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
a7963a16-2677-42a3-9492-a7ea251dadc4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-16 15:54:16", "repo_name": "axelrodvl/ibm-mq-client", "sub_path": "/src/main/java/co/axelrod/ibm/mq/client/mq/MQCloseableQueue.java", "file_name": "MQCloseableQueue.java", "file_ext": "java", "file_size_in_byte": 1038, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "d4773086a34e055cd1c22c8bee04789c5f35f361", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/axelrodvl/ibm-mq-client
231
FILENAME: MQCloseableQueue.java
0.250913
package co.axelrod.ibm.mq.client.mq; import co.axelrod.ibm.mq.client.configuration.MQConfiguration; import com.ibm.mq.MQException; import com.ibm.mq.MQQueue; import com.ibm.mq.MQQueueManager; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @Slf4j public class MQCloseableQueue implements AutoCloseable { private final MQQueueManager queueManager; @Getter private final MQQueue queue; public MQCloseableQueue(MQConfiguration mqConfiguration, String queueName, int openOptions) throws MQException { log.info("Connecting to queue manager: " + mqConfiguration.getQueueManager()); queueManager = new MQQueueManager(mqConfiguration.getQueueManager()); log.info("Accessing queue: " + queueName); queue = queueManager.accessQueue(queueName, openOptions); } @Override public void close() throws MQException { log.info("Closing the queue"); queue.close(); log.info("Disconnecting from the Queue Manager"); queueManager.disconnect(); } }
16f801ea-50c1-468f-89b5-57824e5cc0d9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-26 20:15:21", "repo_name": "SzymiJimi/bank-app-core", "sub_path": "/src/main/java/com/pai2/bank/app/controller/AddressController.java", "file_name": "AddressController.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "e60827431f59ec7fde39f033876f062579a386a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SzymiJimi/bank-app-core
247
FILENAME: AddressController.java
0.271252
package com.pai2.bank.app.controller; import com.pai2.bank.app.dao.AccountTransferDao; import com.pai2.bank.app.dao.AddressDao; import com.pai2.bank.app.model.Address; import com.pai2.bank.app.model.Creditcard; import javax.ejb.EJB; import javax.mvc.Controller; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @Controller @Path("address") public class AddressController { @EJB(beanInterface = AddressDao.class, beanName = "AddressDaoImpl") private AddressDao addressDao; @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/changeAddress") public Response getCreditCardsByBankAcc(Address address ) { try{ Address result= addressDao.merge(address); return Response.ok().entity(result).build(); }catch(Exception e) { System.out.println("Authentication not found"); System.out.println(e.toString()); return Response.status(403).build(); } } }
51ea828a-3e9f-41d4-957e-4e772092e8f8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-12 14:53:39", "repo_name": "JankenLv/Practice", "sub_path": "/FileIO/src/com/FileIO/Utils/ParseRequestUtil.java", "file_name": "ParseRequestUtil.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "cac9962c4169c846f7d51f14c5cf50d34b0cd19c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JankenLv/Practice
213
FILENAME: ParseRequestUtil.java
0.255344
package com.FileIO.Utils; import com.FileIO.Dto.fileItemDto; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; import javax.servlet.http.HttpServletRequest; import java.util.List; /** * 解析 request 的工具类 * 解析 request,并把 fileItem 保存到 paramDto */ public class ParseRequestUtil { public static fileItemDto parse(HttpServletRequest request) throws Exception{ fileItemDto fileItemDto = new fileItemDto(); ServletFileUpload fileUpload = new ServletFileUpload(new DiskFileItemFactory()); List<FileItem> fileItems = fileUpload.parseRequest(request); for(FileItem fileItem : fileItems) { if (!fileItem.isFormField()) { fileItemDto.addFileItem(fileItem.getFieldName(), fileItem); } else { fileItemDto.addFileItem(fileItem.getFieldName(),fileItem); } } return fileItemDto; } }
861ff2be-ac28-4abc-8e60-1738ff972179
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-08-09 15:44:01", "repo_name": "Pushp1403/Timezone-store-spring-Oauth-React", "sub_path": "/tz-store/src/main/java/com/toptal/pushpendra/mappers/EmailDetailsMapper.java", "file_name": "EmailDetailsMapper.java", "file_ext": "java", "file_size_in_byte": 1093, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "bcb66812a2021efadb66a04fbc76dfeebc75e74f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Pushp1403/Timezone-store-spring-Oauth-React
238
FILENAME: EmailDetailsMapper.java
0.285372
package com.toptal.pushpendra.mappers; import org.springframework.stereotype.Component; import com.toptal.pushpendra.entities.EmailRequest; import com.toptal.pushpendra.models.EmailData; import com.toptal.pushpendra.models.JwtUserDetails; import com.toptal.pushpendra.utilities.Constants; @Component public class EmailDetailsMapper { public EmailData userDetailsToEmailData(JwtUserDetails details, EmailRequest request) { EmailData data = new EmailData(); data.setUserFullName(details.getFirstName() + Constants.SINGLE_SPACE + details.getLastName()); data.setUrl(Constants.BASE_URL + Constants.VERIFICATION_END_POINT + Constants.QUESTION_MARK + Constants.ACCESS_TOKEN + Constants.EQUAL_SIGN + request.getToken()); data.setRecipient(request.getEmailId()); data.setSubject(Constants.VERIFICATION_SUBJECT); return data; } public EmailData userDetailsToEmailData(EmailRequest request) { EmailData data = new EmailData(); data.setUrl(Constants.SIGNUP_URL); data.setRecipient(request.getEmailId()); data.setSubject(Constants.INVITATION_SUBJECT); return data; } }
746caea7-7875-4289-81f8-440dc87e298b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-07 06:20:09", "repo_name": "jxday/JDKSourceCode1.8", "sub_path": "/jdkSourceTest/src/main/java/util/LinkedList.java", "file_name": "LinkedList.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "df665088fe2e70c15448528faa8c5b528d793e9b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jxday/JDKSourceCode1.8
232
FILENAME: LinkedList.java
0.250913
package util; import sun.misc.Unsafe; import sun.reflect.Reflection; import java.lang.reflect.Field; /** * 〈〉 * * @author cty * @ClassName LinkedList * @create 2020-01-10 16:19 * @Version 1.0.0 */ public class LinkedList implements List { private static Unsafe unsafe = reflectGetUnsafe(); private Integer length; private Integer next; public LinkedList() { this.length = 0; Node<Integer> node = new Node<Integer>(); } @Override public String toString() { return "LinkedList:" + "length=" + length + "{" + "}"; } private static Unsafe reflectGetUnsafe() { Unsafe unsafe = null; Field field = null; try { Class<?> callerClass = Reflection.getCallerClass(); field = Unsafe.class.getDeclaredField("theUnsafe"); field.setAccessible(true); unsafe = (Unsafe) field.get(null); } catch (Exception e) { e.printStackTrace(); } return unsafe; } }
c2b217bd-3250-4ab9-9c4e-bf3b43e3d582
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-23 01:22:25", "repo_name": "chavonac/UtilsTecWs", "sub_path": "/src/main/java/com/mx/msc/servicios/SalasDisponiblesService.java", "file_name": "SalasDisponiblesService.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "94c26ce39f9b7d091ade806fa28b52694e8318ee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/chavonac/UtilsTecWs
259
FILENAME: SalasDisponiblesService.java
0.262842
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mx.msc.servicios; import com.mx.msc.dao.SalasDisponiblesDao; import java.util.List; import javax.jws.WebService; import javax.jws.WebMethod; import javax.jws.WebParam; /** * * @author sergiov */ @WebService(serviceName = "SalasDisponiblesService") public class SalasDisponiblesService { private SalasDisponiblesDao dao; public SalasDisponiblesService() { dao = new SalasDisponiblesDao(); } /** * This is a sample web service operation */ @WebMethod(operationName = "consultaSalasDisponibles") public List<Object[]> consultaSalasDisponibles(@WebParam(name = "fechaPresentacion") String fechaPresentacion, @WebParam(name = "horaInicio") String horaInicio, @WebParam(name = "horaFin") String horaFin) throws Exception { return dao.getSalasDisponibles(fechaPresentacion, horaInicio, horaFin); } }
3ab9492b-e212-455d-b273-08293c4c42c5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-16 18:06:02", "repo_name": "hecun1993/shipdata", "sub_path": "/shipdata-security/src/main/java/me/hecun/shipdata/security/common/ResponseEnum.java", "file_name": "ResponseEnum.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "6f466666d8b6783f1d1e85b2c1a4017fea6f1599", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hecun1993/shipdata
274
FILENAME: ResponseEnum.java
0.252384
package me.hecun.shipdata.security.common; /** * * @author hecun * @date 2017/10/25 */ public enum ResponseEnum { SUCCESS(0, "success!"), PARAMETER_ERROR(11, "parameter error!"), ERROR(10, "error!"), DATA_FILE_ERROR(12, "data file error!"), BATCH_JOB_ERROR(13, "batch job error!"), UNAUTHORIZED(20, "unauthorized"), USER_NOT_EXIST(21, "user not exist!"), USER_NOT_LOGIN(22, "Please Sign In"), USER_CREATE_ERROR(23, "create user error!"), SHIP_NOT_EXIST(31, "Ship not exist!"), MONITORDATA_NOT_EXIST(41, "Monitor data not exist! Please confirm the search params!"), FMSDATA_NOT_EXIST(42, "FMS data not exist! Please confirm the username!") ; public int code; public String message; ResponseEnum(int code, String message) { this.code = code; this.message = message; } public int getCode() { return code; } public String getMessage() { return message; } }
3cd9ee12-cf7b-443d-b3f9-010315476635
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-28 17:15:43", "repo_name": "dx1MS/TaskTrackerCodeX", "sub_path": "/src/main/java/com/codex/busel/web/utils/PasswordHelper.java", "file_name": "PasswordHelper.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "2a14427934beac1e4e4903c7a8d5cae2881be39f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dx1MS/TaskTrackerCodeX
197
FILENAME: PasswordHelper.java
0.23231
package com.codex.busel.web.utils; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; import java.security.MessageDigest; @Service public class PasswordHelper implements PasswordEncoder{ private MessageDigest md; @Override public String encode(CharSequence rawPassword) { if (md == null) { return rawPassword.toString(); } md.update(rawPassword.toString().getBytes()); byte byteData[] = md.digest(); StringBuffer hexString = new StringBuffer(); for (int i = 0; i < byteData.length; i++){ String hex = Integer.toHexString(0xff & byteData[1]); if (hex.length() == 1) { hexString.append('0'); } hexString.append(hex); } return hexString.toString(); } @Override public boolean matches(CharSequence rawPassword, String encodedPassword) { return rawPassword.equals(encodedPassword); } }
312b69e0-a400-4a60-ad00-6f826e91d824
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-08 07:48:57", "repo_name": "AudricLarose/RealEstateManager", "sub_path": "/app/src/main/java/com/openclassrooms/realestatemanager/modele/NearbyEstate.java", "file_name": "NearbyEstate.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "225ebfb4257d2946118cf7ba6e1c82da16d202fc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AudricLarose/RealEstateManager
272
FILENAME: NearbyEstate.java
0.236516
package com.openclassrooms.realestatemanager.modele; import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.ForeignKey; import androidx.room.Ignore; import androidx.room.PrimaryKey; @Entity(tableName = "bddNearby", foreignKeys = @ForeignKey(entity = RealEstate.class, parentColumns = "id", childColumns = "idEstate",onDelete = ForeignKey.CASCADE)) public class NearbyEstate { @PrimaryKey(autoGenerate = true) private int id; @ColumnInfo(name = "idEstate") private int idEstate; private String nearby; public NearbyEstate() { } @Ignore public NearbyEstate(int idEstate, String nearby) { this.idEstate = idEstate; this.nearby = nearby; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getIdEstate() { return idEstate; } public void setIdEstate(int idEstate) { this.idEstate = idEstate; } public String getNearby() { return nearby; } public void setNearby(String nearby) { this.nearby = nearby; } }
8b479e05-bb46-4c39-a6f8-df2fdcd3512f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-01-10T12:11:21", "repo_name": "BMKEG/exp-parser", "sub_path": "/statement_classification/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1037, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "b23ea25231d99c6d748c25538ba7f544bb815666", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/BMKEG/exp-parser
242
FILENAME: README.md
0.259826
#Code for preparing data for statement classification, training the classifier and classifying new files ## Dependencies * Stanford Basic English POS Tagger: Download from http://nlp.stanford.edu/software/stanford-postagger-2015-04-20.zip and install * Stanford Parser: Download from http://nlp.stanford.edu/software/stanford-parser-full-2015-04-20.zip and install Change the locations in PATHS to the paths to the tagger and parser ## Training classifier * Input: Tab-separated file with label in the first column and clause in the second * Output: Cross-validation scores written to stderr and trained classifier saved to disk * Run: `python train_classifier.py <input-file>` ## Prediction * Input: Plain text file with one clause per line * Output: Tab separated file with input clause in the first column and predicted label in the second * Run: `python predict.py <input-file> <output-file>` Note: You can use `make_data.py` to separate passages into clauses: `python make_data.py <input-passages-file> <output-clauses-file>`
53e13328-b545-4d03-8083-114061329715
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-02-05 13:25:10", "repo_name": "lor1an/task4", "sub_path": "/src/java/ua/kpi/filters/Encoding.java", "file_name": "Encoding.java", "file_ext": "java", "file_size_in_byte": 1148, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "2676d3b617674413c65e6084ac4327260e74557b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lor1an/task4
216
FILENAME: Encoding.java
0.26588
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ua.kpi.filters; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; /** * This class is responsible for filtering the encoding. Default encoding should * be UTF-8 * * @author lor1an */ public class Encoding implements Filter { private String encoding; @Override public void init(FilterConfig filterConfig) throws ServletException { encoding = filterConfig.getInitParameter("requestEncoding"); if (encoding == null) { encoding = "UTF-8"; } } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding("UTF-8"); chain.doFilter(request, response); } @Override public void destroy() { } }
9889a8a4-86c6-45fc-a93d-952226af85f5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-17 14:33:54", "repo_name": "hehaihao/Test", "sub_path": "/project/wallet_module/src/main/java/com/xm6leefun/wallet_module/reset_psw/adapter/ResetPswViewPagerAdapter.java", "file_name": "ResetPswViewPagerAdapter.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "773ece6f4ae464e0fa0157fde15f7f93e1162444", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hehaihao/Test
235
FILENAME: ResetPswViewPagerAdapter.java
0.264358
package com.xm6leefun.wallet_module.reset_psw.adapter; import com.xm6leefun.wallet_module.reset_psw.ResetPswFragment; import java.util.List; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentPagerAdapter; /** * @Description: * @Author: hhh * @CreateDate: 2021/3/31 13:50 */ public class ResetPswViewPagerAdapter extends FragmentPagerAdapter { private String[] mTitles; private List<ResetPswFragment> fragments; public ResetPswViewPagerAdapter(FragmentManager fm, String[] mTitles, List<ResetPswFragment> fragments) { super(fm); this.mTitles = mTitles; this.fragments = fragments; } @Override public Fragment getItem(int position) { return fragments.get(position); } @Override public int getCount() { return mTitles.length; } //用来设置tab的标题 @Override public CharSequence getPageTitle(int position) { return mTitles[position]; } }
15bd7e5b-b5a4-44ad-aa02-5785f568d8bd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-03 12:08:11", "repo_name": "farshmaker/IssueTracker", "sub_path": "/src/main/java/by/epamlab/bugtracker/service/impl/ProjectServiceImpl.java", "file_name": "ProjectServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "09d9a5c8de4cad32b8cee4c25bd484d36000b2f7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/farshmaker/IssueTracker
195
FILENAME: ProjectServiceImpl.java
0.292595
package by.epamlab.bugtracker.service.impl; import by.epamlab.bugtracker.dao.intefaces.ProjectDAO; import by.epamlab.bugtracker.model.bean.Project; import by.epamlab.bugtracker.service.interfaces.ProjectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service @Transactional @SuppressWarnings("unchecked") public class ProjectServiceImpl implements ProjectService { @Autowired private ProjectDAO projectDAO; @Override public Project getProjectById(Integer id) { return projectDAO.getProjectById(id); } @Override public void addProject(Project project) { projectDAO.addProject(project); } @Override public void updateProject(Project project) { projectDAO.updateProject(project); } @Override public List<Project> listProject() { return projectDAO.listProject(); } }
a398402a-cd0a-4c1b-9de5-1d18875ae9df
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-22 13:09:26", "repo_name": "jackeybill/eShop", "sub_path": "/src/net/shopxx/FileInfo.java", "file_name": "FileInfo.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 67, "lang": "en", "doc_type": "code", "blob_id": "afeb6e9f61872e33c14c22d0d16e898e73cf0d1e", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jackeybill/eShop
297
FILENAME: FileInfo.java
0.292595
package net.shopxx; import java.util.Date; public class FileInfo { private String IIIllIlI; private String IIIllIll; private Boolean IIIlllII; private Long IIIlllIl; private Date IIIllllI; public String getName() { return this.IIIllIlI; } public void setName(String name) { this.IIIllIlI = name; } public String getUrl() { return this.IIIllIll; } public void setUrl(String url) { this.IIIllIll = url; } public Boolean getIsDirectory() { return this.IIIlllII; } public void setIsDirectory(Boolean isDirectory) { this.IIIlllII = isDirectory; } public Long getSize() { return this.IIIlllIl; } public void setSize(Long size) { this.IIIlllIl = size; } public Date getLastModified() { return this.IIIllllI; } public void setLastModified(Date lastModified) { this.IIIllllI = lastModified; } } /* Location: C:\jackey\software\jad\ * Qualified Name: net.shopxx.FileInfo * JD-Core Version: 0.6.2 */
750fdf7b-a93a-43b5-8928-0c7558e44fce
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-21 03:06:44", "repo_name": "hcfr1314/sleepworker", "sub_path": "/early_kks/kks/src/test/java/com/hhgs/kks/narikks/NaRiPageDataTest.java", "file_name": "NaRiPageDataTest.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "97f74372ca4d02b7f268691067f679f41141ecf5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hcfr1314/sleepworker
263
FILENAME: NaRiPageDataTest.java
0.264358
package com.hhgs.kks.narikks; import com.hhgs.kks.SpringbootKksApplication; import com.hhgs.kks.mapper.NaRiPageMapper; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.web.WebAppConfiguration; import java.util.List; import java.util.Map; import java.util.Set; @RunWith(SpringRunner.class) @SpringBootTest(classes = SpringbootKksApplication.class)//这里是启动类 @WebAppConfiguration public class NaRiPageDataTest { @Autowired private NaRiPageMapper naRiPageMapper; @Test public void testPageSelect() { List<Map<String, Object>> dataList = naRiPageMapper.getNaRiDataFromRownum(10000, 0, "黄河共和光伏电站"); for (Map<String, Object> stringObjectMap : dataList) { Set<String> keySet = stringObjectMap.keySet(); for (String s : keySet) { Object o = stringObjectMap.get(s); System.out.println(o+"===="+s); } } } }
aacc9661-e52b-4f3d-985e-8a09c64f16e2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-26 01:53:23", "repo_name": "canuonifeng/framework", "sub_path": "/src/main/java/com/codeages/framework/config/WebMvcConfig.java", "file_name": "WebMvcConfig.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "364d37256759c48381f4890a34a492c4eed23747", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/canuonifeng/framework
205
FILENAME: WebMvcConfig.java
0.253861
package com.codeages.framework.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import com.codeages.framework.interceptor.RateLimiterInterceptor; import com.codeages.framework.interceptor.TimeCostInterceptor; @Configuration @EnableWebMvc public class WebMvcConfig extends WebMvcConfigurerAdapter { @Autowired private RateLimiterInterceptor rateLimiter; @Autowired private TimeCostInterceptor timeCost; @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(timeCost).addPathPatterns("/**"); registry.addInterceptor(rateLimiter).addPathPatterns("/**"); } @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**"); } }
7a0ad6d0-08d5-449d-b981-9e2e42ca0f79
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-13 13:10:29", "repo_name": "FischerMatias/WeatherApp", "sub_path": "/WeatherREST/src/main/java/service/WeatherService.java", "file_name": "WeatherService.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "a64088bd7a6e3bff9782b5bad176d84c750dc3f5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/FischerMatias/WeatherApp
214
FILENAME: WeatherService.java
0.278257
package service; import com.github.fedy2.weather.YahooWeatherService; import com.github.fedy2.weather.data.Channel; import com.github.fedy2.weather.data.Condition; import com.github.fedy2.weather.data.unit.DegreeUnit; import javax.xml.bind.JAXBException; import java.io.IOException; /** * Created by Matias Fischer on 30/06/2017. */ public class WeatherService { private YahooWeatherService service; public YahooWeatherService getService() { return service; } public WeatherService(YahooWeatherService service) { this.service = service; } public WeatherService() throws JAXBException { service = new YahooWeatherService(); } public Condition GetCurrentWeatherForLocation(String location) throws JAXBException, IOException { YahooWeatherService.LimitDeclaration limit = service.getForecastForLocation(location, DegreeUnit.CELSIUS); Channel channel = limit.last(1).get(0); return channel .getItem() .getCondition(); } }
abcf6f9c-9afb-4d16-a3eb-116419d3ff29
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-03-16T14:43:16", "repo_name": "hollanderski/myselfisnotenough", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1122, "line_count": 14, "lang": "en", "doc_type": "text", "blob_id": "ca0c2d7e1c387c125114872a42b79f778669d6ad", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hollanderski/myselfisnotenough
254
FILENAME: README.md
0.283781
# My self is not enough Selected for the Jeune Création prize organized by Jennifer Flay (FIAC), Ninon Lizé Masclef in collaboration with Félix Ramon, conceived the installation « My self is not enough ». The digital device challenges visitors to play the game of love with their own reflection. The work is visible during exhibition « Roaming... » at Espace Niemeyer – Siège du parti communiste in Paris from September 5th to 22nd. The device includes a one-way mirror, screen, camera and a face tacking software. When the viewer approaches the mirror, a voice comes to meet them and offers to play a game. When the viewer tries to go away or stop focus his gaze, the machine begs them to stay by his side. Little by little, the viewer is pulled into an ambiguous monologue with the machine. Using the process of interpellation and apparatus, the installation is designed to lure the viewer into social interactions with the device, enticing them to study their own self-image and identity. website : https://wwwetu.utc.fr/~nlizemas/mirror.html exhibition : https://www.youtube.com/watch?v=65NT0Lr6OVs
a5b8967c-7229-4b9b-b987-f06969dfeac7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-03 12:54:45", "repo_name": "xiaotao1991/EMarket", "sub_path": "/EShop-sso-web/src/main/java/com/xiaotao/eshop/sso/web/controller/TokenController.java", "file_name": "TokenController.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "0c28d91fc28e11694ef4112aabe4911bc7fd7461", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/xiaotao1991/EMarket
233
FILENAME: TokenController.java
0.212069
package com.xiaotao.eshop.sso.web.controller; import com.xiaotao.common.utils.E3Result; import com.xiaotao.common.utils.JsonUtils; import com.xiaotao.eshop.sso.service.TokenService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; /** * Created by 13725 on 2018/4/11. */ @Controller public class TokenController { @Autowired private TokenService tokenService; @RequestMapping(value = "/user/token/{token}", produces = "application/json;charset=utf-8") @ResponseBody public String getUserByToken(@PathVariable String token, String callback) { if (StringUtils.isEmpty(callback)) { return JsonUtils.objectToJson(tokenService.getUserByToken(token)); } else { //解决跨域请求 return callback + "(" + JsonUtils.objectToJson(tokenService.getUserByToken(token)) + ")"; } } }
f4d51933-0417-4eaf-85ab-5a4d7c7ad85c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-06-14T21:31:25", "repo_name": "RedFalconKen/JustaLadder", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1146, "line_count": 11, "lang": "en", "doc_type": "text", "blob_id": "515b4141d9f3c565f13f85cdb70eb7ac41ed3449", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/RedFalconKen/JustaLadder
267
FILENAME: README.md
0.228156
# JustaLadder This is literally just a ladder for using in DayZ. Ever need a climbable ladder on your DayZ server? Well I did and was disappointed to find that the ladders from BuilderItems or the base game were decorative and weren't climbable. I was working on putting an oil rig (that had been painstakingly built by another modder in DayZ Editor) on one of my servers. I was saddened to discover that the ladders didn't work, so you couldn't actually climb between levels. When I started looking for a functional ladder but couldn't find one, I went to the BI examples and found that they had some models. I fished one out, modified it slightly to meet my needs, and packed it up. I thought there might be folks that find themselves in a similar situation, so here you go. Originally sourced from: https://github.com/BohemiaInteractive/DayZ-Samples/tree/master/Test_Ladders Feel free to change, modify, fold, spindle, and/or mutilate however you see fit. This mod is free for all to use and enjoy. Repacking of this mod is allowed. For information on this and other mods that I've created, join my Discord https://discord.gg/U6jHPg3Q3u
a3e6ec2c-33fc-4b8c-a30f-2f72b84cec38
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-02 04:32:37", "repo_name": "8tuv/mabi", "sub_path": "/app/src/main/java/com/ying/qixu/MyApplication.java", "file_name": "MyApplication.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "a88cae26063a305344484750470eb11e14d51c97", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/8tuv/mabi
261
FILENAME: MyApplication.java
0.249447
package com.ying.qixu; import android.Manifest; import android.app.Application; import android.os.Build; import android.support.v4.app.ActivityCompat; import android.util.Log; import com.alibaba.baichuan.android.trade.AlibcTradeSDK; import com.alibaba.baichuan.android.trade.callback.AlibcTradeInitCallback; import com.umeng.analytics.MobclickAgent; import com.umeng.commonsdk.UMConfigure; public class MyApplication extends Application { public static MyApplication application = null; @Override public void onCreate() { super.onCreate(); //友盟 UMConfigure.init(this,UMConfigure.DEVICE_TYPE_PHONE,"5c77c98c61f564b0b300093a"); MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO); application = this; //电商SDK初始化 AlibcTradeSDK.asyncInit(this, new AlibcTradeInitCallback() { @Override public void onSuccess() { } @Override public void onFailure(int code, String msg) { Log.e("bai","初始化失败,错误码=" + code + " / 错误消息=" + msg); } }); }}
bc688da0-8924-4fa1-97e8-057000779a4b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-01 18:24:01", "repo_name": "AJAkil/NW_lab_practice", "sub_path": "/src/Sender_receiver_new/Sender.java", "file_name": "Sender.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "6f56e56cafa39285879c9b00d860f8152d140d8e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AJAkil/NW_lab_practice
173
FILENAME: Sender.java
0.280616
package Sender_receiver_new; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.Socket; import java.util.Scanner; public class Sender { public static void main(String[] args) throws IOException, ClassNotFoundException { Socket socket = new Socket("localhost",6666); ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream()); ObjectInputStream in = new ObjectInputStream(socket.getInputStream()); out.writeObject("Sender connecting to the server"); while (true){ System.out.println("Waiting for confirmation: "); String message = (String)in.readObject(); System.out.println(message); System.out.println("Confirmed from the server"); System.out.println("writing to the receiver"); out.writeObject(new Scanner(System.in).nextLine()); System.out.println("message sent to the receiver"); } } }
18b0e16c-1cc4-4c86-9036-7961bebb1b16
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-24 02:15:56", "repo_name": "XSation/BJQQYKNetWork", "sub_path": "/v1/src/main/java/com/example/v1/xklibrary/activity/BaseActivity.java", "file_name": "BaseActivity.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "3512cde791819ba6b99bd406b659c734442c085b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/XSation/BJQQYKNetWork
215
FILENAME: BaseActivity.java
0.259826
package com.example.v1.xklibrary.activity; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.ProgressDialog; import android.os.Bundle; import android.support.annotation.Nullable; import com.example.v1.xklibrary.MyCallback; import com.example.v1.xklibrary.net.Network; /** * Created by xuekai on 2017/6/16. */ public class BaseActivity extends Activity { private Dialog dialog; public ProgressDialog pd; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); pd=new ProgressDialog(this); } abstract class FailedDialogCallback implements MyCallback { @Override public void onFail(String errorMessage) { if (dialog == null) { dialog = new AlertDialog.Builder(BaseActivity.this) .create(); } dialog.setTitle(errorMessage); dialog.show(); } } @Override protected void onDestroy() { super.onDestroy(); Network.getInstance().cancleAllRequest(); } }
14012f7e-a213-4b0e-89c5-249cce1aa064
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-17 15:12:55", "repo_name": "abdasik25/OneMusic", "sub_path": "/src/by/epam/onemusic/entity/Author.java", "file_name": "Author.java", "file_ext": "java", "file_size_in_byte": 1234, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "4148e6ec05b8e551fe17eba5fdb4a544b874e721", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/abdasik25/OneMusic
270
FILENAME: Author.java
0.273574
/** * Created by Alexander Lomat on 13.05.19 * version 0.0.1 */ package by.epam.onemusic.entity; import java.util.Objects; public class Author extends Entity { private String name; private String country; public Author(){ } public Author(long id, String name, String country) { super(id); this.name = name; this.country = country; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Author)) return false; Author author = (Author) o; return name.equals(author.name) && Objects.equals(country, author.country); } @Override public int hashCode() { return Objects.hash(name, country); } @Override public String toString() { return "Author{" + "name='" + name + '\'' + ", country='" + country + '\'' + '}'; } }
d326d97a-949a-487c-9bdb-69c03248e8d6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-04 18:14:35", "repo_name": "hadouken89/Tinder_clone", "sub_path": "/app/src/main/java/com/jonas/tinderclone/adapters/CardAdapter.java", "file_name": "CardAdapter.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "93c7b5c97aa22a3e434a35d8a86633c29e4f4b5d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hadouken89/Tinder_clone
203
FILENAME: CardAdapter.java
0.247987
package com.jonas.tinderclone.adapters; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; import com.jonas.tinderclone.R; import com.jonas.tinderclone.models.CardItem; import java.util.List; public class CardAdapter extends ArrayAdapter { public CardAdapter( Context context, int resource, List objects) { super(context, resource, objects); } public View getView(int position, View view, ViewGroup parent) { CardItem cardItem = (CardItem) getItem(position); if (view == null) { view = LayoutInflater.from(getContext()).inflate(R.layout.item, parent, false); } TextView tvName = view.findViewById(R.id.tvName); ImageView imageCard = view.findViewById(R.id.imageCard); tvName.setText(cardItem.getName()); imageCard.setImageResource(R.mipmap.ic_launcher); return view; } }
5a65a47d-6c65-45a6-a2ef-4b68e592beae
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-30 12:29:47", "repo_name": "gtu001/gtu-test-code", "sub_path": "/GTU/src/gtu/charset/CustomCharsetProvider.java", "file_name": "CustomCharsetProvider.java", "file_ext": "java", "file_size_in_byte": 1248, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "3c99931235d76899fe7ff27753e91e10b8d418e7", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/gtu001/gtu-test-code
276
FILENAME: CustomCharsetProvider.java
0.284576
package gtu.charset; import java.nio.charset.Charset; import java.nio.charset.spi.CharsetProvider; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * 將此package包成檔案 CP937_FUCO.jar * 放到 C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\CP937_FUCO.jar * * Example : new String(bytearry, "CP937-FUCO") */ public class CustomCharsetProvider extends CharsetProvider { public CustomCharsetProvider() { } private List<Charset> charsets = new ArrayList<Charset>(); @Override public Iterator<Charset> charsets() { return charsets.iterator(); } @Override public Charset charsetForName(String charsetName) { charsetName = charsetName.toUpperCase(); for (Iterator<Charset> iter = charsets.iterator(); iter.hasNext();) { Charset charset = iter.next(); if (charset.name().equals(charsetName)) return charset; } for (Iterator<Charset> iter = charsets.iterator(); iter.hasNext();) { Charset charset = iter.next(); if (charset.aliases().contains(charsetName)) return charset; } return null; } }
91beea5a-c619-4c40-b080-605cbbd8b45b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-30 06:59:55", "repo_name": "studyforgitzxl/nettyserver", "sub_path": "/nettystudy/src/main/java/zxl/netty/command/consolecommand/SendToUserConsoleCommand.java", "file_name": "SendToUserConsoleCommand.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "558d0e0fa0fb0d1807deafb85f5c2dd855fd22da", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/studyforgitzxl/nettyserver
214
FILENAME: SendToUserConsoleCommand.java
0.274351
package zxl.netty.command.consolecommand; import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; import zxl.netty.command.ConsoleCommand; import zxl.netty.packet.codec.PacketCodec; import zxl.netty.packet.request.MessageRequestPacket; import java.util.Scanner; public class SendToUserConsoleCommand implements ConsoleCommand { public void exec(Scanner scanner, Channel channel) { System.out.println("请输入消息和userId:"); String line=scanner.next(); //消息格式 userId,消息 String[] marr=line.split(","); if(marr.length!=2){ System.out.println("消息格式错误,正确格式:【userId,消息】"); }else{ //封装发送消息 String userId=marr[0].trim(); String message=marr[1].trim(); MessageRequestPacket messageRequestPacket=new MessageRequestPacket(message,userId); ByteBuf requestBuffer= PacketCodec.INSTANCE.encode(channel.alloc().ioBuffer(),messageRequestPacket); channel.writeAndFlush(requestBuffer); } } }
87870846-cc8b-479b-936c-07d66cc86e9a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-12 19:10:40", "repo_name": "rogeriosilva-ifpi/android-teaching-projects", "sub_path": "/AppLesson2/app/src/main/java/com/example/rogermac/applesson2/Tela1DebugLogActivity.java", "file_name": "Tela1DebugLogActivity.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "ec681dd0da663861bf1619c20f2fb935678be123", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rogeriosilva-ifpi/android-teaching-projects
236
FILENAME: Tela1DebugLogActivity.java
0.259826
package com.example.rogermac.applesson2; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.EditText; import butterknife.BindView; import butterknife.ButterKnife; public class Tela1DebugLogActivity extends AppCompatActivity { public static final String TAG = "Screen1"; public static final String ENCOMENDA = "packet"; @BindView(R.id.edit_nome) protected EditText editNome; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tela1_debug_log); ButterKnife.bind(this); Log.d(TAG, "Tela Criada"); Log.i(TAG, "Tudo Ok"); Log.e(TAG, "VEix deu errado"); // editNome = findViewById(R.id.edit_nome); } public void prosseguir(View view) { String nome = editNome.getText().toString(); Intent intent = new Intent(this, Tela2DebugLogActivity.class); intent.putExtra(ENCOMENDA, nome); startActivity(intent); } }
29e20d6a-1dcd-41c1-ba11-a806c5f9e4ef
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-24 22:44:08", "repo_name": "MaximCeban/test_project", "sub_path": "/app/src/main/java/com/example/ceban/maxim/mvprx/rest/RestClient.java", "file_name": "RestClient.java", "file_ext": "java", "file_size_in_byte": 1039, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "76482feb3330ce22fa6c52280b4957a2a191ba6a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MaximCeban/test_project
195
FILENAME: RestClient.java
0.243642
package com.example.ceban.maxim.mvprx.rest; import android.support.annotation.NonNull; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Retrofit; import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; public class RestClient { public NewsAPI getNewsSources() { return createAPIClent().create(NewsAPI.class); } Retrofit createAPIClent() { return new Retrofit.Builder() .baseUrl("https://newsapi.org/v1/") .client(getClient()) .addConverterFactory(GsonConverterFactory.create()) .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .build(); } @NonNull private OkHttpClient getClient() { HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); logging.setLevel(HttpLoggingInterceptor.Level.BODY); return new OkHttpClient().newBuilder().addInterceptor(logging).build(); } }
45be32b7-2e1a-4cf5-90ad-23823df0918c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-07 09:38:31", "repo_name": "chaolemen-github/Ergedd", "sub_path": "/app/src/main/java/com/chaolemen/ergedd/look/presenter/TabPresenter.java", "file_name": "TabPresenter.java", "file_ext": "java", "file_size_in_byte": 1069, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "0611e6b7cc0866e4a4e480ff6c6e7a9b4ca0198d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/chaolemen-github/Ergedd
256
FILENAME: TabPresenter.java
0.282988
package com.chaolemen.ergedd.look.presenter; import com.chaolemen.ergedd.look.bean.TabBean; import com.chaolemen.ergedd.look.contract.TabContract; import com.chaolemen.ergedd.look.model.TabModel; import com.chaolemen.ergedd.look.parmasen.TabParameter; import com.chaolemen.mvplibrary.model.ModelFractory; import com.chaolemen.mvplibrary.presenter.BasePresenter; import java.util.List; public class TabPresenter extends BasePresenter<TabContract.View> implements TabContract.Presenter { @Override public void getDataLook(TabParameter tabParameter) { //创建model的对象 TabModel tabModel = ModelFractory.createModel(TabModel.class); //调用model的方法 tabModel.getDataLook(tabParameter, this, getLifecycle()); } @Override public void onSuccessLook(List<TabBean> tabBeans) { mView.onSuccessLook(tabBeans); } @Override public void onFailLook(String error, int code) { mView.onFail(error + code); } @Override public void onCancel() { mView.onCancel(); } }
e3f5be44-5be2-453a-91c4-e379bc85a34b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-07 13:17:08", "repo_name": "fabianlupa/geometri", "sub_path": "/src/main/java/com/flaiker/geometri/blocks/TestBlock.java", "file_name": "TestBlock.java", "file_ext": "java", "file_size_in_byte": 657, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "cd15f7d83e75217a62fbfa8cbf13a587c9ada167", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fabianlupa/geometri
191
FILENAME: TestBlock.java
0.264358
/****************************************************************************** * Copyright (c) 2015 Fabian Lupa * * This software is licensed under the MIT License (MIT). * ******************************************************************************/ package com.flaiker.geometri.blocks; import com.flaiker.geometri.Geometri; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; /** * Created by Flaiker on 15.10.2014. */ public class TestBlock extends Block { public static final String NAME = "testBlock"; public TestBlock() { super(Material.rock); setCreativeTab(CreativeTabs.tabBlock); setBlockName(Geometri.MODID + "_" + NAME); setBlockTextureName(Geometri.MODID + ":" + NAME); GameRegistry.registerBlock(this, NAME); } }
f972ef42-2c28-477f-b405-63ca482611f8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-29 07:11:26", "repo_name": "liuyanjun528/SpringCloud", "sub_path": "/my-spring-feign/src/main/java/com/example/demo/contorlle/HiControlle.java", "file_name": "HiControlle.java", "file_ext": "java", "file_size_in_byte": 1144, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "fe693e441daebb9c2f1b94ee79e64f0c29f60b78", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/liuyanjun528/SpringCloud
230
FILENAME: HiControlle.java
0.226784
package com.example.demo.contorlle; import javax.sound.sampled.Port; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.example.demo.enty.Stu; import com.example.demo.interfacefeing.FeingInterface; import com.example.demo.interfacefeing.Test1; import com.example.demo.mapper.StuMapper; import com.example.demo.service.StuService; import io.swagger.annotations.ApiOperation; @RestController // @RequestMapping("/api") public class HiControlle { @Value("${server.port}") String Port; @Autowired StuService stuService; @Autowired private Test1 test1; @GetMapping("/sayHi") public String sayHi() { return stuService.insertStu(); } @GetMapping("/feignTest1") @ApiOperation("feignSwagger") public String feignTest1() { return "我是端口是:"+Port+"调用data项目test1方法:"+test1.test1(); } }
47354ea1-9a92-40f6-9985-b49dfca71fd3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-12 21:18:05", "repo_name": "Vladzensan/equeue-webserver-app", "sub_path": "/src/main/java/by/equeue/webserverapp/model/users/UserQueueKey.java", "file_name": "UserQueueKey.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "8539e357dca0aceb337d9a5d3a388ce2e4015fa2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Vladzensan/equeue-webserver-app
261
FILENAME: UserQueueKey.java
0.290176
package by.equeue.webserverapp.model.users; import javax.persistence.Column; import javax.persistence.Embeddable; import java.io.Serializable; import java.util.Objects; @Embeddable public class UserQueueKey implements Serializable { @Column(name = "user_id") Long userId; @Column(name = "queue_id") Long queueId; public UserQueueKey(Long userId, Long queueId) { this.userId = userId; this.queueId = queueId; } public UserQueueKey() { } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof UserQueueKey)) return false; UserQueueKey that = (UserQueueKey) o; return userId == that.userId && queueId == that.queueId; } @Override public int hashCode() { return Objects.hash(userId, queueId); } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public Long getQueueId() { return queueId; } public void setQueueId(Long queueId) { this.queueId = queueId; } }
7a6dc51a-f498-47f5-98ca-214d6302346e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-21 02:48:16", "repo_name": "BMariscal/fire_tv_for_reddit", "sub_path": "/app/src/test/java/seveida/firetvforreddit/SubredditRepoTest.java", "file_name": "SubredditRepoTest.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "061a09983f1c3dc363e770ca5d447faa83655bd6", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/BMariscal/fire_tv_for_reddit
199
FILENAME: SubredditRepoTest.java
0.20947
package seveida.firetvforreddit; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; import io.reactivex.functions.Consumer; import retrofit2.Retrofit; import seveida.firetvforreddit.domain.objects.SubredditDetails; import seveida.firetvforreddit.domain.objects.ThreadMetadata; import seveida.firetvforreddit.response.objects.SubredditResponse; import static org.junit.Assert.*; @RunWith(RobolectricTestRunner.class) public class SubredditRepoTest { @Test public void t() { Retrofit retrofit = RetrofitProvider.create(); SubredditRepo repo = new SubredditRepo(retrofit); repo.getSubreddit("boobs") .subscribe(subreddit -> { subreddit.threadMetadataList.forEach(thread -> { System.out.println(thread.title); }); }); try { Thread.sleep(10_000); } catch (Exception e) { } } }
737d91e3-8510-40aa-b169-0684d83f7379
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-21 23:34:14", "repo_name": "qiuchili/ggnn_graph_classification", "sub_path": "/program_data/JavaProgramData/19/1655.java", "file_name": "1655.java", "file_ext": "java", "file_size_in_byte": 1062, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "039468a42d5a71cbe49d4bf77448cdec961a1bdc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/qiuchili/ggnn_graph_classification
378
FILENAME: 1655.java
0.255344
import java.util.*; package <missing>; public class GlobalMembers { public static int Main() { String s = new String(new char[201]); String a = new String(new char[101]); String b = new String(new char[101]); int S; int A; int i; int j; int k = 0; int m = 0; s = new Scanner(System.in).nextLine(); S = s.length(); a = new Scanner(System.in).nextLine(); A = a.length(); b = new Scanner(System.in).nextLine(); while (s.charAt(k) != a.charAt(0)) { System.out.print(s.charAt(k)); k++; } for (i = k;i < S;i++) { if (s.charAt(i) == a.charAt(0)) { for (j = i;j < A + i;j++) { if (s.charAt(j) == a.charAt(j - i)) { m++; } } if ((i == 0) && (m == A)) { System.out.print(b); i = i + A - 1; } else if ((m == A) && (i != 0) && (s.charAt(i - 1) == 32)) { System.out.print(b); i = i + A - 1; } else { System.out.print(s.charAt(i)); } m = 0; } else { System.out.print(s.charAt(i)); } } return 0; } }
95add1c6-75ee-43d0-9f08-025303a1f257
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-12 20:20:07", "repo_name": "LluisAguilar/Kinedu_test", "sub_path": "/app/src/main/java/com/luis/test/kinedu/POJO/Meta.java", "file_name": "Meta.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "e32cb7739df78827b1d69807497b977ae7b448bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LluisAguilar/Kinedu_test
217
FILENAME: Meta.java
0.212069
package com.luis.test.kinedu.POJO; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Meta { @SerializedName("page") @Expose private Integer page; @SerializedName("per_page") @Expose private Integer perPage; @SerializedName("total_pages") @Expose private Integer totalPages; @SerializedName("total") @Expose private Integer total; public Integer getPage() { return page; } public void setPage(Integer page) { this.page = page; } public Integer getPerPage() { return perPage; } public void setPerPage(Integer perPage) { this.perPage = perPage; } public Integer getTotalPages() { return totalPages; } public void setTotalPages(Integer totalPages) { this.totalPages = totalPages; } public Integer getTotal() { return total; } public void setTotal(Integer total) { this.total = total; } }
629d2c26-2201-47a8-a647-4f4cda1a662f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-06 05:41:32", "repo_name": "abusayedruetcse/Miwok", "sub_path": "/app/src/main/java/com/ecxample/android/miwok/Word.java", "file_name": "Word.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "c5f38d1ef5aa46617f77af0388707e70a34390f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/abusayedruetcse/Miwok
263
FILENAME: Word.java
0.268941
package com.ecxample.android.miwok; public class Word { private String english; private String bangla; private int imageId=NO_IMAGE_PROVIDED; //private boolean isPhrases; private static final int NO_IMAGE_PROVIDED = -1; private int audioId; public Word(String s1,String s2,int id,int audio) { bangla=s1; english=s2; imageId=id; audioId=audio; // isPhrases=false; } public Word(String s1,String s2,int audio) { bangla=s1; english=s2; audioId=audio; } /* public Word(String s1,String s2) { bangla=s1; english=s2; // isPhrases=true; } */ public String getDefaultTranslation() { return english; } public String getBanglaTranslation() { return bangla; } public int getImageId() { return imageId; } public boolean hasImage() { return imageId!=NO_IMAGE_PROVIDED; } public int getAudioId() { return audioId; } }
d29ba235-2cfb-468a-9929-03b142ba91d6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-08 05:39:59", "repo_name": "iboomboom/MJNPullToRefresh", "sub_path": "/app/src/main/java/com/meiyouwifi/mjnpulltorefresh/view/NormalRefreshViewManager.java", "file_name": "NormalRefreshViewManager.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "94fd800b0c273ebbf2551aa485966d188ae88b18", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/iboomboom/MJNPullToRefresh
247
FILENAME: NormalRefreshViewManager.java
0.243642
package com.meiyouwifi.mjnpulltorefresh.view; import android.content.Context; import android.view.MotionEvent; import android.view.View; import android.widget.TextView; import com.meiyouwifi.mjnpulltorefresh.R; /** * Created by hiviiup on 2017/1/12. * 加载样式管理器 */ public class NormalRefreshViewManager extends BaseRefreshViewManager { private TextView tv; public NormalRefreshViewManager(Context context) { super(context); } @Override protected int getRefreshViewLayout() { return R.layout.refresh_view_normal; } @Override public void findChildView(View view) { if (tv == null) tv = (TextView) view.findViewById(R.id.tv); } public void changeToRefreshing() { tv.setText("正在刷新"); } public void changeToPullOnly() { tv.setText("下拉刷新"); } @Override public void changeToPullMore(float percent) { } public void changeToRelease() { tv.setText("释放刷新"); } }
c028cedb-a3bb-4c28-ae34-1cb29437c076
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-19 10:21:29", "repo_name": "ThornJuice/LearnAndroid", "sub_path": "/app/src/main/java/com/ju/learnandroid/lifecycle/LifeCycleDemoActivity.java", "file_name": "LifeCycleDemoActivity.java", "file_ext": "java", "file_size_in_byte": 1146, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "eb0868bde6ed040ed40c0a8a668ebf75cacae726", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ThornJuice/LearnAndroid
206
FILENAME: LifeCycleDemoActivity.java
0.286968
package com.ju.learnandroid.lifecycle; import androidx.appcompat.app.AppCompatActivity; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LifecycleObserver; import androidx.lifecycle.OnLifecycleEvent; import android.os.Bundle; import android.util.Log; import com.ju.learnandroid.R; public class LifeCycleDemoActivity extends AppCompatActivity { private static final String TAG = "LifeCycleDemoActivity"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_life_cycle_demo); getLifecycle().addObserver(new MyObserver()); } public class MyObserver implements LifecycleObserver { @OnLifecycleEvent(Lifecycle.Event.ON_RESUME) void onResume(){ Log.d(TAG, "Lifecycle call onResume"); } @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE) void onPause(){ Log.d(TAG, "Lifecycle call onPause"); } @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) void onDestroy(){ Log.d(TAG, "Lifecycle call onDestroy"); } } }
04f85215-2836-47b0-8124-3f95f358e090
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-24 13:48:25", "repo_name": "TonySamara/CPWeb", "sub_path": "/WebProject/src/main/java/com/dao/HibernateUtil.java", "file_name": "HibernateUtil.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "910092e1e43369abcfb7b5dd55a152a059ac459e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/TonySamara/CPWeb
188
FILENAME: HibernateUtil.java
0.268941
package com.dao; import com.models.Biography; import com.models.Player; import com.models.Position; import com.models.Statistics; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; /** * Created by ANTON on 05.03.2016. */ public class HibernateUtil { private static final SessionFactory sessionFactory; static { try { sessionFactory = new Configuration() .configure() .setProperty("hibernate.show_sql", "true") .addAnnotatedClass(Player.class) .addAnnotatedClass(Statistics.class) .addAnnotatedClass(Biography.class) .addAnnotatedClass(Position.class) .buildSessionFactory(); ; } catch (Throwable ex) { ex.printStackTrace(); throw new ExceptionInInitializerError(ex); } } public static SessionFactory getSessionFactory() { return sessionFactory; } }
4af8371f-ee11-4ada-8765-065821822dfa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-23 10:05:27", "repo_name": "Maves1/TheBanyaSimulatorLGDX", "sub_path": "/core/src/ru/mavesoft/thebanyasim/Cloud.java", "file_name": "Cloud.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "b4f03a9b4ef0304636583fb68dae20cb1baabe62", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Maves1/TheBanyaSimulatorLGDX
234
FILENAME: Cloud.java
0.286169
package ru.mavesoft.thebanyasim; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.math.MathUtils; public class Cloud { public float x; public float y; private short direction; private float speed = 6.0f; private int width = 200; private int height = 150; private Texture texture; public Cloud (short direction, float screenWidth, float screenHeight, AssetManager assetManager) { this.direction = direction; this.y = screenHeight - height - MathUtils.random(height); texture = assetManager.get(Assets.clouds[MathUtils.random(0, 3)]); if (direction == 0) { x = screenWidth; } else if (direction == 1) { x = 0 - width; } } public float getSpeed() { return speed; } public int getWidth() { return width; } public int getHeight() { return height; } public Texture getTexture() { return texture; } }
ccdb5642-959d-42ca-ba82-1d2b024d1246
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-27 14:47:41", "repo_name": "olebas13/AndroidLessons2", "sub_path": "/p1061fragmentactivity/src/main/java/com/olebas/p1061fragmentactivity/Fragment1.java", "file_name": "Fragment1.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "618063c45a4f99b1cbfb295d2515879d39b17942", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/olebas13/AndroidLessons2
189
FILENAME: Fragment1.java
0.240775
package com.olebas.p1061fragmentactivity; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import static android.view.View.*; public class Fragment1 extends Fragment { final String LOG_TAG = "myLogs"; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment1, null); Button button = (Button) v.findViewById(R.id.button); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { ((Button) getActivity().findViewById(R.id.btnFind)).setText("Access from Fragment1"); } }); return v; } }
66ba2b65-968b-477f-8ea7-a8db418e3803
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-06 20:27:24", "repo_name": "ireneroy2797/SeleniumHabileTechnologiesCode", "sub_path": "/src/main/java/pages/ClientActivationPage.java", "file_name": "ClientActivationPage.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "cf2ff7daed37535b43b37b006cbc47569c35056d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ireneroy2797/SeleniumHabileTechnologiesCode
212
FILENAME: ClientActivationPage.java
0.236516
package pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class ClientActivationPage { WebDriver driver; public ClientActivationPage(WebDriver driver) { this.driver=driver; PageFactory.initElements(this.driver,this); } @FindBy(css="[class='client-title'] strong") public WebElement FirstNameLabel; @FindBy(css="[class='client-title'] small") public WebElement ClientIDLabel; @FindBy(css="[href*='activate']") public WebElement activateButton; @FindBy(css="[ng-hide='getEnabledSteps().length > 1']") public WebElement activatePageLabel; @FindBy(name="clientactionform") public WebElement clientactionform; @FindBy(id="activationDate") public WebElement activationDateButton; @FindBy(xpath="(//a[@ng-click='select(todayDate.date)'])[2]") public WebElement activationDate; @FindBy(css="i[uib-tooltip='Active']") public WebElement clientIDactive; }
57c7b02d-01ff-405f-99f2-da5d1b37888c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-06 08:16:03", "repo_name": "Prashant-Pandey/Tutorial-Java", "sub_path": "/SplashDemo/src/com/example/splashdemo/SplashScreen.java", "file_name": "SplashScreen.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "d498f95a100650e76d8c8490f72d11ca515a954b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Prashant-Pandey/Tutorial-Java
219
FILENAME: SplashScreen.java
0.293404
package com.example.splashdemo; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.Window; public class SplashScreen extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE);//To make title of a layout vanish //MUST BE CALLED BEFORE LAYOUT setContentView(R.layout.activity_splash_screen); Thread th=new Thread(){ public void run(){ try{ sleep(3000); }catch(Exception e){ } finally{ Intent i= new Intent(SplashScreen.this,Splash.class); finish(); startActivity(i); } } }; th.start(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_splash_screen, menu); return true; } }
7279e0e1-607f-46ab-aeb0-0afa51cf9ced
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-17 02:26:01", "repo_name": "cheloide/telegram-bot-api", "sub_path": "/common/src/main/java/com/github/cheloide/telegrambotapi/model/common/Location.java", "file_name": "Location.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "206b82f5932cb4bbfec748005b1bc6a0c23772ef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cheloide/telegram-bot-api
236
FILENAME: Location.java
0.246533
package com.github.cheloide.telegrambotapi.model.common; import com.fasterxml.jackson.annotation.JsonProperty; /** * This object represents a point on the map. * * @author Marcelo González * * @see <a href="https://core.telegram.org/bots/api#location">https://core.telegram.org/bots/api#location</a> * */ public class Location { /** * Longitude as defined by sender */ @JsonProperty("longitude") private Float longitude; /** * Latitude as defined by sender */ @JsonProperty("latitude") private Float latitude; /** * @return the latitude */ public Float getLatitude() { return latitude; } /** * @return the longitude */ public Float getLongitude() { return longitude; } /** * @param latitude the latitude to set */ public void setLatitude(Float latitude) { this.latitude = latitude; } /** * @param longitude the longitude to set */ public void setLongitude(Float longitude) { this.longitude = longitude; } }
5ea87353-b3db-4a44-91c1-eadcde5837f7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-24 12:09:18", "repo_name": "ryhonour/community", "sub_path": "/src/test/java/com/ry/community/CommunityApplicationTests.java", "file_name": "CommunityApplicationTests.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "2c8c53dbaf72fb583c6d829773f8dedda2903d9f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ryhonour/community
206
FILENAME: CommunityApplicationTests.java
0.259826
package com.ry.community; import com.ry.community.mapper.QuestionMaperCustom; import com.ry.community.model.Question; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.util.List; @RunWith(SpringRunner.class) @SpringBootTest public class CommunityApplicationTests { @Autowired QuestionMaperCustom questionMaperCustom; @Test public void contextLoads() { Question question = new Question(); question.setId(18L); question.setTags("Spring Boot|Spring|java"); List<Question> question1 = questionMaperCustom.selectQuestionListByTagsWithRegexp(question); for (Question question2 : question1) { System.out.println(question2.getId() + " - " + question2.getTitle() + " - " + question2.getTags() + " - " + question2.getDescription()); } } }
3fddffe9-28bd-446d-b0f0-e0ef131575a1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-27 06:53:29", "repo_name": "GGtray/FlagCampAndroid", "sub_path": "/app/src/main/java/com/example/flagcamp/Splash/SplashActivity.java", "file_name": "SplashActivity.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "8b3201d3462cad979787cf9680b5941e2e3840a9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/GGtray/FlagCampAndroid
179
FILENAME: SplashActivity.java
0.210766
package com.example.flagcamp.Splash; import android.content.Intent; import android.os.Bundle; import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import com.example.flagcamp.Discover.DiscoverActivity; import com.example.flagcamp.Home.HomeActivity; import com.example.flagcamp.R; import com.google.firebase.auth.FirebaseAuth; public class SplashActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { setTheme(R.style.AppTheme); super.onCreate(savedInstanceState); FirebaseAuth firebaseAuth = FirebaseAuth .getInstance(); if (firebaseAuth.getCurrentUser() == null) { Intent intent = new Intent(SplashActivity.this, HomeActivity.class); startActivity(intent); } else { Intent intent = new Intent(SplashActivity.this, DiscoverActivity.class); startActivity(intent); } finish(); } }
4ea28937-cdff-46ec-a013-4b944fd8a7e1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-26 11:09:19", "repo_name": "galasam/GalaBank", "sub_path": "/TradeEngine/src/main/java/com/gala/sam/tradeengine/utils/orderprocessors/OrderProcessorFactory.java", "file_name": "OrderProcessorFactory.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "a07265d8733154470fbe8ad5a302337bbc39053e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/galasam/GalaBank
210
FILENAME: OrderProcessorFactory.java
0.282196
package com.gala.sam.tradeengine.utils.orderprocessors; import com.gala.sam.orderrequestlibrary.orderrequest.AbstractOrderRequest.OrderType; import com.gala.sam.tradeengine.utils.exception.OrderTypeNotSupportedException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @Slf4j @Component @RequiredArgsConstructor public class OrderProcessorFactory { private final StopOrderProcessor stopOrderProcessor; private final ActiveLimitOrderProcessor activeLimitOrderProcessor; private final ActiveMarketOrderProcessor activeMarketOrderProcessor; public AbstractOrderProcessor getOrderProcessor(OrderType type) throws OrderTypeNotSupportedException { switch (type) { case STOP_LIMIT: case STOP_MARKET: return stopOrderProcessor; case ACTIVE_LIMIT: return activeLimitOrderProcessor; case ACTIVE_MARKET: return activeMarketOrderProcessor; default: log.error("Order type {} is not supported so cannot create order processor", type); throw new OrderTypeNotSupportedException(type); } } }
e3fded5e-be18-4759-a6f2-3258a806b4e8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-18 02:17:49", "repo_name": "gocd/gocd", "sub_path": "/common/src/test/java/com/thoughtworks/go/helper/UsersMother.java", "file_name": "UsersMother.java", "file_ext": "java", "file_size_in_byte": 429, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "e967a544ee8e81380d473e9ef64b3148500d3a6c", "star_events_count": 6443, "fork_events_count": 1074, "src_encoding": "UTF-8"}
https://github.com/gocd/gocd
221
FILENAME: UsersMother.java
0.225417
/* * Copyright 2023 Thoughtworks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.thoughtworks.go.helper; import com.thoughtworks.go.domain.User; public class UsersMother { public static User withName(String username) { User user = new User(username); user.setEmail(String.format("%s@no-reply.com", username)); user.setEmailMe(true); user.setMatcher(String.format("awesome, %s", username)); user.setDisplayName(username); return user; } }
01463c16-89cf-4fef-a522-dbf06ad6b3e2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-27 18:52:00", "repo_name": "kendeclise/FakeGenerator", "sub_path": "/fakeGenerator/src/main/java/com/fakegenerator/entities/Empleado.java", "file_name": "Empleado.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "79c669c0ff41bc64f12b71cafae95cd5c253ddc9", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kendeclise/FakeGenerator
242
FILENAME: Empleado.java
0.233706
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.fakegenerator.entities; import java.util.Set; import javax.persistence.Entity; import javax.persistence.OneToMany; import javax.persistence.Table; /** * * @author jbust */ @Entity @Table(name = "empleados") public class Empleado extends Persona { @OneToMany(mappedBy = "empleado")//hace referencia a la variable relacionada en la otra tabla private Set<OrdenPago> ordenesPago; public Empleado() { } public Set<OrdenPago> getOrdenesPago() { return ordenesPago; } public void setOrdenesPago(Set<OrdenPago> ordenesPago) { this.ordenesPago = ordenesPago; } @Override public String toString() { return "Persona{" + "dni=" + dni + ", nombres=" + nombres + ", ape_pat=" + ape_pat + ", ape_mat=" + ape_mat + ", telefono=" + telefono + ", email=" + email + '}'; } }
8b19b762-f9a2-4d44-92ea-b5cb9a8d2ac3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-21 10:35:56", "repo_name": "ArinaLau/ProgCompICPC", "sub_path": "/StreetLightPole.java", "file_name": "StreetLightPole.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "3b3fa08eea721b291af696b01ee60273e62ff236", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ArinaLau/ProgCompICPC
279
FILENAME: StreetLightPole.java
0.268941
import java.util.Scanner; //acmicpc2016 - E public class StreetLightPole { public static void main(String[] args) { int test_case, hn, cn, status[][], steps; Scanner scanner = new Scanner(System.in); Scanner in = new Scanner(System.in).useDelimiter("[,\\s+]"); System.out.print("Enter number of test cases: "); test_case = scanner.nextInt(); System.out.print("\n"); // do{ for(int c=0; c<test_case; c++) { System.out.print("Enter number of horizontal and vertical streets: "); hn = in.nextInt(); cn = in.nextInt(); status = new int[hn][cn]; for (int i = 0; i < hn; i++) { System.out.print("Enter integer: "); for (int j = 0; j < cn; j++) { status[i][j] = in.nextInt(); } } for (int i = 0; i < hn; i++) { for (int j = 0; j < cn; j++) { } } // System.out.println("Case " + c + ": " + steps); test_case--; } //}while(test_case>0); } }
143a6847-29b4-46dd-ad3a-7c9c5f9f0e18
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-14 22:34:19", "repo_name": "grwkremilek/Excerpts", "sub_path": "/src/main/java/com/excerpts/springboot/validators/TagValidator.java", "file_name": "TagValidator.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ed34c3a3fe6620337b86bf82021c3c6f4c494361", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/grwkremilek/Excerpts
207
FILENAME: TagValidator.java
0.289372
package com.excerpts.springboot.validators; import java.nio.charset.StandardCharsets; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; import org.springframework.validation.Validator; import com.excerpts.springboot.domain.Tag; @Component public class TagValidator implements Validator { @SuppressWarnings("rawtypes") public boolean supports(Class clazz) { return Tag.class.isAssignableFrom(clazz); } public void validate(Object obj, Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "description", "error.description", "Please enter at least one tag."); Tag tag = (Tag) obj; if (tag.getDescription() != null) { byte[] bytesTags = tag.getDescription().getBytes(StandardCharsets.UTF_8); int tagsInBytes = bytesTags.length; if (tagsInBytes > 255) { errors.rejectValue("tags", "field.max.length", "There are too many tags."); } } } }
7a9b5745-fc34-43e2-81dd-5136b24e79e6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-10 01:03:52", "repo_name": "lonely7yk/shop_admin_back", "sub_path": "/src/test/java/com/lonely7yk/service/PermsServiceTest.java", "file_name": "PermsServiceTest.java", "file_ext": "java", "file_size_in_byte": 700, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "20d54cfe62a5bf9f18e563e66f57de4368ba91fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lonely7yk/shop_admin_back
220
FILENAME: PermsServiceTest.java
0.277473
package com.lonely7yk.service; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.lonely7yk.pojo.po.Perms; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import java.util.List; import java.util.Map; @SpringBootTest public class PermsServiceTest { @Autowired private PermsService permsService; ObjectMapper objectMapper = new ObjectMapper(); @Test public void getAllPermsIds() { String allPermsIds = permsService.getAllPermsIds(); System.out.println(allPermsIds); } @Test public void getAllPerms() throws JsonProcessingException { List<Perms> permsList = permsService.getAllPermsTree(); System.out.println(permsList); } @Test public void getAllPermsList() throws JsonProcessingException { List<Map<String, Object>> allPermsList = permsService.getAllPermsList(); System.out.println(objectMapper.writeValueAsString(allPermsList)); } }
28169449-6fcf-42e7-b5d0-378c1c626e87
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-29 10:25:29", "repo_name": "Pamod997/java-sample", "sub_path": "/src/com/pamod/sample/Sensor.java", "file_name": "Sensor.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "087234c0e3ccc60c4e36c128b235149d63856f1c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Pamod997/java-sample
211
FILENAME: Sensor.java
0.280616
package com.pamod.sample; public class Sensor { //sensor have two properties name , value private String name; // make variables for properties private double value; //by using private we can make variable can only read by this class //standard practice make variables as private public Sensor() { // default constructor } public Sensor(String name, double value) { //over right constructor this.name = name; this.value = value; } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getValue() { return value; } public void setValue(double value) { this.value = value; } @Override public String toString() { //without tostring cannot get the output just right click and genarate tostring() return "Sensor{" + "name='" + name + '\'' + ", value=" + value + '}'; } }
5a9bb2d3-0f8d-4f52-99e9-1ef2503d371e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-20 07:45:39", "repo_name": "September31st/CleanDemo", "sub_path": "/app/src/main/java/com/example/mylo/cleandemo/data/service/ZhihuService.java", "file_name": "ZhihuService.java", "file_ext": "java", "file_size_in_byte": 564, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "9cc86aae918804d51b41c309b8d1bea4d352dd53", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/September31st/CleanDemo
302
FILENAME: ZhihuService.java
0.27513
/** * Copyright 2017 Sun Jian * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.mylo.cleandemo.data.service; import com.example.mylo.cleandemo.domain.entity.ZhihuNewsEntity; import io.reactivex.Flowable; import retrofit2.http.GET; import retrofit2.http.Headers; /** * author: sunjian * created on: 2017/9/19 下午6:36 * description: https://github.com/crazysunj/CrazyDaily */ public interface ZhihuService { String HOST = "http://news-at.zhihu.com/api/4/"; @Headers("Cache-Control: public, max-age=300")//缓存时间为5分钟 @GET("news/latest") Flowable<ZhihuNewsEntity> getZhihuNewsList(); }
00ec0e4c-e62b-4e2f-96a6-1b1132589a3e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-30 22:23:12", "repo_name": "KananMusayev/NextBaseCRM", "sub_path": "/src/test/java/com/NextBaseCRM/Pages/VisualEditorPage.java", "file_name": "VisualEditorPage.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "d34fdbdbc866642bd8ee4315bc0071772fd49674", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/KananMusayev/NextBaseCRM
189
FILENAME: VisualEditorPage.java
0.249447
package com.NextBaseCRM.Pages; import com.NextBaseCRM.utilities.Driver; import org.junit.Assert; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.ExpectedConditions; public class VisualEditorPage extends BasePage { public VisualEditorPage(){ PageFactory.initElements(Driver.getDriver(), this); } @FindBy(xpath = "//span[@id='lhe_button_editor_blogPostForm']") private WebElement VisualEditorIcon; @FindBy(xpath = "//span[@class='bxhtmled-top-bar-wrap']") private WebElement VisualEditorBox; public void clickingOnVisualEditor(){ wait.until(ExpectedConditions.visibilityOf(VisualEditorIcon)); VisualEditorIcon.click(); } public void VisibilityOfEditorBar(){ wait.until(ExpectedConditions.visibilityOf(VisualEditorBox)); Assert.assertTrue(VisualEditorBox.isDisplayed()); } }
bdb6cb1a-48e1-4f74-90f5-6fe6b9b7b930
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-10-10 20:53:41", "repo_name": "ddrezga/ddrezga-diplomski", "sub_path": "/video/DiplomskiWorkspace/src/hr/drezga/diplomski/workspace/input/VideoEditorInput.java", "file_name": "VideoEditorInput.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "9b80a7dafb9608f42b2cc60e6ad72835e8910cb6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ddrezga/ddrezga-diplomski
216
FILENAME: VideoEditorInput.java
0.226784
package hr.drezga.diplomski.workspace.input; import hr.drezga.diplomski.video.core.IVideoProducer; import org.eclipse.core.runtime.Platform; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IPersistableElement; public class VideoEditorInput implements IEditorInput { IVideoProducer video; public VideoEditorInput(IVideoProducer video) { this.video = video; } @Override public Object getAdapter(Class adapter) { return Platform.getAdapterManager().getAdapter(this, adapter); } @Override public boolean exists() { return false; } @Override public ImageDescriptor getImageDescriptor() { return null; } @Override public String getName() { return video.getId(); } @Override public IPersistableElement getPersistable() { return null; } @Override public String getToolTipText() { return ""; } public IVideoProducer getVideo() { return video; } }
c63119b2-2901-409c-9c56-a5375f81a43e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-03 17:03:42", "repo_name": "ConnorYoto/GlyndwrTimetables", "sub_path": "/GlyndwrTimetables/app/src/main/java/com/example/glyndwrtimetables/AboutActivity.java", "file_name": "AboutActivity.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "b5eda49acddf259e763fa9133d388a5196a8e9ce", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ConnorYoto/GlyndwrTimetables
163
FILENAME: AboutActivity.java
0.240775
package com.example.glyndwrtimetables; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class AboutActivity extends AppCompatActivity { // Interface Button backButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); setupControls(); } // protected void onCreate(Bundle savedInstanceState) protected void setupControls() { backButton = findViewById(R.id.about_back_button); backButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); // backButton.setOnClickListener(new View.OnClickListener() } // protected void setupControls() } // public class AboutActivity extends AppCompatActivity
87637f39-408c-4e4e-b465-69dc8008c6f2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-05-11T18:41:04", "repo_name": "twashing/market-scanner", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1018, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "a0e8afe5880b3e736d9fdcda781f7d9ec3a4bc15", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/twashing/market-scanner
269
FILENAME: README.md
0.235108
# market-scanner Edgarly microservice for interfacing with the TWS Gateway. From here, the platform makes historical, stock and scanner requests. ## Notes A) You can connect to TWS, with a VNC viewer (ex: TightVNC). ``` cd ~/Downloads/tvnjviewer-2.8.3-bin-gnugpl/ java -jar tightvnc-jviewer.jar ``` B) You have to do an Initial build of base docker images. ``` docker build --force-rm -f Dockerfile.tws.base -t twashing/market-scanner-tws-base:latest -t twashing/market-scanner-tws-base:`git rev-parse HEAD` . docker build --force-rm -f Dockerfile.app.base -t twashing/market-scanner-app-base:latest -t twashing/market-scanner-app-base:`git rev-parse HEAD` . ``` C) Bringing up docker-compose ``` # Basic docker-compose up # Force a rebuild of containers docker-compose up --force-recreate --build ``` ## Lifecycle functions - return channels - expose scanner results in system map - expose request ids in system map (filter by request type) - check that system is started - check that connection is valid
5ec05689-75b1-4058-9db8-592edf9dc238
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-05 14:44:24", "repo_name": "tim-butterworth/tdd-katas", "sub_path": "/src/main/java/coreRefactor/effectiveLegacyCode/classIntoTestHarness_9/hiddenDependency/solution/parameterizeConstructor/dependency/NetworkNotHiddenDependency.java", "file_name": "NetworkNotHiddenDependency.java", "file_ext": "java", "file_size_in_byte": 1013, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "9e69833a534265d84a3b5ba251c2448912d169e2", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tim-butterworth/tdd-katas
215
FILENAME: NetworkNotHiddenDependency.java
0.290981
package coreRefactor.effectiveLegacyCode.classIntoTestHarness_9.hiddenDependency.solution.parameterizeConstructor.dependency; import java.util.Random; public class NetworkNotHiddenDependency implements NotHiddenDependency { private final String status; public NetworkNotHiddenDependency() { String statusToSet; try { attemptToConnectToServer(); statusToSet = "CONNECTED_TO_SERVER"; } catch (Exception e) { statusToSet = "NOT_CONNECTED"; } this.status = statusToSet; } private void attemptToConnectToServer() throws Exception { int i = new Random().nextInt(10); if (i > 4) throw new Exception("Failed to make connection!"); } @Override public void doStuff() { if (this.status.equals("CONNECTED_TO_SERVER")) { System.out.println("DOING REALLY INTERESTING STUFF"); } else { System.out.println("DOING TOTALLY DIFFERENT STUFF"); } } }
06f20328-6d7e-418a-b24b-710f7cd11af6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-26 07:54:42", "repo_name": "kyanrong/sorting-signed-permutation", "sub_path": "/src/CNode.java", "file_name": "CNode.java", "file_ext": "java", "file_size_in_byte": 1033, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "4c2e2e290bca7ffb959db67daacc99bb88c16a83", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kyanrong/sorting-signed-permutation
250
FILENAME: CNode.java
0.294215
import java.util.*; import java.lang.*; class CNode{ private CNode childLeft; private CNode childRight; private CNode parent; private String type; private String index; private double distance; public CNode( CNode parent,String nodeType,String indexNode){ childLeft = null; childRight = null; this.parent = parent; type = nodeType; index = indexNode; distance = 0; //this refers to the distance from a child node to its parent node } public CNode(){ } public void addChildL(CNode child){ childLeft= child; } public void addChildR(CNode child){ childRight= child; } public CNode getChildL(){ return childLeft; } public CNode getChildR(){ return childRight; } public void addDistance(double dist){ distance=dist; } public double getDistance(){ return distance; } public CNode getParent(){ return parent; } public String getType(){ return type; } public String getIndex(){ return index; } public void setParent(CNode newParent){ parent = newParent; } }
949f6e21-9032-4f4a-858a-35d49684b354
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-26 14:33:10", "repo_name": "zzckm/Demo", "sub_path": "/src/main/java/com/zhiyou100/servlet/message/UpdateServlet.java", "file_name": "UpdateServlet.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "2d293c27cc2634dabe6b5364b503f3573e679de7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zzckm/Demo
194
FILENAME: UpdateServlet.java
0.245085
package com.zhiyou100.servlet.message; import com.zhiyou100.util.AdminBaseServlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * 更新邮件 */ @WebServlet("/message/update") public class UpdateServlet extends AdminBaseServlet { private static final long serialVersionUID = 1L; @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int messageId = Integer.parseInt(request.getParameter("id")); request.getRequestDispatcher("/WEB-INF/view/message/update.jsp").forward(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // 注意这里判断用户点哪个按扭的方法! boolean send = request.getParameter("send") != null; response.sendRedirect(request.getContextPath() + "/message/listSave"); } }
8f31d8c2-af71-4a64-8fe4-562f5d05cc4b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-31 03:09:33", "repo_name": "wyhwpl/NetflowProject", "sub_path": "/netflow-authority/src/main/java/com/netflow/interceptor/InterceptorConfig.java", "file_name": "InterceptorConfig.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "888822042a424fedab86c0890d3179199d42dcca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wyhwpl/NetflowProject
201
FILENAME: InterceptorConfig.java
0.200558
package com.netflow.interceptor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import java.util.ArrayList; import java.util.List; /** * @author 汪培林 * @data 2020-12-24 15:30:37 */ @Configuration public class InterceptorConfig implements WebMvcConfigurer { @Autowired private TokenInterceptor tokenInterceptor; @Override public void addInterceptors(InterceptorRegistry registry) { List<String> excludePath = new ArrayList<>(); excludePath.add("/user/login"); excludePath.add("/user/register"); excludePath.add("/user/logout"); registry.addInterceptor(tokenInterceptor) .addPathPatterns("/**") .excludePathPatterns(excludePath); WebMvcConfigurer.super.addInterceptors(registry); } }
d92f53ea-0da5-4da3-be67-d24fd7cad31f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-27 02:17:12", "repo_name": "FlameJordan/Proyecto3LenguajesAndroid", "sub_path": "/app/src/main/java/ucr/cr/ac/proyecto3/Api/ApiPacientes.java", "file_name": "ApiPacientes.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "fcc4708fe52ce99ee33efca3034cbc5a5befac7d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/FlameJordan/Proyecto3LenguajesAndroid
210
FILENAME: ApiPacientes.java
0.23231
package ucr.cr.ac.proyecto3.Api; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; import ucr.cr.ac.proyecto3.IUser.UserService; public class ApiPacientes { private static Retrofit getRetrofit(){ HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); logging.setLevel(HttpLoggingInterceptor.Level.BODY); // Asociamos el interceptor a las peticiones OkHttpClient.Builder httpClient = new OkHttpClient.Builder(); httpClient.addInterceptor(logging); Retrofit retrofit = new Retrofit.Builder() .addConverterFactory(GsonConverterFactory.create()) .client(httpClient.build()) .baseUrl("http://flamejordan-001-site1.gtempurl.com/api/") .build(); return retrofit; } public static UserService getUserService(){ UserService userService = getRetrofit().create(UserService.class); return userService; } }
f299d985-6a91-4b74-9081-300e25158028
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-07 09:47:18", "repo_name": "gp990824/DesignPattern", "sub_path": "/src/javase/gp/threadpool/MyThreadPool.java", "file_name": "MyThreadPool.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "6ae386864f333088f74154463f2e0ff49c4987bd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/gp990824/DesignPattern
208
FILENAME: MyThreadPool.java
0.253861
package javase.gp.threadpool; import java.util.concurrent.*; /** * @author Gp * @create 2020/4/2 16:05 */ //手写一个线程池 public class MyThreadPool { public static void main(String[] args) { System.out.println(Runtime.getRuntime().availableProcessors()); ExecutorService threadPool = new ThreadPoolExecutor(2, 5, 1L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(3), Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy()); try { for (int i = 0; i < 8; i++) { threadPool.execute(new Runnable() { @Override public void run() { System.out.println(Thread.currentThread().getName() + "正在执行任务!"); } }); } } catch (Exception e) { e.printStackTrace(); } finally { threadPool.shutdown(); } } }
7a14cee8-22fd-4781-aa6d-15505ebdb125
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-15 04:45:32", "repo_name": "zaoshang67dian/wechat-sdk", "sub_path": "/src/main/java/com/sky/open/wx/sdk/response/appdev/GetAppWVDomainResponse.java", "file_name": "GetAppWVDomainResponse.java", "file_ext": "java", "file_size_in_byte": 1273, "line_count": 44, "lang": "zh", "doc_type": "code", "blob_id": "3bf695987a722364734a7cb14db8ace955e252f7", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zaoshang67dian/wechat-sdk
314
FILENAME: GetAppWVDomainResponse.java
0.259826
package com.sky.open.wx.sdk.response.appdev; import com.alibaba.fastjson.annotation.JSONField; import com.sky.open.wx.sdk.response.WechatResponse; import java.util.List; /** * 获取小程序全部业务域名: * 提示: * 1、需要先将域名登记到第三方平台的小程序业务域名中,才可以调用接口进行配置。 * 2、为授权的小程序配置域名时支持配置子域名, * 例如第三方登记的业务域名如为qq.com,则可以直接将qq.com及其子域名(如xxx.qq.com)也配置到授权的小程序中。 * @date 2018/5/7 10:57 */ public class GetAppWVDomainResponse extends WechatResponse { private static final long serialVersionUID = 4148710617262303802L; /** * 小程序的业务域名列表 */ @JSONField(name = "webviewdomain") private List<String> webviewDomain; public GetAppWVDomainResponse() { } public List<String> getWebviewDomain() { return webviewDomain; } public void setWebviewDomain(List<String> webviewDomain) { this.webviewDomain = webviewDomain; } @Override public String toString() { return "GetAppWVDomainResponse{" + "webviewDomain=" + webviewDomain + '}'; } }
d9573d76-c841-48de-aa65-be5b20b3fe79
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-12 16:17:43", "repo_name": "mraza-x/java3_worker_exceptions2", "sub_path": "/Employee.java", "file_name": "Employee.java", "file_ext": "java", "file_size_in_byte": 1104, "line_count": 91, "lang": "en", "doc_type": "code", "blob_id": "e30a57d6a02a9491a746fce09cc9a66cd6d0e9c9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mraza-x/java3_worker_exceptions2
289
FILENAME: Employee.java
0.26588
/** Mohammed Raza CSC 236 - Lab1 # 3 (class1) */ public class Employee { public String name; public int id; public String date; public Employee() { name = " "; id = 0; date = " "; } public Employee(String n, String d, int i) { name = n; id = i; date = d; } public void setName(String n) { name = n; } public void setEmployeeNumber(int i) { id = i; } public void setHireDate(String d) { date = d; } public String getName() { return name; } public int getEmployeeNumber() { try { if (id < 0 || id > 9999) throw new InvalidEmployeeNumber(); } catch (InvalidEmployeeNumber e) { System.out.println("Error: " + e.toString()); } finally { return id; } } public String getHireDate() { return date; } public void isValidEmpNum() { } public String toString() { String str = " "; return str; } }
d8884d5a-75b6-408b-a1b2-d4481f814e8b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-05-13T02:23:56", "repo_name": "cathymicyi/Fart-Away", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 987, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "2d9b122c2e380e47c076df12a5604095b6bf9a51", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cathymicyi/Fart-Away
210
FILENAME: README.md
0.253861
# Description Have you ever heard of “selling good smell fart”? This is a folk story in south Asia, the main goal of this story is teaching people to be kind. How much does animal agriculture and eating meat con- tribute to global warming? Animal agriculture and eating meat are the biggest causes of global warming. Becoming vegan or cutting down on your own personal meat consumption could be the sin- gle most effective action that you can do to help reduce greenhouse gas emissions. We want to combine “selling good smell fart” and reduce greenhouse gas together, it may be hard to imagine how, but if without those research information, most people know about eating too much meat which will cause greenhouse gas because of methane emissions (fart). To focus on this, we create a connection between meat-eating and farting as a cause of greenhouse gas, and this becomes our main game philosophy. # How to play Space - fly A backward D forward ![GitHub Logo](version.png)
ce099e86-850c-4afe-b030-1e1b5222c983
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-08 07:52:33", "repo_name": "Kutty39/Program", "sub_path": "/StockAccountManagement/src/com/blbz/stockaccountnanagement/repository/CompanyFileHandler.java", "file_name": "CompanyFileHandler.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "eb132487aef99c3d2f209a20ca191f20399e2582", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Kutty39/Program
189
FILENAME: CompanyFileHandler.java
0.261331
package com.blbz.stockaccountnanagement.repository; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import static com.blbz.stockaccountnanagement.model.StockModel.*; public class CompanyFileHandler { public void readCompanyJSON() { try (FileReader fr = new FileReader(getCompanyfilename())) { JSONParser pr = new JSONParser(); setBaseobjcompany((JSONObject) pr.parse(fr)); } catch (IOException | ParseException e) { e.printStackTrace(); } } public void writeCompanyJSON() { try(FileWriter fw=new FileWriter(getCompanyfilename())){ fw.write(getBaseobjcompany().toJSONString()); fw.flush(); System.out.println("Company File saved!!!"); } catch (IOException e) { e.printStackTrace(); } } }
eeb42069-76fd-4a8e-85ff-58be5f3f1287
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-02 23:19:35", "repo_name": "timv5/MyFinanceApp", "sub_path": "/app/src/main/java/com/example/myfinanceapp/database/db/AppDatabase.java", "file_name": "AppDatabase.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "c4df7db77194d19082f2393f11935bd5dd7924f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/timv5/MyFinanceApp
181
FILENAME: AppDatabase.java
0.264358
package com.example.myfinanceapp.database.db; import android.content.Context; import androidx.room.Database; import androidx.room.Room; import androidx.room.RoomDatabase; import com.example.myfinanceapp.database.dao.CryptoCoinDao; import com.example.myfinanceapp.database.model.CryptoCoin; @Database(entities = { CryptoCoin.class }, version = 1, exportSchema = false) public abstract class AppDatabase extends RoomDatabase { private static final String DATABASE_NAME = "my_finance_db"; private static AppDatabase instance; public abstract CryptoCoinDao cryptoCoinDao(); public static synchronized AppDatabase getInstance(Context context) { if (instance == null) { instance = Room.databaseBuilder(context.getApplicationContext(), AppDatabase.class, DATABASE_NAME) .allowMainThreadQueries() .fallbackToDestructiveMigration() .build(); } return instance; } }
b411d9a9-556b-41d7-9c2b-6f9a3a2bbd12
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-05-23T15:18:27", "repo_name": "shiftypanda/fatigue-performance", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1044, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "6a0eef543ea2dad0228b919726c72d7b1ae0ce54", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/shiftypanda/fatigue-performance
211
FILENAME: README.md
0.226784
#Fatigue and performance This project aims to help capture data on fatigue and performance It's split into multiple smaller apps to make debugging easier and show the overall framework. Based upon Django 2.0.2 #Overall framework of smaller apps:- 1. ai - for customizing responses based upon machine learning systems Status - development not yet started 2. analysis - analysing data using python libraries Status - development not yet started 3. cogtests - collection of cognitive testing Status - Collecting tests 4. participant - management area for participants to access their data Status - Under development 5. prompt - system for prompting user to answer tests or other systems, to link with ai system in production Status - development not yet started 6. question - system for delivering basic questions and gathering responses Status - Under development 7. rota - tracking system for rota used by participants, allowing defined shift patterns, rota patterns and acutal shift start and finish times Status - under development
e28c849a-b573-4035-9e15-bf721e247af0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-04-10 19:31:25", "repo_name": "simplyti/simple-server", "sub_path": "/acceptance/src/test/java/com/simplyti/service/examples/filter/FullHttpRequestFilterModule.java", "file_name": "FullHttpRequestFilterModule.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "aad6c046ff6835b4990733ef9f924f9c1d634695", "star_events_count": 6, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/simplyti/simple-server
210
FILENAME: FullHttpRequestFilterModule.java
0.259826
package com.simplyti.service.examples.filter; import com.google.inject.AbstractModule; import com.google.inject.Singleton; import com.google.inject.multibindings.Multibinder; import com.simplyti.service.exception.BadRequestException; import com.simplyti.service.filter.FilterContext; import com.simplyti.service.filter.http.FullHttpRequestFilter; import io.netty.handler.codec.http.FullHttpRequest; public class FullHttpRequestFilterModule extends AbstractModule implements FullHttpRequestFilter { @Override protected void configure() { Multibinder<FullHttpRequestFilter> fulters = Multibinder.newSetBinder(binder(), FullHttpRequestFilter.class); fulters.addBinding().to(FullHttpRequestFilterModule.class).in(Singleton.class); } @Override public void execute(FilterContext<FullHttpRequest> context) { if(context.object().uri().equals("/hello/bad") || context.object().uri().equals("/echo/bad")){ context.fail(new BadRequestException()); }else { context.done(); } } }
8b870556-0a15-4534-bd16-ac0486f1d235
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-05-17T15:25:36", "repo_name": "stevelilly/rxandroid-racecondition", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1099, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "486c5b8219c5459f0aab9265683a9cea8600e440", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/stevelilly/rxandroid-racecondition
244
FILENAME: README.md
0.255344
This demo is based on the belief that when running the following code in the main thread it should not be possible to reach the exception: ```java Single.fromCallable(Object::new) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(object -> { throw new IllegalStateException("should never be called"); }) .dispose(); ``` After a few thousand calls I often encounter the exception. More interestingly, in the debugger we can see that the `HandlerScheduler$ScheduledRunnable` has already been disposed, yet its `run()` method is still called. ![Debugging run() on disposed Runnable](https://github.com/stevelilly/rxandroid-racecondition/blob/master/runOnDisposedRunnable.png?raw=true) AFAICT the code in the `HandlerScheduler` is using `removeCallbacks` and `removeCallbacksAndMessages` in the proper way, however it appears it is not safe to call `delegate.run()` without first checking `isDisposed`. This seems to affect API 24+ much more often than API 23 when I test it, but this could just be the specific timings of my emulator.
39fefdf8-7992-46a5-9278-4db840e2dffc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-24 09:43:12", "repo_name": "keillen/springboot-VUE-", "sub_path": "/shop/src/main/java/com/zxsc/springboot/bean/Item.java", "file_name": "Item.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "1a708bece419228c831cbde41d67ecc883d0de3e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/keillen/springboot-VUE-
219
FILENAME: Item.java
0.259826
package com.zxsc.springboot.bean; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.text.DecimalFormat; import java.util.Date; @AllArgsConstructor @NoArgsConstructor @Data public class Item { private Integer id; private Integer cid; private String title; private String sell_point; private String price; private Integer num; private String pic; private Integer status; private String content; private String album; private Date created; private Date updated; @Override public String toString() { return "Item{" + "id=" + id + ", cid=" + cid + ", title='" + title + '\'' + ", sell_point='" + sell_point + '\'' + ", price=" + price + ", num=" + num + ", pic='" + pic + '\'' + ", status=" + status + ", content='" + content + '\'' + ", album='" + album + '\'' + ", created=" + created + ", updated=" + updated + '}'; } }
acf3db16-78fe-4375-b691-dc7a50f1f1ae
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-15 07:15:23", "repo_name": "sunjulei/WeatherDemo", "sub_path": "/app/src/main/java/com/example/administrator/weatherdemo/GetUtil.java", "file_name": "GetUtil.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "c33e2b72c2f95f2c524b130c50cddd226f2eaed9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sunjulei/WeatherDemo
221
FILENAME: GetUtil.java
0.252384
package com.example.administrator.weatherdemo; import android.icu.util.ULocale; import android.widget.TextView; import android.widget.Toast; import org.apache.commons.io.IOUtils; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URL; import java.net.URLEncoder; /** * Created by Administrator on 2018/1/8 0008. */ public class GetUtil { String city = null, jsonUrl, result; URL url = null; InputStream is = null; public String getjson(String c) { try { city = URLEncoder.encode(c, "utf-8"); jsonUrl = String.format("http://www.sojson.com/open/api/weather/json.shtml?city=%s", city); url = new URL(jsonUrl); //打开url对应的资源的输入流 is = url.openStream(); //获取资源 result = IOUtils.toString(is, "utf-8"); } catch (Exception e) { e.printStackTrace(); } return result; } }
58c4fb93-602f-4933-9746-308cb9d80145
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-14T11:36:58", "repo_name": "anurgsrivastava/react-native-couchbase-lite", "sub_path": "/android/src/main/java/com/reactlibrary/JsonQuery.java", "file_name": "JsonQuery.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "823a52138f4aeb3a8db060cb9f040126f0ca13ca", "star_events_count": 5, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/anurgsrivastava/react-native-couchbase-lite
226
FILENAME: JsonQuery.java
0.288569
package com.reactlibrary; //import com.couchbase.lite.AbstractQuery; import com.couchbase.lite.CouchbaseLiteException; import com.couchbase.lite.Database; import java.util.HashMap; import java.util.List; import java.util.Map; class JsonQuery { //extends AbstractQuery { private Map<String, Object> jsonSchema; private Database database; JsonQuery(Map<String, Object> jsonSchema, Database database) { super(); this.jsonSchema = jsonSchema; this.database = database; } public Database getDatabase() { return this.database; } protected Map<String, Object> _asJSON() { return this.jsonSchema; } protected Map<String, Integer> generateColumnNames() throws CouchbaseLiteException { Map<String, Integer> map = new HashMap<>(); int count = ((List)this.jsonSchema.get("WHAT")).size(); for (int i = 0; i < count; i++) { map.put(String.format("f%d", i), i); } return map; } }
b15af544-56ae-43bb-a5e5-e6788a8ed91b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-24 05:58:38", "repo_name": "mickdevill/Entrevoisins", "sub_path": "/app/src/main/java/com/openclassrooms/entrevoisins/service/DummyNeighbourApiService.java", "file_name": "DummyNeighbourApiService.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "670a6f87a1ca95be0928e0e3255fc3677617456b", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mickdevill/Entrevoisins
242
FILENAME: DummyNeighbourApiService.java
0.286968
package com.openclassrooms.entrevoisins.service; import com.openclassrooms.entrevoisins.model.Neighbour; import java.util.ArrayList; import java.util.List; /** * Dummy mock for the Api */ public class DummyNeighbourApiService implements NeighbourApiService { private List<Neighbour> neighbours = DummyNeighbourGenerator.generateNeighbours(); /** * {@inheritDoc} */ @Override public List<Neighbour> getNeighbours() { return neighbours; } @Override public void deleteNeighbour(Neighbour neighbour) { neighbours.remove(neighbour); } //les méthode que j'ai ajouté List<Neighbour> favoriteNeibours = new ArrayList<>(); public List<Neighbour> getFavoriteNeibours() { return favoriteNeibours; } public void deleteFavNeibour(Neighbour neighbour) { favoriteNeibours.remove(neighbour); } public void addFavNeibour(Neighbour neighbour) { favoriteNeibours.add(neighbour); } /** * {@inheritDoc} */ }
b591f4db-354b-4bb1-9717-030fedeb6c6d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-07-18T20:17:33", "repo_name": "sheepit/sheepit", "sub_path": "/source/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1146, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "a474897fefc9022cd77da295a3eb79173160a6c3", "star_events_count": 13, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sheepit/sheepit
237
FILENAME: readme.md
0.242206
# sheepIT ## Swagger Address: http://localhost:5000/swagger/index.html ## Architecture Project is divided into three primary modules: infrastructure, use cases and core. ### Infrastructure It mainly contains technical code reused by all other modules. It should be unrelated to this specific project (meaning it could in theory be used in other projects). We should strive to have as much technical code moved from other modules to infrastructure, to keep them focused on logic instead of technical details. ### Use cases Represents _specific_ functionalities related to specific endpoints (e. g. web app or public API). Use cases should be structured in the same way as their enpoints, e. g. use cases related to web app should have similar structure as that web app. Use cases should not reference one another. If some code needs reusing, it should either go to infrastructure or core modules. ### Core Represents functionalities common to entire project. It includes domain code (e. g. entities, business rules, value objects, etc.), but also technical code related to this project (e. g. data access for specific entities).
b2ddf85f-cc66-46df-acf1-64ef7cce2836
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-07-09 03:58:15", "repo_name": "yuxiaohui78/KJFrameForAndroid", "sub_path": "/KJFrameExample/src/org/kymjs/example/fragment/ExampleFragment.java", "file_name": "ExampleFragment.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "60011abcfab7492ea6139fa8168cff701af128c6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/yuxiaohui78/KJFrameForAndroid
211
FILENAME: ExampleFragment.java
0.26588
package org.kymjs.example.fragment; import org.kymjs.aframe.ui.BindView; import org.kymjs.aframe.ui.fragment.BaseFragment; import org.kymjs.example.R; import org.kymjs.example.activity.SlidExample; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; public class ExampleFragment extends BaseFragment { @BindView(id = R.id.button1, click = true) private Button button; @Override protected View inflaterView(LayoutInflater inflater, ViewGroup container, Bundle bundle) { View view = inflater.inflate(R.layout.example_layout, null); return view; } @Override protected void widgetClick(View v) { super.widgetClick(v); switch (v.getId()) { case R.id.button1: if (getActivity() instanceof SlidExample) { ((SlidExample) getActivity()).changeSlidMenu(); } break; } } }
8291b6b7-439c-4fef-82e6-ad9f5cfc71f1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-18 15:52:43", "repo_name": "sacahan/opendata", "sub_path": "/ntpc-od-model/src/main/java/com/udn/ntpc/od/model/system/domain/CoordinateMapping.java", "file_name": "CoordinateMapping.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "4c9d8cb71e1e99526aafe934c72adba8ca266987", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sacahan/opendata
222
FILENAME: CoordinateMapping.java
0.259826
package com.udn.ntpc.od.model.system.domain; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.ToString; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; @Entity @DynamicInsert @DynamicUpdate @Table(name="st_coordinate_mapping") @NoArgsConstructor @AllArgsConstructor @Data @ToString(exclude = {}) @EqualsAndHashCode(exclude = {}) public class CoordinateMapping implements Serializable { private static final long serialVersionUID = 3982118162973241041L; @Id @Column(name = "od_data_cfg_oid", length = 36, nullable = false) private String dataCfgOid; @Column(name = "field_addr", length = 50, nullable = false) private String fieldAddr; @Column(name = "field_name", length = 50, nullable = false) private String fieldName; }
27145ab5-19cd-479b-93a7-36c44f4e1736
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-01-24 12:38:26", "repo_name": "camelinaction/camelinaction2", "sub_path": "/chapter5/splitter/src/test/java/camelinaction/CustomerService.java", "file_name": "CustomerService.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "54618850d5ac2849301e7d2dce9723d07a112c9e", "star_events_count": 636, "fork_events_count": 447, "src_encoding": "UTF-8"}
https://github.com/camelinaction/camelinaction2
248
FILENAME: CustomerService.java
0.292595
package camelinaction; import java.util.ArrayList; import java.util.List; /** * Customer service bean */ public class CustomerService { /** * Split the customer into a list of departments * * @param customer the customer * @return the departments */ public List<Department> splitDepartments(Customer customer) { // this is a very simple logic, but your use cases // may very well require more complex logic return customer.getDepartments(); } /** * Create a dummy customre for testing purprose */ public static Customer createCustomer() { List<Department> departments = new ArrayList<Department>(); departments.add(new Department(222, "Oceanview 66", "89210", "USA")); departments.add(new Department(333, "Lakeside 41", "22020", "USA")); departments.add(new Department(444, "Highstreet 341", "11030", "USA")); Customer customer = new Customer(123, "Honda", departments); return customer; } }
e55bf2ff-0b7f-4a6d-b020-bb0b690484ba
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-14 22:57:37", "repo_name": "tbal/space-sweeper", "sub_path": "/src/main/java/de/dynamobeuth/spacesweeper/component/LevelComponent.java", "file_name": "LevelComponent.java", "file_ext": "java", "file_size_in_byte": 1038, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "88b65908471f8e85ab25e79bda2b5892a18033ab", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tbal/space-sweeper
204
FILENAME: LevelComponent.java
0.253861
package de.dynamobeuth.spacesweeper.component; import javafx.beans.property.SimpleIntegerProperty; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.control.Label; import javafx.scene.layout.HBox; import java.io.IOException; /** * Component to display the current level */ public class LevelComponent extends HBox { @FXML private Label lblLevel; private SimpleIntegerProperty level = new SimpleIntegerProperty(); /** * Initialize component */ public LevelComponent() { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("LevelComponent.fxml")); fxmlLoader.setRoot(this); fxmlLoader.setController(this); try { fxmlLoader.load(); } catch (IOException e) { throw new RuntimeException(e); } } @FXML private void initialize() { lblLevel.textProperty().bind(levelProperty().asString()); } public SimpleIntegerProperty levelProperty() { return level; } }
cf381408-33fa-4172-a316-d3ea03b66ac1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-21 06:26:42", "repo_name": "MonsoonJava/simpleframework", "sub_path": "/src/main/java/simple/xfj/framework/util/DEcodeUtil.java", "file_name": "DEcodeUtil.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "4145a3c48e98917c1b1811c13991d540f8d4d5e6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MonsoonJava/simpleframework
241
FILENAME: DEcodeUtil.java
0.247987
package simple.xfj.framework.util; import com.sun.org.apache.xml.internal.utils.StringToStringTableVector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; /** * Created by asus on 2017/4/19. */ public class DEcodeUtil { private static final Logger LOGGER = LoggerFactory.getLogger(DEcodeUtil.class); public static final String Decode(String str){ String res = null; try { /* byte[] bytes = str.getBytes("ISO8859-1"); res = new String(bytes, "GBK");*/ res = URLDecoder.decode(str,"UTF-8"); } catch (UnsupportedEncodingException e) { LOGGER.error("decode String error"); throw new RuntimeException(e); } return res; } public static final String Encode(String str){ try { str = URLEncoder.encode(str,"ISO8859-1"); } catch (UnsupportedEncodingException e) { LOGGER.error("encode String error"); throw new RuntimeException(e); } return str; } }
fd55b32e-c12e-469d-8f4c-64904a43ff28
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-24 20:55:18", "repo_name": "dplucenio/spring-security-with-jwt", "sub_path": "/src/main/java/io/plucen/springsecuritywithjwt/SpringSecurityWithJwtApplication.java", "file_name": "SpringSecurityWithJwtApplication.java", "file_ext": "java", "file_size_in_byte": 1014, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "fb4018bdc60867e38808f432aaa099f05e45b728", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dplucenio/spring-security-with-jwt
184
FILENAME: SpringSecurityWithJwtApplication.java
0.208179
package io.plucen.springsecuritywithjwt; import io.plucen.springsecuritywithjwt.users.UserService; import javax.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication @RequiredArgsConstructor public class SpringSecurityWithJwtApplication { private final UserService userService; @Value("${admin.email}") private String adminEmail; @Value("${admin.password}") private String adminPassword; public static void main(String[] args) { SpringApplication.run(SpringSecurityWithJwtApplication.class, args); } @PostConstruct public void setAdminUser() { if (userService.findByEmail(adminEmail).isEmpty()) { userService.create(adminEmail, adminPassword); System.out.println("Created admin user"); } else { System.out.println("already created"); } } }
86dbf597-4a69-4530-973b-d8d8a86ecf24
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-05-10T20:27:38", "repo_name": "congdv/vim-config", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1059, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "aee2ea5984c0c54297a75cc555e1886eb1214b10", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/congdv/vim-config
329
FILENAME: README.md
0.240775
The font used in the screenshot is [Haskplex Nerd](https://github.com/huytd/haskplex-font). ## Installation There are two way to use this config: **Option 1:** Check `init.vim` and copy just what you need. **Option 2:** Clone the whole repo in to `~/.config/nvim/`, please make sure you don't have this folder before clone: ``` $ git clone https://github.com/huytd/vim-config ~/.config/nvim/ ``` ## Screenshots NERDTree + coc.nvim floating document + vista.vim outline: ![](https://i.imgur.com/NItTlei.png) Floating Terminal: `<Leader>at` or `:call FloatTerm()` ![](https://i.imgur.com/tbANa2W.png) NodeJS REPL: `<Leader>an` or `:call FloatTerm('"node"')` ![](https://i.imgur.com/SQYbYJA.png) Floating tig - TUI Git: `<Leader>ag` or `:call FloatTerm('"tig"')` ![](https://i.imgur.com/zAjTPsK.png) ## Note For displaying well font of vim-devicons. You should install [nerd-fonts](https://github.com/ryanoasis/nerd-fonts). To install it you can check this [instructions](https://gist.github.com/matthewjberger/7dd7e079f282f8138a9dc3b045ebefa0)
8b640acb-b03c-4c01-9768-b41b37bc28d7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-12 01:37:22", "repo_name": "tonels/mongoDB-", "sub_path": "/src/main/java/com/example/demo/MongoDBController.java", "file_name": "MongoDBController.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "ae573a5c0edbf1a56ec4d425ca5ac130ea1ad723", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tonels/mongoDB-
228
FILENAME: MongoDBController.java
0.278257
package com.example.demo; import java.util.Collection; import java.util.LinkedHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/mongo") public class MongoDBController { Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private StudentExamRepository SERepository; @RequestMapping("/save") public Student save() { Student s = new Student("Jack",26); Collection<Exam> exams = new LinkedHashSet<>(); exams.add(new Exam("高等代数",90)); exams.add(new Exam("线性几何",88)); exams.add(new Exam("大学英语",95)); s.setExams(exams); return SERepository.save(s); } @GetMapping("/selbyage") public Student findByage(Integer age ) { logger.info("执行于此了"); return SERepository.findByAge(age); } }
e57018c8-d6c9-40ca-94ce-99e6411badf8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-01-23 18:27:39", "repo_name": "ben-ng/checkmate", "sub_path": "/src/com/ben/chess/pieces/Knight.java", "file_name": "Knight.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "6253bf14bfb41a3efd97f9a17af665bc9023a4e6", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/ben-ng/checkmate
259
FILENAME: Knight.java
0.272025
package com.ben.chess.pieces; import com.ben.chess.Player; import com.ben.chess.boards.ChessBoard; import com.ben.chess.boards.ChessBoardCell; import com.ben.chess.boards.ChessBoardCellNotOccupiedException; import com.ben.chess.pieces.behaviors.Behavior; import com.ben.chess.pieces.behaviors.KnightBehavior; /** * Created by ben on 2/6/14. */ public class Knight extends ChessPiece { Behavior behavior; public Knight (Player player) throws InvalidPlayerException { super(player); this.behavior = new KnightBehavior(); } public Knight (Knight other) { super(other); } public String getName () { return "Knight"; } public boolean canMove (ChessBoard board, ChessBoardCell origin, ChessBoardCell destination) { return this.behavior.canMove(board, origin, destination); } public ChessPiece copy () { return new Knight(this); } public char getIconChar() { if(this.getPlayer() == Player.WHITE) return '\u2658'; else return '\u265E'; } }
c1b42e95-4ed5-40dc-a10e-ea822e3d7754
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-12 07:39:32", "repo_name": "liwei6797/yuanbao", "sub_path": "/EvaluateStrategy/src/main/com/star/strategy/EsService.java", "file_name": "EsService.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "71a19ff34742e07478db3a06521d9c53ac412576", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/liwei6797/yuanbao
242
FILENAME: EsService.java
0.294215
package com.star.strategy; import java.util.Date; import org.apache.log4j.Logger; import com.star.db.SqlDao; public class EsService { private static Logger LOGGER = Logger.getLogger(EsService.class); // 导入CSV文件到H2数据库 public static void importCSV(String filePath, String tableName) { Date t1 = new Date(); String sql = "CREATE TABLE " + tableName + " (STOCKID INT,BUYDATE INT," + "BUYPRICE INT,SELLDATE INT,SELLPRICE INT,PROFIT DOUBLE)"; SqlDao.executeSql(sql); try { SqlDao.executeSql("INSERT INTO " + tableName + " SELECT * FROM CSVREAD('" + filePath + "')"); } catch (Exception ex) { LOGGER.error("", ex); } Date t2 = new Date(); LOGGER.info("导入" + filePath + "耗时" + (t2.getTime() - t1.getTime()) + "毫秒"); } public static void dropTable(String tableName) { String sql = "DROP TABLE IF EXISTS " + tableName; SqlDao.executeSql(sql); } }
dfeae360-27db-4095-9c6d-5fee0eae107e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-15 21:20:07", "repo_name": "Andrey777-a/pet-project-hillel", "sub_path": "/src/main/java/com/example/springhillel/api/service/crudservice/convert/UserConverter.java", "file_name": "UserConverter.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "20a0ba3cbe4aa049285b71902cc06dc095e7834e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Andrey777-a/pet-project-hillel
192
FILENAME: UserConverter.java
0.261331
package com.example.springhillel.api.service.crudservice.convert; import com.example.springhillel.model.dto.UserDTO; import com.example.springhillel.model.entity.Role; import com.example.springhillel.model.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.persistence.EntityManager; @Component public class UserConverter implements AbstractConvert<User, UserDTO> { @Autowired private EntityManager entityManager; @Override public User convertToEntity(UserDTO userDTO) { Role role = entityManager.find(Role.class, userDTO.getRoleId()); return new User(userDTO.getFirstName(), userDTO.getLastName(), userDTO.getPassword(), userDTO.getEmail(), role); } @Override public UserDTO covertToDTO(User user) { return new UserDTO(user.getFirstName(), user.getLastName(), user.getEmail(), user.getPassword(), user.getRole().getId()); } }
45777b47-068e-433f-a1a9-f0e104aef69d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-06 12:40:21", "repo_name": "rajivgh/oktpusandroid", "sub_path": "/app/src/main/java/com/app/oktpus/activity/PostAdActivity.java", "file_name": "PostAdActivity.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "fce56e7642c6500678842b70535345609eec634b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rajivgh/oktpusandroid
197
FILENAME: PostAdActivity.java
0.224055
package com.app.oktpus.activity; import android.os.Bundle; import android.os.PersistableBundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.widget.FrameLayout; import com.app.oktpus.R; import com.app.oktpus.fragment.PostAd; /** * Created by Gyandeep on 16/5/18. */ public class PostAdActivity extends BaseActivity { FrameLayout container; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); includeNavigationMenu(this, R.layout.activity_ad_post); container = (FrameLayout) findViewById(R.id.fragment_frame); } @Override protected void onStart() { super.onStart(); FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); Fragment fragment = new PostAd(); ft.add(container.getId(), fragment); ft.commit(); } }
2c9052b0-d21e-4e6d-8638-0d6c2cfc5bab
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-29 20:43:49", "repo_name": "alexvingg/cashbacktest", "sub_path": "/src/main/java/com/store/cashback/entity/SaleAlbum.java", "file_name": "SaleAlbum.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "fe590e04b1774771084d43ea62888b90d04f4b91", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/alexvingg/cashbacktest
193
FILENAME: SaleAlbum.java
0.282988
package com.store.cashback.entity; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.*; import java.math.BigDecimal; @Entity @Table(name = "sales_albums") @Getter @Setter @AllArgsConstructor @NoArgsConstructor @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) public class SaleAlbum { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @JsonIgnore private Long id; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "sales_id") @JsonBackReference private Sale sale; @Column private String albumName; @Column private String albumSlug; @Column private Integer cashback; @Column private BigDecimal albumPrice; @Column private BigDecimal salePrice; }
e0314c83-12bf-48f3-9722-e51f65037614
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-24 07:30:32", "repo_name": "colorfulfrog/springboot-dubbox", "sub_path": "/platform-system/platform-system-api/src/main/java/com/yxhl/stationbiz/system/domain/entity/sys/OperateLog.java", "file_name": "OperateLog.java", "file_ext": "java", "file_size_in_byte": 1195, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "f4c3a6400f30593a499d85e9aecd1b8a525732fb", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/colorfulfrog/springboot-dubbox
301
FILENAME: OperateLog.java
0.23092
package com.yxhl.stationbiz.system.domain.entity.sys; import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableName; import com.yxhl.platform.common.entity.ELItem; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * * 表名:sys_operate_log * 注释:操作日志表 * 创建人: xjh * 创建日期:2018-7-9 17:20:55 */ @Data @TableName(value="sys_operate_log") public class OperateLog extends ELItem{ private static final long serialVersionUID = 1L; @ApiModelProperty(value = "操作模块 长度(10) 必填") private java.lang.String module; @ApiModelProperty(value = "操作类型 长度(20) 必填") private java.lang.String type; @ApiModelProperty(value = "操作IP 长度(20) 必填") private java.lang.String ip; @ApiModelProperty(value = "操作内容") private String content; @TableField(exist = false) @ApiModelProperty(value = "开始时间") private String startTime; @TableField(exist = false) @ApiModelProperty(value = "结束时间") private String endTime; @TableField(exist = false) @ApiModelProperty(value = "操作人 名称") private String userName; }
2ff3a5ac-cde7-494e-ad07-d6a7cab8bab6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-23 01:49:23", "repo_name": "hanjiongchen/xquick", "sub_path": "/rocket/admin/src/main/java/com/nb6868/xquick/modules/shop/service/impl/OrderLogServiceImpl.java", "file_name": "OrderLogServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "8d610d0777cc79e72787d545f7cdd0446b0221e3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hanjiongchen/xquick
240
FILENAME: OrderLogServiceImpl.java
0.258326
package com.nb6868.xquick.modules.shop.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.nb6868.xquick.booster.service.impl.CrudServiceImpl; import com.nb6868.xquick.modules.shop.dao.OrderLogDao; import com.nb6868.xquick.modules.shop.dto.OrderLogDTO; import com.nb6868.xquick.modules.shop.entity.OrderLogEntity; import com.nb6868.xquick.modules.shop.service.OrderLogService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import java.util.Map; /** * 订单记录 * * @author Charles zhangchaoxu@gmail.com */ @Service public class OrderLogServiceImpl extends CrudServiceImpl<OrderLogDao, OrderLogEntity, OrderLogDTO> implements OrderLogService { @Override public QueryWrapper<OrderLogEntity> getWrapper(String method, Map<String, Object> params){ String id = (String)params.get("id"); QueryWrapper<OrderLogEntity> wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), "id", id); return wrapper; } }
8b52a3f3-2d03-4463-9cfd-ee09d06fe6e3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2022-11-18T23:32:08", "repo_name": "iamdcj/reacts", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1148, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "984ffa1244e0da796a6c440f3b177b08360ce916", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/iamdcj/reacts
285
FILENAME: README.md
0.229535
# React React is a [declarative](https://github.com/iamdcj/javascripts/blob/master/paradigms/README.md#declarative-programming), [component-based](components) [JavaScript](https://github.com/iamdcj/javascripts/) library used for building User Interfaces of all sizes and complexities. React can be used to deal with only the **'view'** aspect of an application, or in most cases used to engineer fully-fledged single page applications. ### The Benefits of React - **Scalable**; a great framework for building applications of all sizes. - **Lightning Fast**; React's DOM abstraction, the [virtual DOM](react-dom), ensures UI updates occur in rapid time. - **Production Ready**; a dedicated team of engineers ensure the library is ever-evolving and well maintained. - **Resources Aplenty**; there is an abundance of training material available for engineers of all levels. --- **Core** - [Data Flow and Updates](data-flow) - React DOM - [Components](components) - [JSX](jsx) - Class - Function - Conditionals - Props - State - [Hooks](hooks) - Patterns - HOCs - Render Props **Other** - Routing - Forms - Styling - Testing
1bc569c1-64de-4a8a-9d29-4a22d919eece
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-30 23:01:15", "repo_name": "samuelvazcal/SpringUdemyCourse", "sub_path": "/hibernate-exercise/src/com/samuelvazquez/UpdatePokemon.java", "file_name": "UpdatePokemon.java", "file_ext": "java", "file_size_in_byte": 1014, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "d65fe65d5fdf7ff1a5f019bb33c3d377ab6a4b21", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/samuelvazcal/SpringUdemyCourse
188
FILENAME: UpdatePokemon.java
0.247987
package com.samuelvazquez; import com.samuelvazquez.entity.Pokemon; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class UpdatePokemon { public static void main(String[] args) { SessionFactory factory = new Configuration().configure("hibernate.cfg.xml").addAnnotatedClass(Pokemon.class).buildSessionFactory(); Session session = factory.getCurrentSession(); try { String pokemonId = "6"; session.beginTransaction(); System.out.println("\nGetting student with id: " + pokemonId); Pokemon myPokemon = session.get(Pokemon.class,pokemonId); System.out.println("Updating Pokemon..."); myPokemon.setName("Gloom"); myPokemon.setWeight(8.6); session.getTransaction().commit(); } catch(Exception e) { e.printStackTrace(); } finally { factory.close(); } } }
6d2057eb-e644-4d92-82ce-043fd2b24741
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-06 18:24:26", "repo_name": "SquidDev-CC/plethora", "sub_path": "/src/main/java/org/squiddev/plethora/integration/ic2/MetaEnergyItem.java", "file_name": "MetaEnergyItem.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "dbd8a4761a95e1c50c9a531a703ec1adfa4128bb", "star_events_count": 64, "fork_events_count": 56, "src_encoding": "UTF-8"}
https://github.com/SquidDev-CC/plethora
250
FILENAME: MetaEnergyItem.java
0.291787
package org.squiddev.plethora.integration.ic2; import ic2.api.item.IElectricItemManager; import ic2.core.IC2; import ic2.core.ref.ItemName; import net.minecraft.item.ItemStack; import org.squiddev.plethora.api.Injects; import org.squiddev.plethora.api.meta.BasicMetaProvider; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Collections; import java.util.HashMap; import java.util.Map; @Injects(IC2.MODID) public final class MetaEnergyItem extends BasicMetaProvider<ItemStack> { @Nonnull @Override public Map<String, ?> getMeta(@Nonnull ItemStack object) { IElectricItemManager manager = IntegrationIc2.getManager(object); if (manager == null) return Collections.emptyMap(); Map<String, Object> map = new HashMap<>(3); map.put("stored", manager.getCharge(object)); map.put("capacity", manager.getMaxCharge(object)); map.put("tier", manager.getTier(object)); return Collections.singletonMap("eu", map); } @Nullable @Override public ItemStack getExample() { return ItemName.batpack.getItemStack(); } }
fb8559e3-7f0e-43bf-9ed6-7b9c5347966c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-18 20:19:10", "repo_name": "Njabulongwenyama/restful-web-service", "sub_path": "/src/main/java/Restfulwebservices/Restfulwebservices/user/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "abfebcc6c4e441ae8efeae713ec9ba0d16e92253", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Njabulongwenyama/restful-web-service
258
FILENAME: User.java
0.228156
package Restfulwebservices.Restfulwebservices.user; import javax.validation.constraints.Past; import javax.validation.constraints.Size; import java.util.Date; public class User { private Integer id; @Size(min=2, message = "Name should have atleast two charactors") private String name; @Past(message = "Invalid future Birthday ") private Date Birthdate; private User(){ } public User(final Integer id, final String name, final Date birthdate) { this.id = id; this.name = name; Birthdate = birthdate; } public Integer getId() { return id; } public String getName() { return name; } public Date getBirthdate() { return Birthdate; } public void setId(final Integer id) { this.id = id; } public void setName(final String name) { this.name = name; } @Override public String toString() { return "User{" + "id=" + id + ", name='" + name + '\'' + ", Birthdate=" + Birthdate + '}'; } public void setBirthdate(final Date birthdate) { Birthdate = birthdate; } }
e6cebcaa-929c-4287-a025-89789659a049
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-16 23:48:07", "repo_name": "smdb21/java-miape-api", "sub_path": "/src/main/java/org/proteored/miapeapi/cv/ms/CollisionPressure.java", "file_name": "CollisionPressure.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "9c58b10fc80f92f4366e12a89faff9530026dc28", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/smdb21/java-miape-api
297
FILENAME: CollisionPressure.java
0.287768
package org.proteored.miapeapi.cv.ms; import org.proteored.miapeapi.cv.Accession; import org.proteored.miapeapi.cv.ControlVocabularyManager; import org.proteored.miapeapi.cv.ControlVocabularySet; import org.proteored.miapeapi.cv.ControlVocabularyTerm; import org.proteored.miapeapi.cv.ControlVocabularyTermImpl; public class CollisionPressure extends ControlVocabularySet { private static final Accession COLLISION_GAS_PRESSURE_ACC = new Accession("MS:1000869"); private static final String COLLISION_GAS_PRESSURE_PREFERRED_NAME = "collision gas pressure"; private static CollisionPressure instance; public static CollisionPressure getInstance(ControlVocabularyManager cvManager) { if (instance == null) instance = new CollisionPressure(cvManager); return instance; } private CollisionPressure(ControlVocabularyManager cvManager) { super(cvManager); String[] explicitAccessionsTMP = { "MS:1000869" }; // collision gas // pressure this.explicitAccessions = explicitAccessionsTMP; this.miapeSection = -1; } public static ControlVocabularyTerm getCollisionPressureTerm() { return new ControlVocabularyTermImpl(COLLISION_GAS_PRESSURE_ACC, COLLISION_GAS_PRESSURE_PREFERRED_NAME); } }
8375053b-f112-41c6-8dff-5618e5f03403
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-12 11:47:10", "repo_name": "DEV-yeongji/taketo", "sub_path": "/project_yeongji_final/src/com/taketo/www/Command/AdminCommand/AdminLocalBoardSettingCommand.java", "file_name": "AdminLocalBoardSettingCommand.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "03a18ebcc3760f7dd779c148f527120b2d3c664a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/DEV-yeongji/taketo
221
FILENAME: AdminLocalBoardSettingCommand.java
0.286169
package com.taketo.www.Command.AdminCommand; import java.io.IOException; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.taketo.www.Command.Command; import com.taketo.www.DAO.CourseBoardDAO; import com.taketo.www.DTO.CourseBoardDTO; public class AdminLocalBoardSettingCommand implements Command { @Override public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { CourseBoardDAO dao = CourseBoardDAO.getCourseBoardDAO(); int curPage = 0; if(request.getParameter("curPage")!=null) { curPage = Integer.parseInt(request.getParameter("curPage")); } int cnt = dao.getCnt(); int maxPage = dao.getMaxPage(cnt); if(maxPage < 0) { maxPage =0; } ArrayList<CourseBoardDTO> cBoardList = dao.courseListDAO(curPage); request.setAttribute("list", cBoardList); request.setAttribute("maxPage", maxPage); } }
f2c428b0-96b5-4483-980e-ac133f878083
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-21 23:34:14", "repo_name": "qiuchili/ggnn_graph_classification", "sub_path": "/program_data/JavaProgramData/57/1313.java", "file_name": "1313.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "5404dc0c286cefa3427a8fea762d872dd043b139", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/qiuchili/ggnn_graph_classification
352
FILENAME: 1313.java
0.27513
package <missing>; public class GlobalMembers { public static int Main() { int i; int j; int n; int t; String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { n = Integer.parseInt(tempVar); } String w = new String(new char[MAX + 1]); String s = new String(new char[4]); String a = new String(new char[3]); for (i = 0;i < n;i++) { int k = 0; String tempVar2 = ConsoleInput.scanfRead(); if (tempVar2 != null) { w = tempVar2.charAt(0); } for (j = w.length() - 3;j <= w.length();j++) { s = tangible.StringFunctions.changeCharacter(s, k, w.charAt(j)); k++; } k = 0; for (j = w.length() - 2;j <= w.length();j++) { a = tangible.StringFunctions.changeCharacter(a, k, w.charAt(j)); k++; } if (strcmp(a,"er") == 0 || strcmp(a,"ly") == 0) { t = 2; } if (strcmp(s,"ing") == 0) { t = 3; } for (j = 0;j < w.length() - t;j++) { System.out.printf("%c",w.charAt(j)); } System.out.print("\n"); } return 0; } }