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 |
|---|---|---|---|---|---|---|
36631447-4be8-4586-8347-02f0196f08dd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-04 14:14:13", "repo_name": "essweinjacob/School", "sub_path": "/Java/Project5/main.java", "file_name": "main.java", "file_ext": "java", "file_size_in_byte": 1061, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "ade5a510ebe3c3989bae4d471ffc779510f00d37", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/essweinjacob/School | 247 | FILENAME: main.java | 0.286968 | import java.util.*;
public class main{
public static void main(String[] args) {
List<creatures> Animals = new ArrayList<creatures>();
Animal lion = new Animal("Lion");
Animals.add(lion);
Animal dog = new Animal("Dog");
Animals.add(dog);
Animal cat = new Animal("Cat");
Animals.add(cat);
Animals.forEach(System.out::println);
List<creatures> Plants = new ArrayList<creatures>();
Plant tree = new Plant("Tree");
Plants.add(tree);
Plant sunflower = new Plant("Sunflower");
Plants.add(sunflower);
Plant grass = new Plant("Grass");
Plants.add(grass);
Plants.forEach(System.out::println);
List<creatures> Fungis = new ArrayList<creatures>();
Fungi blue = new Fungi("Blue Fungi");
Fungis.add(blue);
Fungi red = new Fungi("Red Fungi");
Fungis.add(red);
Fungi green = new Fungi("Green Fungi");
Fungis.add(green);
Fungis.forEach(System.out::println);
}
}
|
38903733-2108-4470-9023-6163e6b88c60 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-14 09:45:53", "repo_name": "xybxjb/repo", "sub_path": "/proxy_manage/src/main/java/cn/deepcoding/controller/ExamNameController.java", "file_name": "ExamNameController.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "6d7dfa6fa0e4874c92d9796e662f66ecf2f71e25", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xybxjb/repo | 247 | FILENAME: ExamNameController.java | 0.272025 | package cn.deepcoding.controller;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.deepcoding.model.ExamName;
import cn.deepcoding.service.ExamNameService;
@Controller
@RequestMapping("examName")
public class ExamNameController {
@Autowired
private ExamNameService examNameService;
@RequiresPermissions("examName:examName")
@RequestMapping("/examName")
public String examName(){
return "data_dictionary/examName";
}
@RequestMapping("/getAll")
@ResponseBody
public List<ExamName> getAll(){
return examNameService.getAll();
}
@RequestMapping("/add")
public String save(ExamName examName){
examNameService.save(examName);
return "redirect:getAll";
}
@RequestMapping("/update")
public String update(ExamName examName){
examNameService.update(examName);
return "redirect:getAll";
}
@RequestMapping("/del")
public String delete(Integer id){
examNameService.delete(id);
return "redirect:getAll";
}
}
|
31dec9ae-8dad-426b-94bb-0792f26af3a8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-09 13:14:39", "repo_name": "seerdaryilmazz/OOB", "sub_path": "/crm-quote-service/src/main/java/ekol/crm/quote/domain/dto/authorizationservice/Subsidiary.java", "file_name": "Subsidiary.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "4f00660882d85418d8c169212f9f7c83f1954390", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/seerdaryilmazz/OOB | 227 | FILENAME: Subsidiary.java | 0.224055 | package ekol.crm.quote.domain.dto.authorizationservice;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import ekol.model.IdNamePair;
import java.util.HashSet;
import java.util.Set;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Subsidiary {
private Long id;
private String name;
private Set<IdNamePair> companies = new HashSet<>();
private IdNamePair defaultInvoiceCompany;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Set<IdNamePair> getCompanies() {
return companies;
}
public void setCompanies(Set<IdNamePair> companies) {
this.companies = companies;
}
public IdNamePair getDefaultInvoiceCompany() {
return defaultInvoiceCompany;
}
public void setDefaultInvoiceCompany(IdNamePair defaultInvoiceCompany) {
this.defaultInvoiceCompany = defaultInvoiceCompany;
}
}
|
be00976e-f9ef-407b-9686-9faf2d91f680 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-07 06:50:11", "repo_name": "tintinfairy/javabegin", "sub_path": "/src/main/java/myserver/handlers/GreetingHandler.java", "file_name": "GreetingHandler.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "99353f9fcf7290f220241f4c23d2f25334060d87", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tintinfairy/javabegin | 209 | FILENAME: GreetingHandler.java | 0.271252 | package myserver.handlers;
import java.io.IOException;
import java.net.Socket;
import java.util.Map;
import myserver.Session;
import myserver.SessionCollector;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
public class GreetingHandler extends ClientMessageHandler{
public GreetingHandler(Socket socket, String cmd) throws IOException {
super(socket, cmd);
}
public void run() {
try {
JSONParser parser = new JSONParser();
String entry = in.readUTF();
Object obj = parser.parse(entry);
JSONObject jsonObject = (JSONObject) obj;
Long client_id = (Long) jsonObject.get("client_id");
SessionCollector.getInstance().setHashMap(client_id, new Session(socket,client_id));
Map<Long, Session> hashmap = SessionCollector.getInstance().getHashMap();
out.writeUTF("Hello!");
} catch (IOException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
}
}
|
58e8f034-7835-40e4-ab56-b593350cde46 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-02-27T21:42:15", "repo_name": "savvytruffle/Astr511", "sub_path": "/HW2015/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1233, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "ed1f819bdc3fe22c239bd54336d3cefc998dab4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/savvytruffle/Astr511 | 410 | FILENAME: README.md | 0.29584 | * ipython notebooks with homework projects for Astr 511 class from Winter 2015
All assignments (and supporting files) are linked to
http://www.astro.washington.edu/users/ivezic/t_astr511.html
The first homework notebooks should go to
Astr511/HW2015/Project1
Name your notebooks, using -your- last name (not "ivezic") as
Astr511_HW0_ivezic.ipynb
You need to fork this repo, add your notebook to the proper directory and
then send me a pull request.
* Paper assignments for in-class presentations:
David Fleming:
3. Helmi & White 2001 (MNRAS 323, 529): "Simple dynamic models of the Sagittarius dwarf galaxy"
Chris Suberlak:
4. Ibata et al. 2001 (ApJ 551, 294): "Great Circle Tidal Streams: Evidence for a
Nearly Spherical Massive Dark Halo around the Milky Way"
Grace Telford:
14. McGurk et al. 2010 (AJ, 139, 1261): "Principal Component Analysis of SDSS Stellar Spectra"
Zhanglu Wang:
16. Schlaufman et al. 2009 (ApJ, 703, 2177): "Insight into the Formation of the Milky Way Through
Cold Halo Substructure. I. The ECHOS of Milky Way Formation"
Kolby Weisenburger:
13. Kauffmann et al. 2003 (MNRAS, 341, 33): "Stellar Masses and Star Formation Histories for
80,000 Galaxies from the Sloan Digital Sky Survey"
|
0497b17f-4939-486c-93ec-75273d93b50c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-02 13:11:57", "repo_name": "code-crusher/udacity-buildItBigger", "sub_path": "/joker/src/main/java/github/vatsal/joker/Joker.java", "file_name": "Joker.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "385a299d033b7d3a5a0688f6d4b5bb37d680cb15", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/code-crusher/udacity-buildItBigger | 227 | FILENAME: Joker.java | 0.282988 | package github.vatsal.joker;
import java.util.Random;
public class Joker {
// no object initialisation
private Joker() {
}
private static final Random random = new Random();
private static final String[] NERDY_JOKES = {
"There are only 10 types of people in the world: those that understand binary and those that don’t.",
"The Internet: where men are men, women are men, and children are FBI agents.",
"The box said ‘Requires Windows Vista or better’. So I installed LINUX.",
"In a world without fences and walls, who needs Gates and Windows?",
"Penguins love cold, they wont survive the sun.",
"Computers are like air conditioners: they stop working when you open Windows.",
"My attitude isn’t bad. It’s in beta.",
"If I wanted a warm fuzzy feeling, I’d antialias my graphics!"
};
public static String tossMeJoke() {
return NERDY_JOKES[random.nextInt(NERDY_JOKES.length)];
}
}
|
0be1ba7a-d018-460e-b367-770fcc638373 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-22 02:02:19", "repo_name": "cc-ohayou/cc-boot-demo", "sub_path": "/src/main/java/com/qunhe/toilet/facade/domain/common/enums/toilet/SexTypeEnum.java", "file_name": "SexTypeEnum.java", "file_ext": "java", "file_size_in_byte": 1229, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "37477103ef67f58430c7e9a4458789536635659a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cc-ohayou/cc-boot-demo | 293 | FILENAME: SexTypeEnum.java | 0.273574 | package com.qunhe.toilet.facade.domain.common.enums.toilet;
/**
* @Author bupo
* @DATE 2020/8/21 15:27
* @Description
*/
public enum SexTypeEnum {
WOMAN(0,"woman","女士"),
MAN(1,"man","男士"),
BOTH(2,"both","共用型"),
;
private int typeId;
private String dbType;
private String describe;
SexTypeEnum(final int typeId, final String dbType, final String describe) {
this.typeId = typeId;
this.dbType = dbType;
this.describe = describe;
}
public int getTypeId() {
return typeId;
}
public void setTypeId(final int typeId) {
this.typeId = typeId;
}
public String getDbType() {
return dbType;
}
public void setDbType(final String dbType) {
this.dbType = dbType;
}
public static String getTypeDescById(int id){
for(SexTypeEnum sexTypeEnum:SexTypeEnum.values()){
if(sexTypeEnum.getTypeId()==id){
return sexTypeEnum.getDbType();
}
}
return "";
}
public String getDescribe() {
return describe;
}
public void setDescribe(final String describe) {
this.describe = describe;
}
}
|
4dbda64f-02e5-40e4-b588-5a79fb7e118e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-01 07:23:58", "repo_name": "santhoshrajr/UserAlbum-AndroidApp", "sub_path": "/app/src/main/java/com/example/santh/useralbum/adapters/UserAdapter.java", "file_name": "UserAdapter.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "579610f8f256b2d9ff6d0fa643f7d2d19b17abc0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/santhoshrajr/UserAlbum-AndroidApp | 206 | FILENAME: UserAdapter.java | 0.285372 | package com.example.santh.useralbum.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.example.santh.useralbum.Models.Users;
import com.example.santh.useralbum.R;
//import com.kmangutov.restexample.models.Post;
import java.util.ArrayList;
/**
* Created by santh on 7/23/2016.
*/
public class UserAdapter extends ArrayAdapter<Users> {
public UserAdapter(Context ctx, ArrayList<Users> posts) {
super(ctx, 0, posts);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Users users = getItem(position);
if(convertView == null)
convertView = LayoutInflater.from(getContext()).inflate(R.layout.layout_user, parent, false);
TextView title = (TextView) convertView.findViewById(R.id.textViewUser);
title.setText(users.name);
return convertView;
}
}
|
4405a11b-78f9-4a7d-98bd-61bea894cb97 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-09 23:15:40", "repo_name": "Jegp/gradleexample", "sub_path": "/src/main/java/dk/cphbusiness/gradleexample/RestService.java", "file_name": "RestService.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "e8e3b0c9e3c89cce23aaa60a917a4ad0fa03cfa8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Jegp/gradleexample | 257 | FILENAME: RestService.java | 0.236516 | /*
* 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 dk.cphbusiness.gradleexample;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
* REST Web Service
*
* @author sofus
*/
@Path("hello")
public class RestService {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "Hello World";
}
@GET
@Path("user")
public String user() {
try {
return JpaMain.getManager().createQuery("SELECT p FROM Person p", Person.class).getResultList().toString();
} catch (Exception e) {
e.printStackTrace();
return "error";
}
}
@GET
@Path("store")
public String store() {
Person p = new Person("John", "Doe");
JpaMain.getManager().getTransaction().begin();
JpaMain.getManager().persist(p);
JpaMain.getManager().getTransaction().commit();
return p.getId() + "";
}
}
|
4844ec06-d657-43c0-90c1-566fcbf77dca | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-10 12:14:05", "repo_name": "raoshibin/JavaWebDemo2012", "sub_path": "/Demo0308/src/Demo02Servlet.java", "file_name": "Demo02Servlet.java", "file_ext": "java", "file_size_in_byte": 1172, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "ccda982cc871ad5d5f5e9b2ac718b2c74d03dc08", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/raoshibin/JavaWebDemo2012 | 246 | FILENAME: Demo02Servlet.java | 0.242206 | 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 java.io.IOException;
/**
* @Author 饶世斌
* @Date 2021/3/8 11:26
* @Version 1.0
* @describe
*/
@WebServlet(name = "Demo02Servlet",urlPatterns = "/demo02.do")
public class Demo02Servlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 获取请求的参数(办事的材料)查看
String username = request.getParameter("username");
System.out.println("在 Servlet2(柜台 2)中查看参数(材料):" + username);
// 查看 柜台 1 是否有盖章
Object key1 = request.getAttribute("key1");
System.out.println("柜台 1 是否有章:" + key1);
// 处理自己的业务
System.out.println("Servlet2 处理自己的业务 ");
}
}
|
8cd70b0e-3128-4c0f-a833-084a3c9b2de5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-10-11T19:21:57", "repo_name": "KhaosSystems/Inari", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1218, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "bd2503da1dd8aff9c88646f814ae6126b46cbab6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/KhaosSystems/Inari | 296 | FILENAME: README.md | 0.216012 | <div align="center">
<img src="images/logo.png" alt="Logo" width="80%">
<h3 align="center">Inari</h3>
<p align="center">
Custom pickers & control UIs.
<br />
<a href="https://khaos.systems/"><strong>By Khaos Systems</strong></a>
<br /><br />
<a href="#">Setup Guide</a>
·
<a href="https://github.com/KhaosSystems/Inari/issues">Report Bug</a>
·
<a href="https://github.com/KhaosSystems/Inari/issues">Request Feature</a>
</p>
</div>
<br>
## About The Project
Inari is a plugin/framework for creating custom pickers and control UIs for digital media pipelines. The underlying framework is developed with easy extensibility in mind, making Inari ideal for all sorts of custom tools. Inari is not built for one specific software, but rather using a bridge architecture allowing the Inari core to have cross-software support. The bridges only needs to implement a few application specific methods and provide window for the Inari master widget. Stuff like window docking is therefore controlled by the host application, which typically makes docking work right out of the box!
### Built With
[VFX Platform](https://vfxplatform.com/) |
c7dc3861-79bb-4c3d-b30b-8e8265e3f0c2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-06-04 14:17:45", "repo_name": "liqian008/geekway", "sub_path": "/geekway-model/src/main/java/com/bruce/geekway/model/data/JsonResultBean.java", "file_name": "JsonResultBean.java", "file_ext": "java", "file_size_in_byte": 1104, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "15a371c2bd8d559a15037916f8448eb1c7190a73", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liqian008/geekway | 246 | FILENAME: JsonResultBean.java | 0.243642 | package com.bruce.geekway.model.data;
/**
* 对数据的json包装,ajax请求及mcp共用此数据类型
*
* @author liqian
*
*/
public class JsonResultBean{
private int result;
private int errorcode;
private String message;
private Object data;
public JsonResultBean() {
super();
}
public JsonResultBean(int result, Object data, int errorcode, String message){
this.result = result;
this.data = data;
this.errorcode = errorcode;
this.message = message;
}
public int getResult() {
return result;
}
public void setResult(int result) {
this.result = result;
}
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 int getErrorcode() {
return errorcode;
}
public void setErrorcode(int errorcode) {
this.errorcode = errorcode;
}
} |
c0363522-c8bb-488c-9d03-b0dc4234f25f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-05 03:31:58", "repo_name": "namimono/zhny", "sub_path": "/src/main/java/org/rcisoft/entity/BusProjectSaving.java", "file_name": "BusProjectSaving.java", "file_ext": "java", "file_size_in_byte": 1233, "line_count": 76, "lang": "en", "doc_type": "code", "blob_id": "a348800c39109c52616793a170385b70ceb012d6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/namimono/zhny | 313 | FILENAME: BusProjectSaving.java | 0.26588 | package org.rcisoft.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Id;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table ( name ="bus_project_saving" )
public class BusProjectSaving {
/**
* 主键
*/
@Column(name = "id" )
@Id
private String id;
/**
* 项目主键
*/
@Column(name = "project_id" )
private String projectId;
/**
* 改造内容
*/
@Column(name = "save_content" )
private String saveContent;
/**
* 工程造价
*/
@Column(name = "save_cost" )
private String saveCost;
/**
* 分享期
*/
@Column(name = "save_share" )
private String saveShare;
/**
* 分享方式
*/
@Column(name = "save_method" )
private String saveMethod;
/**
* 节能量估算
*/
@Column(name = "save_estimate" )
private String saveEstimate;
/**
* 工程造价认定人员id(认定员id)
*/
@Column(name = "save_cost_id" )
private String saveCostId;
/**
* 节能认定人员id(认定员id)
*/
@Column(name = "save_energy_id" )
private String saveEnergyId;
}
|
39f5c99f-ac67-40ac-9f83-fe518793277b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-29 14:25:37", "repo_name": "Earthcomputer/VersionIndependentMods", "sub_path": "/vimapi/src/main/java/net/earthcomputer/vimapi/core/classfinder/FinderDedicatedServer.java", "file_name": "FinderDedicatedServer.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "7d0db2317e14f2cd02eabdb4a007f460416d6532", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Earthcomputer/VersionIndependentMods | 249 | FILENAME: FinderDedicatedServer.java | 0.267408 | package net.earthcomputer.vimapi.core.classfinder;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.MethodNode;
public class FinderDedicatedServer implements IFinder {
@Override
public void accept(String className, ClassConstants constants, ClassNode node) {
if (node.superName.equals("net/minecraft/server/MinecraftServer")) {
boolean isIntegratedServer = false;
String mcDesc = UsefulNames.get("vim:Minecraft");
if (mcDesc != null) {
mcDesc = "L" + mcDesc + ";";
for (FieldNode field : node.fields) {
if (field.desc.equals(mcDesc)) {
isIntegratedServer = true;
break;
}
}
}
if (!isIntegratedServer) {
UsefulNames.found("vim:DedicatedServer", className);
for (MethodNode method : node.methods) {
if (!method.name.equals("<init>")) {
UsefulNames.found("vim:DedicatedServer.startServer", method.name);
break;
}
}
}
}
}
}
|
9a708040-37a5-4f06-814b-9a149ee7b8c0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-21 12:26:19", "repo_name": "gyulchyoung/weather_app", "sub_path": "/app/src/main/java/com/example/Magic_CnyangE/weather_alarm/AlarmDatabase.java", "file_name": "AlarmDatabase.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "d3adfc7856d21542eca5b473089c67178f3dcff5", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/gyulchyoung/weather_app | 210 | FILENAME: AlarmDatabase.java | 0.26971 | package com.example.Magic_CnyangE.weather_alarm;
import android.content.Context;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.room.TypeConverters;
@Database(entities = {Alarm.class}, version = 1, exportSchema = false)
@TypeConverters({Converter.class})
public abstract class AlarmDatabase extends RoomDatabase {
private static volatile AlarmDatabase ALARM_INSTANCE;
public static final String DB_NAME = "alarms";
public abstract AlarmDao alarmDao();
public static AlarmDatabase getDatabases(final Context context){
if(ALARM_INSTANCE == null){
synchronized (AlarmDatabase.class){
if(ALARM_INSTANCE == null){
ALARM_INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
AlarmDatabase.class, DB_NAME)
.allowMainThreadQueries()
.fallbackToDestructiveMigration()
.build();
}
}
}
return ALARM_INSTANCE;
}
public static void destroyInstance(){
ALARM_INSTANCE = null;
}
}
|
41e7bf20-2855-4d50-88c0-e1926fa2666c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-16 18:17:49", "repo_name": "Java-19/16_03_18", "sub_path": "/app/src/main/java/com/sheygam/java_19_16_03_18/NameActivity.java", "file_name": "NameActivity.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "f61558c82f17cc49cfee817192e3a9bc3dcd8669", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Java-19/16_03_18 | 190 | FILENAME: NameActivity.java | 0.247987 | package com.sheygam.java_19_16_03_18;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class NameActivity extends AppCompatActivity implements View.OnClickListener {
private EditText inputName;
private Button okBtn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_name);
inputName = findViewById(R.id.input_name);
okBtn = findViewById(R.id.ok_btn);
okBtn.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(v.getId() == R.id.ok_btn){
String name = inputName.getText().toString();
Intent intent = new Intent();
intent.putExtra("NAME",name);
setResult(RESULT_OK,intent);
finish();
}
}
}
|
ed6c9000-c167-4117-a6e9-8780f69bc90d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-28 13:50:16", "repo_name": "irynaaleinik/java_mentoring", "sub_path": "/src/main/java/salad/Salad.java", "file_name": "Salad.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "eef650f36d6c95dab248fc0fd8b2822c3c6ac086", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/irynaaleinik/java_mentoring | 222 | FILENAME: Salad.java | 0.295027 | package salad;
import ingredient.Vegetable;
import javax.xml.bind.ValidationEvent;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
public abstract class SaladTemplate {
Set<Vegetable> ingredients;
int saladCalories = 0;
public SaladTemplate (Set<Vegetable> ingredients, int calories){
this.ingredients = ingredients;
this.saladCalories = calories;
}
public SaladTemplate() {
}
public int getCalories() {;
return saladCalories;
}
public Set<Vegetable> getIngredients() {
return ingredients;
}
@Override
public String toString() {
String result = "Your salad is ready. Ingredients: ";
for(Vegetable eachIngredient:ingredients) {
result = result.concat(eachIngredient.toString());
result = result.concat(", ");
}
result = result.substring(0, result.length() - 2);
return result + ". Total Calories = " + saladCalories;
}
}
|
9a1677f2-f805-440d-bd17-1c0c88723f7a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-09 04:56:57", "repo_name": "nareshkumar7593/LeetCode", "sub_path": "/src/LeetCodeUberPairsWithEqualSums.java", "file_name": "LeetCodeUberPairsWithEqualSums.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "235d61f26545484a865d5d8501c21d668bf077b1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nareshkumar7593/LeetCode | 259 | FILENAME: LeetCodeUberPairsWithEqualSums.java | 0.250913 | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
// worst Brute Force solution
public class LeetCodeUberPairsWithEqualSums {
static int[] inputs = {9,4,3,1,7,12};
static List<List<Integer>> al = new ArrayList<>();
public static void main(String[] args) {
int sum = 0;
for(int i = 0; i<inputs.length - 1;i++){
for(int j = i+1; j<inputs.length;j++){
sum = inputs[i] + inputs[j];
for(int k = i+1; k<inputs.length - 1;k++){
List<Integer> smallAl = new ArrayList<>();
for(int l = k+1; l<inputs.length;l++) {
if (k != j && l!= j) {
if (sum == inputs[k] + inputs[l]) {
smallAl.add(inputs[i]);
smallAl.add(inputs[j]);
smallAl.add(inputs[k]);
smallAl.add(inputs[l]);
}
}
}
if(smallAl.size() != 0)
al.add(smallAl);
}
}
}
System.out.println(al);
}
}
|
2d48d06c-86a4-42cd-aa27-36ca76a831c6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-17 09:50:08", "repo_name": "gqpibd/kh_chicken", "sub_path": "/khChicken_client/src/utils/images/LabelEventListener.java", "file_name": "LabelEventListener.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "f2362ae319bf0d31392497af5b95c6315fae86a8", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gqpibd/kh_chicken | 211 | FILENAME: LabelEventListener.java | 0.277473 | package utils.images;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JLabel;
import javax.swing.border.EtchedBorder;
public class LabelEventListener extends MouseAdapter{
ActionListener listener = null;
public LabelEventListener(ActionListener listener){
this.listener = listener;
}
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
listener.actionPerformed(new ActionEvent(e.getSource(),e.getID(),e.paramString()));
}
@Override
public void mousePressed(MouseEvent e) {
super.mousePressed(e);
((JLabel) e.getSource()).setBorder(null);
}
@Override
public void mouseEntered(MouseEvent e) {
((JLabel) e.getSource()).setBorder(new EtchedBorder());
super.mouseEntered(e);
}
@Override
public void mouseExited(MouseEvent e) {
((JLabel) e.getSource()).setBorder(null);
super.mouseExited(e);
}
}
|
3e5a592c-7f45-4208-bc66-61adb821ca01 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-07 20:20:39", "repo_name": "msgovea/listbuy", "sub_path": "/appv2/app/app/src/main/java/listbuy/me/listbuy/lista/Sincronizacoes/SincronizaListarListas.java", "file_name": "SincronizaListarListas.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "95783000a8499d9d4bacefbc0d2b565a9955f6b8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/msgovea/listbuy | 249 | FILENAME: SincronizaListarListas.java | 0.288569 | package listbuy.me.listbuy.lista.Sincronizacoes;
import android.os.AsyncTask;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import listbuy.me.listbuy.R;
/**
* Created by Talitadossantoscastr on 13/11/2016.
*/
public class SincronizaListarListas extends AsyncTask<String,String,String> {
@Override
protected String doInBackground(String... n) {
String api_url = R.string.url_listar_listas + "1/";
try{
URL url = new URL(api_url);
URLConnection urlc = url.openConnection();
BufferedReader bfr = new BufferedReader(new InputStreamReader(urlc.getInputStream()));
String line = bfr.readLine();
Log.i("teste_api",line);
JSONArray api_response = new JSONArray(line);
} catch (IOException | JSONException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
}
}
|
47ed877c-12d1-42ce-8112-ca4e699e1b33 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-06 18:28:06", "repo_name": "pradeepkaushal/strimzi", "sub_path": "/common-test/src/main/java/io/strimzi/test/k8s/OpenShift.java", "file_name": "OpenShift.java", "file_ext": "java", "file_size_in_byte": 860, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "a5b5284c3d021b4c320903e845d5ba18defb3d06", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pradeepkaushal/strimzi | 251 | FILENAME: OpenShift.java | 0.255344 | /*
* Copyright 2017-2018, Strimzi authors.
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
*/
package io.strimzi.test.k8s;
public class OpenShift implements KubeCluster {
private static final String OC = "oc";
@Override
public boolean isAvailable() {
return Exec.isExecutableOnPath(OC);
}
@Override
public boolean isClusterUp() {
try {
Exec.exec(OC, "cluster", "status");
return true;
} catch (KubeClusterException e) {
if (e.result.exitStatus() == 1) {
return false;
}
throw e;
}
}
@Override
public void clusterUp() {
Exec.exec(OC, "cluster", "up");
}
@Override
public void clusterDown() {
Exec.exec(OC, "cluster", "down");
}
@Override
public KubeClient defaultClient() {
return new Oc();
}
public String toString() {
return OC;
}
}
|
293743c0-470d-46c8-b46c-79bd059af6e3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-19 10:21:29", "repo_name": "ThornJuice/LearnAndroid", "sub_path": "/library/src/main/java/com/a360vrsh/library/util/KeyBoardUtil.java", "file_name": "KeyBoardUtil.java", "file_ext": "java", "file_size_in_byte": 1122, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "7f08240a770dbf9f3975c1dd0777b8de62ff06ca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ThornJuice/LearnAndroid | 233 | FILENAME: KeyBoardUtil.java | 0.228156 | package com.a360vrsh.library.util;
import android.app.Activity;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
/**
* @author: wxj
* @date: 2020/10/13
* @description:
*/
public class KeyBoardUtil {
//此方法只是关闭软键盘
public static void hintKbTwo(Activity context) {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.isActive() && context.getCurrentFocus() != null) {
if (context.getCurrentFocus().getWindowToken() != null) {
imm.hideSoftInputFromWindow(context.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
}
}
/**
* 显示键盘
*
* @param et 输入焦点
*/
public static void showInput(Activity context, final EditText et) {
et.requestFocus();
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(et, InputMethodManager.SHOW_IMPLICIT);
}
}
|
480cdee6-e007-4358-89b8-4dc72e5e95c3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-01 19:29:58", "repo_name": "cClaude/cchlib", "sub_path": "/cchlib-i18n/src/main/java/com/googlecode/cchlib/i18n/core/resolve/IndexKV.java", "file_name": "IndexKV.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "c0439f1c948d5976b66a37d45dac956ec8d25e1e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cClaude/cchlib | 194 | FILENAME: IndexKV.java | 0.283781 | package com.googlecode.cchlib.i18n.core.resolve;
import java.io.Serializable;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
*
*/
abstract /*not public*/ class IndexKV implements Serializable, Iterable<String>
{
private static final long serialVersionUID = 1L;
public IndexKV()
{
}
public abstract String get( int index );
public abstract int size();
@Override
public Iterator<String> iterator()
{
return new Iterator<String>() {
private int index;
@Override
public boolean hasNext()
{
return this.index < size();
}
@Override
public String next()
{
if( this.index < size() ) {
return get( this.index++ );
}
else {
throw new NoSuchElementException();
}
}
@Override
public void remove()
{
throw new UnsupportedOperationException();
}
};
}
}
|
fe560993-fb8b-4db3-8ad5-ba95d101d01d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-06-10T03:18:46", "repo_name": "Charchit26/RAMLTest", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1126, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "faca4dc70ad4e97da4f450085224f632a2fe53a3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Charchit26/RAMLTest | 241 | FILENAME: README.md | 0.295027 | # RAMLTest
This is a demo RAML of an API to satisfy the following conditions:
List customers
Create a new customer
Update a customer
Deletes a customerD
The RAML pack was designed using "Desing Center" provided by Mulesoft Anypoint platform.
It has 4 basic CRUD operation capability - GET, POST, PUT and DELETE.
I have tried to use many different RAML features like traits, securitySchemes and includes.
Pagination has also been added to the GET request which adds offset, limit or page in the query parameters to be able to fetch and display only a finite amount of records at one go. This feature is very useful in mobile app development since client does not need to wait too long for large amount of data and requires less bandwidth too.
Caching has been enabled for the GET request too using ETags, which enables the browsers to use the old resource if there was no change made to it by the server, which is evident by the presence of same ETags.
This RAML is extensible to allow additions of more resources like orders, products etc by re-using methods in traits and inheriting from customer's URI parameter "ID".
|
2e4866ee-4083-4fb8-b4cd-06147338bf2d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-21 01:28:40", "repo_name": "omkar0613/Android--Programming-Stuff", "sub_path": "/Mobile Contact/app/src/main/java/com/example/user/contact/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "217407c93cf2bdaa8b61d3c468539b99b4107c87", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/omkar0613/Android--Programming-Stuff | 222 | FILENAME: MainActivity.java | 0.253861 | package com.example.user.contact;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
public class MainActivity extends ActionBarActivity {
MyDBHandler db;
public static final String TAG="StatusActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void button_Click(View v) {
if (v.getId() == R.id.id_Add) {
Log.d(TAG, "Clicked Add Button");
Intent intent = new Intent(MainActivity.this, AddContacts.class);
startActivity(intent);
}
if (v.getId() == R.id.id_Lookup) {
Log.d(TAG, "Clicked Lookup Button");
// PhoneBook phn=new PhoneBook(this);
// phn.retrieve();
Intent intent = new Intent(MainActivity.this, Lookup.class);
startActivity(intent);
}
}
}
|
24507a07-6092-4212-b615-a9da5b0d3947 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-10 14:50:31", "repo_name": "Arnament1007/elementary", "sub_path": "/src/main/java/hw_4/entities/Client.java", "file_name": "Client.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "5eff968db7679d97d52535027ca202c1664baaa0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Arnament1007/elementary | 205 | FILENAME: Client.java | 0.275909 | package hw_4.entities;
import java.util.Scanner;
public class Client {
String clientID;
String surname;
String clientAccID;
double suma;
public Client recordClientID (){
Client recordClientID = new Client();
Scanner scanner = new Scanner(System.in);
clientID = scanner.next();
scanner.close();
return recordClientID;
}
public Client recordSurname (){
Client recordSurname = new Client();
Scanner scanner = new Scanner(System.in);
surname = scanner.next();
scanner.close();
return recordSurname;
}
public Client recordAccId (){
Client recordSurname = new Client();
Scanner scanner = new Scanner(System.in);
clientAccID = scanner.next();
scanner.close();
return recordAccId();
}
public Client recordSuma (){
Client recordSurname = new Client();
Scanner scanner = new Scanner(System.in);
suma = scanner.nextInt();
scanner.close();
return recordSuma();
}
}
|
4f01611e-5b40-4e2e-b216-8106c684c69c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-01 08:31:34", "repo_name": "LWHTarena/lwh-example", "sub_path": "/lwh-redis2020/lwh-redisson/src/test/java/com/lwhtarena/lettuce/BasicUsage.java", "file_name": "BasicUsage.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "b98efb20e5d7e04774c0af1f21611918b2593d8d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LWHTarena/lwh-example | 274 | FILENAME: BasicUsage.java | 0.246533 | package com.lwhtarena.lettuce;
import io.lettuce.core.ClientOptions;
import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.sync.RedisStringCommands;
import io.lettuce.core.resource.ClientResources;
/**
* @author liwh
* @version 1.0
* @date 2021/04/18 17:16:46
* @description 单机模式下代码测试
*/
public class BasicUsage {
public static void main(String[] args) {
// client
RedisClient client = RedisClient.create("redis://192.168.56.15");
// connection, 线程安全的长连接,连接丢失时会自动重连,直到调用 close 关闭连接。
StatefulRedisConnection<String, String> connection = client.connect();
// sync, 默认超时时间为 60s.
RedisStringCommands<String, String> sync = connection.sync();
sync.set("host", "note.abeffect.com");
String value = sync.get("host");
System.out.println(value);
// close connection
connection.close();
// shutdown
client.shutdown();
}
}
|
3486e7a3-946b-4053-a773-91faabe02915 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-27 01:35:45", "repo_name": "sakaev2901/chat", "sub_path": "/Multichat Jackson/Server/src/main/java/models/Message.java", "file_name": "Message.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "13d557197b084174c4f84fe5535f9e8a93693ade", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sakaev2901/chat | 226 | FILENAME: Message.java | 0.253861 | package models;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@Data
@AllArgsConstructor
@Builder
public class Message {
private String text;
private String timeStamp;
private String senderName;
private Integer id;
public Message() {
}
public Message(String text) {
this.text = text;
timeStamp =new SimpleDateFormat("yyyy.MM.dd_HH:mm:ss").format(Calendar.getInstance().getTime());
}
public String getSenderName() {
return senderName;
}
public void setSenderName(String sender) {
this.senderName = sender;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(String timeStamp) {
this.timeStamp = timeStamp;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
|
431f8344-5d4d-4f53-96dd-0006c0707263 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-17 12:43:19", "repo_name": "chEv1337/ars_riedl", "sub_path": "/src/GetReservationNumber.java", "file_name": "GetReservationNumber.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "5fb2b5fedcac6a27ffde28d7f793beaf440f5f0c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/chEv1337/ars_riedl | 198 | FILENAME: GetReservationNumber.java | 0.27048 | import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
import javax.servlet.http.HttpSession;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@Named
@SessionScoped
public class GetReservationNumber implements Serializable {
public static void getNumber() {
Connection con = DatabaseConnection.getConnection();
PreparedStatement stmnt;
HttpSession userSession = SessionData.getSession();
int reservationId = 0;
try {
stmnt = con.prepareStatement("SELECT max(idreservation), max(reservationnumber) FROM reservation");
ResultSet rs = stmnt.executeQuery();
while(rs.next()) {
reservationId = 1 + rs.getInt("max(reservationnumber)");
}
userSession.setAttribute("reservationId",reservationId);
DatabaseConnection.closeConnection(con);
} catch (SQLException err) {
System.out.println("Error @ GetReservationNumber.java --> " + err.getMessage());
}
}
}
|
d6e55d40-2100-4184-8900-3c284e7779ae | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-13 14:44:12", "repo_name": "shadowforyou/shadowforyou.github.io", "sub_path": "/src/main/java/com/poi/testpoi/util/IsRowNull.java", "file_name": "IsRowNull.java", "file_ext": "java", "file_size_in_byte": 1271, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "414b54d885ab4b55de64380bfc7f4d10a28e851c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shadowforyou/shadowforyou.github.io | 361 | FILENAME: IsRowNull.java | 0.284576 | package com.poi.testpoi.util;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
public class IsRowNull {
/**
* 判断行是否为空
*
* @param row
* @return
*/
public Boolean rowIsNull(Row row) {
for (int c = row.getFirstCellNum(); c < row.getLastCellNum(); c++) {
Cell cell = row.getCell(c);
if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) {
return false;
}
}
return true;
}
/**
* 最后一行是否含有附注
*
* @param row
* @return
*/
public String rowHasNt(Row row) {
for (int c = row.getFirstCellNum(); c < row.getLastCellNum(); c++) {
Cell cell = row.getCell(c);
if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK && (c==0 || c==1 || c== 2)) {
String result = null;
if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
result = String.valueOf(row.getCell(c).getNumericCellValue());
} else {
result = row.getCell(c).getStringCellValue();
}
if(result.contains("附注") || result.contains("注") || result.contains("说明") ) {
if (result.contains("附注") || result.contains("注") ||
result.contains("说明") ||
result.length()>6) {
return result;
}
}
}
}
return null;
}
}
|
b394ab72-594e-4856-9b17-f548babfac38 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-05 18:47:23", "repo_name": "zhaoseast/WechatMoments", "sub_path": "/app/src/main/java/com/example/zhaoseast/wechatmoments/LoadingActivity.java", "file_name": "LoadingActivity.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "fe5e2b53370f8b78cf846ede48f2adaf2ab274fd", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhaoseast/WechatMoments | 232 | FILENAME: LoadingActivity.java | 0.216012 | package com.example.zhaoseast.wechatmoments;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import com.example.zhaoseast.wechatmoments.activity.baseActivity.WeChatBaseActivity;
/**
* @Description:欢迎页载入
* @Createdtime:2019/1/3 17:46
* @Author:Zhaohd
* @Version: V.1.0.0
*/
public class LoadingActivity extends WeChatBaseActivity {
//延迟3秒
private static final long SPLASH_DELAY_MILLIS = 1600;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loading);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
goHome();
}
},SPLASH_DELAY_MILLIS);
}
private void goHome() {
Intent intent = new Intent(LoadingActivity.this, WelcomeActivity.class);
LoadingActivity.this.startActivity(intent);
LoadingActivity.this.finish();
}
}
|
a8ceca8d-09e2-46d9-b984-ba050c7a1fbe | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-05-20T02:10:40", "repo_name": "knetsteller/Mobile_Engenharia-de-Software", "sub_path": "/src/br/ufg/inf/RegisterActivity.java", "file_name": "RegisterActivity.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "672cc96c7bb31dec96770449055f924c0636aa4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "ISO-8859-1"} | https://github.com/knetsteller/Mobile_Engenharia-de-Software | 177 | FILENAME: RegisterActivity.java | 0.233706 | package br.ufg.inf;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class RegisterActivity {
EditText txtNome;
EditText txtEmail;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
final Controller aController = (Controller) getApplicationContext();
if (!aController.isConnectingToInternet()) {
aController.showAlertDialog(RegisterActivity.this,
"Erro de conexão",
"É necessário conexão com a internet", false);
return;
}
txtNome = (EditText) findViewById(R.id.txtName);
txtEmail = (EditText) findViewById(R.id.txtEmail);
btnRegister = (Button) findViewById(R.id.btnRegister);
}
|
1fa0d1fc-0316-4de0-a148-74f9d448e140 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-18T18:13:50", "repo_name": "rfaugeroux/captain", "sub_path": "/src/main/java/com/liveramp/captain/notifier/DefaultCaptainLoggingNotifier.java", "file_name": "DefaultCaptainLoggingNotifier.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "30fba30eabe6dced16ffe385f2654a85aa23f0f6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rfaugeroux/captain | 231 | FILENAME: DefaultCaptainLoggingNotifier.java | 0.255344 | package com.liveramp.captain.notifier;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DefaultCaptainLoggingNotifier implements CaptainNotifier {
private static final Logger LOG = LoggerFactory.getLogger(DefaultCaptainLoggingNotifier.class);
private void notifyInternal(String subject, String body, NotificationLevel notificationLevel) {
LOG.info(String.format("[%s]: %s %n%n %s)", notificationLevel.toString(), subject, body));
}
@Override
public void notify(
String header, String message, NotificationLevel notificationLevel) {
notifyInternal(header, message, notificationLevel);
}
@Override
public void notify(
String header, Throwable t, NotificationLevel notificationLevel) {
notify(header, "", t, notificationLevel);
}
@Override
public void notify(
String header, String message, Throwable t,
NotificationLevel notificationLevel) {
String body = String.format("%s %n %s", message, ExceptionUtils.getFullStackTrace(t));
notifyInternal(header, body, notificationLevel);
}
}
|
a0a0ccbe-0940-47d3-be45-0f436d6494b5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-23 07:04:30", "repo_name": "enchenDai/grampusMiddle", "sub_path": "/src/main/java/com/deepblue/middleware/service/enums/PalmTypeEnum.java", "file_name": "PalmTypeEnum.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "270855b10937e2ecef5daeba5cc7ddcc85a2083d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/enchenDai/grampusMiddle | 251 | FILENAME: PalmTypeEnum.java | 0.256832 | package com.deepblue.middleware.service.enums;
/**
* Created by enchen on 10/10/17.
*/
public enum PalmTypeEnum {
ADD_TYPE("1", "新增注册"),
UPDATE_TYPE("2", "更新注册"),
DELETE_TYPE("3", "删除会员");
private final String typeCode;
private final String typeName;
/**
* @param typeCode
* @param typeName
*/
private PalmTypeEnum(String typeCode, String typeName) {
this.typeCode = typeCode;
this.typeName = typeName;
}
/**
* <pre>
* 通过typeCode取PalmTypeEnum
* </pre>
*
* @param typeCode
* @return
*/
public static PalmTypeEnum getEnumByCode(String typeCode) {
PalmTypeEnum[] enums = PalmTypeEnum.values();
for (PalmTypeEnum codeEnum : enums) {
if (codeEnum.getTypeCode().equals(typeCode)) {
return codeEnum;
}
}
return null;
}
public String getTypeCode() {
return typeCode;
}
public String getTypeName() {
return typeName;
}
}
|
54d3e60a-d444-46c8-9e35-4b13e4585f51 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-19 18:46:42", "repo_name": "JitendraSharma23/MyAutomationCode", "sub_path": "/TerminusPro/src/main/java/com/terminus/pageHelper/LoginPageHelper.java", "file_name": "LoginPageHelper.java", "file_ext": "java", "file_size_in_byte": 978, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "4fda7b8bb9f41c7ba4e0d25d7a3ae90b9bc703a5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JitendraSharma23/MyAutomationCode | 189 | FILENAME: LoginPageHelper.java | 0.279828 | package com.terminus.pageHelper;
import org.junit.Assert;
import org.openqa.selenium.WebDriver;
import com.terminus.pageObjects.LoginPageObject;
public class LoginPageHelper extends LoginPageObject {
public LoginPageHelper(WebDriver driver) {
super(driver);
}
public void Enter_Invalid_UserNamePassword() throws InterruptedException{
Thread.sleep(5000);
userNameField.sendKeys("test");
passwordField.sendKeys("abc");
}
public void Catch_ValidationMessage() throws InterruptedException {
loginButton.click();
Thread.sleep(7000);
String ExpectedMessage = "Please enter correct Username or Password";
Assert.assertEquals(validationmessage, ExpectedMessage);
}
public void Enter_valid_UserNamePassword() throws InterruptedException {
Thread.sleep(5000);
userNameField.sendKeys(prop.getProperty("username"));
passwordField.sendKeys(prop.getProperty("password"));
loginButton.click();
}
}
|
5c7dc195-efdc-45dd-a4f2-939ec8898145 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-12-09 14:30:43", "repo_name": "ndmnh/Tryout2---Copy---Copy", "sub_path": "/app/src/main/java/com/example/syuqri/tryout2/SettingsFragment.java", "file_name": "SettingsFragment.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "de3fd614243abd9574bd2afad995e9e38eb54125", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ndmnh/Tryout2---Copy---Copy | 187 | FILENAME: SettingsFragment.java | 0.196826 | package com.example.syuqri.tryout2;
import android.app.Fragment;
import android.app.FragmentManager;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
/**
* Created by Syuqri on 11/28/2015.
*/
public class SettingsFragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_settings,container,false);
FloatingActionButton callRefresh = (FloatingActionButton) rootView.findViewById(R.id.refresh);
callRefresh.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
System.out.println("havent added function yet");
}
});
return rootView;
}
}
|
d6a6ba24-360d-4a05-a05b-b0396cea1edf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-07-29T20:34:19", "repo_name": "tpaksu/tpaksu", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1266, "line_count": 20, "lang": "en", "doc_type": "text", "blob_id": "4e78e090fdb29a9bf78e5bb8ecbb94b94d1eb958", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tpaksu/tpaksu | 380 | FILENAME: README.md | 0.242206 | # Hi there 🤟
<img src='https://media.giphy.com/media/dlMIwDQAxXn1K/giphy.gif' style='width: 100%'><br><br>
I'm Taha PAKSU 👋, a coder like most of you, who makes his and his family's living 💰 from writing code.
I write mostly PHP, C# (and .net core) and javascript (vanilla, jquery, vue) about 15+ years ⚒ (yes I feel like getting old 🎅 when I saw younger and better profiles here), and I love writing apps/packages on Laravel framework (👨💻 less than 40 keypresses `laravel new application --auth`, you have a website ready with an authentication system - Oh 😱 forgot the database migrations, make it 100 :P).
Don't hold yourself back to star my repositories🧿. I know some don't deserve stars, but makes me happy. Making anyone happy, will make you happy. Believe me.
## Contact
- 🧐 [LinkedIn](https://linkedin.com/in/tahapaksu)
- 🕊️ [Twitter](https://twitter.com/tpaksu)
- 👾 [GitHub](https://github.com/tpaksu)
- 🦅 [CodeCanyon](https://codecanyon.net/user/tpaksu/portfolio)
- 📗 [HackerRank](https://www.hackerrank.com/tpaksu)
- 📚 [StackOverflow](https://stackoverflow.com/users/916000/taha-paksu)

|
4408021d-890f-4d65-8bd0-eb9ad3e5c455 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-22 12:58:59", "repo_name": "yuanpeili/springBoot", "sub_path": "/src/main/java/com/lpy/marks/service/impl/CityServiceImpl.java", "file_name": "CityServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "c0c5182873fedf7a28ebfa07dd8dc1559ee245fc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yuanpeili/springBoot | 216 | FILENAME: CityServiceImpl.java | 0.26588 | package com.lpy.marks.service.impl;
import com.lpy.marks.dao.CityDao;
import com.lpy.marks.model.City;
import com.lpy.marks.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CityServiceImpl implements CityService {
@Autowired
private CityDao cityDao;
@Override
public int deleteByPrimaryKey(Integer id) {
return cityDao.deleteByPrimaryKey(id);
}
@Override
public int insert(City record) {
return cityDao.insert(record);
}
@Override
public int insertSelective(City record) {
return cityDao.insertSelective(record);
}
@Override
public City selectByPrimaryKey(Integer id) {
return cityDao.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(City record) {
return cityDao.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(City record) {
return cityDao.updateByPrimaryKey(record);
}
}
|
6f3e881c-37d9-4c22-b31f-6fbab4a13f75 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-11 16:18:05", "repo_name": "alvaromrb/LunarClient-API", "sub_path": "/src/main/java/net/silexpvp/lunar/packet/impl/LCPacketServerRule.java", "file_name": "LCPacketServerRule.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "ef46a1e0ba013209e191dbf81bc321e00fa42099", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/alvaromrb/LunarClient-API | 220 | FILENAME: LCPacketServerRule.java | 0.245085 | package net.silexpvp.lunar.packet.impl;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.silexpvp.lunar.packet.LCPacket;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@RequiredArgsConstructor
public class LCPacketServerRule implements LCPacket {
private final Rule rule;
private final int i;
private final float f;
private final boolean b;
private final String message;
@Override
public ByteArrayOutputStream getData() throws IOException {
ByteArrayOutputStream data = new ByteArrayOutputStream();
data.write(10);
data.write(writeString(rule.getName()));
data.write(writeInt(i));
data.write(writeFloat(f));
data.write(writeBoolean(b));
data.write(writeString(message));
data.close();
return data;
}
@RequiredArgsConstructor
@Getter
public enum Rule {
MINIMAP_STATUS("minimapStatus"),
SERVER_HANDLES_WAYPOINTS("serverHandlesWaypoints"),
COMPETITIVE_GAMEMODE("competitiveGame");
private final String name;
}
}
|
39d51a0a-99a8-4f28-81d8-ee808655af3e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-12 18:06:06", "repo_name": "humzafaiz1/DemonsSoulsTrophyApp", "sub_path": "/DemonsSoulsApp/app/src/main/java/com/bluenarwhal/demonssoulsapp/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1216, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "c8f78f5cb8c8ee35d22417b0e8ec2810efbfe04f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/humzafaiz1/DemonsSoulsTrophyApp | 234 | FILENAME: MainActivity.java | 0.236516 | package com.bluenarwhal.demonssoulsapp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ScrollView;
public class MainActivity extends AppCompatActivity {
private Button trophiesButton;
private Button roadmapButton;
private ScrollView sv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
trophiesButton = findViewById(R.id.trophiesButton);
trophiesButton.setSoundEffectsEnabled(false);
}
// public void openCharActivity(View view){
// sv = findViewById(R.id.scrollView1);
// lastButton = findViewById(R.id.lastButton);
// sv.smoothScrollTo((int) lastButton.getX(), (int) lastButton.getY());
// }
public void openTrophiesActivity(View view){
Intent intent = new Intent(this, TrophiesActivity.class);
startActivity(intent);
}
public void openRoadmapActivity(View view){
Intent intent = new Intent(this, RoadmapActivity.class);
startActivity(intent);
}
} |
deee837f-8d36-4448-9d60-be0e1eb5d1e4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-03-09T15:28:45", "repo_name": "pairshaped/pairshaped.ca", "sub_path": "/source/blog/ios-development-with-ruby-motion.md", "file_name": "ios-development-with-ruby-motion.md", "file_ext": "md", "file_size_in_byte": 1043, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "3275b877cb12a424c2eab3215c8484d2da117419", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pairshaped/pairshaped.ca | 259 | FILENAME: ios-development-with-ruby-motion.md | 0.194368 | ---
title: "iOS Development with Ruby Motion"
date: 2012-10-24
tags: [ios, ruby]
author: "Dave Rapin"
published: true
---
I've been building an iOS app with RubyMotion for a while now, and the verdict is...
I'm in love with [RubyMotion](http://www.rubymotion.com/).
Here's why:
* Ruby syntax runs circles around Objective-C syntax. If you've used Ruby and Objective-C for anything significant, and you're not a masochist, then you know what I'm talking about.
* It already has some amazing libraries like Teacup, BubbleWrap, and Formotion.
* Building and deploying is a cinch with Rake. There's even a testflight gem.
* Bundler and CocoaPods for dependency management.
* The REPL. I actually haven't found this that big of a deal, but it can come in handy now and then.
* I can continue using a text editor (vim or Sublime Text) instead of that hog called Xcode.
* Really small archives.
* The only (minor) downside so far has been occasionally translating example Objective-C code to RubyMotion code from Apple's docs and Stack Overflow.
|
6f3a1d65-68dc-494f-b9b0-f84923cb3dd9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-16 01:46:18", "repo_name": "hzr958/myProjects", "sub_path": "/scmv6/center-batch/src/main/java/com/smate/center/batch/service/pub/mq/CniprPubCacheAssignProducer.java", "file_name": "CniprPubCacheAssignProducer.java", "file_ext": "java", "file_size_in_byte": 1165, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "f2c49d051e9801235cadfe63d6c17767e4b80a80", "star_events_count": 2, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/hzr958/myProjects | 292 | FILENAME: CniprPubCacheAssignProducer.java | 0.286968 | package com.smate.center.batch.service.pub.mq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.smate.center.batch.exception.pub.ServiceException;
import com.smate.center.batch.service.rol.pub.InsPortalManager;
/**
*
* 发送CNIPR成果XML到单位.
*
* @author liqinghua
*
*/
@Component("cniprPubCacheAssignProducer")
public class CniprPubCacheAssignProducer {
private String queneName = "cniprPubCacheAssignMessage";
@Autowired
private InsPortalManager insPortalManager;
@Autowired
private CniprPubCacheAssignConsumer cniprPubCacheAssignConsumer;
/**
* 发送成果XML到指定单位.
*
* @param xmlId
* @param xmlData
* @param pubType
* @param dbId
* @param insId
* @throws ServiceException
*/
public void sendAssignMsg(Long xmlId, String xmlData, Long insId) throws ServiceException {
Integer nodeId = insPortalManager.getInsNodeId(insId);
if (nodeId != null) {
CniprPubCacheAssignMessage msg = new CniprPubCacheAssignMessage(xmlId, xmlData, insId);
this.cniprPubCacheAssignConsumer.receive(msg);
}
}
}
|
17c12985-3efa-4e9c-99d7-9e2c6fa2fee8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-11 12:04:44", "repo_name": "waynetrx/MHCI4", "sub_path": "/app/src/main/java/com/mhci4/mhci4/fragments/MapDialogFragment.java", "file_name": "MapDialogFragment.java", "file_ext": "java", "file_size_in_byte": 1037, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "5ec9faf576013eeec4b464bf8db1bb7f03d2ed42", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/waynetrx/MHCI4 | 190 | FILENAME: MapDialogFragment.java | 0.20947 | package com.mhci4.mhci4.fragments;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.mhci4.mhci4.R;
public class MapDialogFragment extends DialogFragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_dialog_popup,container);
TextView popupName = (TextView)view.findViewById(R.id.popup_name);
TextView popupDeadline = (TextView)view.findViewById(R.id.popup_task_deadline);
TextView popupBudget = (TextView)view.findViewById(R.id.popup_budget);
TextView popupDaysRemaining = (TextView)view.findViewById(R.id.popup_time_remain);
TextView popupAddress = (TextView)view.findViewById(R.id.popup_address);
return view;
}
}
|
416b360f-3d9d-4330-886c-4b3dfee6bede | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-01 21:15:51", "repo_name": "Aurawin/Core", "sub_path": "/src/main/java/com/aurawin/core/rsr/def/http/Restful.java", "file_name": "Restful.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "6687544b8fdfb0ce894730f6393ef593ee5f3286", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Aurawin/Core | 222 | FILENAME: Restful.java | 0.256832 | package com.aurawin.core.rsr.def.http;
import com.aurawin.core.array.KeyPairs;
import com.aurawin.core.stream.MemoryStream;
import static com.aurawin.core.lang.Table.CRLF;
public class Restful {
public String Method;
public String NamespacePlugin;
public String NamespaceEntry;
public KeyPairs Headers;
public KeyPairs Parameters;
public KeyPairs Cookies;
public MemoryStream Input;
public MemoryStream Output;
public Restful(String method, String namespacePlugin, String namespaceCommand) {
Method = method;
NamespacePlugin = namespacePlugin;
NamespaceEntry = namespaceCommand;
Headers =new KeyPairs();
Headers.DelimiterItem=CRLF;
Headers.DelimiterField="=";
Parameters = new KeyPairs();
Parameters.DelimiterItem="&";
Parameters.DelimiterField="=";
Cookies = new KeyPairs();
Cookies.DelimiterItem="; ";
Cookies.DelimiterField="=";
Input = new MemoryStream();
Output = new MemoryStream();
}
}
|
32ce8051-301b-4016-be4b-83b7f3313deb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-08-14T13:23:03", "repo_name": "ting11222001/A-Basic-Real-Time-Weather-App", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1236, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "a0f782649683568dc0f2c8e8a0f5f0ffad6e22e2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ting11222001/A-Basic-Real-Time-Weather-App | 270 | FILENAME: README.md | 0.294215 | # Creating a Real Time Weather App in Flask Using Python requests and geocoder
This is the complete source code of my article on Medium: <br>
https://medium.com/li-ting-liao-tiffany/creating-a-real-time-weather-app-in-flask-using-python-requests-and-geocoder-f6a2be3f8b31
## What I’m going to make and Why I’m doing it
This is my hands-on project in which I’ll use Flask to create a weather app and will be using Open weather Data API of the Taiwan Government Central Weather Bureau 中央氣象局 with Python requests to get the data.
## Environment used in this project
I'm using Python3 in VS code.
## Skills used in this project
* Create a simple web application with flask.
* Use python decorator to create route() which will tell Flask what URL should trigger our function.
* Request data from external API with request module.
* Get current location’s latitude and longitude with geocoder module.
* Find the nearest weather station by calculating the distance of each weather station and my current location.
* Use render_template function to pass data to a designed html structure.
* Display the result on browser.
## Notes for files
* weather_final_main.py: for flask web app
* weather.html: to display on browser
|
f49c9b64-0890-428d-89a8-7b26e9cf624b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-27 01:11:33", "repo_name": "ChungYuCheng/AccountingApp", "sub_path": "/app/src/main/java/com/joe/accountingapp/ui/settings/SettingsViewModel.java", "file_name": "SettingsViewModel.java", "file_ext": "java", "file_size_in_byte": 1013, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "7731ff03be42e3b6027ed94a1db5bb0dab721a99", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ChungYuCheng/AccountingApp | 189 | FILENAME: SettingsViewModel.java | 0.206894 | package com.joe.accountingapp.ui.settings;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.joe.accountingapp.bean.MoreFunction;
import java.util.ArrayList;
public class SettingsViewModel extends ViewModel {
private MutableLiveData<String> mText;
private MutableLiveData<ArrayList<String>> mFuncName;
public SettingsViewModel() {
mText = new MutableLiveData<>();
mFuncName = new MutableLiveData<>();
mText.setValue("This is notifications fragment");
// MoreFunction moreFunction = new MoreFunction("個人設定");
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add("吃飯");
arrayList.add("睡覺");
arrayList.add("打東東");
mFuncName.setValue(arrayList);
}
public LiveData<String> getText() {
return mText;
}
public MutableLiveData<ArrayList<String>> getFuncName() {
return mFuncName;
}
} |
ae258050-f818-433d-9a1a-8e97ce87bad9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-16 19:40:40", "repo_name": "rcostadresch/Cadastro-de-anuncios-SPARK", "sub_path": "/sistema/src/command/ScreenUpdateAnuncioCommand.java", "file_name": "ScreenUpdateAnuncioCommand.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "4bbe419a9a01202975a1e63bd01d029177bf52ea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rcostadresch/Cadastro-de-anuncios-SPARK | 183 | FILENAME: ScreenUpdateAnuncioCommand.java | 0.267408 | package command;
import static init.Main.entityManagerFactory;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.persistence.EntityManager;
import model.Anuncio;
import model.Pessoa;
import spark.Request;
import spark.Response;
/**
*
* @author iapereira
*/
public class ScreenUpdateAnuncioCommand extends Command {
public ScreenUpdateAnuncioCommand(Request request, Response response) {
super(request, response);
EntityManager entityManager = entityManagerFactory.createEntityManager();
entityManager.getTransaction().begin();
Anuncio anuncio = entityManager.find(Anuncio.class, Integer.parseInt(request.params(":id")));
entityManager.getTransaction().commit();
map.put("descricao", anuncio.getDescricao());
map.put("valor", anuncio.getValor());
map.put("id", anuncio.getId());
entityManager.close();
}
}
|
59eca465-d426-4604-921c-ba8fe0cd5d55 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-06-01T09:38:12", "repo_name": "antleaf/jct-user-stories", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 975, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "91fc854c4c45e4c6c38ef85b8314cd94f7263a1a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/antleaf/jct-user-stories | 216 | FILENAME: README.md | 0.236516 | # JCT User Stories
This repository is for collecting, discussing and categorising user stories supporting the development of the Plan S Journal Tracking Tool.
## About User Stories
User stories are terse descriptions of a feature told from the perspective of the person who desires the new capability, usually a **user** of the system. They follow this simple template:

For a user story to be valid and useful, it needs to have **all three** of those parts.
## To create a user story
1. Go to https://github.com/antleaf/jct-user-stories/issues
2. Create a new issue, with the the full user story as the title of the issue. Add any extra information you wish into the 'comment' field below.
## To view, label and categorise user stories
1. Go to https://github.com/antleaf/jct-user-stories/projects/1. User stories can be dragged to new columns, or can be labelled by clicking on the title of the user story.
|
9dacbb87-441f-458e-9ed3-393b58ea9a02 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-30 09:47:56", "repo_name": "bijoyoitl/MyAcademy", "sub_path": "/app/src/main/java/com/edu/myacademy/Model/RegisterInfo.java", "file_name": "RegisterInfo.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "9da98a100f5370ca4f553cd7b3a71a11537d541f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bijoyoitl/MyAcademy | 238 | FILENAME: RegisterInfo.java | 0.23231 | package com.edu.myacademy.Model;
/**
* Created by Bijoy on 10/19/2016.
*/
public class RegisterInfo {
private String name;
private String email;
private String userType;
private String classType;
private String password;
private String con_password;
//
public RegisterInfo(String email, String password) {
this.email = email;
this.password = password;
}
public RegisterInfo(String name, String email, String userType, String classType, String password, String con_password) {
this.name = name;
this.email = email;
this.userType = userType;
this.classType = classType;
this.password = password;
this.con_password = con_password;
}
public String getName() {
return name;
}
public String getEmail() {
return email;
}
public String getUserType() {
return userType;
}
public String getClassType() {
return classType;
}
public String getPassword() {
return password;
}
public String getCon_password() {
return con_password;
}
}
|
03eaba45-2619-4ff4-8367-398bfce44917 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-08-28T20:35:57", "repo_name": "vanam/ncs-vagrant", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1118, "line_count": 43, "lang": "en", "doc_type": "text", "blob_id": "c62c658a7d3cc1f1e7a62ae1ae442712baf8fe8b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vanam/ncs-vagrant | 288 | FILENAME: README.md | 0.276691 | # Nette Coding Standard Vagrant Project
[](/LICENSE)
This project allows you to run a [Nette Coding Standard](https://github.com/nette/coding-standard/) check&fix in environments with PHP <7.1.
## Usage
### Install
Install [Vagrant](https://www.vagrantup.com/downloads.html) and [Virtualbox](https://www.virtualbox.org/wiki/Downloads).
### Synchronize project folder
Add project folder, you want to check, to `Vagrantfile`:
```ruby
Vagrant.configure("2") do |config|
...
config.vm.synced_folder "path/to/project-to-check", "/vagrant_data/project-to-check"
...
end
```
> Note: You can add multiple project folders
### Style check & fix
Now run Vagrant and connect via SSH.
```bash
$ vagrant up
$ vagrant ssh
```
Once you are connected via SSH move to `/vagrant` folder and run check&fix.
```bash
$ ./ecs check /vagrant_data/project-to-check/app/ --config vendor/nette/coding-standard/coding-standard-php70.neon --fix
```
For more details read [Nette Coding Standard documentation](https://github.com/nette/coding-standard/).
|
ac1a402b-7188-45e0-900a-de697fd87ac6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-14 22:35:18", "repo_name": "chrisblutz/trinity-legacy-2", "sub_path": "/src/main/java/com/github/chrisblutz/trinity/parser/sources/FileSourceEntry.java", "file_name": "FileSourceEntry.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "95817ca8c6fc64be0db26e20e54972ffd5a0e5c0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/chrisblutz/trinity-legacy-2 | 244 | FILENAME: FileSourceEntry.java | 0.273574 | package com.github.chrisblutz.trinity.parser.sources;
import com.github.chrisblutz.trinity.parser.SourceEntry;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* @author Christopher Lutz
*/
public class FileSourceEntry implements SourceEntry {
private String fileName, filePath;
private String[] lines;
public FileSourceEntry(File file) throws IOException {
fileName = file.getName();
filePath = file.getCanonicalPath();
List<String> lines = new ArrayList<>();
Scanner sc = new Scanner(file);
while (sc.hasNextLine()) {
lines.add(sc.nextLine());
}
sc.close();
this.lines = lines.toArray(new String[lines.size()]);
}
@Override
public String getFileName() {
return fileName;
}
@Override
public String getFilePath() {
return filePath;
}
@Override
public String[] getLines() {
return lines;
}
@Override
public int getStartingLine() {
return 1;
}
}
|
c22afca7-dbb8-41e7-84c8-9dd928539f9b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-28 04:15:19", "repo_name": "deividfsantos/bdd-cucumber-junit", "sub_path": "/src/main/java/com/deividsantos/bdd/service/ClientService.java", "file_name": "ClientService.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "724fa61f4c840ae385496081ff1f838973703d24", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/deividfsantos/bdd-cucumber-junit | 191 | FILENAME: ClientService.java | 0.250913 | package com.deividsantos.bdd.service;
import com.deividsantos.bdd.dto.Client;
import com.deividsantos.bdd.repository.ClientRepository;
import com.deividsantos.bdd.restClient.CountryClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.List;
@Service
public class ClientService {
@Autowired
private ClientRepository clientRepository;
@Autowired
private CountryClient countryClient;
public List<Client> get() throws IOException {
return clientRepository.findAll();
}
public Client get(Integer code) throws Exception {
return clientRepository.find(code);
}
public void insert(Client client) throws IOException {
String countryName = countryClient.getCountryByCode(client.getNationality()).getRestResponse().getResult().getName();
client.setNationality(countryName);
clientRepository.save(client);
}
}
|
4d059654-9a45-4b95-9cc5-dbd77c3f3e4b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-29 15:59:34", "repo_name": "manoj19824/ecommapp", "sub_path": "/src/main/java/com/github/hse24/converter/ProductResourceConverter.java", "file_name": "ProductResourceConverter.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "66c0d0f23efc6616c7735ef835fd3252853910a7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/manoj19824/ecommapp | 205 | FILENAME: ProductResourceConverter.java | 0.287768 | package com.github.hse24.converter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
import org.springframework.stereotype.Component;
import io.jsonwebtoken.lang.Collections;
import com.github.hse24.controller.ProductController;
import com.github.hse24.converter.resource.ProductResource;
import com.github.hse24.entity.Product;
@Component
public class ProductResourceConverter extends ResourceAssemblerSupport<Product, ProductResource> {
@Autowired
private CategoryResourceConverter categoryResourceConverter;
public ProductResourceConverter() {
super(ProductController.class, ProductResource.class);
}
@Override
protected ProductResource instantiateResource(Product entity) {
return new ProductResource(entity.getId(),entity.getName(), Product.CURRENCY, entity.getPrice(),
!Collections.isEmpty(entity.getCategories())
? categoryResourceConverter.toResources(entity.getCategories())
: null);
}
@Override
public ProductResource toResource(Product entity) {
return createResourceWithId(entity.getId(), entity);
}
}
|
9949debf-9492-4b5a-a4c1-99380c5207f2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-07 09:22:09", "repo_name": "TurimarlaSrivani/CG-Assignment", "sub_path": "/inheritance/Accountt.java", "file_name": "Accountt.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "ffc07ba9b5d50c67de20d7275e3e708bef84196f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/TurimarlaSrivani/CG-Assignment | 244 | FILENAME: Accountt.java | 0.27513 | package inheritance;
public class Accountt {
private long accNum;
private double balance;
private Person accHolder;
Accountt(){
}
Accountt(long accNum,double balance,Person accHolder){
this.accNum = accNum;
this.balance=balance;
this.accHolder=accHolder;
}
Accountt(String name,float age,long accNum,double balance,Person accHolder){
super();
this.accNum=accNum;
this.balance=balance;
this.accHolder=accHolder;
}
void deposit(double bal) {
this.balance = balance +bal;
}
void withdraw(double bal) {
this.balance =balance + bal;
}
public long getAccNum() {
return accNum;
}
public void setAccNum(long accNum) {
this.accNum = accNum;
}
public double getBalance() {
return balance;
}
public void setBalance(double balance) {
this.balance = balance;
}
public Person getAccHolder() {
return accHolder;
}
public void setAccHolder(Person accHolder) {
this.accHolder = accHolder;
}
}
|
f53f4e9a-4697-426a-8f73-22534de17089 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-29 10:19:37", "repo_name": "DDTDDTfun/rayact_pc", "sub_path": "/api/src/main/java/com/bra/modules/reserve/service/FieldService.java", "file_name": "FieldService.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "b28a139f606f0d952634816dcd42d1d2667a3eaf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DDTDDTfun/rayact_pc | 220 | FILENAME: FieldService.java | 0.261331 | package com.bra.modules.reserve.service;
import com.bra.common.service.CrudService;
import com.bra.modules.reserve.dao.FieldDao;
import com.bra.modules.reserve.entity.ReserveField;
import com.bra.modules.reserve.entity.ReserveProject;
import com.bra.modules.reserve.entity.ReserveVenue;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* Created by dell on 2016/2/23.
*/
@Service
@Transactional(readOnly = false)
public class FieldService extends CrudService<FieldDao,ReserveField> {
public List<Map<String,Object>> findProjectByField(ReserveField field){
return dao.findProjectByField(field);
}
public List<Map<String,Object>> findFieldByProjectId(String projectId,ReserveVenue venue){
ReserveField field = new ReserveField();
field.setProjectId(projectId);
field.setReserveVenue(venue);
return dao.findFieldByProjectId(field);
}
}
|
37a473a8-151a-4d60-9d49-1908cb5f9bc8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-22 18:56:23", "repo_name": "Vladyslav-Frolov/EPAM_HW_11_0113", "sub_path": "/src/main/java/info/vladyslav/EPAM_HW_11_0113/model/Skill.java", "file_name": "Skill.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "7e4bb8b11bf53fdda1ef7b6e81d8b4f3628393aa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Vladyslav-Frolov/EPAM_HW_11_0113 | 235 | FILENAME: Skill.java | 0.255344 | package info.vladyslav.EPAM_HW_11_0113.model;
import java.util.Objects;
public class Skill {
private Long id;
private String skill;
public Skill() {
}
public Skill(Long id, String skill) {
this.id = id;
this.skill = skill;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getSkill() {
return skill;
}
public void setSkill(String skill) {
this.skill = skill;
}
@Override
public String toString() {
return skill;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Skill skill1 = (Skill) o;
return Objects.equals(id, skill1.id) &&
Objects.equals(skill, skill1.skill);
}
@Override
public int hashCode() {
return Objects.hash(id, skill);
}
}
|
e703612a-e7dc-4150-81b4-36c6aea6e8be | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-12 12:36:08", "repo_name": "altugcagri/boun-swe-574", "sub_path": "/backend/src/test/java/com/fellas/bespoke/controller/UserControllerTest.java", "file_name": "UserControllerTest.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "9a9b7c93864fa6e1230336cc1546496f89e32530", "star_events_count": 7, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/altugcagri/boun-swe-574 | 216 | FILENAME: UserControllerTest.java | 0.280616 | package com.fellas.bespoke.controller;
import com.fellas.bespoke.service.UserService;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
public class UserControllerTest extends AbstractEntityControllerTest {
@Mock
private UserService userService;
@InjectMocks
private final UserController sut = new UserController(userService);
@Test
public void testGetCurrentUser() {
//Test
sut.getCurrentUser(currentUser);
//Verify
verify(userService, times(1)).getCurrentUser(currentUser);
}
@Test
public void testCheckUsernameAvailability() {
//Test
sut.checkUsernameAvailability("email");
//Verify
verify(userService, times(1)).checkUsernameAvailability("email");
}
@Test
public void getGetUserProfile() {
//Test
sut.getUserProfile("username");
//Verify
verify(userService, times(1)).getUserProfileByUserName("username");
}
}
|
b90540e6-2d0e-4fd2-88d8-dc960241bc56 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-17 19:06:01", "repo_name": "novice81/study-aws", "sub_path": "/dynamodb/example-java/src/main/java/study/aws/example/dynamodb/dto/MusicDto.java", "file_name": "MusicDto.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "17cdc049cc9df36ffa82823f05fd6eafebfef4b1", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/novice81/study-aws | 237 | FILENAME: MusicDto.java | 0.250913 | package study.aws.example.dynamodb.dto;
import com.google.common.collect.ImmutableMap;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
import java.util.Map;
public class MusicDto {
public MusicDto(String artist, String songTitle) {
this.artist = artist;
this.songTitle = songTitle;
}
public static MusicDto fromAttributeMap(Map<String, AttributeValue> record) {
return new MusicDto(record.get("Artist").s(), record.get("SongTitle").s());
}
public String getArtist() {
return artist;
}
public void setArtist(String artist) {
this.artist = artist;
}
public String getSongTitle() {
return songTitle;
}
public void setSongTitle(String songTitle) {
this.songTitle = songTitle;
}
public String artist;
public String songTitle;
public Map<String, AttributeValue> toAttributeValues() {
return ImmutableMap.of(
"Artist", AttributeValue.builder().s(getArtist()).build(),
"SongTitle", AttributeValue.builder().s(getSongTitle()).build()
);
}
}
|
e620e68f-81c8-40b6-845a-54b1ed8fbb91 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-06-17 23:49:19", "repo_name": "dianping/cat", "sub_path": "/integration/javaagent-client-agent/cat-client-plugin/src/com/qbao/cat/plugin/common/ThreadPluginTemplate.java", "file_name": "ThreadPluginTemplate.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "130f0fba0bacff1ab17a6402c101aa46d70761bf", "star_events_count": 19076, "fork_events_count": 5869, "src_encoding": "UTF-8"} | https://github.com/dianping/cat | 220 | FILENAME: ThreadPluginTemplate.java | 0.275909 | /**
*
*/
package com.qbao.cat.plugin.common;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import com.dianping.cat.Cat;
import com.dianping.cat.message.Transaction;
import com.qbao.cat.plugin.DefaultPluginTemplate;
/**
* @author andersen
*
*/
@Aspect
public abstract class ThreadPluginTemplate extends DefaultPluginTemplate {
@Override
@Pointcut
public void scope() {}
@Override
@Around(POINTCUT_NAME)
public Object doAround(ProceedingJoinPoint pjp) throws Throwable {
return super.doAround(pjp);
}
@Override
protected Transaction beginLog(ProceedingJoinPoint pjp) {
String className = pjp.getTarget().getClass().getName();
Transaction transaction = Cat.newTransaction("Thread",className);
return transaction;
}
@Override
protected void endLog(Transaction transaction, Object retVal, Object... params) {}
}
|
8f72ace7-a26c-4334-9a8b-2ba3b8d056b6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-21 01:51:30", "repo_name": "bestelapp/api", "sub_path": "/src/main/java/com/fontys/backend/controllers/GroupController.java", "file_name": "GroupController.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "cef705197dd13d12100e1740ffdf9d1ac8972b7a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bestelapp/api | 240 | FILENAME: GroupController.java | 0.276691 | package com.fontys.backend.controllers;
import com.fontys.backend.entities.Group;
import com.fontys.backend.entities.User;
import com.fontys.backend.services.GroupService;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/group")
public class GroupController {
private final GroupService groupService;
public GroupController(GroupService groupService) {
this.groupService = groupService;
}
@RequestMapping("/all")
public List<Group> getAll() {
return groupService.getAll();
}
@RequestMapping("/{id}")
public Group getById(@PathVariable("id") int id) {
return groupService.getById(id);
}
@PostMapping("/create")
public Group create(@RequestBody Group group) {
return groupService.create(group);
}
@PostMapping("/addUser/{id}")
public Boolean addUserToGroup(@PathVariable Integer id, @RequestBody User user) {
return groupService.addUserToGroup(id, user);
}
@PostMapping("/removeUser/{id}")
public Boolean removeUserFromGroup(@PathVariable Integer id, @RequestBody User user) {
return groupService.removeUserFromGroup(id, user);
}
}
|
f04f19ef-6571-490c-a31e-4c096d855c5c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-11 07:03:10", "repo_name": "JINHOUNGHUANG/lineRobot", "sub_path": "/message-object/src/main/java/line/robot/message_object/api/MulticastMessage.java", "file_name": "MulticastMessage.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "3cd0c58e9652faae89d63ea78f372de92f290af9", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/JINHOUNGHUANG/lineRobot | 233 | FILENAME: MulticastMessage.java | 0.282196 | package line.robot.message_object.api;
import java.util.Arrays;
import line.robot.message_object.BaseMessage;
public class MulticastMessage extends BaseApiMessage{
private String[] to;
private BaseMessage[] messages;
public MulticastMessage(String[] to, BaseMessage[] messages) {
super();
this.to = to;
this.messages = messages;
}
public String[] getTo() {
return to;
}
public void setTo(String[] to) {
this.to = to;
}
public BaseMessage[] getMessages() {
return messages;
}
public void setMessages(BaseMessage[] messages) {
this.messages = messages;
}
@Override
public String toString() {
return "{\"to\":" + getToString() + ", \"messages\":" + Arrays.toString(messages) + "}";
}
private String getToString() {
StringBuilder builder = new StringBuilder();
builder.append("[");
for(String str : to) {
builder.append("\"").append(str).append("\",");
}
builder.deleteCharAt(builder.length()-1);
builder.append("]");
return builder.toString();
}
}
|
1b9249c4-d0cf-4226-bf92-f36a5e80ea53 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-07 00:31:35", "repo_name": "mohsine15wal/automation", "sub_path": "/src/main/java/trainingsession/test_PIIT/facelogin.java", "file_name": "facelogin.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "203991b6afce03a6b2f1cb567e382e8b1cf1f1b7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mohsine15wal/automation | 238 | FILENAME: facelogin.java | 0.239349 | package trainingsession.test_PIIT;
import org.openqa.selenium.By;
import org.openqa.selenium.By.ByName;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class facelogin {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\mohsi\\Downloads\\chromedriver_win32\\chromedriver.exe");
WebDriver driver= new ChromeDriver();
driver.get("https://www.facebook.com/");
driver. manage().window().maximize();
driver.findElement(By.name("email"));
WebElement email = driver.findElement(By.name("email"));
WebElement pass = driver.findElement(By.name("pass"));
WebElement sign= driver.findElement(By.name("login"));
WebElement forgot= driver.findElement(By.linkText("Forgot Password?"));
WebElement signbt = driver.findElement(By.xpath("/html/body/div/div/div/div/div/div/div/div/div/form/div/button/"));
email.sendKeys("mohsine15@hotmail.com");
pass.sendKeys("momomo");
sign.click();
//forgot.click();
signbt.click();
}
}
|
0331aa3f-f4e3-49a6-a45f-a5bf53539e3b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-15 10:09:45", "repo_name": "Naouf3l/jwtTestImplementation", "sub_path": "/src/main/java/org/myproject/test/authent/AuthentResource.java", "file_name": "AuthentResource.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "f5fbd6aa383c496f1472467f46eb4ccf3f48552d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Naouf3l/jwtTestImplementation | 181 | FILENAME: AuthentResource.java | 0.247987 | package org.myproject.test.authent;
import org.myproject.test.common.entity.User;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static org.springframework.web.bind.annotation.RequestMethod.POST;
@RestController
@RequestMapping(path = "/authent")
public class AuthentResource {
private final AuthentService service;
public AuthentResource(AuthentService service) {
this.service = service;
}
@RequestMapping(value = "sign-up", method = POST, consumes = "application/json")
public ResponseEntity signUp(@RequestBody User user) {
try{
service.saveAnUser(user);
}catch (final RuntimeException e){
return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
}
return new ResponseEntity<>(user.getLogin(), HttpStatus.OK);
}
} |
1f6f2520-f429-4ad3-ba3e-d6683f342b8f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-21 03:55:41", "repo_name": "DraperHXY/PMIS", "sub_path": "/src/main/java/com/draper/system/service/impl/UserRoleRelationServiceImpl.java", "file_name": "UserRoleRelationServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1074, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "47fe16551089913f5ac233f5d0f305858d8d0a1d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DraperHXY/PMIS | 211 | FILENAME: UserRoleRelationServiceImpl.java | 0.268941 | package com.draper.system.service.impl;
import com.draper.system.dao.UserRoleRelationMapper;
import com.draper.system.entity.UserRoleRelation;
import com.draper.system.service.UserRoleRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class UserRoleRelationServiceImpl implements UserRoleRelationService {
@Autowired
private UserRoleRelationMapper userRoleRelationMapper;
@Override
public void correlate(UserRoleRelation relation) {
userRoleRelationMapper.correlate(relation);
}
@Override
public void unCorrelate(long userId, long roleId) {
userRoleRelationMapper.unCorrelate(userId, roleId);
}
@Override
public List<UserRoleRelation> selectUserRoles(long userId) {
return userRoleRelationMapper.selectUserRoles(userId);
}
@Override
public List<UserRoleRelation> selectUsersFromRole(long roleId) {
return userRoleRelationMapper.selectUsersFromRole(roleId);
}
}
|
bcf08bb7-8d17-41d0-8196-694b03ea15bb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-11-16 11:06:33", "repo_name": "tectronics/nandana", "sub_path": "/NandanaModel/src/main/java/org/dairy/farms/interceptor/hibernate/AuditListener.java", "file_name": "AuditListener.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "35cfe5de707f9b148e81e29158a84bd58c568a99", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tectronics/nandana | 256 | FILENAME: AuditListener.java | 0.271252 | package org.dairy.farms.interceptor.hibernate;
import org.dairy.farms.model.AuditInfo;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import java.util.Date;
/**
* Created by IntelliJ IDEA.
* User: gduggirala
* Date: Jun 13, 2011
* Time: 8:24:31 PM
*/
public class AuditListener {
@PrePersist
public void prePersist(Object obj){
if(obj instanceof Auditable){
AuditInfo auditInfo = ((Auditable) obj).getAuditInfo();
if(auditInfo == null){
auditInfo = new AuditInfo();
}
auditInfo.setCreatedBy(1l);
auditInfo.setModifiedBy(1l);
auditInfo.setDateCreated(new Date());
auditInfo.setDateModified(new Date());
}
}
@PreUpdate
public void preUpdate(Object obj){
if(obj instanceof Auditable){
AuditInfo auditInfo = ((Auditable) obj).getAuditInfo();
if(auditInfo == null){
auditInfo = new AuditInfo();
}
auditInfo.setModifiedBy(1l);
auditInfo.setDateModified(new Date());
}
}
}
|
2f9b32f1-5576-4c46-8e49-ca33c197ae04 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-31 14:58:21", "repo_name": "matsuli/Dark_Seals", "sub_path": "/games/Dark seals/src/Bullet.java", "file_name": "Bullet.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "a4c8264157ae3c1290e2ae861de018dc6bb173b6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "ISO-8859-1"} | https://github.com/matsuli/Dark_Seals | 343 | FILENAME: Bullet.java | 0.280616 | import processing.core.*;
public class Bullet extends PApplet { //samma som i processing, men det finns BARA EN SORTS BULLETS. Ingen skild ebullet för enemies, de skjuter samma bullets.
PVector location; //Därmed finns också bara en bullets arraylist. detta är möjligt genom att det finns bara en shoot-metod, som både player och enemies kan använda (se "actor")
float radius=5;
float oldPosX, oldPosY, rotation, speed;
boolean toRemove=false;
actor shooter;
Bullet(actor shooter, float targetPosX, float targetPosY) {
this.shooter=shooter;
location= new PVector(shooter.location.x, shooter.location.y);
oldPosX = targetPosX;
oldPosY = targetPosY;
rotation = atan2(oldPosY - location.y, oldPosX - location.x) / PI * 180;
speed = 15;
}
void update() {
location.x = location.x + cos(rotation/180*PI)*speed-(player.playerX-player.pplayerX.get(18));
location.y = location.y + sin(rotation/180*PI)*speed-(player.playerY-player.pplayerY.get(18));
if (location.x > 0 && location.x < 1000 && location.y > 0 && location.y < 1000 && toRemove==false) {
} else {
Processing.bullets.remove(this); //removar denna bullet
}
}
}
|
e8b08bed-b6b8-4474-81a0-ecd01fe6acf6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-10-30 16:09:41", "repo_name": "seusofthd/Hydra", "sub_path": "/HydraCloud/src/com/symlab/hydracloud/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "6758a769ed2d765f80f3d2589f3aad5f3694fec1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/seusofthd/Hydra | 242 | FILENAME: MainActivity.java | 0.264358 | package com.symlab.hydracloud;
import com.symlab.hydra.IOffloadingService;
import hk.ust.symlab.hydra.network.cloud.Main;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
RunVMClient();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
public void RunVMClient() {
new Thread(){
public void run() {
CloudService cloudService = new CloudService(MainActivity.this);
cloudService.makeconnection();
};
}.start();
}
}
|
531b1945-4dfe-4864-b44e-75f530bafef9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-30 10:20:46", "repo_name": "wzhongke/spring", "sub_path": "/spring-learn/src/test/java/annotation/AnnotationTest.java", "file_name": "AnnotationTest.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "0ee218995cb4c969ca0dc9651a45ccf635010a61", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wzhongke/spring | 183 | FILENAME: AnnotationTest.java | 0.246533 | package annotation;
import examples.annotation.Annotation;
import examples.component.MyService;
import examples.bean.instantiating.ExampleBean;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:annotation.xml"})
public class AnnotationTest {
@Autowired
Annotation annotation;
@Test
public void testAnnotation() {
System.out.println(annotation.getNoPrimary());
}
@Autowired
@Qualifier("protected")
private ExampleBean exampleBean;
@Test
public void testComponent () {
System.out.println(exampleBean);
}
@Autowired
private MyService service;
@Test
public void testNameGenerator () {
System.out.println(service.getBeanName());
}
}
|
31ec5773-1b20-43e4-89ca-38035f3c2d3f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-26 12:07:40", "repo_name": "DimaRyazanov/VotingRestaurantSystem", "sub_path": "/src/main/java/ru/votingsystem/auth/AuthorizedUser.java", "file_name": "AuthorizedUser.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "6372d459479628a43dfd3f606639fcac4c80daf2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DimaRyazanov/VotingRestaurantSystem | 224 | FILENAME: AuthorizedUser.java | 0.236516 | package ru.votingsystem.auth;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import ru.votingsystem.model.User;
import java.util.ArrayList;
import java.util.Collection;
public class AuthorizedUser implements UserDetails {
private User user;
public AuthorizedUser(User user) {
this.user = user;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return new ArrayList<GrantedAuthority>(user.getRoles());
}
@Override
public String getPassword() {
return user.getPassword();
}
@Override
public String getUsername() {
return user.getEmail();
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return user.isEnabled();
}
public User getUser() {
return user;
}
}
|
4f9f4c6e-9056-44d6-84a7-887d84af279c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-03 16:17:40", "repo_name": "geonyeongkim/kaggle-stackoverflow-api", "sub_path": "/src/main/java/com/skuniv/cs/geonyeong/kaggleapi/vo/Question.java", "file_name": "Question.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "5619e2a82dd6064f9fa9b4327f45b916ee15c066", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/geonyeongkim/kaggle-stackoverflow-api | 270 | FILENAME: Question.java | 0.262842 | package com.skuniv.cs.geonyeong.kaggleapi.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.skuniv.cs.geonyeong.kaggleapi.vo.meta.QnAMeta;
import java.util.List;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Question extends QnAMeta {
private String id;
private String title;
private Integer answerCount;
private Integer favoriteCount;
private Integer viewCount;
@Builder
public Question(String body, String createDate, Integer score, Account account,
Integer commentCount, String tags, List<Comment> commentList, List<Link> linkList,
QnaJoin qnaJoin, String id, String title, Integer answerCount, Integer favoriteCount,
Integer viewCount) {
super(body, createDate, score, account, commentCount, tags, commentList, linkList, qnaJoin);
this.id = id;
this.title = title;
this.answerCount = answerCount;
this.favoriteCount = favoriteCount;
this.viewCount = viewCount;
}
}
|
f6942948-0267-4031-88d9-b0cd142201bd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-20 15:47:12", "repo_name": "lmpanalytics/sp-control", "sub_path": "/pc_processing-web/src/main/java/com/tetrapak/processing/parts_control/beans/LogicClient.java", "file_name": "LogicClient.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "47742786254a0faa88bb3657e13f8257528fb8e8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lmpanalytics/sp-control | 244 | FILENAME: LogicClient.java | 0.289372 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.tetrapak.processing.parts_control.beans;
import com.tetrapak.processing.parts_control.pc_logic_ejb.Logic;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.inject.Named;
/**
* Returns logic from the ejb 'LogicBean' doing the business logic processing
*
* @author SEPALMM
*/
@Named(value = "logicClient")
@Stateless
public class LogicClient {
@EJB
private Logic logicBean;
// Properties to be returned to the jsf page
private String footerMessage;
// Constructor
public LogicClient() {
}
// Initialize properties and methods (sequencial order is important)
@PostConstruct
public void init() {
}
public String getFooterMessage() {
footerMessage = logicBean.getMessage();
return footerMessage;
}
public void setFooterMessage(String footerMessage) {
this.footerMessage = footerMessage;
}
}
|
993e8fd0-78b1-4377-be7d-6195aa1985a9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-04-09T10:54:32", "repo_name": "ddgcarbayo/openpandemic-app", "sub_path": "/CONTRIBUTING.md", "file_name": "CONTRIBUTING.md", "file_ext": "md", "file_size_in_byte": 1054, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "9b54dace651bee25ec0db16b258035cc2576cd41", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ddgcarbayo/openpandemic-app | 240 | FILENAME: CONTRIBUTING.md | 0.194368 | # Getting Started
First, create a fork of the [openpandemic-app](https://github.com/OpenPandemic/openpandemic-app) repo from master by hitting the `fork` button on the GitHub page.
Next, clone your fork onto your computer with this command (replacing YOUR_USERNAME with your actual GitHub username)
```git@github.com:openpandemic/openpandemic-app.git
git clone git@github.com:YOUR_USERNAME/openpandemic-app.git
```
Once cloning is complete, change directory to the repo.
```
cd openpandemic-app
```
# Set up the development environment
Run the following command.
```
npm install
```
This will download and install all packages needed.
# Steps
* In your fork, make the changes.
* If you've changed features, update the documentation.
* Make sure your code lints.
* Make the pull request!
We recommend using an IDE or editor with an eslint plugin in order to streamline the development process. Plugins are available for all the popular editors. For more information see [ESLint Integrations](https://eslint.org/docs/user-guide/integrations)
|
630100f8-e81d-4739-9fdf-06e5ec9c224f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-10 14:04:50", "repo_name": "igloo-project/igloo-parent", "sub_path": "/igloo/igloo-components/igloo-component-jpa/src/main/java/org/iglooproject/jpa/business/generic/model/migration/MigratedFromOldApplicationGenericEntity.java", "file_name": "MigratedFromOldApplicationGenericEntity.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "efd1755feceb18102937d7f6b0b40bce605dd18c", "star_events_count": 20, "fork_events_count": 6, "src_encoding": "UTF-8"} | https://github.com/igloo-project/igloo-parent | 238 | FILENAME: MigratedFromOldApplicationGenericEntity.java | 0.277473 | package org.iglooproject.jpa.business.generic.model.migration;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import org.iglooproject.jpa.business.generic.model.PredefinedIdGenericEntity;
/**
* This class should only be used as a temporary measure to migrate entities from an old application
* to a new one.
*
* It allows us to keep the old id as the new id.
*
* @see MigratedFromOldApplicationSequenceGenerator
*/
@MappedSuperclass
public abstract class MigratedFromOldApplicationGenericEntity<K extends Serializable & Comparable<K>, E extends PredefinedIdGenericEntity<K, E>>
extends PredefinedIdGenericEntity<K, E> implements IMigratedFromOldApplicationEntity<K> {
private static final long serialVersionUID = 2034570162020079499L;
@Column(nullable = false)
private boolean migrated = false;
@Override
public boolean isMigrated() {
return migrated;
}
@Override
public void setMigrated(boolean migrated) {
this.migrated = migrated;
}
}
|
9a58c98a-8239-48cf-80ba-7dcafe14be82 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-15 09:30:35", "repo_name": "BRHSM/JAVADB", "sub_path": "/JavaDB/src/DataBase/Room.java", "file_name": "Room.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "715fbd1b6ad1d3e59e653e602af59c3a87ab0178", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/BRHSM/JAVADB | 290 | FILENAME: Room.java | 0.284576 | package DataBase;
public class Room {
private String name;
private int maxPersons;
private float hCost;
private float cost;
private int roomId;
public Room(String name, int maxPersons,float hCost2,float cost2) {
this.name = name;
this.maxPersons = maxPersons;
this.hCost = hCost2;
this.cost = cost;
}
public Room(String name, int maxPersons,float hCost2,float cost2,int roomId) {
this.name = name;
this.maxPersons = maxPersons;
this.hCost = hCost2;
this.cost = cost;
this.roomId=roomId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getMaxPersons() {
return maxPersons;
}
public void setMaxPersons(int maxPersons) {
this.maxPersons = maxPersons;
}
public float gethCost() {
return hCost;
}
public void sethCost(int hCost) {
this.hCost = hCost;
}
public float getCost() {
return cost;
}
public void setCost(int cost) {
this.cost = cost;
}
public int getRoomId() {
return roomId;
}
public void setRoomId(int roomId) {
this.roomId = roomId;
}
}
|
b24ceedf-91db-465a-af71-3606dbc52aee | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-01 02:46:25", "repo_name": "claudioed/docker-aws-devry", "sub_path": "/product/src/main/java/product/domain/resource/ProductResource.java", "file_name": "ProductResource.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "a4dc196bbc84a1db0c0095cd3c0a677e5c6622a9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/claudioed/docker-aws-devry | 219 | FILENAME: ProductResource.java | 0.272799 | package product.domain.resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import product.domain.model.Product;
import product.domain.repository.ProductRepository;
import product.domain.resource.model.NewProduct;
/**
* Created by claudio on 27/06/17.
*/
@RestController
@RequestMapping("/api/product")
public class ProductResource {
private final ProductRepository productRepository;
@Autowired
public ProductResource(ProductRepository productRepository) {
this.productRepository = productRepository;
}
@PostMapping
public ResponseEntity<Product> newOne(NewProduct newProduct){
return ResponseEntity.status(201).body(this.productRepository.save(Product.builder().product(newProduct).build()));
}
@GetMapping("/{id}")
public ResponseEntity<Product> one(@PathVariable("id") String id){
return ResponseEntity.status(200).body(this.productRepository.findOne(id));
}
@GetMapping
public ResponseEntity<Iterable<Product>> products(){
return ResponseEntity.status(200).body(this.productRepository.findAll());
}
}
|
82c8f8d2-fcf4-45d0-b1c7-3733c1aa7667 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-30 17:47:57", "repo_name": "jffp113/ASD-Distributed-Publish-Subscriber-System", "sub_path": "/src/main/java/protocols/multipaxos/messages/AcceptOperationMessage.java", "file_name": "AcceptOperationMessage.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "465e766db9101f45b2f9633b3d5cc3c9462d2151", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jffp113/ASD-Distributed-Publish-Subscriber-System | 219 | FILENAME: AcceptOperationMessage.java | 0.279828 | package protocols.multipaxos.messages;
import babel.protocol.event.ProtocolMessage;
import io.netty.buffer.ByteBuf;
import network.ISerializer;
import protocols.multipaxos.Operation;
import java.io.Serializable;
import java.net.UnknownHostException;
public class AcceptOperationMessage extends ProtocolMessage implements Serializable {
public final static short MSG_CODE = 26;
private Operation operation;
public AcceptOperationMessage(Operation operation) {
super(MSG_CODE);
this.operation = operation;
}
public static final ISerializer<AcceptOperationMessage> serializer = new ISerializer<AcceptOperationMessage>() {
@Override
public void serialize(AcceptOperationMessage m, ByteBuf out) {
m.operation.serialize(out);
}
@Override
public AcceptOperationMessage deserialize(ByteBuf in) throws UnknownHostException {
return new AcceptOperationMessage(Operation.deserialize(in));
}
@Override
public int serializedSize(AcceptOperationMessage m) {
return m.operation.serializedSize();
}
};
public Operation getOperation() {
return operation;
}
}
|
689fa42c-992a-46f7-ab99-95f52997f643 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-04T05:42:02", "repo_name": "Earthmark/Korriban", "sub_path": "/runtime/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1094, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "1852b1345b3e13f446c0835f6d774f58ffa6ef19", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Earthmark/Korriban | 230 | FILENAME: README.md | 0.288569 | # Korriban Runtime
## The core runtime dependency chain
Field Reservation (type agnostic)
Scheduling information. Contains field indexes.
Indexes element reservations to field sets.
Defines active interdependency set
DOES NOT DEFINE FIELDS ON ELEMENTS (only between).
Says what exit properties go where (and if they should (binding chain)).
Asked during update loop.
Used by scheduler for interdependecy data? Possibly is scheduler?
Prop Set (strong type) - Data storage, requires fast R/W.
Very dumb data storage.
Delta frame based.
Element - Reserves field indicies, R/W to storage quickly.
Asks reservation for I/O
Prepares binding sites
More to insert here as layers come online.
Invokes body
Element reserves by asking Field Reservation for index, then strong typing R/W to prop set trait.
Wasm Element interface - Map from field reservation index to local index for each type (set is primary keyed by type to compiler switches).
Reference types only make sense in the context of another module.
What makes a reference type?
|
6b4d8e52-d9c9-40c0-b140-67c1d980d09e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-01 10:05:12", "repo_name": "Zaaim-Halim/Hadoop-Mapreduce", "sub_path": "/PallindromWordCount/src/zaaim/halim/PallindromMapper.java", "file_name": "PallindromMapper.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "198f1f956a904678cbf8aca5b9e0068e2222cf1a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Zaaim-Halim/Hadoop-Mapreduce | 229 | FILENAME: PallindromMapper.java | 0.292595 | package zaaim.halim;
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
public class PallindromMapper extends Mapper<LongWritable, Text, Text, IntWritable>{
private Text pallindromWord = new Text();
public void map(LongWritable key, Text value, Context context
) throws IOException, InterruptedException {
StringTokenizer itr = new StringTokenizer(value.toString());
while (itr.hasMoreTokens()) {
String word = itr.nextToken().trim();
if(word.equals(inversedWord(word)))
{
pallindromWord.set(word);
context.write(pallindromWord,new IntWritable(1));
}
}
}
private String inversedWord(String word) {
String inversedWord = "";
for(int i = word.length()-1; i >= 0; i--)
{
inversedWord = inversedWord + word.charAt(i);
}
return inversedWord.trim();
}
}
|
68dc89e7-1bca-40de-b921-67beb0a97aad | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-16 16:27:12", "repo_name": "pvtrieulh/thay_hung", "sub_path": "/demo/src/main/java/com/example/demo/controller/KhachHangController.java", "file_name": "KhachHangController.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "797cf24fcf7a1a8fa8c78ecf3b0704364494c7a0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pvtrieulh/thay_hung | 253 | FILENAME: KhachHangController.java | 0.282988 | package com.example.demo.controller;
import com.example.demo.dao.KhachhangDAO;
import com.example.demo.dto.KhachHangDTO;
import com.example.demo.model.KhachHang;
import com.example.demo.model.Phong;
import com.example.demo.repository.KhachHangRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@Controller
@RequestMapping("khach-hang")
public class KhachHangController {
@Autowired
KhachHangRepository khachhangRepository;
@Autowired
KhachhangDAO khachhangDAO;
@PostMapping("/add")
public ResponseEntity<KhachHang> addKhachHang(@RequestBody KhachHangDTO khachHang){
Boolean check = khachhangDAO.addKhachHang(khachHang);
if (check) return new ResponseEntity("Success", HttpStatus.ACCEPTED);
else return new ResponseEntity("Fail", HttpStatus.BAD_REQUEST);
}
@GetMapping("/search")
public ResponseEntity<KhachHang> searchKhachhang(@RequestParam String value){
return new ResponseEntity(khachhangDAO.searchKhachhang(value), HttpStatus.OK);
}
} |
d660ad9e-e794-4e71-921c-9894403f720b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-18 09:13:54", "repo_name": "woshikid/spring-mvc", "sub_path": "/src/main/java/com/github/woshikid/mvc/utils/ShiroCache.java", "file_name": "ShiroCache.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "cc5c1d7b92fcdf058f0119025e35f8b0b9d0b6ae", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/woshikid/spring-mvc | 233 | FILENAME: ShiroCache.java | 0.255344 | package com.github.woshikid.mvc.utils;
import java.util.Collection;
import java.util.Set;
import org.apache.shiro.cache.CacheException;
import org.springframework.cache.Cache;
import org.springframework.cache.support.SimpleValueWrapper;
@SuppressWarnings("rawtypes")
public class ShiroCache implements org.apache.shiro.cache.Cache {
private Cache cache;
public ShiroCache(Cache cache) {
this.cache = cache;
}
public Object get(Object key) throws CacheException {
Object value = cache.get(key);
if (value instanceof SimpleValueWrapper) {
return ((SimpleValueWrapper)value).get();
} else {
return value;
}
}
public Object put(Object key, Object value) throws CacheException {
cache.put(key, value);
return null;
}
public Object remove(Object key) throws CacheException {
cache.evict(key);
return null;
}
public void clear() throws CacheException {
cache.clear();
}
public int size() {
throw new UnsupportedOperationException();
}
public Set keys() {
throw new UnsupportedOperationException();
}
public Collection values() {
throw new UnsupportedOperationException();
}
}
|
a29ab0c1-07b6-4042-b6fb-909fc40f26f1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-04 18:10:53", "repo_name": "CrazyRussian6/LeasingProjectBackEnd", "sub_path": "/src/main/java/lt/swedbank/itacademy/ItAkaLeasingSystemBackEnd/beans/response/BusinessCustomerResponse.java", "file_name": "BusinessCustomerResponse.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "5eeb4a8773742a5d523fb55a91fd06311c7dba4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CrazyRussian6/LeasingProjectBackEnd | 235 | FILENAME: BusinessCustomerResponse.java | 0.250913 | package lt.swedbank.itacademy.ItAkaLeasingSystemBackEnd.beans.response;
import lt.swedbank.itacademy.ItAkaLeasingSystemBackEnd.beans.documents.BusinessCustomer;
/**
* Created by Lukas on 2018-03-20.
*/
public class BusinessCustomerResponse extends CustomerResponse{
private String companyID;
private String companyName;
public BusinessCustomerResponse() {
}
public BusinessCustomerResponse(BusinessCustomer businessCustomer) {
super(businessCustomer.getId().toString(), businessCustomer.getEmail(),
businessCustomer.getPhoneNumber(), businessCustomer.getAddress(),
businessCustomer.getCustomerType().toString(), businessCustomer.getCountry(),
businessCustomer.getUserID());
this.companyID = businessCustomer.getCompanyID();
this.companyName = businessCustomer.getCompanyName();
}
public String getCompanyID() {
return companyID;
}
public void setCompanyID(String companyID) {
this.companyID = companyID;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
}
|
51044752-e85f-4193-9e8a-24e46851b066 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-05 23:20:27", "repo_name": "gibahjoe/springdoc-param-customizer", "sub_path": "/src/test/java/com/devappliance/springdocparamcustomizer/operationcustomizer/QChildEntity.java", "file_name": "QChildEntity.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "a9924c4d27f8671138677bf71a5119580982bd0d", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gibahjoe/springdoc-param-customizer | 231 | FILENAME: QChildEntity.java | 0.258326 | package com.devappliance.springdocparamcustomizer.operationcustomizer;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.PathMetadata;
import com.querydsl.core.types.dsl.EntityPathBase;
import com.querydsl.core.types.dsl.NumberPath;
import static com.querydsl.core.types.PathMetadataFactory.forVariable;
/**
* @author Gibah Joseph
* Email: gibahjoe@gmail.com
* Mar, 2020
**/
public class QChildEntity extends EntityPathBase<ChildEntity> {
public static final QChildEntity childEntity = new QChildEntity("childEntity");
private static final long serialVersionUID = -1184258693L;
public final NumberPath<Long> id = createNumber("id", Long.class);
public QChildEntity(String variable) {
super(ChildEntity.class, forVariable(variable));
}
public QChildEntity(Path<? extends ChildEntity> path) {
super(path.getType(), path.getMetadata());
}
public QChildEntity(PathMetadata metadata) {
super(ChildEntity.class, metadata);
}
}
|
74d8f972-baca-4aef-84ea-f3a61a2eeea5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-18 11:58:03", "repo_name": "xiaozhukai/WeChat", "sub_path": "/wechat/src/main/java/com/wechat/auth/service/impl/UserServiceImpl.java", "file_name": "UserServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1171, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "af1f29ff91b840bb89d259d4504b60d31a9c3090", "star_events_count": 5, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xiaozhukai/WeChat | 233 | FILENAME: UserServiceImpl.java | 0.240775 | package com.wechat.auth.service.impl;
import com.wechat.auth.dao.UserDao;
import com.wechat.auth.pojo.User;
import com.wechat.auth.service.UserService;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* Created by 30825 on 2017/5/18.
*/
@Service
@Transactional
public class UserServiceImpl implements UserService {
@Resource
private UserDao userDao;
@Override
public User boundUser(JSONObject userInfo) {
long count = userDao.getCount();
System.out.println(count);
//User user = userDao.findDistinctByOpenId(userInfo.getString("openid"));
String nickName1 = userDao.findnickNameDistinctByOpenId(userInfo.getString("openid"));
System.out.println(nickName1);
//为空说明没有绑定使用账号密码条件进行绑定
if(nickName1 == null){
String nickName = userInfo.getString("nickname");
String openId = userInfo.getString("openid");
userDao.updateUser(nickName,openId);
}
return new User();
}
}
|
41f0ae6b-00ce-4803-97dd-96e3e96a7d66 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-11 02:43:35", "repo_name": "adench/AndroidProjectBase", "sub_path": "/baselibrary/src/main/java/com/xqkj/baselibrary/weight/NoScrollViewPager.java", "file_name": "NoScrollViewPager.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "5f336f0555260fc6afb313ab2e51160aba209534", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/adench/AndroidProjectBase | 212 | FILENAME: NoScrollViewPager.java | 0.218669 | package com.xqkj.baselibrary.weight;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import androidx.viewpager.widget.ViewPager;
public class NoScrollViewPager extends ViewPager {
// 是否禁止 viewpager 左右滑动
private boolean noScroll = true;
public NoScrollViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
public void setNoScroll(boolean noScroll) {
this.noScroll = noScroll;
}
@Override
public boolean onTouchEvent(MotionEvent arg0) {
if (noScroll){
return false;
}else{
return super.onTouchEvent(arg0);
}
}
@Override
public boolean onInterceptTouchEvent(MotionEvent arg0) {
if (noScroll){
return false;
}else{
return super.onInterceptTouchEvent(arg0);
}
}
@Override
public void setCurrentItem(int item) {
super.setCurrentItem(item,false);
}
} |
058a0905-c963-423c-8033-37f3c40f63a3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-30 06:14:34", "repo_name": "jadeshelton/Weather-Map", "sub_path": "/src/main/java/com/jade/shelton/weather_map/domain/WeatherHourly.java", "file_name": "WeatherHourly.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "8e8b0d866e398cfb741c488c8f140af8ac297d2a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jadeshelton/Weather-Map | 275 | FILENAME: WeatherHourly.java | 0.281406 | package com.jade.shelton.weather_map.domain;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
public class WeatherHourly {
@JsonProperty("response")
private ResponseHourly response;
@JsonProperty("hourly_forecast")
private List<HourlyForecast> hourlyForecast;
private String url = "";
WeatherHourly() {
}
WeatherHourly(String apiKey) {
url += Weather.BASE_URL + apiKey + "/hourly/q/";
}
public String setParamsReturnUrl(String location) {
String encodedUrl = null;
try {
encodedUrl = URLEncoder.encode(location, "UTF-8").replace("+", "%20");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
url += encodedUrl + ".json";
return url;
}
public ResponseHourly getResponse() {
return response;
}
public void setResponse(ResponseHourly input) {
this.response = input;
}
public List<HourlyForecast> getHourlyForecast() {
return hourlyForecast;
}
public void setHourlyForecast(List<HourlyForecast> input) {
this.hourlyForecast = input;
}
}
|
64200484-819c-4e10-bb4e-35c4062726e8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-04 03:21:53", "repo_name": "KimKyeongCheol/GMS-maria", "sub_path": "/src/com/gms/web/util/Separator.java", "file_name": "Separator.java", "file_ext": "java", "file_size_in_byte": 1005, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "9d5f7c5f88b708e974dd13247d8dae3bcf9aac44", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/KimKyeongCheol/GMS-maria | 201 | FILENAME: Separator.java | 0.272799 | package com.gms.web.util;
import javax.servlet.http.HttpServletRequest;
import com.gms.web.command.Command;
import com.gms.web.factory.CommandFactory;
public class Separator {
public static Command cmd=new Command();
public static void init(HttpServletRequest request){
/*String action=request.getParameter("action");
String page=request.getParameter("page");
System.out.println("action : "+action);
String servletPath=request.getServletPath();
System.out.println("servletPath :" + servletPath);
String dir=servletPath.substring(1,servletPath.indexOf("."));
System.out.println("directory: " + dir);
System.out.println("page:"+ page);*/
String servletPath=request.getServletPath();
cmd=CommandFactory.createCommand(
servletPath.substring(1,servletPath.indexOf(".")),
request.getParameter("action"),
request.getParameter("page"),
request.getParameter("pageNumber"),
request.getParameter("column"),
request.getParameter("search"));
}
}
|
4498e7f4-2590-4873-bdb1-ff3cbceae742 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-31 04:20:36", "repo_name": "krkchaitanya/springRevamp", "sub_path": "/src/main/java/com/samplePojos/TechFrameworks.java", "file_name": "TechFrameworks.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "36775c3ad63fef3ffa31572ce29f123b3009b22a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/krkchaitanya/springRevamp | 209 | FILENAME: TechFrameworks.java | 0.214691 | package com.samplePojos;
public class TechFrameworks {
private String name;
private String developmentPhase;
private Number version;
public TechFrameworks(String name, String developmentPhase, Number version) {
this.name = name;
this.developmentPhase = developmentPhase;
this.version = version;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDevelopmentPhase() {
return developmentPhase;
}
public void setDevelopmentPhase(String developmentPhase) {
this.developmentPhase = developmentPhase;
}
public Number getVersion() {
return version;
}
public void setVersion(Number version) {
this.version = version;
}
@Override
public String toString() {
return "TechFrameworks{" +
"name='" + name + '\'' +
", developmentPhase='" + developmentPhase + '\'' +
", version=" + version +
'}';
}
}
|
a2e4f976-0fdd-4461-9292-fb7c5c3dc34a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-30 08:52:42", "repo_name": "KleinDevDE/TwitchBot", "sub_path": "/server/src/main/java/de/kleindev/twitchbot/configuration/TwitchBotConfiguration.java", "file_name": "TwitchBotConfiguration.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "887e76b80ca606bf57044fc8e217e93c51cb63eb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/KleinDevDE/TwitchBot | 206 | FILENAME: TwitchBotConfiguration.java | 0.23231 | package de.kleindev.twitchbot.configuration;
import com.google.inject.Binder;
import com.google.inject.Module;
import java.io.File;
public class TwitchBotConfiguration extends Config implements Module {
private File file;
@Override
public File getFile() {
return file;
}
@ConfigPath(path = "application.logType", description = "LogTypes: NORMAL, DEBUG, TRACE")
public String logType = "NORMAL";
// @ConfigPath(path = "application.pluginsFolder")
// public String pluginsFolder = "plugins";
@ConfigPath(path = "application.logsFolder")
public String logsFolder = "logs";
// @ConfigPath(path = "application.connectionsFolder")
// public String connectionsFolder = "connections";
public TwitchBotConfiguration(File file){
if (!file.getParentFile().exists())
file.getParentFile().mkdirs();
this.file = file;
load();
}
@Override
public void configure(Binder binder) {
}
}
|
1b47eba4-d1ff-4a1c-95d6-4bdef868e57f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-13 15:41:39", "repo_name": "OscarPrediction1/bettingOddsCrawler", "sub_path": "/de.coins2015.oscar1.bettingoddscrawler/src/main/java/de/coins2015/oscar1/bettingoddscrawler/MongoDBHandler.java", "file_name": "MongoDBHandler.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "8f266f3ca40adde195ecc39f36a656cfa6a5b989", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/OscarPrediction1/bettingOddsCrawler | 205 | FILENAME: MongoDBHandler.java | 0.268941 | package de.coins2015.oscar1.bettingoddscrawler;
import java.util.Arrays;
import org.json.simple.JSONObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import com.mongodb.util.JSON;
public class MongoDBHandler {
private MongoClient mongoClient;
private MongoCredential mongoCredential;
private DB db;
public MongoDBHandler(String host, String port, String userName,
String database, String password) {
this.mongoCredential = MongoCredential.createCredential(userName,
database, password.toCharArray());
this.mongoClient = new MongoClient(new ServerAddress(host),
Arrays.asList(mongoCredential));
this.db = mongoClient.getDB(database);
}
public void storeData(JSONObject data, String collection) {
DBObject dbObject = (DBObject) JSON.parse(data.toJSONString());
DBCollection dbCollection = db.getCollection(collection);
dbCollection.insert(dbObject);
}
}
|
f6fe4512-9ede-4add-ac11-fbee4bf9d9fa | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-01 04:36:37", "repo_name": "Taylerlm/gitRepository", "sub_path": "/leyou/ly-search/ly-search-service/src/main/java/com/leyou/lmhitysu/search/controller/SearchController.java", "file_name": "SearchController.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "28b954e0aa68090e16fa103315651b448d9201c0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Taylerlm/gitRepository | 207 | FILENAME: SearchController.java | 0.258326 | package com.leyou.lmhitysu.search.controller;
import com.leyou.lmhitysu.common.PageResult;
import com.leyou.lmhitysu.search.model.Goods;
import com.leyou.lmhitysu.search.model.SearchRequest;
import com.leyou.lmhitysu.search.service.ISearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
@Controller
@RequestMapping(value = "elastic")
public class SearchController {
@Autowired
private ISearchService searchService;
@RequestMapping(value = "page")
public ResponseEntity<PageResult<Goods>> search(@RequestBody SearchRequest searchRequest){
PageResult<Goods> list = this.searchService.searchGoods(searchRequest);
if(list == null){
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
return ResponseEntity.ok(list);
}
}
|
943bc822-189e-4544-89c1-21e394b0499a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-20 23:02:19", "repo_name": "elisabetb/atlas", "sub_path": "/gxa/src/test/java/uk/ac/ebi/atlas/utils/DBSolrStatusControllerIT.java", "file_name": "DBSolrStatusControllerIT.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "566a9a8d7bdd8906ea737d5a4268ed4353c12677", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/elisabetb/atlas | 203 | FILENAME: DBSolrStatusControllerIT.java | 0.250913 | package uk.ac.ebi.atlas.utils;
import com.google.gson.Gson;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import javax.inject.Inject;
import java.util.Map;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml", "/dispatcher-servlet.xml"})
public class DBSolrStatusControllerIT {
@Inject
private DBSolrStatusController subject;
@Test
public void dbAndSolrStatus() throws Exception {
String message = subject.dbAndSolrStatus();
Map<String, String> status = new Gson().fromJson(message, Map.class);
assertThat(status.get("DB"), is("UP"));
assertThat(status.get("Solr"), is("UP"));
}
} |
7032371f-c69d-4e40-a9bf-d65163ab8cf3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-13 02:51:23", "repo_name": "Eternally8/springboot-hjz", "sub_path": "/springCloudAlibaba/nacos-consumer/src/main/java/com/hjz/controller/ConsumerController.java", "file_name": "ConsumerController.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "920f4c53c650ab1edceb48a8f076792aa105756a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Eternally8/springboot-hjz | 225 | FILENAME: ConsumerController.java | 0.200558 | package com.hjz.controller;
import com.hjz.model.StudentVo;
import com.hjz.service.NacosProviderFeignClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@Api(tags = "nacosProvider对外接口")
@RestController
@RequestMapping("/nconsumer")
public class ConsumerController {
@Autowired
private NacosProviderFeignClient nacosProviderFeignClient;
@ApiOperation(value = "调用消费", notes = "通过feign调用nacos-provider接口")
@GetMapping(value = "/nconsumerTest")
public StudentVo nconsumerTest() {
StudentVo vo = new StudentVo();
vo.setAge(1);
vo.setName("lalalala");
vo.setId(1);
StudentVo studentVo = nacosProviderFeignClient.getData(vo);
return studentVo;
}
}
|
ca25f88a-aab5-4fd0-8a9d-21dc98047a6c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-13 14:13:21", "repo_name": "vinayp20/Android-Nanodegree-Projects-Udacity", "sub_path": "/Tour guide/app/src/main/java/com/example/android/myapplication6/HistoricalPlaces.java", "file_name": "HistoricalPlaces.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "cce417afb8522cc6372f1ba5af58aa17944407ba", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vinayp20/Android-Nanodegree-Projects-Udacity | 197 | FILENAME: HistoricalPlaces.java | 0.216012 | package com.example.android.myapplication6;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;
import java.util.ArrayList;
public class HistoricalPlaces extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.locationlist);
ArrayList<Location> historicalPlaces = new ArrayList<Location>();
historicalPlaces.add(new Location(getString(R.string.benjamin), getString(R.string.benjamin_info), R.drawable.benjamin_house));
historicalPlaces.add(new Location(getString(R.string.homesteadfarm), getString(R.string.homesteadfarm_info), R.drawable.homestead_farm));
historicalPlaces.add(new Location(getString(R.string.lainghouse), getString(R.string.lainghouse_info), R.drawable.laing_house));
LocationAdapter adapter = new LocationAdapter(this, historicalPlaces);
ListView listView = (ListView) findViewById(R.id.list);
listView.setAdapter(adapter);
}
}
|
ba89e624-f342-4cab-b250-4ae048b9e912 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-11 20:31:56", "repo_name": "making/credhub", "sub_path": "/src/main/java/io/pivotal/security/generator/SshGenerator.java", "file_name": "SshGenerator.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "349990967ffaab45d0d2503acb0562481948b172", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/making/credhub | 250 | FILENAME: SshGenerator.java | 0.26588 | package io.pivotal.security.generator;
import io.pivotal.security.controller.v1.SshSecretParameters;
import io.pivotal.security.secret.SshKey;
import io.pivotal.security.util.CertificateFormatter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.security.KeyPair;
import java.security.interfaces.RSAPublicKey;
@Component
public class SshGenerator implements SecretGenerator<SshSecretParameters, SshKey> {
@Autowired
LibcryptoRsaKeyPairGenerator keyGenerator;
@Override
public SshKey generateSecret(SshSecretParameters parameters) {
try {
final KeyPair keyPair = keyGenerator.generateKeyPair(parameters.getKeyLength());
String sshComment = parameters.getSshComment();
String sshCommentMessage = StringUtils.isEmpty(sshComment) ? "" : " " + sshComment;
String publicKey = CertificateFormatter.derOf((RSAPublicKey) keyPair.getPublic()) + sshCommentMessage;
String privateKey = CertificateFormatter.pemOf(keyPair.getPrivate());
return new SshKey(publicKey, privateKey);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
|
e37db38c-c596-49e6-903c-e85dacd33832 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-03 12:07:54", "repo_name": "adiraag/adikaal", "sub_path": "/EmployeeSort/src/Employee.java", "file_name": "Employee.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "c0c112611483d9d481c1a85f54ac8f69a458083f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/adiraag/adikaal | 260 | FILENAME: Employee.java | 0.277473 | import java.io.Serializable;
/**
* Created by upadhyad on 7/28/2017.
*/
public class Employee implements Comparable, Serializable {
private int empId;
private String name;
transient private double salary;
public Employee(int empId, String name, double salary) {
this.empId = empId;
this.name = name;
this.salary = salary;
}
public int getEmpId() {
return empId;
}
public void setEmpId(int empId) {
this.empId = empId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
@Override
public String toString() {
return "Employee{" +
"empId=" + empId +
", name='" + name + '\'' +
", salary=" + salary +
'}';
}
@Override
public int compareTo(Object O) {
Employee emp = (Employee) O;
return this.empId - emp.empId;
}
}
|
f03fd33d-42a1-4af9-ada2-96070c0ab924 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-12-13T15:22:30", "repo_name": "Kitchu0401/codenotforfood", "sub_path": "/aws/host-key-changed.md", "file_name": "host-key-changed.md", "file_ext": "md", "file_size_in_byte": 1361, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "7984834c58be8735b9f03e280b1be753f38b2d8d", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Kitchu0401/codenotforfood | 353 | FILENAME: host-key-changed.md | 0.255344 | # Host key가 변경되어 SSH 접속에 실패 할 때
AWS 내 새로운 Instance를 생성하여 기존의 key pair를 적용하고,
Elastic IPs를 적용하여 public-dns가 변경되었을 때 (Elastic IP 적용시 주의 메시지가 출력됨)
``` sh
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
[private-key-fingerprints-value].
Please contact your system administrator.
Add correct host key in /Users/Kitchu/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/Kitchu/.ssh/known_hosts:6
RSA host key for [public-dns-value] has changed and you have requested strict checking.
Host key verification failed.
```
이렇게 혹시 공격받은거 아니냐고 징징댐;
## 해결 [[참고](http://visu4l.tistory.com/343)]
아래의 커맨드를 실행해 새롭게 private-key를 등록한다.
``` sh
ssh-keygen -R [public-dns-value]
```
해결이 되지 않는다면 링크를 한 번 더 참고하여 저장된 파일을 지워보도록 하자. |
b2e19a69-2e94-4792-9d76-4fc479159240 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-16 11:50:35", "repo_name": "ainilili/no-framework", "sub_path": "/nico-nocat/src/main/java/org/nico/cat/server/ServerEntrance.java", "file_name": "ServerEntrance.java", "file_ext": "java", "file_size_in_byte": 989, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "90baa2770cb72ed3603ed685b073e7a7fa4d15ed", "star_events_count": 5, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ainilili/no-framework | 229 | FILENAME: ServerEntrance.java | 0.290981 | package org.nico.cat.server;
import java.io.IOException;
import java.net.Socket;
import org.nico.cat.server.processer.ServerProcesser;
import org.nico.cat.server.processer.entity.ProcessResult;
import org.nico.cat.server.response.buddy.ResponseBuddy;
import org.nico.log.Logging;
import org.nico.log.LoggingHelper;
public class ServerEntrance extends Thread{
private static Logging logging = LoggingHelper.getLogging(ServerProcesser.class);
private ResponseBuddy reponseBuddy;
private Socket client;
public ServerEntrance(Socket client) {
this.client = client;
this.reponseBuddy = new ResponseBuddy(client);
}
@Override
public void run() {
try{
ProcessResult result = new ServerProcesser(client).process();
reponseBuddy.push(result.getResponse());
}catch(Throwable e){
reponseBuddy.SimpleFailurePush(e);
}finally{
if(client != null){
try {
client.close();
} catch (IOException e) {
logging.error(e.getMessage());
}
}
}
}
}
|
4fd5a90e-9c48-417a-b5dd-0b9ec07c7778 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-21 03:48:31", "repo_name": "WillTong/enjoy-sample", "sub_path": "/sample-sys/sample-user-model/src/main/java/com/enjoy/sample/user/model/dto/UserInfoDto.java", "file_name": "UserInfoDto.java", "file_ext": "java", "file_size_in_byte": 1054, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "d96d35ede8534cc5e87cd94acd2002d3e6f78a8b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/WillTong/enjoy-sample | 218 | FILENAME: UserInfoDto.java | 0.236516 | package com.enjoy.sample.user.model.dto;
import com.enjoy.sample.user.model.entity.UserInfo;
import java.io.Serializable;
public class UserInfoDto implements Serializable {
private Long id;
private String userCode;
private String userName;
public UserInfoDto() {
}
public UserInfoDto(Long id, String userCode, String userName) {
this.id = id;
this.userCode = userCode;
this.userName = userName;
}
public UserInfoDto(UserInfo userInfo){
this.id=userInfo.getId();
this.userCode=userInfo.getUserCode();
this.userName=userInfo.getUserName();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}
|
e3bfe55d-2f89-41d5-87db-3a2fe71b8649 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-10 23:06:00", "repo_name": "dantudorin/Producer-Consumer-MultiThreading-JAVA", "sub_path": "/Consumer.java", "file_name": "Consumer.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "4611b1b41314ac11d03f4299c439616a4d26081d", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dantudorin/Producer-Consumer-MultiThreading-JAVA | 185 | FILENAME: Consumer.java | 0.256832 | import java.util.ArrayList;
public class Consumer implements Runnable {
private ArrayList<Integer> arrayList;
private String threadName;
public Consumer(ArrayList<Integer> arrayList, String threadName){
this.arrayList = arrayList;
this.threadName = threadName;
Thread t = new Thread(this);
t.start();
}
@Override
public void run() {
while(true){
synchronized (arrayList){
while(arrayList.isEmpty()){
try {
arrayList.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
int variable = arrayList.get(0);
System.out.println("Value extracted: " + variable + "by " + this.threadName);
arrayList.remove(0);
try{
Thread.sleep(500);
}catch (InterruptedException e){
e.printStackTrace();
}
arrayList.notifyAll();
}
}
}
}
|
fd14bbd2-b324-47c2-a42e-59f321a20914 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-16 14:06:46", "repo_name": "tim-mila/jwt-demo", "sub_path": "/src/main/java/com/sevensummits/jwt/demo/global/jpa/AuditorAwareImpl.java", "file_name": "AuditorAwareImpl.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "510bfa0c443b3f75650b2e6378648ef0c15c33a3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tim-mila/jwt-demo | 158 | FILENAME: AuditorAwareImpl.java | 0.23793 | package com.sevensummits.jwt.demo.global.jpa;
import com.sevensummits.jwt.demo.user.ApplicationUser;
import com.sevensummits.jwt.demo.user.ApplicationUserService;
import org.springframework.data.domain.AuditorAware;
import org.springframework.lang.NonNull;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import java.util.Optional;
public class AuditorAwareImpl implements AuditorAware<ApplicationUser> {
private final ApplicationUserService applicationUserService;
public AuditorAwareImpl(final ApplicationUserService applicationUserService) {
this.applicationUserService = applicationUserService;
}
@Override
@NonNull
public Optional<ApplicationUser> getCurrentAuditor() {
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
return Optional.of(applicationUserService.findByUsername(authentication.getName()));
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.