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
|
|---|---|---|---|---|---|---|
1387929d-287a-4ba3-a21a-09f9c8f32bb7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-15 21:24:31", "repo_name": "wuzzy00/Gti310_Laboratoire03", "sub_path": "/GTi310_Lab03/gti310/tp3/parser/MazeLine.java", "file_name": "MazeLine.java", "file_ext": "java", "file_size_in_byte": 963, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "4e6e56a67a023ebc36d2802a93864bebd9c28953", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "ISO-8859-1"}
|
https://github.com/wuzzy00/Gti310_Laboratoire03
| 207
|
FILENAME: MazeLine.java
| 0.250913
|
package gti310.tp3.parser;
import java.util.LinkedList;
/**
*
* Class contenant les lignes(details) du fichier
*
* @author Innocent Windsor Junior
*/
public class MazeLine {
/** Variables de class */
private String source;
private String destination;
private int weight;
/** Méthode servant à initialiser un object MazeLine */
MazeLine(String source, String destination, String weight){
this.source = source;
this.destination = destination;
this.weight = Integer.parseInt(weight);
}
/** Mutateurs & accesseur */
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getDestination() {
return destination;
}
public void setDestination(String destination) {
this.destination = destination;
}
public int getweight() {
return weight;
}
public void setweight(int weight) {
this.weight = weight;
}
}
|
16a76461-8430-44a6-8983-e2efd6c364ea
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-19 13:30:31", "repo_name": "oszust002/java2015", "sub_path": "/ftp/server/src/main/java/pl/edu/agh/java2015/ftp/server/gui/action/ConnectAction.java", "file_name": "ConnectAction.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "f54876ce499d80cc3bfb8fbbb7dbf72699799f81", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/oszust002/java2015
| 191
|
FILENAME: ConnectAction.java
| 0.264358
|
package pl.edu.agh.java2015.ftp.server.gui.action;
import pl.edu.agh.java2015.ftp.server.session.SessionsManager;
import javax.swing.*;
import java.awt.event.ActionEvent;
/**
* Created by Kamil on 03.02.2016.
*/
public class ConnectAction extends AbstractAction{
SessionsManager manager;
public ConnectAction(SessionsManager manager){
super("Start");
this.manager = manager;
}
@Override
public void actionPerformed(ActionEvent e) {
if(getValue(NAME).equals("Start")){
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
manager.start();
return null;
}
}.execute();
putValue(NAME,"Stop");
System.out.println("Started");
}
else {
manager.disconnect();
putValue(NAME,"Start");
}
}
}
|
ba481daf-4c06-47ac-b6e4-56653cd7a5fa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-11 00:59:57", "repo_name": "xymyf1314/MVCjavaweb", "sub_path": "/dao/src/main/java/com/neuedu/util/MyBatisUtil.java", "file_name": "MyBatisUtil.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "795a8c90c465d2268d1ef01788f8ad59c8c8b45e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/xymyf1314/MVCjavaweb
| 205
|
FILENAME: MyBatisUtil.java
| 0.23092
|
package com.neuedu.util;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import java.io.IOException;
import java.io.InputStream;
/**
* @program: mvntest09
* @description: MyBatis工具类
* @author: LinLuo
* @create: 2019-09-09 15:30
**/
public class MyBatisUtil {
private MyBatisUtil() {
}
public static SqlSession getSqlSession(String reso) {
String resource = reso;
InputStream inputStream = null;
SqlSession session = null;
try {
inputStream = Resources.getResourceAsStream(resource);
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
session = sqlSessionFactory.openSession();
} catch (IOException e) {
e.printStackTrace();
}
return session;
}
}
|
18ed8b82-8e68-4823-91c3-ea374c3d8ec4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-23 10:47:56", "repo_name": "wolvesleader/interview", "sub_path": "/base_java/src/main/java/com/quincy/java/algorithm/leetcode/LeetCode28.java", "file_name": "LeetCode28.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 37, "lang": "zh", "doc_type": "code", "blob_id": "a4269dde5d8177b80c53dae90ce46af7270e7791", "star_events_count": 34, "fork_events_count": 8, "src_encoding": "UTF-8"}
|
https://github.com/wolvesleader/interview
| 267
|
FILENAME: LeetCode28.java
| 0.293404
|
package com.quincy.java.algorithm.leetcode;
/**
* Copyright (C), 2015-2020, 大众易书天津科技有限公司
* FileName: LeetCode28
*
* @author: quincy
* Date: 2020/7/22 下午6:12
* History:
* 给定一个 haystack 字符串和一个 needle 字符串,
* 在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回 -1
*/
public class LeetCode28 {
public static void main(String[] args) {
System.out.println(strStr("phello", "llo"));
}
public static int strStr(String haystack, String needle) {
int position = -1;
int index = 0;
int indexN = 0;
while (haystack.length() > index){
if (indexN < needle.length() && haystack.charAt(index) == needle.charAt(indexN)){
indexN ++;
position ++;
}
if (indexN == needle.length()){
//position = haystack.length() - position - 1;
break;
}
index ++;
}
return position;
}
}
|
f97f29d2-2899-40f0-99ad-83583d18bda9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-29 12:51:07", "repo_name": "ymin96/Kakao_Chatbot", "sub_path": "/src/main/java/com/ymin/chatbot/service/ItemService.java", "file_name": "ItemService.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "0f225009981c20d0d986450469954a61e4e4d9cc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ymin96/Kakao_Chatbot
| 180
|
FILENAME: ItemService.java
| 0.262842
|
package com.ymin.chatbot.service;
import com.ymin.chatbot.dto.Item;
import com.ymin.chatbot.mapper.ItemMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional
public class ItemService {
@Autowired
ItemMapper itemMapper;
public boolean findItem(String userId, String name){
Item item = itemMapper.findItem(userId, name);
return (item != null);
}
public boolean insertItem(Item item){
return itemMapper.insertItem(item.getUserId(), item.getName(), item.getUrl());
}
public List<Item> getItemList(String userId){
return itemMapper.getItemList(userId);
}
public boolean deleteItem(String userId, String name){
return itemMapper.deleteItem(userId, name);
}
}
|
605a12c6-40c3-4b69-830e-1dc87558e2f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-07 03:42:40", "repo_name": "zlk-bobule/Yummy", "sub_path": "/src/main/java/com/nju/vo/UserAddressVO.java", "file_name": "UserAddressVO.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "1e19025f702999be056711435cc7e61ca904a02d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zlk-bobule/Yummy
| 255
|
FILENAME: UserAddressVO.java
| 0.250913
|
package com.nju.vo;
import com.nju.enums.Gender;
import lombok.Data;
@Data
public class UserAddressVO {
Long id;
/**
* 用户编号
*/
Long userId;
/**
* 联系人姓名
*/
String contactName;
/**
* 性别
*/
Gender gender;
/**
* 联系人电话
*/
String phone;
/**
* 地址
*/
String address;
/**
* 经度
*/
private String lng;
/**
* 纬度
*/
private String lat;
/**
* 门牌号
*/
String houseNumber;
public UserAddressVO(){}
public UserAddressVO(Long id, Long userId, String contactName, Gender gender, String phone, String address, String lng, String lat, String houseNumber) {
this.id = id;
this.userId = userId;
this.contactName = contactName;
this.gender = gender;
this.phone = phone;
this.address = address;
this.lng = lng;
this.lat = lat;
this.houseNumber = houseNumber;
}
}
|
c53a68be-ebb9-4d5c-b886-39eefab8b6ed
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-14 14:42:55", "repo_name": "bulkowy/tetris", "sub_path": "/src/com/tetrisbybulek/Model/Block/SpritedBlock.java", "file_name": "SpritedBlock.java", "file_ext": "java", "file_size_in_byte": 974, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "8c9b79ebc4ff2bcde70fd18246cb39a8b8e7b539", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bulkowy/tetris
| 205
|
FILENAME: SpritedBlock.java
| 0.291787
|
package com.tetrisbybulek.Model.Block;
import com.tetrisbybulek.Model.Piece.Pieces;
public class SpritedBlock extends Block {
/**
* Class defining SpritedBlock object that has defined
* type so it can print with given colors on Frame
*/
Pieces pieces;
public SpritedBlock(boolean empty, Pieces type){
/**
* Parameter Constructor of SpritedBlock object
*
* Calls Parameter Constructor of superclass with passed empty
*
* @param empty boolean telling whether Block should be treated
* as empty or not
* @param type Pieces enum type defining type of given block
*
* @see Block#Block(boolean)
*/
super(empty);
pieces = type;
}
@Override
public Pieces getPieces(){
/**
* Getter of pieces field
*
* @return value of pieces field
*/
return pieces;
}
}
|
9e4d7076-dc90-4f65-99a0-cdc04cfd147c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-15 12:50:36", "repo_name": "yanjie0305/MyTabLayout", "sub_path": "/app/src/main/java/com/example/administrator/mytablayout/ItemFragment.java", "file_name": "ItemFragment.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "31bc259c86c5b159ec7dbb95b265e82c92afa2df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yanjie0305/MyTabLayout
| 181
|
FILENAME: ItemFragment.java
| 0.23092
|
package com.example.administrator.mytablayout;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
/**
* Created by ${郭艳杰} on 2017/1/15.
*/
public class ItemFragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
String title = getArguments().getString("title");
TextView textView = new TextView(getActivity());
textView.setText(title);
return textView;
}
public static Fragment getInstance(String s) {
ItemFragment itemFragment = new ItemFragment();
Bundle args = new Bundle();
args.putString("title",s);
itemFragment.setArguments(args);
return itemFragment;
}
}
|
a2c416d1-68e7-4fc1-ad1a-1f47ea6a489f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-13 11:48:35", "repo_name": "oterrien/pullrequest-approval", "sub_path": "/src/main/java/com/ote/github/api/JsonUtils.java", "file_name": "JsonUtils.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "2c7b34b2b27a8eb918c85d30dced67926eb3fa9b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/oterrien/pullrequest-approval
| 181
|
FILENAME: JsonUtils.java
| 0.249447
|
package com.ote.github.api;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import javax.validation.constraints.NotNull;
import java.io.IOException;
public final class JsonUtils {
// ObjectMapper is threadsafe
private static final ObjectMapper MAPPER;
static {
MAPPER = new ObjectMapper();
MAPPER.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
private JsonUtils() {
}
public static <T> T parse(@NotNull String content, @NotNull Class<T> type) throws IOException {
return MAPPER.readValue(content, type);
}
public static <T> String serialize(@NotNull T obj) throws IOException {
return MAPPER.writeValueAsString(obj);
}
}
|
0365f50f-605a-411b-b2af-431776f1dde1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-02-04T09:38:16", "repo_name": "rajatdem/rtes", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 972, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "c8517af28f97833daed8bf1f9008fb8583e76ca4", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/rajatdem/rtes
| 234
|
FILENAME: README.md
| 0.288569
|
# Real Time Embedded Systems (18-648) Project
Hacking the Linux Kernel for the Android Nexus 7 device
## /apps
* calc.c: Userspace program to use syscall
* energymon.c: Userspace application to print task wise energy usage on console
* easyperiodic.c: Real time thread used for reservation.
* reserve.c: Userspace app to reserve a thread.
* rtps.c: Userspace app to check thread status.
## /modules: Loadable Kernel Modules
* hello: A simple module to print hello on the dmesg screen
* psdev: A character device driver supporting 255 devices
* cleanup: Module to check open devices
## /kernel
* sysclock.c: Computes the frequency to scale to based on utilization of the core.
* calc.c: Syscall to float arithmetic in kernel space.
* reserve.c: Real time thread reservation framework.
* cpu_heuristics.c: Computes core to be used to reserve the new thread based on user selected heuristic.
* taskmon_sysfs.c: Computes and stores energy consumption for each thread.
|
a0ff0e9c-3c9b-45d7-b2b5-20bfe5e309fa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-09 05:26:01", "repo_name": "amsa-code/detection", "sub_path": "/src/main/java/au/gov/amsa/detection/behaviour/MessageTemplateBehaviour.java", "file_name": "MessageTemplateBehaviour.java", "file_ext": "java", "file_size_in_byte": 974, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "8799b43e45b18b85006855ca9a3ce69ac0514a2a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/amsa-code/detection
| 198
|
FILENAME: MessageTemplateBehaviour.java
| 0.256832
|
package au.gov.amsa.detection.behaviour;
import au.gov.amsa.detection.model.DetectionRule;
import au.gov.amsa.detection.model.MessageTemplate;
import au.gov.amsa.detection.model.MessageTemplate.Behaviour;
import au.gov.amsa.detection.model.MessageTemplate.Events.Create;
import xuml.tools.model.compiler.runtime.ArbitraryId;
public class MessageTemplateBehaviour implements Behaviour {
private final MessageTemplate self;
public MessageTemplateBehaviour(MessageTemplate self) {
this.self = self;
}
@Override
public void onEntryCreated(Create event) {
self.setId(ArbitraryId.next());
self.setBody(event.getBody());
self.setSubject(event.getSubject());
self.setStartTime(event.getStartTime());
self.setEndTime(event.getEndTime());
self.setForceUpdateBeforeTime(event.getForceUpdateBeforeTime());
DetectionRule.find(event.getDetectionRuleID()).get().setMessageTemplate_R8(self);
}
}
|
fbc94c13-e2b6-4e76-a3cb-c20d23495ed9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-01-20T02:10:35", "repo_name": "nehori/java-simple-launcher-androidtv", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 970, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "8826bbee3078b92a0658193bf86534c2a704ebda", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nehori/java-simple-launcher-androidtv
| 200
|
FILENAME: README.md
| 0.199308
|
Sample source code of Simple Home launcher on AndroidTV.
=============
## Introduction
Home launcher on AndroidTV displays application's banners with category of LEANBACK_LAUNCHER.
## ScreenShot

## License
Copyright 2016 nehori.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
[1]: http://developer.android.com/reference/android/service/notification/NotificationListenerService.html
|
dc8c577a-7d0d-46f1-9faf-699f06399d98
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-09-23T07:02:43", "repo_name": "varunajmera0/vuejs-shopping", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 970, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "28edef5e7df0c3a1b5ba5522cce4fc9d53f75e0f", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/varunajmera0/vuejs-shopping
| 234
|
FILENAME: README.md
| 0.247987
|
# Vue-shoppingcart
> A Vue.js project
> It's just an experiment.
> <a href="https://vue-shopping.firebaseapp.com/">Shopping Cart</a>
> Some Code In Vuetify (like slider/login/sign up)
> <a href="vuetifyjs.com/vuetify/quick-start">Vuetify</a>
> Create Database In Firebase Database and add given detail in main.js file using firebase databse.
firebase.initializeApp({
apiKey: '',
authDomain: '',
databaseURL: '',
projectId: '',
storageBucket: ''
})
# This website contains admin part. So You can add categories and add products accroding to categories. You can also add slider.
# Sign up And Sign In the help of Firebase.
# Add to Cart
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
|
23c970dc-fd91-4290-8cec-00f7e56bdfdf
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-14 07:51:56", "repo_name": "Bilyana-Vatev-80/Java-OOP", "sub_path": "/SOLID/src/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 25, "lang": "en", "doc_type": "code", "blob_id": "abfdf496eec59dad5797e3e148b48a8735fffed5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Bilyana-Vatev-80/Java-OOP
| 250
|
FILENAME: Main.java
| 0.289372
|
import Interfaces.Appender;
import Interfaces.Layout;
import Interfaces.Logger;
import controllers.ConsoleAppender;
import controllers.XmlLayout;
import logger.MessageLogger;
public class Main {
public static
void main (String[] args) {
/* Layout simpleLayout = new SimpleLayout ();
Appender consoleAppender = new ConsoleAppender (simpleLayout);
Logger logger = new MessageLogger (consoleAppender);
logger.logError ("3/26/2015 2:08:11 PM", "Error parsing JSON.");
logger.logInfo ("3/26/2015 2:08:11 PM", "User Pesho successfully registered.");*/
Layout xmlLayout = new XmlLayout ();
Appender consoleAppender = new ConsoleAppender(xmlLayout);
Logger logger = new MessageLogger(consoleAppender);
logger.logFatal("3/31/2015 5:23:54 PM", "mscorlib.dll does not respond");
logger.logCritical("3/31/2015 5:23:54 PM", "No connection string found in App.config");
}
}
|
5c73e08f-a4c2-488d-8b92-f7aee8ad6564
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-06-06T21:19:26", "repo_name": "jan25/sandbox-2020", "sub_path": "/bazel/example/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 970, "line_count": 46, "lang": "en", "doc_type": "text", "blob_id": "a78cd869cf659e80cbd47bb24bfb01ec50a83428", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jan25/sandbox-2020
| 206
|
FILENAME: README.md
| 0.256832
|
## Practising Prometheus style metric collection concepts while setting up sample project for bazel
WIP to setup bazel for all three components in one workspace.
`/server` has a simple HTTP server serving one endpoint. Start the server using:
```
cd server
go run main.go
```
Hit server endpoint using:
```
curl localhost:8080/password?keywords=abc,xyz&len=10
```
Start metric collector with below commands and visualize request metric histogram in terminal:
```
cd metrics
go run scraper.go
HTTP Request count metric
(Latest scrapped metric last)
|**************************
|*******************
|*******
|**************
|***************
|************************
|***********************
|*****************
|********************
|***********
```
Generate synthetic load with helper script:
```
cd load-generator
sh naive.sh localhost:8080/password
```
Made use of https://golang.org/pkg/expvar/ stdlib for clientside metric state and http exporter handler.
|
c112c2e8-7e44-4698-a8f2-f3e306513790
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-25 09:54:52", "repo_name": "AndrewChudiyevych/Architecture", "sub_path": "/src/test/java/kniga/project/bookshop/status/AuthorStub.java", "file_name": "AuthorStub.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "fa056d3f4ee2b081059b7b4750e26c5e057baa03", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AndrewChudiyevych/Architecture
| 184
|
FILENAME: AuthorStub.java
| 0.23793
|
package kniga.project.bookshop.status;
import kniga.project.bookshop.dto.AuthorRequest;
import kniga.project.bookshop.entity.Author;
import java.util.HashSet;
public final class AuthorStub {
public static final Long ID = 1L;
public static final String NAME = "name";
public static final String SURNAME = "surname";
public static final String DESCRIPTION = "description";
public static Author getRandomAuthor() {
return Author.builder().id(ID)
.name(NAME)
.surname(SURNAME)
.genre(new HashSet<>())
.description(DESCRIPTION)
.books(new HashSet<>())
.build();
}
public static AuthorRequest getAuthorRequest() {
AuthorRequest authorRequest = new AuthorRequest();
authorRequest.setName(NAME);
authorRequest.setSurname(SURNAME);
authorRequest.setDescription(DESCRIPTION);
return authorRequest;
}
}
|
a898956c-42ff-4e42-89a4-58c548a16064
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-03 22:22:35", "repo_name": "Honeybee-Cloud/WiFiSurvey", "sub_path": "/app/src/main/java/com/example/wifisurvey/ElasticSearchExporter.java", "file_name": "ElasticSearchExporter.java", "file_ext": "java", "file_size_in_byte": 971, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "20fd10b8d21b3a3e1547a369d9b42b57403033c0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Honeybee-Cloud/WiFiSurvey
| 180
|
FILENAME: ElasticSearchExporter.java
| 0.233706
|
package com.example.wifisurvey;
import com.loopj.android.http.AsyncHttpClient;
public class ElasticSearchExporter {
private AsyncHttpClient httpClient = null;
public static class ESExporterOptions {
protected String domain;
protected int port;
protected String username;
public void ESExporterOptions() {
}
public int getPort() {
return port;
}
public String getDomain() {
return domain;
}
public String getUsername() {
return username;
}
}
private ESExporterOptions curConfig = null;
public boolean config(ESExporterOptions options) {
if (httpClient != null) {
return false;
}
curConfig = options;
httpClient = new AsyncHttpClient();
return true;
}
public void upload() {
assert curConfig != null;
assert httpClient != null;
}
}
|
0a807a2b-6e08-4e20-af9d-ec5a2607c7b9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-06 01:28:02", "repo_name": "JPBaro/webapp-Rest-microservice-Based", "sub_path": "/DisplayControl/src/main/java/com/jpb/displaycontrol/exception/ItemNotFoundException.java", "file_name": "ItemNotFoundException.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "d4fd928926826dd507601d3d7c357e4447393c75", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/JPBaro/webapp-Rest-microservice-Based
| 189
|
FILENAME: ItemNotFoundException.java
| 0.252384
|
package com.jpb.displaycontrol.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus (value= HttpStatus.NOT_FOUND)
public class ItemNotFoundException extends RuntimeException{
/**
* @ResponseStatus (value= HttpStatus.NOT_FOUND)
* public class ItemNotFound extends RuntimeException
*
* ----Pending to check why i have to include serilVersionUID to avoid warning JP
*/
private static final long serialVersionUID = 1L;
private String exceptionDescription;
private Object fieldDetail;
public ItemNotFoundException(String exceptionDescription, String fieldDetail) {
super(exceptionDescription+"- !!Oh my Godness :-) ! - "+fieldDetail);
this.exceptionDescription = exceptionDescription;
this.fieldDetail = fieldDetail;
}
public String getExceptionDetail() {
return exceptionDescription;
}
public Object getFieldValue() {
return fieldDetail;
}
}
|
4befcf92-9e25-4b39-af2e-0c57d312e559
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-25 06:49:19", "repo_name": "Exorth98/heroyn-java-libraries", "sub_path": "/Plugins/QuakeDatabaseSign/src/fr/exorth/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "9fae7c03d99e24e345a4afb7aed36387933cd9b8", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/Exorth98/heroyn-java-libraries
| 223
|
FILENAME: Main.java
| 0.272025
|
package fr.exorth;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
static Main instance;
public SqlConnection sql;
public static Main getInstance(){
return instance;
}
@Override
public void onEnable() {
sql = new SqlConnection("jdbc:mysql://","localhost","quake","root","");
sql.connection();
instance=this;
getConfig().options().copyDefaults(true);
saveConfig();
Bukkit.getPluginManager().registerEvents(new SignEvent(sql), this);
Bukkit.getPluginManager().registerEvents(new SignClickEvent(), this);
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
getCommand("lobby").setExecutor(new QuakeLobbyCommand());
new SignRefreshRunnable(sql).runTaskTimer(this, 5L, 5L);
super.onEnable();
}
@Override
public void onDisable() {
sql.disconnect();
super.onDisable();
}
}
|
7d1635db-1100-4d39-8c3f-016323881b7f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-06-07 23:59:15", "repo_name": "rirodlar/clientWSArquitecturaUfro", "sub_path": "/ClientWSReservaMedicasUFRO/src/java/mb/LoginManagedBean.java", "file_name": "LoginManagedBean.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "3ee0716613f456bbca5be0d582c6aaec188b3cb5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rirodlar/clientWSArquitecturaUfro
| 210
|
FILENAME: LoginManagedBean.java
| 0.181263
|
/*
* 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 mb;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
/**
*
* @author rrodriguez
*/
@ManagedBean(name = "loginManagedBean")
@RequestScoped
public class LoginManagedBean {
private String rut;
private String email;
public LoginManagedBean() {
}
public void login(){
System.out.print("login");
System.out.print("RUT: "+this.rut);
System.out.print("EMAIL: "+this.email);
}
public String getRut() {
return rut;
}
public void setRut(String rut) {
this.rut = rut;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
|
a700c7df-e355-4f8e-a1b6-359f122edf3e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-14 14:25:44", "repo_name": "Alecktos/alecktos-stockfetcher", "sub_path": "/src/main/java/com/alecktos/stockfetcher/StockfetcherDependencyModule.java", "file_name": "StockfetcherDependencyModule.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "262b22570bad92cb1685c9591e7f68982d2db9e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Alecktos/alecktos-stockfetcher
| 217
|
FILENAME: StockfetcherDependencyModule.java
| 0.259826
|
package com.alecktos.stockfetcher;
import com.alecktos.misc.logger.EmailNotifier;
import com.alecktos.misc.logger.Logger;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.name.Names;
abstract public class StockfetcherDependencyModule extends AbstractModule {
private String emailConfigPath;
public StockfetcherDependencyModule(String emailConfigPath) {
this.emailConfigPath = emailConfigPath;
}
protected Provider<Logger> getLoggerProvider() {
return new Provider<Logger>() {
@Inject
EmailNotifier emailNotifier;
@Override
public Logger get() {
return new Logger(emailNotifier);
}
};
}
@Override
protected void configure() {
bind(Logger.class).toProvider(getLoggerProvider());
bindConstant().annotatedWith(Names.named("emailConfigPath")).to(emailConfigPath);
bindConstant().annotatedWith(Names.named("influxDbName")).to("stocks");
}
}
|
20441cc6-6a02-4aaa-8176-eda6c02a7ce7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-06 22:44:12", "repo_name": "gustavoktausend/redismock", "sub_path": "/src/main/java/com/teste/redismock/redismock/service/NavegationService.java", "file_name": "NavegationService.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "24ddb4f805aeed90fda0d1e643e31e5478ed0be7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gustavoktausend/redismock
| 213
|
FILENAME: NavegationService.java
| 0.225417
|
package com.teste.redismock.redismock.service;
import com.teste.redismock.redismock.model.Navegation;
import com.teste.redismock.redismock.repository.NavegationRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class NavegationService {
@Autowired
private NavegationRepository repository;
public Navegation findById(String id) throws Exception {
return repository.findById(id).orElseThrow(Exception::new);
}
public void insertNavegation(Navegation newNavegation) {
repository.save(
Navegation.builder()
.id(newNavegation.getId())
.home(newNavegation.getHome())
.about(newNavegation.getAbout())
.blog(newNavegation.getBlog())
.help(newNavegation.getHelp())
.rules(newNavegation.getRules())
.build()
);
}
}
|
d4272da7-acf1-43a8-84d5-d12de0ec9c0a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-01-30 12:31:50", "repo_name": "venuatthota/multithreading", "sub_path": "/src/courses/lecture1/HardwareUtility.java", "file_name": "HardwareUtility.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "1f395a9fba129571b9b1cca7d3aa74b31b74991a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/venuatthota/multithreading
| 218
|
FILENAME: HardwareUtility.java
| 0.284576
|
package courses.lecture1;
import com.sun.jna.Native;
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.WinBase.SYSTEMTIME;
import com.sun.jna.platform.win32.WinBase.SYSTEM_INFO;
public class HardwareUtility {
public static long getCPUCores(){
return Runtime.getRuntime().availableProcessors();
}
public static void main (String[] args){
Kernel32 INSTANCE = (Kernel32) Native
.loadLibrary("Kernel32", Kernel32.class);
SYSTEMTIME time =new SYSTEMTIME();
INSTANCE.GetSystemTime(time);
System.out.println("Day of the Week "+time.wDayOfWeek);
System.out.println("Year : "+time.wYear);
SYSTEM_INFO systeminfo=new SYSTEM_INFO();
INSTANCE.GetSystemInfo(systeminfo);
// INSTANCE.GetNativeSystemInfo(arg0);
System.out.println("Processor Type : "+systeminfo.dwNumberOfProcessors);
}
}
|
6145a056-bc16-4230-8eb5-dea230975cac
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-19 03:43:12", "repo_name": "FeastTime/feast-demo", "sub_path": "/feast-ad/src/main/java/com/feast/demo/hibernate/TimedEntity.java", "file_name": "TimedEntity.java", "file_ext": "java", "file_size_in_byte": 989, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7f6ae61f946ae866242765400ab01970e58ad5ef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/FeastTime/feast-demo
| 236
|
FILENAME: TimedEntity.java
| 0.258326
|
package com.feast.demo.hibernate;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.Index;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.sql.Timestamp;
/**
* Created by ggke on 2017/7/29.
*/
@MappedSuperclass
@Data
@ToString(callSuper = true)
@EntityListeners({ TimedEntityListener.class })
public abstract class TimedEntity{
/**
*
*/
private static final long serialVersionUID = 5968742044806210654L;
/**
* 创建时间
*/
@JsonFormat(pattern = "YYYY/MM/DD hh:mm:ss", timezone="GMT+8")
@Column(updatable = false, nullable = false)
protected Timestamp creation;
/**
* 最后修改时间
*/
@Index(name="lastModified")
@JsonFormat(pattern = "YYYY/MM/DD hh:mm:ss", timezone="GMT+8")
@Column(nullable = false)
protected Timestamp lastModified;
}
|
346a056b-8579-462b-91d4-1c35ba4d6dd0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-03-17T07:23:38", "repo_name": "amarjeetsingh1999/Memory-Game", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 970, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "940164790faa35f4b82b53e54044356fe3bceb8a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/amarjeetsingh1999/Memory-Game
| 246
|
FILENAME: README.md
| 0.278257
|
# Memory-Game
## Instructions:
* Click on cards
* Keep viewing the front side of cards and memorize them and simultaneously try matching them
* Try to complete this in minimum number of moves possible
- 3 stars for completing the game is not more than 12 moves
- 2 stars for completing the game is moves not greater than 22 and not less than 13
- 1 star otherwise
* Modal with final stats appears after game completion
* Restart button available above game board on right side
* "Ok" and "Play Again" buttons on modal
- Ok to close the modal and return to the completed game screen
- Play again to restart the game
## Web Development Technologies used:
* HTML
* CSS
* JavaScript
## Fonts Source
* [Google Fonts](https://fonts.google.com/)
## Icons Source
* [Font Awesome](https://fontawesome.com/v4.7.0/)
## Animations Source
* https://daneden.github.io/animate.css/
### GitHub pages link: [Memory Game](https://amarjeetsingh1999.github.io/Memory-Game/)
|
cd1af7c1-12fe-4af5-8222-6c3b8350e3d1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-01 12:43:05", "repo_name": "Rezapratama10118055/AplikasiKerjaPraktek", "sub_path": "/app/src/main/java/com/dinas/dinaskesehatanbelitung/Api/ApiCovid.java", "file_name": "ApiCovid.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "dcc6b2d8e42bc0a06acacb5274a4407d93fd41d7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Rezapratama10118055/AplikasiKerjaPraktek
| 177
|
FILENAME: ApiCovid.java
| 0.239349
|
package com.dinas.dinaskesehatanbelitung.Api;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ApiCovid {
public static Retrofit getApiCovid(){
HttpLoggingInterceptor httpLoggingInterception = new HttpLoggingInterceptor();
httpLoggingInterception.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient okHttpClient = new OkHttpClient.Builder().addInterceptor(httpLoggingInterception).build();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://data.covid19.go.id/")
.addConverterFactory(GsonConverterFactory.create())
.client(okHttpClient)
.build();
return retrofit;
}
public static ApiService getData(){
ApiService apiService = getApiCovid().create(ApiService.class);
return apiService;
}
}
|
cb05afdf-0cd5-4e60-9d55-877a1ec7b62b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-27 18:20:54", "repo_name": "szmerd/MyApplication", "sub_path": "/app/src/main/java/com/example/konradszmidt/myapplication/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "7481fbe55520a35b06b3d747f702c2123c836e6c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/szmerd/MyApplication
| 186
|
FILENAME: MainActivity.java
| 0.225417
|
package com.example.konradszmidt.myapplication;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String[] elementy_listy = { "Pierwszy", "Drugi", "Trzeci", "Czwarty" };
ListView prosta_lista = (ListView) findViewById(R.id.lista_mainList);
ArrayAdapter adapter_listy = new ArrayAdapter(this,
android.R.layout.simple_list_item_1, elementy_listy);
prosta_lista.setAdapter(adapter_listy);
}
public void sendMessage(View view)
{
Intent intent = new Intent(MainActivity.this, Podstrona.class);
startActivity(intent);
}
}
|
dd664bb5-822f-4952-82e1-50881db5a198
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-11-02 09:24:53", "repo_name": "kongq1983/concurrent", "sub_path": "/thread/src/main/java/com/kq/concurrent/threadlocal/ThreadLocalLeakDemo.java", "file_name": "ThreadLocalLeakDemo.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "43019711e1f9b0a31cd9cf825dc1a45cb880d6b8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kongq1983/concurrent
| 256
|
FILENAME: ThreadLocalLeakDemo.java
| 0.249447
|
package com.kq.concurrent.threadlocal;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
/**
* ThreadLocalLeakDemo
*
* @author kq
* @date 2021/8/23 23:43
* @since 1.0.0
*/
public class ThreadLocalLeakDemo {
static AtomicLong atomicLong = new AtomicLong();
public static void main(String[] args) throws Exception{
for(int i=0;i<5000000;i++) {
new Thread(() -> {
ThreadLocal<String> value = new ThreadLocal<String>();
try {
// Thread.sleep(1000L);
value.set("milk11111111111111111111111111111111111111111" + atomicLong.incrementAndGet());
// null
System.out.println("get1=" + value.get());
} catch (Exception e) {
e.printStackTrace();
}
}, "thread-2").start();
}
TimeUnit.SECONDS.sleep(100);
}
}
|
9157379f-121b-4f8b-b304-ce2c95023d54
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-05 16:34:42", "repo_name": "clovergaze/dilithium-exchange-manager", "sub_path": "/src/main/java/org/infokin/repository/api/AbstractBaseRepository.java", "file_name": "AbstractBaseRepository.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "5a9e853f47b440851757f3d8a5d5409e044bd463", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/clovergaze/dilithium-exchange-manager
| 194
|
FILENAME: AbstractBaseRepository.java
| 0.240775
|
package org.infokin.repository.api;
import org.hibernate.Session;
import org.infokin.model.core.BaseEntity;
import org.infokin.util.HibernateUtility;
/**
* Generic implementation of basic repository operations.
*/
public abstract class AbstractBaseRepository<T extends BaseEntity> implements BaseRepository<T> {
/**
* {@inheritDoc}
*/
@Override
public Session getSession() {
return HibernateUtility.getSessionFactory().getCurrentSession();
}
/**
* {@inheritDoc}
*/
@Override
public Long save(T entity) {
Session session = getSession();
session.beginTransaction();
Long id = (Long) session.save(entity);
session.getTransaction().commit();
return id;
}
/**
* {@inheritDoc}
*/
@Override
public Long update(T entity) {
return 0L;
}
/**
* {@inheritDoc}
*/
@Override
public void delete(T entity) {
}
}
|
03b2d240-adee-44a7-a3ad-e1cb30c7d4e9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-05-15 06:27:31", "repo_name": "majiajia1989/JiaYe", "sub_path": "/src/main/java/com/e1858/wuye/pojo/CommissionTypeCommand.java", "file_name": "CommissionTypeCommand.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "4a489992c8bcbff8d8920bc7fe97069063d89946", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/majiajia1989/JiaYe
| 224
|
FILENAME: CommissionTypeCommand.java
| 0.249447
|
package com.e1858.wuye.pojo;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import com.e1858.wuye.common.CommonConstant;
public class CommissionTypeCommand
{
private long id;
@NotBlank(message=CommonConstant.ValidMessage.NotBlank)
@NotEmpty(message=CommonConstant.ValidMessage.NotEmpty)
private String name;
private long template_count;
private boolean isCommissionuse;
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 long getTemplate_count()
{
return template_count;
}
public void setTemplate_count(long template_count)
{
this.template_count = template_count;
}
public boolean isCommissionuse()
{
return isCommissionuse;
}
public void setCommissionuse(boolean isCommissionuse)
{
this.isCommissionuse = isCommissionuse;
}
}
|
8ada68d0-9a6d-473e-ac4e-6844585503cb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-09 06:29:14", "repo_name": "zcscvxx/board", "sub_path": "/project/src/test/java/com/ish/board/TestOfBDao.java", "file_name": "TestOfBDao.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "d094fe3826b6dd0a11685f02d4b0eea7d6b7fe61", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zcscvxx/board
| 213
|
FILENAME: TestOfBDao.java
| 0.286169
|
package com.ish.board;
import static org.junit.Assert.*;
import javax.inject.Inject;
import org.apache.ibatis.session.SqlSession;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.ish.board.dao.BDao;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations= {
"file:src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml",
"file:src/main/webapp/WEB-INF/spring/root-context.xml"
})
public class TestOfBDao {
@Inject
private SqlSession sqlSession;
private BDao dao;
@Before
public void setup() {
dao = sqlSession.getMapper(BDao.class);
}
@Test
public void test() {
int rows = dao.getRowNum();
System.out.println(rows);
int max = dao.getRowNum();
System.out.println(max);
}
}
|
57520960-2b52-4126-8762-5b4d1ef379e4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-18 05:00:39", "repo_name": "z8g/common", "sub_path": "/concurrent/src/main/java/net/zhaoxuyang/concurrent/demo/ThreadDemoVolatile.java", "file_name": "ThreadDemoVolatile.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "13a30c879d3c7689b05989131066f1ad5749cb9b", "star_events_count": 72, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/z8g/common
| 193
|
FILENAME: ThreadDemoVolatile.java
| 0.247987
|
package net.zhaoxuyang.concurrent.demo;
/**
* 线程示例程序 - 可见性
* @author zhaoxuyang
*/
public class ThreadDemoVolatile {
public static void main(String[] args) {
class StoppableThread extends Thread {
private volatile boolean shutdown;
@Override
public void run() {
synchronized (this) {
while (!shutdown) {
System.out.println(System.nanoTime());
}
}
}
void stopThread() {
shutdown = true;
}
}
StoppableThread t = new StoppableThread();
t.start();
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
System.out.println("出错:" + ex);
}
System.out.println("停止" + t.getName());
t.stopThread();
System.out.println("停止" + Thread.currentThread().getName());
}
}
|
ebc9b4b8-20b5-4efb-8034-e6a62bb3c690
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-21 08:10:56", "repo_name": "dragonfly95/jpademo-gradle", "sub_path": "/src/main/java/com/example/jpademo/dto/SongDto.java", "file_name": "SongDto.java", "file_ext": "java", "file_size_in_byte": 974, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "4fd1127440c9b5449f1282deb1a2a02d8f788cf4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dragonfly95/jpademo-gradle
| 201
|
FILENAME: SongDto.java
| 0.220007
|
package com.example.jpademo.dto;
import com.example.jpademo.domain.Person;
import com.example.jpademo.domain.Song;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SongDto {
private Long id;
private String title;
private String singer;
private Person person;
public SongDto(Long id, String title, String singer) {
this.id = id;
this.title = title;
this.singer = singer;
}
public SongDto(Song song) {
this.id = song.getId();
this.title = song.getTitle();
this.singer = song.getSinger();
this.person = song.getPerson();
}
@Override
public String toString() {
return "SongDto{" +
"id=" + id +
", title='" + title + '\'' +
", singer='" + singer + '\'' +
", person=" + person +
'}';
}
}
|
80cad055-56ae-4187-9f62-2972cce796e6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-01 18:40:37", "repo_name": "nhatanhmc/DemoThymeleaf", "sub_path": "/src/main/java/com/example/ThymeleafDemo/controller/GlobalController.java", "file_name": "GlobalController.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "5db9c2d42c74d6fab08a707ae5f6801df91591b7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nhatanhmc/DemoThymeleaf
| 163
|
FILENAME: GlobalController.java
| 0.225417
|
/*
* 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.example.ThymeleafDemo.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;
/**
*
* @author Admin
*/
@ControllerAdvice
public class GlobalController {
@ExceptionHandler(value = Exception.class)
public ModelAndView error(HttpServletRequest request, Exception e) throws Exception{
System.out.println(e);
ModelAndView mav = new ModelAndView();
mav.addObject("exception", e);
mav.addObject("url", request.getRequestURI());
mav.setViewName("error");
return mav;
}
}
|
7314b301-720e-4d9d-b118-92e0ef522fb6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-03 19:20:25", "repo_name": "jpeyraud/UltimatePixel_Android", "sub_path": "/app/src/main/java/com/altarrys/ultimatepixel/game/DFVictoryScore.java", "file_name": "DFVictoryScore.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "847f94fe9baf6d79d17bf9cd296a3c1d900915a5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jpeyraud/UltimatePixel_Android
| 200
|
FILENAME: DFVictoryScore.java
| 0.264358
|
package com.altarrys.ultimatepixel.game;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import com.altarrys.ultimatepixel.R;
public class DFVictoryScore extends DialogFragment implements android.content.DialogInterface.OnClickListener
{
private int m_score;
public DFVictoryScore()
{
m_score = 0;
}
public void setScore(int score)
{
m_score = score;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
setCancelable(false);
builder.setTitle(getString(R.string.dfvictoryscore) + " " + m_score);
builder.setPositiveButton(R.string.dfcontinue, this);
return builder.create();
}
@Override
public void onClick(DialogInterface dialog, int which)
{
if (which == DialogInterface.BUTTON_POSITIVE)
getActivity().finish();
}
}
|
cb747c30-699b-4571-a18d-12b0b6607e97
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-23 11:58:36", "repo_name": "ProductivePathway/LiquibaseLambda", "sub_path": "/src/main/java/com/productivepathway/liquibase/Response.java", "file_name": "Response.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "452489677be91790a16bab2eb3e314563fbc0cb8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ProductivePathway/LiquibaseLambda
| 205
|
FILENAME: Response.java
| 0.240775
|
package com.productivepathway.liquibase;
import java.util.ArrayList;
import java.util.List;
public class Response {
private List<String> errors;
private boolean success;
public List<String> getErrors() {
return errors;
}
public void setErrors(List<String> errors) {
this.errors = errors;
}
public void addError(String error) {
if(errors == null) {
errors = new ArrayList<String>();
}
errors.add(error);
success = false;
}
public boolean getSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public Response(List<String> errors) {
this.errors = errors;
}
public Response() {
}
public String toString() {
return "Response: ["
+ (success ? "success" : "")
+ (errors != null ? ("errors=" + errors) : "")
+ "]";
}
}
|
3e73cf7a-2e01-4918-b94f-9f92e213e940
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-20 09:15:25", "repo_name": "corri108/CapnetFlag", "sub_path": "/core/src/com/capnet/game/InputHandle.java", "file_name": "InputHandle.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "eaae7fcb9fa0e1421bfb0d67e27e0296a6dc693f", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/corri108/CapnetFlag
| 215
|
FILENAME: InputHandle.java
| 0.275909
|
package com.capnet.game;
import com.badlogic.gdx.Gdx;
import com.capnet.share.Entities.InputSnapshot;
import com.capnet.share.networking.PacketManager;
import java.net.Socket;
/**
* Created by michaelpollind on 4/30/16.
*/
public class InputHandle {
private int key;
private PacketManager manager;
private Socket server;
private boolean isPressed;
public boolean IsPressed()
{
return isPressed;
}
public int Key()
{
return key;
}
public InputHandle(int key, PacketManager manager, Socket server)
{
this.key = key;
this.manager = manager;
this.server = server;
}
public boolean Update()
{
boolean press = Gdx.input.isKeyPressed(key);
if(isPressed != press) {
isPressed = press;
manager.SendPacket(new InputSnapshot(key, isPressed), server);
return true;
}
return false;
}
}
|
19d6bb29-deb6-4cee-854b-c120b982883d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-23 18:28:31", "repo_name": "harkaran3009/CovidAssessment", "sub_path": "/app/src/main/java/com/example/covidassessment/VaccineRegisterResult.java", "file_name": "VaccineRegisterResult.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "126c592b1ecb6aeb3651c6cd3b2587e871f7adeb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/harkaran3009/CovidAssessment
| 201
|
FILENAME: VaccineRegisterResult.java
| 0.236516
|
package com.example.covidassessment;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class VaccineRegisterResult extends AppCompatActivity {
String name,date,time,centre;
TextView t1,t2,t3;
String[] suit;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vaccine_register_result);
Intent intent = new Intent();
t1 = (TextView)findViewById(R.id.vaccinetest3);
t2 = (TextView)findViewById(R.id.covidcenterVaccine);
t3 = (TextView)findViewById(R.id.coviddatevaccine);
//suit = intent.getStringArrayExtra("nameres");
Bundle b=this.getIntent().getExtras();
String[] array=b.getStringArray("key");
t1.setText(array[0]);
t2.setText(array[3]);
t3.setText(array[1] + " at " + array[2]);
}
}
|
e55f1cfc-3b79-4914-809c-7f7acd6d255e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-23 08:07:42", "repo_name": "gzhongj/healthydiets", "sub_path": "/src/main/java/com/gzj/healthydiets/entity/Resp.java", "file_name": "Resp.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "6a04e31ccb9119d66ef8ff48aab2d29fbf9d60c5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gzhongj/healthydiets
| 217
|
FILENAME: Resp.java
| 0.2227
|
package com.gzj.healthydiets.entity;
public class Resp<E> {
private String errcode;
private String message;
private E body;
public Resp() {
}
public Resp(String errcode, String message, E body) {
this.errcode = errcode;
this.message = message;
this.body = body;
}
public String getErrcode() {
return errcode;
}
public void setErrcode(String errcode) {
this.errcode = errcode;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public E getBody() {
return body;
}
public void setBody(E body) {
this.body = body;
}
@Override
public String toString() {
return "Resp{" +
"errcode='" + errcode + '\'' +
", message='" + message + '\'' +
", body=" + body +
'}';
}
}
|
85e4cfc1-584b-4758-a2a4-2c4ea63e0918
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-04-12T15:10:50", "repo_name": "kwhitley/football", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 966, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "8ba988ff781a57a784ad19bd9a488a312928cc40", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kwhitley/football
| 258
|
FILENAME: README.md
| 0.243642
|
# Auto Gallery
This build uses a fuse-box build process, rather than webpack. This includes the following feature support, minus the time overhead or babel dependencies (fuse-box uses a TypeScript transpiler under the hood).
- [x] React/JSX support
- [x] Hot reloading
- [x] CSS/LESS/SASS
- [x] Images
- [x] Autoreloading of server & client while in `yarn dev` mode
- [x] Sourcemaps (manual refresh required, as hot-reloading messes with sourcemaps)
- [x] Build to ES5
- [x] Cache-busting
### Structure Description
- `/src/client` - throw your entire untranspiled client code+assets in here (entry point is index.jsx)
- `/src/server` - throw your entire untranspiled server code here (entry point is index.js)
- `/dist` - generated distributable output from the `yarn build` command
- `.env` (root) - local environment variables will be automatically loaded
- `fuse.js` - build config
- `.eslint.json` - linting config
Notes
- Routes
- /:gallery-slug/i/:uuid
|
230da91f-2533-4c3a-ab14-c1c20d64d8a7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-05 10:14:25", "repo_name": "TonyLeeIT/tonyle.github.io", "sub_path": "/src/main/java/com/project/entity/BusTemp.java", "file_name": "BusTemp.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "c5bfe44c0aa7bc154841e75e4b04ee894f697015", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/TonyLeeIT/tonyle.github.io
| 216
|
FILENAME: BusTemp.java
| 0.249447
|
package com.project.entity;
import java.sql.Date;
public class BusTemp extends Bus{
private java.sql.Date nextWarrantyDate;
private Boolean checkOutOfDate;
private int revenue;
public BusTemp(Date nextWarrantyDate, Boolean checkOutOfDate, int revenue) {
this.nextWarrantyDate = nextWarrantyDate;
this.checkOutOfDate = checkOutOfDate;
this.revenue = revenue;
}
public int getRevenue() {
return revenue;
}
public void setRevenue(int revenue) {
this.revenue = revenue;
}
public BusTemp(){}
public Date getNextWarrantyDate() {
return nextWarrantyDate;
}
public void setNextWarrantyDate(Date nextWarrantyDate) {
this.nextWarrantyDate = nextWarrantyDate;
}
public Boolean getCheckOutOfDate() {
return checkOutOfDate;
}
public void setCheckOutOfDate(Boolean checkOutOfDate) {
this.checkOutOfDate = checkOutOfDate;
}
}
|
c4e3003c-862b-4c55-bb07-58efe9089def
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-05 14:25:44", "repo_name": "Junglexyz/wemall", "sub_path": "/wemall-wx-api/src/main/java/com/jungle/wemall/wx/controller/WxAdController.java", "file_name": "WxAdController.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "8eb76d3b9deddc7cbd198ad7a5f22d2c59409ee8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Junglexyz/wemall
| 220
|
FILENAME: WxAdController.java
| 0.200558
|
package com.jungle.wemall.wx.controller;
import com.jungle.wemall.common.util.ResponseUtil;
import com.jungle.wemall.db.pojo.WemallAd;
import com.jungle.wemall.db.service.WemallAdService;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @description: 广告
* @author: jungle
* @date: 2020-02-29 09:55
*/
@RestController
@RequestMapping("/wx/ad")
public class WxAdController {
@Autowired
private WemallAdService wemallAdService;
@GetMapping("/list")
public Object listAd(){
List<WemallAd> list = wemallAdService.listAd();
if(list != null){
return ResponseUtil.okList(list);
}
return ResponseUtil.fail();
}
}
|
733a12e0-4205-410b-a076-f4e9805d1a9b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-20 10:19:25", "repo_name": "storm56/XingYeDa", "sub_path": "/EHome/app/src/main/java/com/xingyeda/ehome/bean/SeekHistoryBase.java", "file_name": "SeekHistoryBase.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "ada6873183831bad00d222853d6fd2e5b7200f9a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/storm56/XingYeDa
| 238
|
FILENAME: SeekHistoryBase.java
| 0.242206
|
package com.xingyeda.ehome.bean;
import org.litepal.crud.DataSupport;
public class SeekHistoryBase extends DataSupport{
private int mId;
private String name;
private String mUserId;
private String mTime;
public SeekHistoryBase(String name, String time) {
this.name = name;
this.mTime = time;
}
public SeekHistoryBase(String name) {
this.name = name;
}
public SeekHistoryBase() {
}
public int getmId() {
return mId;
}
public void setmId(int mId) {
this.mId = mId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUid() {
return mUserId;
}
public void setUid(String uid) {
this.mUserId = uid;
}
public String getmTime() {
return mTime;
}
public void setmTime(String mTime) {
this.mTime = mTime;
}
}
|
5cdce374-e7c0-4d95-9b6f-f4cc34599684
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-12-03 14:19:18", "repo_name": "bkozyrev/TheVyshka", "sub_path": "/app/src/main/java/com/dtd/thevyshka/Adapters/ScienceListAdapter.java", "file_name": "ScienceListAdapter.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "2c2ef606d50c7e1e8b23f07b260098087ab917bf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bkozyrev/TheVyshka
| 179
|
FILENAME: ScienceListAdapter.java
| 0.246533
|
package com.dtd.thevyshka.Adapters;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.dtd.thevyshka.Adapters.ViewHolders.ScienceViewHolder;
import com.dtd.thevyshka.R;
public class ScienceListAdapter extends RecyclerView.Adapter<ScienceViewHolder> {
View.OnClickListener listener;
public ScienceListAdapter(View.OnClickListener listener){
this.listener = listener;
}
@Override
public ScienceViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_science, viewGroup, false);
return new ScienceViewHolder(view, listener);
}
@Override
public void onBindViewHolder(final ScienceViewHolder holder, final int i) {
}
@Override
public int getItemCount() {
return 3;
}
}
|
02bee7cb-108c-4352-ab0d-981ba3d8b9a0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-10 06:13:10", "repo_name": "chmutian/netty", "sub_path": "/src/main/java/com/netty/tcp/NettyTcpClient.java", "file_name": "NettyTcpClient.java", "file_ext": "java", "file_size_in_byte": 987, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "28ec9bb71a799521841fba7170fe168df55d34c9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/chmutian/netty
| 232
|
FILENAME: NettyTcpClient.java
| 0.268941
|
package com.netty.tcp;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
public class NettyTcpClient {
public static void main(String[] args) throws Exception {
NioEventLoopGroup group = new NioEventLoopGroup();
try {
// 客户端配置
Bootstrap bootstrap = new Bootstrap();
bootstrap.group(group)
.channel(NioSocketChannel.class)
.handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
ch.pipeline().addLast(new NettyTcpClientHandler());
}
});
ChannelFuture channelFuture = bootstrap.connect("127.0.0.1", 6666).sync();
channelFuture.channel().closeFuture().sync();//监听通道关闭
} finally {
group.shutdownGracefully();
}
}
}
|
e506c73f-06ac-4e12-9925-36275e8296d1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-26 12:33:25", "repo_name": "CeivenLean/makedeal", "sub_path": "/src/cn/shop/servlet/ImageCodeServlet.java", "file_name": "ImageCodeServlet.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "696cd838795dc51037d2809f2b049b9d02a1163e", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/CeivenLean/makedeal
| 194
|
FILENAME: ImageCodeServlet.java
| 0.258326
|
package cn.shop.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.shop.util.RandomValidateCode;
@WebServlet("/imageCodeServlet")
public class ImageCodeServlet extends HttpServlet {
/**
*
*/
private static final long serialVersionUID = -3574237787598371108L;
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("image/jpeg");
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "No-cache");
response.setDateHeader("Expires", 0);
RandomValidateCode rc = new RandomValidateCode();
try {
rc.getRandomCode(request,response);
}catch(Exception e) {
e.printStackTrace();
}
}
}
|
bf61b0de-59f7-428a-a500-53ff0f1e3831
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-24 11:18:09", "repo_name": "sudhirt/api-portal", "sub_path": "/src/main/java/com/sudhirt/apiutils/portal/exception/Error.java", "file_name": "Error.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "36f0bd310aa24f76f640eeb29b36a2322517ced8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sudhirt/api-portal
| 194
|
FILENAME: Error.java
| 0.235108
|
package com.sudhirt.apiutils.portal.exception;
import lombok.Getter;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Getter
public class Error implements Serializable {
private static final long serialVersionUID = 7554020068463996833L;
private String error;
private List<String> description;
public Error(String error) {
super();
this.error = error;
}
public Error(String message, String error) {
super();
description = Arrays.asList(error);
}
public Error(String message, List<String> errors) {
super();
this.description = errors;
}
public void addDetail(String detail) {
if(description == null) {
description = new ArrayList<>();
}
description.add(detail);
}
}
|
64be1744-54d5-4c5f-bf37-03c0a69b94a4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-30 06:01:17", "repo_name": "AminLiu/queencastle", "sub_path": "/queencastle-all/queencastle-dao/src/main/java/com/queencastle/dao/utils/SysDateSerializer.java", "file_name": "SysDateSerializer.java", "file_ext": "java", "file_size_in_byte": 1043, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "3b8659d8cd63a27546f8ee91692da0293417541f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AminLiu/queencastle
| 195
|
FILENAME: SysDateSerializer.java
| 0.220007
|
package com.queencastle.dao.utils;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
/**
* 系统时间处理,在各种JSON传递的时候,在对应的字段加上这个注解即可,用法如下:<br>
*
* @JsonSerialize(using = SysDateSerializer.class) private Date startTime;
* @author 于东伟
*
*/
public class SysDateSerializer extends JsonSerializer<Date> {
public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
public static final SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
@Override
public void serialize(Date date, JsonGenerator generator, SerializerProvider provider)
throws IOException, JsonProcessingException {
String dateStr = sdf.format(date);
generator.writeString(dateStr);
}
}
|
bd6a9b77-efb9-464b-b063-9fa16705327c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-06-19T07:26:36", "repo_name": "dipakp-logicrays/module-newsletter", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 969, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "5ad9010f345170808b3cbd05dbee03b039afdc2f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dipakp-logicrays/module-newsletter
| 224
|
FILENAME: README.md
| 0.258326
|
Magento 2 Newsletter module overview
=========================================
Magento 2x Newsletter adding new field Guest First Name, Guest Last Name and Privacy agreement checkbox to frontend newsletter form.
Module is tested on Magento 2.4.2-p1 version
How install module
==================
1. First download the Magento module (LR_Newsletter) from the github and unzip the
module
2. Use the Ftp client to upload or copy to extension in your [magento_root]/app/code directory
3. After upload module path will be [magento_root]/app/code/LR/Newsletter
4. Open the command line (connect ssh) and go to the Magento root directory then execute
one by one below commands:
```bash
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush
chmod -R 777 var/ pub/ generated/
```
THANK YOU!
|
8855f96c-5c27-4ae2-adc5-8a6efca68cfa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-11 13:12:16", "repo_name": "pantherproject/designpattern", "sub_path": "/src/main/java/com/panther/aspect/ProxyFactory.java", "file_name": "ProxyFactory.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "514089067825345fa50b8ee914ad177702577965", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/pantherproject/designpattern
| 195
|
FILENAME: ProxyFactory.java
| 0.255344
|
package com.panther.aspect;
import com.panther.aspect.impl.PersonServiceBean;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
/**
* 动态代理
* Created by panther on 16-9-28.
*/
public class ProxyFactory implements InvocationHandler {
private Object targetObject;
public Object creatProxyInstance(Object obj){
this.targetObject = obj;
return Proxy.newProxyInstance(this.targetObject.getClass()
.getClassLoader(), this.targetObject.getClass()
.getInterfaces(), this);
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
PersonServiceBean personServiceBean = (PersonServiceBean) this.targetObject;
Object result = null;
if (personServiceBean.getUser() != null) {
result = method.invoke(personServiceBean, args);
}
return result;
}
}
|
226568fe-3a7e-4e78-97ac-fbdd148b1eb9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-03-27T00:18:39", "repo_name": "ApesofWrath/Sasquatch-T-shirt-Shooter", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 970, "line_count": 13, "lang": "en", "doc_type": "text", "blob_id": "b1b309f36a50de45c1a033ceafe40f2db7205520", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ApesofWrath/Sasquatch-T-shirt-Shooter
| 255
|
FILENAME: README.md
| 0.228156
|
This is the code for team 668's T-shirt shooter. It is based on the Team221 Sasquatch robot controller.
[Home](http://www.team221.com/robotopen)
[Driver Station](http://www.team221.com/robotopen/ds.html)
[Current Snapshot of Library](https://github.com/221robotics/RobotOpen-Sasquatch-Library/archive/master.zip)
[Library Classes](https://robotopen.readthedocs.org/en/latest/)
[Official Purchase Page](http://www.team221.com/robotopen/product.php?id=114)
And [here](http://www.team221.com/upload/Sasquatch_rev2_drawing_package.pdf) is the official schematic of the controller, not that anyone but mark005 will need it.
The IDE (Integrated Development Environment) can be found [here](http://arduino.cc/en/Main/Software), and download version 1.0.5.
The Snapshot of the current library previously linked to, must be uncompressed into your sketchbook folder, making sure that the "libraries" and "hardware" folders are both in the sketchbook directory.
|
1dfbda3a-3b08-4276-bc57-680a351284d8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-31 12:52:12", "repo_name": "geeker-lait/user-center", "sub_path": "/lmt-mbsp-user-controller/src/main/java/com/lmt/mbsp/user/controller/PermissionController.java", "file_name": "PermissionController.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "20c0099a861fea65ce786cae08d07808acaaa26f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/geeker-lait/user-center
| 210
|
FILENAME: PermissionController.java
| 0.191933
|
package com.lmt.mbsp.user.controller;
import com.lmt.framework.support.service.CrudService;
import com.lmt.framework.support.web.controller.CrudController;
import com.lmt.mbsp.user.dto.PermissionQuery;
import com.lmt.mbsp.user.entity.permission.Permission;
import com.lmt.mbsp.user.service.PermissionService;
import com.lmt.mbsp.user.vo.permission.PermissionInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @描述: 权限.
* @作者: lijing.
* @创建时间: 2018-06-27 16:41.
* @版本: 1.0 .
*/
@RestController
@RequestMapping("/permission")
public class PermissionController implements CrudController<Permission, Long, PermissionQuery, PermissionInfo> {
@Autowired
private PermissionService permissionService;
@Override
public CrudService<Permission, Long> getService() {
return permissionService;
}
}
|
f23a36f9-61c1-4721-a1e5-4cbed34a9188
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-25 16:27:55", "repo_name": "Karthick986/Women-Security", "sub_path": "/app/src/main/java/com/example/womensecurity/HospWeb.java", "file_name": "HospWeb.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "91d556084144235be704a67a697f96840ab2cea9", "star_events_count": 2, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/Karthick986/Women-Security
| 183
|
FILENAME: HospWeb.java
| 0.175538
|
package com.example.womensecurity;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class HospWeb extends AppCompatActivity {
WebView hospWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hosp_web);
hospWebView = findViewById(R.id.hospWeb);
hospWebView.setWebViewClient(new WebViewClient());
hospWebView.loadUrl("https://www.mapsofindia.com/nagpur/health/hospitals.html");
WebSettings webSettings = hospWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
}
@Override
public void onBackPressed() {
if (hospWebView.canGoBack()) {
hospWebView.goBack();
}
else {
super.onBackPressed();
}
}
}
|
23b88f49-c8b6-4898-9c60-23b674cc573e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-20 02:10:51", "repo_name": "dujijun007/chronic-disease-project", "sub_path": "/kafka-eagle-web/src/main/java/org/smartloli/kafka/eagle/web/controller/VisualizerController.java", "file_name": "VisualizerController.java", "file_ext": "java", "file_size_in_byte": 962, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "a74c752519de5d549670663bee8087c5629cef1a", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/dujijun007/chronic-disease-project
| 170
|
FILENAME: VisualizerController.java
| 0.213377
|
package org.smartloli.kafka.eagle.web.controller;
import org.smartloli.kafka.eagle.web.exception.entity.NormalException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpSession;
/**
* @author LH
*
*
* */
@Controller
public class VisualizerController {
@RequestMapping(value = "/visualizer/visShow", method = RequestMethod.GET)
public ModelAndView visShow(HttpSession session){
ModelAndView mav = new ModelAndView();
mav.setViewName("/visualizer/sourceVisualizer");
String monitorGroupId;
if((monitorGroupId = (String)session.getAttribute("monitorGroupId")) != null)
mav.addObject("monitorGroupId", monitorGroupId);
session.removeAttribute("monitorGroupId");
return mav;
}
}
|
64274695-3975-41e4-9e3d-ddbd52ae1b90
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-09 11:59:53", "repo_name": "lucasmunioz0/cursos", "sub_path": "/1-Java/Udemy/JavaEE/JavaEE/Leccion303/src/main/java/ClienteEntidadPersona.java", "file_name": "ClienteEntidadPersona.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "7edc414ad2a14ea4601f7d01f47024fcdb44d6e1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lucasmunioz0/cursos
| 193
|
FILENAME: ClienteEntidadPersona.java
| 0.239349
|
import com.udemy.javaee.clase303.domain.Persona;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class ClienteEntidadPersona {
static Logger log = LogManager.getRootLogger();
public static void main(String[] args) {
final EntityManagerFactory emf = Persistence.createEntityManagerFactory("PersonaPU");
final EntityManager em = emf.createEntityManager();
EntityTransaction tx = em.getTransaction();
tx.begin();
Persona persona = new Persona("Lucas", "Muñoz", "lmunoz@mail.com", "123123");
log.debug("Objeto a persistir" + persona);
em.persist(persona);
tx.commit();
log.debug("Objeto persistido" + persona);
em.close();
}
}
|
23200123-caa6-41c4-a67d-dd7dfcad6884
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-04-03T00:10:31", "repo_name": "sul-dlss-deprecated/archive-utils", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 963, "line_count": 46, "lang": "en", "doc_type": "text", "blob_id": "54a5dcae9c8809bdebd0b7fe918128f18f26d179", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sul-dlss-deprecated/archive-utils
| 248
|
FILENAME: README.md
| 0.245085
|
archive-utils
=============
[](http://badge.fury.io/rb/archive-utils)
Ruby utilities for archival data (BagIt, Fixity, Tarfile).
**Note** As of Q1 2018, this repository is in the process of being replaced by https://github.com/sul-dlss/preservation_robots (not yet complete as of this writing).
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'archive-utils'
```
And then execute:
```sh
$ bundle update
```
Or install it yourself as:
```sh
$ gem install archive-utils
```
## Usage
```ruby
include 'archive-utils'
bag = Archive::BagitBag.new()
```
## Contributing
1. Fork it (https://github.com/[my-github-username]/archive-utils/fork )
2. Create your feature branch (`git checkout -b feature/my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin feature/my-new-feature`)
5. Create a new Pull Request
|
86ba9553-65a9-41ca-8893-be92d3641d49
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-25 15:31:16", "repo_name": "P79N6A/icse_20_user_study", "sub_path": "/methods/Method_46882.java", "file_name": "Method_46882.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 22, "lang": "en", "doc_type": "code", "blob_id": "31acb33ce3c148947353109bfe7089541d6980f3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/P79N6A/icse_20_user_study
| 199
|
FILENAME: Method_46882.java
| 0.264358
|
@Override void addElements(ArrayList<CompressedObjectParcelable> elements){
TarArchiveInputStream tarInputStream=null;
try {
tarInputStream=new TarArchiveInputStream(new FileInputStream(filePath));
TarArchiveEntry entry;
while ((entry=tarInputStream.getNextTarEntry()) != null) {
String name=entry.getName();
if (!CompressedHelper.isEntryPathValid(name)) {
continue;
}
if (name.endsWith(SEPARATOR)) name=name.substring(0,name.length() - 1);
boolean isInBaseDir=relativePath.equals("") && !name.contains(SEPARATOR);
boolean isInRelativeDir=name.contains(SEPARATOR) && name.substring(0,name.lastIndexOf(SEPARATOR)).equals(relativePath);
if (isInBaseDir || isInRelativeDir) {
elements.add(new CompressedObjectParcelable(entry.getName(),entry.getLastModifiedDate().getTime(),entry.getSize(),entry.isDirectory()));
}
}
}
catch ( IOException e) {
e.printStackTrace();
}
}
|
d472a016-2d9f-4ed6-bc7a-5365b44b1dc9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-12-31 13:01:07", "repo_name": "klakegg/formats", "sub_path": "/formats-mobi/src/main/java/net/klakegg/formats/mobi/code/Compression.java", "file_name": "Compression.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "19b72042102fbe02ea18600422b7fec8c97f7865", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/klakegg/formats
| 191
|
FILENAME: Compression.java
| 0.252384
|
package net.klakegg.formats.mobi.code;
import net.klakegg.formats.common.compression.CompressionAlgorithm;
import net.klakegg.formats.common.compression.NoCompression;
import net.klakegg.formats.mobi.compression.PalmDocCompression;
public enum Compression implements CompressionAlgorithm {
NONE(1, new NoCompression()),
PalmDOC(2, new PalmDocCompression()),
HUFF_CDIC(17480, null);
private int identifier;
private CompressionAlgorithm algorithm;
Compression(int identifier, CompressionAlgorithm algorithm) {
this.identifier = identifier;
this.algorithm = algorithm;
}
public static Compression findByIdentifier(int identifier) {
for (Compression compression : values())
if (compression.identifier == identifier)
return compression;
return null;
}
@Override
public byte[] decompress(byte[] bytes) {
return algorithm.decompress(bytes);
}
}
|
6770609b-6310-40eb-ad6b-1828dd4a8766
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-12-16T08:53:10", "repo_name": "joe4u/Hello-World", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1034, "line_count": 53, "lang": "en", "doc_type": "text", "blob_id": "9af89a6d0df5ef446dfe02527463317eb5eaa8d5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/joe4u/Hello-World
| 281
|
FILENAME: README.md
| 0.26588
|
# Hello-World
I'm a freshman
Here is an example of AppleScript:
tell application "Foo"
beep
end tell
This is a normal paragraph:
This is a code block.
<table>
<tr>
<td>Foo</td>
</tr>
</table>
*emphasis*
©
这是一个一级标题
=============
这是一个二级标题
-------------
# 这是一级标题
## 这是二级标题
###### 这是六级标题
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.
> ## This is a header.
>
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> return shell_exec("echo $input | $markdown_script");
|
060499c6-5889-40ca-a5fa-e918b55eb936
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-06-18 05:41:47", "repo_name": "crashtheparty/EnchantmentSolution", "sub_path": "/src/org/ctp/enchantmentsolution/api/ApiEnchantmentWrapper.java", "file_name": "ApiEnchantmentWrapper.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "35f49ce0ac2ec40362be04a0cb119d8299bb04a7", "star_events_count": 21, "fork_events_count": 17, "src_encoding": "UTF-8"}
|
https://github.com/crashtheparty/EnchantmentSolution
| 226
|
FILENAME: ApiEnchantmentWrapper.java
| 0.245085
|
package org.ctp.enchantmentsolution.api;
import org.bukkit.plugin.java.JavaPlugin;
import org.ctp.enchantmentsolution.enchantments.CustomEnchantmentWrapper;
public class ApiEnchantmentWrapper extends CustomEnchantmentWrapper {
private final JavaPlugin plugin;
/**
* Constructor for the ApiEnchantmentWrapper
*
* @param plugin
* - the plugin of the enchantment
* @param namespace
* - the standard name of the enchantment
* @param name
* - the standard name of the enchantment
*/
public ApiEnchantmentWrapper(JavaPlugin plugin, String namespace, String name) {
super(plugin, namespace, name);
if (name == null || name == "") throw new NullPointerException("An enchantment's name may not be set to null or an empty string!");
this.plugin = plugin;
}
/**
* Gets the plugin of this enchantment
*
* @return JavaPlugin - the plugin
*/
public JavaPlugin getPlugin() {
return plugin;
}
}
|
53c42f37-4f9b-43d7-a65c-64138fbaab20
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-03-19T15:37:21", "repo_name": "bogdan-zaharia-hs/elm-intro", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 965, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "0db5d6d8ac7be99dd48d82c8f92edf66746b7ff8", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/bogdan-zaharia-hs/elm-intro
| 278
|
FILENAME: README.md
| 0.240775
|
# Elm intro examples
## Usage
### Installing elm
```sh
$ npm i -g elm
```
That will install the following tools:
- elm-repl
- elm-make - for compiling elm files
- elm-reactor - a dev server
- elm-package - for managing packages
For more details, as well as editor/IDE integrations, see [the `install` section of the guide](https://guide.elm-lang.org/install.html). Also note [elm-format](https://github.com/avh4/elm-format), which auto-formats your code according to the official styleguide.
### Running the examples
```sh
$ elm package install --yes
$ elm reactor
$ open http://localhost:8000
```
## Learning elm
- [The official docs](http://elm-lang.org/docs)
- [Egghead.io course](https://egghead.io/courses/start-using-elm-to-build-web-applications)
- [Awesome Elm](https://github.com/isRuslan/awesome-elm)
- [Elm Town Podcast](https://elmtown.github.io/)
- [Elm Conf 2016 Videos](https://www.youtube.com/playlist?list=PLglJM3BYAMPH2zuz1nbKHQyeawE4SN0Cd)
|
2b23a3dc-c158-4f7b-86b8-915e6653bb8f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-16 19:29:03", "repo_name": "GabrielLewis/BattleShip", "sub_path": "/Player.java", "file_name": "Player.java", "file_ext": "java", "file_size_in_byte": 960, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "7c14f71ddec4e35dde9fece7b337914960d11565", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/GabrielLewis/BattleShip
| 219
|
FILENAME: Player.java
| 0.26588
|
import java.util.Scanner;
/**
* Player
*/
public class Player
{
private boolean myTurn;
private Board board;
private String name;
public Player (String name, int boardSize)
{
this.name = name;
board = new Board(boardSize);
myTurn = false;
}
/**
*
*/
public String toString()
{
return name;
}
/**
*
*/
public Board getBoard()
{
return board;
}
public void placeShips(int numShips)
{
Scanner in = new Scanner(System.in);
for(int i = 0; i < numShips; i++)
{
System.out.print("Place your battleship: ");
int xcoord = in.nextInt();
int ycoord = in.nextInt();
String orientation = in.next();
Ship ship = new Ship(xcoord, ycoord, 5, orientation.charAt(0));
board.placeShip(ship);
System.out.println(board);
}
}
}
|
7f277f9a-0ffe-4cb8-9327-67a26346106d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-01-24T03:29:50", "repo_name": "AliciaBurn/05-Workday-Planner", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 964, "line_count": 40, "lang": "en", "doc_type": "text", "blob_id": "77f21ee974f505597b668254ab9fffd8e14a2325", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AliciaBurn/05-Workday-Planner
| 210
|
FILENAME: README.md
| 0.252384
|
# 05-homework
Read Me
Project: Work Day Planner
Author: Alicia Burn
Date: 12/19/2019
https://aliciaburn.github.io/05-homework/
******************************
* TABLE OF CONTENTS *
******************************
1. Description
2. Features
3. Known Issues
******************************
* DESCRIPTION *
******************************
Work Day Scheduler
A simple calendar application that allows the user to save events for each hour of the day. This app will run in the browser and feature dynamically updated HTML and CSS powered by jQuery.
******************************
* FEATURES *
******************************
Work Day Scheduler
1. Updates current date
2. Time blocks for each hour 9am-5pm
3. Color coded time blocks
4. Color coding represents past, present, future
5. Input area to hold data
******************************
* Known Issues *
******************************
1. None
|
b2d6aa45-d9b9-4df2-b61c-54ceb1d1c6b3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-12 11:28:58", "repo_name": "vcedgar/swhacks17", "sub_path": "/Coordinates.java", "file_name": "Coordinates.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "f5360a30e6c39eb6b49e25eaf2a150d0d8102fd0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/vcedgar/swhacks17
| 238
|
FILENAME: Coordinates.java
| 0.285372
|
import java.net.*;
import java.util.*;
import java.io.*;
public class Coordinates {
public static void main(String []args) {
}
public static String getMetars(int minLat, int minLong, int maxLat, int maxLong) {
String url = "https://aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&minLat=" + minLat + "&minLon=" + minLong + "&maxLat=" + maxLat + "&maxLon=" + maxLong + "&hoursBeforeNow=3";
return getUrlSource(url);
}
public static String getUrlSource(String url) {
try {
URL yahoo = new URL(url);
URLConnection yc = yahoo.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream(), "UTF-8"));
String inputLine;
StringBuilder a = new StringBuilder();
while ((inputLine = in.readLine()) != null)
a.append(inputLine);
in.close();
return a.toString();
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
}
|
5a451ac4-621c-476d-8aab-716df5fab329
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-08 07:46:31", "repo_name": "Piloting/2019-08-otus-spring-suntsov", "sub_path": "/lesson1/src/main/java/ru/otus/spring/service/PersonServiceImpl.java", "file_name": "PersonServiceImpl.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "ee3d13c182caa9bfda51b906457dbfa94643dcdd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Piloting/2019-08-otus-spring-suntsov
| 175
|
FILENAME: PersonServiceImpl.java
| 0.273574
|
package ru.otus.spring.service;
import org.springframework.stereotype.Service;
import ru.otus.spring.common.LocalizationService;
import ru.otus.spring.domain.Person;
@Service
public class PersonServiceImpl implements PersonService {
private final ChannelService channel;
private final LocalizationService localizationService;
public PersonServiceImpl(ChannelService channel, LocalizationService localizationService){
this.channel = channel;
this.localizationService = localizationService;
}
@Override
public Person getPerson() {
channel.say(localizationService.getMessage("say_name"));
String answer = channel.listen();
String[] names = answer.split(" ");
Person person = new Person();
if (names.length > 0){
person.setLastName(names[0]);
}
if (names.length > 1){
person.setName(names[1]);
}
return person;
}
}
|
983fd306-ae0a-42f0-bb56-6a7706db02b1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-23 16:45:14", "repo_name": "jenszer/Expeditioners-PioneerTrail", "sub_path": "/PioneerTrail/src/pioneertrail/view/ErrorView.java", "file_name": "ErrorView.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "18ca530dd42e91f71e800b4dfde76894573e295f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jenszer/Expeditioners-PioneerTrail
| 177
|
FILENAME: ErrorView.java
| 0.23231
|
/*
* 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 pioneertrail.view;
import java.io.PrintWriter;
import pioneertrail.PioneerTrail;
/**
*
* @author Jacob Enszer
*/
public class ErrorView {
private static PrintWriter console = PioneerTrail.getOutFile();
private static PrintWriter log = PioneerTrail.getLogFile();
public static void display(String className, String errorMessage) {
console.println(
"\n---ERROR-------------------------"
+ "\n" + errorMessage
+ "\n---------------------------------");
log.printf("%n%n%s", className + " - " + errorMessage);
}
static void display(String error_saving_Invenotry_items_list_to_file) {
throw new UnsupportedOperationException();
}
}
|
38e1b8b7-5ac7-4511-95da-835758f248f6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-09 04:56:40", "repo_name": "mrshin163/RestBoard", "sub_path": "/src/com/rest/board/repository/BoardDAOMybatis.java", "file_name": "BoardDAOMybatis.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "cc31c2b4582dff4a5ddc546c33a5b599c7f24d66", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mrshin163/RestBoard
| 194
|
FILENAME: BoardDAOMybatis.java
| 0.268941
|
package com.rest.board.repository;
import java.util.List;
import javax.swing.GroupLayout.SequentialGroup;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.rest.board.domain.Board;
@Repository
public class BoardDAOMybatis implements BoardDAO{
@Autowired
private SqlSessionTemplate sqlSessionTemplate;
@Override
public List selectAll() {
return sqlSessionTemplate.selectList("Board.selectAll");
}
@Override
public Board select(int board_id) {
return sqlSessionTemplate.selectOne("Board.select",board_id);
}
@Override
public void insert(Board board) {
sqlSessionTemplate.insert("Board.insert", board);
}
@Override
public void update(Board board) {
sqlSessionTemplate.update("Board.update",board);
}
@Override
public void delete(int board_id) {
sqlSessionTemplate.delete("Board.delete", board_id);
}
}
|
d0ca6fbc-f9b6-44be-9298-0c6b47635244
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-08 15:14:58", "repo_name": "Fy45/ID1212_Homework", "sub_path": "/TESTRMIClient/src/start/RMIClient.java", "file_name": "RMIClient.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "036380f022e4c2967b13ce0e6e3dc125bb9bae13", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/Fy45/ID1212_Homework
| 211
|
FILENAME: RMIClient.java
| 0.279828
|
/*
* 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 start;
import java.rmi.Naming;
import common.RMIinter;
import controller.Opration;
import controller.Registerlogin;
/**
*
* @author user
*/
public class RMIClient {
public static String URL;
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws Exception {
URL="rmi://"+"192.168.1.103"+":9999/common.interimplement";
RMIinter userOperation=(RMIinter)Naming.lookup(URL);
String wow = userOperation.print();
System.out.println(wow);
while(true){
Registerlogin.registerlogin();
if(Registerlogin.flag==1){
break;
}
}
while(true){
Opration.Operation();
}
}
}
|
73ae8127-600d-4f3d-9b36-550868eabdc3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-20 03:01:41", "repo_name": "hi-jianger/ThihkingInJava21", "sub_path": "/src/com/package2119/Runnable2.java", "file_name": "Runnable2.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "88ca1ab9a47b0de0eea1067dde20371115030911", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hi-jianger/ThihkingInJava21
| 201
|
FILENAME: Runnable2.java
| 0.256832
|
package com.package2119;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
/**
* @author jianger
* @Date 2018/2/26 下午8:59
**/
public class Runnable2 implements Runnable {
private Runnable1 waitNotify;
public Runnable2(Runnable1 waitNotify) {
this.waitNotify = waitNotify;
}
@Override
public void run() {
synchronized (waitNotify) {
waitNotify.notifyAll();
}
}
public static void main(String[] args) throws InterruptedException {
// WaitNotify waitNotify=new WaitNotify();
Runnable1 runnable1 = new Runnable1();
ExecutorService executorService = Executors.newCachedThreadPool();
executorService.execute(runnable1);
TimeUnit.SECONDS.sleep(1);
executorService.execute(new Runnable2(runnable1));
TimeUnit.SECONDS.sleep(1);
executorService.shutdown();
}
}
|
18617aa3-a378-45aa-85b4-c258885935ab
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-11-15T22:28:20", "repo_name": "smandable/de-obfuscate", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 964, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "629afdd64e7cc1ca320fe528ad4119df79967e09", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/smandable/de-obfuscate
| 272
|
FILENAME: README.md
| 0.271252
|
# de-obfuscate
Fixes obfuscated filenames by renaming them to the name of the directory they are contained in.
When one obtains a file via NNTP, or BitTorrent, or whatever, they are often "obfuscated".
What this means is that, when it's done downloading, you'll have a directory named (for example):
ShowTitle.S01E01.1080p.HDTV.x264-AVS
This is all well and good- but the file contained within this directory is named something slightly less useful:
41948484cf014f3f994f605c2e842aa6.mp4
This script will rename each file with the name of its parent folder, and will also find and remove common patterns in said directory name, like "1080p", "720p", "x264", "DVDRip", etc.
The example given above would be renamed to "ShowTitle.S01E01.mp4".
It'll work on however many folders you put in the directory it's working in (I've got a "de-obfuscate" folder I use), and will also delete the original folders so you'll be left with nothing but the filenames.
|
08bc42e6-53b6-42bf-af9c-b7daa4da0888
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-02 02:19:34", "repo_name": "vonrepiks/Java-Web-May-2018", "sub_path": "/Java Web Development Basics/Exams/JavaEEBlock/src/main/java/repositories/ProductRepository.java", "file_name": "ProductRepository.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "097d9df7eea2c0c242b15a684ab21e95c3f3d4f3", "star_events_count": 1, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/vonrepiks/Java-Web-May-2018
| 193
|
FILENAME: ProductRepository.java
| 0.271252
|
package repositories;
import models.Product;
import models.ProductType;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class ProductRepository {
private List<Product> products;
public ProductRepository() {
this.products = new ArrayList<>();
this.seedProducts();
}
public List<Product> getProducts() {
return Collections.unmodifiableList(this.products);
}
private void seedProducts() {
this.products.add(new Product("Chushkopek", "A universal tool for …", ProductType.valueOf("Domestic".toUpperCase())));
this.products.add(new Product("Injektoplqktor", "Dunno what this is…", ProductType.valueOf("Cosmetic".toUpperCase())));
this.products.add(new Product("Plumbus", "A domestic tool for everything", ProductType.valueOf("Food".toUpperCase())));
}
public void addProduct(Product product) {
this.products.add(product);
}
}
|
4a292384-dd48-4077-ae03-e4064716f76d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-31 03:50:20", "repo_name": "pvilhelm/deltastream_old", "sub_path": "/src/deltastream/pkg/Part.java", "file_name": "Part.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "559e3870e77796e10473fdc97a43e4facc039e82", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pvilhelm/deltastream_old
| 222
|
FILENAME: Part.java
| 0.252384
|
/*
* 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 deltastream.pkg;
/**
* A part of data sampled from the input stream at the source.
*
* Each of this parts are transmitted to the other clients and then reforged
* into the original UDP- or TCP-stream.
*
* @author Petter Tomner
*/
public class Part{
int partN; //de part number of the part
byte[] data; //generic data container
long timeCreated;//when the part was created
/**
*
* @param thisPartN the number this part has, with the first part BY THE SOURCE created at index 0
* @param thisData the data the part carries
*/
public Part(int thisPartN, byte thisData[]){
timeCreated = System.currentTimeMillis();
partN = thisPartN;
data = thisData;
}
}
|
72a8160c-f6c6-44bb-ad86-27a6500e11d9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-01 14:12:54", "repo_name": "GiansCode/PiggyBanks", "sub_path": "/src/main/java/gg/plugins/piggybanks/api/BagRedeemEvent.java", "file_name": "BagRedeemEvent.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "fb2c77b63d87ec0c02edfe7ebef1baa4cf578e31", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/GiansCode/PiggyBanks
| 193
|
FILENAME: BagRedeemEvent.java
| 0.23092
|
package gg.plugins.piggybanks.api;
import org.bukkit.OfflinePlayer;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class BagRedeemEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private OfflinePlayer player;
private int amount;
public BagRedeemEvent(OfflinePlayer player, int amount) {
this.player = player;
this.amount = amount;
}
public OfflinePlayer getPlayer() {
return player;
}
public int getAmount() {
return amount;
}
public boolean isCancelled() {
return cancelled;
}
public void setCancelled(boolean cancel) {
cancelled = cancel;
}
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
|
db9595b4-a85f-4e7b-a93f-6a9a4b7f1eb6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-12 06:31:14", "repo_name": "yairramirez/Horario", "sub_path": "/app/src/main/java/mx/ipn/escom/horario/Registro_AluActivity.java", "file_name": "Registro_AluActivity.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "44986a2c086d432a47d93eb4c60f4861980de67e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yairramirez/Horario
| 187
|
FILENAME: Registro_AluActivity.java
| 0.194368
|
package mx.ipn.escom.horario;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
public class Registro_AluActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registro__alu);
}
EditText tx = findViewById(R.id.Nombre_a);
public void registro(View view) {
String cadena1 = "20";
Integer bo = Integer.valueOf(String.valueOf(tx));
if(cadena1.equals(bo)) {
System.out.println("Es alumono");
} else {
System.out.println("Es profesor");
}
Intent r = new Intent(Registro_AluActivity.this, MainActivity.class);
startActivity(r);
finish();
}
public void cancelar_a(View view) {
finish();
}
}
|
2f377a5a-f2b4-40a1-9e63-da8c01321eda
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-03-24T02:26:34", "repo_name": "dansakamoto/emoticam-server", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 965, "line_count": 15, "lang": "en", "doc_type": "text", "blob_id": "087261835a3d3253b8c3637924e3809ea2d89951", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dansakamoto/emoticam-server
| 216
|
FILENAME: README.md
| 0.204342
|
# emoticam-server
[Emoticam](//www.emoticam.net) is a program that ran (consensually) in the background on a bunch of personal computers, from 2013-2018.
Anytime a user typed something to imply they were emoting in real life, it took a photo of their face and uploaded it to the project page (and formerly to Twitter).
This is the server-side software.
* docking.php handles receiving images uploaded by the desktop app
* index.php handles adding received images to the database + displaying all images
* settings.php stores database credentials and unique user codes for known participants
* receiver/poster.php handles sending new posts to Twitter (now defunct).
[The client app can be found here](https://github.com/dansakamoto/emoticam-app).
Note: there was an issue with certain Mac models purchased after the project began which caused some of the images to be underexposed. This is the reason why there are so many solid black images in the later years.
|
05fe2b83-0b98-4106-8687-1eb41313fc8f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-05-01 00:38:12", "repo_name": "futabooo/ListViewPractice", "sub_path": "/app/src/main/java/com/futabooo/listviewpractice/views/adapters/NormalAdapter.java", "file_name": "NormalAdapter.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "32756f522c5c43297dfd58211ca75d8d790d0af8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/futabooo/ListViewPractice
| 196
|
FILENAME: NormalAdapter.java
| 0.243642
|
package com.futabooo.listviewpractice.views.adapters;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.futabooo.listviewpractice.R;
import com.futabooo.listviewpractice.dummy.DummyContent;
import java.util.List;
public class NormalAdapter extends ArrayAdapter<DummyContent.DummyItem> {
public NormalAdapter(Context context, List<DummyContent.DummyItem> list) {
super(context, 0, list);
}
@Override public View getView(int position, View convertView, ViewGroup parent) {
View view = View.inflate(getContext(), R.layout.item, null);
ImageView thumbnail = (ImageView) view.findViewById(R.id.thumbnail);
thumbnail.setImageResource(R.mipmap.ic_launcher);
TextView title = (TextView) view.findViewById(R.id.title);
title.setText(getItem(position).toString());
return view;
}
}
|
a63ea173-6785-4b5e-81cc-9c5f28f4a886
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-02 22:56:50", "repo_name": "AkaZecik/java_multiclient_chat", "sub_path": "/src/user/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "5d4e09c660aa884f53b0c8d9493275758bf0dd16", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AkaZecik/java_multiclient_chat
| 197
|
FILENAME: User.java
| 0.229535
|
package user;
import java.io.Serializable;
import java.util.Objects;
public class User implements Serializable {
private volatile int id;
private volatile String username;
public User() {
this.username = null;
}
public User(Integer id, String username) {
this.id = id;
this.username = username;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof User)) {
return false;
}
User user = (User) o;
return Objects.equals(this.username, user.username) && Objects.equals(this.id, user.id);
}
@Override
public String toString() {
return username;
}
}
|
8fe6b6dd-0ebb-4061-9e14-a5d6742b52ef
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-20 07:00:24", "repo_name": "sudeepkrishnan87/spring-cloud", "sub_path": "/library/library/src/main/java/com/mytechexp/library/controller/LibraryController.java", "file_name": "LibraryController.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "53b81c63430c2d5cf05ada6caac0bacc879ec0c7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sudeepkrishnan87/spring-cloud
| 187
|
FILENAME: LibraryController.java
| 0.253861
|
package com.mytechexp.library.controller;
import com.mytechexp.library.entity.Library;
import com.mytechexp.library.service.LibraryService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Optional;
@RestController
@RequestMapping("/library")
@Log4j2
public class LibraryController {
@Autowired
private LibraryService libService;
@PostMapping("/create")
public Library createLibrary(@RequestBody Library library)
{
log.info("inside create controller");
libService.createLibrary(library);
log.info("executed the createLibrary");
return library;
}
@GetMapping("/{id}")
public Library searchLibrary(@PathVariable long id)
{
Optional<Library> lib=libService.findbyId(id);
if(lib.isPresent())
return lib.get();
else
return null;
}
}
|
45aba1f5-135c-4663-a96d-eb02af2cea2f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-04 09:11:01", "repo_name": "supriyachittimalla/supriya", "sub_path": "/Supriya/src/find_elements/date_picker_active_dates.java", "file_name": "date_picker_active_dates.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "8b6702c7b42c616efac06a857730a247a20b0735", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/supriyachittimalla/supriya
| 200
|
FILENAME: date_picker_active_dates.java
| 0.253861
|
package find_elements;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class date_picker_active_dates {
public static void main(String[] args) throws Exception
{
System.setProperty("webdriver.chrome.driver","drivers\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get("https://www.cleartrip.com/trains");
driver.manage().window().maximize();
WebElement date_picker=driver.findElement(By.xpath("//input[@id='dpt_date']"));
date_picker.click();
for (int i = 0; i <=3; i++);
WebElement active_month;
active_month=driver.findElement(By.xpath("//input[@id='dpt_date']"));
List<WebElement> active_dates;
active_dates=(List<WebElement>) active_month.findElement(By.xpath("javascript: void(0);"));
}
}
|
a4d62741-1099-4f2d-a4c9-4c0dc4fbe29e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-30 13:12:48", "repo_name": "eikhyeonchoi/bitcamp-java-2018-12", "sub_path": "/java-project-server/src04/main/java/com/eomcs/lms/ServerTest.java", "file_name": "ServerTest.java", "file_ext": "java", "file_size_in_byte": 1004, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "448aff7b861e08983d267577b4522d6bc8b60750", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/eikhyeonchoi/bitcamp-java-2018-12
| 221
|
FILENAME: ServerTest.java
| 0.239349
|
package com.eomcs.lms;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import com.eomcs.lms.domain.Member;
public class ServerTest {
public static void main(String[] args) {
try (Socket socket = new Socket("localhost", 8888);
ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
ObjectInputStream in = new ObjectInputStream(socket.getInputStream()); ){
System.out.println("서버와 연결되었음.");
Member member = new Member();
member.setNo(1);
member.setName("홍길동");
member.setEmail("hong@test.com");
member.setPassword("1111");
member.setPhoto("hong.gif");
member.setTel("1111-1111");
out.writeObject(member);
out.flush();
System.out.println(in.readUTF());
System.out.println("서버와 연결 끊었음.");
} catch(Exception e) {
e.printStackTrace();
}
} // main
}
|
0a469404-b875-4555-af76-4d5c8c295cc2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-26 18:10:50", "repo_name": "martesz/workLogger", "sub_path": "/src/main/java/database/UserDao.java", "file_name": "UserDao.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "851de9c2d1cc643c0f5dd1c4f12dc8fb9bbc71b8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/martesz/workLogger
| 211
|
FILENAME: UserDao.java
| 0.26588
|
package database;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import entities.User;
@Stateless
public class UserDao {
@PersistenceContext(unitName = "workLoggerPu")
EntityManager em;
public User getUserByGoogleId(String googleId) {
User user = em.find(User.class, googleId);
return user;
}
public void insert(User user) {
em.persist(user);
}
public void updateLevel(String googleId, String level) {
User user = em.find(User.class, googleId);
user.setLevelFromString(level);
}
public List<User> getUsers() {
TypedQuery<User> query = em.createQuery("SELECT u FROM User u", User.class);
List<User> resultList = query.getResultList();
return resultList;
}
public void updateUser(final User user) {
em.merge(user);
}
public void removeUser(final User databaseUser) {
em.remove(databaseUser);
}
}
|
f61b6ea6-cea2-4d89-ad14-c5af7caafa54
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-18 06:27:00", "repo_name": "jcweb/BeautyMeter", "sub_path": "/src/main/java/cn/yaman/http/YamanHttpCallback.java", "file_name": "YamanHttpCallback.java", "file_ext": "java", "file_size_in_byte": 962, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "0cf35fb4a42876e20931df4b3f037394940ec5dd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jcweb/BeautyMeter
| 204
|
FILENAME: YamanHttpCallback.java
| 0.2227
|
package cn.yaman.http;
import androidx.annotation.Nullable;
import cn.lamb.activity.BaseActivity;
import cn.lamb.http.HttpCallback;
/**
* @author timpkins
*/
public class YamanHttpCallback implements HttpCallback {
private BaseActivity activity;
public YamanHttpCallback() {
}
public YamanHttpCallback(BaseActivity activity) {
this.activity = activity;
}
@Override
public void onStart() {
if (activity != null) {
activity.showLoading();
}
}
@Override
public void onFailure(String url, String statusCode) {
}
@Override
public void onSuccess(String url, @Nullable Object o) {
}
@Override
public void onSuccess(String url, String result) {
}
@Override
public void onError(String url, Exception e) {
}
@Override
public void onFinish() {
if (activity != null) {
activity.dismissLoading();
}
}
}
|
a57e6bf7-04ae-4a86-a8ac-e1d3647040d2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-09 10:58:45", "repo_name": "sdsd08013/oper_interpreter", "sub_path": "/non_terminal_expression/NonTerminalExpression.java", "file_name": "NonTerminalExpression.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "bd5a05fb40241982c6a6f09b56d06f6ba1acf3e8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sdsd08013/oper_interpreter
| 162
|
FILENAME: NonTerminalExpression.java
| 0.250913
|
package non_terminal_expression;
import java.util.List;
import java.util.ArrayList;
import abstract_expression.*;
import terminal_expression.*;
import context.*;
public class NonTerminalExpression extends AbstractExpression{
private int resultValue;
private String Plus = "+";
private List<AbstractExpression> list = new ArrayList<AbstractExpression>();
public int interpret(Context context){
AbstractExpression childExpressions;
context.nextToken();
String token = "";
while(!context.isEnd()){
token = context.getToken();
if(Plus.equals(token)){
childExpressions = new NonTerminalExpression();
}else{
childExpressions = new TerminalExpression();
}
resultValue += childExpressions.interpret(context);
}
return resultValue;
}
public String toString(){
return "+" + list.toString();
}
}
|
df9c739f-e719-441f-83db-318527e6e041
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-30 00:17:25", "repo_name": "AsturaPhoenix/alchemy", "sub_path": "/Substrate/src/main/java/io/baku/alchemy/substrate/predicates/ParsePredicate.java", "file_name": "ParsePredicate.java", "file_ext": "java", "file_size_in_byte": 962, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "9a77e0d8b018d5c484d178088c29e94d20f1ec23", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AsturaPhoenix/alchemy
| 189
|
FILENAME: ParsePredicate.java
| 0.291787
|
package io.baku.alchemy.substrate.predicates;
import java.util.function.Predicate;
import edu.umd.cs.findbugs.annotations.NonNull;
import io.baku.alchemy.substrate.Scanner;
import io.baku.alchemy.substrate.symbols.Symbol;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Getter
public abstract class ParsePredicate {
public static final ParsePredicate EOF = create(0, 0, s -> !s.hasCurrent());
public static ParsePredicate create(final int width, final float entropy,
final Predicate<? super Scanner<? extends Symbol>> fn) {
return new ParsePredicate(width, entropy) {
@Override
public boolean test(final @NonNull Scanner<? extends Symbol> state) {
return fn.test(state);
}
};
}
private final int width;
private final float entropy;
public abstract boolean test(@NonNull Scanner<? extends Symbol> state);
}
|
8fca2f6f-55b6-4c8f-86ea-f86a10b127c4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-01 16:11:28", "repo_name": "BarryLiu/Resources", "sub_path": "/Work35_Safety/src/com/example/safe/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 963, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "c505d0d87633941d13228d72c77e6b84ece3dc8e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/BarryLiu/Resources
| 190
|
FILENAME: MainActivity.java
| 0.23092
|
package com.example.safe;
import com.example.work35_md5.R;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
public class MainActivity extends Activity {
private EditText tvInput;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void click1(View v){
Intent intent =new Intent(this,MD5Activity.class);
startActivity(intent);
}
public void click2(View v){
Intent intent =new Intent(this,AesActivity.class);
startActivity(intent);
}
public void click3(View v){
Intent intent =new Intent(this,RsaActivity.class);
startActivity(intent);
}
public void click4(View v){
Intent intent =new Intent(this,HttpsActivity.class);
startActivity(intent);
}
}
|
239962a3-93d3-412d-ac9c-97117f19342b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-02-19 05:05:42", "repo_name": "jfizz/shirtsio-java", "sub_path": "/src/main/java/com/shirtsio/model/Order.java", "file_name": "Order.java", "file_ext": "java", "file_size_in_byte": 962, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "d2d55070dfaf8a118718f786f8d10d882f57ba93", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jfizz/shirtsio-java
| 194
|
FILENAME: Order.java
| 0.224055
|
package com.shirtsio.model;
import org.codehaus.jackson.annotate.JsonProperty;
import java.math.BigDecimal;
import java.util.Date;
public class Order {
private BigDecimal price;
@JsonProperty("order_id")
private Long orderId;
private String[] warnings;
@JsonProperty("delivery_date")
private Date deliveryDate;
public Date getDeliveryDate() {
return deliveryDate;
}
public void setDeliveryDate(Date deliveryDate) {
this.deliveryDate = deliveryDate;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public String[] getWarnings() {
return warnings;
}
public void setWarnings(String[] warnings) {
this.warnings = warnings;
}
}
|
7578d44e-bec7-4d58-afc4-eca0105ff1d5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-04-09T08:38:06", "repo_name": "marquelzikri/rest-hapi-admin-bro", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 964, "line_count": 50, "lang": "en", "doc_type": "text", "blob_id": "e8dda053e09bfff3b650f04c8632e56eb309a915", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/marquelzikri/rest-hapi-admin-bro
| 280
|
FILENAME: README.md
| 0.239349
|
# rest-hapi-demo
A template to auto generate RESTful API and admin dashboard using [rest-hapi](https://github.com/JKHeadley/rest-hapi) and [adminBro](https://adminbro.com/) Hapi plugin.
## Requirements
You need [Node.js version >= 12](https://nodejs.org/en/) installed and you'll need [MongoDB](https://docs.mongodb.com/manual/installation/) installed and running.
## Installation
clone the repo
```
$ git clone https://github.com/marquelzikri/rest-hapi-admin-bro
$ cd rest-hapi-admin-bro
```
install the dependencies
```
$ npm install
```
copy env file
```
$ cp .env.example .env
```
seed the models
- Local db
```
$ ./node_modules/.bin/rest-hapi-cli seed
```
- External db
```
$ ./node_modules/.bin/rest-hapi-cli seed <your mongoDB url>
```
## Using the app
start the api
```
$ npm start
```
view the api docs at
[http://localhost:8080/](http://localhost:8080/)
view the admin dashboard at
[http://localhost:8080/admin](http://localhost:8080/admin)
|
df07fbbd-47a8-42fc-be6e-856a564eadc0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-15 02:05:05", "repo_name": "xuhuangyun/MyCoffee", "sub_path": "/bean/coffe/ImageBean.java", "file_name": "ImageBean.java", "file_ext": "java", "file_size_in_byte": 962, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "b5626dd058cd84d08a684450688b04a5c3c6fb96", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/xuhuangyun/MyCoffee
| 212
|
FILENAME: ImageBean.java
| 0.199308
|
package com.fancoff.coffeemaker.bean.coffe;
import java.io.Serializable;
/**
* Created by apple on 2018/2/1.
*/
/**
*/
public class ImageBean implements Serializable {
String url;
PositionBean position;
public ImageBean(String url) {
this.url = url;
}
public String getUrl() {
return url;
}
Clickbean click;
public void setUrl(String url) {
this.url = url;
}
public PositionBean getPosition() {
return position;
}
public void setPosition(PositionBean position) {
this.position = position;
}
public Clickbean getClick() {
return click;
}
public void setClick(Clickbean click) {
this.click = click;
}
@Override
public String toString() {
return "ImageBean{" +
"url='" + url + '\'' +
", position=" + position +
", click=" + click +
'}';
}
}
|
41439852-2998-488b-88fb-f3ee6efbd12e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-11 13:39:04", "repo_name": "KZ-CTRL/dz1.5", "sub_path": "/src/com/company/Downloander.java", "file_name": "Downloander.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "5a936a5704dc98d19e198ef3cade16bca9f29390", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/KZ-CTRL/dz1.5
| 211
|
FILENAME: Downloander.java
| 0.291787
|
package com.company;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Semaphore;
public class Downloander extends Thread {
private int speed = 100;
private int size = 500;
private Semaphore semaphore;
private CountDownLatch cdlUp;
public Downloander(String name, Semaphore semaphore, CountDownLatch cdlUp, CountDownLatch cdlDown) {
super(name);
this.semaphore = semaphore;
this.cdlUp = cdlUp;
this.cdlDown = cdlDown;
}
private CountDownLatch cdlDown;
@Override
public void run() {
try {
cdlUp.await();
semaphore.acquire();
System.out.println(getName() + " Начал скачивать");
sleep(size / speed);
System.out.println(getName() + "Скачал");
semaphore.release();
cdlDown.countDown();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
|
d4ed90dd-9e9a-41f2-90be-383bf826bf8a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-16 17:39:39", "repo_name": "Valuya/comptoir", "sub_path": "/comptoir-ws/src/main/java/be/valuya/comptoir/ws/rest/validation/StockChangeChecker.java", "file_name": "StockChangeChecker.java", "file_ext": "java", "file_size_in_byte": 962, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "6d39df4e8b9331fef9692ce5f811747a3d496b90", "star_events_count": 2, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/Valuya/comptoir
| 202
|
FILENAME: StockChangeChecker.java
| 0.264358
|
package be.valuya.comptoir.ws.rest.validation;
import be.valuya.comptoir.model.commercial.Sale;
import be.valuya.comptoir.model.stock.ItemStock;
import be.valuya.comptoir.model.stock.StockChangeType;
import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.BadRequestException;
import java.util.Arrays;
import java.util.List;
/**
*
* @author cghislai
*/
@ApplicationScoped
public class StockChangeChecker {
public void checkStockChangeType(ItemStock itemStock, StockChangeType... expectedTypes) {
StockChangeType stockChangeType = itemStock.getStockChangeType();
if (stockChangeType == null) {
throw new AssertionError("Stock change type expected");
}
List<StockChangeType> stockChangeTypes = Arrays.asList(expectedTypes);
if (!stockChangeTypes.contains(stockChangeType)) {
throw new AssertionError("Stock change type is not allowed : "+stockChangeType);
}
}
}
|
45918de8-2c48-4a66-94b4-1ddba630acdc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-30 06:01:17", "repo_name": "AminLiu/queencastle", "sub_path": "/queencastle-all/queencastle-service/src/test/java/com/queencastle/service/test/shop/CustomerTester.java", "file_name": "CustomerTester.java", "file_ext": "java", "file_size_in_byte": 964, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "e3e5b34d7b5c220a460d92489bf7c18826a82f52", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AminLiu/queencastle
| 241
|
FILENAME: CustomerTester.java
| 0.282988
|
package com.queencastle.service.test.shop;
import org.junit.Test;
import com.queencastle.dao.model.shop.Customer;
import com.queencastle.dao.mybatis.IdTypeHandler;
import com.queencastle.service.test.BaseTest;
public class CustomerTester extends BaseTest {
@Test
// @Ignore
public void getByIdTest() {
String id = IdTypeHandler.encode(1l);
Customer result = customerService.getById(id);
if (result != null) {
System.out.println("=========" + result.getId());
System.out.println("=========" + result.getCustomerName());
System.out.println("=========" + result.getCustomerSex());
System.out.println("=========" + result.getCustomerTel());
} else {
System.out.println("=========");
}
}
@Test
// @Ignore
public void CustomertTest() {
Customer customer = new Customer();
customer.setCustomerName("drgergeg");
customer.setCustomerSex("男");
customer.setCustomerTel("14567438796");
customerService.insert(customer);
}
}
|
27d59ba8-541a-4466-ba94-42a9c9cae359
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-30 09:16:41", "repo_name": "hossein-baghshahi/farazpardazan", "sub_path": "/card-management-system-/src/main/java/com/farazpardazan/cardmanagementsystem/web/dto/card/CardDto.java", "file_name": "CardDto.java", "file_ext": "java", "file_size_in_byte": 962, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "8824210af4c0a0d428a152713f4ae8af52ec6b2a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hossein-baghshahi/farazpardazan
| 213
|
FILENAME: CardDto.java
| 0.213377
|
package com.farazpardazan.cardmanagementsystem.web.dto.card;
import com.farazpardazan.cardmanagementsystem.validator.card.CardNumber;
import javax.validation.constraints.NotBlank;
/**
* @author Hossein Baghshahi
*/
public class CardDto {
@NotBlank(message = "{card.name.empty")
private String name;
@NotBlank(message = "{card.number.empty}")
@CardNumber
private String cardNumber;
public CardDto() {
}
public CardDto(@NotBlank(message = "{card.name.empty") String name,
@NotBlank(message = "{card.number.empty}") String cardNumber) {
this.name = name;
this.cardNumber = cardNumber;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCardNumber() {
return cardNumber;
}
public void setCardNumber(String cardNumber) {
this.cardNumber = cardNumber;
}
}
|
1c9a6144-9db8-4a01-9350-bb127184d6b0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-12 12:43:10", "repo_name": "TB5z035/COVID-19News", "sub_path": "/app/src/main/java/com/java/zhangjiayou/ui/explore/utils/WXRegister.java", "file_name": "WXRegister.java", "file_ext": "java", "file_size_in_byte": 1110, "line_count": 32, "lang": "zh", "doc_type": "code", "blob_id": "ba42791165ae0187e910090fb58061f8845389ec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/TB5z035/COVID-19News
| 246
|
FILENAME: WXRegister.java
| 0.286169
|
package com.java.zhangjiayou.ui.explore.utils;
import android.content.Context;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
public class WXRegister{
// APP_ID 替换为你的应用从官方网站申请到的合法appID
private static final String APP_ID = "wx88888888";
// IWXAPI 是第三方app和微信通信的openApi接口
public static IWXAPI regToWx(Context context) {
// 通过WXAPIFactory工厂,获取IWXAPI的实例
IWXAPI api = WXAPIFactory.createWXAPI(context, APP_ID, true);
// 将应用的appId注册到微信
api.registerApp(APP_ID);
/*
//建议动态监听微信启动广播进行注册到微信
registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// 将该app注册到微信
api.registerApp(APP_ID);
}
}, new IntentFilter(ConstantsAPI.ACTION_REFRESH_WXAPP));
*/
return api;
}
}
|
571a8405-7435-4519-ba2b-dc485d53ee62
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-03 01:03:18", "repo_name": "pauIomartins/cleanarch", "sub_path": "/web/src/main/java/com/paulorobertomartins/cleanarch/infra/web/controller/presenter/InputStockResponsePresenter.java", "file_name": "InputStockResponsePresenter.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "84127bf49a5c4533d3ce49a656b0b380cd8cacf3", "star_events_count": 12, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pauIomartins/cleanarch
| 180
|
FILENAME: InputStockResponsePresenter.java
| 0.246533
|
package com.paulorobertomartins.cleanarch.infra.web.controller.presenter;
import com.paulorobertomartins.cleanarch.core.usecases.responsemodel.InputStockResponse;
import com.paulorobertomartins.cleanarch.infra.web.controller.jsonresponse.CreateMovementJsonResponse;
import lombok.Getter;
import java.util.function.Consumer;
@Getter
public class InputStockResponsePresenter implements Consumer<InputStockResponse> {
private CreateMovementJsonResponse jsonResponse;
@Override
public void accept(InputStockResponse response) {
jsonResponse = CreateMovementJsonResponse.builder()
.stockId(response.getStockId())
.movementId(response.getMovementId())
.addressFrom(null)
.addressTo(response.getAddressLabel())
.productEan(response.getProductEan())
.quantity(response.getQuantity())
.type("input")
.build();
}
}
|
cde330dc-83bd-469f-b1ad-7efdac2dce90
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-04 19:38:52", "repo_name": "abdelrahmanfarrag/FootGoals", "sub_path": "/app/src/main/java/com/app/mana/a4321football/ui/screens/mainscreen/screenContents/favorite/teamdetails/DetailPresenter.java", "file_name": "DetailPresenter.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "2882bd3f50e7d02ad530784859f0b64120895935", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/abdelrahmanfarrag/FootGoals
| 215
|
FILENAME: DetailPresenter.java
| 0.291787
|
package com.app.mana.a4321football.ui.screens.mainscreen.screenContents.favorite.teamdetails;
import android.content.Context;
import com.app.mana.a4321football.data.model.Matches;
import com.app.mana.a4321football.data.network.RetrofitServices;
import com.app.mana.a4321football.ui.base.BasePresenter;
import com.pnikosis.materialishprogress.ProgressWheel;
import io.reactivex.disposables.CompositeDisposable;
public class DetailPresenter extends BasePresenter {
private DetailResponse resp;
public DetailPresenter(Context context,
CompositeDisposable disposable, DetailResponse resp) {
super(context, disposable);
this.resp = resp;
}
public void loadGames(ProgressWheel wheel, int id, String query) {
services.getTeamPreviousGame(wheel, id, query);
}
@Override public void loadServiceData(Object model) {
if (model instanceof Matches) {
Matches matches = (Matches) model;
resp.getDetaiGames(matches);
}
}
}
|
b01e9c88-3b1c-43ad-ad36-5dd50d9b47a8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-31 02:00:28", "repo_name": "EomKun/Mogasup", "sub_path": "/mogasupServer/src/main/java/com/ssafy/mogasup/service/NoticeServiceImpl.java", "file_name": "NoticeServiceImpl.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "195956b5baa8706848b63a389e3446a317457438", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/EomKun/Mogasup
| 239
|
FILENAME: NoticeServiceImpl.java
| 0.276691
|
package com.ssafy.mogasup.service;
import java.util.HashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ssafy.mogasup.dao.NoticeDao;
import com.ssafy.mogasup.dto.Notice;
@Service
public class NoticeServiceImpl implements NoticeService {
@Autowired
NoticeDao dao;
@Override
public void insert(Notice notice) {
dao.insert(notice);
}
@Override
public void delete(int notice_id) {
dao.delete(notice_id);
}
@Override
public List<Notice> find(int family_id) {
return dao.find(family_id);
}
@Override
public void update(Notice notice) {
dao.update(notice);
}
@Override
public String getNickname(int user_id) {
return dao.getNickname(user_id);
}
@Override
public Notice read(int notice_id) {
return dao.read(notice_id);
}
@Override
public String getNoticeId(int family_id) {
return dao.getNoticeId(family_id);
}
}
|
d48ab329-35f0-431f-a88c-7910c2936d1c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-17 13:38:56", "repo_name": "DanusiaZabcia/Selenium", "sub_path": "/com.secretofglory/src/test/java/testowka/Selenium1.java", "file_name": "Selenium1.java", "file_ext": "java", "file_size_in_byte": 962, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "83226212d9b16baa88b0deee2989d1cca50bffdd", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/DanusiaZabcia/Selenium
| 218
|
FILENAME: Selenium1.java
| 0.281406
|
package testowka;
import static junit.framework.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
public class Selenium1 {
@Before
public void before(){
System.setProperty("webdriver.gecko.driver", "D:\\Danusia\\Testowanie\\geckodriver-v0.14.0-win64\\geckodriver.exe");
}
@Test
public void driveIsTheKing(){
WebDriver driver = new HtmlUnitDriver();
driver.get("http://compendiumdev.co.uk/selenium");
assertTrue(driver.getTitle().startsWith("Selenium Simplified"));
}
@Test
public void firefoxIsSupportedByWebdriver(){
WebDriver driver = new FirefoxDriver();
driver.get("http://compendiumdev.co.uk/selenium");
assertTrue(driver.getTitle().startsWith("Selenium Simplified"));
driver.quit();
}
}
|
cb3f886e-d02d-4118-b385-eff7e3587808
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-09T18:39:35", "repo_name": "noahms456/Arduino-Bytebeat-Eurorack", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 962, "line_count": 15, "lang": "en", "doc_type": "text", "blob_id": "9c1b5b9e5873a172328d5c278908c68935b1518f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/noahms456/Arduino-Bytebeat-Eurorack
| 244
|
FILENAME: README.md
| 0.203075
|
# Arduino-Bytebeat-Eurorack
this is based on stimmer's code from the arduino forums, based on Viznut's work
see viznut's blog http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
and http://www.youtube.com/watch?v=GtQdIYUtAHg&feature=related
So all this does is take the original code, add an X and Y input with pots, and a "function" selector with a button.
It's compiled and it works on my Uno, but the pushbutton function selector functionality does not respond. I think it's something to do with the looping nature of the writing to the pin 10, but I'm new to Arduino coding.
The first function is obnoxious and terrible with the X and Y changing, but it proves the concept.
Once i've hashed out why I can't get it to change functions, I'll send the thing out into the world and hope for the best!
A planned feature is the ability to slow the velocity of the noise generated, but I'm not quite sure how to do it, yet.
|
9bfb6b9e-284f-4c25-9409-2805387f1767
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-20 15:28:11", "repo_name": "CedricMoser/TheGame", "sub_path": "/src/window/KeyCallBack.java", "file_name": "KeyCallBack.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "d316c0b29e54fa78b5079bdbc4f438ca411e96d1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/CedricMoser/TheGame
| 192
|
FILENAME: KeyCallBack.java
| 0.26588
|
package window;
import gui.KeyPressedEvent;
import gui.KeyReleasedEvent;
import org.lwjgl.glfw.GLFWKeyCallbackI;
import static org.lwjgl.glfw.GLFW.GLFW_PRESS;
import static org.lwjgl.glfw.GLFW.GLFW_RELEASE;
public class KeyCallBack implements GLFWKeyCallbackI {
private Window mWindow;
public KeyCallBack(Window window) {
this.mWindow = window;
}
@Override
public void invoke(long window, int key, int scancode, int action, int mods) {
if (this.mWindow.getHandle() == window) {
switch (action) {
case GLFW_PRESS: {
this.mWindow.pushEvent(new KeyPressedEvent(key, scancode));
break;
}
case GLFW_RELEASE: {
this.mWindow.pushEvent(new KeyReleasedEvent(key, scancode));
break;
}
default:
break;
}
}
}
}
|
683c7e37-204c-4050-a92d-c7bcbf476c10
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-27T22:51:01", "repo_name": "K0bus/BetterHalloween", "sub_path": "/src/fr/k0bus/betterhalloween/event/ZombieKill.java", "file_name": "ZombieKill.java", "file_ext": "java", "file_size_in_byte": 963, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "47d97117373b8749a2341c6414638ba5bac3c0cc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/K0bus/BetterHalloween
| 226
|
FILENAME: ZombieKill.java
| 0.23231
|
package fr.k0bus.betterhalloween.event;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.inventory.ItemStack;
import fr.k0bus.betterhalloween.Main;
import fr.k0bus.betterhalloween.items.KeyItem;
import fr.k0bus.betterhalloween.items.KeyType;
public class ZombieKill implements Listener{
@EventHandler(ignoreCancelled = true)
public void onKill(EntityDeathEvent e)
{
if(e.getEntity().getKiller() instanceof Player && e.getEntity().hasMetadata("herobrine"))
{
Player p = (Player) e.getEntity().getKiller();
Main.plugin.getServer().broadcastMessage(Main.tag + p.getDisplayName() + " a détruit un fragment d'âme d'Herobrine !");
ItemStack key = new KeyItem(KeyType.IRON, 1);
e.getDrops().clear();
e.getEntity().getWorld().dropItemNaturally(e.getEntity().getLocation(), key);
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.