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 |
|---|---|---|---|---|---|---|
f3ee40f4-4f1d-4693-8691-50e830f9795b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-10 12:10:15", "repo_name": "moomooda/zeusRpc", "sub_path": "/zeusRpc-demo/src/main/java/group/zeus/demo/client/RpcClientBootStrap.java", "file_name": "RpcClientBootStrap.java", "file_ext": "java", "file_size_in_byte": 1073, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "3562a9900d7b46ed31b4eb33598cb5cbacd72916", "star_events_count": 7, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/moomooda/zeusRpc | 239 | FILENAME: RpcClientBootStrap.java | 0.258326 | package group.zeus.demo.client;
import group.zeus.demo.api.Person;
import group.zeus.rpc.RpcClientConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
/**
* @Author: maodazhan
* @Date: 2020/12/5 22:25
*/
public class RpcClientBootStrap {
public static void main(String[] args) {
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(RpcClientConfiguration.class, ClientApplicationConfiguration.class);
// 确保销毁资源
applicationContext.registerShutdownHook();
WelcomeImpl welcome = applicationContext.getBean(WelcomeImpl.class);
welcome.welcome(new Person("dazhan", "mao"));
welcome.welcome("maodazhan");
// 测试心跳
// try {
// Thread.sleep(1000000);
// welcome.welcome(new Person("dazhan", "mao"));
// welcome.welcome("maodazhan");
// Thread.sleep(100000);
// } catch (Exception ex){
// //
// }
}
}
|
04f8013c-a4ca-4a94-bf4f-46846a6030cf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-23 11:04:00", "repo_name": "KevinGuancheDarias/owge", "sub_path": "/business/src/main/java/com/kevinguanchedarias/owgejava/entity/listener/UpgradeListener.java", "file_name": "UpgradeListener.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "fd6a739c8d3bd47475eb9969394155497d752b4e", "star_events_count": 4, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/KevinGuancheDarias/owge | 223 | FILENAME: UpgradeListener.java | 0.264358 | package com.kevinguanchedarias.owgejava.entity.listener;
import com.kevinguanchedarias.owgejava.business.RequirementInformationBo;
import com.kevinguanchedarias.owgejava.entity.Upgrade;
import com.kevinguanchedarias.owgejava.enumerations.ObjectEnum;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.PostLoad;
/**
* @author Kevin Guanche Darias <kevin@kevinguanchedarias.com>
* @since 0.9.0
*/
@Component
public class UpgradeListener {
private final RequirementInformationBo requirementInformationBo;
@Lazy
public UpgradeListener(RequirementInformationBo requirementInformationBo) {
this.requirementInformationBo = requirementInformationBo;
}
@PostLoad
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void loadRequirements(Upgrade upgrade) {
upgrade.setRequirements(requirementInformationBo.findRequirements(ObjectEnum.UPGRADE, upgrade.getId()));
}
}
|
fb63f46d-d877-4bc5-a55d-b72ba39dc3df | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-11 11:02:29", "repo_name": "lsfst/algorithm", "sub_path": "/src/main/java/com/algorithm/longpoll/deferredResult/PoolingMessage.java", "file_name": "PoolingMessage.java", "file_ext": "java", "file_size_in_byte": 1202, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "50352fb7948bd836cc3d1f5174d3313dfb2d06b0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lsfst/algorithm | 260 | FILENAME: PoolingMessage.java | 0.274351 | package com.algorithm.longpoll.deferredResult;
import java.util.HashMap;
import java.util.Map;
public class PoolingMessage {
private String vid;
private long lastConnectime;
private Map<String,String> message;
public PoolingMessage( String vid){
this(vid,"","");
}
public PoolingMessage( String vid, String type, String message){
this.vid = vid;
this.lastConnectime = System.currentTimeMillis();
this.message = new HashMap<>();
this.message.put( type,message );
}
public String getVid() {
return vid;
}
public void setVid( String vid ) {
this.vid = vid;
}
public long getLastConnectime() {
return lastConnectime;
}
public void setLastConnectime( long lastConnectime ) {
this.lastConnectime = lastConnectime;
}
public Map< String, String> getMessage() {
return message;
}
public void setMessage( Map message ) {
this.message = message;
}
public void setMessage( String type,String msg) {
if(this.message==null){
this.message = new HashMap<>( );
}
this.message.put( type,msg );
}
}
|
6d19406a-9dd7-46f3-a879-19c02c403f9e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-18 02:17:49", "repo_name": "gocd/gocd", "sub_path": "/config/config-server/src/main/java/com/thoughtworks/go/config/exceptions/ConfigFileHasChangedException.java", "file_name": "ConfigFileHasChangedException.java", "file_ext": "java", "file_size_in_byte": 462, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "0cdfc7cce0e71d6691dbb0e922db350d1efcc394", "star_events_count": 6443, "fork_events_count": 1074, "src_encoding": "UTF-8"} | https://github.com/gocd/gocd | 218 | FILENAME: ConfigFileHasChangedException.java | 0.226784 | /*
* Copyright 2023 Thoughtworks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.thoughtworks.go.config.exceptions;
/**
* @understands the condition when the config file change failed because it has already been changed by someone else
*/
public class ConfigFileHasChangedException extends RuntimeException {
public static final String CONFIG_CHANGED_PLEASE_REFRESH = "Configuration file has been modified by someone else.";
public ConfigFileHasChangedException() {
super(CONFIG_CHANGED_PLEASE_REFRESH);
}
}
|
0e8a0c6d-2970-4427-83a6-fe88785d20df | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-23 08:45:05", "repo_name": "RegishGeorge/wander_mate", "sub_path": "/app/src/main/java/com/example/wandermate/RouteDetails.java", "file_name": "RouteDetails.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "e1281c43bfedebbc9fb18430894a283545221e7e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/RegishGeorge/wander_mate | 267 | FILENAME: RouteDetails.java | 0.286968 | package com.example.wandermate;
import androidx.room.Entity;
import androidx.room.ForeignKey;
@Entity(foreignKeys = {@ForeignKey(entity = Route.class, parentColumns = "route_id", childColumns = "route_id"),
@ForeignKey(entity = Stop.class, parentColumns = "stop_id", childColumns = "stop_id")},
primaryKeys = {"route_id", "stop_id"})
public class RouteDetails {
private int route_id;
private int stop_id;
private int stop_number;
private int duration_hrs;
private int duration_mins;
public RouteDetails(int route_id, int stop_id, int stop_number, int duration_hrs, int duration_mins) {
this.route_id = route_id;
this.stop_id = stop_id;
this.stop_number = stop_number;
this.duration_hrs = duration_hrs;
this.duration_mins = duration_mins;
}
public int getRoute_id() {
return route_id;
}
public int getStop_id() {
return stop_id;
}
public int getStop_number() {
return stop_number;
}
public int getDuration_hrs() {
return duration_hrs;
}
public int getDuration_mins() {
return duration_mins;
}
}
|
a803aeb8-1dfe-4035-8bfc-f47d61f1b4b3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-01 03:35:03", "repo_name": "haibofaith/Yunqiu", "sub_path": "/app/src/com/kball/util/KballActivityManager.java", "file_name": "KballActivityManager.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "c66e439f2ccb5f0a5fd67f1bf54d04369ca92e99", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/haibofaith/Yunqiu | 231 | FILENAME: KballActivityManager.java | 0.276691 | package com.kball.util;
import android.app.Activity;
import java.util.Stack;
/**
* Activity管理
* <p/>
* lizheng -- 15/5/21
* <p/>
* weici
*/
public class KballActivityManager {
private static KballActivityManager instance;
private Stack<Activity> mActivityStack = new Stack<Activity>();
private KballActivityManager() {
}
public static KballActivityManager getInstance() {
if (null == instance) {
instance = new KballActivityManager();
}
return instance;
}
public void addActivity(Activity act) {
mActivityStack.push(act);
}
public void removeActivity(Activity act) {
mActivityStack.remove(act);
}
public void killMyProcess() {
int nCount = mActivityStack.size();
for (int i = nCount - 1; i >= 0; i--) {
Activity activity = mActivityStack.get(i);
activity.finish();
}
mActivityStack.clear();
// android.os.Process.killProcess(android.os.Process.myPid());
}
}
|
bae2d645-60ca-4dff-b8db-a56502a940b9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-14 12:37:17", "repo_name": "shaunhossain/ImComingDear", "sub_path": "/app/src/main/java/com/shaunhossain/imcomingdear/data/models/Message.java", "file_name": "Message.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "159f8069423cf937bf89c7ba183edcc22f448ac0", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shaunhossain/ImComingDear | 236 | FILENAME: Message.java | 0.225417 | package com.shaunhossain.imcomingdear.data.models;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.Ignore;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;
/**
* Created by adriaboschsaez on 19/11/2017.
*/
@Entity(tableName = "messages")
public class Message {
@PrimaryKey
@NonNull
private String time;
private String text;
private boolean isMine;
public void setTime(String time) {
this.time = time;
}
public void setMine(boolean mine) {
isMine = mine;
}
public void setText(String text) {
this.text = text;
}
public Message() {
}
@Ignore
public Message(String time, boolean isMine, String text) {
this.time = time;
this.isMine = isMine;
this.text = text;
}
public boolean getIsMine() {
return isMine;
}
public String getTime() {
return time;
}
public String getText() {
return text;
}
}
|
8f1909dd-6a45-470d-8ab4-2d7d861e1d94 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-05 18:19:57", "repo_name": "EmanuelGabriel/projeto-agenda-api", "sub_path": "/src/main/java/br/com/srsolution/agenda/api/dtos/request/ClienteModelInputRequest.java", "file_name": "ClienteModelInputRequest.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "b7f686dce51a0bdd7fc4bc5b4be5479cff3a5f11", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/EmanuelGabriel/projeto-agenda-api | 255 | FILENAME: ClienteModelInputRequest.java | 0.214691 | package br.com.srsolution.agenda.api.dtos.request;
import java.io.Serializable;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.br.CPF;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ClienteModelInputRequest implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "nome", type = "string", format = "string", description = "nome do cliente", required = true, example = "Fulano")
@NotBlank
@Size(min = 5, max = 90)
private String nome;
@Schema(name = "email", type = "string", format = "string", description = "email do cliente", required = true, example = "email@email.com.br")
@Email
@NotBlank
private String email;
@Schema(name = "cpf", type = "string", format = "string", description = "CPF do cliente", required = true, example = "000.000.000-00")
@CPF
@NotBlank
private String cpf;
}
|
3a7bbcbd-4b13-4849-8818-02f16e32939e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-10 13:46:38", "repo_name": "lichaoliu/lottery", "sub_path": "/src/main/java/com/lottery/log/Tphase.java", "file_name": "Tphase.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "038bb7097f65d6f0e1940f502d7aecc3fcb6dfd0", "star_events_count": 7, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/lichaoliu/lottery | 269 | FILENAME: Tphase.java | 0.247987 | package com.lottery.log;
import com.lottery.common.util.HTTPUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import java.util.Map;
/**
* Created by fengqinyun on 15/8/25.
*/
public class Tphase {
public static void main(String[] args) {
String platyType="1001";
System.out.println(platyType.endsWith("01"));
//dd(null);
}
public static void dd( Map<String, String> map){
String strResult=null;
try {
JSONObject paramJson = new JSONObject();
JSONArray paramJsonArray = new JSONArray();
paramJsonArray.add("18600758958");
paramJson.put("type", 2);
paramJson.put("msg", "注册test");
paramJson.put("numList", paramJsonArray);
paramJson.put("clientType", "android");
String send=paramJson.toString();
System.out.println(send);
strResult = HTTPUtil.postJson("http://118.26.65.147/smscenter/send/msg", send);
System.out.println(strResult);
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
97736790-45fc-436f-93ab-fc7abfb70851 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-12 12:11:45", "repo_name": "edoardogiacomello/TelegramBotJava-Unofficial", "sub_path": "/TelegramBotJava-Unofficial/src/main/java/com/edoardogiacomello/telegrambot/types/Voice.java", "file_name": "Voice.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "55920f66d91b888f509991a2e4bfe93a1c3770d1", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/edoardogiacomello/TelegramBotJava-Unofficial | 248 | FILENAME: Voice.java | 0.23793 | package com.edoardogiacomello.telegrambot.types;
/**
* This object represents a voice note
* Created by Edoardo Giacomello <edoardo.giacomello1990@gmail.com> on 31/03/16.
*/
public class Voice implements TelegramData{
private String fileId;
private Integer duration;
private String mimeType; //Optional
private Integer fileSize; //Optional
public Voice(String fileId, Integer duration) {
this.fileId = fileId;
this.duration = duration;
}
public Voice(String fileId, Integer duration, String mimeType, Integer fileSize) {
this.fileId = fileId;
this.duration = duration;
this.mimeType = mimeType;
this.fileSize = fileSize;
}
public String getFileId() {
return fileId;
}
public Integer getDuration() {
return duration;
}
public String getMimeType() {
return mimeType;
}
public Integer getFileSize() {
return fileSize;
}
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
public void setFileSize(Integer fileSize) {
this.fileSize = fileSize;
}
}
|
5a8cca1b-7e25-4b3f-ae2d-f32b604a04dd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-12 23:01:22", "repo_name": "RenatoFSantos/Dentalpix", "sub_path": "/src/main/java/com/midilabs/dentech/api/service/ResponsavelService.java", "file_name": "ResponsavelService.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "817f5d8164cfd7e97c653149958368b46a053821", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/RenatoFSantos/Dentalpix | 228 | FILENAME: ResponsavelService.java | 0.278257 | package com.midilabs.dentech.api.service;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.stereotype.Service;
import com.midilabs.dentech.api.model.vo.Responsavel;
import com.midilabs.dentech.api.repository.ResponsavelRepository;
@Service
public class ResponsavelService {
@Autowired
private ResponsavelRepository responsavelRepository;
public Responsavel buscarResponsavelPorId(Long id) {
return responsavelRepository.findById(id).orElseThrow(() -> new EmptyResultDataAccessException(1));
}
public Responsavel atualizar(Long id, Responsavel responsavel) {
Responsavel responsavelSalvo = this.buscarResponsavelPorId(id);
// --- Copia as propriedades alteradas para as propriedades do objeto pesquisado excluindo o código (id) que já está definido
BeanUtils.copyProperties(responsavel, responsavelSalvo, "id");
return responsavelRepository.save(responsavelSalvo);
}
}
|
9726175a-151f-4136-9e76-b6fc97e7113d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-19 02:29:24", "repo_name": "rewerma/jdbc-agent", "sub_path": "/client-pool/src/main/java/com/jdbcagent/clientpool/c3p0/JAC3p0Connection.java", "file_name": "JAC3p0Connection.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "b1e724134f5665343c9e85232ce1a58988eb3fb7", "star_events_count": 13, "fork_events_count": 5, "src_encoding": "UTF-8"} | https://github.com/rewerma/jdbc-agent | 218 | FILENAME: JAC3p0Connection.java | 0.253861 | package com.jdbcagent.clientpool.c3p0;
import com.jdbcagent.client.jdbc.JdbcConnection;
import com.jdbcagent.clientpool.ProxyConnection;
import com.mchange.v2.c3p0.impl.NewProxyConnection;
import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.SQLException;
public class JAC3p0Connection extends ProxyConnection implements Connection {
public JAC3p0Connection(Connection conn) {
super(conn);
}
@Override
public void close() throws SQLException {
JdbcConnection jdbcConn = null;
if (conn instanceof NewProxyConnection) {
NewProxyConnection newProxyConn = (NewProxyConnection) conn;
try {
Field innerField = NewProxyConnection.class.getDeclaredField("inner");
innerField.setAccessible(true);
jdbcConn = (JdbcConnection) innerField.get(newProxyConn);
} catch (Exception e) {
e.printStackTrace();
}
}
conn.close();
if (jdbcConn != null) {
jdbcConn.release();
}
}
}
|
76976ec2-c43b-4507-a8e0-f22392f0ce20 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-18 17:47:45", "repo_name": "azimoff98/STEP_IT-isp-payment-billing-service", "sub_path": "/src/main/java/az/itstep/pbs/resource/PaymentResource.java", "file_name": "PaymentResource.java", "file_ext": "java", "file_size_in_byte": 1210, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "3fa348c45ebd0864badd1c91516cad9907822e35", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/azimoff98/STEP_IT-isp-payment-billing-service | 200 | FILENAME: PaymentResource.java | 0.279828 | package az.itstep.pbs.resource;
import az.itstep.pbs.dto.PaymentRequest;
import az.itstep.pbs.entities.Payment;
import az.itstep.pbs.service.impl.PaymentService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/payments")
@RequiredArgsConstructor
@Slf4j
public class PaymentResource {
private final PaymentService paymentService;
@PostMapping
public ResponseEntity<?> pay(@RequestBody PaymentRequest request) {
log.info("Incoming payment for subscription: {} with amount {}", request.getSubscriptionNumber(), request.getAmount());
Payment response = paymentService.pay(request);
return ResponseEntity.status(HttpStatus.ACCEPTED)
.contentType(MediaType.APPLICATION_JSON)
.body(response);
}
}
|
7b91dc5b-8daa-4050-bce3-e0b06aba6e81 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-11 03:35:48", "repo_name": "jackxieweiwu/Renpeng", "sub_path": "/app/src/main/java/comnepe/example/js_kftd_35/renpeng/base/BaseActivity.java", "file_name": "BaseActivity.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "c9bfbecf78dcc8ad1b1d05b951b21e26d051340e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jackxieweiwu/Renpeng | 217 | FILENAME: BaseActivity.java | 0.26588 | package comnepe.example.js_kftd_35.renpeng.base;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.View;
import android.view.Window;
/**
* Created by renpeng on 2016/8/1.
*/
public abstract class BaseActivity extends FragmentActivity {
private static final String TAG = "BaseActivity";
private static final int NO_LAYOUT = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int layoutId = getLayoutId();
View contentView = null;
requestWindowFeature(Window.FEATURE_NO_TITLE);
if(layoutId != NO_LAYOUT){
contentView = getLayoutInflater().inflate(layoutId,null);
setContentView(contentView);
}else{
Log.d(TAG,"no content view");
}
init();
}
protected abstract int getLayoutId();
protected abstract void init();
protected <T extends View> T getViewById(int id){
return (T)findViewById(id);
}
}
|
0416344e-f8dc-4751-85db-66e0ef67e6b5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-18 21:00:33", "repo_name": "cac03/elijars", "sub_path": "/elijars-launcher/src/main/java/com/caco3/elijars/launcher/ApplicationDefinition.java", "file_name": "ApplicationDefinition.java", "file_ext": "java", "file_size_in_byte": 1091, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "e36bafb974e41186470291cbdbfcfda611a6928b", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/cac03/elijars | 205 | FILENAME: ApplicationDefinition.java | 0.258326 | package com.caco3.elijars.launcher;
import com.caco3.elijars.utils.Assert;
import java.nio.file.Path;
import java.util.List;
public class ApplicationDefinition {
private final List<Path> dependencies;
private final String mainClassName;
private final String mainModuleName;
public ApplicationDefinition(List<Path> dependencies, String mainClassName, String mainModuleName) {
Assert.notNull(dependencies, "modulePath == null");
Assert.notNull(mainClassName, "mainClassName == null");
Assert.isTrue(!mainClassName.isBlank(), "mainClassName cannot be blank");
this.dependencies = dependencies;
this.mainClassName = mainClassName;
this.mainModuleName = mainModuleName;
}
public static ApplicationDefinitionBuilder builder() {
return new ApplicationDefinitionBuilder();
}
public List<Path> getDependencies() {
return dependencies;
}
public String getMainClassName() {
return mainClassName;
}
public String getMainModuleName() {
return mainModuleName;
}
}
|
82a40948-c30c-4640-a7be-c3f93214c5de | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-26 03:18:03", "repo_name": "Jessecar96/PVLUnofficial", "sub_path": "/app/src/main/java/com/jessecar/pvl/AboutActivity.java", "file_name": "AboutActivity.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "7b2e7517616ea87e608e50002c5c96191a425b2d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Jessecar96/PVLUnofficial | 182 | FILENAME: AboutActivity.java | 0.198064 | package com.jessecar.pvl;
import android.content.Context;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import butterknife.BindView;
import butterknife.ButterKnife;
public class AboutActivity extends AppCompatActivity {
// Views
@BindView(R.id.toolbar) Toolbar vToolbar;
private ActionBar mActionBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
ButterKnife.bind(this);
setSupportActionBar(vToolbar);
mActionBar = getSupportActionBar();
mActionBar.setTitle(R.string.about);
mActionBar.setDisplayHomeAsUpEnabled(true);
mActionBar.setDisplayShowHomeEnabled(true);
vToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
finish();
}
});
}
}
|
9cb11efc-e9a0-42b4-a4cf-75f754c688e2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-20 21:52:03", "repo_name": "kelvincer/AsistenciasIDigital", "sub_path": "/app/src/main/java/com/idigital/asistenciasidigital/util/LocationUtil.java", "file_name": "LocationUtil.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "a75370b132c431ab2bfca22714e396800bfcdcb2", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/kelvincer/AsistenciasIDigital | 209 | FILENAME: LocationUtil.java | 0.214691 | package com.idigital.asistenciasidigital.util;
import android.content.Context;
import android.os.Build;
import android.provider.Settings;
import android.text.TextUtils;
/**
* Created by USUARIO on 07/04/2017.
*/
public class LocationUtil {
public static boolean isLocationServicesAvailable(Context context) {
int locationMode = 0;
String locationProviders;
boolean isAvailable = false;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
try {
locationMode = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.LOCATION_MODE);
} catch (Settings.SettingNotFoundException e) {
e.printStackTrace();
return false;
}
isAvailable = (locationMode != Settings.Secure.LOCATION_MODE_OFF);
} else {
locationProviders = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
isAvailable = !TextUtils.isEmpty(locationProviders);
}
return isAvailable;
}
}
|
2aa412b8-a50b-497a-8ab5-5ef618eb1227 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-04-02 15:22:22", "repo_name": "duongtran97/hair-salon", "sub_path": "/src/main/java/com/duongtv/hair/controller/HomeController.java", "file_name": "HomeController.java", "file_ext": "java", "file_size_in_byte": 1208, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "3085e3a0357f501474b96971eee6777d29109e19", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/duongtran97/hair-salon | 217 | FILENAME: HomeController.java | 0.233706 | package com.duongtv.hair.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import com.duongtv.hair.repository.UserRepository;
@Controller
public class HomeController {
@Autowired
private UserRepository userRepository;
@GetMapping("/")
public String index() {
return "index";
}
@PostMapping("/product")
public String home() {
return "product";
}
@GetMapping("/product")
public String getProduct(){
return "product";
}
@GetMapping("/user")
public String user(Model model) {
try {
// userRepositiry.findAll();
model.addAttribute("UserList", userRepository.findAll());
// userRepository.findAll().forEach(System.out::println);
// userRepository.findByFullname("duong").forEach(System.out::println);
return "user";
} catch (Exception e) {
System.err.println(e.getMessage());
}
return "user";
}
}
|
9ffd850e-d7a8-400b-88cb-c196b2187cd4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-29 16:37:54", "repo_name": "Slavvok/selenium_maven_allure", "sub_path": "/src/test/java/com/selenium/test/tests/TabletsTest.java", "file_name": "TabletsTest.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "d8fbc308d816f3d1a03c1cb91e6a10c701a3b7b4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Slavvok/selenium_maven_allure | 212 | FILENAME: TabletsTest.java | 0.275909 | package com.selenium.test.tests;
import com.selenium.test.MainTest;
import io.qameta.allure.junit4.DisplayName;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class TabletsTest extends MainTest {
@Test
@DisplayName("Market tablets test")
public void test(){
yandexPage.getMarket();
mainMenu.getComputers();
categoriesPage.getTablets();
itemsPage.getAllFilters();
filtersPage.setPrices("20000", "25000")
.showAllBrands()
.chooseBrands(driver,"Acer", "Lenovo")
.getResults();
int a = itemsPage.countItems();
System.out.println(a);
String title1 = itemsPage.getItemTitle(0);
mainMenu.itemSearch(title1);
String title2 = itemPage.itemTitleSearch();
System.out.println(title2);
assertTrue(title2.contains(title1));
int so = itemPage.countShopOffers();
System.out.println(so);
}
}
|
78fcd2b9-f12e-419e-ac0e-5373747a413f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-27 17:28:30", "repo_name": "BMouhcine/Gestion-Conges-Webapp", "sub_path": "/JPAGestionConges/src/main/java/io/gestionconges/spring/LigneAuthEx/LigneAuthEx.java", "file_name": "LigneAuthEx.java", "file_ext": "java", "file_size_in_byte": 1037, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "ff934d639f4d1aecbc16f3d155348b99b05fcf01", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/BMouhcine/Gestion-Conges-Webapp | 249 | FILENAME: LigneAuthEx.java | 0.258326 | package io.gestionconges.spring.LigneAuthEx;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import io.gestionconges.spring.AuthEx.AuthEx;
import io.gestionconges.spring.Personnel.Personnel;
@Entity
@Table(name = "ligne_authex")
public class LigneAuthEx implements Serializable {
@Id
@Column(name="id")
private int id;
@ManyToOne
@JoinColumn(name="id_authex")
private AuthEx authEx;
@ManyToOne
@JoinColumn(name="id_personnel")
private Personnel personnel;
public LigneAuthEx() {
super();
}
public AuthEx getAuthEx() {
return authEx;
}
public void setAuthEx(AuthEx authEx) {
this.authEx = authEx;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Personnel getPersonnel() {
return personnel;
}
public void setPersonnel(Personnel personnel) {
this.personnel = personnel;
}
}
|
259f6789-31f7-4d22-a233-1328c061f849 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-04 11:45:06", "repo_name": "alexeyKvitko/EdaNyma", "sub_path": "/app/src/main/java/com/edanyma/model/LoginUser.java", "file_name": "LoginUser.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "3dc9407b83d59cfe2d618d15b6af3bdd4449e1c7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/alexeyKvitko/EdaNyma | 228 | FILENAME: LoginUser.java | 0.221351 | package com.edanyma.model;
import com.edanyma.AppConstants;
import org.pojomatic.Pojomatic;
import org.pojomatic.annotations.AutoProperty;
import java.io.Serializable;
@AutoProperty
public class LoginUser implements Serializable {
private String username;
private String password;
public LoginUser( ){
this.username = AppConstants.DEFAULT_USER;
this.password = AppConstants.DEFAULT_PASSWORD;
}
public LoginUser( String username, String password ) {
this.username = username;
this.password = password;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override public boolean equals(Object o) {
return Pojomatic.equals(this, o);
}
@Override public int hashCode() {
return Pojomatic.hashCode(this);
}
@Override public String toString() {
return Pojomatic.toString(this);
}
}
|
1120aefb-0240-4a07-8fe0-7de6de7ec549 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-21 05:41:37", "repo_name": "junemohit12/chess-mj", "sub_path": "/src/main/java/com/cuebiq/chess/Location.java", "file_name": "Location.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "14d9bfe687bb3bf0c588caf0a3c96b3e64547054", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/junemohit12/chess-mj | 242 | FILENAME: Location.java | 0.291787 | package com.cuebiq.chess;
import java.util.Objects;
public class Location {
private int xPos;
private int yPos;
public Location(int xPos, int yPos) {
this.xPos = xPos;
this.yPos = yPos;
}
public int getxPos() {
return xPos;
}
public void setxPos(int xPos) {
this.xPos = xPos;
}
public int getyPos() {
return yPos;
}
public void setyPos(int yPos) {
this.yPos = yPos;
}
@Override
public String toString() {
return "Location{" +
"xPos=" + xPos +
", yPos=" + yPos +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Location location = (Location) o;
return xPos == location.xPos &&
yPos == location.yPos;
}
@Override
public int hashCode() {
return Objects.hash(xPos, yPos);
}
}
|
3b142a29-1e1b-4816-8bb9-10377c1f71a1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-21 14:06:00", "repo_name": "rmnvalera/Californication", "sub_path": "/SetWallpaper/SetWallpaper.java", "file_name": "SetWallpaper.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "09fa5809b81712cd477d174ec99af08f612f462d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rmnvalera/Californication | 259 | FILENAME: SetWallpaper.java | 0.284576 | /*
* 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 californication.SetWallpaper;
import java.util.HashMap;
import com.sun.jna.Native;
import com.sun.jna.platform.win32.WinDef.UINT_PTR;
import com.sun.jna.win32.*;
/**
*
* @author Roman
*/
public class SetWallpaper {
public interface SPI extends StdCallLibrary {
//from MSDN article
long SPI_SETDESKWALLPAPER = 20;
long SPIF_UPDATEINIFILE = 0x01;
long SPIF_SENDWININICHANGE = 0x02;
SPI INSTANCE = (SPI) Native.loadLibrary("user32", SPI.class, new HashMap<Object, Object>() {
{
put(OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);
}
});
boolean SystemParametersInfo(
UINT_PTR uiAction,
UINT_PTR uiParam,
String pvParam,
UINT_PTR fWinIni
);
}
}
|
efcfdac6-30db-40d8-9e19-eadf54f094cf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-27 13:57:12", "repo_name": "Ha5h-Code/The-Fob", "sub_path": "/app/src/main/java/hashcode/thefob/Entities/Account.java", "file_name": "Account.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "4d88c8dbd2fabf04a0a33cb2d54d8ee314cbbb33", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/Ha5h-Code/The-Fob | 205 | FILENAME: Account.java | 0.252384 | package hashcode.thefob.Entities;
import java.util.Hashtable;
public class Account {
private int accountId;
private String accountName;
private Hashtable<String, String> accountDetails = new Hashtable<String, String>();
public Account(int accountId, String accountName, Hashtable<String, String> accountDetails)
{
this.accountId = accountId;
this.accountName = accountName;
this.accountDetails = accountDetails;
}
public int getAccountId()
{
return accountId;
}
public void setAccountId(int accountId)
{
this.accountId = accountId;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public Hashtable<String, String> getAccountDetails() {
return accountDetails;
}
public void setAccountDetails(Hashtable<String, String> accountDetails) {
this.accountDetails = accountDetails;
}
}
|
ac6eb9a2-d94f-4dcb-a741-a0baa4883a32 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-24 10:11:56", "repo_name": "snsh22/nshms", "sub_path": "/app/src/main/java/music/streaming/dev/snsh/musicstreaming/adpt/PersonalPlaylistNameAdapter2.java", "file_name": "PersonalPlaylistNameAdapter2.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "debe53cf6dd8cf554cf44f5697c7b56a66d4877d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/snsh22/nshms | 228 | FILENAME: PersonalPlaylistNameAdapter2.java | 0.259826 | package music.streaming.dev.snsh.musicstreaming.adpt;
import android.app.Activity;
import android.support.v7.widget.CardView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import java.util.List;
import music.streaming.dev.snsh.musicstreaming.R;
import music.streaming.dev.snsh.musicstreaming.dto.PersonalPlaylistName;
public class PersonalPlaylistNameAdapter2 extends BaseQuickAdapter<PersonalPlaylistName.Data, BaseViewHolder> {
private final Activity activity;
public PersonalPlaylistNameAdapter2(List<PersonalPlaylistName.Data> data, Activity activity) {
super(R.layout.layout_personal_playlist_name, data);
this.activity = activity;
}
@Override
protected void convert(BaseViewHolder helper, PersonalPlaylistName.Data item) {
helper.setText(R.id.tweetName, item.playlist_name);
helper.addOnClickListener(R.id.ib_details);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
((CardView) helper.getView(R.id.card_view)).setRadius(0);
}
}
}
|
9248da77-8f21-4562-932d-d7e4fad6f19c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-22T06:20:59", "repo_name": "qateam9092/AutomationFW", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1115, "line_count": 40, "lang": "en", "doc_type": "text", "blob_id": "839d4aef6cfb2db316f8e0915cc59b680c9b2fab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/qateam9092/AutomationFW | 302 | FILENAME: README.md | 0.285372 | ### To run tests
- mvn clean verify
Profile : test
### To create jar
- mvn clean verify
Profile : jar
### Test controller guide lines
- Column header names must be static and changing them will break the project
- Adding a new column will have no effect until there is corresponding code change
### DB queries
- SELECT * FROM TBL_QA_TEST_CASES_DETAILS where TEST_REFERENCE = '20-09-2020-12-21-59'
- SELECT * FROM TBL_QA_FINAL_TEST_RESULT where TEST_REFERENCE = '20-09-2020-12-21-59'
### Json schema generator
- https://www.liquid-technologies.com/online-json-to-schema-converter
### XML schema generator
- https://www.liquid-technologies.com/online-xml-to-xsd-converter
### How set allure path
documents/How-to-set-allure-path.docx
### To ignore xml value form comparison
example : <logId>${xmlunit.ignore}</logId>
### To ignore json value from comparison
example :
{
"schemaFile" : "/schema/user/user-schema.json",
"validateOnlySchema" : true,
"validateFullResponse" : true,
"jsonIgnore":["logId", "user.lastLoggedIn"]
}
### How to write a jsonPath expression
- https://github.com/json-path/JsonPath |
44cd247a-61b2-4a8f-9628-c658b330817e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-28 10:16:36", "repo_name": "arunavo4/EruditionPaper", "sub_path": "/app/src/main/java/in/co/erudition/paper/data/model/University.java", "file_name": "University.java", "file_ext": "java", "file_size_in_byte": 1210, "line_count": 69, "lang": "en", "doc_type": "code", "blob_id": "77d3c7bee09866cff99bfb4b5721a7385dcbb0c2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/arunavo4/EruditionPaper | 272 | FILENAME: University.java | 0.214691 | package in.co.erudition.paper.data.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by Arunavo Ray on 31-03-2018.
*/
public class University {
@SerializedName("_id")
@Expose
private String id;
@SerializedName("Code")
@Expose
private String code;
@SerializedName("Name")
@Expose
private String name;
@SerializedName("FullName")
@Expose
private String fullName;
@SerializedName("Logo")
@Expose
private String logo;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
}
|
f4a4be57-cf3f-4871-91e9-9dfa98a70d86 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-28 10:48:56", "repo_name": "creatorvm/KinderApp", "sub_path": "/KinderSurvey/app/src/main/java/creator/kindersurvey/Splash/SplashScreen.java", "file_name": "SplashScreen.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "fe20cd0de050df5771966b18841dba55978691a9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/creatorvm/KinderApp | 153 | FILENAME: SplashScreen.java | 0.213377 | package creator.kindersurvey.Splash;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import creator.kindersurvey.Login.Login;
import creator.kindersurvey.R;
public class SplashScreen extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
Thread loading = new Thread() {
public void run() {
try {
sleep(1000);
Intent main = new Intent(SplashScreen.this,Login.class);
startActivity(main);
finish();
}
catch (Exception e) {
e.printStackTrace();
}
finally {
finish();
}
}
};
loading.start();
}
}
|
d23268bd-8caa-4576-8458-7f8b44f2f8dd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-12 17:31:00", "repo_name": "mikhailferko/ferko", "sub_path": "/src/main/java/com/MySklad/ferko/documents/Sale.java", "file_name": "Sale.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "1c2eff7c9b102e197a686d6285a148644224bb78", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mikhailferko/ferko | 218 | FILENAME: Sale.java | 0.255344 | package com.MySklad.ferko.documents;
import com.MySklad.ferko.service.ProductReceipt;
import com.MySklad.ferko.service.ProductSale;
import java.util.List;
public class Sale {
private int id;
private String warehouseName;
private List<ProductSale> listOfProducts;
public Sale(int id, String warehouseName, List<ProductSale> listOfProducts) {
this.id = id;
this.warehouseName = warehouseName;
this.listOfProducts = listOfProducts;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public List<ProductSale> getListOfProducts() {
return listOfProducts;
}
public void setList(List<ProductSale> listOfProducts) {
this.listOfProducts = listOfProducts;
}
}
|
5be87370-098e-4eac-ab13-7bfe60898d76 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-25 10:51:15", "repo_name": "wengchuqin/utilstools", "sub_path": "/thrift/src/main/java/top/chuqin/thrift/impl/HelloWordServiceImpl.java", "file_name": "HelloWordServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "1af6cabec12084ec7a1ef6410691f0b8917af099", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wengchuqin/utilstools | 233 | FILENAME: HelloWordServiceImpl.java | 0.26971 | package top.chuqin.thrift.impl;
import org.apache.commons.lang3.StringUtils;
import org.apache.thrift.TException;
import top.chuqin.thrift.HelloWordService;
import top.chuqin.thrift.Request;
import top.chuqin.thrift.RequestException;
import java.time.LocalDateTime;
public class HelloWordServiceImpl implements HelloWordService.Iface {
// 实现这个方法完成具体的逻辑。
@Override
public String doAction(Request request) throws RequestException, TException {
System.out.println("Get request: " + request);
if (StringUtils.isBlank(request.getName()) || request.getType() == null) {
throw new RequestException();
}
String result = "";
switch (request.getType()) {
case SAY_HELLO:
result = String.format("Hello, %s, Welcome", request.getName());
break;
case QUERY_TIME:
result = String.format("Hello, %s, Welcome, Now is %s", request.getName(), LocalDateTime.now().toString());
break;
default:
throw new RuntimeException("something wrong");
}
return result;
}
}
|
f73a008b-ce2d-451b-8d4f-9113c30efe7e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-03-17 08:17:37", "repo_name": "Harishwar/Sensorem", "sub_path": "/src/com/harishwar/sensorem/Proximity.java", "file_name": "Proximity.java", "file_ext": "java", "file_size_in_byte": 989, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "ee9987e0d773cc66a3f5c553db77b3154ec0d3f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Harishwar/Sensorem | 228 | FILENAME: Proximity.java | 0.272025 | package com.harishwar.sensorem;
import com.harishwar.sensorem.SensorHandler;
import com.harishwar.sensorem.Proximity;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.widget.TextView;
public class Proximity extends SensorHandler {
private float lastVal = -1;
ComponentName compName;
DevicePolicyManager deviceManager;
TextView textView;
Window window = this.getWindow();
boolean isScreenOn;
boolean active;
@Override
public void onSensorChanged(SensorEvent sensorEvent) {
float thisVal = sensorEvent.values[0];
if (this.lastVal == -1) {
this.lastVal = thisVal;
} else {
this.lastVal = thisVal;
}
X.setText("Current Proximity Value: " + this.lastVal + " cm");
}
@Override
protected String getSensorTitle() {
return "Proximity Sensor";
}
@Override
protected int getSensorType() {
return Sensor.TYPE_PROXIMITY;
}
} |
4aede254-6048-46cf-afa8-1d107117cb63 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-01-02T14:08:29", "repo_name": "johnryM/static-server", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1041, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "5f3195478ddbb529108c7104b38e4dbc575ff3f1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/johnryM/static-server | 260 | FILENAME: README.md | 0.226784 | # static-server
Server for static files hosted in Heroku and using [node-static](https://github.com/cloudhead/node-static)
## How to set up
1. Create a heroku account and install the Heroku CLI and node.js
2. Navigate to the root folder
3. Install the node-static module and dependencies
`npm install node-static`
4. Login to heroku
`heroku login`
5. Create the app in heroku (e.g. static-server)
`heroku create app-name-here`
6. Push to heroku
`git push heroku master`
7. Deploy and launch one instance of the web app-name-here
`heroku ps:scale web=1`
8. Open the webapp sample file via browser
`your-app-name.herokuapp.com/hello.txt`
9. Add new files by adding it to the `public` folder and using git to add/commit file and repeat step 6
`git add . && git commit -m"a commit message"`
## Dropbox integration
You can also deploy new files via dropbox by dragging and dropping files. After following the set up above connect the app to dropbox by going to `dashboard > your-app-instance > deploy` and following the dropbox instructions
|
e60fc303-db25-4676-934d-59b771a5c5f0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-24 18:39:52", "repo_name": "lukapopovic97/WebApp-Java", "sub_path": "/src/java/entities/Test.java", "file_name": "Test.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "2aa55ffbae6d14fd708ab8729f07bf984cce1923", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lukapopovic97/WebApp-Java | 252 | FILENAME: Test.java | 0.26588 | /*
* 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 entities;
import java.util.Collection;
import java.util.Date;
//import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
/**
*
* @author Luka
*/
@Entity
public class Test extends Upitnik{
private int trajanje;
@ManyToMany(fetch = FetchType.EAGER)
private Collection<PitanjeTest> pitanja;
public int getTrajanje() {
return trajanje;
}
public void setTrajanje(int trajanje) {
this.trajanje = trajanje;
}
public Collection<PitanjeTest> getPitanja() {
return pitanja;
}
public void setPitanja(Collection<PitanjeTest> pitanja) {
this.pitanja = pitanja;
}
public int broj_pitanja(){
return pitanja.size();
}
}
|
f1e5bc6b-1a43-471d-897b-8f88782a3067 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-21 19:04:10", "repo_name": "jscti/gogolalert", "sub_path": "/main/java/com/cti/gogolalert/BootReceiver.java", "file_name": "BootReceiver.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "1c8e0815cd410ed6dd40e648513b9fc9901301d1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jscti/gogolalert | 191 | FILENAME: BootReceiver.java | 0.258326 | package com.cti.gogolalert;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
/**
* Created by CTI on 12/06/2016.
*/
public class BootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.d("BootReceiver", "Received intent : " + intent.getAction().toString());
if(shouldStartService(context)) {
Log.d("BootReceiver", "Resuming gogol service from device boot");
Intent serviceIntent = new Intent(context, ShakeService.class);
context.startService(serviceIntent);
}
}
private boolean shouldStartService(Context context) {
SharedPreferences sharedPref = context.getSharedPreferences(context.getString(R.string.gogol_pref), Context.MODE_PRIVATE);
return sharedPref.getBoolean("enableService", true);
}
}
|
73e94627-6c34-47f0-8375-2be7a2d200e6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-08 19:13:29", "repo_name": "surajsaluja4/suraj_fact", "sub_path": "/src/fact/edit.java", "file_name": "edit.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "608c0707fea4481ed159093646a98e313661b114", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/surajsaluja4/suraj_fact | 232 | FILENAME: edit.java | 0.274351 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fact;
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
/**
*
* @author suraj
*/
public class edit implements fonts{
JFrame frame;
JPanel panel;
JLabel username;
JTextField usernamet;
int width,height;
edit(){
frame=new JFrame();
frame.setLayout(null);
panel=new JPanel();
panel.setLayout(null);
panel.setBackground(Color.WHITE);
username=new JLabel("Hello");
username.setFont(f8);
usernamet=new JTextField();
width=screensize.width();
height=screensize.hieght();
frame.setSize(width, height);
panel.setBounds(0, 0, width, height);
username.setBounds(100, 100,100,50);
panel.add(username);
panel.setVisible(true);
frame.add(panel);
frame.setVisible(true);
}
public static void main(String[] args) {
new edit();
}
}
|
7e8645f8-7aeb-4995-9682-79673449491b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-17 16:37:02", "repo_name": "MrZhuangSheng/ERP", "sub_path": "/src/main/java/cn/zsxmlv/modules/sys/ctrl/TestCtrl.java", "file_name": "TestCtrl.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "dcf7841d1b278120f322631997c19a7c8c5a24e6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MrZhuangSheng/ERP | 219 | FILENAME: TestCtrl.java | 0.183594 | package cn.zsxmlv.modules.sys.ctrl;
import cn.zsxmlv.common.utils.RedisUtils;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
/**
* @author: zs
* @description:
* @date: 2019/1/28 15:15
*/
@RestController
@RequestMapping("/test")
@Api("测试接口")
public class TestCtrl extends BaseCtrl {
@Autowired
private RedisUtils redisUtils;
@RequestMapping("/redisApi")
public String redisApi(String key) throws UnsupportedEncodingException {
System.out.println("================== redis start ================");
String str = redisUtils.get(key);
byte[] bytes = str.getBytes("GBK");
String s = new String(bytes, "UTF-8");
System.out.println(s);
System.out.println("================== redis end ================");
return s;
}
}
|
4b04fd0f-a87f-424e-829f-8f01ede14d1d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-15 14:37:08", "repo_name": "htdangkhoa/QRCodeScanner-Android", "sub_path": "/app/src/main/java/com/example/dangkhoa/qrcodefirebase/Models/QRModel.java", "file_name": "QRModel.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "43c01c2b6cee7db345e98c43ad1de29aa7370cb5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/htdangkhoa/QRCodeScanner-Android | 248 | FILENAME: QRModel.java | 0.226784 | package com.example.dangkhoa.qrcodefirebase.Models;
import com.example.dangkhoa.qrcodefirebase.Utils.Services;
import java.util.UUID;
import io.realm.RealmObject;
/**
* Created by dangkhoa on 11/10/17.
*/
public class QRModel extends RealmObject {
String id;
String detail;
long price;
String timestamp;
public QRModel() {
}
public QRModel(String detail, long price) {
this.id = UUID.randomUUID().toString();
this.detail = detail;
this.price = price;
this.timestamp = Services.GenerateTimestamp();
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public long getPrice() {
return price;
}
public void setPrice(long price) {
this.price = price;
}
public String getTimestamp() {
return timestamp;
}
public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}
}
|
e32faf3c-3f07-4115-9595-94cec6313f96 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-11 04:14:52", "repo_name": "fmtlyw/WeiYun", "sub_path": "/modulemvp/src/main/java/com/lyw/modulemvp/base/BaseActivity.java", "file_name": "BaseActivity.java", "file_ext": "java", "file_size_in_byte": 1228, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "5fd20c365944c59e13cbc3826d32e222ab96775a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fmtlyw/WeiYun | 245 | FILENAME: BaseActivity.java | 0.250913 | package com.lyw.modulemvp.base;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.view.WindowManager;
import com.lyw.commonutils.dialog.LoadingDialog;
import com.lyw.modulemvp.dialog.LoadingLayout;
/**
* 功能描述:所有Activity的基类
* Created on 2020/6/29.
*
* @author lyw
*/
public abstract class BaseActivity extends FragmentActivity {
protected Context mContext;
protected LoadingLayout mLoadingLayout;
protected LoadingDialog mLoadingDialog;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
init();
setContentView(getLayoutId());
mLoadingLayout = new LoadingLayout(this);
mLoadingDialog = new LoadingDialog(this);
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
initView();
}
protected abstract int getLayoutId();
protected abstract void initView();
protected void init(){
}
}
|
ab2dd7db-94a8-4da7-a53c-9dba001359d6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-14 13:24:09", "repo_name": "stanalexandrucode/ProgSchool", "sub_path": "/src/com/company/Person/Employee/SalesPeople.java", "file_name": "SalesPeople.java", "file_ext": "java", "file_size_in_byte": 980, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "603abcb008f2b55d07ef60c3b7a08b2641ffe5dc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/stanalexandrucode/ProgSchool | 200 | FILENAME: SalesPeople.java | 0.26588 | package com.company.Person.Employee;
import com.company.Person.Module;
import com.company.Person.Person;
import com.company.Person.Student;
import com.company.ProgrammingSchool;
import java.util.ArrayList;
import java.util.List;
public class SalesPeople extends Employee {
List<Student> studentList;
ProgrammingSchool programmingSchool;
public SalesPeople(String name, String birthDate, String phoneNr, int salary) {
super(name, birthDate, phoneNr, salary);
this.studentList = new ArrayList<>();
}
public void hire(Student student) {
if (student.getProgression() == 100 && student.getModule() == Module.ADVANCE) {
System.out.println("angajat");
studentList.add(student);
}
}
@Override
public void tick() {
for (Person person : programmingSchool.getPersonList()) {
hire((Student) person);
}
// System.out.println(studentList.stream().count());
}
}
|
3c648269-7e51-482d-a7d8-1844cd1d5f95 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-15 13:57:11", "repo_name": "Lovestrant/Android-ListViews", "sub_path": "/app/src/main/java/com/example/listviews/Youtube.java", "file_name": "Youtube.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "acb7fb76b929a847bc52f8b5f613e8287dbf0d15", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Lovestrant/Android-ListViews | 189 | FILENAME: Youtube.java | 0.188324 | package com.example.listviews;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
public class Youtube extends AppCompatActivity {
Drawable drawable; ImageView image; TextView info;
String text = "YouTube is a video sharing platform that is owned by google. initially created in the" +
"year 2006 and acquired by google around 2008" +
"The main aim of developing it was to enable people share videos";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
//initialize elements
image = findViewById(R.id.imageView);
info = findViewById(R.id.info);
//Create drawable and load img to drawable
drawable = getResources().getDrawable(R.drawable.yt);
image.setImageDrawable(drawable);
info.setText(text);
}
} |
b6526e80-7705-4f76-8519-37d26306d634 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-23 11:57:03", "repo_name": "mkemiche/final_project_allforhome", "sub_path": "/src/main/java/io/allforhome/controllersAPI/ImageUploadControllerAPI.java", "file_name": "ImageUploadControllerAPI.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "cb558c7222155281dec1fc3e252931f0b2dbbc09", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mkemiche/final_project_allforhome | 226 | FILENAME: ImageUploadControllerAPI.java | 0.243642 | package io.allforhome.controllersAPI;
import io.allforhome.services.ImageUploadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
* @author mkemiche
* @created 05/06/2021
*/
@RestController
@Api(value="API allows to upload an attached file")
public class ImageUploadControllerAPI {
// private static final String SUB_DIR = "/Users/mouloudkemiche/perscholas/final_project/final_project_allforhome/src/main/resources/upload";
@Autowired
private ImageUploadService imageUploadService;
@ApiOperation(value = "upload file and save it in the database")
@RequestMapping(value = "/uploadFile", method = RequestMethod.POST, produces = "application/json")
public String handleImageUpload(@RequestParam("file") MultipartFile file,
@RequestParam("pRef") String preference){
String filename = imageUploadService.saveImage(file, preference);
return filename;
}
}
|
5ba9707f-a4e3-4f76-81b6-19ee30a7062d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-06 01:38:13", "repo_name": "FelipeCarvalho25/UniCarEJW", "sub_path": "/app/src/main/java/com/example/unicarejfw/ui/perfil/TabSobreFragment.java", "file_name": "TabSobreFragment.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "687c4ce545e738bd1f2b86a93a88c5a06e07cbe2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/FelipeCarvalho25/UniCarEJW | 195 | FILENAME: TabSobreFragment.java | 0.181263 | package com.example.unicarejfw.ui.perfil;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import com.example.unicarejfw.R;
public class TabSobreFragment extends Fragment {
public static TabSobreFragment newInstance() {
TabSobreFragment fragment = new TabSobreFragment();
return fragment;
}
public TabSobreFragment() {
// Deve existir um construtor vazio
// na classe que estende um Fragment
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.tab_sobre_fragment, container, false);
}
} |
ee3b3314-3a5c-47ae-9736-9961dd770aef | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-30 08:23:43", "repo_name": "shike2599/MyApp", "sub_path": "/app/src/main/java/project/wy/com/myappdemo/bean/EquipmentInfoBean.java", "file_name": "EquipmentInfoBean.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 23, "lang": "en", "doc_type": "code", "blob_id": "abc5146938d8d0db64ffd481a2fa3524968a385e", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/shike2599/MyApp | 389 | FILENAME: EquipmentInfoBean.java | 0.204342 | package project.wy.com.myappdemo.bean;
/**
* Created by lichee on 2018/9/23.
*/
public class EquipmentInfoBean {
/**
* equipment : {"equip_mdate":20,"equip_isdeleted":0,"equip_name":"?????","equip_no":"?????","equip_udate":{"date":31,"hours":0,"seconds":0,"month":7,"nanos":0,"timezoneOffset":-480,"year":118,"minutes":0,"time":1535644800000,"day":5},"equip_state":0,"equip_tel":"13255555555","equip_id":7,"equip_atime":0,"equip_num":"?????","equip_ndate":{"date":7,"hours":0,"seconds":0,"month":8,"nanos":0,"timezoneOffset":-480,"year":118,"minutes":0,"time":1536249600000,"day":5},"equip_snum":0,"file_id":null,"equip_manu":"?????","equip_pdate":{"date":24,"hours":0,"seconds":0,"month":7,"nanos":0,"timezoneOffset":-480,"year":118,"minutes":0,"time":1535040000000,"day":5},"equip_life":24,"equip_memo":"","equip_qrcode":"","equip_bfee":24,"user":null,"equip_room":null,"equip_type":null}
*/
private EquipmentBean equipment;
public EquipmentBean getEquipment() {
return equipment;
}
public void setEquipment(EquipmentBean equipment) {
this.equipment = equipment;
}
}
|
3626eab6-6115-4f07-9572-ede35b02d89a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-06 09:39:51", "repo_name": "ghemulyanto/kafka-springboot-rest", "sub_path": "/src/main/java/com/trim/kafkarest/controller/WebRestController.java", "file_name": "WebRestController.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "7026e7ee501c6070d7fa853a49d71f4f14be8c83", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ghemulyanto/kafka-springboot-rest | 219 | FILENAME: WebRestController.java | 0.23231 | package com.trim.kafkarest.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.trim.kafkarest.services.KafkaProducer;
import com.trim.kafkarest.storages.MessageStorage;
@RestController
@RequestMapping(value = "trim/kafka")
public class WebRestController {
private static final Logger LOG = LoggerFactory
.getLogger(WebRestController.class);
@Autowired
KafkaProducer kafkaProducer;
@Autowired
MessageStorage storage;
@GetMapping(value = "/producer")
public String producer(@RequestParam("data") String data) {
kafkaProducer.send(data);
LOG.info("data value : {}", data);
LOG.info("storage value : {}", storage.toString());
return "Done";
}
@GetMapping(value = "/consumer")
public String consumer() {
String messages = storage.toString();
storage.clear();
return messages;
}
}
|
19ae3c16-810c-4334-8e69-2bcf341c0f90 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-15 13:15:56", "repo_name": "pmidc-egov-tech/pl-services", "sub_path": "/pl-services/src/main/java/org/egov/pl/models/AuditDetails.java", "file_name": "AuditDetails.java", "file_ext": "java", "file_size_in_byte": 1043, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "94a47dfb6c59c945b8fae27c8a4083b4b651fb9a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pmidc-egov-tech/pl-services | 221 | FILENAME: AuditDetails.java | 0.23231 | package org.egov.pl.models;
import javax.validation.constraints.Size;
import org.springframework.validation.annotation.Validated;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* Collection of audit related fields used by most models
*/
@ApiModel(description = "Collection of audit related fields used by most models")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2020-05-18T04:08:46.274Z")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AuditDetails {
@Size(max = 64)
@JsonProperty("createdBy")
private String createdBy = null;
@Size(max = 64)
@JsonProperty("lastModifiedBy")
private String lastModifiedBy = null;
@JsonProperty("createdTime")
private Long createdTime = null;
@JsonProperty("lastModifiedTime")
private Long lastModifiedTime = null;
}
|
1ac89489-f6c0-41b7-957d-5295f44d3f11 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-07 16:42:10", "repo_name": "Aosamesan/twitterbot", "sub_path": "/src/main/java/com/aosamesan/service/MongoService.java", "file_name": "MongoService.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "021de6bc1835470b66a4fe88296680f0e3e32c57", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Aosamesan/twitterbot | 194 | FILENAME: MongoService.java | 0.253861 | package com.aosamesan.service;
import com.aosamesan.model.Bot;
import com.aosamesan.repository.BotRepository;
import com.sun.istack.internal.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class MongoService {
private BotRepository botRepository;
@Autowired
public void setBotRepository(BotRepository botRepository) {
this.botRepository = botRepository;
}
public boolean createBot(@NotNull String botName, String koreanBotName) {
try {
Bot bot = new Bot();
bot.setBotName(botName);
bot.setKoreanBotName(koreanBotName);
botRepository.insert(bot);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public List<Bot> findBotList() {
return botRepository.findAll();
}
}
|
6e481d8c-cd54-440c-9599-fed3e20c4613 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-22 11:06:56", "repo_name": "dnieuwenhuizen97/Opdrachten_Java_Advanced", "sub_path": "/my-first-api/src/main/java/nl/inholland/myfirstapi/model/Album.java", "file_name": "Album.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "fc93620924c296f712164aebaf2e763d6c7df4f3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dnieuwenhuizen97/Opdrachten_Java_Advanced | 210 | FILENAME: Album.java | 0.218669 | package nl.inholland.myfirstapi.model;
public abstract class Album {
protected long id;
protected String title;
protected String artist;
protected int price;
public Album() {
}
public Album(long id, String title, String artist, int price) {
this.id = id;
this.title = title;
this.artist = artist;
this.price = price;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getArtist() {
return artist;
}
public void setArtist(String artist) {
this.artist = artist;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
@Override
public abstract String toString();
}
|
34ef0522-100d-43aa-823c-d74ab145874a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-08-24T17:59:35", "repo_name": "zazyzaya/StenoTyper", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1066, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "7a3b5bd77812a1a763e489d6e1db8b9039c2be42", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zazyzaya/StenoTyper | 328 | FILENAME: README.md | 0.23793 | # StenoTyper
Converts the keyboard into a stenographer's keyboard
I have no idea why anyone would ever need this
# Requirements:
python 3
pynput
To obtain pynput, simply use the command
```
pip install pynput
```
and it will be installed
# Mapping
The keyboard is arranged like this:
(lowercase letters are qwerty, uppercase is Steno)
```
____ ____ ____ ____ __ ____ ____ ____ ____ ____
/q S /w T /e P/ r H|t * |y F \u P \i L \o T \p D\
| |____|____|____| |____|____|____|____|____|
| | | | | | | | | | |
\a S\ s K\ d W\ f R|g * |h R /j B /k G /l S /; Z/
\___\____\____\___|____|___/____/____/____/___/
| | | | |
\c A |v O | b E| n U/
\___|____|____|___/
```
Just like a normal stenograph, hold down multiple keys to create "chords" and release to print the line
[Here's](https://github.com/openstenoproject/plover/wiki/Learning-Stenography) a good source to learn more
|
8640aa57-a14c-4dac-a044-fc3c404277ae | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-23 17:16:33", "repo_name": "oraculo-nl/ExampleBackend", "sub_path": "/src/main/java/nl/oraculo/popsongs/endpoint/ArtiestEndpoint.java", "file_name": "ArtiestEndpoint.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "41a45f5d874f00d5e18d9aeacc30d71680ee7d12", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/oraculo-nl/ExampleBackend | 230 | FILENAME: ArtiestEndpoint.java | 0.252384 | package nl.oraculo.popsongs.endpoint;
import nl.oraculo.popsongs.domain.Artiest;
import nl.oraculo.popsongs.service.ArtiestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Optional;
@CrossOrigin(origins = "http://localhost:4200")
@RestController
@RequestMapping(path = "artiest")
public class ArtiestEndpoint {
@Autowired
ArtiestService artiestService;
@GetMapping
public Iterable<Artiest> findAll() {
return artiestService.findAll();
}
@GetMapping(path = "{id}")
public Optional<Artiest> findById(@PathVariable int id) {
return artiestService.findById(id);
}
@GetMapping(path = "naam/{naam}")
public List<Artiest> findByNaam(@PathVariable String naam) {
return artiestService.findByNaam(naam);
}
@PostMapping
public Artiest save(@RequestBody Artiest artiest) {
return artiestService.save(artiest);
}
}
|
aa9ce309-6c3a-40cc-b874-3241d3dcb0ec | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-05 12:31:42", "repo_name": "maxymmrn/JavaLab3", "sub_path": "/src/main/java/ua/lviv/iot/hockeyGoods/models/IceSkates.java", "file_name": "IceSkates.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "0d4cc3f53beca5d596e8ae54befcff56f91ff6ca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/maxymmrn/JavaLab3 | 229 | FILENAME: IceSkates.java | 0.277473 | package ua.lviv.iot.hockeyGoods.models;
public class IceSkates extends HockeyGood {
private int footSize;
private String model;
public IceSkates() {
}
public IceSkates(final double price, final String producerName,
final Age userAge, final ProfessionalLevel professionalLevel,
final PlayerType playerType, final Rating rating,
final int footSize) {
super(price, producerName, userAge,
professionalLevel, playerType, rating);
this.footSize = footSize;
}
@Override
public final String toString() {
return "\nIce skates\n"
+ super.toString()
+ "\nFoot Size: " + footSize + "\n";
}
public final int getFootSize() {
return footSize;
}
public final void setFootSize(final int footSize) {
this.footSize = footSize;
}
public final String getModel() {
return model;
}
public final void setModel(final String model) {
this.model = model;
}
}
|
4e028f55-7f6c-478f-98b6-0137a678a4df | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-09-08T18:41:15", "repo_name": "JKK86/squash_club", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1210, "line_count": 50, "lang": "en", "doc_type": "text", "blob_id": "a1acd875e80ed3759f4dda7e148dc945ae836564", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JKK86/squash_club | 271 | FILENAME: README.md | 0.250913 | # Squash club
A squash/tennis club management web application with court reservation system, built with Django Framework.
## Technologies:
- Python
- Django
- Celery
- JavaScript
- HTML
- CSS
## Features:
- user authorization (register, login, logout, edit profile, change password, reset password)
- courts reservation system
- e-mail and sms notifications
- user panel with reservation history
- admin panel
## Setup
First you should clone this repository:
```
git clone https://github.com/JKK86/squash_club.git
cd squash_club
```
To run the project you should have Python 3 installed on your computer. Then it's recommended to create a virtual environment for your projects dependencies. To install virtual environment:
```
pip install virtualenv
```
Then run the following command in the project directory:
```
virtualenv venv
```
That will create a new folder venv in your project directory. Next activate virtual environment:
```
source venv/bin/active
```
Then install the project dependencies:
```
pip install -r requirements.txt
```
Now you can run the project with this command:
```
python manage.py runserver
```
**Note** in the settings file you should complete your own database settings.
|
a0be6892-d1e0-47ef-bb11-d36558effd96 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-05 03:58:04", "repo_name": "CrystalGirls/NacosConsumer", "sub_path": "/src/main/java/net/crystalos/nacosconsumer/controller/DemoController.java", "file_name": "DemoController.java", "file_ext": "java", "file_size_in_byte": 989, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "4ddec1714bc5f88a028057efcf434f5bb22faed6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CrystalGirls/NacosConsumer | 213 | FILENAME: DemoController.java | 0.203075 | package net.crystalos.nacosconsumer.controller;
import net.crystalos.nacosconsumer.service.DemoService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* Description: 用例
* Create on 2020/8/4 14:28
*
* @author Miss.Crystal
* @version 1.0
* Copyright (c) 2020 ♀Crystal♀ ,Inc. All Rights Reserved.
*/
@RestController
public class DemoController {
@Resource(name = "demoService")
private DemoService demoService;
@RequestMapping(value = "/nowtimes", method = RequestMethod.GET)
public String times() {
return demoService.times();
}
@RequestMapping(value = "/hello/{name}", method = RequestMethod.GET)
public String hello(@PathVariable String name) {
return demoService.hello(name);
}
}
|
f016a5fd-7a50-40f9-99fe-fbd87145d59a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-07 23:17:33", "repo_name": "Jing2012/IdeaSample", "sub_path": "/ProxySamples/src/com/company/advice/ControllablePerformanceMonitor.java", "file_name": "ControllablePerformanceMonitor.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "ac7ffae4680d91b36f555591f48727abf68f29a3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Jing2012/IdeaSample | 221 | FILENAME: ControllablePerformanceMonitor.java | 0.258326 | package com.company.advice;
import com.company.common.PerformanceMonitor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
/**
* Created by jingjing.hu on 2017/9/20.
* 引介增强
*/
public class ControllablePerformanceMonitor extends DelegatingIntroductionInterceptor implements Monitorable {
private ThreadLocal<Boolean> threadLocalMonitor = new ThreadLocal<>();
/**
* 是否支持性能监视
* @param active
*/
@Override
public void setMonitorActive(boolean active) {
threadLocalMonitor.set(active);
}
@Override
public Object invoke(MethodInvocation mi) throws Throwable {
Object obj = null;
if (threadLocalMonitor.get() != null && threadLocalMonitor.get()) {
PerformanceMonitor.begin(mi.getClass().getName() + "." + mi.getMethod().getName());
obj = super.invoke(mi);
PerformanceMonitor.end();
} else {
obj = super.invoke(mi);
}
return obj;
}
}
|
e1a64543-4e34-4c2b-a589-5af22ed6feb9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-12-16 16:11:07", "repo_name": "City-Outdoors/City-Outdoors-Android", "sub_path": "/app/src/uk/co/jarofgreen/cityoutdoors/UI/TitleBar.java", "file_name": "TitleBar.java", "file_ext": "java", "file_size_in_byte": 1152, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "edcd05a0e10846549db72e1bc0b41aea18c6e94c", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/City-Outdoors/City-Outdoors-Android | 246 | FILENAME: TitleBar.java | 0.285372 | package uk.co.jarofgreen.cityoutdoors.UI;
import uk.co.jarofgreen.cityoutdoors.R;
import android.app.Activity;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.widget.TextView;
/**
*
* @author James Baster <james@jarofgreen.co.uk>
* @copyright City of Edinburgh Council & James Baster
* @license Open Source under the 3-clause BSD License
* @url https://github.com/City-Outdoors/City-Outdoors-Android
*/
public class TitleBar {
public static void populate(Activity activity ) {
SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(activity);
int userID = settings.getInt("userID", -1);
if (userID > 0) {
int userScore = settings.getInt("userScore", 0);
String userDisplayName = settings.getString("userDisplayName", "");
TextView tv = (TextView)activity.findViewById(R.id.user_details);
if (tv != null) {
if (userScore > 0) {
tv.setText(userDisplayName+" ("+Integer.toString(userScore)+")");
} else {
tv.setText(userDisplayName);
}
}
}
}
}
|
e32b27af-49d4-4765-8673-73d33ba3a69f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-20 16:40:53", "repo_name": "TimVonsee/csp-store", "sub_path": "/src/main/java/nl/sharecompany/writer/csp/TokenHandler.java", "file_name": "TokenHandler.java", "file_ext": "java", "file_size_in_byte": 1208, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "97aff8feecf5f01978dc05b81e91d49000509e85", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/TimVonsee/csp-store | 231 | FILENAME: TokenHandler.java | 0.247987 | package nl.sharecompany.writer.csp;
import nl.sharecompany.pattern.buffers.SerializableByteBuffer;
import nl.sharecompany.pattern.bytebuffercommand.IByteBufferCommand;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
/**
* Used for debugging and testing
*/
public class TokenHandler implements IByteBufferCommand {
private final String token;
private final CharBuffer charValue = CharBuffer.allocate(130);
private final static CharsetDecoder decoder = Charset.forName("US-ASCII").newDecoder();
private final static Charset ascii = Charset.forName("US-ASCII");
public TokenHandler(String token) {
this.token = token;
SerializableByteBuffer tokenKey = SerializableByteBuffer.allocate(token.length());
tokenKey.put(token.getBytes(ascii)).flip();
}
public void execute(ByteBuffer value) {
charValue.clear();
try {
decoder.decode(value, charValue, true);
charValue.flip();
System.out.print(token + "=" + charValue + "|");
}
catch (RuntimeException e) {
e.printStackTrace();
}
}
}
|
860688fd-e7a6-4391-94e2-897557a21430 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-16 01:58:48", "repo_name": "gbluntzer/makertracker", "sub_path": "/src/main/java/org/tenbitworks/dto/NewUserDTO.java", "file_name": "NewUserDTO.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "e305605ed690b86bdf9a84fc24895cf7a860b389", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/gbluntzer/makertracker | 248 | FILENAME: NewUserDTO.java | 0.228156 | package org.tenbitworks.dto;
import java.util.List;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotBlank;
public class NewUserDTO {
@NotBlank
private String username;
@NotBlank
private String plainPassword;
private UUID memberId;
@NotNull
private List<String> roles;
public void setMemberId(String memberId) {
if (memberId == null || memberId.trim().isEmpty()) {
this.memberId = null;
} else {
this.memberId = UUID.fromString(memberId);
}
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPlainPassword() {
return plainPassword;
}
public void setPlainPassword(String plainPassword) {
this.plainPassword = plainPassword;
}
public UUID getMemberId() {
return memberId;
}
public void setMemberId(UUID memberId) {
this.memberId = memberId;
}
public List<String> getRoles() {
return roles;
}
public void setRoles(List<String> roles) {
this.roles = roles;
}
}
|
6988f517-5f7e-4e07-b242-91537750dda8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-01 06:34:05", "repo_name": "cgc186/server", "sub_path": "/src/main/java/com/example/server/controller/FileController.java", "file_name": "FileController.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "8e9aa0c3b2338858853b7e3c1181cb900cd9c6b2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cgc186/server | 189 | FILENAME: FileController.java | 0.228156 | package com.example.server.controller;
import com.example.server.entity.FileData;
import com.example.server.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("/file")
public class FileController {
@Autowired
FileService fileService;
@RequestMapping("upload")
@ResponseBody
public String uploadFile(HttpServletRequest req, MultipartFile file) {
return fileService.upload(req, file);
}
@RequestMapping("download")
public String downloadFile(HttpServletResponse response, String uuid) {
return fileService.getFile(response, uuid);
}
@RequestMapping("getFileData")
@ResponseBody
public FileData getFileData(String uuid) {
return fileService.getFileData(uuid);
}
}
|
6233ca98-73bb-4678-b89c-ccd8b95e0ddc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-09-24T13:40:27", "repo_name": "csharpd/picagramram", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1046, "line_count": 65, "lang": "en", "doc_type": "text", "blob_id": "40f89cd6d0d0c3fe15eb564809a63c8d28e2d5fe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/csharpd/picagramram | 277 | FILENAME: README.md | 0.23231 | Picagram
=========
A photosharing website

####Deployed
To view, visit: http://picagram.herokuapp.com/
###Objectives
- Get a deeper understanding of Rails and using paperclip to upload pictures onto Amazon S3.
- Learn about many-to-many associations for posts and tags.
- Use the Geolocations capabilities of GMaps to search and display the location of the post.
###Specifications
+ Users can post images and tag them
+ Users can add a location which will then be displayed on a map
###Technologies used
+ Rails
+ Ruby
+ RSPEC
+ Heroku
+ CSS
+ HTML
+ Bootstrap
+ Devise
+ Google Maps API
+ Factory Girl
+ Warden
+ Capybara
+ Amazon Web Services
###Set up
```sh
git clone https://github.com/csharpd/picagramram.git
cd picagram
bundle install
```
###Run
```sh
cd picagram
rails s
```
Open the browser at localhost:3000 to view the app
###Test
```sh
cd picagram
rspec
```
### Possible enhancements
+ General styling & format pictures
+ Pushr (Websockets)
+ Allow users to buy the photos (Stripe)
|
880ff5ff-98eb-4980-a162-80feaa22c25e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-04-18 01:29:13", "repo_name": "the-blue-alliance/the-blue-alliance-android", "sub_path": "/android/src/main/java/com/thebluealliance/androidclient/models/Robot.java", "file_name": "Robot.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "22f4d148052bf39a95722d8af017196e0713e983", "star_events_count": 71, "fork_events_count": 48, "src_encoding": "UTF-8"} | https://github.com/the-blue-alliance/the-blue-alliance-android | 241 | FILENAME: Robot.java | 0.228156 | package com.thebluealliance.androidclient.models;
import com.thebluealliance.api.model.IRobot;
import javax.annotation.Nullable;
public class Robot implements IRobot {
private String key;
private String name;
private String teamKey;
private Integer year;
private Long lastModified;
@Override public String getKey() {
return key;
}
@Override public void setKey(String key) {
this.key = key;
}
@Override public String getName() {
return name;
}
@Override public void setName(String name) {
this.name = name;
}
@Override public String getTeamKey() {
return teamKey;
}
@Override public void setTeamKey(String teamKey) {
this.teamKey = teamKey;
}
@Override public Integer getYear() {
return year;
}
@Override public void setYear(Integer year) {
this.year = year;
}
@Nullable @Override public Long getLastModified() {
return lastModified;
}
@Override public void setLastModified(Long lastModified) {
this.lastModified = lastModified;
}
}
|
cf288d96-c96c-4610-9cd1-dafe10c10839 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-15T23:08:16", "repo_name": "Guuri11/let-it-flow", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1138, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "d755dc7d954d0b4a28cfbda93c2303927935e320", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/Guuri11/let-it-flow | 285 | FILENAME: README.md | 0.225417 | # Let it flow 🧠✨
Let it flow is a friendly note app with neumorphic UI concept and animations to improve the UX.
The inspiration was that I didn't find a note app that could create notes ASAP, so I decided to make it by my own.
I wanted to get many ways to interact with the notes with the basic CRUD so I could:
- CRUD functions with voice commanders 🗣️
- CRUD functions with buttons
- Play with animations so the user can do some funcionalities with it.
#### So is that all? 🤷♂️
I have to say yes, that's all. The first idea was to build a workspace app as you can see in old commits. But I rather build different apps with other libraries and keep trying new & cool things.
Now I have a solid note app with a cool UI/UX that brings me all what I needed to create my own notes.
Any new feature will be focus on improving the app as a note app.
#### What is it built with
- React JS
- Firebase
- PWA
- React Native (to do)
#### Where can I try it?
You can sign up free and try it in [let-it-flow.netlify.app](https://let-it-flow.netlify.app) !! 💯
You can download it in your phone too with the power of PWA.
|
37e7ed0f-9ae5-429c-8a84-95ca05f80137 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-20 02:54:46", "repo_name": "zsj6102/zsjda", "sub_path": "/app/src/main/java/com/colpencil/propertycloud/Ui/RecordView.java", "file_name": "RecordView.java", "file_ext": "java", "file_size_in_byte": 1210, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "6fdbc91919072e4d074484dc9b9ce90e086661fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zsj6102/zsjda | 220 | FILENAME: RecordView.java | 0.259826 | package com.colpencil.propertycloud.Ui;
import android.content.Context;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ImageView;
/**
* User:Chenbao
* This View is a view for recording
*/
public class RecordView extends ImageView {
private RecordListener listener;
public RecordView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public void setListener(RecordListener listener) {
this.listener = listener;
}
@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
if (listener != null) {
listener.startRecord();
}
break;
case MotionEvent.ACTION_UP:
SystemClock.sleep(500);
if (listener != null) {
listener.stopRecord();
}
break;
}
return true;
}
/**
* recording control interface
*/
public interface RecordListener {
void startRecord();
void stopRecord();
}
}
|
6e36b07f-afd2-4476-b7e3-e3a80440736e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-23 01:26:25", "repo_name": "LaxusJie/AopSimple", "sub_path": "/app/src/main/java/com/jie/aoptest/aspect/SafeAspect.java", "file_name": "SafeAspect.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "77971912ce608b02b50e5fd0be89417d3d0d5006", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LaxusJie/AopSimple | 253 | FILENAME: SafeAspect.java | 0.261331 | package com.jie.aoptest.aspect;
import android.util.Log;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import java.io.PrintWriter;
import java.io.StringWriter;
/**
* desc:安全切片
* author:haojie
* date:2017/11/2
*/
@Aspect
public class SafeAspect {
@Pointcut("@within(com.jie.aoptest.aop.Safe)||@annotation(com.jie.aoptest.aop.Safe)")
public void methodAnnotated() {
}
@Around("execution(!synthetic * *(..)) && methodAnnotated()")
public Object aroundJoinPoint(final ProceedingJoinPoint joinPoint) throws Throwable {
Object result = null;
try {
result = joinPoint.proceed(joinPoint.getArgs());
} catch (Throwable e) {
Log.e("aspect", getStringFromException(e));
}
return result;
}
private static String getStringFromException(Throwable ex) {
StringWriter errors = new StringWriter();
ex.printStackTrace(new PrintWriter(errors));
return errors.toString();
}
}
|
1349230f-8202-49c6-8099-dfe5a42219f7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-15 01:30:28", "repo_name": "hqbhoho/learn-bigdata", "sub_path": "/learn-concurrent/src/main/java/com/hqbhoho/bigdata/learnConcurrent/disruptor/Operation.java", "file_name": "Operation.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "3a0f81bf7544c304a319b0916841fec018b86a97", "star_events_count": 19, "fork_events_count": 7, "src_encoding": "UTF-8"} | https://github.com/hqbhoho/learn-bigdata | 274 | FILENAME: Operation.java | 0.29584 | package com.hqbhoho.bigdata.learnConcurrent.disruptor;
import com.lmax.disruptor.BlockingWaitStrategy;
import com.lmax.disruptor.RingBuffer;
import com.lmax.disruptor.dsl.Disruptor;
import com.lmax.disruptor.dsl.ProducerType;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.stream.IntStream;
/**
* describe:
*
* @author hqbhoho
* @version [v1.0]
* @date 2019/04/23
*/
public class Operation {
public static void main(String[] args) {
OrderEventFactory factory = new OrderEventFactory();
int ringBufferSize = 1024 * 1024;
ThreadFactory threadFactory = Executors.defaultThreadFactory();
Disruptor disruptor = new Disruptor(factory, ringBufferSize, threadFactory, ProducerType.SINGLE, new BlockingWaitStrategy());
disruptor.handleEventsWith(new OrderEventHandler());
disruptor.start();
RingBuffer<OrderEvent> ringBuffer = disruptor.getRingBuffer();
OrderEventProducer producer = new OrderEventProducer(ringBuffer);
IntStream.rangeClosed(0, 99).forEach(producer::sendData);
disruptor.shutdown();
}
}
|
248c54d4-42f7-4c4e-b8b0-bdf5464c8b70 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-18 00:42:06", "repo_name": "bmaur/simple-rest-api", "sub_path": "/src/main/java/com/one2tribe/recruitment/MessageController.java", "file_name": "MessageController.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "10e5bc53d3ae83eb5055e7f5c114c2bcd3003bc2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bmaur/simple-rest-api | 203 | FILENAME: MessageController.java | 0.255344 | package com.one2tribe.recruitment;
import com.one2tribe.recruitment.model.Message;
import com.one2tribe.recruitment.model.MessageInput;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
@RestController
@RequiredArgsConstructor
public class MessageController {
private final MessageService messageService;
@GetMapping("/message/random/{messageNumber}")
List<Message> randomMessages(@PathVariable("messageNumber") int messageNumber) {
return messageService.findRandomMessages(messageNumber);
}
@GetMapping("/message")
List<Message> getMessage() {
return messageService.getAllMessages();
}
@PostMapping("/message")
Message addMessage(@RequestBody MessageInput messageInput) {
return messageService.createMessage(messageInput);
}
@PutMapping("/message/{uuid}")
Message changeContent(@PathVariable UUID uuid, @RequestBody MessageInput messageInput) {
return messageService.updateMessage(uuid, messageInput);
}
}
|
4618fd58-bcf6-4de3-a5a8-278d0ed69c7f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-23 02:31:21", "repo_name": "Sunnzy/alwaysdazz", "sub_path": "/main/java/Test.java", "file_name": "Test.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "e170b858b25b4f23e434667b6d34e8a304579a64", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Sunnzy/alwaysdazz | 214 | FILENAME: Test.java | 0.204342 | import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
public class Test {
public static void main(String[] args) throws IOException {
Configuration conf = new Configuration();
conf.addResource("hdfs://127.0.0.1:9000");
conf.addResource("alwaysdazz");
// conf.addResource("/");
FileSystem filer = FileSystem.get(conf);
FileStatus fileStatus = filer.getFileStatus(new Path("/aaa"));
//获取分组
System.out.println(fileStatus.getGroup());
//获取最后的访问时间
System.out.println( fileStatus.getAccessTime());
//下载
System.out.println(fileStatus.isDirectory());
//判断路径下的所有文件及目录
System.out.println(fileStatus.getPath());
}
}
|
febd3ead-fc49-4719-a47d-01e6d7337eb4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-21 15:29:58", "repo_name": "lgf-Allen/spring-boot-demo", "sub_path": "/spring-boot-was/src/main/java/com/allen/spring/config/IbmmqConfig.java", "file_name": "IbmmqConfig.java", "file_ext": "java", "file_size_in_byte": 1211, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ebcd77c2a168074b3908f63beb08679c64bef313", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lgf-Allen/spring-boot-demo | 206 | FILENAME: IbmmqConfig.java | 0.2227 | /**
*
*/
package com.allen.spring.config;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.support.ErrorPageFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* @author first
*
*/
@Configuration
@ImportResource(locations = { "classpath:mq/mq.xml" })
public class IbmmqConfig extends WebMvcConfigurerAdapter {
@Bean
public ObjectMapper objectMapper() {
return new ObjectMapper();
}
@Bean
public ErrorPageFilter errorPageFilter() {
return new ErrorPageFilter();
}
@Bean
public FilterRegistrationBean disableSpringBootErrorFilter(ErrorPageFilter filter) {
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
filterRegistrationBean.setFilter(filter);
filterRegistrationBean.setEnabled(false);
return filterRegistrationBean;
}
}
|
e5d445ad-e748-4a8a-8118-874a599f81f2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-26 16:19:18", "repo_name": "zhichao19930808/struts2-test", "sub_path": "/src/main/java/com/demo/utils/EncodingInterceptors.java", "file_name": "EncodingInterceptors.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "c0cf39cf93b94e9b4e2a02db3a7d95323e8cc5c2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhichao19930808/struts2-test | 210 | FILENAME: EncodingInterceptors.java | 0.240775 | package com.demo.utils;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
import org.apache.struts2.ServletActionContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class EncodingInterceptors implements Interceptor {
@Override
public void destroy() {
// destroy 销毁 [dɪˈstrɔɪ]
}
@Override
public void init() {
// initialization 初始化\ [ɪ,nɪʃəlaɪ'zeɪʃən]
}
@Override
public String intercept(ActionInvocation invocation) throws Exception {
//修改请求的编码方式
HttpServletRequest request = ServletActionContext.getRequest();
request.setCharacterEncoding("UTF-8");
//修改响应的编码方式
HttpServletResponse response = ServletActionContext.getResponse();
response.setCharacterEncoding("UTF-8");
System.out.println("经过了Encoding拦截器");
//将请求交给action
return invocation.invoke();
}
}
|
9a3ac34c-aabe-436c-9bb6-6254815c32bb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-12 06:34:32", "repo_name": "JorgReal/ExamenPractico", "sub_path": "/src/modelo/Principal.java", "file_name": "Principal.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "01ac35ce3a692eaa08b4e50df307245f12b7ce13", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JorgReal/ExamenPractico | 237 | FILENAME: Principal.java | 0.261331 | /*
* 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 modelo;
/**
*
* @author Real
*/
import java.util.Scanner;
public class Principal {
public static void main (String [] args){
Scanner entrada = new Scanner(System.in);
String marca,modelo,placa;
int cantidad;
System.out.print("Cantidad de Vehiculos");
cantidad = entrada.nextInt();
vehiculo transporte[] = new vehiculo[cantidad];
for (int i=0; i<transporte.length;i++){
System.out.print("\nDigite Datos de Vehiculo"+(i+1)+":");
System.out.print("Introdusca Marca: ");
marca = entrada.nextLine();
System.out.print("Introdusca Modelo: ");
modelo = entrada.nextLine();
System.out.print("Introdusca Placa: ");
placa = entrada.nextLine();
transporte[i] = new vehiculo(marca,modelo,placa);
}
}
}
|
6cb554a1-1a03-4560-8f39-729959f4c6ac | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-28 16:00:22", "repo_name": "giovaneroggen/demo", "sub_path": "/delivery-service/src/main/java/br/com/delivery/enummeration/DispatchTypeEnum.java", "file_name": "DispatchTypeEnum.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "34d7cbd10c7c39a9c088ebb6bbf507fedfc453e1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/giovaneroggen/demo | 233 | FILENAME: DispatchTypeEnum.java | 0.278257 | package br.com.delivery.enummeration;
import br.com.entity.enummeration.GenericEnum;
import br.com.runnable.web.exception.GenericProcessException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.http.HttpStatus;
/**
* Created by giovane.silva on 22/09/2017.
*/
@AllArgsConstructor
public enum DispatchTypeEnum implements GenericEnum<String> {
DELIVERY(DispatchTypeEnum.DELIVERY_VALUE),
DRIVE_THRU(DispatchTypeEnum.DRIVE_THRU_VALUE);
@Getter
private final String value;
public static final String DELIVERY_VALUE = "delivery";
public static final String DRIVE_THRU_VALUE = "driveThru";
@Override
@JsonValue
public String jsonValue() {
return this.value;
}
@JsonCreator
public static DispatchTypeEnum forValue(String value) {
return GenericEnum.get(value, DispatchTypeEnum.class, (key) -> {
throw new GenericProcessException("INVALID DispatchTypeEnum " + key, HttpStatus.BAD_REQUEST);
});
}
}
|
e80a7e9c-ddac-488d-beb0-3bae30f16b05 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-11 11:19:26", "repo_name": "Metatavu/wso2-dbquery-mediator", "sub_path": "/src/main/java/fi/metatavu/wso2/dbquery/DBQueryMediatorSerializer.java", "file_name": "DBQueryMediatorSerializer.java", "file_ext": "java", "file_size_in_byte": 972, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "b52c527fd2e4e2d03c17bad09d566dd5153c7e4c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Metatavu/wso2-dbquery-mediator | 218 | FILENAME: DBQueryMediatorSerializer.java | 0.273574 | package fi.metatavu.wso2.dbquery;
import org.apache.axiom.om.OMElement;
import org.apache.synapse.Mediator;
import org.apache.synapse.config.xml.AbstractDBMediatorSerializer;
/**
* Mediator serializer for dbquery mediator
*
* @author Antti Leppä
*/
public class DBQueryMediatorSerializer extends AbstractDBMediatorSerializer {
@Override
protected OMElement serializeSpecificMediator(Mediator mediator) {
if (!(mediator instanceof DbQueryMediator)) {
handleException(String.format("Unexpected mediator %s when trying to serialize dbquery mediator", mediator.getType()));
}
DbQueryMediator dbQueryediator = (DbQueryMediator) mediator;
OMElement element = fac.createOMElement(DbQueryConstants.TAG_NAME, synNS);
saveTracingState(element, mediator);
serializeDBInformation(dbQueryediator, element);
return element;
}
@Override
public String getMediatorClassName() {
return DbQueryMediator.class.getName();
}
}
|
9a09e036-8f9e-417b-a317-0ca915877800 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-05 00:14:04", "repo_name": "Maxcimkj/Spring-5-Samples", "sub_path": "/spring_jdbc/src/main/java/com/maksim/spring/samples/dao/JdbcTemplateOnlyDao.java", "file_name": "JdbcTemplateOnlyDao.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "f55f12c4adcba4a4dbd78635f35156e8675d11d3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Maxcimkj/Spring-5-Samples | 198 | FILENAME: JdbcTemplateOnlyDao.java | 0.258326 | package com.maksim.spring.samples.dao;
import com.maksim.spring.samples.model.Station;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator;
import javax.sql.DataSource;
import java.util.List;
public class JdbcTemplateOnlyDao {
private JdbcTemplate jdbcTemplate;
public JdbcTemplateOnlyDao(DataSource dataSource, SQLErrorCodeSQLExceptionTranslator exceptionTranslator) {
this.jdbcTemplate = new JdbcTemplate();
this.jdbcTemplate.setDataSource(dataSource);
this.jdbcTemplate.setExceptionTranslator(exceptionTranslator);
}
public List<String> getStationNames() {
return jdbcTemplate.queryForList("SELECT name FROM Station", String.class);
}
public void insertStation(Station station) {
jdbcTemplate.update("INSERT INTO Station(name, line) VALUES (?, ?)",
station.getName(), station.getLine());
}
public void deleteStationByName(String name) {
jdbcTemplate.update("DELETE FROM Station WHERE name = ?", name);
}
}
|
75616e65-e7e5-4651-a0e9-a26221867847 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-11-01 09:37:04", "repo_name": "git-wylson/kata", "sub_path": "/foobarqix/foobarqix-web/src/main/java/fr/wd/kata/rs/config/CORSFilter.java", "file_name": "CORSFilter.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "d8c3aa83575e056898ec98d09af063cba592ec28", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/git-wylson/kata | 230 | FILENAME: CORSFilter.java | 0.253861 | package fr.wd.kata.rs.config;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
/**
* This class defines a way in which a browser and server can interact to determine safely whether or not to allow the cross-origin request
* @author wylson dibinga
*/
public class CORSFilter implements Filter {
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with, Content-Type");
chain.doFilter(req, res);
}
public void init(FilterConfig filterConfig) {
}
public void destroy() {
}
}
|
dec9dcc8-b203-422e-8f78-29116158fb93 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-20 22:32:09", "repo_name": "NEMAR/PaNeRo", "sub_path": "/panero-tools/debs-simulator/src/main/java/org/panero/debs/config/PaneroConfiguration.java", "file_name": "PaneroConfiguration.java", "file_ext": "java", "file_size_in_byte": 1210, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "cc9607169fa0775f68c2c317368b85187d12ed1f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NEMAR/PaNeRo | 193 | FILENAME: PaneroConfiguration.java | 0.228156 | package org.panero.debs.config;
import org.panero.gateway.client.GatewayClient;
import org.panero.gateway.client.GatewayConfiguration;
import org.panero.gateway.client.http.DefaultHttpClient;
import org.panero.gateway.client.http.HttpClientConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties(PaneroProperties.class)
public class PaneroConfiguration {
@Autowired
private PaneroProperties properties;
@Bean
public GatewayConfiguration gatewayConfiguration() {
final HttpClientConfiguration clientConfiguration = new HttpClientConfiguration();
clientConfiguration.setHostname(properties.getGateway().getHostname());
clientConfiguration.setPort(properties.getGateway().getPort());
return clientConfiguration;
}
@Bean
public GatewayClient gatewayClient(final GatewayConfiguration configuration) {
return new DefaultHttpClient((HttpClientConfiguration) configuration);
}
}
|
db16e0df-d7cb-4b7d-91d3-bee46653b4f1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-23 12:13:18", "repo_name": "mawenlong1/springCloud_order", "sub_path": "/order/order-server/src/main/java/com/mwl/order/controller/SendMessageController.java", "file_name": "SendMessageController.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "1bbb8c2749416d2998f010eccd4d5f30e6ad484c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mawenlong1/springCloud_order | 203 | FILENAME: SendMessageController.java | 0.220007 | package com.mwl.order.controller;
import com.mwl.order.dto.OrderDTO;
import com.mwl.order.message.StreamClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* @author mawenlong
* @date 2018/12/25
*/
@RestController
public class SendMessageController {
@Autowired
private StreamClient streamClient;
@GetMapping("sendMessage")
public void process() {
String message = "date:" + new Date();
streamClient.output().send(MessageBuilder.withPayload(message).build());
}
@GetMapping("sendObject")
public void sendObeject() {
OrderDTO orderDTO= new OrderDTO();
orderDTO.setBuyerName("123456");
streamClient.output().send(MessageBuilder.withPayload(orderDTO).build());
}
}
|
c977d43e-4f99-4e80-86d7-b2f4e355c0de | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-14 01:57:06", "repo_name": "Kneuman0/AlbumTunesRef", "sub_path": "/AlbumTunesControllers/src/main/java/fun/albumtunes/changelisteners/OnMediaProgressUpdate.java", "file_name": "OnMediaProgressUpdate.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "db43e2ad76d584ec4545f4d3f12af51503ab6ae8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Kneuman0/AlbumTunesRef | 200 | FILENAME: OnMediaProgressUpdate.java | 0.286968 | package fun.albumtunes.changelisteners;
import fun.albumtunes.utilities.MediaUtils;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollBar;
import javafx.scene.media.MediaPlayer;
public class OnMediaProgressUpdate implements javafx.scene.media.AudioSpectrumListener {
private Label songTime;
private ScrollBar scrollBar;
private MediaPlayer currentPlayer;
public OnMediaProgressUpdate(MediaPlayer currentPlayer, ScrollBar scrollBar, Label songTime) {
this.scrollBar = scrollBar;
this.currentPlayer = currentPlayer;
this.songTime = songTime;
}
@Override
public void spectrumDataUpdate(double timestamp, double duration,
float[] magnitudes, float[] phases) {
double scrollBarValue = currentPlayer.getCurrentTime().toSeconds()/
currentPlayer.getTotalDuration().toSeconds();
scrollBar.setValue(scrollBarValue);
songTime.setText(MediaUtils.convertDecimalMinutesToTimeMinutes(
(currentPlayer.getCurrentTime().toMinutes())));
}
}
|
111e437b-2268-47ab-9dd5-b05e7d18ce56 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-18 09:15:01", "repo_name": "niuzymain/SpringBoot_Study", "sub_path": "/miaosha/src/main/java/com/nzy/miaosha/MiaoshaApplication.java", "file_name": "MiaoshaApplication.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "1959f03ffe1b9002f9787a46b6164a91e0a83f7d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/niuzymain/SpringBoot_Study | 213 | FILENAME: MiaoshaApplication.java | 0.218669 | package com.nzy.miaosha;
import com.nzy.miaosha.dao.PasswordMapper;
import com.nzy.miaosha.entity.Password;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication(scanBasePackages = {"com.nzy.miaosha"})
@MapperScan("com.nzy.miaosha.dao")
@RestController
public class MiaoshaApplication {
@Autowired
private PasswordMapper passwordMapper;
@RequestMapping(value = "/start", method = RequestMethod.GET)
public String Start() {
Password password = passwordMapper.selectByPrimaryKey(1);
if (password != null) {
return password.getPassword();
} else {
return "null";
}
}
public static void main(String[] args) {
SpringApplication.run(MiaoshaApplication.class, args);
}
}
|
0ed255ac-9ec5-4c85-9085-f36c3d440147 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-09 08:36:20", "repo_name": "L-Xiah/theX", "sub_path": "/MonSpringBoot/src/main/java/fv/controller/HomeController.java", "file_name": "HomeController.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "1abd25812240a11171adda8b94905692dce248f9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/L-Xiah/theX | 243 | FILENAME: HomeController.java | 0.220007 | package fv.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HomeController {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@RequestMapping("/index")
public String index() {
System.out.println("--" + System.getProperty("catalina.home"));
System.out.println("--" + System.getProperty("user.home"));
logger.info("index---+++++");
return "index";//通过mvc访问src/main/webapp路径下jsp文件(前面不加"/")
}
@RequestMapping("/index1")
public String index1() {
return "/index";//通过thymeleaf引入resources下的html文件
}
@RequestMapping("/set")
public String getSet() {
return "theK";
}
@RequestMapping("/theK")
public String getTheK() {
return "/theK";
}
@RequestMapping("/slide")
public String getTheSlide() {
return "/theSlide";
}
@RequestMapping("/theCss")
public String getTheCss() {
return "/theCss";
}
}
|
33a87b9f-6372-486a-a1c4-ac91d7112599 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-08 04:44:21", "repo_name": "Evior/e3_mall", "sub_path": "/e3_sso/e3_sso_service/src/main/java/cn/e3mall/sso/service/impl/TokenServiceImpl.java", "file_name": "TokenServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1171, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "6ca5b919f943b5955e82abbfb3c3a1a856d39b91", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Evior/e3_mall | 255 | FILENAME: TokenServiceImpl.java | 0.245085 | package cn.e3mall.sso.service.impl;
import cn.e3mall.comment.jedis.JedisClientCluster;
import cn.e3mall.comment.utils.E3Result;
import cn.e3mall.comment.utils.JsonUtils;
import cn.e3mall.pojo.TbUser;
import cn.e3mall.sso.service.TokenService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@Service
public class TokenServiceImpl implements TokenService {
/*过期时间*/
@Value("${SESSION_EXPIRE}")
private Integer SESSION_EXPIRE;
@Autowired
private JedisClientCluster jedisClientCluster;
@Override
public E3Result getUserByToken(String token) {
String json=jedisClientCluster.get("SESSION:"+token);
//判断
if (!StringUtils.isNotBlank(json))
{
return E3Result.build(201,"用户登录已过期");
}
//去用户信息 更新时间
jedisClientCluster.expire("SESSION:"+token,SESSION_EXPIRE);
TbUser tbUser = JsonUtils.jsonToPojo(json, TbUser.class);
return E3Result.ok(tbUser);
}
}
|
68eb145c-a1a4-42ee-98fc-02e4c2c9bd16 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-21 12:28:36", "repo_name": "bprollinson/robotzombieninjawizard", "sub_path": "/rznw/game/maincharacter/inventory/IceRod.java", "file_name": "IceRod.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "a8d6f4f9e25cec66092a1922c0d62c03c895a014", "star_events_count": 11, "fork_events_count": 4, "src_encoding": "UTF-8"} | https://github.com/bprollinson/robotzombieninjawizard | 250 | FILENAME: IceRod.java | 0.285372 | package rznw.game.maincharacter.inventory;
import rznw.game.enemy.EnemyCharacter;
import rznw.game.maincharacter.MainCharacter;
import rznw.map.GameWorld;
import rznw.ui.LogRendererFactory;
import rznw.utility.RandomNumberGenerator;
public class IceRod extends Weapon
{
public static final int EQUIPMENT_NUMBER = 6;
public String getDisplayName()
{
return "Ice Rod";
}
public String[] getStats()
{
return new String[] {
"Damage: " + this.getDamage(),
"",
"Freezes enemies",
"Chance to freeze: 50%",
"",
"Value: " + this.getValue()
};
}
public int getDamage()
{
return 8;
}
public void damagedEnemyCharacter(MainCharacter mainCharacter, EnemyCharacter enemyCharacter, int damage, GameWorld gameWorld)
{
if (RandomNumberGenerator.rollSucceeds(50))
{
enemyCharacter.getStatusEffects().freeze();
LogRendererFactory.instance().log("Enemy frozen.");
}
}
public int getEquipmentNumber()
{
return IceRod.EQUIPMENT_NUMBER;
}
}
|
15f0757b-f72f-4e52-8d17-47fd9418d9d4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-13 21:58:32", "repo_name": "mykels/microTag", "sub_path": "/src/main/java/micro/tag/core/services/file/FileReader.java", "file_name": "FileReader.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "1b674a7222d6fa9720a32910d0a31dbde49f4e8b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mykels/microTag | 195 | FILENAME: FileReader.java | 0.240775 | package micro.tag.core.services.file;
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
@Service
public class FileReader {
private static final Logger logger = LogManager.getLogger(FileReader.class);
private Environment env;
@Autowired
public FileReader(Environment env) {
this.env = env;
}
@PostConstruct
public void onInit() {
logger.info("==== FileReader is initialized ====");
}
public File getFile(String fileName) throws IOException {
return new File(env.getProperty("resource.path") + File.separator + fileName);
}
public String read(String fileName) throws IOException {
return FileUtils.readFileToString(getFile(fileName), Charset.forName("UTF-8"));
}
}
|
1f1ea9ec-36c7-4a1e-8f99-452ef5174377 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-06-22 06:36:45", "repo_name": "rpidikiti/mongodb-benchmark-tools", "sub_path": "/src/main/java/org/eatbacon/mongodb/benchmark/morphia/entity/TestObject.java", "file_name": "TestObject.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "725f5b33c218a44851e0eb65c4a32b17b2a79772", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rpidikiti/mongodb-benchmark-tools | 281 | FILENAME: TestObject.java | 0.252384 | package org.eatbacon.mongodb.benchmark.morphia.entity;
import java.util.List;
import com.google.code.morphia.annotations.Embedded;
import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;
import com.google.code.morphia.annotations.Property;
@Entity
public class TestObject {
@Id
long id;
@Property("strval")
String stringVal;
@Property("long_val")
long longVal;
@Embedded
List<User> users;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getStringVal() {
return stringVal;
}
public void setStringVal(String stringVal) {
this.stringVal = stringVal;
}
public long getLongVal() {
return longVal;
}
public void setLongVal(long longVal) {
this.longVal = longVal;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
@Override
public String toString() {
return "MorphiaEntity [id=" + id + ", longVal=" + longVal
+ ", stringVal=" + stringVal + ", users=" + users + "]";
}
} |
568537a3-e439-4a2e-9a32-1ef0f457985c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-23 13:27:41", "repo_name": "Abolesonike/WeVote", "sub_path": "/src/main/java/com/example/wv/entity/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "048238d60744a264f644cd329f8221aeed12fa4f", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Abolesonike/WeVote | 196 | FILENAME: User.java | 0.204342 | package com.example.wv.entity;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collection;
import java.util.Collections;
@Data
public class User implements UserDetails {
int id;
String username;
String password;
String heard_url;
int status;
/**
*返回用户授予的权限集合
*/
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER"));
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
}
|
fd328543-7e60-4474-83f9-b93ef6aa6da5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-30 03:35:55", "repo_name": "hleminh/MyLogin", "sub_path": "/app/src/main/java/com/example/hoang/mylogin/utils/InputValidator.java", "file_name": "InputValidator.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "f5ba0201230d542ec6605d23124f7161d34d13e8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hleminh/MyLogin | 243 | FILENAME: InputValidator.java | 0.282196 | package com.example.hoang.mylogin.utils;
import android.util.Patterns;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Created by Hoang on 5/27/2017.
*/
public class InputValidator {
private static final String PASSWORD_PATTERN = "^(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$";
private static final String USERNAME_PATTERN = "(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,20})$";
public static boolean isValidPassword(String passwordEd) {
Pattern pattern = Pattern.compile(PASSWORD_PATTERN);
Matcher matcher = pattern.matcher(passwordEd);
return matcher.matches();
}
public static boolean isValidUsername(String usernameEd) {
Pattern pattern = Pattern.compile(USERNAME_PATTERN);
Matcher matcher = pattern.matcher(usernameEd);
return matcher.matches();
}
public static boolean isValidEmail(String emailEd) {
Pattern pattern = Patterns.EMAIL_ADDRESS;
Matcher matcher = pattern.matcher(emailEd);
return matcher.matches();
}
}
|
48607f67-dd1e-48ef-8127-fb5c9caf538f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-16 01:46:18", "repo_name": "hzr958/myProjects", "sub_path": "/scmv6/web-v8pub/src/main/java/com/smate/web/v8pub/service/sns/PubModifyHistoryServiceImpl.java", "file_name": "PubModifyHistoryServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "e22c4354e7efcb209daddab89823ec1dad410d01", "star_events_count": 2, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/hzr958/myProjects | 237 | FILENAME: PubModifyHistoryServiceImpl.java | 0.267408 | package com.smate.web.v8pub.service.sns;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.smate.web.v8pub.dao.sns.PubModifyHistoryDao;
import com.smate.web.v8pub.exception.ServiceException;
import com.smate.web.v8pub.po.sns.PubModifyHistory;
/**
* 个人库成果修改历史记录服务实现类
*
* @author yhx
*
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class PubModifyHistoryServiceImpl implements PubModifyHistoryService {
@Autowired
private PubModifyHistoryDao pubModifyHistoryDao;
@Override
public PubModifyHistory findListByPubIdAndPsnId(Long pubId, Long psnId) throws ServiceException {
PubModifyHistory pubHistory = pubModifyHistoryDao.findListByPubIdAndPsnId(pubId, psnId);
return pubHistory;
}
@Override
public void savePubModifyHistory(PubModifyHistory pubModifyHistory) throws ServiceException {
pubModifyHistoryDao.save(pubModifyHistory);
}
}
|
24349887-e575-4e47-8849-3f30b7455da3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-10-25 02:03:54", "repo_name": "zople/365Project", "sub_path": "/Model/src/java/com/zople/dao/enterprise/EnterpriseContactFacade.java", "file_name": "EnterpriseContactFacade.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "fcdbea711ee6b9ec47812af347d22324e7400cea", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/zople/365Project | 225 | FILENAME: EnterpriseContactFacade.java | 0.294215 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.zople.dao.enterprise;
import com.zople.dao.basic.*;
import com.zople.dao.utils.CollectionUtil;
import com.zople.domain.TblEnterpriseContact;
import com.zople.domain.basic.UserInfo;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
/**
*
* @author 王文彦
*/
@Stateless
public class EnterpriseContactFacade extends AbstractFacade<UserInfo> {
@PersistenceContext(unitName = "365PU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public EnterpriseContactFacade() {
super(UserInfo.class);
}
public TblEnterpriseContact findEnterpriseContact(String id){
Query query=em.createQuery("select t from TblEnterpriseContact t where t.enterpriseId ="+id);
return CollectionUtil.getFirstElement((List<TblEnterpriseContact>)query.getResultList());
}
}
|
70943583-8d5f-4b36-b1eb-1e2e4087f7a1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-27 21:38:46", "repo_name": "FRC5113/2019-Robot-Java-Postseason", "sub_path": "/src/main/java/frc/robot/subsystems/CargoIntake.java", "file_name": "CargoIntake.java", "file_ext": "java", "file_size_in_byte": 1210, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "4af44b1327eeefe6a111d04dd934d383b7c326c2", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/FRC5113/2019-Robot-Java-Postseason | 309 | FILENAME: CargoIntake.java | 0.277473 | package frc.robot.subsystems;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.command.Subsystem;
import frc.robot.RobotMap;
public class CargoIntake extends Subsystem {
private WPI_TalonSRX intakeMotor = new WPI_TalonSRX(RobotMap.intakeMotorCAN);
private DoubleSolenoid pivot = new DoubleSolenoid(RobotMap.pivotSolenoid0, RobotMap.pivotSolenoid1);
public CargoIntake() {
intakeMotor.setInverted(true); // Set as inverted because it spins the wrong direction.
pivot.set(Value.kForward); // Initialized as kForward because that is its starting configuration.
}
/**
* True for intake, false for outtake.
*/
public void intakeSpinDirection(boolean dir) {
intakeMotor.set(dir ? RobotMap.intakeSpeed : RobotMap.outputSpeed);
}
public void intakeOff() {
intakeMotor.set(0);
}
public void togglePivot() {
if (pivot.get() == Value.kForward) {
pivot.set(Value.kReverse);
} else {
pivot.set(Value.kForward);
}
}
@Override
public void initDefaultCommand() {
// This subsystem has no default command.
}
}
|
602dae3e-a641-4b34-8a25-f8af3d1b695f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-11 15:02:59", "repo_name": "bakic/library-service-provider-example", "sub_path": "/standard-library/src/main/java/org/library/StandardLibrary.java", "file_name": "StandardLibrary.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "93672b4ceeb9998bed2672e991848c7597259f3a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bakic/library-service-provider-example | 233 | FILENAME: StandardLibrary.java | 0.274351 | package org.library;
import java.util.Map;
import java.util.TreeMap;
import org.library.spi.Book;
import org.library.spi.Library;
public class StandardLibrary implements Library {
private final Map<String, Book> books;
public StandardLibrary() {
books = new TreeMap<>();
Book nineteenEightyFour = new Book("Nineteen Eighty-Four", "George Orwell",
"It was a bright cold day in April, and the clocks were striking thirteen.");
Book theLordOfTheRings = new Book("The Lord of the Rings", "J. R. R. Tolkien",
"When Mr. Bilbo Baggins of Bag End announced that he would shortly be celebrating his " +
"eleventy-first birthday with a party of special magnificence, there was much talk and excitement in Hobbiton.");
books.put("Nineteen Eighty-Four", nineteenEightyFour);
books.put("The Lord of the Rings", theLordOfTheRings);
}
@Override
public Book getBook(String name) {
return books.get(name);
}
}
|
4aff2893-d88f-4be7-b21f-d284da4a521a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-14 17:38:09", "repo_name": "Kessler1459/Udee", "sub_path": "/src/main/java/com/Udee/models/Address.java", "file_name": "Address.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "a912e1a31ce047df8bb2fa525eb2daddf2585081", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Kessler1459/Udee | 239 | FILENAME: Address.java | 0.27513 | package com.Udee.models;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@Entity
@Getter
@Setter
@ToString
@AllArgsConstructor
@RequiredArgsConstructor
@Table(name = "addresses")
public class Address {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Integer id;
@NotNull @Size(min = 2, max = 50)
private String street;
@NotNull
private Integer num;
@Column(name = "floor_unit")
@Size(min = 1, max = 10)
private String floorUnit;
@Column(name = "postal_code")
@NotNull @Size(min = 3, max = 30)
private String postalCode;
@OneToOne( optional = false, orphanRemoval = true)
@JoinColumn(name = "residence_id", nullable = false, unique = true)
@JsonBackReference("residence-address")
@ToString.Exclude
private Residence residence;
}
|
0968bd8d-b99e-4d95-bcf9-228e43e0107a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-22 07:24:55", "repo_name": "liuziyingbeidou/deelkall", "sub_path": "/fuzhuang/src/service/basedoc/BaseDocService.java", "file_name": "BaseDocService.java", "file_ext": "java", "file_size_in_byte": 1170, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "d4a027a8b0872adcd179b93d2596e29b2e075f57", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "GB18030"} | https://github.com/liuziyingbeidou/deelkall | 253 | FILENAME: BaseDocService.java | 0.290981 | package service.basedoc;
import itf.pub.IConstant;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletResponse;
import model.basedoc.BaseDocVO;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import service.impl.CommonService;
import dao.IMyHibernateDao;
public class BaseDocService extends CommonService {
@Autowired @Qualifier("myHibernateDao")
IMyHibernateDao mydao;
public void save(BaseDocVO baseDocVO,String doctype){
try {
Integer id = baseDocVO.getId();
HttpServletResponse response = ServletActionContext.getResponse();
String msg = "保存失败";
if(id != null){
mydao.updateBean(baseDocVO);
msg = "更新成功";
}else{
//标识是品牌档案
baseDocVO.setVdoctype(doctype);
mydao.insertBean(baseDocVO);
msg = "新增成功";
}
response.setContentType("text/html;charset=utf-8");
PrintWriter out = response.getWriter();
out.print(msg);
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
decb39d1-ddd3-4b18-a1ab-121c6371e720 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-20 15:08:29", "repo_name": "Allen1211/minispring", "sub_path": "/MiniSpring-Ioc/src/main/java/com/allen/minispring/factory/XmlBeanFactory.java", "file_name": "XmlBeanFactory.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "95113e37b90b7d858ce6fd97198c7199c785be43", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Allen1211/minispring | 237 | FILENAME: XmlBeanFactory.java | 0.287768 | package com.allen.minispring.factory;
import com.allen.minispring.exception.BeanDefinitionReadException;
import com.allen.minispring.io.ClassPathResource;
import com.allen.minispring.io.Resource;
/**
* @ClassName XmlBeanFactory
* @Description DefaultBeanFactory的子类,基于XML配置文件建立Bean工厂
* @Author XianChuLun
* @Date 2020/9/5
* @Version 1.0
*/
public class XmlBeanFactory extends DefaultBeanFactory{
private final XmlBeanDefinitionReader reader;
public XmlBeanFactory(String resourceClassPathLocation) throws BeanDefinitionReadException {
this(new ClassPathResource(resourceClassPathLocation));
}
public XmlBeanFactory(Resource resource) throws BeanDefinitionReadException {
super();
this.reader = new XmlBeanDefinitionReader(super.beanDefinitionRegistry);
this.reader.loadBeanDefinitions(resource);
}
public XmlBeanFactory(Resource... resources) throws BeanDefinitionReadException {
super();
this.reader = new XmlBeanDefinitionReader(super.beanDefinitionRegistry);
this.reader.loadBeanDefinitions(resources);
}
}
|
b6cd7604-d4d2-4a0f-8b3f-661bcf8f67aa | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-22 13:53:44", "repo_name": "fathurrohmane/Pop-Movie", "sub_path": "/app/src/main/java/com/elkusnandi/popularmovie/data/model/RequestSessionIdRespond.java", "file_name": "RequestSessionIdRespond.java", "file_ext": "java", "file_size_in_byte": 1207, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "f9ce82d377f334d34c9ee767ac0b67d00b977e93", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fathurrohmane/Pop-Movie | 248 | FILENAME: RequestSessionIdRespond.java | 0.216012 | package com.elkusnandi.popularmovie.data.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by Taruna 98 on 31/12/2017.
*/
public class RequestSessionIdRespond {
@SerializedName("success")
@Expose
private Boolean success;
@SerializedName("session_id")
@Expose
private String sessionId;
@SerializedName("status_message")
@Expose
private String statusMessage;
@SerializedName("status_code")
@Expose
private Integer statusCode;
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public String getStatusMessage() {
return statusMessage;
}
public void setStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
}
public Integer getStatusCode() {
return statusCode;
}
public void setStatusCode(Integer statusCode) {
this.statusCode = statusCode;
}
}
|
f550f02c-4029-4418-957f-d8018c0bb04e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-23 09:23:38", "repo_name": "neoteric-eu/neo-starters", "sub_path": "/request-parameters/src/main/java/eu/neoteric/starter/request/RequestField.java", "file_name": "RequestField.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "16ddf4d02025a314edbfd6280f18fda0304a3b2d", "star_events_count": 11, "fork_events_count": 11, "src_encoding": "UTF-8"} | https://github.com/neoteric-eu/neo-starters | 203 | FILENAME: RequestField.java | 0.243642 | package eu.neoteric.starter.request;
import java.util.Objects;
public class RequestField implements RequestObject {
private final String fieldName;
private RequestField(String fieldName) {
this.fieldName = fieldName;
}
public static RequestField of(String fieldName) {
return new RequestField(fieldName);
}
public String getFieldName() {
return fieldName;
}
@Override
public RequestObjectType getType() {
return RequestObjectType.FIELD;
}
@Override
public String toString() {
return "<" + fieldName + ">";
}
@Override
public final boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof RequestField)) {
return false;
}
RequestField other = (RequestField) o;
return Objects.equals(this.fieldName, other.fieldName);
}
@Override
public final int hashCode() {
return Objects.hash(fieldName);
}
}
|
4a6b88cc-98d3-4260-8451-77c824989af9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-20 20:20:06", "repo_name": "egierski/CourseSchedulerApplication", "sub_path": "/src/edu/bsu/nicegierski/CourseOffering.java", "file_name": "CourseOffering.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "21c7971cb92481fcca4b0bccebaa29afeff2c9d7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/egierski/CourseSchedulerApplication | 214 | FILENAME: CourseOffering.java | 0.259826 | package edu.bsu.nicegierski;
public class CourseOffering {
private final String title;
private final String number;
private final String crn;
private final String section;
public CourseOffering(Builder builder){
this.title = builder.title;
this.number = builder.number;
this.crn = builder.crn;
this.section = builder.section;
}
public static final class Builder{
private String title;
private String number;
private String crn;
private String section;
public Builder setTitle(String title){
this.title = title;
return this;
}
public Builder setNumber(String number){
this.number = number;
return this;
}
public Builder setCrn(String crn){
this.crn = crn;
return this;
}
public Builder setSection(String section){
this.section = section;
return this;
}
public CourseOffering build() {
return new CourseOffering(this);
}
}
}
|
f790aa7d-bd09-4d22-972d-2c62219627d9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-05 23:37:59", "repo_name": "jmverneri/Laboratorio-3", "sub_path": "/Guia 2/src/com/utn/ej2/Client.java", "file_name": "Client.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "75d8fea29671f9392772358970665b5834e326bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jmverneri/Laboratorio-3 | 249 | FILENAME: Client.java | 0.228156 | package com.utn.ej2;
import java.util.Random;
import java.util.UUID;
public class Client {
private UUID id;
private String name;
private String email;
private double percentage;
public Client(){
}
public Client(String name, String email, double percentage) {
this.id= UUID.randomUUID();
this.name= name;
this.email= email;
this.percentage= percentage;
}
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public double getPercentage() {
return percentage;
}
public void setPercentage(double percentage) {
this.percentage = percentage;
}
@Override
public String toString() {
return "\nID: " + id + ", nombre: " + name + ", email: " + email + ", descuento: " + percentage;
}
}
|
bd8b552e-da73-44df-a7fc-d2ff54976a27 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-13 13:53:51", "repo_name": "zhubinsheng/BRVAHandRXJAVA", "sub_path": "/app/src/main/java/gdyj/tydic/com/jinlingapp/TestFragmentAdapter.java", "file_name": "TestFragmentAdapter.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "e7627e746ecc73e18d6009f37e29ce7100a2de96", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhubinsheng/BRVAHandRXJAVA | 210 | FILENAME: TestFragmentAdapter.java | 0.235108 | package gdyj.tydic.com.jinlingapp;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import java.util.List;
// 1.创建Adapter
public class TestFragmentAdapter extends FragmentPagerAdapter {
// 用来添加Fragment
private List<Fragment> fragments;
// 用来存储Fragment标题
private String title[] = {"首页","成长树","发现","我的"};
public void setFragments(List<Fragment> fragments) {
this.fragments = fragments;
notifyDataSetChanged();
}
public TestFragmentAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
return fragments.get(position);
}
@Override
public int getCount() {
return fragments != null ? fragments.size() : 0;
}
@Override
public CharSequence getPageTitle(int position) {
// 设置Fragment标题
return title[position];
}
}
|
fe93c1a3-be1d-46b7-b2cd-c7085d8c85aa | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-30 14:45:46", "repo_name": "DungltAPV/ChatOn", "sub_path": "/app/src/main/java/com/lethdz/onlinechatdemo/modal/RoomMessage.java", "file_name": "RoomMessage.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "b25cbcf8b9c28d1f3bf41716cfb46d89a5e13558", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DungltAPV/ChatOn | 212 | FILENAME: RoomMessage.java | 0.200558 | package com.lethdz.onlinechatdemo.modal;
import com.google.firebase.Timestamp;
public class RoomMessage {
private String id;
private String owner;
private String message;
private Timestamp timeStamp;
public RoomMessage() {
}
public RoomMessage(String id, String owner, String message, Timestamp timeStamp) {
this.id = id;
this.owner = owner;
this.message = message;
this.timeStamp = timeStamp;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Timestamp getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(Timestamp timeStamp) {
this.timeStamp = timeStamp;
}
}
|
c044ae4f-2b4a-4084-97d3-e7dc61aa3b8a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-26 15:07:43", "repo_name": "Parism/hotel_app", "sub_path": "/app/src/main/java/com/example/hotel/OpenPhotoActivity.java", "file_name": "OpenPhotoActivity.java", "file_ext": "java", "file_size_in_byte": 972, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "7e07089d7565183bd105657cacf3428bb6d65b85", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/Parism/hotel_app | 165 | FILENAME: OpenPhotoActivity.java | 0.226784 | package com.example.hotel;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
public class OpenPhotoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_open_photo);
Bundle extras = getIntent().getExtras();
/* byte[] byteArray = extras.getByteArray("image");
Bitmap bmp = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
ImageView image = findViewById(R.id.openImageView);
image.setImageBitmap(bmp);*/
int tag = extras.getInt("image");
ImageView image = findViewById(R.id.openImageView);
Drawable d = getResources().getDrawable(tag);
image.setImageDrawable(d);
}
}
|
b990392a-40f9-4b55-8dbd-a6d6f3ff2cff | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-10-30T21:50:17", "repo_name": "Pavan47Rao/JS-with-AJAX-calls", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1088, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "fcfd6ab3f765a97155e9d048f6ff1176b1fd6759", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Pavan47Rao/JS-with-AJAX-calls | 280 | FILENAME: README.md | 0.285372 | # Stalk the Stock
## PROJECT DESCRIPTION:
Fetch the stock details of snapchat, twitter and vodafone upon user request from text box and display the details in a table
## MOTIVATION:
1. The goal of this assignment is to learn about JavaScript.
2. Use fetch api/XHR requests to make ajax call to the server and handle response using promise.
3. Use RxJs observables for adding event listeners.
## TECH USED:
JavaScript, HTML, CSS
## Installation:
1. Clone the repository using git clone https://github.com/neu-mis-info6150-fall-2019/assignment-7-PavanKalyanSrikantaRao.git
2. Navigate to project directory.
3. Run `npm install`.
## Build
Default build mode is `production`. This will build `index.html `, `main.js` and `main.css` files in the `dist` directory.
1. To build the app, run `npm run build`.
2. Launh the app by opening the file `./dist/index.html` in a browser.
## Development Server
Follow below steps to lauch the app using `webpack-dev-server`.
1. Run `npm start` or `npm run start`.
2. This will open the app on a browser window.
## AUTHOR:
Pavan Kalyan Srikanta Rao
|
c622bb2f-c883-4947-9fb0-eb633d5a49ca | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-09 05:04:17", "repo_name": "luvsword/del4u", "sub_path": "/app/src/main/java/com/kaist/delforyou/activity/ListItem.java", "file_name": "ListItem.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "1e76fbabbcb7430cdd01491ad21b7597f27e4add", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/luvsword/del4u | 229 | FILENAME: ListItem.java | 0.224055 | package com.kaist.delforyou.activity;
/**
* Created by birmjin.in on 2016. 8. 7..
*/
public class ListItem {
private String date;
private String dayOfWeek;
private String itemDescription;
private String personInfo;
private String deliveryStatus;
private String shippingLocation;
public ListItem(String date, String dayOfWeek, String itemDescription, String personInfo, String location, String status) {
this.date = date;
this.dayOfWeek = dayOfWeek;
this.itemDescription = itemDescription;
this.personInfo = personInfo;
this.shippingLocation = location;
this.deliveryStatus = status;
}
public String getDate() {
return this.date;
}
public String getDayOfWeek() {
return this.dayOfWeek;
}
public String getItemDescription(){
return this.itemDescription;
}
public String getPersonInfo(){
return this.personInfo;
}
public String getShippingLocation() {return this.shippingLocation;}
public String getDeliveryStatus(){return this.deliveryStatus;}
}
|
810694c1-a8b3-4690-a1e3-34bb6d0d8015 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-23 15:45:11", "repo_name": "JakubPetr/ebean", "sub_path": "/src/test/java/org/tests/transaction/TestBeginTransactionWithExisting.java", "file_name": "TestBeginTransactionWithExisting.java", "file_ext": "java", "file_size_in_byte": 1210, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "89d982718268e0fd50cb946c683f1e9eb88832ff", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/JakubPetr/ebean | 234 | FILENAME: TestBeginTransactionWithExisting.java | 0.286968 | package org.tests.transaction;
import io.ebean.BaseTestCase;
import io.ebean.Ebean;
import io.ebean.Transaction;
import io.ebean.annotation.TxIsolation;
import org.junit.Test;
import javax.persistence.PersistenceException;
import java.sql.Connection;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
public class TestBeginTransactionWithExisting extends BaseTestCase {
@Test
public void testTransactionIsoLevels() {
assertEquals(Transaction.READ_COMMITTED, Connection.TRANSACTION_READ_COMMITTED);
assertEquals(Transaction.READ_UNCOMMITTED, Connection.TRANSACTION_READ_UNCOMMITTED);
assertEquals(Transaction.REPEATABLE_READ, Connection.TRANSACTION_REPEATABLE_READ);
assertEquals(Transaction.SERIALIZABLE, Connection.TRANSACTION_SERIALIZABLE);
}
@Test(expected = PersistenceException.class)
public void test() {
assertEquals(Transaction.READ_COMMITTED, Connection.TRANSACTION_READ_COMMITTED);
Transaction txn = Ebean.beginTransaction();
try {
try (Transaction txn2 = Ebean.beginTransaction(TxIsolation.READ_COMMITED)) {
fail("Expected persitenceException here");
}
} finally {
txn.end();
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.