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 |
|---|---|---|---|---|---|---|
264fd46a-a615-4799-977a-8dca3fcf8a30 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-03 17:24:22", "repo_name": "PoopBear1/CMPUT301", "sub_path": "/labs/lab1/Lab1Demo/app/src/main/java/com/example/simpleparadox/lab1demo/Tweet.java", "file_name": "Tweet.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "57a868633dfe89c3c0338e1e1f0f15d803b5f1f1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/PoopBear1/CMPUT301 | 192 | FILENAME: Tweet.java | 0.262842 | package com.example.simpleparadox.lab1demo;
import java.util.Date;
abstract public class Tweet implements Tweetable{
private Date date;
private String message;
Tweet(String message){
if(message.length()>140){
this.message = message.substring(0,140);
}
else{
this.message = message;
}
date = new Date();
}
Tweet(Date date, String message){
this.date = date;
if(message.length()>140){
this.message = message.substring(0,140);
}
else{
this.message = message;
}
}
public Date getDate(){
return this.date;
}
public String getMessage(){
return this.message;
}
void setDate(Date date){
this.date = date;
}
void setMessage(String message){
this.message = message;
}
public abstract Boolean isImportant();
}
|
8454261a-b16b-4893-b6dc-368dc652e03c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-07 16:33:36", "repo_name": "MagdaMaSlonia/DeepDiveDynamoDbTutorial", "sub_path": "/src/main/java/com/pluralsight/dynamodb/dao/CommentDao.java", "file_name": "CommentDao.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "474ecf38f0b0a88ed28982512b8a17aa41dc3144", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MagdaMaSlonia/DeepDiveDynamoDbTutorial | 237 | FILENAME: CommentDao.java | 0.26588 | package com.pluralsight.dynamodb.dao;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBScanExpression;
import com.pluralsight.dynamodb.domain.Comment;
import java.util.List;
public class CommentDao {
private DynamoDBMapper mapper;
public CommentDao(AmazonDynamoDB dynamoDB) {
this.mapper = new DynamoDBMapper(dynamoDB);
}
public Comment put(Comment comment) {
mapper.save(comment);
return comment;
}
public Comment get(String itemId, String messageId) {
Comment comment = new Comment();
comment.setItemId(itemId);
comment.setMessageId(messageId);
return mapper.load(comment);
}
public void delete(String itemId, String messageId) {
Comment comment = new Comment();
comment.setItemId(itemId);
comment.setMessageId(messageId);
mapper.delete(comment);
}
public List<Comment> getAll() {
return mapper.scan(Comment.class, new DynamoDBScanExpression());
}
}
|
29cbf915-886b-43e5-a391-bc9cb961d427 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-28 17:32:02", "repo_name": "imranlatur24/KhayumDemo", "sub_path": "/KhayumDemo/app/src/main/java/com/example/khayumdemo/ProfileActivity.java", "file_name": "ProfileActivity.java", "file_ext": "java", "file_size_in_byte": 1141, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "99784bdfa6c06c9a7a77edfd848c4fad6d2798df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/imranlatur24/KhayumDemo | 187 | FILENAME: ProfileActivity.java | 0.206894 | package com.example.khayumdemo;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
public class ProfileActivity extends BaseActivity
{
private Toolbar toolbar;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.profile);
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("Profile");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
|
c26c78d1-1c20-4738-9f91-646dda6b5f2c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-11 12:00:47", "repo_name": "liaocp666/amireux", "sub_path": "/amireux-core/src/main/java/cn/liaocp/amireux/core/http/MultiReadHttpServletRequest.java", "file_name": "MultiReadHttpServletRequest.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "4d743b72b02d00d1d6b588a0cb79e35aa8d37158", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liaocp666/amireux | 185 | FILENAME: MultiReadHttpServletRequest.java | 0.229535 | package cn.liaocp.amireux.core.http;
import org.springframework.util.StreamUtils;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.*;
/**
* @author Chunping.Liao
*/
public class MultiReadHttpServletRequest extends HttpServletRequestWrapper {
private final byte[] cachedBody;
public MultiReadHttpServletRequest(HttpServletRequest request) throws IOException {
super(request);
InputStream requestInputStream = request.getInputStream();
this.cachedBody = StreamUtils.copyToByteArray(requestInputStream);
}
@Override
public ServletInputStream getInputStream() {
return new CachedBodyServletInputStream(this.cachedBody);
}
@Override
public BufferedReader getReader() {
// Create a reader from cachedContent
// and return it
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(this.cachedBody);
return new BufferedReader(new InputStreamReader(byteArrayInputStream));
}
} |
74f1c683-f9c2-4650-85d6-d85e261970c6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-12 13:38:43", "repo_name": "TonyLituo/Test", "sub_path": "/Visa/app/src/main/java/com/dhcc/visa/ui/MyOrderActivity.java", "file_name": "MyOrderActivity.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "9a5952260ea3c8a4755929f2829f9568f7f6c920", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/TonyLituo/Test | 273 | FILENAME: MyOrderActivity.java | 0.258326 | package com.dhcc.visa.ui;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.dhcc.visa.R;
import com.dhcc.visa.persenter.CommonPresent;
import com.dhcc.visa.ui.base.BaseActivity;
import com.dhcc.visa.ui.base.IBaseView;
import butterknife.BindView;
import butterknife.OnClick;
/**
* Created by lenovo on 2017/4/11.
*/
public class MyOrderActivity extends BaseActivity <IBaseView, CommonPresent> implements IBaseView{
@BindView(R.id.base_img_left)
ImageView mBaseImgLeft;
@BindView(R.id.base_toolbar_title)
TextView mBaseToolbarTitle;
@Override
public int getLayoutResID() {
return R.layout.activity_my_order;
}
@Override
protected void initView() {
mBaseToolbarTitle.setText("我的订单");
}
@OnClick({R.id.base_img_left})
public void OnClick(View v) {
switch (v.getId()) {
case R.id.base_img_left:
this.finish();
break;
}
}
@NonNull
@Override
public CommonPresent createPresenter() {
return new CommonPresent();
}
}
|
295785e4-d71f-4823-aa3e-73db245b72f9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-29 21:24:50", "repo_name": "ericosta-dev/studyMaisPW", "sub_path": "/src/main/java/tads/eaj/projeto/service/AulaService.java", "file_name": "AulaService.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "d03ec0378d68ce9e6f78f9e62a2427b7077a7f6d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ericosta-dev/studyMaisPW | 216 | FILENAME: AulaService.java | 0.267408 | package tads.eaj.projeto.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tads.eaj.projeto.model.Aula;
import tads.eaj.projeto.repository.AulaRepository;
import java.util.List;
import java.util.Optional;
@Service
public class AulaService {
private AulaRepository repository;
@Autowired
public void setRepository(AulaRepository repository){
this.repository = repository;
}
public Aula insert(Aula a){
return repository.save(a);
}
public Aula update(Aula a){
return repository.save(a);
}
public void delete(Long id){
repository.deleteById(id);
}
public Aula getOne(Long id){
return repository.findById(id).orElse(null);
}
public Optional<Aula> findById(Long id){
return repository.findById(id);
}
public List<Aula> getAll(){
return repository.findAll();
}
public Aula saveAndFlush(Aula a){
return repository.saveAndFlush(a);
}
}
|
cbe7159e-7676-4ceb-b719-3084aa1eeaa6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-08-29T22:38:32", "repo_name": "maanijou/ulauncher-ecosia-search", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1165, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "8e2775c2ed2f269989acea317dcc3e439b92bf1e", "star_events_count": 9, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/maanijou/ulauncher-ecosia-search | 301 | FILENAME: README.md | 0.243642 | # Ulauncher
Ulauncher is an Application launcher for Linux.
You can install it from [here](https://ulauncher.io/#Download).
This extension requires Ulauncher version 5.0+.
# Ecosia search Extention for Ulauncher
Ecosia is the search engine that plants trees!
For more information, visit [Ecosia webpage](https://info.ecosia.org/what).
With this extension, you will be able to search inside Ecosia through Ulauncher. You can use Ecosia [search tags](https://ecosia.zendesk.com/hc/en-us/articles/201657321-What-are-search-tags-) in your queries.
# Basic usage
Open Ulauncher and start searching by writing `ecosia` and your search query! You can open the result in your default browser by selecting one of the results.

# Install
Go to Ulauncher preferences window > EXTENSIONS > Add extension and paste the following URL:
https://github.com/maanijou/ulauncher-ecosia-search
The default keyword to call the Ecosia plugin is "ecosia". You can change it to whatever you want in the preferences.
**Note**: [Ecosia](https://www.ecosia.org/) and all its assets are properties of [Ecosia GmbH](https://info.ecosia.org/about).
|
6c3ce252-a8ad-4384-8381-03751db3819a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-29 02:00:49", "repo_name": "Rewiew/bookmanager", "sub_path": "/src/com/controller/hsgloginController.java", "file_name": "hsgloginController.java", "file_ext": "java", "file_size_in_byte": 1139, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "48316fe08a757236ab42b251beac54ffb46d8fbf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Rewiew/bookmanager | 251 | FILENAME: hsgloginController.java | 0.258326 | package com.controller;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import com.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.server.UserServer;
@Controller
public class hsgloginController {
@Resource
private UserServer allusersService;
@RequestMapping("hsglogin.do")
public String checkAllusersLogin(User user, HttpSession session) {
Map<String,Object> u=new HashMap<String,Object>();
System.out.println("name===" + user.getUsername());
u.put("username", user.getUsername());
//u.put("utype", "用户");
//Md5.MD5HexEncode(user.getPassword())
u.put("pwd", user.getPwd());
user = allusersService.allusersLogin(u);
if (user != null) {
session.setAttribute("username", user);
System.out.println("username=" + user);
session.removeAttribute("suc");
return "redirect:index.do";
} else {
System.out.println("usernafwfwwme=");
session.setAttribute("suc", "登录失败!用户名或密码错误!");
return "login";
}
}
}
|
b12ba0e1-d954-493c-aae0-e1ce9cfddd57 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-22 00:13:14", "repo_name": "ricardoaruiz/android-superafit", "sub_path": "/app/src/main/java/superafit/rar/com/br/superafit/uitls/DateUtil.java", "file_name": "DateUtil.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "3496495446be40eb8e565624d072528d3ef4f3a1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ricardoaruiz/android-superafit | 227 | FILENAME: DateUtil.java | 0.250913 | package superafit.rar.com.br.superafit.uitls;
import android.util.Log;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
/**
* Created by ralmendro on 06/06/17.
*/
public class DateUtil {
private static final String TAG = "DateUtil";
public static Date toDate(String value, DateUtil.Format format) {
try {
return format.getFormater().parse(value);
} catch (ParseException e) {
Log.e(TAG, "toDate: " + e.getMessage());
return null;
}
}
public static String fromDate(Date date, DateUtil.Format format) {
return format.getFormater().format(date);
}
public enum Format {
DIA_MES_ANO(new SimpleDateFormat("dd/MM/yyyy"));
private final SimpleDateFormat formater;
Format(SimpleDateFormat formater) {
this.formater = formater;
}
public SimpleDateFormat getFormater() {
return formater;
}
}
}
|
4e875e27-0909-4779-9ac6-f03cad9cfe5f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-09-01 19:02:38", "repo_name": "brueda/Bolt-Squadron", "sub_path": "/app/src/main/java/com/Ben/framework/util/TaskList.java", "file_name": "TaskList.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ad32c2264fa5389dbc86907899386ec4d0f4f891", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/brueda/Bolt-Squadron | 257 | FILENAME: TaskList.java | 0.29584 | package com.Ben.framework.util;
import java.util.ArrayList;
/**
* Created by Klaue on 6/8/2015.
*/
public class TaskList {
private static ArrayList<Task> _list;
private static ArrayList<Task> _toAdd;
private static ArrayList<Task> _toDelete;
public TaskList() {
_list = new ArrayList<Task>();
_toAdd = new ArrayList<Task>();
_toDelete = new ArrayList<Task>();
}
//Adds a previously created task to the tasklist.
public static void addTask(Task t) {
_toAdd.add(t);
}
public static void updateAll(long deltaTime, Painter g) {
for (Task t : _list) {
if (t.getState() == Task.TASK_READY) { t.update(deltaTime, g); }
if (t.getState() == Task.TASK_DONE) { _toDelete.add(t); }
}
cleanup();
}
private static void cleanup() {
for (Task t : _toDelete) { _list.remove(t); }
for (Task t : _toAdd) { _list.add(t); }
_toDelete.clear();
_toAdd.clear();
}
}
|
8884c4a4-9a57-4c24-9c47-48bd2560b310 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-22 22:06:29", "repo_name": "carbaj03/FitGallery", "sub_path": "/app/src/main/java/com/acv/gallery/GalleryApplication.java", "file_name": "GalleryApplication.java", "file_ext": "java", "file_size_in_byte": 1168, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "25a31c568de7564ca365db40e55e6412e1e76f18", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/carbaj03/FitGallery | 201 | FILENAME: GalleryApplication.java | 0.256832 | package com.acv.gallery;
import android.app.Application;
import android.content.Context;
import rx.Scheduler;
import rx.schedulers.Schedulers;
public class GalleryApplication extends Application {
private AppComponent appComponent;
private Scheduler defaultSubscribeScheduler;
@Override
public void onCreate() {
super.onCreate();
initAppComponent();
}
private void initAppComponent() {
appComponent = DaggerAppComponent.builder()
.appModule(new AppModule(this))
.build();
}
public static GalleryApplication get(Context context) {
return (GalleryApplication) context.getApplicationContext();
}
public AppComponent getAppComponent() {
return appComponent;
}
public Scheduler defaultSubscribeScheduler() {
if (defaultSubscribeScheduler == null) {
defaultSubscribeScheduler = Schedulers.io();
}
return defaultSubscribeScheduler;
}
//User to change scheduler from tests
public void setDefaultSubscribeScheduler(Scheduler scheduler) {
this.defaultSubscribeScheduler = scheduler;
}
} |
08c6c2d6-d857-49e7-8814-aa2644ca84a8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-29 15:41:52", "repo_name": "Irilia/Javacode", "sub_path": "/MyStack/src/daydata/GeneTest.java", "file_name": "GeneTest.java", "file_ext": "java", "file_size_in_byte": 1168, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "ed27be5313050141bc92fc464e6929d0f7a99321", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Irilia/Javacode | 255 | FILENAME: GeneTest.java | 0.262842 | package daydata;
import java.util.Arrays;
import java.util.Scanner;
public class GeneTest {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String str = in.nextLine();
int n = in.nextInt();
float[] floats = new float[str.length()-n+1];
char[] ch = str.toCharArray();
for (int i = 0; i < ch.length; i++) {
int count = 0;
for (int j = i; j < j+5; j++) {
if(ch[j] == 'G'||ch[j] == 'C'){
count++;
}
}
if(!(i>floats.length-1)){
floats[i] = count;
}
}
/*float tmp = floats[0];
int last = floats.length-1;
int first = 0;
while(first<last){
while(first<last){
if(floats[last]<tmp){
floats[first] = floats[last];
last--;
}
while(first<last){
if(floats[first] > floats[last]) {
floats[last] = floats[first];
first++;
}
}
}*/
}
}
|
ae93bb69-9afe-40eb-a84a-0438520e85b0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-23 07:45:19", "repo_name": "quanhengwen/rock_github", "sub_path": "/app/android_things/app/src/main/java/com/example/android_things/Io_list.java", "file_name": "Io_list.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "980ec5656c2f7cec6ed457741619fc03eb8ffb95", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/quanhengwen/rock_github | 199 | FILENAME: Io_list.java | 0.247987 | package com.example.android_things;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import com.google.android.things.pio.PeripheralManager;
import java.util.List;
public class Io_list extends Activity {
ListView io_list;
private ArrayAdapter<String> all_io;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_io_list);
io_list = findViewById(R.id.io_list);
PeripheralManager manager = PeripheralManager.getInstance();
List<String> deviceList = manager.getI2cBusList();
deviceList.addAll(manager.getSpiBusList());
deviceList.addAll(manager.getUartDeviceList());
deviceList.addAll(manager.getPwmList());
deviceList.addAll(manager.getGpioList());
all_io = new ArrayAdapter<>(this,android.R.layout.simple_list_item_1, deviceList);
io_list.setAdapter(all_io);
}
}
|
2a4a086b-90a6-4e1e-a457-2a8e06c30e21 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-20 08:04:15", "repo_name": "datmv123/trainning", "sub_path": "/J3.L.P0013.The-Suhi-Restaurant/J3.L.P0013/src/java/dal/IntroductionDAO.java", "file_name": "IntroductionDAO.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "0a9414bf82a9f928be7bfa20ed147e32ca568d06", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/datmv123/trainning | 198 | FILENAME: IntroductionDAO.java | 0.252384 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package dal;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import model.Introduction;
/**
*
* @author Drol
*/
public class IntroductionDAO extends BaseDAO {
public Introduction getIntroduction() throws Exception {
String sql = "select * from introduction";
Connection conn = getConnection();
PreparedStatement st = null;
ResultSet rs = null;
try {
st = conn.prepareStatement(sql);
rs = st.executeQuery();
while (rs.next()) {
Introduction ii = new Introduction();
ii.setImagePath(rs.getString("imagePath"));
return ii;
}
return null;
} catch (SQLException ex) {
throw ex;
} finally {
close(conn, st, rs);
}
}
}
|
d26615a3-4c5d-4437-8765-a726014f5bd0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-08-30T03:07:18", "repo_name": "crazywhalecc/CrazyWorld", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1728, "line_count": 42, "lang": "zh", "doc_type": "text", "blob_id": "4bbe368b643ee8265cff0519fdc8094a186b87fa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/crazywhalecc/CrazyWorld | 496 | FILENAME: README.md | 0.275909 | # CrazyWorld
a multiple feature world plugin for PocketMine-MP
Oh....
=====CrazyWorld多世界帮助=====<br>
作者: 鲸鱼 版权所有<br>
插件持续更新中,请加W系列群237043779获取最新版。<br>
本插件仅授权极致插件包转载!<br>
有bug欢迎反馈作者QQ:627577391<br>
=================<br>
命令:<br>
如果安装完输入/cw是英文的话,请先改为中文!<br>
==<br>
1.控制台输入/cw language ch (这个是改变语言为中文)<br>
2.控制台输入/cw admin 你的ID (这个是添加你为管理员)<br>
==<br>
/w [地图名]: 传送至某地图<br>
/w list: 查看服务器内所有地图<br>
/cw admin: 添加或删除管理员(仅限控制台)<br>
/cw load [地图名]: 加载已安装的地图<br>
/cw unload [地图名]: 卸载一个已加载的地图<br>
/setworld whitelist: 添加或删除一个世界的白名单<br>
/setworld chat [地图名]: 设置一个快速传送指令<br>
/cw delmap [地图名]: 删除一个地图的存档<br>
/cw protect [地图名]: 添加或删除一个保护的世界<br>
/cw banpvp: 设置禁止PVP的世界<br>
/cw oppvp: 允许或拒绝op在禁止pvp的世界pvp<br>
/cw lockgm: 锁定或解锁某个地图的游戏模式<br>
/cw fixname: 修复所有地图名字<br>
/cw setpos: 添加或删除一个传送点<br>
/mw [地图名] [类型]<br>
类型包括以下几种:<br>
default: 原生世界(类型后面需要输入种子)<br>
flat: 超平坦<br>
empty: 空白世界<br>
land: 普通地皮<br>
snowland: 雪地地皮<br>
woodflat: 平坦木头区<br>
<br>
注意:在切换语言为中文后,输入/cw 将会返回中文的提示,例如protect会变为保护,你也可以记为保护,都是通用的。<br>
|
dc0edf76-9fb0-4d5d-a674-50b5198a2dac | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-24 06:09:19", "repo_name": "lichunqiang/playground", "sub_path": "/app/src/main/java/lzuer/net/playground/ui/pringView/PringViewActivity.java", "file_name": "PringViewActivity.java", "file_ext": "java", "file_size_in_byte": 1169, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "a50872a69b5fbe6a7822b656499b2259b0eb3d5d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lichunqiang/playground | 243 | FILENAME: PringViewActivity.java | 0.272025 | package lzuer.net.playground.ui.pringView;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import lzuer.net.playground.R;
import lzuer.net.playground.ui.pringView.demo.Demo1Activity;
public class PringViewActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pring_view);
ButterKnife.bind(this);
}
@OnClick({R.id.springViewdemo1, R.id.springViewdemo2, R.id.springViewdemo3, R.id.springViewdemo4,
R.id.springViewdemo5, R.id.springViewdemo6, R.id.springViewdemo7, R.id.springViewWarningDemo,
R.id.springViewTestDemo})
void showDemo1(Button btn) {
Intent intent = new Intent();
switch (btn.getId()) {
case R.id.springViewdemo1:
intent.setClass(PringViewActivity.this, Demo1Activity.class);
break;
}
startActivity(intent);
}
}
|
e724fd77-a3c1-4a9c-9ef7-31e420fdb310 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-21 11:32:34", "repo_name": "skyaa13/extractor", "sub_path": "/src/main/java/com/company/extractor/entity/ControllerMethods.java", "file_name": "ControllerMethods.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "ed39a3d03b0bbe0f987a83b5c63ab6498af4dffa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/skyaa13/extractor | 228 | FILENAME: ControllerMethods.java | 0.247987 | package com.company.extractor.entity;
import java.lang.reflect.Method;
import java.util.List;
public class ControllerMethods {
private List<Method> getMethods;
private List<Method> postMethods;
private List<Method> putMethods;
private List<Method> patchMethods;
public List<Method> getGetMethods() {
return getMethods;
}
public void setGetMethods(List<Method> getMethods) {
this.getMethods = getMethods;
}
public List<Method> getPostMethods() {
return postMethods;
}
public void setPostMethods(List<Method> postMethods) {
this.postMethods = postMethods;
}
public List<Method> getPutMethods() {
return putMethods;
}
public void setPutMethods(List<Method> putMethods) {
this.putMethods = putMethods;
}
public List<Method> getPatchMethods() {
return patchMethods;
}
public void setPatchMethods(List<Method> patchMethods) {
this.patchMethods = patchMethods;
}
}
|
9110dfed-66f4-4b52-b4f1-b2aedc731c20 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-03-19 08:02:27", "repo_name": "tomdev2008/talkserver", "sub_path": "/src/net/ion/talk/account/Account.java", "file_name": "Account.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "3558dbd944b1e3b178634e2c632717f8e20b0ef4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tomdev2008/talkserver | 231 | FILENAME: Account.java | 0.272025 | package net.ion.talk.account;
import net.ion.talk.responsebuilder.TalkResponse;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
/**
* Created with IntelliJ IDEA.
* User: Ryun
* Date: 2014. 2. 20.
* Time: 오후 4:15
* To change this template use File | Settings | File Templates.
*/
public abstract class Account {
private final Type type;
private final String accountId;
public enum Type{
ConnectedUser, DisconnectedUser, NotFoundUser, Bot
}
public abstract Object onMessage(TalkResponse response) throws IOException, ExecutionException, InterruptedException;
public Type type(){
return type;
}
public String accountId(){
return accountId;
}
protected Account(String id, Type type) {
this.accountId = id;
this.type = type;
}
public static Account NotFoundUser = new Account("notFound", Type.NotFoundUser) {
@Override
public Object onMessage(TalkResponse s) {
return null;
}
};
}
|
316da443-5de9-4d7f-b669-1d56983c1dc6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-07 02:28:52", "repo_name": "szdksconan/cms", "sub_path": "/system-dao/src/main/java/com/cms/dao/maoyi/enterprise/impl/EnterQualifDaoImpl.java", "file_name": "EnterQualifDaoImpl.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "769227fda2470094f9a3e02a97b39d444e1f41a2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/szdksconan/cms | 249 | FILENAME: EnterQualifDaoImpl.java | 0.264358 | package com.cms.dao.maoyi.enterprise.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.cms.dao.maoyi.enterprise.EnterQualifDao;
import com.cms.mapper.maoyi.EnterpriseQualificationMapper;
import com.cms.model.maoyi.EnterpriseQualification;
import com.cms.model.maoyi.TradeImage;
@Repository
public class EnterQualifDaoImpl implements EnterQualifDao {
@Autowired
private EnterpriseQualificationMapper enterQualifMapper;
public void deleteQualif(Long id) {
enterQualifMapper.deleteQualif(id);
}
public void addQualif(EnterpriseQualification enterQualif) {
enterQualifMapper.addQualif(enterQualif);
}
public List<EnterpriseQualification> getAllQualif(Long id) {
return enterQualifMapper.getAllQualif(id);
}
public void updateQualif(EnterpriseQualification enterQualif) {
enterQualifMapper.updateQualif(enterQualif);
}
//拿到对应id的资质信息
public EnterpriseQualification getQualif(Long id) {
return enterQualifMapper.getQulif(id);
}
}
|
2e4ecedf-eb27-42af-a42a-638ff04a5a2e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-01 13:19:20", "repo_name": "Master0646/one-course", "sub_path": "/FINAL_ARCHIVE/one-course-server/src/onecourse/models/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "42b81fd66a799c2329158c33eda7a3ea5170d252", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Master0646/one-course | 223 | FILENAME: User.java | 0.224055 | package onecourse.models;
public class User {
private int id;
private String email;
private String password;
private String role;
public User() {
}
public User(String email, String password, String role) {
this.email = email;
this.password = password;
this.role = role;
}
public User(User user, int id) {
this.id = id;
this.email = user.email;
this.password = user.password;
this.role = user.role;
}
public int getId() {
return id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getUniqueValue() {
return this.getEmail();
}
}
|
63423d39-d89f-4b07-8e00-9510c5e55ed7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-15 18:50:53", "repo_name": "ClaireMeany/Android_Register_Login_Test", "sub_path": "/app/src/test/java/com/example/wildlifegps/testAddComment.java", "file_name": "testAddComment.java", "file_ext": "java", "file_size_in_byte": 1095, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "4eb2615796861908dbea53e14552f4a2b3bca2bd", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ClaireMeany/Android_Register_Login_Test | 222 | FILENAME: testAddComment.java | 0.29584 | package com.example.wildlifegps;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.textfield.TextInputEditText;
import junit.framework.TestCase;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.lang.reflect.Array;
import java.util.ArrayList;
public class testAddComment {
private String str = "Nice post!";
ArrayList<Comment> list = new ArrayList<>();
Comment comment1 = new Comment();
Comment comment2 = new Comment();
private Sighting sighting = new Sighting();
@Before
public void setUp(){
comment1.setComment(str);
comment2.setComment("nice");
list.add(0, comment2);
list.add(1, comment1);
sighting.setComments(list);
}
@Test
public void TestThis(){
Assert.assertEquals(list, sighting.getComments());
Assert.assertNotSame(str, comment2.getComment());
}
@After
public void tearDown(){
}
}
|
97ee70b4-f68d-48e8-818e-0cf626fb250c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-07 16:11:31", "repo_name": "vivian8725118/SeeMore", "sub_path": "/app/src/main/java/com/vivian/seemoredemo/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1169, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "74a51182a9419a9b69e756eff6f431eff90b136d", "star_events_count": 22, "fork_events_count": 4, "src_encoding": "UTF-8"} | https://github.com/vivian8725118/SeeMore | 209 | FILENAME: MainActivity.java | 0.249447 | package com.vivian.seemoredemo;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import com.vivian.seemore.SeeMoreAdapter;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
RecyclerView mRecyclerView;
SeeMoreAdapter mAdapter;
List<Item> mList = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.recyclerview);
initSeeMoreRecyclerView();
}
void initSeeMoreRecyclerView(){
mRecyclerView = findViewById(R.id.recyclerview);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
mAdapter = new SeeMoreItemAdapter(this);
for (int i = 0; i < 3; i++) {
Item item = new Item();
item.title = "this is item" + i;
mList.add(item);
}
mAdapter.setmList(mList);
mRecyclerView.setAdapter(mAdapter);
}
}
|
daabf4eb-1ee4-4b5f-a47c-0e2cc56aff06 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2008-11-23 13:05:50", "repo_name": "codehaus/agilifier", "sub_path": "/src/test/com/stuffedgiraffe/agilifier/MicroTests.java", "file_name": "MicroTests.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "5a73c02c9fab48fe07a3e70970a11b29e0aded90", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/codehaus/agilifier | 229 | FILENAME: MicroTests.java | 0.272025 | package com.stuffedgiraffe.agilifier;
import junit.framework.TestSuite;
import org.apache.tools.ant.DirectoryScanner;
import java.io.File;
public class MicroTests extends TestSuite {
public static TestSuite suite() throws Throwable {
TestSuite suite = new TestSuite();
File projectRoot = new File("./src/test/");
DirectoryScanner scanner = new DirectoryScanner();
scanner.setBasedir(projectRoot);
String[] includedTests = new String[]{"**/*Test.java"};
String[] excludedTests = new String[]{"**/JUnitAcceptanceTest.java"};
scanner.setIncludes(includedTests);
scanner.setExcludes(excludedTests);
scanner.scan();
String[] files = scanner.getIncludedFiles();
for (int i = 0; i < files.length; i++) {
String s = files[i];
String className = s.substring(0, s.length() - 5).replace(File.separatorChar, '.');
suite.addTestSuite(Class.forName(className));
}
suite.setName("Micro Tests (" + suite.countTestCases() + " tests)");
return suite;
}
}
|
113f1f84-6102-4ab8-ae56-ffdda6aad605 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-02 09:50:43", "repo_name": "whywuzeng/leyou", "sub_path": "/ly-search/src/test/java/com/leyou/search/client/ElasticsearchTest.java", "file_name": "ElasticsearchTest.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "9ef8f7d618a259626a537f1bd0300d8f0912986a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/whywuzeng/leyou | 220 | FILENAME: ElasticsearchTest.java | 0.205615 | package com.leyou.search.client;
import com.leyou.search.pojo.Goods;
import com.leyou.search.repository.GoodsRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import org.springframework.test.context.junit4.SpringRunner;
/**
* Created by Administrator on 2020/2/18.
* <p>
* by author wz
* <p>
* com.leyou.search.client
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class ElasticsearchTest {
@Autowired
private GoodsRepository goodsRepository;
@Autowired
private ElasticsearchTemplate elasticsearchTemplate;
@Test
public void createIndex(){
//创建索引
this.elasticsearchTemplate.createIndex(Goods.class);
// 配置映射
this.elasticsearchTemplate.putMapping(Goods.class);
}
@Test
public void deleteIndex(){
this.elasticsearchTemplate.deleteIndex(Goods.class);
}
}
|
3ac1c183-2a0a-44d6-abcd-1f2485dd55a0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-20 08:47:29", "repo_name": "haltp/variable", "sub_path": "/Variable/src/variable6/Member.java", "file_name": "Member.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "93696ac2677095395db7deea255706c03a6557ab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/haltp/variable | 250 | FILENAME: Member.java | 0.26971 | package variable6;
public class Member {
private int num;
private String name;
private String phone;
private String className;
public Member() {
}
public Member(int num, String name) {
super();
this.num = num;
this.name = name;
}
public Member(int num, String name, String phone, String className) {
this.num = num;
this.name = name;
this.phone = phone;
this.className = className;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
@Override
public String toString() {
return "Member [num=" + num + ", name=" + name + ", phone=" + phone + ", className=" + className + "]";
}
}
|
da9736fb-eeb7-4d13-89a2-775ce4372b6c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-27 18:22:07", "repo_name": "fssantana/vertgo", "sub_path": "/src/main/java/io/github/fssantana/vertgo/response/LambdaResponseMessageCodec.java", "file_name": "LambdaResponseMessageCodec.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "38438caa377fe3ba86361c33c37e1bff1b4b886d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fssantana/vertgo | 255 | FILENAME: LambdaResponseMessageCodec.java | 0.273574 | package io.github.fssantana.vertgo.response;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.eventbus.MessageCodec;
import io.vertx.core.json.JsonObject;
public class LambdaResponseMessageCodec implements MessageCodec<LambdaResponse, LambdaResponse> {
@Override
public void encodeToWire(Buffer buffer, LambdaResponse lambdaResponse) {
JsonObject jsonToEncode = JsonObject.mapFrom(lambdaResponse);
String jsonToStr = jsonToEncode.encode();
int length = jsonToStr.getBytes().length;
buffer.appendInt(length);
buffer.appendString(jsonToStr);
}
@Override
public LambdaResponse decodeFromWire(int position, Buffer buffer) {
int _pos = position;
int length = buffer.getInt(_pos);
String jsonStr = buffer.getString(_pos += 4, _pos += length);
JsonObject contentJson = new JsonObject(jsonStr);
return contentJson.mapTo(LambdaResponse.class);
}
@Override
public LambdaResponse transform(LambdaResponse customMessage) {
return customMessage;
}
@Override
public String name() {
return this.getClass().getSimpleName();
}
@Override
public byte systemCodecID() {
return -1;
}
} |
a1c23f5d-8854-492e-a655-70f4019f2b33 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-11 03:48:27", "repo_name": "FutureComeIn/vaction-web", "sub_path": "/vactionWeb/src/com/yxw/bean/GoodOrder.java", "file_name": "GoodOrder.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 67, "lang": "en", "doc_type": "code", "blob_id": "195b8f9578ff018fb4d4c0f01477f83bc78f6ff7", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "GB18030"} | https://github.com/FutureComeIn/vaction-web | 341 | FILENAME: GoodOrder.java | 0.286169 | package com.yxw.bean;
/**
* 8.商品订单表(编号,买家编号,总价,购买日期)
* @author Administrator
*
*/
public class GoodOrder {
private int gono;
private int gouno;
private double goprice;
private String godate;
public GoodOrder() {
super();
}
public GoodOrder(int gono, int gouno, double goprice, String godate) {
super();
this.gono = gono;
this.gouno = gouno;
this.goprice = goprice;
this.godate = godate;
}
public int getGono() {
return gono;
}
public void setGono(int gono) {
this.gono = gono;
}
public int getGouno() {
return gouno;
}
public void setGouno(int gouno) {
this.gouno = gouno;
}
public double getGoprice() {
return goprice;
}
public void setGoprice(double goprice) {
this.goprice = goprice;
}
public String getGodate() {
return godate;
}
public void setGodate(String godate) {
this.godate = godate;
}
@Override
public String toString() {
return "GoodOrder [godate=" + godate + ", gono=" + gono + ", goprice="
+ goprice + ", gouno=" + gouno + "]";
}
}
|
18088e7a-a429-49a1-ba31-7bff676a63fe | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-08-21T03:20:57", "repo_name": "zongeva/hotnspicy", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1033, "line_count": 60, "lang": "en", "doc_type": "text", "blob_id": "d8dc9a06c3ebffda5d20774fb1728b4efbbee702", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zongeva/hotnspicy | 327 | FILENAME: README.md | 0.290981 | # hotnspicy
TCP/IP Assignment with Dr Anang
<h1> Group Member </h1>
1112702444 Ahmad Saifuddin
1112700661 Kok Pin Zong
<h2> Task That Have Been Carried Out </h2>
1. Create Github Account and Install Git
2. launch Git Bash
3. Moving to Folders
4. Create Folder and File
5. Git Respitory
6. Status Update
7. Staging
8. Committing
9. updating Git about Github
10. A Push or A Shove
<h2>Work Distribution</h2>
All work distribution are equally divided among members
<h2>codes<h2/>
```c++
#include <stdio.h>
#include <string.h>
int main(int argc, const char * argv[])
{
FILE *fp;
char returnData[64];
fp = popen("/sbin/ifconfig eth0", "r");
while (fgets(returnData, 63, fp) != NULL)
{
if (returnData[0] == '\n') {
continue;
}
char no1[60], no2[60];
strcpy(no1, strtok(returnData, " "));
if (strcmp("inet", no1) != 0) {
continue;
}
strcpy(no2, strtok(NULL, " "));
printf("%s %s\n", no1, no2);
}
return 0;
}
```
|
f2dea311-58d1-464a-b4df-c004a297ea27 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-20 03:26:46", "repo_name": "15274453161/springboot_fileUpload", "sub_path": "/src/main/java/com/qgh/spring_mvc/common/util/TextUtils.java", "file_name": "TextUtils.java", "file_ext": "java", "file_size_in_byte": 1277, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "9b77cff73fe0d92f53282d6de6d60866b489b26d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/15274453161/springboot_fileUpload | 254 | FILENAME: TextUtils.java | 0.256832 | package com.qgh.spring_mvc.common.util;
import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
/**
* created by zhuwenquan on 2019/11/1
* 文本工具
*/
public class TextUtils {
/**
* 手机号码处理
* @param phone 原始string
* @param stringBuffer 返回信息
* @return true:返回处理结果;false:返回错误原因
*/
public static boolean toPhoneNb(String phone, StringBuffer stringBuffer ){
try {
stringBuffer.setLength(0);
if (StringUtils.isBlank(phone)) {
stringBuffer.append("手机号码不能为空!");
return false;
}
phone = phone.replaceAll(" ", "");
BigDecimal phoneBd = new BigDecimal(phone);
phone = phoneBd.toPlainString();
phone = phone.replaceAll("\\.00", "");
if (!PhoneUtils.isPhone(phone)) {
stringBuffer.append("手机号码不正确!");
return false;
}else {
stringBuffer.append( phone );
return true;
}
} catch (Exception e) {
stringBuffer.append("手机号码不正确!" + e.getMessage());
return false;
}
}
}
|
f579cec2-12ed-454f-80dc-34ef4d8b8d05 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-20 16:46:38", "repo_name": "thjen/CustomListViewImage", "sub_path": "/app/src/main/java/com/example/qthjen/customlistviewimage/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1100, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "b27f248daa70ea950f2a9b81044595f9d1bc6484", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/thjen/CustomListViewImage | 256 | FILENAME: MainActivity.java | 0.268941 | package com.example.qthjen.customlistviewimage;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
public ListView lv;
public ArrayList<MonAn> mangMonAn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lv = (ListView) findViewById(R.id.lv);
mangMonAn = new ArrayList<MonAn>();
mangMonAn.add(new MonAn("My wife 1: ", 0, R.drawable.im5));
mangMonAn.add(new MonAn("My wife 2: ", 1, R.drawable.im1));
mangMonAn.add(new MonAn("My wife 3: ", 2, R.drawable.im2));
mangMonAn.add(new MonAn("My wife 4: ", 3, R.drawable.im3));
mangMonAn.add(new MonAn("My wife 5: ", 4, R.drawable.im4));
CustomMonAn customMonAn = new CustomMonAn(
MainActivity.this,
R.layout.list_monan,
mangMonAn);
lv.setAdapter(customMonAn);
}
}
|
232ceeda-69db-4ddd-96cc-2478aad25f08 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-08 07:47:10", "repo_name": "fewoy/groovy-dynamic-code", "sub_path": "/groovy-dynamic/src/main/java/com/alipay/mcenter/core/engine/aengine/enums/EntityTypeEnum.java", "file_name": "EntityTypeEnum.java", "file_ext": "java", "file_size_in_byte": 1145, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "568f3671185e7c723c9b7b6855ef686935456bef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fewoy/groovy-dynamic-code | 306 | FILENAME: EntityTypeEnum.java | 0.272799 | /**
* Alipay.com Inc.
* Copyright (c) 2004-2017 All Rights Reserved.
*/
package com.alipay.mcenter.core.engine.aengine.enums;
import java.io.Serializable;
/**
* 实体类别枚举
* @author chingsung.zihong
* @version $Id: 2017-05-11 $
*/
public enum EntityTypeEnum implements Serializable {
/** sofa的bean对象 */
SOFABEAN("SOFA_BEAN", "sofa的bean对象"),
/** 静态类 */
STATIC("STATIC", "静态类"),
/** 引用类 */
IMPOTS("IMPOTS", "引用类"),
;
/** 说明 */
private String code;
private String desc;
/**
* CT
*/
private EntityTypeEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
public static EntityTypeEnum getByCode(String code) {
for (EntityTypeEnum e : EntityTypeEnum.values()) {
if (e.getCode().equalsIgnoreCase(code)) {
return e;
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
|
ff44ea18-d7b2-4c74-bc0c-3ec2eec5e3fe | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-27 17:29:37", "repo_name": "DerYeger/Project_RBSG", "sub_path": "/src/main/java/de/uniks/se19/team_g/project_rbsg/ingame/state/GameEventConfig.java", "file_name": "GameEventConfig.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "017968d83086d07c2ffe4af0b18762db9ff45890", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DerYeger/Project_RBSG | 184 | FILENAME: GameEventConfig.java | 0.252384 | package de.uniks.se19.team_g.project_rbsg.ingame.state;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import java.util.Map;
@Configuration
public class GameEventConfig {
@Bean
@Scope("prototype")
public GameEventDispatcher gameEventDispatcher(
ApplicationContext context
) {
Map<String, GameEventDispatcher.Adapter> adapterMap = context.getBeansOfType(GameEventDispatcher.Adapter.class);
Map<String, GameEventDispatcher.Listener> listenerMap = context.getBeansOfType(GameEventDispatcher.Listener.class);
GameEventDispatcher gameEventDispatcher = new GameEventDispatcher();
adapterMap.forEach((s, adapter) -> gameEventDispatcher.addAdapter(adapter));
listenerMap.forEach((s, listener) -> gameEventDispatcher.addListener(listener));
return gameEventDispatcher;
}
}
|
4b592f5a-8333-40b2-b449-25c78e26f76e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-27 12:24:13", "repo_name": "wangxuangege/some-code", "sub_path": "/introspector/src/main/java/com/wx/somecode/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "a31b6ceb68edd6bccd29d80072303559de92bc72", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/wangxuangege/some-code | 225 | FILENAME: User.java | 0.256832 | package com.wx.somecode;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
/**
* @author xinquan.huangxq
*/
public class User {
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
private String name;
private String a = "2";
public void addPropertyChangeListener(PropertyChangeListener listener) {
this.pcs.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
this.pcs.removePropertyChangeListener(listener);
}
public String getAAA() {
return a;
}
public void setAAA(String a) {
String old = this.a;
this.a = a;
this.pcs.firePropertyChange("a", old == null ? "null" : old, this.a);
}
public String getName() {
return name;
}
public void setName(String name) {
String old = this.name;
this.name = name;
this.pcs.firePropertyChange("name", old == null ? "null" : old, this.name);
}
}
|
929b4f3b-19c9-4e20-a5c0-65b525712982 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-13 10:24:30", "repo_name": "yyyyqq/recse", "sub_path": "/security/src/main/java/com/recse4cloud/security/DefaultHttpSecurityConfigure.java", "file_name": "DefaultHttpSecurityConfigure.java", "file_ext": "java", "file_size_in_byte": 1108, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "9a2ac5ffd4192b766ff33e38186abab3bf792977", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yyyyqq/recse | 197 | FILENAME: DefaultHttpSecurityConfigure.java | 0.20947 | package com.recse4cloud.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.access.AccessDeniedHandler;
public class DefaultHttpSecurityConfigure implements IHttpSecurityConfigure {
@Autowired
AccessDeniedHandler accessDeniedHandler;
/**
* 配置security的认证
*
* @param http
*/
@Override
public void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
// http.cors().configurationSource(request-> new CorsConfiguration());
http.headers().frameOptions().disable();
http.exceptionHandling().accessDeniedHandler(accessDeniedHandler).authenticationEntryPoint(new RestAuthenticationEntryPoint());
// http.authorizeRequests().anyRequest().permitAll();
http.authorizeRequests().anyRequest().authenticated()
.and().logout().clearAuthentication(true).invalidateHttpSession(true)
.and().formLogin().successForwardUrl("/");
}
}
|
f5e28782-8220-423d-99a1-85221d6c2359 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-21 02:38:06", "repo_name": "jiayonghua1988/Circle", "sub_path": "/app/src/main/java/yhjia/com/circle/adapter/ListPopupWindowAdapter.java", "file_name": "ListPopupWindowAdapter.java", "file_ext": "java", "file_size_in_byte": 1169, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "59af8e23f0b44f54e5640c299755e93612cc20b6", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/jiayonghua1988/Circle | 246 | FILENAME: ListPopupWindowAdapter.java | 0.290981 | package yhjia.com.circle.adapter;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.yhjia.me.adapter.FBaseAdapter;
import java.util.List;
import yhjia.com.circle.activity.R;
/**
* Created e on 16/7/21.
* @author jiayonghua
*/
public class ListPopupWindowAdapter extends FBaseAdapter<String>{
public ListPopupWindowAdapter(Context context, List<String> list) {
super(context, list);
}
@Override
public int settingDefaultPicture() {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
HolderView holderView = null;
if (convertView == null) {
convertView = inflater.inflate(R.layout.item_list_popup,null);
holderView = new HolderView();
holderView.tvContent1 = (TextView) convertView.findViewById(R.id.tvLabel);
convertView.setTag(holderView);
} else {
holderView = (HolderView) convertView.getTag();
}
holderView.tvContent1.setText(list.get(position));
return convertView;
}
}
|
c7045e7a-98ba-46cb-ac25-bd0d9d892fa9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-04-25 19:09:20", "repo_name": "TheRadikalStyle/Metrans--nw", "sub_path": "/src/com/metrans/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "e5c787e91c18f01463b45a17fe5186b8a069dfd0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/TheRadikalStyle/Metrans--nw | 221 | FILENAME: MainActivity.java | 0.233706 | package com.metrans;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
/** Called when the user clicks the start button */
public void goToWareHouse(View view) {
Intent intent = new Intent(this, RequestWarehouse.class);
startActivity(intent);
}
/** Called when the user clicks the about button */
public void goToAbout(View view) {
Intent intent = new Intent(this, About.class);
startActivity(intent);
}
/** Called when the user clicks the help button */
public void goToHelp(View view) {
Intent intent = new Intent(this, Help.class);
startActivity(intent);
}
}
|
73c79c2d-e5d1-41ff-9058-c0097e01da3a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2010-12-13 21:20:38", "repo_name": "ryanswanstrom/Software-Logger", "sub_path": "/app/models/Project.java", "file_name": "Project.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "929fcfab43147393367347d6d3cba7f5fc9a04f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ryanswanstrom/Software-Logger | 204 | FILENAME: Project.java | 0.247987 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package models;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import play.data.validation.Required;
/**
*
* @author GooF
*/
@Entity
public class Project extends SwloggerModel {
@Required
public String title;
public String description;
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL)
public List<LogMessage> messages;
@OneToMany(mappedBy="project",cascade=CascadeType.ALL)
public List<UserProject> userProjects;
public Project() {
this("Default", "No Description");
}
public Project(String title, String desc) {
this.userProjects = new ArrayList<UserProject>();
this.title = title;
this.description = desc;
}
@Override
public String toString() {
return this.title;
}
}
|
b145c6d9-0007-419d-bdad-cbfac21002a9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-21T11:09:07", "repo_name": "Saifahmedprogrminlocallang/Programinlocallang", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1037, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "a44c34a4a9203de98a05e46ce428ff8fa284e4a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Saifahmedprogrminlocallang/Programinlocallang | 249 | FILENAME: README.md | 0.256832 | pickala pickala ping ping - pickala pickala ping ping -
pickala pickala ping -
have to ping it - pong it - ping pong it -
art to programming - made it with all my heart and effort. ..-..
may contain some mistakes, i have written the code and am uploading the source code images.
# Programinlocallang
A Java project to program in local language. This project contains the source code.
Put all the text files and Inputfile.java in D:\Saif\LocallangProgram.
Run the jar file with the cmd - java -jar Programinlocallang.jar
The BhashaVarthaMapper.java file contains 3 input sections and 1 processing and 1 output section -
1. Read the Inputfile.java from input folder.
2. Read the Keyword.txt and make a hashtable
3. Read the locallanguagekeyword.txt and make a hashtable
4. Read the ApiMapper.txt and make hashtable
5. Replace the local language keywords by the computer language keywords.
Replace the local language api wih the api.
6. Write Outputbinaryfile.dat in input folder.
Input folder - D:\Saif\LocallangProgram.
|
005b61fd-e50e-4f47-911f-ae8244585365 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-06-24T20:12:05", "repo_name": "lbartroli/webpack-es6-static", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1036, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "57297f39fb3c2197095d6e41c054d830bc5f50e9", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lbartroli/webpack-es6-static | 252 | FILENAME: README.md | 0.2227 | # Webpack - ES6 - Express - Mongoose - Bootstrap
## Boilerplate for static pages
I've been looking for a boilerplate like this one for so long, but none fit my needs, so I decided to build my own boilerplate.
Maybe it will be useful for you too.
Feel free to send any recommendation or doubt to my [email](mailto:lgbartroli@gmail.com).
>### Run webpack-dev-server with HMR ***(on localhost:3000)***
```
$ npm start
```
>### Build and run files for production ***(on localhost:8080)***
```
$ npm run start:prod
```
>+ Configure your MongoDB settings in ***/backend/config/db.js***
>+ Configure your Express settings in ***/backend/config/express.js***
>+ Configure your Server settings in ***/backend/config/server.js***
>+ Add your modules inside ***/backend/mdoules*** and configure them in ***/backend/router.js***
>+ This Boilerplate use *Swig* with *Consolidate*, so you need to add your views inside ***/frontend/src/views***
>+ Your webpack entry files, should be included inside ***/frontend/src/modules***
## Enjoy. |
a4d93ee2-65a0-4fd4-bfc9-f6986ca903c2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-11-23 11:00:18", "repo_name": "VolmitSoftware/Mortar", "sub_path": "/src/main/java/mortar/api/tome/TomeMeta.java", "file_name": "TomeMeta.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 68, "lang": "en", "doc_type": "code", "blob_id": "6478b52bca9a12a67ca5073061c2bfdbf2bca387", "star_events_count": 3, "fork_events_count": 7, "src_encoding": "UTF-8"} | https://github.com/VolmitSoftware/Mortar | 243 | FILENAME: TomeMeta.java | 0.253861 | package mortar.api.tome;
import org.dom4j.Attribute;
import org.dom4j.Element;
import org.dom4j.Node;
public class TomeMeta extends TomeComponent
{
private String property;
private String value;
public TomeMeta()
{
this("", "");
}
public TomeMeta(String property, String value)
{
this.property = property;
this.value = value;
}
@Override
public void read(Node thisElement)
{
Element e = (Element) thisElement;
for(Attribute i : e.attributes())
{
if(i.getName().equals("property"))
{
setProperty(i.getStringValue());
}
}
setValue(e.getText());
}
@Override
public void construct(Element parent)
{
Element section = parent.addElement("meta");
section.addAttribute("property", getProperty());
section.setText(getValue());
}
public String getProperty()
{
return property;
}
public void setProperty(String property)
{
this.property = property;
}
public String getValue()
{
return value;
}
public void setValue(String value)
{
this.value = value;
}
}
|
b0ed456e-6b13-4927-8708-8a56a696fbef | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-12 10:24:44", "repo_name": "homna/GuessTheCelebrity", "sub_path": "/app/src/main/java/com/example/guessthecelebrity/DownloadImageFromUrl.java", "file_name": "DownloadImageFromUrl.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "12f340f03df9e015229e1792699f070e90f7a372", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/homna/GuessTheCelebrity | 190 | FILENAME: DownloadImageFromUrl.java | 0.272799 | package com.example.guessthecelebrity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.util.Log;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class DownloadImageFromUrl extends AsyncTask<String, Void, Bitmap> {
@Override
protected Bitmap doInBackground(String... urls) {
Bitmap image = null;
HttpURLConnection httpURLConnection;
InputStream inputStream;
try {
Log.i("HTML_ImageUrl", "url " + urls[0]);
URL imageUrl = new URL(urls[0]);
httpURLConnection = (HttpURLConnection) imageUrl.openConnection();
httpURLConnection.connect();
inputStream = httpURLConnection.getInputStream();
image = BitmapFactory.decodeStream(inputStream);
httpURLConnection.disconnect();
return image;
} catch (Exception e) {
Log.i("HTML_Error_DImageClass", e.getMessage());
return null;
}
}
}
|
40e33d6c-3a4b-4685-a1a2-5e7559ab6ce0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-25 14:00:22", "repo_name": "aliabusaleh/MicroservicesDemo", "sub_path": "/api-gateway-service/src/main/java/com/example/demo/GatewayFilter.java", "file_name": "GatewayFilter.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "1fceba3ecd24866f99227f0d1bf11c5e11b64b0a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aliabusaleh/MicroservicesDemo | 207 | FILENAME: GatewayFilter.java | 0.226784 | package com.example.demo;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
public class GatewayFilter extends ZuulFilter {
private static final Logger LOG = LoggerFactory.getLogger(GatewayFilter.class);
@Override
public String filterType() {
return "pre";
//return "pre";
//return "post";
//return "error";
}
@Override
public int filterOrder() {
return 0;
}
@Override
public boolean shouldFilter() {
return true;
}
@Override
public Object run() throws ZuulException {
HttpServletRequest request =
RequestContext.getCurrentContext().getRequest();
LOG.info(request.getQueryString());
LOG.info("request -> {} request Uri -> {}",request,request.getRequestURI());
return null;
}
}
|
47e5b9ef-6128-42ad-9757-94509c383eb6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-03 08:11:32", "repo_name": "martinwen/AndroidModuleDemo", "sub_path": "/module_main/src/main/java/com/wss/module/main/ui/page/CustomViewActivity.java", "file_name": "CustomViewActivity.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "a032063a631b24a50a4c93de56964426d65e33e4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/martinwen/AndroidModuleDemo | 282 | FILENAME: CustomViewActivity.java | 0.250913 | package com.wss.module.main.ui.page;
import android.widget.TextView;
import com.wss.common.base.BaseActionBarActivity;
import com.wss.common.base.mvp.BasePresenter;
import com.wss.module.main.R;
import com.wss.module.main.R2;
import com.wss.module.main.ui.view.VerificationCodeView;
import butterknife.BindView;
/**
* Describe:自定义View展示页
* Created by 吴天强 on 2020/8/27.
*/
public class CustomViewActivity extends BaseActionBarActivity {
@BindView(R2.id.vc_code)
VerificationCodeView vcCode;
@BindView(R2.id.tv_vc_code)
TextView tvVcCode;
@Override
protected BasePresenter createPresenter() {
return null;
}
@Override
protected int getLayoutId() {
return R.layout.main_activity_custom_view;
}
@Override
protected void initView() {
setCenterText("自定义View展览区");
vcCode.addOnCodeChangeListener(code -> tvVcCode.setText(String.format("验证码是:%s", code)));
tvVcCode.setText(String.format("验证码是:%s", vcCode.getText()));
}
@Override
protected void onDestroy() {
super.onDestroy();
if (vcCode != null) {
vcCode.destroy();
}
}
}
|
83c6ccb0-2cf4-4a16-8a49-94735787cfe9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-25 15:10:25", "repo_name": "ag-piyush/to-do-backend", "sub_path": "/src/main/java/com/example/todobackend/controllers/TodoController.java", "file_name": "TodoController.java", "file_ext": "java", "file_size_in_byte": 1103, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "2ecd2862bee4c145d7067a6b17a83a9a5cfe05ef", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/ag-piyush/to-do-backend | 228 | FILENAME: TodoController.java | 0.247987 | package com.example.todobackend.controllers;
import com.example.todobackend.model.Todo;
import com.example.todobackend.repository.TodoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@CrossOrigin(origins = "https://to-do-piyush.netlify.app")
@RestController
@RequestMapping("/todo")
public class TodoController {
private final TodoRepository todoRepository;
@Autowired
public TodoController(TodoRepository todoRepository) {
this.todoRepository = todoRepository;
}
@GetMapping
public List<Todo> getTodos() {
return this.todoRepository.findAll();
}
@GetMapping("/{id}")
public Todo getTodo(@PathVariable("id") String id) {
return this.todoRepository.findById(id).get();
}
@PostMapping
public Todo saveTodo(@RequestBody Todo todo) {
return this.todoRepository.save(todo);
}
@DeleteMapping("/{id}")
public void deleteTodo(@PathVariable("id") String id) {
this.todoRepository.deleteById(id);
}
}
|
5c0e1de1-88e6-4093-ad67-dd9dc4f2eaa9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-03 14:23:03", "repo_name": "olafo7/typhoon", "sub_path": "/portal/src/main/java/org/chencc/service/impl/AssetsBaseSetServiceImpl.java", "file_name": "AssetsBaseSetServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1170, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "02614515095a6796d7ad1ae021062c07befdd265", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/olafo7/typhoon | 260 | FILENAME: AssetsBaseSetServiceImpl.java | 0.261331 | package org.chencc.service.impl;
import org.chencc.mapper.AssetsBaseSetMapper;
import org.chencc.model.AssetsBaseDropdown;
import org.chencc.service.AssetsBaseSetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @Description
* @author:chencc
* @Date:2018/7/23
* @Time:下午6:27
*/
@Service
@Transactional
public class AssetsBaseSetServiceImpl implements AssetsBaseSetService {
@Autowired
private AssetsBaseSetMapper assetsBaseSetMapper;
@Override
public List<AssetsBaseDropdown> getDropdownByType(Integer type) {
return assetsBaseSetMapper.getDropdownByType(type);
}
@Override
public void saveEditRecord(Integer type, String value, Integer id) {
assetsBaseSetMapper.saveEditRecord(type,value,id);
}
@Override
public void saveNewRecord(Integer type, String value) {
assetsBaseSetMapper.saveNewRecord(type,value);
}
@Override
public void deleteRecord(Integer id) {
assetsBaseSetMapper.deleteRecord(id);
}
}
|
df000725-40f1-4a45-80e3-988a05d276a2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-31 04:09:55", "repo_name": "WarsFeng/SpringBoog_Sell", "sub_path": "/src/main/java/shop/warscat/sell/model/ProductInfo.java", "file_name": "ProductInfo.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "9751bb6a9294142a822da020b10dc19bfdbbf115", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/WarsFeng/SpringBoog_Sell | 250 | FILENAME: ProductInfo.java | 0.247987 | package shop.warscat.sell.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import shop.warscat.sell.enums.ProductStatusEnmu;
import shop.warscat.sell.utils.EnumUtils;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;
/**
* Created with IntelliJ IDEA.
* Description: 商品信息
* User: wars
* Date: 2018-03-21
* Time: 00:19
*/
@Data
@Entity
public class ProductInfo {
@Id
private String productId;
/**名称*/
private String productName;
/**单价*/
private BigDecimal productPrice;
/**库存*/
private Integer productStock;
/**描述*/
private String productDescription;
/**小图*/
private String productIcon;
/**状态 0正常1下架*/
private Integer productStatus;
/**类目编号*/
private Integer categoryType;
private Date createTime;
private Date updateTime;
@JsonIgnore
public String getProductStatusEnum(){
return Objects.requireNonNull(EnumUtils.getByCode(productStatus, ProductStatusEnmu.class)).getMassage();
}
}
|
f11e624e-c259-4e2a-a533-d1e35c9b1a9f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-27 12:28:22", "repo_name": "neramirez/ikigai", "sub_path": "/security/src/main/java/ikigai/service/IkigaiUserDetailsService.java", "file_name": "IkigaiUserDetailsService.java", "file_ext": "java", "file_size_in_byte": 1169, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "f9bfa2f03dc5b60fb93783e502c8e111d30eee0e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/neramirez/ikigai | 192 | FILENAME: IkigaiUserDetailsService.java | 0.250913 | package ikigai.service;
import ikigai.IkigaiUserDetails;
import ikigai.entity.Admin;
import ikigai.repository.AdminRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class IkigaiUserDetailsService implements UserDetailsService {
@Autowired
private AdminRepository adminRepository;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
Admin admin = adminRepository.findByEmail(username).orElseThrow();
return IkigaiUserDetails.builder()
.adminId(admin.getId())
.password(admin.getPassword())
.username(admin.getEmail())
.authorities(List.of(new SimpleGrantedAuthority("ROLE_ADMIN")))
.build();
}
}
|
f45f53e2-9a21-4ee3-9ec1-08444b2e3c81 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-28 12:04:25", "repo_name": "jieyu2333/springboot-mybatisplus-jwt-redis", "sub_path": "/src/main/java/com/study/config/jwt/JwtInterceptor.java", "file_name": "JwtInterceptor.java", "file_ext": "java", "file_size_in_byte": 1188, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "b36adf256dcaa90a9dc84dba697aab194da2bf16", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jieyu2333/springboot-mybatisplus-jwt-redis | 209 | FILENAME: JwtInterceptor.java | 0.208179 | package com.study.config.jwt;
import com.study.exception.MyException;
import com.study.sys.mapper.UserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Slf4j
@Component
public class JwtInterceptor extends HandlerInterceptorAdapter {
@Autowired
private UserMapper userMapper;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
response.setCharacterEncoding("utf-8");
//验证路径是否存在
if (!(handler instanceof HandlerMethod)){
throw new MyException(1,"path doesn't exist");
}
String token = request.getHeader("accessToken");
if (null == token){
throw new MyException(1,"token is null");
}
//验证token
JwtUtils.verifyToken(token);
return true;
}
}
|
6a80a47b-27b4-4446-9b90-965d7ac98bf0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-14 10:14:20", "repo_name": "LuisEngelniederhammer/styx", "sub_path": "/Core/src/main/java/net/petafuel/styx/core/xs2a/oauth/serializers/EndpointsSerializer.java", "file_name": "EndpointsSerializer.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "dd45afc41322ca039cf024790f2e61804520755a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LuisEngelniederhammer/styx | 207 | FILENAME: EndpointsSerializer.java | 0.250913 | package net.petafuel.styx.core.xs2a.oauth.serializers;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonObject;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class EndpointsSerializer implements JsonDeserializer<HashMap> {
@Override
public HashMap<String, String> deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
HashMap<String, String> endpoints = new HashMap<>();
JsonObject object = jsonElement.getAsJsonObject();
object.entrySet().iterator();
Iterator<Map.Entry<String, JsonElement>> iterator = object.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, JsonElement> item = iterator.next();
endpoints.put(item.getKey(), item.getValue().toString().replaceAll("^\"|\"$", ""));
}
return endpoints;
}
}
|
a27b40f9-6f0f-4747-b11d-0bcf7853ff65 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-04 11:53:31", "repo_name": "verginiaa/Leetcode", "sub_path": "/Leetcode9/src/PalindromeLinkedList.java", "file_name": "PalindromeLinkedList.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "7ebbb8a7d65e04909a7bb9218eef30e0f0f28a21", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/verginiaa/Leetcode | 189 | FILENAME: PalindromeLinkedList.java | 0.280616 | import java.util.Stack;
public class PalindromeLinkedList {
public class ListNode {
int val;
ListNode next;
ListNode() {}
ListNode(int val) { this.val = val; }
ListNode(int val, ListNode next) { this.val = val; this.next = next; }
}
public boolean isPalindrome(ListNode head) {
int size=0;
ListNode temp=head;
while (temp.next!=null){
size++;
temp=temp.next;
}
Stack<Integer>stack=new Stack<>();
int n=size/2;
while (n-->0) {
stack.push(head.val);
head = head.next;
}
if(size%2==1)
head=head.next;
while (!stack.isEmpty())
System.out.println(stack.pop());
while (!stack.isEmpty()){
if(head.val!=stack.pop())
return false;
}
return true;
}
}
|
c547d990-3088-4f3e-a941-496ce955ed74 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-25 01:47:18", "repo_name": "scamposb/Hibernate-One-To-One", "sub_path": "/src/main/java/db/entities/Publication.java", "file_name": "Publication.java", "file_ext": "java", "file_size_in_byte": 1169, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "66d3b5f0e4a6e3f8950033771cb8101b4ca1edb9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/scamposb/Hibernate-One-To-One | 255 | FILENAME: Publication.java | 0.250913 | package db.entities;
import javax.persistence.*;
import java.io.Serializable;
/**
* Created by david on 25/03/2015.
*/
@Entity
@Table(name = "Publication")
public class Publication implements Serializable{
@Id
@GeneratedValue
@Column(name = "Id")
private int id;
@Column(name = "Date")
private long date;
@Column(name = "Content")
private String content;
@ManyToOne
@JoinColumn(name = "PublisherId")
private Publisher publisher;
public Publication(long date, String content) {
this.date = date;
this.content = content;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public long getDate() {
return date;
}
public void setDate(long date) {
this.date = date;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Publisher getPublisher() {
return publisher;
}
public void setPublisher(Publisher publisher) {
this.publisher = publisher;
}
}
|
302b0a86-da78-4716-98e5-22de24032d3c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-03 14:17:33", "repo_name": "y4sik/project3", "sub_path": "/src/main/java/com/epam/threads/entity/Port.java", "file_name": "Port.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "8bc04be736c9bb989546061e1a14f8d7d8721962", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/y4sik/project3 | 238 | FILENAME: Port.java | 0.255344 | package com.epam.threads.entity;
import java.util.ArrayList;
import java.util.List;
public class Port {
private int maxCapacity;
private int currentCargo;
private ArrayList<Dock> docks;
public Port(int maxCapacity, int currentCargo, ArrayList<Dock> docks) {
this.maxCapacity = maxCapacity;
this.currentCargo = currentCargo;
this.docks = docks;
}
public int getMaxCapacity() {
return maxCapacity;
}
public void setMaxCapacity(int maxCapacity) {
this.maxCapacity = maxCapacity;
}
public int getCurrentCargo() {
return currentCargo;
}
public void setCurrentCargo(int currentCargo) {
this.currentCargo = currentCargo;
}
public List<Dock> getDocks() {
return docks;
}
public void setDocks(ArrayList<Dock> docks) {
this.docks = docks;
}
@Override
public String toString() {
return "Port{" +
"maxCapacity=" + maxCapacity +
", currentCargo=" + currentCargo +
", docks=" + docks +
'}';
}
}
|
2d38e2db-43e0-40f1-9326-cc89a8539a81 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-20 02:36:38", "repo_name": "JDrost1818/CLParserSpringBoot", "sub_path": "/src/main/java/github/jdrost1818/controller/StaticController.java", "file_name": "StaticController.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "12435180014a4b042e9a4d238e6bdd2a289a460a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JDrost1818/CLParserSpringBoot | 216 | FILENAME: StaticController.java | 0.214691 | package github.jdrost1818.controller;
import github.jdrost1818.model.authentication.SessionUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* @author Jake Drost
* @version 1.0.0
* @since 1.0.0
*/
@Controller
public class StaticController {
@Autowired
protected SessionUser sessionUser;
private static final String LOGIN = "login.html";
private static final String DASHBOARD = "dashboard.html";
private static final String REDIRECT_HOME = "redirect:home";
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home() {
return REDIRECT_HOME;
}
@RequestMapping(value = "/home", method = RequestMethod.GET)
public String dashboard() {
return DASHBOARD;
}
@RequestMapping(value = "/welcome", method = RequestMethod.GET)
public String login() {
return LOGIN;
}
}
|
f425c2c0-1717-40b6-a0f8-653a182f9c12 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-22 02:59:04", "repo_name": "tttttttt222/udp-frame-service", "sub_path": "/udp-frame-demo/src/main/java/com/udp/frame/demo/utils/MsgPackageUtils.java", "file_name": "MsgPackageUtils.java", "file_ext": "java", "file_size_in_byte": 1263, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "02c0621bc9facc57ff270a5b03537cbfff30d50d", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tttttttt222/udp-frame-service | 276 | FILENAME: MsgPackageUtils.java | 0.293404 | package com.udp.frame.demo.utils;
import com.udp.frame.demo.dto.MsgPackage;
import java.net.InetSocketAddress;
import java.util.List;
/**
* 项目名称:udp-frame-demo
* 描述:
* 创建人:ryw
* 创建时间:2018/5/18
*/
public class MsgPackageUtils {
public static <T> MsgPackage<T> createMsgPackage(String sender, List<String> receivers, InetSocketAddress serverAddress,T data){
//连接包
MsgPackage<T> msgPackage = new MsgPackage<T>();
msgPackage.setSender(sender);
msgPackage.setAddress(serverAddress);
msgPackage.setReceivers(receivers);
msgPackage.setInfo(data);
return msgPackage;
}
public static <T> MsgPackage<T> copyMsgPackage(MsgPackage<T> msgPackage){
MsgPackage<T> objectMsgPackage = new MsgPackage<>();
objectMsgPackage.setType(msgPackage.getType());
objectMsgPackage.setSeq(msgPackage.getSeq());
objectMsgPackage.setFrame(msgPackage.getFrame());
objectMsgPackage.setAddress(msgPackage.getAddress());
objectMsgPackage.setSender(msgPackage.getSender());
objectMsgPackage.setReceivers(msgPackage.getReceivers());
objectMsgPackage.setInfo(msgPackage.getInfo());
return objectMsgPackage;
}
}
|
57311259-3caa-4e1e-960c-1bff329e5d6a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-18 17:04:30", "repo_name": "flaviogf/courses", "sub_path": "/alura/course_android_room_001/app/src/main/java/br/com/flaviogf/schedule/repositories/MemoryStudentRepository.java", "file_name": "MemoryStudentRepository.java", "file_ext": "java", "file_size_in_byte": 1169, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "04659b08aaefe066efa7e11376322a8df171bfd4", "star_events_count": 3, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/flaviogf/courses | 224 | FILENAME: MemoryStudentRepository.java | 0.26971 | package br.com.flaviogf.schedule.repositories;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import br.com.flaviogf.schedule.infrastructure.Result;
import br.com.flaviogf.schedule.models.Student;
public class MemoryStudentRepository implements StudentRepository {
private final static Map<String, Student> students = new HashMap<>();
@Override
public Result<Void> save(Student student) {
students.put(student.getId(), student);
return Result.ok();
}
@Override
public Result<Void> remove(Student student) {
students.remove(student.getId());
return Result.ok();
}
@Override
public Result<Collection<Student>> fetch() {
Collection<Student> unmodifiableList = Collections.unmodifiableCollection(students.values());
return Result.ok(unmodifiableList);
}
@Override
public Result<Student> fetchOne(String id) {
if (!students.containsKey(id)) {
return Result.fail("Student does not exist");
}
Student student = students.get(id);
return Result.ok(student);
}
}
|
53c565f2-9028-4c63-baba-704765fc7d6f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-04 08:35:43", "repo_name": "lqc1990/designMode", "sub_path": "/src/main/java/com/designmode/observer/java/CurrentConditionsDisplay.java", "file_name": "CurrentConditionsDisplay.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "386a8739016568c86bdf49f622344244f7f1de7d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lqc1990/designMode | 179 | FILENAME: CurrentConditionsDisplay.java | 0.280616 | package com.designmode.observer.java;
import java.util.Observable;
import java.util.Observer;
/**
* @author lqc
*/
public class CurrentConditionsDisplay implements Observer, DisplayElement {
Observable observable;
public CurrentConditionsDisplay(Observable observable) {
this.observable = observable;
observable.addObserver(this);
}
private float temperature;
private float humidity;
private float pressure;
@Override
public void update(Observable observable,Object args) {
if(observable instanceof ConcreteSubject){
ConcreteSubject concreteSubject = (ConcreteSubject) observable;
this.humidity = concreteSubject.getHumidity();
this.temperature = concreteSubject.getTemperature();
this.pressure = concreteSubject.getPressure();
display();
}
}
@Override
public void display() {
System.out.println("Current conditions java"+temperature+","+humidity+","+pressure);
}
}
|
292ce0cd-890f-4919-b1ea-5771a5ca32cb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-11 02:52:04", "repo_name": "chhapp0/cmfz", "sub_path": "/NettyDemo/src/main/java/com/baizhi/netty/NettyServerBootStrp.java", "file_name": "NettyServerBootStrp.java", "file_ext": "java", "file_size_in_byte": 1247, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "651136bf66e59219ef7ceccbdff6ccfbf98971d4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/chhapp0/cmfz | 298 | FILENAME: NettyServerBootStrp.java | 0.252384 | package com.baizhi.netty;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
/**
* Created by ljf on 2017/6/28.
*/
public class NettyServerBootStrp {
public static void main(String[] args) throws InterruptedException {
//1.创建Netty服务端启动引导
ServerBootstrap sbt = new ServerBootstrap();
//2 创建Netty工作线程池
NioEventLoopGroup boss = new NioEventLoopGroup();
NioEventLoopGroup worker = new NioEventLoopGroup();
//3 设置线程池
sbt.group(boss,worker);
//4 设置底层NIO请求接受实现类
sbt.channel(NioServerSocketChannel.class);
//5 初始化通讯管道 极其重要
sbt.childHandler(new ServerChannelInitializer());
System.out.println("我在9999监听-----");
//6 绑定监听端口并启动服务
ChannelFuture channelFuture = sbt.bind(9999).sync();
//7。 关闭服务
channelFuture.channel().closeFuture().sync();
// 8。 释放线程池资源
boss.shutdownGracefully();
worker.shutdownGracefully();
}
}
|
01084ec4-de09-457f-a820-1e8445c3fcb2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-27 14:57:47", "repo_name": "LPnave/WMAD2", "sub_path": "/app/src/main/java/pamudithanavaratna/com/styleomega/Database/PaymentDetails.java", "file_name": "PaymentDetails.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "3504c1d701ae393a1ecc3686985955bdbf7d993d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LPnave/WMAD2 | 275 | FILENAME: PaymentDetails.java | 0.247987 | package pamudithanavaratna.com.styleomega.Database;
import com.orm.SugarRecord;
import java.util.Date;
public class PaymentDetails extends SugarRecord<PaymentDetails> {
private String cardnumber;
private int vsc;
private Date ExpiriyDate;
private User user;
public PaymentDetails() {
}
public PaymentDetails(String cardnumber, int vsc, Date expiriyDate, User user) {
this.cardnumber = cardnumber;
this.vsc = vsc;
ExpiriyDate = expiriyDate;
this.user = user;
}
public String getCardnumber() {
return cardnumber;
}
public void setCardnumber(String cardnumber) {
this.cardnumber = cardnumber;
}
public int getVsc() {
return vsc;
}
public void setVsc(int vsc) {
this.vsc = vsc;
}
public Date getExpiriyDate() {
return ExpiriyDate;
}
public void setExpiriyDate(Date expiriyDate) {
ExpiriyDate = expiriyDate;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
|
e6fd3ba9-3ecf-4bce-948e-afa40164f8ed | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-05 01:40:03", "repo_name": "IIpocTo/spring_boot_vaadin_website", "sub_path": "/src/main/java/favourites/ui/UIExceptionConfigurer.java", "file_name": "UIExceptionConfigurer.java", "file_ext": "java", "file_size_in_byte": 1093, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "28a18266f78fae69d1378c4f4bcadf3eca98967c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/IIpocTo/spring_boot_vaadin_website | 211 | FILENAME: UIExceptionConfigurer.java | 0.290981 | package favourites.ui;
import com.vaadin.server.DefaultErrorHandler;
import com.vaadin.server.ErrorEvent;
import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import javax.validation.constraints.NotNull;
public interface UIExceptionConfigurer {
@NotNull
default UI configureUIException(@NotNull VerticalLayout content) {
UI.getCurrent().setErrorHandler(new DefaultErrorHandler() {
private static final long serialVersionUID = 4324322326324432L;
@Override
public void error(ErrorEvent event) {
final StringBuilder cause = new StringBuilder("<b>Error: </b>");
for (Throwable t = event.getThrowable(); t != null; t = t.getCause()) {
if (t.getCause() == null) cause.append(t.getMessage()).append("<br/>");
}
content.addComponent(new Label(cause.toString(), ContentMode.HTML));
doDefault(event);
}
});
return UI.getCurrent();
}
}
|
49906059-933d-480f-b07f-ef91fe82a83e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-28 02:24:10", "repo_name": "tpbvieira/mobisaude", "sub_path": "/mobisaude-android/app/src/main/java/co/salutary/mobisaude/util/Validator.java", "file_name": "Validator.java", "file_ext": "java", "file_size_in_byte": 1169, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "c4b803dda2d166e692d7e6297b0bde77fc8ffe9a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tpbvieira/mobisaude | 213 | FILENAME: Validator.java | 0.242206 | package co.salutary.mobisaude.util;
import android.util.Log;
import java.util.StringTokenizer;
public class Validator {
private static final String TAG = Validator.class.getSimpleName();
public static boolean isValidEmail(String email) {
boolean result = false;
try{
if(email.contains("@") && email.contains(".")){
StringTokenizer tokens = new StringTokenizer(email,"@");
tokens.nextToken();
String domainValue = tokens.nextToken();
tokens = new StringTokenizer(domainValue,".");
if(tokens.countTokens() > 1) {
result = true;
}
}
}catch(Exception e){
Log.e(TAG, e.getMessage());
}
return result;
}
public static boolean isValidName(String name) {
boolean result = false;
try{
result = (name.length() > 1);
}catch(Exception e){
Log.e(TAG, e.getMessage());
}
return result;
}
public static boolean isValidPassword(String password) {
return password.length() > 4;
}
}
|
3c2ccd5c-6031-412c-86a9-7a8ca4deff69 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-22 07:45:52", "repo_name": "CycloneBoy/springcloud-learn", "sub_path": "/goods-kill/src/main/java/com/cycloneboy/springcloud/goodskill/queue/disruptor/SeckillEventMain.java", "file_name": "SeckillEventMain.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "27e58b35a0d1ace31d5e37cff169d4f1b537662b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CycloneBoy/springcloud-learn | 294 | FILENAME: SeckillEventMain.java | 0.273574 | package com.cycloneboy.springcloud.goodskill.queue.disruptor;
import com.lmax.disruptor.RingBuffer;
import com.lmax.disruptor.dsl.Disruptor;
import java.util.concurrent.ThreadFactory;
/**
* 测试类 Create by sl on 2019-12-12 14:36
*/
public class SeckillEventMain {
public static void main(String[] args) {
producerWithTranslator();
}
public static void producerWithTranslator() {
int ringBufferSize = 1024;
SeckillEventFactory seckillEventFactory = new SeckillEventFactory();
ThreadFactory threadFactory = Thread::new;
//创建disruptor
Disruptor<SeckillEvent> disruptor = new Disruptor<>(seckillEventFactory,
ringBufferSize, threadFactory);
//连接消费事件方法
disruptor.handleEventsWith(new SeckillEventConsumer());
//启动
disruptor.start();
RingBuffer<SeckillEvent> ringBuffer = disruptor.getRingBuffer();
SeckillEventProducer producer = new SeckillEventProducer(ringBuffer);
for (int i = 0; i < 10; i++) {
producer.seckill(i, i);
}
//关闭 disruptor,方法会堵塞,直至所有的事件都得到处理;
disruptor.shutdown();
}
}
|
6dcfd394-7eda-4a6e-a695-228e6bcb2c0c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-01 07:37:00", "repo_name": "dengyouquan/Algorithm", "sub_path": "/src/nowcoder/swordoffer/p4/Q60.java", "file_name": "Q60.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "0121374aa375710a761baa35bf42c1b7c518aa5d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dengyouquan/Algorithm | 219 | FILENAME: Q60.java | 0.294215 | package nowcoder.swordoffer.p4;
import java.util.*;
/**
* @author dengyouquan
* @createTime 2019-02-08
**/
public class Q60 {
ArrayList<ArrayList<Integer>> Print(TreeNode pRoot) {
ArrayList<ArrayList<Integer>> lists = new ArrayList<>();
if (pRoot == null) return lists;
LinkedList<TreeNode> queue = new LinkedList<>();
queue.add(null);
queue.addLast(pRoot);
while (queue.size() != 1) {
TreeNode node = queue.removeFirst();
if (node == null) {
ArrayList<Integer> list = new ArrayList<>();
Iterator<TreeNode> iterator = queue.iterator();
while (iterator.hasNext()) {
list.add(iterator.next().val);
}
lists.add(list);
queue.add(null);
continue;
}
if (node.left != null) {
queue.addLast(node.left);
}
if (node.right != null) {
queue.addLast(node.right);
}
}
return lists;
}
}
|
26a9e10f-947d-4cbf-9edb-57af29a7a32a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-12 21:47:10", "repo_name": "ketchyn/Algorithms-and-data-structures", "sub_path": "/src/ThreadEx/ClientSocket.java", "file_name": "ClientSocket.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "bf0f88ed90abb09ea2f13d2e132f9245b322be31", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ketchyn/Algorithms-and-data-structures | 216 | FILENAME: ClientSocket.java | 0.256832 | package ThreadEx;
import java.io.*;
import java.net.Socket;
/**
* Created by Alexandr on 11.03.2016.
*/
public class ClientSocket extends Thread {
@Override
public void run() {
Socket s = null;
try {
s = new Socket("localhost", 8080);
} catch (IOException e) {
e.printStackTrace();
}
BufferedWriter out = null;
//OutputStream out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
} catch (IOException e) {
e.printStackTrace();
}
try {
int i = 0;
while(i<=5000){
this.sleep(1);
out.write("Hello");
//out.write("Heelo".getBytes());
i++;
}
System.out.println("_________________________________________________");
out.close();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
|
31cf9236-e730-41d2-822e-d30a740016b9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-22 11:43:48", "repo_name": "zj573564983/WebTest", "sub_path": "/jdbc/src/com/zhangjie/jdbc/JDBCDemo3.java", "file_name": "JDBCDemo3.java", "file_ext": "java", "file_size_in_byte": 1282, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "30fe5c440f602806c612423796aa91e90a4cfd66", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zj573564983/WebTest | 296 | FILENAME: JDBCDemo3.java | 0.289372 | package com.zhangjie.jdbc;
import java.sql.*;
/***
* @author zhangjie
* @date 2019/4/15 19:44
*/
public class JDBCDemo3 {
public static void main(String[] args) throws Exception {
/*
1.导入驱动jar包
2.注册驱动
3.获取数据库连接信息
4.定义sql语句
注意:sql的参数使用?作为占位符
5.获取执行sql的对象PreparedStatement
6.给?赋值
7.执行sql
8.处理结果
9.释放资源
*/
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn= DriverManager.getConnection("jdbc:mysql://localhost:3306/test1?serverTimezone=UTC","root","123456");
String sql="select * from user where name=?";
PreparedStatement stat=conn.prepareStatement(sql);
stat.setString(1,"zhangjie");
ResultSet resultSet=stat.executeQuery();
while(resultSet.next()){
int id = resultSet.getInt(1);
String name=resultSet.getString("name");
String remark=resultSet.getString("remark");
System.out.println(id+"---"+name+"---"+remark);
}
resultSet.close();
stat.close();
conn.close();
}
}
|
5aa62c82-1a9d-41ee-a197-7e44ede4b231 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-10-21 01:21:14", "repo_name": "elliotchance/Sentinel", "sub_path": "/test/org/sentinel/servers/http/configuration/StaticTest.java", "file_name": "StaticTest.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "b3f25ee91acc9a56216a0ab4991f98e53ef4a5b4", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/elliotchance/Sentinel | 203 | FILENAME: StaticTest.java | 0.27513 | package org.sentinel.servers.http.configuration;
import static org.junit.Assert.*;
import org.junit.Test;
import org.sentinel.configuration.ConfigurationException;
public class StaticTest
{
@Test
public void testPath()
{
String string = "abc";
Static instance = new Static();
instance.setPath(string);
assertEquals(string, instance.getPath());
}
@Test
public void testToString()
{
Static s = new Static("/some/path");
assertEquals("<static path=\"/some/path\"/>", s.toString());
}
@Test
public void testTextElement() throws ConfigurationException
{
new Static().parseTextElement(null);
}
@Test
public void testParseElement() throws ConfigurationException
{
assertFalse(new Static().parseElement(null));
}
@Test
public void testParseAttribute() throws ConfigurationException
{
assertFalse(new Static().parseAttribute("doesntexist", null));
}
}
|
79b9bfa0-7ee5-4343-9038-92c7c4cb33bf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-30 09:11:58", "repo_name": "Trung-RMIT-3695656/A1-SADI-Code", "sub_path": "/src/Information/Course.java", "file_name": "Course.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "d755ad7ee5f3662708c7afd19e5e3ddfb42fb2fb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Trung-RMIT-3695656/A1-SADI-Code | 208 | FILENAME: Course.java | 0.26971 | package Information;
public class Course {
private String courseId;
private String name;
private int numberOfCredit;
private static Course course;
public Course(String courseId, String name, int numberOfCredit) {
this.courseId = courseId;
this.name = name;
this.numberOfCredit = numberOfCredit;
}
public static Course getInstance(String id, String name, int numberOfCredit) {
if (null == course) {
course = new Course(id, name, numberOfCredit);
}
return course;
}
public String getCourseId() {
return courseId;
}
public void setCourseId(String courseId) {
this.courseId = courseId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getNumberOfCredit() {
return numberOfCredit;
}
public void setNumberOfCredit(int numberOfCredit) {
this.numberOfCredit = numberOfCredit;
}
}
|
5b46482e-029c-4c80-a92a-1d3282951786 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-22 10:03:29", "repo_name": "sachinthazoysa/MadPracticeExam", "sub_path": "/app/src/main/java/com/example/madmodelpaper2020/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1099, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "4c8ba779e1bb9ac8e7281e80ec3779b28e4a271d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sachinthazoysa/MadPracticeExam | 175 | FILENAME: MainActivity.java | 0.206894 | package com.example.madmodelpaper2020;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button register, update;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
register = findViewById(R.id.reg);
update = findViewById(R.id.ed);
register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent= new Intent(MainActivity.this, ProfileManagement.class);
startActivity(intent);
}
});
update.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent= new Intent(MainActivity.this, EditProfile.class);
startActivity(intent);
}
});
}
}
|
326ed2a8-4f50-435a-89e2-3a8111086940 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-01-24T12:56:05", "repo_name": "bookendus/insolar", "sub_path": "/cmd/benchmark/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1170, "line_count": 44, "lang": "en", "doc_type": "text", "blob_id": "7e3ffc0507b016d64f40f0f79d0f4106c7badbbb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bookendus/insolar | 262 | FILENAME: README.md | 0.253861 | Benchmark
===============
Usage
----------
#### Build
make benchmark
#### Start insolard
./scripts/insolard/launchnet.sh -g
#### Start benchmark
./bin/benchmark -c=4 -r=25 -k=scripts/insolard/configs/root_member_keys.json
### Options
-c concurrency
Number of concurrent users. Default is one.
-r repetitions
Number of repetitions for one user. Default is one.
-o output
Path to output file (use - for STDOUT).
-k rootmemberkeys
Path to file with RootMember keys.
-u apiurl (may be specified multiple times for roundrobin requests)
API url for requests (default - http://localhost:19101/api).
-l loglevel
Log level (default - info).
-s savemembers
Saves members to file scripts/insolard/benchmark/members.txt.
If false, file wont be updated. Default is false.
-m usemembers
Use members from file scripts/insolard/benchmark/members.txt.
If false, wright info about created members in this file. Default is false.
|
81cf65e6-b60d-44ec-85dc-dd11b33eceef | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-21 07:09:49", "repo_name": "leozlliang/brpc-customize", "sub_path": "/brpc-spring-boot-starter-interceptor/src/main/java/com/yy/lite/brpc/spring/configure/BrpcMetricsInterceptorConfiguration.java", "file_name": "BrpcMetricsInterceptorConfiguration.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "00f8fb0da51b8fd60b63aeeb729797ac486a6556", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/leozlliang/brpc-customize | 240 | FILENAME: BrpcMetricsInterceptorConfiguration.java | 0.255344 | package com.yy.lite.brpc.spring.configure;
import com.yy.lite.brpc.interceptor.BrpcConsumerAomiInterceptor;
import com.yy.lite.brpc.interceptor.BrpcMetricsInterceptor;
import com.yy.lite.brpc.interceptor.BrpcProviderAomiInterceptor;
import com.yy.lite.framework.aop.MetricsAop;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class BrpcMetricsInterceptorConfiguration {
@Bean(name="brpcMetricsInterceptor")
public BrpcMetricsInterceptor brpcMetricsInterceptor(){
BrpcMetricsInterceptor aop = new BrpcMetricsInterceptor();
return aop;
}
@Bean(name="brpcConsumerAomiInterceptor")
public BrpcConsumerAomiInterceptor brpcConsumerAomiInterceptor(){
BrpcConsumerAomiInterceptor aop = new BrpcConsumerAomiInterceptor();
return aop;
}
@Bean(name="brpcProviderAomiInterceptor")
public BrpcProviderAomiInterceptor brpcProviderAomiInterceptor(){
BrpcProviderAomiInterceptor aop = new BrpcProviderAomiInterceptor();
return aop;
}
} |
f3de9de1-0906-4c0b-84af-f52da470219c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-19 18:03:48", "repo_name": "2GatherAPITeam/middleware-java", "sub_path": "/src/main/java/ac/il/shenkar/middleware/models/Device.java", "file_name": "Device.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "d8338a55210e3a2dd0e5b3badef1a899cc2ed7db", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/2GatherAPITeam/middleware-java | 267 | FILENAME: Device.java | 0.272799 | package ac.il.shenkar.middleware.models;
public class Device {
private String vendorId;
private String productId;
public Device() {}
public String getVendorId() {
return vendorId;
}
public void setVendorId(String vendorId) {
this.vendorId = vendorId;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
@Override public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Device device = (Device) o;
if (vendorId != null ? !vendorId.equals(device.vendorId) : device.vendorId != null)
return false;
return productId != null ? productId.equals(device.productId) : device.productId == null;
}
@Override public int hashCode() {
int result = vendorId != null ? vendorId.hashCode() : 0;
result = 31 * result + (productId != null ? productId.hashCode() : 0);
return result;
}
@Override public String toString() {
return "Device{" + "vendorId='" + vendorId + '\'' + ", productId='" + productId + '\'' + '}';
}
}
|
a5297be7-40c0-4069-b9de-43f9fdeb687a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-15 03:53:31", "repo_name": "caranha/BordeauxTsukuba2017", "sub_path": "/Sumimasen/core/src/com/tskbdx/sumimasen/scenes/OnTimeOnFirstDay.java", "file_name": "OnTimeOnFirstDay.java", "file_ext": "java", "file_size_in_byte": 1104, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "5fe5d01e7669053a2ff327805885f55b13ad598f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/caranha/BordeauxTsukuba2017 | 268 | FILENAME: OnTimeOnFirstDay.java | 0.285372 | package com.tskbdx.sumimasen.scenes;
import com.tskbdx.sumimasen.GameScreen;
import com.tskbdx.sumimasen.scenes.model.World;
import com.tskbdx.sumimasen.scenes.model.entities.Entity;
import com.tskbdx.sumimasen.scenes.model.entities.interactions.Dialogue;
/*
* Created by viet khang on 01/06/2017.
*/
public class OnTimeOnFirstDay extends Scene {
@Override
public void init() {
World world = getWorld();
Entity noname = world.getEntityByName("Pr. Noname");
noname.setInteraction(new Dialogue("welcome.xml"));
}
@Override
public boolean isFinished() {
Entity player = GameScreen.getPlayer();
return player.hasInteractedWith("Pr. Noname");
}
@Override
public Scene getNextScene() {
return new LetsWork();
}
@Override
public void dispose() {
}
@Override
protected String defaultMap() {
return "lab";
}
@Override
protected String defaultSpawn() {
return "left_entrance";
}
@Override
public String description() {
return "I'm on time !";
}
}
|
62e06abd-490e-4cff-bca8-9f442112bf80 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-25 06:04:24", "repo_name": "WallE2017/ASUI", "sub_path": "/app/src/main/java/com/example/a111/myapplication/VoiceFrag.java", "file_name": "VoiceFrag.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "48d01fe66c3183701d0447fb775fb04d7eebcb0b", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/WallE2017/ASUI | 202 | FILENAME: VoiceFrag.java | 0.200558 | package com.example.a111.myapplication;
import android.app.Activity;
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.ImageView;
import android.widget.Toast;
/**
* Created by 111 on 2017/8/2.
*/
public class VoiceFrag extends Fragment{
private View view;
private ImageView subt;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle saveInstanceState){
view=inflater.inflate(R.layout.content_voice,container,false);
subt=(ImageView)view.findViewById(R.id.imageView8);
return view;
}
@Override
public void onActivityCreated(Bundle savedInstanceState){
super.onActivityCreated(savedInstanceState);
subt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getActivity(),"声音已保存,解析中...",Toast.LENGTH_LONG).show();
}
});
}
}
|
709f0606-4a95-4d04-9c43-1ff959e26878 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-03-15T22:28:36", "repo_name": "oryxr/wiki_repo", "sub_path": "/Pic32--interrupt.md", "file_name": "Pic32--interrupt.md", "file_ext": "md", "file_size_in_byte": 1021, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "14dd0c586a747b4f38dda3700d0693261c3cf0d0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/oryxr/wiki_repo | 344 | FILENAME: Pic32--interrupt.md | 0.279042 | Gestion des interruptions extérieurs sur PIC32
==============================================
#include <plib.h>
#define SYS_FREQ (80000000L)
void setup() {
SYSTEMConfig(SYS_FREQ, SYS_CFG_WAIT_STATES | SYS_CFG_PCACHE);
INTEnableSystemMultiVectoredInt();
/* initialisation interruption extern 0 */
IEC0CLR = 0x00000008; // disable INT0
INTCONSET = 0x00000001; // set the bit for rising edge trigger
IFS0CLR = 0x00000008; // clear the interrupt flag
IPC0CLR = 0x1F000000; // clear the priority
IPC0SET = 0x09000000; // set the priority to 2 and sub-priority to 1
IEC0SET = 0x00000008; // enable INT0;
// temporaire
pinMode(23,OUTPUT);
LATCCLR=0x0008;
Serial.begin(115200);
// fin temporaire
}
void loop(){
}
extern "C" {
void __ISR(_EXTERNAL_0_VECTOR,ipl2) Int0Handler(void){
IFS0CLR = 0x00000008;
LATCINV = 0x0008;
}
} |
197a5bf6-e1cd-4b00-8d13-c90de7a2ce22 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-11 11:47:49", "repo_name": "guotongning/user-platform", "sub_path": "/ning-web-mvc/src/main/java/com/ning/web/mvc/handler/DefaultRestControllerHandler.java", "file_name": "DefaultRestControllerHandler.java", "file_ext": "java", "file_size_in_byte": 1037, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "22680ab0b958956b39b8e6b325f18da83a12471c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/guotongning/user-platform | 198 | FILENAME: DefaultRestControllerHandler.java | 0.206894 | package com.ning.web.mvc.handler;
import com.ning.web.mvc.controller.Controller;
import com.ning.web.mvc.controller.PageController;
import com.ning.web.mvc.controller.RestController;
import com.ning.web.mvc.response.Result;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import static com.ning.web.mvc.utils.RequestMappingUtils.handleRequestMapping;
/**
* @Author: nicholas
* @Date: 2021/2/28 17:31
* @Descreption:
*/
public class DefaultRestControllerHandler implements RestControllerHandler {
@Override
public Result handle(HttpServletRequest request, HttpServletResponse response, Controller controller) {
try {
RestController pageController = (RestController) controller;
return pageController.execute(request, response);
} catch (Throwable throwable) {
throwable.printStackTrace();
}
return new Result(500, "fail");
}
}
|
f39107c2-32a5-4cfc-abe2-b3388bd02d64 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-01 06:07:55", "repo_name": "jkwcp/Algo4_PriorityQueues", "sub_path": "/src/UnorderedMaxPQ.java", "file_name": "UnorderedMaxPQ.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "d50340b1db877a51661a2ed22b8ccc310dd2c145", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jkwcp/Algo4_PriorityQueues | 272 | FILENAME: UnorderedMaxPQ.java | 0.242206 | import edu.princeton.cs.algs4.StdIn;
public class UnorderedMaxPQ<Key extends Comparable<Key>> {
private Key[] pq;
private int N;
public UnorderedMaxPQ(int capacity) {
pq = (Key[]) new Comparable[capacity];
}
public boolean isEmpty() {
return N == 0;
}
public void insert(Key x) {
pq[N++] = x;
}
public Key delMax() {
int max = 0;
for (int i = 1; i < N; i++)
if (max < i) max = 1;
exch(max, N - 1);
return pq[--N];
}
public int size() {
return N;
}
private void exch(int i, int j) {
Key temp = pq[i];
pq[i] = pq[j];
pq[j] = temp;
}
public static void main(String[] args) {
UnorderedMaxPQ<String> pq = new UnorderedMaxPQ<>(5);
while (StdIn.hasNextLine()) {
String line = StdIn.readLine();
pq.insert(line);
if (pq.size() > 4) {
pq.delMax();
}
}
}
}
|
62aef469-9932-4fe2-b63f-81a9d13d287e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-29 01:35:36", "repo_name": "shaobin123/study", "sub_path": "/demo1/src/main/java/com/example/demo/Service/impl/CustomerServiceImpl.java", "file_name": "CustomerServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1170, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "4c0c0f1bc33eb1a5171c544fcb8ba4d75683788a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shaobin123/study | 201 | FILENAME: CustomerServiceImpl.java | 0.243642 | package com.example.demo.Service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.example.demo.domain.Customer;
import com.example.demo.mapper.CustomerMapper;
import com.example.demo.Service.CustomerService;
@Service
public class CustomerServiceImpl implements CustomerService{
@Resource
private CustomerMapper customerMapper;
@Override
public int deleteByPrimaryKey(String userId) {
return customerMapper.deleteByPrimaryKey(userId);
}
@Override
public int insert(Customer record) {
return customerMapper.insert(record);
}
@Override
public int insertSelective(Customer record) {
return customerMapper.insertSelective(record);
}
@Override
public Customer selectByPrimaryKey(String userId) {
return customerMapper.selectByPrimaryKey(userId);
}
@Override
public int updateByPrimaryKeySelective(Customer record) {
return customerMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(Customer record) {
return customerMapper.updateByPrimaryKey(record);
}
}
|
11d827f9-3251-4887-8929-6532798acc31 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-03 07:22:22", "repo_name": "smemoryouth/ajie", "sub_path": "/MavenTest/src/main/java/internet/Client3.java", "file_name": "Client3.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "d8274f1d8cc5c544c855a56366dbe7b96fc75dda", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/smemoryouth/ajie | 228 | FILENAME: Client3.java | 0.272799 | package internet;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
/**
* description:客户端,双端通信
*
* @author ajie
* data 2018/10/18 12:39
*/
public class Client3 {
public static void main(String[] args) throws IOException {
String flag = "over";
int port = 123;
String host = "127.0.0.1";
Socket socket = new Socket(host, port);
System.out.println("客户端开始");
PrintWriter os = new PrintWriter(socket.getOutputStream());
BufferedReader is = new BufferedReader(new InputStreamReader(socket.getInputStream()));
BufferedReader sin = new BufferedReader(new InputStreamReader(System.in));
String line = sin.readLine();
while (!line.equals(flag)){
os.println(line);
os.flush();
System.out.println("服务器:" + is.readLine());
line = sin.readLine();
}
os.close();
is.close();
socket.close();
System.out.println("客户端关闭");
}
}
|
736b5acf-edc2-479c-b8c8-db11ac016b21 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-27 09:21:03", "repo_name": "wqwangruiqi/maven-ssm", "sub_path": "/src/main/test/org/wq/ssm/lasw/TestLaswNewsTitleService.java", "file_name": "TestLaswNewsTitleService.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "be2c1d0c86542e4c1a452730e5639f73e431fe86", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wqwangruiqi/maven-ssm | 299 | FILENAME: TestLaswNewsTitleService.java | 0.295027 | package org.wq.ssm.lasw;
import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.wq.ssm.entity.lasw.LaswNewsTitle;
import org.wq.ssm.service.lasw.LaswNewsTitleService;
import com.github.pagehelper.PageInfo;
/**
* 首先需要配置spring和junit整合 为了junit启动时加载spring ioc容器
* @author wangqiang
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({
"classpath:spring/spring-dao.xml",
"classpath:spring/spring-service.xml" })
/**
* @author wangqiang
*联系邮箱:417297506@qq.com
* 2017年7月6日 下午2:46:28
* 类的说明:这是一个测试service的类
*
*/
public class TestLaswNewsTitleService {
//注入dao实现类依赖
@Resource
private LaswNewsTitleService laswNewsTitleService;
@Test
public void TestQueryPage(){
PageInfo<LaswNewsTitle> page= laswNewsTitleService.queryPage(null, null, null, null, null,null);
System.out.println(page);
}
}
|
664b1d6a-b92b-4aee-9261-61dbec90c60e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-18 15:51:27", "repo_name": "saurabhgoyal24/Application-Engineering-Development-Final", "sub_path": "/src/Business/Organization/DiseaseManagementOrganization.java", "file_name": "DiseaseManagementOrganization.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "b47816b492b18bc404ecb5060733c7c4c6afe2d3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/saurabhgoyal24/Application-Engineering-Development-Final | 203 | FILENAME: DiseaseManagementOrganization.java | 0.279042 | /*
* 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 Business.Organization;
import Business.Role.Role;
import Business.SocialForum.Disease;
import Business.SocialForum.Topic;
import java.util.ArrayList;
/**
*
* @author Saurabh Goyal
*/
public class DiseaseManagementOrganization extends Organization {
private ArrayList<Disease> diseaseList;
private ArrayList<Topic>topicList;
public DiseaseManagementOrganization() {
super(OrganizationType.DISEASEMANAGEMENTORGANIZATION, null);
diseaseList = new ArrayList<>();
topicList = new ArrayList<>();
}
public ArrayList<Topic> getTopicList() {
return topicList;
}
public ArrayList<Disease> getDiseaseList() {
return diseaseList;
}
@Override
public ArrayList<Role> getSupportedRole() {
return null;
}
}
|
90dd90fd-6b03-4fdf-adf4-da6c4fb5b9e7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-23 05:54:55", "repo_name": "sujaynaik/Retrofit-2", "sub_path": "/app/src/main/java/com/testretrofit/model/CustomerDetail.java", "file_name": "CustomerDetail.java", "file_ext": "java", "file_size_in_byte": 1170, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "08dca47042051cb7e7831ceffdd5ec32ed17ea32", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sujaynaik/Retrofit-2 | 243 | FILENAME: CustomerDetail.java | 0.233706 | package com.testretrofit.model;
import java.io.Serializable;
import java.util.List;
/**
* Created by hclpc on 1/3/2017.
*/
public class CustomerDetail implements Serializable {
private List<CreditRequest> credit_requests;
private Customer customer;
private Customer cutomer;
public CustomerDetail(List<CreditRequest> credit_requests, Customer customer) {
this.credit_requests = credit_requests;
this.customer = customer;
}
public CustomerDetail(Customer cutomer, List<CreditRequest> credit_requests) {
this.cutomer = cutomer;
this.credit_requests = credit_requests;
}
public List<CreditRequest> getCredit_requests() {
return credit_requests;
}
public void setCredit_requests(List<CreditRequest> credit_requests) {
this.credit_requests = credit_requests;
}
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public Customer getCutomer() {
return cutomer;
}
public void setCutomer(Customer cutomer) {
this.cutomer = cutomer;
}
}
|
fdc3204b-3540-401e-a78e-3e0d8ae74ee3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-15 11:20:03", "repo_name": "kaisersouza/justjava", "sub_path": "/OnChatServer.java", "file_name": "OnChatServer.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "ebd1b2770f2c37ba2fc998ccc6336d6700eba8ad", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kaisersouza/justjava | 182 | FILENAME: OnChatServer.java | 0.245085 | import java.net.*;
import java.io.*;
public class OnChatServer {
public static void main(String[] args) throws IOException {
ServerSocket serverSocket = new ServerSocket(9000);
System.out.println("Server has started. Waiting for connection");
int count = 1;
while (true) {
Socket clientSocket = serverSocket.accept();
System.out.println("Client has connected " + (count));
BufferedReader reader = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
String request = reader.readLine();
System.out.println("Client #" + count + ": " + request);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(clientSocket.getOutputStream()));
String response = "SERVER ACCEPTED UR MESSAGE";
writer.write(response);
writer.flush();
writer.close();
reader.close();
clientSocket.close();
}
//serverSocket.close();
}
}
|
7ae39973-7b90-4630-8683-c2659312845f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-05-11 17:24:24", "repo_name": "sameerkathawate/codeBase", "sub_path": "/src/main/java/commonLibs/implementation/WebElementOptions.java", "file_name": "WebElementOptions.java", "file_ext": "java", "file_size_in_byte": 964, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "dd0137707dc227874891c36357465efaf3b5c8e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sameerkathawate/codeBase | 177 | FILENAME: WebElementOptions.java | 0.253861 | package commonLibs.implementation;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
public class WebElementOptions {
WebDriver driver;
public WebElementOptions(WebDriver driver) {
this.driver = driver;
}
public void clickElement(WebElement element) {
element.click();
}
public void sendText(WebElement element, String text) {
element.isDisplayed();
element.sendKeys(text);
}
public boolean isDisplayed(WebElement element) {
return element.isDisplayed();
}
public void selectVisibleDropdownValue(WebElement element, String text) {
Select dropdown = new Select(element);
dropdown.selectByVisibleText(text);
}
public void findByValueDropdownElement(WebElement element, String text) {
Select dropdown = new Select(element);
dropdown.selectByValue(text);
}
}
|
b017399f-c14d-4164-9683-fc07a160cd8c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-14 07:56:43", "repo_name": "Koushik-Gandi/Module4", "sub_path": "/TestAutomationAndSelenium/src/main/java/com/capg/pomfiles/DriverInitialiser.java", "file_name": "DriverInitialiser.java", "file_ext": "java", "file_size_in_byte": 1099, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "7aa0a5123a1d911c11a69892832550ec2c7eb0f7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Koushik-Gandi/Module4 | 238 | FILENAME: DriverInitialiser.java | 0.280616 | package com.capg.pomfiles;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class DriverInitialiser {
static Properties prop = new Properties();
public static WebDriver driver;
static String browser;
public static void setBrowserName() {
try {
InputStream is = new FileInputStream(
"G:\\webprogramming\\TestAutomationAndSelenium\\src\\main\\java\\com\\capg\\properties\\config.properties");
prop.load(is);
System.out.println(prop.getProperty("browser"));
} catch (Exception e) {
e.printStackTrace();
}
browser = prop.getProperty("browser");
}
public static void setBrowserConfig() {
if (browser.equals("chrome")) {
System.setProperty("webdriver.chrome.driver",
"G:\\webprogramming\\TestAutomationAndSelenium\\src\\main\\java\\chromedriver.exe");
}
}
public static void runTest() {
driver = new ChromeDriver();
driver.get(prop.getProperty("url"));
}
public static void quitTest() {
driver.quit();
}
}
|
9f233707-fbe7-49ec-9b31-26d5c0c4b21c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-01 23:53:15", "repo_name": "diogotorres/cursomc", "sub_path": "/src/main/java/com/diogotorres/cursomc/resources/CategoriaResource.java", "file_name": "CategoriaResource.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "24339bfb4ebce0a2b9cfb3c5d97783fe2baf6ced", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/diogotorres/cursomc | 223 | FILENAME: CategoriaResource.java | 0.286968 | package com.diogotorres.cursomc.resources;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.diogotorres.cursomc.domain.Categoria;
import com.diogotorres.cursomc.services.CategoriaService;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import java.net.URI;
@RestController
@RequestMapping(value = "/categorias")
public class CategoriaResource {
@Autowired
private CategoriaService service;
//utiliza-se interrogação para o caso de não encontrar o objeto desejado
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public ResponseEntity<?> find(@PathVariable Integer id) {
Categoria cat = service.find(id);
return ResponseEntity.ok().body(cat);
}
@PostMapping
public ResponseEntity<Void> insert(@RequestBody Categoria obj) {
obj = service.insert(obj);
URI uri = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}").buildAndExpand(obj.getId()).toUri();
return ResponseEntity.created(uri).build();
}
}
|
0fa05302-b0ad-450e-88ad-570829c1a4ba | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-12 04:36:25", "repo_name": "Emanhashim/BankingSystem", "sub_path": "/src/bb/classes/userAccount.java", "file_name": "userAccount.java", "file_ext": "java", "file_size_in_byte": 1191, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "44fc6cab4a899b6026b472e455c8aa0c2faea235", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Emanhashim/BankingSystem | 219 | FILENAME: userAccount.java | 0.27048 | /*
* 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 bb.classes;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
/**
*
* @author cs
*/
public class userAccount {
public boolean loginBank(String userName,String password) {
boolean userExist = false;
String sql = "SELECT * FROM useraccount WHERE UserName = '"+userName + "' AND Password = '"+ password +"';";
try {
Connection conn = connection.getConn();
Statement stmt = conn.createStatement();
ResultSet rst = stmt.executeQuery(sql);
if (rst.next()) {
UserInfo.username = rst.getString("UserName");
UserInfo.password = rst.getString("Password");
UserInfo.role = rst.getInt("UserRole");
UserInfo.EmpId = rst.getString("UserEmpId");
userExist = true;
}
} catch (Exception e) {
userExist = false;
}
return userExist;
}
}
|
c98d8df9-3636-442e-8227-6b9ae948b54f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-13 13:17:36", "repo_name": "antowaddle/Selenium-Cucumber-Quickstart", "sub_path": "/ui-acceptance-tests/src/test/java/io/github/anthony/runvalidation/TestExecutionValidator.java", "file_name": "TestExecutionValidator.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "e83500bd827886490302abf8a7e0763cee61f0f5", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/antowaddle/Selenium-Cucumber-Quickstart | 187 | FILENAME: TestExecutionValidator.java | 0.23092 | package io.github.anthony.runvalidation;
import io.github.bonigarcia.wdm.WebDriverManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;
@Slf4j
@ContextConfiguration(classes = TestExecutionSpringConfig.class)
public class TestExecutionValidator extends AbstractTestNGSpringContextTests {
@Autowired
private TestExecutionListener testExecutionListener;
private final String downloadDirectory = "src/test/resources/binaries";
@Test
public void validateRunConditionsHere() {
log.info("Test run instantiated...validating conditions");
testExecutionListener.checkEnvironmentIsOnline();
WebDriverManager.chromedriver().targetPath(downloadDirectory).setup();
WebDriverManager.firefoxdriver().targetPath(downloadDirectory).setup();
}
}
|
f3979a86-bd5e-402a-99fa-b996650b34d4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-22 07:38:39", "repo_name": "AndroidHF/PaiMai", "sub_path": "/app/src/main/java/com/buycolle/aicang/adapter/HomeDataAdapter.java", "file_name": "HomeDataAdapter.java", "file_ext": "java", "file_size_in_byte": 1100, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "764884d6f3b9bcda4e72cf2e7171463aa4c88736", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AndroidHF/PaiMai | 232 | FILENAME: HomeDataAdapter.java | 0.239349 | package com.buycolle.aicang.adapter;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.buycolle.aicang.bean.HomeGoodsBean;
import java.util.ArrayList;
/**
* Created by joe on 16/3/24.
*/
public class HomeDataAdapter extends BaseAdapter {
private Context context;
private Activity mActivity;
private ArrayList<HomeGoodsBean> homeGoodsBeanArrayList;
public HomeDataAdapter(Context context, ArrayList<HomeGoodsBean> beans) {
this.context = context;
this.mActivity = (Activity) context;
this.homeGoodsBeanArrayList = beans;
}
@Override
public int getCount() {
return homeGoodsBeanArrayList.size();
}
@Override
public Object getItem(int position) {
return homeGoodsBeanArrayList.get(position);
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return null;
}
}
|
0f64822d-6070-4082-886a-8b47b30aad9d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-27 23:08:52", "repo_name": "FernandoVelcic/whatsapp-remote", "sub_path": "/WhatsappRemote/src/com/soxeon/whatsappremote/ServerService.java", "file_name": "ServerService.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "b27faaa983d94b6aab2d77c84098a57062c24195", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/FernandoVelcic/whatsapp-remote | 239 | FILENAME: ServerService.java | 0.278257 | package com.soxeon.whatsappremote;
import java.net.UnknownHostException;
import android.app.Service;
import android.content.Intent;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.IBinder;
import android.util.Log;
public class ServerService extends Service {
private static final int SERVER_PORT = 8080;
private Server WebServer;
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
// [Thread] Server initialization
try {
WebServer = new Server(SERVER_PORT);
WebServer.start();
Log.d("[DEBUG]", "WebServer started on port: " + WebServer.getPort());
} catch (UnknownHostException e) {
e.printStackTrace();
}
Log.d("[DEBUG]", "ServerService started.");
}
@Override
public void onDestroy() { // this.stopSelf();
super.onDestroy();
try {
WebServer.stop();
} catch (Exception e) {
}
Log.d("[DEBUG]", "ServerService destroyed.");
}
@Override
public IBinder onBind(Intent arg0) {
return null;
}
}
|
1cfa4f4d-01ed-4bd8-aaca-b747d24093f2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-24 12:23:48", "repo_name": "Maurogch/Laboratorio5", "sub_path": "/Stream Sample/src/com/company/Person.java", "file_name": "Person.java", "file_ext": "java", "file_size_in_byte": 1103, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "ecd346bffcbf53def3eabf69dadc61b156289a0c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Maurogch/Laboratorio5 | 246 | FILENAME: Person.java | 0.235108 | package com.company;
public class Person {
private String name;
private String lastname;
private int age;
private int dni;
public Person(String name, String lastname, int age, int dni) {
this.name = name;
this.lastname = lastname;
this.age = age;
this.dni = dni;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public int getDni() {
return dni;
}
public void setDni(int dni) {
this.dni = dni;
}
@Override
public String toString() {
return "Person{" +
"name='" + name + '\'' +
", lastname='" + lastname + '\'' +
", age=" + age +
", dni=" + dni +
'}';
}
}
|
46b20f3d-1ce1-490d-9297-93f16d97da0e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-12 14:40:32", "repo_name": "TarikoDan/Java-Lessons", "sub_path": "/src/lesson2_Composition_Agrigation/Task3_Request/Passport.java", "file_name": "Passport.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "c77b890fc1d6fa94a73353f3535e36b7b14c49dd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/TarikoDan/Java-Lessons | 217 | FILENAME: Passport.java | 0.267408 | package lesson2_Composition_Agrigation.Task3_Request;
public class Passport {
private String series;
private int number;
private String serviceIssues;
public Passport() {
}
public Passport(String series, int number, String serviceIssues) {
this.series = series;
this.number = number;
this.serviceIssues = serviceIssues;
}
public String getSeries() {
return series;
}
public void setSeries(String series) {
this.series = series;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public String getServiceIssues() {
return serviceIssues;
}
public void setServiceIssues(String serviceIssues) {
this.serviceIssues = serviceIssues;
}
@Override
public String toString() {
return "Passport{ " +
series.toUpperCase() +
"/" + number +
", vydanyj:_'" + serviceIssues + '\'' +
'}';
}
}
|
23f838f6-ef90-42d9-b920-025dbccad99e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-27 15:38:59", "repo_name": "ebrusoysal/Storytel_App_End_To_End_TestNG", "sub_path": "/src/main/java/com/storytel/pages/WelcomeScreen.java", "file_name": "WelcomeScreen.java", "file_ext": "java", "file_size_in_byte": 1170, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "dc4dffd751a4a76663809ca8ee5e403961a6d9d9", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/ebrusoysal/Storytel_App_End_To_End_TestNG | 256 | FILENAME: WelcomeScreen.java | 0.268941 | package com.storytel.pages;
import com.storytel.base.Base;
import io.appium.java_client.MobileElement;
import io.appium.java_client.TouchAction;
import io.appium.java_client.pagefactory.AndroidFindBy;
import io.appium.java_client.touch.WaitOptions;
import io.appium.java_client.touch.offset.PointOption;
import org.openqa.selenium.Point;
import org.openqa.selenium.support.ui.ExpectedConditions;
import java.time.Duration;
public class WelcomeScreen extends Base {
@AndroidFindBy(id = "grit.storytel.app:id/carousel_description")
public MobileElement swipeList;
@AndroidFindBy(id = "grit.storytel.app:id/create_account_preview")
public MobileElement tryItOut;
public void swipeStories(int swipeCount) {
Point p = wait.until(ExpectedConditions.visibilityOf(swipeList)).getLocation();
TouchAction t = new TouchAction(driver);
for (int i = 0; i < swipeCount; i++) {
t.press(PointOption.point(p.x + 300, p.y));
t.waitAction(WaitOptions.waitOptions(Duration.ofMillis(500)));
t.moveTo(PointOption.point(p.x + 100, p.y));
t.release();
t.perform();
}
}
}
|
dde742c3-e73b-40e7-944d-fdd857c41fd3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-18 07:16:50", "repo_name": "artisancreek/hrpd", "sub_path": "/Jarvis/app/src/main/java/edu/depaul/csc595/jarvis/inventory/CustomListItem.java", "file_name": "CustomListItem.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "126d65f0a96dc188810e366c905a901ccc29c230", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/artisancreek/hrpd | 233 | FILENAME: CustomListItem.java | 0.279828 | package edu.depaul.csc595.jarvis.inventory;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.FrameLayout;
/**
* Created by Advait on 15-02-2016.
*/
public class CustomListItem extends FrameLayout
{
private JBHorizontalSwipe mJBHorizontalSwipe;
public CustomListItem(Context context, AttributeSet attrs)
{
super(context, attrs);
}
public CustomListItem(Context context, AttributeSet attrs, int defStyleAttr)
{
super(context, attrs, defStyleAttr);
}
@Override
public boolean onTouchEvent(MotionEvent ev)
{
if (this.mJBHorizontalSwipe != null)
this.mJBHorizontalSwipe.onScrollerDispatchTouchEventListener(this, ev);
return super.onTouchEvent(ev);
}
/**
* Sets a reference to a JBHorizontalSwipe controller.
* @param jbHorizontalSwipe The instance of a JBHorizontalSwipe controller.
*/
public void setJBHeaderRef(JBHorizontalSwipe jbHorizontalSwipe)
{
this.mJBHorizontalSwipe = jbHorizontalSwipe;
}
}
|
2a54552c-5969-49f0-98d0-1ff63c49a4b2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-24 23:14:55", "repo_name": "dioob/Aplikasi-Chat-DBChat", "sub_path": "/app/src/main/java/dioobanu/yahoo/dbchat/StartActivity.java", "file_name": "StartActivity.java", "file_ext": "java", "file_size_in_byte": 1168, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "f9d8aa0de0e45cc0d78af76f0ed5f302b7cf55a3", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/dioob/Aplikasi-Chat-DBChat | 203 | FILENAME: StartActivity.java | 0.20947 | package dioobanu.yahoo.dbchat;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class StartActivity extends AppCompatActivity {
private Button mRegbtn;
private Button mLogbtn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start);
mRegbtn = findViewById(R.id.start_reg_button);
mLogbtn = findViewById(R.id.start_login_button);
mRegbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent regIntent = new Intent(StartActivity.this, RegistrasiActivity.class);
startActivity(regIntent);
}
});
mLogbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent logIntent = new Intent(StartActivity.this, LoginActivity.class);
startActivity(logIntent);
}
});
}
}
|
c7404f0d-6be4-442f-8988-ab0995841578 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-10 13:58:52", "repo_name": "kkmangl/EventManagement", "sub_path": "/src/com/sapient/controller/DashboardController.java", "file_name": "DashboardController.java", "file_ext": "java", "file_size_in_byte": 1033, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "bde1c84b798181a8ed70b2d2ca35300e648c7d45", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kkmangl/EventManagement | 194 | FILENAME: DashboardController.java | 0.287768 | package com.sapient.controller;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.ModelAndView;
import com.sapient.hibernate.DashBoard;
import com.sapient.hibernate.UpcomingEvent;
import com.sapient.model.Event;
import com.sapient.model.UserLoginInfo;
@Controller
public class DashboardController {
@RequestMapping(value="/dashBoard", method= RequestMethod.GET)
public String dashBoard(UserLoginInfo login, ModelMap model, HttpSession session){
DashBoard dashboard=new DashBoard();
String mnb = (String) session.getAttribute("logsesh");
List eventList=dashboard.dashList(mnb);
model.addAttribute("eventlist", eventList);
return "Dashboard";
}
}
|
4cd28f56-7fcd-4bed-9d57-135785584cf9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-24 07:36:06", "repo_name": "NastyaGribanova/HealthyLifestyle", "sub_path": "/src/Register.java", "file_name": "Register.java", "file_ext": "java", "file_size_in_byte": 1121, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "31b022fa71bfb7362193ad1ff6be6674b94a9051", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NastyaGribanova/HealthyLifestyle | 172 | FILENAME: Register.java | 0.262842 | import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
/*
Страничка регистрации
*/
@WebServlet("/registration")
public class Register extends HttpServlet {
UserBL businessLogic = new UserBL();
public Register() throws SQLException {
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
businessLogic.register(request, response);
} catch (SQLException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.getRequestDispatcher("jsp/registrationPage.jsp").forward(request, response);
}
}
|
97ad2609-30a5-4ac1-b12f-e18a03b0cbc9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-16 21:39:14", "repo_name": "inorser/android-hufflepuff", "sub_path": "/app/src/main/java/com/example/androidtestapp/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1170, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "8680ba3097f0c70a470899dadb048d71745d7326", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/inorser/android-hufflepuff | 185 | FILENAME: MainActivity.java | 0.278257 | package com.example.androidtestapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private int counter = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final TextView textField = findViewById(R.id.textField);
final Button buttonInc = findViewById(R.id.buttonInc);
final Button buttonDec = findViewById(R.id.buttonDec);
buttonInc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
counter++;
textField.setText(String.valueOf(counter));
}
});
buttonDec.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
counter--;
textField.setText(String.valueOf(counter));
}
});
}
}
|
7c36c09b-34b4-4a0c-9bc8-68272f11f47a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-25 19:56:31", "repo_name": "claveroJuan/Workspace", "sub_path": "/Guia9/src/bip/TarjetaBip.java", "file_name": "TarjetaBip.java", "file_ext": "java", "file_size_in_byte": 1169, "line_count": 80, "lang": "en", "doc_type": "code", "blob_id": "56afac67cfde723e13d79d42e6df5bbad183ebf6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/claveroJuan/Workspace | 344 | FILENAME: TarjetaBip.java | 0.264358 | /**
*
*/
package bip;
/**
* @author JuanClavero
*
*/
public abstract class TarjetaBip
{
private int saldo;
private String color;
private int nTarjeta;
public TarjetaBip ()
{
}
/**
* @param saldo
* @param color
* @param nTarjeta
*/
public TarjetaBip(int saldo, String color, int nTarjeta) {
super();
this.saldo = saldo;
this.color = color;
this.nTarjeta = nTarjeta;
}
public abstract void cargar(int monto);
public abstract void pagarPasaje ();
/**
* @return the saldo
*/
public int getSaldo() {
return saldo;
}
/**
* @param saldo the saldo to set
*/
public void setSaldo(int saldo) {
this.saldo = saldo;
}
/**
* @return the color
*/
public String getColor() {
return color;
}
/**
* @param color the color to set
*/
public void setColor(String color) {
this.color = color;
}
/**
* @return the nTarjeta
*/
public int getnTarjeta() {
return nTarjeta;
}
/**
* @param nTarjeta the nTarjeta to set
*/
public void setnTarjeta(int nTarjeta) {
this.nTarjeta = nTarjeta;
}
public void imprimir ()
{
System.out.println(this.nTarjeta);
System.out.println(this.saldo);
}
}
|
82ba108e-5da2-436b-ba16-e14caf090b41 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-04 03:44:41", "repo_name": "guogai1949/js_code", "sub_path": "/src/main/java/com/js/worker/code/netty/client/NettyClientPipelineFactory.java", "file_name": "NettyClientPipelineFactory.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "e051f201cd120301085984c5d79d56563cef8424", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/guogai1949/js_code | 195 | FILENAME: NettyClientPipelineFactory.java | 0.273574 | package com.js.worker.code.netty.client;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import com.js.worker.code.netty.server.NettyMessageDecoder;
import com.js.worker.code.netty.server.NettyMessageEncoder;
public class NettyClientPipelineFactory implements ChannelPipelineFactory {
private NettyClient nettyClient;
public NettyClientPipelineFactory(NettyClient nettyClient) {
this.nettyClient = nettyClient;
}
@Override
public ChannelPipeline getPipeline() throws Exception {
// Create a default pipeline implementation.
ChannelPipeline pipeline = Channels.pipeline();
// Decoder
pipeline.addLast("decoder", new NettyMessageDecoder());
// Encoder
pipeline.addLast("encoder", new NettyMessageEncoder());
// business logic.
pipeline.addLast("handler", new NettyClientHandler(nettyClient));
return pipeline;
}
}
|
68442414-a80d-441a-bbe7-09661472462d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-26 01:25:34", "repo_name": "IrisWolfBite/demo", "sub_path": "/springboot_mybatis_redis_activitymq_dubbo/src/main/java/com/zjf/demo/service/impl/StudentServiceImpl.java", "file_name": "StudentServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1198, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7fcb4410419954bfc491827870a5dc26c5f72f29", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/IrisWolfBite/demo | 260 | FILENAME: StudentServiceImpl.java | 0.264358 | package com.zjf.demo.service.impl;
import com.zjf.demo.mapper.StudentMapper;
import com.zjf.model.Student;
import com.zjf.service.StudentService;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;
/**
* className:StudentServiceImpl
* package:com.zjf.demo.service
* Description:简单描述
*
* @date: 2019/11/25 0:27
* @Author: ASUS
*/
@Service //spring的Service注解
@com.alibaba.dubbo.config.annotation.Service(interfaceClass = StudentService.class,timeout = 10000) //相当于暴露接口
public class StudentServiceImpl implements StudentService {
@Resource
private StudentMapper studentMapper;
@Resource
private RedisTemplate<String,Student> redisTemplate;
@Override
public int add(Student student) {
int num = studentMapper.insertSelective(student);
return num;
}
@Override
public int modify(Student student) {
int num = studentMapper.updateByPrimaryKeySelective(student);
redisTemplate.opsForValue().set("student", student, 60, TimeUnit.SECONDS);
return num;
}
}
|
3feb59bb-0b4e-40d5-8c42-0cc7bb525028 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-02-10 15:32:19", "repo_name": "bwssytems/ha-bridge", "sub_path": "/src/main/java/com/bwssystems/HABridge/plugins/hass/Service.java", "file_name": "Service.java", "file_ext": "java", "file_size_in_byte": 1068, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "ec07e2d85909cd6deceb81bfebeac86ab6c0758a", "star_events_count": 1604, "fork_events_count": 283, "src_encoding": "UTF-8"} | https://github.com/bwssytems/ha-bridge | 247 | FILENAME: Service.java | 0.239349 |
package com.bwssystems.HABridge.plugins.hass;
import java.util.Map;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Service {
@SerializedName("domain")
@Expose
private String domain;
@SerializedName("services")
@Expose
private Map<String, ServiceElement> services;
public Service(String domain, Map<String, ServiceElement> services) {
super();
this.domain = domain;
this.services = services;
}
/**
*
* @return
* The domain
*/
public String getDomain() {
return domain;
}
/**
*
* @param domain
* The domain
*/
public void setDomain(String domain) {
this.domain = domain;
}
/**
*
* @return
* The services
*/
public Map<String, ServiceElement> getServices() {
return services;
}
/**
*
* @param domain
* The services
*/
public void setServices(Map<String, ServiceElement> services) {
this.services = services;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.