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 |
|---|---|---|---|---|---|---|
7fe43a48-f5bb-46f3-bd19-de663b7d1abf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-06 08:59:33", "repo_name": "WaterMoonMirror/spring-cloud-book", "sub_path": "/consumer-book/src/main/java/com/wondersgroup/simple/consumer/controller/ConsumerController.java", "file_name": "ConsumerController.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "044280ab035812fd8a9c56354b68ed71ee532393", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/WaterMoonMirror/spring-cloud-book | 203 | FILENAME: ConsumerController.java | 0.249447 | package com.wondersgroup.simple.consumer.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import com.netflix.appinfo.InstanceInfo;
import com.netflix.discovery.EurekaClient;
import com.wondersgroup.simple.consumer.entity.User;
@RestController
public class ConsumerController {
@Autowired
private RestTemplate restTemplate;
@Autowired
private EurekaClient eurekaClient;
@GetMapping("/consumer/{id}")
public User findById(@PathVariable Long id){
InstanceInfo url = eurekaClient.getNextServerFromEureka("PROVIDE", false);
return restTemplate.getForObject(url.getHomePageUrl()+"provice/"+id, User.class);
}
@GetMapping("/url")
public String url(){
InstanceInfo url = eurekaClient.getNextServerFromEureka("PROVIDE", false);
return url.getHomePageUrl();
}
}
|
ffdd4bba-8478-4f8f-9bbf-3cac880a1dd9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-24 23:43:12", "repo_name": "JordanWWood/Minecraft-Severside-Plugins-Portfolio", "sub_path": "/MinigameCore/SurvivalGames/src/main/java/network/marble/game/mode/survivalgames/commands/Whisper.java", "file_name": "Whisper.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "5f1612ca6c58317c31fdd6dcb4dde24e790257df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JordanWWood/Minecraft-Severside-Plugins-Portfolio | 240 | FILENAME: Whisper.java | 0.29584 | package network.marble.game.mode.survivalgames.commands;
import network.marble.game.mode.survivalgames.listeners.GameListener;
import network.marble.game.mode.survivalgames.listeners.StateListener;
import network.marble.minigamecore.entities.command.MinigameCommand;
import network.marble.minigamecore.entities.player.PlayerType;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.*;
public class Whisper extends MinigameCommand {
public Whisper(String name) {
super(name);
this.CANBERUNBY.add(PlayerType.PLAYER);
this.COMMANDALIASES = Arrays.asList("whisper", "w");
}
@Override
public boolean commandExecution(CommandSender commandSender, String s, String[] args) {
Player p = (Player) commandSender;
String message = args[0];
for(int i = 1; i < args.length; i++){
message += " " + args[i];
}
GameListener.sendMessage(StateListener.getMapConfig().getChat().getWhisperDistance(), message, p.getDisplayName(), p.getLocation());
return true;
}
}
|
7b7a8909-93ef-45ba-b5b4-d7afc193244d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-14 07:18:58", "repo_name": "rkskekabc/shoppingmall_front", "sub_path": "/src/main/java/com/cafe24/shoppingmall_front/security/CustomUserDetailService.java", "file_name": "CustomUserDetailService.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "4d1030557778184a59c475a93b7adfe8bfb4bcc1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rkskekabc/shoppingmall_front | 228 | FILENAME: CustomUserDetailService.java | 0.290981 | package com.cafe24.shoppingmall_front.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import com.cafe24.shoppingmall_front.dto.JSONResult;
import com.cafe24.shoppingmall_front.vo.MemberVo;
@Service
public class CustomUserDetailService implements UserDetailsService {
private final String BASE_URL = "http://localhost:8080/api";
@Autowired
private RestTemplate restTemplate;
public MemberVo getMemberById(String id) {
JSONResultMember result = restTemplate.getForObject(BASE_URL + "/member/" + id, JSONResultMember.class);
MemberVo vo = result.getData();
return vo;
}
@Override
public UserDetails loadUserByUsername(String id) throws UsernameNotFoundException {
MemberVo vo = getMemberById(id);
return new SecurityMember(vo);
}
private static class JSONResultMember extends JSONResult<MemberVo> {
}
}
|
996a4ffc-d470-4c4d-9244-02419b320863 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-31 05:08:03", "repo_name": "GamiiisKth/giga-example", "sub_path": "/giga-example/src/main/java/se/so4it/learn/domain/Customer.java", "file_name": "Customer.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "3bec8caf2aa5c26b0e89efb678c7026da93b19aa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/GamiiisKth/giga-example | 241 | FILENAME: Customer.java | 0.236516 | package se.so4it.learn.domain;
import se.so4it.learn.common.IdEntity;
import java.util.Objects;
/**
* @author Ali yusha {@literal <mailto:ali.yusha@so4it.com>}
*/
public class Customer extends IdEntity<String> {
private String name;
private String id;
private Customer(Builder builder) {
this.id = builder.id;
this.name = builder.name;
}
public static Builder builder() {
return new Builder();
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public static class Builder {
private String id;
private String name;
public Builder withName(String name) {
this.name = name;
return this;
}
public Builder withId(String id) {
this.id = id;
return this;
}
public Customer build() {
return new Customer(this);
}
}
@Override
public String toString() {
return "Customer{" +
"name='" + name + '\'' +
", id='" + id + '\'' +
'}';
}
}
|
22973f3d-2e65-4df6-8ba5-28dc1819f3fd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-09-19 04:41:38", "repo_name": "paradite/CS2106SimpleKernel", "sub_path": "/src/zhuliang/nus/cs2106/KernelResource.java", "file_name": "KernelResource.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "fcc8022af58581cf04559cba997e9bf67caed4e2", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/paradite/CS2106SimpleKernel | 230 | FILENAME: KernelResource.java | 0.273574 | package zhuliang.nus.cs2106;
import java.util.LinkedList;
/**
* Class for resources
* Created by paradite on 2/9/14.
*/
public class KernelResource {
public String RID;
// Number of free units
public int max_unit;
public int status;
public LinkedList<KernelProcess> blocked_list;
public LinkedList<KernelProcess> using_list;
public KernelResource(int unit, String RID) {
this.max_unit = unit;
this.status = unit;
this.RID = RID;
this.blocked_list = new LinkedList<KernelProcess>();
this.using_list = new LinkedList<KernelProcess>();
}
/**
* Remove the blocked process and return it if it exists
* @return {@link zhuliang.nus.cs2106.KernelProcess} or null
*/
public KernelProcess getAndRemoveBlocked(){
if(this.blocked_list == null || this.blocked_list.isEmpty()){
return null;
}else{
return this.blocked_list.removeFirst();
}
}
}
|
4157e44f-e55e-46ff-a3cb-a2e928d035e7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-22 08:39:50", "repo_name": "micnice/voucher-mobile", "sub_path": "/app/src/main/java/morris/com/voucher/graphql/GraphQL.java", "file_name": "GraphQL.java", "file_ext": "java", "file_size_in_byte": 1039, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "d4c25fba31b9eb06c16cc41b216757fbc29ca802", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/micnice/voucher-mobile | 250 | FILENAME: GraphQL.java | 0.27513 | package morris.com.voucher.graphql;
import com.apollographql.apollo.ApolloClient;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
/**
* Created by morris on 03/01/2019
*/
public class GraphQL {
public static final String BASE_URL =
"http://192.168.43.250:2508/graphql/";
//"http://192.168.1.192:2508/graphql";
//"http://173.82.51.162:2508/graphql";
private static ApolloClient apolloClient;
public static ApolloClient getApolloClient(){
// HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
// loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient okHttpClient = new OkHttpClient.Builder()
// .addInterceptor(loggingInterceptor)
.connectTimeout(10, TimeUnit.SECONDS)
.build();
apolloClient = ApolloClient.builder()
.serverUrl(BASE_URL)
.okHttpClient(okHttpClient)
.build();
return apolloClient;
}
}
|
32233a8f-de95-435c-adec-33e85286412b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-26 00:07:40", "repo_name": "wissensolutions/learning-java", "sub_path": "/Conceptual-Questions/src/main/java/reflection/ClassA.java", "file_name": "ClassA.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "f4704a6531bc5fa202fc40900d7c744ee724064b", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wissensolutions/learning-java | 234 | FILENAME: ClassA.java | 0.255344 | package reflection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* ClassA
* Learning
*
* @author WissenSolutions.
*/
public class ClassA {
private static final Logger logger = LoggerFactory.getLogger(ClassA.class);
private int id;
private String name;
private ClassA(int iId, String iName) {
id = iId;
name = iName;
}
public ClassA() {
}
public int getId() {
return id;
}
public void setId(int iId) {
id = iId;
}
public String getName() {
return name;
}
public void setName(String iName) {
name = iName;
}
public void printObject(){
logger.info(toString());
}
public ClassA createInstance(int iId, String iName){
return new ClassA(iId,iName);
}
@Override
public String toString() {
return "ClassA{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
}
|
beb75770-f11c-432e-b4aa-d128e2623585 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-27 07:32:21", "repo_name": "ShaneKingArchive/org.shaneking.sql", "sub_path": "/src/main/java/org/shaneking/sql/entity/SKZoneAdtVerFullEntity.java", "file_name": "SKZoneAdtVerFullEntity.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "e5f3ba0e5891651e1bf84439207fb14a7b68b3e0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ShaneKingArchive/org.shaneking.sql | 297 | FILENAME: SKZoneAdtVerFullEntity.java | 0.291787 | package org.shaneking.sql.entity;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.shaneking.skava.util.Date0;
import javax.persistence.Column;
/**
* Just reference
*/
@Accessors(chain = true)
@ToString
public abstract class SKZoneAdtVerFullEntity<J> extends SKIdAdtVerFullEntity<J> {
/**
* @see org.shaneking.skava.util.Date0#XXX
*/
@Column(length = 10, columnDefinition = "COMMENT 'The creation time zone of record'")
@Getter
@Setter
private String crtZone;
/**
* @see org.shaneking.skava.util.Date0#XXX
*/
@Column(length = 10, columnDefinition = "COMMENT 'The invalid time zone of record'")
@Getter
@Setter
private String ivdZone;
/**
* @see org.shaneking.skava.util.Date0#XXX
*/
@Column(length = 10, columnDefinition = "COMMENT 'The last modification time zone of record'")
@Getter
@Setter
private String modZone;
public SKZoneAdtVerFullEntity<J> initWithUserId(@NonNull String userId) {
super.initWithUserId(userId);
return this.setCrtZone(Date0.on().zone());
}
}
|
9c37a249-a281-476b-bb82-eeabd72f4e5b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-21 07:49:45", "repo_name": "zhonghangIT/MVPBaseApplication", "sub_path": "/app/src/main/java/com/cgt/yuanmeng/baseapplication/ui/splash/SplashActivity.java", "file_name": "SplashActivity.java", "file_ext": "java", "file_size_in_byte": 1149, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "d25685a2a3feedcba43f24460124a5c5e6140a98", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhonghangIT/MVPBaseApplication | 237 | FILENAME: SplashActivity.java | 0.250913 | package com.cgt.yuanmeng.baseapplication.ui.splash;
import android.content.Intent;
import android.os.Bundle;
import com.cgt.yuanmeng.baseapplication.R;
import com.cgt.yuanmeng.baseapplication.base.BaseActivity;
import com.cgt.yuanmeng.baseapplication.ui.main.MainActivity;
/**
* @author zhonghang
* description:
*/
public class SplashActivity extends BaseActivity<SplashContract.Presenter> implements SplashContract.View {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public SplashContract.Presenter initPresenter() {
return new SplashPresenter();
}
@Override
public int getLayoutId() {
return R.layout.activity_splash;
}
@Override
public void initViews() {
}
@Override
public void initData() {
}
@Override
protected void onResume() {
super.onResume();
mPresenter.delayedOperation();
}
@Override
public void startToMainActivity() {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
finish();
}
}
|
95c74c29-090a-4584-9e3c-dada317141f4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-09-07 06:51:49", "repo_name": "zgsxxzzyl/spring-boot-sample-code", "sub_path": "/springboot-web-enterprise/src/main/java/com/framework/aspectj/DataSourceAspect.java", "file_name": "DataSourceAspect.java", "file_ext": "java", "file_size_in_byte": 1161, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "336fff8ad3b67b3c1d9053605908d717eb0f28c4", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zgsxxzzyl/spring-boot-sample-code | 219 | FILENAME: DataSourceAspect.java | 0.239349 | package com.framework.aspectj;
import com.framework.aspectj.lang.annotation.TargetDataSource;
import com.framework.datasource.DynamicDataSourceContextHolder;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Aspect
@Order(-1)
@Component
public class DataSourceAspect {
/**
* 改变数据源
*
* @param joinPoint
* @param targetDataSource
*/
@Before("@annotation(targetDataSource)")
public void changeDataSource(JoinPoint joinPoint, TargetDataSource targetDataSource) {
String dsType = targetDataSource.value().name();
if (!DynamicDataSourceContextHolder.isContainsDataSource(dsType)) {
} else {
DynamicDataSourceContextHolder.setDateSoureType(dsType);
}
}
@After("@annotation(targetDataSource)")
public void clearDataSource(JoinPoint joinPoint, TargetDataSource targetDataSource) {
DynamicDataSourceContextHolder.clearDateSoureType();
}
}
|
c4d00fb0-24ba-4311-ac4f-44aabc791ec9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-12 08:44:14", "repo_name": "linhui123/jhhsProject", "sub_path": "/app/src/main/java/com/jhhscm/platform/fragment/invitation/IntegralFragment.java", "file_name": "IntegralFragment.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "07a379f2070747a98e454a750ce776292f060964", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/linhui123/jhhsProject | 197 | FILENAME: IntegralFragment.java | 0.217338 | package com.jhhscm.platform.fragment.invitation;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.jhhscm.platform.databinding.FragmentIntegralBinding;
import com.jhhscm.platform.fragment.base.AbsFragment;
/**
* 积分
*/
public class IntegralFragment extends AbsFragment<FragmentIntegralBinding> {
private int type;
private String des;
public static IntegralFragment instance() {
IntegralFragment view = new IntegralFragment();
return view;
}
@Override
protected FragmentIntegralBinding bindRootView(LayoutInflater inflater, ViewGroup container, boolean attachToRoot) {
return FragmentIntegralBinding.inflate(inflater, container, attachToRoot);
}
@Override
protected void setupViews() {
type = getArguments().getInt("type", 0);
des = getArguments().getString("des");
if (des != null && des.length() > 0) {
mDataBinding.content.setText(des);
}
}
}
|
5eb8c0ca-f9c8-4153-95a4-37fbe01426ba | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-28 20:09:08", "repo_name": "romanvey/apps17vey-hw2", "sub_path": "/src/main/java/Terminal.java", "file_name": "Terminal.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "d9e321eb7d8ecc94d0dc0bcd785a6a3fa9977ccf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/romanvey/apps17vey-hw2 | 240 | FILENAME: Terminal.java | 0.277473 | import java.util.ArrayList;
public class Terminal {
private ArrayList<ISkiPass> skiPasses;
private SkiPassFactory skiPassFactory;
public Terminal(SkiPassFactory skiPassFactory){
skiPasses = new ArrayList<>();
this.skiPassFactory = skiPassFactory;
}
boolean block(int id){
for(ISkiPass skiPass: skiPasses){
if(skiPass.getId() == id){
skiPass.block();
return true;
}
}
return false;
}
public ArrayList<ISkiPass> getSkiPasses() {
return skiPasses;
}
boolean unblock(int id){
for(ISkiPass skiPass: skiPasses){
if(skiPass.getId() == id){
skiPass.unblock();
return true;
}
}
return false;
}
ISkiPass createSkiPass(SkiPassType skiPassType, ISkiPassChecker checker){
ISkiPass skiPass = skiPassFactory.createSkiPass(skiPassType, checker);
skiPasses.add(skiPass);
return skiPass;
}
}
|
10734d0e-a714-4607-a6a3-65f255b1d4d5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-31 10:14:48", "repo_name": "SugiHaxor/tugasKuliah", "sub_path": "/uas/Insert.java", "file_name": "Insert.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "e12ac413a9d6eb6fbbacbcbe135a847866db3cc3", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/SugiHaxor/tugasKuliah | 219 | FILENAME: Insert.java | 0.271252 | /*
* 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 uas;
import java.sql.Statement;
import javax.swing.JOptionPane;
/**
*
* @author sugi
*/
public class Insert {
Koneksi konek = new Koneksi();
public void insert(int no, String judul, String pengarang, String kategori, int halaman, String penerbit, int tahun) {
try {
konek.koneksi();
Statement statement = konek.con.createStatement();
String sql = "insert into daftarbuku values('" + no + "','" + judul + " ',' " + pengarang + "','" + kategori + "','" + halaman + "','" + penerbit + "','" + tahun + "');";
statement.executeUpdate(sql);
statement.close();
JOptionPane.showMessageDialog(null, "Berhasil Disimpan");
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, ex);
}
}
}
|
4d56131d-b643-49c5-a42a-ade0404ca47d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-05-11 05:54:29", "repo_name": "davidperezmillan/examples", "sub_path": "/services/ServicesFactory.java", "file_name": "ServicesFactory.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "6b2466181e7051b8e8d5fb6f268d65ff4b1043fb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/davidperezmillan/examples | 194 | FILENAME: ServicesFactory.java | 0.243642 | package com.sandbox.sandbox.common.services;
import com.sandbox.sandbox.common.services.beans.BeanServicesDefinition;
/**
* Clase que se encarga de proporcionar los servicios de la aplicación.
*/
public class ServicesFactory {
private static BeanServicesDefinition servicesDef = null;
public static GenericService getService(String key) throws Exception {
GenericService service = null;
service = getService(key, "default");
return service;
}
public static GenericService getService(String key, String variant) throws Exception {
GenericService service = null;
StringBuffer sbVariant = new StringBuffer(variant);
Class clase = Class.forName(servicesDef.getService(key).getSubservice(sbVariant.toString()).getClassName());
service = (GenericService) clase.newInstance();
return service;
}
public static BeanServicesDefinition getServicesDef() {
return servicesDef;
}
public static void setServicesDef(BeanServicesDefinition definition) {
servicesDef = definition;
}
}
|
15a2a2d4-af78-4a6f-8488-be2cbca7b332 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-11 00:02:02", "repo_name": "Taemane/GADS_Practice_Project", "sub_path": "/app/src/main/java/orionlofty/com/apps/gadspracticeproject/services/SubmitServiceBuilder.java", "file_name": "SubmitServiceBuilder.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "e37e0156b155b1efb8da0e437f7a15f366f89a4a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Taemane/GADS_Practice_Project | 199 | FILENAME: SubmitServiceBuilder.java | 0.255344 | package orionlofty.com.apps.gadspracticeproject.services;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class SubmitServiceBuilder {
private static final String URL = "https://docs.google.com/forms/d/e/";
//creating a logger
private static HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor()
.setLevel(HttpLoggingInterceptor.Level.BODY);
//creating OkHttpClient
private static OkHttpClient.Builder client = new OkHttpClient.Builder().
addInterceptor(interceptor);
private static Retrofit.Builder builder = new Retrofit.Builder()
.baseUrl(URL)
.addConverterFactory(GsonConverterFactory.create())
.client(client.build());
private static Retrofit retrofit = builder.build();
public static <S> S buildService(Class<S> serviceType){
return retrofit.create(serviceType);
}
}
|
40b460d6-574c-4233-8c11-eb88c8df41dc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-06-07T02:03:01", "repo_name": "victorwizeline/kotlin-contest", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1211, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "037d92f5bb976e099130142faf13c8d9cdab5f95", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/victorwizeline/kotlin-contest | 275 | FILENAME: README.md | 0.252384 | # Kotlin Contest
**Kotlin Contest** is an android app that shows a list of top albums. The app utilizes [Last FM API](http://www.last.fm/api).
## Project setup
To run the project you should obtain a new Last FM api key that needs to be set in the gradle.properties file.
## Open-source libraries used
- [Retrofit](https://github.com/square/retrofit/) - REST client for Android developed by Square.
- [RxAndroid](https://github.com/ReactiveX/RxAndroid/) - Reactive Extensions for Android.
- [Picasso](https://github.com/square/picasso/) - Image loading and caching library for Android.
## License
Copyright 2017 Victor Mariano Lopez Medina
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
|
8f143f3e-0a06-4cc4-9d59-6f8dea8705a4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-02 12:47:31", "repo_name": "NolanJos/vespa", "sub_path": "/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/MockTenantProvider.java", "file_name": "MockTenantProvider.java", "file_ext": "java", "file_size_in_byte": 951, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "4227567d1459bb49cd5ff6a9186df21906d6bb85", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NolanJos/vespa | 224 | FILENAME: MockTenantProvider.java | 0.286169 | // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.tenant;
import com.yahoo.vespa.config.server.MockReloadHandler;
import com.yahoo.vespa.config.server.rpc.MockRequestHandler;
import com.yahoo.vespa.config.server.ReloadHandler;
import com.yahoo.vespa.config.server.RequestHandler;
/**
* @author Ulf Lilleengen
*/
public class MockTenantProvider implements TenantHandlerProvider {
private final MockRequestHandler requestHandler;
private final MockReloadHandler reloadHandler;
public MockTenantProvider() {
this(false);
}
public MockTenantProvider(boolean pretendToHaveLoadedAnyApplication) {
this.requestHandler = new MockRequestHandler(pretendToHaveLoadedAnyApplication);
this.reloadHandler = new MockReloadHandler();
}
@Override
public RequestHandler getRequestHandler() { return requestHandler; }
@Override
public ReloadHandler getReloadHandler() {
return reloadHandler;
}
}
|
a24a664b-73db-4c01-9ac8-7562596942a7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-22 10:21:34", "repo_name": "yangwulang/music", "sub_path": "/music-spring/src/main/java/top/yangwulang/utils/LoadJson.java", "file_name": "LoadJson.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "8fa579a9297a335d6e40be2027eef896418ece6e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yangwulang/music | 251 | FILENAME: LoadJson.java | 0.262842 | package top.yangwulang.utils;
import java.io.*;
/**
* @author yangwulang
* @date 2020/4/19 增加读取资源目录下的文件转化成string
*/
public class LoadJson {
/**
* 读取resources目录下的request.json文件到内存
*
* @return 加载文件到内存中
* @throws IOException s
*/
public static String loadJson() throws IOException {
return loadJson("/static/json/request.json");
}
/**
* 加载{@link LoadJson}classpath环境下的指定路径数据转成string
*
* @param path 文件地址(相对路径)
* @return 以字符串形式的文件
* @throws IOException s
*/
public static String loadJson(String path) throws IOException {
InputStream resourceAsStream = LoadJson.class.getResourceAsStream(path);
InputStreamReader inputStreamReader = new InputStreamReader(resourceAsStream);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
StringBuilder stringBuffer = new StringBuilder();
String s;
while ((s = bufferedReader.readLine()) != null) {
stringBuffer.append(s);
}
return stringBuffer.toString();
}
}
|
f6e139dc-1989-46dd-9942-3cf20542f670 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-16 05:07:39", "repo_name": "JaysonCheng/LeetCode", "sub_path": "/JavaLeetCode/src/LeetCode/ValidParantheses.java", "file_name": "ValidParantheses.java", "file_ext": "java", "file_size_in_byte": 1210, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "42b4ff8d0abd8bddb4040180955cc1b9bb959d11", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JaysonCheng/LeetCode | 226 | FILENAME: ValidParantheses.java | 0.259826 | package LeetCode;
import java.util.HashMap;
import java.util.Stack;
public class ValidParantheses {
public static boolean isValid(String s) {
if(s.length() < 2) return false;
boolean isValid = false;
HashMap<Character, Character> parentheses = new HashMap<>();
parentheses.put('{', '}');
parentheses.put('(', ')');
parentheses.put('[', ']');
Stack<Character> stack = new Stack<>();
for(int i = 0; i < s.length(); i++) {
if(parentheses.containsKey(s.charAt(i))) {
stack.push(s.charAt(i));
} else {
if(stack.empty()) {
return false;
}
char openParentheses = stack.pop();
if(s.charAt(i) != parentheses.get(openParentheses)) {
isValid = false;
stack.push(openParentheses);
break;
} else {
continue;
}
}
}
if(stack.empty()) isValid = true;
return isValid;
}
public static void main(String[] args) {
System.out.println(isValid("(]"));
}
}
|
78b6a190-3df1-480a-9e69-781c4def3fc2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-10 08:15:01", "repo_name": "IvanButakov/simple", "sub_path": "/src/main/java/com/but/simple/service/MessageService.java", "file_name": "MessageService.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "dab2dad5b22b83f4304c8563ee8ad5730cac8869", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/IvanButakov/simple | 182 | FILENAME: MessageService.java | 0.281406 | package com.but.simple.service;
import com.but.simple.entity.Message;
import com.but.simple.entity.User;
import com.but.simple.repository.MessageRepository;
import com.but.simple.utils.Utils;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service
public class MessageService {
private final MessageRepository messageRepository;
public MessageService(MessageRepository messageRepository) {
this.messageRepository = messageRepository;
}
public void add(User user, String text, String tag, Map<String, Object> model) {
String time = Utils.dateNow();
Message message = new Message(text, tag, time, user);
messageRepository.save(message);
Iterable<Message> messages = messageRepository.findAll();
model.put("messages", messages);
}
public void main(Map<String, Object> model){
Iterable<Message> messages = messageRepository.findAll();
model.put("messages", messages);
}
}
|
62df3e04-2432-4c7e-bdfc-2346a5e6e15f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-09 13:21:09", "repo_name": "heyaoi/LayoutCompareDemo", "sub_path": "/app/src/main/java/com/example/layoutcomparedemo/Titleview.java", "file_name": "Titleview.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "dbb035e101f44d22dceb49864747c1c910a1a122", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/heyaoi/LayoutCompareDemo | 206 | FILENAME: Titleview.java | 0.255344 | package com.example.layoutcomparedemo;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
public class Titleview extends ConstraintLayout {
private static final String TAG = "Titleview";
public Titleview(Context context) {
super(context);
LayoutInflater.from(context).inflate(R.layout.title_view,this);
}
public Titleview(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
LayoutInflater.from(context).inflate(R.layout.title_view,this);
}
public Titleview(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
// LayoutInflater.from(context).inflate(R.layout.title_view,this);
}
/* @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
Log.e(TAG, "onMeasure: " );
}*/
}
|
658c9b9f-678d-40eb-b4d0-d1c40c884ed9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-24 01:09:25", "repo_name": "gonwan/restful", "sub_path": "/springboot/src/main/java/com/gonwan/restful/springboot/model/TUserDateCountPK.java", "file_name": "TUserDateCountPK.java", "file_ext": "java", "file_size_in_byte": 1151, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "94f6390fd88f5486a5830d7e7ca0e5e38f41cfc6", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/gonwan/restful | 258 | FILENAME: TUserDateCountPK.java | 0.264358 | package com.gonwan.restful.springboot.model;
import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.sql.Date;
import java.util.Objects;
public class TUserDateCountPK implements Serializable {
private String username;
private Date rowDate;
@Column(name = "username", nullable = false, length = 32)
@Id
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Column(name = "row_date", nullable = false)
@Id
public Date getRowDate() {
return rowDate;
}
public void setRowDate(Date rowDate) {
this.rowDate = rowDate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TUserDateCountPK that = (TUserDateCountPK) o;
return Objects.equals(username, that.username) &&
Objects.equals(rowDate, that.rowDate);
}
@Override
public int hashCode() {
return Objects.hash(username, rowDate);
}
}
|
1a8da740-fe66-4a27-ba49-cbe033e63895 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-16 07:22:42", "repo_name": "Goliat80/JPABlogg", "sub_path": "/src/main/java/com/example/jpadb/PostsController.java", "file_name": "PostsController.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "458578628892ec99d5b7433603db960ad3811d9f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Goliat80/JPABlogg | 212 | FILENAME: PostsController.java | 0.277473 | package com.example.jpadb;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@Controller
public class PostsController {
@Autowired
private PostsRepository postRepostory;
// @GetMapping("/posts/{Headline}/{Post}")
@GetMapping ("/posts")
public String getposts (Model model){
List<Posts> Posts = (List<Posts>) postRepostory.findAll();
for (int i =0; i < Posts.size(); i++) {
System.out.println(Posts.get(i).getHeadline());
System.out.println(Posts.get(i).getPost());
}
model.addAttribute("Posts", Posts);
return "blogg";
}
@PostMapping("/posts")
public String addposts(Posts posts){
postRepostory.save(new Posts(posts.getPost(), posts.getHeadline()));
return "blogg";
}
}
|
778d3fd7-4223-4eac-b918-7a6187a1bb9e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-28 06:52:47", "repo_name": "A-pZ/spring-session-safe-deserialize-sample", "sub_path": "/src/main/java/com/github/apz/controller/SampleController.java", "file_name": "SampleController.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "3025f5348951f171cf9478396a6f9d60b7da3ec6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/A-pZ/spring-session-safe-deserialize-sample | 233 | FILENAME: SampleController.java | 0.292595 | package com.github.apz.controller;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttribute;
import org.springframework.web.servlet.ModelAndView;
import com.github.apz.model.SampleModel;
import com.github.apz.model.SampleModel.Address;
@Controller
@RequestMapping
public class SampleController {
@GetMapping("setup")
public ModelAndView setup(ModelAndView mnv, HttpSession session) {
//SampleModel sampleModel = SampleModel.of("new user", Address.of("Tochigi", "gyouza-city", 8L));
SampleModel sampleModel = SampleModel.of("new user", Address.of("Tochigi", "gyouza-city"));
session.setAttribute("sampleModel", sampleModel);
mnv.addObject(sampleModel);
mnv.setViewName("sample");
return mnv;
}
@GetMapping("display")
public ModelAndView display(ModelAndView mnv, @SessionAttribute SampleModel sampleModel) {
mnv.addObject(sampleModel);
mnv.setViewName("sample");
return mnv;
}
}
|
98c94e29-023a-4a7e-bd7e-af8a2db1e335 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-25 13:59:16", "repo_name": "akinyeleolat/videorentalapi", "sub_path": "/src/main/java/com/videorentalapi/service/services/UserServiceImpl.java", "file_name": "UserServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1213, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "3ee4fe86e2e29407b23724990fb102b58e284177", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/akinyeleolat/videorentalapi | 203 | FILENAME: UserServiceImpl.java | 0.261331 | package com.videorentalapi.service.services;
import com.videorentalapi.service.models.User;
import com.videorentalapi.service.repository.UserRepository;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import java.util.Optional;
@Service
public class UserServiceImpl implements UserService {
private BCryptPasswordEncoder bCryptPasswordEncoder;
private UserRepository userRepository;
public UserServiceImpl(BCryptPasswordEncoder bCryptPasswordEncoder, UserRepository userRepository) {
this.bCryptPasswordEncoder=bCryptPasswordEncoder;
this.userRepository=userRepository;
}
@Override
public User saveUser(String username, String password) {
User user = new User();
user.setUsername(username);
user.setPassword(bCryptPasswordEncoder.encode(password));
return userRepository.save(user);
}
@Override
public User findByUsername(String username){
User user = new User();
user.setUsername(username);
Optional<User> userDetails=userRepository.findByUsername(user.getUsername());
return userDetails.orElse(null);
}
}
|
4cbe169b-1fc2-48ba-9ebe-0c94c560f2a4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-09 17:22:34", "repo_name": "danielcdev/swingit", "sub_path": "/src/main/java/com/danielcotter/swingit/utility/ModalUtility.java", "file_name": "ModalUtility.java", "file_ext": "java", "file_size_in_byte": 1085, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "1fb4f6e707fa3f0ece715da38ad2efa5ab1d2a8e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/danielcdev/swingit | 223 | FILENAME: ModalUtility.java | 0.277473 | package com.danielcotter.swingit.utility;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import org.springframework.stereotype.Component;
@Component
public class ModalUtility {
public String getInput(String text) {
JLabel label = new JLabel(text);
final JTextField input = new JTextField();
Object[] ob = { label, input };
int result = JOptionPane.showConfirmDialog(null, ob, "SwinGit", JOptionPane.OK_CANCEL_OPTION);
if (result == JOptionPane.OK_OPTION)
return input.getText().trim();
return null;
}
public String dropDown(String choices[], String text) {
String input = (String) JOptionPane.showInputDialog(null, text, "SwinGit", JOptionPane.QUESTION_MESSAGE, null,
choices, choices[0]);
return input;
}
public void error(String error) {
JOptionPane.showMessageDialog(null, "Error\n" + error, "SwinGit", JOptionPane.ERROR_MESSAGE);
}
public void info(String info) {
JOptionPane.showMessageDialog(null, info, "SwinGit", JOptionPane.INFORMATION_MESSAGE);
}
}
|
252c5ada-f128-40d7-b0ad-c3916fcea089 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-07-27 03:22:19", "repo_name": "545923664/xx-im", "sub_path": "/xx-im/src/main/java/com/jzwl/mytest/login/service/impl/LoginServiceImpl.java", "file_name": "LoginServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "9a59dd00dbd4c748c113b8deec63bbfbc603acf8", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/545923664/xx-im | 259 | FILENAME: LoginServiceImpl.java | 0.23231 | package com.jzwl.mytest.login.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jzwl.base.service.BaseService;
import com.jzwl.mytest.login.dao.LoginDao;
import com.jzwl.mytest.login.service.LoginService;
/**
* 登录service接口实现类
*
* @ClassName: LoginServiceImpl
* @author: zhang guo yu
* @date: 2015-1-21 下午2:54:43
* @version: 1.0.0
*/
@Service("loginService")
public class LoginServiceImpl extends BaseService implements LoginService {
@Autowired
private LoginDao loginDao;
/**
* 通过用户名获取用户账户信息
* @param userName 用户名
* */
public Map<String,Object> getUserInfoByUserName(String userName){
return loginDao.getUserInfoByUserName(userName);
}
/**
* 通过用户名获取用户角色权限信息
* @param userName 用户名
* */
public List<Map<String, Object>> getUserRolesInfoByUserName(String userName){
return loginDao.getUserRolesInfoByUserName(userName);
}
}
|
a26d121e-8fb6-448f-b6a5-a0700f10b458 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-04-09T01:04:30", "repo_name": "bingoohuang/flume-more", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1052, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "dbcfc30a77440fc95f22447e383f6353ceac4566", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/bingoohuang/flume-more | 275 | FILENAME: README.md | 0.294215 | # flume-more
more sources, interceptors and others
## more sources
### com.github.bingoohuang.flume.more.source.ExecBlockSource
Enhance exec source to support a log event which may contain multiple lines like java exception trace stacks.
example:
a1.sources = r1
a1.channels = c1
a1.sources.r1.type = com.github.bingoohuang.flume.more.source.ExecBlockSource
a1.sources.r1.boundaryRegex=\d{4}-\d{2}-\d{2}
a1.sources.r1.command = tail -F /var/log/secure
a1.sources.r1.channels = c1
## more interceptors
### com.github.bingoohuang.flume.more.interceptor.MultiStaticInterceptor
Interceptor class that appends multiple static, pre-configured headers to all events.
example:
agent.sources.r1.channels = c1
agent.sources.r1.type = SEQ
agent.sources.r1.interceptors = i1
agent.sources.r1.interceptors.i1.type = com.github.bingoohuang.flume.more.interceptor.MultiStaticInterceptor
agent.sources.r1.interceptors.i1.preserveExisting = false
agent.sources.r1.interceptors.i1.keyValues = key1:value1, key2:value2
|
ee0afa4a-6c62-4403-8a42-05edad8a1dda | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-08-14 23:48:20", "repo_name": "brandonegg/soldiersvszombies", "sub_path": "/src/me/bman7842/soldiersvszombies/managers/ArenaManager.java", "file_name": "ArenaManager.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "5b79b9e55fbb0f3c2f7ca13bab4f54a289ee4ba3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/brandonegg/soldiersvszombies | 262 | FILENAME: ArenaManager.java | 0.293404 | package me.bman7842.soldiersvszombies.managers;
import me.bman7842.soldiersvszombies.utils.FileManager;
import java.util.ArrayList;
import java.util.Random;
/**
* Created by brand_000 on 8/2/2015.
*/
public class ArenaManager {
private ArrayList<Arena> arenas;
private ArenaManager(){
this.arenas = new ArrayList<Arena>();
}
static ArenaManager instance = new ArenaManager();
public static ArenaManager getInstance() {
return instance;
}
public void setup() {
arenas.clear();
for (String arenaId : FileManager.getArenas().getKeys()) {
arenas.add(new Arena(arenaId));
}
}
public Arena getArena(String id) {
for (Arena arena : arenas) {
if (arena.getID().equals(id)) {
return arena;
}
}
return null;
}
public ArrayList<Arena> getArenas() {
return arenas;
}
public Arena getActiveArena() {
Random r = new Random();
int index = r.nextInt(getArenas().size());
return getArenas().get(index);
}
}
|
374db919-c04a-4c5a-ab84-274ebd89639d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-07 17:19:09", "repo_name": "kkdrz/powierzenia", "sub_path": "/src/main/java/pl/edu/pwr/service/mapper/CourseMapper.java", "file_name": "CourseMapper.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "41fa709bc22d2963c674fda4e2b0b9be1864abf4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kkdrz/powierzenia | 258 | FILENAME: CourseMapper.java | 0.280616 | package pl.edu.pwr.service.mapper;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import pl.edu.pwr.domain.Course;
import pl.edu.pwr.service.dto.CourseDTO;
/**
* Mapper for the entity {@link Course} and its DTO {@link CourseDTO}.
*/
@Mapper(componentModel = "spring", uses = {KnowledgeAreaMapper.class, EducationPlanMapper.class})
public interface CourseMapper extends EntityMapper<CourseDTO, Course> {
@Mapping(source = "educationPlan.id", target = "educationPlanId")
CourseDTO toDto(Course course);
@Mapping(target = "classes", ignore = true)
@Mapping(target = "removeClasses", ignore = true)
@Mapping(target = "removeTags", ignore = true)
@Mapping(source = "educationPlanId", target = "educationPlan")
@Mapping(target = "teachersThatPreferThisCourses", ignore = true)
@Mapping(target = "removeTeachersThatPreferThisCourse", ignore = true)
Course toEntity(CourseDTO courseDTO);
default Course fromId(Long id) {
if (id == null) {
return null;
}
Course course = new Course();
course.setId(id);
return course;
}
}
|
d2e3ac90-7a99-4422-9b14-8e8f3a2fbd5f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-25 22:11:31", "repo_name": "justindongqiang/spring5-mvc-rest", "sub_path": "/src/test/java/guru/springframework/ThisRestTests.java", "file_name": "ThisRestTests.java", "file_ext": "java", "file_size_in_byte": 1151, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "3a236a7a22a30b3e69f301a0b34def2adf36a561", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/justindongqiang/spring5-mvc-rest | 206 | FILENAME: ThisRestTests.java | 0.247987 | package guru.springframework;
import com.fasterxml.jackson.databind.JsonNode;
import guru.springframework.controllers.v1.CategoryController;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.web.client.RestTemplate;
@SpringBootTest
@RunWith(SpringRunner.class)
@WebMvcTest(CategoryController.class)
public class ThisRestTests {
private static final String ROOT_URL = "http://localhost:8080/api/v1/categories";
@Autowired
private MockMvc mvc;
@Test
public void testGetAllCategories() throws Exception {
String apiUrl = ROOT_URL;
RestTemplate restTemplate = new RestTemplate();
JsonNode jsonNode = restTemplate.getForObject(apiUrl, JsonNode.class);
System.out.println("Response");
System.out.println(jsonNode.toString());
}
}
|
54e394ac-b1a2-4358-be4c-3f5ea0a17846 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-01 18:49:47", "repo_name": "dimitrakouu/ClinicProject", "sub_path": "/SoftEng/src/Drug.java", "file_name": "Drug.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 70, "lang": "en", "doc_type": "code", "blob_id": "94bdee14c26bd33781093a23db140be84c580bea", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dimitrakouu/ClinicProject | 232 | FILENAME: Drug.java | 0.285372 | public class Drug {
private String name;
private String id;
private double price;
private int availability;
private int soldUnits;
public Drug(String name, String Id, double price, int availability) {
this.name = name;
this.id = Id;
this.price = price;
this.availability = availability;
this.soldUnits = 0 ;
}
public Drug(String name, String Id) {
this.name = name;
this.id = Id;
}
public String getName() {
return name;
}
public String getId() {
return id;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public int getAvailability() {
return availability;
}
public void setAvailability(int availability) {
this.availability = availability;
}
public void setSoldUnits(int soldUnits) {
this.soldUnits = soldUnits;
}
public int getSoldUnits() {
return soldUnits;
}
}
|
fdbb1a74-0e80-4c0e-be9a-ee49eb1eda6e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-10 08:39:40", "repo_name": "kfcoding/kfcoding-springboot", "sub_path": "/kfcoding-core/src/main/java/com/cuiyun/kfcoding/core/exception/KfCodingExceptionEnum.java", "file_name": "KfCodingExceptionEnum.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "2ee9ac63ea5c7561873b85556a66946b627df9af", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kfcoding/kfcoding-springboot | 272 | FILENAME: KfCodingExceptionEnum.java | 0.243642 | package com.cuiyun.kfcoding.core.exception;
/**
* @program: kfcoding
* @description: KfCoding异常枚举
* @author: maple
* @create: 2018-05-05 21:05
**/
public enum KfCodingExceptionEnum implements ServiceExceptionEnum {
/**
* 其他
*/
WRITE_ERROR(500,"渲染界面错误"),
/**
* 文件上传
*/
FILE_READING_ERROR(400,"FILE_READING_ERROR!"),
FILE_NOT_FOUND(400,"FILE_NOT_FOUND!"),
/**
* 错误的请求
*/
REQUEST_NULL(400, "请求有错误"),
SERVER_ERROR(500, "服务器异常");
KfCodingExceptionEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
private Integer code;
private String message;
@Override
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
@Override
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
|
ff1aaa8e-c3b8-42a8-bcaa-4a49a8984751 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-23 15:03:44", "repo_name": "sebasdelr/XMLViewer", "sub_path": "/src/sample/xmlviewer/data/ViewerManager.java", "file_name": "ViewerManager.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "a4ed70b1ea763be9748a0cbf28c41680544dea60", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sebasdelr/XMLViewer | 215 | FILENAME: ViewerManager.java | 0.264358 | package sample.xmlviewer.data;
import javafx.scene.control.TreeItem;
import sample.xmlviewer.main.ViewerWindowMain;
import java.io.File;
import java.util.ArrayList;
public class ViewerManager {
private static File xmlFile;
private static String xsdFilePath;
private static ArrayList<TreeItem<String>> treeItem;
public static void setTreeItem(ArrayList<TreeItem<String>> item){
treeItem = item;
ViewerWindowMain.contentPanel.setRootItem();
}
public static ArrayList<TreeItem<String>> getTreeItem() {
return treeItem;
}
public static void setXmlFile(File xmlFile) {
ViewerManager.xmlFile = xmlFile;
ViewerWindowMain.footerPanel.setLabel(getXmlFilePath());
}
public static String getXmlFilePath(){
return xmlFile.getAbsolutePath();
}
public static void setXsdFilePath(String xsdFilePath) {
ViewerManager.xsdFilePath = xsdFilePath;
}
public static String getXsdFilePath() {
return xsdFilePath;
}
}
|
67ec0690-b0f7-4cec-8edc-2a7c27e9e497 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-10-06T02:31:14", "repo_name": "Harris-Lodi/HTML_CSS_JS_WebSite", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1045, "line_count": 16, "lang": "en", "doc_type": "text", "blob_id": "4986fe776535b4088e0ea1d0d42a3852e84bc332", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Harris-Lodi/HTML_CSS_JS_WebSite | 270 | FILENAME: README.md | 0.205615 | # HTML_CSS_JS_WebSite
My attempt to get started with basic web dev using HTML, CSS, and Javascript.
This project is to help me get used to working with HTML and CSS while being an introduction for Javascript for me! <br />
This project is based on 'The Road' project from lashaNoz on Github, it's not meant to be public but to help me learn web dev as well as to use it as a reference guide for my future projects!<br />
lashaNoz's project can be found here: https://github.com/lashaNoz/The-Road/tree/Final <br/>
lashaNoz's video can be found on his youtube channel 'CodeandCreate', link to video is here: https://www.youtube.com/watch?v=qmyN7lYY_xo <br />
<b>Requirements</b><br />
<ul>
<li>A Local Host Server: I am using the 'Live Server' extension from Visual Studio Code/Codium to create a virtual server to view to site. You can use any virtual server tool to make your own server!</li>
</ul><br />
<b>Notes: </b><br />
Project finished, can and may expand it in the future, in the mean time to be used as reference!<br />
|
a3bafc58-1951-4a2b-a2ac-6d644a7dc589 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-09 16:10:46", "repo_name": "Sharon131/Theory-of-Concurrency-Laboratory", "sub_path": "/Lab5/src/main/java/readers_writers/readers_first/Writer.java", "file_name": "Writer.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "db56e8463ae822ac5d5f3c642d3895060b75bc03", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Sharon131/Theory-of-Concurrency-Laboratory | 232 | FILENAME: Writer.java | 0.279828 | package readers_writers.readers_first;
import java.util.Random;
import java.util.concurrent.Semaphore;
public class Writer extends Thread {
private Random gen = new Random();
private Semaphore _sem;
private SynchData _synchData;
public Writer(Semaphore sem, SynchData synchData) {
_sem = sem;
_synchData = synchData;
}
public void run() {
_synchData.lock.lock();
try {
while (!_synchData.canWrite)
{
_synchData.write_cond.await();
}
while (!_sem.tryAcquire()) {}
// System.out.println("Writing...");
int time_to_sleep = 10;
sleep(time_to_sleep);
// System.out.println("Writing finished.");
if (_synchData.waiting_readers_no != 0)
{
_synchData.canWrite = false;
} else {
_synchData.write_cond.signal();
}
} catch (Exception e) {}
_sem.release();
_synchData.lock.unlock();
}
}
|
a8f5e422-a6e7-4579-ba01-efc4b88c0d8d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-05-23 13:42:16", "repo_name": "tomaaron/ID3-Tag-Editor", "sub_path": "/src/model/id3/ID3Frame.java", "file_name": "ID3Frame.java", "file_ext": "java", "file_size_in_byte": 1211, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "7e6011014a0964ba7da09ff02a87ef8ba515caa7", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/tomaaron/ID3-Tag-Editor | 406 | FILENAME: ID3Frame.java | 0.286169 | package model.id3;
/**
*
* represents a mp3 frame
*
* @author MPGI 4, WS 11/12, Tutorium 01, Gruppe 05
*
*/
public class ID3Frame {
public static final int TAG_ALTER_PRESERVATION = 0;
public static final int FILE_ALTER_PRESERVATION = 1;
public static final int READ_ONLY = 2;
public static final int COMPRESSION = 3;
public static final int ENCRYPTION = 4;
public static final int GROUPING_IDENTIFY = 5;
private String id;
private byte[] flags;
public ID3Frame(String id, byte[] flags) {
this.id = id;
this.flags = flags;
}
public String getID() {
return id;
}
public byte[] getFlags() {
return flags;
}
public static boolean isFlagSet(byte[] flags, int flag) {
switch (flag) {
case TAG_ALTER_PRESERVATION:
return (flags[0] & 1 << 7) == 1 << 7;
case FILE_ALTER_PRESERVATION:
return (flags[0] & 1 << 6) == 1 << 6;
case READ_ONLY:
return (flags[0] & 1 << 5) == 1 << 5;
case COMPRESSION:
return (flags[1] & 1 << 7) == 1 << 7;
case ENCRYPTION:
return (flags[1] & 1 << 6) == 1 << 6;
case GROUPING_IDENTIFY:
return (flags[1] & 1 << 5) == 1 << 5;
}
return false;
}
public boolean isFlagSet(int flag) {
return isFlagSet(flags, flag);
}
}
|
617a7e62-4fc0-4007-b20a-48c97b3ed0a5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-12 16:33:18", "repo_name": "pinzhuo-zhao/Online-whiteboard-project", "sub_path": "/src/ClientMessage.java", "file_name": "ClientMessage.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "56234488ff264c02dd2260f207df9dc8fbc326c3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pinzhuo-zhao/Online-whiteboard-project | 240 | FILENAME: ClientMessage.java | 0.23793 | import java.io.Serializable;
/**
* @program: COMP90015A2
* @description:
* @author: Pinzhuo Zhao, StudentID:1043915
* @create: 2021-05-07 21:07
**/
public class ClientMessage implements Serializable {
String prefix;
String message;
private static final long serialVersionUID = 1L;
public ClientMessage(String prefix, String message) {
this.prefix = prefix;
this.message = message;
}
public ClientMessage(String prefix) {
this.prefix = prefix;
}
public ClientMessage() {
}
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "ClientMessage{" +
"prefix='" + prefix + '\'' +
", message='" + message + '\'' +
'}';
}
}
|
115361ea-99fd-4210-b10f-6841fc65dc95 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-06 04:05:39", "repo_name": "vescame/SimpleSpringSecurity", "sub_path": "/src/main/java/edu/vescame/simpleSpringSecurity/seed/RoleInitializer.java", "file_name": "RoleInitializer.java", "file_ext": "java", "file_size_in_byte": 1033, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "86c3ce5aa732cdc6b25353a2dc0397be452689a8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vescame/SimpleSpringSecurity | 188 | FILENAME: RoleInitializer.java | 0.249447 | package edu.vescame.simpleSpringSecurity.seed;
import edu.vescame.simpleSpringSecurity.entity.Role;
import edu.vescame.simpleSpringSecurity.repository.RoleRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
import java.util.Arrays;
@Component
public class RoleInitializer implements ApplicationListener<ContextRefreshedEvent> {
private final RoleRepository roleRepository;
@Autowired
public RoleInitializer(final RoleRepository roleRepository) {
this.roleRepository = roleRepository;
}
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
this.roleRepository.saveAll(roles());
}
private Iterable<Role> roles() {
Role admin = new Role("ROLE_ADMIN");
Role user = new Role("ROLE_USER");
return Arrays.asList(admin, user);
}
}
|
cb74d228-6aa0-44e3-9219-a07da8e437a9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-10-02T14:37:31", "repo_name": "jbaysolutions/vue-bootstrap-select", "sub_path": "/docs/index.md", "file_name": "index.md", "file_ext": "md", "file_size_in_byte": 1234, "line_count": 72, "lang": "en", "doc_type": "text", "blob_id": "c8201779b0987fdcf89ca82c3a4de85d5df7dd64", "star_events_count": 5, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/jbaysolutions/vue-bootstrap-select | 311 | FILENAME: index.md | 0.224055 | # Vue-Bootstrap-Select
vue-bootstrap-select - A dropdown select component, that allows for single and multiple selection as well as filtering, for vue.js.
### Version : 0.0.1 - Beta version
### [Demo](https://jbaysolutions.github.io/vue-bootstrap-select/examples/01-basic.html)
<!--
## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Contribute](#contribute)
- [TODO List](#todo-list)
## Demos
TODO UPDATE DOCS
TODO UPDATE CHANGELOG
-->
#### Projects using vue-bootstrap-table
*Know of others? Create a PR to let me know!*
## Features
## Requirements
* Vue 2.* (tested with 2.3.3)
* Bootstrap 4
## Installation
Install the vue-bootstrap-select [package](https://www.npmjs.org/package/vue-bootstrap-select) package using [npm](https://www.npmjs.com/):
npm install vue-bootstrap-select
Or add the js script to your html (download from [releases](https://github.com/jbaysolutions/vue-bootstrap-select/releases)):
<script src="vue-bootstrap-table.js"></script>
## Usage
Not written yet
## Contribute
If you have a feature request, please add it as an issue or make a pull request.
## TODO List
Many stuff,
## Changelog
### 0.0.1
* Starting point
|
7859d1b0-b2ac-4e8b-ba32-fed03a1da896 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-02-22 10:23:44", "repo_name": "sujeet100/filesearch", "sub_path": "/FileSearch/src/com/filesearch/SearchQuery.java", "file_name": "SearchQuery.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "f00be36ea762accaec8998ccfb260ededa6c6bcd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sujeet100/filesearch | 228 | FILENAME: SearchQuery.java | 0.280616 | package com.filesearch;
import java.util.Arrays;
import java.util.List;
public class SearchQuery{
private String searchString;
private List<String> fileFilterExtensions;
private SortOn sortCriteria;
public SearchQuery(String searchString, String... fileFilterExtensions) {
this.searchString = searchString;
this.fileFilterExtensions = Arrays.asList(fileFilterExtensions);
}
public SearchQuery(String searchString, SortOn sortCriteria, String... fileFilterExtensions) {
this.searchString = searchString;
this.sortCriteria = sortCriteria;
this.fileFilterExtensions = Arrays.asList(fileFilterExtensions);
}
public String getSearchString() {
return isPrefixedWithAsterisk()? searchString.replace("*", "") : searchString;
}
public boolean matchesFileFilterExtensions(String fileExtension) {
if(fileFilterExtensions.size() == 0 || fileFilterExtensions.contains("*")){
return true;
}
return fileFilterExtensions.contains(fileExtension);
}
public boolean isPrefixedWithAsterisk(){
return searchString.startsWith("*");
}
public SortOn getSortCriteria() {
return sortCriteria;
}
}
|
1f2d363f-77e1-449a-b314-defeddfb1fd5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-10-11T06:44:10", "repo_name": "akkarthick/magento2", "sub_path": "/Mailer/Ews/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1151, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "1b0c3e2925ed623e009b3a8dd1398a62072e94c7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/akkarthick/magento2 | 279 | FILENAME: README.md | 0.264358 | <h1>PHP Exchange Web Services</h1>
The PHP Exchange Web Services library (php-ews) is intended to make communication with Microsoft Exchange servers using Exchange Web Services easier. It handles the NTLM authentication required to use the SOAP services and provides an object-oriented interface to the complex types required to form a request.
<h2>Dependencies</h2>
Composer
PHP 5.4 or greater
cURL with NTLM support (7.30.0+ recommended)
Exchange 2007 or later
<h2>Installation</h2>
composer require php-ews/php-ews
<h2>Usage</h2>
$server: The url to the exchange server you wish to connect to, without the protocol. Example: mail.example.com. If you have trouble determining the correct url, you could try using the \jamesiarmes\PhpEws\Autodiscover class.
$username: The user to connect to the server with. This is usually the local portion of the users email address. Example: "user" if the email address is "user@example.com".
$password: The user's plain-text password.
$version (optional): The version of the Exchange sever to connect to. Valid values can be found at \jamesiarmes\PhpEws\Client::VERSION_*. Defaults to Exchange 2007.
|
1799e34b-6b39-4bd9-8f8c-bb948dc2a0b1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-12 12:45:07", "repo_name": "AhGang/RefactorDemo", "sub_path": "/src/main/java/rentalstore/Movie.java", "file_name": "Movie.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "622c6fd30d45688e8f2e04b3d85fd8526f086ca9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AhGang/RefactorDemo | 221 | FILENAME: Movie.java | 0.292595 | package rentalstore;
public class Movie {
public static final int CHILDRENS = 2;
public static final int REGULAR = 0;
public static final int NEW_RELEASE = 1;
private String title;
private int priceCode;
public Movie(String title,int priceCode) {
this.title = title;
this.priceCode = priceCode;
}
public double getMovieType(int dayRented) {
double thisAmount = 0;
switch (this.getPriceCode()) {
case Movie.REGULAR:
return new RegularStrategy().getAmount(dayRented);
case Movie.NEW_RELEASE:
return new NewReleaseStrategy().getAmount(dayRented);
case Movie.CHILDRENS:
return new ChildrenStrategy().getAmount(dayRented);
}
return thisAmount;
}
public int getPriceCode() {
return priceCode;
}
public void setPriceCode(int priceCode) {
this.priceCode = priceCode;
}
public String getTitle() {
return title;
}
}
|
4f61bc1a-5ab9-4812-a5e3-7ef90f38ed2b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-24 15:20:59", "repo_name": "WuMeng-1993/ChangeSkin_Android", "sub_path": "/app/src/main/java/com/wumeng/changeskin_android/util/SkinPreferencesUtil.java", "file_name": "SkinPreferencesUtil.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "d950e651267f8569ecac1e02fc2a4289934b6927", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/WuMeng-1993/ChangeSkin_Android | 233 | FILENAME: SkinPreferencesUtil.java | 0.235108 | package com.wumeng.changeskin_android.util;
import android.content.Context;
import android.content.SharedPreferences;
import com.wumeng.changeskin_android.skin.SkinConfig;
/**
* @author WuMeng
* @date 2021/4/12
* desc:
*/
public class SkinPreferencesUtil {
/**
* 存储字符串
* @param context
* @param key
* @param value
* @return
*/
public static boolean putString(Context context,String key,String value) {
SharedPreferences preferences = context.getSharedPreferences(SkinConfig.PREF_SKIN_NAME,Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putString(key, value);
return editor.commit();
}
/**
* 获取存储的字符串值
* @param context
* @param key
* @param defaultValue
* @return
*/
public static String getString(Context context,String key,String defaultValue) {
SharedPreferences preferences = context.getSharedPreferences(SkinConfig.PREF_SKIN_NAME,Context.MODE_PRIVATE);
return preferences.getString(key,defaultValue);
}
}
|
f64f8572-a82d-4711-b9b9-fdf298d851d3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-08-12 15:41:33", "repo_name": "pojosontheweb/ttt-idea-plugin", "sub_path": "/src/com/pojosontheweb/ttt/TttProjectComponent.java", "file_name": "TttProjectComponent.java", "file_ext": "java", "file_size_in_byte": 1151, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "fb2d1ff588542b4360b8695ee8e428fcdab946bd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pojosontheweb/ttt-idea-plugin | 215 | FILENAME: TttProjectComponent.java | 0.267408 | package com.pojosontheweb.ttt;
import com.intellij.openapi.components.AbstractProjectComponent;
import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.*;
import org.jetbrains.annotations.NotNull;
public class TttProjectComponent extends AbstractProjectComponent {
private final Logger LOG = Logger.getInstance(TttProjectComponent.class.getName());
private final TttCompileOnSaveListener listener;
public TttProjectComponent(@NotNull Project project) {
super(project);
listener = new TttCompileOnSaveListener(project);
}
@NotNull
@Override
public String getComponentName() {
return "TttProjectComponent";
}
@Override
public void projectOpened() {
LOG.info("Registering file listener");
VirtualFileManager.getInstance().addVirtualFileListener(listener);
}
@Override
public void projectClosed() {
LOG.info("Removing file listener");
VirtualFileManager.getInstance().removeVirtualFileListener(listener);
}
}
|
1406bac3-0145-497c-afdf-8e4a2fa4e731 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-08-23T14:56:38", "repo_name": "Sharqiewicz/Wiki-Search", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1211, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "1b4e9deb4c679355c6910191568009bc20f37bd0", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Sharqiewicz/Wiki-Search | 277 | FILENAME: README.md | 0.23793 | ## How to run the application
- clone the repository
- to run the project you need to have NodeJS and NPM installed on your computer
In the project directory, you can run:
- `npm install`
- `npm start`
or you can use yarn
- `yarn install`
- `yarn start`
## Description
In README.md I added instructions how to start the application.
There are 2 fields in the application
- 1 has "Search Input" and "Search Phrase" button, thanks to them you can search phrase in Wikipedia API
- 2 has "Replace With Input" and buttons "Replace" and "Replace With", thanks to them you can change given phrase in list to phrase from "Replace With Input"
The application has loaders and "no results found" if there is no such result in the Wikipedia API.
As for the Wikipedia API data, I didn't use any "sanitize" and dangerouslySetInnerHTML, I just listed the text itself from the snippet.
I used Context API due to the fact that I have little time to complete the task, it would also be convenient to use Redux.
## Technologies
- SASS - for styling
- react-highlight-words - to highlight searched words
- react-debounce-input - to make function wait until getting fired ( set the time between last function calls )
|
32e2a0b5-509b-49f3-aeb2-e03244776400 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-04-01T19:02:30", "repo_name": "Oryinn/Project3", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 989, "line_count": 17, "lang": "en", "doc_type": "text", "blob_id": "cfc54f891898b3ad53ccd245cafeaf24e022224f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Oryinn/Project3 | 221 | FILENAME: README.md | 0.218669 | # Project3
Description
The Atlanta comedy scene is a thriving scene with many venues and many open mic opportunities, however it is very difficult to find out where and when these shows are unless you follow specific comedians on social media. Comedy Tracker is a user sourced site that will allow people to track what comedy shows and open mics are coming to atlanta with information on ticket purchasing and venue location.
Deployed App:
https://comedy-tracker.herokuapp.com/
Trello Board:
https://trello.com/b/Qv9Xte5F/wdi-project-3

The technologies I used in this project are: Node, express, mongoose, React, styled-components, Moment.js, axios, nodemon, concurrently.
In version 2 I would like to add multiple cities to be tracked, pull from the Google calendar API to easily pull open mics, add passport for user authentication, sessions, and the ability to favorite shows so that they show up on an individual users page. |
7edb0194-f5a4-4138-a780-48c3d0b7bd81 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-23 07:31:09", "repo_name": "need4spd/crescent", "sub_path": "/crescent_core_web/src/main/java/com/tistory/devyongsik/crescent/collection/entity/CrescentAnalyzerHolder.java", "file_name": "CrescentAnalyzerHolder.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "d88c2e275dec1c0dd8af46f601783ad7a33a5ff8", "star_events_count": 1, "fork_events_count": 9, "src_encoding": "UTF-8"} | https://github.com/need4spd/crescent | 237 | FILENAME: CrescentAnalyzerHolder.java | 0.23231 | package com.tistory.devyongsik.crescent.collection.entity;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
@XStreamAlias("analyzer")
public class CrescentAnalyzerHolder {
@XStreamAsAttribute
private String type;
@XStreamAlias("className")
@XStreamAsAttribute
private String className;
@XStreamAlias("constructor-args")
@XStreamAsAttribute
private String constructorArgs;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getConstructorArgs() {
return constructorArgs;
}
public void setConstructorArgs(String constructorArgs) {
this.constructorArgs = constructorArgs;
}
@Override
public String toString() {
return "CrescentAnalyzerHolder [type=" + type + ", className="
+ className + ", constructorArgs=" + constructorArgs + "]";
}
}
|
0a9e7ff9-5ea2-4710-928e-748428615df6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-09-28T03:13:23", "repo_name": "jcnesci/cct-project1", "sub_path": "/sake-label-simulator/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1078, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "8fa8e533cc5b42d2e8dc5ac19c50492fa6a6b1db", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jcnesci/cct-project1 | 277 | FILENAME: README.md | 0.226784 | # Sake Label Maker
For exhibition at Creative Code Tokyo, September 2019.
## TODO
- add dat.gui to control sake label params
- [TOCONFIRM]
- sake region -> background gradient color (Ine = red (inemankai), Akita = white (doburoku))
- sake style (junmai, gingjo, daiginjo, honjozo, futsushu) -> shortcut for param presets? (modifies all other params to certain settings)
- SMV -> liquid thickness (sweet is thicker, acidic is thinner)
- semai buai -> liquid color (dark to clear)
- filtering style (nama, hiyaoroshi, pasturized, muroka, nigori, doburoku) -> blurring of liquid
- ... change texture img added to liquid (like in fireball example) for changing... what param?... sake region?
- ... others for deformation intensity, anim speed, etc.
- add sake label text to canvas foreground
- connect dat.gui changes to label text (eg. region changes to "Niigata" -> change text to that)
- add printing file export (or screenshot?)(should be quite long to go around bottle; important?)
dat.gui notes:
- string options allows arrays
- presets exist |
0d2a21e7-2874-464e-b7f2-2ba0b322084d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-05-18T16:17:29", "repo_name": "oddlydrawn/flapShmup", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1027, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "9a8731788e2bfb39627915f72cae3bf968630399", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/oddlydrawn/flapShmup | 372 | FILENAME: README.md | 0.208179 | # flapShmup
A flappy bird shoot em up created with love2d.. LÖVE.. LÖVE2d.. the game framework formerly known as love2d?


I used the following two pages since this was my first time playing with love2d.
I probably should have read up on lua a bit more before starting the project.
[HeadChant's invader's must die page - other pages were not working at the
time](http://www.headchant.com/2010/11/27/love2d-tutorial-part-1-invaders-must-die/)
[NovaFusion's camera page](http://nova-fusion.com/2011/04/19/cameras-in-love2d-part-1-the-basics/)
[Amble font by Punchcut](http://www.fontsquirrel.com/fonts/amble)
[SFX created with bfxr](http://www.bfxr.net/)
[Images created with Aseprite](http://www.aseprite.org/)
[Images edited with GIMP](http://www.gimp.org/)
|
173d3718-8e43-401a-962d-94b19bc4a94d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-08-11T21:29:39", "repo_name": "modern-software-dev-team-3/msdagenda", "sub_path": "/Day03.md", "file_name": "Day03.md", "file_ext": "md", "file_size_in_byte": 1210, "line_count": 15, "lang": "en", "doc_type": "text", "blob_id": "316805c944e8863891f93117a107ccde06756871", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/modern-software-dev-team-3/msdagenda | 266 | FILENAME: Day03.md | 0.281406 | # Day 3
0. Ensure you tag your master branch as day02 before working on Day 3 tasks.
1. Configure your project to use an embedded database (HSQL) to store Customer data. (update dependencies in the build file, create schema.sql). **Note:** All fields are mandatory.
2. Hard-code 2-3 sample records using data.sql.
3. Implement the domain and repository layers so they use JPA to access the embedded database.
4. Implement the service layer (the interface and implementation) to use all repository layer operations.
5. Implement the Customer data API with full CRUD capabilities using Spring Boot. Ensure you return the appropriate status code and also data where applicable.
6. Use the Gradle build process to build and run Customer data API
7. Use Postman to test service endpoints and verify CRUD capabilities of the service
8. Test the service endpoints using the front-end react client
9. Repeat task 1 through 8 to implement and test Event data API
10. Repeat task 1 through 8 to implement and test Registrations data API
11. Demonstrate the service and build process
12. Commit the completed API code and Gradle files to your local repository and also merge changes into the GitHub remote repository.
|
7849cc6b-e362-4e99-805e-7953e6c78f4e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-03-19T19:48:51", "repo_name": "Alex-Dobrynin/Xamarin.Controls.TabView", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1107, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "1df287939b056742e8a22230dc28cff5662c7244", "star_events_count": 6, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Alex-Dobrynin/Xamarin.Controls.TabView | 217 | FILENAME: README.md | 0.262842 | # Xamarin.Controls.TabView
Fully customizable Xamarin.Forms TabView
It is written using Xamarin.Forms without native code and it is fully compatible with all platforms Xamarin.Forms supports
The nuget package: https://www.nuget.org/packages/Xamarin.Controls.TabView
### Initialize:
Make sure to initialize the UI of the TabView inside your App.xaml file:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<tabview:TabViewStyle />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
### Usage:
You can create tabs from markup or from ViewModel specifying ItemsSource and describing DataTemplate and header templates in xaml.
Note: ItemsSource has bigger priority than directly markup tab creation.
### Example of usage:
Here described two types of usage:
https://github.com/Alex-Dobrynin/Xamarin.Controls.TabView/blob/master/Sample.TabVIew/Sample.TabVIew/Views/MainPage.xaml
### Note:
You cannot use typeof Page as tab template.
|
770b277c-6644-4bfd-8498-c6bffd947830 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-04-10T00:12:03", "repo_name": "hamiltont/clasp", "sub_path": "/www/views/doc/getting-started.md", "file_name": "getting-started.md", "file_ext": "md", "file_size_in_byte": 1152, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "f476b3d234ebf19ef5dda7d609a89773654da2d4", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hamiltont/clasp | 282 | FILENAME: getting-started.md | 0.262842 | ## Getting Started
Run `tools/autodetect-config.sh` script to automate detection of
appropriate SDK binaries and configuration setup.
If `tools/autodetect-config.sh` fails, configuration has to be
done manually.
The first item to specify is the path to the appropriate SDK binaries e.g.
android, emulator, adb, etc. Configuration is done using
[typesafe config](https://github.com/typesafehub/config),
which make it simple to define and use configuration.
Locate `$ROOT/src/application.conf.example`, copy
the example contents into `$ROOT/src/application.conf` (or anywhere else on
your build path), and modify the paths of `sdk.root` to reflect your sdk root.
### 5-minute local setup
Install Dependencies: Android SDK, sbt, SSH Server, ia32-libs (for adb), ia32-libs-sdl (for emulator), nodejs & npm (if you want web interface)
$ git clone <URL>
$ cd attack
$ sbt assembly
$ ./tools/autodetect-config.sh
Note: The autodetect will only work if you have Android's tools and/or platform-tools
directory in your PATH. If it fails to work, read src/application.conf.example
$ sbt stage
> run --help
> run --local
|
be36bced-3af1-4ba6-aba9-99ad862dc5e9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-02-22T23:13:03", "repo_name": "sallyvdv/crackerhash", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1082, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "a09904745e43f788ec3d3675602ae581e537adf7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sallyvdv/crackerhash | 271 | FILENAME: README.md | 0.23092 | # crackerhash
What is it?
===========
This is a script to automate password cracking using Hashcat.
Quick Start
------------
Grab the script, unpack it and define variables at the top of the script.
Requirements
------------
Hashcat
Password dictionary such rockyou or crackstation
Usage
-----
Open the script and define the variables that point to the wordlists, hashes, potfile, etc..
You will get the best results if you spend a little time up front creating a good targeted wordlist.
The targeted list consists of previous passwords and specialized words associated with the organization..
Consider using DigiNinja's 'cewl' to generate a wordlist: https://github.com/digininja/CeWl
cewl -d 3 -u "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)" -w \
targeted.txt -v hxxp://target-company.com
Also consider adding:
* Variations on the company name
* Current season and year e.g., Winter2019
* Company city
* Account names
* Users first names
* Creds from public data breaches
* Local sports teams
Run the script: ./crackerhash.sh
|
d968577d-b6aa-4bb6-af00-d242600ab6ce | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-18 05:08:45", "repo_name": "joelcasteel/Artificer", "sub_path": "/src/main/java/artificer/ui/elements/ModNumberField.java", "file_name": "ModNumberField.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "02251df9d0be287edec5a82696fe23cf8820447d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/joelcasteel/Artificer | 199 | FILENAME: ModNumberField.java | 0.290981 | package main.java.artificer.ui.elements;
/**
* A special type of NumberField for displaying modifiers
*
* @author Joel Castel
* @version June 2020
*
*/
public class ModNumberField extends NumberField {
@Override
public int getNumericValue() throws NumberFormatException {
try {
int value = Integer.parseInt(getText());
setNumericValue(value);
return value;
} catch (NumberFormatException ex) {
throw new NumberFormatException();
}
}
/**
* Set the value of the field to a numeric mod value.
* The +/- is applied based on the value
*
* @param value The mod value.
*/
public void setNumericValue(int value) {
String newText = "";
if(value > 0 ) {
newText += "+";
}
newText += Integer.toString(value);
setText(newText);
}
}
|
3000e1f3-e6bd-4c83-a4bf-ea44da353f80 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-22 05:07:15", "repo_name": "githubken0426/SpringInAction", "sub_path": "/SpringInAction/src/spring/chapter_04SpringAOP/test/SpringAopMain.java", "file_name": "SpringAopMain.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "229401c830b3097d6b8e33b84d2370aa889a4c1e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/githubken0426/SpringInAction | 243 | FILENAME: SpringAopMain.java | 0.288569 | package spring.chapter_04SpringAOP.test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import spring.chapter_04SpringAOP.service.Constant;
import spring.chapter_04SpringAOP.service.Performer;
import spring.chapter_04SpringAOP.service.Thinker;
import spring.util.XMLClassPath;
/**
* 测试类
*
* @author Administrator
*
* 2016-6-14 上午09:54:54
*/
public class SpringAopMain {
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext(
XMLClassPath.XML_CHAPTER_04_PATH);
Performer juggler = (Performer) context.getBean("juggler");
juggler.perform();
// Constant constant=(Constant) juggler;
// constant.receiveAward();
System.out.println("****************************************");
// Thinker thinker=(Thinker) context.getBean("thinkerImpl");
// thinker.thinkOfSomething("I am the winner!");
}
}
|
8afef321-20df-41ab-96b7-e947944e4624 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-14 05:44:21", "repo_name": "zhouzgang/ecomb", "sub_path": "/ecomb-common/ecomb-common-provider-api/src/main/java/cn/ecomb/common/provider/api/constant/SxApiUserConstant.java", "file_name": "SxApiUserConstant.java", "file_ext": "java", "file_size_in_byte": 1143, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "ffe90eb1f9c1372eae762916e14fdb7a55d32eff", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/zhouzgang/ecomb | 384 | FILENAME: SxApiUserConstant.java | 0.27513 | package cn.ecomb.common.provider.api.constant;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author zhouzg
* @date 2019/8/5
*/
public enum SxApiUserConstant {
SUI_XING(Arrays.asList("5e8ee649e92b")),
KOU_BEI(Arrays.asList("77a42fbb415a")),
XIAO_MI(Arrays.asList("1845de4cb75c")),
OPPO(Arrays.asList("8d44efc20dc2","e994b41725dc")),
VIVO(Arrays.asList("e7cf3bccc7fa")),
SMART_PARKING(Arrays.asList("f37fd43a9f0d")),
TEST_ELBS(Arrays.asList("af28a8e71a97")),
MEIZU(Arrays.asList("f8a58c9f343e","dc1dd8c0868c")),
HUAWEI_QUICK(Arrays.asList("3fd77527375a")),
INVESTOR(Arrays.asList("01a9c38d1abd"))
;
/**
* 对接此系统应用appId
*/
private List<String> appIds;
private static final Map<String, SxApiUserConstant> appIdMap = new HashMap<>();
SxApiUserConstant(List<String> appIds) {
this.appIds = appIds;
}
public List<String> appIds() {
return this.appIds;
}
public String appId() {
return this.appIds.get(0);
}
}
|
4fc9dc11-74ba-44b7-b8d0-17d6ba0bc201 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-11 03:48:14", "repo_name": "derysudrajat/Pemrogramman-Mobile", "sub_path": "/MyShopingCart/app/src/main/java/com/derysudrajat/daftarbelanja/MyViewHolder.java", "file_name": "MyViewHolder.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "b0225c5c78b3618717397749236021e6015c52ff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/derysudrajat/Pemrogramman-Mobile | 220 | FILENAME: MyViewHolder.java | 0.236516 | package com.derysudrajat.daftarbelanja;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class MyViewHolder extends RecyclerView.ViewHolder {
View myview;
TextView mType;
TextView mNote;
TextView mDate;
TextView mAmount;
public MyViewHolder(@NonNull View itemView) {
super(itemView);
myview = itemView;
mType = myview.findViewById(R.id.type);
mNote = myview.findViewById(R.id.note);
mDate = myview.findViewById(R.id.date);
mAmount = myview.findViewById(R.id.amount);
}
public void setmType(String mType) {
this.mType.setText(mType);
}
public void setmNote(String mNote) {
this.mNote.setText(mNote);
}
public void setmDate(String mDate) {
this.mDate.setText(mDate);
}
public void setmAmount(int mAmount) {
this.mAmount.setText(String.valueOf(mAmount));
}
}
|
8a5b6639-f0da-4a43-a041-045267fc62cf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-13T12:23:33", "repo_name": "BinarCode/laravel-restify", "sub_path": "/docs-v2/content/en/testing/testing.md", "file_name": "testing.md", "file_ext": "md", "file_size_in_byte": 1040, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "824a040c4fd239822ecccab6b7d9f0ca07bad820", "star_events_count": 488, "fork_events_count": 58, "src_encoding": "UTF-8"} | https://github.com/BinarCode/laravel-restify | 209 | FILENAME: testing.md | 0.279828 | ---
title: Testing Repositories
menuTitle: Testing Repositories
description: Unlike traditional static method calls, repositories may be mocked. This provides a great advantage over traditional static methods and grants you the same testability you would have if you were using dependency injection. When testing, you may often want to mock a call to a Restify repository in one of your controllers. For example, consider the following controller action
category: Testing
position: 15
---
```php
class ExampleTest extends TestCase
{
public function testBasicTest()
{
UserRepository::partialMock()
->shouldReceive('index')
->andReturn(['data' => [],]);
$this->withHeader('Accept', 'application/json')
->get('/api/restify/users')
->assertJsonStructure([
'response' => 'data',
])->assertOk();
}
}
```
So you can use the `partialMock` to get the partial mock instance of the repository, and then perform actions or expectations over it.
|
fe65a71a-e68c-4a40-9eb6-060dfe542135 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-30 08:59:55", "repo_name": "lucifax301/chelizi", "sub_path": "/chelizi/access/src/main/java/com/lili/net/CommonMessageClientHandler.java", "file_name": "CommonMessageClientHandler.java", "file_ext": "java", "file_size_in_byte": 1231, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "597f3d770c1662c775a0f4ec21d88492a4d0f7fc", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lucifax301/chelizi | 246 | FILENAME: CommonMessageClientHandler.java | 0.290981 | package com.lili.net;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.lili.component.AbstractCommandComponent;
import com.lili.component.ComponentManager;
import com.lili.net.command.ICommand;
public class CommonMessageClientHandler implements IClientPacketHandler
{
private static Logger LOGGER = LoggerFactory
.getLogger(CommonMessageClientHandler.class);
@Override
public void process(IClientConnection conn, Object packet)
{
short code = ((CommonMessage) packet).getCode();
// 从组件管理器中间调用
AbstractCommandComponent<?> cm = (AbstractCommandComponent<?>) ComponentManager
.getInstance().getComponent(AbstractCommandComponent.NAME);
if (cm == null)
{
LOGGER.error("CommandModule not found");
return;
}
ICommand cmd = cm.getCommand(code);
if (cmd == null)
{
LOGGER.error(" Can not found code = " + code + ",drop this packet.");
return;
}
try
{
cmd.execute(conn, (CommonMessage) packet);
}
catch (Exception e)
{
LOGGER.error("", e);
}
}
}
|
dc8f6a41-58c9-4b03-97e4-90633c1df857 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-19 07:21:50", "repo_name": "caishuwei/MusicPlatform", "sub_path": "/app/src/main/java/com/csw/musicplatform/utils/HintForException.java", "file_name": "HintForException.java", "file_ext": "java", "file_size_in_byte": 1139, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "a55448d343aed79c88c686bb40abd100be36d4c9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/caishuwei/MusicPlatform | 233 | FILENAME: HintForException.java | 0.258326 | package com.csw.musicplatform.utils;
import android.content.Context;
import com.csw.musicplatform.R;
import com.google.gson.JsonParseException;
import com.google.gson.stream.MalformedJsonException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import retrofit2.HttpException;
/**
* Created by caisw on 2017/12/4.
*/
public class HintForException {
private Context context;
public HintForException(Context context) {
this.context = context;
}
/**
* 获取异常提示
*/
public String findHint(Throwable e) {
String msg = null;
if (e instanceof SocketTimeoutException) {
msg = context.getString(R.string.Hint_socket_time_out);
} else if (e instanceof ConnectException||e instanceof HttpException) {
msg = context.getString(R.string.Hint_network_connect_error);
} else if (e instanceof MalformedJsonException || e instanceof JsonParseException) {
msg = context.getString(R.string.Hint_data_parse_exception);
} else {
msg = e.getMessage();
}
return msg;
}
}
|
62dba992-7d37-4b81-9a18-8f215adb632c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2013-10-17T00:29:43", "repo_name": "gmaggess/gradle-project-template", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 977, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "c811eef9b3a4963ff7b52570c857f3f82d16751c", "star_events_count": 2, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/gmaggess/gradle-project-template | 191 | FILENAME: README.md | 0.262842 | Gradle Project Template
=======================
It consists of 3 projects:
## ear
* settings.gradle - Projects list.
* gradle.properties - Properties used on the gradle scripts.
* ear.gradle - ear file assembly information. You'll notice Spring dependencies added to the APP-INF/lib and ViewController and Model are transitive, which means that it does not add it's dependencies to its artifacts.
* sonar.gradle - Sonar server setup.
* build.gradle - Includes all previously mentioned gradle files.
## Model
Contains SampleServerConfig configuration class.
## ViewController
Has a basic Spring MVC setup with home.jsp View and SampleWebConfig configuration class.
## Other files
common.gradle contains some basic configuration that will be included on ViewController and Model build.gradle files.'jacoco.gradle' refers to JaCoCo code coverage tool and it's not necessary to be changed.
``
Note: The weblogic branch includes Oracle WebLogic configuration files.`` |
90e7e576-6b99-4a4d-ae7a-950b86135644 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-15 21:01:33", "repo_name": "catBoris453alexmol/TestHome", "sub_path": "/Test/src/main/java/ru/sapteh/models/ClientService.java", "file_name": "ClientService.java", "file_ext": "java", "file_size_in_byte": 1033, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "1f8e4a1a1ec2d6280ae8c21f2e544afce3430716", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/catBoris453alexmol/TestHome | 200 | FILENAME: ClientService.java | 0.282988 | package ru.sapteh.models;
import lombok.*;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table()
public class ClientService {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column
@NonNull
private Date startTime;
@Column
@NonNull
private String comment;
@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "client_id")
private Client client;
@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "service_id")
private Service service;
@Override
public String toString() {
return "ClientService{" +
"id=" + id +
", startTime=" + startTime +
", comment='" + comment + '\'' +
", client=" + client +
", service=" + service +
'}';
}
}
|
e2819a3c-701e-459e-9a25-15e65288eb23 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-08-24 06:03:37", "repo_name": "Spyobird/CraftableUncraftables", "sub_path": "/craftableuncraftables-common/me/spyobird/CraftableUncraftables/CraftableUncraftables.java", "file_name": "CraftableUncraftables.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "47c96a69cd06758efe8eb1bd6f5de0812c87c03c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Spyobird/CraftableUncraftables | 263 | FILENAME: CraftableUncraftables.java | 0.268941 | package me.spyobird.CraftableUncraftables;
import me.spyobird.CraftableUncraftables.recipes.CraftingRecipes;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
@Mod(modid = "CraftableUncraftables", name = "Craftable Uncraftables", version = "v0.1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class CraftableUncraftables
{
public static final String modid = "CraftbleUncraftables";
@Instance("CraftableUncraftables")
public static CraftableUncraftables instance;
@EventHandler
public void load(FMLPreInitializationEvent event)
{
}
@EventHandler
public void load(FMLInitializationEvent event)
{
CraftingRecipes.init();
}
@EventHandler
public static void load(FMLPostInitializationEvent event)
{
}
} |
cba83a59-89bb-4e41-be52-633dd125529c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-13 11:23:39", "repo_name": "Huawei/ICP_CDSDemo_Java", "sub_path": "/src/CDSDemo/src/com/huawei/cdsdemo/bean/RegisterRequest.java", "file_name": "RegisterRequest.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "3b91587584bae3d9efa464f12de36171f298a039", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/Huawei/ICP_CDSDemo_Java | 216 | FILENAME: RegisterRequest.java | 0.255344 | package com.huawei.cdsdemo.bean;
public class RegisterRequest
{
private String requestType;
private String callBackURL;
private String registerServerType;
public RegisterRequest(String registerServerType, String callBackUrl, int isRegister)
{
this.registerServerType = registerServerType;
this.callBackURL = callBackUrl;
this.requestType = String.valueOf(isRegister);
}
public String getRequestType()
{
return requestType;
}
public void setRequestType(String requestType)
{
this.requestType = requestType;
}
public String getCallBackURL()
{
return callBackURL;
}
public void setCallBackURL(String callBackURL)
{
this.callBackURL = callBackURL;
}
public String getRegisterServerType()
{
return registerServerType;
}
public void setRegisterServerType(String registerServerType)
{
this.registerServerType = registerServerType;
}
}
|
455b9652-3105-4d16-840b-a8f57fbc5704 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-13 04:08:30", "repo_name": "davigre/ConexiaTest", "sub_path": "/CocinaApp/src/main/java/com/conexia/test/services/CamareroServiceImpl.java", "file_name": "CamareroServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1040, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "d808835df83b57aad00410ea1af4c15dc114f4f3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/davigre/ConexiaTest | 236 | FILENAME: CamareroServiceImpl.java | 0.277473 | package com.conexia.test.services;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.conexia.test.entities.Camarero;
import com.conexia.test.repositories.CamareroRepository;
@Service
public class CamareroServiceImpl implements CamareroServiceI {
@Autowired
CamareroRepository repository;
public CamareroRepository getRepository() {
return repository;
}
public void setRepository(CamareroRepository repository) {
this.repository = repository;
}
@Override
public Camarero saveCamarero(Camarero camarero) {
return repository.save(camarero);
}
@Override
public Camarero updateCamarero(Camarero camarero) {
return repository.save(camarero);
}
@Override
public void deleteCamarero(Camarero camarero) {
repository.delete(camarero);
}
@Override
public Camarero getCamareroById(Long id) {
return repository.findOne(id);
}
@Override
public List<Camarero> getAllCamareros() {
return repository.findAll();
}
}
|
d174757b-073c-4be8-95ba-115d036f7606 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-06-07 07:36:16", "repo_name": "ielvxiao/develop", "sub_path": "/MySQL/src/main/java/com/lvxiao/mysql/sharding/TestShading.java", "file_name": "TestShading.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "33153cd6b6dcdc195f5dc266a5a95ae4c6d41b45", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ielvxiao/develop | 239 | FILENAME: TestShading.java | 0.262842 | package com.lvxiao.mysql.sharding;
import lombok.SneakyThrows;
import org.apache.shardingsphere.shardingjdbc.api.yaml.YamlShardingDataSourceFactory;
import javax.sql.DataSource;
import java.io.File;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
/**
* @author lvxiao
* @date 2020/4/23
*/
public class TestShading {
@SneakyThrows
public static void main(String[] args) {
String filePath = TestShading.class.getResource("/sharding.yaml").getFile();
DataSource dataSource = YamlShardingDataSourceFactory.createDataSource(new File(filePath));
String sql = "SELECT i.* FROM t_order o JOIN t_order_item i ON o.order_id=i.order_id WHERE o.user_id=? AND o.order_id=?";
String test = "INSERT INTO t_order VALUES(?, ?, 'init');";
try (
Connection conn = dataSource.getConnection();
PreparedStatement preparedStatement = conn.prepareStatement(test)) {
preparedStatement.setInt(1, 1101);
preparedStatement.setInt(2, 11);
preparedStatement.executeUpdate();
}
}
}
|
029962c6-5e6d-4afd-bb5e-e3eebb579857 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-21 21:08:07", "repo_name": "sDurgam/LearnMaterialDesign", "sub_path": "/app/src/main/java/udacityproject5/learnmaterialdesign/RecyclerAnimActivity.java", "file_name": "RecyclerAnimActivity.java", "file_ext": "java", "file_size_in_byte": 1211, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "17c3da1c8f5796b1a7562dde6b4f716d48da72eb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sDurgam/LearnMaterialDesign | 225 | FILENAME: RecyclerAnimActivity.java | 0.276691 | package udacityproject5.learnmaterialdesign;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* Created by root on 10/19/16.
*/
public class RecyclerAnimActivity extends AppCompatActivity
{
@BindView(R.id.recyclerview) RecyclerView rv;
Context mcontext;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.anim_recyclerview_layout);
ButterKnife.bind(this);
rv.setLayoutManager(new LinearLayoutManager(this));
rv.setAdapter(new RecyclerAnimAdapter(this));
mcontext = this;
}
@OnClick(R.id.fab) void fabClick(View view)
{
// Bundle bundle = ActivityOptions.makeSceneTransitionAnimation(this).toBundle();
Intent animIntent = new Intent(mcontext, AnimTransitionActivity.class);
mcontext.startActivity(animIntent);
}
}
|
6dabf3e9-31c1-4125-8c77-6471ff0695e3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-05-19T17:41:30", "repo_name": "damog/REPL", "sub_path": "/kinks/level4/web_development/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1038, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "de0ea307e5cab8c0c98f07330c80c9ab66f7ec23", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/damog/REPL | 292 | FILENAME: README.md | 0.181263 | [Go back to the main page](https://github.com/world-class/REPL)
# Table of contents
<!-- vim-markdown-toc GFM -->
* [Web Development - Reported problems](#web-development---reported-problems)
* [Week 6](#week-6)
* [Lecture: 3.3.10 HTML media tags](#lecture-3.3.10-html-media-tags)
* [Practice Quiz: 3.3.11 Review information](#practice-quiz-3.3.11-review-information)
<!-- vim-markdown-toc -->
# Web Development - Reported problems
This page is about the [Web Development module](../../../modules/level_4/web_development/).
## Week 6
### Lecture: 3.3.10 HTML media tags
- Video: The video appears with all sorts of white dots all over. It looks
like the professor is in a snowball.
### Practice Quiz: 3.3.11 Review information
- The `width` attribute is _not_ a global attribute.
- The `png` file extension _is_ from image files.
- The `jog` file extension should not be selected because it doesn't really
exist. Unless it's a typo for `jpg` or `jpeg`.
- The `bmp` file extension _is_ from image files.
|
74b2f3ef-69d5-495f-b546-e12ed6aa3e49 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-16 01:13:58", "repo_name": "dyf901/marketing", "sub_path": "/src/main/java/com/zty/marketing/entity/Msg.java", "file_name": "Msg.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "ca54f6cad483804021611dce8a8932c8d7d3200b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dyf901/marketing | 204 | FILENAME: Msg.java | 0.228156 | package com.zty.marketing.entity;
public class Msg {
private String message;//中文信息
private Object data;//实体
private Object statistics;
public Msg(){
super();
}
public Msg(String message, Object data, Object statistics) {
this.message = message;
this.data = data;
this.statistics = statistics;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public Object getStatistics() {
return statistics;
}
public void setStatistics(Object statistics) {
this.statistics = statistics;
}
@Override
public String toString() {
return "Msg{" +
"message='" + message + '\'' +
", data=" + data +
", statistics=" + statistics +
'}';
}
}
|
b44eb4c6-03c7-4d06-b0b3-11a6fc7d79c6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-14 15:21:01", "repo_name": "ebi-uniprot/QuickGOBE", "sub_path": "/indexing/src/test/java/uk/ac/ebi/quickgo/index/annotation/AnnotationMocker.java", "file_name": "AnnotationMocker.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "3f0c1162a1fbce7c313357483656dc3be07c324f", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/ebi-uniprot/QuickGOBE | 333 | FILENAME: AnnotationMocker.java | 0.261331 | package uk.ac.ebi.quickgo.index.annotation;
/**
* A class for creating stubbed annotations, representing rows of data read from
* annotation source files.
*
* Created 22/04/16
* @author Edd
*/
public class AnnotationMocker {
public static Annotation createValidAnnotation() {
Annotation annotation = new Annotation();
annotation.db = "IntAct";
annotation.dbObjectId = "EBI-10043081";
annotation.dbReferences = "PMID:12871976";
annotation.qualifier = "enables";
annotation.goId = "GO:0000977";
annotation.interactingTaxonId = "taxon:12345";
annotation.evidenceCode = "ECO:0000353";
annotation.with = "GO:0036376,GO:1990573";
annotation.assignedBy = "IntAct";
annotation.annotationExtension = "occurs_in(CL:1000428)";
annotation.annotationProperties =
"go_evidence=IEA|taxon_id=35758|db_subset=TrEMBL|db_object_symbol=moeA5|db_object_type=protein" +
"|target_set=BHF-UCL,Exosome,KRUK|taxon_lineage=1,2,3,4|gp_related_go_ids=GO:1,GO:02|row_num=1";
return annotation;
}
}
|
2e31c96e-cff6-496e-a8a9-1b80536af993 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-05 16:47:29", "repo_name": "Vorobeyyyyyy/pokerface", "sub_path": "/src/main/java/by/bsuir/pokerface/entity/card/Deck.java", "file_name": "Deck.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "30c98e9973817b2d2e4e0c7a1ac7528bc2ae3126", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/Vorobeyyyyyy/pokerface | 230 | FILENAME: Deck.java | 0.289372 | package by.bsuir.pokerface.entity.card;
import java.util.List;
public class Deck {
private List<Card> cards;
public Deck() {
cards = CardStorage.getCards();
}
public List<Card> getCards() {
return cards;
}
public void setCards(List<Card> cards) {
this.cards = cards;
}
public Card takeTopCard() {
return cards.remove(cards.size() - 1);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Deck deck = (Deck) o;
return cards != null ? cards.equals(deck.cards) : deck.cards == null;
}
@Override
public int hashCode() {
return cards != null ? cards.hashCode() : 0;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("Deck{");
sb.append("cards=").append(cards);
sb.append('}');
return sb.toString();
}
}
|
25e62e6b-41e7-4256-abd5-3a029ebcd8b4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-21T15:59:00", "repo_name": "tepeumut/spring-rest-example", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1152, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "f2420ec3a3047be0e413383631e3a0ef1866b707", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tepeumut/spring-rest-example | 284 | FILENAME: README.md | 0.271252 | # Spring Boot REST API Example Project with MySQL
## Running Project
Project is a [Spring Boot](https://spring.io/guides/gs/spring-boot) application built using [Maven](https://spring.io/guides/gs/maven/). You can build a jar file and run it from the command line:
```
git clone https://github.com/tepeumut/spring-rest-example.git
cd spring-rest-example
./mvnw package
java -jar target/*.jar
```
Or you can run it from Maven directly using the Spring Boot Maven plugin. If you do this it will pick up changes that you make in the project immediately (changes to Java source files require a compile as well - most people use an IDE for this):
```
./mvnw spring-boot:run
```
## Database Configuration
It uses a MySQL database (for now), can be changed easily in the ``application.properties`` for any other database.
For MySQL:
```
spring.datasource.url=jdbc:mysql://USER:PASSWORD@localhost:3306/DATABASE?characterEncoding=UTF-8
```
Change ``USER``,``PASSWORD`` and ``DATABASE`` as per your MySQL installation.
You can then access the project here: http://localhost:8080/users
You can find to Swagger docs here: http://localhost:8080/swagger-ui.html
|
a11f132b-d19f-4b00-97a3-e398760837cc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-21 07:51:55", "repo_name": "CPstudy/SilsiganMetro-Android-legacy", "sub_path": "/app/src/main/java/com/ganada/silsiganmetro/activity/OpenSourceActivity.java", "file_name": "OpenSourceActivity.java", "file_ext": "java", "file_size_in_byte": 1210, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7d3114d55ad41f60d81a9f14e96722434d7bacc9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CPstudy/SilsiganMetro-Android-legacy | 222 | FILENAME: OpenSourceActivity.java | 0.200558 | package com.ganada.silsiganmetro.activity;
import android.app.Activity;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import com.ganada.silsiganmetro.R;
public class OpenSourceActivity extends Activity {
WebView web;
ImageButton btnBack;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_open_source);
LinearLayout layout_status = (LinearLayout) findViewById(R.id.layout_status);
btnBack = (ImageButton) findViewById(R.id.btnBack);
if(Build.VERSION.SDK_INT < 19) {
layout_status.setVisibility(View.GONE);
}
layout_status.setBackgroundColor(Color.parseColor("#91be2e"));
web = (WebView) findViewById(R.id.web);
web.loadUrl("file:///android_asset/opensource.html");
btnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
}
}
|
8b3dfafb-da9d-4e4c-b3ba-b3d7570a47c4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-18 13:43:33", "repo_name": "OvidiuPintilei/Bug-Report-App", "sub_path": "/src/main/java/serviceLayer/bugOperations.java", "file_name": "bugOperations.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "b9ebbe3d4002497b5e2d08f79e9594cf20161d91", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/OvidiuPintilei/Bug-Report-App | 225 | FILENAME: bugOperations.java | 0.291787 | package serviceLayer;
import dataAccessLayer.Bug;
import dataAccessLayer.DBQuery;
import dataAccessLayer.DBUpdate;
public class bugOperations {
private Bug bug = new Bug();
private DBUpdate dbu = new DBUpdate();
private DBQuery dbq = new DBQuery();
public void addBug(String empId, String prodId, String bugName, String description, String tag, String screenshot) {
bug.setName(dbu.convertSQLString(bugName));
bug.setDescription(dbu.convertSQLString(description));
bug.setTag(dbu.convertSQLString(tag));
bug.setScreenshot(dbu.convertSQLString(screenshot));
bug.setEmployeeId(empId);
bug.setProductId(prodId);
bug.create();
}
public void deleteBug(String id){
bug.setId(id);
bug.delete();
}
public void printBugs(){
bug.read();
}
public String getLastInsert(){
String str = dbq.doQuery("SELECT LAST_INSERT_ID() FROM bug");
String[] id = str.split(" ");
return id[0];
}
}
|
b58a568b-9238-42a6-ae6d-01f188e24ada | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-02 08:53:36", "repo_name": "magenta-aps/OpenDESK-foundation-application", "sub_path": "/backend/src/main/java/dk/opendesk/foundationapplication/webscripts/foundation/PostStartGroupsAndUsers.java", "file_name": "PostStartGroupsAndUsers.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "01aadd781ee2a60904ea4f559cc628f79d08e627", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/magenta-aps/OpenDESK-foundation-application | 202 | FILENAME: PostStartGroupsAndUsers.java | 0.221351 | package dk.opendesk.foundationapplication.webscripts.foundation;
import dk.opendesk.foundationapplication.webscripts.JacksonBackedWebscript;
import org.alfresco.service.cmr.repository.NodeRef;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;
public class PostStartGroupsAndUsers extends JacksonBackedWebscript {
@Override
protected Object doAction(WebScriptRequest req, WebScriptResponse res) throws Exception {
JSONObject jsonRequest = getRequestAs(JSONObject.class);
JSONObject roles = jsonRequest.getJSONObject("groups");
JSONArray users = jsonRequest.getJSONArray("users");
NodeRef emailTemplate = getActionBean().getEmailTemplate("ekstern-bruger-osflow.html.ftl");
getAuthorityBean().loadUsers(roles,users,"Velkommen til OSflow-Danva", emailTemplate);
return new JSONObject().put("status", "OK");
}
}
|
acab309d-35fc-46ff-bf6b-137277dd7a7a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-17 10:18:40", "repo_name": "treasurect/Android_XT", "sub_path": "/app/src/main/java/com/treasure_ct/android_xt/studyfragment/corecontrols/viewpager/tabhost/TabHostActivity.java", "file_name": "TabHostActivity.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "176386f02717a7ad376fb9f708ec988b83ad10bb", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/treasurect/Android_XT | 230 | FILENAME: TabHostActivity.java | 0.282196 | package com.treasure_ct.android_xt.studyfragment.corecontrols.viewpager.tabhost;
import android.app.TabActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.TabHost;
import android.widget.Toast;
import com.treasure_ct.android_xt.R;
public class TabHostActivity extends TabActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TabHost host = getTabHost();
LayoutInflater.from(this).inflate(R.layout.activity_corecontrols_tabhost,host.getTabContentView(),true);
host.addTab(host.newTabSpec("one").setIndicator("tab1").setContent(R.id.tab1));
host.addTab(host.newTabSpec("two").setIndicator("tab2").setContent(R.id.tab1));
host.addTab(host.newTabSpec("three").setIndicator("tab3").setContent(R.id.tab1));
host.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
@Override
public void onTabChanged(String tabId) {
Toast.makeText(TabHostActivity.this, tabId, Toast.LENGTH_SHORT).show();
}
});
}
}
|
b0a0359d-23f6-4696-83e8-623ea3cee677 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-28 13:48:03", "repo_name": "Madhu0/FifaPlayerStats", "sub_path": "/app/repository/UserRepository.java", "file_name": "UserRepository.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "5055a4b0b879c1352af9010f45e7ff2f99cde851", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Madhu0/FifaPlayerStats | 219 | FILENAME: UserRepository.java | 0.27048 | package repository;
import io.ebean.Ebean;
import io.ebean.EbeanServer;
import io.ebean.Expr;
import models.User;
import play.db.ebean.EbeanConfig;
import play.db.ebean.EbeanDynamicEvolutions;
import javax.inject.Inject;
import javax.inject.Named;
@Named
public class UserRepository {
private final EbeanServer ebeanServer;
private final DatabaseExecutionContext databaseExecutionContext;
private final EbeanDynamicEvolutions ebeanDynamicEvolutions;
@Inject
public UserRepository(EbeanConfig ec, DatabaseExecutionContext dec, EbeanDynamicEvolutions ede) {
ebeanServer = Ebean.getServer(ec.defaultServer());
databaseExecutionContext = dec;
ebeanDynamicEvolutions = ede;
}
public User create(User user) {
ebeanServer.insert(user);
return user;
}
public User getUserByEmail(String email) {
User user = ebeanServer.createQuery(User.class).where().add(Expr.eq("email", email)).findUnique();
return user;
}
}
|
b7d8c6e8-5dd4-4df6-8ded-e7111239fae8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-07 14:15:31", "repo_name": "Netcracker-Spring-2021-Group-4/project-marketplace-java", "sub_path": "/src/main/java/com/netcrackerg4/marketplace/controller/AuthStoreController.java", "file_name": "AuthStoreController.java", "file_ext": "java", "file_size_in_byte": 1033, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "427e2bf1c8a4c98020a3faa8f94af294f98be8d6", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/Netcracker-Spring-2021-Group-4/project-marketplace-java | 185 | FILENAME: AuthStoreController.java | 0.243642 | package com.netcrackerg4.marketplace.controller;
import com.netcrackerg4.marketplace.model.dto.password.PasswordUpdateDto;
import com.netcrackerg4.marketplace.model.response.UserInfoResponse;
import com.netcrackerg4.marketplace.service.interfaces.IUserService;
import lombok.AllArgsConstructor;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/v1/auth-store")
@AllArgsConstructor
public class AuthStoreController {
private final IUserService userService;
@GetMapping("/me")
public UserInfoResponse getMyProfile(Authentication auth) {
String email = auth.getName();
return this.userService.getProfileByEmail(email);
}
// change password without email confirmation
@PatchMapping("/change-password")
void changePassword(@RequestBody PasswordUpdateDto passwordData, Authentication auth) {
String email = auth.getName();
userService.changePassword(email, passwordData);
}
}
|
7156cc91-3ab5-4476-b8e0-52ccf0b31517 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-03-09T01:53:20", "repo_name": "neil-lindquist/swank-client", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1151, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "251c7768c432212936496391df4a44ebcad2fc06", "star_events_count": 6, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/neil-lindquist/swank-client | 265 | FILENAME: README.md | 0.242206 | # swank-client
[](https://travis-ci.org/neil-lindquist/swank-client)
This is an implementation of a Swank client in Javascript, intended for communicating with running Common Lisp processes running a swank server, just like SLIME in Emacs.
Swank-client forms a core part of the [SLIMA](https://atom.io/packages/SLIMA) package for the Atom text editor.
This package was forked from [Steve Levine's swank-client-js](https://github.com/sjlevine/swank-client-js) due to maintenance issues.
If you are interested in using this library, please let me know.
Currently, the only user is the [SLIMA](https://atom.io/packages/SLIMA) package for Atom, so the documentation is pretty minimal.
This library provides an editor/view-independent API for making the following queries to a Swank server:
- Evaluating arbitrary Lisp expressions and files
- Retrieving auto documentation
- Controlling a debugger
- Autocompletion requests
- Object inspection requests
- Profiling functions
- Accessing compiler notes
- Macroexpansion requests
See `test.js` for an example use case.
|
48434d79-667b-439a-9e11-e463a725af37 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-17 15:08:11", "repo_name": "sebastiankorkko/CWPClient", "sub_path": "/app/src/main/java/com/korkkosebastian/cwpclient/model/Signaller.java", "file_name": "Signaller.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "72a31e4eb2e84e598a663ed10dec339039a28d01", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sebastiankorkko/CWPClient | 233 | FILENAME: Signaller.java | 0.264358 | package com.korkkosebastian.cwpclient.model;
import android.media.AudioManager;
import android.media.ToneGenerator;
import java.util.Observable;
import java.util.Observer;
public class Signaller implements Observer {
private CWPMessaging cwpMessaging;
private ToneGenerator toneGenerator;
public Signaller() {
toneGenerator = new ToneGenerator(AudioManager.STREAM_DTMF, 50);
}
@Override
public void update(Observable o, Object arg) {
if(cwpMessaging.lineIsUp()) {
toneGenerator.startTone(ToneGenerator.TONE_DTMF_A, 5000);
} else {
toneGenerator.stopTone();
}
}
public void setCwpMessaging(CWPMessaging cwpMessaging) {
if(cwpMessaging != null) {
this.cwpMessaging = cwpMessaging;
this.cwpMessaging.addObserver(this);
}
}
public void setCwpMessagingNullAndSilence() {
toneGenerator.stopTone();
this.cwpMessaging.deleteObserver(this);
this.cwpMessaging = null;
}
} |
4b92c237-5271-4294-a398-c2047921891f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-22 13:17:18", "repo_name": "honeythigh1/spring_practice", "sub_path": "/SpringMVC/src/kr/co/project/board/dao/BoardDaoImpl.java", "file_name": "BoardDaoImpl.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "69458162cea96bd2d980a302a5faf5136f1ff3ca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/honeythigh1/spring_practice | 219 | FILENAME: BoardDaoImpl.java | 0.283781 | package kr.co.project.board.dao;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import kr.co.project.board.dto.BoardDto;
@Repository
public class BoardDaoImpl implements BoardDao {
@Autowired
private SqlSession session;
private static final String namespace = "kr.co.project.board.";
@Override
public BoardDto selectOne(BoardDto dto){
return session.selectOne(namespace + "selectOne", dto);
}
@Override
public List<BoardDto> selectAll(){
return session.selectList(namespace + "selectAll");
}
@Override
public void insertBoard(BoardDto dto){
session.insert(namespace + "insertBoard", dto);
}
@Override
public void updateBoard(BoardDto dto){
session.update(namespace + "updateBoard", dto);
}
@Override
public void deleteBoard(BoardDto dto) {
session.delete(namespace, dto);
}
@Override
public int totalCount() {
return session.selectOne(namespace + "totalCount");
}
}
|
14fdb5f6-2568-41c4-a217-502ccbd7dcc1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-18 23:33:17", "repo_name": "shankulk/spring-boot-tdd", "sub_path": "/src/main/java/com/shankulk/model/Objective.java", "file_name": "Objective.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "a0f43f3d603e4b09e6ceb795cb29945806da1af3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shankulk/spring-boot-tdd | 214 | FILENAME: Objective.java | 0.293404 | package com.shankulk.model;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.UUID;
public class Objective {
private final UUID id;
private final String metricName;
private final ObjectiveComparator comparator;
private final Double metricValve;
private final String objectiveName;
private Objective(String metricName, ObjectiveComparator comparator, Double metricValue,
String objectiveName) {
this.id = UUID.randomUUID();
this.metricName = metricName;
this.comparator = comparator;
this.metricValve = metricValue;
this.objectiveName = objectiveName;
}
public UUID getId() {
return id;
}
public String getMetricName() {
return metricName;
}
@JsonValue
public ObjectiveComparator getComparator() {
return comparator;
}
public Double getMetricValve() {
return metricValve;
}
public static Objective createObjective(String objectiveName, String metricName, ObjectiveComparator comparator, Double metricValue) {
return new Objective(metricName, comparator, metricValue, objectiveName);
}
}
|
2a958b89-3383-4e6d-8ef4-c6b850ac1b9a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-15 13:30:16", "repo_name": "dcostinett/unleash-client-java", "sub_path": "/src/main/java/no/finn/unleash/metric/MetricsBucket.java", "file_name": "MetricsBucket.java", "file_ext": "java", "file_size_in_byte": 1211, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "5c34032e6c1a96d6f06a73641d06b27eb9a2965c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dcostinett/unleash-client-java | 258 | FILENAME: MetricsBucket.java | 0.282196 | package no.finn.unleash.metric;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.HashMap;
import java.util.Map;
class MetricsBucket {
private final Map<String, ToggleCount> toggles;
private final LocalDateTime start;
private LocalDateTime stop;
MetricsBucket() {
this.start = LocalDateTime.now(ZoneId.of("UTC"));
this.toggles = new HashMap<>();
}
void registerCount(String toggleName, boolean active) {
getOrCreate(toggleName).register(active);
}
void registerCount(String toggleName, String variantName) {
getOrCreate(toggleName).register(variantName);
}
private ToggleCount getOrCreate(String toggleName) {
if(!toggles.containsKey(toggleName)) {
ToggleCount counter = new ToggleCount();
toggles.put(toggleName, counter);
}
return toggles.get(toggleName);
}
void end() {
this.stop = LocalDateTime.now(ZoneId.of("UTC"));
}
public Map<String, ToggleCount> getToggles() {
return toggles;
}
public LocalDateTime getStart() {
return start;
}
public LocalDateTime getStop() {
return stop;
}
}
|
1527dd69-27a2-45b6-a266-5a82aa16ee2a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-10-01T00:17:03", "repo_name": "2bmio/docs", "sub_path": "/skills/cka/concepts/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1152, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "37533d2d13e7f824a26e72792ddcb26079bc8c64", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/2bmio/docs | 275 | FILENAME: README.md | 0.252384 | ---
description: >-
The Concepts section helps you learn about the parts of the Kubernetes system
and the abstractions Kubernetes uses to represent your cluster , and helps you
obtain a deeper understanding of how Kubern
---
# Concepts
### Overview <a id="overview"></a>
### Kubernetes objects <a id="kubernetes-objects"></a>
### Kubernetes Control Plane <a id="kubernetes-control-plane"></a>
> kubernetes control plane consist of the following **components** on controller nodes:
>
> 1. kube-**apiserver**: **allow** user/srv/etc **ineract** with the cluster
> 2. **etcd**: clustes datastore, **keep** multples controllers in **sync**
> 3. kube-**scheduler**: **dealing** into the cluster to apply desired **state**
> 4. **kube-controller-manager**: **runs** a series of controllers that provide a wide range of **cluster functionality**.
> 5. **cloud-controller-manager**: **handles** interaction with underlying **cloud providers**.
>
> This **set of services** is the magic on k8s ecosystem with worker nodes and control nodes
#### Kubernetes Master <a id="kubernetes-master"></a>
#### Kubernetes Nodes <a id="kubernetes-nodes"></a>
|
cd4dfe85-44e4-4c18-a09f-9c4f8d5df3bb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-08 09:23:47", "repo_name": "wwj912790488/PGCLivePlatform2", "sub_path": "/Commander/src/main/java/com/arcvideo/pgcliveplatformserver/model/PageBean.java", "file_name": "PageBean.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "87ff78366a3c71b08e490d00782fe3a6a792fc9e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wwj912790488/PGCLivePlatform2 | 229 | FILENAME: PageBean.java | 0.246533 | package com.arcvideo.pgcliveplatformserver.model;
import java.util.List;
/**
* Created by slw on 2018/8/3.
*/
public class PageBean<T> {
long total;
int pageNum;
int pageSize;
List<T> list;
public PageBean(long total, int pageNum, int pageSize, List<T> list) {
this.total = total;
this.pageNum = pageNum;
this.pageSize = pageSize;
this.list = list;
}
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
}
|
05470a73-0170-4e1c-af61-334a12d85d82 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-23 18:18:13", "repo_name": "MalenaMoix/dan-ms-usuarios", "sub_path": "/src/main/java/jms/dan/usuarios/config/SwaggerConfig.java", "file_name": "SwaggerConfig.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "f25721b07d5ea447d8a530d989c7d6db02aa4352", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MalenaMoix/dan-ms-usuarios | 176 | FILENAME: SwaggerConfig.java | 0.206894 | package jms.dan.usuarios.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import springfox.documentation.swagger.web.InMemorySwaggerResourcesProvider;
import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;
import java.util.ArrayList;
import java.util.List;
@Configuration
public class SwaggerConfig {
@Primary
@Bean
public SwaggerResourcesProvider swaggerResourcesProvider(InMemorySwaggerResourcesProvider defaultResourcesProvider) {
return () -> {
SwaggerResource wsResource = new SwaggerResource();
wsResource.setName("1.0.0");
wsResource.setSwaggerVersion("2.0");
wsResource.setLocation("/swagger.yaml");
List<SwaggerResource> resources = new ArrayList<>();
resources.add(wsResource);
return resources;
};
}
}
|
0de27080-eea6-4a83-a8f8-2d8623dc50e8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-08 01:04:45", "repo_name": "abinash526/Spring-boot-task", "sub_path": "/src/main/java/com/stackroute/springBoot/domain/Track.java", "file_name": "Track.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "fe123baf074dd75e04af826be4bdd705790425e5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/abinash526/Spring-boot-task | 227 | FILENAME: Track.java | 0.23793 | package com.stackroute.springBoot.domain;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class Track {
@Id
private int id;
private String name;
private String comment;
@Override
public String toString() {
return "Track{" +
"id=" + id +
", name='" + name + '\'' +
", comment='" + comment + '\'' +
'}';
}
public Track() {
}
public Track(int id, String name, String comment) {
this.id = id;
this.name = name;
this.comment = comment;
}
public int getId() {
return id;
}
public Track setId(int id) {
this.id = id;
return this;
}
public String getName() {
return name;
}
public Track setName(String name) {
this.name = name;
return this;
}
public String getComment() {
return comment;
}
public Track setComment(String comment) {
this.comment = comment;
return this;
}
}
|
37a945df-f2c5-4f7e-b2c3-3927addc863e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-10-27T01:44:05", "repo_name": "joshfeldstein/joshfeldstein.github.io", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1097, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "cec811ced50df27986cc8c56519587060417b119", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/joshfeldstein/joshfeldstein.github.io | 311 | FILENAME: README.md | 0.221351 | # Josh Site
26 Oct 2019
## Edit Content
* Go to https://github.com/joshfeldstein/joshfeldstein.github.io (password is same as Wifi)
* Click "_posts" (https://github.com/joshfeldstein/joshfeldstein.github.io/tree/master/_posts)
* Edit files on that page:
* Click the Pencil icon - upper right above your text
* Make your changes
* At the bottom click "Commit Changes"
After a minute or two the changes should show up automatically at: https://joshfeldstein.github.io
----
## Setup & Test site/server
### Download Jekyll image
docker pull jekyll/jekyll
### Launch named instance
map cwd to /srv/jekyll, map localist port 4000 to container 4000, name the site, remove after process exit, interactive batch
docker run -v "$PWD:/srv/jekyll" -p 0.0.0.0:4000:4000 --name jf-news --rm -i -t jekyll/jekyll bash
### Build
Start server on [http://localhost:4000/](http://localhost:4000)
jekyll serve --incremental
Don't create a new site, we're using a local copy of the Whiteglass theme and "jekyll create" installs its own layouts, styles, etc.
### Cleanup
jekyll clean
|
c58cf6f6-6fa0-4fcf-8c3b-3348cef54674 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-04 11:30:53", "repo_name": "rudwns/teamproject", "sub_path": "/teamSsum/src/com/service/UpdateContent.java", "file_name": "UpdateContent.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "491463025a2beff8d991f352e2fda8b6b3f7dd20", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "WINDOWS-1252"} | https://github.com/rudwns/teamproject | 218 | FILENAME: UpdateContent.java | 0.282196 | package com.service;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.model.BoardDAO;
@WebServlet("/UpdateContent")
public class UpdateContent extends HttpServlet {
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("euc-kr");
int num = Integer.parseInt(request.getParameter("num"));
String title= request.getParameter("title");
String content = request.getParameter("content");
BoardDAO dao = BoardDAO.getInstance();
String moveUrl ="";
try {
int cnt = dao.updateContent(num,title,content);
if(cnt>0) {
System.out.println("¼º°ø");
moveUrl ="greenright.jsp";
}else {
System.out.println("½ÇÆÐ");
moveUrl ="content.jsp";
}
response.sendRedirect(moveUrl);
}catch (Exception e) {
e.printStackTrace();
}
}
}
|
05718540-7379-493e-b489-284cf098621d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-07-06 16:20:08", "repo_name": "uniprot/enzymeportal", "sub_path": "/enzyme-portal/enzymeportal-website/src/test/java/uk/ac/ebi/ep/web/controller/HomeControllerIT.java", "file_name": "HomeControllerIT.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "9227790aff4df300276f56aae120ee455f5bfeb9", "star_events_count": 7, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/uniprot/enzymeportal | 225 | FILENAME: HomeControllerIT.java | 0.278257 |
package uk.ac.ebi.ep.web.controller;
import static org.hamcrest.Matchers.equalTo;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
*
* @author joseph
*/
@SpringBootTest
@AutoConfigureMockMvc
public class HomeControllerIT {
@Autowired
private MockMvc mvc;
@Test
public void testHomePage() throws Exception {
mvc.perform(MockMvcRequestBuilders.get("/").accept(MediaType.ALL))
.andExpect(status().isOk());
}
@Test
public void testStatusPage() throws Exception {
mvc.perform(MockMvcRequestBuilders.get("/status/json").accept(MediaType.ALL))
.andExpect(status().isOk())
.andExpect(content().string(equalTo("UP")));
}
}
|
a217259e-7307-40cc-a650-a5132932dd39 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-22 15:03:17", "repo_name": "jinhanlai/JavaSourceCode", "sub_path": "/src/main/java/designmode/singleton/InnerclassSingleton.java", "file_name": "InnerclassSingleton.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "c37e0852a0766d4dde81c151ace8be0a14740a3b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jinhanlai/JavaSourceCode | 208 | FILENAME: InnerclassSingleton.java | 0.293404 | package designmode.singleton;
import org.junit.jupiter.api.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* @Author laijinhan
* @date 2020/12/22 下午9:38
*/
public class InnerclassSingleton {
private InnerclassSingleton() { }
private static class InnerclassSingletonInstance {
private static final InnerclassSingleton INSTANCE = new InnerclassSingleton();
}
public static InnerclassSingleton getInstance() {
return InnerclassSingletonInstance.INSTANCE;
}
@Test
public void test() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
InnerclassSingleton instance = InnerclassSingleton.getInstance();
Constructor<InnerclassSingleton> declaredConstructor = InnerclassSingleton.class.getDeclaredConstructor();
declaredConstructor.setAccessible(true);// 可以防伪私有变量
InnerclassSingleton instance1 = declaredConstructor.newInstance();
System.out.println(instance);
System.out.println(instance1);
}
}
|
a4e0c297-24aa-4853-87fe-091de9d28404 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-08 09:23:47", "repo_name": "wwj912790488/PGCLivePlatform2", "sub_path": "/Commander/src/main/java/com/arcvideo/pgcliveplatformserver/model/delayer/DelayerStatusDto.java", "file_name": "DelayerStatusDto.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "04badc0083924f0a475d6703fc3c97d9337fffa5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wwj912790488/PGCLivePlatform2 | 259 | FILENAME: DelayerStatusDto.java | 0.2227 | package com.arcvideo.pgcliveplatformserver.model.delayer;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
/**
* Created by slw on 2018/4/24.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DelayerStatusDto {
private Long id;
private Integer bcheck;
private Integer bhavestream;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getBcheck() {
return bcheck;
}
public void setBcheck(Integer bcheck) {
this.bcheck = bcheck;
}
public Integer getBhavestream() {
return bhavestream;
}
public void setBhavestream(Integer bhavestream) {
this.bhavestream = bhavestream;
}
@Override
public String toString() {
return "DelayerStatusDto{" +
"id=" + id +
", bcheck=" + bcheck +
", bhavestream=" + bhavestream +
'}';
}
}
|
6847c817-1523-487d-8030-3bb4e6512e57 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-19 19:50:48", "repo_name": "jonathan-sh/alfred-api-java", "sub_path": "/src/main/java/com/alfred/api/app/model/tasks/TaskBuild.java", "file_name": "TaskBuild.java", "file_ext": "java", "file_size_in_byte": 1011, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "a2b71643ab77cf2c1e8cef5c1173dbdb0cd9267d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jonathan-sh/alfred-api-java | 221 | FILENAME: TaskBuild.java | 0.253861 | package com.alfred.api.app.model.tasks;
import com.alfred.api.app.model.interfaces.Processor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class TaskBuild {
private static Logger logger = LoggerFactory.getLogger(TaskBuild.class);
private Processor processor;
@Autowired
public TaskBuild(Processor processor) {
this.processor = processor;
}
/**
* Variával que controla o intervalo de tempo, aonde 60000 equivale a um minuto.
*/
private final String INTERVALO_DE_TEMPO = "5000";
/**
* Rotina de verificação para fechamneto de jornada;
*/
@Scheduled(fixedRateString = INTERVALO_DE_TEMPO)
public void task() {
logger.info("Inicio da tarefa");
this.processor.process();
logger.info("Fim da tarefa");
}
}
|
69ff3d2b-5ebf-4785-9337-4649a8eb107e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-07 01:45:07", "repo_name": "AaronGuW/Weizu", "sub_path": "/Weizu/app/src/main/java/com/demo/aaronapplication/fragments/releaseokFragment.java", "file_name": "releaseokFragment.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "602ed643a935f07d5cd9e13ecb2d3fdef756e7de", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AaronGuW/Weizu | 188 | FILENAME: releaseokFragment.java | 0.218669 | package com.demo.aaronapplication.fragments;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.demo.aaronapplication.weizu.R;
/**
* Created by Aaron on 2016/3/27.
*/
public class releaseokFragment extends Fragment {
private View confirm;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.releasefinish, container, false);
confirm = v.findViewById(R.id.confirm);
confirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent action = new Intent();
action.putExtra("modify",true);
getActivity().setResult(Activity.RESULT_OK, action);
getActivity().finish();
}
});
return v;
}
}
|
78add267-fe35-4cf6-bfea-e4c1909410a0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-07-27 00:47:15", "repo_name": "timothyekl/ShellParser", "sub_path": "/src/com/lithium3141/shellparser/states/StartState.java", "file_name": "StartState.java", "file_ext": "java", "file_size_in_byte": 1121, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "fab36fc83584baf423a45121b8f14c848df5bd64", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/timothyekl/ShellParser | 251 | FILENAME: StartState.java | 0.291787 | package com.lithium3141.shellparser.states;
import java.util.List;
import com.lithium3141.shellparser.ParseException;
public class StartState extends State {
@Override
public List<String> parse(String parsing, String accumulator, List<String> parsed, State referrer) throws ParseException {
if(parsing.length() == 0) {
if(accumulator.length() > 0) {
parsed.add(accumulator);
}
return parsed;
}
char c = (char)parsing.getBytes()[0];
if(c == ' ') {
if(accumulator.length() > 0) {
parsed.add(accumulator);
}
return (new StartState()).parse(parsing.substring(1), "", parsed, this);
} else if(c == '\\') {
return (new EscapeState()).parse(parsing.substring(1), accumulator, parsed, this);
} else if(c == '"' || c == '\'') {
return (new QuoteState(c)).parse(parsing.substring(1), accumulator, parsed, this);
}
return (new StartState()).parse(parsing.substring(1), accumulator + c, parsed, this);
}
}
|
01d72d87-d770-4c5b-ac6c-6b31d09a78c8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-13 04:58:14", "repo_name": "thunderferret/user08-ticket", "sub_path": "/ticket/src/main/java/com/example/rumyticket/Ticket.java", "file_name": "Ticket.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "bd8ab247be272bc1b36d9e1f8c4e3ce98ba771d6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/thunderferret/user08-ticket | 204 | FILENAME: Ticket.java | 0.267408 | package com.example.rumyticket;
import javax.persistence.*;
import org.springframework.beans.BeanUtils;
import java.util.List;
import java.util.Date;
@Entity
@Table(name="Ticket_table")
public class Ticket{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
private Integer price;
@PostPersist
public void onPostPersist(){
TicketRegistered TicketRegistered = new TicketRegistered();
BeanUtils.copyProperties(this, TicketRegistered);
TicketRegistered.publishAfterCommit();
}
@PostRemove
public void onPostRemove(){
TicketDeleted TicketDeleted = new TicketDeleted();
BeanUtils.copyProperties(this, TicketDeleted);
TicketDeleted.publishAfterCommit();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getPrice() {
return price;
}
public void setPrice(Integer price) {
this.price = price;
}
}
|
741c549f-6bcc-461e-a112-60f0945f7ea2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-29 07:08:01", "repo_name": "followmyego/Ego_Server_Java_Application", "sub_path": "/src/main/java/com/amazonaws/geo/server/util/Facebook_Class.java", "file_name": "Facebook_Class.java", "file_ext": "java", "file_size_in_byte": 1091, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "c45c64107298843085fc81dd05ed3f07632f357b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/followmyego/Ego_Server_Java_Application | 211 | FILENAME: Facebook_Class.java | 0.23793 | package com.amazonaws.geo.server.util;
import com.restfb.DefaultFacebookClient;
import com.restfb.FacebookClient;
import com.restfb.types.User;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
/**
* Created by Lucas on 09/08/2016.
*/
public class Facebook_Class {
private static String accessToken;
public static Properties properties = new Properties();
// public FacebookClass(String accessToken) {
// this.accessToken = accessToken;
// }
public static String getHometown(String accessToken){
FacebookClient fbClient = null;
try{
properties.load(new FileInputStream("fb.properties"));
fbClient = new DefaultFacebookClient(accessToken);
} catch (FileNotFoundException e) {
} catch (IOException e) {
e.printStackTrace();
}
if(fbClient != null){
User me = fbClient.fetchObject("me", User.class);
return me.getHometownName();
}
return "someTown";
}
}
|
fbdc6ce4-5b2b-4cc8-a7ae-05b4c3cb7f69 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-08 20:13:56", "repo_name": "DavidSuazo/GenericUtil", "sub_path": "/src/main/java/com/credencial/util/invoker/bill/AuthenticationResponse.java", "file_name": "AuthenticationResponse.java", "file_ext": "java", "file_size_in_byte": 1211, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "7bb4c091c43111e2adc84fc8fe04cd176c797c15", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DavidSuazo/GenericUtil | 251 | FILENAME: AuthenticationResponse.java | 0.23793 | package com.credencial.util.invoker.bill;
import com.credencial.util.JSonable;
import com.credencial.util.StringUtils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
/**
*
* @author cj_sr
*/
public class AuthenticationResponse implements JSonable {
private String token;
private String expires;
public AuthenticationResponse(String token, String expires) {
this.token = token;
this.expires = expires;
}
public AuthenticationResponse() {
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getExpires() {
return expires;
}
public void setExpires(String expires) {
this.expires = expires;
}
@Override
public String toJson() {
Gson gson = new GsonBuilder().setDateFormat(StringUtils.FORMAT_DATE_YY_MM_DD_SSz).create();
return gson.toJson(this);
}
@Override
public Object fromJSON(String message) {
Gson gson = new GsonBuilder().setDateFormat(StringUtils.FORMAT_DATE_YY_MM_DD_SSz).create();
return gson.fromJson(message, AuthenticationResponse.class);
}
}
|
5a4a89a7-7f05-470c-a79d-1d5cdffb751f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-06-10 10:17:08", "repo_name": "deline/SpringMVCTalk", "sub_path": "/src/main/java/com/delineneo/web/form/Player.java", "file_name": "Player.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "03af176c3b8e235027ffdff7a4591efbb1e0225d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/deline/SpringMVCTalk | 234 | FILENAME: Player.java | 0.2227 | package com.delineneo.web.form;
import com.delineneo.web.validation.MyCustomConstraint;
import org.hibernate.validator.constraints.NotBlank;
/**
* User: deline
* Date: 1/05/13
* Time: 8:42 PM
*/
public class Player {
private int id;
@NotBlank(message = "First name is required")
private String firstName;
@NotBlank(message = "Last name is required")
@MyCustomConstraint
private String lastName;
public Player() {
}
public Player(int id, String firstName, String lastName) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
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;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.