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 |
|---|---|---|---|---|---|---|
5aa28b1e-1d80-4afa-90e2-4706fc8c20b8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-12 12:14:31", "repo_name": "AnnaKulai79/eurocrab", "sub_path": "/src/main/java/ua/eurocrab/service/impl/FeedbackServiceImpl.java", "file_name": "FeedbackServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "d4c9363fba78f7fc8ed0d4660903a27f4966debf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AnnaKulai79/eurocrab | 220 | FILENAME: FeedbackServiceImpl.java | 0.290981 | package ua.eurocrab.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ua.eurocrab.domain.FeedbackDTO;
import ua.eurocrab.entity.FeedbackEntity;
import ua.eurocrab.repository.FeedbackRepository;
import ua.eurocrab.service.FeedbackService;
import ua.eurocrab.utils.ObjectMapperUtils;
import javax.transaction.Transactional;
import java.util.List;
@Service
public class FeedbackServiceImpl implements FeedbackService {
@Autowired
private FeedbackRepository feedbackRepository;
@Autowired
private ObjectMapperUtils modelMapper;
@Override
public List<FeedbackDTO> findAllFeedback() {
return modelMapper.mapAll(feedbackRepository.findAll(),FeedbackDTO.class);
}
@Override
public FeedbackDTO saveFeedback(FeedbackDTO feedbackDTO) {
return modelMapper.map(feedbackRepository.save(modelMapper.map(feedbackDTO, FeedbackEntity.class)),FeedbackDTO.class);
}
@Override
@Transactional
public void deleteFeedback(Long id) {
feedbackRepository.deleteById(id);
}
}
|
0d78011c-1834-43f9-a29b-6d7c9044560f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-23 21:06:59", "repo_name": "smallgod/library-dbmodels", "sub_path": "/src/main/java/com/library/datamodel/Constants/AccountType.java", "file_name": "AccountType.java", "file_ext": "java", "file_size_in_byte": 1068, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "fe047defeaa021390fed5249677bc6afcdbbf8ee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/smallgod/library-dbmodels | 211 | FILENAME: AccountType.java | 0.285372 | package com.library.datamodel.Constants;
import com.library.customexception.MyCustomException;
import com.library.sgsharedinterface.Constants;
import com.library.utilities.GeneralUtils;
/**
*
* @author smallgod
*/
public enum AccountType implements Constants {
PREPAID("PREPAID"),
POSTPAID("POSTPAID");
private final String enumValue;
AccountType(String enumValue) {
this.enumValue = enumValue;
}
@Override
public String getValue() {
return this.enumValue;
}
public static AccountType convertToEnum(String value) throws MyCustomException {
if (value != null) {
for (AccountType availableValue : AccountType.values()) {
if (value.equalsIgnoreCase(availableValue.getValue())) {
return availableValue;
}
}
}
MyCustomException error = GeneralUtils.getSingleError(ErrorCode.NOT_SUPPORTED_ERR, "Unsupported Account type", "Failed to convert account type: " + value + "to Enum");
throw error;
}
}
|
015e569d-35ba-4327-8860-99f165d0c31b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-01 08:16:32", "repo_name": "shilei0221/edu_xueyuan", "sub_path": "/edu_edustatis/src/main/java/cn/eduonline/edustatis/controller/StatisticsDailyController.java", "file_name": "StatisticsDailyController.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "b23ccd8051a84d67bf2de80ead5faa7addb0cb52", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shilei0221/edu_xueyuan | 247 | FILENAME: StatisticsDailyController.java | 0.262842 | package cn.eduonline.edustatis.controller;
import cn.eduonline.common.R;
import cn.eduonline.edustatis.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* <p>
* 网站统计日数据 前端控制器
* </p>
*
* @author Alei
* @since 2019-07-27
*/
@RestController
@RequestMapping("/edustastics/countData")
@CrossOrigin
public class StatisticsDailyController {
@Autowired
private StatisticsDailyService dailyService;
//根据时间范围查询统计数据
@GetMapping("/showCharts/{type}/{begin}/{end}")
public R showCharts(@PathVariable String type,
@PathVariable String begin,
@PathVariable String end){
Map<String,Object> map = dailyService.getChartsData(type,begin,end);
return R.ok().data(map);
}
//根据某一天获取注册人数 添加到数据库中
@GetMapping("createData/{day}")
public R createData(@PathVariable String day) {
dailyService.createStatisData(day);
return R.ok();
}
}
|
1f032aaf-b5ad-4187-ba01-267e44ab16b6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-30T08:47:39", "repo_name": "bazelbuild/continuous-integration", "sub_path": "/gitsync/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1171, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "0d5d1112716d01f79ee2d74e7b50733614e684d6", "star_events_count": 253, "fork_events_count": 160, "src_encoding": "UTF-8"} | https://github.com/bazelbuild/continuous-integration | 283 | FILENAME: README.md | 0.23231 | # Building the Docker container
```
$ docker build -t gcr.io/bazel-public/gitsync .
$ docker push gcr.io/bazel-public/gitsync
```
# Starting the VM that hosts the Docker container
```
$ gcloud compute instances delete --project bazel-public gitsync
$ gcloud compute instances create-with-container \
--project bazel-public \
--boot-disk-size 200GB \
--container-image gcr.io/bazel-public/gitsync:latest \
--machine-type n1-standard-2 \
--zone us-central1-a \
--image-project cos-cloud \
--image-family cos-stable \
--metadata cos-metrics-enabled=true \
--scopes cloud-platform \
--service-account gitsync@bazel-public.iam.gserviceaccount.com \
gitsync
```
# About the service account
The service account used for the container must have at least the following
permissions:
- `Cloud KMS Decryption` for the gitcookies and SSH key files only.
- `Logging > Logs Writer` to write the Docker logs to Google Cloud Logging.
# Getting logs from the container
You can view the Docker logs by navigating to the VM in GCE and then by either clicking on "Stackdriver logging" or ssh-ing into the machine and running `docker logs`.
|
4f2a0c17-ffea-4e00-8505-f27f75324ba1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-08-25 12:37:02", "repo_name": "sendhilcoep/InventoryManagement", "sub_path": "/authentication/authentication/model/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1091, "line_count": 72, "lang": "en", "doc_type": "code", "blob_id": "ff22f48fe43a69a6e9bece66f3e56540278d8b26", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sendhilcoep/InventoryManagement | 245 | FILENAME: User.java | 0.23793 | package authentication.model;
public class User {
int id;
String username;
String password;
int privilege;
int employeeId;
public User(String username, String password, int privilege, int employeeId){
this.username = username;
this.password = password;
this. privilege = privilege;
this.employeeId = employeeId;
}
public User() {
}
public User(String username, String password) {
this.username = username;
this.password = password;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getPrivilege() {
return privilege;
}
public void setPrivilege(int privilege) {
this.privilege = privilege;
}
public int getEmployeeId() {
return employeeId;
}
public void setEmployeeId(int employeeId) {
this.employeeId = employeeId;
}
}
|
1cf80fd3-5da6-4f4d-84c3-07428ec81f07 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-23 21:00:07", "repo_name": "dominique-unruh/onthefly", "sub_path": "/src/main/java/de/unruh/onthefly/inlays/Collector.java", "file_name": "Collector.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "37811366dae3ad30093b4bbe2b4a5ebaf127d5e1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dominique-unruh/onthefly | 237 | FILENAME: Collector.java | 0.29584 | package de.unruh.onthefly.inlays;
import com.intellij.codeInsight.hints.InlayHintsCollector;
import com.intellij.codeInsight.hints.InlayHintsSink;
import com.intellij.codeInsight.hints.presentation.*;
import com.intellij.openapi.editor.Editor;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@SuppressWarnings("UnstableApiUsage")
public class Collector implements InlayHintsCollector {
static AtomicLong counter = new AtomicLong();
static long id = counter.getAndIncrement();
@Override
public boolean collect(@NotNull PsiElement element, @NotNull Editor editor, @NotNull InlayHintsSink inlayHintsSink) {
if (!(element instanceof PsiWithInlay)) return true;
PsiWithInlay psiWithInlay = (PsiWithInlay) element;
InlayPresentation inlayPresentation = new Presentation(editor, psiWithInlay.getInlay(id));
inlayHintsSink.addBlockElement(element.getTextRange().getEndOffset(), true, false, 0, inlayPresentation);
return true;
}
}
|
8308801d-0ef3-49fe-92ef-dd50316fba9d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-28 01:43:43", "repo_name": "leeahua/dream", "sub_path": "/src/main/java/com/next/dream/service/RedisService.java", "file_name": "RedisService.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "ad978f080d33e6183b66c01f3de58711426607b6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/leeahua/dream | 270 | FILENAME: RedisService.java | 0.243642 | package com.next.dream.service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;
/**
* 描述:〈redis〉
*
* @author liyaohua
* create on 2018/3/8
* @version 1.0
*/
@Component
@Slf4j
public class RedisService {
@Autowired
private RedisTemplate redisTemplate;
private final long TIME_OUT = 60*60; //一个小时 秒
public void set(String key, Object obj,long timeout, TimeUnit outTime){
ValueOperations<String, Object> operations = redisTemplate.opsForValue();
operations.set(key, obj, timeout,outTime);
log.info("key:{},添加缓存成功",key);
}
public Object get(String key){
ValueOperations<String, Object> operations = redisTemplate.opsForValue();
return operations.get(key);
}
public void remove(String key){
if(redisTemplate.hasKey(key)) {
redisTemplate.delete(key);
log.info("key:{},已从缓存中删除!"+key);
}
}
}
|
e1a15222-8418-45a2-971f-14cc97ce3aa7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-09-01 03:17:00", "repo_name": "Team1BTBKSHRD/News-Management-MVC-Web-Final-Project", "sub_path": "/src/Model/DTO/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1068, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "eaff196ac2b8f4643a8491fdf471cb22a9bd7667", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/Team1BTBKSHRD/News-Management-MVC-Web-Final-Project | 258 | FILENAME: User.java | 0.2227 | /**
*
*/
package Model.DTO;
import java.io.Serializable;
/**
* @author Pisal
*
*/
public class User implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private int user_id;
private String user_name;
private String user_pass;
private String user_type;
public User() {
}
public User(int user_id, String user_name, String user_pass,
String user_type) {
super();
this.user_id = user_id;
this.user_name = user_name;
this.user_pass = user_pass;
this.user_type = user_type;
}
public int getUser_id() {
return user_id;
}
public void setUser_id(int user_id) {
this.user_id = user_id;
}
public String getUser_name() {
return user_name;
}
public void setUser_name(String user_name) {
this.user_name = user_name;
}
public String getUser_pass() {
return user_pass;
}
public void setUser_pass(String user_pass) {
this.user_pass = user_pass;
}
public String getUser_type() {
return user_type;
}
public void setUser_type(String user_type) {
this.user_type = user_type;
}
}
|
b38df957-285e-4d4b-94af-b220b8a8ac1d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-21 03:55:41", "repo_name": "DraperHXY/PMIS", "sub_path": "/src/test/java/com/draper/common/util/JWTUtilTest.java", "file_name": "JWTUtilTest.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "ee6b4d5809a70b814d7426f268af061213970cf2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DraperHXY/PMIS | 249 | FILENAME: JWTUtilTest.java | 0.285372 | package com.draper.common.util;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.security.Keys;
import org.junit.Test;
import java.security.Key;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.*;
public class JWTUtilTest {
@Test
public void sign() {
Map<String, Object> payload = new HashMap<>();
payload.put("sub", "Draper");
payload.put("wid", 123456);
String jws = JWTUtil.sign(payload, null, JWTUtil.DEFAULT_EXPIRE_TIME);
System.out.println("jws = " + jws);
Jws<Claims> claimsJws = JWTUtil.verify(jws);
System.out.println(claimsJws.getBody().getSubject());
System.out.println(claimsJws.getBody().get("wid"));
}
@Test
public void verify() {
}
@Test
public void key() {
Key key = Keys.secretKeyFor(SignatureAlgorithm.HS256);
System.out.println(key.getAlgorithm());
System.out.println(key.getEncoded());
}
} |
fd0c05ad-0209-4315-8847-9e9ecd0f12be | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-01 17:55:51", "repo_name": "OrganizacionVictorRuiz/20161201_VictorRuiz", "sub_path": "/src/main/java/es/albarregas/etiquetas/Cesar.java", "file_name": "Cesar.java", "file_ext": "java", "file_size_in_byte": 1163, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "0328d7b8b86e59321f58b836e28b11cb2f823adf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/OrganizacionVictorRuiz/20161201_VictorRuiz | 262 | FILENAME: Cesar.java | 0.285372 | package es.albarregas.etiquetas;
import java.io.IOException;
import java.io.Writer;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;
public class Cesar extends TagSupport{
private String cadena;
public void setCadena(String cadena) {
this.cadena = cadena;
}
@Override
public int doStartTag() throws JspException {
Writer out = pageContext.getOut();
this.cadena = (cadena == null || cadena.length() == 0)?"Hola Mundo JSP":cadena;
return Tag.EVAL_BODY_INCLUDE;
}
@Override
public int doEndTag() throws JspException {
Writer out = pageContext.getOut();
for (int i = 0; i < cadena.length(); i++) {
try {
out.write(cadena.charAt(i) + " = " + cadena.codePointAt(i)+"\n ");
} catch (IOException ex) {
Logger.getLogger(Cesar.class.getName()).log(Level.SEVERE, null, ex);
}
}
return Tag.EVAL_PAGE;
}
}
|
a450205e-88ad-4b2b-a4f6-4dda3f91b70e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-30T21:27:37", "repo_name": "psalmprax/ProjectNew", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1192, "line_count": 55, "lang": "en", "doc_type": "text", "blob_id": "0266dafb784e1c4ca4ae05e7891049c165fd6446", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/psalmprax/ProjectNew | 272 | FILENAME: README.md | 0.285372 | # Spark Structured Streaming Project
A Python task for analysing real-time data ingestion using Kafka and Spark Structured Streaming.
To run the producer and kafka services:
`install docker and docker-compose on the server`
and
`docker-compose up -d --build`
To run the consumer from spark-master:
`docker exec spark-master bash scripts/start_consumer.sh`
## Producer
* API data:
* Request: From Publisher Class.
```
{
"id": data.get("id"),
"first_name": data.get("first_name"),
"last_name": data.get("last_name"),
"email": data.get("email"),
"gender": data.get("gender"),
"ip_address": data.get("ip_address"),
"date": data.get("date"),
"country": data.get("country"),
"user": "user",
"timestamp_logger": current_milli_time()
}
```
* Produces into Kafka topic: `data`
## Consumer
* Reads from `data`
* Uses Spark Structured Streaming
* Calculates moving total by countries and users (with window, slide and watermark)
* Sinking: Console
## Additional Services
* JMX (Java Management Extensions) Exporter for Prometheus: For Prometheus to consume Java based metrics
* Prometheus: Scraping and storing metrics in a time series db (this is set for Kafka topic monitoring)
|
dfd0fb2b-48f1-40a2-a033-2d052165d3cd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-19 09:45:15", "repo_name": "Linklmm/mini-spring", "sub_path": "/framework/src/main/java/com/lmm/starter/MiniApplication.java", "file_name": "MiniApplication.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "05f76d8a133a25e593fd1ca267d554708b0ec534", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Linklmm/mini-spring | 257 | FILENAME: MiniApplication.java | 0.236516 | package com.lmm.starter;
import com.lmm.beans.BeanFactory;
import com.lmm.core.ClassScanner;
import com.lmm.web.handler.HandlerManager;
import com.lmm.web.sever.TomcatServer;
import org.apache.catalina.LifecycleException;
import java.util.List;
/**
* 版权声明:Copyright(c) 2019
*
* @program: mini-spring
* @Author myFlowerYourGrass
* @Date 2019-09-19 14:06
* @Version 1.0
* @Description
*/
public class MiniApplication {
public static void run(Class<?> cls,String[] args){
System.out.println("Hello MiniApplication");
TomcatServer tomcatServer = new TomcatServer(args);
try {
tomcatServer.startServer();
//获取所有的class
List<Class<?>> classList = ClassScanner.scanClasses(cls.getPackage().getName());
BeanFactory.initBean(classList);
//调用handlerManager处理类中所有的handler
HandlerManager.resolveMappingHandler(classList);
classList.forEach(it-> System.out.println(it));
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
0dfffdd9-37dc-41b1-b0ce-6e1f093ea5fd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-05 04:34:28", "repo_name": "linbingxing/tank", "sub_path": "/tank-user-center/user-center-api/src/main/java/com/tank/user/entity/SysDictType.java", "file_name": "SysDictType.java", "file_ext": "java", "file_size_in_byte": 1264, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "8ca2ce6fdf94ea89c2a0d6bd924f02e54cb84798", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/linbingxing/tank | 278 | FILENAME: SysDictType.java | 0.221351 | package com.tank.user.entity;
import com.tank.common.model.SuperEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
/**
* <p>
* 字典类型表
* </p>
*
* @author lbx
* @since 2019-11-03
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SysDictType对象", description="字典类型表")
public class SysDictType extends SuperEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "字典类型编码")
private String code;
@ApiModelProperty(value = "字典类型名称")
private String name;
@ApiModelProperty(value = "字典描述")
private String description;
@ApiModelProperty(value = "是否是系统字典,0、否 1、是")
@TableField("sysFlag")
private Boolean sysFlag;
@ApiModelProperty(value = "状态(0 冻结、1 激活 )")
private Boolean status;
@ApiModelProperty(value = "排序")
private Integer sort;
}
|
3eb85a3c-0f09-4b6c-8353-56c5ac1c443a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-07 16:52:20", "repo_name": "tdashton/thermoAndroidPi", "sub_path": "/app/src/main/java/com/ashtonandassociates/thermopi/connectivity/ConnectionReceiver.java", "file_name": "ConnectionReceiver.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "4b1879a530f401a28f5f34589415701db2fbabbd", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tdashton/thermoAndroidPi | 192 | FILENAME: ConnectionReceiver.java | 0.245085 | package com.ashtonandassociates.thermopi.connectivity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
/**
* Created by tdashton on 28.02.18.
*/
public class ConnectionReceiver extends BroadcastReceiver {
public static Integer CONNECTION_ACTIVITY_IS_CONNECTED = 1;
public static String TAG = ConnectionReceiver.class.getSimpleName();
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction() == ConnectivityManager.CONNECTIVITY_ACTION) {
ConnectivityManager connectivityManager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo =
connectivityManager.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected()) {
BroadcastReceiverManager.getInstance().notifyReceivers(context, intent, this.CONNECTION_ACTIVITY_IS_CONNECTED);
}
}
}
}
|
b3f90505-c7a5-49b9-ac25-a64b9d1ef58b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-09 14:00:48", "repo_name": "afdolash/spiro_2", "sub_path": "/app/src/main/java/com/pens/afdolash/spiro/main/FinishFragment.java", "file_name": "FinishFragment.java", "file_ext": "java", "file_size_in_byte": 1232, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "0e34e6d33d6cd4199c9b17309dbad188348c0aea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/afdolash/spiro_2 | 223 | FILENAME: FinishFragment.java | 0.236516 | package com.pens.afdolash.spiro.main;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.CardView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.pens.afdolash.spiro.R;
/**
* A simple {@link Fragment} subclass.
*/
public class FinishFragment extends Fragment {
private CardView cardAgree;
public FinishFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_finish, container, false);
cardAgree = (CardView) view.findViewById(R.id.card_agree);
cardAgree.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
((MainActivity) getActivity()).finish();
Intent intent = new Intent(getContext(), MainActivity.class);
startActivity(intent);
}
});
return view;
}
}
|
59c5c90b-94fb-40cb-a6d2-478b2753fe1d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-10 01:28:39", "repo_name": "phronesys/EDDyA", "sub_path": "/Tareas/Tarea5/sortingtool.java", "file_name": "sortingtool.java", "file_ext": "java", "file_size_in_byte": 1163, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "389fdc84e550701cdd220cb61e70b6740d3fda5e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/phronesys/EDDyA | 230 | FILENAME: sortingtool.java | 0.295027 | import java.util.*;
import java.io.*;
public class sortingtool {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int M = scan.nextInt();
LinkedHashMap<Integer, Integer> nums = new LinkedHashMap<Integer, Integer>();
for(int i = 0; i < N; i++)
{
int n = scan.nextInt();
int count = nums.containsKey(n) ? nums.get(n) : 0;
nums.put(n, count + 1);
}
//System.out.println(nums);
do{
Map.Entry<Integer, Integer> max = null;
for(Map.Entry<Integer, Integer> entry: nums.entrySet())
{
if(max == null || entry.getValue().compareTo(max.getValue()) > 0)
{
max = entry;
}
for(int i = 0; i < max.getValue();i++)
{
System.out.print(max.getKey()+ " ");
}
break;
}
nums.remove(max.getKey());
}while(!nums.isEmpty());
scan.close();
}
}
|
5a373e2d-990f-4f4e-98d4-045a66dde32c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-29 11:27:58", "repo_name": "busliksuslik/SPTVR19MySchool", "sub_path": "/src/entity/Person.java", "file_name": "Person.java", "file_ext": "java", "file_size_in_byte": 1189, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "0ec1f7e8e51895b2f963de48394bb45fdcd7cd04", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/busliksuslik/SPTVR19MySchool | 259 | FILENAME: Person.java | 0.221351 | /*
* 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 entity;
import java.io.Serializable;
/**
*
* @author user
*/
public class Person implements Serializable{
private String name;
private String secName;
private String phone;
private String role;
public Person() {
}
public Person(String name, String secName, String phone, String role) {
this.name = name;
this.secName = secName;
this.phone = phone;
this.role = role;
}
public String getName() {
return name;
}
public String getSecName() {
return secName;
}
public String getPhone() {
return phone;
}
public String getRole() {
return role;
}
public void setName(String name) {
this.name = name;
}
public void setSecName(String secName) {
this.secName = secName;
}
public void setPhone(String phone) {
this.phone = phone;
}
public void setRole(String role) {
this.role = role;
}
}
|
71c06bd7-32b9-4416-906c-d85b3e24db6d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-17 20:22:26", "repo_name": "krd/jpa-inheritence", "sub_path": "/src/test/java/com/krd/jpa/inheritance/repository/joinedtable/TieFighterRepositoryIntegrationTest.java", "file_name": "TieFighterRepositoryIntegrationTest.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "5218c88d464ea6d6ca1ae20ffe9c31449a611982", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/krd/jpa-inheritence | 228 | FILENAME: TieFighterRepositoryIntegrationTest.java | 0.277473 | package com.krd.jpa.inheritance.repository.joinedtable;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
public class TieFighterRepositoryIntegrationTest {
@Autowired
private TieFighterRepository tieFighterRepository;
@Autowired
private VehicleRepository vehicleRepository;
@Test
public void whenNewModel_thenSaveEntity() {
// Vehicle tableperclass = new Vehicle();
// vehicleRepository.save(tableperclass);
// Optional<Vehicle> found = vehicleRepository.findById(1L);
// assert found.isPresent();
// TieFighter tieFighter = new TieFighter();
// tieFighter.setBlasterDamage(100);
// tieFighter.setEscapePod(false);
// tieFighter.setStyle("Interceptor");
//// tieFighter.setVehicleId(1L);
// tieFighter.setTopSpeed(100);
// tieFighter.setNumberOfPilots(1);
//
// tieFighterRepository.save(tieFighter);
}
}
|
5493ed5b-1250-49e4-b4aa-410d1b42c67b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-31 21:12:49", "repo_name": "zamalex/Mawared", "sub_path": "/app/src/main/java/app/mawared/alhayat/forgot/ForgotViewModel.java", "file_name": "ForgotViewModel.java", "file_ext": "java", "file_size_in_byte": 1163, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "db39c294c5f520b7e6f21ef4dc7c2b298af90ee1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zamalex/Mawared | 220 | FILENAME: ForgotViewModel.java | 0.26588 | package app.mawared.alhayat.forgot;
import android.util.Log;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.google.gson.JsonObject;
import app.mawared.alhayat.api.RetrofitClient;
import app.mawared.alhayat.forgot.model.ForgotModel;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class ForgotViewModel extends ViewModel {
MutableLiveData<ForgotModel> res = new MutableLiveData<>();
void forgotPass(JsonObject jsonObject) {
RetrofitClient.getApiInterface().forgotPass(jsonObject).enqueue(new Callback<ForgotModel>() {
@Override
public void onResponse(Call<ForgotModel> call, Response<ForgotModel> response) {
if (response.isSuccessful())
res.setValue(response.body());
else
res.setValue(null);
Log.d("rere2", "done");
}
@Override
public void onFailure(Call<ForgotModel> call, Throwable t) {
Log.d("rere2", t.getMessage());
res.setValue(null);
}
});
}
}
|
fc124411-dc0d-4d06-b373-d54dd85149a0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-09 02:49:37", "repo_name": "gzchen008/jeesite", "sub_path": "/src/main/java/com/vanroid/dachuang/common/DaChuangUtils.java", "file_name": "DaChuangUtils.java", "file_ext": "java", "file_size_in_byte": 1276, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "33ae3b707e29477c9f70a61a00de08e3ed9fa7a9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gzchen008/jeesite | 290 | FILENAME: DaChuangUtils.java | 0.277473 | package com.vanroid.dachuang.common;
import com.thinkgem.jeesite.modules.sys.entity.Office;
import com.thinkgem.jeesite.modules.sys.entity.Role;
import com.thinkgem.jeesite.modules.sys.entity.User;
import org.apache.log4j.Logger;
import java.util.Iterator;
import java.util.List;
/**
* Created by cgz on 16-10-22.
*/
public class DaChuangUtils {
public static final Logger logger = Logger.getLogger(DaChuangUtils.class);
public static final String BASE_OFFICE = "总部";
public static void transformUser(User user) {
// 设置用户类型为2:部门经理
user.setUserType("2");
}
public static void transformRoleList(List<Role> roleList) {
for (Iterator<Role> iter = roleList.iterator(); iter.hasNext(); ) {
if (iter.next().getId().equals("1")) {
iter.remove();
}
}
}
public static Office transformChildOffices(List<Office> childOffices) {
for (Office o : childOffices) {
if (o.getName().equals(BASE_OFFICE))
return o;
}
logger.error("没有找到[总部]部门");
return null;
}
public static void exceptionInTest() {
if (true)
throw new RuntimeException("test");
}
}
|
2419cc82-18e4-452c-8580-10f1bbe7297a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-02 07:58:40", "repo_name": "wangyanmin1998/CombatWeek1", "sub_path": "/app/src/main/java/com/bwie/combatweek1/view/view/view/fragment/HomeFragment.java", "file_name": "HomeFragment.java", "file_ext": "java", "file_size_in_byte": 1189, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "8db71bb0e2d238fd07df8afc036afc31287c8455", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wangyanmin1998/CombatWeek1 | 227 | FILENAME: HomeFragment.java | 0.205615 | package com.bwie.combatweek1.view.view.view.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bwie.combatweek1.R;
import com.bwie.combatweek1.view.view.base.BaseFragment;
import com.bwie.combatweek1.view.view.utile.NetUtile;
/**
* A simple {@link Fragment} subclass.
*/
public class HomeFragment extends BaseFragment {
private TextView textView;
private ImageView imageView;
@Override
protected void initView(View inflate) {
textView = inflate.findViewById(R.id.tv_one);
imageView = inflate.findViewById(R.id.iv_one);
}
@Override
protected int layoutId() {
return R.layout.fragment_home;
}
@Override
protected void initData() {
if (NetUtile.getInstance().hasNet(getActivity())){
textView.setVisibility(View.VISIBLE);
imageView.setVisibility(View.GONE);
}else {
textView.setVisibility(View.GONE);
imageView.setVisibility(View.VISIBLE);
}
}
}
|
f1e329f0-2249-4872-a053-eeca5fea109a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-25 18:19:23", "repo_name": "ISGA9371/GEFAMVC", "sub_path": "/src/main/java/com/mx/bbva/business/service/impl/LevelTypeServiceImpl.java", "file_name": "LevelTypeServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "307d4ab8bf0db6590c60b31f6471088d4b29c7fb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ISGA9371/GEFAMVC | 197 | FILENAME: LevelTypeServiceImpl.java | 0.249447 | package com.mx.bbva.business.service.impl;
import com.mx.bbva.business.entity.LevelType;
import com.mx.bbva.business.repository.LevelTypeRepository;
import com.mx.bbva.business.service.LevelTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class LevelTypeServiceImpl implements LevelTypeService {
private LevelTypeRepository levelTypeRepository;
@Override
public List<LevelType> findAllLevelTypes() {
return levelTypeRepository.findAll();
}
@Override
public LevelType findByLevelTypeName(String levelTypeName) {
return levelTypeRepository.findByLevelTypeName(levelTypeName);
}
@Override
public LevelType findOneLevelType(Integer levelTypeId) {
return levelTypeRepository.findById(levelTypeId).orElse(null);
}
@Autowired
public void setLevelTypeRepository(LevelTypeRepository levelTypeRepository) {
this.levelTypeRepository = levelTypeRepository;
}
}
|
92a0c844-72d9-4135-b2b4-d103a1359bbe | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-11 21:26:51", "repo_name": "Pyshankov/SpringSecurityRedis", "sub_path": "/src/main/java/com/example/security/HttpSessionConfig.java", "file_name": "HttpSessionConfig.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "6917221a366526abbee78e36cf1f56ab0a4615ec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Pyshankov/SpringSecurityRedis | 207 | FILENAME: HttpSessionConfig.java | 0.236516 | package com.example.security;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.web.http.HeaderHttpSessionStrategy;
import org.springframework.session.web.http.HttpSessionStrategy;
import redis.clients.jedis.Protocol;
import redis.embedded.RedisServer;
import javax.annotation.PreDestroy;
import java.io.IOException;
/**
* Created by pyshankov on 11.10.2016.;
*/
@EnableRedisHttpSession
public class HttpSessionConfig {
private static RedisServer redisServer;
@Bean
public JedisConnectionFactory connectionFactory() throws IOException {
redisServer = new RedisServer(Protocol.DEFAULT_PORT);
redisServer.start();
return new JedisConnectionFactory();
}
@PreDestroy
public void destroy() {
redisServer.stop();
}
@Bean
public HttpSessionStrategy httpSessionStrategy() {
return new HeaderHttpSessionStrategy();
}
} |
d249cb9f-25cf-49dd-9217-4636676e5781 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-19 15:27:30", "repo_name": "allanbrock/enccollegesim", "sub_path": "/src/com/endicott/edu/models/CollegeErrorMessage.java", "file_name": "CollegeErrorMessage.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "092893d02005af6d8114f0ac9020ee6e996ccd55", "star_events_count": 2, "fork_events_count": 5, "src_encoding": "UTF-8"} | https://github.com/allanbrock/enccollegesim | 174 | FILENAME: CollegeErrorMessage.java | 0.200558 | package com.endicott.edu.models;
//import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.Serializable;
//@XmlRootElement
public class CollegeErrorMessage implements Serializable {
private String errorMessage;
private int errorCode;
private String documentation;
public CollegeErrorMessage(String errorMessage, int errorCode, String documentation) {
this.errorMessage = errorMessage;
this.errorCode = errorCode;
this.documentation = documentation;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public int getErrorCode() {
return errorCode;
}
public void setErrorCode(int errorCode) {
this.errorCode = errorCode;
}
public String getDocumentation() {
return documentation;
}
public void setDocumentation(String documentation) {
this.documentation = documentation;
}
}
|
168069ca-aa05-4fca-856e-cc6bc7eb310c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-01-09T09:15:06", "repo_name": "otissv/redesign", "sub_path": "/ui/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1109, "line_count": 92, "lang": "en", "doc_type": "text", "blob_id": "8e02d9f1778d43a2e09ae1d4bf6f1a75f2c3fcda", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/otissv/redesign | 303 | FILENAME: README.md | 0.217338 | # Redesign UI
React Design System built with Emotion base on Atomic Design.
## Installation
`npm install @redesign-system/ui @redesign-system/ui-core @redesign-system/theme @redesign-system/material-icons`
or
`yarn add @redesign-system/ui @redesign-system/ui-core @redesign-system/theme @redesign-system/material-icons`
## Theme
A Global and normalized css theme is provide for html elements by default
Component themes can be overwritten via `ThemeProvider`.
## Components
### Atoms
- Alert
- Badge
- Box
- Button
- Caption
- Checkbox
- Close
- Copyright
- Error Message
- Figure
- Google Maps
- Image
- JSON
- Label
- Ledgend
- Link
- List
- Main
- Nav
- Overlay
- Radio
- Textarea
- Textbox
- Timer
- Toggle
- Timer
- Toggle
- Typography
- Video
### Molecules
- AppBar
- Button Group
- Button Icon
- Cover Image
- Dropdown
- Fieldset
- Form Textbox
- Header
- Heading
- Pagination
- Section
- Switch
- Toolbar
### Organisms
- Accordion
- Table
- Tabs
### Helpers
- Either
- Maybe
- Portal
## Hooks
- useBoolean
- useSelected
- useString
- useTimeRemaining
- useViewport
## License
MIT
|
0120d92f-3c7a-4f02-8f2e-dd3b1b9ce106 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-04 10:59:06", "repo_name": "2242575739gyk/gyk_idea-ssm", "sub_path": "/jiyun-springboot-test2/src/main/java/cn/juhyun/service/jiyunspringboottest2/controller/UserController.java", "file_name": "UserController.java", "file_ext": "java", "file_size_in_byte": 1213, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "355f530ee256e46c846717421b142eb5ee2e72b6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/2242575739gyk/gyk_idea-ssm | 264 | FILENAME: UserController.java | 0.259826 | package cn.juhyun.service.jiyunspringboottest2.controller;
import cn.juhyun.service.jiyunspringboottest2.pojo.User;
import cn.juhyun.service.jiyunspringboottest2.service.UserService;
import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("consuer/user")
@DefaultProperties//(defaultFallback ="getUserFallBack")
public class UserController {
@Autowired
private UserService userService;
@GetMapping
@ResponseBody
//@HystrixCommand//(fallbackMethod = "getUserFallBack")
public String findByList(@RequestParam("ids")List<Integer> ids){
// try {
// Thread.sleep(6000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// if(ids.get(0)==1){
// throw new RuntimeException("太忙了");
// }
return this.userService.findById(ids).toString();
}
// public String getUserFallBack(){
// return "请求失败,稍后重试";
// }
}
|
2c57e057-fb53-450d-af97-1b9139ff8208 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-01-12 19:34:04", "repo_name": "harjassingh0007/unix-tools", "sub_path": "/src/harjassi/unixtools/FileOperations.java", "file_name": "FileOperations.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "c0b88c7d8df850876db752214351b92a1481bd26", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/harjassingh0007/unix-tools | 183 | FILENAME: FileOperations.java | 0.267408 | package harjassi.unixtools;
import java.io.*;
public class FileOperations {
public String readFile(String fileName){
String current_line = null;
String data="";
try{
BufferedReader reader = new BufferedReader(new FileReader(fileName));
while ((current_line = reader.readLine()) != null) {
data = data + current_line+"\n";
}
}
catch(Exception exp){
System.out.println("Something Went Wrong in Reading File");
}
return data.substring(0,data.length()-1);
}
public void writeFile(String fileName,String data){
try {
PrintWriter writer = new PrintWriter(fileName, "UTF-8");
String[] temp = data.split("\n");
for(String line : temp)
writer.println(line);
writer.close();
}
catch(Exception exp){
System.out.println("Something Went Wrong in Writing File");
}
}
}
|
4cda6b07-97e6-4b69-9c5d-e85e9e1ee760 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-05 05:50:22", "repo_name": "Iconzjy/JD", "sub_path": "/src/main/test/com/springmvc/dao/UserMapperTest.java", "file_name": "UserMapperTest.java", "file_ext": "java", "file_size_in_byte": 1061, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "a3027b0844e9224f235ec8125960e8ca29f4dc19", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Iconzjy/JD | 187 | FILENAME: UserMapperTest.java | 0.225417 | package com.springmvc.dao;
import com.springmvc.entity.User;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import static org.junit.Assert.*;
public class UserMapperTest {
private ApplicationContext applicationContext;
@Autowired
private UserMapper userMapper;
@Before
public void setUserMapper() throws Exception{
applicationContext = new ClassPathXmlApplicationContext("classpath:spring/applicationContext.xml");
userMapper = applicationContext.getBean(UserMapper.class);
}
@Test
public void insertSelective() {
User user = userMapper.selectByPrimaryKey(1);
System.out.println(user.getId()+" "+user.getName()+" "+user.getPwd());
userMapper.deleteByPrimaryKey(2);
}
@Test
public void selectByPrimaryKey() {
}
} |
9b851313-4cdc-40fe-88a4-819fefaf306a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-27 15:55:19", "repo_name": "Acronus2008/r2dbc_kafka_experiment", "sub_path": "/src/main/java/com/acl/r2oracle/kafka/experiments/facade/r2/impl/ProcessorFacadeImpl.java", "file_name": "ProcessorFacadeImpl.java", "file_ext": "java", "file_size_in_byte": 1040, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "baa6a9924cdf120d412070fb76a53706157f7888", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Acronus2008/r2dbc_kafka_experiment | 218 | FILENAME: ProcessorFacadeImpl.java | 0.259826 | package com.acl.r2oracle.kafka.experiments.facade.r2.impl;
import com.acl.r2oracle.kafka.experiments.core.facade.stereotype.Facade;
import com.acl.r2oracle.kafka.experiments.service.xml.contract.to.ItemTO;
import com.acl.r2oracle.kafka.experiments.core.facade.Result;
import com.acl.r2oracle.kafka.experiments.facade.r2.ProcessorFacade;
import com.acl.r2oracle.kafka.experiments.service.xml.ExperimentService;
import reactor.core.publisher.Mono;
@Facade("processorFacade")
public class ProcessorFacadeImpl implements ProcessorFacade {
private final ExperimentService experimentService;
public ProcessorFacadeImpl(ExperimentService experimentService) {
this.experimentService = experimentService;
}
@Override
public Mono<Result<Void>> execute() {
return this.experimentService.read()
.map(Result::successful);
}
@Override
public Mono<Result<Void>> create(ItemTO item) {
return this.experimentService.create(item)
.map(Result::successful);
}
}
|
97f21fa9-453a-4c82-8e48-2c0b79ef6381 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-31 14:26:52", "repo_name": "dingey/dubbo-demo", "sub_path": "/dubbo-demo-provider/src/main/java/com/d/base/BaseEntity.java", "file_name": "BaseEntity.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "aa7017f0bc6e27c5a4c5e99b5dcc91cf9417b681", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dingey/dubbo-demo | 276 | FILENAME: BaseEntity.java | 0.285372 | package com.d.base;
import java.io.Serializable;
import com.d.base.SqlProvider.Id;
import com.d.base.SqlProvider.Transient;
/**
* @author di
*/
public class BaseEntity<T> implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
public static final int DEL_FLAG_NORMAL = 0;
public static final int DEL_FLAG_DELETE = 1;
public static final int DEL_FLAG_AUDIT = 2;
@Id
private long id;
private int delFlag;
@Transient
private boolean newRecord;
public BaseEntity() {
super();
this.id = 0;
this.delFlag = 0;
this.newRecord = false;
}
public BaseEntity(long id) {
super();
this.id = id;
}
public int getDelFlag() {
return delFlag;
}
public void setDelFlag(int delFlag) {
this.delFlag = delFlag;
}
public long getId() {
return id;
}
@SuppressWarnings("unchecked")
public T setId(long id) {
this.id = id;
return (T) this;
}
public boolean isNewRecord() {
return this.newRecord || this.getId() <= 0;
}
public void setNewRecord(boolean newRecord) {
this.newRecord = newRecord;
}
}
|
8667652c-677d-4d7a-ab67-2473342e1e7c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-21 21:39:25", "repo_name": "caioschristino/coaching", "sub_path": "/app/src/main/java/com/v2/coaching/data/model/Knock.java", "file_name": "Knock.java", "file_ext": "java", "file_size_in_byte": 1163, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "85fb0bcb359fa749f2c6dd4b1020904e47b58362", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/caioschristino/coaching | 279 | FILENAME: Knock.java | 0.26971 | package com.v2.coaching.data.model;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.field.ForeignCollectionField;
import com.j256.ormlite.table.DatabaseTable;
import java.util.ArrayList;
import java.util.Collection;
/**
* Created by CaioSChristino on 03/09/17.
*/
@DatabaseTable
public class Knock {
@DatabaseField(columnName = "id", generatedId = true)
private int id;
@DatabaseField
private int point;
@DatabaseField
private String name;
@DatabaseField(foreign=true,foreignAutoRefresh=true)
private Fight fight;
@ForeignCollectionField
private Collection<KnockSessionFight> mKnockForeignCollection = new ArrayList<>();
public Knock() {
}
public Knock(String name, int point, Fight fight) {
this.point = point;
this.fight = fight;
this.name = name;
}
public int getPoint() {
return point;
}
public Fight getFight() {
return fight;
}
public void setFight(Fight fight) {
this.fight = fight;
}
public String getName() {
return name;
}
public int getId() {
return id;
}
}
|
6c309cfe-fbcf-4074-b0c9-3f331c18b8fc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-06 14:01:50", "repo_name": "cgpllx/meizi", "sub_path": "/src/com/kubeiwu/db/DBAccess.java", "file_name": "DBAccess.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "3c53264ecfeab24d42066f6bb478800dbb8f6d6d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cgpllx/meizi | 237 | FILENAME: DBAccess.java | 0.27048 | package com.kubeiwu.db;
import java.io.IOException;
import java.io.Reader;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
/**
* @author cgp 加载Mybatis配置文件 访问数据库
*/
public class DBAccess {
public final SqlSessionFactory sqlSessionFactory;
public DBAccess() {
Reader reader = null;
try {
reader = Resources.getResourceAsReader("com/kubeiwu/config/Configuration.xml");
} catch (IOException e) {
e.printStackTrace();
} finally {// 通过配置信息构建一个SqlSessionFactory
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
public SqlSession getSqlSession() {
return getSqlSession(false);
}
public SqlSession getSqlSession(boolean b) {
SqlSession sqlSession = sqlSessionFactory.openSession(b);
return sqlSession;
}
}
|
17778992-f827-4d0b-9514-699e8c598cc2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-12-12 19:44:58", "repo_name": "omgpotatoes/DEANQA", "sub_path": "/src/cs2731/TrainingFileData.java", "file_name": "TrainingFileData.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "9702ae42918895ad85994fda2e75711e1f22de4a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/omgpotatoes/DEANQA | 255 | FILENAME: TrainingFileData.java | 0.278257 | package cs2731;
/**
* Representation of all information needed from a file to train on the data
* @author Eric Heim
*
*/
public class TrainingFileData {
/** The name of the file */
public String filename;
/** The sentences in the document */
public String document;
/** The questions for the above document */
public String questions;
/** Used as a map from question number to answer sentence */
public String [] answerMap;
public TrainingFileData() {}
public TrainingFileData(String inFilename, String inDocument, String inQuestions, String [] inAnswerMap) {
this.filename = inFilename;
this.document = inDocument;
this.questions = inQuestions;
this.answerMap = inAnswerMap;
}
public String toString() {
String returnString = "FileName: " + filename + "\nDOCUMENT\n" + document + "\n" + "QUESTIONS\n" + questions + "\n" + "ANSWER MAP\n";
for(int i = 0; i < answerMap.length; i++)
returnString += (i + 1) + ": " + answerMap[i] + "\n";
return returnString;
}
}
|
7733732e-d4da-4f03-81ac-245442e02b68 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-21 03:03:55", "repo_name": "jdr66/edimca", "sub_path": "/src/main/java/com/jorisderoeck/edimca/service/SupportRequestRowMapper.java", "file_name": "SupportRequestRowMapper.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 24, "lang": "en", "doc_type": "code", "blob_id": "d28d01361a49d152d3d148abee95ea9c8c32a62a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jdr66/edimca | 211 | FILENAME: SupportRequestRowMapper.java | 0.245085 | package com.jorisderoeck.edimca.service;
import com.jorisderoeck.edimca.entity.SupportRequest;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class SupportRequestRowMapper implements RowMapper<SupportRequest>{
@Override
public SupportRequest mapRow(ResultSet rs, int arg1) throws SQLException{
SupportRequest supportRequest = new SupportRequest();
supportRequest.setRequest_id(rs.getInt("request_id"));
supportRequest.setRequester_id(rs.getInt("requester_id"));
supportRequest.setCreation_time(rs.getDate("creation_time"));
supportRequest.setName(rs.getString("name"));
supportRequest.setDescription(rs.getString("description"));
supportRequest.setApprover_id(rs.getInt("approver_id"));
supportRequest.setPriority(rs.getInt("priority"));
supportRequest.setApprove_time(rs.getDate("approve_time"));
supportRequest.setTech_id(rs.getInt("tech_id"));
supportRequest.setAssign_time(rs.getDate("assign_time"));
return supportRequest;
}
} |
c2e6500d-d8b4-450e-b7cd-e6fe196982b1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-16 14:58:49", "repo_name": "leimin12/crm", "sub_path": "/src/main/java/com/zking/crm/biz/impl/StorageBiz.java", "file_name": "StorageBiz.java", "file_ext": "java", "file_size_in_byte": 1043, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "35f3265836082c9025c54cc52a8a17200087520b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/leimin12/crm | 213 | FILENAME: StorageBiz.java | 0.267408 | package com.zking.crm.biz.impl;
import com.zking.crm.biz.IStorageBiz;
import com.zking.crm.mapper.StorageMapper;
import com.zking.crm.model.Storage;
import com.zking.crm.util.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class StorageBiz implements IStorageBiz {
@Autowired
private StorageMapper storageMapper;
@Override
public void del(Storage storage) {
storageMapper.deleteByPrimaryKey(storage.getStkId());
}
@Override
public void add(Storage storage) {
storageMapper.insert(storage);
}
@Override
public void edit(Storage storage) {
storageMapper.updateByPrimaryKeySelective(storage);
}
@Override
public Storage load(Storage storage) {
return storageMapper.selectByPrimaryKey(storage.getStkId());
}
@Override
public List<Storage> list(Storage storage, PageBean pageBean) {
return storageMapper.list(storage);
}
}
|
ca3cbc4f-b0cd-4203-a5d3-5c7c121d50b1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-08-15 04:08:19", "repo_name": "sequenia/sibGurman", "sub_path": "/sibGurman/src/adapters/BrandAdapter.java", "file_name": "BrandAdapter.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "bc8dc001ee03ae592703d32ab14dd2d518781e94", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sequenia/sibGurman | 206 | FILENAME: BrandAdapter.java | 0.294215 | package adapters;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import classes.Brand;
import sequenia.sibgurman.R;
public class BrandAdapter extends ArrayAdapter<Brand> {
private final Context context;
private List<Brand> items;
public BrandAdapter (Context context, List<Brand> brands) {
super(context, R.layout.brand, brands);
this.context = context;
this.items = brands;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.brand, parent, false);
TextView nameBrand = (TextView) rowView.findViewById(R.id.nameBrand);
nameBrand.setText(items.get(position).getNameBrand());
return rowView;
}
} |
6fc25943-05b0-4768-b0cb-d6bd2999e44d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-28 15:13:58", "repo_name": "zirami/DoAnChoThue", "sub_path": "/src/main/java/com/nhom2/entity/NHACUNGCAP.java", "file_name": "NHACUNGCAP.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "a058668dbc28c58d568f9fc8bc0b8f67dd350373", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zirami/DoAnChoThue | 321 | FILENAME: NHACUNGCAP.java | 0.283781 | package com.nhom2.entity;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "NHACUNGCAP")
public class NHACUNGCAP {
@Id
@Column(name = "MANCC")
private String mancc;
@Column(name = "TEN ")
private String ten;
@OneToMany(mappedBy = "ncc", fetch = FetchType.EAGER)
private List<PHIEUNHAP> phieunhaps;
public String getMancc() {
return mancc;
}
public void setMancc(String mancc) {
this.mancc = mancc;
}
public String getTen() {
return ten;
}
public void setTen(String ten) {
this.ten = ten;
}
public List<PHIEUNHAP> getPhieunhaps() {
return phieunhaps;
}
public void setPhieunhaps(List<PHIEUNHAP> phieunhaps) {
this.phieunhaps = phieunhaps;
}
public NHACUNGCAP(String mancc, String ten, List<PHIEUNHAP> phieunhaps) {
super();
this.mancc = mancc;
this.ten = ten;
this.phieunhaps = phieunhaps;
}
public NHACUNGCAP() {
super();
}
}
|
3d4bcf19-bb27-40b6-b058-86f5b4b718c1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-24 13:20:31", "repo_name": "cnywb/ford-wechat", "sub_path": "/repository/src/main/java/com/ford/wechat/repository/pc/complain/impl/EmailConfigEntityRepositoryImpl.java", "file_name": "EmailConfigEntityRepositoryImpl.java", "file_ext": "java", "file_size_in_byte": 964, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "d83af3884ed3f2a8ac022c5b35118adb6ce180f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cnywb/ford-wechat | 228 | FILENAME: EmailConfigEntityRepositoryImpl.java | 0.261331 | /*
* Copyright (c) dabing.io
* All rights reserved.
* EmailConfigEntityRepositoryImpl.java
*/
package com.ford.wechat.repository.pc.complain.impl;
import com.ford.wechat.entity.pc.complain.EmailConfigEntity;
import com.ford.wechat.repository.pc.complain.EmailConfigEntityRepository;
import io.dabing.core.repository.DefaultJpaRepository;
import io.dabing.core.repository.domain.StringQuery;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 描述:EmailConfigEntityRepositoryImpl 仓储服务接口实现层代码类
*
* @author ziv
* @since 1.0
*/
@Repository
public class EmailConfigEntityRepositoryImpl extends DefaultJpaRepository<EmailConfigEntity, Long> implements EmailConfigEntityRepository {
@Override
public List<EmailConfigEntity> getByCode(String code) {
StringQuery query = StringQuery.newQuery()
.query("from " + EmailConfigEntity.class.getName() + " where code = :code ")
.param("code", code)
.build();
return find(query);
}
}
|
e0455585-87b0-416a-8fa3-56bf04bb3d1b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-05 10:23:17", "repo_name": "justinjoseph72/vertex-learning", "sub_path": "/src/main/java/com/justin/app/wiki/WikiWithBusVerticle.java", "file_name": "WikiWithBusVerticle.java", "file_ext": "java", "file_size_in_byte": 1189, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "1896722e21570187c6a2ab054383c13870280441", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/justinjoseph72/vertex-learning | 236 | FILENAME: WikiWithBusVerticle.java | 0.288569 | package com.justin.app.wiki;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Future;
import io.vertx.core.Launcher;
public class WikiWithBusVerticle extends AbstractVerticle {
public static void main(String ... args){
Launcher.main(new String[]{"run",WikiWithBusVerticle.class.getName(),"-ha"});
}
@Override
public void start(final Future<Void> startFuture) throws Exception {
Future<String> dbVerticleDeployment = Future.future();
vertx.deployVerticle(new WikiDatabaseVerticle(),dbVerticleDeployment.completer());
dbVerticleDeployment.compose(id ->{
Future<String> httpVerticleDeployment = Future.future();
vertx.deployVerticle(
"com.justin.app.wiki.HttpServerVerticle",
new DeploymentOptions().setInstances(2),
httpVerticleDeployment.completer()
);
return httpVerticleDeployment;
}).setHandler(ar->{
if(ar.succeeded()){
startFuture.complete();
}else {
startFuture.fail(ar.cause());
}
});
}
}
|
cdebcbc6-2f9c-4259-948b-e3b81ab28fd0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-09 14:34:04", "repo_name": "Kaffe-work/dat076Labs", "sub_path": "/lab3/ws2/src/main/java/chl/hajo/library/dao/BookCatalogue.java", "file_name": "BookCatalogue.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "acbee801d395d891e62ad9d06d10ccca50edd8f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Kaffe-work/dat076Labs | 221 | FILENAME: BookCatalogue.java | 0.264358 | package chl.hajo.library.dao;
import chl.hajo.library.core.Book;
import chl.hajo.library.service.DataSupplier;
import javax.ejb.Stateless;
import java.util.List;
/**
* All orders Responsible for putting new PurchaseOrders objects into the model
*
* @author hajo
*/
@Stateless
public class BookCatalogue {
private List<Book> books = DataSupplier.getBooks();
public BookCatalogue() {
}
public List<Book> findAll() {
return books;
}
public void create(Book book) {
books.add(book);
}
public void delete(String isbn) {
Book del = find(isbn);
if( del != null) {
books.remove(del);
}
}
public Book find(String isbn) {
for(Book b : books) {
if(b.getIsbn().equals(isbn)) {
return b;
}
}
return null;
}
public void update(Book book) {
delete(book.getIsbn());
create(book);
}
} |
e7361978-cb8b-45cc-a95f-bf0a91c4b846 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-31 13:48:48", "repo_name": "joshuajgomez/chatapp", "sub_path": "/app/src/main/java/com/joshgm3z/chatapp/common/utils/SharedPrefs.java", "file_name": "SharedPrefs.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "ac5337f773b3dd87bd48beb7a7b201cdcc9c1362", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/joshuajgomez/chatapp | 180 | FILENAME: SharedPrefs.java | 0.236516 | package com.joshgm3z.chatapp.common.utils;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
public class SharedPrefs {
private static final String CHAT_APP_SHARED_PREFS = "CHAT_APP_SHARED_PREFS";
private static final String CURRENT_USER = "CURRENT_USER";
public static String getCurrentUser(Context context) {
SharedPreferences sharedPrefs = context.getSharedPreferences(
CHAT_APP_SHARED_PREFS, Context.MODE_PRIVATE);
return sharedPrefs.getString(CURRENT_USER, "");
}
public static void setCurrentUser(Context context, String user) {
if (!user.isEmpty()) {
SharedPreferences.Editor editor = context.getSharedPreferences(
CHAT_APP_SHARED_PREFS, Context.MODE_PRIVATE).edit();
editor.putString(CURRENT_USER, user);
editor.apply();
} else {
Logger.log(Log.WARN, "Empty user");
}
}
}
|
fa220916-45c4-4962-aba8-38d926ff98ac | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-06-23T21:56:56", "repo_name": "gugutz/dotfiles", "sub_path": "/config/.config/conky/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1043, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "2928b8e47cba730f12245edf90fa4387cd7e7ac0", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gugutz/dotfiles | 280 | FILENAME: README.md | 0.280616 |
# My personal Conky setup
This are my scripts and config files for Conky. It is intended to serve as a backup for my configuration, but it should work on any system, so if you like it, feel free to use it as you will.
** It has: **
* CPU, GPU, RAM & Disk Usage Stats;
* CPU, GPU & Disks Temperature values, colorized by range;
* System, CPU and GPU Fan status;
* Network stats with graphs for Download and Upload activity;
* Processes info;
* Detailed panel with Nvidia Card info;
* Transparency, so it should combine with any dark background.
# Installation
To install clone this repo with:
`git clone https://github.com/gugutz/tonky.git ~/.conky`
### xinitrc
Add `scripts/conky-start` to your `xnitrc` file:
`echo "~/.conky/tonky/scripts/conky-start.sh" >> ~/.xinitrc`
### i3-gaps Window Manager
Add `scripts/conky-start` to your `xnitrc` file:
`echo "exec_always --no-startup-id ~/.conky/tonky/scripts/conky-start.sh" >> ~/.config/i3/config`
## Screenshots

