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 |
|---|---|---|---|---|---|---|
d7d8410e-5a14-46ba-9f14-cb630fa56fd0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-13 06:02:17", "repo_name": "xuhaijiang/sapanywhere-sdk", "sub_path": "/sapanywhere-appointmentactivity/src/main/java/com/hc/sap/anywhere/api/appointmentactivity/bean/relation/ParticipantInfo.java", "file_name": "ParticipantInfo.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "b82e56e48ee0a84ecfbc3973ea561ea8e532761d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xuhaijiang/sapanywhere-sdk | 230 | FILENAME: ParticipantInfo.java | 0.246533 | package com.hc.sap.anywhere.api.appointmentactivity.bean.relation;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Appointment activity participant.
*
* @author xuhaijiang
*
*/
public class ParticipantInfo {
@JsonProperty(value = "id")
private long id;
@JsonProperty(value = "participantType")
private ParticipantType participantType;
@JsonProperty(value = "participantId")
private long participantId;
public ParticipantInfo(){}
public ParticipantInfo(ParticipantType participantType,long participantId){
this.participantType = participantType;
this.participantId = participantId;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public ParticipantType getParticipantType() {
return participantType;
}
public void setParticipantType(ParticipantType participantType) {
this.participantType = participantType;
}
public long getParticipantId() {
return participantId;
}
public void setParticipantId(long participantId) {
this.participantId = participantId;
}
}
|
a5d1a162-454b-4f63-ae1a-6104702ce3dc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-14 21:35:23", "repo_name": "cilogon/cilogon-java", "sub_path": "/loader/src/main/java/org/cilogon/oauth2/servlet/storage/idp/MultiIDPStoreProvider.java", "file_name": "MultiIDPStoreProvider.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "4f4e368a5a000a7a39b7922bf7264bb734856b59", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cilogon/cilogon-java | 236 | FILENAME: MultiIDPStoreProvider.java | 0.278257 | package org.cilogon.oauth2.servlet.storage.idp;
import edu.uiuc.ncsa.myproxy.oa4mp.server.OA4MPConfigTags;
import edu.uiuc.ncsa.security.core.configuration.provider.MultiTypeProvider;
import edu.uiuc.ncsa.security.core.util.MyLoggingFacade;
import org.apache.commons.configuration.tree.ConfigurationNode;
/**
* <p>Created by Jeff Gaynor<br>
* on 3/19/12 at 6:42 PM
*/
public class MultiIDPStoreProvider extends MultiTypeProvider<IdentityProviderStore> implements OA4MPConfigTags {
public MultiIDPStoreProvider(ConfigurationNode config,
boolean disableDefaultStore, MyLoggingFacade loggingFacade) {
super(config, disableDefaultStore, loggingFacade, null, IDENTITY_PROVIDERS);
}
MemoryIDPStore idpStore;
@Override
public IdentityProviderStore getDefaultStore() {
if(idpStore == null){
logger.info("Using default in memory IDP store.");
idpStore = new MemoryIDPStore(new IDPProvider());
}
return idpStore;
}
}
|
aff98022-34bc-4031-91f8-16a875712e31 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-10 03:17:27", "repo_name": "ZhouYC627/RDMASorting", "sub_path": "/src/main/java/rdma/RdmaConsumer.java", "file_name": "RdmaConsumer.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "05a3134e125e9c83b4029e52b8de1083f2894465", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/ZhouYC627/RDMASorting | 232 | FILENAME: RdmaConsumer.java | 0.26588 | package rdma;
import com.ibm.disni.util.DiSNILogger;
import java.io.IOException;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutionException;
public class RdmaConsumer implements Runnable {
private final ArrayBlockingQueue<RdmaJob> jobQueue;
public RdmaConsumer(ArrayBlockingQueue<RdmaJob> jobQueue) {
this.jobQueue = jobQueue;
}
@Override
public void run() {
DiSNILogger.getLogger().info("Rdma Consumer running....");
while (true) {
try {
//DiSNILogger.getLogger().info("Waiting for jobs");
RdmaJob job = jobQueue.take();
//DiSNILogger.getLogger().info("Found Job");
if (job.isDone()) {
//DiSNILogger.getLogger().info("Job finished and perform RDMA Write");
job.sendData();
}else {
//DiSNILogger.getLogger().info("Job not finished and check next Job");
jobQueue.add(job);
}
} catch (InterruptedException | IOException | ExecutionException e) {
e.printStackTrace();
}
}
}
}
|
5ed9f84b-7fe4-4c88-9fa1-6db9bec49e5f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-06-06T09:06:25", "repo_name": "Autoratch/cpp-grader", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1011, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "7c0f8b903a9f876d1ebbf7fcc255dec3c5603c65", "star_events_count": 8, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Autoratch/cpp-grader | 241 | FILENAME: README.md | 0.29584 | # CPP-Grader
CPP-Grader is a grader for C++ language written in C++.
## Installation
Clone this repository by running this command.
```bash
git clone git@github.com:Autoratch/cpp-grader.git
```
or Download the zip file instead.
## Usage
For version 1, 2, and 3, compile and run grader.cpp
For system version, compile and run system.cpp
For testcase generator, compile and run gentestcase.cpp
## Project Status
-Version 1: Run your code with input and check with output from testcase
-Version 2: Generate testcase to test with correct code and your code
-Version 3: Let you configure your file info in text file
-System version: Grade code with all testset in one run, put the system and grader file with your solution code in the testcase folder, run system and just wait
-Testcase generator: Generate testcase, put the gentestcase file in the same folder with testgen(random testcase input gen) and your solution code, run gentestcase and just wait
## Developer
Autoratch - Krittitee Ratchanan
|
9fb2b51c-ee67-4634-8f7d-672d1b286def | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-14 17:33:24", "repo_name": "Marcin795/Spring_Back-end", "sub_path": "/src/main/java/com/example/lozik/payload/response/QuestionResponse.java", "file_name": "QuestionResponse.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "80ef1da70dab8d07631df1523559a925922f38df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Marcin795/Spring_Back-end | 173 | FILENAME: QuestionResponse.java | 0.289372 | package com.example.lozik.payload.response;
import com.example.lozik.entity.Question;
import lombok.Data;
import java.util.List;
import java.util.stream.Collectors;
@Data
public class QuestionResponse {
private Long id;
private String text;
private List<AnswerResponse> answers;
public static QuestionResponse createResponse(Question question) {
QuestionResponse questionResponse = new QuestionResponse();
questionResponse.setId(question.getId());
questionResponse.setText(question.getText());
List<AnswerResponse> answers = question.getAnswers().stream().map(answer -> {
AnswerResponse answerResponse = new AnswerResponse();
answerResponse.setId(answer.getId());
answerResponse.setText(answer.getText());
answerResponse.setIsCorrect(answer.getIsCorrect());
return answerResponse;
}).collect(Collectors.toList());
questionResponse.setAnswers(answers);
return questionResponse;
}
}
|
90029c85-b73a-46b5-9840-7a05a7767557 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-01-03T11:03:15", "repo_name": "halliba/PRTGWindowsBackupSensor", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1122, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "98e0034c03c31f8a3062c2090c5e73d90d387744", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/halliba/PRTGWindowsBackupSensor | 296 | FILENAME: README.md | 0.240775 | # PRTG Sensor for Windows Backup
*based on [htrengove/PRTGwindowsbackup](https://github.com/htrengove/PRTGwindowsbackup/)*
## How to install
1. Download [WindowsBackup.ps1](WindowsBackup.ps1)
2. Save it to your PRTG custom sensor folder for XML-sensors
e.g. C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML
## How to use
1. In PRTG create a new sensor and choose Type "Program/Script (Advanced)"
2. Adjust the following settings:
* Program/Script: choose WindowsBackup.ps1 from drop-down menu
* Parameter: '%host' '%windowsdomain' '%windowsuser' '%windowspassword'
## Channels
The channels will be created automatically and have some default limits:
| Channel Name | Description | Values | Warning | Error |
| ------------ | ----------- | ------ | ------- | ----- |
| Backup Status | Represents the latest status code from Windows Backup | 0 for Success <br/> non-0 for Failure | | <=1 <br/> >=1
| Hours Since Last Backup | Hours past since last successfully created Backup | e.g. 12h | >=26 | >=50
| Number of Versions | No. of backups currently available | e.g. 25# | | <=0
|
3a59515b-7e9f-4c47-b431-8713baa41ecd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-10 05:37:02", "repo_name": "QiqeMtz/javabasic_course", "sub_path": "/vehiculos/TaxiCRUD.java", "file_name": "TaxiCRUD.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "0e28836549ab8508408239ba0b01780200e99621", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/QiqeMtz/javabasic_course | 223 | FILENAME: TaxiCRUD.java | 0.236516 | package vehiculos;
import basedatos.DataBase;
import java.sql.SQLException;
import java.sql.Statement;
public class TaxiCRUD {
private final int V_TYPE = 1;
public void add(Taxi taxi) throws SQLException {
String query = "";
Statement sentence = null;
DataBase db = new DataBase();
sentence = db.connect().createStatement();
query = "INSERT INTO \"vehiculo\" " +
"(\"matricula\", \"marca\", \"modelo\", \"anio\", \"id_tipo_vehiculo\") " +
"VALUES ('"+ taxi.getMatricula() +"', '"+ taxi.getMarca() +"', '"+ taxi.getModelo() +"', " +
"'"+ taxi.getAnio() +"', "+ V_TYPE +")";
if (sentence.executeUpdate(query) > 0){
System.out.printf("Record inserted!");
} else {
System.out.println("Can't insert the record");
System.out.println(query);
}
db.disconnect();
}
public void editar(Taxi taxi){}
public void eliminar(Taxi taxi){}
}
|
330df1a0-863b-43f4-9531-cd67bf4e4cb9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-06 06:48:06", "repo_name": "KevinShen620/kvlibdemo", "sub_path": "/kvlibdemo.kafka/src/main/java/kevsn/kafka/StreamTest.java", "file_name": "StreamTest.java", "file_ext": "java", "file_size_in_byte": 1204, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "3b235a7c898f9df36a86b00a3eedc33c867baea9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/KevinShen620/kvlibdemo | 354 | FILENAME: StreamTest.java | 0.287768 | /*
* 2016年7月11日
*/
package kevsn.kafka;
import java.util.HashMap;
import java.util.Map;
import org.apache.kafka.common.serialization.Serdes.StringSerde;
import org.apache.kafka.streams.KafkaStreams;
import org.apache.kafka.streams.StreamsConfig;
import org.apache.kafka.streams.kstream.KStreamBuilder;
import com.fasterxml.jackson.databind.ser.std.StringSerializer;
/**
* @author Kevin
*
*/
public class StreamTest {
public static void main(String[] args) {
Map<String, Object> props = new HashMap<>();
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "C2");
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG,
"192.168.1.25:9092,192.168.1.26:9002");
// props.put(StreamsConfig.ZOOKEEPER_CONNECT_CONFIG,
// "192.168.1.25:2181,192.168.1.26:2181/kafka");
props.put(StreamsConfig.KEY_SERDE_CLASS_CONFIG, StringSerde.class);
props.put(StreamsConfig.VALUE_SERDE_CLASS_CONFIG, StringSerde.class);
StreamsConfig config = new StreamsConfig(props);
KStreamBuilder builder = new KStreamBuilder();
builder.stream("ktest").foreach((k, v) -> {
System.out.println("K=" + k + ",V=" + v);
});
KafkaStreams streams = new KafkaStreams(builder, config);
streams.start();
}
}
|
6e81a770-a753-497e-892e-a1b0c296badc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-05 06:19:17", "repo_name": "cgy529387306/Schedule", "sub_path": "/app/src/main/java/com/android/mb/schedule/adapter/RingAdapter.java", "file_name": "RingAdapter.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "5ad21e2ec651206855786ba3890e4ec1f7a14581", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/cgy529387306/Schedule | 233 | FILENAME: RingAdapter.java | 0.271252 | package com.android.mb.schedule.adapter;
import com.android.mb.schedule.R;
import com.android.mb.schedule.entitys.RingBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import java.util.List;
/**
* Created by necer on 2017/6/7.
*/
public class RingAdapter extends BaseQuickAdapter<RingBean, BaseViewHolder> {
private int mIndex;
public void setCurrentIndex(int index) {
this.mIndex = index;
notifyDataSetChanged();
}
public RingAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, RingBean item) {
helper.setText(R.id.tv_ring_name,item.getName());
helper.setTextColor(R.id.tv_ring_name,helper.getAdapterPosition()==mIndex?mContext.getResources().getColor(R.color.base_blue):mContext.getResources().getColor(R.color.text_color));
helper.setVisible(R.id.iv_ring_choice,helper.getAdapterPosition()==mIndex);
}
public int getIndex() {
return mIndex;
}
}
|
76c04d48-14cc-42d9-8537-845451d9a022 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-01 13:13:18", "repo_name": "vtproduction/vuibongda", "sub_path": "/05_IMPLEMENTATION/05_02_NATIVE/VuiBongDa/app/src/main/java/ats/abongda/api/APIService.java", "file_name": "APIService.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "8f567d13b13dea55dd7f71d1591977aa71b767f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vtproduction/vuibongda | 203 | FILENAME: APIService.java | 0.247987 | package ats.abongda.api;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import ats.abongda.config.APILink;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by NienLe on 12-Jul-16.
*/
public class APIService {
static HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY);
static OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
static Gson gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
.create();
static Retrofit retrofit = new Retrofit.Builder()
.baseUrl(APILink.APIENDPOINT)
.client(client)
.addConverterFactory(GsonConverterFactory.create(gson))
.build();
public static APIEndpoint build(){
return retrofit.create(APIEndpoint.class);
}
}
|
00c91b71-ad9c-4c4d-af4b-9722e1fba766 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-10-16T13:39:10", "repo_name": "mikefieldmay/Notes", "sub_path": "/Webpack/Webpack - Webpack Dev Server.md", "file_name": "Webpack - Webpack Dev Server.md", "file_ext": "md", "file_size_in_byte": 1093, "line_count": 16, "lang": "en", "doc_type": "text", "blob_id": "ac2340e38cda9e8df5b3b11768cbc04bcb6c1fe6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mikefieldmay/Notes | 219 | FILENAME: Webpack - Webpack Dev Server.md | 0.26971 | ## Webpack Dev Server
When we run webpack, we spit out some files and then manually open the index.html and then loads the bundled files.
We are:
- manually running webpack
- files in same directory
- manually open index.HTML
Webpack dev server is a library that acts as an intermediary between our browser and our output. We start it once and it will automatically rebuild our project when the files change. It only updates the module that has changed. We'll also no longer be manually be loading the html. We'll access the dev server which will return the index.html.
The server is something that we don't have much access to. It's more about developing a client side application without doing any server side coding.
`npm install webpack-dev-server`
When webpack dev server sees a change it will automatically rebuild the project, but only the specific file.
Webpack-dev-server will not create the `dist` directory. It internally executes webpack, but stops any files being saved to teh directory. The files only exist in memory. It is only for development and not for production use.
|
118aa162-1bca-4a2c-87c8-c97da728c6da | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-11 16:26:55", "repo_name": "karl-free-legion/zcs-legion-cluster", "sub_path": "/src/test/java/com/legion/lang/MessageResourceTests.java", "file_name": "MessageResourceTests.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "72effc8d23e4821f6dde28736931d184546a6536", "star_events_count": 19, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/karl-free-legion/zcs-legion-cluster | 270 | FILENAME: MessageResourceTests.java | 0.264358 | package com.legion.lang;
import com.legion.common.local.Lang;
import com.legion.common.local.MessageResource;
import lombok.extern.slf4j.Slf4j;
import org.junit.Ignore;
import org.junit.Test;
/**
* 读取资源文件, 并转换消息内容
*
* @author lance
* 8/20/2019 18:12
*/
@Slf4j
public class MessageResourceTests {
@Test
public void run() {
String notFound = "-401";
// final String[] params = {"pay", "/apply/se"};
log.info("===>cn: {}", MessageResource.getInstance().getMessage(notFound, "pay", "/apply/se"));
log.info("===>en: {}", MessageResource.getInstance().getMessage(Lang.EN, notFound, "pay", "/apply/se"));
String notAuth = "-404";
log.info("===>zh: {}", MessageResource.getInstance().getMessage(notAuth, "pay", "/apply/se"));
log.info("===>en: {}", MessageResource.getInstance().getMessage(Lang.EN, notAuth, "pay", "/apply/se"));
log.info("===>zh: {}", MessageResource.getInstance().getMessage("2", "pay", "/apply/se"));
}
}
|
40f34242-ac88-413a-ba85-517d6fc649b3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-22 01:44:42", "repo_name": "tangkunprimeledger/helloworld", "sub_path": "/slave/src/main/java/com/higgs/trust/slave/dao/rocks/block/BlockTestRocksDao.java", "file_name": "BlockTestRocksDao.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "cb52d50a79b62a2bcb7a04fb174954c656f4e9bb", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/tangkunprimeledger/helloworld | 287 | FILENAME: BlockTestRocksDao.java | 0.276691 | package com.higgs.trust.slave.dao.rocks.block;
import com.higgs.trust.common.dao.RocksBaseDao;
import com.higgs.trust.common.utils.ThreadLocalUtils;
import com.higgs.trust.slave.common.enums.SlaveErrorEnum;
import com.higgs.trust.slave.common.exception.SlaveException;
import com.higgs.trust.slave.dao.po.block.BlockPO;
import lombok.extern.slf4j.Slf4j;
import org.rocksdb.Transaction;
import org.springframework.stereotype.Service;
/**
* @author tangfashuang
*/
@Service
@Slf4j
public class BlockTestRocksDao extends RocksBaseDao<BlockPO> {
@Override protected String getColumnFamilyName() {
return "blockTest";
}
public void save(BlockPO po) {
Transaction tx = ThreadLocalUtils.getRocksTx();
if (null == tx) {
log.error("[BlockTestRocksDao.save] transaction is null");
throw new SlaveException(SlaveErrorEnum.SLAVE_ROCKS_TRANSACTION_IS_NULL);
}
String height = String.valueOf(po.getHeight());
if (keyMayExist(height) && null != get(height)) {
throw new SlaveException(SlaveErrorEnum.SLAVE_ROCKS_KEY_ALREADY_EXIST);
}
po.setSignedTxs(null);
txPut(tx, height, po);
}
}
|
bc639342-0554-4c2a-b427-a7a3da8c9b5d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-27 20:28:43", "repo_name": "PI-and-TP-CEFETMG-AJPPV/RespostaCerta", "sub_path": "/RespostaCertaPersistencePostgre/src/br/cefetmg/util/db/TesteJPA.java", "file_name": "TesteJPA.java", "file_ext": "java", "file_size_in_byte": 1014, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "89f00e014929ae4d9a1c9d240a3991cf57b44748", "star_events_count": 0, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/PI-and-TP-CEFETMG-AJPPV/RespostaCerta | 215 | FILENAME: TesteJPA.java | 0.255344 | /*
* 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 br.cefetmg.util.db;
import br.cefetmg.respostaCerta.model.domain.User;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
/**
*
* @author Pós Graduação
*/
public class TesteJPA {
public static void main(String[] args){
EntityManagerFactory emf = Persistence.createEntityManagerFactory("RespostaCerta");
EntityManager em = emf.createEntityManager();
User us = new User(new Long(0), "joão", "joa", "coco", 'A', null);
em.getTransaction().begin();
em.persist(us);
em.getTransaction().commit();
System.out.println("Persistiu");
User u = em.find(User.class, us.getIdUsuario());
System.out.println(u.getNomeUsuario());
em.close();
emf.close();
}
}
|
25019b31-5f0d-4043-a6b9-5a9e3f0180ad | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-20 12:18:48", "repo_name": "ruchikabobade/bank-account-manager", "sub_path": "/src/main/java/com/hackerearth/esri/bank/controller/BankAccountManagerController.java", "file_name": "BankAccountManagerController.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "305da7618b87b124747c441fb4a2ae963bbd6fef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ruchikabobade/bank-account-manager | 189 | FILENAME: BankAccountManagerController.java | 0.261331 | package com.hackerearth.esri.bank.controller;
import com.hackerearth.esri.bank.model.BankTransactionDetailsResponse;
import com.hackerearth.esri.bank.service.BankAccountManagerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
public class BankAccountManagerController {
private Logger logger = LoggerFactory.getLogger(BankAccountManagerController.class);
@Autowired
private BankAccountManagerService service;
@RequestMapping(value = "/getTransactions", method = RequestMethod.GET)
public BankTransactionDetailsResponse getBankTransactionDetails(
@RequestParam(required = false, value = "start", defaultValue = "0") Integer start ,
@RequestParam(required = false, value = "size", defaultValue = "0") Integer page
) {
return service.getBankTransactionDetails(start, page);
}
}
|
231516ae-353e-4547-838d-43a96924a55a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-27 04:24:18", "repo_name": "KathrinBeaver/TouristHelper-2", "sub_path": "/Touristhelper/app/src/main/java/com/hse/touristhelper/InternetConnectionReceiver.java", "file_name": "InternetConnectionReceiver.java", "file_ext": "java", "file_size_in_byte": 1122, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "d186e4e9308837c7f350faf00dd8b3acf06ca34e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/KathrinBeaver/TouristHelper-2 | 213 | FILENAME: InternetConnectionReceiver.java | 0.255344 | package com.hse.touristhelper;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.widget.Toast;
/**
* Created by Alex on 07.05.2016.
*/
public class InternetConnectionReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
boolean isConnected = activeNetInfo != null && activeNetInfo.isConnected();
boolean isDisconnected = activeNetInfo == null || (activeNetInfo != null && activeNetInfo.isConnectedOrConnecting());
if (isConnected) {
Toast.makeText(context, "Online mode enabled", Toast.LENGTH_LONG).show();
} else if (isDisconnected) {
Toast.makeText(context, "Offline mode enabled", Toast.LENGTH_LONG).show();
}
}
}
|
cee2f4ad-f5c4-4e89-9a80-afd25b6d8fd0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-06 19:04:45", "repo_name": "Eduardo2108/FmessageApp", "sub_path": "/src/extraclase/gui/ventanaChatController.java", "file_name": "ventanaChatController.java", "file_ext": "java", "file_size_in_byte": 1202, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "fffebdb9ad4f3721c5f6860cc30e0cdbdcfa9240", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Eduardo2108/FmessageApp | 245 | FILENAME: ventanaChatController.java | 0.273574 | package extraclase.gui;
import extraclase.conectivity.Client;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;
import java.awt.event.ActionEvent;
import java.io.IOException;
public class ventanaChatController {
@FXML private TextField entradaTexto;
@FXML private TextField d1;
@FXML private ListView lst;
@FXML private Label puertoLabel;
private int puerto;
public void sendMessagePressed(javafx.scene.input.MouseEvent mouseEvent) throws IOException {
Client.sendMessage(entradaTexto.getText(), puerto, puerto, "Remitente");
lst.getItems().add("Tu a el puerto " +": " + puerto + entradaTexto.getText());
}
public void addMensaje(String msj, int puerto){
lst.getItems().add("Puerto " + puerto + ": " + msj);
}
public void puertoOKpressed() {
try{
System.out.println(d1.getText());
puerto = Integer.parseInt( d1.getText());
puertoLabel.setText(d1.getText());
}
catch (Exception e){
System.out.println(e.getCause());
}
}
}
|
c1a3ad2d-c08b-4e33-a7d4-e671d1d7ec4f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-29 11:51:11", "repo_name": "mg120/7afalaty", "sub_path": "/app/src/main/java/com/tasmim/a7afalaty/adapter/SectionsAdapter.java", "file_name": "SectionsAdapter.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "28ba9e56cfe91e396fba27ebd339114bab0418e3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mg120/7afalaty | 225 | FILENAME: SectionsAdapter.java | 0.249447 | package com.tasmim.a7afalaty.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.tasmim.a7afalaty.R;
import com.tasmim.a7afalaty.model.SectionModel;
import java.util.List;
/**
* Created by Ma7MouD on 10/12/2018.
*/
public class SectionsAdapter extends RecyclerView.Adapter<SectionsAdapter.ViewHolder> {
Context context ;
// List<SectionModel.Data> list ;
@Override
public SectionsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.show_item_layout,parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(SectionsAdapter.ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
public class ViewHolder extends RecyclerView.ViewHolder {
public ViewHolder(View itemView) {
super(itemView);
}
}
}
|
11f71ea2-bc09-4635-bf4d-1de3b7d957c4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-18 06:22:09", "repo_name": "wangdk1/study", "sub_path": "/study-netty/src/test/java/com/example/SQLite3Test.java", "file_name": "SQLite3Test.java", "file_ext": "java", "file_size_in_byte": 1168, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "fe23f91284145dbf194623d21780eaba193200c1", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wangdk1/study | 242 | FILENAME: SQLite3Test.java | 0.262842 | package com.example;
import org.junit.Test;
import java.net.URL;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
/**
* @author: wangdk
* @create: 2020-06-17 13:31
* @description:
**/
public class SQLite3Test {
@Test
public void test() {
try {
URL systemResource = ClassLoader.getSystemResource("config/testDB.db");
Class.forName("org.sqlite.JDBC");
String db = systemResource.getFile();
Connection conn = DriverManager.getConnection("jdbc:sqlite:" + db);
Statement state = conn.createStatement();
ResultSet rs = state.executeQuery("select * from user;"); //查询数据
while (rs.next()) { //将查询到的数据打印出来
System.out.print("name = " + rs.getString("name") + " "); //列属性一
System.out.println("age = " + rs.getString("password")); //列属性二
}
rs.close();
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
217cff9b-6290-4a4b-8456-4483b5d80aaa | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-24 13:06:59", "repo_name": "l376571926/ZOLClientAndroid", "sub_path": "/app/src/main/java/cn/com/zol/app/zolclientandroid/module5/ui/ThirdPartyActivity.java", "file_name": "ThirdPartyActivity.java", "file_ext": "java", "file_size_in_byte": 1014, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "0384e5269ae27243e2abdebd272b4b35c5b0316d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/l376571926/ZOLClientAndroid | 199 | FILENAME: ThirdPartyActivity.java | 0.188324 | package cn.com.zol.app.zolclientandroid.module5.ui;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import cn.com.zol.app.zolclientandroid.R;
import cn.com.zol.app.zolclientandroid.other.utils.ToolBarUtils;
public class ThirdPartyActivity extends Activity implements View.OnClickListener {
private TextView thirdPartyBack;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ToolBarUtils.setContentView(this,R.layout.activity_third_party);
initView();
intiEvent();
}
private void initView() {
thirdPartyBack = (TextView) findViewById(R.id.Third_party_back);
}
private void intiEvent() {
thirdPartyBack.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.Third_party_back:
finish();
break;
}
}
}
|
94df985e-8593-4e79-91a1-b8eb431ebca5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-06-30 14:41:20", "repo_name": "cboppert/CCNY", "sub_path": "/src/I4722/project/NetworkElements/Packet.java", "file_name": "Packet.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "d996ff76d174a9909ab586568c6dd2eebb1308c7", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/cboppert/CCNY | 240 | FILENAME: Packet.java | 0.239349 | package I4722.project.NetworkElements;
/**
* Created by codyboppert on 6/19/14.
*/
public class Packet {
private byte[] packet;
public Packet(byte[] header, byte[] body) {
packet = new byte[header.length + body.length];
setPacket(header, body);
}
public Packet(byte[] packet) {
this.packet = packet;
}
public byte[] getPacket() { return packet; }
public void setPacket(byte[] packet) {
int index = 0;
while (index < this.packet.length && index < packet.length) {
this.packet[index] = packet[index];
index++;
}
}
public void setPacket(byte[] header, byte[] body) {
int index = 0;
while(index < header.length && index < packet.length) {
packet[index] = header[index];
index++;
}
int indexTwo = 0;
while (indexTwo < body.length && index < packet.length) {
packet[index] = body[indexTwo];
index++;
indexTwo++;
}
}
}
|
bc7cd682-0a4a-4197-a412-0462b6c89ede | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-07-22 12:07:01", "repo_name": "kszit/cdrecord", "sub_path": "/CDRecord/src/com/kszit/CDReport/listener/AppStartListener.java", "file_name": "AppStartListener.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "925ec47ebfed9e588826edb7a1b0148917a8f6aa", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kszit/cdrecord | 207 | FILENAME: AppStartListener.java | 0.258326 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.kszit.CDReport.listener;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import ognl.OgnlRuntime;
import com.kszit.CDReport.cor.service.excel.ExcelService;
import com.kszit.CDReport.util.Constants;
/**
*
* @author Administrator
*/
public class AppStartListener implements ServletContextListener{
private ServletContext context = null;
@Override
public void contextInitialized(ServletContextEvent sce) {
context = sce.getServletContext();
Constants.APP_ROOT_PATH = context.getRealPath("/");
//生成excel文件相关的文件夹
ExcelService.initFolde();
OgnlRuntime.setSecurityManager(null);
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
this.context = null;
}
}
|
27e7d5ee-8f9a-4921-b346-908bdd1aad44 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-11 11:01:14", "repo_name": "bbs0153/java", "sub_path": "/day0418/src/exam04/FiledelTest.java", "file_name": "FiledelTest.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "78a7d413a14d27c4c3f136ea81c0aa7b4df851b4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UHC"} | https://github.com/bbs0153/java | 250 | FILENAME: FiledelTest.java | 0.233706 | package exam04;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class FiledelTest extends JFrame {
JFrame f;
public FiledelTest() {
f = this;
setLayout(new FlowLayout());
JButton btn = new JButton("Hello2.java 지우기");
btn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
File file = new File("C:\\자바스터디\\day0320\\Hello2.java");
boolean re = file.delete();
if (re == true) {
JOptionPane.showMessageDialog(f, "파일을 삭제하였습니다.", "확인", JOptionPane.INFORMATION_MESSAGE);
} else {
JOptionPane.showMessageDialog(f, "파일을 삭제 실패했습니다.", "확인", JOptionPane.INFORMATION_MESSAGE);
}
}
});
setSize(400, 300);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new FiledelTest();
}
}
|
dfbbe7e4-fccb-45b7-8a0b-cc1799b177b1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-09 04:48:15", "repo_name": "ethankhall/version-manager-clients", "sub_path": "/java-client/src/main/java/tech/crom/client/java/common/ConradClientBuilder.java", "file_name": "ConradClientBuilder.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "86837cfddb8512866743165dc4e92987ad58c52d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ethankhall/version-manager-clients | 249 | FILENAME: ConradClientBuilder.java | 0.261331 | package tech.crom.client.java.common;
import tech.crom.client.java.RepoDetails;
import tech.crom.client.java.common.internal.DefaultGitCromClient;
import tech.crom.client.java.scm.git.GitManager;
import tech.crom.client.java.scm.git.GitManagerBuilder;
import tech.crom.client.java.http.HttpConradClient;
import tech.crom.client.java.http.HttpConradClientBuilder;
import java.io.File;
import java.io.IOException;
public class ConradClientBuilder {
private RepoDetails repoDetails;
public ConradClientBuilder(RepoDetails repoDetails) {
this.repoDetails = repoDetails;
}
public ConradClientBuilder(String projectName, String repoName, String authToken) {
this(new RepoDetails(projectName, repoName, authToken));
}
public CromClient build(File projectDir) {
try {
GitManager gitManager = new GitManagerBuilder(projectDir).build();
HttpConradClient httpClient = new HttpConradClientBuilder(repoDetails).build();
return new DefaultGitCromClient(httpClient, gitManager);
} catch (IOException ioe) {
throw new RuntimeException("Only the git client is supported at this time.");
}
}
}
|
a2037370-926e-4286-9666-d73084986717 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-09 11:59:53", "repo_name": "lucasmunioz0/cursos", "sub_path": "/1-Java/2 - Java Advanced Programming/Java Advanced Programming/src/main/java/ar/com/eduit/course/class01/CronometerR.java", "file_name": "CronometerR.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "a266556678b2eeaa00f986208cfdbce1ea2d3c53", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lucasmunioz0/cursos | 228 | FILENAME: CronometerR.java | 0.290176 | /*
* 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 ar.com.eduit.course.class01;
import java.text.DecimalFormat;
import javax.swing.JTextField;
public class CronometerR implements Runnable{
private JTextField txt;
private int cont = 0;
private boolean correr = false;
public CronometerR(JTextField txt) {
this.txt = txt;
}
@Override
public void run() {
while(true){
if(correr){
cont++;
txt.setText(new DecimalFormat("000000").format(cont));
}
try{ Thread.sleep(1000); }catch(InterruptedException e){}
}
}
public void start(){
correr = true;
}
public void stop(){
correr = false;
cont = 0;
txt.setText("000000");
}
public void pause(){
correr = false;
}
} |
ab77f8ae-b622-4a3f-ab00-eecba5d3d2ed | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-07 03:11:48", "repo_name": "Chrn12/template", "sub_path": "/yoga-common/common-webutils/src/main/java/com/woniu/yoga/utils/OssUtils.java", "file_name": "OssUtils.java", "file_ext": "java", "file_size_in_byte": 1296, "line_count": 32, "lang": "zh", "doc_type": "code", "blob_id": "525cd65349802b61a372e9e8fc210c47812572e2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Chrn12/template | 322 | FILENAME: OssUtils.java | 0.286169 | package com.woniu.yoga.utils;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.PutObjectRequest;
import java.io.File;
import java.util.UUID;
public class OssUtils {
//上传 返回url
public static String upLoad(File file){
UUID uuid = UUID.randomUUID();
// Endpoint以杭州为例,其它Region请按实际情况填写。
String endpoint = "oss-cn-chengdu.aliyuncs.com";
// 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建RAM账号。
String accessKeyId = "LTAI4GHChG9gRjpN8mekxdLZ";
String accessKeySecret = "z9jh9QmvRSyZzCfaNpspMHD23vpOrn";
// 创建OSSClient实例。
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
String bucketName = "woniutest";
String key = uuid+".jpg";
// 创建PutObjectRequest对象。
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, key, file);
// 上传文件。
ossClient.putObject(putObjectRequest);
String url = bucketName + "." + endpoint + "/"+key;
return url;
}
}
|
a4c3896d-69f1-485c-a970-37ce69866bc6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-04-08 17:07:05", "repo_name": "gstraymond/hearthstone-card-search", "sub_path": "/src/fr/gstraymond/android/CardCommonActivy.java", "file_name": "CardCommonActivy.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "ad0d3423482bd21f1a23a3cfcb465f45c380aaca", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gstraymond/hearthstone-card-search | 214 | FILENAME: CardCommonActivy.java | 0.264358 | package fr.gstraymond.android;
import static fr.gstraymond.constants.Consts.CARD;
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.MenuItem;
import fr.gstraymond.search.model.response.Card;
public abstract class CardCommonActivy extends Activity {
private Card card;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
card = getIntent().getParcelableExtra(CARD);
setTitle(card.getTitle());
}
protected Bundle getBundle() {
Bundle bundle = new Bundle();
bundle.putParcelable(CARD, card);
return bundle;
}
protected void replaceFragment(Fragment fragment, int id) {
getFragmentManager().beginTransaction().replace(id, fragment).commit();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
protected Card getCard() {
return card;
}
}
|
eaa6a2aa-2c40-442c-aa91-8428430d4c3d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-04-23 17:36:24", "repo_name": "charliemblack/spring-data-rest-gemfire", "sub_path": "/src/main/java/org/pivotal/gemfire/rest/Sensor.java", "file_name": "Sensor.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "afc8da7d9aa5aaee0987269386896213c9518f1e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/charliemblack/spring-data-rest-gemfire | 238 | FILENAME: Sensor.java | 0.226784 | package org.pivotal.gemfire.rest;
import org.springframework.data.annotation.Id;
import org.springframework.data.gemfire.mapping.Region;
/**
* Created by cblack on 11/1/13.
*/
@Region
public class Sensor{
@Id
private long id;
private double value;
private long timestamp;
private String name;
public Sensor(long id, double value, long timestamp, String name) {
this.id = id;
this.value = value;
this.timestamp = timestamp;
this.name = name;
}
public Sensor(long id) {
this.id = id;
}
public Sensor() {
}
public long getId() {
return id;
}
public double getValue() {
return value;
}
public void setValue(double value) {
this.value = value;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
|
3b1f0109-af3f-44a1-8bff-65f39bafddf0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-09 10:00:25", "repo_name": "newSue/wkdubbo", "sub_path": "/product-dubbo-v3/was-product-server1/src/main/java/com/wangku/v3/was/product/utils/ObjectToMap.java", "file_name": "ObjectToMap.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "c6c03e662d14de4b94fcb55267c8ba8072a65911", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/newSue/wkdubbo | 269 | FILENAME: ObjectToMap.java | 0.288569 | package com.wangku.v3.was.product.utils;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
/**
* @Copyright 北京网库互联信息技术有限公司
* @Description:实体转换成map
* @author guoYang
* @date 2013-11-28 上午11:50:08
* @version V1.0
*/
public class ObjectToMap {
public static Map ConvertObjToMap(Object obj){
Map<String,Object> reMap = new HashMap<String,Object>();
if (obj == null){
return null;
}
Field[] fields = obj.getClass().getDeclaredFields();
try {
for(int i=0;i<fields.length;i++){
try {
Field f = obj.getClass().getDeclaredField(fields[i].getName());
f.setAccessible(true);
Object o = f.get(obj);
reMap.put(fields[i].getName(), o);
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
} catch (SecurityException e) {
e.printStackTrace();
}
return reMap;
}
}
|
6c131ffe-5093-48a1-9190-ceaea2465ef9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-03-23T12:20:06", "repo_name": "mohonish/awesome-ios", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1050, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "ea4c9ca06b813b79cae2981786fe0a4371c40d03", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mohonish/awesome-ios | 279 | FILENAME: README.md | 0.206894 | # AWESOME IOS
A curated list of awesome __iOS__ libraries, frameworks, components and much more.
### Contents
- [Style Guides](#style-guides)
- [Parsing](#parsing)
- [Testing](#testing)
- [Analytics and Reporting](#analytics-and-reporting)
## Style Guides
* [Swift Style Guide](https://github.com/raywenderlich/swift-style-guide) by Raywenderlich.com
* [iOS Best Practices](https://github.com/futurice/ios-good-practices) by Futurice
* [Design Patterns](https://github.com/ochococo/Design-Patterns-In-Swift) implemented in Swift.
## Parsing
* [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON) - Simple JSON parsing in Swift.
* [Argo](https://github.com/thoughtbot/Argo) - Functional JSON Parsing for Swift.
## Testing
* [UI Auto Monkey](https://github.com/jonathanpenn/ui-auto-monkey) - Stress testing script for iOS Applications that runs in UI Automation and Instruments.
## Analytics and Reporting
* [Fabric](https://get.fabric.io/) - By Twitter, was previously Crashlytics.
* [HockeyApp](http://hockeyapp.net/) - By Microsoft.
|
c3e3c52b-3a40-49ec-8761-99e47cff0d90 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-26 07:52:01", "repo_name": "Torward/CloudStorage", "sub_path": "/ServerIO/src/main/java/ServerIO.java", "file_name": "ServerIO.java", "file_ext": "java", "file_size_in_byte": 1043, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "430ba4196da0c3aa4b465ddc50e13548d051d430", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Torward/CloudStorage | 172 | FILENAME: ServerIO.java | 0.275909 | import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ServerIO {
private static final ExecutorService threadPool = Executors.newFixedThreadPool(5);
public static void main(String[] args) throws IOException {
ServerSocket serverSocket = new ServerSocket(8700);
while (true) {
Socket socket = serverSocket.accept();
threadPool.execute(()->{
try(BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()))
) {
String str = reader.readLine();
System.out.println(str);
writer.write("Hi!");
} catch (IOException e) {
System.err.println("Smth went wrong!");
}
});
}
}
}
|
08d4b689-944e-4727-9d7d-529773b323ad | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-16 19:42:06", "repo_name": "JohnSzepesi/adios", "sub_path": "/src/main/java/hu/janos/adios/ejb/LoginManager.java", "file_name": "LoginManager.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "2f78a763d8c11e03bc35d6e620c92638ff1addba", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JohnSzepesi/adios | 188 | FILENAME: LoginManager.java | 0.233706 | package hu.janos.adios.ejb;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import hu.janos.adios.model.User;
@Stateless
public class LoginManager implements ILoginManager{
@PersistenceContext(unitName = "hu.janos_adios_war_1.0-SNAPSHOTPU")
private EntityManager em;
@Override
public boolean authenticate(String userName, String password) {
User user = null;
try {
TypedQuery<User> query = em.createNamedQuery("User.findByUsername",User.class);
query.setParameter("username", userName);
List<User> resultList = query.getResultList();
if(query.getResultList().isEmpty())
throw new Exception();
} catch (Exception e) {
return false;
}
return true;
}
} |
90de73f7-bb00-4518-b6dd-5e8b4cfe39ec | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-12-19 01:08:11", "repo_name": "bountin/oop", "sub_path": "/Aufgabe6/Androide.java", "file_name": "Androide.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "ffec3e5ee8d9be284926a986074ff4b57f22ac1a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bountin/oop | 248 | FILENAME: Androide.java | 0.290176 | import java.lang.String;
abstract class Androide
{
protected String serial;
protected Skin skin;
protected Software software;
protected SensorenAktorenKit kit;
public Androide(String serial, Skin skin, Software software, SensorenAktorenKit kit)
{
this.serial = serial;
this.software = software;
this.skin = skin;
this.kit = kit;
encodeSerial();
}
public boolean check()
{
return this.checkSoftware() &&
this.kit.isUnderLimit(software.getSicherheitsstufe());
}
abstract protected boolean checkSoftware();
// {
// return software.check(this);
// }
public String getSerial() {
return serial;
}
private void encodeSerial(){
if(software.getSerial()==null)
software.setSerial(serial);
if(skin.getSerial()==null)
skin.setSerial(serial);
if(kit.getSerial()==null)
kit.setSerial(serial);
}
@Override
public String toString() {
return "{" + "serial=" + serial + ", skin=" + skin + ", software=" + software + ", kit=" + kit + '}';
}
}
|
a30a7cd8-0516-40ef-80b1-592cb1d10dca | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-05 08:57:56", "repo_name": "WncudChou/wncud-work", "sub_path": "/src/main/java/com/wncud/zookeeper/ZKTest.java", "file_name": "ZKTest.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "47f5f2ac653a539c5c0c02e409e3bbf7d62f3eb6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/WncudChou/wncud-work | 279 | FILENAME: ZKTest.java | 0.256832 | package com.wncud.zookeeper;
import com.wncud.zookeeper.core.ZKUtil;
import com.wncud.zookeeper.core.ZooKeeperWatcher;
import org.apache.zookeeper.KeeperException;
import org.junit.Test;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.List;
/**
* Created by yajunz on 2014/12/15.
*/
public class ZKTest {
@Test
public void testList(){
String quorumServers = "192.168.69.9";
int sessionTimeout = 9000;
int maxRetries = 300000;
int retryIntervalMillis = 5;
try {
ZooKeeperWatcher zooKeeperWatcher = new ZooKeeperWatcher(quorumServers, sessionTimeout, maxRetries, retryIntervalMillis);
List<String> nodes = ZKUtil.listChildrenNoWatch(zooKeeperWatcher, "/squirrel/filelog");
for(String node : nodes){
System.out.println(node);
}
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (KeeperException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
|
3e385936-c56c-460f-8671-423c03f8a5fe | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-15 10:32:55", "repo_name": "P79N6A/nrosCrm", "sub_path": "/nros-crm/start/src/test/java/com/ztesoft/zsmart/nros/crm/core/server/service/MarketingServiceTest.java", "file_name": "MarketingServiceTest.java", "file_ext": "java", "file_size_in_byte": 978, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "3e0588a497c70a82bf03600833c78fd787559857", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/P79N6A/nrosCrm | 200 | FILENAME: MarketingServiceTest.java | 0.229535 | package com.ztesoft.zsmart.nros.crm.core.server.service;
import java.util.List;
import com.ztesoft.zsmart.nros.crm.core.MockitoTest;
import com.ztesoft.zsmart.nros.crm.core.client.api.MarketingService;
import com.ztesoft.zsmart.nros.crm.core.client.model.dto.MarketingDefineDTO;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.fastjson.JSON;
import com.ztesoft.zsmart.nros.base.model.ResponseMsg;
public class MarketingServiceTest extends MockitoTest {
@Autowired
private MarketingService marketingService;
@Test
public void listActiveCampaignDefines() {
String merchantCode="1";
String marketingType="2";
List<MarketingDefineDTO> marketingDefineDTOS=marketingService.listActiveCampaignDefines(merchantCode,
marketingType);
ResponseMsg msg = ResponseMsg.build(marketingDefineDTOS);
System.out.println(JSON.toJSONString(msg));
}
} |
9abf597a-b58a-4fdd-97b6-ad60072e2b26 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-10 13:11:16", "repo_name": "minibright/SmartSportHealth", "sub_path": "/lib_coremodel/src/main/java/com/bright/administrator/lib_coremodel/d_arouter/RouterURLS.java", "file_name": "RouterURLS.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "16e4c9668860b6f5536b89639d3ccb72d7dc8577", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/minibright/SmartSportHealth | 270 | FILENAME: RouterURLS.java | 0.267408 | package com.bright.administrator.lib_coremodel.d_arouter;
/**
* @Created by TOME .
* @时间 2018/4/26 10:20
* @描述 ${路由地址}
*/
// 注意事项!!! /模块/页面名称 或 /模块/子模块../页面名称 至少两级 例子 /商城/商品详情 /shop/shopDetails
//url 第一次相同会报错??
public interface RouterURLS {
/**首页Fragment*/
String MainFragment = "/fragmentmain/list";
/**运动Fragment*/
String SportFragment = "/fragmentsport/list";
/**我的Fragment*/
String MineFragment = "/fragmentmine/list";
/**设置Fragment*/
String SettingFragment = "/fragmentsetting/list";
//PressureTestActivity
String PressureTestActivity = "/fragmentmain/PressureTestActivity";
//PressureTestActivity
String WeightTestActivity = "/fragmentmain/WeightTestActivity";
//ShowDataActivity
String ShowDataActivity = "/fragmentmain/ShowDataActivity";
//ShowDataActivity
String DataChartActivity = "/fragmentmain/DataChartActivity";
//ShowDataActivity
String DynamicMapTraceActivity = "/fragmentsport/DynamicMapTraceActivity";
}
|
47b28b29-be8e-473b-b74e-2a6f00cd2c62 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-03-12T18:27:53", "repo_name": "cusengan/Earth-Day-Application", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 969, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "b5d6e4bc1bdbf86a94b476bccb3eff110f02a171", "star_events_count": 0, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/cusengan/Earth-Day-Application | 250 | FILENAME: README.md | 0.249447 | # GROWFLO
GROWFLO is an Android application developed during EARTHACK DFW 2017. Using GROWFLO, users can input a city and be given the weather of the city and information on how to take care of their plants in that location. As the users use the app more and more, they are rewarded by having a virtual plant grow.
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development.
### Prerequisites
```
Android Studio
Android Emulator/Android Device
```
### Installing
```
Clone this repository into a directory
Build the project using Android Studio
```
You should now be able to use the app on your emulator or be able to download it to your Android device.
## Built With
* Android Studio (Java)
* Gradle
## Authors
* **William Truong** - [cusengan](https://github.com/cusengan)
* **Kha VO** - [kingko555](https://github.com/kingko555)
* **Nhan Vu** - [NhanTVu](https://github.com/NhanTVu)
|
f50e01e4-269a-4d0e-bbe8-04f1f625dea0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-10 12:22:31", "repo_name": "JiPyeong/bbs2", "sub_path": "/bbs2/src/main/java/com/filter/CharacterEncodingFilter.java", "file_name": "CharacterEncodingFilter.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "21481c5e4cfe8f7c9b7200881eb5649be85f9cf9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JiPyeong/bbs2 | 221 | FILENAME: CharacterEncodingFilter.java | 0.279828 | package com.filter;
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.HttpServletRequest;
public class CharacterEncodingFilter implements Filter{
private String charset;
@Override
public void init(FilterConfig filterConfig) throws ServletException {
charset = filterConfig.getInitParameter("charset");
if(charset==null || charset.length()==0)
charset = "UTF-8";
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
if(request instanceof HttpServletRequest) {
HttpServletRequest req = (HttpServletRequest)request;
if(req.getMethod().equalsIgnoreCase("POST")) {
req.setCharacterEncoding(charset);
}
}
// 다음 필터 또는 필터의 마지막이면 resource 실행
chain.doFilter(request, response);
}
@Override
public void destroy() {
}
}
|
d20e363a-4a2e-42da-912b-2b6593eb8d37 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-28 08:36:46", "repo_name": "mashanshui/Driver", "sub_path": "/app/src/main/java/com/shenhesoft/driver/fragment/ChatFragment.java", "file_name": "ChatFragment.java", "file_ext": "java", "file_size_in_byte": 1124, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "da09e05897972f35aae0d7d0969baea872c62b9a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mashanshui/Driver | 207 | FILENAME: ChatFragment.java | 0.182426 | package com.shenhesoft.driver.fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.shenhesoft.driver.R;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* A simple {@link Fragment} subclass.
*/
public class ChatFragment extends Fragment {
@BindView(R.id.title)
TextView titleTv;
public ChatFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_chat, container, false);
ButterKnife.bind(this, view);
initView(view);
initData();
initListener();
return view;
}
private void initView(View view) {
titleTv.setText("聊天");
}
private void initData() {
}
private void initListener() {
}
}
|
be3f644c-74fc-443f-a827-09e4ac47bb49 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-18 05:09:29", "repo_name": "srimanivannan/spring-log4j2", "sub_path": "/src/main/java/com/raminus/springlog4j2/controller/Log4jController.java", "file_name": "Log4jController.java", "file_ext": "java", "file_size_in_byte": 1014, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "93a0d613041151bf25894c76c84f628fc741944f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/srimanivannan/spring-log4j2 | 219 | FILENAME: Log4jController.java | 0.242206 | package com.raminus.springlog4j2.controller;
import java.util.UUID;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.slf4j.MDC;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.raminus.springlog4j2.model.LogData;
@RestController
@RequestMapping("/private/1001")
public class Log4jController {
private static Logger logger = LogManager.getLogger(Log4jController.class);
@GetMapping("/logs")
public ResponseEntity<LogData> getLogData() {
LogData body = new LogData("info level", "this is log data description");
body.loggSomething();
logger.debug("Log4j2 message: {}", () -> body);
MDC.put("correlationId", UUID.randomUUID().toString());
logger.error("Mani context test:" + MDC.get("correlationId"));
return ResponseEntity.ok(body);
}
}
|
dc72c16f-13e9-49b2-b684-a8ebeb97aba0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-13 10:06:00", "repo_name": "huangxueqin/rookieweibo", "sub_path": "/app/src/main/java/com/huangxueqin/rookieweibo/common/list/LoadingListener.java", "file_name": "LoadingListener.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "85ef9607277737acc0dfc0d08218bf1755958e73", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/huangxueqin/rookieweibo | 210 | FILENAME: LoadingListener.java | 0.274351 | package com.huangxueqin.rookieweibo.common.list;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
/**
* Created by huangxueqin on 2017/2/24.
*/
public abstract class LoadingListener extends RecyclerView.OnScrollListener {
@Override
public final void onScrolled(RecyclerView recyclerView, int dx, int dy) {
if (dy > 0 && allowLoading()) {
RecyclerView.LayoutManager lm = recyclerView.getLayoutManager();
final int visibleItemCount = lm.getChildCount();
final int totalItemCount = lm.getItemCount();
if (lm instanceof LinearLayoutManager) {
LinearLayoutManager llm = (LinearLayoutManager) lm;
final int startPosition = llm.findFirstVisibleItemPosition();
if (startPosition + visibleItemCount >= totalItemCount) {
performLoadingAction();
}
}
}
}
public boolean allowLoading() {
return true;
}
public abstract void performLoadingAction();
}
|
894d7b11-d6f5-406c-8993-eb3fca96b3b6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-02 07:55:07", "repo_name": "mwitikenn/redis-java-connection-pool", "sub_path": "/src/main/java/com/indepthkenya/connectionpooling/App.java", "file_name": "App.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "92d96be80765e306f11bffc6023d61b215d16941", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mwitikenn/redis-java-connection-pool | 209 | FILENAME: App.java | 0.255344 | package com.indepthkenya.connectionpooling;
import com.indepthkenya.connectionpooling.exception.JedisConnectionNotFound;
import com.indepthkenya.connectionpooling.resources.CacheFactory;
import redis.clients.jedis.Jedis;
/**
* Hello world!
*
*/
public class App
{
String packageName = this.getClass().getPackageName();
static CacheFactory cacheFactory = new CacheFactory();
public App(){
cacheFactory.createRedisPool(packageName);
}
public static void main(String[] args )
{
try {
App app = new App();
} catch (Exception ex) {
}
}
//Get first connection -default
public static Jedis getRedisConnection() throws JedisConnectionNotFound {
return cacheFactory.getRedisConnection();
}
//Get - a connecion from a specific redis installation if there are many
public static Jedis getRedisConnection(String redisInstance) throws JedisConnectionNotFound {
return cacheFactory.getRedisConnection("2");
}
}
|
bbbcdb6d-2b6f-4211-bf56-c0f179d716b9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-01-23 02:15:51", "repo_name": "VeenaHosur/the-fascinator", "sub_path": "/the-fascinator/tags/the-fascinator-0.5.0/plugins/transformer/ffmpeg/src/test/java/au/edu/usq/fascinator/transformer/ffmpeg/FfmpegMockImpl.java", "file_name": "FfmpegMockImpl.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "96cd788fcde7b46b20bfdbe553d63da79706f83c", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/VeenaHosur/the-fascinator | 260 | FILENAME: FfmpegMockImpl.java | 0.262842 | package au.edu.usq.fascinator.transformer.ffmpeg;
import java.io.File;
import java.io.IOException;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FfmpegMockImpl implements Ffmpeg {
private Logger log = LoggerFactory.getLogger(FfmpegMockImpl.class);
@Override
public String executeAndWait(List<String> params) throws IOException {
log.debug("executeAndWait: {}", params);
int len = params.size();
String resource = "/default.txt";
if (len == 2) {
resource = "/identify.txt";
} else if (len == 20) {
File srcFile = new File(params.get(1));
File destFile = new File(params.get(len - 1));
FileUtils.copyFile(srcFile, destFile);
resource = "/transform.txt";
}
return IOUtils.toString(getClass().getResourceAsStream(resource));
}
@Override
public FfmpegInfo getInfo(File inputFile) throws IOException {
return new FfmpegInfo(this, inputFile);
}
@Override
public boolean isAvailable() {
return true;
}
}
|
3442bf88-15e1-4f60-97fe-e1b98ce56322 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-23 15:03:34", "repo_name": "kpramesh2212/osgi_demo", "sub_path": "/module2/src/com/osgi/tutorial/HeartBeatActivator.java", "file_name": "HeartBeatActivator.java", "file_ext": "java", "file_size_in_byte": 978, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "41a72e8388c6e14c1035d2b14f494bf35397e6cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kpramesh2212/osgi_demo | 208 | FILENAME: HeartBeatActivator.java | 0.236516 | package com.osgi.tutorial;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
/**
* Created by IEI78363 on 20/06/2017.
*/
public class HeartBeatActivator implements BundleActivator {
Thread t;
@Override
public void start(BundleContext context) throws Exception {
System.out.println("Starting the Heart Beat thread");
t = new Thread(new HeartBeat());
t.start();
}
@Override
public void stop(BundleContext context) throws Exception {
System.out.println("Stopping the Heart beat thread");
t.interrupt();
}
}
class HeartBeat implements Runnable {
@Override
public void run() {
try {
while (!Thread.currentThread().isInterrupted()) {
System.out.println("Heart beat signal");
Thread.sleep(5000);
}
} catch (InterruptedException e) {
System.out.println("I am dead");
}
}
}
|
2f8fdca9-6062-4548-a708-ccfaf4e3b130 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-12 05:23:56", "repo_name": "tysonsorensen/userAccount", "sub_path": "/src/main/java/net/tysonsorensen/userAccount/data/StartUp.java", "file_name": "StartUp.java", "file_ext": "java", "file_size_in_byte": 1122, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "8c18857f37bec7bf74e7787da19fbb6562060412", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tysonsorensen/userAccount | 210 | FILENAME: StartUp.java | 0.246533 | package net.tysonsorensen.userAccount.data;
import lombok.RequiredArgsConstructor;
import net.tysonsorensen.userAccount.data.entities.RoleEntity;
import net.tysonsorensen.userAccount.data.repositories.RoleRepository;
import net.tysonsorensen.userAccount.data.repositories.UserRepository;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import java.util.Optional;
@Component
@RequiredArgsConstructor
public class StartUp implements ApplicationListener<ApplicationReadyEvent> {
private final RoleRepository roleRepository;
@Override
public void onApplicationEvent(final ApplicationReadyEvent event) {
createRole("admin");
createRole("user");
}
private void createRole(final String role) {
Optional<RoleEntity> roleEntity = roleRepository.findByRoleName(role);
if(!roleEntity.isPresent()) {
RoleEntity newRole = new RoleEntity();
newRole.setRoleName(role);
roleRepository.save(newRole);
}
}
}
|
cfd2267b-41e7-4277-a5b0-bd138c4b6680 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-25 00:34:29", "repo_name": "Marcos-trindade/projeto-imobiliaria", "sub_path": "/src/java/imobiliaria/dao/HistoricoDAO.java", "file_name": "HistoricoDAO.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "ce433a5aaab1036aff9cd99b664acefebb31bbe5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Marcos-trindade/projeto-imobiliaria | 228 | FILENAME: HistoricoDAO.java | 0.26588 |
package imobiliaria.dao;
import com.mysql.jdbc.PreparedStatement;
import imobiliaria.beans.Historico;
import java.sql.Connection;
import java.sql.Date;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import imobiliariaConnection.ConnectionFactory;
import javax.swing.JOptionPane;
public class HistoricoDAO {
public void create(Historico h){
Connection con;
con = ConnectionFactory.getConnection();
PreparedStatement stmt = null;
try{
stmt = (PreparedStatement) con.prepareStatement("INSERT INTO corretor (acao,imovel_id,corretor_id) VALUES(?,?,?)");
stmt.setString(1, h.getAcao());
stmt.setInt(2, h.getImovel_id());
stmt.setInt(3, h.getCorretor_id());
stmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Salvo com sucesso!");
}catch (SQLException ex ){
JOptionPane.showMessageDialog(null, "Erro ao salvar!"+ex);
}finally{
ConnectionFactory.closeConnection(con, stmt);
}
}
}
|
237a0e9b-6449-4238-86ac-c85aa932f8a0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-27 04:26:38", "repo_name": "sarkershantonu/jdbc-examples", "sub_path": "/InterBase/src/main/java/org/automation/dal/FireBirdSqlGateway.java", "file_name": "FireBirdSqlGateway.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "d9e57c47375f37ccf55e7568fd983295c84ea9bf", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sarkershantonu/jdbc-examples | 193 | FILENAME: FireBirdSqlGateway.java | 0.23231 | package org.automation.dal;
import org.firebirdsql.jdbc.FBDriver;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
* Created by shantonu on 7/10/16.
*/
public class FireBirdSqlGateway {
public static String dbPath="pathToGDBFile";
public static String url= "jdbc:interbase://<HOST>/"+dbPath;
private static final String user = "user";
private static final String pass = "pass";
private static final String className = "org.firebirdsql.jdbc.FBDriver";
public static synchronized Connection getConnection() throws SQLException {
DriverManager.registerDriver(new FBDriver());
return DriverManager.getConnection(url, user, pass);
}
public static synchronized Connection getLegacyConnection() throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException {
Class.forName(className);
return DriverManager.getConnection(url,user,pass);
}
}
|
e417bac1-daf7-41e2-b835-716eb11a9325 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-18 06:01:11", "repo_name": "Gusabary/YIBUK", "sub_path": "/back-end/src/main/java/com/example/demo/daoImpl/UserDaoImpl.java", "file_name": "UserDaoImpl.java", "file_ext": "java", "file_size_in_byte": 1121, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "9bf90705736ec1041e5b3f60e02121660fb2df0f", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Gusabary/YIBUK | 194 | FILENAME: UserDaoImpl.java | 0.23793 | package com.example.demo.daoImpl;
import com.example.demo.dao.UserDao;
import com.example.demo.entity.User;
import com.example.demo.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class UserDaoImpl implements UserDao {
@Autowired
UserRepository userRepository;
@Override
public User findByUsernameAndPassword(String username, String password) {
return userRepository.findByUsernameAndPassword(username, password);
}
@Override
public User findByUsername(String username) {
return userRepository.findByUsername(username);
}
@Override
public void deleteByUsername(String username) {
userRepository.deleteByUsername(username);
}
@Override
public void save(User user) {
userRepository.save(user);
}
@Override
public Iterable<User> findAll() {
return userRepository.findAll();
}
@Override
public User findById(Integer userId) {
return userRepository.findById(userId).get();
}
}
|
106b6eda-8070-4c17-9d3c-8e115c76f8a9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-15 20:20:55", "repo_name": "VaJIn/fantastic-snake", "sub_path": "/server/src/main/java/fr/vajin/snakerpg/gameroom/impl/handlers/PlayerReadyPacketHandlerImpl.java", "file_name": "PlayerReadyPacketHandlerImpl.java", "file_ext": "java", "file_size_in_byte": 1099, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "caf4ae11f68ee4a526340246132d8a035937dd11", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/VaJIn/fantastic-snake | 235 | FILENAME: PlayerReadyPacketHandlerImpl.java | 0.27513 | package fr.vajin.snakerpg.gameroom.impl.handlers;
import fr.vajin.snakerpg.gameroom.PlayerHandler;
import fr.vajin.snakerpg.gameroom.PlayerPacketCreator;
import fr.vajin.snakerpg.gameroom.PlayerPacketHandler;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.net.DatagramPacket;
import java.nio.ByteBuffer;
public class PlayerReadyPacketHandlerImpl implements PlayerPacketHandler{
private static int BUFFER_START_POS = 24;
private PlayerHandler playerHandler;
@Override
public boolean handleDatagramPacket(DatagramPacket datagramPacket) {
ByteBuffer buffer = ByteBuffer.wrap(datagramPacket.getData());
buffer.position(BUFFER_START_POS);
int type = buffer.getInt();
if(type==PlayerPacketCreator.PLAYER_READY){
playerHandler.getController().setPlayerReady(playerHandler.getUserId());
return true;
}
return false;
}
@Override
public void setPlayerHandler(PlayerHandler playerHandler) {
this.playerHandler = playerHandler;
}
}
|
bd1ac154-99cb-455e-878e-bb7e5163168c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-23 07:45:51", "repo_name": "MarkGao11520/spring-cloud-weather", "sub_path": "/gwf-weather-basic/src/main/java/com/gwf/gwf/weather/basic/config/ApplicationContextHelper.java", "file_name": "ApplicationContextHelper.java", "file_ext": "java", "file_size_in_byte": 1091, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "01742a1f79da2462e9cfce447b422d2cfe3583ee", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MarkGao11520/spring-cloud-weather | 211 | FILENAME: ApplicationContextHelper.java | 0.218669 | package com.gwf.gwf.weather.basic.config;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* @author gaowenfeng
* @package com.gwf.gwf.weather.basic.config
* @describe 应用上下文
* @date 2018/2/20
*/
@Component("applicationContextHelper")
public class ApplicationContextHelper implements ApplicationContextAware {
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext context) throws BeansException {
applicationContext = context;
}
public static <T> T popBean(Class<T> clazz) {
if (applicationContext == null) {
return null;
}
return applicationContext.getBean(clazz);
}
public static <T> T popBean(String name, Class<T> clazz) {
if (applicationContext == null) {
return null;
}
return applicationContext.getBean(name, clazz);
}
}
|
7335f192-293b-4b95-9269-c96aea204b42 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-10 11:25:01", "repo_name": "Thoronir42/i-spy-with-my-eye--teh-internetzz", "sub_path": "/src/cz/zcu/sdutends/kiwi/ted/serdes/TalkSerDes.java", "file_name": "TalkSerDes.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "05a6b59c88a750800196c94db34bcd0ac5eca549", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Thoronir42/i-spy-with-my-eye--teh-internetzz | 263 | FILENAME: TalkSerDes.java | 0.286968 | package cz.zcu.sdutends.kiwi.ted.serdes;
import cz.zcu.sdutends.kiwi.ted.model.Talk;
import cz.zcu.sdutends.kiwi.utils.SerDes;
import cz.zcu.sdutends.kiwi.utils.SerDesException;
public class TalkSerDes extends SerDes<Talk> {
private static final String SEP = "\n\0\n";
@Override
public String serialize(Talk talk) {
String[] parts = {
talk.getUrl(),
talk.getTitle(),
talk.getTalker(),
talk.getDateRecorded(),
talk.getIntroduction(),
talk.getTranscript(),
};
return String.join(SEP, parts);
}
@Override
public Talk deserialize(String text) throws SerDesException {
String[] parts = text.split(SEP);
try {
return new Talk()
.setUrl(parts[0])
.setTitle(parts[1])
.setTalker(parts[2])
.setDateRecorded(parts[3])
.setIntroduction(parts[4])
.setTranscript(parts[5]);
} catch (IndexOutOfBoundsException ex) {
throw new SerDesException("Failed talk deserialization", ex);
}
}
}
|
be0e30e7-4042-4ba1-9c0e-22ff586cd330 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-05-05T13:09:45", "repo_name": "NTI-Gymnasieingenjor/Stoqup", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1103, "line_count": 41, "lang": "en", "doc_type": "text", "blob_id": "541851a5ff4b74d7b5a1de9c681561c85ec9406c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NTI-Gymnasieingenjor/Stoqup | 232 | FILENAME: README.md | 0.224055 | # Stoqup
## Definition of Done
The code must be commented and documented when needed
All code must pass the respective tests
All members in the group must understand the code and approve the push
The branch has to be merged after pull request has been approved
## Coding Standard
- File name structure: this_is_how (underscore)
- Variable name structure: camelCase
- Comments: English, first letter capitalized. Comment symbol (#) at the beginning of the line, but the comment itself indented the same way as surrounding code.
## Git Conventions
- Feature Branches.
- Everyone on site should submit a review for each pull request before merging with the main branch.
- **Feature branch naming conventions:**
- Dashes in place of spaces.
- No capital letters.
- Short and concise branch names.
- **Example:** my-feature-branch.
## Development Environment
- Visual Studio Code
## Programming Languages
- HTML
- CSS
## Frameworks
- Bootstrap 4
### Created using https://github.com/startbootstrap/startbootstrap-stylish-portfolio template
|
320e03af-318b-4714-a0bc-a18f09a4c082 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-01 00:07:28", "repo_name": "gilhwankim/Tablet-Ordering-Systems", "sub_path": "/Team_Project/src/pos/menu/Menu.java", "file_name": "Menu.java", "file_ext": "java", "file_size_in_byte": 1122, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "61cc467bf586e9eecc4fdc851002ac156489384a", "star_events_count": 1, "fork_events_count": 4, "src_encoding": "UTF-8"} | https://github.com/gilhwankim/Tablet-Ordering-Systems | 241 | FILENAME: Menu.java | 0.256832 | package pos.menu;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
public class Menu {
private SimpleIntegerProperty menuNum;
private SimpleStringProperty category;
private SimpleStringProperty name;
private SimpleStringProperty price;
public Menu() {
}
public Menu(int menuNum, String category, String name, String price) {
super();
this.menuNum = new SimpleIntegerProperty(menuNum);
this.category = new SimpleStringProperty(category);
this.name = new SimpleStringProperty(name);
this.price = new SimpleStringProperty(price);
}
public int getMenuNum() {
return menuNum.get();
}
public void setMenuNum(int menuNum) {
this.menuNum.set(menuNum);
}
public String getCategory() {
return category.get();
}
public void setCategory(String category) {
this.category.set(category);
}
public String getName() {
return name.get();
}
public void setName(String name) {
this.name.set(name);
}
public String getPrice() {
return price.get();
}
public void setPrice(String price) {
this.price.set(price);
}
}
|
8883ba00-c835-4b1e-8e95-00a352918d0b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-25 17:40:36", "repo_name": "Emmptee/dounat", "sub_path": "/Pandora/app/src/main/java/com/donut/app/http/message/UserPasswdChangeRequest.java", "file_name": "UserPasswdChangeRequest.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "dbb08683d41536bed95fb77cfbbf929751053b46", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Emmptee/dounat | 233 | FILENAME: UserPasswdChangeRequest.java | 0.218669 | package com.donut.app.http.message;
public class UserPasswdChangeRequest
{
private String passwd;
private String newPasswd;
private String confirmPasswd;
/**
* @return passwd
*/
public String getPasswd()
{
return passwd;
}
/**
* @param passwd
* the passwd to set
*/
public void setPasswd(String passwd)
{
this.passwd = passwd;
}
/**
* @return content
*/
public String getNewPasswd()
{
return newPasswd;
}
public void setNewPasswd(String newPasswd)
{
this.newPasswd = newPasswd;
}
/**
* @return confirmPasswd
*/
public String getConfirmPasswd()
{
return confirmPasswd;
}
/**
* @param confirmPasswd
* the confirmPasswd to set
*/
public void setConfirmPasswd(String confirmPasswd)
{
this.confirmPasswd = confirmPasswd;
}
}
|
2f458831-63a2-4ca2-8b36-ebc7e4866120 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-25 06:49:19", "repo_name": "Exorth98/heroyn-java-libraries", "sub_path": "/Plugins/AH_PlayerShop/src/fr/exorth/commands/ShopZoneCommand.java", "file_name": "ShopZoneCommand.java", "file_ext": "java", "file_size_in_byte": 1039, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "cdc2b2f51ed852d142fad3ba1ab3ee564f3e39ea", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "WINDOWS-1250"} | https://github.com/Exorth98/heroyn-java-libraries | 255 | FILENAME: ShopZoneCommand.java | 0.261331 | package fr.exorth.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.exorth.util.Zone;
public class ShopZoneCommand implements CommandExecutor{
@Override
public boolean onCommand(CommandSender s, Command cmd, String msg, String[] args) {
if(cmd.getName().equalsIgnoreCase("setshopzone")) {
if(s instanceof Player) {
Player p = (Player) s;
if(args.length==1) {
if(args[0].equalsIgnoreCase("pos1")) {
Zone.setPos1(p.getLocation());
s.sendMessage("§aPosition 1 mise a jour");
}
else if(args[0].equalsIgnoreCase("pos1")) {
Zone.setPos2(p.getLocation());
s.sendMessage("§aPosition 2 mise a jour");
}
else {
s.sendMessage("§c/setshopzone <pos1/pos2>");
}
}else {
s.sendMessage("§c/setshopzone <pos1/pos2>");
}
}
}
return false;
}
}
|
a6163346-e08e-40a8-b4d9-032bef352fa3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-16 22:48:46", "repo_name": "mehrdadinho/review-product", "sub_path": "/src/main/java/com/mehrdad/reviewproduct/model/Comment.java", "file_name": "Comment.java", "file_ext": "java", "file_size_in_byte": 1013, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "d4019e9722f51e2e0956e28b159a2e57d21c4a32", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mehrdadinho/review-product | 225 | FILENAME: Comment.java | 0.252384 | package com.mehrdad.reviewproduct.model;
import com.mehrdad.reviewproduct.model.enums.CommentStatus;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
/**
* Created by m.peykari on 2/15/2021.
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "comment")
public class Comment {
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Long id;
@Column(name = "title",length = 100, nullable = false)
private String title;
@Column(name = "text",length = 500, nullable = false)
private String text;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id")
private User user;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "product_id")
private Product product;
@Column(name = "status")
@Enumerated(EnumType.ORDINAL)
private CommentStatus commentStatus;
}
|
08749339-7e69-4b21-9c60-20dda705cee2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-06-29T16:09:28", "repo_name": "LBenotsch/HashAlert", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1070, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "d2b0647a34266798b5f9a02d7515ec20e70f3f66", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LBenotsch/HashAlert | 255 | FILENAME: README.md | 0.206894 | # HashAlert
An email alert application for EthOS distro.
There really wasn't an effective way to recieve alerts if a miner went down via EthOS. So I wrote this app to solve my issue, as well as for others. Feel free to use, re-distribute, or make changes.
This java application is intended to be ran within a Linux kernel or Windows cmd.
#### Linux and Windows Instructions
Navigate to the directory of the .jar and use:
```
java -jar HashAlert.jar
```
If running on Windows, you may use a .bat for containment:
```
@echo off
java -jar HashAlert.jar
pause
```
#### Requirements
Java 7 or higher
#### Allowing 3rd Party App Access in Google Mail
By default, gmail will turn off access to "less secure apps".
Go here while logged in and select "turn on": https://www.google.com/settings/security/lesssecureapps
This will allow email alerts to continue without error within HashAlert. It's recommended to preform an email test by forcing an error. An easy way to do this is to change the "errorMinimum" value to something high (ex. 999), then running the application.
|
82005f07-4a72-4afc-a847-bbaa1d3778b9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-18 01:23:18", "repo_name": "jameszkw/demo", "sub_path": "/src/main/java/com/zkw/socket/socket_longconnection/ServerHandel.java", "file_name": "ServerHandel.java", "file_ext": "java", "file_size_in_byte": 1227, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "3894787d8674fdc7cdf58e96f7871d9b4a3c6bf0", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jameszkw/demo | 242 | FILENAME: ServerHandel.java | 0.271252 | package com.zkw.socket.socket_longconnection;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.net.Socket;
/**
* 服务器端线程类
*
* @author James
* @create 2017-12-29 下午 4:43
**/
public class ServerHandel implements Runnable {
public static int count = 0;
Socket socket = null;
public ServerHandel(Socket socket) {
count++;
this.socket = socket;
System.out.println("用户" + count + "接入");
}
public void run() {
BufferedInputStream bis = null;
try {
bis = new BufferedInputStream(socket.getInputStream());
while (true) {
byte [] head = new byte[4];
bis.read(head);
byte [] data = new byte[Tool.byteArrayToInt(head)];
bis.read(data);
System.out.println(new String(data).trim());
}
} catch (IOException e) {
e.printStackTrace();
}finally {
try {
bis.close();
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
|
40cd6534-14a4-4cdb-928d-5813d0db12f9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-10-04T10:27:56", "repo_name": "tim3in/WAiT", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1037, "line_count": 13, "lang": "en", "doc_type": "text", "blob_id": "687f412ac823649fcb1bc455bbda3cd2f5e737b7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tim3in/WAiT | 205 | FILENAME: README.md | 0.253861 | # WAiT
WAiT is a project that track the movement of wild animal at the application area, identify the animal class and report it on the webserver.
The full documentation for this project can be found at https://www.hackster.io/timothy_malche/wait-wild-animal-tracker-edbb50.
This repository contains following two applications:
## Wild Animal Tracker Firmware
This is the firmware source code that you need to compile and upload on sensor node using Arduino IDE. Before uploading this firmware please develop model using EdgeImpulse as the steps describe in this documentation and then download model as Arduino zip library, import the library and then compile this sketch.
## Wild Animal Tracker Web Application
To run this application, first install XAMPP server, create the database and the table and then copy paste this application folder to htdocs folder of web server. Before running update settings in DBController.php file and upload.php file as described in this documentation. Then execute the application in web browser.
|
19a5749c-dbe8-4811-acab-b57b3b80e03e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-14 04:13:05", "repo_name": "maoHuanZhe/fgrapp-admin", "sub_path": "/src/main/java/com/fgrapp/blog/domain/BlogDo.java", "file_name": "BlogDo.java", "file_ext": "java", "file_size_in_byte": 1194, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "3f8e5d25528190d67bbb7c71e91f04ee39e4d421", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/maoHuanZhe/fgrapp-admin | 261 | FILENAME: BlogDo.java | 0.208179 | package com.fgrapp.blog.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fgrapp.base.domain.BaseDo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.util.List;
/**
* BlogDo
*
* @author fan guang rui
* @date 2021年07月31日 9:56
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@TableName("func_blog")
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value="博客表",description="博客func_blog")
public class BlogDo extends BaseDo {
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "分类")
private Integer type;
@ApiModelProperty(value = "封面图片")
private String imgUrl;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "摘要")
private String summary;
@ApiModelProperty(value = "博客分类列表")
@TableField(exist = false)
private List<Long> classIds;
@ApiModelProperty(value = "要新建的博客分类列表")
@TableField(exist = false)
private List<String> addClassNames;
}
|
34df055e-273f-4113-a30e-b376ab5c1b56 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-07 04:56:41", "repo_name": "jwhitehorn/arcadia", "sub_path": "/src/us/whitehorn/jason/arcadia/compiler/ArcadiaCompiler.java", "file_name": "ArcadiaCompiler.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "057b77b637aa6c1eaf0536b2e205452b1e4478f1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jwhitehorn/arcadia | 219 | FILENAME: ArcadiaCompiler.java | 0.286968 | package us.whitehorn.jason.arcadia.compiler;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.ParseTreeWalker;
import us.whitehorn.jason.arcadia.core.ArcadiaProgram;
public class ArcadiaCompiler {
public static ArcadiaProgram compile(String src) throws InstantiationException, IllegalAccessException {
CharStream input = CharStreams.fromString(src);
return compile(input);
}
public static ArcadiaProgram compile(CharStream src) throws InstantiationException, IllegalAccessException {
ArcadiaLexer lexer = new ArcadiaLexer(src);
CommonTokenStream tokens = new CommonTokenStream(lexer);
ArcadiaParser parser = new ArcadiaParser(tokens);
ParseTree tree = parser.prog();
ParseTreeWalker walker = new ParseTreeWalker();
ArcadiaListenerImpl listener = new ArcadiaListenerImpl();
walker.walk(listener, tree);
return listener.finish();
}
}
|
d3ce21d1-fae7-46dd-865c-7ca895f1b909 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-05 04:09:52", "repo_name": "LINAULIA/nctapps", "sub_path": "/app/src/main/java/com/example/jadi/Profile.java", "file_name": "Profile.java", "file_ext": "java", "file_size_in_byte": 1104, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "76e66bfa5e1a9e540ef481f5cee9dc59f52692d4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LINAULIA/nctapps | 196 | FILENAME: Profile.java | 0.193147 | package com.example.jadi;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.example.jadi.R;
public class Profile extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
Button btnPindahHalaman = findViewById(R.id.btnPindahHalaman);
btnPindahHalaman.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(Profile.this, MainActivity.class));
}
});
Button btnPindahProfil = findViewById(R.id.btnPindahProfil);
btnPindahProfil.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(Profile.this, Profilku.class));
}
});
}
} |
7cd0bd5b-6ad0-46d1-9491-2cac64a9e671 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-03-25T13:44:25", "repo_name": "xavmer9/FixMyCH", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1119, "line_count": 42, "lang": "en", "doc_type": "text", "blob_id": "f53171c393de173cd675a52469d6c05c788cbc61", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xavmer9/FixMyCH | 251 | FILENAME: README.md | 0.199308 | # COMEM+ Citizen Engagement Ionic Starter Project
This project was created following these [setup instructions](https://github.com/MediaComem/comem-citizen-engagement-ionic-setup).
## About this app:
This app allows citizens to report and view gelolocated issues.
Users can create an account, login like on most mobile apps.
## Map function
They can then consult the map and see each issue reported. Opening the map will geolocate them automatically and show the current area. Clicking on a marker will lead to the issue page.

## List and filter functions
Users can also consult the list of issues, and filter the list. By clicking on an issue, they can get all the details about it.


## View and comments functions
Users can also view and posts comments on issues.


## Report function
Each logged in user can simply report an issue (it will geolocate him automatically) with various details (description, image, category...etc)

## Enjoy and spread!
|
5e2ce8a6-4ad9-49a0-9184-07e029fd12c8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-19 03:21:08", "repo_name": "Fuy7/BookShop", "sub_path": "/src/com/fuy/book/filter/ManagerFilter.java", "file_name": "ManagerFilter.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "3d9da80316c3be53e692e6f89a205f6c59f9fb95", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Fuy7/BookShop | 225 | FILENAME: ManagerFilter.java | 0.239349 | package com.fuy.book.filter;
import com.fuy.book.entity.User;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class ManagerFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//进行拦截后的处理
HttpServletRequest req = (HttpServletRequest) servletRequest; //进行强转
HttpServletResponse resp = (HttpServletResponse) servletResponse; //进行强转
//判断是否登录
User user = (User) req.getSession().getAttribute("user");
if(user==null){
//没登录就跳转到登录页面
req.getRequestDispatcher("/pages/user/login.jsp").forward(req,resp);
}
else {
// 让程序继续往下访问用户的目标资源
filterChain.doFilter(req,resp);
}
}
@Override
public void destroy() {
}
}
|
2a7b6979-2319-4893-8941-6e9202c5e631 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-02 11:46:45", "repo_name": "kioco/flink-recommendsystem-demo", "sub_path": "/flink-recommendsystem-hbase/src/main/java/com/datafly/recommend/task/ProductPortraitTask.java", "file_name": "ProductPortraitTask.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "12241a924a8bf3bfd72ccaa79a0edc7447c5217a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kioco/flink-recommendsystem-demo | 192 | FILENAME: ProductPortraitTask.java | 0.225417 | package com.datafly.recommend.task;
import com.datafly.recommend.util.Property;
import com.datafly.recommend.map.ProductPortraitMapFunction;
import org.apache.flink.api.common.serialization.SimpleStringSchema;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer;
import java.util.Properties;
/**
* 产品画像 -> Hbase
*
* @author XINZE
*/
public class ProductPortraitTask {
public static void main(String[] args) throws Exception {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
Properties properties = Property.getKafkaProperties("ProductPortrait");
DataStreamSource<String> dataStream = env.addSource(new FlinkKafkaConsumer<>("con", new SimpleStringSchema(), properties));
dataStream.map(new ProductPortraitMapFunction());
env.execute("Product Portrait");
}
}
|
d8b85306-9023-43f1-9187-1daf57ca671c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-19 18:21:40", "repo_name": "Ayatj/ToDoList", "sub_path": "/src/main/java/toDoList/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1201, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "381b2ee1bffc2758c4e76d7f91c55e034794edff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Ayatj/ToDoList | 219 | FILENAME: Main.java | 0.273574 | package toDoList;
import javax.sound.sampled.Line;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
public class Main {
public static void main(String[] args) throws IOException {
Map<String, List<Task>> project2Task = new HashMap<>();
Scanner in = new Scanner(System.in);
ToDo.printIntro();
ToDo.getTasks(project2Task);
int option = in.nextInt();
while (true) {
switch (option) {
case 1:
ToDo.displayTasks(project2Task);
break;
case 2:
ToDo.addTask(project2Task);
break;
case 3:
ToDo.editTask(project2Task);
break;
case 4:
ToDo.saveTasks(project2Task);
break;
default:
System.out.println("The option chosen is not valid");
}
ToDo.printIntro();
option = in.nextInt();
}
}
}
|
84044a1e-a040-4107-8562-6992e5d517e9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-02 08:01:09", "repo_name": "oferby/vca-web", "sub_path": "/src/main/java/com/huawei/vca/repository/entity/ConversationEntity.java", "file_name": "ConversationEntity.java", "file_ext": "java", "file_size_in_byte": 1083, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "2f7cd562bb83fb48b198fe7797f59a5b78312202", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/oferby/vca-web | 217 | FILENAME: ConversationEntity.java | 0.252384 | package com.huawei.vca.repository.entity;
import com.huawei.vca.repository.ConversationTurn;
import com.huawei.vca.repository.Turn;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.ArrayList;
import java.util.List;
@Document(collection = "conversations")
public class ConversationEntity {
@Id
private String userId;
private List<ConversationTurn>conversationTurns;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public List<ConversationTurn> getConversationTurns() {
return conversationTurns;
}
public void setConversationTurns(List<ConversationTurn> conversationTurns) {
this.conversationTurns = conversationTurns;
}
public void addConversationTurn(Turn turn, String text){
if (conversationTurns == null) {
conversationTurns = new ArrayList<>();
}
conversationTurns.add(new ConversationTurn(turn, text));
}
}
|
b2588c1b-64c4-4a8c-b462-0ff4b42fa181 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-28 06:32:28", "repo_name": "lingxiaoming/winlife", "sub_path": "/app/src/main/java/com/hyd/winlife/tools/AppVersionUtils.java", "file_name": "AppVersionUtils.java", "file_ext": "java", "file_size_in_byte": 1014, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "245290af411d07716b31086ced2150c24d7008ee", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lingxiaoming/winlife | 204 | FILENAME: AppVersionUtils.java | 0.221351 | package com.hyd.winlife.tools;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import com.hyd.winlife.LifeApplication;
/**
* 获取app版本号
* Created by lingxiaoming on 2017/9/6 0006.
*/
public class AppVersionUtils {
public static int getVersionCode() {
try {
PackageManager pm = LifeApplication.getInstance().getPackageManager();
PackageInfo pi = pm.getPackageInfo(LifeApplication.getInstance().getPackageName(), 0);
return pi.versionCode;
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
public static String getVersionName() {
try {
PackageManager pm = LifeApplication.getInstance().getPackageManager();
PackageInfo pi = pm.getPackageInfo(LifeApplication.getInstance().getPackageName(), 0);
return pi.versionName;
} catch (Exception e) {
e.printStackTrace();
}
return "";
}
}
|
72b426d8-4c2c-480b-8a8a-61daf9944946 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-30 14:24:01", "repo_name": "xiaoaxe/xiao-spring-in-action", "sub_path": "/mess-up/src/main/java/me/xiao/springlearn/ch05/web/UserController.java", "file_name": "UserController.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "d097cfb87f5f91d25669969680f0e3058b5c545a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xiaoaxe/xiao-spring-in-action | 216 | FILENAME: UserController.java | 0.247987 | package me.xiao.springlearn.ch05.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* 用户的控制器
*
* @author pacman
* @version 1.0
* @date: 2017/8/30 17:37
*/
@Controller
public class UserController {
private final UserRepository userRepository;
@Autowired
public UserController(UserRepository userRepository) {
this.userRepository = userRepository;
}
@RequestMapping(value = "/users",method = RequestMethod.GET)
public String getUsers(Model model) {
model.addAttribute(userRepository.findUsers());
return "users";
}
@RequestMapping(value = "/user/{name}", method = RequestMethod.GET)
public String getUserByName(@PathVariable("name") String name, Model model) {
model.addAttribute(userRepository.findUserByName(name));
return "user";
}
}
|
389963d9-b5a8-46a4-925e-8af6397116a0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-05 03:31:58", "repo_name": "namimono/zhny", "sub_path": "/src/main/java/org/rcisoft/business/equipment/device/controller/DeviceController.java", "file_name": "DeviceController.java", "file_ext": "java", "file_size_in_byte": 1271, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "d3279b371e3569688ed581adb201bc5aabfca3c5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/namimono/zhny | 247 | FILENAME: DeviceController.java | 0.212069 | package org.rcisoft.business.equipment.device.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.rcisoft.base.result.Result;
import org.rcisoft.business.equipment.device.service.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* Created by JiChao on 2019/3/26.
* 设备维护--设备管理
*/
@Api(tags = "设备维护--设备管理")
@RestController
@RequestMapping("device")
public class DeviceController {
@Autowired
DeviceService deviceServiceImpl;
@ApiOperation(value="资产统计", notes="查询设备列表")
@GetMapping("/queryDevices/{projectId}/{deviceTypeId}")
public Result queryDevices(@PathVariable String projectId, @PathVariable String deviceTypeId) {
return Result.result(deviceServiceImpl.queryDevices(projectId, deviceTypeId));
}
@ApiOperation(value="巡检记录", notes="查询巡检列表")
@PostMapping("/queryInspectionForPage")
public Result queryInspectionForPage(@RequestParam String deviceId, @RequestParam Integer year, @RequestParam Integer month) {
return Result.result(deviceServiceImpl.queryInspectionForPage(deviceId, year, month));
}
}
|
92a8b8bf-f2b4-4c60-b15a-e47beba692c5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-15 02:30:16", "repo_name": "donahue-ldz/X", "sub_path": "/X-web/src/main/java/com/X/web/module/student/screen/Index.java", "file_name": "Index.java", "file_ext": "java", "file_size_in_byte": 1121, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "fc7a2f66db4b5f6e4df3e8a0e43cbd2172cd9c60", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/donahue-ldz/X | 257 | FILENAME: Index.java | 0.273574 | package com.X.web.module.student.screen;
import com.X.biz.aggregation.CourseAgg;
import com.X.biz.exception.XException;
import com.X.web.common.BaseScreen;
import com.X.web.common.WebResult;
import com.alibaba.citrus.turbine.Context;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author donahue ldz2012yn@gmail.com
* @create 2016-05-16 3:13 PM
**/
public class Index extends BaseScreen {
@Autowired
private CourseAgg courseAgg;
@Override
protected WebResult handleRequest(Context context) throws Exception {
setTopNHotCourses(context);
setTopNRecentlyCourses(context);
return new WebResult();
}
@Override
protected List<String> getPermissionList() throws XException {
return null;
}
private void setTopNHotCourses(Context context) throws Exception {
context.put("topNHotCourses", courseAgg.queryTopNHotCourses());
}
private void setTopNRecentlyCourses(Context context) throws Exception {
context.put("topNRecentlyCourses", courseAgg.queryTopNRecentlyCourses());
}
}
|
fc2fb7be-7f55-4294-84a3-9f4ab87474d3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-28 05:20:38", "repo_name": "AbbyLiming/ExtraceIm", "sub_path": "/ExtraceIm/src/main/java/extrace/user/address/AddressPresenterImpl.java", "file_name": "AddressPresenterImpl.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "3a9c03986bd5d55256f446033f07c2d152961be3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AbbyLiming/ExtraceIm | 220 | FILENAME: AddressPresenterImpl.java | 0.287768 | package extrace.user.address;
import android.app.Activity;
import extrace.main.MyApplication;
/**
* Created by chao on 2016/4/17.
*/
public class AddressPresenterImpl implements AddressPresenter{
Activity activity;
MyApplication application;
AddressModel addressModel;
AddressView addressView;
public AddressPresenterImpl(Activity activity,AddressView addressView){
this.activity = activity;
this.addressView = addressView;
application = (MyApplication) activity.getApplication();
addressModel = new AddressModelImpl(activity,this);
}
@Override
public void getAddress() {
addressModel.startGetAddress();
}
@Override
public void onGetAddressSuccess(String name , String tel, String address, Integer rank) {
boolean isDefault = false;
if(rank==0){
isDefault = true;
}
addressView.addAddress(name ,tel,address,isDefault);
}
@Override
public void onGetAddressFail(String errorMessage) {
addressView.onError(errorMessage);
}
}
|
43957207-81d1-48a0-8560-600891913e3b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-21 23:34:14", "repo_name": "qiuchili/ggnn_graph_classification", "sub_path": "/program_data/JavaProgramData/17/287.java", "file_name": "287.java", "file_ext": "java", "file_size_in_byte": 1201, "line_count": 73, "lang": "en", "doc_type": "code", "blob_id": "0040868c8ded181f5134d7d4fc129d714dd9e06d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/qiuchili/ggnn_graph_classification | 419 | FILENAME: 287.java | 0.264358 | package <missing>;
public class GlobalMembers
{
public static int Main()
{
String a = new String(new char[200]);
while (scanf("%s",a) != EOF)
{
final String al = "";
int i;
for (i = 0;a.charAt(i);i++)
{
if (a.charAt(i) == '(')
{
al = tangible.StringFunctions.changeCharacter(al, i, '$');
}
else if (a.charAt(i) == ')')
{
al = tangible.StringFunctions.changeCharacter(al, i, '?');
}
else
{
al = tangible.StringFunctions.changeCharacter(al, i, ' ');
}
}
void func(char s[]);
func(al);
System.out.println(a);
System.out.println(al);
a = "'\0'";
}
return 0;
}
public static void func(String s)
{
int i;
int t1 = 0;
int t2 = 0;
int n = s.length();
for (i = 0;i < s.length();i++)
{
while (!(s[i].equals('$') || s[i].equals('?')) && !s[i].equals('\0'))
{
i++;
}
t1 = i;
i = i + 1;
while (!(s[i].equals('$') || s[i].equals('?')) && !s[i].equals('\0'))
{
i++;
}
if (s[i].equals('\0'))
{
break;
}
t2 = i;
if (s[t1].equals('$') && s[t2].equals('?'))
{
s[t1] = ' ';
s[t2] = ' ';
i = -1;
continue;
}
i = t1;
}
}
}
|
2231be5b-0dbb-47ff-9ad9-28c7fb26bd6d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-25 09:44:33", "repo_name": "vbutsko/test-task-multithreading", "sub_path": "/src/org/expertsoft/executor/impl/SynchronousQueueExecutor.java", "file_name": "SynchronousQueueExecutor.java", "file_ext": "java", "file_size_in_byte": 1122, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "bae6ab3cd94e7043a450d033d9c12304a71f8c3c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vbutsko/test-task-multithreading | 217 | FILENAME: SynchronousQueueExecutor.java | 0.287768 | package org.expertsoft.executor.impl;
import org.expertsoft.executor.Executor;
import org.expertsoft.executor.TaskAccess;
import org.expertsoft.executor.thread.ExecuteThread;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.SynchronousQueue;
/**
* Created by wladek on 1/24/17.
*/
public class SynchronousQueueExecutor implements Executor, TaskAccess {
private final BlockingQueue<Runnable> queueOfTasks;
private final ExecuteThread executeThread;
public SynchronousQueueExecutor(){
queueOfTasks = new SynchronousQueue<Runnable>();
executeThread = new ExecuteThread(this);
executeThread.start();
}
public Runnable getNextTask(){
try {
return queueOfTasks.take();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return null;
}
}
public void execute(Runnable task){
try {
queueOfTasks.put(task);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
executeThread.myNotify();
}
}
|
74eb3dc9-fda7-400c-ad36-413d7e7331d0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-16 16:44:07", "repo_name": "pabloxavier/parametrizacao-bi-us", "sub_path": "/parametrizacao-bi-impl/src/main/java/br/com/unicred/parametrizacao/bi/impl/infrastructure/dao/SiglaContabilDAO.java", "file_name": "SiglaContabilDAO.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "fa880b19f9ea03e71bd619d48975c3dad95c88d0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pabloxavier/parametrizacao-bi-us | 239 | FILENAME: SiglaContabilDAO.java | 0.288569 | package br.com.unicred.parametrizacao.bi.impl.infrastructure.dao;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import br.com.unicred.parametrizacao.bi.impl.business.commands.SiglaContabilCommand;
import br.com.unicred.parametrizacao.bi.impl.business.domain.SiglaContabil;
@Repository
public class SiglaContabilDAO {
private final JdbcTemplate jdbcTemplate;
private static final String BUSCA_SIGLA_CONTABIL_SQL = "select codigo, sigla_contabil siglaContabil, ordem from edw.sigla_contabil;";
private static final BeanPropertyRowMapper<SiglaContabil> ROW_MAPPER = BeanPropertyRowMapper.newInstance(SiglaContabil.class);
@Autowired
public SiglaContabilDAO(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
public List<SiglaContabil> buscaSiglasContabeis() {
return jdbcTemplate.query(BUSCA_SIGLA_CONTABIL_SQL, ROW_MAPPER);
}
}
|
d487036d-0d8e-43dc-aeb7-8aebdef6a418 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-10 20:07:17", "repo_name": "Ashish018/Android", "sub_path": "/FoodApp/app/src/main/java/com/ashish/foodapp/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "a2ec9347df512711095155b1a3a273b1aaa9f92b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Ashish018/Android | 180 | FILENAME: MainActivity.java | 0.221351 | package com.ashish.foodapp;
import android.app.ActionBar;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button login,register;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Transparent Action Bar
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
getSupportActionBar().hide();
login=(Button)findViewById(R.id.login);
register=(Button)findViewById(R.id.register);
login.setOnClickListener(v->{
Intent intent=new Intent(MainActivity.this,SignInActivity.class);
startActivity(intent);
});
register.setOnClickListener(v->{
Intent intent=new Intent(MainActivity.this,SignUpActivity.class);
startActivity(intent);
});
}
} |
8d28b145-ac14-4def-99c8-096e5ee33675 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-24 16:39:50", "repo_name": "Html5DevAndroid/MyLib", "sub_path": "/html5/src/main/java/bk/itc/html5/mylib/component/view/recycler/MyRecyclerAdapter.java", "file_name": "MyRecyclerAdapter.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "7391a13cfeefd91c0d6780a71edd3ccfa59cce5c", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Html5DevAndroid/MyLib | 219 | FILENAME: MyRecyclerAdapter.java | 0.290981 | package bk.itc.html5.mylib.component.view.recycler;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by Hien on 5/3/2018.
*/
public class MyRecyclerAdapter extends RecyclerView.Adapter<MyViewHolder> {
private MyRecyclerListener mListener;
private int mSize = 0;
public MyRecyclerAdapter(@NonNull MyRecyclerListener listener) {
mListener = listener;
}
public void setSize(int size) {
mSize = size;
notifyDataSetChanged();
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return mListener.onCreateView();
}
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
mListener.onBind(position, holder.itemView);
}
@Override
public int getItemCount() {
return mSize;
}
public interface MyRecyclerListener {
MyViewHolder onCreateView();
void onBind(int position, View view);
}
}
|
fce0c5fb-affd-45ee-b446-eed2508dedc4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-07 01:33:52", "repo_name": "jholbrook7115/CodingInterviewQuestions", "sub_path": "/src/com/jholbrook/interviewquestions/PermutationIndexSearch.java", "file_name": "PermutationIndexSearch.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "b7f3f56cff0cd2c5cdff7fabd7d5602f6e7ea671", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jholbrook7115/CodingInterviewQuestions | 230 | FILENAME: PermutationIndexSearch.java | 0.235108 | package com.jholbrook.interviewquestions;
/*
Currently pending, most of the work is finished on my other computer but is not found here yet because I am a silly
person who forgot to commit and push my changes. As my friend Sri would say, I am a "numpty".
As a result this is incomplete right now and I am aware that this will not pass its unit test in its current state.
*/
import java.util.ArrayList;
import java.util.List;
class PermutationIndexSearch {
private static List<Character> output = new ArrayList<>();
static String findPermIndex(String str, int index){
int binSize = 1;
for(int i = 1; i <= str.length(); i++){
binSize = binSize * i;
}
System.out.println("bin size: " + binSize);
int bin = binSize/index;
output.add(str.charAt(bin));
if(bin != 1){
//recurse
System.out.println("gotta complete this");
} else{
return output.toString();
}
return null;
}
}
|
0f1d3736-2ad1-429b-9b34-b54b9206ef3f | {"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/PaneroProperties.java", "file_name": "PaneroProperties.java", "file_ext": "java", "file_size_in_byte": 1122, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "989d7503e97f50ff9e9516e4fa42937b8f608f61", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NEMAR/PaNeRo | 209 | FILENAME: PaneroProperties.java | 0.235108 | package org.panero.debs.config;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties("panero")
public class PaneroProperties {
@Valid
@NotNull
private Gateway gateway;
public Gateway getGateway() {
return gateway;
}
public void setGateway(final Gateway gateway) {
this.gateway = gateway;
}
public static class Gateway {
@NotEmpty
private String hostname;
@Min(1)
@Max(65535)
@NotNull
private Integer port;
public String getHostname() {
return hostname;
}
public void setHostname(final String hostname) {
this.hostname = hostname;
}
public Integer getPort() {
return port;
}
public void setPort(final Integer port) {
this.port = port;
}
}
}
|
4b622d9d-e4d6-4d2b-ae80-7816aa0b67a9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-21 12:57:12", "repo_name": "ebookleader/CookingTogether-webservice", "sub_path": "/src/main/java/com/jeongeun/project/springboot/domain/products/ProductsReview.java", "file_name": "ProductsReview.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "aeb3173b3cd26a5322279354f9b803a72d78c189", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ebookleader/CookingTogether-webservice | 243 | FILENAME: ProductsReview.java | 0.26971 | package com.jeongeun.project.springboot.domain.products;
import com.jeongeun.project.springboot.domain.BaseTimeEntity;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import javax.persistence.*;
@Getter
@NoArgsConstructor
@Entity
public class ProductsReview extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long reviewId;
@ManyToOne
@JoinColumn(name="p_id")
private Products products;
@Column(nullable = false)
private Long userId;
@Column(nullable = false)
private Long reservationId;
@Column(nullable = false, length = 500)
private String content;
@Column(nullable = false)
private double rating;
@Builder
public ProductsReview(Long userId, String content, double rating, Long reservationId) {
this.userId = userId;
this.content = content;
this.rating = rating;
this.reservationId = reservationId;
}
public void setProducts(Products products) {
this.products = products;
}
public void update(String content, double rating) {
this.content = content;
this.rating = rating;
}
}
|
b4f21270-8936-4650-a787-866f1b0fd1d6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-04-29 17:36:20", "repo_name": "dmitrybilyk/interviews", "sub_path": "/web/src/main/java/com/learn/web/gwt/server/HelloServiceImpl.java", "file_name": "HelloServiceImpl.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "6812b7e81d55644c8d13e8f84c71eb4a6d2a4b61", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dmitrybilyk/interviews | 175 | FILENAME: HelloServiceImpl.java | 0.239349 | package com.learn.web.gwt.server;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.learn.web.gwt.shared.CustomCheckedException;
import com.learn.web.gwt.client.HelloService;
import com.learn.web.gwt.shared.Employee;
import java.util.Collections;
import java.util.List;
public class HelloServiceImpl extends RemoteServiceServlet implements HelloService {
@Override
public List<Employee> getEmployees() {
Employee employee = new Employee();
employee.setEmployeeName("some name");
return Collections.singletonList(employee);
}
@Override
public List<Employee> getEmployeesWithException() throws CustomCheckedException {
Employee employee = new Employee();
employee.setEmployeeName("some name");
if ("some name".equals(employee.getEmployeeName())) {
throw new CustomCheckedException("some checked exception");
}
return Collections.singletonList(employee);
}
}
|
2a41e6e1-2c25-462b-9287-86a0d37e8ebc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-02 23:13:01", "repo_name": "goyal-shubham/Android-Assignment-Projects", "sub_path": "/ZooDirectory/app/src/main/java/edu/scu/sgoyal/zoodirectory/ZooInformation.java", "file_name": "ZooInformation.java", "file_ext": "java", "file_size_in_byte": 1011, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "1ad29569188577abdddd9dc2d1ff76156ce3d8a8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/goyal-shubham/Android-Assignment-Projects | 188 | FILENAME: ZooInformation.java | 0.199308 | package edu.scu.sgoyal.zoodirectory;
import android.content.Intent;
import android.net.Uri;
import android.support.v4.app.NavUtils;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
public class ZooInformation extends MenuActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_zoo_information);
Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
String num = "tel:1800-123-1234";
Intent myintent = new Intent(Intent.ACTION_CALL, Uri.parse(num));
startActivity(myintent);
}
});
}
}
|
6cd59612-31d7-4a11-8713-f0c9f903bd01 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-02 19:26:41", "repo_name": "deagofdo/laughing-pancake1", "sub_path": "/workout tracker/src/main/java/workout/service/CategoryImpl.java", "file_name": "CategoryImpl.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "78e8526074e948f992d910fbcf0a70f63e2df969", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/deagofdo/laughing-pancake1 | 188 | FILENAME: CategoryImpl.java | 0.276691 | package workout.service;
import workout.interfaces.Category;
import workout.model.WorkoutCategory;
import org.springframework.stereotype.Service;
import workout.repo.CategoryRepository;
import javax.transaction.Transactional;
import java.util.List;
@Service
@Transactional
public class CategoryImpl implements Category {
public CategoryImpl(CategoryRepository categoryRepo) {
this.categoryRepo = categoryRepo;
}
private CategoryRepository categoryRepo;
@Override
public String addCategory(WorkoutCategory category) {
categoryRepo.save(category);
return null;
}
@Override
public List<WorkoutCategory> getAllCategory() {
return (List<WorkoutCategory>)categoryRepo.findAll();
}
@Override
public String updateCategory(WorkoutCategory category) {
categoryRepo.save(category);
return null;
}
@Override
public void deleteCategory(WorkoutCategory category) {
categoryRepo.delete(category);
}
}
|
ba501625-a08c-401b-86fe-61bee63068b4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-17 17:58:39", "repo_name": "kj1995/PulsUhr-1", "sub_path": "/app/src/main/java/de/rwth/pulsuhr/pulsuhr/SettingsFragment.java", "file_name": "SettingsFragment.java", "file_ext": "java", "file_size_in_byte": 1233, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "b42e589c861fd1c27973b15ee110ebf413786c2b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kj1995/PulsUhr-1 | 243 | FILENAME: SettingsFragment.java | 0.283781 | package de.rwth.pulsuhr.pulsuhr;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;
/**
* Created by steffen on 16.06.16.
*/
public class SettingsFragment extends Fragment implements View.OnClickListener{
View myView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
myView = inflater.inflate(R.layout.settings_fragment, container, false);
Button btnResetDB = (Button)myView.findViewById(R.id.btnResetDB);
btnResetDB.setOnClickListener(this);
return myView;
}
@Override
public void onClick(View v) {
final SqlHelper myDB = new SqlHelper(getActivity());
switch (v.getId()){
case R.id.btnResetDB :
int successful = myDB.deleteMeasurement(null,null);
if(successful > 0){
Toast.makeText(getActivity(),"Datenbank zurückgesetzt !",Toast.LENGTH_SHORT).show();
}
break;
}
}
}
|
23e2c94c-ce67-4cad-99b9-e7eb08290971 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-24 14:19:25", "repo_name": "shiliang/demotwitter", "sub_path": "/src/main/java/com/twitter/demo/model/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 67, "lang": "en", "doc_type": "code", "blob_id": "44b5c4a3c3241cc3ba4a43784c1f2d9b2596d836", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shiliang/demotwitter | 256 | FILENAME: User.java | 0.20947 | package com.twitter.demo.model;/*
* @program:com.twitter.demo.model
* @description:用户实体类
* @author:shiliang
* @create:2018-05-15 23:13
* */
import java.io.Serializable;
public class User implements Serializable {
private long id;
private String username;
private String password;
private String salt;
private String headUrl;
public User() {
}
public User(String name) {
this.username = name;
this.password = "";
this.salt = "";
this.headUrl = "";
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
public String getHeadUrl() {
return headUrl;
}
public void setHeadUrl(String headUrl) {
this.headUrl = headUrl;
}
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;
}
}
|
1671c9f0-1955-4329-b9fe-a585c1f14efb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-20 11:23:57", "repo_name": "linxuanwei/trident-core", "sub_path": "/trident-core-business-system/trident-system-api/src/main/java/x/trident/core/system/api/exception/enums/organization/DataScopeExceptionEnum.java", "file_name": "DataScopeExceptionEnum.java", "file_ext": "java", "file_size_in_byte": 1418, "line_count": 49, "lang": "zh", "doc_type": "code", "blob_id": "450b34a5f79f70136e299af3efbfdd596177eeb6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/linxuanwei/trident-core | 315 | FILENAME: DataScopeExceptionEnum.java | 0.261331 |
package x.trident.core.system.api.exception.enums.organization;
import x.trident.core.constants.BaseConstants;
import x.trident.core.exception.AbstractExceptionEnum;
import x.trident.core.system.api.constants.SystemConstants;
import lombok.Getter;
/**
* 数据范围异常枚举
*
* @author 林选伟
* @date 2020/11/5 16:04
*/
@Getter
public enum DataScopeExceptionEnum implements AbstractExceptionEnum {
/**
* 操作失败,当前用户没有该数据的数据权限
*/
DATA_SCOPE_ERROR(BaseConstants.USER_OPERATION_ERROR_TYPE_CODE + SystemConstants.SYSTEM_EXCEPTION_STEP_CODE + "51", "操作失败,当前用户没有该数据的数据权限,当前数据范围是:{}"),
/**
* 用户id为空
*/
USER_ID_EMPTY_ERROR(BaseConstants.BUSINESS_ERROR_TYPE_CODE + SystemConstants.SYSTEM_EXCEPTION_STEP_CODE + "52", "获取数据范围失败,用户id为空"),
/**
* 用户角色为空
*/
ROLE_EMPTY_ERROR(BaseConstants.BUSINESS_ERROR_TYPE_CODE + SystemConstants.SYSTEM_EXCEPTION_STEP_CODE + "53", "获取数据范围失败,用户角色为空,userId:{}");
/**
* 错误编码
*/
private final String errorCode;
/**
* 提示用户信息
*/
private final String userTip;
DataScopeExceptionEnum(String errorCode, String userTip) {
this.errorCode = errorCode;
this.userTip = userTip;
}
}
|
64c011e9-937d-4c96-8bab-6fb09f310cc8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-23 07:30:33", "repo_name": "nickbar86/youblogit", "sub_path": "/posts/src/main/java/com/youblog/posts/PostsApplication.java", "file_name": "PostsApplication.java", "file_ext": "java", "file_size_in_byte": 1121, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "ce9ec504de11491c7814971c1b838569115852e6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nickbar86/youblogit | 206 | FILENAME: PostsApplication.java | 0.2227 | package com.youblog.posts;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import brave.sampler.Sampler;
@SpringBootApplication
@EnableDiscoveryClient
@ComponentScan("com.youblog.posts")
public class PostsApplication {
private static final Logger LOG = LoggerFactory.getLogger(PostsApplication.class);
public static void main(String[] args) {
ConfigurableApplicationContext ctx = SpringApplication.run(PostsApplication.class, args);
String mysqlUri = ctx.getEnvironment().getProperty("spring.datasource.url");
LOG.info("Connected to MySQL: " + mysqlUri);
}
@Bean
public Sampler defaultSampler() {
return Sampler.ALWAYS_SAMPLE;
}
@Bean
feign.Logger.Level feignLoggerLevel() {
return feign.Logger.Level.BASIC;
}
}
|
63b0ea9a-e290-4e11-8276-97d0f85f28ca | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-10 02:40:26", "repo_name": "yummykang/workkits", "sub_path": "/src/main/java/me/yummykang/service/UserService.java", "file_name": "UserService.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "52ae591c382395415707cbe7d1d294bfc7b7c770", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yummykang/workkits | 271 | FILENAME: UserService.java | 0.285372 | package me.yummykang.service;
import me.yummykang.constant.ErrorCode;
import me.yummykang.entity.tables.pojos.Users;
import me.yummykang.entity.tables.records.UsersRecord;
import me.yummykang.exceptions.BusinessErrorException;
import me.yummykang.utils.JwtTokenUtil;
import org.jooq.DSLContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import static me.yummykang.entity.tables.Users.USERS;
/**
* write something to describe this file.
*
* @author demon
* @since 2017-11-08 17:56.
*/
@Service
public class UserService {
@Autowired
private DSLContext dsl;
@Autowired
private JwtTokenUtil jwtTokenUtil;
public Users loadUserByUsername(String username) {
return dsl.selectFrom(USERS).where(USERS.USERNAME.eq(username)).fetchOne().into(Users.class);
}
public String login(Users users) throws BusinessErrorException {
Users resultUser = loadUserByUsername(users.getUsername());
if (resultUser != null) {
return jwtTokenUtil.generateToken(resultUser);
} else {
throw new BusinessErrorException(ErrorCode.NAME_OR_PWD_ERROR);
}
}
}
|
c2bf2aa9-47e8-438d-93d6-1b46554ccb56 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-18 22:02:35", "repo_name": "Anastasiia-byte/Movies-Catalogue", "sub_path": "/app/src/main/java/com/example/moviescatalogue/MovieViewModel.java", "file_name": "MovieViewModel.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "9faa493dc7e55616d32fec6e4b6cc4fcdc5fedf7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Anastasiia-byte/Movies-Catalogue | 184 | FILENAME: MovieViewModel.java | 0.271252 | package com.example.moviescatalogue;
import android.app.Application;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.example.moviescatalogue.databases.Movie;
import java.util.List;
public class MovieViewModel extends AndroidViewModel{
private final static MutableLiveData<String> selectedMovie = new MutableLiveData<String>();
private final MovieRepository movieRepository;
private final LiveData<List<Movie>> moviesList;
public MovieViewModel(Application application) {
super(application);
movieRepository = new MovieRepository(application);
moviesList = movieRepository.getMovieByName(selectedMovie.getValue());
}
public static void selectMovie(String movieName) {
selectedMovie.setValue(movieName);
}
public LiveData<List<Movie>> getData() {
return moviesList;
}
public void changeRate(int rate){
movieRepository.changeRate(rate, selectedMovie.getValue());
}
} |
7d05f8db-d1aa-4995-bab2-467308166f3e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-27 14:01:06", "repo_name": "kensupernova/exchcard-android-app", "sub_path": "/app/src/main/java/com/guanghuiz/exchangecard/Database/model/MailAddress.java", "file_name": "MailAddress.java", "file_ext": "java", "file_size_in_byte": 1122, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "1df5e50b3eec675122416954be6e8d93d1bfb946", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kensupernova/exchcard-android-app | 235 | FILENAME: MailAddress.java | 0.226784 | package com.guanghuiz.exchangecard.Database.model;
import com.google.gson.annotations.SerializedName;
/**
* Created by Guanghui on 17/2/16.
*/
public class MailAddress {
@SerializedName("name")
private String name = " ";
@SerializedName("address")
private String address = " ";
@SerializedName("postcode")
private String postcode = " ";
public MailAddress(String name, String address, String postcode){
this.name = name;
this.address = address;
this.postcode = postcode;
}
public void setName(String name){
this.name = name;
}
public String getName(){
return this.name;
}
public void setAddress(String address){
this.address = address;
}
public String getAddress(){
return this.address;
}
public void setPostcode(String postcode){
this.postcode = postcode;
}
public String getPostcode(){
return this.postcode;
}
public String toString(){
return this.name +",\n" +
this.address +",\n" +
this.postcode;
}
}
|
726f99f2-01a8-4776-930b-c50cddf9df47 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-03-22 20:07:09", "repo_name": "dinocore1/LightEtch", "sub_path": "/core/src/main/java/com/devsmart/lightetch/ViewGroup.java", "file_name": "ViewGroup.java", "file_ext": "java", "file_size_in_byte": 1201, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "523ce842e61a6eed8a45dfa6940c586096659d6e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dinocore1/LightEtch | 241 | FILENAME: ViewGroup.java | 0.280616 | package com.devsmart.lightetch;
import java.util.ArrayList;
public class ViewGroup extends View {
public static class LayoutParams {
public static final int FILL_PARENT = -1;
public static final int WRAP_CONTENT = -2;
public int width = WRAP_CONTENT;
public int height = WRAP_CONTENT;
}
public static class MarginLayoutParams extends LayoutParams {
public int marginTop;
public int marginBottom;
public int marginLeft;
public int marginRight;
}
private ArrayList<View> mChildren = new ArrayList<View>();
public ViewGroup(Context context) {
super(context);
}
public void addView(View view) {
mChildren.add(view);
}
public void removeAllChildren() {
mChildren.clear();
}
public void removeChildAt(int index) {
mChildren.remove(index);
}
public int getChildCount() {
return mChildren.size();
}
public View getViewAt(int index) {
return mChildren.get(index);
}
@Override
public Iterable<View> children() {
return mChildren;
}
@Override
public final void draw(Canvas canvas) {}
}
|
224c8bf6-8607-4e39-b54d-33f462892bb0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-02-05T02:18:48", "repo_name": "grady-lad/reason-bingo", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1122, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "66c2a729c679a25a932087cea13e8b4c8ab335a4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/grady-lad/reason-bingo | 264 | FILENAME: README.md | 0.245085 | # reason-bingo
## What is this ?
When learning ELM, I found this course by pragmatic studio very helpful and wanted to apply it to ReasonML.
The app contains a simple sever running on port '3000', It will return some randomEntries.
The game is a basic UI which renders the random entries and calculates a score for entry clicked.
## Run this project locally:
```
npm install
npm start
# in another tab
npm run webpack
# and in another tab !! :P
cd /server && npm start
```
After you see the webpack compilation succeed (the `npm run webpack` step), open up the nested html files in `src/*` (**no server needed!**). Then modify whichever file in `src` and refresh the page to see the changes.
## TODOS
- [] Introduce error handling loading etc.
- [] Deploy on Heroku would be nice :)
- [] Recored the score of every game to make a high score board.
- [] Introduce ability to remove/add players. (Some text field to record user inputs)
- [] Rewrite the sever implementation in ReasonML ?
- [] Make into a PWA (Might be useful to see how to link the bindings between js and reason)
- [] Possibly release an article
|
11c709ad-603c-4728-b091-d57101c41b3c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-03 10:43:09", "repo_name": "louiema1n/foo", "sub_path": "/src/main/java/com/lm/controller/sys/PermissionController.java", "file_name": "PermissionController.java", "file_ext": "java", "file_size_in_byte": 1209, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "b90d8c9f800b082b3e44c5f2a62f9c938bb449dd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/louiema1n/foo | 222 | FILENAME: PermissionController.java | 0.229535 | package com.lm.controller.sys;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.lm.domain.PageResult;
import com.lm.service.sys.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 权限控制器
* Created by Louie on 2017-09-03.
*/
@RequestMapping("/per")
@RestController
public class PermissionController {
@Autowired
private PermissionService permissionService;
@RequestMapping(value = "/all", method = RequestMethod.GET)
public PageResult all(@RequestParam("offset") int offset,
@RequestParam("limit") int limit,
@RequestParam("order") String order) {
PageResult pageResult = new PageResult();
Page page = PageHelper.offsetPage(offset, limit, true);
pageResult.setRows(this.permissionService.getAll());
pageResult.setTotal(page.getTotal());
return pageResult;
}
}
|
c1b86b1c-4ebd-42a4-b143-10ed9e902d74 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-30 01:01:27", "repo_name": "krystiancorderoh/academy", "sub_path": "/Spring Boot/SBoot-app/src/main/java/com/softtek/academy/jpa/domain/model/CouponEntity.java", "file_name": "CouponEntity.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ba52a63283679b7d0080674af6919b5c09697e19", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/krystiancorderoh/academy | 183 | FILENAME: CouponEntity.java | 0.221351 | package com.softtek.academy.jpa.domain.model;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.softtek.academy.jpa.util.serializer.JsonDateTimeDeserializer;
import com.softtek.academy.jpa.util.serializer.JsonDateTimeSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class CouponEntity extends AuditableEntity {
private static final long serialVersionUID = 1L;
private String id;
@JsonSerialize(using = JsonDateTimeSerializer.class)
@JsonDeserialize(using = JsonDateTimeDeserializer.class)
private Date validFrom;
@JsonSerialize(using = JsonDateTimeSerializer.class)
@JsonDeserialize(using = JsonDateTimeDeserializer.class)
private Date validTo;
private Double value;
private Double redeemed;
private Double balance;
private boolean active;
}
|
e94dc674-fb46-40fb-b886-bc4e3312d692 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-29 04:42:25", "repo_name": "54Zenk/spring-start", "sub_path": "/src/main/java/ru/beeline/demo/entity/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "de645672f451a251ad1c111170f03737f545ddb3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/54Zenk/spring-start | 231 | FILENAME: User.java | 0.256832 | package ru.beeline.demo.entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@NotBlank
private String name;
@NotBlank
private String password;
@OneToMany(fetch = FetchType.EAGER, mappedBy = "user")
@JsonIgnore
private List<Orderz> orders = new LinkedList<>();
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public List<Orderz> getOrders() {
return orders;
}
public void setOrders(List<Orderz> orders) {
this.orders = orders;
}
}
|
628a311b-a87c-40ad-aa58-e7a659aaf976 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-03-18T15:50:37", "repo_name": "enterstudio/gtbjj.github.io", "sub_path": "/_posts/2016-06-18-2344-X205TA-Touchpad.md", "file_name": "2016-06-18-2344-X205TA-Touchpad.md", "file_ext": "md", "file_size_in_byte": 1013, "line_count": 39, "lang": "en", "doc_type": "text", "blob_id": "db98d0cdc70a223768aedff8b5a3068e9d5e773b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/enterstudio/gtbjj.github.io | 297 | FILENAME: 2016-06-18-2344-X205TA-Touchpad.md | 0.195594 | ---
layout: post
title: "X205TA: Touchpad Fix"
excerpt: "Quick fix to get touchpad working with Arch Linux and Asus X205TA"
category:
- Linux
tags:
- arch
- linux
- troubleshooting
- x205ta
- touchpad
comments: true
---
*From [my BUGS page](https://github.com/gtbjj/x205ta/blob/master/BUGS.md) for the Asus X205TA.*
The touchpad should work on kernels 4.3* [[1]](https://wiki.archlinux.org/index.php/Asus_x205ta#Touchpad) (confirmed on kernel 4.3.3-2-ARCH), but if you still run into problems on another kernel, you can proceed with the following.
First, make sure that you have ```xf86-input-synaptics``` installed. To enable more features of the touchpad:`
Then,
```
# nano /etc/X11/xorg.conf.d/elan_synaptics.conf
---------------------------------------------------
Section "InpuClass"
Identifier "Elan Touchpad"
MatchIsTouchpad "on"
Driver "synaptics"
EndSection
```
Things should work as normal when you start up X again.
-----
[Reference](https://wiki.archlinux.org/index.php/Asus_x205ta#Touchpad)
|
4eb7d25c-04de-4eee-89f0-7b98c4b8c497 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-09T16:14:19", "repo_name": "nsorin/njob", "sub_path": "/njob-rest/src/test/java/com/github/nsorin/njobrest/NjobApplicationTests.java", "file_name": "NjobApplicationTests.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "fc26bcdc0eb50661a84a1efe144b0ab39106eb90", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nsorin/njob | 193 | FILENAME: NjobApplicationTests.java | 0.247987 | package com.github.nsorin.njobrest;
import com.github.nsorin.njobrest.web.controller.ApplicationController;
import com.github.nsorin.njobrest.web.controller.CompanyController;
import com.github.nsorin.njobrest.web.controller.DocumentController;
import com.github.nsorin.njobrest.web.controller.RecruiterController;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest
class NjobApplicationTests {
@Autowired
private CompanyController companyController;
@Autowired
private RecruiterController recruiterController;
@Autowired
private ApplicationController applicationController;
@Autowired
private DocumentController documentController;
@Test
void contextLoads() {
assertThat(this.companyController).isNotNull();
assertThat(this.recruiterController).isNotNull();
assertThat(this.applicationController).isNotNull();
assertThat(this.documentController).isNotNull();
}
}
|
2b1fc788-1db2-41e6-b1c8-aec6e94292d9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-09 12:18:18", "repo_name": "TerryMabowen/pyg", "sub_path": "/web-manager/src/main/java/cn/itcast/core/controller/OrderItemController.java", "file_name": "OrderItemController.java", "file_ext": "java", "file_size_in_byte": 1235, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ada5ca5d8da46b9a8cca33993a2186937d02d99f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/TerryMabowen/pyg | 238 | FILENAME: OrderItemController.java | 0.285372 | package cn.itcast.core.controller;
import cn.itcast.core.pojo.entity.PageResult;
import cn.itcast.core.pojo.order.Order;
import cn.itcast.core.service.OrderItemService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/orderItem")
public class OrderItemController {
@Reference
private OrderItemService orderItemService;
//查询订单所有
@RequestMapping("/findAll")
public List<Order> orderItemList(){
List<Order> orderList = orderItemService.findAll();
return orderList;
}
//分页查询
@RequestMapping("/findPage")
public PageResult findPage(Integer page, Integer rows){
PageResult pageResult = orderItemService.findPage(page, rows);
return pageResult;
}
//多条件分页查询
@RequestMapping("/search")
public PageResult search(Integer page,Integer rows,@RequestBody Order order){
PageResult pageResult = orderItemService.search(page, rows, order);
return pageResult;
}
}
|
f62b38f0-5eb3-41b9-8ad6-b7e34a882d76 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-19 19:50:29", "repo_name": "zhanglei923/JGrapeTree", "sub_path": "/src/main/java/org/jgrapetree/io/xml/XmlSerializer.java", "file_name": "XmlSerializer.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "ca1ccb2dd5ed7ad0cd9ae23131a5c18bf66de054", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/zhanglei923/JGrapeTree | 247 | FILENAME: XmlSerializer.java | 0.275909 | package org.jgrapetree.io.xml;
import org.jgrapetree.io.xml.support.SerializerNodeGenerator;
import org.jgrapetree.io.xml.support.SerializerStringGenerator;
import org.jgrapetree.model.Form;
import org.jgrapetree.model.Widget;
import org.jgrapetree.model.form.GrapeForm;
import org.jgrapetree.model.form.GrapeWidget;
import org.jgrapetree.model.form.GrapeWidgetManager;
public class XmlSerializer implements org.jgrapetree.io.Serializer{
SerializerNodeGenerator nodeGen = new SerializerNodeGenerator();
SerializerStringGenerator strGen = new SerializerStringGenerator();
public String getString(Form doc) {
String s = strGen.getString(doc.getRoot());
return s;
}
public String getString(Widget node) {
String s = strGen.getString(node);
return s;
}
public Form getForm(String str) {
GrapeWidget node = nodeGen.getNode(str);
Form document = new GrapeForm();
document.addWidget(node);
return document;
}
public Widget getWidget(String str) {
GrapeWidget node = nodeGen.getNode(str);
return node;
}
}
|
f87192ec-e216-44d2-9b39-8009abe5045e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-10 16:45:53", "repo_name": "AlexMihalache99/Spaceship_Game", "sub_path": "/source/CollectableItem.java", "file_name": "CollectableItem.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "dfc7855f5a7d7df9e54d4ea5d4830f8e731ace27", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AlexMihalache99/Spaceship_Game | 236 | FILENAME: CollectableItem.java | 0.259826 | import javafx.scene.image.Image;
/**
* A super class of all the collectable items.
* @author Alexandru Mihalache
*/
public class CollectableItem extends Cell {
private Image image;
private static Image image2 = new Image("images/groundCell.png");
private boolean wasCollected;
/**
* Create a new collectable item on the given position.
* @param position The position of the collectable item.
*/
public CollectableItem(Position position) {
super(position);
}
/**
* Change the image representing the collectable item.
*/
public void changeImage() {
this.image = CollectableItem.image2;
}
/**
* Set the boolean value of wasCollected.
* @param wasCollected The new value of wasCollected.
*/
public void setWasCollected(boolean wasCollected) {
this.wasCollected = wasCollected;
}
/**
* Get the boolean value of wasCollected.
* @return True or false.
*/
public boolean getWasCollected() {
return this.wasCollected;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.