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 |
|---|---|---|---|---|---|---|
c8a76ae9-21c4-4822-8bfe-4b20726c489a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-05 02:33:10", "repo_name": "jonathanapm/webservice-jpa", "sub_path": "/src/main/java/com/webservicejpa/controller/ProductController.java", "file_name": "ProductController.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "47a150bf0eeb023c56afcda4d38e37d9b8d294bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jonathanapm/webservice-jpa | 173 | FILENAME: ProductController.java | 0.259826 | package com.webservicejpa.controller;
import com.webservicejpa.entities.Product;
import com.webservicejpa.services.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("products")
public class ProductController {
@Autowired
private ProductService productService;
@GetMapping
public ResponseEntity<List<Product>> getAllProducts() {
List<Product> products = productService.findAll();
return ResponseEntity.ok().body(products);
}
@GetMapping("/{id}")
public ResponseEntity<Product> getProductFindById(@PathVariable("id") Long id) {
Product product = productService.findById(id);
return ResponseEntity.ok().body(product);
}
}
|
125db9dc-2c40-41e3-bf0d-4df671d9cf2c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-12 02:29:51", "repo_name": "soldiers1989/my_dev", "sub_path": "/ddf-parent/ddf-common-entity/src/main/java/com/ddf/entity/member/query/AlipayZhimaCreditQuery.java", "file_name": "AlipayZhimaCreditQuery.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "65ea47193143f80e27e673cb1740f21fb97c0de5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/soldiers1989/my_dev | 301 | FILENAME: AlipayZhimaCreditQuery.java | 0.283781 | package com.ddf.entity.member.query;
import java.util.Date;
import com.ddf.entity.base.query.Query;
import com.ddf.entity.member.dto.AlipayZhimaCredit;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* alipay_zhima_credit EntityQuery
* @author robot
* @version 2018-01-17
*/
public class AlipayZhimaCreditQuery extends Query {
private static final long serialVersionUID = 1L;
public AlipayZhimaCreditQuery(){
this.alipayZhimaCredit = new AlipayZhimaCredit();
}
private AlipayZhimaCredit alipayZhimaCredit;
public AlipayZhimaCredit getAlipayZhimaCredit() {
return alipayZhimaCredit;
}
public void setAlipayZhimaCredit(AlipayZhimaCredit alipayZhimaCredit) {
this.alipayZhimaCredit = alipayZhimaCredit;
}
private Date startCreateDate;
private Date endCreateDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date getStartCreateDate() {
return startCreateDate;
}
public void setStartCreateDate(Date startCreateDate) {
this.startCreateDate = startCreateDate;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date getEndCreateDate() {
return endCreateDate;
}
public void setEndCreateDate(Date endCreateDate) {
this.endCreateDate = endCreateDate;
}
} |
dd24c095-dada-4ad5-9166-58aa36e110a1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-30 06:10:04", "repo_name": "pascalgrimaud/jhipster-microservices", "sub_path": "/gateway/src/main/java/io/github/pascalgrimaud/client/config/FeignErrorDecoder.java", "file_name": "FeignErrorDecoder.java", "file_ext": "java", "file_size_in_byte": 1004, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "e5c0385e0ae804a8d30665692d7f6ca95f38d863", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pascalgrimaud/jhipster-microservices | 215 | FILENAME: FeignErrorDecoder.java | 0.246533 | package io.github.pascalgrimaud.client.config;
import feign.Response;
import feign.codec.ErrorDecoder;
import io.github.pascalgrimaud.client.exception.BusinessException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.naming.ServiceUnavailableException;
/**
* Created by pgrimaud on 03/12/16.
*/
public class FeignErrorDecoder implements ErrorDecoder {
private final Logger log = LoggerFactory.getLogger(FeignErrorDecoder.class);
private final ErrorDecoder defaultErrorDecoder = new Default();
@Override
public Exception decode(String methodKey, Response response) {
if (response.status() >= 400 && response.status() <= 499) {
return new BusinessException(response.status(), response.headers(), response.reason(), response);
} else if (response.status() >= 500 && response.status() <= 599) {
return new ServiceUnavailableException();
}
return defaultErrorDecoder.decode(methodKey, response);
}
}
|
bb7bc1ca-2a2a-4722-a85a-492f33c6c821 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-27 01:38:17", "repo_name": "liwj007/szpd", "sub_path": "/src/main/java/com/liwj/szpd/utils/ChinesePinyinUtil.java", "file_name": "ChinesePinyinUtil.java", "file_ext": "java", "file_size_in_byte": 1214, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "df7b1af7611bf6e05eaa4e90b07e7b41a9a900a0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liwj007/szpd | 297 | FILENAME: ChinesePinyinUtil.java | 0.253861 | package com.liwj.szpd.utils;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
public class ChinesePinyinUtil {
/**
* 得到中文首字母,例如"专科"得到zk返回
* @param str 中文字符串
* @return
*/
public static String getPinYinFirstHeadChar(String str) {
HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
format.setCaseType(HanyuPinyinCaseType.UPPERCASE);
StringBuilder sb = new StringBuilder();
char word = str.charAt(0);
String[] pinyinArray = new String[0];
try {
pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word,format);
} catch (BadHanyuPinyinOutputFormatCombination badHanyuPinyinOutputFormatCombination) {
badHanyuPinyinOutputFormatCombination.printStackTrace();
}
if (pinyinArray != null) {
sb.append(pinyinArray[0].charAt(0));
} else {
sb.append(word);
}
return sb.toString();
}
}
|
e2c97566-0ce4-4267-bd4a-43baa8f30775 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-13T22:40:44", "repo_name": "nick-neal/Ubuntu-16-battery-notification", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1050, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "9080b63ca822fce73c5e1063b40fc709f38f5afc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nick-neal/Ubuntu-16-battery-notification | 251 | FILENAME: README.md | 0.239349 | # Ubuntu Desktop 16.04 LTS Battery Notification
A script that will notify you that your battery is getting low on Ubuntu Desktop 16.04.2 LTS
## Setup
To setup this script, you will need to clone the repo, and go into the directory on your computer.
After that, run the following commands:
chmod u+x battery-notification.sh
./battery-notification.sh --install
What these commands will do is set the shell script to executable by the user, and install the script.
The script will install the script to a 'bin' directory in your home directory.
Then, it will install a cron job to call it every 2 minutes.
## Output
* When your battery is between 11-15%, it will tell you to plug in your computer.
* When your battery is between 6-10%, it will alert you that it will shutdown at 5%.
* At 5% it will alert you that your computer is shutting down, and shut down your computer safely.
## Uninstall
To uninstall this script , delete the line that calls '*bn.sh*' from your crontab, and delete the bn.sh script from your '~/bin' directory.
|
494c815e-82f2-4b65-8806-90d1c188c92d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-27 03:54:13", "repo_name": "minhlunso1/Ambulance-NOW", "sub_path": "/app/src/main/java/pinride/minhna/submission/ambulancenow/map/Polyline.java", "file_name": "Polyline.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "258a67401c0c4d0e69d24d6151bb8740248dfcc9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/minhlunso1/Ambulance-NOW | 207 | FILENAME: Polyline.java | 0.228156 | package pinride.minhna.submission.ambulancenow.map;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.SerializedName;
public class Polyline implements Parcelable {
@SerializedName("points")
private String points;
protected Polyline(Parcel in) {
points = in.readString();
}
public static final Creator<Polyline> CREATOR = new Creator<Polyline>() {
@Override
public Polyline createFromParcel(Parcel in) {
return new Polyline(in);
}
@Override
public Polyline[] newArray(int size) {
return new Polyline[size];
}
};
public String getPoints() {
return points;
}
public void setPoints(String points) {
this.points = points;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(points);
}
}
|
28941f54-81a4-4b0a-beab-6235db14baa8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-07 13:54:06", "repo_name": "thaolt267/selecnium-homework", "sub_path": "/demo-web-homework/src/test/java/models/components/global/footer/MenuCustomerServiceComponent.java", "file_name": "MenuCustomerServiceComponent.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "f8663c0c2b550ffa26dddc5c894a58dcffd47144", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/thaolt267/selecnium-homework | 189 | FILENAME: MenuCustomerServiceComponent.java | 0.26971 | package models.components.global.footer;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import java.security.SecureRandom;
import java.util.List;
public class MenuCustomerServiceComponent {
private final WebDriver driver;
private final By customerServiceItemSel = By.cssSelector(".column.customer-service ul li a");
public MenuCustomerServiceComponent(WebDriver driver) {
this.driver = driver;
}
public WebElement customerServiceItem() {
List<WebElement> customerServiceItems = driver.findElements(customerServiceItemSel);
WebElement randomCustomerServiceItem = customerServiceItems.get(new SecureRandom().nextInt(customerServiceItems.size()));
return randomCustomerServiceItem;
}
public void getAllCustomerServiceItems() {
List<WebElement> customerServiceItems = driver.findElements(customerServiceItemSel);
for (WebElement item : customerServiceItems) {
System.out.println(item.getText());
}
}
}
|
d26602a7-826e-423c-945a-92bb554e2edb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-07-31 15:05:34", "repo_name": "TimWoolford/bango", "sub_path": "/bango-test/src/main/java/sonique/bango/matcher/DateMatcher.java", "file_name": "DateMatcher.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "38f441849fee5cdeae0749a4786eaa42d358dddf", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/TimWoolford/bango | 194 | FILENAME: DateMatcher.java | 0.290176 | package sonique.bango.matcher;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;
public abstract class DateMatcher extends TypeSafeMatcher<Date> {
public static DateMatcher theSameDateAs(Date date) {
return new DateMatcher(date) {
protected ZonedDateTime rounded(Date datetime) {
return ZonedDateTime.ofInstant(datetime.toInstant(), ZoneId.systemDefault()).withSecond(0).withNano(0);
}
};
}
private final ZonedDateTime expected;
public DateMatcher(Date expected) {
this.expected = rounded(expected);
}
@Override
protected boolean matchesSafely(Date item) {
return rounded(item).isEqual(expected);
}
protected abstract ZonedDateTime rounded(Date item);
@Override
public void describeTo(Description description) {
description.appendText(" " + expected);
}
}
|
013adaed-5899-4ba7-9bd5-320a2f1ffe9f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-16 00:14:39", "repo_name": "brenonocciolizup/orange-talents-07-template-ecommerce", "sub_path": "/src/main/java/br/com/zupacademy/brenonoccioli/mercadolivre/annotations/UniqueValueValidator.java", "file_name": "UniqueValueValidator.java", "file_ext": "java", "file_size_in_byte": 1174, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "fbc2fedb1bc37b34540d30fcb221dcab0fa51041", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/brenonocciolizup/orange-talents-07-template-ecommerce | 228 | FILENAME: UniqueValueValidator.java | 0.29584 | package br.com.zupacademy.brenonoccioli.mercadolivre.annotations;
import org.springframework.util.Assert;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.List;
public class UniqueValueValidator implements ConstraintValidator<UniqueValue, Object> {
private String domainField;
private Class<?> clazz;
@PersistenceContext
private EntityManager em;
@Override
public void initialize(UniqueValue object) {
domainField = object.field();
clazz = object.domainClass();
}
@Override
public boolean isValid(Object value, ConstraintValidatorContext context) {
Query query = em.createQuery("select 1 from "+clazz.getName()+
" where "+domainField+" =:value");
query.setParameter("value", value);
List<?> list = query.getResultList();
Assert.state(list.size()<=1, "Foi encontrado mais de um "
+clazz+" com o atributo "+domainField+" = "+value);
return list.isEmpty();
}
}
|
a6024645-ad61-4af2-939d-e54e9aabf117 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-07 10:52:22", "repo_name": "aaronrs/ContactOrders", "sub_path": "/src/test/java/net/astechdesign/clients/model/todo/TodosTest.java", "file_name": "TodosTest.java", "file_ext": "java", "file_size_in_byte": 972, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "40d644aa67eec918dfdb269e66419dd255ec118f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aaronrs/ContactOrders | 208 | FILENAME: TodosTest.java | 0.281406 | package net.astechdesign.clients.model.todo;
import net.astechdesign.clients.model.contact.Contact;
import org.junit.Test;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class TodosTest {
@Test
public void add_shouldNormaliseTodos() throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("MMMM yyyy");
Todo todo1 = new Todo(1,1, LocalDate.now(), "note1", "name1", "town1");
Todos todos = new Todos();
todos.add(todo1);
todos.add(todo1);
Map<String, List<Map<Date, List<Map<Contact, List<String>>>>>> todoMap = todos.get();
ArrayList months = new ArrayList<>(todoMap.keySet());
assertThat(months.size(), is(1));
// assertThat(months.get(0), is(sdf.format(from1)));
}
} |
d79da1a0-d0f1-49f0-9f29-acab2d64be05 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-16 03:45:01", "repo_name": "FPhoenixCorneaE/Ignorance", "sub_path": "/LIgnorance/src/main/java/com/livelearn/ignorance/ui/fragment/ImageFragment.java", "file_name": "ImageFragment.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "2fcbfc72a82bd9dc3d7c4a0d3089cdb100af2c8d", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/FPhoenixCorneaE/Ignorance | 227 | FILENAME: ImageFragment.java | 0.194368 | package com.livelearn.ignorance.ui.fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.livelearn.ignorance.R;
import com.livelearn.ignorance.base.BaseFragment;
import com.livelearn.ignorance.ui.fragment.image.TianGouPrettyPictureFragment;
import com.livelearn.ignorance.utils.FragmentUtils;
/**
* 图片
*/
public class ImageFragment extends BaseFragment {
//天狗美图
private TianGouPrettyPictureFragment tianGouPrettyPictureFragment;
@Override
public int getLayoutResource() {
return R.layout.fragment_image;
}
@Override
public void initLayout(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
tianGouPrettyPictureFragment = new TianGouPrettyPictureFragment();
FragmentUtils.addChildFragment(this, R.id.fl_container, tianGouPrettyPictureFragment, null, false);
}
@Override
public void setListeners() {
}
@Override
public void lazyFetchData() {
}
}
|
e4a30152-a82c-4e47-a0ca-c72250aa507b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-11-23T09:20:32", "repo_name": "dtinblack/RaspberryPi-Notes", "sub_path": "/C/SimpleServer/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1172, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "041aa224206a96b8db58aa732fa4481bb5eab5d5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dtinblack/RaspberryPi-Notes | 279 | FILENAME: README.md | 0.261331 | # Simple Server
Develop a simple sever written in the programming language [C](https://en.wikipedia.org/wiki/C_(programming_language))
## Background
The simple server returns a message for every request a web browser makes.
To connect via telnet ( on the server machine ):
```
telnet 127.0.0.1 5000
```
## Thanks
[Let's Build A Web Server. Part 1.](https://ruslanspivak.com/lsbaws-part1/) - a good description about the process of connecting and communicating with a
server.
[Networking and Socket Programming Tutorial in C](http://www.codeproject.com/Articles/586000/Networking-and-Socket-programming-tutorial-in-C) - describes the data structures and parameters required to configure a simple server.
[Writing a simple Web Server in C](http://blog.manula.org/2011/05/writing-simple-web-server-in-c.html) - helpful starting point for the software development approach taken with this example.
[Beej's Guide to Network Programming Using Internet Sockets: Using Internet Sockets](http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html ) - detailed description of data structures, function calls with software examples.
## Licence
[See Licence](/LICENSE)
|
53053a4f-fa39-40e3-8275-8dfd4d1c2c2b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-07-10T16:36:09", "repo_name": "macmillanpublishers/vba_utilities", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1003, "line_count": 12, "lang": "en", "doc_type": "text", "blob_id": "86be2729067f0b9f0c89d7a60b3b91e99ad60be5", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/macmillanpublishers/vba_utilities | 220 | FILENAME: README.md | 0.205615 | # vba_utilities
Reusable modules and dev utilities for the Macmillan Word template and macros.
## dependencies
Externally produced modules that must be incorporated into the main Utilities template file, but which are not part of this repo. Currently includes the wonderful [VBA-JSON](https://github.com/VBA-tools/VBA-JSON) and [VBA-Dictonary](https://github.com/VBA-tools/VBA-Dictionary). If you clone this repo, be sure to manually add the primary modules from those projects in the `/dependencies` directory, the contents of which are not tracked here.
## Utilities
A series of modules containing classes and functions required for other Macmillan VBA projects, notably [Word-template](https://github.com/macmillanpublishers/Word-template). Just save the `MacroUtilities.dotm` file in the same directory as your primary template, be sure it is loaded as an add-in, and you can call procedures in the format `Project.Module.Procedure`.
## Dev Tools
A series of macros to help with VBA development.
|
cc702fab-1676-4eb8-ad52-db9cebef2770 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-14 13:50:21", "repo_name": "skok1025/MeetingWebProject", "sub_path": "/src/com/meeting/mypage/ManagerSOS.java", "file_name": "ManagerSOS.java", "file_ext": "java", "file_size_in_byte": 1195, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "70a2c8546e3d1d86531b3825dbeb0020929bbe3c", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/skok1025/MeetingWebProject | 237 | FILENAME: ManagerSOS.java | 0.288569 | package com.meeting.mypage;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
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 javax.servlet.http.HttpSession;
import com.meeting.mypage.model.ManagerDTO;
import com.meeting.mypage.model.MypageDAO;
/**
* 매니저 SOS 관련 Servlet 클래스
* @author 김석현
*
*/
@WebServlet("/mypage/managersos.do")
public class ManagerSOS extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
HttpSession session = req.getSession();
MypageDAO dao = new MypageDAO();
ManagerDTO mdto = dao.getManagerInfo(session.getAttribute("id").toString());
String cseq = dao.getCseq(session.getAttribute("id").toString());
req.setAttribute("mdto", mdto);
req.setAttribute("cseq", cseq);
RequestDispatcher dispatcher = req.getRequestDispatcher("/WEB-INF/view/mypage/managersos.jsp");
dispatcher.forward(req, resp);
}
} |
51da1d28-f9f4-4eb9-bf10-29f545d256d7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-01-28 06:59:27", "repo_name": "wsy121250155/lovecat", "sub_path": "/app_framework_demo/src/com/ailk/ec/unitdesk/models/http/param/StrInst.java", "file_name": "StrInst.java", "file_ext": "java", "file_size_in_byte": 1174, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "9fb964fe48ed0ef1aea1400deb968016f511adff", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/wsy121250155/lovecat | 280 | FILENAME: StrInst.java | 0.258326 | package com.ailk.ec.unitdesk.models.http.param;
public class StrInst {
public String defShowUrl;
public String showSize;
public String clickUrl;
public String serviceCode;
public String BgColor;
public int funcId;
public String iosLocation;
public int sortNum;
public String instName;
public String instTypeId;
public String clientUri;
public String bindAccountServiceCode;
public String appDownloadAddress;
public StrInst(String showSize, String clickUrl, String serviceCode,
String bgColor, int funcId, String instName, String iosLocation,
int sortNum, String defShowUrl, String insttypeId,
String clientUri, String bindAccountServiceCode,
String appDownloadAddress) {
super();
this.showSize = showSize;
this.clickUrl = clickUrl;
this.instName = instName;
this.serviceCode = serviceCode;
BgColor = bgColor;
this.funcId = funcId;
this.iosLocation = iosLocation;
this.sortNum = sortNum;
this.defShowUrl = defShowUrl;
this.instTypeId = insttypeId;
this.clientUri = clientUri;
this.bindAccountServiceCode = bindAccountServiceCode;
this.appDownloadAddress = appDownloadAddress;
}
public StrInst() {
super();
}
}
|
10910e50-0e66-4b3d-badc-9236a2a7f26f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-14 17:37:26", "repo_name": "albertoruvel/shakepoint-machine-connector", "sub_path": "/src/main/java/com/shakepoint/web/io/data/entity/Machine.java", "file_name": "Machine.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "5ac1c971248fbd969cee43c014f9ab80515774f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/albertoruvel/shakepoint-machine-connector | 256 | FILENAME: Machine.java | 0.250913 | package com.shakepoint.web.io.data.entity;
import javax.persistence.*;
import java.util.List;
@Entity(name = "Machine")
@Table(name = "machine")
public class Machine {
@Id
private String id;
private String name;
@Column(name = "technician_id")
private String technicianId;
@OneToMany(fetch = FetchType.EAGER)
@JoinTable(name = "machine_product",
joinColumns = @JoinColumn(name = "machine_id"),
inverseJoinColumns = @JoinColumn(name = "product_id")
)
private List<Product> products;
public Machine() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<Product> getProducts() {
return products;
}
public void setProducts(List<Product> products) {
this.products = products;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTechnicianId() {
return technicianId;
}
public void setTechnicianId(String technicianId) {
this.technicianId = technicianId;
}
}
|
e357f01b-1aec-44ea-9ecb-288b75f42e26 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-01-15T19:50:44", "repo_name": "IsabellaCaspari/isabellas-angular-app", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1066, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "207ceed7794fa5ea8462ba94b3b4c11bb0337509", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/IsabellaCaspari/isabellas-angular-app | 257 | FILENAME: README.md | 0.206894 | # IsabellasAngularApp
[](https://github.com/IsabellaCaspari/isabellas-angular-app/actions)
This is my personal website, it contains information about me and my portfolio is shown.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run ` ng build --output-path=docs/` to build the project. The build artifacts will be stored in the `docs/` directory. Use the `--prod` flag for a production build.
It starts a github pipeline and updates the website `https://isabellacaspari.github.io/`.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
a76ff521-c7dc-478d-9b78-0a63d77bc6d2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-11 00:12:14", "repo_name": "gdrte/rapi-ca-sa", "sub_path": "/src/main/java/rapi/ca/certificate/model/PKCS12CertificateRequest.java", "file_name": "PKCS12CertificateRequest.java", "file_ext": "java", "file_size_in_byte": 1172, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "bbf06d94f08b035ba6d34b65bf6eef950145d778", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gdrte/rapi-ca-sa | 247 | FILENAME: PKCS12CertificateRequest.java | 0.243642 | package rapi.ca.certificate.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang.builder.ToStringBuilder;
import java.io.Serializable;
public class PKCS12CertificateRequest implements Serializable {
private static final long serialVersionUID = -8359388328788919401L;
Certificate certificate;
String caBundle;
String password;
@JsonProperty("caBundle")
public String getCaBundle() {
return caBundle;
}
public Certificate getCertificate() {
return certificate;
}
@JsonProperty("caBundle")
public PKCS12CertificateRequest setCaBundle(final String certBundle) {
this.caBundle = certBundle;
return this;
}
public PKCS12CertificateRequest setCertificate(final Certificate certificate) {
this.certificate = certificate;
return this;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
final ToStringBuilder builder = new ToStringBuilder(this);
builder.append("certificate", certificate).append("caBundle", caBundle);
return builder.toString();
}
}
|
7539d041-41f5-4f64-89fc-35d5d7b31706 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-04 06:48:48", "repo_name": "wingjay/jayAndroid", "sub_path": "/app/src/main/java/com/wingjay/jayandroid/javaresearch/JavaResearchActivity.java", "file_name": "JavaResearchActivity.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "13ef3d4dd66d71d75ea6fc9ae6d20ba438ed030a", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wingjay/jayAndroid | 203 | FILENAME: JavaResearchActivity.java | 0.249447 | package com.wingjay.jayandroid.javaresearch;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import com.wingjay.jayandroid.BaseActivity;
/**
* Created by Jay on 3/22/17.
*/
public class JavaResearchActivity extends BaseActivity {
final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
Log.i("jaydebug", msg.toString());
super.handleMessage(msg);
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
Looper.prepare();
Handler workerThread = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
}
};
Looper.loop();
}
});
thread.start();
}
}
|
132b913e-c3c4-4e10-8e4f-17f2ad0e3d9c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-08-02 23:58:56", "repo_name": "mirzaakhena/Snake-Game-Multiplayer", "sub_path": "/src/main/java/com/mirza/snakemultiplayer/logic/Player.java", "file_name": "Player.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "e930d878acb0807ffb30ccd34e40e0c7d00b304a", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/mirzaakhena/Snake-Game-Multiplayer | 246 | FILENAME: Player.java | 0.246533 | package com.mirza.snakemultiplayer.logic;
import java.awt.Color;
import java.io.Serializable;
import java.net.InetAddress;
public class Player implements Serializable {
private static final long serialVersionUID = 1L;
private int id;
private String name;
private InetAddress ipAddress;
private Color color;
public Player(int id, String name, InetAddress ipAddress, Color color) {
this.id = id;
this.name = name;
this.ipAddress = ipAddress;
this.color = color;
}
public Player(String name) {
this.id = -1;
this.name = name;
this.ipAddress = null;
this.color = null;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public InetAddress getIpAddress() {
return ipAddress;
}
public void setIpAddress(InetAddress ipAddress) {
this.ipAddress = ipAddress;
}
public Color getColor() {
return color;
}
public void setColor(Color color) {
this.color = color;
}
}
|
9c611883-cf77-4223-994f-60d6416d8a3c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-08-26T16:07:28", "repo_name": "abbeygirl/nzedb", "sub_path": "/Release-Management.md", "file_name": "Release-Management.md", "file_ext": "md", "file_size_in_byte": 995, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "b799e713be17190d0273e6c54c71a2c4acb5e167", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/abbeygirl/nzedb | 297 | FILENAME: Release-Management.md | 0.256832 | # Managing Your Releases
Here a few commands/scripts that are useful for general day-to-day operations.
### Find a specific release based on ID
```
for i in {1..9999}; do ps aux | grep postprocess_new.php | grep -v grep | sed -e 's/://g' | awk '{print $13,$15 }' | grep 4751258; done
```
outputs the ID and GUID of the release.
or via SQL
```
mysql> SELECT ID,passwordstatus,name,searchname,guid FROM releases WHERE ID = 4751258;
```
### Delete a specific release
```
cd misc/testing/DB
php delete_release.php guid equals 1f374b691cdba39757e5a7a59978ceb89373fb20
```
### List releases added during the last day
```
mysql> select ID,name from releases where adddate > DATE_SUB(NOW(), INTERVAL 1 day);
```
### Crossposted or Duplicate Releases
_View_
```
mysql> select name,fromname,size,count(*) as dupes from releases group by name,fromname,size HAVING dupes > 1;
```
Note: The above query finds both duplicates and crossposts. A true duplicate matches on group, a crosspost does not. |
d5c0a099-0a7e-454f-a1ff-c8b23891561b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-20 07:13:39", "repo_name": "zyyoona7/Jokes", "sub_path": "/app/src/main/java/com/zyyoona7/jokes/adapter/MainVpAdapter.java", "file_name": "MainVpAdapter.java", "file_ext": "java", "file_size_in_byte": 1174, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "a6d98c8babf3d13f04f6679dd67f611be3aef50c", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/zyyoona7/Jokes | 262 | FILENAME: MainVpAdapter.java | 0.291787 | package com.zyyoona7.jokes.adapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.zyyoona7.jokes.module.imageJoke.ImageJokeFragment;
import com.zyyoona7.jokes.module.textJoke.TextJokeFragment;
import java.util.ArrayList;
import java.util.List;
/**
* Created by User on 2016/6/29.
*/
public class MainVpAdapter extends FragmentPagerAdapter {
private List<String> titles;
public MainVpAdapter(FragmentManager fm, List<String> titles) {
super(fm);
if(titles!=null){
this.titles=titles;
}else {
this.titles=new ArrayList<>();
}
}
@Override
public Fragment getItem(int position) {
if (position==0) {
return TextJokeFragment.newInstance();
}else if(position==1){
return ImageJokeFragment.newInstance();
}else {
return null;
}
}
@Override
public int getCount() {
return titles.size();
}
@Override
public CharSequence getPageTitle(int position) {
return titles.get(position);
}
}
|
e8aaf297-5ecd-4e1e-b0f6-6ab2f878ba41 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-04 01:48:55", "repo_name": "codenbox/MavenProject", "sub_path": "/src/test/java/codenbox/MavenProject/WdManagerTest.java", "file_name": "WdManagerTest.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "e680c207a6ed637ddccd60b92feedd6d82e6627b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/codenbox/MavenProject | 270 | FILENAME: WdManagerTest.java | 0.272799 | package codenbox.MavenProject;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import io.github.bonigarcia.wdm.WebDriverManager;
public class WdManagerTest {
public WebDriver driver;
@BeforeMethod
public void initializeDriver() {
// System.setProperty("webdriver.chrome.driver",
// "C:\\Users\\SeleniumWork\\chromedriver.exe");
WebDriverManager.chromedriver().setup();
/*
* WebDriverManager.chromedriver().setup();
* WebDriverManager.firefoxdriver().setup();
* WebDriverManager.operadriver().setup(); WebDriverManager.phantomjs().setup();
* WebDriverManager.edgedriver().setup(); WebDriverManager.iedriver().setup();
*/
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.manage().timeouts().implicitlyWait(6, TimeUnit.SECONDS);
}
@Test
public void codenboxTest() {
driver.get("http://codenboxautomationlab.com/");
System.out.println(driver.getTitle());
}
@AfterMethod
public void tearDown() {
driver.quit();
}
}
|
2c5b39a6-97c7-4c94-a8c4-a8e0aac3bf87 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-15 03:05:48", "repo_name": "aasheng24/AndroidNews", "sub_path": "/ShengNews/app/src/main/java/a/a/sheng/shengnews/presenter/wx/WxDetailArticlePresenter.java", "file_name": "WxDetailArticlePresenter.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "8d046fc5193ac6bf3a79eaf0a5837cdec748acd6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aasheng24/AndroidNews | 233 | FILENAME: WxDetailArticlePresenter.java | 0.247987 | package a.a.sheng.shengnews.presenter.wx;
import javax.inject.Inject;
import a.a.sheng.shengnews.base.presenter.BasePresenter;
import a.a.sheng.shengnews.contract.wx.WxDetailContract;
import a.a.sheng.shengnews.core.DataManager;
import a.a.sheng.shengnews.core.bean.main.collect.FeedArticleData;
public class WxDetailArticlePresenter extends BasePresenter<WxDetailContract.View>
implements WxDetailContract.Presenter{
private DataManager mDataManager;
@Inject
public WxDetailArticlePresenter(DataManager dataManager) {
super(dataManager);
this.mDataManager = dataManager;
}
@Override
public void getWxSearchSumData(int id, int page, String k) {
}
@Override
public void getWxDetailData(int id, int page, boolean isShowError) {
}
@Override
public void addCollectArticle(int position, FeedArticleData feedArticleData) {
}
@Override
public void cancelCollectArticle(int position, FeedArticleData feedArticleData) {
}
}
|
0c33319e-ad82-4aa8-8641-82936b4c9b88 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-28 11:14:35", "repo_name": "ashishmehta11/Unit-Converter", "sub_path": "/app/src/main/java/com/project/unitconverter/main_activity/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "c370fd2aef5f548e4dced5dc47d1134db3b2ff4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ashishmehta11/Unit-Converter | 194 | FILENAME: MainActivity.java | 0.294215 | package com.project.unitconverter.main_activity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider;
import com.project.unitconverter.R;
import com.project.unitconverter.databinding.ActivityMainBinding;
/**
* The Main Activity where the one and only screen of the application is controlled.
* Other parts of the screen are divided into fragments like FragmentNumPad
*/
public class MainActivity extends AppCompatActivity {
MainActivityViewModel viewModel;
ActivityMainBinding binding; // Data binding object
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
viewModel = new ViewModelProvider(this).get(MainActivityViewModel.class);
// Initializing the binding instance with the layout to be used.
binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
// Setting test class instance as the variable to be used by ActivityMainBinding
binding.setData(viewModel.getData());
}
} |
4dd60e6b-a548-48d3-9f0d-aee8721b3a90 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-28 18:41:55", "repo_name": "eghazal/WorkflowCnam", "sub_path": "/src/main/java/com/logicbig/example/workflowList.java", "file_name": "workflowList.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "eaae0f8f90b45ab52c75210ef35bde086e29d6cb", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/eghazal/WorkflowCnam | 158 | FILENAME: workflowList.java | 0.23092 | package com.logicbig.example;
import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken;
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 javax.servlet.http.HttpSession;
import java.io.IOException;
@WebServlet(urlPatterns = {"/workflowMain"})
public class workflowList extends HttpServlet {
@Override
protected void doPost (HttpServletRequest req,
HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/html");
try {
String idToken = req.getParameter("id_token");
GoogleIdToken.Payload payLoad = IdTokenVerifierAndParser.getPayload(idToken);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
} |
ade89e14-8738-4272-839e-4fb88a159699 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-22 11:51:22", "repo_name": "pan2636172514/babasport", "sub_path": "/babasport-console/src/main/java/cn/itcast/core/controller/SkuController.java", "file_name": "SkuController.java", "file_ext": "java", "file_size_in_byte": 1207, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "6d0b3dfaaf3c60c9edeb6718aa05f4ab0e691fb4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pan2636172514/babasport | 253 | FILENAME: SkuController.java | 0.284576 | package cn.itcast.core.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import cn.itcast.core.pojo.product.Sku;
import cn.itcast.core.service.product.SkuService;
/**
* 库存管理
* @author 潘金鑫
*
*/
@Controller
public class SkuController {
@Autowired
private SkuService skuService;
//去库存页面
@RequestMapping(value = "/sku/list.do")
public String list(Long productId , Model model){
List<Sku> skus = skuService.selectSkuListByProduct(productId);
model.addAttribute("skus", skus);
return "/sku/list";
}
//修改库存
@RequestMapping(value = "/sku/addSku.do")
public void updateSkuById(Sku sku,HttpServletResponse response)throws Exception{
skuService.updateSkuById(sku);
JSONObject jo = new JSONObject();
jo.put("message", "1");
response.setContentType("application/json;charset=UTF-8");
response.getWriter().write(jo.toString());
}
}
|
339eb35a-9404-4870-ab0a-36ad45d96e88 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-08 04:28:18", "repo_name": "jyothish6190/tracer", "sub_path": "/app/src/main/java/com/exalture/tracer/myReceiver.java", "file_name": "myReceiver.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "46d11bb8c15c0cb61529bca97b9e7d7c25f30933", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jyothish6190/tracer | 223 | FILENAME: myReceiver.java | 0.240775 | package com.exalture.tracer;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
public class myReceiver extends Service{
private static final String ACTION_IN = "android.intent.action.PHONE_STATE";
private static final String ACTION_OUT = "android.intent.action.NEW_OUTGOING_CALL";
private CallBr br_call;
Context context;
@Override
public void onCreate()
{
super.onCreate();
this.context = getApplicationContext();
//br_call = new CallBr();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId)
{
final IntentFilter filter = new IntentFilter();
filter.addAction(ACTION_OUT);
filter.addAction(ACTION_IN);
this.br_call = new CallBr();
this.registerReceiver(this.br_call, filter);
return (START_STICKY);
}
@Override
public IBinder onBind(Intent intent)
{
return null;
}
}
|
a9d5e2a9-ec2f-45a4-afd0-6ac29c85e9d6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-12 19:38:44", "repo_name": "nat32/levelup", "sub_path": "/main/java/com/springapp/controller/HelloController.java", "file_name": "HelloController.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "1c0429b4636a0913c402dc0a0c1b3e96502f2d1a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nat32/levelup | 185 | FILENAME: HelloController.java | 0.235108 | package com.springapp.controller;
import com.springapp.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import java.security.Principal;
@Controller
public class HelloController {
@Autowired
UserService userService;
/**
* L'entree de l'application - redirection vers la page de bienvenue
* @param model
* @return
*/
@RequestMapping(value = "/")
public String index(ModelMap model, HttpServletRequest request) {
Principal principal = request.getUserPrincipal();
String username = principal.getName();
int user_id = userService.getUserIdByName(username);
model.addAttribute("username", username);
model.addAttribute("user_id", user_id);
model.addAttribute("message", "Bienvenue au Level Up!");
return "salut";
}
} |
b4d4699b-e86b-4af1-88d2-3e5c0d33948c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-30 09:04:59", "repo_name": "PeterInfraBIM/IFC_GraphQL_server", "sub_path": "/dataserver/src/main/java/nl/infrabim/ifc/dataserver/models/IfcRelContainedInSpatialStructure.java", "file_name": "IfcRelContainedInSpatialStructure.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "466cc77331f04122eb85123e73b361a27ff64aac", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/PeterInfraBIM/IFC_GraphQL_server | 236 | FILENAME: IfcRelContainedInSpatialStructure.java | 0.258326 | package nl.infrabim.ifc.dataserver.models;
import java.util.List;
import org.springframework.data.mongodb.core.mapping.Field;
public class IfcRelContainedInSpatialStructure extends IfcRoot {
@Field("relatedElements")
private List<Ref> relatedElementsRef;
@Field("relatingStructure")
private Ref relatingStructureRef;
public IfcRelContainedInSpatialStructure() {
super();
}
public IfcRelContainedInSpatialStructure(String id, String type, String globalId, String name, String description) {
super(id, type, globalId, name, description);
}
public List<Ref> getRelatedElementsRef() {
return relatedElementsRef;
}
public void setRelatedElementsRef(List<Ref> relatedElements) {
this.relatedElementsRef = relatedElements;
}
public Ref getRelatingStructureRef() {
return relatingStructureRef;
}
public void setRelatingStructureRef(Ref relatingStructureRef) {
this.relatingStructureRef = relatingStructureRef;
}
public void copyRootValues(IfcRoot root) {
super.copyRootValues(root);
}
}
|
49107a91-b21e-4370-a3d6-62a920829fb7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-07 19:02:34", "repo_name": "lxtlouise/LSA", "sub_path": "/src/HelloAckHandler.java", "file_name": "HelloAckHandler.java", "file_ext": "java", "file_size_in_byte": 1174, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "c5524cb35233f2f4e0760d1e94f195f1ff32f971", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lxtlouise/LSA | 224 | FILENAME: HelloAckHandler.java | 0.23231 | public class HelloAckHandler extends Thread {
protected boolean running = true;
private synchronized boolean isRunning() {
return this.running;
}
public void run() {
while (isRunning()) {
while (!Router.helloAckQueue.isEmpty()) {
Packet helloAck = Router.helloAckQueue.remove(Router.helloAckQueue.size() - 1);
String neighborID = helloAck.srcAddress;
int neighborPort = UI.routerList.get(neighborID);
if(Router.helloAck.containsKey(neighborID)) {
HelloNode hn = Router.helloAck.get(neighborID);
hn.ack = "true";
hn.counter = 0;
// System.out.println("get hello ack from: " + neighborID);
} else {
continue;
}
}
try {
this.sleep(30000);
} catch (InterruptedException e) {
if(!running){
break;
}
}
}
}
public synchronized void shutdown(){
this.running = false;
interrupt();
}
}
|
e7f98d6b-ac9a-40eb-b648-0cc1516ced08 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-17 21:53:12", "repo_name": "Body123/MVVM-dataBinding-training", "sub_path": "/app/src/main/java/com/example/moviesnerds/ui/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "21dcf0a65b0aea6c521b9e05ea477eb54163c20e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Body123/MVVM-dataBinding-training | 164 | FILENAME: MainActivity.java | 0.199308 | package com.example.moviesnerds.ui;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import com.example.moviesnerds.R;
import com.example.moviesnerds.databinding.ActivityMainBinding;
import butterknife.BindView;
import butterknife.ButterKnife;
public class MainActivity extends AppCompatActivity {
MovieViewModel movieViewModel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityMainBinding binding= DataBindingUtil.setContentView(this,R.layout.activity_main);
movieViewModel= new ViewModelProvider(this).get(MovieViewModel.class);
binding.setViewModel(movieViewModel);
binding.setLifecycleOwner(this);
}
}
|
a94022ab-c842-4666-a0ee-52eb5d3ced74 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-07 02:18:41", "repo_name": "zhuzhaoman/websocket_netty", "sub_path": "/SpringbootNettyApplication.java", "file_name": "SpringbootNettyApplication.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "caca655824993521d6a8773a23990c00ea87d9de", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhuzhaoman/websocket_netty | 178 | FILENAME: SpringbootNettyApplication.java | 0.225417 | package com.example.springboot_netty;
import com.example.springboot_netty.server.NettyServer_;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import javax.annotation.Resource;
import java.net.InetSocketAddress;
@SpringBootApplication
public class SpringbootNettyApplication implements CommandLineRunner {
@Value("${netty.port}")
private Integer port;
@Value("${netty.url}")
private String url;
@Resource
private NettyServer_ server;
public static void main(String[] args) {
SpringApplication.run(SpringbootNettyApplication.class, args);
}
@Override
public void run(String... args) throws Exception {
InetSocketAddress address = new InetSocketAddress(url, port);
System.out.println("run..." + url);
server.start(address);
}
}
|
d405e019-b125-40fd-9476-40aefb475ead | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-05 23:31:05", "repo_name": "Sami5/twu-biblioteca-Sami", "sub_path": "/src/com/twu/biblioteca/Book.java", "file_name": "Book.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "8f45a2d9981e77dea610feffdea9339cb2c95dda", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Sami5/twu-biblioteca-Sami | 225 | FILENAME: Book.java | 0.23092 | package com.twu.biblioteca;
public class Book {
private String title;
private String author;
private int year;
public Book(String newTitle, String newAuthor, int newYear) {
setTitle(newTitle);
setAuthor(newAuthor);
setYear(newYear);
//AvailableBooks.addAvailableBook(this);
}
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
public int getYear() {
return year;
}
public void setTitle(String newTitle) {
title = newTitle;
}
public void setAuthor(String newAuthor) {
author = newAuthor;
}
public void setYear(int newYear) {
year = newYear;
}
public String showAll() {
String title = this.getTitle();
String author = this.getAuthor();
int year = this.getYear();
String details = String.format("%-30s%-30s%-20s", title, author, year);
return details;
}
}
|
66244b99-0c80-4421-8431-bc0e889e264e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-16 12:33:45", "repo_name": "imar26/todo-list-cloud-computing", "sub_path": "/src/main/java/com/csye6225/demo/service/AttachmentService.java", "file_name": "AttachmentService.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "ea364cf16ebf78a87b9574c1c8caef6168958acc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/imar26/todo-list-cloud-computing | 186 | FILENAME: AttachmentService.java | 0.258326 | package com.csye6225.demo.service;
import com.csye6225.demo.pojo.Attachment;
import com.csye6225.demo.pojo.Tasks;
import com.csye6225.demo.repositories.AttachmentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@Service
public class AttachmentService {
private AttachmentRepository attachmentRepository;
@Autowired
public AttachmentService(AttachmentRepository attachmentRepository){
this.attachmentRepository = attachmentRepository;
}
//added last
public ArrayList<Attachment> findAttachment(String taskId) {
return (ArrayList<Attachment>) attachmentRepository.findAttachmentByTasks(taskId);
}
public void deleteAttachment(Attachment attachment){
attachmentRepository.delete(attachment);
}
public Attachment findByAttachmentId (String attachmentId) {
return attachmentRepository.findByAttachmentId(attachmentId);
}
}
|
1c863d76-7fc0-4463-a8f0-9938325d8c08 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-24 13:38:50", "repo_name": "bladeszasza/test_cake", "sub_path": "/app/src/main/java/com/waracle/androidtest/StreamUtils.java", "file_name": "StreamUtils.java", "file_ext": "java", "file_size_in_byte": 1056, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "ee92a726d57b6059a745900be423472d2aed5f68", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bladeszasza/test_cake | 226 | FILENAME: StreamUtils.java | 0.242206 | package com.waracle.androidtest;
import android.util.Log;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by Riad on 20/05/2015.
*/
public final class StreamUtils {
private static final String TAG = StreamUtils.class.getSimpleName();
private static final int BUFFER_SIZE = 1024;
// Can you see what's wrong with this???
public static byte[] readUnknownFully(InputStream stream) throws IOException {
ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();
byte[] buffer = new byte[BUFFER_SIZE];
int len = 0;
while ((len = stream.read(buffer)) != -1) {
byteBuffer.write(buffer, 0, len);
}
return byteBuffer.toByteArray();
}
public static void close(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (IOException e) {
Log.e(TAG, e.getMessage());
}
}
}
}
|
24daba45-22c2-4924-8908-4f1fbd0f089a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-18 23:32:27", "repo_name": "DanielDeGaspari/SalesTaxes", "sub_path": "/src/main/test/java/io/github/salestaxes/utils/FormatUtilsTest.java", "file_name": "FormatUtilsTest.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "ae30b39c75b765fb0d1219973252d42c45738376", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DanielDeGaspari/SalesTaxes | 250 | FILENAME: FormatUtilsTest.java | 0.290981 | package io.github.salestaxes.utils;
import io.github.salestaxes.Utils.FormatUtils;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class FormatUtilsTest {
@Test
public void testSlugifyToBeTrueSpecialChar() {
// Setup
final String input = "fóò bâr";
final String expectedResult = "foo-bar";
// Run the test
final String result = FormatUtils.slugify(input);
// Verify the results
assertEquals(expectedResult, result);
}
@Test
public void testSlugifyToBeTrueWhiteSpace() {
// Setup
final String input = " book ";
final String expectedResult = "book";
// Run the test
final String result = FormatUtils.slugify(input);
// Verify the results
assertEquals(expectedResult, result);
}
@Test
public void testSlugifyToBeTrueUpperCase() {
// Setup
final String input = "BOOK";
final String expectedResult = "book";
// Run the test
final String result = FormatUtils.slugify(input);
// Verify the results
assertEquals(expectedResult, result);
}
}
|
f9fe4898-39a2-4fe6-9fa9-762caf652fd6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-27 07:19:30", "repo_name": "proqer/spring-boot-nashorn", "sub_path": "/src/main/java/com/pragmasoft/study/controllers/rest/GlobalExceptionHandler.java", "file_name": "GlobalExceptionHandler.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "69c2cd8359b0f2e48d4f36716be14ee9bcd14ddc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/proqer/spring-boot-nashorn | 199 | FILENAME: GlobalExceptionHandler.java | 0.235108 | package com.pragmasoft.study.controllers.rest;
import com.pragmasoft.study.exception.ScriptCompilationException;
import com.pragmasoft.study.exception.ScriptNotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
public class GlobalExceptionHandler {
private static final Logger LOG = LoggerFactory.getLogger(GlobalExceptionHandler.class);
@ExceptionHandler(ScriptNotFoundException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
public void onScriptNotFoundException(ScriptNotFoundException e) {
LOG.debug("Script with id {} not found", e.getId());
}
@ExceptionHandler(ScriptCompilationException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public String onScriptCompilationException(ScriptCompilationException e) {
LOG.debug("Compilation exception: {}", e.getMessage());
return "Compilation failed: " + e.getMessage();
}
}
|
c188ef10-d4f5-4f56-87ec-445d65861d03 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-17 18:04:14", "repo_name": "pitambar-smartek/Hibernate_Repo", "sub_path": "/WebServiceDemo/src/com/bt/tadds/dao/GetTestResultServiceDAO.java", "file_name": "GetTestResultServiceDAO.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "f9051dd6b7465b7ec232a8b9f2b4686610ade6ed", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pitambar-smartek/Hibernate_Repo | 213 | FILENAME: GetTestResultServiceDAO.java | 0.201813 | package com.bt.tadds.dao;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import oracle.jdbc.OraclePreparedStatement;
public class GetTestResultServiceDAO {
public String getTestResults(String testId,String tarrId){
Connection connection=null;
OraclePreparedStatement oraclePreparedStatement=null;
ResultSet rs=null;
try{
connection.prepareCall("");
}catch(SQLException e){
}finally{
//call close method f connection and preparedStatement object and resultset object
}
return null;
}
public String[] getTestResults(String serviceId){
Connection connection=null;
OraclePreparedStatement oraclePreparedStatement=null;
ResultSet rs=null;
try{
connection.prepareCall("");
//get connection object
//get prepared statement
//get the resultset object
}catch(SQLException e){
}finally{
//call close method f connection and preparedStatement object and resultset object
}
return null;
}
}
|
98d1ef35-359e-49e6-a976-3f50aab580d1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-23 00:25:11", "repo_name": "feitebi/wallet-android", "sub_path": "/app/src/main/java/com/ftb/app/FtbApplication.java", "file_name": "FtbApplication.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "47686fc570929e2df382ec4838dfd92e5e407f21", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/feitebi/wallet-android | 206 | FILENAME: FtbApplication.java | 0.258326 | package com.ftb.app;
import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;
import devliving.online.securedpreferencestore.DefaultRecoveryHandler;
import devliving.online.securedpreferencestore.SecuredPreferenceStore;
/**
* Created by mangoo on 2017/9/5.
*/
public class FtbApplication extends Application {
private static Application instance;
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
@Override
public void onCreate() {
super.onCreate();
instance = this;
try {
SecuredPreferenceStore.init(instance.getApplicationContext(), new DefaultRecoveryHandler());
// TEST clear every time.
// SecuredPreferenceStore.getSharedInstance().edit().clear().commit();
} catch (Exception e) {
e.printStackTrace();
}
}
public static Application getInstance() {
return instance;
}
} |
efa728db-5714-4beb-b0fb-9718ac7fb101 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-30 14:00:19", "repo_name": "rakshitkothari/RadiantAcademy", "sub_path": "/app/src/main/java/com/radiant/testradiant/ApplyNow.java", "file_name": "ApplyNow.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "a48d8dcc6edf052a84f7bf08e951d44f9f4e2419", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rakshitkothari/RadiantAcademy | 206 | FILENAME: ApplyNow.java | 0.196826 | package com.radiant.testradiant;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
public class ApplyNow extends AppCompatActivity {
@SuppressLint("RestrictedApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_apply_now);
getSupportActionBar().setTitle("Radiant Academy");
getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true);
}
public void browser2(View view) {
Intent browserIntent1 = new Intent(Intent.ACTION_VIEW, Uri.parse("https://docs.google.com/forms/d/e/1FAIpQLSc-ipv7wSU5bDZymqP8xOE-QDuqPWqtvIP0EQOQq70UW8Bc6g/viewform"));
startActivity(browserIntent1);
}
@Override
public boolean onSupportNavigateUp() {
onBackPressed();
return true;
}
} |
2cefb1e8-cade-4f05-b0bf-5940e17b3b9f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-12T06:56:19", "repo_name": "jienius/world-expedition", "sub_path": "/server/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1175, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "e2daa562803fd3193ec5d0954a8dcf4fa3e33baa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jienius/world-expedition | 252 | FILENAME: README.md | 0.201813 | ### Node Express template project
This is the backend developed for authentication with Amazon Cognito for User-related activities such as authentication, token validation, getting users, etc.
## About
The backend is equipped with ExpressJS, Typescript and SocketIO to deal with the basic time consuming errors on starting up a project
The backend will automatically compile and run after you save. The setting is in "nodemonConfig" in package.json
You must include the un-tracked .env file into the root folder, it will be provided on request in our Discord group
## How to run
The project has already been set up and ready to run, the main file is index.ts
Run the command `npm install` to initialize the project the first time (and after every pull from the git)
ALWAYS run `npm install` when you pull the project
Run the command `nodemon` for the server to start
## To connect to the database
The .env file must be present
Because of security, the database also only allows certain IP addresses to connect to it, please contact Minh for details
Resource on how to use the database once it's been set up:
https://www.w3schools.com/nodejs/nodejs_mongodb.asp
|
741972d9-48a6-4a06-a0f9-0f55b6ab4293 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-05 11:08:41", "repo_name": "olga6294/JavaTr", "sub_path": "/src/main/java/csvprocessor/Book.java", "file_name": "Book.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "ddb6690028dde00f103e8e25ffe0ed17188e4a93", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/olga6294/JavaTr | 205 | FILENAME: Book.java | 0.259826 | package csvprocessor;
public class Book {
private int id;
private String title;
private String author;
private String format;
private double price;
public Book(int id, String title, String author, String format, double price) {
this.id = id;
this.title = title;
this.author = author;
this.format = format;
this.price = price;
}
public int getId() {
return id;
}
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
public String getFormat() {
return format;
}
public double getPrice() {
return price;
}
@Override
public boolean equals(Object object){
if(!(this instanceof Book))
return false;
if(this.id == ((Book)object).id)
return true;
return false;
}
@Override
public int hashCode(){
return id;
}
}
|
151322f6-3b2d-492c-8ba1-d30da8e8f6fd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-01 08:03:38", "repo_name": "gaoooyh/Java_chatroom", "sub_path": "/chatroom 1/src/connect/JDBC.java", "file_name": "JDBC.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ec6218bb8e4b4185ec738c4c7b085c4c7bcc4f1b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gaoooyh/Java_chatroom | 231 | FILENAME: JDBC.java | 0.262842 | package connect;
import java.sql.Connection;
import java.sql.DriverManager;
public class JDBC {
private static String IP_ADDRESS = "Localhost";
private static String PORT_NUM = "3306";
private static String USER_NAME = "root";
private static String PASSWORD = "161105";
private static String DB_NAME = "chatroom";
String url = "jdbc:mysql://localhost:3306/chatroom";
private static Connection connection;
public static Connection getConnection() {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
connection = DriverManager.getConnection(
"jdbc:mysql://" + IP_ADDRESS + ":" + PORT_NUM + "/" + DB_NAME +"?userSSL=false&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT",
USER_NAME, PASSWORD);
} catch (Exception e) {
throw new RuntimeException(e);
}
return connection;
}
public static void closeConnection(){
try {
connection.close();
connection = null;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
|
2b1e3b5c-22ea-4f53-a48d-eb5889a29b23 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-14 10:41:30", "repo_name": "KungumaTharun/Wipro_Assessment_KungumaTharun", "sub_path": "/app/src/main/java/com/wipro/assignment/adapter/RowAdapter.java", "file_name": "RowAdapter.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "3fc6b4b3220fd0c8cb6dd5d83a58ab57295a938f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/KungumaTharun/Wipro_Assessment_KungumaTharun | 209 | FILENAME: RowAdapter.java | 0.26971 | package com.wipro.assignment.adapter;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.wipro.assignment.R;
import com.wipro.assignment.response.Rows;
import java.util.List;
public class RowAdapter extends RecyclerView.Adapter<RowHolder> {
private List<Rows> rowsList;
public void setRows(List<Rows> rowsList) {
this.rowsList = rowsList;
}
@NonNull
@Override
public RowHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.row_item, viewGroup, false);
return new RowHolder(view);
}
@Override
public void onBindViewHolder(@NonNull RowHolder rowHolder, int i) {
Rows rows = rowsList.get(i);
rowHolder.setRow(rows);
}
@Override
public int getItemCount() {
return rowsList.size();
}
}
|
1b101c77-9566-4581-8b4b-efff5fa35f4c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-25 06:24:39", "repo_name": "yanyjcoder/yanyj-xyz", "sub_path": "/02_source/yanyj-back/yanyj-services/src/test/java/TestUserService.java", "file_name": "TestUserService.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "04b8821aec663447a416972f97834cf8797b92f9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yanyjcoder/yanyj-xyz | 227 | FILENAME: TestUserService.java | 0.228156 | import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import xyz.yanyj.services.service.UserService;
import xyz.yanyj.util.StringUtil.JsonUtil;
import java.util.logging.Logger;
/**
* Created by yanyj on 2017/4/17.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:spring.xml",
"classpath:spring-hibernate.xml" })
public class TestUserService {
private static final Logger LOGGER = Logger
.getLogger(String.valueOf(TestUserService.class));
@Autowired
private UserService userService;
@Test
public void save() {
LOGGER.info(userService.getUser("40287d815b7eef9b015b7eef9ebd0000").getUsername());
}
@Test
public void getUserList() {
LOGGER.info(JsonUtil.convertToJson(userService.getUserList()));
}
}
|
bd57cdec-9cca-4d53-a6ef-b83f50f8fea5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-13 08:50:38", "repo_name": "th8664484/spring-boot-demo", "sub_path": "/demo-06-error-exception/src/main/java/com/resolver/MyErrorViewTesolver.java", "file_name": "MyErrorViewTesolver.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "a0fa6c89d7ce4dd7256ee123db3f2ce4c6ead7e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/th8664484/spring-boot-demo | 159 | FILENAME: MyErrorViewTesolver.java | 0.250913 | package com.resolver;
import org.springframework.boot.autoconfigure.web.servlet.error.ErrorViewResolver;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.Map;
@Component
public class MyErrorViewTesolver implements ErrorViewResolver {
@Override
public ModelAndView resolveErrorView(HttpServletRequest request, HttpStatus status, Map<String, Object> model) {
if (status.equals(HttpStatus.NOT_FOUND)){
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("timestamp", new Date(System.currentTimeMillis()));
modelAndView.addObject("status",status);
modelAndView.addObject("message","No message available");
modelAndView.setViewName("/resolver404");
return modelAndView;
}
return null;
}
}
|
b5a75760-2354-4bd6-85cf-34ad4c35e613 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-03-17 15:00:24", "repo_name": "italo-07/jabref", "sub_path": "/src/test/java/org/jabref/logic/citationstyle/CitationStyleTest.java", "file_name": "CitationStyleTest.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "f12d6b3ed9dbf3de7774512aeba14f98c6c221d1", "star_events_count": 6, "fork_events_count": 73, "src_encoding": "UTF-8"} | https://github.com/italo-07/jabref | 275 | FILENAME: CitationStyleTest.java | 0.280616 | package org.jabref.logic.citationstyle;
import org.jabref.logic.util.TestEntry;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@Disabled("For some reason, instead of vol and pp we get null. No idea about the origin of this problem.")
class CitationStyleTest {
@Test
void getDefault() throws Exception {
assertNotNull(CitationStyle.getDefault());
}
@Test
void testDefaultCitation() {
String citation = CitationStyleGenerator.generateCitation(TestEntry.getTestEntry(), CitationStyle.getDefault());
// if the default citation style changes this has to be modified
String expected = " <div class=\"csl-entry\">\n" +
" <div class=\"csl-left-margin\">[1]</div><div class=\"csl-right-inline\">" +
"B. Smith, B. Jones, and J. Williams, “Title of the test entry,” " +
"<i>BibTeX Journal</i>, vol. 34, no. 3, pp. 45–67, Jul. 2016.</div>\n" +
" </div>\n";
assertEquals(expected, citation);
}
}
|
6998f39e-9ef3-4fde-9441-3ea58038a74b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-25 12:30:44", "repo_name": "dmytro-boiko-dev/javaee", "sub_path": "/fwqa/common/src/main/java/com/cumulus/pages/main/MainPage.java", "file_name": "MainPage.java", "file_ext": "java", "file_size_in_byte": 971, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "aea6a48717900511ebc92b130b627e7a205fe761", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/dmytro-boiko-dev/javaee | 191 | FILENAME: MainPage.java | 0.226784 | package com.cumulus.pages.main;
import com.cumulus.pages.BaseLogic;
import org.apache.log4j.Logger;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class MainPage extends BaseLogic {
public MainPage(WebDriver driver) {
super(driver);
}
private final static Logger logger = Logger.getLogger(MainPage.class);
@FindBy(linkText = "Defects")
private WebElement defectsMenu;
@FindBy(linkText = "Workshop")
private WebElement workshopMenu;
@FindBy(linkText = "Purchase Orders")
private WebElement purchaseOrder;
public void openDefectsMenu() throws InterruptedException {
clickWhenReady(defectsMenu);
}
public void openWorkshopMenu() throws InterruptedException {
clickWhenReady(workshopMenu);
}
public void openPurchaseOrdersMenu() throws InterruptedException {
clickWhenReady(purchaseOrder);
}
}
|
99fb6779-b6ac-4e06-ba34-3e9dc5026bb3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-06 02:57:34", "repo_name": "jchonker/factory-end", "sub_path": "/src/main/java/com/factory/end/model/primary/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "e928deffb49573c803379e49783d4d04031ff1fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jchonker/factory-end | 243 | FILENAME: User.java | 0.253861 | package com.factory.end.model.primary;
import lombok.Data;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
/**
* @Author jchonker
* @Date 2020/8/21 15:37
* @Version 1.0
* 模板类
*/
@Data
@Table(name = "pro_User")
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "username")
private String username;
@Column(name = "password")
private String password;
@Column(name = "enable")
private boolean enable;
private boolean credentialsNonExpired;
private boolean accountNonLocked;
private boolean accountNonExpired;
@ManyToMany
@JoinTable(name = "pro_User_Role",uniqueConstraints = {@UniqueConstraint(columnNames = {"uid","rid"})},
joinColumns = {@JoinColumn(name = "uid",referencedColumnName = "id")},
inverseJoinColumns = {@JoinColumn(name = "rid",referencedColumnName = "id")})
private List<Role> roleList = new ArrayList<>();
}
|
0e150c5d-715e-483c-babf-287040318fa5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-15 13:02:34", "repo_name": "Lixard/db-labs", "sub_path": "/data/src/main/java/ru/student/db/DatabaseMainFunctional.java", "file_name": "DatabaseMainFunctional.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "fb508009eca36aceeca610133f9b5353b8502f86", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Lixard/db-labs | 183 | FILENAME: DatabaseMainFunctional.java | 0.268941 | package ru.student.db;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
@Component
public class DatabaseMainFunctional {
private final JdbcTemplate jdbcTemplate;
@Autowired
public DatabaseMainFunctional(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
public void createDatabase(String name) {
jdbcTemplate.update("CREATE DATABASE " + name);
}
public void createTable(String name) {
jdbcTemplate.update("CREATE TABLE " + name + " ()");
}
public void createColumn(String tableName, String fieldName, String fieldDataType) {
jdbcTemplate.update("ALTER TABLE " + tableName + " ADD COLUMN " + fieldName + " " + fieldDataType);
}
public void deleteColumn(String tableName, String fieldName) {
jdbcTemplate.update("ALTER TABLE " + tableName + " DROP COLUMN " + fieldName);
}
}
|
8febfa0c-9d39-4e52-83b9-0dd7a15db07b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-12-03T14:51:41", "repo_name": "kourouklides/CEI_523_2018", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1174, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "f28c75a36b38e0de542bec3900b9f5daac2d85b9", "star_events_count": 5, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kourouklides/CEI_523_2018 | 397 | FILENAME: README.md | 0.274351 | # CEI 523: Data Science - 2018
This repository is the one used for the module __CEI-523: Data Science__ during Fall Semester of 2018 at the Master's degree [MSc in Data Science and Engineering](https://www.cut.ac.cy/faculties/fet/eecei/module-description/modules-msc-data-science-and-engineering/?languageId=1) at the [Cyprus University of Technology](https://www.cut.ac.cy/).
For the Python code used in the module, please check: [artificial_neural_networks](https://github.com/kourouklides/artificial_neural_networks)
## Part A: Deep Learning and Computer Vision
__Instructor:__ Ioannis Kourouklides
__Announcements:__ (on Moodle)
__Lecture Notes:__
- [Lecture notes on Data Science](https://goo.gl/VSTGUQ) (a work in progress)
__Lecture Slides:__
- [Lecture 1 - 11 Sep 2018](https://goo.gl/v8hJda)
- Lecture 2 - 18 Sep 2018 (lab)
- [Lecture 3 - 25 Sep 2018](https://goo.gl/NcvGQS)
- Lecture 4 - 2 Oct 2018 (lab)
- Lecture 5 - 9 Oct 2018 (lab)
- [Lecture 6 - 16 Oct 2018](https://goo.gl/RJwG19)
- [Lecture 7 - 23 Oct 2018](https://goo.gl/5ZTnGH)
## Part B: Deep Learning and Natural Language Processing
Taught by a different instructor. Please check Moodle.
|
b823377d-5eef-426f-96ce-4762fd567067 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-17 19:27:28", "repo_name": "Mbojanow/sda-caching-webinar", "sub_path": "/src/main/java/pl/sdacademy/cachingwebinar/services/PetService.java", "file_name": "PetService.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "9c8b91716c7a1965e7551a3061eefdca7eff7892", "star_events_count": 3, "fork_events_count": 4, "src_encoding": "UTF-8"} | https://github.com/Mbojanow/sda-caching-webinar | 215 | FILENAME: PetService.java | 0.26588 | package pl.sdacademy.cachingwebinar.services;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import pl.sdacademy.cachingwebinar.domain.Pet;
import pl.sdacademy.cachingwebinar.repositories.PetRepository;
@Service
@Slf4j
@CacheConfig(cacheNames = "pets")
public class PetService {
private final PetRepository petRepository;
public PetService(final PetRepository petRepository) {
this.petRepository = petRepository;
}
@CachePut(key = "#pet.name")
public Pet createOrUpdate(final Pet pet) {
log.info("createOrUpdate");
return petRepository.save(pet);
}
@Cacheable
public Pet getByName(final String name) {
log.info("getByName");
return petRepository.findById(name)
.orElseThrow(() -> new RuntimeException("pet with name does not exist " + name));
}
}
|
59a21cb4-2f5e-4b1b-a024-3f6261f9aef4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-14 18:18:12", "repo_name": "suyash123/SleepTracker", "sub_path": "/app/src/main/java/com/example/suyash/sleeptracker/events/ScreenStateReceiver.java", "file_name": "ScreenStateReceiver.java", "file_ext": "java", "file_size_in_byte": 1004, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "a98491643b7a525c2b486df55357fab7b52ae5b8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/suyash123/SleepTracker | 196 | FILENAME: ScreenStateReceiver.java | 0.250913 | package com.example.suyash.sleeptracker.events;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import org.greenrobot.eventbus.EventBus;
public class ScreenStateReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
boolean isScreenOn;
if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
Log.d("ScreenStateReceiver","Screen went ON");
isScreenOn = true;
} else {
Log.d("ScreenStateReceiver","Screen went OFF");
isScreenOn = false;
}
EventBus.getDefault().post(new ScreenStateEvent(isScreenOn));
}
public class ScreenStateEvent {
private boolean isScreenOn;
public ScreenStateEvent(boolean isScreenOn) {
this.isScreenOn = isScreenOn;
}
public boolean isScreenOn() {
return isScreenOn;
}
}
}
|
914aaaa2-46a7-4d66-ae0f-514860ca5443 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-10 03:27:07", "repo_name": "wangjiaxin1100/AutoTest", "sub_path": "/Chapter7/src/main/java/com/oocl/MocoTest.java", "file_name": "MocoTest.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "ab22897db85f6b369db687ba792c50ba5df1ad72", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wangjiaxin1100/AutoTest | 240 | FILENAME: MocoTest.java | 0.285372 | package com.oocl;
import com.github.dreamhead.moco.Moco;
import com.github.dreamhead.moco.junit.MocoJunitRunner;
import org.apache.http.HttpResponse;
import org.apache.http.client.fluent.Content;
import org.apache.http.client.fluent.Request;
import org.junit.Rule;
import org.junit.Test;
import java.io.IOException;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
public class MocoTest {
@Rule
public MocoJunitRunner runner = MocoJunitRunner.jsonHttpRunner(8811, Moco.pathResource("foo.json"));
@Test
public void testNoUri() throws IOException {
Content content = Request.Get("http://localhost:8811").execute().returnContent();
assertThat(content.asString(), is("Hello, Moco"));
}
@Test
public void testWithParamAndHeader() throws IOException {
HttpResponse httpResponse = Request.Get("http://localhost:8811/hust?param=zw").execute().returnResponse();
assertThat(httpResponse.getFirstHeader("SelfHeader").getValue(), is("SelfHeader"));
}
} |
e3efea6b-4d51-497d-bebc-b0b7a83b18c4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-07-26T11:43:39", "repo_name": "ensyvz/ensyvz.github.io", "sub_path": "/_posts/2020-07-25-bluetoothcli-en.md", "file_name": "2020-07-25-bluetoothcli-en.md", "file_ext": "md", "file_size_in_byte": 1013, "line_count": 43, "lang": "en", "doc_type": "text", "blob_id": "d7c64000949923a21ce2e39f099a09dcdc6fd8a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ensyvz/ensyvz.github.io | 241 | FILENAME: 2020-07-25-bluetoothcli-en.md | 0.217338 | ---
title: "Bluetooth Using Terminal"
excerpt: "Connecting to a device with bluetooth using terminal."
tags:
-linux
-solution
categories: english
---
You may want to use terminal for connecting to bluetooth devices and here is how:
(I am explaining over Arch Linux but when you install the necessary package you should be able to do same thing in other distros.)
Install bluez-utils package from AUR.
```shell
yay - S bluez-utils
```
Get bluetooth up and running using bluetoothctl command provided by bluez-utils.
```shell
bluetoothctl
power on
agent on
default-agent
scan on
```
When the device that you want to connect shows up with MAC Adress on screen, do following step.
```shell
pair device-mac-adress
connect device-mac-adress
```
If an error shows up that says notready after running scan on command do following steps.
```shell
rfkill list
```
If there is any blocked ones run this command.
```shell
rfkill unblock all
```
Daha sonrasında scan on komutundan devam edebilirsiniz.
|
1f331f62-46a3-4afe-a655-c65beb40ae26 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-12-09 03:19:43", "repo_name": "jeff-2/UIUI", "sub_path": "/src/edu/illinois/engr/web/cs465uiui/search/SearchItem.java", "file_name": "SearchItem.java", "file_ext": "java", "file_size_in_byte": 1174, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "12f5248ba34005928041f45245570d7bf98f1c02", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jeff-2/UIUI | 265 | FILENAME: SearchItem.java | 0.283781 | package edu.illinois.engr.web.cs465uiui.search;
/**
* SearchItem provides storage for the data displayed in the SearchActivity. Each row of the results from the search displays a
* restaurantName and address, as well as an icon for verifying the location on a map.
*/
public class SearchItem {
private long restaurantId;
/** The restaurant name. */
private String restaurantName;
/** The restaurant address. */
private String restaurantAddress;
/**
* Instantiates a new search item.
*/
public SearchItem() {
restaurantId = -1;
restaurantName = null;
restaurantAddress = null;
}
/**
* Instantiates a new search item.
*
* @param restaurantName the restaurant name
* @param restaurantAddress the restaurant address
*/
public SearchItem(long restaurantId, String restaurantName,String restaurantAddress) {
this.restaurantId = restaurantId;
this.restaurantName = restaurantName;
this.restaurantAddress = restaurantAddress;
}
public String getRestaurantName() {
return restaurantName;
}
public String getRestaurantAddress() {
return restaurantAddress;
}
public long getRestaurantId() {
return restaurantId;
}
}
|
7e19e888-8564-42d7-aa8b-7c0e75ad248f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-09 06:23:23", "repo_name": "lzlz123/Netty", "sub_path": "/src/main/java/nio/NIOFileChannel03.java", "file_name": "NIOFileChannel03.java", "file_ext": "java", "file_size_in_byte": 1290, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "ecddb19ce86554bc46652900dfe47f49858c18c5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lzlz123/Netty | 243 | FILENAME: NIOFileChannel03.java | 0.293404 | package nio;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
public class NIOFileChannel03 {
public static void main(String[] args) throws IOException {
//创建一个输入流
FileInputStream fileInputStream = new FileInputStream("01.text");
//创建输入流的channel
FileChannel channel = fileInputStream.getChannel();
//创建一个buffer
ByteBuffer buffer = ByteBuffer.allocate(1);
//创建一个输出流对象
FileOutputStream fileOutputStream = new FileOutputStream("02.text");
//创建输出流对象的channel
FileChannel channel1 = fileOutputStream.getChannel();
//循环读取
while (true) {
buffer.clear();//需要重置一下buffer
int read = channel.read(buffer);
System.out.println(read);
//表示读取结束
if (read == -1) {
break;
}
buffer.flip();
channel1.write(buffer);
}
//从buffer中写出数据
channel1.write(buffer);
//关闭
fileInputStream.close();
fileOutputStream.close();
}
}
|
4c9dfb0f-8713-41f9-a9a4-c48a9ce39584 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-30 18:22:31", "repo_name": "M1chel00/gommeHD", "sub_path": "/MC-Plugin/src/me/mses/commands/BackPack.java", "file_name": "BackPack.java", "file_ext": "java", "file_size_in_byte": 1004, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "9c6cbf370bc073154be9480a45780a3493c0b827", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "ISO-8859-1"} | https://github.com/M1chel00/gommeHD | 227 | FILENAME: BackPack.java | 0.236516 | package me.mses.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import me.mses.main.SpigotPlugin;
public class BackPack implements CommandExecutor{
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(sender instanceof Player) {
Player p = (Player) sender;
for(Player i : SpigotPlugin.getInstance().getPlayers()) {
if(i.getName().equalsIgnoreCase(p.getName()) && p.hasPermission("mses.backpack.open")) {
Inventory inv = SpigotPlugin.getInstance().getBP();
p.openInventory(inv);
return true;
}
}
p.sendMessage("[§6Challenge§r] Du nimmst zur Zeit an keiner Challenge teil!");
p.sendMessage("[§6Challenge§r] Sobald du an einer teilnimmst, wirst du das BackPack öffnen können!");
return true;
}
return false;
}
}
|
e285fac6-810e-4257-a344-c8c317e2c31a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-19 15:12:02", "repo_name": "ranjanasisodia/Spring-boot-application", "sub_path": "/src/main/java/com/bhaiti/kela/controllers/AuthorController.java", "file_name": "AuthorController.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "61f72dcbdddb4f4f85348b8285097b6998963c96", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ranjanasisodia/Spring-boot-application | 203 | FILENAME: AuthorController.java | 0.249447 | package com.bhaiti.kela.controllers;
import java.util.List;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.bhaiti.kela.beans.Articles;
import com.bhaiti.kela.beans.Author;
import com.bhaiti.kela.beans.ParseAuthors;
@Controller
public class AuthorController {
@RequestMapping(method = RequestMethod.GET, value="/author/allauthors")
@ResponseBody
public List<Author> getAuthors() {
ParseAuthors pa = new ParseAuthors();
return pa.getAuthors();
}
@RequestMapping(method = RequestMethod.GET, value="/author/get")
@ResponseBody
public List<Articles> getAuthorData(@RequestParam(name= "name") String name) {
ParseAuthors pa = new ParseAuthors();
name = name.replace("%20", " ").replace("\"", "");
return pa.getData(name);
}
}
|
5fad775a-c032-4f5b-8d3e-d13fe0cb8609 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-21 08:47:13", "repo_name": "duggankimani/IConserv", "sub_path": "/src/com/wira/pmgt/client/ui/upload/attachment/ShowIframeEvent.java", "file_name": "ShowIframeEvent.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "31ec5c4c993104d5187afd05bcac5b4036fa6396", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/duggankimani/IConserv | 233 | FILENAME: ShowIframeEvent.java | 0.272025 | package com.wira.pmgt.client.ui.upload.attachment;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.EventHandler;
import java.lang.String;
import com.google.gwt.event.shared.HasHandlers;
public class ShowIframeEvent extends
GwtEvent<ShowIframeEvent.ShowIframeHandler> {
public static Type<ShowIframeHandler> TYPE = new Type<ShowIframeHandler>();
private String uri;
public interface ShowIframeHandler extends EventHandler {
void onShowIframe(ShowIframeEvent event);
}
public ShowIframeEvent(String uri) {
this.uri = uri;
}
public String getUri() {
return uri;
}
@Override
protected void dispatch(ShowIframeHandler handler) {
handler.onShowIframe(this);
}
@Override
public Type<ShowIframeHandler> getAssociatedType() {
return TYPE;
}
public static Type<ShowIframeHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source, String uri) {
source.fireEvent(new ShowIframeEvent(uri));
}
}
|
41dddb21-51d4-46a7-b6c4-cc80bfe0c06f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-14 20:03:36", "repo_name": "Toscaro/ChatServerSide", "sub_path": "/src/ReceptorDeSockets.java", "file_name": "ReceptorDeSockets.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "69f034860191dc8d0f4de30fd63034c9f0874888", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Toscaro/ChatServerSide | 230 | FILENAME: ReceptorDeSockets.java | 0.235108 | import java.io.ObjectInputStream;
import java.io.PrintWriter;
import java.net.Socket;
public class ReceptorDeSockets implements Runnable {
/** Socket é a conexao do cliente */
private Socket socket;
/** PrintWriter envia informação (String) para o cliente */
private PrintWriter messageWriter;
/** BufferedReader recebe a informação (objeto usuario) do cliente */
private ObjectInputStream objectReader;
/**
* @param socket recebe a conexao de um novo cliente.
* @throws Exception caso nao recebermos conseguirmos criar o output ou input stream.
*/
ReceptorDeSockets(Socket socket) throws Exception {
this.socket = socket;
messageWriter = new PrintWriter(socket.getOutputStream());
objectReader = new ObjectInputStream(socket.getInputStream());
new Thread(this).start();
}
@Override
public void run() {
try {
Usuario usuario = (Usuario) objectReader.readObject();
System.out.println(String.format("Nome: %s, socket: %s", usuario.getNome(), usuario.getSocket()));
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
797995c4-1ab0-4718-a0f8-f83d1a9d9945 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-08 14:54:17", "repo_name": "jingjianqian/springcloud", "sub_path": "/system-manager/service-auth/src/main/java/auth/entity/Role.java", "file_name": "Role.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "b52697ebff153944a91e22f9567fef0a1f5ecbd6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jingjianqian/springcloud | 218 | FILENAME: Role.java | 0.205615 | package auth.entity;
import org.apache.ibatis.type.Alias;
import javax.persistence.Column;
import javax.persistence.Table;
@Table(name = "sys_role")
@Alias(value = "sysRole")
public class Role {
private String id;
@Column
private String role_name;
@Column
private String role_description;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getRole_name() {
return role_name;
}
public void setRole_name(String role_name) {
this.role_name = role_name;
}
public String getRole_description() {
return role_description;
}
public void setRole_description(String role_description) {
this.role_description = role_description;
}
@Override
public String toString() {
return "Role{" +
"id='" + id + '\'' +
", role_name='" + role_name + '\'' +
", role_description='" + role_description + '\'' +
'}';
}
}
|
17f47e15-2217-4003-ae00-ccc815de1708 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-09-09 18:29:01", "repo_name": "mateuszszczurek/object_oriented", "sub_path": "/src/main/java/pl/com/sniper/auction/SniperPortfolio.java", "file_name": "SniperPortfolio.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "69e3f5aee325c2b051295590222873ab086510c8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mateuszszczurek/object_oriented | 204 | FILENAME: SniperPortfolio.java | 0.284576 | package pl.com.sniper.auction;
import pl.com.sniper.auction.sniper.AuctionSniper;
import pl.com.sniper.auction.sniper.SniperSnapshot;
import java.util.ArrayList;
import java.util.List;
public class SniperPortfolio implements SniperCollector {
private List<PortfolioListener> portfolioListeners = new ArrayList<>();
private List<AuctionSniper> snipers = new ArrayList<>();
@Override
public void addSniper(AuctionSniper auctionSniper) {
this.snipers.add(auctionSniper);
auctionSniper.addSniperListener(new SwingThreadSniperListener(this));
portfolioListeners.forEach(listener -> listener.sniperAdded(auctionSniper.getSnapshot()));
}
@Override
public void sniperStateChanged(SniperSnapshot sniperSnapshot) {
this.portfolioListeners.forEach(listener -> listener.sniperStateChanged(sniperSnapshot));
}
public void registerPortfolioListener(PortfolioListener portfolio) {
this.portfolioListeners.add(portfolio);
}
}
|
ffd66042-36b6-4377-94e2-52055a54e328 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-09-03 06:47:48", "repo_name": "jamessnee1/RegisterLogin", "sub_path": "/src/MainFrame.java", "file_name": "MainFrame.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "1fb7b3ab7f978c47b5ce3a3b8cb4b4e4f8b7307a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jamessnee1/RegisterLogin | 239 | FILENAME: MainFrame.java | 0.286968 | import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.JFrame;
//MainFrame to be combined with other MainFrame
//This one by James Snee
public class MainFrame extends JFrame {
private LoginDialog login;
private RegisterDialog register;
//Declaring access to the database
private static final String USERNAME = "dbuser";
private static final String PASSWORD = "dbpassword";
//If we are connecting to a remote database not on localhost, replace
//localhost in the following string with the IP address
private static final String CONN_STRING = "jdbc:mysql://localhost/logincredentials";
public MainFrame(){
//instantiate the login and register dialogs
login = new LoginDialog(this);
register = new RegisterDialog(this);
register.setVisible(false);
login.setVisible(true);
}
public LoginDialog getLoginDialog(){
return login;
}
public RegisterDialog getRegisterDialog(){
return register;
}
//getter for the connection
public Connection getConnection() throws SQLException{
return DriverManager.getConnection(CONN_STRING, USERNAME, PASSWORD);
}
}
|
113dd1fd-3810-4ea4-8f82-4bb5890be1c2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-04-06T08:00:29", "repo_name": "scottatron/terraform-docker", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1029, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "d948a5153a2683d3ad4b1bbe63678a75b4682a4c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/scottatron/terraform-docker | 234 | FILENAME: README.md | 0.182426 | scottatron/terraform
====================
A simple, opinionated Dockerfile and binstub for running [Terraform](https://terraform.io/).
Can optionally decrypt a terrraform.tfvars.json file that has been encrypted using [ejson](https://github.com/Shopify/ejson)
USAGE
-----
The simplest usage is to run the binstub:
bin/terraform <sub-command>
This volumes mounts your current directory and runs the specified terraform sub-command.
The binstub also checks for a .env file in your current directory and uses to the set the --env-file for the Docker run command
### Decrypting an ejson encrypted terraform.vars.json file
If a **terraform.vars.ejson** file is found, it will be attempted to be decrypted using [ejson](https://github.com/Shopify/ejson). In order for this to work the ejson private key must be provided setting the EJSON_PRIVATE_KEY envrionment variable in the .env file
The encrypted **terraform.vars.ejson** will be decrypted to **terraform.vars.json** before Terraform runs and deleted when finished.
|
c24b2405-e17b-4388-b66f-6c2616fb516b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-23 19:49:49", "repo_name": "SergeyAminov/ToDoList", "sub_path": "/app/src/main/java/com/example/todolist/Tasks/Tasks.java", "file_name": "Tasks.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "f92770cf118aa3d5e55393284e246caa69a73510", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SergeyAminov/ToDoList | 205 | FILENAME: Tasks.java | 0.225417 | package com.example.todolist.Tasks;
public class Tasks{
private String title;
private String description;
private String id;
private String date;
private String time;
private String place;
public Tasks(String id, String title, String description, String date, String time, String place) {
this.title = title;
this.description = description;
this.id = id;
this.date = date;
this.time = time;
this.place = place;
}
public String getDate() {
return date;
}
public String getTime() {
return time;
}
public String getPlace() {
return place;
}
public Tasks(String id, String title, String description) {
this.id = id;
this.title = title;
this.description = description;
}
public String getId(){ return id;}
public String getTitle() {
return title;
}
public String getDescription() {
return description;
}
}
|
fe580561-2445-4038-9860-c24fb99507af | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-14 22:37:58", "repo_name": "jandrewtorres/BioWars309", "sub_path": "/src/client/lobby/LobbyController.java", "file_name": "LobbyController.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "f2e25fd6fc8554e022f9c36e3ba423285160c9cc", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jandrewtorres/BioWars309 | 217 | FILENAME: LobbyController.java | 0.292595 | package client.lobby;
import client.Client;
import client.model.ClientModel;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import server.model.Player;
public class LobbyController {
ClientModel model;
Client clientApp;
@FXML
Button readyButton;
@FXML
TableView<Player> lobbyTable;
@FXML
TableColumn<Player, String> playerNameColumn;
@FXML
TableColumn<Player, String> playerStatusColumn;
public LobbyController(ClientModel model) {
this.model = model;
}
@FXML
private void initialize() {
playerNameColumn.setCellValueFactory(cellData -> cellData.getValue().nameProperty());
playerStatusColumn.setCellValueFactory(cellData -> cellData.getValue().statusProperty().asString());
lobbyTable.setItems(model.getReadOnlyPlayers());
}
@FXML
private void onReadyButtonClicked() {
model.setClientStatusReady();
}
public void setClientApp(Client app) {
this.clientApp = app;
}
}
|
0379f4dd-484f-4b28-a961-48498426317d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-14 17:23:02", "repo_name": "avinashmadireddy/memoryBlog", "sub_path": "/src/main/java/com/rest/model/Memory.java", "file_name": "Memory.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 67, "lang": "en", "doc_type": "code", "blob_id": "5329939bca1cd7c7f27aa1487b09d2bbc9edd9df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/avinashmadireddy/memoryBlog | 257 | FILENAME: Memory.java | 0.225417 | package com.rest.model;
import java.util.Date;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Memory {
private int id;
private String description;
private String createdBy;
private Date created;
public Memory() {
super();
}
public Memory(Memory memory) {
this.id = memory.id;
this.description = memory.description;
this.createdBy = memory.createdBy;
this.created = memory.created;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@XmlElement(name = "desc")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
@Override
public String toString() {
return "Memory [id=" + id + ", description=" + description + ", createdBy=" + createdBy + ", created=" + created
+ "]";
}
}
|
3bac172d-baf9-4771-bfda-eed9bf52ac61 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-21 16:49:16", "repo_name": "reachshyam80/teelstng", "sub_path": "/src/main/java/com/coxautoinc/sfdc/login/LoginSelector.java", "file_name": "LoginSelector.java", "file_ext": "java", "file_size_in_byte": 1174, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "ef52e883df39997dc1f077264cbd97701c9eca22", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/reachshyam80/teelstng | 208 | FILENAME: LoginSelector.java | 0.23793 | package com.coxautoinc.sfdc.login;
import org.openqa.selenium.By;
/**
* Selector class for the Login page.
*/
class LoginSelector {
//~ Instance fields ------------------------------------------------------------------------------------------------
private By loginBtn = By.id("Login");
private By passwordInputBx = By.id("password");
private By userNameInputBx = By.id("username");
//~ Constructors ---------------------------------------------------------------------------------------------------
/**
* Creates a new LoginSelector object.
*/
LoginSelector() {
init();
}
//~ Methods --------------------------------------------------------------------------------------------------------
By getLoginBtn() {
return loginBtn;
}
By getPasswordInputBx() {
return passwordInputBx;
}
By getUserNameInputBx() {
return userNameInputBx;
}
/**
* Method to initialize all selector variables.
*/
private void init() {
passwordInputBx = By.id("password");
userNameInputBx = By.id("username");
loginBtn = By.id("Login");
}
}
|
9a05cbc0-e347-4eef-8354-9c5187b7f414 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-14 21:04:33", "repo_name": "thombergs/code-examples", "sub_path": "/spring-boot/spring-boot-and-reactjs/publisher_register/src/main/java/io/reflectoring/publisher_register/controller/PublisherController.java", "file_name": "PublisherController.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "4a6f49e31ad4586a6c91e9cd91f5cf81ed6c84a7", "star_events_count": 2492, "fork_events_count": 2710, "src_encoding": "UTF-8"} | https://github.com/thombergs/code-examples | 212 | FILENAME: PublisherController.java | 0.258326 | package io.reflectoring.publisher_register.controller;
import io.reflectoring.publisher_register.model.Publisher;
import io.reflectoring.publisher_register.repository.PublisherRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Optional;
@RestController
@CrossOrigin
@RequestMapping("/publisher")
public class PublisherController {
@Autowired
private PublisherRepository publisherRepository;
@PostMapping("/create")
public Publisher create(@RequestBody Publisher publisher){
return publisherRepository.save(publisher);
}
@GetMapping("/all")
public List<Publisher> getAllAuthors() {
return publisherRepository.findAll();
}
@GetMapping("/{id}")
public Optional<Publisher> findOneById(@PathVariable String id) {
return publisherRepository.findById(id);
}
@PutMapping("/update")
public Publisher update(@RequestBody Publisher publisher){
return publisherRepository.save(publisher);
}
@DeleteMapping("/delete/{id}")
public void deleteById(@PathVariable String id){
publisherRepository.deleteById(id);
}
}
|
053fa0e1-088d-4b1c-9f6b-2c4988c7ffc6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-05 16:28:23", "repo_name": "gitter-badger/WebWorkflowCleanData", "sub_path": "/src/main/java/fr/bird/bloom/beans/Step1_MappingDwc.java", "file_name": "Step1_MappingDwc.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "7bb3d922813e73a5721947e16527230ed2d849ac", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gitter-badger/WebWorkflowCleanData | 269 | FILENAME: Step1_MappingDwc.java | 0.285372 | /**
* fr.bird.bloom.beans
* Step1_MappingDwc
*/
package fr.bird.bloom.beans;
import fr.bird.bloom.model.MappingDwC;
import java.util.HashMap;
/**
* fr.bird.bloom.beans
*
* Step1_MappingDwc.java
* Step1_MappingDwc
*/
public class Step1_MappingDwc {
private HashMap<Integer,MappingDwC> infos_mapping = new HashMap<Integer,MappingDwC>();
private boolean involved = false;
//private HashMap<MappingDwC, String> mappedFilesAssociatedPath = new HashMap<MappingDwC, String>();
//<!--<c:if test="${count1 == info.idFile}">-->
//<!--<span class="value"><c:out value='${info.value.isSuccess}'/></span>-->
public Step1_MappingDwc(){
}
public HashMap<Integer, MappingDwC> getInfos_mapping() {
return infos_mapping;
}
public void setInfos_mapping(HashMap<Integer, MappingDwC> infos_mapping) {
this.infos_mapping = infos_mapping;
}
public boolean isInvolved() {
return involved;
}
public void setInvolved(boolean involved) {
this.involved = involved;
}
}
|
11f74d71-ab60-466b-80a1-61df456dae87 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-22 07:45:52", "repo_name": "CycloneBoy/springcloud-learn", "sub_path": "/kafka-hello/src/main/java/com/cycloneboy/springcloud/kafkahello/service/SenderService.java", "file_name": "SenderService.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "6cf3faa06c44c7fb2c34a5b5a26f61e81ee9a1e4", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CycloneBoy/springcloud-learn | 226 | FILENAME: SenderService.java | 0.20947 | package com.cycloneboy.springcloud.kafkahello.service;
import com.cycloneboy.springcloud.common.domain.dto.mafengwo.TravelNoteDto;
import com.cycloneboy.springcloud.kafkahello.kafka.SinkSender;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessageHeaders;
import org.springframework.stereotype.Service;
import org.springframework.util.MimeTypeUtils;
/**
* Create by sl on 2019-08-25 18:34
*/
@Slf4j
@Service
public class SenderService {
@Autowired
private SinkSender sinkSender;
public void sendHello(TravelNoteDto travelNoteDto) {
log.info("Sending greetings {}", travelNoteDto);
MessageChannel messageChannel = sinkSender.output();
messageChannel.send(MessageBuilder
.withPayload(travelNoteDto)
.setHeader(MessageHeaders.CONTENT_TYPE, MimeTypeUtils.APPLICATION_JSON)
.build());
}
}
|
5e0b2e8b-6794-4050-890c-8c5d64295ada | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-07 20:20:42", "repo_name": "Karya55/VD-Book-Shop", "sub_path": "/Android/app/src/main/java/com/janfranco/bookstore/entities/Book.java", "file_name": "Book.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 69, "lang": "en", "doc_type": "code", "blob_id": "ed85e2c97d79f593c36025a8deb000ab50f135f5", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Karya55/VD-Book-Shop | 239 | FILENAME: Book.java | 0.225417 | package com.janfranco.bookstore.entities;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class Book {
@SerializedName("_id")
private String id;
@SerializedName("title")
private String title;
@SerializedName("author")
private String author;
@SerializedName("cover")
private String cover;
@SerializedName("pageCount")
private int pageCount;
@SerializedName("price")
private int price;
@SerializedName("averageStar")
private int averageStar;
@SerializedName("category")
List<Category> categoryList;
@SerializedName("reviews")
List<Review> reviews;
public String getId() {
return id;
}
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
public String getCover() {
return cover;
}
public int getPageCount() {
return pageCount;
}
public int getPrice() {
return price;
}
public int getAverageStar() {
return averageStar;
}
public List<Category> getCategoryList() {
return categoryList;
}
}
|
0e3402d6-f0dd-4ac9-99bd-9e320b8fcc3f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-05 01:51:26", "repo_name": "lqj12267488/Gemini", "sub_path": "/src/main/resourcelibrary/com/goisan/type/service/impl/ResourceTypeCourseServiceImpl.java", "file_name": "ResourceTypeCourseServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "06cb9db849b20993679db3ae37431d16cb78c195", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lqj12267488/Gemini | 237 | FILENAME: ResourceTypeCourseServiceImpl.java | 0.289372 | package com.goisan.type.service.impl;
import com.goisan.type.dao.ResourceTypeCourseDao;
import com.goisan.type.service.ResourceTypeCourseService;
import com.goisan.system.bean.BaseBean;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class ResourceTypeCourseServiceImpl implements ResourceTypeCourseService {
@Resource
private ResourceTypeCourseDao resourceTypeCourseDao;
public List<BaseBean> getResourceTypeCourseList(BaseBean baseBean) {
return resourceTypeCourseDao.getResourceTypeCourseList(baseBean);
}
public void saveResourceTypeCourse(BaseBean baseBean) {
resourceTypeCourseDao.saveResourceTypeCourse(baseBean);
}
public BaseBean getResourceTypeCourseById(String id) {
return resourceTypeCourseDao.getResourceTypeCourseById(id);
}
public void updateResourceTypeCourse(BaseBean baseBean) {
resourceTypeCourseDao.updateResourceTypeCourse(baseBean);
}
public void delResourceTypeCourse(String id) {
resourceTypeCourseDao.delResourceTypeCourse(id);
}
public String checkTypeCourse(String id) {
return resourceTypeCourseDao.checkTypeCourse(id);
}
}
|
02ee3b68-8a8c-4b23-b501-4e145fbdaf3d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-23 20:36:03", "repo_name": "diegodh1/pokeApi", "sub_path": "/src/main/java/com/example/poke/pokeApi/models/ExternalApi/PokemonApiSprites.java", "file_name": "PokemonApiSprites.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "ea9d5c32ba431143f86c22c235ece12836ae6e55", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/diegodh1/pokeApi | 262 | FILENAME: PokemonApiSprites.java | 0.252384 | package com.example.poke.pokeApi.models.ExternalApi;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class PokemonApiSprites {
//variables
@JsonAlias("front_shiny")
private String frontShiny;
@JsonAlias("front_default")
private String frontDefault;
private PokemonApiOther other;
//empty constructor
public PokemonApiSprites(){
}
//constructor
public PokemonApiSprites(String frontShiny, String frontDefault, PokemonApiOther other){
this.frontShiny = frontShiny;
this.frontDefault = frontDefault;
this.other = other;
}
//setters
public void setFrontShiny(String value){
this.frontShiny = value;
}
public void setFrontDefault(String value){
this.frontDefault = value;
}
public void setOther(PokemonApiOther value){
this.other = value;
}
//getters
public String getFrontShiny(){
return this.frontShiny;
}
public String getFrontDefault(){
return this.frontDefault;
}
public PokemonApiOther getOther(){
return this.other;
}
}
|
f27348cd-638e-41dd-91f7-9295d6a73b80 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-18 22:25:28", "repo_name": "millems/noggin", "sub_path": "/runtime/core/utils/src/main/java/software/amazon/noggin/runtime/util/Strings.java", "file_name": "Strings.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "b5ac7aee2b98e716f47d7bef789d9dd9c2b45d14", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/millems/noggin | 215 | FILENAME: Strings.java | 0.258326 | package software.amazon.noggin.runtime.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Strings {
private Strings() {}
public static List<String> split(String input, char delimeter) {
List<String> result = new ArrayList<>();
int start = 0;
for (int i = 0; i < input.length(); ++i) {
if (input.charAt(i) == delimeter) {
result.add(input.substring(start, i));
start = i + 1;
}
}
result.add(input.substring(start));
return Collections.unmodifiableList(result);
}
public static String trim(String input, String toTrim) {
if (input.equals(toTrim)) {
return "";
}
int startIndex = input.startsWith(toTrim) ? toTrim.length() : 0;
int exclusiveEndIndex = input.endsWith(toTrim) ? input.length() - toTrim.length() : input.length();
return input.substring(startIndex, exclusiveEndIndex);
}
}
|
e73196ec-9e7e-4de9-9e6d-f8078dcce5e3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-02-20T13:01:13", "repo_name": "lturner19/GitHub_readme_generator", "sub_path": "/README-repo.md", "file_name": "README-repo.md", "file_ext": "md", "file_size_in_byte": 1047, "line_count": 51, "lang": "en", "doc_type": "text", "blob_id": "b00abe95a50a6f091c5b786bf66d30e7c03cb776", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lturner19/GitHub_readme_generator | 255 | FILENAME: README-repo.md | 0.267408 | # GitHub ReadMe Generator
## INTRODUCTION
As a developer, providing a readme file is another important part of the coding process. Access to a command-line application allows for quick and easy generation of a file with a profile attached.
<br>
## FEATURES
The readme file is dynamically generated, with the user's profile, based on their response to eight questions.
1. The user is asked to provide their GitHub username.
2. The user answers the remaining questions.
3. The GitHub api is used to obtain their GitHub profile.
4. The readme file is generated with the user's information.
<br>
## INSTALLATION
To utilize the program, the user will need to download
* Axios
* Inquirer
<br>
### PREVIEW
<img src="./utils/Readme_Generator.gif"/>
<br>
<br>
### RESOURCES
To record gif: *Screencastify*
Badges for Markdown: ***Naereen Badges:***
https://github.com/Naereen/badges
<br>
### Badges
[](https://lturner19.github.io/GitHub_readme_generator/)
|
d34e0aef-b57c-4b4f-b875-8f7c404fe3e5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-25 08:34:20", "repo_name": "scorpiocc/ShoppingT", "sub_path": "/Shopping/src/lyons/db/DbConn.java", "file_name": "DbConn.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "3b713251cfcde41dafe69ed0266b6a576096ea0d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/scorpiocc/ShoppingT | 270 | FILENAME: DbConn.java | 0.273574 | package lyons.db;
/**
* 链接数据库
* @author Lyons
*/
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import org.apache.log4j.Logger;
public class DbConn
{
private static Logger logger= Logger.getLogger(DbConn.class);
public static Connection getConn()
{
Connection conn = null;
String user = "scott";
String passwd = "tiger";
String url = "jdbc:oracle:thin:@localhost:1521:orcl";
// String user = "scorpio";
//String passwd = "111111";
//String url = "jdbc:mysql://localhost:3306/ssm?useUnicode=true&characterEncoding=utf8";
//已加载驱动
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
//Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection(url,user,passwd);
} catch (ClassNotFoundException e)
{
e.printStackTrace();
logger.error("找不到driver类");
} catch (SQLException e)
{
e.printStackTrace();
logger.error("sql执行失败");
}
return conn;
}
}
|
a06f7092-4495-4d5d-8c91-ab92b8594fb2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-12 18:11:27", "repo_name": "maicondmenezes/addressBookMeFX", "sub_path": "/src/addressbookmefx/data/Phone.java", "file_name": "Phone.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "09ca10a8bc6f7d96ed2ed1ee14201e57aad4de3e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/maicondmenezes/addressBookMeFX | 245 | FILENAME: Phone.java | 0.23092 | /*
* 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 addressbookmefx.data;
import java.io.Serializable;
/**
*
* @author MaJoy
*/
public class Phone implements Serializable{
private String number;
private String type;
public Phone(String number, String type) {
super();
this.number = number;
this.type = type;
}
public Phone(){
this("", "");
}
/**
* @return the type
*/
public String getType() {
return type;
}
@Override
public String toString() {
return this.getNumber()+" Tipo: "+this.getType();
}
/**
* @return the number
*/
public String getNumber() {
return number;
}
/**
* @param number the number to set
*/
public void setNumber(String number) {
this.number = number;
}
/**
* @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
}
|
fa3349eb-d764-410f-8455-16ac043e3b6e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-07T11:45:02", "repo_name": "shlok191/Hostel-Management", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1173, "line_count": 15, "lang": "en", "doc_type": "text", "blob_id": "682db3bed6ac15dcc8fe6051c2d3814ecea5b6e6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shlok191/Hostel-Management | 263 | FILENAME: README.md | 0.26588 | # Hostel-Management
This is a hostel management software that I made when I was 12 years old. The software uses Java for the front-end and a mySQL local database to securely save all the data.
The GUI is made with help of the swing package available for Java. The software, however, is not completely versatile for all hostels. As each hostels have a different amount of
capacities and requirements, slight tweaks were necessary for every hostel that I made this software for. All in all, I sold my software to 6 hostels in my city and nearby places.
Anyone who wants to review this project has my permission to do so. However, as the SQL database was saved to each device individually. A user will have to set up their own SQL database
and link it with this software. I believe anyone with sufficient knowledge in the field can do so :)
How To Run :-
1. Download and save the repository in a folder.
2. Open the Hostel folder, and then open the dist folder.
3. In the dist folder, there is an executable Jar File called Hostel, which will run the software.
4. Additionally, to tweak the code, anyone can open up this project via Netbeans(what I used), or Eclipse IDE.
|
e5f52da6-6682-4ac4-a151-7e2bdc83d7f7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-08-13 14:48:29", "repo_name": "wintermute0/foresty", "sub_path": "/foresty-server/src/main/java/com/foresty/service/impl/EventServiceImpl.java", "file_name": "EventServiceImpl.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "5db68bd142211f3c87388c6541031ccfa98a03c7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wintermute0/foresty | 184 | FILENAME: EventServiceImpl.java | 0.27048 | package com.foresty.service.impl;
import com.foresty.repository.EventRepository;
import com.foresty.repository.LogRepository;
import com.foresty.service.EventService;
import com.foresty.service.EventServiceException;
import com.google.common.base.Preconditions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Created by EveningSun on 14-3-23.
*/
@Service
public class EventServiceImpl implements EventService {
@Autowired
private EventRepository eventRepository;
@Autowired
private LogRepository logRepository;
@Override
@Transactional
public void deleteEventById(String eventId) throws EventServiceException {
Preconditions.checkNotNull(eventId);
Preconditions.checkArgument(!eventId.trim().isEmpty());
this.logRepository.deleteLogByEventId(eventId);
this.eventRepository.delete(eventId);
}
}
|
fe37cb7a-6a0a-47e0-91a3-0bae590acb99 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-30 07:04:26", "repo_name": "Chetan500/CricketTeamDetailsApplication", "sub_path": "/app/src/main/java/com/example/cricketteamsdetailsapp/view/FragmentAdapter.java", "file_name": "FragmentAdapter.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "947e31449fe1f9f54e631e66d6e9458fa083d4bd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Chetan500/CricketTeamDetailsApplication | 209 | FILENAME: FragmentAdapter.java | 0.264358 | package com.example.cricketteamsdetailsapp.view;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
import androidx.viewpager2.adapter.FragmentStateAdapter;
public class FragmentAdapter extends FragmentStateAdapter
{
public FragmentAdapter(@NonNull FragmentManager fragmentManager, @NonNull Lifecycle lifecycle)
{
super(fragmentManager, lifecycle);
}
@NonNull
@Override
public Fragment createFragment(int position)
{
TeamsDetailsFragment teamsDetailsFragment = new TeamsDetailsFragment();
Bundle bundle = new Bundle();
switch (position)
{
case 0:
bundle.putString("Team Name", "India");
break;
case 1:
bundle.putString("Team Name", "New Zealand");
break;
default:
break;
}
teamsDetailsFragment.setArguments(bundle);
return teamsDetailsFragment;
}
@Override
public int getItemCount()
{
return 2;
}
}
|
3c80d776-0f9a-4bec-8c9a-eb19ed4a9e4f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-08-02T19:30:49", "repo_name": "yluo86/yluo86.github.io", "sub_path": "/_posts/2016-01-11-sanger-proxy-snippet.markdown", "file_name": "2016-01-11-sanger-proxy-snippet.markdown", "file_ext": "markdown", "file_size_in_byte": 1174, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "0268e0fcb7bad763aef7b2714954c141932a22e1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yluo86/yluo86.github.io | 314 | FILENAME: 2016-01-11-sanger-proxy-snippet.markdown | 0.264358 | ---
layout: post
title: "ssh web-proxy -- working outside work"
date: 2016-01-11
categories: snippets
author: Yang
permalink: web-proxy
---
I recently moved to Boston from Sanger Institute, and had to access an internal website from a new laptop. This is the snippets of how to set it up, and generally speaking, it should work for any web proxy as long as you have a valid ssh login.
# 1. ssh from your terminal window:
{% highlight bash %}
ssh -L3128:cache1a.internal.sanger.ac.uk:3128 USERNAME@ssh.sanger.ac.uk
{% endhighlight %}
# 2. Change the proxy settings in the web browser to, the figure below shows a screen shot of my setting in Firefox

# Feeling lazy..
After doing this for a while, instead of typing the ssh command ever time, I created a tunnel set up in my config file `~/.ssh/config` and save some typing effort
{% highlight bash %}
Host Sanger_web
Hostname ssh.sanger.ac.uk
User USERNAME
LocalForward localhost:3128 cache1a.internal.sanger.ac.uk:3128
ForwardX11 yes
ForwardX11Trusted yes
{% endhighlight %}
And now I only need to do `ssh Sanger_web` to "jump the gate".
|
c2b83d2a-e8f0-4c78-b928-4a1e84cc776a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-04-07 15:06:22", "repo_name": "jhannes/certificate-fun", "sub_path": "/liquidpki/src/main/java/io/liquidpki/pkcs12/Pkcs12KeyStore.java", "file_name": "Pkcs12KeyStore.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "c3fcd605edbda424075a9cc381c4c7577534fc72", "star_events_count": 11, "fork_events_count": 4, "src_encoding": "UTF-8"} | https://github.com/jhannes/certificate-fun | 259 | FILENAME: Pkcs12KeyStore.java | 0.262842 | package io.liquidpki.pkcs12;
import io.liquidpki.der.Der;
import java.io.PrintStream;
import java.util.Iterator;
/**
* https://datatracker.ietf.org/doc/html/rfc7292#section-4
*/
public class Pkcs12KeyStore {
private final Der.INTEGER version;
private final ContentInfo authSafe;
private final MacData macData;
private final Der der;
public Pkcs12KeyStore(Der der) {
this.der = der;
Iterator<Der> iterator = ((Der.SEQUENCE) der).iterator();
version = (Der.INTEGER) iterator.next();
authSafe = new ContentInfo((Der.SEQUENCE) iterator.next());
macData = iterator.hasNext() ? new MacData((Der.SEQUENCE) iterator.next()) : null;
}
public void output(PrintStream out, String indent) {
der.output(out, indent);
out.println(getClass().getSimpleName() + ": " + der);
out.println(indent + " version=" + version);
authSafe.output(out, indent + " ");
if (macData != null) {
macData.output(out, indent + " ");
}
}
}
|
e7585fa5-2fb7-4acd-9097-34dd0194e84e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-18 21:00:12", "repo_name": "adolfo17832/proyectoSSyR", "sub_path": "/src/proyectoSSyR/servicio/ConectarServicio.java", "file_name": "ConectarServicio.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "c135eaa8252f32f7270b32fd1f41506f0f98872c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/adolfo17832/proyectoSSyR | 195 | FILENAME: ConectarServicio.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 proyectoSSyR.servicio;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author mario
*/
public class ConectarServicio {
private Conexion cdb;
private static ConectarServicio instancia;
public static synchronized ConectarServicio getInstancia(){
if(instancia ==null){
instancia=new ConectarServicio();
}
return instancia;
}
public Conexion getConexionDB() throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
{
if(cdb==null){
String nombreClase=System.getProperty("databaseclass");
cdb=(Conexion)Class.forName(nombreClase).newInstance();
}
return cdb;
}
}
|
68f7d807-76ed-4d18-b14f-7746b259f98f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-07 17:39:46", "repo_name": "milanrath0d/linux-simulator", "sub_path": "/src/main/java/org/milan/provider/SimpleBannerProvider.java", "file_name": "SimpleBannerProvider.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "451a3f4a216d0ae9e38bf2f3b3027d718fc786f9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/milanrath0d/linux-simulator | 218 | FILENAME: SimpleBannerProvider.java | 0.221351 | package org.milan.provider;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.shell.plugin.support.DefaultBannerProvider;
import org.springframework.shell.support.util.OsUtils;
import org.springframework.stereotype.Component;
/**
* Simple Banner Provider
*
* @author Milan Rathod
*/
@Component
@Order(Ordered.HIGHEST_PRECEDENCE)
public class SimpleBannerProvider extends DefaultBannerProvider {
public String getBanner() {
StringBuffer buf = new StringBuffer();
buf.append("=======================================").append(OsUtils.LINE_SEPARATOR);
buf.append("* Customize Shell *").append(OsUtils.LINE_SEPARATOR);
buf.append("=======================================").append(OsUtils.LINE_SEPARATOR);
buf.append("Version:").append(this.getVersion());
return buf.toString();
}
public String getVersion() {
return "1.0.0";
}
public String getWelcomeMessage() {
return "Welcome to Test Shell";
}
@Override
public String getProviderName() {
return "Test Shell Banner";
}
}
|
c0432819-f880-42dc-a271-63535bb69ed3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-21 14:27:57", "repo_name": "softwarebio/Mood-Android", "sub_path": "/app/src/main/java/com/buzzware/mood/activity/NotificationActivity.java", "file_name": "NotificationActivity.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ed621b4ea7938bcd975c72fffd21bcccfe6403ed", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/softwarebio/Mood-Android | 172 | FILENAME: NotificationActivity.java | 0.191933 | package com.buzzware.mood.activity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.buzzware.mood.R;
import com.buzzware.mood.databinding.ActivityNotificationBinding;
public class NotificationActivity extends AppCompatActivity {
ActivityNotificationBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding=ActivityNotificationBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setView();
setListener();
}
private void setListener() {
binding.includeView.backIV.setOnClickListener(v->{
finish();
});
}
private void setView() {
binding.includeView.titleTV.setText("Notifications");
binding.includeView.backIV.setImageResource(R.drawable.back_icon);
}
@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
} |
718701c4-0cfb-4336-9867-a18d525ac6cb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-05 11:00:29", "repo_name": "ArturMadejski/a-made.pl", "sub_path": "/src/main/java/pl/art/amadepl/dto/MessageDto.java", "file_name": "MessageDto.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "643280e9eba58f0fe2d500709ee5f6090638db69", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ArturMadejski/a-made.pl | 206 | FILENAME: MessageDto.java | 0.224055 | package pl.art.amadepl.dto;
import org.springframework.stereotype.Component;
import pl.art.amadepl.entity.MessageType;
import java.util.Date;
public class MessageDto {
private Integer id;
private String text;
private MessageType messageType;
private Date created;
public MessageDto(Integer id, String text, MessageType messageType, Date created) {
this.id = id;
this.text = text;
this.messageType = messageType;
this.created = created;
}
public MessageDto() {}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public MessageType getMessageType() {
return messageType;
}
public void setMessageType(MessageType messageType) {
this.messageType = messageType;
}
public Date getCreated() {
return created;
}
}
|
f20fa557-b74f-4883-bac8-450b37c3538a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-11 06:49:06", "repo_name": "iumehara/login-app", "sub_path": "/server/login-app-spring/src/main/java/com/example/user/UserRepo.java", "file_name": "UserRepo.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "90b0bc9c371a1e21f90794a33de2e543da3a23b2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/iumehara/login-app | 219 | FILENAME: UserRepo.java | 0.277473 | package com.example.user;
import com.example.login.LoginCredentials;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;
@Repository
public class UserRepo {
private UserDataMapper dataMapper;
public UserRepo(UserDataMapper dataMapper) {
this.dataMapper = dataMapper;
}
public List<User> all() {
return dataMapper.all();
}
public Optional<User> findByUsername(String username) {
return dataMapper.findByUsername(username);
}
public Optional<User> validate(LoginCredentials credentials) {
return dataMapper.validate(credentials);
}
public Optional<User> create(UserParams userParams) {
Optional<Integer> maybeRoleId = dataMapper.findRoleIdByName(userParams.getRole());
if(!maybeRoleId.isPresent()) return Optional.empty();
Optional<Integer> maybeUserId = dataMapper.create(new UserData(userParams, maybeRoleId.get()));
if(!maybeUserId.isPresent()) return Optional.empty();
User user = new User(maybeUserId.get(), userParams.getUsername(), userParams.getRole());
return Optional.of(user);
}
}
|
9a79fda1-0ff4-4e06-811b-538de78ac9f4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-06-06T17:02:14", "repo_name": "zwan2204/CP14-2", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1017, "line_count": 43, "lang": "en", "doc_type": "text", "blob_id": "47b8b40e19bd5bbfe66ab45710a23998c585510a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zwan2204/CP14-2 | 294 | FILENAME: README.md | 0.245085 | # CP14-2
Group 40 capstone project
## Installation
Use npm insall to install the package
```bash
cd CP14-2
npm install
```
## Development
```bash
npm run start
```
## Deployment
1. Fork the repository
2. Login to the [Amplify Console](https://console.aws.amazon.com/amplify/home) and choose Get started under Deploy. Grant Amplify permission to read from your GitHub account or organization that owns your repo.
3. The Amplify Console will detect that the amplify.yml file is in the repo. Choose Next.
4. Go to rewrites and redirects setting, add following setting:
```bash
Source address: </^[^.]+$|\.(?!(css|gif|ico|jpg|json|js|png|txt|svg|woff|ttf)$)([^.]+$)/>
Target address: /index.html
Type: 200
```
5. Go to build setting, make sure the node version is >= 12.13.0
```bash
nvm use 12
```
6. Review your settings and choose Save and deploy. Your app will now be deployed to a https://branchname.xxxxxx.amplifyapp.com URL.
## Backend Repository
[Backend](https://github.com/zihanmo/CP14-2-Backend)
|
a716f62b-6ce5-4b92-9069-71f5fc02e31f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-21 23:00:08", "repo_name": "apc4141/a-knights-adventure", "sub_path": "/src/knightsadventure/ui/events/LoopLinkEvent.java", "file_name": "LoopLinkEvent.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "71f86f223e86f6aeb714e4faa4bdbee103caa3f6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/apc4141/a-knights-adventure | 208 | FILENAME: LoopLinkEvent.java | 0.292595 | package knightsadventure.ui.events;
import knightsadventure.ui.Prompt;
import java.io.IOException;
public abstract class LoopLinkEvent extends LinkEvent {
public LoopLinkEvent(String eventName, Event... events) {
super(eventName, events);
}
@Override
public void execute() {
preLink();
// Prompt the user for what event they would like to access next
String[] eventNames = new String[events.size()+1];
for(int i = 0; i < events.size(); i++) eventNames[i] = events.get(i).eventName;
eventNames[events.size()] = "back";
Prompt prompt = new Prompt(eventNames);
while(true) {
int choice;
try {
choice = prompt.prompt();
} catch (IOException ignore) {
System.err.println("IOException in prompt.prompt()!");
return;
}
if(choice==events.size()) return;
Event event = events.get(choice);
event.execute();
}
}
}
|
8ae08bc0-6426-4d41-9516-93c5247eef09 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-13 02:25:48", "repo_name": "biantaiwuzui/netx", "sub_path": "/trunk/netx-common/src/main/java/com/netx/common/user/dto/integration/SelectUserProfessionResponse.java", "file_name": "SelectUserProfessionResponse.java", "file_ext": "java", "file_size_in_byte": 1037, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "d345991ace6897a0320e941d40ce926d36a409b7", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/biantaiwuzui/netx | 202 | FILENAME: SelectUserProfessionResponse.java | 0.195594 | package com.netx.common.user.dto.integration;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
@ApiModel("用户工作经历信息")
public class SelectUserProfessionResponse {
@ApiModelProperty("职业")
private String professionLabel;
@ApiModelProperty("工作经历详情列表")
private List<SelectUserProfessionDetailResponse> list;
public String getProfessionLabel() {
return professionLabel;
}
public void setProfessionLabel(String professionLabel) {
this.professionLabel = professionLabel;
}
public List<SelectUserProfessionDetailResponse> getList() {
return list;
}
public void setList(List<SelectUserProfessionDetailResponse> list) {
this.list = list;
}
@Override
public String toString() {
return "SelectUserProfessionResponse{" +
"professionLabel='" + professionLabel + '\'' +
", list=" + list +
'}';
}
}
|
295e9ac6-0cac-4c8f-868f-427279253678 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-05 17:20:40", "repo_name": "puvvadivk4/master", "sub_path": "/demo-springboot/src/main/java/com/example/hrsh/demo/services/PersonService.java", "file_name": "PersonService.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "93e10bd3b2d4fa8f74fe90cb061987b680b2f46b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/puvvadivk4/master | 188 | FILENAME: PersonService.java | 0.259826 | package com.example.hrsh.demo.services;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.hrsh.demo.repos.PersonRepository;
import com.example.hrsh.demo.ents.*;
@Service
public class PersonService {
@Autowired
PersonRepository personRepository;
@Autowired
PersonRepository personRepositoryyy;
public List<Person> getAllPersons() {
List<Person> persons = new ArrayList<Person>();
personRepository.findAll().forEach(person -> persons.add(person));
return persons;
}
public PersonService() {
}
public Person getPersonById(Long id) {
return personRepository.findById( id).get();
}
public void saveOrUpdate(Person person) {
personRepository.save(person);
}
public void delete(int id) {
personRepository.deleteById((long) id);
}
}
|
c69bc906-1d92-47e2-98c6-c47ba41ee612 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-10 15:21:48", "repo_name": "VSukhovych/diploma", "sub_path": "/src/main/java/edu/nulp/diploma/businesslogic/menu/city/CityServicesLogic.java", "file_name": "CityServicesLogic.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "167c5db8a37b4377e64a606e37c6fcf654d273dc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/VSukhovych/diploma | 235 | FILENAME: CityServicesLogic.java | 0.26971 | package edu.nulp.diploma.businesslogic.menu.city;
import edu.nulp.diploma.pageobject.menu.city.CityServicesPage;
import io.qameta.allure.Step;
public class CityServicesLogic {
private CityServicesPage cityServicesPage;
public CityServicesLogic() {
cityServicesPage = new CityServicesPage();
}
@Step("Get City Services header text")
public String getCityServicesHeaderText() {
return cityServicesPage.getCityServicesHeader().getText();
}
@Step("Get Card link text")
public String getCardLinkText() {
return cityServicesPage.getCardLink().getText();
}
@Step("Get Apartments link text")
public String getApartmentsLinkText() {
return cityServicesPage.getApartmentsLink().getText();
}
@Step("Get Pay Taxes link text")
public String getPayTaxesLinkText() {
return cityServicesPage.getPayTaxesLink().getText();
}
@Step("Get More link text")
public String getMoreLinkText() {
return cityServicesPage.getMoreLink().getText();
}
}
|
dfd77d39-b384-4f42-9c59-e644daaf6a8a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-04-01T21:43:36", "repo_name": "kkirsche/launchy", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1195, "line_count": 40, "lang": "en", "doc_type": "text", "blob_id": "91f64208491594effd5ecbda1c98d3147e4d8a72", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kkirsche/launchy | 311 | FILENAME: README.md | 0.286169 | # Launchy
Because someone needs to launch the Mac OS X services already.
## Introduction
I hate OS'X's `launchctl`? You have to give it exact filenames. The syntax is annoyingly different from Linux's nice, simple init system and it's overly verbose. It's just not a very developer-friendly tool.
Launchy aims to be that friendly and performant tool by wrapping `launchctl` and providing a few simple operations that you perform all the time:
```
launchy list [-r pattern]
launchy status [-r pattern]
```
where pattern is just a substring that matches the agent's plist filename. Use launchy's `list` or `status` command to view possible completions.
### Examples
#### List
```shell
~/go/src/github.com/kkirsche/launchy git:master ❯❯❯ launchy list ✱ ◼
at.obdev.LittleSnitchUIAgent
org.macosforge.xquartz.startx
com.adobe.AAM.Updater-1.0
com.apple.serveralertproxy
homebrew.mxcl.postgresql
org.virtualbox.vboxwebsrv
```
```shell
~/go/src/github.com/kkirsche/launchy git:master ❯❯❯ launchy list -r "LittleSnitch" ✱ ◼
at.obdev.LittleSnitchUIAgent
```
### Credit
Shamelessly ripped off of https://github.com/eddiezane/lunchy
|
d61fb848-03a4-4933-97c8-3a9d8df17da1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-09 10:30:29", "repo_name": "alireza-ebrahimi/telegram-talaeii", "sub_path": "/5.3.5/sources/com/crashlytics/android/core/InvalidSessionReport.java", "file_name": "InvalidSessionReport.java", "file_ext": "java", "file_size_in_byte": 1174, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "3e8fd430ddc9fbc8a758b6990bd8e77112f8ab87", "star_events_count": 12, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/alireza-ebrahimi/telegram-talaeii | 248 | FILENAME: InvalidSessionReport.java | 0.290981 | package com.crashlytics.android.core;
import io.fabric.sdk.android.Fabric;
import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
class InvalidSessionReport implements Report {
private final Map<String, String> customHeaders = new HashMap(ReportUploader.HEADER_INVALID_CLS_FILE);
private final File[] files;
private final String identifier;
public InvalidSessionReport(String identifier, File[] files) {
this.files = files;
this.identifier = identifier;
}
public String getFileName() {
return this.files[0].getName();
}
public String getIdentifier() {
return this.identifier;
}
public File getFile() {
return this.files[0];
}
public File[] getFiles() {
return this.files;
}
public Map<String, String> getCustomHeaders() {
return Collections.unmodifiableMap(this.customHeaders);
}
public void remove() {
for (File file : this.files) {
Fabric.getLogger().mo4381d(CrashlyticsCore.TAG, "Removing invalid report file at " + file.getPath());
file.delete();
}
}
}
|
cc48cd48-8e73-4e1e-8244-68a9f09702c4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-06 10:15:03", "repo_name": "LikhanovP/s14_question", "sub_path": "/motocross/src/main/java/com/rosa/swift/core/network/json/sap/swchat/JRoom.java", "file_name": "JRoom.java", "file_ext": "java", "file_size_in_byte": 1227, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "c9be1375cbbd050ea05867b225fee73c59482682", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LikhanovP/s14_question | 305 | FILENAME: JRoom.java | 0.27048 | package com.rosa.swift.core.network.json.sap.swchat;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
/**
* Created by yalang on 04.12.2014.
* <p>
* ROOM_ID ZCHAT_ROOM_ID
* TOPIC CHAR100
* LAST_CHANGE TIMESTAMP
* MESSAGE_COUNT INT4
* SWIFT_CHAT ZSWIFT_CHAT
*/
public class JRoom implements Serializable {
@SerializedName("ROOM_ID")
public String room_id;
@SerializedName("TOPIC")
public String topic;
@SerializedName("LAST_CHANGE")
public String last_change;
@SerializedName("MESSAGE_COUNT")
public int message_count;
@SerializedName("SWIFT_CHAT")
public String swift_chat;
public String getTitleTopic() {
if (topic != null) topic = topic.replace("\r\n", "");
return topic != null ? (topic.length() >= 20 ? topic.substring(0, 20) : topic) : room_id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
JRoom jRoom = (JRoom) o;
if (!room_id.equals(jRoom.room_id)) return false;
return true;
}
@Override
public int hashCode() {
return room_id.hashCode();
}
}
|
0dfaa1d3-140e-49e8-a9d6-c11b9fe62f6b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-17 13:44:19", "repo_name": "mack94/urban-traffic-monitoring-application", "sub_path": "/cron/src/main/java/pl/edu/agh/pp/cron/utils/RoutesLoader.java", "file_name": "RoutesLoader.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "5dc7d211b3d9bcc5f384813f6e3ea5081115e480", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/mack94/urban-traffic-monitoring-application | 202 | FILENAME: RoutesLoader.java | 0.288569 | package pl.edu.agh.pp.cron.utils;
import org.apache.commons.io.IOUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by Maciej on 15.05.2016.
* 00:14
* Project: 1.
*/
public class RoutesLoader {
/**
* Thread-safe singleton.
* But not allow multiple singleton instances.
*/
private final static RoutesLoader INSTANCE = new RoutesLoader();
private static String fileName = "/routes.json";
private RoutesLoader() {
}
public static RoutesLoader getInstance() {
return INSTANCE;
}
public String getDefaultJSONFileName() {
return fileName;
}
public JSONArray loadJSON() throws IOException {
InputStream inputStream = System.class.getResourceAsStream(fileName);
String jsonTxt = IOUtils.toString(inputStream);
JSONObject jsonObject = new JSONObject(jsonTxt);
return jsonObject.getJSONArray("routes");
}
}
|
4329b0f0-08e3-45cb-a337-038b044df1e5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-03-10T20:22:49", "repo_name": "AThoennes/Plex-Music", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1048, "line_count": 17, "lang": "en", "doc_type": "text", "blob_id": "981dc713a17287e4659115d1a8a8ad9e8d0b6630", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AThoennes/Plex-Music | 248 | FILENAME: README.md | 0.212069 | # Plex-Music
This is a python script I wrote to download all the music from my plex server.
It uses the plexapi for python which can be found [here.](http://python-plexapi.readthedocs.io/en/latest/introduction.html)
For now, this script only lets you enter the atist you would like to download.
You can enter as many artists as you would like to download, and when you are done
you type *x* to start the download. If you would like to download every single song
for every single artist in the music library, you enter *\**. This symbolizes everything.
After that you follow it with and *x* and you will start downloading the music. All the music
is downloaded to a directory on your destop called *plex music*.
## Installation
The installation is very simple. All you need to do is install plexapi and you're good to go.
You can do this by going into terminal and entering **pip install plexapi**. Examples of how
to use the api as well as the documentation can be found [here.](http://python-plexapi.readthedocs.io/en/latest/introduction.html)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.