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 |
|---|---|---|---|---|---|---|
58ecb3e4-0ce3-4737-88b8-3929b04fb70a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-11 09:24:21", "repo_name": "tboqi/tbqapps", "sub_path": "/javaApps/yuqiblog-gae/src/com/yuqi/blog/dao/gae/UserDaoImpl.java", "file_name": "UserDaoImpl.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "d9030bff07f69f21466faf8b7476b6ecc47af3d3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tboqi/tbqapps | 257 | FILENAME: UserDaoImpl.java | 0.286968 | package com.yuqi.blog.dao.gae;
import java.util.List;
import javax.jdo.PersistenceManager;
import com.yuqi.blog.dao.UserDao;
import com.yuqi.blog.domain.User;
import com.yuqi.blog.utils.PMF;
import javax.jdo.Query;
public class UserDaoImpl implements UserDao {
private PersistenceManager pm = PMF.get().getPersistenceManager();
@Override
public User get(Long id) {
return pm.getObjectById(User.class, id);
}
@Override
public User save(User user) {
user.setPassword2(null);
user = pm.makePersistent(user);
return user;
}
@SuppressWarnings("unchecked")
@Override
public User getByUsername(String username) {
Query query = pm.newQuery(User.class);
query.setFilter("username == param");
query.declareParameters("String param");
List<User> results = (List<User>) query.execute(username);
if (results.size() < 1)
return null;
else
return results.get(0);
}
@SuppressWarnings("unchecked")
@Override
public int count() {
Query query = pm.newQuery(User.class);
List<User> results = (List<User>) query.execute();
return results.size();
}
}
|
7d4dd9b1-d980-4b6f-a8c4-740cba6d4a05 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-10 11:15:29", "repo_name": "Zxobi/andersenlab", "sub_path": "/bookstorageweb/src/test/java/com/andersenlab/bookstorageweb/PublishingHouseRepositoryIntegrationTest.java", "file_name": "PublishingHouseRepositoryIntegrationTest.java", "file_ext": "java", "file_size_in_byte": 1234, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "2a94881683f9fc158b48bd4249963ec48123972f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Zxobi/andersenlab | 222 | FILENAME: PublishingHouseRepositoryIntegrationTest.java | 0.279042 | package com.andersenlab.bookstorageweb;
import com.andersenlab.bookstorageweb.entity.PublishingHouse;
import com.andersenlab.bookstorageweb.repository.PublishingHouseRepository;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(SpringExtension.class)
@DataJpaTest
public class PublishingHouseRepositoryIntegrationTest {
@Autowired
private TestEntityManager entityManager;
@Autowired
private PublishingHouseRepository publishingHouseRepository;
@Test
public void testFindById() {
PublishingHouse publishingHouse = new PublishingHouse("publishing house name");
entityManager.persist(publishingHouse);
entityManager.flush();
assertThat(
publishingHouseRepository.findById(publishingHouse.getId()).get().getName()
).isEqualTo("publishing house name");
}
}
|
d115ac7e-0cc2-40f6-83f3-dcb4ca542dd2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-14 15:21:01", "repo_name": "ebi-uniprot/QuickGOBE", "sub_path": "/ontology-rest/src/main/java/uk/ac/ebi/quickgo/ontology/service/search/SearchServiceImpl.java", "file_name": "SearchServiceImpl.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "7f296a63650f9ed217a912097122d080c6af831a", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/ebi-uniprot/QuickGOBE | 237 | FILENAME: SearchServiceImpl.java | 0.272025 | package uk.ac.ebi.quickgo.ontology.service.search;
import uk.ac.ebi.quickgo.rest.search.RequestRetrieval;
import uk.ac.ebi.quickgo.rest.search.SearchService;
import uk.ac.ebi.quickgo.rest.search.query.QueryRequest;
import uk.ac.ebi.quickgo.rest.search.results.QueryResult;
import uk.ac.ebi.quickgo.ontology.model.OBOTerm;
/**
* The search service implementation for ontologies. This class implements the
* {@link SearchService} interface, and delegates retrieval of ontology results
* to a {@link RequestRetrieval} instance.
*
* Created 18/01/16
* @author Edd
*/
public class SearchServiceImpl implements SearchService<OBOTerm> {
private final RequestRetrieval<OBOTerm> requestRetrieval;
public SearchServiceImpl(RequestRetrieval<OBOTerm> requestRetrieval) {
this.requestRetrieval = requestRetrieval;
}
@Override
public QueryResult<OBOTerm> findByQuery(QueryRequest request) {
return this.requestRetrieval.findByQuery(request);
}
}
|
d12673f7-bc57-471a-9096-592fdbe5bf5b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-09 14:18:22", "repo_name": "deNiroMe/spring-demos", "sub_path": "/book-service/src/main/java/ma/example/books/controllers/BookController.java", "file_name": "BookController.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "714a31930fa31f82507643ec8160ed6442e942e0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/deNiroMe/spring-demos | 201 | FILENAME: BookController.java | 0.256832 | package ma.example.books.controllers;
import java.util.List;
import lombok.AllArgsConstructor;
import ma.example.books.services.BookService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ma.example.books.entities.Book;
import ma.example.books.repositories.BookRepository;
@RestController
@RequestMapping("/api/v1")
@AllArgsConstructor
public class BookController {
private final BookService bookService;
@PostMapping("/books")
public Book addBook(@RequestBody Book book) {
return bookService.createBook(book);
}
@GetMapping("/books/{bookId}")
public Book getBookById(@PathVariable final Long bookId) {
return bookService.getBook(bookId);
}
@GetMapping("/books")
public List<Book> getBooks() {
return bookService.getBooks();
}
@DeleteMapping("/books/{bookId}")
public ResponseEntity<Void> deleteBook(@PathVariable final Long bookId) {
bookService.deleteBook(bookId);
return new ResponseEntity<>(HttpStatus.OK);
}
}
|
2c41ac47-dda6-409b-aa13-398aa7f53839 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-10 06:18:54", "repo_name": "JDZhao/QQResourceCollection", "sub_path": "/course.storage/src/main/java/course/storage/imp/ResourceProcess.java", "file_name": "ResourceProcess.java", "file_ext": "java", "file_size_in_byte": 1208, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "e654e09645dfabcb8b3735e44b3f6aa3f7bbf673", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "GB18030"} | https://github.com/JDZhao/QQResourceCollection | 295 | FILENAME: ResourceProcess.java | 0.286968 | package course.storage.imp;
import java.util.List;
import course.spider.entity.WebSitesNewList;
import course.storage.configuration.ConfigUration;
import course.storage.interfaces.IResourceProcess;
/**
* 多线程资源处理的抽象类
*
* @author zhaojd
* @date 2016年10月24日 下午11:06:34
* @version 1.0
*/
public abstract class ResourceProcess<T> implements IResourceProcess<T> {
protected List<WebSitesNewList> webSitesNewList;
protected String path;
protected int times;
protected String threadname;
protected String tag;
protected int sleepTime;
public ResourceProcess(List<WebSitesNewList> webSitesNewList, String path, ConfigUration configUration,
String threadname) {
this.webSitesNewList = webSitesNewList;
this.path = path;
this.times = configUration.getTrytimes();
this.threadname = threadname;
this.sleepTime = configUration.getSleepTime();
}
public ResourceProcess(List<WebSitesNewList> webSitesNewList, ConfigUration configUration, String threadname) {
this.webSitesNewList = webSitesNewList;
this.times = configUration.getTrytimes();
this.threadname = threadname;
this.sleepTime = configUration.getSleepTime();
}
}
|
75de425c-72aa-4bc0-b734-8b336043dbe7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-02-05 22:58:40", "repo_name": "robend123/prace_dyplomowe2", "sub_path": "/src/java/entity/Cycle.java", "file_name": "Cycle.java", "file_ext": "java", "file_size_in_byte": 1039, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "2d75ec129b2bb4c81e6b79a1d3e219984067ae65", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/robend123/prace_dyplomowe2 | 213 | FILENAME: Cycle.java | 0.23092 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package entity;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
/**
*
* @author Robson
*/
public class Cycle implements Serializable {
private long cycleId;
private String name;
Set Specializations = new HashSet(0);
public Cycle(){
}
public Cycle(/*long id,*/String name){
this.name = name;
//this.cycleId=id;
}
public Long getCycleId() {
return cycleId;
}
public void setCycleId(Long cycleId) {
this.cycleId = cycleId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Set getSpecializations() {
return Specializations;
}
public void setSpecializations(Set Specializations) {
this.Specializations = Specializations;
}
}
|
ddca7450-c9ed-49f2-9e9f-3be5c7a36eae | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-02 03:20:18", "repo_name": "pengkeng/pb2json", "sub_path": "/src/main/java/com/ucas/bigdata/controller/PbToJsonController.java", "file_name": "PbToJsonController.java", "file_ext": "java", "file_size_in_byte": 1040, "line_count": 25, "lang": "en", "doc_type": "code", "blob_id": "3fe61f07a8433fe9f95b71260b8babf838cfc317", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pengkeng/pb2json | 199 | FILENAME: PbToJsonController.java | 0.259826 | package com.ucas.bigdata.controller;
import com.ucas.bigdata.proto.WebApi;
import com.ucas.bigdata.service.PbToJsonTransForService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@Controller
public class PbToJsonController {
private static Logger logger = LoggerFactory.getLogger(com.ucas.bigdata.controller.PbToJsonController.class);
@Autowired
private PbToJsonTransForService transforService;
@RequestMapping(value = "/getJson", method = RequestMethod.POST, produces = "application/x-protobuf")
public @ResponseBody
WebApi.InfoResponse getUserInfo(@RequestBody WebApi.InfoRequest request, @RequestParam(value = "version", defaultValue = "3") String version) throws Exception {
WebApi.InfoResponse.Builder builder = transforService.getInfo(request.getSchema(), request.getData(), version);
return builder.build();
}
}
|
53ca0c01-0edb-4140-952a-3667c4a29c95 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-06-22 21:08:47", "repo_name": "NOAA-PMEL/OAPDashboard", "sub_path": "/UploadDashboard/src/gov/noaa/pmel/dashboard/server/vocabularies/NewVocabularyItemProposal.java", "file_name": "NewVocabularyItemProposal.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "cf6478f931ae315e8fb5049c38050a21e700f166", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/NOAA-PMEL/OAPDashboard | 221 | FILENAME: NewVocabularyItemProposal.java | 0.217338 | /**
*
*/
package gov.noaa.pmel.dashboard.server.vocabularies;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
/**
* @author kamb
*
*/
@Data
@SuperBuilder(toBuilder = true)
@Setter(AccessLevel.NONE)
@NoArgsConstructor
@AllArgsConstructor
public class NewVocabularyItemProposal {
@JsonProperty("proposed_name")
private String _proposedName;
@JsonProperty("dataset_recordid")
private String _recordId;
@JsonProperty("user_id")
private String _userId;
@JsonProperty("user_email")
private String _userEmail;
@Builder.Default
@JsonProperty("propose_date")
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ss z", timezone="PST")
private Date _proposedOn = new Date();
}
|
f6551b07-1158-4693-ba27-7b476c936a20 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-24 03:15:08", "repo_name": "huiyu/ceresfs", "sub_path": "/ceresfs-server/src/test/java/io/github/huiyu/ceresfs/util/NetUtilTest.java", "file_name": "NetUtilTest.java", "file_ext": "java", "file_size_in_byte": 1164, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "62a81da2540fd9723772813c65058360d15f99bf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/huiyu/ceresfs | 242 | FILENAME: NetUtilTest.java | 0.282988 | package io.github.huiyu.ceresfs.util;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.apache.curator.test.TestingServer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.net.InetAddress;
import static org.junit.Assert.*;
public class NetUtilTest {
private TestingServer server;
@Before
public void setUp() throws Exception {
server = new TestingServer(true);
}
@After
public void tearDown() throws Exception {
server.close();
}
@Test
public void testGetLocalAddressFromZookeeper() throws Exception {
ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(200, 10);
CuratorFramework client = CuratorFrameworkFactory.newClient(
server.getConnectString(), retryPolicy);
client.start();
InetAddress address = NetUtil.getLocalAddressFromZookeeper(client);
assertNotNull(address);
assertEquals("127.0.0.1", address.getHostAddress());
client.close();
}
} |
a1120e0a-f8b8-47b2-8018-002d809057ca | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-07 23:58:30", "repo_name": "sattdn21-01-02/selenium-minh2", "sub_path": "/src/main/java/models/Account.java", "file_name": "Account.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "eb127f989dc6818f1ad8413bb4f160c2943cd94f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sattdn21-01-02/selenium-minh2 | 205 | FILENAME: Account.java | 0.225417 | package models;
import helper.DataHelper;
public class Account {
private String email;
private String password;
private String pid;
public Account() {
email = DataHelper.getRandomValidEmail();
password = DataHelper.getRandomValidPassword();
pid = DataHelper.getRandomValidPid();
}
public Account(String email, String password) {
this.email = email;
this.password = password;
}
public Account(String email, String password, String pid) {
this.email = email;
this.password = password;
this.pid = pid;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
}
|
8e2b23dc-6dfe-456d-93f6-ac043dcf6cc8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-07 00:02:16", "repo_name": "blakethiessen/cirque", "sub_path": "/core/src/com/blakeandshahan/cirque/systems/render/UIRenderSystem.java", "file_name": "UIRenderSystem.java", "file_ext": "java", "file_size_in_byte": 1191, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "9326373f372cd9b122297b74fa321e6c27188372", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/blakethiessen/cirque | 255 | FILENAME: UIRenderSystem.java | 0.293404 | package com.blakeandshahan.cirque.systems.render;
import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.Family;
import com.badlogic.ashley.systems.IteratingSystem;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.blakeandshahan.cirque.Mapper;
import com.blakeandshahan.cirque.components.Render;
import com.blakeandshahan.cirque.components.UI;
/*
The RenderSystem draws all sprites onto the screen.
*/
public class UIRenderSystem extends IteratingSystem
{
private SpriteBatch batch;
public UIRenderSystem(SpriteBatch spriteBatch)
{
super(Family.all(Render.class, UI.class).get());
batch = spriteBatch;
}
protected void processEntity(Entity e, float deltaTime)
{
Render render = Mapper.render.get(e);
if (render.isVisible)
{
if (render.flipped)
{
if (!render.sprites[0].isFlipX())
render.flipSprites(true, false);
}
else
{
if (render.sprites[0].isFlipX())
render.flipSprites(true, false);
}
render.draw(batch);
}
}
}
|
624ee251-d9da-48f1-8bb2-cabdc1c51de2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-02 19:44:40", "repo_name": "pm012/ftasks", "sub_path": "/fTasks/src/lesson16/SFileChooser.java", "file_name": "SFileChooser.java", "file_ext": "java", "file_size_in_byte": 1233, "line_count": 65, "lang": "en", "doc_type": "code", "blob_id": "e1aae8a70b9f1dd12fdd2941ca4485148f13728f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pm012/ftasks | 293 | FILENAME: SFileChooser.java | 0.286169 | package lesson16;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.FlowLayout;
import java.io.File;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.filechooser.FileFilter;
public class SFileChooser extends JFrame {
JTextArea txt;
SFileChooser() {
super("Open and Save file");
setSize(200, 300);
Container c = getContentPane();
JPanel pn = new JPanel(new FlowLayout(FlowLayout.CENTER, 8, 5));
JButton openBtn = new JButton("Open");
JButton saveBtn = new JButton("Save");
pn.add(openBtn);
pn.add(saveBtn);
c.add(pn, BorderLayout.NORTH);
txt = new JTextArea();
JScrollPane sp = new JScrollPane(txt);
c.add(sp, BorderLayout.CENTER);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args) {
new SFileChooser();
}
class ExtFileChooser extends FileFilter {
String ext;
String desc;
ExtFileChooser(String ext, String desc) {
this.ext = ext;
this.desc = desc;
}
public boolean accept(File file) {
return true;
}
public String getDescription() {
return this.desc;
}
}
}
|
5e46cbff-e973-4964-bf7e-fe92ad09e646 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-11-13T12:40:53", "repo_name": "gitdoit/learning-springboot", "sub_path": "/spring-mongodb/src/test/java/org/seefly/springmongodb/enums/EnumSupportTest.java", "file_name": "EnumSupportTest.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "55048c3baf7462de3c140e40d2be3db227a836ce", "star_events_count": 2, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/gitdoit/learning-springboot | 249 | FILENAME: EnumSupportTest.java | 0.258326 | package org.seefly.springmongodb.enums;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.seefly.springmongodb.entity.Person;
import org.seefly.springmongodb.utils.MongoClientUtil;
import org.springframework.data.mongodb.core.MongoTemplate;
import java.util.List;
import static org.springframework.data.mongodb.core.query.Criteria.where;
import static org.springframework.data.mongodb.core.query.Query.query;
/**
* @author liujianxin
* @date 2021/7/19 16:01
**/
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class EnumSupportTest {
MongoTemplate template;
@BeforeAll
void before() {
template = MongoClientUtil.create("test");
}
@Test
void testInsertWithEnum(){
Person p = new Person();
p.setAge(12);
p.setName("enum");
p.setStatus(AuditStatusEnum.AUDITING);
template.save(p);
}
@Test
void find(){
List<Person> list = template.find(query(where("name").is("enum")), Person.class);
System.out.println(list);
}
}
|
3ba84f22-4f7e-45ac-9059-ef83018e78d1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-17 13:05:04", "repo_name": "eniacce/hql-builder", "sub_path": "/hql-builder/hql-builder-web/hql-builder-webservice/src/main/java/org/tools/hqlbuilder/webservice/jquery/ui/tagit/TagIt.java", "file_name": "TagIt.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "8911c4bded07359eb2c11e51fee7534f34c66421", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/eniacce/hql-builder | 233 | FILENAME: TagIt.java | 0.262842 | package org.tools.hqlbuilder.webservice.jquery.ui.tagit;
import org.tools.hqlbuilder.webservice.jquery.ui.jqueryui.JQueryUI;
import org.tools.hqlbuilder.webservice.wicket.CssResourceReference;
import org.tools.hqlbuilder.webservice.wicket.JavaScriptResourceReference;
/**
* @see http://aehlke.github.io/tag-it/
*/
public class TagIt {
public static JavaScriptResourceReference TAG_IT_JS = new JavaScriptResourceReference(TagIt.class, "js/tag-it.js");
static {
try {
TAG_IT_JS.addJavaScriptResourceReferenceDependency(JQueryUI.getJQueryUIReference());
} catch (Exception ex) {
//
}
}
public static CssResourceReference TAG_IT_CSS = new CssResourceReference(TagIt.class, "css/jquery.tagit.css");
public static CssResourceReference TAG_IT_ZEN_CSS = new CssResourceReference(TagIt.class, "css/tagit.ui-zendesk.css");
public static JavaScriptResourceReference TAG_IT_FACTORY_JS = new JavaScriptResourceReference(TagIt.class, "tag-it-factory.js")
.addJavaScriptResourceReferenceDependency(TAG_IT_JS);
}
|
08d778c5-8358-4f51-a816-38f67dd5dc11 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-19 15:37:04", "repo_name": "jojoldu/blog-code", "sub_path": "/spring-validation/src/main/java/com/blogcode/domain/web/MemberController.java", "file_name": "MemberController.java", "file_ext": "java", "file_size_in_byte": 1163, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "d03ddd20790d69a7bf7df173a41a4e1759561b74", "star_events_count": 705, "fork_events_count": 451, "src_encoding": "UTF-8"} | https://github.com/jojoldu/blog-code | 244 | FILENAME: MemberController.java | 0.258326 | package com.blogcode.domain.web;
import com.blogcode.domain.member.MemberService;
import com.blogcode.domain.member.dto.MemberRequestDto;
import com.blogcode.domain.member.dto.MemberResponseDto;
import com.blogcode.domain.member.dto.ValidTestDto;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* Created by jojoldu@gmail.com on 2017. 2. 20.
* Blog : http://jojoldu.tistory.com
* Github : http://github.com/jojoldu
*/
@RestController
public class MemberController {
private MemberService memberService;
public MemberController(MemberService memberService) {
this.memberService = memberService;
}
@PostMapping("/member")
public Long saveMember(@RequestBody @Valid MemberRequestDto memberRequestDto) {
return memberService.save(memberRequestDto);
}
@GetMapping("/members")
public List<MemberResponseDto> findAll(){
return memberService.findAll();
}
@PostMapping("/test")
public ValidTestDto validTest(@Valid ValidTestDto validTestDto){
return validTestDto;
}
}
|
9273164b-9bad-4cde-82c5-80efe5f17bd5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-05 13:31:55", "repo_name": "TanyaOdyniuk/PetSpace", "sub_path": "/src/main/java/com/netcracker/model/like/CommentLike.java", "file_name": "CommentLike.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "ad7c25084dbbaf4a35f686fc17234b688644ad78", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/TanyaOdyniuk/PetSpace | 221 | FILENAME: CommentLike.java | 0.258326 | package com.netcracker.model.like;
import com.netcracker.dao.annotation.ObjectType;
import com.netcracker.dao.annotation.Reference;
import com.netcracker.model.comment.AbstractComment;
import com.netcracker.model.comment.CommentConstant;
@ObjectType(LikeConstant.LDL_TYPE)
public class CommentLike extends AbstractLike {
@Reference(value = CommentConstant.COM_LIKEDISLIKE, isParentChild = 0)
private AbstractComment likedDislikedComment;
public CommentLike() {
}
public CommentLike(String name) {
super(name);
}
public CommentLike(String name, String description) {
super(name, description);
}
public AbstractComment getLikedDislikedComment() {
return likedDislikedComment;
}
public void setLikedDislikedComment(AbstractComment likedDislikedComment) {
this.likedDislikedComment = likedDislikedComment;
}
@Override
public String toString() {
return "CommentLike{" +
"likedDislikedComment=" + likedDislikedComment +
'}';
}
}
|
adf9524f-95f3-4036-be09-48cc28e162c9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-14 17:18:10", "repo_name": "SiriShortcutboi/New-Java-2020-6_7-projects", "sub_path": "/New Java 2020 6_7 projects/chapter 10 classes oop/src/holden/anderson/car/Car.java", "file_name": "Car.java", "file_ext": "java", "file_size_in_byte": 1236, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "540fb1cbacfd3ff7bd42f2d86810aaa538ab9fb7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SiriShortcutboi/New-Java-2020-6_7-projects | 287 | FILENAME: Car.java | 0.26588 | package holden.anderson.car;
import java.awt.Color;
import java.util.Scanner;
import Vehicle;
import holden.anderson.carcomponents.Engine;
public class Car extends Vehicle{
String color;
int numDoors;
String doorType;
Long hardware;
double price;
Engine engine = new Engine();
public Car() {
Scanner input = new Scanner(System.in);
System.out.println("What color should your car be?");
color = input.nextLine();
System.out.println("What doors should your car have?");
numDoors = input.nextInt();
input.nextLine();
System.out.println("What kind of doors should your car have?");
doorType = input.nextLine();
System.out.println("How many wheels should your car have?");
input.nextLine();
hardware = input.nextLong();
System.out.println("What hardware should your car have?");
System.out.println("What price should your car have?");
input.nextLine();
price=(25000.00);
input.close();
}
public void drive() {
if (engine.cylinders == 8) {
System.out.println("I'm driving really fast");
}
else {
System.out.println("I'm driving");
}
}
public void start() {
System.out.println("you started the car");
}
}
|
8e92c424-5a67-4738-aab0-a1e0b021d9a3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-06-19 04:13:05", "repo_name": "zibilal/ExternalFileLogger", "sub_path": "/lib/src/main/java/com/zibilal/externalfilelogger/ExternalLoggerHelper.java", "file_name": "ExternalLoggerHelper.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "dff9f7b908d28a08c1d36f95260afe3e7e00542d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zibilal/ExternalFileLogger | 196 | FILENAME: ExternalLoggerHelper.java | 0.242206 | package com.zibilal.externalfilelogger;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* Created by bilalmuhammad on 9/22/14.
*/
public class ExternalLoggerHelper {
private Storage storage;
private Logger logger;
private int capacity;
private Writer writer;
public ExternalLoggerHelper(Storage storage, int capacity) {
this.storage=storage;
this.capacity=capacity;
logger = new Logger(capacity);
writer = new Writer(storage, logger);
ExecutorService executor = Executors.newCachedThreadPool();
executor.execute(writer);
executor.shutdown();
}
public int getCapacity(){
return capacity;
}
public Storage getStorage(){
return storage;
}
public void log(String str) {
try {
Message message = new Message();
message.setMessage(str);
logger.set(message);
} catch (InterruptedException e) {
}
}
}
|
c3d14aa8-699b-4b3d-8fbe-69197c33c1f6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-14 15:21:01", "repo_name": "ebi-uniprot/QuickGOBE", "sub_path": "/annotation-rest/src/test/java/uk/ac/ebi/quickgo/annotation/coterms/CoTermRepositorySimpleMapFailedRetrievalIT.java", "file_name": "CoTermRepositorySimpleMapFailedRetrievalIT.java", "file_ext": "java", "file_size_in_byte": 1191, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "bbac4dad5aa109e6023d82c0b755d7ff3c02ca49", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/ebi-uniprot/QuickGOBE | 271 | FILENAME: CoTermRepositorySimpleMapFailedRetrievalIT.java | 0.271252 | package uk.ac.ebi.quickgo.annotation.coterms;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author Tony Wardell
* Date: 11/10/2016
* Time: 15:57
* Created with IntelliJ IDEA.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = {CoTermRepoTestConfig.class})
@ActiveProfiles(profiles = CoTermRepoTestConfig.FAILED_RETRIEVAL)
public class CoTermRepositorySimpleMapFailedRetrievalIT {
private static final String GO_TERM = "GO:7777771";
@Autowired
private CoTermRepository failedCoTermLoading;
@Test(expected = IllegalStateException.class)
public void cannotLoadAllFromCoTermRepositoryAsFileIsEmpty() {
failedCoTermLoading.findCoTerms(GO_TERM, CoTermSource.ALL);
}
@Test(expected = IllegalStateException.class)
public void cannotLoadManualFromCoTermRepositoryAsFileIsEmpty() {
failedCoTermLoading.findCoTerms(GO_TERM, CoTermSource.MANUAL);
}
}
|
33bddec9-3aaf-42f4-8a4a-6d4b6af4b780 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-15 12:21:45", "repo_name": "valera1297/an2", "sub_path": "/lab/app/src/main/java/com/example/valera/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "a2bc564397c710cb4b9ac7c31983f54467428a29", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/valera1297/an2 | 171 | FILENAME: MainActivity.java | 0.250913 | package com.example.valera;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
EditText login;
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
login = (EditText) findViewById(R.id.login);
button = (Button) findViewById(R.id.conf);
View.OnClickListener onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), Main2Activity.class);
String loginText = login.getText().toString();
intent.putExtra("login", loginText);
startActivity(intent);
}
};
button.setOnClickListener(onClickListener);
}
}
|
d42eff3c-32ed-4466-901f-7d795bb0100d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-16T22:44:05", "repo_name": "cloudflare/cloudflare-docs", "sub_path": "/content/bots/_partials/_javascript-detections-csp.md", "file_name": "_javascript-detections-csp.md", "file_ext": "md", "file_size_in_byte": 1048, "line_count": 12, "lang": "en", "doc_type": "text", "blob_id": "887023c4fd679298f4a0de8dbc8fe841314e7cdf", "star_events_count": 2276, "fork_events_count": 2810, "src_encoding": "UTF-8"} | https://github.com/cloudflare/cloudflare-docs | 262 | FILENAME: _javascript-detections-csp.md | 0.221351 | ---
_build:
publishResources: false
render: never
list: never
---
If you have a Content Security Policy (CSP), you need to take additional steps to implement JavaScript detections:
- Ensure that anything under `/cdn-cgi/challenge-platform/` is allowed. Your CSP should allow scripts served from your origin domain (`script-src self`).
- If your CSP uses a `nonce` for script tags, Cloudflare will add these nonces to the scripts it injects by parsing your CSP response header.
- If your CSP does not use `nonce` for script tags and **JavaScript Detection** is enabled, you may see a console error such as `Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-b123b8a70+4jEj+d6gWI9U6IilUJIrlnRJbRR/uQl2Jc='), or a nonce ('nonce-...') is required to enable inline execution.` We highly discourage the use of `unsafe-inline` and instead recommend the use CSP `nonces` in script tags which we parse and support in our CDN. |
bcf91603-1b15-4a7d-a92a-882fa6860232 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-03 02:17:58", "repo_name": "iuthub/java_2020_lecture9_helloworld", "sub_path": "/src/sample/Controller.java", "file_name": "Controller.java", "file_ext": "java", "file_size_in_byte": 1165, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "948cacafa157bca4b9633e68d838bf699975d7fa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/iuthub/java_2020_lecture9_helloworld | 219 | FILENAME: Controller.java | 0.278257 | package sample;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
public class Controller {
@FXML
public void initialize() {
txtGreeting.setText("Hey World");
}
@FXML
private TextField txtGreeting;
@FXML
private Label lblGreeting;
@FXML
public void onButtonClicked(ActionEvent e) {
Runnable task = new Runnable() {
@Override
public void run() {
try {
Thread.sleep(10000);
Platform.runLater(new Runnable() {
@Override
public void run() {
lblGreeting.setText("Hello, " + txtGreeting.getText());
}
});
} catch (InterruptedException e) {
}
}
};
new Thread(task).start();
}
@FXML
public void onKeyPressed() {
lblGreeting.setText("You typed: " + txtGreeting.getText());
}
}
|
3beb3ac9-6e7d-4d10-aefa-6b10ee4e298f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-04-27 17:35:17", "repo_name": "QuimMilho/Minecraft-Plugins", "sub_path": "/Login/src/me/quimmilho/plugins/login/events/OnPlayerCommand.java", "file_name": "OnPlayerCommand.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "5b04b2bd3934ed514e1c71ce9baf35c6efd4c004", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/QuimMilho/Minecraft-Plugins | 203 | FILENAME: OnPlayerCommand.java | 0.235108 | package me.quimmilho.plugins.login.events;
import me.quimmilho.plugins.login.commands.CmdLogin;
import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
public class OnPlayerCommand implements Listener {
@EventHandler
public void onPlayerCommand(PlayerCommandPreprocessEvent event) {
String abc = event.getMessage();
String cmd = getCmd(abc);
if (!(cmd.equalsIgnoreCase("login") || cmd.equalsIgnoreCase("register"))) {
event.getPlayer().sendMessage(ChatColor.RED + "You don't have permission!");
event.setCancelled(true);
}
}
private String getCmd(String abc) {
String cmd = "";
for (int i = 1; i < abc.length(); i++) {
if (abc.charAt(i) != ' ') {
cmd += "" + abc.charAt(i);
} else {
return cmd;
}
}
return cmd;
}
}
|
79a51276-0a0c-4e03-8d69-5f859f3d8657 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-26 23:07:47", "repo_name": "YoungFu083/ModelPlayer", "sub_path": "/ModelPlayer_Lib/src/uuu/mplayer/test/TestCustomerService_register.java", "file_name": "TestCustomerService_register.java", "file_ext": "java", "file_size_in_byte": 1043, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "b9c1d43427985a7fadcd1235fdfa1838cec22647", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/YoungFu083/ModelPlayer | 295 | FILENAME: TestCustomerService_register.java | 0.280616 | package uuu.mplayer.test;
import java.util.logging.Level;
import java.util.logging.Logger;
import uuu.mplayer.entity.Customer;
import uuu.mplayer.exception.MPRDataInvalidException;
import uuu.mplayer.exception.MPRException;
import uuu.mplayer.service.CustomerService;
public class TestCustomerService_register {
public static void main(String[] args) {
Customer c = new Customer();
try {
c.setId("A175803307");
c.setPassword("asdf1234");
c.setName("王大槌");
c.setGender(Customer.MALE);
c.setEmail("test12@uuu.com.tw");
c.setBirthday("1950-05-05");
c.setAddress("美國");
c.setPhone("0988779448");
c.setSubscribed(true);
CustomerService service = new CustomerService();
service.register(c);
Customer c2 = service.login("A175803307", "asdf1234");
System.out.println(c2);
} catch (MPRException e) {
Logger.getLogger("詳細的錯誤呈現").log(Level.SEVERE, e.getMessage(), e);
} catch (MPRDataInvalidException e) {
System.err.println(e.getMessage());
}
}
}
|
1e5400e5-eab9-4650-b7f6-6a09c2a9a78c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-07 08:33:16", "repo_name": "sa-mamun/Android-Code", "sub_path": "/RadioButton/app/src/main/java/demo2/com/radiobutton/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1191, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "b1bf47a48c6c54bd975827819ebb0e86cb629ff2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sa-mamun/Android-Code | 213 | FILENAME: MainActivity.java | 0.249447 | package demo2.com.radiobutton;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
RadioGroup radioGroup;
RadioButton radioButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
radioGroup = findViewById(R.id.radiogrp);
}
public void click(View view) {
int radioButtonId = radioGroup.getCheckedRadioButtonId();
radioButton = findViewById(radioButtonId);
String gender = radioButton.getText().toString();
Toast.makeText(MainActivity.this, gender, Toast.LENGTH_SHORT).show();
}
// public void save(View view) {
//
// int radioButtonId = radioGroup.getCheckedRadioButtonId();
//
// radioButton = findViewById(radioButtonId);
//
// String gender = radioButton.getText().toString();
//
// Toast.makeText(MainActivity.this, gender, Toast.LENGTH_SHORT).show();
//
// }
}
|
6a7ed0bc-6a06-4bb0-a56e-83f733767c49 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-30 03:57:15", "repo_name": "shixiangyu/git_android", "sub_path": "/GitAndroid/app/src/main/java/com/xiangyu/material/gitandroid/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "cceddbe05d965101b9d19e8f7c47aea0a19e40b2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shixiangyu/git_android | 199 | FILENAME: MainActivity.java | 0.187133 | package com.xiangyu.material.gitandroid;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.git).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//log标志
Log.d("shixiangyu", "gitmaster,gittest");
Log.d("shixaingyu", "新增加了分支");
}
});
}
private void test() {
//添加test方法
}
private void sum() {
Intent intent = new Intent(this, TestActivity.class);
startActivity(intent);
}
private void getVip() {
VipName vip = new VipName();
String price = vip.name;
}
}
|
91225e83-110d-4a0a-b2a9-f99d24300cf5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-21 01:57:29", "repo_name": "DannyHoo/miaosha", "sub_path": "/src/main/java/com/geekq/miaosha/redis/redismanager/RedisLua.java", "file_name": "RedisLua.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "38ee0b5ba3ff34959d1f76228afe13b2284fee14", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DannyHoo/miaosha | 258 | FILENAME: RedisLua.java | 0.242206 | package com.geekq.miaosha.redis.redismanager;
import redis.clients.jedis.Jedis;
import java.util.ArrayList;
import java.util.List;
public class RedisLua {
/**
* 未完成 需 evalsha更方便
*/
public static void getLUa() {
Jedis jedis = null;
try {
jedis = RedisManager.getJedis();
} catch (Exception e) {
e.printStackTrace();
}
String lua =
"local num=redis.call('incr',KEYS[1]) if tonumber(num)==1 " +
"then redis.call('expire',KEYS[1],ARGV[1]) " +
"return 1 elseif tonumber(num)>" +
"tonumber(ARGV[2]) then return 0 else return 1 end";
List<String> keys = new ArrayList<String>();
keys.add("ip:limit:127.0.0.1");
List<String> argves = new ArrayList<String>();
argves.add("6000");
argves.add("5");
jedis.auth("youxin11");
Object object = jedis.eval(lua, keys, argves);
System.out.println(object);
}
}
|
a7609ff2-991e-4da7-9a4a-a58820e8c89b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-14 21:35:23", "repo_name": "cilogon/cilogon-java", "sub_path": "/client/src/main/java/org/cilogon/oauth2/client/CILOA2ClientBootstrapper.java", "file_name": "CILOA2ClientBootstrapper.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "7f322646e40f7e506b4e290fd2ab60760ed365f7", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cilogon/cilogon-java | 273 | FILENAME: CILOA2ClientBootstrapper.java | 0.264358 | package org.cilogon.oauth2.client;
import edu.uiuc.ncsa.oa4mp.oauth2.client.OA2ClientBootstrapper;
import edu.uiuc.ncsa.security.core.exceptions.MyConfigurationException;
import edu.uiuc.ncsa.security.core.util.ConfigurationLoader;
import org.apache.commons.configuration.tree.ConfigurationNode;
/**
* <p>Created by Jeff Gaynor<br>
* on 4/2/15 at 2:01 PM
*/
public class CILOA2ClientBootstrapper extends OA2ClientBootstrapper {
public static final String CIL_OA2_CONFIG_FILE_KEY = "oa4mp:cil-oa2.client.config.file";
public static final String CIL_OA2_CONFIG_NAME_KEY = "oa4mp:cil-oa2.client.config.name";
@Override
public String getOa4mpConfigFileKey() {
return CIL_OA2_CONFIG_FILE_KEY;
}
@Override
public String getOa4mpConfigNameKey() {
return CIL_OA2_CONFIG_NAME_KEY;
}
@Override
public ConfigurationLoader getConfigurationLoader(ConfigurationNode node) throws MyConfigurationException {
// so this prints out the CILogon client version mostly.
return new CILOA2ClientLoader(node);
}
}
|
5454f7f8-bc67-416d-928e-899b2c272250 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-07 14:08:06", "repo_name": "bestego/SoapClient", "sub_path": "/src/main/java/nl/bestego/springclient/PersoonClient.java", "file_name": "PersoonClient.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "710a4fb6a7850f364aa846095bf4005e9f578dd3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bestego/SoapClient | 215 | FILENAME: PersoonClient.java | 0.233706 | package nl.bestego.springclient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
import org.springframework.ws.soap.client.core.SoapActionCallback;
import com.example.consumingwebservice.wsdl.GetPersoonRequest;
import com.example.consumingwebservice.wsdl.GetPersoonResponse;
public class PersoonClient extends WebServiceGatewaySupport {
private static final Logger log = LoggerFactory.getLogger(PersoonClient.class);
public GetPersoonResponse getPersoon(Long id) {
GetPersoonRequest request = new GetPersoonRequest();
request.setId(id);
log.info("Requesting location for " + id);
GetPersoonResponse response = (GetPersoonResponse) getWebServiceTemplate()
.marshalSendAndReceive("http://localhost:8090/personenSoapWS", request,
new SoapActionCallback(
"http://spring.io/guides/gs-producing-web-service/GetPersoonRequest"));
return response;
}
}
|
41866250-2e19-4e82-8b82-e8d83099efe2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-06 18:46:57", "repo_name": "raxuk/HundirServlet", "sub_path": "/src/controlador/SalirPartidaServlet.java", "file_name": "SalirPartidaServlet.java", "file_ext": "java", "file_size_in_byte": 1191, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "97e5d16081840799c808b4480bc657918052f2bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/raxuk/HundirServlet | 224 | FILENAME: SalirPartidaServlet.java | 0.295027 | package controlador;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import modelo.Partida;
/**
* Servlet implementation class SalirPartidaServlet
*/
public class SalirPartidaServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public SalirPartidaServlet() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession sesion = request.getSession();
Partida partida = (Partida) sesion.getAttribute("Partida");
partida = new Partida(partida.getnumFilas(), partida.getNumCol(), partida.getBarcosInicial());
sesion.setAttribute("Partida", partida);
RequestDispatcher vista = request.getRequestDispatcher("index.html");
vista.forward(request, response);
}
}
|
9a18ec6c-a41a-400c-9a9b-9cb1c5c70fc3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-02-24T06:04:17", "repo_name": "carlelieser/windowBar-js", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1039, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "e8b40203c0057be4f121737f6a14a631a7818e77", "star_events_count": 2, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/carlelieser/windowBar-js | 249 | FILENAME: README.md | 0.272025 | # windowBar.js
A jQuery plugin for chrome packaged apps that creates a simple, customizable and functional window bar.
## Example
See [test](https://github.com/carlelieser/windowBar.js/tree/master/test) for a complete chrome packaged app showcasing windowBar.js
**Link CSS**
```html
<link type="text/css" rel="stylesheet" href="windowBar.css"/>
```
**Link Plugin**
```html
<!-- load jQuery first -->
<script src="jquery-2.2.1.min.js"></script>
<script src="windowBar.js"></script>
<script src="windowBarTest.js"></script>
```
**Initialize windowBar in app script**
```javascript
$('.example-wrapper').initializeWindowBar();
```
## Options
**Color**
Enter a hexadecimal value as a string to change the color of the window bar. If no hexadecimal is set, the color of the window bar will be set to `#FFFFFF`. The color of the icons will change accordingly.
```javascript
$('.example-wrapper').initializeWindowBar('#526262');
```
## License
Copyright (c) 2016 Carlos Santos. See the LICENSE file for license rights and limitations (MIT).
|
d7efd281-9173-4e71-879d-24285f732042 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-08-23T04:17:09", "repo_name": "MathBunny/typedoc-namespace-bug-demo", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1084, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "f21fc8b1d467b8cbb8fcd17f9614d5cd2b7a3bf7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MathBunny/typedoc-namespace-bug-demo | 261 | FILENAME: README.md | 0.229535 | # TypeDoc Namespace Bug
Simple reproducible setup demonstrating a [re-exporting bug](https://github.com/TypeStrong/typedoc/issues/1353) in TypeDoc.
## Purpose
Highlights the issue of "variables" appearing as a heading for type re-exporting, when in fact it is an interface. The complete source code can be found in `src`.
```ts
/**
* Sample namespace exported that leverages aliasing.
*/
export namespace admin.subnamespace{
export import DemoInterface = demoInterfaceApi.DemoInterface; // DOES NOT WORK!
export interface DemoClass extends demoClassApi.DemoClass {}
}
```
## Getting started
```
npm install && npm run build && npm run docs
```
After, open the generated docs in the `docs` folder. You'll notice by going to the nested namespace the following:

## Related Pull Requests
The [following](https://github.com/TypeStrong/typedoc/pull/1157) seems related but does not fully satisfy the issue. However, compared to TypeDoc `0.15.0` it is working much better because the re-export appears in the documentation unlike before.
|
d02bbb08-74d1-4f8b-825a-e5d450329d77 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-02 13:43:05", "repo_name": "ynwc2006/leetcode", "sub_path": "/0230_KthSmallestElementInABST_mine.java", "file_name": "0230_KthSmallestElementInABST_mine.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "761dde5cea4d37db6401c0578657c10e86dd1640", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ynwc2006/leetcode | 222 | FILENAME: 0230_KthSmallestElementInABST_mine.java | 0.282196 | /**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
class Solution {
public int kthSmallest(TreeNode root, int k) {
Stack<TreeNode> stack=new Stack<>();
Set<TreeNode> set=new HashSet<>();
stack.push(root);
int count=k;
while(!stack.isEmpty()){
TreeNode n=stack.peek();
while (n.left!=null && !set.contains(n.left)){
stack.push(n.left);
n=n.left;
}
if(count==1) return n.val;
n=stack.pop();
set.add(n);
count--;
if(n.right!=null) stack.push(n.right);
}
return 0;
}
}
|
5a32b0d6-c597-4edc-b329-3cae2c4b804c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-12 23:09:48", "repo_name": "deathcoder/WebsiteDetector", "sub_path": "/src/main/java/com/demo/deathcoder/detector/impl/ChainWebsiteDetector.java", "file_name": "ChainWebsiteDetector.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "f2e4df528be73b77eca85296eadc33764b6ed376", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/deathcoder/WebsiteDetector | 224 | FILENAME: ChainWebsiteDetector.java | 0.279042 | package com.demo.deathcoder.detector.impl;
import com.demo.deathcoder.detector.WebsiteDetector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
/**
* Created by davide on 20/10/16.
*/
public class ChainWebsiteDetector implements WebsiteDetector {
private static Logger logger = LoggerFactory.getLogger( ChainWebsiteDetector.class );
private List<WebsiteDetector> websiteDetectors;
@Override public Boolean detect( final String htmlBody ) {
return websiteDetectors.stream()
.filter( detector -> detector.detect( htmlBody ) )
.findFirst().isPresent();
}
public List<WebsiteDetector> getWebsiteDetectors() {
return websiteDetectors;
}
public void setWebsiteDetectors( final List<WebsiteDetector> websiteDetectors ) {
this.websiteDetectors = websiteDetectors;
}
public ChainWebsiteDetector websiteDetectors( final List<WebsiteDetector> websiteDetectors ) {
this.websiteDetectors = websiteDetectors;
return this;
}
}
|
39088022-75bf-440a-9d40-703a63f3706c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-29 11:02:32", "repo_name": "ltpAndroid/sxl", "sub_path": "/app/src/main/java/com/dofun/sxl/adapter/LiveAdapter.java", "file_name": "LiveAdapter.java", "file_ext": "java", "file_size_in_byte": 1165, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "ee4503c56282d233ba8e3aafd17e98c64dfa9675", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ltpAndroid/sxl | 248 | FILENAME: LiveAdapter.java | 0.253861 | package com.dofun.sxl.adapter;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dofun.sxl.R;
import com.dofun.sxl.bean.LiveBean;
import java.util.List;
public class LiveAdapter extends BaseQuickAdapter<LiveBean, BaseViewHolder> {
public LiveAdapter(int layoutResId, @Nullable List<LiveBean> data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, LiveBean item) {
helper.setText(R.id.item_live_title, item.getLiveTitle())
.setText(R.id.item_live_time, item.getLiveTime())
.setText(R.id.item_live_duration, item.getLiveDuration());
Glide.with(mContext).load(R.drawable.rank_header).into((ImageView) helper.getView(R.id.item_live_header));
String state = item.getLiveState();
if (state.equals("true")) {
helper.setVisible(R.id.item_live_state, true);
} else {
helper.setVisible(R.id.item_live_state, false);
}
}
}
|
e3337460-ee95-4aec-8daf-9d17012cb917 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-31 10:38:48", "repo_name": "Ruslan815/CrazyTanks", "sub_path": "/src/tankgame/Sound.java", "file_name": "Sound.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "87c28f0ab884e02c69fc009ac629f6e3686d316c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Ruslan815/CrazyTanks | 225 | FILENAME: Sound.java | 0.267408 | package tankgame;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.*;
import javax.sound.sampled.*;
public class Sound {
URL url;
private Clip clip;
boolean loop;
String path = System.getProperty("user.dir");
Sound(String name, boolean loop) throws MalformedURLException, LineUnavailableException, UnsupportedAudioFileException, IOException {
url = new URL("file:///" + path + name);
clip = AudioSystem.getClip();
this.loop = loop;
AudioInputStream audioIS = AudioSystem.getAudioInputStream(url);
clip.open(audioIS);
SwingUtilities.invokeLater(() -> {}); // Отдельный Thread для потока музыки
}
public void play() {
if (loop) {
clip.loop(Clip.LOOP_CONTINUOUSLY);
} else {
clip.setFramePosition(clip.getFrameLength());
clip.loop(1);
}
}
public void stop() {
clip.stop();
}
public void flush() {
clip.flush();
}
} |
adeca55e-dff1-4f4d-910c-ef4f09a7c238 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-05-18 20:28:33", "repo_name": "life0fun/MovementSensor", "sub_path": "/src/com/colorcloud/movementsensor/AppPreferences.java", "file_name": "AppPreferences.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "266e23919b069dc175d84405d17b0c3c46c29bf7", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/life0fun/MovementSensor | 257 | FILENAME: AppPreferences.java | 0.286968 |
package com.colorcloud.movementsensor;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
/**
*<code><pre>
* CLASS:
* To handle App setting and preference
*
* RESPONSIBILITIES:
*
* COLABORATORS:
*
* USAGE:
* See each method.
*
*</pre></code>
*/
public class AppPreferences {
private static final String TAG = "MOV_PREF";
public static final String POI = "poi";
private MovementSensorApp mLSApp;
private SharedPreferences mPref;
public AppPreferences(MovementSensorApp lsapp) {
mLSApp = lsapp;
mPref = mLSApp.getSharedPreferences(Constants.PACKAGE_NAME, 0);
}
/**
* Get the value of a key
* @param key
* @return
*/
public String getString(String key) {
return mPref.getString(key, null);
}
/**
* Set the value of a key
* @param key
* @return
*/
public void setString(String key, String value) {
SharedPreferences.Editor editor = mPref.edit();
editor.putString(key, value);
editor.commit();
}
}
|
9e60199c-165f-4192-b3bc-2bd82911ab80 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-07-29 09:40:10", "repo_name": "YuanwuXiang/Challenge", "sub_path": "/src/main/java/com/tradeshift/loginProj/Test/TestClient.java", "file_name": "TestClient.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "d3f8826e866be20cd1b293fcd3def30af48c2f10", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/YuanwuXiang/Challenge | 265 | FILENAME: TestClient.java | 0.26971 | package com.tradeshift.loginProj.Test;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl;
/**
* Created by aaron on 15/7/25.
*/
public class TestClient {
public static void main(String[] args){
}
private static WebResource getWr(String USER_URL) {
String user ="mike";
// user.setUserName("hndes");
// user.setAge(39);
USER_URL = "http://localhost:8080/rest/restresource/insertUser";
MultivaluedMapImpl params = new MultivaluedMapImpl();
params.add("user",user);
String result = getWr(USER_URL).entity(user, javax.ws.rs.core.MediaType.APPLICATION_XML).post(String.class);
System.out.println("result"+result);
System.out.println("kkkkk");
Client c = Client.create(); //创建一个 com.sun.jersey .api.client.Client 类的实例
System.out.println("llllll"+USER_URL);
WebResource wr = c.resource(USER_URL); // 建了一个 WebResponse 对象
return wr;
}
}
|
6ee17766-094a-4574-a7b7-6887752127d4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-10 14:05:48", "repo_name": "1316869355/icps", "sub_path": "/src/com/icps/servlet/logoutServlet.java", "file_name": "logoutServlet.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "0d7add198f134addfde3dd4573ddd8849009f742", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/1316869355/icps | 179 | FILENAME: logoutServlet.java | 0.277473 | package com.icps.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import net.sf.json.JSONArray;
/**
* Servlet implementation class logoutServlet
*/
@WebServlet("/logout")
public class logoutServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public logoutServlet() {
super();
}
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
doPost(req, res);
}
protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
JSONArray result = new JSONArray();
HttpSession session = req.getSession();
session.removeAttribute("cardno");
session.invalidate();
res.addHeader("location","login.html");
res.setStatus(302);
}
}
|
c8dd9145-7d0e-44cf-918c-a998a0119d12 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-12 12:16:57", "repo_name": "KormuhinIP/demo", "sub_path": "/src/main/java/com/example/view/VaadinUI.java", "file_name": "VaadinUI.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "ba0ac16b3d52b5447c294fb5b085c2799a24e188", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/KormuhinIP/demo | 213 | FILENAME: VaadinUI.java | 0.256832 | package com.example.view;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.ui.UI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.annotation.WebServlet;
import java.util.Locale;
@SuppressWarnings("serial")
@Theme("vaadinmaps")
@SpringUI
@Widgetset("AppWidgetset")
public class VaadinUI extends UI {
private static final Logger logger = LoggerFactory.getLogger(VaadinUI.class);
@Override
protected void init(VaadinRequest vaadinRequest) {
setLocale(Locale.US);
updateContent();
logger.debug("start UI");
}
private void updateContent() {
logger.debug("updateContent method (VaadinUI) invoked; ");
setContent(new LoginView());
}
@WebServlet(value = "/*", asyncSupported = true)
public static class Servlet extends VaadinServlet {
}
} |
d6aabea1-c88a-40c5-ba98-815b60b40c96 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-06-05 12:49:24", "repo_name": "companieshouse/docs.developer.ch.gov.uk", "sub_path": "/src/main/java/uk/gov/ch/developer/docs/DocsWebApplication.java", "file_name": "DocsWebApplication.java", "file_ext": "java", "file_size_in_byte": 1061, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "967d6bff1f002e253236f4488196c722880b43dd", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/companieshouse/docs.developer.ch.gov.uk | 174 | FILENAME: DocsWebApplication.java | 0.193147 | package uk.gov.ch.developer.docs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import uk.gov.ch.developer.docs.interceptor.LoggingInterceptor;
@SpringBootApplication
public class DocsWebApplication implements WebMvcConfigurer {
public static final String APPLICATION_NAME_SPACE = "docs.developer.ch.gov.uk";
private LoggingInterceptor loggingInterceptor;
@Autowired
public DocsWebApplication(LoggingInterceptor loggingInterceptor) {
this.loggingInterceptor = loggingInterceptor;
}
public static void main(String[] args) {
SpringApplication.run(DocsWebApplication.class, args);
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(loggingInterceptor);
}
}
|
42c7f7b8-17e1-4036-9d95-4a05008ff1b7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-02 14:33:26", "repo_name": "MichaelBosello/regexp-searcher", "sub_path": "/src/main/java/forkjoin/action/CountRegexInFileAction.java", "file_name": "CountRegexInFileAction.java", "file_ext": "java", "file_size_in_byte": 1110, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "6e41b9611ffd0e02c53520eb938008f145386bf3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MichaelBosello/regexp-searcher | 210 | FILENAME: CountRegexInFileAction.java | 0.276691 | package forkjoin.action;
import regex.regexresult.Result;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.util.concurrent.RecursiveAction;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static utility.FileUtility.countMatch;
public class CountRegexInFileAction extends RecursiveAction {
protected String file;
protected String regex;
protected Result collector;
public CountRegexInFileAction(String file, String regex, Result collector) {
this.file = file;
this.regex = regex;
this.collector = collector;
}
@Override
protected void compute() {
try {
long match = countMatch(regex, file);
if(match > 0){
collector.addMatchingFile(file, match);
} else {
collector.addNonMatchingFile(file);
}
} catch (IOException e) {
collector.incrementIOException();
}
}
}
|
1d362c8a-fdd3-4869-a6c3-ea8c0893c4b5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2013-08-06T17:33:26", "repo_name": "odoucet/googlePhotosImageFinder", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1012, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "6bf9289c3268978bc2c8061d6121944d571076e0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/odoucet/googlePhotosImageFinder | 311 | FILENAME: README.md | 0.262842 | googlePhotosImageFinder
=======================
Since 2013 (I guess), Picasa has been merged on Google+
Now with Google+, all images <= 2048pixels are free of charge. All images wider will count on your Google account quota.
If you need to find such images, just use this small PHP script. It will tell you which albums has this kind of data.
Output example
--------------
Call script with your Google ID. You can find it in the URL when you list all your albums :
https://plus.google.com/photos/< this is your ID >/albums
$ php findpicasagooglebigimages.php <my google ID>
Found 53 albums
There is 26 albums with images larger than 2048 pixels. This is 869 pics on a total of 2800.
9 photos larger - http://plus.google.com/photos/XXX/albums/5827401518537866641
8 photos larger - http://plus.google.com/photos/XXX/albums/5826260862028886737
5 photos larger - http://plus.google.com/photos/XXX/albums/5825278058751377441
[...]
TODO
----
Handle private albums by just using auth on Picasa API.
|
2276a923-c3e1-48b1-982a-62eb4337ad84 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-25 05:34:24", "repo_name": "DarksKnight/ezevent", "sub_path": "/ezevent-project/src/main/java/com/ez/event/internal/flow/CreateConsumerEventEmitter.java", "file_name": "CreateConsumerEventEmitter.java", "file_ext": "java", "file_size_in_byte": 1192, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "37727328331c752238abf358fc8af7ccffd64f45", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DarksKnight/ezevent | 247 | FILENAME: CreateConsumerEventEmitter.java | 0.292595 | package com.ez.event.internal.flow;
import com.ez.event.internal.thread.ExecRunnable;
import com.ez.event.internal.thread.ThreadExecutors;
import com.ez.event.internal.thread.ThreadToken;
/**
* @author shy
* @date 2018/11/18
*/
public class CreateConsumerEventEmitter implements ConsumerEventEmitter {
private Consumer consumer;
private ThreadToken threadToken = ThreadToken.DEFAULT;
private int delay = 0;
public CreateConsumerEventEmitter(Consumer consumer) {
this.consumer = consumer;
}
public CreateConsumerEventEmitter threadToken(ThreadToken threadToken) {
this.threadToken = threadToken;
return this;
}
public CreateConsumerEventEmitter delay(int delay) {
this.delay = delay;
return this;
}
@Override
public void accept(Object value) {
ThreadExecutors.run(new AcceptRunnable(value), threadToken, delay);
}
final class AcceptRunnable<T> extends ExecRunnable {
private T value;
public AcceptRunnable(T value) {
this.value = value;
}
@Override
public void execute() {
consumer.accept(value);
}
}
}
|
a80eb91f-348a-4f2b-9981-2f7d8b046768 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-11-29 04:32:31", "repo_name": "ejconlon/jsubschema", "sub_path": "/src/main/java/net/exathunk/jsubschema/gen/FieldRep.java", "file_name": "FieldRep.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "c1dfa358151612e26e3e985e0b8153e61f35bbae", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ejconlon/jsubschema | 227 | FILENAME: FieldRep.java | 0.226784 | package net.exathunk.jsubschema.gen;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
/**
* charolastra 11/14/12 9:57 PM
*/
public class FieldRep {
public String name;
public String className;
public Visibility visibility = Visibility.PUBLIC;
public List<AnnotationRep> annotations = new ArrayList<AnnotationRep>();
public String declaredName;
public Set<String> imports = new TreeSet<String>();
public void makeDeclarationString(Stringer s) {
for (AnnotationRep annotationRep : annotations) {
s.append(annotationRep.toString());
s.end();
}
if (!Visibility.PACKAGE.equals(visibility)) {
s.append(visibility.toString().toLowerCase()).append(" ");
} else {
s.append("");
}
s.cont().append(className).append(" ").append(name).append(";");
s.end();
}
public void makeParameterString(Stringer s) {
s.cont().append(className).append(" ").append(name);
}
}
|
fe5d18a0-9287-44ee-9aea-d6e6793914ef | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-01 18:34:35", "repo_name": "brianstenk/mockito-example", "sub_path": "/src/main/java/stackWithLinkedListRachael/StackAdvanced.java", "file_name": "StackAdvanced.java", "file_ext": "java", "file_size_in_byte": 989, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "cb4e05fdf8a41a791e9818a20596ba5664eb10c3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/brianstenk/mockito-example | 212 | FILENAME: StackAdvanced.java | 0.273574 | package stackWithLinkedListRachael;
import advancedStackTest.PopEmptyStackException;
import com.crystal.demo.rachealStack.PopEmptyStack;
public class StackAdvanced {
Node head;
private int count = 0;
public boolean isEmpty() {
if (head != null ) return false;
return true;
}
public void push(Integer i) {
Node node = new Node(i);
head = node;
head.next = null;
count++;
}
public Object pop() {
Object poppedElement = null;
if(isEmpty()) throw new PopEmptyStackException();
else {
poppedElement = head.element;
head = null;
count--;
}
return poppedElement;
}
public Integer peek() {
return (Integer)head.element;
}
public int size() {
return count;
}
class Node{
Node next;
Object element;
Node(Object elem){
this.element = elem;
}
}
}
|
dac0c1d4-2edc-4026-b0d3-d511536271a9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-23 14:55:45", "repo_name": "Moearly/Weekend", "sub_path": "/app/src/main/java/com/martn/weekend/model/QuestreplyModel.java", "file_name": "QuestreplyModel.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "8c6432bbcc46f9d425dd0176229d3c0988d3332c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Moearly/Weekend | 258 | FILENAME: QuestreplyModel.java | 0.255344 | package com.martn.weekend.model;
import org.json.JSONObject;
import java.io.Serializable;
/**
* Title: Weekend
* Package: com.martn.weekend.model
* Description: ("问题回答")
* Date 2014/10/5 23:02
*
* @author MartnLei MartnLei_163_com
* @version V1.0
*/
public class QuestreplyModel implements Serializable {
private static final long serialVersionUID = 3350769404828373893L;
public QuestreplyQuestModel quest;
public QuestreplyReplyModel reply;
public QuestreplyModel() {
}
public QuestreplyModel(JSONObject json) {
parse(json);
}
public void parse(JSONObject json) {
this.quest = new QuestreplyQuestModel();
this.quest.parse(json.optJSONObject("questreply_quest"));
JSONObject replyJson = json.optJSONObject("questreply_reply");
this.reply = new QuestreplyReplyModel();
this.reply.parse(replyJson);
}
public String toString() {
return "QuestreplyModel [quest=" + this.quest + ", reply=" + this.reply + "]";
}
}
|
912ab2ab-f22c-44e7-b8d5-f8a886bbdbf0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-06 15:21:41", "repo_name": "zndy10/Theseed-back-end", "sub_path": "/src/main/java/com/seed/controller/frontend/BannerLogoController.java", "file_name": "BannerLogoController.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "955e93069149127c8971d3716fa47a646daf1cf8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zndy10/Theseed-back-end | 199 | FILENAME: BannerLogoController.java | 0.242206 | package com.seed.controller.frontend;
import com.seed.model.BannerLogo;
import com.seed.service.IBannerLogoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping(value = "/banner")
public class BannerLogoController {
@Autowired
private IBannerLogoService bannerLogoService;
@RequestMapping(value = "/getbanner",method = {RequestMethod.POST,RequestMethod.GET})
@Cacheable(cacheNames = "logo",key = "'bannerLogo'")
public List<BannerLogo> getbanner(){
BannerLogo bannerLogo =new BannerLogo();
List<BannerLogo> lis = bannerLogoService.selectBannerLogoList(bannerLogo);
//String listArray= JSONArray.toJSONString(lis);
// System.out.println(listArray.replaceAll("",""));
return lis;
}
}
|
b44eb57a-1792-4e27-bb22-71a34ff7690f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-14 01:07:59", "repo_name": "Kausbot/AIIMS_KIOSK", "sub_path": "/app/src/main/java/ps1/bits_pilani/goa/aiims_kiosk/Govt_Schemes/IGMSY.java", "file_name": "IGMSY.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "9e57d0495877211f768f8f9cf8cf5119c74d9a77", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Kausbot/AIIMS_KIOSK | 238 | FILENAME: IGMSY.java | 0.242206 | package ps1.bits_pilani.goa.aiims_kiosk.Govt_Schemes;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import ps1.bits_pilani.goa.aiims_kiosk.R;
import ps1.bits_pilani.goa.aiims_kiosk.Schemes;
public class IGMSY extends AppCompatActivity {
@Override
protected void onPause() {
super.onPause();
this.finish();
}
@Override
protected void onStop() {
super.onStop();
this.finish();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_igmsy);
}
public void igmsyp (View view) {
Intent i = new Intent(this,NFSM.class);
startActivity(i);
}
public void igmsyn (View view) {
Intent i = new Intent(this,ICDS.class);
startActivity(i);
}
public void igmsyh (View view) {
Intent i = new Intent(this,Schemes.class);
startActivity(i);
}
}
|
5a43aa64-9048-43d9-91bf-bf6366fa8b0a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-30 10:31:56", "repo_name": "evrimulgen/product-shop-workshop", "sub_path": "/src/main/java/productshop/domain/entities/BaseUUIDEntity.java", "file_name": "BaseUUIDEntity.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "15e293d3944d5f788cf691a2f376d72f32cb03f5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/evrimulgen/product-shop-workshop | 213 | FILENAME: BaseUUIDEntity.java | 0.27513 | package productshop.domain.entities;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.util.Objects;
import java.util.UUID;
@Getter
@Setter
@NoArgsConstructor
@MappedSuperclass
abstract class BaseUUIDEntity {
@Id
@GeneratedValue(generator = "uuid2")
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Column(name = "id", unique = true, nullable = false, updatable = false, columnDefinition = "UUID")
private UUID id;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof BaseUUIDEntity)) return false;
BaseUUIDEntity that = (BaseUUIDEntity) o;
return getId().equals(that.getId());
}
@Override
public int hashCode() {
return Objects.hash(getId());
}
}
|
3168280b-abe8-449f-a9c9-33df9f253224 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-10 15:06:38", "repo_name": "freshchen/fresh-ad-system", "sub_path": "/ad-gateway/src/main/java/com/ecnu/lingc/ad/gateway/filter/PostRequestFilter.java", "file_name": "PostRequestFilter.java", "file_ext": "java", "file_size_in_byte": 1165, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "27bccfb88ab489acdd846b329c4bb755052444f6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/freshchen/fresh-ad-system | 266 | FILENAME: PostRequestFilter.java | 0.253861 | package com.ecnu.lingc.ad.gateway.filter;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.netflix.zuul.filters.support.FilterConstants;
import org.springframework.stereotype.Component;
/**
* @program: fresh-ad-system
* @Date: 2019/6/25 21:58
* @Author: Ling Chen
* @Description:
*/
@Slf4j
@Component
public class PostRequestFilter extends ZuulFilter {
@Override
public String filterType() {
return FilterConstants.POST_TYPE;
}
@Override
public int filterOrder() {
return FilterConstants.SEND_RESPONSE_FILTER_ORDER - 1;
}
@Override
public boolean shouldFilter() {
return true;
}
@Override
public Object run() throws ZuulException {
RequestContext context = RequestContext.getCurrentContext();
String url = context.getRequest().getRequestURI();
long duration = System.currentTimeMillis() - (Long) context.get("startTime");
log.info("url: [{}] duration: [{}]", url, duration);
return null;
}
}
|
9a12396b-30fa-4bd5-9509-a93600c12987 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-29 09:05:52", "repo_name": "MonicaTifaniZ/Adeptform", "sub_path": "/app/src/main/java/com/monicatifanyz/adeptforms/api/LoginResponse.java", "file_name": "LoginResponse.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "9a55bae4c332a3f3c40d8e7383204cb8060aeb4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MonicaTifaniZ/Adeptform | 214 | FILENAME: LoginResponse.java | 0.203075 | package com.monicatifanyz.adeptforms.api;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class LoginResponse {
@SerializedName("error")
@Expose
private boolean error;
@SerializedName("message")
@Expose
private String message;
@SerializedName("data")
private List<User> data;
public boolean isError() {
return error;
}
public void setError(boolean error) {
this.error = error;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public List<User> getData() {
return data;
}
public void setData(List<User> data) {
this.data = data;
}
@Override
public String toString() {
return "LoginResponse{" +
"error=" + error +
", message='" + message + '\'' +
", data=" + data +
'}';
}
}
|
4b76af59-7ded-46fe-9f22-f988e94daefc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-23 06:25:16", "repo_name": "Floodon/RES-4IF", "sub_path": "/TP-HTTP/src/http/server/HttpResponse.java", "file_name": "HttpResponse.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "8cd163fb54753fdeee0c5128abfe78120906a018", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Floodon/RES-4IF | 257 | FILENAME: HttpResponse.java | 0.284576 | package http.server;
/**
* Classe representant le HEADER d'une reponse HTTP
*
*/
public class HttpResponse {
public String protocolVersion;
public String code;
public String codeSignification;
public String body;
public String contentLength;
public String contentType;
public String server;
public String date;
public HttpResponse() {
server = "LocalHost";
}
/**
* Methode renvoyant un string correspondant au HEADER de la reponse HTTP
* Renvoie le string contenant les informations du HEADER de la reponse HTTP
*
* @return Un string representant le HEADER de la reponse HTTP
*/
public String stringify(){
String res ="";
res += protocolVersion + " " + code + " " + codeSignification + "\n";
res += "Server : " + server +"\n";
if(contentLength != null) {
res += "Content-Length :" + contentLength +"\n";
}
if(contentType != null) {
res += "Content-Type : " + contentType + "\n";
}
res += "\n"; //FIN DU HEADER
return res;
}
}
|
177f425b-8b3f-4788-955e-6f34c144673e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-16 08:05:34", "repo_name": "iamStephenFang/JavaEE_Course_Projects", "sub_path": "/实验一/LoginServlet/src/cn/edu/zjut/LoginController.java", "file_name": "LoginController.java", "file_ext": "java", "file_size_in_byte": 1188, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "fe273821fca042a9cf0b66b9019f2415085e637a", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/iamStephenFang/JavaEE_Course_Projects | 208 | FILENAME: LoginController.java | 0.281406 | package cn.edu.zjut;
import cn.edu.zjut.dao.UserDAO;
import cn.edu.zjut.model.UserBean;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class LoginController extends HttpServlet {
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=utf-8");
PrintWriter out = response.getWriter();
UserBean user = new UserBean();
user.setUsername(request.getParameter("username"));
user.setPassword(request.getParameter("password"));
user.setType(Integer.parseInt(request.getParameter("type")));
if (checkUser(user)) {
request.setAttribute("USER", user);
RequestDispatcher dispatcher = request.getRequestDispatcher("loginSuccess.jsp");
dispatcher.forward(request, response);
} else {
response.sendRedirect("loginFailed.jsp");
}
}
boolean checkUser(UserBean user) {
UserDAO ud = new UserDAO();
if (ud.searchUser(user)) {
return true;
}
return false;
}
} |
39f19125-76d7-493a-a8ef-f58f2621ea36 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-18 03:37:03", "repo_name": "hanzujun/sjroom-boot", "sub_path": "/dop-framework-z-demo/src/main/java/com/sunvalley/framework/example/web/DictController.java", "file_name": "DictController.java", "file_ext": "java", "file_size_in_byte": 1203, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "07b704b26c0021b4de7882465023c5abe9b58159", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hanzujun/sjroom-boot | 258 | FILENAME: DictController.java | 0.201813 | package com.sunvalley.framework.example.web;
import com.sunvalley.framework.example.ExampleService;
import com.sunvalley.framework.example.service.DemoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <B>说明:数据字典表 控制器</B><BR>
*
* @author manson.zhou
* @version 1.0.0
* @since 2019-05-27 08:34
*/
@Slf4j
@Validated
@RestController
@Api("数据字典表 控制器")
@RequestMapping("api/dict")
public class DictController {
@Autowired
private DemoService demoService;
@Autowired
private ExampleService exampleService;
@ApiOperation("refresh")
@PostMapping("refresh")
public void refresh() {
demoService.echo();
}
@GetMapping("/input")
public String input(String word) {
return exampleService.wrap(word);
}
}
|
390da477-6c1b-457e-b9a0-2b0b701f456c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-05 09:55:59", "repo_name": "raunak11/RecyclerView-image-", "sub_path": "/app/src/main/java/com/example/raunak/recyclerview/NextActivity.java", "file_name": "NextActivity.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "807be70ebcddfc7230e4ccaa58897f5b535c2b19", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/raunak11/RecyclerView-image- | 189 | FILENAME: NextActivity.java | 0.220007 | package com.example.raunak.recyclerview;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import Adapter.Myadapter;
public class NextActivity extends AppCompatActivity {
private TextView name, desc, id;
private ImageView imageView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_next);
name = findViewById(R.id.textName);
desc = findViewById(R.id.textdesc);
id = findViewById(R.id.textid);
Bundle bundle = getIntent().getExtras();
String name1 = bundle.getString("name");
String desc1 = bundle.getString("desc");
Integer id1 = bundle.getInt("id");
name.setText(name1);
desc.setText(desc1);
id.setText(Integer.toString(id1));
imageView = findViewById(R.id.imageView);
imageView.setImageResource(id1);
}
}
|
7bdb3344-bc39-4459-a82a-41cad7ab1e37 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-30 22:08:19", "repo_name": "4aplin/testIFree", "sub_path": "/src/test/java/core/pages/SignUpPage.java", "file_name": "SignUpPage.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "0f171c28a6af0114a45f6bb4c8c9b6fd937e8d26", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/4aplin/testIFree | 248 | FILENAME: SignUpPage.java | 0.27513 | package core.pages;
import core.systemControls.*;
import core.systemPages.PageBase;
import org.openqa.selenium.By;
public class SignUpPage extends PageBase {
public SignUpPage() {
NameInput = new TextInput(By.xpath("//*[@id=\"root\"]/div/div/div/main/div/div[2]/div/div[1]/div/form/div[1]/div[1]/div/input"));
EmailInput = new TextInput(By.xpath("//*[@id=\"root\"]/div/div/div/main/div/div[2]/div/div[1]/div/form/div[1]/div[2]/div/input"));
PassInput = new TextInput(By.xpath("//*[@id=\"password\"]"));
CreateAccountBtn = new Button(By.xpath("//*[@id=\"root\"]/div/div/div/main/div/div[2]/div/div[1]/div/form/div[2]/button"));
}
public TextInput NameInput;
public TextInput EmailInput;
public TextInput PassInput;
public Button CreateAccountBtn;
@Override
public void BrowseWaitVisible() {
EmailInput.WaitVisibleWithRetries();
NameInput.WaitVisibleWithRetries();
PassInput.WaitVisibleWithRetries();
CreateAccountBtn.WaitVisibleWithRetries();
}
}
|
6087ae7a-0b79-401c-a8bb-bbb484b4009d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-30 17:15:03", "repo_name": "tomala1000/grupowe", "sub_path": "/src/main/java/org/sda/servlets/util/ValidationUtil.java", "file_name": "ValidationUtil.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "4e28a4b87b83c1ff295b20258f6258639c0fd921", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tomala1000/grupowe | 193 | FILENAME: ValidationUtil.java | 0.286169 | package org.sda.servlets.util;
import org.sda.servlets.domain.User;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import java.util.Set;
public class ValidationUtil {
private static Validator validator;
static {
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
validator = factory.getValidator();
}
public static boolean validate(User user) {
Set<ConstraintViolation<User>> constraintViolations = validateInternal(user);
return constraintViolations.isEmpty();
}
public static Set<ConstraintViolation<User>> validateInternal(User entity) {
Set<ConstraintViolation<User>> constraintViolations = validator.validate(entity);
return constraintViolations;
}
public static <T> Set<ConstraintViolation<T>> validateInternal(T entity) {
Set<ConstraintViolation<T>> constraintViolations = validator.validate(entity);
return constraintViolations;
}
}
|
7aa18beb-7def-4ce3-8c04-81bac6a56eb6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-07 06:44:18", "repo_name": "Xunle1/Animal-master", "sub_path": "/src/animal/Animal.java", "file_name": "Animal.java", "file_ext": "java", "file_size_in_byte": 1141, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "8b180767fc78cdbc5e3a754d2b1ba4476fc67723", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Xunle1/Animal-master | 262 | FILENAME: Animal.java | 0.258326 | package animal;
/**
* Filename: Animal.java
* 动物属性: 种类,性别, 年龄。
* @author: Xunle
* @date: 2020/10/07
*/
public class Animal {
private String species;
private char gender;
private int age;
public Animal() {}
public Animal(String species, char gender, int age) {
this.species = species;
this.gender = gender;
this.age = age;
}
@Override
public String toString() {
return "Animal{" +
"species='" + species + '\'' +
", gender=" + gender +
", age=" + age +
'}';
}
public boolean equals(String species){
return this.species.equals(species)?true:false;
}
public void setSpecies(String species) {
this.species = species;
}
public void setGender(char sexual) {
this.gender = sexual;
}
public void setAge(int age) {
this.age = age;
}
public String getSpecies() {
return species;
}
public char getGender() {
return gender;
}
public int getAge() {
return age;
}
}
|
a94d930c-39ca-4c23-8a7f-a627a838453b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-07 09:44:42", "repo_name": "Mostafayehya/ITI-Java-IO", "sub_path": "/src/main/java/Day2/lab2/UDPFileSender.java", "file_name": "UDPFileSender.java", "file_ext": "java", "file_size_in_byte": 1192, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ec45613fc93828262c48dade9b7ce60959c5308a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Mostafayehya/ITI-Java-IO | 224 | FILENAME: UDPFileSender.java | 0.267408 | package Day2.lab2;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.net.*;
import java.nio.charset.StandardCharsets;
public class UDPFileSender {
public static void main(String[] args) {
DatagramSocket dgSocket = null;
try {
dgSocket = new DatagramSocket();
byte[] bytes = new byte[1000];
InetAddress serverHost = InetAddress.getByName("localhost");
int serverPortNumber = 3000;
BufferedReader fileReader = new BufferedReader(new FileReader("src/main/resources/text.txt"));
String line = fileReader.readLine();
while (line != null) {
bytes = line.getBytes(StandardCharsets.UTF_8);
dgSocket.send(new DatagramPacket(bytes,
bytes.length, serverHost, serverPortNumber));
line = fileReader.readLine();
Thread.sleep(1000);
}
} catch (IOException | InterruptedException e) {
e.printStackTrace();
} finally {
if (dgSocket != null) {
dgSocket.close();
}
}
}
}
|
1ef33976-c3e5-4fa0-add4-eeea67d820a3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-05 12:31:26", "repo_name": "automate-website/teamcity-plugin", "sub_path": "/server/src/main/java/website/automate/teamcity/server/io/model/AbstractSerializable.java", "file_name": "AbstractSerializable.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "d855bbac67cf34af9537b0ccf92d17e3d51a9e4f", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/automate-website/teamcity-plugin | 239 | FILENAME: AbstractSerializable.java | 0.275909 | package website.automate.teamcity.server.io.model;
import java.io.Serializable;
public abstract class AbstractSerializable implements Serializable {
private static final long serialVersionUID = -1407298374327171471L;
protected String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AbstractSerializable other = (AbstractSerializable) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
|
227843d1-c867-483c-96f7-043a8951a899 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-18 12:20:47", "repo_name": "professor-lol/professor-lol", "sub_path": "/professorlol-riot-api/src/main/java/com/ccs/professorlol/config/exception/dto/RiotExceptionDto.java", "file_name": "RiotExceptionDto.java", "file_ext": "java", "file_size_in_byte": 1038, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "07bfbf4f4bc5a044f7b28d97ebe8cb52321b4d0a", "star_events_count": 11, "fork_events_count": 5, "src_encoding": "UTF-8"} | https://github.com/professor-lol/professor-lol | 202 | FILENAME: RiotExceptionDto.java | 0.228156 | package com.ccs.professorlol.config.exception.dto;
import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
@Slf4j
@Getter
@ToString
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class RiotExceptionDto {
private Status status;
public String getStatusCode() {
return this.status.getStatusCode();
}
public String getMessage() {
return this.status.getMessage();
}
public boolean isBadRequestError() {
return getStatusCode().equals(String.valueOf(HttpStatus.BAD_REQUEST.value()));
}
public boolean is4xxError() {
return 400 < Integer.parseInt(getStatusCode()) && Integer.parseInt(getStatusCode()) < 500;
}
@Getter
@ToString
public static class Status {
@JsonAlias("status_code")
private String statusCode;
private String message;
}
}
|
6ef07251-d3c6-46f3-a382-118012dc8eb2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-19 08:03:07", "repo_name": "e1328/blog2", "sub_path": "/src/main/java/com/javaweb/blog/controller/CommentController.java", "file_name": "CommentController.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "a63d89df2f5d6f77a33151a11d9053350e9d3ec2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/e1328/blog2 | 207 | FILENAME: CommentController.java | 0.242206 | package com.javaweb.blog.controller;
import com.javaweb.blog.entity.Result;
import com.javaweb.blog.entity.StatusCode;
import com.javaweb.blog.pojo.Comment;
import com.javaweb.blog.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@CrossOrigin
@RequestMapping("/comment")
public class CommentController {
@Autowired
private CommentService commentService;
@RequestMapping(method = RequestMethod.GET)
public Result findAll() {
return new Result(true, StatusCode.OK, "查询成功", commentService.findAll());
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public Result findByArticleId(@PathVariable int id) {
return new Result(true, StatusCode.OK, "查询成功", commentService.findByArticleId(id));
}
@RequestMapping(method = RequestMethod.POST)
public Result add(@RequestBody Comment comment) {
commentService.add(comment);
return new Result(true, StatusCode.OK, "增加成功");
}
}
|
c6cd391f-7c4e-439f-b21f-60866ad1958d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-01-16 07:39:02", "repo_name": "ta-matsuura/taidroid", "sub_path": "/src/icsbook/sample/section3/example12/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1202, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "2484c2519b7cb275eb04ae5511795ced4b2f61bd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ta-matsuura/taidroid | 229 | FILENAME: MainActivity.java | 0.282988 | package icsbook.sample.section3.example12;
import icsbook.sample.R;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.ShareActionProvider;
public class MainActivity extends Activity {
private ShareActionProvider mShareActionProvider;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu3_12, menu);
// MenuItem を取得
MenuItem menuItem = menu.findItem(R.id.menu_share);
// ShareActionProvider を取得
mShareActionProvider = (ShareActionProvider) menuItem.getActionProvider();
// ShareActionProvider に共有 Intent をセット
mShareActionProvider.setShareIntent(getDefaultShareIntent());
return true;
}
private Intent getDefaultShareIntent() {
// 共有 Intent を返す
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "share text");
return intent;
}
}
|
da9291cb-15e9-4f0a-95ab-09407989643e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-07-06 19:24:05", "repo_name": "rilopez/cracking-the-code-interview", "sub_path": "/src/main/java/crackingTheCodeInterview/arraysandstrings/StringAndArrayUtils.java", "file_name": "StringAndArrayUtils.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "179253628d94be4ba01d2f54cd133dd5ba996d24", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rilopez/cracking-the-code-interview | 209 | FILENAME: StringAndArrayUtils.java | 0.295027 | package crackingTheCodeInterview.arraysandstrings;
import java.util.HashSet;
import java.util.Set;
public class StringAndArrayUtils {
public static boolean hasUniqueCharacters(String inputString) {
if(inputString == null || inputString.equals("")) return false;
Set<Character> charSet = new HashSet<Character>();
for (int i = 0; i < inputString.length(); i++) {
char character = inputString.charAt(i);
if(!charSet.contains(character)) {
charSet.add(character);
}else{
return false;
}
}
return true;
}
public static boolean hasUniqueCharactersWithoutAdditionalDataStructure(String inputString) {
if(inputString == null || inputString.equals("")) return false;
for (int i = 0; i < inputString.length(); i++) {
char character = inputString.charAt(i);
if(inputString.indexOf(character,i+1)> i) {
return false;
}
}
return true;
}
}
|
e07f959b-f371-4b45-ae57-ff0c8cae84c8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-12 08:58:18", "repo_name": "fvahdati/viva", "sub_path": "/src/main/java/com/viva/Viva/membership/model/Membership.java", "file_name": "Membership.java", "file_ext": "java", "file_size_in_byte": 1192, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ff02d84787a745f06625acac00aee48a9ba7b560", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fvahdati/viva | 249 | FILENAME: Membership.java | 0.273574 | package com.viva.Viva.membership.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ser.Serializers;
import com.viva.Viva.base.BaseEntity;
import com.viva.Viva.businessProviders.model.BusinessProvider;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name="MEMBERSHIP")
public class Membership extends BaseEntity {
@Column(name="ACTIVE", nullable = false)
private Boolean active;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "BUSINESS_PROVIDER_ID")
private BusinessProvider businessProviderId;
@ManyToMany(fetch =FetchType.LAZY , cascade=CascadeType.PERSIST)
@JoinTable(name = "MEMBERSHIPS_INVOICES",
joinColumns = {
@JoinColumn(name="MEMBERSHIP_ID" , referencedColumnName = "ID" , nullable = false, updatable = false)},
inverseJoinColumns = {
@JoinColumn(name="INVOICE_ID" , referencedColumnName = "ID", nullable = false, updatable = false)})
private Set<Invoice> invoices = new HashSet<>();
}
|
28a58534-da36-4cf3-a5ff-714a6ab836ed | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-30 11:46:15", "repo_name": "komalghule/eVisa", "sub_path": "/src/app/visa/test/CenterServiceImplTest.java", "file_name": "CenterServiceImplTest.java", "file_ext": "java", "file_size_in_byte": 1056, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "785e06e78c6f3ffcc6cd7481d10c086a1afe9ae1", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/komalghule/eVisa | 201 | FILENAME: CenterServiceImplTest.java | 0.264358 | package app.visa.test;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.GenericXmlContextLoader;
import app.visa.pojo.Country;
import app.visa.service.CenterService;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="file:WebContent/WEB-INF/spring4-servlet.xml", loader=GenericXmlContextLoader.class)
public class CenterServiceImplTest {
@Autowired
@Qualifier("centerServiceImpl")
private CenterService centerService;
@Test
public void testGetCnters(){
List<Country> cList = centerService.getCountryList();
for (Country centers : cList) {
System.out.println("-----------------------------centersList--------------------------------");
System.out.println(centers);
}
}
}
|
a7ab9bba-b7af-410b-8e70-b019b930b2e1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-21 01:32:14", "repo_name": "fliang97/176B_server", "sub_path": "/src/Server/Server.java", "file_name": "Server.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "ae1b42626fe07a9f965e540819f6448e1860c315", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fliang97/176B_server | 224 | FILENAME: Server.java | 0.295027 | package Server;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import Server.MultipleConnection;
public class Server extends Thread{
private final int serverPort;
private ArrayList<MultipleConnection> connectionList = new ArrayList<>();
public Server(int serverPort) {
this.serverPort = serverPort;
}
public List<MultipleConnection> getConnectionList(){
return connectionList;
}
@Override
public void run() {
try {
ServerSocket serverSocket = new ServerSocket(serverPort);
while(true) {
System.out.println("about to accept connection");
Socket clientSocket = serverSocket.accept();
System.out.println("Accepted connection from " + clientSocket);
MultipleConnection mc = new MultipleConnection(this, clientSocket);
connectionList.add(mc);
mc.start();
}
} catch (IOException e){
e.printStackTrace();
}
}
public void removeWorker(MultipleConnection multipleConnection) {
connectionList.remove(multipleConnection);
}
}
|
97606467-47b7-4b7c-ab17-2317d238522d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-08-15T15:03:04", "repo_name": "Vinelab/go-base", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1022, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "23d5434b24df567c868faaa593731e132cf16588", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Vinelab/go-base | 241 | FILENAME: README.md | 0.249447 | # Go base
A basic project structure with configuration using environment variables and a convenient http client package to reduce boilerplate.
### Features
- Define configuration variables in `config/config.go`
- Use the HTTP client with simple calls to `http.GET` and `http.POST`
## Installation
- Clone this repository in a location from your GOPATH
- Replace all occurrences of `Vinelab/go-base` with the name your `vendor/project`
## Vendoring Dependencies
Using Docker image `vinelab/go-vndr`:
1. Run `docker run -it -v /path/to/project:/go/src/github.com/[vendor]/[project] vinelab/go-vndr bash` to run a container with the code mounted and a new SSH session established
> 1. Changes in code on the local file system will be directly available in the container (mounted)
> 2. Shutting down the container will not cause any harm to the code, except the vendor packages installed using `vndr` will need to be re-installed after running another container (see step n.2)
2. Run (within the container) `vndr`
|
e8664312-91d9-486b-abde-30e5b3428ef9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-09 13:14:12", "repo_name": "weebeejeebees/InheritanceRPGTANGOTECHNOLOGIES", "sub_path": "/app/src/main/java/com/example/inheritancerpgtangotechnologies/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 971, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "fd3396acbea12323c9360abe872b1b5e92e93c0b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/weebeejeebees/InheritanceRPGTANGOTECHNOLOGIES | 174 | FILENAME: MainActivity.java | 0.191933 | package com.example.inheritancerpgtangotechnologies;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.example.inheritancerpgtangotechnologies.view.Select;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button splashtocharacter = findViewById(R.id.splashtocharacter);
splashtocharacter.setOnClickListener(this);
}
@Override
public void onClick(View v) {
Intent i = new Intent(MainActivity.this, Select.class
);
startActivity(i);
switch (v.getId()) {
case R.id.splashtocharacter:
startActivity(i);
break;
}
}
} |
bd8c8bd1-2316-43e4-ac1b-9a34a687bc0c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-20 00:36:30", "repo_name": "redhat-quarkus-hackfest-team5/twitter-ingestor", "sub_path": "/src/main/java/quarkus/hackfest/twitteringestor/bean/LatestTweetBean.java", "file_name": "LatestTweetBean.java", "file_ext": "java", "file_size_in_byte": 1164, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "ce2040dffd1c2299a016b2a2417a1ec1b933cf56", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/redhat-quarkus-hackfest-team5/twitter-ingestor | 241 | FILENAME: LatestTweetBean.java | 0.259826 | package quarkus.hackfest.twitteringestor.bean;
import org.apache.camel.Exchange;
import org.apache.camel.component.twitter.TwitterConstants;
import twitter4j.HashtagEntity;
import twitter4j.Status;
import javax.inject.Named;
import javax.inject.Singleton;
import java.util.List;
@Singleton
@Named("latestTweetBean")
public class LatestTweetBean {
public static String CURRENT_GP = "CurrentGP";
public void latestTweet(Exchange exchange){
List<Status> list = exchange.getIn().getBody(List.class);
if(list != null && !list.isEmpty()){
Status status = list.get(0);
String query = "conversation_id:"+ status.getId();
exchange.getIn().setHeader(TwitterConstants.TWITTER_KEYWORDS, query);
exchange.getIn().setHeader(CURRENT_GP, getGPname(status));
}
}
public static String getGPname(Status status){
String gp = null ;
for ( HashtagEntity hashtag : status.getHashtagEntities() ) {
if( hashtag.getText().contains("GrandPrix") ){
gp = hashtag.getText();
break;
}
}
return gp;
}
}
|
c7237c71-5dcc-46f9-8d6d-79a17cac669b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-10 09:29:18", "repo_name": "YLS-Kevin/robot", "sub_path": "/src/main/java/com/yls/projects/robot/service/impl/DialogResourceServiceImpl.java", "file_name": "DialogResourceServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "6da15d235511c8d2ecbb639d5b53ff088173a601", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/YLS-Kevin/robot | 234 | FILENAME: DialogResourceServiceImpl.java | 0.290981 | package com.yls.projects.robot.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yls.projects.robot.dao.DialogResourcDao;
import com.yls.projects.robot.entity.DialogResource;
import com.yls.projects.robot.service.DialogResourceService;
/**
* 资源service impl
*
* @author Alex Lee 李璐
* @date 2018年5月6日下午4:49:00
*/
@Service("dialogResourceService")
@Transactional(value = "robotTransactionManager", rollbackFor = Exception.class)
public class DialogResourceServiceImpl implements DialogResourceService{
@Autowired
private DialogResourcDao dialogResourcDao;
//keyGenerator="wiselyKeyGenerator"
@Cacheable(value = "ida",key="#root.targetClass.name")
@Transactional(value = "robotTransactionManager", readOnly = true)
@Override
public List<DialogResource> getByUserId(String userId) {
return dialogResourcDao.getByUserId(userId);
}
}
|
67e8b148-acb6-4e74-b596-8bfccaf0e3c9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-25 17:03:11", "repo_name": "chaulong78/ONLINE-TRACKING-01", "sub_path": "/src/main/java/com/msp/controller/MainController.java", "file_name": "MainController.java", "file_ext": "java", "file_size_in_byte": 1192, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "09da520c2ba17c4ca81cc02cfb2cb34a04e1bd82", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/chaulong78/ONLINE-TRACKING-01 | 214 | FILENAME: MainController.java | 0.2227 | package com.msp.controller;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class MainController {
@RequestMapping(value = "/login")
public ModelAndView login() {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
String role = "[ROLE_ANONYMOUS]";
boolean isAuthenticated = role.equals(auth.getAuthorities().toString());
if (isAuthenticated) {
return new ModelAndView("web/login-form");
} else {
return new ModelAndView("redirect:/");
}
}
@GetMapping(value = {"/"})
public String home() {
return "web/home-public";
}
@GetMapping(value = "/403")
public String accessDenied() {
return "web/403";
}
@RequestMapping(value = "/home")
public String privateHome(){
return "web/home-private";
}
}
|
9bafd460-0c89-46af-8b45-8bc683dc2149 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-06-03T06:26:38", "repo_name": "nwinkler/bookmarklet", "sub_path": "/CHANGELOG.md", "file_name": "CHANGELOG.md", "file_ext": "md", "file_size_in_byte": 1066, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "09ad12bfac64eb73f764129793aeb7783fa96377", "star_events_count": 3, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/nwinkler/bookmarklet | 256 | FILENAME: CHANGELOG.md | 0.233706 | ## 0.5.1
* Improved documentation, mainly formatting.
## 0.5.0
* Added commands to include/load jQuery in the generated bookmarklet. The code for including jQuery was reused from https://github.com/chriszarate/bookmarkleter.
* Added option to use minified or unminified jQuery library.
## 0.4.0
* Encoding the generated bookmarklet to avoid issues with special characters like quotes when using the bookmarklet from a link
* The `Ctrl-Alt-B` shortcut now creates an HTML link ('Click Me') with the bookmarklet code.
* The existing functionality (simply creating the JavaScript function) is still available from the menu or from the command palette (_Bookmarklet: Create JavaScript_).
## 0.3.0
* Showing a message after copying the bookmarklet to the clipboard.
## 0.2.1
* Temporarily disabling the alert, since it was causing a ∫ character to be inserted into the current editor (Mac OS X).
## 0.2.0
* Checking for file grammar - only enable for JavaScript files
* Showing alert after copying the bookmarklet to the clipboard
## 0.1.0
* Basic implementation
|
f920911a-163e-4fa7-ad6d-327c5a34dfa3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-16 10:16:18", "repo_name": "alexandrKuskov/11", "sub_path": "/src/eu/datatiler/pages/dictionary/ItemRegion.java", "file_name": "ItemRegion.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "151d8b5ce3ca0e796730e2b4176ce60076517e13", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/alexandrKuskov/11 | 217 | FILENAME: ItemRegion.java | 0.272799 | package eu.datatiler.pages.dictionary;
import com.qatestlab.base.BasePage;
import com.qatestlab.base.Locator;
import com.qatestlab.base.LocatorTypes;
/**
* Created by Petro on 16.03.2016.
*/
public class ItemRegion extends BasePage {
private Locator dictionaryPage = new Locator(LocatorTypes.XPATH,
"//body[contains(@class, 'page-dictionary')]");
private Locator dictionaryItemByName = new Locator(LocatorTypes.XPATH,
"//div[@class='dt-grid-container']//td[text()='%s']");
public void waitToLoad(){
waitForVisibility("Wait for dictionary page to be loaded", dictionaryPage);
}
public void waitDictionaryItemByName(String itemName){
waitForVisibility("Wait for dictionary item with name '" + itemName + "' to be loaded",
dictionaryItemByName, itemName);
}
public boolean isDictionaryItemPresent(String itemName){
return isPresent("Item '" + itemName + "' is present", dictionaryItemByName, itemName);
}
}
|
49c2b033-576f-4eea-827f-cbd8ad3ddf1c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-27 11:17:32", "repo_name": "zhang951228/springboo2_guides_web01", "sub_path": "/src/main/java/com/erayt/web01/domain/Student01.java", "file_name": "Student01.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "52c1cc4eb0e2803ed24718545d08e1085a6e4690", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhang951228/springboo2_guides_web01 | 299 | FILENAME: Student01.java | 0.242206 | package com.erayt.web01.domain;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.hateoas.RepresentationModel;
/**
* @Auther: Z151
* @Date: 2021/8/12 14:27
*/
public class Student01 extends RepresentationModel<Student01> {
private long id;
private String name;
private String clz;
@JsonCreator
public Student01(@JsonProperty("id")long id, @JsonProperty("name")String name, @JsonProperty("clz")String clz) {
this.id = id;
this.name = name;
this.clz = clz;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getClz() {
return clz;
}
public void setClz(String clz) {
this.clz = clz;
}
@Override
public String toString() {
return "Student01{" +
"id=" + id +
", name='" + name + '\'' +
", clz='" + clz + '\'' +
'}';
}
}
|
a335f419-7efa-453a-a29a-5e916a2fa4eb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-11 17:10:32", "repo_name": "sates298/Second-Year", "sub_path": "/ProgrammingTechnologies/secondlist/src/test/java/pl/swozniak/TempDatabaseTest.java", "file_name": "TempDatabaseTest.java", "file_ext": "java", "file_size_in_byte": 1091, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "52d950c073d2cc7be934108411a41e7e4192fa8b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sates298/Second-Year | 227 | FILENAME: TempDatabaseTest.java | 0.284576 | package pl.swozniak;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import pl.swozniak.article.Article;
import pl.swozniak.client.Client;
import pl.swozniak.invoice.Invoice;
import java.util.ArrayList;
import static org.junit.Assert.*;
public class TempDatabaseTest {
private TempDatabase tempDatabase;
@Before
public void setUp() throws Exception {
tempDatabase = new TempDatabase();
}
@After
public void tearDown() throws Exception {
tempDatabase = null;
}
@Test
public void setDatabase() {
TempDatabase.setDatabase(tempDatabase);
assertEquals(tempDatabase, TempDatabase.getDatabase());
}
@Test
public void getAllArticles() {
assertEquals(new ArrayList<Article>(), tempDatabase.getAllArticles());
}
@Test
public void getAllInvoices() {
assertEquals(new ArrayList<Invoice>(), tempDatabase.getAllInvoices());
}
@Test
public void getAllClients() {
assertEquals(new ArrayList<Client>(), tempDatabase.getAllClients());
}
} |
b75e0f42-02df-4b90-9b6b-50de8c64f721 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-19T07:27:41", "repo_name": "cx265/mye", "sub_path": "/Webservice-client/src/com/atguigu/day01_ws/ws2/GetStudentsByPrice.java", "file_name": "GetStudentsByPrice.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 53, "lang": "zh", "doc_type": "code", "blob_id": "11ab1a7321e3c14385c06964526c9cf1e8e998e5", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "GB18030"} | https://github.com/cx265/mye | 293 | FILENAME: GetStudentsByPrice.java | 0.287768 |
package com.atguigu.day01_ws.ws2;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>getStudentsByPrice complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType name="getStudentsByPrice">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="arg0" type="{http://www.w3.org/2001/XMLSchema}float"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getStudentsByPrice", propOrder = {
"arg0"
})
public class GetStudentsByPrice {
protected float arg0;
/**
* 获取arg0属性的值。
*
*/
public float getArg0() {
return arg0;
}
/**
* 设置arg0属性的值。
*
*/
public void setArg0(float value) {
this.arg0 = value;
}
}
|
f7d8da9f-be8e-4e03-abd2-9492eb22e4d2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-10 02:46:52", "repo_name": "xingtingbiao/springboot-example", "sub_path": "/springboot1/security/src/main/java/com/example/spring/handler/TestArgumentResolver.java", "file_name": "TestArgumentResolver.java", "file_ext": "java", "file_size_in_byte": 1231, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "a2aaab4d666feba947743a42386283fad6056f81", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xingtingbiao/springboot-example | 189 | FILENAME: TestArgumentResolver.java | 0.253861 | package com.example.spring.handler;
import com.example.spring.User;
import com.example.spring.annotation.InjectUserInfo;
import org.springframework.core.MethodParameter;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
@Component
public class TestArgumentResolver implements HandlerMethodArgumentResolver {
@Override
public boolean supportsParameter(MethodParameter methodParameter) {
return methodParameter.hasParameterAnnotation(InjectUserInfo.class);
}
@Override
public Object resolveArgument(MethodParameter methodParameter,
ModelAndViewContainer modelAndViewContainer,
NativeWebRequest nativeWebRequest,
WebDataBinderFactory webDataBinderFactory) throws Exception {
InjectUserInfo info = methodParameter.getParameterAnnotation(InjectUserInfo.class);
User user = new User();
user.setName(info.name());
return user;
}
}
|
c49d6b4e-8486-47b0-9aba-47c2374c9e0c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-01 08:44:54", "repo_name": "TianXingKeJi/YiKeZhong", "sub_path": "/NeiHanDuanZi/app/src/main/java/com/example/y_xl/neihanduanzi/utils/My_api.java", "file_name": "My_api.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "18394fa7b21de80b26559804455dd50ae96ffb38", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/TianXingKeJi/YiKeZhong | 310 | FILENAME: My_api.java | 0.246533 | package com.example.y_xl.neihanduanzi.utils;
/**
* Created by Administrator on 2018/3/26.
*/
public class My_api {
//我的关注
public static final String wodeguanzhu_utils="http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=1";
//热门视频
public static String Hot_video_api = "https://www.zhaoapi.cn/quarter/getHotVideos";
public static String Odd_photos_api = " https://www.zhaoapi.cn/quarter/getJokes";
//登陆
public static String Login_zpi = "https://www.zhaoapi.cn/user/login";
// 最新
public final static String URL_LATEST = "http://m2.qiushibaike.com/article/list/latest?page=%d";
// 图片
public final static String URL_PIC= "http://m2.qiushibaike.com/article/list/pic?page=%d";
// 视频
public final static String URL_VIDEO = "http://m2.qiushibaike.com/article/list/video?page=2";
// 文本
public final static String URL_TEXT = "http://m2.qiushibaike.com/article/list/text?page=%d";
public static String add_content ="https://www.zhaoapi.cn/quarter/publishJoke";
}
|
01d6087f-e164-430f-ac7b-d31ef4992b85 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-24 13:33:48", "repo_name": "rameshmese/calendarapp", "sub_path": "/src/main/java/com/ramesh/calendarapp/dao/UserDao.java", "file_name": "UserDao.java", "file_ext": "java", "file_size_in_byte": 1192, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "a471bd03c5af96e7312740dd5f16b3054d8f8d29", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rameshmese/calendarapp | 239 | FILENAME: UserDao.java | 0.290981 | package com.ramesh.calendarapp.dao;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.stereotype.Component;
import com.ramesh.calendarapp.dbconfig.DBConfig;
import com.ramesh.calendarapp.dbconfig.DBConnection;
@Component
@AutoConfigureAfter(value = {DBConfig.class,DBConnection.class})
public class UserDao {
protected final Logger log = LoggerFactory.getLogger(getClass());
@Autowired
DBConnection dbConnection ;
public Boolean checkAdmin(String userName,String password){
Connection connection = null;
try{
connection = dbConnection.getConnection();
Statement stmt = connection.createStatement();
ResultSet rs=stmt.executeQuery("select * from users where userName=' "+userName+" ' and pwd =' " + password +"'");
while (rs.next()) {
return true;
}
} catch (SQLException e) {
return false;
} finally {
dbConnection.closeConnection(connection);
}
return true;
}
}
|
844d907f-2682-468d-be7d-5269268baa50 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-09 13:14:39", "repo_name": "seerdaryilmazz/OOB", "sub_path": "/authorization-service/src/main/java/ekol/authorization/domain/auth/BaseRelation.java", "file_name": "BaseRelation.java", "file_ext": "java", "file_size_in_byte": 1040, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "b69c65d0a21163f14bcab5bf94ffb571cfad92a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/seerdaryilmazz/OOB | 230 | FILENAME: BaseRelation.java | 0.274351 | package ekol.authorization.domain.auth;
import java.io.Serializable;
import org.apache.commons.lang3.StringUtils;
import org.neo4j.ogm.annotation.EndNode;
import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.RelationshipEntity;
import org.neo4j.ogm.annotation.StartNode;
import lombok.Data;
@Data
public abstract class BaseRelation implements Serializable{
/**
*
*/
private static final long serialVersionUID = -2392712916454743242L;
@GraphId
private Long id;
@StartNode
private BaseEntity startNode;
@EndNode
private BaseEntity endNode;
public String getType() {
if (this.getClass().isAnnotationPresent(RelationshipEntity.class)) {
RelationshipEntity relationEntity = this.getClass().getAnnotation(RelationshipEntity.class);
if (StringUtils.isNotBlank(relationEntity.type())) {
return relationEntity.type();
} else {
return this.getClass().getSimpleName();
}
}
return null;
}
}
|
a90870f2-329d-48ab-a2f0-5f8a1433886b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-28 02:36:57", "repo_name": "lpzahd/Lpzahd", "sub_path": "/app/src/main/java/com/lpzahd/lpzahd/activity/base/TestSepatateActivity.java", "file_name": "TestSepatateActivity.java", "file_ext": "java", "file_size_in_byte": 1068, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "0e5f3b7aed85a0f84a5adcab153c63d56e0926af", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lpzahd/Lpzahd | 242 | FILENAME: TestSepatateActivity.java | 0.287768 | package com.lpzahd.lpzahd.activity.base;
import android.support.annotation.Nullable;
import android.widget.TextView;
import com.lpzahd.lpzahd.R;
/**
* Created by Administrator on 2016/5/4.
*/
public class TestSepatateActivity extends SeparateBaseActivity{
private SimpleHolder holder;
@Nullable
@Override
public LifeHolder initHolder() {
return new SimpleHolder();
}
@Override
public void onBaseCreate() {
setContentView(R.layout.activity_test);
holder = getLifeHolder();
holder.t1 = (TextView) findViewById(R.id.textView1);
holder.t2 = (TextView) findViewById(R.id.textView2);
holder.t3 = (TextView) findViewById(R.id.textView3);
holder.s1 = "str";
holder.i1 = 1;
HolderAdapter adapter = new SimpleHolderAdapter(getLifeSepatate());
adapter.addAll(holder);
}
class SimpleHolder extends LifeHolder {
public TextView t1;
public TextView t2;
public TextView t3;
public String s1;
public int i1;
}
}
|
a7aa5aca-3ca0-4ef7-b84d-bde60126d029 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-12-05 07:42:54", "repo_name": "RichaYadav/cmpe273", "sub_path": "/AirlineManagementService/src/sjsu/cmpe273/project/helper/ProjectHelper.java", "file_name": "ProjectHelper.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "178d46726339be3f89506436ab77ba5c1f2f213a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/RichaYadav/cmpe273 | 238 | FILENAME: ProjectHelper.java | 0.288569 | package sjsu.cmpe273.project.helper;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Random;
public class ProjectHelper {
public static void closeStatement(Statement statement) {
if (statement != null) {
try {
statement.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
public static void closeConnection(Connection connection) {
if (connection != null) {
try {
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
public static void closeResultSet(ResultSet resultSet) {
if (resultSet != null) {
try {
resultSet.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
public static String createID(String type){
StringBuffer id = new StringBuffer();
id.append(type);
for(int i = 0; i < 10 ; i++){
id.append(new Random().nextInt(9));
}
return id.toString();
}
}
|
c7b3cc01-efd5-4e10-b93a-084efa23bba4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-09-28T01:39:51", "repo_name": "Julegirl/HTML-Exercise-1", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1076, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "0a591e5090ff1e24640add6c4b0c313fdb4f03af", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Julegirl/HTML-Exercise-1 | 312 | FILENAME: README.md | 0.225417 | # HTML-Exercise-1
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="Beginning Codes.css"/>
<title>What's Up</title>
</head>
<body>
<h1>greeting</h1>
<p>Hello, this is my first attempt at coding for my web browser. Can you read me?</p>
<h2>Learn About me</h2>
<p>I though I could use this page to help you learn a little more about myself.</p>
<ul>
<li>I am a writing major.</li>
<li>I live in the small town of Hunker, PA.</li>
<li>I am a 80% introverted and 20% extroverted.</li>
<li>I love to bake.</li>
</ul>
<p><a>https://www.handletheheat.com/bakery-style-chocolate-chip-cookies/</a>chocolate-chip cookies</p>
<h3>Farewell</h3>
<p>That's all for me. Thanks for reading.</p>
</body>
</html>
body {
background-color: #DFF557;
color: #9147D7;
font-family: arial, helvetica, sans-serif;
|
89b0be18-b45a-47a4-9577-d36fb47bb6c7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-18 05:28:22", "repo_name": "sshaiakhmedov/AG", "sub_path": "/src/test/java/LoginPage.java", "file_name": "LoginPage.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "49ad8fea4ad707fbfd061718d755235bd00f3855", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sshaiakhmedov/AG | 190 | FILENAME: LoginPage.java | 0.242206 | import org.openqa.selenium.*;
import org.openqa.selenium.support.*;
import static org.junit.jupiter.api.Assertions.*;
class LoginPage extends Base{
private String URL = "http://the-internet.herokuapp.com/login";
private String title="The Internet";
//Class with elements (Mapping)
@FindBy(id="username")
private WebElement username;
@FindBy(id = "password")
private WebElement password;
@FindBy(className = "radius")
private WebElement buttonLogin;
@FindBy(id = "flash")
private WebElement confirmLogout;
//constructor
public LoginPage(WebDriver driver){
this.driver=driver;
assertEquals(title, driver.getTitle(), "This is not the LoginPage");
}
//services
public static LoginPage open(WebDriver driver){
// driver.get(URL);
return PageFactory.initElements(driver, LoginPage.class);
}
public void submitLogin(String user, String pass){
username.sendKeys(user);
}
}
|
6da7ff24-5279-428f-9c4a-fc8267d07002 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-01-19 07:45:40", "repo_name": "vladb00mer/PureSelenium", "sub_path": "/src/main/java/pageobjects/HomePage.java", "file_name": "HomePage.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "ee560b2a3ac151a24ceab3efff4ea125c0d44f31", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vladb00mer/PureSelenium | 204 | FILENAME: HomePage.java | 0.289372 | package pageobjects;
import common.Init;
import common.ParentPage;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class HomePage extends ParentPage {
@FindBy(xpath = "//button[@type = 'submit']")
private WebElement searchButton;
@FindBy(xpath = "//input[@id = 'text']")
private WebElement searchArea;
public HomePage() {
Init.getWebDriver().navigate().to("http://ya.ru");
PageFactory.initElements(Init.getWebDriver(), this);
new WebDriverWait(Init.getWebDriver(), Init.getTimeOut()).until(ExpectedConditions.visibilityOf(searchArea));
}
public HomePage search(String request) {
setTextValue(searchArea, request);
clickOnElement(searchButton);
try {
Thread.sleep(5);
} catch (InterruptedException e) {
e.printStackTrace();
}
return this;
}
}
|
adb99775-811c-491c-9a2e-de14fa698e79 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-09T13:41:40", "repo_name": "ipinfo/java", "sub_path": "/CHANGELOG.md", "file_name": "CHANGELOG.md", "file_ext": "md", "file_size_in_byte": 1625, "line_count": 50, "lang": "en", "doc_type": "text", "blob_id": "644b9752e93026556c0b10cad6925b78095d5513", "star_events_count": 95, "fork_events_count": 56, "src_encoding": "UTF-8"} | https://github.com/ipinfo/java | 337 | FILENAME: CHANGELOG.md | 0.282196 | # 2.2.0
- Added `isEU`, `CountryFlag`, `CountryCurrency` and `Continent` fields.
- Checking bogon IP locally.
- Upgraded `okhttp` to `4.10.0`.
# 2.1.0
- Added `Relay` and `Service` fields to `io.ipinfo.api.model.Privacy`.
# 2.0.0
Breaking changes:
- `IPInfo` is renamed to `IPinfo`.
- `IPInfoBuilder` is moved into `IPinfo.Builder`.
- `ASNResponse.numIps` is now an `Integer` instead of a `String`.
- The cache implementation now only uses `get` and `set`, which accept
arbitrary strings, which may not necessarily be IP or ASN strings like
"1.2.3.4" and "AS123".
Additions:
- `getBatch`, `getBatchIps` and `getBatchAsns` allow you to do lookups of
multiple entities at once. There is no limit to the size of inputs on these
library calls as long as your token has quota.
- `getMap` will give you a map URL for https://ipinfo.io/tools/map given a list
of IPs.
- Many new pieces of data have been added that were previously missing. The new
dataset reflects all the new data available via raw API calls.
- The keys given to cache functions will now be versioned. `IPinfo.cacheKey`
must be used to derive the correct key if doing manual lookups.
|
e9e6bb7e-764c-4ded-850d-03b6dd68cbb8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-06 01:31:45", "repo_name": "marktowhen/gule-trade", "sub_path": "/src/main/java/com/jingyunbank/etrade/message/service/EmailService.java", "file_name": "EmailService.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "f5357ce6a46beb9898c24d4f2f0b5feecc68af72", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/marktowhen/gule-trade | 235 | FILENAME: EmailService.java | 0.289372 | package com.jingyunbank.etrade.message.service;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import com.jingyunbank.core.msg.MessagerManager;
import com.jingyunbank.core.msg.email.EmailSender;
import com.jingyunbank.etrade.api.message.bo.Message;
import com.jingyunbank.etrade.api.message.service.context.ISyncNotifyService;
import com.jingyunbank.etrade.config.PropsConfig;
@Service("emailService")
public class EmailService implements ISyncNotifyService {
private EmailSender sender;
public EmailService() {
try {
String providername = PropsConfig.getString(PropsConfig.EMAIL_PROVIDER);
Class.forName(providername);
} catch (ClassNotFoundException e) {
// logger.error(e);
}
sender = MessagerManager.getEmailSender(PropsConfig.toMap());
}
@Override
public void inform(Message msg) throws Exception {
if(msg.getReceiveUser()!=null && !StringUtils.isEmpty(msg.getReceiveUser().getEmail())){
sender.send(msg.getReceiveUser().getEmail(), msg.getTitle(), msg.getContent());
}
}
}
|
8c7de6af-4d7a-4345-baa9-41ae11402725 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-27 14:47:11", "repo_name": "azerliquid/Point-Of-Sale-with-Java", "sub_path": "/src/config/koneksi.java", "file_name": "koneksi.java", "file_ext": "java", "file_size_in_byte": 1104, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "df618391f0e123f7f37269710cf30579014ba8b4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/azerliquid/Point-Of-Sale-with-Java | 215 | FILENAME: koneksi.java | 0.245085 | package config;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
*
* @author Reza Azmi
*/
public class koneksi {
public static Connection SambungKeDatabase(){
String DRIVER = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/projectkp";
Connection kon = null;
try {
Class.forName(DRIVER).newInstance();
kon = DriverManager.getConnection(url,"root","");
return kon;
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException | SQLException e) {
System.err.println("Error: "+ e.getMessage());
System.exit(0);
}
return null;
}
public static Connection getConnection() {
Connection con = null;
if(con == null){
try {
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/projectkp?", "root", "");
} catch (SQLException e) {
System.exit(0);
}
}
return con;
}
}
|
4e1e9c61-5d4c-4e09-8d96-ecc83286a10a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-23 04:38:50", "repo_name": "nakulpatil24/misc_samples", "sub_path": "/HTML-JSP-Javascript-Assignments- Tests/Assignments/JSP_Servlet/ServletAssing/Day 3/Assignment 7/Modified Assignment 5/ConDatabase.java", "file_name": "ConDatabase.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "dcffb109f682399581e2d6ae871f1ccddfa3f5bf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nakulpatil24/misc_samples | 209 | FILENAME: ConDatabase.java | 0.262842 | import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
/************************************************************/
public class ConDatabase implements ServletContextListener
{
private ServletContext context = null;
/************************************************************/
public void contextInitialized(ServletContextEvent event)
{
this.context = event.getServletContext();
try
{
// create a url string to connect to the oracle server
String url = "jdbc:oracle:thin:@192.168.12.16:1521:oracle8i";
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection con = DriverManager.getConnection(url , "scott", "tiger");
context.setAttribute("con", con);
}
catch (SQLException s)
{
System.out.println("SQLException occured.");
}
}
/************************************************************/
public void contextDestroyed(ServletContextEvent event)
{
this.context = null;
}
/************************************************************/
}
/********************************************************************/
|
bbf3705d-ff01-4def-873e-f124a6f2365e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-25 12:12:38", "repo_name": "spring-of-mulberry/neusoft", "sub_path": "/upload/src/main/java/com/mulberry/upload/fileloadController.java", "file_name": "fileloadController.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "2fcc3a4ea75de910765a860eea615ce43ea91ab3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/spring-of-mulberry/neusoft | 209 | FILENAME: fileloadController.java | 0.23231 | package com.mulberry.upload;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.UUID;
@Controller
public class fileloadController {
@RequestMapping("/dofile")
public String file_UpLoad(@RequestParam("ufile") MultipartFile multipartFile
,@RequestParam("fname") String xxxx, ModelMap modelMap) throws IOException {
System.out.println(xxxx);
// 加密
String sfname = multipartFile.getOriginalFilename().substring(multipartFile.getOriginalFilename().lastIndexOf("."));
String newName = UUID.randomUUID().toString().replace("-","X");
File newfile = new File("F:\\图片\\"+newName+sfname);
System.out.println(newName+sfname);
// 上传文件
multipartFile.transferTo(newfile);
return "forward:index.jsp";
}
}
|
694d7884-207d-4f47-b50b-fcfe02f9b5df | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-03-22T01:45:35", "repo_name": "omwan/task-tracker-spa", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1164, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "647f4427a8b00b38efcb40a235d9e0a6690c3c58", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/omwan/task-tracker-spa | 271 | FILENAME: README.md | 0.23092 | # TaskTrackerSpa
## Design choices
- Users can create an account and set a password, but cannot edit their information afterwards, only view it
- Usernames must be unique, passwords cannot be blank
- Tasks are required to have a title, but may be created without an assignee, or later set to not have an assignee
- Tasks have a many to one relationship with users where a single user may be assigned multiple tasks but a task may only have one assignee
------
To start your Phoenix server:
- Install dependencies with `mix deps.get`
- Create and migrate your database with `mix ecto.setup`
- Install Node.js dependencies with `cd assets && npm install`
- Start Phoenix endpoint with `mix phx.server`
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
## Learn more
- Official website: http://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Mailing list: http://groups.google.com/group/phoenix-talk
- Source: https://github.com/phoenixframework/phoenix |
8430d42e-8318-48c3-b4e2-496bc8cb61f9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-02 13:33:08", "repo_name": "laptoprobotica/AICitizens-19066", "sub_path": "/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/userOpModes/robo7u/Mecanisme/Intake.java", "file_name": "Intake.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "244d9507fc96a6898145b88be594630f5457a0ee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/laptoprobotica/AICitizens-19066 | 285 | FILENAME: Intake.java | 0.273574 | package org.firstinspires.ftc.teamcode.drive.userOpModes.robo7u.Mecanisme;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.HardwareMap;
public class Intake {
HardwareMap hwMap;
DcMotor geckoMotor;
DcMotor gearedMotor;
public Intake(HardwareMap ahwMap) {
hwMap = ahwMap;
geckoMotor = hwMap.get(DcMotor.class, "geckoMotor");
gearedMotor = hwMap.get(DcMotor.class, "gearedMotor");
}
/**
* Functie care mananca covrigi
* @param power primit de la controller
*/
public void powerIntake(double power) {
geckoMotor.setPower(power);
gearedMotor.setPower(-power);
}
/**
* Functie care vomita covrigi
* @param power primit de la controller
*/
public void powerOuttake(double power) {
geckoMotor.setPower(-power);
gearedMotor.setPower(power);
}
/**
* Functie care se opreste din mancat covrigi
*/
public void stopIntake() {
geckoMotor.setPower(0);
gearedMotor.setPower(0);
}
}
|
1702b5aa-86a5-475b-8f44-b2aeca379a8a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-22 01:51:14", "repo_name": "wh0315/BaseFramework", "sub_path": "/app/src/main/java/com/caifulife/baseframework/fargment/SubjectFragment.java", "file_name": "SubjectFragment.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "954b3dcbae5d01e2d5915873f31eef5d71a216a0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wh0315/BaseFramework | 208 | FILENAME: SubjectFragment.java | 0.235108 | package com.caifulife.baseframework.fargment;
import android.content.Intent;
import android.view.View;
import com.caifulife.baseframework.R;
import com.caifulife.baseframework.activity.LoginActivity;
/**
* Created by 皓 on 2017/8/29.
*/
public class SubjectFragment extends BaseFragment implements View.OnClickListener {
@Override
public View setContentView() {
if(view == null ){
view = View.inflate(getActivity(), R.layout.subjectfragment,null);
}
return view;
}
@Override
public void init() {
}
@Override
public void initView() {
view.findViewById(R.id.button2).setOnClickListener(this);
}
@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.button2:
Intent intent = new Intent(getActivity(), LoginActivity.class);
startActivity(intent);
getActivity().overridePendingTransition(R.anim.anim_slide_in,R.anim.anim_slide_out);
break;
}
}
}
|
f5c1be35-ffbc-484b-adf8-6c9cd40a50c1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-27 18:51:27", "repo_name": "ashirobokov/bank-online", "sub_path": "/payment-selector/src/main/java/ru/ashirobokov/payment/selector/flow/PaymentSelector.java", "file_name": "PaymentSelector.java", "file_ext": "java", "file_size_in_byte": 1192, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "24572d4cd14631d0881b573db1ef4788164fda73", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ashirobokov/bank-online | 226 | FILENAME: PaymentSelector.java | 0.276691 | package ru.ashirobokov.payment.selector.flow;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;
import ru.ashirobokov.payment.selector.model.Payment;
@Slf4j
@Component
public class PaymentSelector {
@Autowired
private PaymentSelectorProcessor processor;
@StreamListener(PaymentSelectorProcessor.INPUT)
public void selector(Payment payment) {
log.info(" .. PaymentSelector get Payment = {}", payment);
if (payment.getPaymentType().equals("account")) {
processor.account().send(message(payment));
} else if (payment.getPaymentType().equals("card")) {
processor.card().send(message(payment));
} else if (payment.getPaymentType().equals("mobile_phone")) {
processor.phone().send(message(payment));
}
}
private static final <T> Message<T> message(T val) {
return MessageBuilder.withPayload(val).build();
}
}
|
f109124f-1d0b-4808-bb7a-8dff0c150850 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-01-08 01:39:00", "repo_name": "ssinganamalla/tpr", "sub_path": "/gap/src/com/analysis/action/basic/BasicAjaxActionSupport.java", "file_name": "BasicAjaxActionSupport.java", "file_ext": "java", "file_size_in_byte": 1061, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "d8fbb0e917d4e9499013bba884ddf25c7a937766", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ssinganamalla/tpr | 212 | FILENAME: BasicAjaxActionSupport.java | 0.255344 | package com.analysis.action.basic;
import java.io.InputStream;
import java.io.StringBufferInputStream;
import org.apache.struts2.StrutsException;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.tickerperformance.exceptions.StrutsExecuteException;
public abstract class BasicAjaxActionSupport extends BasicActionSupport {
protected InputStream inputStream;
public InputStream getInputStream() {
return inputStream;
}
public void setInputStream(InputStream inputStream) {
this.inputStream = inputStream;
}
public String execute() throws Exception {
try{
this.inputStream = new StringBufferInputStream(populateInputString());
System.out.println("testing");
} catch(StrutsException e) {
return ERROR;
}
return SUCCESS;
}
/**
* Returns a populated string to be sent as inpurstream
* @return a String
* @throws StrutsException
*/
public abstract String populateInputString() throws StrutsException;
}
|
52b7aa07-7695-4a96-84c9-7fb02b92a53d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-12 05:00:50", "repo_name": "itskoolsid/dbslPropGen", "sub_path": "/DBSL_ProposalGenerator/src/com/dbsl/proposalgenerator/gui/admin/wizard/solution/form/SolutionAddForm.java", "file_name": "SolutionAddForm.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "dc7879a86ede29cdb902dc7589a5f0e302e9f37d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/itskoolsid/dbslPropGen | 193 | FILENAME: SolutionAddForm.java | 0.228156 | package com.dbsl.proposalgenerator.gui.admin.wizard.solution.form;
import java.util.Date;
import com.dbsl.proposalgenerator.commons.util.ImageUploadPanel;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.DateField;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.TextField;
@SuppressWarnings("serial")
public class SolutionAddForm extends CustomComponent {
private final TextField name;
private final TextField motto;
private final DateField createdOn;
private final ImageUploadPanel upload;
public SolutionAddForm() {
name = new TextField("Solution Name");
motto = new TextField("Solution Motto");
createdOn = new DateField("Created On", new Date());
upload = new ImageUploadPanel();
name.setNullRepresentation("");
motto.setNullRepresentation("");
createdOn.setEnabled(false);
FormLayout form = new FormLayout(name, motto, createdOn, upload);
setCompositionRoot(form);
}
}
|
2f47f027-51f3-4274-ae5b-211bb0f161fd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-03 07:21:40", "repo_name": "maxwell-nc/RxLiteAdapter", "sub_path": "/adapter/src/main/java/com/maxwell/nc/adapter/RxLiteCallAdapterFactory.java", "file_name": "RxLiteCallAdapterFactory.java", "file_ext": "java", "file_size_in_byte": 1188, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "01d3f717d4027e3132c149846eaec855052df65d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/maxwell-nc/RxLiteAdapter | 230 | FILENAME: RxLiteCallAdapterFactory.java | 0.285372 | package com.maxwell.nc.adapter;
import com.github.maxwell.nc.reactivelib.Publisher;
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import retrofit2.CallAdapter;
import retrofit2.Response;
import retrofit2.Retrofit;
/**
* RxLite请求适配器工厂
*/
public class RxLiteCallAdapterFactory extends CallAdapter.Factory {
public static RxLiteCallAdapterFactory create() {
return new RxLiteCallAdapterFactory();
}
@Override
public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
Class<?> rawType = getRawType(returnType);
if (returnType instanceof ParameterizedType) {
Type responseType = getParameterUpperBound(0, (ParameterizedType) returnType);
if (rawType == Publisher.class) {//处理Publisher<T>
if (getRawType(responseType) == Response.class) {//处理Publisher<Response<T>>
return new RxLiteCallAdapter(responseType, false);
}
return new RxLiteCallAdapter(responseType, true);
}
}
return null;
}
}
|
0e994194-fa96-4f3a-b901-c2dd533205de | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-07 15:10:17", "repo_name": "CS601-F18/project-3-ksonar", "sub_path": "/src/main/java/HTTP/SomeApplication.java", "file_name": "SomeApplication.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "933ef336dd5311cf27f8e72d2fc5505cf94bc2be", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/CS601-F18/project-3-ksonar | 250 | FILENAME: SomeApplication.java | 0.279042 | package HTTP;
import java.io.IOException;
/*
* Driver class, sets up server with data from config file and correct mappings
* @author ksonar
*/
public class SomeApplication {
public static void main(String[] args) throws SecurityException, IOException {
LogData.createLogger();
HTTPServer server = new HTTPServer();
if(args.length != 1) {
System.out.println("INVALID ARGUMENT LENGTH, MUST CONTAIN 1 CONIFG FILE");
LogData.log.warning("INVALID ARGUMENT LENGTH, MUST CONTAIN 1 CONIFG FILE");
System.exit(1);
}
String cFile = args[0];
System.out.println(cFile);
server.readConfig(cFile);
if(HTTPServer.configData.getAppName().equals("InvertedIndex")) {
server.addMapping("/reviewsearch", new ReviewSearchHandler());
server.addMapping("/find", new FindHandler());
server.buildInvertedIndex();
}
else {
server.addMapping("/slackbot", new ChatHandler());
}
System.out.println(server.getValidPaths());
LogData.log.info(server.getValidPaths());
server.startup();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.