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 |
|---|---|---|---|---|---|---|
3952e2b7-623e-43b4-9bc9-7ef6395d78c8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-10 15:16:59", "repo_name": "HelloNYAC/FinalProject_CST2335", "sub_path": "/app/src/main/java/com/finalproject_cst2335/trivia/TriviaEmptyActivity.java", "file_name": "TriviaEmptyActivity.java", "file_ext": "java", "file_size_in_byte": 988, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "27e1757e3c08bd9f525ecddb4f0afadb744bc9be", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/HelloNYAC/FinalProject_CST2335 | 196 | FILENAME: TriviaEmptyActivity.java | 0.253861 | package com.finalproject_cst2335.trivia;
import android.app.Activity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.finalproject_cst2335.R;
public class TriviaEmptyActivity extends AppCompatActivity {
@Override
/**
* To pass bundle with data to fragement
*/
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tg_acitivity_empty);
Bundle tg_dataToPass = getIntent().getExtras(); //get the data that was passed from FragmentExample
//This is copied directly from FragmentExample.java lines 47-54
TriviaDetailsFragment tg_dFragment = new TriviaDetailsFragment();
tg_dFragment.setArguments( tg_dataToPass ); //pass data to the the fragment
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.tg_fragmentLocation, tg_dFragment)
.commit();
}
}
|
a0c2d2f0-8356-48d1-b613-f56b1796cf40 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-14 22:44:20", "repo_name": "Alex-astakhov/IO_Technologies", "sub_path": "/src/main/java/pageObjects/reportPages/LeftMenuBar.java", "file_name": "LeftMenuBar.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "2dfc64c9596a322d68148dd97746d72711194715", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Alex-astakhov/IO_Technologies | 224 | FILENAME: LeftMenuBar.java | 0.259826 | package pageObjects.reportPages;
import core.MethodsFactory;
import org.openqa.selenium.By;
import ru.yandex.qatools.allure.annotations.Step;
public class LeftMenuBar extends MethodsFactory {
private By tvDashboardIcon = By.cssSelector(".fullscreen_icon");
private By homeLeftBar = By.cssSelector("[qa-id='home']");
private By articlesLeftBar = By.cssSelector("[qa-id='articles']");
private By authorsLeftBar = By.cssSelector("[qa-id='authors']");
@Step("Left menu bar: Click on 'TV Dashboard' icon")
public void clickTvDashboard(){
click(tvDashboardIcon);
}
@Step("Left menu bar: Click on 'Home' option")
public void clickHome(){
click(homeLeftBar);
}
@Step("Left menu bar: Click on 'Articles' option")
public void clickArticles(){
click(articlesLeftBar);
}
@Step("Left menu bar: Click on 'Authors' option")
public void clickAuthors(){
click(authorsLeftBar);
}
}
|
b7d76cd1-b84f-4aff-bfa3-93c4c3fcedb9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-17 12:57:27", "repo_name": "anikolv/webteck-ws", "sub_path": "/src/main/java/com/rest/controller/CurrencyController.java", "file_name": "CurrencyController.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "33f7fa6e9e36a408558d2a9c084e40a12fb933fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/anikolv/webteck-ws | 187 | FILENAME: CurrencyController.java | 0.286169 | package com.rest.controller;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import dto.ConvertCurrencyRequestDTO;
@RestController
public class CurrencyController {
@PostMapping(value = "/currency", consumes = MediaType.APPLICATION_XML_VALUE)
public String convertCurrency(@RequestBody ConvertCurrencyRequestDTO request) throws IOException {
String conversionEndpoint = "https://www.google.com/finance/converter?a=" + request.getAmount() +
"&from=" + request.getFromCurrency() + "&to=" + request.getToCurrency();
Document doc = Jsoup.connect(conversionEndpoint).get();
Elements result = doc.select("span.bld");
return result.text().replaceAll("[^\\d.]", "");
}
}
|
fd1feec6-5a0a-41cd-ae95-b1d4016ce3a0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-31 12:52:12", "repo_name": "geeker-lait/user-center", "sub_path": "/lmt-mbsp-user-controller/src/main/java/com/lmt/mbsp/user/controller/ResourcesController.java", "file_name": "ResourcesController.java", "file_ext": "java", "file_size_in_byte": 1038, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "1051f49f83919d1b070c029d73e306fd1f569184", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/geeker-lait/user-center | 190 | FILENAME: ResourcesController.java | 0.221351 | package com.lmt.mbsp.user.controller;
import com.lmt.framework.support.model.message.ResponseMessage;
import com.lmt.framework.support.service.CrudService;
import com.lmt.framework.support.web.controller.CrudController;
import com.lmt.mbsp.user.dto.ResourcesQuery;
import com.lmt.mbsp.user.entity.resources.Resources;
import com.lmt.mbsp.user.service.ResourcesService;
import com.lmt.mbsp.user.vo.resources.ResourcesInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/resource")
public class ResourcesController implements CrudController<Resources,Long,ResourcesQuery,ResourcesInfo> {
@Autowired
private ResourcesService resourcesService;
@Override
public CrudService<Resources, Long> getService() {
return resourcesService;
}
@RequestMapping("config")
public ResponseMessage config(){
return null;
}
}
|
a80ed4b7-b7cd-445e-bc04-c577d7295f56 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-11 13:07:22", "repo_name": "MorkovkAs/auto-sql-migration-tool", "sub_path": "/src/main/java/ru/morkovka/migrationspring/utils/SkypeUtils.java", "file_name": "SkypeUtils.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "defe1756b28d3fe534056f6b780fe3bca5959e22", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MorkovkAs/auto-sql-migration-tool | 260 | FILENAME: SkypeUtils.java | 0.247987 | package ru.morkovka.migrationspring.utils;
import com.samczsun.skype4j.Skype;
import com.samczsun.skype4j.SkypeBuilder;
import com.samczsun.skype4j.exceptions.ConnectionException;
import com.samczsun.skype4j.exceptions.InvalidCredentialsException;
import com.samczsun.skype4j.exceptions.NotParticipatingException;
public class SkypeUtils {
public static final String CHAT_ME = "8:live:anton.android.apps";
private static Skype skype;
private static final String USER_NAME = "";
private static final String PASSWORD = "";
static Skype loginToSkype() throws ConnectionException, InvalidCredentialsException, NotParticipatingException {
if (skype == null) {
skype = new SkypeBuilder(USER_NAME, PASSWORD).withAllResources().withExceptionHandler((errorSource, throwable, willShutdown) -> {
System.out.println("Error: " + errorSource + " " + throwable + " " + willShutdown);
}).build();
skype.login();
skype.subscribe();
System.out.println("Connected");
}
return skype;
}
public static void logoutFromSkype() throws ConnectionException {
skype.logout();
}
}
|
5c86ef05-bffe-4a52-8d24-ac9811ab1505 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-15 19:14:48", "repo_name": "ilasoftwaretesting/GoogleFireFox", "sub_path": "/GoogleFireFox/src/test/java/org/example/MyStepDef.java", "file_name": "MyStepDef.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "687b1ad95384a0df746514c0648e334b7e915329", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ilasoftwaretesting/GoogleFireFox | 241 | FILENAME: MyStepDef.java | 0.279828 | package org.example;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.junit.Assert;
import org.openqa.selenium.By;
public class MyStepDef extends BasePage {
LoginPage loginpage = new LoginPage();
@When("^I enter username \"([^\"]*)\"$")
public void i_enter_username(String Email) {
loginpage.enterEmailAdress(Email);
}
@When("^Click on next Button$")
public void click_on_next_Button() {
loginpage.ClickonSignin();
}
@When("^I enter password \"([^\"]*)\"$")
public void i_enter_password(String arg1) {
}
@When("^I click on login button$")
public void i_click_on_login_button() {
}
@Then("^I am not able to log in successfully and i should see error \"([^\"]*)\"$")
public void i_am_not_able_to_log_in_successfully_and_i_should_see_error(String errormessage) {
Assert.assertEquals(driver.findElement(By.id("headingText")).getText(), errormessage);
System.out.println("error message should be display successfully");
}
} |
f894fba1-7ec7-482e-b4e4-566d41c035a3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-18 16:51:20", "repo_name": "bartgerard/lifestarter", "sub_path": "/server/web/src/main/java/be/gerard/starter/web/PledgeRestController.java", "file_name": "PledgeRestController.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "65d128ee571eb527e4bf10abcaddbaf10d54c437", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bartgerard/lifestarter | 219 | FILENAME: PledgeRestController.java | 0.282196 | package be.gerard.starter.web;
import be.gerard.starter.model.Pledge;
import be.gerard.starter.service.PledgeService;
import be.gerard.starter.service.RegistrationService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import java.util.Map;
/**
* PledgeRestController
*
* @author bartgerard
* @version v0.0.1
*/
@RestController
@RequestMapping("pledges")
@RequiredArgsConstructor
public class PledgeRestController {
private final PledgeService pledgeService;
private final RegistrationService registrationService;
@GetMapping
public Flux<Pledge> pledges() {
final Map<String, Integer> pledgeMap = registrationService.nbGuestsPerPledge();
return pledgeService.findAll()
.map(pledge -> pledge.toBuilder()
.amount(pledgeMap.getOrDefault(pledge.getName(), 0))
.build()
);
}
}
|
74e0ad57-318f-4260-84fe-44fdbc1bf9a1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-04-07T11:47:55", "repo_name": "anton-shikov/Trimmomatic_try", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1216, "line_count": 48, "lang": "en", "doc_type": "text", "blob_id": "36f3ba0be300d90b976b91801fb597fdab7d5513", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/anton-shikov/Trimmomatic_try | 316 | FILENAME: README.md | 0.247987 | # Trimmomatic_try
A simple trimmomatic-like script to trim fastq-files.
## Getting Started
This tool allows you to trim sequences and trimmed file as a result.
### Prerequisites
You need to install python3 with Biopython library to run this tool.
### Installing
To install this tool clone this repository to your PC.
```
~$ git clone https://github.com/anton-shikov/Trimmomatic_try.git
```
## Running and using tool
Using this tool is sa simple as its code is. After downloading repository launch terminal and enter this repository.
Use this following to execute tool:
```
~$ python Trimmomatic_try -isq test.fastq -hd 15 -tl 10 -wn 5 -th 30 -osq test_trimmed.fastq
```
Information about flags:
-isq input sequence fastq file
-hd the size of headcrop (0 for default)
-tl the size of tailcrop (0 for default)
-wn the size of sliding clip (5 for default)
-th base quality thershold (0 for default)
-osq output sequence fastq file
Output format: trimmed sequence in fasq format
## Author
* **Anton Shikov** - *Initial work* - [anton-shikov](https://github.com/anton-shikov)
## License
This project is free and available for everyone.
## Acknowledgments
Eugene Bakin for python course.
|
3af97886-ea1c-49dd-bfaf-b85665fe08d9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-04 15:22:46", "repo_name": "prashantkaushik11/Josh", "sub_path": "/src/main/java/com/josh/model/CourseId.java", "file_name": "CourseId.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "0ec558d1d2fecfeac9a4959a080e5fa43cfffd48", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/prashantkaushik11/Josh | 234 | FILENAME: CourseId.java | 0.252384 | package com.josh.model;
import org.hibernate.validator.constraints.NotEmpty;
import javax.persistence.Embeddable;
import java.io.Serializable;
import java.util.Objects;
@Embeddable
public class CourseId implements Serializable {
@NotEmpty(message = "courseName must not be empty")
private String courseName;
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof CourseId)) return false;
CourseId courseId = (CourseId) o;
return Objects.equals(courseName, courseId.courseName) &&
Objects.equals(year, courseId.year);
}
@Override
public int hashCode() {
return Objects.hash(courseName, year);
}
@NotEmpty(message = "yearName must not be empty")
private String year;
}
|
568a4113-3c21-4e87-84bf-74045414852c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-08 10:33:01", "repo_name": "yinzongchang/spring_transaction", "sub_path": "/src/main/java/com/yinzo/jichu/ReflectUtil.java", "file_name": "ReflectUtil.java", "file_ext": "java", "file_size_in_byte": 1182, "line_count": 40, "lang": "zh", "doc_type": "code", "blob_id": "4a2a9f695eb6c0566adbfa266e3976e3bca76012", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yinzongchang/spring_transaction | 249 | FILENAME: ReflectUtil.java | 0.268941 | package com.yinzo.jichu;
import java.lang.reflect.Method;
/**
* 通用的反射工具类
*
* Title: ReflectUtil.java<br>
* Description: <br>
* Copyright: Copyright (c) 2015<br>
* Company: 北京云杉世界信息技术有限公司<br>
*
* @author undyliu 2015年11月13日
*/
public class ReflectUtil {
public static <T> T cloneFrom(Object obj, Class<T> clazz) {
try {
T result = clazz.newInstance();
Class objClass = obj.getClass();
Method[] methods = objClass.getDeclaredMethods();
for (Method method : methods) {
String name = method.getName();
if (name.startsWith("get")) {
String subName = name.substring(3);
try {
Method m = clazz.getMethod("set" + subName, method.getReturnType());
m.invoke(result, method.invoke(obj, null));
} catch (Exception e) {
//do nothing
}
}
}
return result;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
|
489d218e-d246-4542-a90e-a684891d0dcb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-04 21:51:28", "repo_name": "emilpyp/studentDB", "sub_path": "/Executor/src/main/java/models/Subject.java", "file_name": "Subject.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "c8337aeea571d5f8357effc28b436cd692cbc4a7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/emilpyp/studentDB | 230 | FILENAME: Subject.java | 0.259826 | package models;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Objects;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "subjects")
public class Subject {
@Id
@Column(name = "teacher_id")
private Long id;
private String subject_name;
@JsonBackReference
@OneToOne(mappedBy = "")
@MapsId
@JoinColumn(name = "teacher_id")
private Teacher teacher;
@Override
public String toString() {
return "Subject{" +
"id=" + id +
", subject_name='" + subject_name + '\'' +
", teacher=" + teacher.getFirstname() +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Subject subject = (Subject) o;
return id.equals(subject.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
} |
b98492dd-36e2-4160-b24b-a511f1589339 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-17 14:33:54", "repo_name": "hehaihao/Test", "sub_path": "/project/block_browser/src/main/java/com/xm6leefun/block_browser/home/mvp/BlockBrowserHomeModelImp.java", "file_name": "BlockBrowserHomeModelImp.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "33d0fe491bcbb586e6c48251ab43fe8215bd3dd3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hehaihao/Test | 242 | FILENAME: BlockBrowserHomeModelImp.java | 0.271252 | package com.xm6leefun.block_browser.home.mvp;
import com.xm6leefun.block_browser.api.BlockBrowserApiService;
import io.reactivex.Observable;
/**
* @Description:
* @Author: cyh
* @CreateDate: 2021/4/14
*/
public class BlockBrowserHomeModelImp implements BlockBrowserHomeContract.IModel{
private BlockBrowserApiService apiService;
public static final int LIMIT = 3;
public static final int PAGE = 1;
public BlockBrowserHomeModelImp(BlockBrowserApiService apiService) {
this.apiService = apiService;
}
@Override
public Observable<?> getStatics() {
return apiService.getBlockBrowserHomeData();
}
@Override
public Observable<?> getBlockList() {
return apiService.getBlockBrowserBlockList(LIMIT,PAGE);
}
@Override
public Observable<?> getTradeList() {
return apiService.getBlockBrowserTradeList(0,LIMIT,PAGE);
}
@Override
public Observable<?> search(String search) {
return apiService.getBlockBrowserSearchDetail(search,LIMIT,PAGE);
}
}
|
74034c0e-c49b-4baa-9b64-068fb72e3329 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-19 01:07:54", "repo_name": "katalinkovacs/MyDropwizard", "sub_path": "/src/main/java/resources/DoSomethingResource.java", "file_name": "DoSomethingResource.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "5aedef453958d0154b51f4cfac6c6188487497ea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/katalinkovacs/MyDropwizard | 236 | FILENAME: DoSomethingResource.java | 0.26588 | package resources;
import representation.DoSomething;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.io.IOException;
@Path("/dosomething")
@Produces(MediaType.APPLICATION_JSON)
public class DoSomethingResource {
private String doing;
private String something;
public DoSomethingResource(String doing, String something){
this.doing = doing;
this.something = something;
}
public String getDoing() {
return doing;
}
public void setDoing(String doing) {
this.doing = doing;
}
public String getSomething() {
return something;
}
public void setSomething(String something) {
this.something = something;
}
@GET
public DoSomething doSomething() throws IOException {
// return new DoSomething("cooking" , "dinner");
return new DoSomething("cooking", "dinner");
}
@GET
@Path("/singing")
public DoSomething doSomethingSing() throws IOException {
return new DoSomething("singing", something);
}
}
|
3e5e3e3d-b2c1-4b60-a8b4-c0fea4b5d725 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-03-17 15:46:34", "repo_name": "masaya1507/google-guice-sample", "sub_path": "/src/main/java/jp/projects/miya/google_guice_sample/module/GuiceModule.java", "file_name": "GuiceModule.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "81bbc93ec27df5f903db86092ff9f14e6a9184a9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/masaya1507/google-guice-sample | 238 | FILENAME: GuiceModule.java | 0.29584 | package jp.projects.miya.google_guice_sample.module;
import jp.projects.miya.google_guice_sample.annotation.AopLogging;
import jp.projects.miya.google_guice_sample.component.IComponent;
import jp.projects.miya.google_guice_sample.component.SampleComponent;
import jp.projects.miya.google_guice_sample.interceptor.LoggingInterceptor;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.matcher.Matchers;
/**
* Class: GuiceModule
*
* @author masaya1507
*
*/
public class GuiceModule extends AbstractModule {
/**
*
*/
@Inject
private IComponent component;
/**
*
* @return
*/
public IComponent getComponent() {
return component;
}
/**
*
* @param component
*/
public void setComponent(IComponent component) {
this.component = component;
}
/**
*
*/
@Override
protected void configure() {
bind(IComponent.class).to(SampleComponent.class);
bindInterceptor(Matchers.any(), Matchers.annotatedWith(AopLogging.class), new LoggingInterceptor());
}
}
|
c488f6fd-7d76-40d0-b819-fcd27f23d658 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-12-16 19:03:28", "repo_name": "itakenami/rest-swing", "sub_path": "/src/main/java/swing/ui/form/Combo.java", "file_name": "Combo.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "27da0296881260c16b43bcb0d15e2d0d1d499876", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/itakenami/rest-swing | 223 | FILENAME: Combo.java | 0.291787 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package swing.ui.form;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JComboBox;
import swing.model.DefaultModel;
/**
*
* @author itakenami
*/
public class Combo extends JComboBox implements FormComponent {
List<Long> list;
public Combo(List<? extends DefaultModel> models, String def){
list = new ArrayList<Long>();
String[] lst_itens = new String[models.size()];
int idx = 0;
for (int x=0;x<models.size();x++) {
DefaultModel dm = models.get(x);
list.add(dm.getId());
lst_itens[x] = dm.toString();
if(lst_itens[x].equals(def)){
idx = x;
}
}
this.setModel(new javax.swing.DefaultComboBoxModel(lst_itens));
this.setSelectedIndex(idx);
}
@Override
public Object getUserValue() {
return list.get(this.getSelectedIndex()).toString();
}
}
|
78c69333-2081-4be2-a3a9-2d10dd3d0713 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-17 00:39:53", "repo_name": "aliKhan94/sdet", "sub_path": "/TestNG/Activity1.java", "file_name": "Activity1.java", "file_ext": "java", "file_size_in_byte": 1216, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "8d2cdcc81ac6f78dd23365080920cfc2e93a63c3", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aliKhan94/sdet | 255 | FILENAME: Activity1.java | 0.279042 | package testNGTest;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class Activity1 {
WebDriver driver;
WebDriverWait wait;
@BeforeMethod
public void beforeMethod() {
//create a new instance of the Firefox driver
driver = new FirefoxDriver();
wait = new WebDriverWait(driver, 10);
driver.get("https://www.training-support.net");
}
@Test
public void exampleTestCase() {
String title = driver.getTitle();
System.out.println("Page tile is: " + title);
Assert.assertEquals(title, "Training Support");
driver.findElement(By.id("about-link")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//h1[text()='About Us']")));
title = driver.getTitle();
System.out.println("Page tile is: " + title);
Assert.assertEquals(title, "About Training Support");
}
@AfterMethod
public void afterMethod() {
driver.close();
}
}
|
743f677f-7010-4dbb-98e3-1458f0ac1b68 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-05-20 01:16:36", "repo_name": "wz2cool/canal-utils", "sub_path": "/src/main/java/com/github/wz2cool/canal/utils/generator/Db2SqlTemplateGenerator.java", "file_name": "Db2SqlTemplateGenerator.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "b88c1da3814f3e13b40e78a707a08afe78689126", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/wz2cool/canal-utils | 249 | FILENAME: Db2SqlTemplateGenerator.java | 0.229535 | package com.github.wz2cool.canal.utils.generator;
import com.github.wz2cool.canal.utils.converter.BaseAlterSqlConverter;
import com.github.wz2cool.canal.utils.converter.IValuePlaceholderConverter;
import com.github.wz2cool.canal.utils.converter.db2.Db2AlterSqlConverter;
import com.github.wz2cool.canal.utils.converter.db2.Db2ValuePlaceholderConverter;
import com.github.wz2cool.canal.utils.model.DatabaseDriverType;
/**
* DB2 sql 模板生成器
*
* @author Frank
*/
public class Db2SqlTemplateGenerator extends AbstractSqlTemplateGenerator {
private final Db2AlterSqlConverter db2AlterSqlConverter = new Db2AlterSqlConverter();
private final Db2ValuePlaceholderConverter db2ValuePlaceholderConverter = new Db2ValuePlaceholderConverter();
@Override
protected IValuePlaceholderConverter getValuePlaceholderConverter() {
return this.db2ValuePlaceholderConverter;
}
@Override
protected BaseAlterSqlConverter getAlterSqlConverter() {
return this.db2AlterSqlConverter;
}
@Override
public DatabaseDriverType getDatabaseDriverType() {
return DatabaseDriverType.DB2;
}
}
|
9adfd749-243d-4d18-818e-514dd45f7c2e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-07 09:20:12", "repo_name": "Saukonoja/Mobile-Module", "sub_path": "/Mobile-Project/SignalStrength/app/src/main/java/fi/jamk/signalstrength/HttpRequestTask.java", "file_name": "HttpRequestTask.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "6b8bdc29dfcfb7936308585de637a35f772b3016", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Saukonoja/Mobile-Module | 232 | FILENAME: HttpRequestTask.java | 0.290176 | package fi.jamk.signalstrength;
import android.os.AsyncTask;
import android.util.Log;
import static java.util.UUID.randomUUID;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestTemplate;
import java.util.Date;
import java.util.UUID;
import java.util.zip.DataFormatException;
// This class is responsible for sending POST requests to rest
public class HttpRequestTask extends AsyncTask<DataLocation, Void, DataLocation> {
DataLocation dl;
String uri;
public HttpRequestTask(DataLocation dl, String uri){
this.dl = dl;
this.uri = uri;
}
@Override
protected DataLocation doInBackground(DataLocation... params ) {
try {
RestTemplate restTemplate = new RestTemplate();
restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
DataLocation dl1 = restTemplate.postForObject(uri, dl, DataLocation.class);
return dl1;
} catch (Exception e) {
Log.e("MainActivity", e.getMessage(), e);
}
return null;
}
@Override
protected void onPostExecute(DataLocation dl) {
}
}
|
5c6cfa35-475b-497f-9339-b23b6471f5c4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-23 14:42:16", "repo_name": "jinhak94/kh-arduino", "sub_path": "/HelloArduino/src/com/kh/arduino/controller/TestServlet.java", "file_name": "TestServlet.java", "file_ext": "java", "file_size_in_byte": 1089, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "88cda36c7e37f07ee80734dd63881478898747e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jinhak94/kh-arduino | 212 | FILENAME: TestServlet.java | 0.23231 | package com.kh.arduino.controller;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/test")
public class TestServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//0. encoding처리
request.setCharacterEncoding("utf-8");
//1. 사용자 입력값 처리
String name = request.getParameter("name");
int num = Integer.parseInt(request.getParameter("num"));
System.out.println(request.getMethod());
System.out.println("name = " + name);
System.out.println("num = " + num);
//2. 업무로직
//3. 응답처리
response.getWriter().print(1);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request,response);
}
}
|
8d7c63fe-e59f-4d54-bdb2-b7424c7a9bef | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-21 18:33:18", "repo_name": "fmorris2/viking-api", "sub_path": "/src/viking/api/questing/Questing.java", "file_name": "Questing.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "8d22aa068f5e2e8ab747d3af7a38d52e59c8aeac", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fmorris2/viking-api | 234 | FILENAME: Questing.java | 0.287768 | package viking.api.questing;
import org.osbot.rs07.api.ui.RS2Widget;
import viking.api.Timing;
import viking.framework.VMethodProvider;
/**
* Created by Sphiinx on 1/19/2017.
*/
public class Questing extends VMethodProvider {
private final int QUEST_COMPLETION_INTERFACE = 277;
private final int QUEST_COMPLETION_CLOSE_INTERFACE = 15;
/**
* Closes the quest completion dialogue.
*
* @return True if the quest completion dialogue was successfully closed; false otherwise.
* */
public boolean closeQuestCompletion() {
final RS2Widget QUEST_CLOSE_BUTTON = widgets.get(QUEST_COMPLETION_INTERFACE, QUEST_COMPLETION_CLOSE_INTERFACE);
if (QUEST_CLOSE_BUTTON == null)
return true;
if (QUEST_CLOSE_BUTTON.interact())
return Timing.waitCondition(() -> widgets.get(QUEST_COMPLETION_INTERFACE, QUEST_COMPLETION_CLOSE_INTERFACE) == null, 150, random(2000, 2500));
return false;
}
}
|
41b669b3-3782-43b0-b59f-cfc064b302db | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-02 07:36:24", "repo_name": "2016hsir/myRepository", "sub_path": "/app/src/main/java/com/example/hxf/day28customlistview/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "4d110b9bbd374064801bea832a43b46c4fb6e2a3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/2016hsir/myRepository | 250 | FILENAME: MainActivity.java | 0.275909 | package com.example.hxf.day28customlistview;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ArrayAdapter;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
List<String> datas;
String[] strings={
"A","B","C","D","E","F","G","H","I","J","K","L","M",
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z"
};
MyList myList;
ArrayAdapter<String> adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myList= (MyList) findViewById(R.id.listviewId);
// initView();
initData();
adapter=new ArrayAdapter<String>(getApplicationContext(),R.layout.item_listview);
}
private void initView() {
}
private void initData() {
datas=new ArrayList<String>();
for (int i = 0; i < 100; i++) {
datas.add(strings[(int) (Math.random()*strings.length)]+"天道");
}
}
}
|
1503ee0a-6933-415d-b690-915f4217f4c9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-03-03T02:30:26", "repo_name": "FooBartn/Ucs-Puptr", "sub_path": "/docs/Invoke-PuptrTest.md", "file_name": "Invoke-PuptrTest.md", "file_ext": "md", "file_size_in_byte": 1130, "line_count": 43, "lang": "en", "doc_type": "text", "blob_id": "383859c5ec5e429b2a57b839a694a1777d94bd19", "star_events_count": 5, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/FooBartn/Ucs-Puptr | 261 | FILENAME: Invoke-PuptrTest.md | 0.259826 | This is where all the magic happens.
...
Actually it's just a wrapper for Pester, built to run against a specified set of tests/configurations
# Running Ucs-Puptr
> Note: This requires a configuration to exist
Let's assume you have your Prod configuration, you want to run all of the tests against it, but you do not
want to remediate anything.
```PowerShell
Invoke-PuptrTest -ConfigName Prod
```
That's it. That will run all of the enabled tests on your configuration.
Want to remediate?
```PowerShell
Invoke-PuptrTest -ConfigName Prod -Remediate
```
It also supports all of these standard Pester parameters:
.PARAMETER TestName
Informs Invoke-Pester to only run Describe blocks that match this name.
.PARAMETER Tag
Informs Invoke-Pester to only run Describe blocks tagged with the tags specified. Aliased 'Tags' for backwards
compatibility.
.PARAMETER ExcludeTag
Informs Invoke-Pester to not run blocks tagged with the tags specified.
.PARAMETER OutputFormat
OutputFile format
Options: LegacyNUnitXml, NUnitXml
.PARAMETER OutputFile
Location to dump pester results in format: $OutputFormat |
95e39a52-b821-4304-951c-bd9871f8c12b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-05 02:06:32", "repo_name": "CoricovMA/JSeek", "sub_path": "/src/main/java/org/jseek/response/Response.java", "file_name": "Response.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "3c8b28c2491c584249acde87e8b1b77bf6e9495d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CoricovMA/JSeek | 221 | FILENAME: Response.java | 0.23231 | package org.jseek.response;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.jseek.config.JSeekConfig;
import org.jseek.requests.Request;
public abstract class Response {
private MessageReceivedEvent event;
private Request parentRequest;
private EmbedBuilder eb = new EmbedBuilder();
public static String [] availableCommands = (String []) JSeekConfig.getInstance().getProperties().get("commands");
Response(MessageReceivedEvent event){
this.event = event;
}
public void send() {
event.getChannel().sendMessage("This command has not yet been implemented.").queue();
}
protected MessageReceivedEvent getEvent(){
return this.event;
}
protected void setEvent(MessageReceivedEvent event){
this.event = event;
}
public void setParentRequest(Request request){
this.parentRequest = request;
}
public Request getParentRequest(){
return this.parentRequest;
}
public EmbedBuilder getEmbedBuilder(){
return this.eb;
}
}
|
252a3a42-25ce-449d-9973-1c259c1f11bb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-26 13:32:34", "repo_name": "longnutrasweet/springcloud", "sub_path": "/eureka-gateway-5003/src/main/java/com/nutrasweet/jackson/TestJackson.java", "file_name": "TestJackson.java", "file_ext": "java", "file_size_in_byte": 1220, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "1a5ccbbbd492171b752dbd0c16f83962a6d837fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/longnutrasweet/springcloud | 224 | FILENAME: TestJackson.java | 0.242206 | package com.nutrasweet.jackson;
import com.fasterxml.jackson.core.JsonEncoding;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.File;
import java.io.IOException;
import java.util.Map;
public class TestJackson {
public static void main(String[] args) throws IOException {
Teacher teacher = new Teacher();
teacher.setName("aaa");
Student student = new Student();
student.setName("bbb");
student.getAttrMap().put("age","11");
teacher.getStudents().add(student);
ObjectMapper objectMapper = new ObjectMapper();
String json = objectMapper.writeValueAsString(teacher);
Map tragetTeacher = objectMapper.readValue(json, Map.class);
//流式api
JsonFactory jsonFactory = new JsonFactory();
JsonGenerator generator=jsonFactory.createGenerator(new File("e://test.json"),JsonEncoding.UTF8);
generator.writeStartObject();
generator.writeStringField("name","333");
generator.writeEndObject();
generator.close();
}
}
|
6bcbfb33-f8bf-4629-9628-b89e2833acdc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-02-16T14:33:26", "repo_name": "levatas-agency/engineering", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1133, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "be07cbe647910428d52882292203342a2710fbbe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/levatas-agency/engineering | 236 | FILENAME: README.md | 0.256832 | # Engineering handbook
At Levatas, our Engineering team is a fundamental part of the success of our company. For us to understand what's important, to guide the decisions we make every day, and to help us grow and create the future we want to develop, we put together this handbook consisting of the following sections:
* [Our values](values.md)
* [Roles and responsibilities](roles-responsibilities.md)
* [Advancement opportunities](advancement-opportunities.md)
* [Engineering workflow](engineering-workflow.md)
We use these principles and guides to ensure our performance upholds our standards of excellence, and for those that go above and beyond, we keep their names in a special place:
* [Acknowledgements](acknowledgements.md)
Also, [here is a list of resources](resources.md) we want to make sure all our team has access to (and read and watch, of course).
More on the technical side, we also keep the following resources that specify how we approach different problems related to our daily work:
* [Estimating Projects](estimating-projects.md)
* [Website Development and Deployment Checklist](websites-checklist.md)
|
470e36f1-7d89-4632-a920-637809af39af | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-17T18:32:33", "repo_name": "feliciaaurelia/KAMPUSMERDEKA_SDETIntern_TestCase_FeliciaAureliaS", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1215, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "c61aef5bb98a01a87d7ca27417628bea39811e51", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/feliciaaurelia/KAMPUSMERDEKA_SDETIntern_TestCase_FeliciaAureliaS | 291 | FILENAME: README.md | 0.294215 | Web automation script was made using Katalon Studio as the automation tools that I choose.
Automated testing is divided into 2 test cases, a one-time flight and a round-trip flight.
Work files are uploaded in .rar format.
Testing is carried out starting from entering the tiket.com website, choosing a flight, choosing an airline, until payment without logging in/registering.
The method I use when creating automated testing using Katalon Studio is the script method.
Here are the steps on how to run the automation script:
1. Download the file named "KAMPUSMERDEKA_SDETIntern_TestCase_FeliciaAureliaS.rar".
2. Extract file.
3. Using Katalon Studio to open the project.
4. File -> Open project -> Select Folder named "KAMPUSMERDEKA_SDETIntern_TestCase_FeliciaAureliaS".
5. Inside the test case folder, there are 2 test cases namely FlightPulangPergi_Test and FlightSekaliJalan_Test.
6. Click test case that want to be execute.
7. To see the script code, click the "script" button at the bottom of the work sheet.
8. To run the script code, click run at the top or using Ctrl + Shift + A.
9. Automated testing will be automatically running via the main browser.
Notes: The script code is in the test case folder.
|
99c56ff0-91e5-418f-8e36-cad15e6ae972 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-02-15 04:13:26", "repo_name": "wcyz666/libapp", "sub_path": "/src/com/example/libapp/LibActivity.java", "file_name": "LibActivity.java", "file_ext": "java", "file_size_in_byte": 1232, "line_count": 68, "lang": "en", "doc_type": "code", "blob_id": "7473cb8e323bea67ef83797abb33fae191c770d0", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wcyz666/libapp | 249 | FILENAME: LibActivity.java | 0.252384 | package com.example.libapp;
import java.net.URL;
import java.text.DateFormat;
import java.util.Date;
public class LibActivity {
private String eventTitle;
private URL contentURL;
private Date date;
private String datestring;
public LibActivity()
{
eventTitle = new String("");
}
public void setTitle(String s)
{
eventTitle = s;
}
public String getTitle()
{
return eventTitle;
}
public void setURL(String url)
{
try
{
contentURL = new URL(url);
}
catch (Exception e){}
}
public void setDate(String s)
{
try
{
datestring = new String(s);
date = DateFormat.getDateInstance().parse(s);
}
catch (Exception e)
{
date = new Date();
}
}
public Date getDate()
{
return this.date;
}
public String getDateString()
{
return this.datestring;
}
public URL getURL()
{
return contentURL;
}
public String getURLString()
{
return contentURL.toString();
}
}
|
57e08a94-bcb0-4c45-982a-57ae39ccc6c3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-10-09 20:03:43", "repo_name": "arollavengers/backend-java", "sub_path": "/backend-core/src/main/java/arollavengers/core/events/pandemic/FirstPlayerDesignatedEvent.java", "file_name": "FirstPlayerDesignatedEvent.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "ecc964bfbf272b23ef895adeef841891cf4e6ea5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/arollavengers/backend-java | 233 | FILENAME: FirstPlayerDesignatedEvent.java | 0.249447 | package arollavengers.core.events.pandemic;
import arollavengers.core.domain.pandemic.MemberKey;
import arollavengers.core.infrastructure.Id;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonTypeInfo;
/**
* @author <a href="http://twitter.com/aloyer">@aloyer</a>
*/
public class FirstPlayerDesignatedEvent implements MemberEvent {
@JsonProperty
private final Id worldId;
@JsonProperty
private final MemberKey memberKey;
@JsonCreator
public FirstPlayerDesignatedEvent(@JsonProperty("worldId") Id worldId,
@JsonProperty("memberKey") MemberKey memberKey)
{
this.worldId = worldId;
this.memberKey = memberKey;
}
public MemberKey memberKey() {
return memberKey;
}
@Override
public Id entityId() {
return worldId;
}
@Override
public String toString() {
return "FirstPlayerDesignatedEvent[" + entityId() +
", " + memberKey +
"]";
}
}
|
383faa52-d502-45d5-8a8c-3d6583000c69 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-14 14:48:35", "repo_name": "li-yong-jie/1114-springcloud", "sub_path": "/1109-provider-management/1112-hystrix/src/main/java/com/aaa/jie/springcloud/controller/UserController.java", "file_name": "UserController.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "380a64f6fca8d789bed0b4c3c582f2ef25d31603", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/li-yong-jie/1114-springcloud | 243 | FILENAME: UserController.java | 0.218669 | package com.aaa.jie.springcloud.controller;
import com.aaa.jie.springcloud.Model.User;
import com.aaa.jie.springcloud.UserService.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author 李永杰
* @Date 2019/11/12 23:43
**/
@RestController
public class UserController {
@Autowired
private UserService userService;
@RequestMapping("/all")
// @HystrixCommand(fallbackMethod ="selectAlls" )
public List<User> selectAll() throws Exception {
List<User> users = userService.selectAll();
if(users.size()>0){
throw new Exception("错误 错误");
}
return null;
}
/* public List<User> selectAlls(){
List<User> list = new ArrayList<User>();
User user = new User();
user.setUsername("网络延迟,请稍后再试");
user.setId(10000);
list.add(user);
return list;
}*/
}
|
8da961c0-af6e-4c25-bb59-4676046cb46b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-07 09:56:11", "repo_name": "jwee0330/jwp-was", "sub_path": "/src/test/java/http/RequestLineParserTest.java", "file_name": "RequestLineParserTest.java", "file_ext": "java", "file_size_in_byte": 1227, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "fd2749d64b3d03761c49ed58e20dec759b7e49e3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jwee0330/jwp-was | 291 | FILENAME: RequestLineParserTest.java | 0.283781 | package http;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
class RequestLineParserTest {
@Test
public void parseGet() {
RequestLine requestLine = RequestLineParser.parse("GET /users HTTP/1.1");
assertThat(requestLine).isEqualTo(RequestLine.of("GET", "/users", "HTTP/1.1"));
assertThat(requestLine.getProtocol()).isEqualTo("HTTP/1.1");
}
@Test
public void parsePost() {
RequestLine requestLine = RequestLineParser.parse("POST /users HTTP/1.1");
assertThat(requestLine).isEqualTo(RequestLine.of("POST", "/users", "HTTP/1.1"));
assertThat(requestLine.getProtocol()).isEqualTo("HTTP/1.1");
}
@Test
public void queryString() {
String source = "GET /users?userId=javajigi&password=password&name=JaeSung HTTP/1.1";
RequestLine requestLine = RequestLineParser.parse(source);
}
@Test
public void 학습테스트() {
String source = "/users?userId=javajigi&password=password&name=JaeSung";
final String[] pathValues = source.split("//?");
final String queryStrings = pathValues[1];
assertThat(pathValues.length).isEqualTo(2);
}
}
|
90e99b8f-2def-43bb-986b-25fbbf85f7dc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-05 12:40:02", "repo_name": "NazarYunko/TT", "sub_path": "/src/sample/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "cbab080a469fc70a0d81cc09e886863d8a2b5980", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NazarYunko/TT | 188 | FILENAME: Main.java | 0.249447 | package sample;
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import sample.controller.Controller;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("view/mainView.fxml"));
primaryStage.setTitle("TT");
primaryStage.setResizable(false);
primaryStage.setScene(new Scene(root, 600, 550));
primaryStage.show();
// primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
// @Override
// public void handle(WindowEvent event) {
// Controller.stopThread();
// }
// });
primaryStage.setOnCloseRequest((WindowEvent event) -> Controller.stopThread());
}
public static void main(String[] args) {
launch(args);
}
}
|
e0eb8c0e-e45c-49cf-b5ef-44b593fcae23 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-05-24 03:57:25", "repo_name": "castrolle/sitp", "sub_path": "/LocationFromGPS/src/in/wptrafficanalyzer/locationfromgps/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "5ebb4db4868392a192962ed4071fe0b2430369df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/castrolle/sitp | 225 | FILENAME: MainActivity.java | 0.27048 | package in.wptrafficanalyzer.locationfromgps;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btn_ok = (Button) findViewById(R.id.ok);
// Listening to News Feed button click
btn_ok.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
EditText txtIdBus = (EditText)findViewById(R.id.txtBus);
String busId = txtIdBus.getText().toString();
EditText txtServer = (EditText)findViewById(R.id.txtServer);
String url = txtServer.getText().toString();
// Launching News Feed Screen
Intent i = new Intent(getApplicationContext(), GPSActivity.class);
i.putExtra("busId", busId);
i.putExtra("url", url);
startActivity(i);
}
});
}
} |
dd8699dd-2ba6-48e6-aa60-ff065b93cc5a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-08 23:49:43", "repo_name": "dev-alves/flashmeeting-tdd-iteris", "sub_path": "/src/main/java/com/tdd/services/PersonService.java", "file_name": "PersonService.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "1ee448bd2dc7f485c0a01f831908cf70040d9a7a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dev-alves/flashmeeting-tdd-iteris | 195 | FILENAME: PersonService.java | 0.275909 | package com.tdd.services;
import com.tdd.domain.entities.Person;
import com.tdd.domain.exceptions.BirthDateException;
import com.tdd.domain.exceptions.PersonNotFoundException;
import com.tdd.repositories.PersonRepository;
import com.tdd.utils.AgeUtils;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.BooleanUtils;
import org.springframework.stereotype.Service;
@Service
@RequiredArgsConstructor
public class PersonService {
private final PersonRepository repository;
public Person save(Person entity){
AgeUtils ageUtils = new AgeUtils();
entity.setAge(Integer.toUnsignedLong(ageUtils.getAgeByBirthDate(entity.getNascDate())));
if (BooleanUtils.isFalse(ageUtils.isOfLegalAge(entity.getAge().intValue())))
throw new BirthDateException("Pessoa não tem idade para se inscrever");
return repository.save(entity);
}
public Person findById(Long id) {
return repository.findById(id).orElseThrow(PersonNotFoundException::new);
}
}
|
b7c3fe21-11b1-4add-a68a-5114edb85d28 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-20 07:25:50", "repo_name": "prabhatomer/POC", "sub_path": "/src/main/java/hibernate/StoreSendMail.java", "file_name": "StoreSendMail.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "ce12e73b60701db74c5ac729b2bdcf9d19d18903", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/prabhatomer/POC | 231 | FILENAME: StoreSendMail.java | 0.255344 | package hibernate;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
public class StoreSendMail {
public String storeMail(String to, String subject, String message) {
Configuration cfg = new Configuration().configure("hibernate.cfg.xml");
SessionFactory factory = cfg.buildSessionFactory();
Transaction tx = null;
long millis = System.currentTimeMillis();
java.sql.Date date = new java.sql.Date(millis);
try {
Session session = factory.openSession();
tx = session.beginTransaction();
SendMailPojo SMP = new SendMailPojo();
SMP.setMailid(1);
SMP.setTo("ds");
SMP.setSubject("sds");
SMP.setMessage("sdsdssdsd");
SMP.setDate(date);
session.save(SMP);
tx.commit();
return "true";
} catch (HibernateException e) {
System.err.print(e);
if (tx != null)
tx.rollback();
return "false";
}
}
}
|
0a0d5f1f-5166-4005-9a19-59c392d68ec3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-12-19T16:27:18", "repo_name": "edwardstock/httb", "sub_path": "/RELEASE.md", "file_name": "RELEASE.md", "file_ext": "md", "file_size_in_byte": 984, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "0d35229ad728c909b6c0bd0977fe8d5897caa822", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/edwardstock/httb | 229 | FILENAME: RELEASE.md | 0.245085 | # Release notes
## 1.0.1
- Added support for request mocking
- Temporary, tests will work on mock request instead of server. In future, custom web server will be integrated
- Added support for MSVC
- Added support to build shared library and DLL
## 1.0.0
- Stable release
- Refactored code and used c++17 standard (partially)
- Fixed blocking execution, now using beast executor timer
- Added methods to remove and clear headers and query parameters
- Fixed consistency while adding headers: now container checks for existent header, and overwrite value for it, otherwise insert with lowercase name
- Hidden non-api headers and functions
- Added boost::optional return type for find_* methods
## 0.4.2
- Using clang-format for code-style
- Updated toolbox dependency
## 0.4.1
- Fixed building parameters for post body
- Fixed undefined reference for `body_string`
## 0.4.0
- Added progress callback
- Added batch request
- Fixed files downloading
- Refactoring |
71bbe435-726b-49f2-952f-a4ca0b80fc41 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-04 07:33:33", "repo_name": "renddel/Car-leasing", "sub_path": "/src/main/java/com/carLease/carLease/controller/CreditApplicationController.java", "file_name": "CreditApplicationController.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "d9c6c78716ddf8a4f975bda00585f56ff5209023", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/renddel/Car-leasing | 213 | FILENAME: CreditApplicationController.java | 0.272799 | package com.carLease.carLease.controller;
import com.carLease.carLease.model.CreditApplication;
import com.carLease.carLease.service.CreditApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api")
public class CreditApplicationController {
@Autowired
CreditApplicationService creditApplicationService;
@GetMapping(value = "/credit-application/{id}")
public CreditApplication getCreditApplication(@PathVariable("id") Long id) {
return creditApplicationService.getOne(id);
}
@GetMapping(value = "/credit-application")
public List<CreditApplication> getCreditApplications() {
return creditApplicationService.getAll();
}
@PostMapping(
value = "/credit-application",
produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE
)
public CreditApplication createCreditApplication(@RequestBody final CreditApplication creditApplication) {
return creditApplicationService.save(creditApplication);
}
}
|
21a40948-fca2-458e-9c50-e55933f6a7aa | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-20 13:23:42", "repo_name": "morgande51/trivia-app", "sub_path": "/trivia-service/src/main/java/com/nge/triviaapp/security/UserDetails.java", "file_name": "UserDetails.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "099c6ec8c7f54129d1b95d789264cc548420493a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/morgande51/trivia-app | 243 | FILENAME: UserDetails.java | 0.26588 | package com.nge.triviaapp.security;
import java.io.Serializable;
import javax.json.JsonObject;
import javax.json.JsonString;
import javax.json.bind.annotation.JsonbTransient;
import com.nge.triviaapp.domain.Contestant;
import lombok.Data;
@Data
public class UserDetails implements Serializable {
private String[] userRoles;
@JsonbTransient
private Contestant contestant;
public UserDetails(JsonObject userData) {
super();
contestant = new Contestant();
// contestant.setEmail(userData.getString("userEmail").toUpperCase());
// contestant.setPasswordHash(userData.getString("userPwd"));
// contestant.setFirstName(userData.getString("firstName", "John"));
// contestant.setLastName(userData.getString("lastName", "Doe"));
// userRoles = userData.getJsonArray("userRoles").stream()
// .map(r -> ((JsonString) r).getString())
// .toArray(i -> new String[i]);;
}
public String getUserEmail() {
return contestant.getEmail();
}
@JsonbTransient
public String getUserPwd() {
return contestant.getPasswordHash();
}
private static final long serialVersionUID = 1L;
} |
4439a768-a32e-414a-9935-9d7bdd3ff62e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-03-16T22:37:15", "repo_name": "radytheprogrammer/QuotesOnDev", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1132, "line_count": 49, "lang": "en", "doc_type": "text", "blob_id": "ea62c978e86556b8741b402abc6d5a7d6316b489", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/radytheprogrammer/QuotesOnDev | 270 | FILENAME: README.md | 0.286968 | # QuotesOnDev
Sample API call using RESTapi from the client computer
$(function() {
//this is your event listener
$('.randomQuote').on('click', function(e)
$.ajax({
method: 'get',
url:
red_vars.rest_url + 'wp/v2/posts?filter[orderby]=rand&filter[posts_per_page]=10'
}).done(function(data) {
console.log(data);
});
});
});
})(jQuery);
# C.R.U.D
Create, read, update and delete
method: 'get' translates to read data from the user's browser and evaluate that to query the databse for a new post
#document.ready function syntax. Used if you want to write jQuery code to handle an event listening
(function($) {
} ) (jQuery);
#Learnings
- Ajax is an asynchronous call to the API that returns a data object
- nonces are a security feature and are the new way of validationg an API request by a user
- WordPress can be used as a CMS where a developer can make API requests to get the posts and display them on the homepage
##Functions used so far:
- WP_Query()
- get_post_thumbnail()
### Technologies used:
- WordPress
- Yarn, Gulp, node.js
|
5a2f180a-b6c7-4870-9e32-d263f80bd6f3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-17 02:49:57", "repo_name": "moshangpiaoxue/kUtilsxDemo", "sub_path": "/libsx/src/main/java/com/mo/libsx/utils/viewUtil/RecycleViewUtil.java", "file_name": "RecycleViewUtil.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "e1cdb3eeabe9ae40841787030ce983da87c43b56", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/moshangpiaoxue/kUtilsxDemo | 221 | FILENAME: RecycleViewUtil.java | 0.26588 | package com.mo.libsx.utils.viewUtil;
import android.view.View;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mo.libsx.utils.tips_utils.LogUtil;
/**
* @ author:mo
* @ data:2019/4/19:15:26
* @ 功能:KRecycleView工具类
*/
public class RecycleViewUtil {
/**
* 获取整体滑动的距离
*/
public static int getScollYDistance(RecyclerView recyclerView) {
RecyclerView.LayoutManager manager = recyclerView.getLayoutManager();
if (manager instanceof LinearLayoutManager) {
int position = ((LinearLayoutManager) manager).findFirstVisibleItemPosition();
View firstVisiableChildView = ((LinearLayoutManager) manager).findViewByPosition(position);
int itemHeight = firstVisiableChildView.getHeight();
return (position) * itemHeight - firstVisiableChildView.getTop();
} else {
LogUtil.i("只能计算LinearLayoutManager下的滑动距离");
return 0;
}
}
}
|
2b5f0e89-c249-4eec-b0f2-ce0a1b52d7b8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-15 03:41:37", "repo_name": "gege0121/clothes-Tracking", "sub_path": "/src/main/java/com/ascending/training/service/HistoryService.java", "file_name": "HistoryService.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "8613967f5dd9ba183a9a9ce90982591eb7ce27fb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gege0121/clothes-Tracking | 198 | FILENAME: HistoryService.java | 0.264358 | package com.ascending.training.service;
import com.ascending.training.model.History;
import com.ascending.training.repository.HistoryDao;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
@Service
public class HistoryService {
@Autowired
private HistoryDao historyDao;
private Logger logger;
public boolean save(History history){
return historyDao.save(history);
}
public boolean update(History history){
return historyDao.update(history);
}
public List<History> getHistorys(){
return historyDao.getHistorys();
}
public History getHistoryById(int id){
return historyDao.getHistoryById(id);
}
public boolean delete(LocalDate historyDate){
return historyDao.delete(historyDate);
}
public boolean deleteHistoryById(int id){
return historyDao.deleteHistoryById(id);
}
}
|
41f9a0f8-3c10-43bf-9652-6e2da9e38201 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-03 19:44:55", "repo_name": "CottonMC/Workshop", "sub_path": "/src/main/java/io/github/cottonmc/workshop/binding/BindingType.java", "file_name": "BindingType.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "9bfd44dc950ac90a54bf91b9972f68aa136481e2", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/CottonMC/Workshop | 192 | FILENAME: BindingType.java | 0.23092 | package io.github.cottonmc.workshop.binding;
import com.google.common.base.MoreObjects;
import io.github.cottonmc.workshop.item.mold.MoldType;
import net.minecraft.util.Identifier;
public class BindingType {
private final Identifier identifier;
private final int colorPalette;
public BindingType(Identifier identifier, int colorPalette) {
this.identifier = identifier;
this.colorPalette = colorPalette;
}
public Identifier getIdentifier() {
return identifier;
}
public int getColorPalette() {
return colorPalette;
}
@Override
public boolean equals(Object obj) {
if(!(obj instanceof BindingType)) return false;
return (this.identifier.equals(((BindingType) obj).identifier));
}
public String toString() {
return MoreObjects.toStringHelper(this)
.add("identifier", identifier.toString())
.add("colorPalette", colorPalette)
.toString();
}
}
|
6cb98f32-013f-42d6-bdb3-e1cf64e613c5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-15 20:46:49", "repo_name": "aleksandarb99/Apoteka_Projekat", "sub_path": "/Backend/PharmacyProject/src/main/java/com/team11/PharmacyProject/security/JWTUserDetailsService.java", "file_name": "JWTUserDetailsService.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "7269401c99f8ac7f7480c47d76a593da31776a1d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aleksandarb99/Apoteka_Projekat | 166 | FILENAME: JWTUserDetailsService.java | 0.221351 | package com.team11.PharmacyProject.security;
import com.team11.PharmacyProject.users.user.MyUser;
import com.team11.PharmacyProject.users.user.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import java.util.Optional;
@Service
public class JWTUserDetailsService implements UserDetailsService {
@Autowired
private UserRepository userRepository;
@Override
public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
Optional<MyUser> user = userRepository.findByEmail(email);
if (user.isEmpty()) {
throw new UsernameNotFoundException("User not found");
} else {
return new JWTUserDetails(user.get());
}
}
}
|
16841607-bc3c-4fdb-a884-984baa125c90 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-04-17 03:08:36", "repo_name": "zjhyteam/EQWeiXin", "sub_path": "/src/org/earthQuake/course/common/bean/GroupSend.java", "file_name": "GroupSend.java", "file_ext": "java", "file_size_in_byte": 1187, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "5495c8ac4b106cccf887dfa07c6622b49e274a56", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/zjhyteam/EQWeiXin | 299 | FILENAME: GroupSend.java | 0.2227 | package org.earthQuake.course.common.bean;
/**
* 短信群发信息表
* @author 徐晓亮
*
*/
public class GroupSend implements java.io.Serializable{
//短信群发信息ID
private int id;
//标题
private String title;
//发送时间
private String s_time;
//内容
private String content;
//图片路径
private String imageName;
public GroupSend() {
super();
}
public GroupSend(int id, String title, String s_time, String content,
String imageName) {
super();
this.id = id;
this.title = title;
this.s_time = s_time;
this.content = content;
this.imageName = imageName;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getS_time() {
return s_time;
}
public void setS_time(String s_time) {
this.s_time = s_time;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getImageName() {
return imageName;
}
public void setImageName(String imageName) {
this.imageName = imageName;
}
}
|
8e715d9e-7bd1-4684-b358-733bfa4c3482 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-07-25 17:25:22", "repo_name": "MecanicalDragon/LearningApp", "sub_path": "/reactivit/bombarder/src/main/java/net/medrag/reactivit/reactivitapp/bombarder/service/SleepController.java", "file_name": "SleepController.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "df49f42f0d60b6f44180d9f7d77b38548e5cba90", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MecanicalDragon/LearningApp | 250 | FILENAME: SleepController.java | 0.261331 | package net.medrag.reactivit.reactivitapp.bombarder.service;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import net.medrag.reactivit.dto.RequestDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Stanislav Tretyakov
* 22.05.2022
*/
@RestController
@RequiredArgsConstructor
public class SleepController {
private final BombarderService bombarderService;
@PostMapping("/switch")
public String switchDispatch() {
return bombarderService.switchDispatch();
}
@PostMapping("/hit")
public String hit() {
return bombarderService.hit();
}
@PostMapping("/sleep")
@SneakyThrows
public String sleep(@RequestParam long time) {
Thread.sleep(time);
return "200 OK";
}
@GetMapping("/sleep")
@SneakyThrows
public RequestDto sleepAndGet(@RequestParam long time, @RequestParam String string) {
Thread.sleep(time);
return new RequestDto(string.toLowerCase(), string.toUpperCase());
}
}
|
e6735e85-4bd5-45a6-ba57-2619dac5b641 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-28 14:37:46", "repo_name": "GrupoProgra2/TrabajoGrupal2LabProgra2", "sub_path": "/src/trabajogrupal2/PlanTarjeta.java", "file_name": "PlanTarjeta.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "0754c617379bb26a5b8b0136aceed65aa2b8a060", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/GrupoProgra2/TrabajoGrupal2LabProgra2 | 226 | FILENAME: PlanTarjeta.java | 0.256832 | /*
* 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 trabajogrupal2;
import java.util.Calendar;
/**
*
* @author Justm
*/
public class PlanTarjeta extends PlanBasico{
private double saldo ;
public PlanTarjeta(int n, String name) {
super(n, name);
saldo = 0;
}
public void aplicarTarjeta(double monto){
Calendar domingo = Calendar.getInstance();
Calendar hoy = Calendar.getInstance();
domingo.get(Calendar.SUNDAY);
if(monto > 0){
if(hoy.getTime().equals(domingo)){
saldo += (3 * monto);
}
else{
saldo += monto;
}
}
}
@Override
public void call(int numero, double mins){
double Monto =(mins*0.7);
LogCall e= new LogCall(numero, mins);
llamadas.add(e);
}
}
|
347e3d10-85f7-46b8-b78a-c12486bb6e75 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-19 13:22:14", "repo_name": "alexmilis/java-course", "sub_path": "/hw11-0036499702/src/main/java/hr/fer/zemris/java/hw11/jnotepadapp/local/AbstractLocalizationProvider.java", "file_name": "AbstractLocalizationProvider.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "84fd3f9aacde5e478dfb354974f3f05de664338c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/alexmilis/java-course | 215 | FILENAME: AbstractLocalizationProvider.java | 0.287768 | package hr.fer.zemris.java.hw11.jnotepadapp.local;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
/**
* Abstract implementation of {@link ILocalizationProvider}.
* Implements addition and removal of listeners.
* Provides method that notifies listeners.
* @author Alex
*
*/
public class AbstractLocalizationProvider implements ILocalizationProvider {
/**
* List of listeners.
*/
private List<ILocalizationListener> listeners;
/**
* Constructor.
*/
public AbstractLocalizationProvider() {
this.listeners = new LinkedList<>();
}
@Override
public void addLocalizationListener(ILocalizationListener l) {
listeners.add(Objects.requireNonNull(l));
}
@Override
public void removeLocalizationListener(ILocalizationListener l) {
listeners.remove(l);
}
/**
* Notifies listeners.
*/
public void fire() {
listeners.forEach(l -> l.localizationChanged());
}
@Override
public String getString(String key) {
return null;
}
}
|
e2922667-698a-477e-a318-62f8cbf1ff93 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-10 17:51:19", "repo_name": "JavDriver/anime-checker", "sub_path": "/src/main/java/nasirov/yv/data/animedia/AnimediaTitleSearchInfo.java", "file_name": "AnimediaTitleSearchInfo.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "62d2b494bbfbe0257d4b1d2deb0235efdd57ff43", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JavDriver/anime-checker | 241 | FILENAME: AnimediaTitleSearchInfo.java | 0.240775 | package nasirov.yv.data.animedia;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
/**
* Anime information for search on animedia
* Created by nasirov.yv
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AnimediaTitleSearchInfo {
/**
* Anime title
*/
private String title;
/**
* Keywords for search
*/
private String keywords;
/**
* Anime URL
*/
private String url;
/**
* Poster URL
*/
@JsonProperty(value = "poster")
private String posterUrl;
public AnimediaTitleSearchInfo(AnimediaTitleSearchInfo animediaTitleSearchInfo) {
this.title = animediaTitleSearchInfo.title;
this.keywords = animediaTitleSearchInfo.keywords;
this.url = animediaTitleSearchInfo.url;
this.posterUrl = animediaTitleSearchInfo.posterUrl;
}
public void setTitle(String title) {
this.title = title.toLowerCase();
}
public void setKeywords(String keywords) {
this.keywords = keywords.toLowerCase();
}
}
|
f09979be-fc0d-4215-b521-e99aaa97ca48 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-03 11:06:18", "repo_name": "brokolee/fu", "sub_path": "/Kapitel 5/src/bsp_FlowLayout_BufferedReader_TextFile/FlowLayoutTest.java", "file_name": "FlowLayoutTest.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "48e05b2fbd24c643662c14893db8ea8118afaae9", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/brokolee/fu | 241 | FILENAME: FlowLayoutTest.java | 0.273574 | package bsp_FlowLayout_BufferedReader_TextFile;
import java.awt.*;
import java.io.*;
import java.util.StringTokenizer;
import adhoc5_BaseFrame.BaseFrame;
public class FlowLayoutTest {
public static void main(String[] args) throws HeadlessException, IOException {
Frame f = new BaseFrame();
f.setTitle("no que understand le spansich!");
BufferedReader br = null;
br = new BufferedReader(new FileReader("C:\\Users\\aaron\\eclipse\\kurs1618\\workspace\\Kapitel 5\\"
+ "src\\bsp_FlowLayout_BufferedReader_TextFile\\file.txt"));
String line = null;
while ((line = br.readLine()) != null) {
StringTokenizer st = new StringTokenizer(line, " ");
Panel p = new Panel(new FlowLayout(FlowLayout.LEFT));
f.add(p);
System.out.println("f.add(p)");
while(st.hasMoreElements()) {
String token = st.nextToken();
p.add(new Label(token));
System.out.println("hasMore Elements: " + token);
}
}
br.close();
f.setVisible(true);
}
}
|
340ab51f-c20c-4f59-8605-792c62e1ac57 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-30 18:48:11", "repo_name": "HanYehong/vue-springboot-uppis", "sub_path": "/src/main/java/com/gly/uppis/login/controller/LoginController.java", "file_name": "LoginController.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "40ac736077c214ecf85ca414ed19a1f2fa90bdc0", "star_events_count": 5, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/HanYehong/vue-springboot-uppis | 214 | FILENAME: LoginController.java | 0.208179 | package com.gly.uppis.login.controller;
import com.gly.uppis.common.cache.RedisHelper;
import com.gly.uppis.common.response.Response;
import com.gly.uppis.common.util.UserUtil;
import com.gly.uppis.login.controller.request.LoginParamRequest;
import com.gly.uppis.login.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author GuLiyun
* @date 2019/5/22 14:56
*/
@CrossOrigin
@RestController
@RequestMapping("user")
public class LoginController {
@Autowired
private LoginService loginService;
@PostMapping("/check")
public Response checkUser(@RequestBody LoginParamRequest param) {
loginService.login(param.getUsername(), param.getPassword());
return Response.ok();
}
@PostMapping("/saveUser")
public Response saveUser(@RequestBody LoginParamRequest param) {
RedisHelper.getRedisUtil().set("userId", param.getUsername());
return Response.ok();
}
}
|
4301c1a0-a305-4649-bea4-bb8eb6e0c70b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-03 11:59:15", "repo_name": "manikanth004/manikanth_project", "sub_path": "/testing/src/test_fb/screen_capture.java", "file_name": "screen_capture.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "00c62fa33d6286d08570333460fe2acc491bbd7d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/manikanth004/manikanth_project | 223 | FILENAME: screen_capture.java | 0.294215 | package test_fb;
import java.awt.Robot;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class screen_capture {
public static void main(String[] args) throws Exception
{
System.setProperty("webdriver.chrome.driver", "brow\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get("https://www.facebook.com");
driver.manage().window().maximize();
Thread.sleep(5000);
Date d=new Date();
SimpleDateFormat sdf=new SimpleDateFormat("dd/MMM hh-mm-ss");
String time=sdf.format(d);
Robot robot=new Robot();
robot.mouseWheel(100);
File src=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(src, new File("screenshot\\"+time+"image.png"));
}
}
|
12e9a091-919a-47cb-8f20-40d3969ce59a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-27 05:21:20", "repo_name": "cynicLT/excel-api", "sub_path": "/src/main/java/org/cynic/excel/service/manager/FileManagerFactory.java", "file_name": "FileManagerFactory.java", "file_ext": "java", "file_size_in_byte": 1073, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "59366e8d11abdbf4fb85b543e246e9af27b3b891", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cynicLT/excel-api | 197 | FILENAME: FileManagerFactory.java | 0.27513 | package org.cynic.excel.service.manager;
import org.cynic.excel.data.FileFormat;
import org.cynic.excel.service.manager.excel.XlsFileManager;
import org.cynic.excel.service.manager.excel.XlsxFileManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Locale;
@Component
public class FileManagerFactory {
private final char csvSeparator;
public FileManagerFactory(@Value("${csv.separator}") char csvSeparator) {
this.csvSeparator = csvSeparator;
}
public FileManager getFileManager(FileFormat fileFormat) {
switch (fileFormat) {
case CSV:
return new CsvFileManager(csvSeparator);
case XLS:
return new XlsFileManager();
case XLSX:
return new XlsxFileManager();
default:
throw new IllegalArgumentException(
String.format(Locale.getDefault(), "Unknown file format: %s", fileFormat.name())
);
}
}
}
|
5e539a56-3e17-4490-bdd7-7d390d47beb8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-11 10:11:48", "repo_name": "fuatbakkal/LocationApp", "sub_path": "/app/src/main/java/com/fuat/locationapp/MyPlace.java", "file_name": "MyPlace.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "3262c3e0987cd9a694a7c4539ce3862c6825241d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fuatbakkal/LocationApp | 228 | FILENAME: MyPlace.java | 0.242206 | package com.fuat.locationapp;
import com.google.android.gms.maps.model.LatLng;
public class MyPlace {
private String id, name;
private double latitude, longitude;
public MyPlace(String id, String name, LatLng latLng) {
this.id = id;
this.name = name;
this.latitude = latLng.latitude;
this.longitude = latLng.longitude;
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj == this) return true;
if (!(obj instanceof MyPlace)) return false;
MyPlace o = (MyPlace) obj;
return o.getId().equals(this.getId());
}
public double getLongitude() {
return longitude;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getLatitude() {
return latitude;
}
}
|
d821d940-47af-4eb6-a090-81c580d9716c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-19 03:35:53", "repo_name": "ToastedSnackBar/arbor-android", "sub_path": "/app/src/main/java/com/github/toastedsnackbar/arbor/net/responses/AuthorResponse.java", "file_name": "AuthorResponse.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "fd464f219970db8ec0626e10f5e02edaabb82e31", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ToastedSnackBar/arbor-android | 213 | FILENAME: AuthorResponse.java | 0.23231 | package com.github.toastedsnackbar.arbor.net.responses;
import android.os.Parcel;
import com.google.gson.annotations.SerializedName;
public class AuthorResponse extends ApiResponse {
@SerializedName("email")
public String mEmail;
@SerializedName("name")
public String mName;
public AuthorResponse(Parcel source) {
super(source);
mEmail = source.readString();
mName = source.readString();
}
public String getEmail() {
return mEmail;
}
public String getName() {
return mName;
}
public static Creator<AuthorResponse> CREATOR = new Creator<AuthorResponse>() {
@Override
public AuthorResponse createFromParcel(Parcel source) {
return new AuthorResponse(source);
}
@Override
public AuthorResponse[] newArray(int size) {
return new AuthorResponse[size];
}
};
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeString(mEmail);
dest.writeString(mName);
}
}
|
55639ef6-0ff1-4598-ae2f-bd4d206503ac | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-29 06:31:25", "repo_name": "liqilun/ikilun-zookeeper", "sub_path": "/src/main/java/com/ikilun/web/controller/zk/ZkController.java", "file_name": "ZkController.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "1bff34f8fc7d5a6e0dab1e4dc2fad2db5f1994d8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liqilun/ikilun-zookeeper | 237 | FILENAME: ZkController.java | 0.290176 | package com.ikilun.web.controller.zk;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.ikilun.service.ZookeeperService;
import com.ikilun.web.controller.BaseController;
@RestController
public class ZkController extends BaseController{
@Autowired
private ZookeeperService zookeeperService;
@RequestMapping("/zk/zkconfig")
@ResponseBody
public String zkconfig(String data, ModelMap model, HttpServletRequest request) {
String path = "/LQLTEST";
if(!zookeeperService.exist(path)){
zookeeperService.addPresistentNode(path, data);
}else{
zookeeperService.updateNode(path, data);
}
return "success";
}
@RequestMapping("/zk/clidrenList")
@ResponseBody
public String clidrenList(String path, ModelMap model, HttpServletRequest request) {
Map<String, String> map = zookeeperService.getChildrenData(path);
return map.toString();
}
}
|
6ff1e4bf-9749-4460-86df-0be36354b80e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-05 23:15:52", "repo_name": "stevehav/iowa-caucus-app", "sub_path": "/sources/com/google/firebase/firestore/core/DatabaseInfo.java", "file_name": "DatabaseInfo.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "cb25beee1e465cce46d58ffd541a0fb8b6cb9d40", "star_events_count": 21, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/stevehav/iowa-caucus-app | 216 | FILENAME: DatabaseInfo.java | 0.282196 | package com.google.firebase.firestore.core;
import com.google.firebase.firestore.model.DatabaseId;
/* compiled from: com.google.firebase:firebase-firestore@@20.2.0 */
public final class DatabaseInfo {
private final DatabaseId databaseId;
private final String host;
private final String persistenceKey;
private final boolean sslEnabled;
public DatabaseInfo(DatabaseId databaseId2, String str, String str2, boolean z) {
this.databaseId = databaseId2;
this.persistenceKey = str;
this.host = str2;
this.sslEnabled = z;
}
public DatabaseId getDatabaseId() {
return this.databaseId;
}
public String getPersistenceKey() {
return this.persistenceKey;
}
public String getHost() {
return this.host;
}
public boolean isSslEnabled() {
return this.sslEnabled;
}
public String toString() {
return "DatabaseInfo(databaseId:" + this.databaseId + " host:" + this.host + ")";
}
}
|
d4ea33bf-b6ce-4b35-a286-e175ed4ab6ad | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-05-11 02:36:34", "repo_name": "Jzcob/Majikku", "sub_path": "/src/main/java/majikku/majikku/Events/Leave.java", "file_name": "Leave.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "9bcf6ea04d26ce9a613038a07e7ec1a8274de932", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Jzcob/Majikku | 251 | FILENAME: Leave.java | 0.247987 | package majikku.majikku.Events;
import majikku.majikku.Commands.Fly;
import majikku.majikku.Commands.God;
import me.clip.placeholderapi.PlaceholderAPI;
import majikku.majikku.Majikku;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
public class Leave implements Listener {
Majikku plugin;
public Leave(Majikku plugin) {
this.plugin = plugin;
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onQuit(PlayerQuitEvent e) {
Player p = e.getPlayer();
String leave = this.plugin.getConfig().getString("Settings.Chat.leave-message");
leave = PlaceholderAPI.setPlaceholders(e.getPlayer(), leave);
e.setQuitMessage(leave);
if (Fly.fly.contains(p)) {
p.setAllowFlight(false);
}
if (God.g.contains(p)) {
p.setInvulnerable(false);
}
p.setFlySpeed((float) 0.2);
p.setWalkSpeed((float) 0.2);
}
}
|
60b42915-f407-4083-8b8c-9cf274378b5b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-28 11:12:36", "repo_name": "Moruna/AndroidSkills", "sub_path": "/ImageCacheTest/app/src/main/java/com/moruna/imagecachetest/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "b7da48f02154d30a0ecfd04082eba60836d152b1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Moruna/AndroidSkills | 250 | FILENAME: MainActivity.java | 0.246533 | package com.moruna.imagecachetest;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import com.moruna.imagecachetest.Util.BitmapUtil;
public class MainActivity extends AppCompatActivity {
private ImageView imageView;
private BitmapUtil bitmapUtil;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bitmapUtil = new BitmapUtil();
imageView = (ImageView) findViewById(R.id.image);
bitmapUtil.display(imageView, "http://pic129.nipic.com/" +
"file/20170516/20614752_221848813000_2.jpg");
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bitmapUtil.display(imageView, "http://pic129.nipic.com/" +
"file/20170516/20614752_221848813000_2.jpg");
}
});
}
}
|
f80c046c-cfda-435d-ab38-6105cc742932 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-23 16:55:30", "repo_name": "thiago1fc3/educ4", "sub_path": "/core/src/main/java/br/com/educ4/core/userstory/week/CreateWeeksByRangeDateUS.java", "file_name": "CreateWeeksByRangeDateUS.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "cb9798c0af9520b4766e013f379357a684be0648", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/thiago1fc3/educ4 | 232 | FILENAME: CreateWeeksByRangeDateUS.java | 0.29584 | package br.com.educ4.core.userstory.week;
import br.com.educ4.core.domain.Week;
import br.com.educ4.core.ports.driven.repository.week.WeekRepositoryPort;
import br.com.educ4.core.ports.driver.week.CreateWeeksByRangeDatePort;
import lombok.RequiredArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.ArrayList;
@Service
@RequiredArgsConstructor
public class CreateWeeksByRangeDateUS implements CreateWeeksByRangeDatePort {
private final WeekRepositoryPort repository;
@Override
public void execute(ObjectId classroomId, LocalDate begin, LocalDate end) {
var weeks = new ArrayList<Week>();
while (begin.isBefore(end)) {
weeks.add(createWeek(classroomId, begin));
begin = begin.plusWeeks(1);
}
repository.saveAll(weeks);
}
private Week createWeek(ObjectId classroomId, LocalDate begin) {
return Week.builder()
.beginDate(begin)
.classroomId(classroomId)
.visible(false)
.build();
}
}
|
e08240a3-309e-4859-8faa-d40d545440eb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-12 18:05:55", "repo_name": "mdemiguelr/ISST-Grupo23-RGPD", "sub_path": "/RGPD/src/es/upm/dit/isst/rgpd/servlets/ServeFileServlet.java", "file_name": "ServeFileServlet.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "d00181b739334ed296327656e2cd24a9e1abbf39", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mdemiguelr/ISST-Grupo23-RGPD | 211 | FILENAME: ServeFileServlet.java | 0.250913 | package es.upm.dit.isst.rgpd.servlets;
import java.io.IOException;
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 es.upm.dit.isst.rgpd.dao.SolicitudDAO;
import es.upm.dit.isst.rgpd.dao.SolicitudDAOImplementation;
import es.upm.dit.isst.rgpd.model.Solicitud;
/**
* Servlet implementation class ServeFileServlet
*/
@WebServlet("/ServeFileServlet")
public class ServeFileServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
SolicitudDAO sdao = SolicitudDAOImplementation.getInstance();
String id = req.getParameter( "id" );
int idInt = Integer.parseInt(id);
Solicitud solicitud = sdao.read(idInt);
resp.setContentLength(solicitud.getMemoria().length);
resp.getOutputStream().write(solicitud.getMemoria());
}
}
|
ce7599fc-75eb-4626-be42-8efab6fec3af | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-07 13:35:34", "repo_name": "alsgh4098/BaekJun", "sub_path": "/Baekjoon/src/Main_2941_크로아티아알파벳.java", "file_name": "Main_2941_크로아티아알파벳.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "b303f9ef87ef9548a5ecc5f22cd30373ccf9dac8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/alsgh4098/BaekJun | 331 | FILENAME: Main_2941_크로아티아알파벳.java | 0.295027 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main_2941_크로아티아알파벳 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String string = br.readLine();
char[] chr_arr = string.toCharArray();
int count = 0;
for (int i = 0; i < chr_arr.length; i++) {
if( i+1 < chr_arr.length) {
if(chr_arr[i] == 'c'){
if(chr_arr[i+1] == '-'
|| chr_arr[i+1] == '=') {
continue;
}
}else if(chr_arr[i] == 'd'){
if(chr_arr[i+1] == '-') {
continue;
}else if(chr_arr[i+1] == 'z') {
if(i+2 < chr_arr.length
&& chr_arr[i+2] == '=') {
continue;
}
}
}else if(chr_arr[i] == 'l'
||chr_arr[i] == 'n') {
if(chr_arr[i+1] == 'j') {
continue;
}
}else if(chr_arr[i] == 's'
||chr_arr[i] == 'z') {
if(chr_arr[i+1] == '=') {
continue;
}
}
}
count++;
}
System.out.println(count);
}
}
|
6eb3cb8f-1f78-4212-9db3-46840a55345a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-01-20 01:58:14", "repo_name": "ahemenson/Tirando-De-Letra-2.0", "sub_path": "/src/com/projetoUfPB/tirandodeletra/DicaActivity.java", "file_name": "DicaActivity.java", "file_ext": "java", "file_size_in_byte": 1039, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "0dfb1eb72139fd33a0aa78e49899fbe8e46936f6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "ISO-8859-1"} | https://github.com/ahemenson/Tirando-De-Letra-2.0 | 243 | FILENAME: DicaActivity.java | 0.26588 | package com.projetoUfPB.tirandodeletra;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class DicaActivity extends Activity implements OnClickListener {
GifView2 gifView2;
Button botao_sair;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dica);
gifView2 = (GifView2) findViewById(R.id.gif_view2);
botao_sair = (Button) findViewById(R.id.button_sair);
botao_sair.setOnClickListener(this);
}
@Override
public void onBackPressed() {
// Caso o botão back (retorno) do dispositivo seja acionado nada ocorrerá
}
@Override
public void onClick(View arg0) {
switch (arg0.getId()) {
case R.id.button_sair:
startActivity(new Intent(DicaActivity.this, Menu_Activity.class));
finish();
break;
}
}
}
|
9b287c77-f8bd-4fb0-be51-5141e26321c2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-01 14:31:57", "repo_name": "zoltancsaszi/action-monitor-application", "sub_path": "/src/test/java/net/zoltancsaszi/actionmonitor/service/JmsListenerServiceTest.java", "file_name": "JmsListenerServiceTest.java", "file_ext": "java", "file_size_in_byte": 1216, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "95ff614f806813f51541d094dfe07c85c957c7e4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zoltancsaszi/action-monitor-application | 248 | FILENAME: JmsListenerServiceTest.java | 0.271252 | package net.zoltancsaszi.actionmonitor.service;
import net.zoltancsaszi.actionmonitor.dto.MonitoringEvent;
import org.apache.activemq.artemis.junit.EmbeddedActiveMQResource;
import org.junit.Rule;
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.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.concurrent.TimeUnit;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("test")
public class JmsListenerServiceTest {
@Rule
public EmbeddedActiveMQResource resource = new EmbeddedActiveMQResource();
@Autowired
private JmsSenderService jmsSenderService;
@Autowired
private JmsListenerService jmsListenerService;
@Test
public void testReceive() throws Exception {
jmsSenderService.send(new MonitoringEvent(0, 0, "Test EventType"));
jmsListenerService.getLatch().await(10000, TimeUnit.MILLISECONDS);
assertThat(jmsListenerService.getLatch().getCount()).isEqualTo(0);
}
} |
4f099755-bf76-4bb7-b182-fcebcd63662e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-04-17T13:59:03", "repo_name": "jeok/Embedded-Systems-Programming-2015", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1052, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "c77686350581fe8d5e61277dabbe17f0d5a1b4ad", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jeok/Embedded-Systems-Programming-2015 | 469 | FILENAME: README.md | 0.255344 | # Embedded-Systems-Programming-2015
Obligatory coursework for course [521142A](https://weboodi.oulu.fi/oodi/opintjakstied.jsp?MD5avain=&Kieli=1&OpinKohd=16913373&OnkoIlmKelp=1&takaisin=ilmsuor.jsp&haettuOrg=-1&sortJarj=2&Kieli=1&NimiTunniste=embedded&AlkPvm=&PaatPvm=&Selite=&Sivu=0&haettuOpas=-1&haettuOppAin=&haettuLk=-1&haettuOpetKiel=-1&haeOpetTap=haeopetustapahtumat&haeVainIlmKelp=0&haeMyosAlemOrg=1&eHOPSopinkohtlaj=&eHOPSpaluusivu=&eHOPSilmsuor=1) at the University of Oulu.
A car game for AVR ATmega128.
##Dependencies:
* avr-libc
* avr-gcc
* avr-gdb
* avrdude (for loading to device)
## Compiling
### Manually
1. avr-gcc -w -Os -DF_CPU=16000000UL -mmcu=atmega128 -c main.c lcd.c
2. avr-gcc -w -mmcu=atmega128 *.o -o main
3. avr-objcopy -O ihex -R .eeprom main main.hex
### Using Makefile
1. make hex
### Load to AVR
Assuming you use the AVR-JTAG-USB-programmer (and it is connected to /dev/ttyUSB0).
1. sudo avrdude -F -V -c jtag1 -p ATmega128 -U flash:w:main.hex -P /dev/ttyUSB0
Or with Makefile:
sudo make flash
|
ab0a729a-96b1-4aa0-91b1-59c6284944ed | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-28 09:12:12", "repo_name": "dorfingerjonas/battleships", "sub_path": "/src/main/java/Ship.java", "file_name": "Ship.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "5ddeb9b23bd1f3ff8fc5abb4c4092581901ec85c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dorfingerjonas/battleships | 224 | FILENAME: Ship.java | 0.26588 | import java.util.ArrayList;
import java.util.List;
public class Ship {
List<ShipPart> parts = new ArrayList<>();
public Ship(char startX, char startY,int length, boolean horizontal) {
char x = startX;
char y = startY;
for (int i = 0; i < length;i++) {
parts.add(new ShipPart(x, y));
if (horizontal) {
x++;
} else {
y++;
}
}
}
public boolean isHit(char x, char y) {
for (ShipPart part : parts) {
if (part.getX() == x && part.getY() == y) {
if (!part.isShot()) {
part.setShot(true);
return true;
} else {
return false;
}
}
}
return false;
}
@Override
public String toString() {
String output = "";
for (ShipPart part : parts) {
output += String.format("%c%c ", part.getX(), part.getY());
}
return output;
}
} |
9f1ce4c7-c12e-4bc0-b4c2-4932128d70a5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-07 08:59:18", "repo_name": "gsilvatici/BPMN-Prolog", "sub_path": "/src/xmlparser/Edge.java", "file_name": "Edge.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "e1ab03825a9dd5f60953bb8b50b998bd44bf1e13", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/gsilvatici/BPMN-Prolog | 260 | FILENAME: Edge.java | 0.26588 | package xmlparser;
/**
*
* @author Stefan_524450
*
* For each edge in the business process diagram ("sequenceFlow"), we
* create an object Edge An Edge contains an id, a name, the id of the
* source, the id of the target, and eventually a condition The source
* and the target may be activities, subprocesses, events, or gateways
*
*/
public class Edge {
public final String id;
public final String name;
public final String source;
public final String target;
public final String condition;
public Edge(String id, String name, String src, String tgt, String cond) {
this.id = id;
this.name = name;
this.source = src;
this.target = tgt;
this.condition = cond;
}
public boolean hasCondition() {
return (!(condition == null));
}
public boolean hasName() {
return (!(name == ""));
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public String getSource() {
return source;
}
public String getTarget() {
return target;
}
public String getCondition() {
return condition;
}
}
|
c2dea13c-def9-435a-955b-d8569bc88a00 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-30 15:14:24", "repo_name": "Everess/TradingNetwork", "sub_path": "/src/main/java/tnSpringHibernate/dao/UserDaoImpl.java", "file_name": "UserDaoImpl.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "9938b4000bf4e6396116596096bf7bd520ebea44", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Everess/TradingNetwork | 196 | FILENAME: UserDaoImpl.java | 0.250913 | package tnSpringHibernate.dao;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.springframework.stereotype.Repository;
import tnSpringHibernate.models.User;
import tnSpringHibernate.utils.HibernateSessionFactoryUtil;
@Repository
public class UserDaoImpl implements UserDao {
@Override
public void save(User user) {
Session session = HibernateSessionFactoryUtil.getSessionFactory().openSession();
Transaction tx2 = session.beginTransaction();
session.save(user);
tx2.commit();
session.close();
}
@Override
public void update(User user) {
Session session = HibernateSessionFactoryUtil.getSessionFactory().openSession();
Transaction tx2 = session.beginTransaction();
session.update(user);
tx2.commit();
session.close();
}
@Override
public void delete(User user) {
Session session = HibernateSessionFactoryUtil.getSessionFactory().openSession();
Transaction tx2 = session.beginTransaction();
session.delete(user);
tx2.commit();
session.close();
}
}
|
1a950c0c-e2fa-4462-acf7-1517737ccd31 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-02 21:47:43", "repo_name": "PF-G4/airports-indoor-location-backend", "sub_path": "/src/main/java/afinal/proyecto/cuatro/grupo/entities/Location.java", "file_name": "Location.java", "file_ext": "java", "file_size_in_byte": 1040, "line_count": 65, "lang": "en", "doc_type": "code", "blob_id": "93a805ff310005f72b0ab5aa1e7e6eaadbb305d5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/PF-G4/airports-indoor-location-backend | 273 | FILENAME: Location.java | 0.247987 | package afinal.proyecto.cuatro.grupo.entities;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Set;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "location")
public class Location {
@Id
@Column(name = "id")
private Integer id;
@NotNull
private String name;
@NotNull
private String abreviature;
@OneToMany(mappedBy = "destination", cascade = CascadeType.ALL)
private Set<Vuelo> vuelo;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAbreviature() {
return abreviature;
}
public void setAbreviature(String abreviature) {
this.abreviature = abreviature;
}
@JsonIgnore
public Set<Vuelo> getVuelo() {
return vuelo;
}
public void setVuelo(Set<Vuelo> vuelo) {
this.vuelo = vuelo;
}
@Override
public String toString() {
return name + " (" + abreviature +")";
}
} |
5f200156-bfda-41a7-a88e-557b0a92de26 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-19 04:41:03", "repo_name": "parkjg20/DeliveryTalk", "sub_path": "/app/src/main/java/com/dataflow/deliverytalk/Models/Location.java", "file_name": "Location.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "c7b07f8bb7dd470371cfc1e9413c4e718146a746", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/parkjg20/DeliveryTalk | 191 | FILENAME: Location.java | 0.216012 | package com.dataflow.deliverytalk.Models;
import android.os.Parcel;
import android.os.Parcelable;
public class Location implements Parcelable {
String name;
public Location(){}
public Location(String name) {
this.name = name;
}
protected Location(Parcel in){
name = in.readString();
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeString(name);
}
public static final Creator<Location> CREATOR = new Creator<Location>() {
@Override
public Location createFromParcel(Parcel in) {
return new Location(in);
}
@Override
public Location[] newArray(int size) {
return new Location[size];
}
};
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
|
af2a423b-9810-4482-836d-edcf45d4d06c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-18 13:38:28", "repo_name": "HighlandsWalker/JavaDocs", "sub_path": "/Collections/warmup-part2/src/main/java/exercise3/Student.java", "file_name": "Student.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "184e733c7b639e788472417e2686f8e417fd324e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/HighlandsWalker/JavaDocs | 260 | FILENAME: Student.java | 0.258326 | package exercise3;
/**
* Created by Gabriel.Tabus on 7/7/2017.
*/
public class Student {
public String firstName;
public String lastName;
public Student(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
// GETTERS
public String getFirstName() {
return this.firstName;
}
public String getLastName() {
return this.lastName;
}
// SETTERS
public void setFirstName(String firstName){
this.firstName = firstName;
}
public void setLastName(String lastName){
this.lastName = lastName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Student student = (Student) o;
if (firstName != null ? firstName.equals(student.firstName) : student.firstName != null) return true;
return false;
}
@Override
public int hashCode() {
int result = firstName != null ? firstName.hashCode() : 0;
return result;
}
@Override
public String toString() {
return this.firstName + " " + this.lastName;
}
}
|
4474df86-3b3c-4412-8874-f732bd861c4d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-24 12:05:03", "repo_name": "ReinRaus/Mrakopedia-Mobile", "sub_path": "/app/src/main/java/com/randomname/mrakopedia/models/api/recentchanges/RecentChangesResult.java", "file_name": "RecentChangesResult.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "a974cc191990a4eace2be97835c12e683196afdc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ReinRaus/Mrakopedia-Mobile | 221 | FILENAME: RecentChangesResult.java | 0.216012 | package com.randomname.mrakopedia.models.api.recentchanges;
import com.google.gson.annotations.SerializedName;
/**
* Created by Vlad on 27.01.2016.
*/
public class RecentChangesResult {
private Query query;
@SerializedName("continue")
private Continue mContinue;
private String batchcomplete;
public Query getQuery ()
{
return query;
}
public void setQuery (Query query)
{
this.query = query;
}
public Continue getmContinue ()
{
return mContinue;
}
public void setmContinue (Continue mContinue)
{
this.mContinue = mContinue;
}
public String getBatchcomplete ()
{
return batchcomplete;
}
public void setBatchcomplete (String batchcomplete)
{
this.batchcomplete = batchcomplete;
}
@Override
public String toString()
{
return "ClassPojo [query = "+query+", continue = "+mContinue+", batchcomplete = "+batchcomplete+"]";
}
}
|
2872419d-8458-4460-97cf-3b2e1aea5783 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-11 01:44:23", "repo_name": "tortoises/cabrite", "sub_path": "/src/com/imm/mqtt/subscribe/Subscriber.java", "file_name": "Subscriber.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "1cf52ce0f95f3fc3e406c1d65261298ae989f267", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/tortoises/cabrite | 244 | FILENAME: Subscriber.java | 0.245085 | package com.imm.mqtt.subscribe;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttException;
import com.imm.mqtt.publish.Utils;
public class Subscriber {
public static final String BROKER_URL = "tcp://10.1.222.99:1883";
// We have to generate a unique Client id.
String clientId = Utils.getMacAddress() + "-sub";
private MqttClient mqttClient;
public Subscriber() {
try {
mqttClient = new MqttClient(BROKER_URL, clientId);
} catch (MqttException e) {
e.printStackTrace();
System.exit(1);
}
}
public void start() {
try {
mqttClient.setCallback(new SubscribeCallback());
mqttClient.connect();
mqttClient.subscribe("/v1.0/recorder/1/get/+");
} catch (MqttException e) {
e.printStackTrace();
System.exit(1);
}
}
public static void main(String args) {
final Subscriber subscriber = new Subscriber();
subscriber.start();
}
}
|
2b45abe7-19ff-46bb-aa7a-b356eaf39802 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-13 14:00:06", "repo_name": "Alvin-Tang/JVP", "sub_path": "/core/src/main/java/com/jvp/core/model/Result.java", "file_name": "Result.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "bbbb44167d4a89225d97831ae9249269f534a4fc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Alvin-Tang/JVP | 229 | FILENAME: Result.java | 0.27048 | package com.jvp.core.model;
import java.io.Serializable;
public class Result implements Serializable
{
/**
*
*/
private static final long serialVersionUID = 1L;
private boolean success;
private Serializable sid;
private Message message;
public Result()
{
this(true, null);
}
public Result(boolean success) {
this(success, null);
}
public Result(boolean success, Message message) {
this.success = success;
this.message = message;
}
public boolean isSuccess()
{
return this.success;
}
public void setSuccess(boolean success)
{
this.success = success;
}
public String getMessageDesc()
{
if (this.message == null)
return null;
return this.message.getMessage();
}
public Integer getMessageCode()
{
if (this.message == null)
return null;
return Integer.valueOf(this.message.getCode());
}
public Serializable getSid()
{
return this.sid;
}
public void setSid(Serializable sid)
{
this.sid = sid;
}
} |
bfc74c1d-db25-4b5b-b240-6318ee67bff6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-28 16:48:26", "repo_name": "MatweyL/mkjsn", "sub_path": "/src/com/company/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1214, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "ff20892898bfe5533d79b491c8c946a572b074b9", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MatweyL/mkjsn | 256 | FILENAME: Main.java | 0.27513 | package com.company;
import com.gen.MYJSONLexer;
import com.gen.MYJSONParser;
import org.antlr.runtime.CharStream;
import org.antlr.runtime.tree.ParseTree;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTreeWalker;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
public class Main {
public static void main(String[] args) {
// write your code here
String pathToFile;
try {
pathToFile = args[0];
InputStream file = new FileInputStream(pathToFile);
MYJSONLexer myjsonLexer = new MYJSONLexer(new ANTLRInputStream(file));
CommonTokenStream tokens = new CommonTokenStream(myjsonLexer);
MYJSONParser myjsonParser = new MYJSONParser(tokens);
myjsonParser.setBuildParseTree(true);
MYJSONParser.ProgContext ctx = myjsonParser.prog();
ParseTreeWalker walker = new ParseTreeWalker();
walker.walk(new TreeWalker(), ctx);
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}
} |
dfea648b-5cef-415e-8ac1-b0b77d0dd0db | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-22T00:37:06", "repo_name": "AwpData/Csgo-Case-Simulator", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1059, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "8588d55b3f094afb6b3f6974e7a096636a0d221c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AwpData/Csgo-Case-Simulator | 295 | FILENAME: README.md | 0.256832 | <h1> Csgo Case Simulator </h1>
-Open cases and obtain skins <br>
-Sell skins for credits <br>
-Don't go bankrupt or the game is over! <br>
-Data (will be) is saved using <a href="https://www.oracle.com/database/technologies/appdev/jdbc.html">JDBC</a> written in SQLite
<h1> Dev Path </h1>
-Need to add inventory saving/reading <br>
-Adding item colors / credits to db <br>
-Updating collections and cases to present day <br>
-Reformat code to fit database syntax <br>
<h2> This program uses Unicode Characters! </h2> <br>
* If you use Eclipse, it is set to use the default "Cp1252" text file encoding and this program must be set to "UTF-8"! <br>
* In order to not get errors or missing characters (labeled with "?"): <br>
* 1. Window > Preferences > General > Content Types, under "Default encoding", type "UTF-8" and click apply <br>
* 2. Window > Preferences > General > Workspace, set "Text file encoding" to "Other : UTF-8". <br><br>
<b> Soon I will publish a .jar file when I complete the program so you don't have to execute through IDE!</b>
|
539b7e1c-1f75-4e9c-b57c-1492e8382eca | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-08 07:58:26", "repo_name": "yogita72/project10", "sub_path": "/src/main/java/com/ProjectOne/app/OneGraphApi.java", "file_name": "OneGraphApi.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "fd1249805058e17d827fabbc548ca2c06c4a0427", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yogita72/project10 | 253 | FILENAME: OneGraphApi.java | 0.262842 |
package com.ProjectOne.app;
import java.io.*;
import java.util.*;
import org.scribe.builder.*;
import org.scribe.builder.api.*;
import org.scribe.model.*;
import org.scribe.oauth.*;
import org.scribe.extractors.*;
import org.scribe.model.*;
import org.scribe.utils.*;
public class OneGraphApi extends DefaultApi20
{
private static final String AUTHORIZATION_URL = "http://www.one-graph.com/one-graph/api/authenticate?client_id=%s&response_type=code&redirect_uri=%s";
@Override
public String getAccessTokenEndpoint()
{
return "http://www.one-graph.com/one-graph/api/access_token?grant_type=authorization_code";
}
@Override
public Verb getAccessTokenVerb()
{
return Verb.POST;
}
@Override
public String getAuthorizationUrl(OAuthConfig config)
{
Preconditions.checkValidUrl(config.getCallback(), "Must provide a valid url as callback. Foursquare2 does not support OOB");
return String.format(AUTHORIZATION_URL, config.getApiKey(), OAuthEncoder.encode(config.getCallback()));
}
@Override
public AccessTokenExtractor getAccessTokenExtractor()
{
return new JsonTokenExtractor();
}
}
|
930406fe-cb72-4b84-aeed-8b45f6450f90 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-07 02:42:58", "repo_name": "JuanFRios/MatriculasLab1", "sub_path": "/src/java/com/udea/ejb/MatriculaFacade.java", "file_name": "MatriculaFacade.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "06c5d19d37fa563bbbab6960b41110dd02aa2ac9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JuanFRios/MatriculasLab1 | 226 | FILENAME: MatriculaFacade.java | 0.286169 | /*
* 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.udea.ejb;
import com.udea.modelo.Matricula;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
/**
*
* @author mateo
*/
@Stateless
public class MatriculaFacade extends AbstractFacade<Matricula> implements MatriculaFacadeLocal {
@PersistenceContext(unitName = "MatriculasLab1PU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public MatriculaFacade() {
super(Matricula.class);
}
@Override
public List<Matricula> listarPorEstudiante(int id) {
Query q = em.createQuery("SELECT m FROM Matricula m WHERE m.matriculaPK.idEstudiante =:id");
q.setParameter("id", id);
return q.getResultList();
}
}
|
9e8f0af5-3808-4e16-9fed-9b61f2a0e6ed | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-24 16:26:09", "repo_name": "pekalam/FuelPrice", "sub_path": "/aplikacja/app/src/main/java/com/projekt/fuelprice/voicerecog/CheapestStationVoiceCommand.java", "file_name": "CheapestStationVoiceCommand.java", "file_ext": "java", "file_size_in_byte": 1073, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "bc30e08530a77558824042896554bb5a4128bbde", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pekalam/FuelPrice | 222 | FILENAME: CheapestStationVoiceCommand.java | 0.295027 | package com.projekt.fuelprice.voicerecog;
import android.content.Context;
import com.projekt.fuelprice.data.GasStation;
import com.projekt.fuelprice.viewmodels.GasStationsViewModel;
public class CheapestStationVoiceCommand extends VoiceCommand {
public CheapestStationVoiceCommand(String cmdTail) {
super(cmdTail);
}
@Override
public boolean execute(GasStationsViewModel gasStationsViewModel, Context context) {
GasStation[] stations = gasStationsViewModel.getGasStations().getValue();
if(stations != null){
GasStation.FuelType selectedType = gasStationsViewModel.getSelectedFuelType().getValue();
GasStation cheapest = stations[0];
for(int i = 1; i < stations.length; i++){
if(stations[i].getPriceOf(selectedType) < cheapest.getPriceOf(selectedType)){
cheapest = stations[i];
}
}
gasStationsViewModel.navigateTo(cheapest, context);
return true;
}else{
return false;
}
}
}
|
586eef98-4f7b-482e-a008-2de4a0c86733 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-08 21:16:04", "repo_name": "godwintrav/MyMusicApp", "sub_path": "/src/sample/datamodel/GetMusic.java", "file_name": "GetMusic.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f05409dadb9285a74110a31896a2517890398c79", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/godwintrav/MyMusicApp | 226 | FILENAME: GetMusic.java | 0.267408 | package sample.datamodel;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.nio.file.FileVisitResult;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class GetMusic extends SimpleFileVisitor<Path> {
private static List<Path> musicList = new ArrayList<>();
public static List<Path> getMusicList() {
return musicList;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
if(file.getFileName().toString().endsWith(".mp3")){
musicList.add(file);
}
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
System.out.println("Error Accessing File :" + file.toAbsolutePath()+ " " + exc.getMessage());
return FileVisitResult.CONTINUE;
}
}
|
4babd52c-ec71-4cd1-ace1-f089e49fdca5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-20 08:41:29", "repo_name": "finnflyer/CaseDB", "sub_path": "/src/main/java/com/demo/model/issue/IssuePhaseBean.java", "file_name": "IssuePhaseBean.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "d2cb694b7bc5d2bc9ef05ee5bb9f22b2f802dfaf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/finnflyer/CaseDB | 320 | FILENAME: IssuePhaseBean.java | 0.290981 | package com.demo.model.issue;
import javax.persistence.*;
/**
* Created by Admin on 2016/9/8.
*/
@Entity
@Table(name = "ctdissuephase", schema = "", catalog = "casedb")
public class IssuePhaseBean {
private int phaseId;
private String phaseCato;
@Id
@Column(name = "PhaseID")
public int getPhaseId() {
return phaseId;
}
public void setPhaseId(int phaseId) {
this.phaseId = phaseId;
}
@Basic
@Column(name = "PhaseCato")
public String getPhaseCato() {
return phaseCato;
}
public void setPhaseCato(String phaseCato) {
this.phaseCato = phaseCato;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
IssuePhaseBean that = (IssuePhaseBean) o;
if (phaseId != that.phaseId) return false;
if (phaseCato != null ? !phaseCato.equals(that.phaseCato) : that.phaseCato != null) return false;
return true;
}
@Override
public int hashCode() {
int result = phaseId;
result = 31 * result + (phaseCato != null ? phaseCato.hashCode() : 0);
return result;
}
}
|
798d7357-8105-4086-a228-3106a8e959f3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-18 12:46:53", "repo_name": "abhi1505/Hostel-Information", "sub_path": "/src/main/java/com/first/controller/service/Hostel_feedbackservice/Hostel_feedbackserviceimp.java", "file_name": "Hostel_feedbackserviceimp.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "6e15094515ec3bd07322d4735fdf3a5522f9b6aa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/abhi1505/Hostel-Information | 212 | FILENAME: Hostel_feedbackserviceimp.java | 0.274351 | package com.first.controller.service.Hostel_feedbackservice;
import com.first.controller.dao.Hostel_feedback.Hostel_feedbackdao;
import com.first.controller.domain.Hostel_feedback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Created by admin on 10/31/2017.
*/
@Service
public class Hostel_feedbackserviceimp implements Hostel_feedbackservice {
@Autowired
private Hostel_feedbackdao hostelfeedbackdao;
@Override
@Transactional
public void insert(Hostel_feedback hostel) {
hostelfeedbackdao.insert(hostel);
}
@Override
@Transactional
public Hostel_feedback getPersonById(String id) {
return hostelfeedbackdao.getPersonById(id);
}
@Override
@Transactional
public List<Hostel_feedback> getAllhostel(String hid) {
return hostelfeedbackdao.getAllhostel(hid);
}
}
|
330612b0-a67a-499c-b5ee-2631d79afcbe | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-30 08:17:38", "repo_name": "zhengzongsheng/pdf_annotate", "sub_path": "/src/main/java/Filter/ValidateFilter.java", "file_name": "ValidateFilter.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "b03ace28155930d1ea542704ff5e3bb809e85934", "star_events_count": 11, "fork_events_count": 2, "src_encoding": "GB18030"} | https://github.com/zhengzongsheng/pdf_annotate | 239 | FILENAME: ValidateFilter.java | 0.249447 | package Filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 拦截器
* 用于防止未选择批注文件就强制进入批注网页
*
* @author sheng
*
*/
public class ValidateFilter implements Filter {
public void init(FilterConfig filterConfig) throws ServletException {
System.out.println("----过滤器初始化----");
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest request1 = (HttpServletRequest) request;
HttpServletResponse response1 = (HttpServletResponse) response;
// HttpSession session = request1.getSession();
String a = (String) request1.getSession().getAttribute("correct");
if (a == null) {
response1.sendRedirect("index.jsp");
}
chain.doFilter(request, response);
}
public void destroy() {
System.out.println("----过滤器销毁----");
}
}
|
db14c202-ef47-4da0-af7f-6fcdea0b2142 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-10 19:37:14", "repo_name": "ITKosta829/Pics2Share", "sub_path": "/app/src/main/java/com/example/deanc/pics2share/Pic.java", "file_name": "Pic.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "89ea95c85c95553c8c4651e6d357ef8dfc118533", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ITKosta829/Pics2Share | 229 | FILENAME: Pic.java | 0.226784 | package com.example.deanc.pics2share;
import java.util.ArrayList;
/**
* Created by DeanC on 7/28/2016.
*/
public class Pic {
private String picName;
private ArrayList<String> commentList;
private String URL;
private int likes;
public Pic(String picName, String URL) {
this.picName = picName;
this.commentList = new ArrayList<>();
this.URL = URL;
}
public String getPicName() {
return picName;
}
public void setPicName(String picName) {
this.picName = picName;
}
public ArrayList<String> getCommentList() {
return commentList;
}
public void addComment(String comments) {
commentList.add(comments);
}
public String getURL() {
return URL;
}
public void setURL(String URL) {
this.URL = URL;
}
public int getLikes() {
return likes;
}
public void setLikes(int likes) {
this.likes = likes;
}
}
|
9beb8cbf-91d1-4f49-b4f0-23c2ed6b1d48 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-27 03:37:40", "repo_name": "tapdevops/PatroliApi", "sub_path": "/android/app/src/main/java/com/patroliapi/LocationServiceModule.java", "file_name": "LocationServiceModule.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "468eeb43d99bc142cf38b82b46aa0c983f97b1f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tapdevops/PatroliApi | 200 | FILENAME: LocationServiceModule.java | 0.218669 | package com.patroliapi;
import android.util.Log;
import android.widget.Toast;
import android.content.Intent;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import javax.annotation.Nonnull;
public class LocationServiceModule extends ReactContextBaseJavaModule {
public static final String REACT_CLASS = "LocationService";
public static ReactApplicationContext reactContext;
public LocationServiceModule(@Nonnull ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
}
@Nonnull
@Override
public String getName() {
return REACT_CLASS;
}
@ReactMethod
public void startService() {
this.reactContext.startService(new Intent(this.reactContext, LocationService.class));
}
@ReactMethod
public void stopService() {
this.reactContext.stopService(new Intent(this.reactContext, LocationService.class));
}
} |
352ee383-3d31-4542-97c9-05e8d69419e5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-25 23:03:38", "repo_name": "wagnerwave/Dossier_Hacking_de_peluche", "sub_path": "/Application_code_source/eMybaby/sources/androidx/core/content/SharedPreferencesCompat.java", "file_name": "SharedPreferencesCompat.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "e36487d86cf0cec9d4555a01bc1a6680f522ec8b", "star_events_count": 5, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/wagnerwave/Dossier_Hacking_de_peluche | 163 | FILENAME: SharedPreferencesCompat.java | 0.240775 | package androidx.core.content;
import android.content.SharedPreferences;
import androidx.annotation.NonNull;
@Deprecated
public final class SharedPreferencesCompat {
@Deprecated
public static final class EditorCompat {
public static EditorCompat sInstance;
public final Helper mHelper = new Helper();
public static class Helper {
public void apply(@NonNull SharedPreferences.Editor editor) {
try {
editor.apply();
} catch (AbstractMethodError unused) {
editor.commit();
}
}
}
@Deprecated
public static EditorCompat getInstance() {
if (sInstance == null) {
sInstance = new EditorCompat();
}
return sInstance;
}
@Deprecated
public void apply(@NonNull SharedPreferences.Editor editor) {
this.mHelper.apply(editor);
}
}
}
|
9319237b-cdbe-436b-b846-7fe0d2471b39 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-19 11:56:30", "repo_name": "ALFREDProject/CalendarApp", "sub_path": "/app/src/main/java/eu/alfred/calendarapp/actions/ShowCalendarAction.java", "file_name": "ShowCalendarAction.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "f8ae9b6e098e4777ad48c949275c712729ec427b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ALFREDProject/CalendarApp | 255 | FILENAME: ShowCalendarAction.java | 0.272799 | package eu.alfred.calendarapp.actions;
import java.util.Map;
import eu.alfred.api.proxies.interfaces.ICadeCommand;
import eu.alfred.api.speech.Cade;
import eu.alfred.calendarapp.CalendarView;
import eu.alfred.calendarapp.MainActivity;
import eu.alfred.calendarapp.R;
/**
* Created by Gary on 26.02.2016.
*/
public class ShowCalendarAction implements ICadeCommand {
MainActivity main;
Cade cade;
CalendarView mView;
public ShowCalendarAction(MainActivity main, Cade cade) {
this.main = main;
this.cade = cade;
}
@Override
public void performAction(String s, Map<String, String> map) {
mView = (CalendarView) main.findViewById(R.id.calendar);
mView.newDate(map,main);
cade.sendActionResult(true);
}
@Override
public void performWhQuery(String s, Map<String, String> map) {
}
@Override
public void performValidity(String s, Map<String, String> map) {
}
@Override
public void performEntityRecognizer(String s, Map<String, String> map) {
}
}
|
77f8fee8-10b1-404b-b197-2e40d3a111e7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-30 00:19:40", "repo_name": "knmuni/MyProjectWorkspace", "sub_path": "/src/main/java/com/test/springboot/mybatis/resource/EmployeeResource.java", "file_name": "EmployeeResource.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "c73b64eb6030a332014d70f11fb2ee458d963804", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/knmuni/MyProjectWorkspace | 218 | FILENAME: EmployeeResource.java | 0.245085 | package com.test.springboot.mybatis.resource;
import java.util.List;
import org.apache.ibatis.type.MappedTypes;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.test.springboot.mybatis.mapper.EmployeeMapper;
import com.test.springboot.mybatis.model.Employee;
@MappedTypes(Employee.class)
@MapperScan("com.test.springboot.mybatis.mapper")
@RestController
@RequestMapping("/rest/employee")
public class EmployeeResource {
private EmployeeMapper employeeMapper;
public EmployeeResource(EmployeeMapper employeeMapper) {
this.employeeMapper = employeeMapper;
}
@GetMapping("/all")
public List<Employee> getAll() {
return employeeMapper.findAll();
}
@GetMapping("/update")
private List<Employee> update() {
Employee employee = new Employee();
employee.setFistName("Nadhamuni");
employee.setLastName("Kothapalle");
employee.setDept("MCA");
employeeMapper.insert(employee);
return employeeMapper.findAll();
}
}
|
16bbad0a-52ee-4ffe-a6d8-ee52122ec501 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-21 23:34:14", "repo_name": "qiuchili/ggnn_graph_classification", "sub_path": "/program_data/JavaProgramData/20/45.java", "file_name": "45.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 82, "lang": "en", "doc_type": "code", "blob_id": "d347c2eeed0ece3924174600b95038907429ed43", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/qiuchili/ggnn_graph_classification | 438 | FILENAME: 45.java | 0.280616 | package <missing>;
public class GlobalMembers
{
public static void insert(String st1, String st2)
{
int i;
int m;
int n;
char max;
m = st1.length();
max = st1[0];
n = m - 1;
for (i = 0;i < m;i++)
{
if (st1[i].compareTo(max) > 0)
{
max = st1[i];
n = i;
}
}
for (i = 0;i <= n;i++)
{
System.out.printf("%c",st1[i]);
}
for (i = 0;i < 3;i++)
{
System.out.printf("%c",st2[i]);
}
for (i = n + 1;i < m;i++)
{
System.out.printf("%c",st1[i]);
}
System.out.print("\n");
}
public static void Main()
{
char[][] st1 = new char[50][10];
char[][] st2 = new char[50][4];
int i;
int j;
int k;
char p;
while ((st1[i][0] = System.in.read()) != EOF)
{
for (j = 1;;j++)
{
if ((p = System.in.read()) != ' ')
{
st1[i][j] = p;
}
else
{
st1[i][j] = '\0';
break;
}
}
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
st2[i] = tempVar.charAt(0);
}
i++;
p = System.in.read();
}
k = i;
for (i = 0;i < k;i++)
{
insert(st1[i], st2[i]);
}
}
}
|
a9e0ae9b-54fc-4c7e-8133-0ee7b70991a1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-15 10:20:49", "repo_name": "sdotolo71/learngit_myrep", "sub_path": "/src/main/java/com/example/base/components/Alien.java", "file_name": "Alien.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "611fe0496b4bd6b7123b7555fd1932af6463a0f9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sdotolo71/learngit_myrep | 269 | FILENAME: Alien.java | 0.279042 | package com.example.base.components;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("A1")
@Scope("singleton")
public class Alien {
private int aid;
private String aname;
private String tech;
@Autowired
@Qualifier("L1")
private Laptop lap;
public int getAid() {
return aid;
}
public void setAid(int aid) {
this.aid = aid;
}
public String getAname() {
return aname;
}
public void setAname(String aname) {
this.aname = aname;
}
public String getTech() {
return tech;
}
public void setTech(String tech) {
this.tech = tech;
}
public Laptop getLap() {
return lap;
}
public void setLap(Laptop lap) {
this.lap = lap;
}
public Alien() {
super();
System.out.println("alien constructor called");
}
@Override
public String toString() {
return "Alien [aid=" + aid + ", aname=" + aname + ", tech=" + tech + ", lap=" + lap + "]";
}
}
|
6cbd7d1f-f6fd-42ee-b8ec-421b0be5dd02 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-16 07:18:24", "repo_name": "Harjot-kaur-code/jewelleryshoppingproject", "sub_path": "/src/java/changestatus.java", "file_name": "changestatus.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "0e86a661e6fd100a45a52dcaf52c302371596a12", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Harjot-kaur-code/jewelleryshoppingproject | 201 | FILENAME: changestatus.java | 0.275909 |
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import vmm.DBLoader;
/**
*
* @author harjot
*/
@MultipartConfig
public class changestatus extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
try
{
PrintWriter out = response.getWriter();
String skid = request.getParameter("skid");
String status = request.getParameter("status");
ResultSet rs = DBLoader.executeQuery("select * from shopkeeper where skid='" + skid +"'");
rs.next();
rs.updateString("status", status);
rs.updateRow();
out.println("success");
}
catch (Exception e) {
e.printStackTrace();
}
}
}
|
4ade0d2d-4e1b-4027-bb7b-2e43652c2e4b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-05 05:05:41", "repo_name": "botukarajesh/food-delivery", "sub_path": "/src/main/java/com/food/delivery/service/impl/RestaurantServiceImpl.java", "file_name": "RestaurantServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "b218123c16541edce437b74939861f135238883f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/botukarajesh/food-delivery | 172 | FILENAME: RestaurantServiceImpl.java | 0.293404 | package com.food.delivery.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.food.delivery.entity.RestaurantEntity;
import com.food.delivery.repository.RestaurantRepository;
import com.food.delivery.service.RestaurantService;
@Service
public class RestaurantServiceImpl implements RestaurantService{
private RestaurantRepository restaurantRepository;
@Autowired
public RestaurantServiceImpl(RestaurantRepository restaurantRepository) {
this.restaurantRepository = restaurantRepository;
}
@Override
public List<RestaurantEntity> allRestaurants() {
return restaurantRepository.findAll();
}
@Override
public List<RestaurantEntity> searchByRating(int rating) {
return restaurantRepository.findByRating(rating);
}
@Override
public List<RestaurantEntity> searchByDestination(String destination) {
return restaurantRepository.findByLocation(destination);
}
}
|
1eabc63f-b194-40ac-af5f-2d80b3e8d84b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-15 01:19:35", "repo_name": "lliule/rpc", "sub_path": "/src/test/java/zookeeper/ZookeeperClientDemo.java", "file_name": "ZookeeperClientDemo.java", "file_ext": "java", "file_size_in_byte": 1329, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "d6839b2e2bca39e5c958ce84f007a876d4eba1b0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lliule/rpc | 388 | FILENAME: ZookeeperClientDemo.java | 0.264358 | package zookeeper;
import org.I0Itec.zkclient.IZkDataListener;
import org.I0Itec.zkclient.ZkClient;
import org.junit.Test;
/**
* @author leliu
*/
public class ZookeeperClientDemo {
@Test
public void test() throws InterruptedException {
String zkServer = "106.12.204.20:2181";
int connectionTimeout = 3000;
ZkClient zkClient = new ZkClient(zkServer, connectionTimeout);
String path = "/zk-data";
if(zkClient.exists(path)) {
zkClient.delete(path);
}
// 创建持久节点
zkClient.createPersistent(path);
// 节点写入数据
zkClient.writeData(path, "test_data_1");
// 读取数据,第二个参数表明如果该节点不存在,将返回null
String data = zkClient.readData(path, true);
System.out.println(data);
// 注册监听器,监听数据变化
zkClient.subscribeDataChanges(path, new IZkDataListener() {
@Override
public void handleDataChange(String dataPath, Object obj) {
System.out.println("handle data change, dataPath = " + dataPath + " data: " + obj);
}
@Override
public void handleDataDeleted(String dataPath) {
System.out.println("handle data deleted, dataPath: " + dataPath);
}
});
// 修改数据
zkClient.writeData(path, "test_data_2");
Thread.sleep(1000);
// 删除节点
zkClient.delete(path);
Thread.sleep(1000);
}
}
|
b1fe035f-92fa-4e0b-a086-1c87b9d39301 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-07 12:37:29", "repo_name": "The-Neo-Noir/my-coding-practise", "sub_path": "/src/main/java/com/aneonoir/dsalgo/practise/linkedlist/InerSectionOfTwoSortedList.java", "file_name": "InerSectionOfTwoSortedList.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "77075fa68a21229dea482ab611c358978ddf7b32", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/The-Neo-Noir/my-coding-practise | 231 | FILENAME: InerSectionOfTwoSortedList.java | 0.261331 | package com.aneonoir.dsalgo.practise.linkedlist;
import java.util.HashSet;
/**
* link:
*/
public class InerSectionOfTwoSortedList {
Node head = new Node(0); // object of LinkedList having Intersection of two LinkedLists
// Function to find Intersection of two LinkedLists
void getIntersection(Node head1, Node head2)
{
HashSet<Integer> set = new HashSet<>();
HashSet<Integer> set2 = new HashSet<>();
while(head1!=null){
set.add(head1.value);
head1=head1.next;
}
Node tail=null;
while(head2!=null){
if (set.contains(head2.value) && !set2.contains(head2.value)) {
if(head==null){
set2.add(head2.value);
head = new Node(head2.value);
tail=head;
}else{
set2.add(head2.value);
Node temp = new Node(head2.value);
tail.next=temp;
tail=tail.next;
}
}
head2=head2.next;
}
}
}
|
1b671808-2b70-4256-a10f-6567b801a94f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-02 10:26:20", "repo_name": "vmyla/DropwizardTest", "sub_path": "/src/main/java/com/test/dropwizardtest/config/ManagedPersistenceService.java", "file_name": "ManagedPersistenceService.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f4038dd360106f4d0a56adc019315577f3cebad2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vmyla/DropwizardTest | 244 | FILENAME: ManagedPersistenceService.java | 0.26971 | package com.test.dropwizardtest.config;
import com.google.inject.Inject;
import com.google.inject.Provider;
import io.dropwizard.lifecycle.Managed;
/**
* Created by venkateswara.km on 01/02/16.
*/
public class ManagedPersistenceService implements Managed{
private Provider<PersistenceServiceLifeCycle> persistenceServiceLifeCycleProvider;
@Inject
public ManagedPersistenceService(Provider<PersistenceServiceLifeCycle> persistenceServiceLifeCycleProvider){
this.persistenceServiceLifeCycleProvider = persistenceServiceLifeCycleProvider;
}
/**
* Starts the object. Called <i>before</i> the application becomes available.
*
* @throws Exception if something goes wrong; this will halt the application startup.
*/
@Override
public void start() throws Exception {
this.persistenceServiceLifeCycleProvider.get().start();
}
/**
* Stops the object. Called <i>after</i> the application is no longer accepting requests.
*
* @throws Exception if something goes wrong.
*/
@Override
public void stop() throws Exception {
this.persistenceServiceLifeCycleProvider.get().stop();
}
}
|
318aec10-84b8-4400-9357-03914c854947 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-09-01 06:29:10", "repo_name": "liweinan0423/AppFactory", "sub_path": "/src/com/appfactory/library/view/TabView.java", "file_name": "TabView.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "271b4bd9e75c6e7e9c57cb4334bc6e398ca55b05", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liweinan0423/AppFactory | 234 | FILENAME: TabView.java | 0.295027 | package com.appfactory.library.view;
import android.content.Context;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class TabView extends RelativeLayout {
private ImageView image;
private TextView text;
public TabView(Context context, String str, int imageId) {
super(context);
this.image = new ImageView(context);
this.text = new TextView(context);
RelativeLayout.LayoutParams imageParams = new RelativeLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
imageParams.addRule(RelativeLayout.ALIGN_PARENT_TOP,
RelativeLayout.TRUE);
imageParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
RelativeLayout.LayoutParams textParams = new RelativeLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
textParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM,
RelativeLayout.TRUE);
textParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
image.setImageResource(imageId);
text.setText(str);
text.setTextColor(context.getResources().getColorStateList(android.R.color.white));
text.setTextSize(12.0F);
this.addView(image, imageParams);
this.addView(text, textParams);
}
}
|
c1bfc843-48e7-4f3a-a702-b0c31c4c0b11 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-12 21:58:36", "repo_name": "Minehut/Skellett", "sub_path": "/src/main/java/com/gmail/thelimeglass/SkellettPacket.java", "file_name": "SkellettPacket.java", "file_ext": "java", "file_size_in_byte": 1069, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "9b68b28324410f955b7fe61c41bf87c05b13c5f6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Minehut/Skellett | 245 | FILENAME: SkellettPacket.java | 0.256832 | package com.gmail.thelimeglass;
import java.io.Serializable;
public class SkellettPacket implements Serializable {
private static final long serialVersionUID = -7377209366283539512L;
private final Boolean returnable;
private final Object object;
private final Object settable;
private final SkellettPacketType type;
public SkellettPacket(Boolean returnable, Object object, SkellettPacketType type) {
this.returnable = returnable;
this.object = object;
this.type = type;
this.settable = null;
}
public SkellettPacket(Boolean returnable, Object object, Object settable, SkellettPacketType type) {
this.returnable = returnable;
this.object = object;
this.type = type;
this.settable = settable;
}
public Boolean isReturnable() {
return returnable;
}
public Object getObject() {
return object;
}
public SkellettPacketType getType() {
return type;
}
public Object getSetObject() {
return settable;
}
}
|
2b7ef354-af03-4665-a748-8e7e374a4d71 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-06 09:22:13", "repo_name": "yufengqi/kb", "sub_path": "/kb-core/src/main/java/cn/damai/kb/core/entity/Topic.java", "file_name": "Topic.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 68, "lang": "en", "doc_type": "code", "blob_id": "dc8d25829198ec440b935873be4065e0fdd4a7f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yufengqi/kb | 310 | FILENAME: Topic.java | 0.280616 | package cn.damai.kb.core.entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @author 王惠
* @version 创建时间:2014年8月27日 上午10:49:31
* @className Topic.java
*/
public class Topic implements Serializable {
/**
*
*/
private static final long serialVersionUID = 5188170620752042578L;
public Topic() {
super();
}
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public List<TopicProblem> getTopicpro() {
return topicproblem;
}
public void setTopicproblem(List<TopicProblem> topicproblem) {
this.topicproblem = topicproblem;
}
public List<UserTopic> getUserTopic() {
return userTopic;
}
public void setUserTopic(List<UserTopic> userTopic) {
this.userTopic = userTopic;
}
private String name;
private Date time;
private List<TopicProblem> topicproblem;
private List<UserTopic> userTopic;
}
|
46cea73d-7b16-42cc-9f0d-15557ec6e03a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-28 07:01:13", "repo_name": "0Gz2bflQyU0hpW/portal", "sub_path": "/datacubic/src/main/java/com/weibo/dip/data/platform/datacubic/youku/entity/Result.java", "file_name": "Result.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "815fa042480437dd9c2bd842669f9228392bc999", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/0Gz2bflQyU0hpW/portal | 249 | FILENAME: Result.java | 0.249447 | package com.weibo.dip.data.platform.datacubic.youku.entity;
/**
* @author delia
*/
public class Result {
private String vid;
private String domainid;
private Data data;
public Result() {
}
public Result(String vid, String domainid) {
this.vid = vid;
this.domainid = domainid;
this.data = new Data();
}
public String getVid() {
return vid;
}
public void setVid(String vid) {
this.vid = vid;
}
public String getDomainid() {
return domainid;
}
public void setDomainid(String domainid) {
this.domainid = domainid;
}
public Data getData() {
return data;
}
public void setData(Data data) {
this.data = data;
}
public void setData(String platform, int hour, long count) {
if (platform.equals("android")) {
data.getAndroid().getHour()[hour] = count;
} else if (platform.equals("ios")) {
data.getIos().getHour()[hour] = count;
}
}
}
|
0c9710a8-e205-4cb9-ada5-7b58e3a364e3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-12-04 13:05:17", "repo_name": "ElFeesho/CastAnyVid", "sub_path": "/app/src/main/java/fd/com/castanyvid/EditTextCastMediaView.java", "file_name": "EditTextCastMediaView.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "b2b6c8ea322dd7e76511282d63d62edb96a44afc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ElFeesho/CastAnyVid | 238 | FILENAME: EditTextCastMediaView.java | 0.289372 | package fd.com.castanyvid;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class EditTextCastMediaView implements CastMediaPresenter.CastMediaView {
private final EditText castMediaUrl;
private final Button castMediaButton;
private Listener listener;
public EditTextCastMediaView(final EditText castMediaUrl, Button castMediaButton) {
this.castMediaUrl = castMediaUrl;
this.castMediaButton = castMediaButton;
castMediaButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.castMedia(castMediaUrl.getText().toString());
}
});
}
@Override
public void displayMediaUrl(String mediaUrl) {
castMediaUrl.setText(mediaUrl);
}
@Override
public void allowUse() {
castMediaUrl.setEnabled(true);
castMediaButton.setEnabled(true);
}
@Override
public void disallowUse() {
castMediaUrl.setEnabled(false);
castMediaButton.setEnabled(false);
}
@Override
public void setListener(Listener listener) {
this.listener = listener;
}
}
|
7fcf6e37-3235-4b82-98a4-182c1c9385fa | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-02-17 22:30:30", "repo_name": "gorjanz/solved-exercises", "sub_path": "/NP_Labs/src/edu/finki/np/lab1/Transaction.java", "file_name": "Transaction.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "3350c92061b76c00878f56d5f07e0411587f8362", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gorjanz/solved-exercises | 253 | FILENAME: Transaction.java | 0.276691 | package edu.finki.np.lab1;
public abstract class Transaction {
private long fromAccountId;
private long toAccountId;
private String description;
private String amount;
private String provision;
public Transaction(){
}
public Transaction(long from_id, long to_id, String descr, String amount){
fromAccountId = from_id;
toAccountId = to_id;
description = descr;
this.amount = amount;
}
public long getFromAccountId() {
return fromAccountId;
}
public long getToAccountId() {
return toAccountId;
}
public String getAmount() {
return amount;
}
public String getDescription() {
return description;
}
protected void setProvision(String prov){
provision = prov;
}
public String getProvision(){
return provision;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Append:" + getAmount() + "\n");
sb.append("Provision:" + getProvision() + "\n");
sb.append("Description:" + getDescription() + "\n");
sb.append("From:" + getFromAccountId() + "\n");
return sb.toString();
}
}
|
bf976cdd-a2dd-4b2b-b339-8891bac886ee | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-21 15:32:23", "repo_name": "NIKMC/KC", "sub_path": "/app/src/main/java/com/nikmc/kc/ConfirmationActivity.java", "file_name": "ConfirmationActivity.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "5f1247010eaf48556ad0d46f8b43785f1f39d44f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NIKMC/KC | 181 | FILENAME: ConfirmationActivity.java | 0.235108 | package com.nikmc.kc;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
public class ConfirmationActivity extends FragmentActivity {
TextView number;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_confirmation);
number = (TextView) findViewById(R.id.NumberText);
if(getIntent()!= null)
number.setText(getIntent().getStringExtra("number"));
Button btnBack = (Button) findViewById(R.id.btnBack);
btnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(ConfirmationActivity.this, SubmissionForm.class));
finish();
}
});
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.