|
5f66e2fd-9371-4965-9aa5-80950669bb40 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-21 15:13:13", "repo_name": "AkankshaSJain/servletPractice", "sub_path": "/servletpracticetest/src/servlet/login.java", "file_name": "login.java", "file_ext": "java", "file_size_in_byte": 1165, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "6e0458f8b15cf2baa11f8550a5498bf9d697a454", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AkankshaSJain/servletPractice | 213 | FILENAME: login.java | 0.26971 | package servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class login
*/
@WebServlet("/login")
public class login extends HttpServlet {
private static final long serialVersionUID = 1L;
public login() {
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String user = request.getParameter("uname");
System.out.println("username: "+user);
String pass = request.getParameter("pass");
System.out.println("Password: "+ pass);
String hiddenVal = request.getParameter("hd");
System.out.println("the hidden value is: "+ hiddenVal);
if(pass.equals("aksy")){
System.out.println("login success");
request.setAttribute("hidden",hiddenVal);
response.sendRedirect("profile.jsp");
}
else
{
System.out.println("login failed");
response.sendRedirect("Login.html");
}
}
}
|
52459b68-2c8a-40c5-8cdb-d1fd611d62e4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-09 03:35:25", "repo_name": "williamcheng1988/smart-oa", "sub_path": "/src/main/com/chz/smartoa/task/pojo/HiTaskAssignee.java", "file_name": "HiTaskAssignee.java", "file_ext": "java", "file_size_in_byte": 1107, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "3e3ccc90e7ff0434c1bf8341461ace5ec7c5d506", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/williamcheng1988/smart-oa | 275 | FILENAME: HiTaskAssignee.java | 0.277473 | package com.chz.smartoa.task.pojo;
import java.io.Serializable;
import com.chz.smartoa.common.base.BaseDomain;
/**
* @author wesson
* @date 2015-05-24
*/
public class HiTaskAssignee extends BaseDomain implements Serializable {
private static final long serialVersionUID = 1L;
public HiTaskAssignee() {
}
public HiTaskAssignee(String execution_id_, String assignee_, String conf_id_) {
super();
this.execution_id_ = execution_id_;
this.assignee_ = assignee_;
this.conf_id_ = conf_id_;
}
//实例ID
private String execution_id_;
//用户ID
private String assignee_;
//节点ID
private String conf_id_;
public String getExecution_id_() {
return execution_id_;
}
public void setExecution_id_(String execution_id_) {
this.execution_id_ = execution_id_;
}
public String getAssignee_() {
return assignee_;
}
public void setAssignee_(String assignee_) {
this.assignee_ = assignee_;
}
public String getConf_id_() {
return conf_id_;
}
public void setConf_id_(String conf_id_) {
this.conf_id_ = conf_id_;
}
}
|
af7d034b-7944-4c46-8c57-2b74f052adae | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-02-01T07:25:34", "repo_name": "janis-rullis/vb", "sub_path": "/2010-jim-backup/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1108, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "586830023c8efb5fe8e771e67d7ad6dabd7f177a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/janis-rullis/vb | 220 | FILENAME: README.md | 0.199308 | # VB script for backing up documents and e-mail
Was specially created for clients that were rarely in the office and their data
needed to be backed-up to the local server. The task could not be scheduled so a
user-friendly interface and data reliable solution were required.
## There are 2 interfaces
1. Admin panel where You configure paths where is stored documents and e-mails and
where should they be copied to.

2. Client panel where you see the progress - displays what is currently being
copied and the remaining time also informs if you can use the Outlook.

## Dependencies
Uses `robocopy` tool for the file copying.
## Environment
Last time I checked was in 2011 and it worked in Windows XP and was specially
adjusted to work with the Microsoft Outlook (closes it if it's working, so no
data would be lost).
--------------------------------------------------------------------------------------------------------------------
Created back in 2010 when I was working as a Network Administrator / Web developer.
|
60dbc1f5-31a2-4355-bd3b-f60f940f40c6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-05 13:32:42", "repo_name": "zhiyunhanhuibing/zhiyun-bannongmin-talkshow", "sub_path": "/src/main/java/com/plat/controller/AddressController.java", "file_name": "AddressController.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "b1b6457e391e60c5e7036f049b6377acaf4bf572", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhiyunhanhuibing/zhiyun-bannongmin-talkshow | 212 | FILENAME: AddressController.java | 0.213377 | package com.plat.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.plat.bean.CollectGoodsAddressReq;
import com.plat.bean.CollectGoodsAddressResp;
import com.plat.config.PageBean;
import com.plat.service.CollectGoodsAddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 收货地址管理控制器
* @author CR
*
*/
@RestController
@RequestMapping("/address")
@Api(value="收货地址管理", tags="收货地址管理控制器")
public class AddressController {
@Autowired
private CollectGoodsAddressService service;
@PostMapping("/query")
@ApiOperation(value="查询收货地址", notes="分页查询收货地址")
public PageBean<CollectGoodsAddressResp> queryCollectGoodsAddress(@RequestBody CollectGoodsAddressReq req) {
return service.queryCollectGoodsAddress(req);
}
}
|
adc42acc-4fcd-4610-b012-e839d3b61cbb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-07 13:37:48", "repo_name": "RuofeiSun/gmall0101", "sub_path": "/gmall-manage-service/src/main/java/com/sunruofei/gmall/manage/impl/PmsBaseAttrValueServiceImpl.java", "file_name": "PmsBaseAttrValueServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1110, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "b96daa2f049ecfe5fe52e2d7b673ce95fd3e959f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/RuofeiSun/gmall0101 | 262 | FILENAME: PmsBaseAttrValueServiceImpl.java | 0.261331 | package com.sunruofei.gmall.manage.impl;
import com.alibaba.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sunruofei.gmall.bean.PmsBaseAttrValue;
import com.sunruofei.gmall.manage.mapper.PmsBaseAttrValueMapper;
import com.sunruofei.gmall.service.PmsBaseAttrValueService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* <p>
* 属性值表 服务实现类
* </p>
*
* @author sunruofei
* @since 2020-01-07
*/
@Service
public class PmsBaseAttrValueServiceImpl extends ServiceImpl<PmsBaseAttrValueMapper, PmsBaseAttrValue> implements PmsBaseAttrValueService {
@Autowired
PmsBaseAttrValueMapper pmsBaseAttrValueMapper;
@Override
public List<PmsBaseAttrValue> getAttrValueListByAttrId(String attrId) {
QueryWrapper<PmsBaseAttrValue> wrapper = new QueryWrapper<>();
wrapper.eq("attr_id", attrId);
return pmsBaseAttrValueMapper.selectList(wrapper);
}
}
|
5ef288c5-e1dd-4f52-9104-1921d50e289b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-27 10:45:19", "repo_name": "mariabrinzila/Programare-Avansata", "sub_path": "/Laboratorul 3/City.java", "file_name": "City.java", "file_ext": "java", "file_size_in_byte": 1068, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "915a807c0b057ff1aa12c8a3893eb4df9e727b58", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mariabrinzila/Programare-Avansata | 247 | FILENAME: City.java | 0.279828 | import java.util.*;
public class City extends Location implements Classifiable {
private int rank;
private List<Location> locatii = new ArrayList<>();
public City(int rank, List<Location> locatii) {
this.rank = rank;
this.locatii = locatii;
}
public City(String name, String description, int rank, List<Location> locatii) {
super(name, description);
this.rank = rank;
this.locatii = locatii;
}
public void addLocation(Location locatie) {
locatii.add(locatie);
}
public void setLocatii(List<Location> locatii) {
this.locatii = locatii;
}
public List<Location> getLocatii() {
return locatii;
}
public void setRank(int rank) {
this.rank = rank;
}
@Override
public int getRank() {
return rank;
}
@Override
public String toString() {
return "City{" +
"rank=" + rank +
", locatii=" + locatii +
'}';
}
}
|
b34fb110-e910-4027-beee-1ebf16c72d2b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-10 06:01:50", "repo_name": "zzfordev/MediaLink", "sub_path": "/Android/MediaLink/app/src/main/java/com/zzfordev/medialink/nodes/PcmWriteNode.java", "file_name": "PcmWriteNode.java", "file_ext": "java", "file_size_in_byte": 1189, "line_count": 68, "lang": "en", "doc_type": "code", "blob_id": "c25769d4e374260a103986452016258531365228", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zzfordev/MediaLink | 286 | FILENAME: PcmWriteNode.java | 0.294215 | package com.zzfordev.medialink.nodes;
import com.zzfordev.medialink.Parameter;
import com.zzfordev.medialink.nodes.audio.AudioNode;
public class PcmWriteNode extends AudioNode
{
short[] mBuff16;
int mIndex;
public PcmWriteNode(short[] buff)
{
mBuff16 = buff;
}
@Override
protected Result onStart()
{
mIndex = 0;
return null;
}
@Override
protected Result onStop()
{
mIndex = 0;
return null;
}
@Override
protected boolean onIsSourceNode()
{
return false;
}
@Override
protected PushResult onPush()
{
return null;
}
@Override
public Result push(short[] data, long length)
{
if (mBuff16 != null && mIndex < mBuff16.length)
{
for(int i=0;i<length;i++)
{
mBuff16[mIndex++] = data[i];
if(mIndex >= mBuff16.length)
{
break;
}
}
}
return new Result(true,0,"");
}
@Override
protected SetParameterResult onSetParameters(Parameter params)
{
return null;
}
}
|
d3a94ccf-ec39-4bbe-942a-b76cd7ffb934 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-20 03:32:40", "repo_name": "Latoris/AndroidLearn", "sub_path": "/DialogPractice/app/src/main/java/com/example/latoris/dialogpractice/informDialog.java", "file_name": "informDialog.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "a5b09d0fba780182a73c39be4c07bbc8848bcd2e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Latoris/AndroidLearn | 186 | FILENAME: informDialog.java | 0.217338 | package com.example.latoris.dialogpractice;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
/**
* Created by Latoris on 2016/9/4.
*/
public class informDialog extends Dialog {
private TextView text;
private Button exit;
protected informDialog(Context context){
super(context);
}
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.inform_dialog);
exit = (Button)findViewById(R.id.exit);
text =(TextView)findViewById(R.id.text);
exit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
}
}
|
4ec44f09-09de-4576-854f-7dbb01e30b2a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-11 09:21:41", "repo_name": "lidonggg/ProjectAdmintor", "sub_path": "/app/src/main/java/com/admin/projectadmintor/sign/SquareRelativeLayout.java", "file_name": "SquareRelativeLayout.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "c6eb11e9051d1f0d7ea3ab5199dc81f1148f452c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lidonggg/ProjectAdmintor | 186 | FILENAME: SquareRelativeLayout.java | 0.290176 | package com.admin.projectadmintor.sign;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
/**
* Created by apple on 2018/1/4.
*/
public class SquareRelativeLayout extends RelativeLayout {
public SquareRelativeLayout(Context context){
super(context);
}
public SquareRelativeLayout(Context context, AttributeSet attributeSet){
super(context,attributeSet);
}
public SquareRelativeLayout(Context context,AttributeSet attributeSet,int defStyleAttr){
super(context,attributeSet,defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
setMeasuredDimension(getDefaultSize(0,widthMeasureSpec),getDefaultSize(0,heightMeasureSpec));
int childWidthSize=getMeasuredWidth();
widthMeasureSpec=heightMeasureSpec=MeasureSpec.makeMeasureSpec(childWidthSize,MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
|
018d92b9-0535-4b76-8b67-3654e9cb3363 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-31 05:54:54", "repo_name": "hoang06kx1/movie-database", "sub_path": "/app/src/main/java/nguyen/hoang/movierating/ui/main/activity/BaseActivity.java", "file_name": "BaseActivity.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "efef7fb665c79194d440d73f95d5225efa6d57b6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hoang06kx1/movie-database | 194 | FILENAME: BaseActivity.java | 0.2227 | package nguyen.hoang.movierating.ui.main.activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import nguyen.hoang.movierating.ParseApplication;
/**
* Created by Hoang on 1/31/2016.
*/
public class BaseActivity extends AppCompatActivity {
ProgressDialog mProgressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mProgressDialog = new ProgressDialog(this);
}
public ProgressDialog getProgressDialog() {
return mProgressDialog;
}
public void showProgressDialog(String message) {
mProgressDialog.setMessage(message);
if (!mProgressDialog.isShowing()) {
mProgressDialog.show();
}
}
public void hideProgressDialog() {
if (mProgressDialog.isShowing()) {
mProgressDialog.hide();
}
}
public ParseApplication getParseApplication() {
return (ParseApplication) getApplication();
}
}
|
58864989-df24-4fa0-bb36-e11d075ec743 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-04-06 03:33:10", "repo_name": "liujiajun2/learning", "sub_path": "/learning-redis/src/main/java/xin/liujiajun/redis/cache/spi/redis/RedisCacheManager.java", "file_name": "RedisCacheManager.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "b1e2cc38467649446e219c803d43a3dd8cb04f90", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liujiajun2/learning | 223 | FILENAME: RedisCacheManager.java | 0.226784 | package xin.liujiajun.redis.cache.spi.redis;
import org.springframework.beans.factory.annotation.Autowired;
import xin.liujiajun.redis.cache.spi.AbstractCacheManager;
import xin.liujiajun.redis.cache.spi.Cache;
import xin.liujiajun.redis.client.serialization.Serialization;
import xin.liujiajun.redis.connection.RedisConnection;
/**
* @author liujiajun
* @date 2019-12-30 11:27
**/
public class RedisCacheManager extends AbstractCacheManager {
@Autowired
private RedisConnection redisConnection;
@Override
public Cache getCache(String region, Serialization serialization) {
Cache cache = super.getCache(region);
if(cache == null) {
cache = new RedisCache(region,redisConnection.getJedisPool(),serialization);
addCache(region,cache);
}
return cache;
}
@Override
public void init() {
redisConnection.init();
}
@Override
public void destroy() throws Exception {
redisConnection.destroy();
}
}
|
9762dd9f-7684-44e9-b0c2-ed7f0fe5daab | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-28 02:50:55", "repo_name": "UaenaSA/wiki", "sub_path": "/src/main/java/com/microcore/jcf/valid/rule/Length.java", "file_name": "Length.java", "file_ext": "java", "file_size_in_byte": 1191, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "f82af0225d74bf2e07e81856186c9b7efd8d4991", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/UaenaSA/wiki | 244 | FILENAME: Length.java | 0.290176 | package com.microcore.jcf.valid.rule;
import com.microcore.jcf.valid.rule.base.AbstractRule;
import com.microcore.jcf.valid.rule.support.BoundaryValueSupport;
import com.microcore.jcf.valid.validate.util.ValidUtil;
/**
* 字符串长度校验
*
* @author leizhenyang
*/
public class Length extends AbstractRule<String> {
private BoundaryValueSupport boundaryValueSupport;
public Length(long maxLength) {
boundaryValueSupport = new BoundaryValueSupport(maxLength);
boundaryValueSupport.setMin(0);
}
public Length(long minLength, long maxLength) {
boundaryValueSupport = new BoundaryValueSupport(maxLength);
boundaryValueSupport.ltZero(minLength);
}
@Override
public boolean valid(String value) {
if (ValidUtil.isBlank(value)) {
return true;
}
//MoreStringUtil.utf8EncodedLength(value)
if (!ValidUtil.between(boundaryValueSupport.getMin(), boundaryValueSupport.getMax(), value.length())) {
message = "长度必须在[" + boundaryValueSupport.getMin() + "," + boundaryValueSupport.getMax() + "]之间";
return false;
}
return true;
}
} |
23247d1a-33dc-4360-b8f1-6ca8336611e4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-21 13:14:39", "repo_name": "angelov81/tophoppers", "sub_path": "/src/main/java/bg/softuni/tophoppers/domain/entity/CategoryEntity.java", "file_name": "CategoryEntity.java", "file_ext": "java", "file_size_in_byte": 1187, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "34cc8cf7bbca366e396552b1e32f5012989a810d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/angelov81/tophoppers | 234 | FILENAME: CategoryEntity.java | 0.255344 | package bg.softuni.tophoppers.domain.entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.*;
import java.util.Set;
@Entity
@Table(name = "categories")
public class CategoryEntity extends BaseEntity {
private CategoryName categoryName;
private String description;
private Set<ProductEntity> products;
public CategoryEntity() {
}
public CategoryEntity(CategoryName categoryName, String description) {
this.categoryName = categoryName;
this.description = description;
}
@Enumerated(EnumType.STRING)
public CategoryName getCategoryName() {
return categoryName;
}
public void setCategoryName(CategoryName categoryName) {
this.categoryName = categoryName;
}
@Column(name = "description", columnDefinition = "TEXT")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@JsonIgnore
@OneToMany(mappedBy = "category", fetch = FetchType.EAGER)
public Set<ProductEntity> getProducts() {
return products;
}
public void setProducts(Set<ProductEntity> products) {
this.products = products;
}
}
|
2f936631-6606-45f1-8335-99626de83975 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-06 14:25:01", "repo_name": "dembitskyib/DembitskyiHW2", "sub_path": "/src/main/java/com/epam/lab/app/model/Droid.java", "file_name": "Droid.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "61e17f1cc9123b5693755319d67540f25e723a74", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dembitskyib/DembitskyiHW2 | 249 | FILENAME: Droid.java | 0.284576 | package com.epam.lab.app.model;
import java.util.Arrays;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class Droid {
private static final Logger logger = LogManager.getLogger(Droid.class);
@MyAnnotation(name = "name")
private String name;
@MyAnnotation(name = "healthPoints")
private int healthPoints;
private int damage;
private int maxHealth;
public Droid() {
}
public Droid(String name) {
this.name = name;
}
public void restoreHealthPoints() {
healthPoints = maxHealth;
logger.info("HP restored");
}
public int addDamage(int additionalDamage) {
return damage += additionalDamage;
}
public String getName() {
return name;
}
public void myMethod(String string, int... intArgs) {
logger.info("String: " + string + "\nIntArgs:");
for (int i = 0; i < intArgs.length; i++) {
logger.info(intArgs[i]);
}
}
public void myMethod(String... strings) {
logger.info("Strings:");
Arrays.asList(strings).forEach(string -> logger.info(string));
}
}
|
a2212245-85c4-4b39-b5f6-fbd965d3a40a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-12 12:30:19", "repo_name": "yhtyyar/Base_patterns", "sub_path": "/src/com/java/base_patterns/behaviorals_patterns/iterator/Drugs.java", "file_name": "Drugs.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "d79ddc7ce64b379edbb376bc720f507304055617", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yhtyyar/Base_patterns | 215 | FILENAME: Drugs.java | 0.253861 | package com.java.base_patterns.behaviorals_patterns.iterator;
public class Drugs implements List{
private String name;
private String [] drugList;
public Drugs(String name, String[] drugList) {
this.name = name;
this.drugList = drugList;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String[] getDrugList() {
return drugList;
}
public void setDrugList(String[] drugList) {
this.drugList = drugList;
}
@Override
public Iterator getIterator() {
return new DrugListIterator();
}
private class DrugListIterator implements Iterator {
int index;
@Override
public boolean hasNext() {
if (index < drugList.length) {
return true;
} else {
return false;
}
}
@Override
public Object next() {
return drugList[index++];
}
}
}
|
1df88d99-8809-43c8-a983-47982674a803 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-04 08:50:53", "repo_name": "WD-Coke/house-rent", "sub_path": "/rent-后台/src/main/java/com/easyrent/utils/Iputils.java", "file_name": "Iputils.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "efde61d4d1a2cec9bffb43498d44f639845b7583", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/WD-Coke/house-rent | 217 | FILENAME: Iputils.java | 0.26588 | package com.easyrent.utils;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Iputils {
public static String getIp(){
String ip = "";
String chinaz = "http://ip.tool.chinaz.com/";
String inputLine = "";
String read = "";
try {
URL url = new URL(chinaz);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
while ((read = in.readLine()) != null) {
inputLine += read;
}
// System.out.println(inputLine);
} catch (Exception e) {
e.printStackTrace();
}
Pattern p = Pattern.compile("class\\=\"fz24\">(.*?)\\<\\/dd>");
Matcher m = p.matcher(inputLine);
if (m.find()) {
ip = m.group(1);
}
return ip;
}
}
|
ec7cc69d-9252-42f8-8d5d-50a6dc007167 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-10-15T15:16:14", "repo_name": "FiveEightyEight/notSET_Game", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1108, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "67bac9dc44de7fad8da81481e0e8fb4d9599c6af", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/FiveEightyEight/notSET_Game | 333 | FILENAME: README.md | 0.267408 | # !SET Web Game

#### Game is just for fun, primarily to test my ability as a developer.
## ENTERED BETA: 12/31/18
* **Deployment** - *NOT SET* - [URL](https://fiveeightyeight.github.io/notSET_Game/)
## Built With
* [VScode](https://code.visualstudio.com/) - Code Editor
* [Bootstrap](https://getbootstrap.com) - CSS
## Authors
* **Robert Abreu** - *Project Manager* - [FiveEightyEight](https://github.com/FiveEightyEight)
## To Do
* **Tutorial**: Manual on how to play *WIP*.
* **Time**: Tracks elapsed time.
* **Design**: Aesthetics are a *WIP*.
* **Code**: Needs cleaning.
## Card Properties
|Property | code | Description
|:---- | :----: | -----: |
|id | c s n d | unique id for each card - permutation of color, shape, number, and shading - 81 total |
|img| | image
|color| rd pp gr | red, purple or green |
|shape| ov sq di | oval, squiggle or diamond |
|number| n1 n2 n3 | one, two or three |
|shading| sd st ol | solid, striped or outlined |
## Known Bugs
* **N/A**: Needs more testing
|
519e2881-4231-4b9a-84c7-74eb0d9f28bc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-04T21:58:40", "repo_name": "14likhit/SmartWay", "sub_path": "/app/src/main/java/com/example/smartway/utils/ActivityLauncher.java", "file_name": "ActivityLauncher.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "2aef823c02d6c17434d68b622b130b2e171dcd0d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/14likhit/SmartWay | 191 | FILENAME: ActivityLauncher.java | 0.216012 | package com.example.smartway.utils;
import android.app.Activity;
import android.content.Intent;
import com.example.smartway.ui.home.HomeActivity;
import com.example.smartway.ui.login.LoginActivity;
import com.example.smartway.ui.onboarding.OnBoardingActivity;
import com.example.smartway.ui.userprofile.UserProfileActivity;
public class ActivityLauncher {
public static void launchHomeActivity(Activity activity) {
Intent intent = new Intent(activity, HomeActivity.class);
activity.startActivity(intent);
}
public static void launchOnBoardingActivity(Activity activity) {
Intent intent = new Intent(activity, OnBoardingActivity.class);
activity.startActivity(intent);
}
public static void launchLoginActivity(Activity activity) {
Intent intent = new Intent(activity, LoginActivity.class);
activity.startActivity(intent);
}
public static void launchUserProfileActivity(Activity activity) {
Intent intent = new Intent(activity, UserProfileActivity.class);
activity.startActivity(intent);
}
}
|
86e5c873-999e-49ac-9ade-053fa0529cb9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-11 04:55:18", "repo_name": "CloudSlang/cs-actions", "sub_path": "/cs-alibaba/src/main/java/io/cloudslang/content/alibaba/utils/ClientUtil.java", "file_name": "ClientUtil.java", "file_ext": "java", "file_size_in_byte": 512, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "bc1fa807995e77bbcde4ee8549f615e672a7bc7f", "star_events_count": 18, "fork_events_count": 37, "src_encoding": "UTF-8"} | https://github.com/CloudSlang/cs-actions | 235 | FILENAME: ClientUtil.java | 0.259826 | /*
* Copyright 2019-2023 Open Text
* This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available 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 io.cloudslang.content.alibaba.utils;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.profile.DefaultProfile;
public class ClientUtil {
public static IAcsClient getClient(final String regionId, final String accessKey, final String accessKeySecret) {
final DefaultProfile profile = DefaultProfile.getProfile(
regionId,
accessKey,
accessKeySecret);
return new DefaultAcsClient(profile);
}
}
|
ccbbf72f-c047-488d-8f43-36fd98cb8b62 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-07 15:22:15", "repo_name": "maayanpolitzer/Android2017May", "sub_path": "/android/lesson5-4.9.17/Lists/app/src/main/java/com/example/hackeru/lists/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1164, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "7514949ea9fa6ba42a350fcfb6ce0b4ba605ee98", "star_events_count": 5, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/maayanpolitzer/Android2017May | 207 | FILENAME: MainActivity.java | 0.282988 | package com.example.hackeru.lists;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {
private String[] names = {"Yossi", "Bar", "Shoval", "Dima", "Daniel", "Alex", "Refael"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ListView listView = (ListView) findViewById(R.id.listView);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, names);
listView.setAdapter(adapter);
listView.setOnItemClickListener(this);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
view.setBackgroundColor(Color.parseColor("#00ff00"));
}
}
|
e16670d6-d2ec-4038-a72a-a89a7e93cb67 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-07 13:49:35", "repo_name": "osmanyaycioglu/t20210705", "sub_path": "/springtraining/src/main/java/com/training/micro/person/PersonManagerProxy.java", "file_name": "PersonManagerProxy.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "22a114979bc79bf6103b5193e505128169274437", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/osmanyaycioglu/t20210705 | 205 | FILENAME: PersonManagerProxy.java | 0.276691 | package com.training.micro.person;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
public class PersonManagerProxy extends PersonManager {
private final PersonManager pm;
@PersistenceContext
private EntityManager eManager;
public PersonManagerProxy(final PersonManager pmParam) {
super();
this.pm = pmParam;
}
@Override
public void add(final Person person) {
this.eManager.getTransaction()
.begin();
try {
this.pm.add(person);
this.eManager.getTransaction()
.commit();
} catch (Exception eLoc) {
this.eManager.getTransaction()
.rollback();
}
}
@Override
public void delete(final Long perId) {
this.pm.delete(perId);
}
@Override
public void update(final Person person) {
this.pm.update(person);
}
@Override
public Person getPerson(final Long perId) {
return this.pm.getPerson(perId);
}
}
|
f478bc46-57fc-4d6a-929b-552a4b061ab1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-02 08:12:54", "repo_name": "Feicus/feicus-blog", "sub_path": "/core/src/main/java/mblog/modules/user/entity/Follow.java", "file_name": "Follow.java", "file_ext": "java", "file_size_in_byte": 896, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "0f18258b8d4229693a15e1ed93641325ecbbb47c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Feicus/feicus-blog | 250 | FILENAME: Follow.java | 0.26971 | /*
+--------------------------------------------------------------------------
| Mblog [#RELEASE_VERSION#]
| ========================================
| Copyright (c) 2014, 2015 mtons. All Rights Reserved
| http://www.mtons.com
|
+---------------------------------------------------------------------------
*/
package mblog.modules.user.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import java.util.Date;
/**
* 我的关注
*
* @author Feicus
*
*/
@Entity
@Table(name = "mto_follows")
@Cache(usage= CacheConcurrencyStrategy.READ_WRITE)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Follow {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
/**
* 所属用户Id
*/
@ManyToOne
@JoinColumn(name = "user_id", nullable = false)
private User user;
/**
* 关注用户Id
*/
@ManyToOne
@JoinColumn(name = "follow_id", nullable = false)
private User follow;
@Temporal(TemporalType.TIMESTAMP)
private Date created;
@Column(name = "is_delete")
private int isDelete;
}
|
d360a49b-c50c-487a-bdef-a14190c246ef | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-10-08T08:27:11", "repo_name": "readfaster/read", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1056, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "e18bf365838293a150f3aaaf6dd75ee215a11f30", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/readfaster/read | 251 | FILENAME: README.md | 0.247987 | Read
====
Read is an app for iOS, Android, Google Glass that helps you read *faster*.
Read flashes words at high speed in your Glass, one at a time.
Because you don't have to move your eyes when you Read, you spend less time scanning for words and more time understanding them. We've found that after just a few minutes, many users can read at least 600 words per minute - nearly 3 times as fast as the average reading speed of 220 words per minute.
You can add things to Read later while browsing normally on your iOS or Android device. Simply share to Read, and articles and books will become instantly available on your Glass.
## Technologies
Read uses [Readability](https://readability.com) to parse articles that it receives. It coordinates using a Django backend server. Frontend mobile applications are written for iOS, Android, and Glass.
## About
Read was created at the inaugural CalHacks by [Gurjit Singh](http://gurjitsinghw.com), [Paul Moulton](http://paul-moulton.com), [James Carr](http://jcarr.io), and [Allen Li](http://allen.li).
|
ea0828b6-f43e-434c-9c10-59933bda55e1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-06 15:09:38", "repo_name": "Joe-FP/JavaProject_SGNN", "sub_path": "/src/main/java/models/News.java", "file_name": "News.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "f61c23124626963decaa058754e6231e5f9e2e79", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/Joe-FP/JavaProject_SGNN | 230 | FILENAME: News.java | 0.26588 | package models;
import java.util.ArrayList;
import java.util.List;
public class News {
private String stationName;
private List<Journalist> journalists;
private List<Article> articles;
public News(String stationName) {
this.stationName = stationName;
this.articles = new ArrayList<Article>();
this.journalists = new ArrayList<Journalist>();
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public List<Journalist> getJournalists() {
return journalists;
}
public void setJournalists(List<Journalist> journalists) {
this.journalists = journalists;
}
public List<Article> getArticles() {
return articles;
}
public void setArticles(List<Article> articles) {
this.articles = articles;
}
public void addJournalist(Journalist journalist){
this.journalists.add(journalist);
}
public void addArticle(Article article){
this.articles.add(article);
}
}
|
4bd23c7d-ec25-46de-b357-df4acc5e3470 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-02 14:14:56", "repo_name": "israelnkum/stock_control", "sub_path": "/src/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ba4b76fb9bd53deee697ff50c423dcde316feb67", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/israelnkum/stock_control | 184 | FILENAME: Main.java | 0.23231 | import com.config.Base;
import com.israel.Users;
import com.israel.Vehicle;
import org.hibernate.Session;
import java.util.Date;
public class Main {
public static void main(final String[] args) throws Exception {
try (Session session = Base.getSession()) {
Users users = new Users();
users.setUsername("Another Another");
users.setJoinedDate(new Date());
Vehicle vehicle = new Vehicle();
vehicle.setName("Car");
users.setVehicle(vehicle);
Users users1 = new Users();
users1.setUsername("Osikani Another");
users1.setJoinedDate(new Date());
Vehicle vehicle1 = new Vehicle();
vehicle1.setName("Car2");
users1.setVehicle(vehicle1);
session.beginTransaction();
session.save(users1);
session.save(users);
session.save(vehicle1);
session.save(vehicle);
session.getTransaction().commit();
}
}
} |
9816ef59-8c66-4017-8f02-607e63589f54 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-10-19 20:27:33", "repo_name": "HarryCutts/TimePlace", "sub_path": "/src/com/timeplace/KeywordDatabase.java", "file_name": "KeywordDatabase.java", "file_ext": "java", "file_size_in_byte": 1089, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "cb473a93bdc486e75d9a81ebebfbf52ebb1385c5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/HarryCutts/TimePlace | 268 | FILENAME: KeywordDatabase.java | 0.282196 | package com.timeplace;
import java.util.ArrayList;
import java.util.Iterator;
public class KeywordDatabase {
ArrayList<Keyword> keywords = new ArrayList<Keyword>();
public KeywordDatabase() {
keywords.add(new Keyword("post", "postbox"));
}
public int size() {
return keywords.size();
}
public String getType(String name) {
String keyword = null;
String lowerName = name.toLowerCase();
for (Iterator<Keyword> iter = keywords.iterator(); iter.hasNext();) {
Keyword keywordObj = iter.next();
if (lowerName.contains(keywordObj.keyword))
{
keyword = keywordObj.type;
}
}
/*String[] words = name.split(" ");
for (int i = 0; i < words.length; i++)
{
for (Iterator<Keyword> iter = keywords.iterator(); iter.hasNext();) {
Keyword keywordObj = iter.next();
if (keywordObj.keyword == words[i].toLowerCase()) {
return keywordObj.keyword;
}
}
}*/
return keyword;
}
private class Keyword {
String keyword;
String type;
Keyword(String keyword, String type) {
this.keyword = keyword;
this.type = type;
}
}
} |
74ed2fe8-3494-4a4e-b250-2dd2a464e7d0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-22T14:51:45", "repo_name": "fatdes/reap_frontend_challenge", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1163, "line_count": 50, "lang": "en", "doc_type": "text", "blob_id": "bb859cb73757d300f7f49dcafdfecc68c1e4c33d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fatdes/reap_frontend_challenge | 291 | FILENAME: README.md | 0.226784 | # Simple app
## Setup
- flutter 2.0+
- jave (if you want to generate api models)
```bash
# generate api models
flutter pub run build_runner build --delete-conflicting-outputs
# cleanup the cache and generate_api folder otherwise it won't generate by default
flutter pub run build_runner clean
rm -rf ./generated_api
```
## Documentation
1. Test
```bash
flutter test
```
2. Production
Setup and deploy
```bash
# setup heruko app in dashboard then add remote
heroku git:remote -a fatdes-reap-frontend-challenge
# deploy to heroku
git push heroku main
```
- config VAR
- FLUTTER_BUILD=flutter build web --release --quiet --no-sound-null-safety --dart-define=API_BASE=https://desmond-reap-backend-challenge.herokuapp.com/v1
- follow guideline in https://elements.heroku.com/buildpacks/ee/heroku-buildpack-flutter-light
Access at https://fatdes-reap-frontend-challenge.herokuapp.com
3. Known issue
- refresh (F5) browser will lead to fail on missing token
- token is not persisted properly
- new created post image is not displayed correctly in the beginning.. click it will refresh to correct one
4. Sample video
[sample video here](sample.mov) |
74a08313-6caf-4e9a-809c-6064a5d2c288 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-25 10:32:03", "repo_name": "wcig/spring-study-demo", "sub_path": "/ioc-annotation-demo/src/main/java/com/wcig/app/profile/DataSourceConfig.java", "file_name": "DataSourceConfig.java", "file_ext": "java", "file_size_in_byte": 1189, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "2bcb483cc83efebe49b052f30a2fa3bba0067774", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wcig/spring-study-demo | 212 | FILENAME: DataSourceConfig.java | 0.245085 | package com.wcig.app.profile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment;
import java.util.Arrays;
@Configuration
public class DataSourceConfig {
@Autowired
Environment environment;
@Value("${spring.profiles.active}")
private String activeProfiles;
@Autowired
DataSource dataSource;
public void printCurrentProfile1() {
String[] profiles = environment.getActiveProfiles();
System.out.println(Arrays.toString(profiles));
}
public void printCurrentProfile2() {
System.out.println(activeProfiles);
}
public void printCurrentDatasource() {
System.out.println(dataSource);
}
@Bean
@Profile("dev")
public DataSource devDataSource() {
return new DataSource("dev");
}
@Bean
@Profile("prod")
public DataSource prodDataSource() {
return new DataSource("prod");
}
}
|
997765eb-37a1-400a-8d4f-9a858d3295a4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-19 07:12:25", "repo_name": "yexuz/babasport", "sub_path": "/parent/babasport-service-product/src/main/java/com/zlj/core/service/product/SkuServiceImpl.java", "file_name": "SkuServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "d842c5e71192a7961e1fe1219f10a84f5a0ab855", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yexuz/babasport | 248 | FILENAME: SkuServiceImpl.java | 0.287768 | package com.zlj.core.service.product;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zlj.core.bean.product.Color;
import com.zlj.core.bean.product.Sku;
import com.zlj.core.bean.product.SkuQuery;
import com.zlj.core.dao.product.ColorDao;
import com.zlj.core.dao.product.SkuDao;
@Service("skuService")
public class SkuServiceImpl implements SkuService {
@Autowired
private SkuDao skuDao;
@Autowired
private ColorDao colorDao;
// 商品id 查询 库存结果集
@Override
public List<Sku> selectSkuListByProductId(Long productId) {
SkuQuery skuQuery = new SkuQuery();
skuQuery.createCriteria().andProductIdEqualTo(productId);
List<Sku> skus = skuDao.selectByExample(skuQuery);
for (Sku sku : skus) {
Color color = colorDao.selectByPrimaryKey(sku.getColorId());
sku.setColor(color);
}
return skus;
}
@Override
public int updateSkuById(Sku sku) {
return skuDao.updateByPrimaryKeySelective(sku);
}
}
|
ea8762e8-b67e-4dd8-95ab-ffb5a8628dda | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-10 02:24:39", "repo_name": "fanjunguo/asxuexi", "sub_path": "/src/main/java/cn/asxuexi/mvc/PersonalCenterController.java", "file_name": "PersonalCenterController.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "d37f9c5deb491daa4435accb10f328cf282fc7c1", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fanjunguo/asxuexi | 231 | FILENAME: PersonalCenterController.java | 0.252384 | package cn.asxuexi.mvc;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.asxuexi.entity.PersonalMenu;
import cn.asxuexi.service.PersonalCenterService;
@Controller
public class PersonalCenterController {
@Resource
private PersonalCenterService personalCenterService;
/**
* @author 张顺
* @作用 请求左菜单数据
* */
@RequestMapping("asxuexi/getPersonalMenu.do")
@ResponseBody
public List<PersonalMenu> getPersonalMenu() {
List<PersonalMenu> personal_sort = personalCenterService.getPersonalMenu();
return personal_sort;
}
/**
* @author 张顺
* @作用 获取用户的图片和用户名
* */
@RequestMapping("asxuexi/getUserInfo.action")
@ResponseBody
public Map<String, Object> getUserInfo() {
Map<String, Object> information = personalCenterService.getUserInfo();
return information;
}
}
|
af943ee3-43c7-449d-84e0-7f7d019969be | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-22 15:09:06", "repo_name": "zhzhxian/study_project", "sub_path": "/java-rabbitmq-producer/src/test/java/com/zzx/rabbitmq/javarabbitmqproducer/JavaRabbitmqProducerApplicationTests.java", "file_name": "JavaRabbitmqProducerApplicationTests.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "fbac8b5934a9aea222b5fcb9baf82e1e710e6659", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhzhxian/study_project | 259 | FILENAME: JavaRabbitmqProducerApplicationTests.java | 0.204342 | package com.zzx.rabbitmq.javarabbitmqproducer;
import com.zzx.rabbitmq.sevice.direct.DirectMessageSendSevice;
import com.zzx.rabbitmq.sevice.fanout.FanoutMessageSendSevice;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@SpringBootTest
class JavaRabbitmqProducerApplicationTests {
@Autowired
private FanoutMessageSendSevice fanoutMessageSendSevice;
@Autowired
private DirectMessageSendSevice directMessageSendSevice;
@Test
public void fanout() {
fanoutMessageSendSevice.senMsg();
}
@Test
public void direct() {
directMessageSendSevice.senMsg("email");
}
@Test
public void directTtl() {
for (int i = 0; i < 11; i++) {
directMessageSendSevice.senTtlMsg("email");
}
}
@Test
public void senTtlMessage() {
directMessageSendSevice.senTtlMessage("ttlmessage");
}
}
|
bcf3b8d8-926f-4289-9f30-a4d3ca86d837 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-31 13:51:30", "repo_name": "tndangana/hrtpportal", "sub_path": "/src/main/java/zw/co/tndangana/hrtp/service/implementation/ReligionServiceImpl.java", "file_name": "ReligionServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "33a53aa0a11e9fc46e2d6573d86eb82706b1fbb8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tndangana/hrtpportal | 228 | FILENAME: ReligionServiceImpl.java | 0.255344 | package zw.co.tndangana.hrtp.service.implementation;
import org.springframework.stereotype.Service;
import zw.co.tndangana.hrtp.domain.Religion;
import zw.co.tndangana.hrtp.repository.ReligionRepository;
import zw.co.tndangana.hrtp.service.ReligionService;
import javax.annotation.Resource;
import java.util.List;
/**
* Created by tndangana on 6/21/17.
*/
@Service
public class ReligionServiceImpl implements ReligionService {
@Resource
private ReligionRepository religionRepository;
@Override
public Religion save(Religion religion) {
return religionRepository.save(religion);
}
@Override
public List<Religion> findAll() {
return (List<Religion>)religionRepository.findAll();
}
@Override
public Religion findOne(Long id) {
return religionRepository.findOne(id);
}
@Override
public void delete(Long id) {
religionRepository.delete(id);
}
@Override
public void delete(Religion religion) {
religionRepository.delete(religion);
}
}
|
3c340a80-c36e-4fb0-9607-74593770de03 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-28 07:57:09", "repo_name": "wangmengzhong/supacer", "sub_path": "/punch_auth/src/main/java/com/wmz/auth/handle/ExceptionHandle.java", "file_name": "ExceptionHandle.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "360054ccd1b34871f20bcd5ae41204b36fe789b5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wangmengzhong/supacer | 209 | FILENAME: ExceptionHandle.java | 0.220007 | package com.wmz.auth.handle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import com.wmz.common.entity.Result;
import com.wmz.common.exception.SpaException;
import com.wmz.common.util.ResultUtil;
/**
* 统一处理异常
* @author Administrator
*/
@ControllerAdvice
public class ExceptionHandle {
private final static Logger logger = LoggerFactory.getLogger(ExceptionHandle.class);
@SuppressWarnings("rawtypes")
@ExceptionHandler(value = Exception.class)
@ResponseBody
public Result handle(Exception e) {
logger.error("【系统异常】{}",e);
if (e instanceof SpaException) {
SpaException spaException = (SpaException) e;
return ResultUtil.error(spaException.getCode(), spaException.getMessage());
} else {
return ResultUtil.error(100, e.getMessage());
}
}
}
|
b2e41fca-88ba-4d15-b4d0-75dde56c5128 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-25 06:30:49", "repo_name": "osight/monitor", "sub_path": "/profiler/src/main/java/com/osight/monitor/profiler/module/DefaultApplicationContext.java", "file_name": "DefaultApplicationContext.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "9e57ca7e7247ca4c27a6f58e868877f7355128af", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/osight/monitor | 217 | FILENAME: DefaultApplicationContext.java | 0.236516 | package com.osight.monitor.profiler.module;
import java.lang.instrument.Instrumentation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.osight.monitor.boot.AgentOption;
import com.osight.monitor.profiler.instrument.InstrumentEngine;
import com.osight.monitor.profiler.instrument.JavassistEngine;
/**
* @author chenw <a href="mailto:chenw@chsi.com.cn">chen wei</a>
* @version $Id$
*/
public class DefaultApplicationContext implements ApplicationContext {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final AgentOption agentOption;
private final Instrumentation instrumentation;
private final InstrumentEngine instrumentEngine;
public DefaultApplicationContext(AgentOption agentOption) {
this.agentOption = agentOption;
this.instrumentation = agentOption.getInstrumentation();
this.instrumentEngine = new JavassistEngine(this.instrumentation, agentOption.getBootstrapJarPaths());
}
@Override
public void start() {
}
@Override
public void close() {
}
}
|
2b0dc4e9-33e5-49b3-9da4-c5f37d87d8ea | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-23 15:00:33", "repo_name": "aacoba/IAC-Restservice", "sub_path": "/src/main/java/net/aacoba/iac/parkeerplaats/ParkingLocationRepository.java", "file_name": "ParkingLocationRepository.java", "file_ext": "java", "file_size_in_byte": 1191, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7e8e4d2c625515c182e5153d0bf54aa00fa4c735", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aacoba/IAC-Restservice | 255 | FILENAME: ParkingLocationRepository.java | 0.29584 | package net.aacoba.iac.parkeerplaats;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ResponseStatus;
import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component
public class ParkingLocationRepository {
private static final Map<Integer, ParkingLocation> parkinglocations = new HashMap<>();
@PostConstruct
public void initData() {
ParkingLocation p1 = new ParkingLocation(1, 100);
parkinglocations.put(p1.getId(), p1);
ParkingLocation p2 = new ParkingLocation(2, 30);
parkinglocations.put(p2.getId(), p2);
ParkingLocation p3 = new ParkingLocation(3, 890);
parkinglocations.put(p3.getId(), p3);
ParkingLocation p4 = new ParkingLocation(4, 410);
parkinglocations.put(p4.getId(), p4);
}
public ParkingLocation getParkingLocation(int id) {
return parkinglocations.get(id);
}
public Map<Integer, ParkingLocation> getAll() {
return new HashMap<Integer, ParkingLocation>(parkinglocations);
}
}
|
e0acfc27-a91f-49c8-a9cc-c2f842948b5d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-07 14:46:15", "repo_name": "disconnect101/FPO_portal", "sub_path": "/Farmer App/app/src/main/java/com/example/ruralcaravan/ResponseClasses/UserResponse.java", "file_name": "UserResponse.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "5a70c556a5284b8ec63c078eda53f61bc41ad5e8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/disconnect101/FPO_portal | 218 | FILENAME: UserResponse.java | 0.185947 | package com.example.ruralcaravan.ResponseClasses;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class UserResponse {
@SerializedName("first_name")
@Expose
private String firstName;
@SerializedName("last_name")
@Expose
private String lastName;
@SerializedName("village")
@Expose
private String village;
@SerializedName("district")
@Expose
private String district;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getVillage() {
return village;
}
public void setVillage(String village) {
this.village = village;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
}
|
af5b8656-69a7-4e6e-8a3e-d5a2d40d3130 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-30 19:20:48", "repo_name": "nicolaivalsted/TAYS", "sub_path": "/base-rest/src/main/java/dk/yousee/tays/bbservice/restbase/asucase/AsuRequest.java", "file_name": "AsuRequest.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "d77877d14a8afb27443ba6dbeddf5a4bdccad826", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nicolaivalsted/TAYS | 226 | FILENAME: AsuRequest.java | 0.221351 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dk.yousee.tays.bbservice.restbase.asucase;
import dk.yousee.tays.bbservice.restbase.SubscriberAccessNetResponse;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author jablo
*/
@XmlRootElement
public class AsuRequest {
protected SubscriberAccessNetResponse accessNet;
protected SimplifiedSubscriberServicesResponse services;
public AsuRequest() {
}
public AsuRequest(SubscriberAccessNetResponse accessNet, SimplifiedSubscriberServicesResponse services) {
this.accessNet = accessNet;
this.services = services;
}
public SubscriberAccessNetResponse getAccessNet() {
return accessNet;
}
public void setAccessNet(SubscriberAccessNetResponse accessNet) {
this.accessNet = accessNet;
}
public SimplifiedSubscriberServicesResponse getServices() {
return services;
}
public void setServices(SimplifiedSubscriberServicesResponse services) {
this.services = services;
}
}
|
82594619-19ff-4e1d-8a3f-196df5552749 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-18 10:51:07", "repo_name": "allegro/hermes", "sub_path": "/hermes-management/src/main/java/pl/allegro/tech/hermes/management/domain/credentials/commands/UpdateCredentialsRepositoryCommand.java", "file_name": "UpdateCredentialsRepositoryCommand.java", "file_ext": "java", "file_size_in_byte": 1164, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "c75ee6cbf89e30455f493c1069847268f36da497", "star_events_count": 811, "fork_events_count": 242, "src_encoding": "UTF-8"} | https://github.com/allegro/hermes | 216 | FILENAME: UpdateCredentialsRepositoryCommand.java | 0.246533 | package pl.allegro.tech.hermes.management.domain.credentials.commands;
import pl.allegro.tech.hermes.domain.CredentialsRepository;
import pl.allegro.tech.hermes.management.domain.dc.DatacenterBoundRepositoryHolder;
import pl.allegro.tech.hermes.management.domain.dc.RepositoryCommand;
public class UpdateCredentialsRepositoryCommand extends RepositoryCommand<CredentialsRepository> {
private final CredentialsRepository repository;
private final String password;
public UpdateCredentialsRepositoryCommand(CredentialsRepository repository, String password) {
this.repository = repository;
this.password = password;
}
@Override
public void backup(DatacenterBoundRepositoryHolder<CredentialsRepository> holder) {
}
@Override
public void execute(DatacenterBoundRepositoryHolder<CredentialsRepository> holder) {
repository.overwriteAdminPassword(password);
}
@Override
public void rollback(DatacenterBoundRepositoryHolder<CredentialsRepository> holder) {
}
@Override
public Class<CredentialsRepository> getRepositoryType() {
return CredentialsRepository.class;
}
}
|
6fa3813d-5d71-43f6-9f74-2bd8c831e41a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-23 07:42:12", "repo_name": "Armymans/hysw-cost", "sub_path": "/src/main/java/net/zlw/cloud/warningDetails/model/AuditInfo.java", "file_name": "AuditInfo.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "fc9162fc9012fd10b9f00fd0ec60d8fd560dfd33", "star_events_count": 0, "fork_events_count": 5, "src_encoding": "UTF-8"} | https://github.com/Armymans/hysw-cost | 246 | FILENAME: AuditInfo.java | 0.203075 | package net.zlw.cloud.warningDetails.model;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created by xulei on 2020/9/21.
*/
@Table(name = "audit_info")
@Data
public class AuditInfo {
@Id
@Column(name = "id")
private String id;
@Column(name = "base_project_id")
private String baseProjectId;
@Column(name = "audit_result")
private String auditResult;
@Column(name = "audit_type")
private String auditType;
@Column(name = "auditor_id")
private String auditorId;
@Column(name = "audit_opinion")
private String auditOpinion;
@Column(name = "audit_time")
private String auditTime;
@Column(name = "founder_id")
private String founderId;
@Column(name = "company_id")
private String companyId;
@Column(name = "status")
private String status;
@Column(name = "create_time")
private String createTime;
@Column(name = "update_time")
private String updateTime;
}
|
05d61212-e3a3-4f3f-8160-0483dd9236a5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-26 17:57:20", "repo_name": "raket124/Coins-for-fun", "sub_path": "/Product/VMs/Database/Project/src/main/java/Records/Object/Coin.java", "file_name": "Coin.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "3c7ce40c9b22b7dd007ddc6ffee564ed6b4133cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/raket124/Coins-for-fun | 205 | FILENAME: Coin.java | 0.284576 | package Records.Objects;
public class Coin extends Records.Id.Coin {
protected Country country;
protected Set set;
public Coin(String id, String countryId, String setId, String name, Integer year) {
super(id);
this.countryId = countryId;
this.setId = setId;
this.name = name;
this.year = year;
}
public Country getCountry() {
if(this.country == null) {
this.country = Data.Singleton.DataSource().getCountry().Spawn(this.countryId);
}
return this.country;
}
public void setCountry(Country country) {
this.countryId = country.getId();
this.country = country;
}
public Set getSet() {
if(this.set == null) {
this.set = Data.Singleton.DataSource().getSet().Spawn(this.setId);
}
return this.set;
}
public void setSet(Set set) {
this.setId = set.getId();
this.set = set;
}
}
|
44dcbb77-4e00-4d1e-a563-b09b7ca5ce28 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-08 12:31:02", "repo_name": "Peratham/PraxiconDB", "sub_path": "/src/main/gr/csri/poeticon/praxicon/GeneratePraxiconXSD.java", "file_name": "GeneratePraxiconXSD.java", "file_ext": "java", "file_size_in_byte": 1074, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "28dd5cce92e65047e2c818e92a00ce9e808e6e49", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Peratham/PraxiconDB | 242 | FILENAME: GeneratePraxiconXSD.java | 0.294215 | /*
* 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 gr.csri.poeticon.praxicon;
import gr.csri.poeticon.praxicon.db.entities.Concept;
import java.io.IOException;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.SchemaOutputResolver;
/**
*
* @author dmavroeidis
*/
public class GeneratePraxiconXSD {
public static SchemaOutputResolver scoure;
JAXBContext jaxbContext;
public GeneratePraxiconXSD() throws JAXBException {
this.jaxbContext = JAXBContext.newInstance(Concept.class);
}
public static void main(String args[]) throws JAXBException, IOException {
SchemaOutputResolver sour;
JAXBContext jaxbContext;
sour = new PraxiconDBOutputResolver();
jaxbContext = JAXBContext.newInstance(Concept.class);
jaxbContext.generateSchema(sour);
sour.createOutput("http://www.csri.gr/concept", "output.xsd");
}
}
|
f76e6192-e361-469d-8d09-dba07c4e0f26 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-05 08:12:26", "repo_name": "cissoko97/manageairport", "sub_path": "/src/manageairport/models/Connexion.java", "file_name": "Connexion.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "c9e33d24a9fcc0bd66c7484be6db210795a98f85", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cissoko97/manageairport | 209 | FILENAME: Connexion.java | 0.210766 | /*
* 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 manageairport.models;
import java.sql.Date;
/**
*
* @author HYVANA
*/
public class Connexion {
private String login;
private String action;
private Date date;
public Connexion(String login, String action, Date date) {
this.login = login;
this.action = action;
this.date = date;
}
public Connexion() {
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
}
|
fe6075c7-68be-46ba-ad43-571a6bc5cea5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-08-13T22:28:44", "repo_name": "jbrumfield19/mod3-project-gratitude-journal", "sub_path": "/mod3-project-gratitude-journal/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1097, "line_count": 18, "lang": "en", "doc_type": "text", "blob_id": "36b7f730fff7cf70093aa3d402c6e29eca536a56", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/jbrumfield19/mod3-project-gratitude-journal | 224 | FILENAME: README.md | 0.189521 | # README
Welcome to the Gratitude Journal!
This is our module 3 project using Rails as the backend and Javascript on the front end.
The purpose of this project is for the user to have a chance to do a daily check-in. We believe gratitude can generate a powerful mindset and this "pause" in their day can give the user a chance to reset and realign on what is truly important.
The first page will allow the user to write 3 things they are grateful for with short suggestions in the text box.
The second page will allow them to view all their gratitude entries and erase any if necessary.
The third page will allow them to press the play button, which will queue the sound of rain and change the background to rain. This page was inspired by Dev Ed from YouTube.
The fourth page is a chatroom. It was created to allow different users to write anonymously what they were grateful for. This will hopefully give people small reminders on different aspects of their lives that they can be thankful for as well.
I hope to add a user feature where different users can log into their own account.
|
68c01335-432a-4e49-89b1-50c31b075697 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-16 16:02:00", "repo_name": "CheeseMan1213/MySecondQuarkus", "sub_path": "/src/main/java/org/acme/dynamodb/FruitResource.java", "file_name": "FruitResource.java", "file_ext": "java", "file_size_in_byte": 1061, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "0fc4a8e27e228a51e4cd120ff86954b28b079610", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CheeseMan1213/MySecondQuarkus | 228 | FILENAME: FruitResource.java | 0.277473 | package org.acme.dynamodb;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import javax.inject.Inject;
import javax.validation.Valid;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
//@Path("/fruits")
//@Produces(MediaType.APPLICATION_JSON)
//@Consumes(MediaType.APPLICATION_JSON)
@RestController
@RequestMapping("/fruits")
public class FruitResource {
// @Inject
@Autowired
FruitSyncService service;
// @GET
@GetMapping
public List<Fruit> getAll() {
return service.findAll();
}
// @GET
// @Path("{name}")
@GetMapping("/{name}")
public Fruit getSingle(@PathVariable("name") String name) {
return service.get(name);
}
// @POST
@PostMapping
public List<Fruit> add(@Valid @RequestBody Fruit fruit) {
service.add(fruit);
return getAll();
}
} |
511c55c6-85fb-4d6c-b0d1-a33e7bc40ca0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-26 06:50:47", "repo_name": "levonyang/springboot_learning", "sub_path": "/springboot_helloworld/src/main/java/com/wujun/servlet/MyServlet.java", "file_name": "MyServlet.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "3dc0402c42caaa6059d55e0ccf1a191a0511f2e4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/levonyang/springboot_learning | 251 | FILENAME: MyServlet.java | 0.268941 | package com.wujun.servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.io.IOException;
/**
* @author wujun
* @description
* @date 18/1/18.
*/
@WebServlet(
name = "myservlet",
urlPatterns = "/myservlet",
initParams = {@WebInitParam(name = "myname",value = "myvalue")}
)
public class MyServlet extends HttpServlet {
private String value;
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
value = config.getInitParameter("myname");
config.getServletContext().log("servlet init");
}
@Override
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
ServletContext servletContext =req.getServletContext();
servletContext.log("servlet excuting....."+value);
}
@Override
public void destroy() {
getServletContext().log("servlet destroy");
}
}
|
4c4e94c3-e85f-4efb-baca-e221d83c853d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-11 04:55:18", "repo_name": "CloudSlang/cs-actions", "sub_path": "/cs-mail/src/main/java/io/cloudslang/content/mail/entities/SimpleAuthenticator.java", "file_name": "SimpleAuthenticator.java", "file_ext": "java", "file_size_in_byte": 559, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "9cba8f774de8406efcc56110a57c8f3c48038ff1", "star_events_count": 18, "fork_events_count": 37, "src_encoding": "UTF-8"} | https://github.com/CloudSlang/cs-actions | 236 | FILENAME: SimpleAuthenticator.java | 0.226784 | /*
* Copyright 2021-2023 Open Text
* This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available 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 io.cloudslang.content.mail.entities;
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
/**
* Created by giloan on 11/3/2014.
*/
public class SimpleAuthenticator extends Authenticator {
private String username;
private String password;
public SimpleAuthenticator(String username, String password) {
this.username = username;
this.password = password;
}
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
}
|
385ee3df-d5c4-4ab1-abb2-4341c822f015 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-13 02:23:23", "repo_name": "xiaoxinxing12/ChzzUI3.0-Android", "sub_path": "/app/src/main/java/org/chzz/demo/test/OnSaveInstanceStateActivity.java", "file_name": "OnSaveInstanceStateActivity.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "5f6b326fc82b4b00f2b1f4b199481531e9a839d6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xiaoxinxing12/ChzzUI3.0-Android | 223 | FILENAME: OnSaveInstanceStateActivity.java | 0.221351 | package org.chzz.demo.test;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.EditText;
import org.chzz.demo.R;
import org.chzz.demo.ui.activity.BaseActivity;
/**
* Created by copy on 2017/7/10.
*/
public class OnSaveInstanceStateActivity extends BaseActivity {
EditText mTest ;
@Override
protected void initView() {
setContentView(R.layout.activity_onsaveinstancestate);
mTest= (EditText) findViewById(R.id.et_test);
}
@Override
protected void initView(@Nullable Bundle savedInstanceState) {
super.initView(savedInstanceState);
if(null!=savedInstanceState){
}
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString("test","1111");
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
String a =savedInstanceState.getString("test");
}
@Override
protected void setListener() {
}
}
|
13058083-76fb-41f4-a6ad-46f443b6141d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2010-03-22 02:23:42", "repo_name": "Jared314/android-bluetooth-reconnect", "sub_path": "/src/com/android/music/MediaPlayback.java", "file_name": "MediaPlayback.java", "file_ext": "java", "file_size_in_byte": 1189, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "dbf7e01d4dddf788c356bf02bed4fa59c15a4a78", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Jared314/android-bluetooth-reconnect | 258 | FILENAME: MediaPlayback.java | 0.292595 | package com.android.music;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.RemoteException;
import com.android.music.IMediaPlaybackService;
public class MediaPlayback {
private MediaPlayback() {
}
public static void play(Context context) {
Intent i = new Intent();
i.setClassName("com.android.music",
"com.android.music.MediaPlaybackService");
ServiceConnection conn = new MediaPlayerServiceConnection();
context.bindService(i, conn, 0);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
}
context.unbindService(conn);
}
private static class MediaPlayerServiceConnection implements
ServiceConnection {
public IMediaPlaybackService mService;
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mService = IMediaPlaybackService.Stub.asInterface(service);
try {
if (mService != null && !mService.isPlaying())
mService.play();
} catch (RemoteException e) {
}
}
@Override
public void onServiceDisconnected(ComponentName name) {
}
}
}
|
aa61c2f3-54b9-459c-8393-038032203c9f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-15 14:33:42", "repo_name": "XHang/Blog", "sub_path": "/Blog Maven Webapp/src/main/java/com/Mybatis/TypeHandler/BooleanTypeHandler.java", "file_name": "BooleanTypeHandler.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "03eaafa9f6364efef0462429ae31f02d032c697d", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/XHang/Blog | 221 | FILENAME: BooleanTypeHandler.java | 0.26588 | package com.Mybatis.TypeHandler;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.TypeHandler;
public class BooleanTypeHandler implements TypeHandler<Boolean>{
@Override
public Boolean getResult(ResultSet arg0, String arg1) throws SQLException {
System.out.println("getResult");
return null;
}
@Override
public Boolean getResult(ResultSet arg0, int arg1) throws SQLException {
System.out.println("getResult");
return null;
}
@Override
public Boolean getResult(CallableStatement arg0, int arg1)
throws SQLException {
System.out.println("getResult");
return null;
}
@Override
public void setParameter(PreparedStatement arg0, int arg1, Boolean arg2,
JdbcType arg3) throws SQLException {
Boolean b = arg2;
int value = (Boolean) b == true ? 1 : 0;
arg0.setInt(1, value);
}
}
|
1b43cbd5-7eea-478d-92e2-6095f7b0622e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-12-16T18:38:10", "repo_name": "IQSS/datafest", "sub_path": "/DataFest-2018/Introduction-to-Web-Scraping-Web-APIs-w-R/R_retrieving_data/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1075, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "f4eda4582e967a4d2b6713a10e20e798ada2f50b", "star_events_count": 35, "fork_events_count": 38, "src_encoding": "UTF-8"} | https://github.com/IQSS/datafest | 239 | FILENAME: README.md | 0.239349 |
[Data Fest 2018](http://projects.iq.harvard.edu/datafest2018)
============================================================
**AUTHOR**: Ista Zahn
**GitHub repo**: https://github.com/izahn/R_retrieving_data
Web Scraping and Web APIs
---------------------------------------------------------
Researchers often need to
retrieve data from a web service and assemble it into a usable
data set. This workshop will show you how to do that, using the httr
and rvest packages in R.
Prerequisites and Preparation
-----------------------------
If you wish to follow along and try things yourself follow these steps:
- install R from <https://cran.r-project.org/>
- install RStudio from <https://www.rstudio.com/products/rstudio/download/#download>
- install required packages in R with `install.packages(c("httr", "rvest", "jsonlite"))`
A github repository containing the workshop materials is
available <https://github.com/izahn/R_retrieving_data>. You can view lesson notes at
<https://rawgit.com/izahn/R_retrieving_data/master/retrievingOnlineData.html>
if you wish.
|
07749c14-0fa0-4ef1-8d92-d544d388a4eb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-08 18:33:19", "repo_name": "seanevans-test/selenium-test", "sub_path": "/src/test/java/CucumberTests/CucumberTests.java", "file_name": "CucumberTests.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "c149121f92dacf98c70821807577b3a662422d95", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/seanevans-test/selenium-test | 229 | FILENAME: CucumberTests.java | 0.240775 | package CucumberTests;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import java.sql.Driver;
public class CucumberTests {
private WebDriver driver;
@Given("I am in the login page of the Para Bank application")
public void i_am_in_the_login_page_of_the_Para_Bank_application(){
System.setProperty("webdriver.chrome.driver", "C://Drivers//chromedriver.exe");
driver = new ChromeDriver();
driver.get("https://parabanks.parasoft.com/parabank.index.htm");
}
@When("I enter valid credentials")
public void i_enter_valid_credentials(){
driver.findElement(By.name("username")).sendKeys("tautester");
driver.findElement(By.name("password")).sendKeys("password");
driver.findElement(By.name("username")).submit();
}
@Then("I should be taken to the Posts page")
public void i_should_be_taken_to_the_Posts_page(){
}
}
|
a06a0940-e05d-4e5c-bc65-389ea7bb3f36 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-12 06:57:55", "repo_name": "ChengZhang1213/NativeDisplayImage", "sub_path": "/app/src/main/java/com/example/app/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1164, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "a34d718fd3165441a01a96c96eb8179331db55e3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ChengZhang1213/NativeDisplayImage | 214 | FILENAME: MainActivity.java | 0.264358 | package com.example.app;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import com.example.app.gl.GLView;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
GLView mView;
String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/download/images/0.png";
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mView = new GLView(getApplication(),path);
setContentView(mView);
// setContentView(R.layout.activity_main);
// ImageView iv = (ImageView) findViewById(R.id.iv);
// Bitmap bitmap = BitmapFactory.decodeFile(path);
// iv.setImageBitmap(bitmap);
}
@Override
protected void onPause() {
super.onPause();
if (mView != null) {
mView.onPause();
}
}
@Override
protected void onResume() {
super.onResume();
if (mView != null) {
mView.onResume();
}
}
}
|
0227deb3-ebbd-4838-933a-b78c90e78524 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-27 00:17:17", "repo_name": "benjacarp/Final_Interfaz_Grafica", "sub_path": "/src/main/java/ui/car/CarNewDialog.java", "file_name": "CarNewDialog.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "4f40be3f3f732e01646c209d420de1f29ad23ad9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/benjacarp/Final_Interfaz_Grafica | 212 | FILENAME: CarNewDialog.java | 0.282988 | package ui.car;
import exception.DIGAppException;
import model.Car;
import model.Client;
import service.CarService;
import service.ClientService;
import ui.client.ClientAbstractDialog;
import java.sql.Blob;
/**
* Created by ASUS on 18/03/2016.
*/
public class CarNewDialog extends CarAbstractDialog {
public CarNewDialog() {
super();
this.setTitle("New Car");
acceptButton.setText("Save");
}
@Override
protected void guardar() {
Car car = new Car();
car.setMarca(this.campoMarca.getText());
car.setPatente(this.campoPatente.getText());
car.setPrice(Double.parseDouble(this.campoPrecio.getText()));
car.setAvailable(true);
Blob blob = convertImageToBlob(this.image);
car.setPhoto(blob);
try {
CarService.getInstance().save(car);
alertClients(car, false);
} catch (DIGAppException e) {
e.printStackTrace();
}
this.close();
}
}
|
625cc882-5b2d-42da-aab5-1635287dbd3a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-06-22T14:19:35", "repo_name": "SimarChawla/ADModule", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1045, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "8ce15323719dde14760bfef2e37737627d9fbb9f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SimarChawla/ADModule | 238 | FILENAME: README.md | 0.23231 | # ADModule
This module was designed for my workplace.
It contains convenient active directory data gathering functions. Due to policy, these functions only extract data from Active Directory and do not alter the directory in any way.
### The functions included in this module are:
Get-InactiveUsers
Get-PasswordExpiration (Output users who have not logged on in X amount of days)
Get-ContactInfo (Given a name of a user, display the user's basic contact information)
Get-UsersInDepartment (Input department to get its users)
Get-ChainOfCommand (recursively find the chain of command, so an input of Simar Chawla will return "My Manager's name"->"his manager"->"his manager"->...->"Chairman")
Get-OSList (List the OS’s that are in use)
Get-ComputersOnOS (Find the computers operating on the specified OS)
Get-ADGroupList (Output the names of the AD groups currently in the directory)
Get-ADGroupMemberNames (Output the users that belong to a specified AD group)
Get-UserMemberOf (Output the groups that a specified user belongs to)
|
0d0c6cea-417a-4802-89f3-afc519bd6699 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-27 01:16:53", "repo_name": "michaeldrrc/MoneyGame", "sub_path": "/CPT3a/src/MoneyGameFiles/Answer.java", "file_name": "Answer.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "27ac3930723779ee8632400afd1872c6d359dabe", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/michaeldrrc/MoneyGame | 222 | FILENAME: Answer.java | 0.250913 | /*
* 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 MoneyGameFiles;
/**
*
* @author scuba
*/
//Francesco Barranca
import java.awt.*;
import javax.swing.*;
public class Answer {
private String answer = "";
private ImageIcon img;
private boolean right = false;
private boolean type = false;
public Answer() {
}
public Answer(String answer, boolean right) {
this.answer = answer;
this.right = right;
type = true;
}
public Answer(ImageIcon img, boolean right) {
this.answer = null;
this.img = img;
this.right = right;
type = false;
}
public String GetAString() {
return answer;
}
public ImageIcon GetAImage() {
return img;
}
public boolean isRight() {
return right;
}
public boolean isString() {
return type;
}
}
|
653728d8-870d-4649-b695-37a0e6bff078 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-07 10:03:02", "repo_name": "mikeliz89/PottumaaJava", "sub_path": "/PottumaaJava/src/Entity/Enemies/EnemyFactory.java", "file_name": "EnemyFactory.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "e1d0ec57a7691c43f232e47364be9518d6c86792", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mikeliz89/PottumaaJava | 230 | FILENAME: EnemyFactory.java | 0.294215 | package Entity.Enemies;
import Entity.Obstacles.Obstacle;
import TileMap.TileMap;
import java.util.ArrayList;
public class EnemyFactory {
ArrayList<TileMap> tileMaps;
ArrayList<Obstacle> obstacles;
public EnemyFactory(ArrayList<TileMap> tileMaps, ArrayList<Obstacle> obstacles) {
this.tileMaps = tileMaps;
this.obstacles = obstacles;
}
public Enemy getEnemy(int enemyType, int xCoordinate, int yCoordinate, int maxHealth) {
if(enemyType <= 0) {
return null;
}
if(enemyType == EnemySettings.ENEMY_TYPES_SLUGGER) {
var slugger = new Slugger(tileMaps, obstacles, maxHealth);
slugger.setPosition(xCoordinate, yCoordinate);
return slugger;
}
else if(enemyType == EnemySettings.ENEMY_TYPES_ARACHNID) {
var arachnid = new Arachnid(tileMaps, obstacles, maxHealth);
arachnid.setPosition(xCoordinate, yCoordinate);
return arachnid;
}
return null;
}
}
|
4305ee35-e8cd-4983-9227-14071ef7c3b7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-04 07:26:16", "repo_name": "Unicorn-Team/android-practices", "sub_path": "/ryh/androidPractice/app/src/main/java/com/example/yueh/androidpractice/TestServiceActivity.java", "file_name": "TestServiceActivity.java", "file_ext": "java", "file_size_in_byte": 1110, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "147c865edb04028608c690b0aec9beead298d320", "star_events_count": 0, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/Unicorn-Team/android-practices | 189 | FILENAME: TestServiceActivity.java | 0.23793 | package com.example.yueh.androidpractice;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class TestServiceActivity extends AppCompatActivity {
private TestService.CounterBinder counterBinder;
private ServiceConnection connection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
counterBinder = (TestService.CounterBinder) service;
counterBinder.startCount();
counterBinder.getNumber();
}
@Override
public void onServiceDisconnected(ComponentName name) {
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test_service);
Intent serviceIntent = new Intent();
serviceIntent.setClass(this,TestService.class);
startService(serviceIntent);
}
}
|
0569416a-dfe8-4ce2-a6d6-536401227356 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-27 00:24:44", "repo_name": "NSU-SP21-CSE486-1/1632858-SP21-CSE486-S01", "sub_path": "/Lab/Lab05/LoginScreen/app/src/main/java/com/example/loginscreen/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1162, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "8ee19564ca17e06d16d2d4119d68321ba11f920b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NSU-SP21-CSE486-1/1632858-SP21-CSE486-S01 | 206 | FILENAME: MainActivity.java | 0.233706 | package com.example.loginscreen;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private EditText mEmailEditText;
private EditText mPasswordEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mEmailEditText = findViewById(R.id.Email_edittext);
mPasswordEditText = findViewById(R.id.Password_edittext);
}
public void checkValidation(View view) {
String email = mEmailEditText.getText().toString();
String password = mPasswordEditText.getText().toString();
if(email.equals("sadman@gmail.com") && password.equals("12345")){
Intent intent = new Intent(this,SuccessScreen.class);
startActivity(intent);
}
else{
Toast toast = Toast.makeText(this, R.string.toast_message,Toast.LENGTH_SHORT);
toast.show();
}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.