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 |
|---|---|---|---|---|---|---|
026411fc-57ea-4eef-b676-d0d9003db53d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-08-02 20:28:28", "repo_name": "nraychaudhuri/spring-akka-sample", "sub_path": "/src/main/java/org/springframework/samples/travel/search/FailureInterceptorJava.java", "file_name": "FailureInterceptorJava.java", "file_ext": "java", "file_size_in_byte": 1214, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "a24f572bf7c2d0c80b54fb2704b00eac0ee6fc93", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/nraychaudhuri/spring-akka-sample | 259 | FILENAME: FailureInterceptorJava.java | 0.267408 | package org.springframework.samples.travel.search;
import org.springframework.samples.travel.search.messages.CircuitBreakerMessages.*;
import org.springframework.samples.travel.search.messages.JHotelResponse;
import scala.concurrent.duration.Duration;
import akka.actor.ActorRef;
import akka.actor.ReceiveTimeout;
import akka.actor.UntypedActor;
public class FailureInterceptorJava extends UntypedActor {
private ActorRef detector;
private ActorRef listener;
public FailureInterceptorJava(ActorRef detector, ActorRef listener) {
this.detector = detector;
this.listener = listener;
getContext().setReceiveTimeout(Duration.create("1 seconds"));
}
@Override
public void onReceive(Object msg) throws Exception {
if(msg instanceof Exception) {
detector.tell(new JQueryFail(), getSelf());
listener.tell(msg, getSelf());
getContext().stop(getSelf());
}
if(msg instanceof JHotelResponse) {
listener.tell(msg, getSelf());
detector.tell(new JQueryOk(), getSelf());
}
if(msg instanceof ReceiveTimeout) {
listener.tell(new FailWhaleException("Search Service is unavailable"), null);
detector.tell(new JQueryFail(), null);
getContext().stop(getSelf());
}
}
}
|
b03165de-510e-4ea9-8487-a32a1b62df47 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-07-25T12:00:46", "repo_name": "agudmund/util", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1000, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "1a79b7f15756e7e361d7c35d3a30cce6fde0850e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/agudmund/util | 246 | FILENAME: README.md | 0.264358 | # util
Generic Utilities
Add ./bin to $PATH (export PATH={install dir}/bin;$PATH)
Add ./lib to $PYTHONPATH (export PYTHONPATH={install dir}/lib;$PYTHONPATH)
./compress_content.py
--[ Compresses the current directory per file and applies a password to the archive
| Usage: ./compress_content.py -f dpx -p password
./findings.py
--[ Scans a directory tree and reports back the latest files which have been modified and when.
| Usage: ./findings.py + (hard coded path at the top of script)
./icon_assign.py
--[ Bulk applies an icon to a file under Mac OS X
| Usage: ./icon_assign.py file icon.png
| find . -type f -exec ./icon_assign.py {} icon.png \; (will set the same icon to all files in the current folder and onward)
./inpsector.py
--[ Simple python callback trace
| Usage: copy/paste this into your code and observe.
./measure.py
--[ Simple profiler which reveals the performance differences between two code sets.
| Usage: Self explanitory within the code.
[y mas][...] |
c4762e6d-e2f5-414c-9733-e680b038128c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2010-03-08T14:59:26", "repo_name": "meeech/aba-flickr", "sub_path": "/README.markdown", "file_name": "README.markdown", "file_ext": "markdown", "file_size_in_byte": 1079, "line_count": 42, "lang": "en", "doc_type": "text", "blob_id": "7d5ff95a64595b28a6f420305009c620a1009a73", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/meeech/aba-flickr | 283 | FILENAME: README.markdown | 0.182426 | aba-flickr
==========
Simple HTML/CSS/JS.
Mixes YUI and Shadowbox ().
Meant for personal Gallery page, while still keeping flickr as backend/main archive.
Usage
-----
See aba.html for basic example.
Included is a css skeleton, dev.css, a minimal look.
For another example, see aba.css, which shows how to make a more complex/customized page by just changing the css.
Some simple configs
**required**
<pre>
myConfig.flickrUserName = 'amisoll';
myConfig.flickrUserId = '35130544@N02';
</pre>
<pre>
myConfig.tags = ['montreal','montreal,night','israel','lighthouse','night'];
</pre>
**optional**
<pre>
//By default, we use Normal picture size. Set pictureSize to \_b for large images in shadowbox.
myConfig.pictureSize = '_b';
myConfig.galleryThumbsPerRow = 5;
</pre>
About
-----
Made for my dad. He wanted a more personalized gallery for his photos.
I wanted to keep it simple [ie: no backend for me to maintain,no php proxies], and needed to get comfy with YUI3.
He already knows how to use flickr (via aperture). There may be bugs :)
Work in progress atm.
|
2df1c777-39bc-460d-80ee-8b82928a9569 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-16 17:12:06", "repo_name": "InevitableAnup/BakingApp", "sub_path": "/app/src/main/java/in/handmademess/bakingapp/Model/IngredientsObject.java", "file_name": "IngredientsObject.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "fd230d2d656d0a46a336b6fa6c958a5a22749152", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/InevitableAnup/BakingApp | 227 | FILENAME: IngredientsObject.java | 0.235108 | package in.handmademess.bakingapp.Model;
/**
* Created by Anup on 07-11-2017.
*/
public class IngredientsObject {
double quantity;
String measure,ingredient;
public IngredientsObject() {
}
public IngredientsObject(double quantity, String measure, String ingredient) {
this.quantity = quantity;
this.measure = measure;
this.ingredient = ingredient;
}
public double getQuantity() {
return quantity;
}
public void setQuantity(double quantity) {
this.quantity = quantity;
}
public String getMeasure() {
return measure;
}
public void setMeasure(String measure) {
this.measure = measure;
}
public String getIngredient() {
return ingredient;
}
public void setIngredient(String ingredient) {
this.ingredient = ingredient;
}
@Override
public String toString() {
return "IngredientsObject{" +
"quantity=" + quantity +
", measure='" + measure + '\'' +
", ingredient='" + ingredient + '\'' +
'}';
}
}
|
fb90c4d0-67f3-40d4-aa47-61d108a1bc2d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-18 17:16:24", "repo_name": "Aseerah/P13-MyTasks", "sub_path": "/app/src/main/java/com/myapplicationdev/android/mytask/Tasks.java", "file_name": "Tasks.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "f0da200657f2e404e0c4591402b222289f4b8d2a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Aseerah/P13-MyTasks | 259 | FILENAME: Tasks.java | 0.247987 | package com.myapplicationdev.android.mytask;
import java.io.Serializable;
public class Tasks implements Serializable {
private int id;
private String title;
private int yearReleased;
private int stars;
public Tasks(String title, int yearReleased, int stars) {
this.title = title;
this.yearReleased = yearReleased;
this.stars = stars;
}
public Tasks(int id, String title, int yearReleased, int stars) {
this.id = id;
this.title = title;
this.yearReleased = yearReleased;
this.stars = stars;
}
public int getId() {
return id;
}
public Tasks setId(int id) {
this.id = id;
return this;
}
public String getTitle() {
return title;
}
public Tasks setTitle(String title) {
this.title = title;
return this;
}
public int getYearReleased() {
return yearReleased;
}
public Tasks setYearReleased(int yearReleased) {
this.yearReleased = yearReleased;
return this;
}
public int getStars() {
return stars;
}
public Tasks setStars(int stars) {
this.stars = stars;
return this;
}
}
|
7f9490ce-d903-41c9-ac24-67bc3bd462d2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-04-24T10:54:32", "repo_name": "Redecorating/t2-audio-config-files", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1041, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "0bf5a79042e760d1970537c66b00246ba6d29abf", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Redecorating/t2-audio-config-files | 312 | FILENAME: README.md | 0.198064 | Moved to [here](https://github.com/Redecorating/archinstall-mbp/tree/main/apple-t2-audio-config)
# t2-audio-config-files
If you are on Arch or an Arch based distro, you can get packages for this from the releases page.
Script to install config files for audio with Macs with the T2 chip. It'll detect if you need the different config files for the 16,1 and 16,4 models.
I've also made it so you can select just Headphones or just Speakers, as for some people (including me) when programs use the Microphone, things crash. Another change I've made is making pipewire work as well as pulseaudio.
```sh
git clone https://github.com/Redecorating/t2-audio-config-files
cd t2-audio-config-files
sudo ./install.sh
```
Dependancies:
Pulseaudio or Pipewire, as you need thoese for sound.
The BCE module described here https://wiki.t2linux.org/guides/dkms/
A patched kernel for use with t2 macs.
Sources
https://gist.github.com/kevineinarsson/8e5e92664f97508277fefef1b8015fba
https://gist.github.com/MCMrARM/c357291e4e5c18894bea10665dcebffb
|
fa316aaa-c1d4-4b50-8331-119b4dd2bc2b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-16 11:37:04", "repo_name": "ruhui/ZZC", "sub_path": "/app/src/main/java/com/zzcar/zzc/adapters/viewholders/IntegralViewHold.java", "file_name": "IntegralViewHold.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "4eaf4809e8eda5c0592ca34a85fa677272f85b5b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ruhui/ZZC | 234 | FILENAME: IntegralViewHold.java | 0.23231 | package com.zzcar.zzc.adapters.viewholders;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.zzcar.zzc.R;
import com.zzcar.zzc.models.IntegralDetail;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;
/**
* 描述:
* 作者:黄如辉 时间 2017/5/15.
*/
@EViewGroup(R.layout.adapter_integral)
public class IntegralViewHold extends LinearLayout {
@ViewById(R.id.textView78)
TextView title;
@ViewById(R.id.textView79)
TextView timedata;
@ViewById(R.id.textView80)
TextView point;
public IntegralViewHold(Context context) {
super(context);
}
public IntegralViewHold(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public void bind(IntegralDetail integralDetail){
title.setText(integralDetail.getName());
timedata.setText(integralDetail.getCreate_time());
point.setText(integralDetail.getIntegral()+"");
}
}
|
61b57421-1cb8-4ab5-bffb-e3d305d7d9e0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-30 08:23:24", "repo_name": "hasuna/Android", "sub_path": "/小实验/intent/intent/app/src/main/java/com/example/login/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "8aec4b674a92d8f5a77efeb7ed515ff17ee5c3db", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hasuna/Android | 218 | FILENAME: User.java | 0.235108 | package com.example.login;
/**
* Created by 王梓豪 on 2017/12/5.
*/
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class User extends AppCompatActivity {
private Button mReturnButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.user);
mReturnButton = (Button)findViewById(R.id.returnback);
}
public void back_to_login(View view) {
Intent intent3 = new Intent(User.this,MainActivity.class) ;
startActivity(intent3);
finish();
}
public void tonext(View view) {
Intent intent4 = new Intent(User.this,lianxiren.class) ;
startActivity(intent4);
finish();
}
public void toupdata(View view) {
Intent intent4 = new Intent(User.this,updata.class) ;
startActivity(intent4);
finish();
}
}
|
05423a1f-2816-4718-a4f4-b3a2ec2e90e4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-18 07:32:32", "repo_name": "jasonhww/Demos", "sub_path": "/ThreadDemo/app/src/main/java/org/jasonhww/threaddemo/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "32d3cacf4ba452307f0147a601f23f6ce544646d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jasonhww/Demos | 190 | FILENAME: MainActivity.java | 0.20947 | package org.jasonhww.threaddemo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import org.jasonhww.threaddemo.threadLocalDm.ThreadLocalActivity;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private static final String TAG = "MainActivity";
private Button threadlocal;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
initListener();
}
private void initView() {
threadlocal = findViewById(R.id.threadlocal);
}
private void initListener() {
threadlocal.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.threadlocal:
ThreadLocalActivity.startActivity(this);
break;
default:
break;
}
}
}
|
455539f2-8248-4ba2-84f9-efcc5ae3d810 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-14 11:02:04", "repo_name": "SebastianOltmanns/birthdays", "sub_path": "/app/src/main/java/com/woodplantation/geburtstagsverwaltung/storage/StorageHandler.java", "file_name": "StorageHandler.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "dd9b96b63fdbc706684b403d3f83489d97af7089", "star_events_count": 6, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/SebastianOltmanns/birthdays | 251 | FILENAME: StorageHandler.java | 0.272799 | package com.woodplantation.geburtstagsverwaltung.storage;
import android.content.Context;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import javax.inject.Inject;
import dagger.hilt.android.qualifiers.ApplicationContext;
/**
* Created by Sebu on 10.03.2016.
* Contact: sebastian.oltmanns.developer@googlemail.com
*/
@Deprecated
public class StorageHandler {
private final Context context;
public static final String filePath = "data";
@Inject
public StorageHandler(@ApplicationContext Context context) {
this.context = context;
}
@Deprecated
public ArrayList<DataSet> loadData() {
try {
FileInputStream fis = context.openFileInput(filePath);
BufferedInputStream bis = new BufferedInputStream(fis);
ObjectInputStream input = new ObjectInputStream(bis);
ArrayList<DataSet> result = (ArrayList<DataSet>) input.readObject();
input.close();
bis.close();
fis.close();
return result;
} catch (IOException | ClassNotFoundException e) {
return new ArrayList<>();
}
}
}
|
1fc7b230-3c44-45b2-8689-94663001087e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-28 14:32:55", "repo_name": "anton-johansson/2d-game", "sub_path": "/2d-game-client/2d-game-client-application/src/main/java/com/antonjohansson/game/client/app/asset/map/MapPart.java", "file_name": "MapPart.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "52411983ac3fde18849d9eee3e934158aa8c9e0c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/anton-johansson/2d-game | 226 | FILENAME: MapPart.java | 0.267408 | package com.antonjohansson.game.client.app.asset.map;
import com.antonjohansson.game.client.app.asset.common.IAsset;
/**
* Defines a small part of the map.
*/
public class MapPart implements IAsset
{
private final MapPartIdentifier identifier;
private final MapTile[][] tiles;
MapPart(MapPartIdentifier identifier, MapTile[][] tiles)
{
this.identifier = identifier;
this.tiles = tiles;
}
@Override
public MapPartIdentifier getIdentifier()
{
return identifier;
}
/**
* Gets the tile of the given coordinate within the part.
*
* @param x The horizontal coordinate (x) of the part.
* @param y The vertical coordinate (y) of the part.
* @return Returns the tile at the specified coordinate.
*/
public MapTile getTile(int x, int y)
{
return tiles[x][y];
}
public int getX()
{
return identifier.getX();
}
public int getY()
{
return identifier.getY();
}
}
|
46cf82b4-66c4-4c13-ad93-a685c34fe934 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-08 00:58:39", "repo_name": "Kanderlendin/JavaCampHomework", "sub_path": "/JavaCamp_D5H1/src/JavaCamp_D5H1/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "cb874612cd617e93325e9e0b85d57c78c4dc92c1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Kanderlendin/JavaCampHomework | 224 | FILENAME: Main.java | 0.276691 | package JavaCamp_D5H1;
import JavaCamp_D5H1.entities.concretes.User;
import JavaCamp_D5H1.business.abstracts.UserService;
import JavaCamp_D5H1.business.concretes.UserManager;
import JavaCamp_D5H1.core.adapters.GMailLoginManagerAdapter;
import JavaCamp_D5H1.business.concretes.CheckManager;
import JavaCamp_D5H1.dataAccess.concretes.DatabaseUserDao;
public class Main {
public static void main(String[] args) {
UserService userService = new UserManager(new DatabaseUserDao(), new CheckManager(), new GMailLoginManagerAdapter());
User newUser = new User();
newUser.setId(0);
newUser.setFirstName("Hasan");
newUser.setLastName("TENK");
newUser.seteMail("htenk@gmail.com");
newUser.setPassword("dogru");
userService.add(newUser);
System.out.println("-----------------------------------------------------------------------------------");
userService.login("htenk@gmail.com","dogru");
userService.login("htenk@gmail.com","yanlis");
}
}
|
be5253e2-e160-4a37-b6be-2a0ffa77d775 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-14 12:31:36", "repo_name": "folio-org/mod-finance", "sub_path": "/src/main/java/org/folio/services/protection/AcqUnitMembershipsService.java", "file_name": "AcqUnitMembershipsService.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "f3a31568e7329481b30379e746b2af294ac5b5ad", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/folio-org/mod-finance | 208 | FILENAME: AcqUnitMembershipsService.java | 0.247987 | package org.folio.services.protection;
import java.util.concurrent.CompletableFuture;
import org.folio.rest.acq.model.finance.AcquisitionsUnitMembershipCollection;
import org.folio.rest.core.RestClient;
import org.folio.rest.core.models.RequestContext;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
public class AcqUnitMembershipsService {
public final Logger logger = LogManager.getLogger(AcqUnitMembershipsService.class);
private final RestClient acqUnitMembershipsRestClient;
public AcqUnitMembershipsService(RestClient acqUnitMembershipsRestClient) {
this.acqUnitMembershipsRestClient = acqUnitMembershipsRestClient;
}
public CompletableFuture<AcquisitionsUnitMembershipCollection> getAcquisitionsUnitsMemberships(String query, int offset,
int limit, RequestContext requestContext) {
return acqUnitMembershipsRestClient.get(query, offset, limit, requestContext, AcquisitionsUnitMembershipCollection.class);
}
}
|
88be9a21-f838-45fa-b127-db25322bb7ca | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-25 21:40:04", "repo_name": "dennerdemoraes/nubank-code-challenge", "sub_path": "/app/src/main/java/br/com/nubank/core/EventHandlerManager.java", "file_name": "EventHandlerManager.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "c29937e3948c6241fba82723a41f91ff6afdbbe9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dennerdemoraes/nubank-code-challenge | 210 | FILENAME: EventHandlerManager.java | 0.277473 | package br.com.nubank.core;
import com.google.inject.Inject;
import br.com.nubank.core.entity.AccountState;
import br.com.nubank.core.entity.Event;
import br.com.nubank.core.entity.EventType;
import br.com.nubank.core.usecase.AccountEventHandlerUseCase;
import br.com.nubank.core.usecase.EventHandlerUseCase;
import br.com.nubank.core.usecase.TransactionEventHandlerUseCase;
public class EventHandlerManager {
private final AccountManager accountManager;
private EventHandlerUseCase useCase;
@Inject
public EventHandlerManager(AccountManager accountManager) {
this.accountManager = accountManager;
}
public void setEventHandler(EventType eventType) {
switch (eventType) {
case ACCOUNT:
useCase = new AccountEventHandlerUseCase(accountManager);
break;
case TRANSACTION:
useCase = new TransactionEventHandlerUseCase(accountManager);
break;
}
}
public AccountState execute(Event<?> event) {
return useCase.execute(event);
}
}
|
11fcb3bf-d04d-41b6-baff-9c7b5ac5771f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-24 01:09:40", "repo_name": "ToreB/hateoas-api", "sub_path": "/src/main/java/no/toreb/hateoasapi/api/common/response/CollectionMetadata.java", "file_name": "CollectionMetadata.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "aa598e160e8f0af9bda24bb9f301eee0b7b94a28", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ToreB/hateoas-api | 249 | FILENAME: CollectionMetadata.java | 0.277473 | package no.toreb.hateoasapi.api.common.response;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
class CollectionMetadata {
private final int count;
public CollectionMetadata(final int count) {
this.count = count;
}
public int getCount() {
return count;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final CollectionMetadata that = (CollectionMetadata) o;
return new EqualsBuilder()
.append(count, that.count)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
.append(count)
.toHashCode();
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
.append("count", count)
.toString();
}
}
|
cf99ac39-e093-4d9a-b313-2219c293c0f4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-15 08:46:55", "repo_name": "Moveuk/2021_JSP", "sub_path": "/0811_Lecture24/webstudy11_Mission/src/main/java/com/ldu/controller/action/EmployeeListAction.java", "file_name": "EmployeeListAction.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "0736fd19b820e745933e24cd5f11c5a70e60a678", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Moveuk/2021_JSP | 200 | FILENAME: EmployeeListAction.java | 0.27513 | package com.ldu.controller.action;
import java.io.IOException;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ldu.dao.EmployeeDAO;
import com.ldu.dto.EmployeeVO;
public class EmployeeListAction implements Action {
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("EmployeeListAction 호출됨");
String url = "emp/empList.jsp";
EmployeeDAO eDao = EmployeeDAO.getInstance();
List<EmployeeVO> empList = eDao.selectAllEmployees();
if (empList == null) {
System.out.println("EmployeeListAction.execute 값 : null");
} else {
request.setAttribute("empList", empList);
System.out.println(empList);
}
RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/"+url);
dispatcher.forward(request, response);
}
}
|
54b75fd1-2ed0-41d0-a1cb-b6fadc30843f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-09 07:45:16", "repo_name": "codemasternode/MyBlogBackend", "sub_path": "/src/main/java/com/awareness/ApiWithJWT/model/blog/BlogCategory.java", "file_name": "BlogCategory.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "a98020347df995f3967953a6e5019a4888bf1dd6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/codemasternode/MyBlogBackend | 226 | FILENAME: BlogCategory.java | 0.243642 | package com.awareness.ApiWithJWT.model.blog;
import com.awareness.ApiWithJWT.model.overalls.Category;
import com.awareness.ApiWithJWT.model.tutorial.Tutorial;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.HashSet;
import java.util.Set;
@Entity
@Table(name = "blog_categories")
public class BlogCategory extends Category{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@OneToMany(mappedBy = "blogCategory",cascade = CascadeType.ALL)
private Set<BlogPost> tutorialSet = new HashSet<>();
public BlogCategory() {
}
public BlogCategory(String name, String color) {
super(name, color);
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Set<BlogPost> getTutorialSet() {
return tutorialSet;
}
public void setTutorialSet(Set<BlogPost> tutorialSet) {
this.tutorialSet = tutorialSet;
}
}
|
6674c09c-2845-49fc-9255-593e05da5bd0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-05 21:57:12", "repo_name": "Avilocap/ODB", "sub_path": "/src/main/java/org/springframework/samples/oculusdb/category/Category.java", "file_name": "Category.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "9f81c7ffa959e83d0b0336775df39606e073a962", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Avilocap/ODB | 212 | FILENAME: Category.java | 0.221351 |
package org.springframework.samples.oculusdb.category;
import org.springframework.samples.oculusdb.model.Application;
import org.springframework.samples.oculusdb.model.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import java.util.Collection;
@Entity
@Table(name = "category")
public class Category extends BaseEntity {
@Column(name = "title")
@NotEmpty
private String title;
@Column(name = "description")
private String description;
@OneToMany(mappedBy = "category")
private Collection<Application> applications;
public String getTitle() {
return this.title;
}
public void setTitle(final String title) {
this.title = title;
}
public String getDescription() {
return this.description;
}
public void setDescription(final String description) {
this.description = description;
}
public Collection<Application> getApplications() {
return applications;
}
public void setApplications(Collection<Application> applications) {
this.applications = applications;
}
@Override
public String toString() {
return this.title + " ~ " + this.description;
}
}
|
585482bd-38be-454c-aaf0-3447dc4138cc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-04 21:10:11", "repo_name": "MerveBusraDurmus/HRMS", "sub_path": "/hrms/src/main/java/kodlamaio/hrms/core/entities/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "f780e2e01e8e874f29db36846049222cd4368f06", "star_events_count": 5, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MerveBusraDurmus/HRMS | 257 | FILENAME: User.java | 0.281406 | package kodlamaio.hrms.core.entities;
import java.time.LocalDateTime;
import javax.persistence.*;
import javax.validation.constraints.*;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@NoArgsConstructor
@ToString
@EqualsAndHashCode
@Entity
@Table(name = "users")
@Inheritance(strategy = InheritanceType.JOINED)
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="id")
private int id;
@NotBlank
@Email
@Size(max=100)
@Column(name="email")
private String email;
@NotBlank
@Size(max=100)
@Column(name="password")
private String password;
@NotNull
@Column(name="create_date")
private LocalDateTime createDate = LocalDateTime.now();
@NotNull
@AssertTrue
@Column(name="is_active")
private boolean isActive;
@Builder
public User(final int id,@NotBlank @Email @Size(max = 100) final String email,
@NotBlank @Size(max = 100) final String password) {
this.id = id;
this.email = email;
this.password = password;
}
}
|
064e0f91-68a9-49fa-a2c5-dc59e0eff2a5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-08-27T17:55:46", "repo_name": "vinayrav/pramati", "sub_path": "/springreadme.md", "file_name": "springreadme.md", "file_ext": "md", "file_size_in_byte": 1216, "line_count": 48, "lang": "en", "doc_type": "text", "blob_id": "c4ba50026e7881a9d1fafa7f9cb415a579a474fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vinayrav/pramati | 295 | FILENAME: springreadme.md | 0.294215 | # Spring Boot Demo
Minimal Spring Boot sample app.
## Installation
Download Spring Tool suite latest version
*https://spring.io/tools*
## Usage
```
Create Spring Starter project
Create inmemomry database h2
i.e(spring.h2.console.enabled=true
spring.datasource.platform=h2
spring.datasource.url=jdbc:h2:mem:tab)
Create an interface that extends JpaRepository.
Create jsp (view page) in webapp folder i.e src->main-webapp->name.jsp
(Mention the changes in application properties if the file is saved in other folder)
```
## Dependencies to include
```
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>9.0.14</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>
```
## Files Included
**Files included in this project**
- Data
- DataController
- Data Repo
- Security Config
- home.jsp
- show.jsp
- Data.sql
|
a2ab30c0-4e9d-4f64-9327-14031e53fe01 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-04-18 01:29:13", "repo_name": "the-blue-alliance/the-blue-alliance-android", "sub_path": "/android/src/main/java/com/thebluealliance/androidclient/datafeed/RequestParams.java", "file_name": "RequestParams.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "b42dfb369b8efd441fe95ba501ab408a42e8a5fc", "star_events_count": 71, "fork_events_count": 48, "src_encoding": "UTF-8"} | https://github.com/the-blue-alliance/the-blue-alliance-android | 231 | FILENAME: RequestParams.java | 0.252384 | package com.thebluealliance.androidclient.datafeed;
public class RequestParams {
public boolean cacheLocally;
public boolean forceFromCache;
public boolean forceFromWeb;
public RequestParams() {
cacheLocally = true;
forceFromCache = false;
forceFromWeb = false;
}
public RequestParams(boolean forceFromCache) {
this();
this.forceFromCache = forceFromCache;
}
public RequestParams(boolean forceFromCache, boolean forceFromWeb) {
this();
this.forceFromCache = forceFromCache;
this.forceFromWeb = forceFromWeb;
}
public RequestParams(boolean cacheLocally, boolean forceFromCache, boolean forceFromWeb) {
this();
this.cacheLocally = cacheLocally;
this.forceFromCache = forceFromCache;
this.forceFromWeb = forceFromWeb;
}
@Override
public String toString() {
return "forceFromCache:" + forceFromCache + " cacheLocally:" + cacheLocally + " forceFromWeb:" + forceFromWeb;
}
}
|
0685d57f-f24d-4076-b2c2-115d20006018 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-21 16:40:19", "repo_name": "benjaminr-ps/vso-httpclient-java", "sub_path": "/Rest/com.microsoft.alm.client.core/src/main/generated/com/microsoft/alm/core/webapi/model/SourceControlTypes.java", "file_name": "SourceControlTypes.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "df8da9bd5c827dd1e19741c8cd55ccfb62f9cc0f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/benjaminr-ps/vso-httpclient-java | 221 | FILENAME: SourceControlTypes.java | 0.294215 | /*
* ---------------------------------------------------------
* Copyright(C) Microsoft Corporation. All rights reserved.
* ---------------------------------------------------------
*
* ---------------------------------------------------------
* Generated file, DO NOT EDIT
* ---------------------------------------------------------
*
* See following wiki page for instructions on how to regenerate:
* https://vsowiki.com/index.php?title=Rest_Client_Generation
*/
package com.microsoft.alm.core.webapi.model;
/**
*/
public enum SourceControlTypes {
TFVC(1),
GIT(2),
;
private int value;
private SourceControlTypes(final int value) {
this.value = value;
}
public int getValue()
{
return value;
}
@Override
public String toString() {
final String name = super.toString();
if (name.equals("TFVC")) { //$NON-NLS-1$
return "tfvc"; //$NON-NLS-1$
}
if (name.equals("GIT")) { //$NON-NLS-1$
return "git"; //$NON-NLS-1$
}
return null;
}
}
|
9743cb86-e486-45c7-8e3f-0fba4bd399c9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-15 01:39:00", "repo_name": "yhltd/workflow_java", "sub_path": "/code/pro/src/servlet/modelServlet.java", "file_name": "modelServlet.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "7927b149377c71a05695e33f4f6977f7e2b2833b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yhltd/workflow_java | 190 | FILENAME: modelServlet.java | 0.285372 | package servlet;
import javaBean.Model;
import service.modelService;
import util.JsonUtil;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
@WebServlet(name = "model", urlPatterns = { "/model" },asyncSupported = true)
public class modelServlet extends javax.servlet.http.HttpServlet {
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
modelService ms = new modelService();
List<Model> list = ms.getList();
response.setContentType("text/html");
response.setCharacterEncoding("utf-8");
PrintWriter out = response.getWriter();
JsonUtil ju = new JsonUtil();
String result = ju.toJson(list);
out.print(result);
out.flush();
out.close();
}
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
}
} |
a23d9115-0311-496c-ad8a-195c6dd16df3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-19 07:04:20", "repo_name": "gaoyussdut/EIOS", "sub_path": "/dependency-package/utils/src/main/java/top/toptimus/formula/webloader/ServletConfigProperties.java", "file_name": "ServletConfigProperties.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "bea169b45d24b64ef9a73fea53ede6753f814efa", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/gaoyussdut/EIOS | 241 | FILENAME: ServletConfigProperties.java | 0.293404 | package top.toptimus.formula.webloader;
import org.apache.commons.lang3.StringUtils;
import top.toptimus.formula.util.Properties;
import top.toptimus.formula.util.Settings;
import javax.servlet.ServletConfig;
/**
* A Properties wrapper for ServletConfig.
*
* @author gaoyu
* @version 1.6.8.13 [gaoyu 20170427] <br>
* - 指定Settings为父节点 <br>
*/
public class ServletConfigProperties extends Properties {
protected ServletConfig servletConfig = null;
public ServletConfigProperties(ServletConfig sc) {
super("ServletConfig", Settings.get());
servletConfig = sc;
}
protected void _SetValue(String _name, String _value) {
//do nothing
}
protected String _GetValue(String _name) {
if (servletConfig == null)
return "";
String value = servletConfig.getInitParameter(_name);
return StringUtils.isEmpty(value) ? servletConfig.getServletContext().getInitParameter(_name) : value;
}
public void Clear() {
// do nothing
}
}
|
6bce9b1c-317a-4185-8eb9-64799f5437d6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-04 22:34:18", "repo_name": "CMPUT301F17T19/Echoes", "sub_path": "/Echoes/app/src/main/java/com/example/cmput301f17t19/echoes/Models/UserReceivedRequestsList.java", "file_name": "UserReceivedRequestsList.java", "file_ext": "java", "file_size_in_byte": 854, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "3c5f02f11325ca614513b71b5987f31bb526a915", "star_events_count": 3, "fork_events_count": 5, "src_encoding": "UTF-8"} | https://github.com/CMPUT301F17T19/Echoes | 249 | FILENAME: UserReceivedRequestsList.java | 0.279828 | /*
* Copyright (c) Team cmput301f17t19, CMPUT301, University of Alberta - All Rights Reserved. You may use, distribute, or modify this code under terms and conditions of the Code of Students Behaviour at University of Alberta
*/
package com.example.cmput301f17t19.echoes.Models;
import java.util.ArrayList;
/**
* The Received Request list for the user
*
* @author Shan Lu
* @version 1.0
* @since 1.0
*/
public class UserReceivedRequestsList {
private String userName;
private ArrayList<ReceivedRequest> receivedRequests;
public UserReceivedRequestsList(String username) {
this.userName = username;
receivedRequests = new ArrayList<ReceivedRequest>();
}
/**
* Get the username
*
* @return String: username
*/
public String getUserName() {
return userName;
}
/**
* Get the Received request array list
*
* @return ArrayList<ReceivedRequest>: array list of ReceivedRequests
*/
public ArrayList<ReceivedRequest> getReceivedRequests() {
return receivedRequests;
}
}
|
7d433670-e83e-44c5-bc00-d3575024db48 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-07-22T12:42:17", "repo_name": "WeilerWebServices/Repl.it", "sub_path": "/replit.github.io/repls/history.md", "file_name": "history.md", "file_ext": "md", "file_size_in_byte": 1087, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "7a9a418f2accd224f4678b057ef3f6335cc5fd55", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/WeilerWebServices/Repl.it | 259 | FILENAME: history.md | 0.282196 | # Repl History
Repl.it auto-saves your code as you write, as every repl is backed by its own filesystem. If you ever make an edit to your code that you'd like to recover, repl history can help.
## How to access History
A repl's history is located at `https://repl.it/@username/repltitle/history`, but you can reach the same page by
- Choosing "History" in the three-dot menu under [My Repls](https://repl.it/repls) or
- Clicking on "saving/saved" while working in a repl.
## Using History
A repl history will show the individual changes to a file, from most to least recent. Clicking "change file" next to the file name will bring up a prompt to select the desired file. Selecting a time will reveal the code differences between the revision and the latest code.

To restore a previous revision of code, select the desired revision and click "Restore" in the top-right corner of the screen.
## Demo
Here's a short gif demonstrating repl history in action:

|
d4b7da1d-631f-4d76-aba0-026809526b51 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-24 03:28:08", "repo_name": "soldiers1989/project-2", "sub_path": "/vc-biz/vc-biz-protocol-inf/src/main/java/com/ccclubs/protocol/dto/mqtt/MachineAdditional_TradeTakeCard.java", "file_name": "MachineAdditional_TradeTakeCard.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "e6f31dbe30b8afd6a78272cc9ce53c9348ab56da", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/soldiers1989/project-2 | 274 | FILENAME: MachineAdditional_TradeTakeCard.java | 0.245085 | package com.ccclubs.protocol.dto.mqtt;
import com.ccclubs.protocol.inf.IMachineAdditionalItem;
import com.ccclubs.protocol.util.MyBuffer;
import com.ccclubs.protocol.util.StringUtils;
/**
* Created by qsxiaogang on 2017/4/17. 操作卡号
*/
public class MachineAdditional_TradeTakeCard implements IMachineAdditionalItem {
private byte additionalLength;
/**
* 操作卡号
*/
private String tradeTakeCard;
public String getTradeTakeCard() {
return StringUtils.trim(tradeTakeCard);
}
public void setTradeTakeCard(String tradeTakeCard) {
this.tradeTakeCard = tradeTakeCard;
}
@Override
public byte getAdditionalId() {
return (byte) 141;
}
@Override
public byte getAdditionalLength() {
return additionalLength;
}
public void setAdditionalLength(byte additionalLength) {
this.additionalLength = additionalLength;
}
@Override
public byte[] WriteToBytes() {
MyBuffer buff = new MyBuffer();
buff.put(getTradeTakeCard());
return buff.array();
}
@Override
public void ReadFromBytes(byte[] bytes) {
setTradeTakeCard(new String(bytes));
}
}
|
26b3bec0-e3c4-47d8-8c68-85505cfdadfc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-16 14:03:52", "repo_name": "AllegroTechDays/wwa_pawelec", "sub_path": "/src/main/java/tech/allegro/pawelec/supplier/NominatimApiSupplier.java", "file_name": "NominatimApiSupplier.java", "file_ext": "java", "file_size_in_byte": 1216, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "328cdfb33c767f89dc12f028904bcf0dbf40b0ff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AllegroTechDays/wwa_pawelec | 244 | FILENAME: NominatimApiSupplier.java | 0.273574 | package tech.allegro.pawelec.supplier;
import lombok.extern.java.Log;
import org.springframework.stereotype.Component;
import tech.allegro.pawelec.InvalidUrl;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
@Log
@Component
public class NominatimApiSupplier {
public final static String getPlaceSearchResults = "https://nominatim.openstreetmap.org/search/";
public final static String getJsonFormat = "?format=json";
public final static String getAddressDetails = "&addressdetails=0";
public final static String limitResultsToOne = "&limit=1";
public String getURLWithQuery(String place) {
String encodedPlace = getEncodeUrl(place);
StringBuffer buffer = new StringBuffer(getPlaceSearchResults);
buffer
.append(encodedPlace)
.append(getJsonFormat)
.append(getAddressDetails)
.append(limitResultsToOne);
return buffer.toString();
}
private String getEncodeUrl(String place) {
try {
return URLEncoder.encode(place, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new InvalidUrl("Invalid url");
}
}
}
|
f89af88b-a2ae-4b2b-99c9-7e1849ed8210 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-22 10:37:07", "repo_name": "ZaynJiang/guard-dwarf", "sub_path": "/dwarf-rpc/src/main/java/cn/guard/dwarf/rpc/resolver/DwarfNameResolver.java", "file_name": "DwarfNameResolver.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "8cc142659574bbfc10cfaeec5bccd81ebf3442b0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ZaynJiang/guard-dwarf | 230 | FILENAME: DwarfNameResolver.java | 0.267408 | package cn.guard.dwarf.rpc.resolver;
import io.grpc.EquivalentAddressGroup;
import io.grpc.NameResolver;
import java.util.ArrayList;
import java.util.List;
public class DwarfNameResolver extends NameResolver {
private List<EquivalentAddressGroup> servers = new ArrayList();
private NameResolver.Listener listener;
private int lbStrategy;
DwarfNameResolver() {
}
void init(int lbStrategy, List<EquivalentAddressGroup> initServices) {
this.lbStrategy = lbStrategy;
this.servers = initServices;
}
public String getServiceAuthority() {
return "";
}
public void start(NameResolver.Listener listener) {
this.listener = listener;
this.resolve(this.lbStrategy);
}
public void shutdown() {
}
private void resolve(int lbStrategy) {}
public void refresh() {
super.refresh();
this.resolve(this.lbStrategy);
}
public void refreshWithServers(int lbStrategy, List<EquivalentAddressGroup> servers) {
this.servers = servers;
this.lbStrategy = lbStrategy;
this.resolve(lbStrategy);
}
}
|
1ce9abbd-d742-46c1-ac45-36257f487d51 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-11 17:38:34", "repo_name": "buojira/stressator", "sub_path": "/src/test/java/org/buojira/rabbit/MessagesWithListenerIT.java", "file_name": "MessagesWithListenerIT.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "4540344cca0ce0d8a5a2233ea6d248098216ed3a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/buojira/stressator | 216 | FILENAME: MessagesWithListenerIT.java | 0.267408 | package org.buojira.rabbit;
import org.buojira.stressator.rabbit.service.MessageConsumerService;
import org.buojira.stressator.rabbit.service.MessageProducerService;
import org.buojira.stressator.rabbit.service.ParallelOverloadService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import com.fluig.broker.exception.BrokerException;
public class MessagesWithListenerIT extends StressatorBaseIT {
@Autowired
private MessageProducerService producer;
@Autowired
private MessageConsumerService consumer;
@Autowired
private ParallelOverloadService parallelOverloadService;
@Test
public void drill() throws BrokerException {
consumer.startupProcessingListener(getQAFluigIO());
producer.sendSomething(getQAFluigIO(), "Blá");
}
@Test
public void testMultiConnections() throws InterruptedException {
parallelOverloadService.alwaysUseNewConnectionAndKeepItOpened(
getQAFluigIO(),
2);
}
}
|
391134fe-2d99-459d-8af9-c5c7c244a2e5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-21 08:10:44", "repo_name": "tyjorange/ExcelDemo", "sub_path": "/src/test/util/FileUtil.java", "file_name": "FileUtil.java", "file_ext": "java", "file_size_in_byte": 1100, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "3640653cd4c5423f93955ff8af1c26b8c7ef5195", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tyjorange/ExcelDemo | 302 | FILENAME: FileUtil.java | 0.290981 | package test.util;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* 文件、文件夹 读取工具
*
* @author add by ts 2017.07.27
*
*/
public class FileUtil {
private static List<File> fList = null;
/**
* 获取文件夹下的文件
*
* @param filePath
* 文件或文件夹路径
* @param reset
* 是否 重置参数
* @return
*/
public static List<File> readFileOrPath(String filePath, boolean reset) {
if (reset) {
fList = new ArrayList<File>();
}
try {
File file = new File(filePath);
if (file.isDirectory()) {
String[] filelist = file.list();
for (int i = 0; i < filelist.length; i++) {
File readfile = new File(filePath + "\\" + filelist[i]);
if (!readfile.isDirectory()) {
fList.add(readfile);
} else if (readfile.isDirectory()) {
readFileOrPath(filePath + "\\" + filelist[i], false);
}
}
}
return fList;
} catch (Exception e) {
e.printStackTrace();
System.out.println("readfile() Exception:" + e.getMessage());
}
return null;
}
}
|
f9b3358b-fbf1-4d95-8192-cf0bbef8e609 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-02 07:36:14", "repo_name": "eaugene/Sms_to_silent_app", "sub_path": "/Smstest/app/src/main/java/cf/eaugenethomas/smstest/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "4f7a3f80fc505849a7d6556d4b7745078e7f02c5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/eaugene/Sms_to_silent_app | 195 | FILENAME: MainActivity.java | 0.226784 | package cf.eaugenethomas.smstest;
import android.Manifest;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.util.Log;
public class MainActivity extends AppCompatActivity {
private int MY_PERMISSIONS_REQUEST_SMS_RECEIVE = 10;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.RECEIVE_SMS},
MY_PERMISSIONS_REQUEST_SMS_RECEIVE);
}
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == MY_PERMISSIONS_REQUEST_SMS_RECEIVE) {
// YES!!
Log.i("tst", "MY_PERMISSIONS_REQUEST_SMS_RECEIVE --> YES");
}
}
}
|
9dfa810a-48f1-4acc-a192-807d10c6e46c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-15 03:27:12", "repo_name": "zhanghaifeng1989/myprojects", "sub_path": "/MyTest/app/src/main/java/com/example/administrator/mytest/DoubleService/DoubleServiceActivity.java", "file_name": "DoubleServiceActivity.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "4ab79f5b2359a3f1aa641a64be70fb51d978c71e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhanghaifeng1989/myprojects | 189 | FILENAME: DoubleServiceActivity.java | 0.239349 | package com.example.administrator.mytest.DoubleService;
import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import com.example.administrator.mytest.R;
/**
* Created by Administrator on 2019/1/21.
*/
public class DoubleServiceActivity extends Activity{
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent i1 = new Intent(DoubleServiceActivity.this, Service1.class);
// Intent i2 = new Intent(DoubleServiceActivity.this, Service2.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(i1);
// startForegroundService(i2);
} else {
startService(i1);
// startService(i2);
}
}
}
|
fb824dc5-5cc9-4769-852b-b142a06bbdb8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-10 09:47:55", "repo_name": "devinbo/RRD", "sub_path": "/src/main/java/com/rrd/filter/DruidLoginFilter.java", "file_name": "DruidLoginFilter.java", "file_ext": "java", "file_size_in_byte": 1273, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "e521194279113bc7bc7f34b89aed76cccc07ccc8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/devinbo/RRD | 237 | FILENAME: DruidLoginFilter.java | 0.220007 | package com.rrd.filter;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Created by Administrator on 2017/8/4.
*/
public class DruidLoginFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
String url = request.getRequestURI();
if(url.contains("/druid/")) {
//如果是进入到监控管理台去, 那么需要进行session校验
if(request.getSession().getAttribute("adminUser") == null) {
request.getRequestDispatcher("/adminuser.jsp").forward(request, response);
}else{
filterChain.doFilter(servletRequest, servletResponse);
}
}else{
filterChain.doFilter(servletRequest, servletResponse);
}
}
@Override
public void destroy() {
}
}
|
69958afd-c721-4228-bf6c-f6d594fe645e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-09-16T15:33:52", "repo_name": "ResDiary/ResDiary-OAuth-Examples", "sub_path": "/php/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1064, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "1e8ff903516d88daa73a7a7f96a7045c996db775", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ResDiary/ResDiary-OAuth-Examples | 247 | FILENAME: README.md | 0.242206 | # ResDiary PHP OAuth Example
This example uses https://github.com/Lusitanian/PHPoAuthLib to make the OAuth requests.
The PHP dependencies are installed using [Composer](https://getcomposer.org/). You will either need to install composer yourself, or you can use the Vagrant VM provided which will automatically setup a test environment with composer installed for you. See the main [README.md](../README.md) file for more information on this.
To run the example, edit the ResDiaryOAuthExample.php file to the API URLs and your credentials:
```php
$deploymentUrl = 'http://uk.rdbranch.com';
$consumerKey = 'Key';
$consumerSecret = 'Secret';
$secondSecret = 'SecondSecret';
$restaurantId = 1234;
```
Make sure that the composer dependencies are installed correctly:
```
ubuntu@ubuntu-xenial:/vagrant/php$ php composer.phar install
```
Then just run the example:
```
ubuntu@ubuntu-xenial:/vagrant/php$ php ResDiaryOAuthExample.php
```
The script should authenticate with the API, and then output the restaurant details for the restaurant you have specified.
|
8d1fa027-5917-49b3-9ed1-285e1b196223 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-19 08:36:34", "repo_name": "dalexxi246/rappi-itunes-catalogo", "sub_path": "/app/src/main/java/com/grability/rappiitunescatalogo/model/db/tables/Artist.java", "file_name": "Artist.java", "file_ext": "java", "file_size_in_byte": 1216, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "fda161123ec55f8e9c24b6e4c0a26902092c12e5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dalexxi246/rappi-itunes-catalogo | 279 | FILENAME: Artist.java | 0.228156 | package com.grability.rappiitunescatalogo.model.db.tables;
import com.grability.rappiitunescatalogo.model.db.AppsCatalogDatabase;
import com.raizlabs.android.dbflow.annotation.Column;
import com.raizlabs.android.dbflow.annotation.PrimaryKey;
import com.raizlabs.android.dbflow.annotation.Table;
import com.raizlabs.android.dbflow.structure.BaseModel;
/**
* Created by wilmer on 14/01/17.
*/
@Table(database = AppsCatalogDatabase.class)
public class Artist extends BaseModel {
@Column
@PrimaryKey(autoincrement = true)
private int id;
@Column
private String name;
@Column
private String href;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getHref() {
return href;
}
public void setHref(String href) {
this.href = href;
}
@Override
public String toString() {
return "Artist{" +
"id=" + id +
", name='" + name + '\'' +
", href='" + href + '\'' +
'}';
}
}
|
2cc686da-6709-4011-99bf-5736b574f5a8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-11-07T14:28:54", "repo_name": "andrrrl/github-folder-downloader", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1130, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "341382fa6e2ccd217afaeca1138628823ffafda9", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/andrrrl/github-folder-downloader | 297 | FILENAME: README.md | 0.245085 | # Github folder downloader #
### Requirements ###
- PHP >= 5.3
- DOMDocument extension (depending on your system: `sudo apt-get install` + `php5-dom`, `php7.0-xml` or `php7.1-xml`)
### Description: ###
- Downloads any project (sub)folder from github, to avoid downloading tests, demos, readme, etc, etc
- Includes full tree structure (and files) from the selected folder as starting point
- Download happens in current local directory by default
### Usage example: ###
Example project is https://github.com/MaxCDN/php-maxcdn/
Let's say you want to download only the `/src` folder:
1. Copy the folder path from the address bar, without the https://github.com part and without the trailing slash:
- Given the URL: https://github.com/MaxCDN/php-maxcdn/tree/master/src/
- Extract: `/MaxCDN/php-maxcdn/tree/master/src`
2. Pass it to the script, along with the target folder:
* Python: `$ python updatelib.py "/MaxCDN/php-maxcdn/tree/master/src" /my/target/dir/`
* PHP: `$ php updatelib.php "/MaxCDN/php-maxcdn/tree/master/src" /my/target/dir/`
### TODOs: ###
- [X] Allow passing a target dir/folder |
fd0e7e92-8630-4c12-925f-358efef49be7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-10 01:34:54", "repo_name": "TimeCrafters/SkyStone", "sub_path": "/TeamCode/src/main/java/org/timecrafters/SkyStone_2019_2020/Autonomos/Subengines/R2iLeft.java", "file_name": "R2iLeft.java", "file_ext": "java", "file_size_in_byte": 1214, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "a50d48ddb04695c438761d0628a70e6c08d72cff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/TimeCrafters/SkyStone | 335 | FILENAME: R2iLeft.java | 0.295027 | package org.timecrafters.SkyStone_2019_2020.Autonomos.Subengines;
import org.cyberarm.NeXT.StateConfiguration;
import org.timecrafters.SkyStone_2019_2020.Autonomos.States.DirectionDrive;
import org.timecrafters.SkyStone_2019_2020.Autonomos.States.GripRollers;
import org.timecrafters.SkyStone_2019_2020.Autonomos.States.SkystoneSight;
import org.timecrafters.SkyStone_2019_2020.Autonomos.States.SkystoneSightBlue;
import org.timecrafters.engine.Engine;
import org.timecrafters.engine.SubEngine;
public class R2iLeft extends SubEngine {
private SkystoneSight skystoneSight;
private Engine engine;
private StateConfiguration stateConfiguration;
public R2iLeft(Engine engine, SkystoneSight skystoneSight, StateConfiguration stateConfiguration) {
this.engine = engine;
this.skystoneSight = skystoneSight;
this.stateConfiguration = stateConfiguration;
}
@Override
public void setProcesses() {
addState(new GripRollers(engine, stateConfiguration, "R2h"));
addThreadedState(new DirectionDrive(engine, stateConfiguration, "R2i_L"));
}
@Override
public void evaluate() {
setRunable(skystoneSight.SkystonePosition == -1);
}
}
|
33cd59fa-1fcb-4282-b289-197e5754543e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-05 23:20:25", "repo_name": "rafaelarnosti/Hungry4Pizza-master", "sub_path": "/app/src/main/java/com/rafaelarnosti/hungry4pizza/LoginActivity.java", "file_name": "LoginActivity.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "207cced685f56be3525fbc5ed9318af20d65bd62", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rafaelarnosti/Hungry4Pizza-master | 215 | FILENAME: LoginActivity.java | 0.208179 | package com.rafaelarnosti.hungry4pizza;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class LoginActivity extends AppCompatActivity {
private EditText tilLogin;
private EditText tilSenha;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
tilLogin = (EditText) findViewById(R.id.tilLogin);
tilSenha = (EditText) findViewById(R.id.tilSenha);
}
public void logar(View v){
String Login = tilLogin.getText().toString();
String Senha = tilSenha.getText().toString();
if(Login.equals("FIAP") && Senha.equals("123")){
Intent intent = new Intent(this, PedidoActivity.class);
intent.putExtra("usuario",Login);
startActivity(intent);
}else{
Toast.makeText(this,"Usuario ou senhas invalidos",Toast.LENGTH_SHORT).show();
}
}
}
|
96e03ac0-a583-4e93-b4ce-d879cf0d6a7c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-03 14:46:30", "repo_name": "vidan997/LibraryIS", "sub_path": "/SSBibliotekaCommonLib/src/transfer/ResponseObject.java", "file_name": "ResponseObject.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "b6f93aff5ed14781edc7c645ce6d3ea59e4cf095", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vidan997/LibraryIS | 206 | FILENAME: ResponseObject.java | 0.242206 | /*
* 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 transfer;
import java.io.Serializable;
/**
*
* @author student1
*/
public class ResponseObject implements Serializable{
private static final long serialVersionUID=1;
private Object data;
private Exception exception;
public ResponseObject() {
}
public ResponseObject(Object data, Exception exception) {
this.data = data;
this.exception = exception;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public Exception getException() {
return exception;
}
public void setException(Exception exception) {
this.exception = exception;
}
@Override
public String toString() {
return "ResponseObject{" + "data=" + data + ", exception=" + exception + '}';
}
}
|
a1c56c5a-577c-4159-a996-602a5fcee631 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-12-29 13:06:15", "repo_name": "githubeyaneu/2srtEditor", "sub_path": "/src/main/java/eu/eyan/srteditor/data/Subtitle.java", "file_name": "Subtitle.java", "file_ext": "java", "file_size_in_byte": 1054, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "d5a3afbc0e0b191a4eb2186d7b3dd3d20dcb2097", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/githubeyaneu/2srtEditor | 236 | FILENAME: Subtitle.java | 0.229535 | package eu.eyan.srteditor.data;
import java.util.List;
import com.google.common.base.Joiner;
public class Subtitle
{
public static final String SEPARATOR = " - ";
private int index;
private String time;
private List<String> lines;
public Subtitle()
{
}
public Subtitle(final int index, final String time, final List<String> lines)
{
this.setIndex(index);
this.setTime(time);
this.setLines(lines);
}
@Override
public String toString()
{
return Joiner.on(SEPARATOR).join(getIndex(), getTime(), getLines());
}
public int getIndex()
{
return index;
}
public void setIndex(final int index)
{
this.index = index;
}
public List<String> getLines()
{
return lines;
}
public void setLines(final List<String> lines)
{
this.lines = lines;
}
public String getTime()
{
return time;
}
public void setTime(final String time)
{
this.time = time;
}
}
|
59a9612f-6647-4abd-ac28-1ab85c1a70e6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-09 15:52:37", "repo_name": "josprigal/D-T2017-3", "sub_path": "/Acme-Chorbies/src/main/java/converters/StringToConfigurationConverter.java", "file_name": "StringToConfigurationConverter.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "507860cf803bd57479509d4e2dbf2e2c98da878b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/josprigal/D-T2017-3 | 155 | FILENAME: StringToConfigurationConverter.java | 0.287768 | package converters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import repositories.ConfigurationRepository;
import domain.Configuration;
@Component
@Transactional
public class StringToConfigurationConverter implements
Converter<String, Configuration> {
@Autowired
ConfigurationRepository configurationRepository;
@Override
public Configuration convert(final String text) {
Configuration result = null;
try {
result = (Configuration) Class.forName(text).newInstance();
} catch (final InstantiationException | IllegalAccessException e) {
e.printStackTrace();
} catch (final ClassNotFoundException e) {
result = this.configurationRepository
.findOne(Integer.valueOf(text));
}
return result;
}
}
|
74ddd70a-cd64-4f55-947f-946afbd1bb6d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-08-28T03:32:13", "repo_name": "fqlx/Halo-5-Server-Looking-for-Group", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1131, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "89f07a54694cec6e511f04432f3d3afdcbd0f41e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fqlx/Halo-5-Server-Looking-for-Group | 273 | FILENAME: README.md | 0.183594 | # Halo 5 Server Looking for Group
This project lets your Xbox act as a host for custom games in Halo 5.
It uses SCP driver and the Windows 10 streaming feature to run custom games and
sends out invites to players requesting to join by message with the command 'inv'.
# Run
1. Need SCP Driver installed
2. Need your login.live.com cookie to paste in the program to scrap your messages
# TODO
1. The timer values are wrong. It needs investigation to figure out good values.
2. Work on adding top forge maps and game modes.
3. Add a login method instead of pasting the cookie in.
#ROADMAP
1. Add error detection by screen capturing the GPU front buffer and using image process or pixel detection to determine the state.
# How to get cookie with chrome
*** NEVER SHARE YOUR COOKIE WITH ANYONE, IT GIVES FULL ACCESS TO YOUR MICROSOFT ACCOUNT***
1. Right click and inspect
2. Go to the network tab
3. Go to https://account.xbox.com/en-US/Messages/UserConversation
4. Click the request 'UserConversation'
5. Copy the Cookie value under request header (including the 'Cookie: ' part)
6. Paste it into the console app
|
c9ebcb9d-a95d-4e7f-bb50-2a209bdfabc5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-05 10:02:55", "repo_name": "dongyuancaizi/chaos", "sub_path": "/chaos-boot/chaos-model/src/main/java/com/cui/tech/chaos/constant/ThreadPoolTypeEnum.java", "file_name": "ThreadPoolTypeEnum.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "b26b6e85afbf0cd39af8ce21e0e2f7780c0c50fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dongyuancaizi/chaos | 248 | FILENAME: ThreadPoolTypeEnum.java | 0.279828 | package com.cui.tech.chaos.constant;
/**
* 线程池类型的枚举类
*
* @author sangweidong
* @create 2019-04-18 17:02
**/
public enum ThreadPoolTypeEnum {
IO_INTENSIVE(1, "IO密集型"),
CPU_INTENSIVE(2, "CPU密集型");
public Integer CODE;
public String TYPE;
ThreadPoolTypeEnum(Integer code, String type) {
this.CODE = code;
this.TYPE = type;
}
public static ThreadPoolTypeEnum get(Integer code) {
ThreadPoolTypeEnum result = null;
if (code != null) {
for (ThreadPoolTypeEnum value : ThreadPoolTypeEnum.values()) {
if (code == value.CODE) {
result = value;
break;
}
}
}
return result;
}
public static boolean contain(Integer code) {
boolean result = false;
if (code != null) {
for (ThreadPoolTypeEnum value : ThreadPoolTypeEnum.values()) {
if (code == value.CODE) {
result = true;
break;
}
}
}
return result;
}
}
|
2a54452f-e36a-43ca-b29b-e199c90b06ed | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-12 15:15:35", "repo_name": "afzalrumon/Batch9GIT", "sub_path": "/IdeaProjects/TestNg/src/utils/CommonMethods.java", "file_name": "CommonMethods.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "0610cf272e616b246422002fb56e113613f5d6c6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/afzalrumon/Batch9GIT | 233 | FILENAME: CommonMethods.java | 0.284576 | package utils;
import com.sun.org.apache.bcel.internal.generic.SWITCH;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.concurrent.TimeUnit;
public class CommonMethods {
public static WebDriver driver;
public void setUp() {
ConfigReader.readProperties("C:\\Users\\ahuss\\IdeaProjects\\TestNg\\src\\config\\config.properties");
switch (ConfigReader.getPropertiesvalue("browser")){
case "chrome":
System.setProperty("webdriver.chrome.driver", "drivers/chromedriver.exe");
driver=new ChromeDriver();
break;
case "firefox":
System.setProperty("webdriver.gecko.driver", "drivers/geckodriver.exe");
driver=new FirefoxDriver();
break;
default:
throw new RuntimeException("Invalid name of browser");
}
driver.get(ConfigReader.getPropertiesvalue("url"));
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
}
public static void tearDown(){
if (driver!=null){
driver.quit();
}
}
}
|
50ee4b5e-a896-4ae2-8c1f-ca2b41a084c6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-10-27 03:44:18", "repo_name": "johnjwang/blocks", "sub_path": "/java/src/blocks/gui/KillGuiObject.java", "file_name": "KillGuiObject.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "37a4fb5ce913732b8add1c55562a24b5addbfb1d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/johnjwang/blocks | 202 | FILENAME: KillGuiObject.java | 0.253861 | package blocks.gui;
import java.awt.BorderLayout;
import java.awt.event.*;
import javax.swing.*;
import java.util.ArrayList;
import lcm.lcm.*;
import april.vis.*;
import blocks.util.KillPublisher;
public class KillGuiObject extends GUIObject
{
LCM lcm;
private KillGuiObject()
{
}
public KillGuiObject(LCM lcm)
{
this.lcm = lcm;
}
public ArrayList<JPanel> getPanels()
{
ArrayList<JPanel> ret = new ArrayList<JPanel>();
ret.add(getKillPanel());
return ret;
}
private JPanel getKillPanel()
{
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
JButton kill = new JButton("Kill");
panel.add(kill);
kill.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
KillPublisher.broadcast(lcm, 0);
}
});
return panel;
}
}
|
5fe45521-0227-4836-b977-a6e1e0def4be | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-27 22:03:38", "repo_name": "espartero/jwt-intellij-plugin", "sub_path": "/src/main/java/com/github/novotnyr/idea/jwt/SecretPanelFactory.java", "file_name": "SecretPanelFactory.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "a9dea6b5ea12421309f2e7e13d5413ecfd1ac702", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/espartero/jwt-intellij-plugin | 262 | FILENAME: SecretPanelFactory.java | 0.290176 | package com.github.novotnyr.idea.jwt;
import com.github.novotnyr.idea.jwt.core.Jwt;
import com.github.novotnyr.idea.jwt.hs256.HS256Panel;
import com.github.novotnyr.idea.jwt.rs256.RS256Panel;
import com.github.novotnyr.idea.jwt.ui.secretpanel.SecretPanel;
import javax.annotation.Nonnull;
public class SecretPanelFactory {
private static SecretPanelFactory INSTANCE = new SecretPanelFactory();
private SecretPanelFactory() {
}
public static SecretPanelFactory getInstance() {
return INSTANCE;
}
@Nonnull
public SecretPanel newSecretPanel(@Nonnull String algorithmName) {
switch (algorithmName) {
case "HS256":
return new HS256Panel();
case "RS256":
return new RS256Panel();
default:
return new UnrecognizedSecretPanel();
}
}
@Nonnull
public SecretPanel newSecretPanel(Jwt jwt) {
if (jwt == null || jwt.getAlgorithm() == null) {
return new UnrecognizedSecretPanel();
}
return newSecretPanel(jwt.getAlgorithm());
}
}
|
e4c4346a-f3cf-4ba7-806c-08724af53318 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-04 05:22:08", "repo_name": "hkjlee109/HansCurriculum", "sub_path": "/Step02/app/src/main/java/com/kwoolytech/step02/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "aea23b442a14ef5ffa5cea75f4dda7d3d6386504", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hkjlee109/HansCurriculum | 176 | FILENAME: MainActivity.java | 0.264358 | package com.kwoolytech.step02;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
public class MainActivity extends AppCompatActivity {
private BaseballManager baseballManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
baseballManager = new BaseballManager(
MainActivity.this,
(FrameLayout)findViewById(R.id.frameLayout),
findViewById(R.id.imageViewGlove),
AnimationUtils.loadAnimation(MainActivity.this, R.anim.shake));
findViewById(R.id.buttonThrow).setOnClickListener(baseballManager.getButtonOnClickListener());
findViewById(R.id.imageViewGlove).setOnDragListener(baseballManager.getGloveOnDragListener());
findViewById(R.id.frameLayout).setOnDragListener(baseballManager.getLayoutOnDragListener());
}
} |
2e1784bf-5e37-4350-b1d3-308e8f4ca654 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-03 10:09:54", "repo_name": "bubinimara/Rates", "sub_path": "/app/src/main/java/com/github/bubinimara/rates/data/model/RateExchangeEntity.java", "file_name": "RateExchangeEntity.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "d5c1563003d112aa286458cfde15ec82a6e680cd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bubinimara/Rates | 233 | FILENAME: RateExchangeEntity.java | 0.26588 | package com.github.bubinimara.rates.data.model;
import java.util.Objects;
/**
* Created by davide.
*/
public class RateExchangeEntity {
/**
* Currency currency
*/
private String currency;
/**
* Currency exchange rate
*/
private double exchangeRate;
public RateExchangeEntity(String currency, double exchangeRate) {
this.currency = currency;
this.exchangeRate = exchangeRate;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public double getExchangeRate() {
return exchangeRate;
}
public void setExchangeRate(double exchangeRate) {
this.exchangeRate = exchangeRate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof RateExchangeEntity)) return false;
RateExchangeEntity that = (RateExchangeEntity) o;
return currency.equals(that.currency);
}
@Override
public int hashCode() {
return Objects.hash(currency);
}
}
|
227fb91f-185d-4e48-85fb-292f8e3e5b8f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-17 13:29:49", "repo_name": "ezrealxn/cmcc", "sub_path": "/src/main/java/cn/cmcc/controller/RedisController.java", "file_name": "RedisController.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "c415fc20fdc4e89b6f29eaa1cfea6093cd6fb19a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ezrealxn/cmcc | 281 | FILENAME: RedisController.java | 0.282196 | package cn.cmcc.controller;
import cn.cmcc.bean.MinuteVO;
import cn.cmcc.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Calendar;
/**
* Created by Huige
* Email: 824203453@qq.com
* DATE: 2019/2/21
* Desc:
*/
@RestController
public class RedisController {
@Autowired
RedisService redisService;
@RequestMapping("/map/{day}")
public Object getRedisDataByDay(@PathVariable String day) {
return redisService.getRedisDataByDay(day);
}
@RequestMapping("/minute/{day}")
public MinuteVO getRedisDataByDayMinute(@PathVariable String day){
Calendar cal = Calendar.getInstance();
// 7 --》 07 小时
String hour = cal.get(Calendar.HOUR_OF_DAY) >= 10 ? cal.get(Calendar.HOUR_OF_DAY)+"": "0"+cal.get(Calendar.HOUR_OF_DAY);
String minute = cal.get(Calendar.MINUTE) >= 10 ? cal.get(Calendar.MINUTE)+"": "0"+cal.get(Calendar.MINUTE);
return redisService.getRedisDataByDayMinute(day,hour+minute);
}
}
|
32df53c8-9254-40b7-ab17-e1ffca4593d0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-16 06:12:43", "repo_name": "FlyingDuck/java-demo", "sub_path": "/src/main/java/demo/rabbitmq/hello/Receiver.java", "file_name": "Receiver.java", "file_ext": "java", "file_size_in_byte": 1098, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "de00f2f7fe5cb8696ba0f1d0ecc638f395581e51", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/FlyingDuck/java-demo | 201 | FILENAME: Receiver.java | 0.233706 | package demo.rabbitmq.hello;
import com.rabbitmq.client.*;
import demo.rabbitmq.SimpleChannelFactory;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
/**
* Created by dongsj on 2017/4/11.
*/
public class Receiver {
private static final String QUEUE_NAME = "hello";
public static void main(String[] args) throws IOException, TimeoutException {
Channel channel = SimpleChannelFactory.getChannel("hello");
System.out.println(" [C] Waiting for messages. To exit press CTRL+C");
Consumer consumer = new DefaultConsumer(channel){
@Override
public void handleDelivery(String consumerTag,
Envelope envelope,
AMQP.BasicProperties properties,
byte[] body) throws IOException {
String message = new String(body, "UTF-8");
System.out.println(" [C] Received '" + message + "'");
}
};
channel.basicConsume(QUEUE_NAME, true, consumer);
}
}
|
196a07ff-d2b2-4a61-938e-2e4d0d5d2210 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-12-28T23:19:25", "repo_name": "bselman1/udacity-lightsail", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 996, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "63464c1ab1cc83be1d7c512a4fd525cc166a12b3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bselman1/udacity-lightsail | 284 | FILENAME: README.md | 0.252384 | # Item Catalog Hosted on Amazon Lightsail Instance
## IP Address:
35.172.137.85
## SSH Port
2200
## URL
http://35.172.137.85.xip.io
## Configuration changes
- Added user grader
- Added user grader to the sudoers list
- Removed non public key authentication
- Removed root ssh authentication
- Updated software package list with apt-get update
- Upgraded software with apt-get upgrade
- Activated the ubuntu firewall and configured it to only allow ports (80, 2200, and 123)
- Installed and configured the item-catalog project
- Modified the google_secrets.json file with the correct URL for this newly hosted web application to allow for OAuth login
## Additional software/resources
- Used the [mod_wsgi package](https://pypi.org/project/mod_wsgi/) to build and install python3.7 compatible version of mod_wsgi for Apache.
## Logging in as grader
```ssh -p 2200 -i grader-key grader@35.172.137.85.xip.io```
where grader-key is the path to the provided grader rsa key
|
fb49db72-958c-4f20-93d9-6efabb778bd1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-05 10:01:30", "repo_name": "bretwitt/SatViz", "sub_path": "/src/main/java/io/github/bretwitt/satviz/simulationstate/objects/earth/components/EarthGraphicsComponent.java", "file_name": "EarthGraphicsComponent.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "ea755370a99e91042897db66de849198ed126dcc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bretwitt/SatViz | 256 | FILENAME: EarthGraphicsComponent.java | 0.290981 | package io.github.bretwitt.satviz.simulationstate.objects.earth.components;
import com.google.common.eventbus.EventBus;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Sphere;
import io.github.bretwitt.SatViz;
import io.github.bretwitt.engine.components.SpatialComponent;
public class EarthGraphicsComponent extends SpatialComponent {
public EarthGraphicsComponent(EventBus eventBus, SatViz app) {
super(eventBus, app);
Spatial earth = generateSpatial();
updateSpatial(earth);
}
private Spatial generateSpatial() {
Sphere sphere = new Sphere(30,30,1);
Spatial s = new Geometry("Sphere",sphere);
Material mat = new Material(getSatViz().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor( "Color", ColorRGBA.White);
mat.setTexture("ColorMap",getSatViz().getAssetManager().loadTexture("3d/textures/earth.jpg"));
s.setMaterial(mat);
return s;
}
}
|
369a63ae-04ec-4274-b5ea-9b5f121f036c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-11 15:46:51", "repo_name": "CubeFlix/made-with-love-by", "sub_path": "/java/madeWithLoveBySwing.java", "file_name": "madeWithLoveBySwing.java", "file_ext": "java", "file_size_in_byte": 1078, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "10e132c2bb9b5c15436c0c9c21e6f790d62b2bf2", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CubeFlix/made-with-love-by | 221 | FILENAME: madeWithLoveBySwing.java | 0.26588 | import java.awt.*;
import javax.swing.*;
public class madeWithLoveBy {
private static void createAndShowGUI() {
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel madeWith = new JLabel("Made with ");
madeWith.setFont(new Font("Unicode Block", Font.PLAIN, 16));
JLabel love = new JLabel("❤");
love.setForeground(Color.RED);
love.setFont(new Font("Unicode Block", Font.PLAIN, 16));
JLabel madeBy = new JLabel(" by cubeflix");
madeBy.setFont(new Font("Unicode Block", Font.PLAIN, 16));
frame.getContentPane().add(madeWith, BorderLayout.WEST);
frame.getContentPane().add(love, BorderLayout.CENTER);
frame.getContentPane().add(madeBy, BorderLayout.EAST);
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
|
081e8a1e-4d9b-4a8b-8e22-6d2df3a5819d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-06-19 13:22:25", "repo_name": "rivasyshyn/vocabulario-spring", "sub_path": "/src/main/java/com/irm/vocabulario/services/CardServiceImpl.java", "file_name": "CardServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "87a419a8d471629773872bd93b21f3e1a85e97ec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rivasyshyn/vocabulario-spring | 236 | FILENAME: CardServiceImpl.java | 0.276691 | package com.irm.vocabulario.services;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import com.irm.vocabulario.dao.CardsDao;
import com.irm.vocabulario.domain.Card;
import com.irm.vocabulario.domain.CardSearchOptions;
@Service("cardService")
public class CardServiceImpl implements CardService {
private CardsDao cardDao;
@Autowired
@Qualifier("cardDao")
public void setCardDao(CardsDao cardDao) {
this.cardDao = cardDao;
}
@Override
public List<Card> getCards() {
return cardDao.getAll();
}
@Override
public void addCard(Card card) {
cardDao.add(card);
}
@Override
public void updateCard(Card card) {
cardDao.update(card);
}
@Override
public void deleteCard(Integer id) {
cardDao.delete(id);
}
@Override
public void searchCards(String query, CardSearchOptions options) {
cardDao.search(query, options);
}
}
|
a4a45656-7031-4392-95ae-513756eb2a9a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-10 09:36:20", "repo_name": "osivia/opentoutatice", "sub_path": "/opentoutatice-ecm-platform-core/src/main/java/fr/toutatice/ecm/platform/core/listener/RecentlyEditedListener.java", "file_name": "RecentlyEditedListener.java", "file_ext": "java", "file_size_in_byte": 1216, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "a3a6817f6d51f5c19d2a4e26a4e2ecc66f40812a", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/osivia/opentoutatice | 244 | FILENAME: RecentlyEditedListener.java | 0.274351 | package fr.toutatice.ecm.platform.core.listener;
import java.security.Principal;
import org.apache.commons.lang.StringUtils;
import org.nuxeo.ecm.core.api.ClientException;
import org.nuxeo.ecm.core.event.Event;
import org.nuxeo.ecm.core.event.EventContext;
import org.nuxeo.ecm.core.event.EventListener;
import org.nuxeo.ecm.core.event.impl.DocumentEventContext;
import fr.toutatice.ecm.platform.core.edition.RecentlyEditedCacheHelper;
/**
* fills the recentlyModifiedCache when a user edits a document
*
* @author dorian
*
*/
public class RecentlyEditedListener implements EventListener {
private static final String DOCUMENT_MODIFIED = "documentModified";
@Override
public void handleEvent(Event event) throws ClientException {
EventContext context = event.getContext();
if (StringUtils.equals(event.getName(), DOCUMENT_MODIFIED) && context instanceof DocumentEventContext) {
DocumentEventContext docCtx = (DocumentEventContext) context;
Principal principal = docCtx.getPrincipal();
if (principal != null) {
RecentlyEditedCacheHelper.put(docCtx.getSourceDocument(), principal.getName());
}
}
}
}
|
c9ffce19-1ffd-446f-bb18-512f2095ef63 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-13 11:24:41", "repo_name": "ManuelPJ/Curriculum", "sub_path": "/ActividadHilo8/src/main/java/DEF123.java", "file_name": "DEF123.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "1c4293ab4171645b7db1bb97ed3e5e80ea5b61d7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ManuelPJ/Curriculum | 236 | FILENAME: DEF123.java | 0.290981 | /*
* 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.
*/
import javax.swing.*;
/**
*
* @author MyC
*/
public class DEF123 extends Thread {
public boolean c1 = true;
static Act8 Actdef = new Act8();
int contador = 0;
public int getContador() {
return contador;
}
public void setContador(int contador) {
this.contador = contador;
}
@Override
public void run() {
while (c1) {
contador = contador + 1;
Actdef.correr(getContador());
try {
sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setSize(500 , 350);
frame.add(Actdef);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
} |
f9de510d-0ad7-4d66-87bb-0729eeb58d6f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-19 02:27:54", "repo_name": "mplawley/thegame-enterprise", "sub_path": "/backend/src/main/java/gameCore/modifiers/AllModifiersController.java", "file_name": "AllModifiersController.java", "file_ext": "java", "file_size_in_byte": 1062, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "952533bda20ebfa5adfec519b411d6de38145883", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mplawley/thegame-enterprise | 182 | FILENAME: AllModifiersController.java | 0.271252 | package gameCore.modifiers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
@RestController
@RequestMapping("/modifiers")
@CrossOrigin
public class AllModifiersController {
private final AllModifiersService allModifiersService;
private final String CROSS_ORIGIN_URL = "http://localhost:4200";
@Autowired
AllModifiersController(AllModifiersService allModifiersService) {
this.allModifiersService = allModifiersService;
}
@GetMapping("/getAllModifiers")
@CrossOrigin(origins = CROSS_ORIGIN_URL)
public Map<String, Integer> getAllModifiers() throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
return allModifiersService.getAllModifiers();
}
}
|
952ad6b8-1ac3-4f56-bffe-b5eefebfa776 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-30 23:33:49", "repo_name": "McCarll/clients-api", "sub_path": "/src/main/java/ru/mccarl/client/api/entity/Client.java", "file_name": "Client.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "a9d675f69abd3a6e9a206e7b841d49a94bfb3a39", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/McCarll/clients-api | 230 | FILENAME: Client.java | 0.243642 | package ru.mccarl.client.api.entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Field;
import java.util.Date;
import java.util.List;
/**
* Created by vrudometkin on 27/01/2018.
*/
@Data
@EqualsAndHashCode
public class Client {
@Id
@JsonSerialize(using = ToStringSerializer.class)
private ObjectId _id;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String name;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String secondName;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String patronymic;
@JsonInclude(JsonInclude.Include.NON_NULL)
private Date birthday;
@Field("accounts")
@JsonSerialize(using = ToStringSerializer.class)
private List<ObjectId> _ids;
}
|
e188e60b-81a2-4343-a376-db95c7b4662c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-27 15:39:06", "repo_name": "jerdoni89/pieceoffice_2016", "sub_path": "/src/java/com/po/rest/admin/RestGroupUsers.java", "file_name": "RestGroupUsers.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "8836a6ba019cf991f52d109fce388649eb347811", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jerdoni89/pieceoffice_2016 | 232 | FILENAME: RestGroupUsers.java | 0.290176 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.po.rest.admin;
import com.po.rest.RestBase;
import com.po.service.admin.GroupUserService;
import java.io.IOException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
/**
*
* @author Lucky Bear
*/
@Path("GroupUsers")
public class RestGroupUsers extends RestBase {
private final GroupUserService service = new GroupUserService();
@Context
private UriInfo context;
public RestGroupUsers() {
}
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("List")
public String getListGroupUsers() {
String result = "";
try {
result = om.writeValueAsString(service.getListGroupUsers());
logger.debug(result);
} catch (IOException ex) {
logger.error(ex);
}
return result;
}
}
|
f2d773a4-523f-49eb-b443-9424e9fcfb19 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-27 10:24:58", "repo_name": "treejames/android_resource", "sub_path": "/ChinalifeSFA/src/com/chinalife/ui/view/MyCreditsView.java", "file_name": "MyCreditsView.java", "file_ext": "java", "file_size_in_byte": 990, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "ec85615f656d706784283b6afbd0479860438ba0", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/treejames/android_resource | 204 | FILENAME: MyCreditsView.java | 0.253861 | package com.chinalife.ui.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.chinalife.R;
public class MyCreditsView extends RelativeLayout {
private TextView tv_mycredits_title;
private TextView tv_mycredits_month;
private TextView tv_mycredits_num;
public MyCreditsView(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater.from(context).inflate(R.layout.view_mycredits, this);
tv_mycredits_title = (TextView)findViewById(R.id.tv_mycredits_title);
tv_mycredits_month = (TextView)findViewById(R.id.tv_mycredits_month);
tv_mycredits_num = (TextView)findViewById(R.id.tv_mycredits_num);
}
public void setTitle(String str){
tv_mycredits_title.setText(str);
}
public void setMonth(String str){
tv_mycredits_month.setText(str);
}
public void setNum(String str){
tv_mycredits_num.setText(str);
}
}
|
f1ca1c42-42fe-42f9-916c-5c38b6872356 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-09-07T02:40:42", "repo_name": "Mugwumper/Eat-Da-Burger", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1110, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "7729596fe3e67cfe4eae415741afda1123ef114e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Mugwumper/Eat-Da-Burger | 271 | FILENAME: README.md | 0.243642 | # Eat-Da-Burger
unit 14-handlebars ...is a restaurant app that lets users input the names of burgers they'd like to eat.
## Description
This full stack application demonstrates the techniques and technologies needed to create a 'real world' solution. The layout utilizes an MVC design pattern with the seperation of concerns maintained. The implementation uses Node.js, Express, mySQl, and Handlebars among others.
A user can enter a burger name which gets added to the menu. Once there it can be 'eaten' or devoured as the button label shows. This causes the item to be removed from the menu list and added to the devoured list.
## Demo
The demo of the burger eating application can be found [here](https://????.herokuapp.com/).
## Installation
To run the application locally, first clone this repository with the following commands.
`git clone git@github.com:??/eat-da-burger.git
cd eat-da-burger
npm install
node server`
Now, open the local application on port 3000 at the URL: `http://localhost:3000/`.
### credits
burger image:
https://pngtree.com/freepng/delicious-burgers-vector_1401858.html
|
c9e16cbb-d426-4566-97ea-1190eedbb2b1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-04 17:13:42", "repo_name": "s3ld0n/University-Management-App", "sub_path": "/src/main/java/com/foxminded/university/utils/ContextReceiver.java", "file_name": "ContextReceiver.java", "file_ext": "java", "file_size_in_byte": 1103, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "dd90903ef69e7077bfd589b8d832e8c8e2141c54", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/s3ld0n/University-Management-App | 186 | FILENAME: ContextReceiver.java | 0.261331 | package com.foxminded.university.utils;
import javax.sql.DataSource;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class ContextReceiver {
private static final Logger log = LogManager.getLogger(ContextReceiver.class.getName());
@SuppressWarnings("resource")
public static DataSource receiveDataSourceFromContext(String contextFile) {
ApplicationContext context = null;
DataSource dataSource = null;
try {
context = new ClassPathXmlApplicationContext(contextFile);
dataSource = context.getBean("dataSource", DataSource.class);
} catch (BeanCreationException e) {
log.error("DataSource failed to be created", e);
throw new BeanCreationException("DataSource failed to be created", e);
}
return dataSource;
}
}
|
3a6e0a7a-b8ca-4e4b-8e97-b1f35f0dd449 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-10-22T08:47:13", "repo_name": "2L3R4/wg-dynamic-mesh", "sub_path": "/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1216, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "b165c82ec15ffb6e94b96bf3f7a638b73fa238c8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/2L3R4/wg-dynamic-mesh | 289 | FILENAME: readme.md | 0.239349 | # wg-dynamic-mesh
a program to dynamically (re)configure a wireguard interface based on factors
can be run in server or client mode
### server-mode:
* monitor connections to peers and other servers
* send current "routes" to clients
* (re)configure according to other servers
* ...
### client-mode
* receive "routes" from server
* reconfigure own interface accordingly
* ...
## TODO:
* everything
## scenario:
* 2 or more "Servers":
* static ip addresses
* comparetivly high bandwidth
* must have connectivity with each other (or through other servers)
* 0 or more "clients":
* may often change location/ip address
* may not have (direct) access to one or more of the servers
* ...
#### example
2 servers: Server[A,B]:
4 clients: client{1,4}
* client1 and 2 connected to both servers
* client3 only connected to serverA, can't reach serverB (for whatever reason)
* client4 only connected to serverB, can't reach serverA (for whatever reason)
client 3 wants to connect to client4, so the packets have to be routed trough both servers, but with "default wireguard" peer routes are not automatically be rewritten
A configuration program as this will be (hopefully) become, should help here
|
b46c737e-1b44-4f5f-ab8d-f5b5b1a99880 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-18 19:03:12", "repo_name": "natebrate/Swen2005project", "sub_path": "/project/src/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1043, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "e393407d34598c55c6a66c7081b034e3a445c7d2", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/natebrate/Swen2005project | 208 | FILENAME: User.java | 0.23231 | public class User {
private int ID;
private String fullName;
private String firstName;
private String lastName;
private String username;
private boolean isAdmin;
User(int ID, String firstName, String lastName, String username, Boolean isAdmin)
{
this.ID = ID;
this.firstName = firstName;
this.lastName = lastName;
this.fullName = firstName + " " + lastName;
this.username = username;
this.isAdmin = isAdmin;
}
public int getID() {
return ID;
}
public String getFirstName() {
return firstName;
}
public String getFullName() {
return fullName;
}
public String getLastName() {
return lastName;
}
public String getUsername() {
return username;
}
public boolean getIsAdmin()
{
return isAdmin;
}
public String adminCredentials()
{
if (getIsAdmin())
{
return "ADMIN";
}
else
return "";
}
}
|
2f3a2b65-6efa-4ec9-bb12-16fb493fb8c7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-09 08:20:00", "repo_name": "shreesha08/Alumni_App", "sub_path": "/alumniapp/FrontPage.java", "file_name": "FrontPage.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "76dced8f34c8391f62262e24c3fd1f9f2478953c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shreesha08/Alumni_App | 190 | FILENAME: FrontPage.java | 0.236516 | package com.example.alumniapp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Main7Activity extends AppCompatActivity {
public Button butt1,butt2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main7);
butt1=findViewById(R.id.pr_button);
butt2=findViewById(R.id.sig_button);
butt1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent fintent1=new Intent(Main7Activity.this,MainActivity.class);
startActivity(fintent1);
}
});
butt2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent fintent2=new Intent(Main7Activity.this,Main2Activity.class);
startActivity(fintent2);
}
});
}
}
|
36a6247a-dacd-468e-ac2a-acbe90a3966c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-07-11T11:27:27", "repo_name": "apollo-elements/apollo-elements", "sub_path": "/docs/api/core/interfaces/index.md", "file_name": "index.md", "file_ext": "md", "file_size_in_byte": 998, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "dd9d1495e40a2bcdf9f7c0161913b3c3c0da8350", "star_events_count": 353, "fork_events_count": 23, "src_encoding": "UTF-8"} | https://github.com/apollo-elements/apollo-elements | 224 | FILENAME: index.md | 0.292595 | # Core >> Interfaces || 20
Each of the web component library packages provides lets you build GraphQL apps differently, depending on the paradigm represented by the base package, they all share the same common interfaces
These interfaces represent the common core of Apollo Elements. Each library package (e.g. `lit-apollo`, `fast`, etc) implement these interfaces using their own idioms when needed.
That is to say, whether you create a query element with `lit-apollo`, `haunted`, or vanilla JS mixins, once they connect to the DOM, they all behave the same vis-a-vis GraphQL.
<figure aria-label="Inheritance diagram">
{% include ./mermaid-inheritance.svg | safe %}
<figcaption class="visually-hidden">
Class inheritance diagram of Apollo Elements, showing
1. `ApolloQuery`, `ApolloMutation`, and `ApolloSubscription` inheriting from `ApolloElement`
2. `ApolloElement` inheriting from `CustomElement`
2. `CustomElement` inheriting from `HTMLElement`
</figcaption>
</figure>
|
5755df90-80c2-4d1f-aea2-85b023bb7c73 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-08-23T02:20:35", "repo_name": "fubarlabs/circuitsunday", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1110, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "3494fd094d72ff1a290d3ff018ee6f13c4e01893", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/fubarlabs/circuitsunday | 284 | FILENAME: README.md | 0.228156 | # Circuit Sunday
Code for each of the Circuit Sunday Events
Code Chat: [Gitter IM](https://gitter.im/fubarlabs/codechat?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
##Requirements
Software
* Arduino 1.6.7+: https://www.arduino.cc/en/Main/Software
* chipkit-core: http://chipkit.net/wiki/index.php?title=ChipKIT_core
##Recommended Boards
* Fubarino Mini or Fubarino SD: http://fubarino.org/
Prepare boards by Soldering Pins onto them.
Place boards into breadboard
* Become familiar with putting boards into programming/bootloader mode
##Installation of chipKIT core

##Sessions
* [Session One: Kicking the Tires and Talking to Your Hardware](week1)
* [Session Two: Serial Communications and Arduino Text Adventure](week2)
* [Session Three: Sampling the world and persistence of vision](week3)
* [Session Four: Fast LED strips the Dotstar and apa102x](week4)
* [Session Five: Fast LED strips the Dotstar and apa102x animations](session5)
* [Session Six: LCD Displays](session6)
* [Session Seven: Dallas OneWire Temperature Sensors](session7)
|
a27782eb-16bd-4c7c-811e-29553d49dabd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-14 07:06:33", "repo_name": "NathalieBritan/4ActivitiesApp", "sub_path": "/4ActivitiesApp/app/src/main/java/com/nathaliebritan/a4activitiesapp/HallowsScreenActivity.java", "file_name": "HallowsScreenActivity.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "b54e7c69cc8e8c5109df178523a54a04d539c2c3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NathalieBritan/4ActivitiesApp | 188 | FILENAME: HallowsScreenActivity.java | 0.221351 | package com.nathaliebritan.a4activitiesapp;
import android.content.SharedPreferences;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
public class HallowsScreenActivity extends FragmentActivity {
public int[] pictures = {R.drawable.elder_wand, R.drawable.cloak_of_invisibility, R.drawable.ressurection_stone};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hallows_screen);
HallowsImageFragment fragment = (HallowsImageFragment) getSupportFragmentManager().findFragmentById(R.id.hallows_image_fragment);
int savedPicture = MainActivity.sPref.getInt("saved_text", -1);
if(savedPicture != -1 && fragment != null && fragment.isInLayout()){
fragment.ShowPicture(pictures[savedPicture]);
}
}
}
|
d4b64eea-acca-425c-a04d-d6626eb32f9d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-09 06:02:33", "repo_name": "yjll/SpringCloudDemo", "sub_path": "/zuul/src/main/java/com/yjll/cloud/zuul/MyFilter.java", "file_name": "MyFilter.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "b761774a7fce09061a98d8288992c141e4f32cbb", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yjll/SpringCloudDemo | 229 | FILENAME: MyFilter.java | 0.214691 | package com.yjll.cloud.zuul;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
/**
* @author: zijing
* @date: 2018/11/9 11:06
* @description:
*/
@Component
public class MyFilter extends ZuulFilter {
@Override
public String filterType() {
return "pre";
}
@Override
public int filterOrder() {
return 0;
}
@Override
public boolean shouldFilter() {
return true;
}
@Override
public Object run() throws ZuulException {
RequestContext ctx = RequestContext.getCurrentContext();
HttpServletRequest request = ctx.getRequest();
String name = request.getParameter("name");
if ("test".equals(name)) {
ctx.setSendZuulResponse(false);
ctx.setResponseStatusCode(502);
}
return null;
}
}
|
66936c30-7cd7-4b4c-bbe2-05f93ce21191 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-11 22:47:29", "repo_name": "Vojtone/MVC-Rental-Catalog", "sub_path": "/app/itemsForRent/film/Film.java", "file_name": "Film.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "31bf556c57a202f76635b562472b3f3095853240", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Vojtone/MVC-Rental-Catalog | 223 | FILENAME: Film.java | 0.271252 | package app.itemsForRent.film;
import app.itemsForRent.item.Item;
import app.itemsForRent.Category;
public class Film extends Item {
private String director;
private Format format;
private int duration;
public Film(String title, Category category, int yearOfPublication, String director,
Format format, int duration) {
super(title, category, yearOfPublication);
this.director = director;
this.format = format;
if (duration >= 0)
this.duration = duration;
else
throw new IllegalArgumentException();
}
public void setDirector(String director) {
this.director = director;
}
public void setFormat(Format format) {
this.format = format;
}
public void setDuration(int duration) {
if (duration >= 0)
this.duration = duration;
else throw new IllegalArgumentException();
}
public String getDirector() {
return director;
}
public Format getFormat() {
return format;
}
public int getDuration() {
return duration;
}
} |
785c11c4-8686-4241-96b2-8c9f77c03f18 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-05 19:42:31", "repo_name": "thiagomuller/scilobot_java", "sub_path": "/src/main/java/com/scilonax/scilobot/models/DBhandler.java", "file_name": "DBhandler.java", "file_ext": "java", "file_size_in_byte": 1216, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "bbd9e2c14a82abb1605fb72e581912c4bef0a9d7", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/thiagomuller/scilobot_java | 211 | FILENAME: DBhandler.java | 0.277473 | package com.scilonax.scilobot.models;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import javax.sql.DataSource;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
@Repository
public class DBhandler {
@Autowired
DataSource dataSource;
public Boolean handleUrlOnDB(String url){
try{
if(url.equals("null")){
return false;
}
Statement stmt = dataSource.getConnection().createStatement();
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS urls(url TEXT);");
List<String> retrievedUrls = new ArrayList<>();
ResultSet rs = stmt.executeQuery("SELECT * FROM urls;");
while(rs.next()){
retrievedUrls.add(rs.getString("url"));
}
if(retrievedUrls.contains(url)){
return false;
}
stmt.executeUpdate("INSERT INTO urls(url) VALUES('" + url + "');");
}catch(SQLException sqlexception){
sqlexception.printStackTrace();
}
return true;
}
}
|
ad7f8967-0cd9-4cda-ae6d-454f78771d01 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-04-24T12:42:36", "repo_name": "reasonablytall/yarsync", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1092, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "56d653f9a9820fff74dcfdf44c5665b46852b304", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/reasonablytall/yarsync | 297 | FILENAME: README.md | 0.216012 | # yarsync
A quick, simple, and swashbuckling tool for synchronizing directories
## Install
There's an Arch Linux package on the aur: https://aur.archlinux.org/packages/yarsync/
Otherwise clone this repository and move `yarsync` somewhere in your path, or call it directly.
### Dependences
yarsync requires `rsync` as well as `inotifywait` from `inotify-tools`.
## Usage
Specify `src` and `dest` directories, and yarsync will keep `dest` synchronized with `src` until exited. `dest` can be a network directory over ssh, like below:
```sh
yarsync ship/ seven@sea.s:~/ &
touch ship/cannon.ball
# cannon.ball now exists in both ship/cannon.ball and seven@sea.s:~/ship/cannon.ball
# changes to ship/cannon.ball will be mirrored in seven@sea.s:~/ship/cannon.ball
```
## Options
See `yarsync -h` for a list of all options.
* `yarsync --delete src dest` will delete files in `dest` if they aren't in `src` to keep both sides ship-shape.
* `yarsync --exclude=swabbie src dest` will exclude the file/directory `swabbie` from synchronization.
`--exclude` can be specified multiple times.
|
2bd89410-96fd-456e-9f6b-dc71e2e27d28 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-15 10:27:30", "repo_name": "god-blessSatadru/TourGuideKolkata", "sub_path": "/app/src/main/java/com/example/android/tourguidekolkata/SeasonFragment.java", "file_name": "SeasonFragment.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "f125ef72071a9804badef624fdef01aa1cd8ca22", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/god-blessSatadru/TourGuideKolkata | 184 | FILENAME: SeasonFragment.java | 0.229535 | package com.example.android.tourguidekolkata;
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.ListView;
import java.util.ArrayList;
/**
* A simple {@link Fragment} subclass.
*/
public class SeasonFragment extends Fragment {
public SeasonFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.word_list, container, false);
final ArrayList<Tour> tours = new ArrayList<Tour>();
tours.add(new Tour(getResources().getString(R.string.Season)));
TourAdapter adapter = new TourAdapter(getActivity(), tours, R.color.category_season);
ListView listView = (ListView) rootView.findViewById(R.id.root_view);
listView.setAdapter(adapter);
return rootView;
}
}
|
cf2596ac-8393-4c64-a4e1-d52cbbec8475 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-07-18 16:54:40", "repo_name": "synchrony/smsn", "sub_path": "/typeatron/src/main/java/net/fortytwo/smsn/typeatron/ripple/lib/music/DisableMusicMapping.java", "file_name": "DisableMusicMapping.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "8ef1d8bcb58ce1c388d6b9d7affe90911e1d30c2", "star_events_count": 166, "fork_events_count": 18, "src_encoding": "UTF-8"} | https://github.com/synchrony/smsn | 248 | FILENAME: DisableMusicMapping.java | 0.284576 | package net.fortytwo.smsn.typeatron.ripple.lib.music;
import net.fortytwo.smsn.typeatron.ripple.lib.SmSnLibrary;
import net.fortytwo.flow.Sink;
import net.fortytwo.ripple.RippleException;
import net.fortytwo.ripple.model.ModelConnection;
import net.fortytwo.ripple.model.PrimitiveStackMapping;
import net.fortytwo.ripple.model.RippleList;
public class DisableMusicMapping extends PrimitiveStackMapping {
private final TypeatronMusicControl music;
public DisableMusicMapping(final TypeatronMusicControl music) {
this.music = music;
}
public String[] getIdentifiers() {
return new String[]{
SmSnLibrary.NS_2014_12 + "disable-music"
};
}
public Parameter[] getParameters() {
return new Parameter[]{};
}
public String getComment() {
return "disables musical output from the Typeatron";
}
public void apply(final RippleList stack,
final Sink<RippleList> solutions,
final ModelConnection context) throws RippleException {
music.disable();
solutions.accept(stack);
}
}
|
7b9644de-5435-422d-a037-4c25b94219f3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-09 23:08:37", "repo_name": "nickmatsnev/letsfitpjv", "sub_path": "/src/sample/Game.java", "file_name": "Game.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "f61416864db32b8feec5ac189491eac5a961b6be", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nickmatsnev/letsfitpjv | 238 | FILENAME: Game.java | 0.279828 | package sample;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
public class Game {
private final SimpleStringProperty name;
private final SimpleStringProperty creatorName;
private final SimpleIntegerProperty score;
public Game(String username, Integer score, String creatorName) {
this.name = new SimpleStringProperty(username);
this.score = new SimpleIntegerProperty(score);
this.creatorName = new SimpleStringProperty(creatorName);
}
public Game(String username, Integer score) {
this.name = new SimpleStringProperty(username);
this.score = new SimpleIntegerProperty(score);
this.creatorName = new SimpleStringProperty("");
}
public String getCreatorName() {
return creatorName.get();
}
public void setCreatorName(String fcreatorName) {
creatorName.set(fcreatorName);
}
public String getName() {
return name.get();
}
public void setName(String fname) {
name.set(fname);
}
public int getScore() {
return score.get();
}
public void setScore(int fscore) {
score.set(fscore);
}
}
|
8ab5aaf4-ee30-4579-821a-17bfd4441f56 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-18 04:31:15", "repo_name": "seiyashun/Apppppppppppp", "sub_path": "/app/src/main/java/com/tangtuongco/apppppppppppp/model/ChiTietBaiViet.java", "file_name": "ChiTietBaiViet.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "8cc6168d5fd817dd3925742fe8b82b5c84e3d9ef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/seiyashun/Apppppppppppp | 311 | FILENAME: ChiTietBaiViet.java | 0.245085 | package com.tangtuongco.apppppppppppp.model;
import java.io.Serializable;
/**
* Created by Administrator on 08/12/2017.
*/
public class ChiTietBaiViet implements Serializable {
private String video;
private String IDChiTietBaiViet;
private String IDCuaBaiViet;
public ChiTietBaiViet() {
}
public String getVideo() {
return video;
}
public void setVideo(String video) {
this.video = video;
}
public String getIDChiTietBaiViet() {
return IDChiTietBaiViet;
}
public void setIDChiTietBaiViet(String IDChiTietBaiViet) {
this.IDChiTietBaiViet = IDChiTietBaiViet;
}
public String getIDCuaBaiViet() {
return IDCuaBaiViet;
}
public void setIDCuaBaiViet(String IDCuaBaiViet) {
this.IDCuaBaiViet = IDCuaBaiViet;
}
public ChiTietBaiViet(String video, String IDChiTietBaiViet, String IDCuaBaiViet) {
this.video = video;
this.IDChiTietBaiViet = IDChiTietBaiViet;
this.IDCuaBaiViet = IDCuaBaiViet;
}
}
|
63c5d50f-0d11-409b-b17b-83ab76b3904c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-24 18:43:32", "repo_name": "ctektonidou/AtmProject", "sub_path": "/AtmProject/src/atmproject/MessageBox.java", "file_name": "MessageBox.java", "file_ext": "java", "file_size_in_byte": 1056, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "fe39ea8454c684a2eeb137c942eb055b8450dfa1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ctektonidou/AtmProject | 212 | FILENAME: MessageBox.java | 0.268941 | /*
* 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 atmproject;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
/**
*
* @author Chrysanthi
*/
class MessageBox {
public static void show (String message,String title){
Stage stage = new Stage ();
stage.setTitle(title);
stage.setMinWidth(250);
Label lbl = new Label ();
lbl.setText(message);
Button btnOK = new Button ("OK");
btnOK.setOnAction(e-> stage.close());
btnOK.setMinWidth(50);
VBox pane = new VBox (20);
pane.getChildren().addAll(lbl, btnOK);
pane.setAlignment(Pos.CENTER);
Scene scene = new Scene(pane);
stage.setScene(scene);
stage.showAndWait();
}
}
|
d566d6a7-d0fe-4123-b0e2-da13a2291019 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-13 10:49:45", "repo_name": "konglingze/spring-security-socialDemo", "sub_path": "/nuc-security-core/src/main/java/edu/nuc/security/core/validata/code/dao/impl/image/ImageCode.java", "file_name": "ImageCode.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "f7e635579f8ab720651e83fcd6f2091b3c7192f0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/konglingze/spring-security-socialDemo | 248 | FILENAME: ImageCode.java | 0.274351 | package edu.nuc.security.core.validata.code.dao.impl.image;
import java.awt.image.BufferedImage;
import java.io.Serializable;
import java.time.LocalDateTime;
import edu.nuc.security.core.validata.code.dao.ValidateCode;
public class ImageCode implements ValidateCode,Serializable {
private BufferedImage image;
private String code;
// 过期时间
private LocalDateTime lcDateTime;
public ImageCode(BufferedImage image, String code, int expectIn) {
super();
this.image = image;
this.code = code;
//未来时间(+60秒)
this.lcDateTime = LocalDateTime.now().plusSeconds(expectIn);
}
public BufferedImage getImage() {
return image;
}
public void setImage(BufferedImage image) {
this.image = image;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public LocalDateTime getLcDateTime() {
return lcDateTime;
}
public void setLcDateTime(LocalDateTime lcDateTime) {
this.lcDateTime = lcDateTime;
}
//是否过期
public boolean isExpried() {
return LocalDateTime.now().isAfter(lcDateTime);
}
}
|
917bd795-d810-4590-af45-2a6ac1319314 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-10 14:29:44", "repo_name": "YaredTse/Reflections", "sub_path": "/src/main/java/annotationSample/Application.java", "file_name": "Application.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "aa46d47d530f49a02967f099de628304c6670f00", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/YaredTse/Reflections | 187 | FILENAME: Application.java | 0.268941 | package annotationSample;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
public class Application {
public static void main(String[] args) {
ConsumerClass consumerClass = new ConsumerClass();
Method[] methods = consumerClass.getClass().getMethods();
for ( Method method : methods ) {
MyAnno myAnno = method.getAnnotation(MyAnno.class);
if ( myAnno != null) {
int getAccessModifier = method.getModifiers();
System.out.println( Modifier.isPrivate(getAccessModifier) );
String des = myAnno.description();
if ( des != ""){
System.out.println( des );
}
try {
method.invoke(consumerClass);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
}
|
312ba883-cf2a-4238-9aba-7587d6d08d48 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-09-25 10:19:54", "repo_name": "romanlum/RoboBinding", "sub_path": "/robobinding/src/main/java/org/robobinding/viewattribute/AttributeBindingException.java", "file_name": "AttributeBindingException.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "d95a06a31ae0a73474f0b14fed0ab8358de34d1d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/romanlum/RoboBinding | 250 | FILENAME: AttributeBindingException.java | 0.286968 | /**
* Copyright 2012 Cheng Wei, Robert Taylor
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions
* and limitations under the License.
*/
package org.robobinding.viewattribute;
/**
*
* @since 1.0
* @version $Revision: 1.0 $
* @author Cheng Wei
*/
@SuppressWarnings("serial")
public class AttributeBindingException extends RuntimeException {
private String attributeName;
public AttributeBindingException(String attributeName, Throwable cause) {
super(cause.getMessage(), cause);
this.attributeName = attributeName;
}
public String getAttributeName() {
return attributeName;
}
@Override
public String toString() {
return attributeName + ": " + getMessage();
}
}
|
fe7831ab-738f-4f69-905d-635088fcd0a7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-02 18:10:44", "repo_name": "RJlegend27/Level1", "sub_path": "/src/Menu.java", "file_name": "Menu.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "4630faf6a2786a234c2eb91ad443a2b8f6480019", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/RJlegend27/Level1 | 235 | FILENAME: Menu.java | 0.250913 | import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class Menu {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
JLabel Item1 = new JLabel();
JLabel Item2 = new JLabel();
JLabel Item3 = new JLabel();
JLabel Item4 = new JLabel();
JButton button = new JButton();
JTextField text = new JTextField();
public Menu() {
frame.setVisible(true);
frame.setSize(500, 500);
frame.add(panel);
panel.add(button);
panel.add(Item1);
panel.add(Item2);
panel.add(Item3);
panel.add(Item4);
}
void addListener(ActionListener controller) {
button.addActionListener(controller);
}
void setItem1(String Burger) {
Item1.setText("Burger");
}
void setItem2(String Pasta) {
Item2.setText("Pasta");
}
void setItem3(String Pizza) {
Item3.setText("Pizza");
}
void setItem4(String IceCream) {
Item4.setText("IceCream");
}
}
|
334d2cb2-a2fe-4503-a1c8-df55cfa99d42 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-18 14:44:13", "repo_name": "newbare/CorpDesk", "sub_path": "/src/main/java/lv/javaguru/java3/core/services/user/AuthorizeUserCommandHandler.java", "file_name": "AuthorizeUserCommandHandler.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "7269c5d25a0dfc791dd0bb9a0df366af131d2b4a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/newbare/CorpDesk | 202 | FILENAME: AuthorizeUserCommandHandler.java | 0.282988 | package lv.javaguru.java3.core.services.user;
import lv.javaguru.java3.core.commands.user.AuthorizeUserCommand;
import lv.javaguru.java3.core.commands.user.AuthorizeUserResult;
import lv.javaguru.java3.core.commands.user.UpdateUserCommand;
import lv.javaguru.java3.core.dto.user.UserDTO;
import lv.javaguru.java3.core.services.DomainCommandHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
class AuthorizeUserCommandHandler
implements DomainCommandHandler<AuthorizeUserCommand, AuthorizeUserResult> {
@Autowired
private UserService userService;
@Override
public AuthorizeUserResult execute(AuthorizeUserCommand command) throws Exception {
UserDTO userDTO = command.getUserDTO();
userService.authorize(userDTO.getLogin(), userDTO.getPassword());
return new AuthorizeUserResult();
}
@Override
public Class getCommandType() {
return AuthorizeUserCommand.class;
}
}
|
d6359d7e-b6a1-46d6-a8e1-317b5e4ff43d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-19 05:46:59", "repo_name": "HeyMoon/fetures", "sub_path": "/transaction/transaction-impl/src/main/java/com/dyh/transaction/Bootstrap.java", "file_name": "Bootstrap.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "bdff5bea7a0bf1634d5973650510ff2504eeb5cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/HeyMoon/fetures | 198 | FILENAME: Bootstrap.java | 0.203075 | package com.dyh.transaction;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import java.util.concurrent.CountDownLatch;
/**
* Created by dengyunhui on 2017/12/5 13:31.
*/
@MapperScan({"com.dyh.transaction.dao.mapper"})
@SpringBootApplication
@ComponentScan(basePackages = { "com.dyh.transaction"})
public class Bootstrap {
private static final Logger log = LoggerFactory.getLogger(Bootstrap.class);
private static CountDownLatch countDownLatch = new CountDownLatch(1);
public static void main(String[] args) throws Exception {
ApplicationContext ctx = new SpringApplicationBuilder().sources(Bootstrap.class).web(false).run(args);
log.info("transaction 启动成功!");
countDownLatch.await();
}
}
|
1f0e231d-f04f-4561-962f-6df89b5646d5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-26 16:47:44", "repo_name": "deivn/scala1010", "sub_path": "/daimashengcheng-test/daimashengcheng-test/src/main/java/com/ymw/love/system/entity/authority/SysRole.java", "file_name": "SysRole.java", "file_ext": "java", "file_size_in_byte": 1246, "line_count": 72, "lang": "zh", "doc_type": "code", "blob_id": "5edd9645a44b316febdcf226cb3e7924dc90ea52", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/deivn/scala1010 | 302 | FILENAME: SysRole.java | 0.220007 | package com.ymw.love.system.entity.authority;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* <p>
* 角色
* </p>
*
* @author
* @since 2019-08-02
*/
@TableName("sys_role")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysRole {
@TableId(value="id", type= IdType.AUTO)
private Integer id;
/**
* 编号
*/
private String code;
/**
* 名字
*/
private String name;
/**
* 平台标识:1互动平台,2后台管理
*/
private Integer sign;
/**
* 等级:小到大
*/
private Integer rank;
/**
* 状态:1未启用,2已启用 ,3 删除
*/
private Integer state;
/**
* 创建时间
*/
@TableField("creates_time")
private Date createsTime;
/**
* 排序
*/
private Integer sort;
/**
* 数据级别:1全部,2部分
*/
@TableField("data_tier")
private Integer dataTier;
/**
* 描述
*/
private String depict;
}
|
57783da1-c306-4abf-a4b9-f7bb3488f31b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-24 21:35:35", "repo_name": "maciejgz/TicTacToe", "sub_path": "/src/main/java/pl/mg/ttt/data/model/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "d071a952623cfd1085628495b44c4067eff0884d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/maciejgz/TicTacToe | 213 | FILENAME: User.java | 0.208179 | package pl.mg.ttt.data.model;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.util.List;
/**
* Created by m on 2016-01-16.
*/
@Entity
public class User {
@Id
private String username;
private String password;
private String role;
@OneToMany(mappedBy = "username")
private List<GameAssociation> games;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public List<GameAssociation> getGames() {
return games;
}
public void setGames(List<GameAssociation> games) {
this.games = games;
}
}
|
fd5965e3-057f-4649-a653-7a1abc197fdf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-19 21:18:37", "repo_name": "PeterStuck/pizzeria-app", "sub_path": "/src/main/java/pizzeria/gui/components/CategorySelector.java", "file_name": "CategorySelector.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "af46ac78b82898653c2106eb8839478608e32303", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/PeterStuck/pizzeria-app | 239 | FILENAME: CategorySelector.java | 0.277473 | package pizzeria.gui.components;
import javax.swing.*;
import java.awt.*;
import static pizzeria.gui.settings.PizzeriaColors.ACCENT_COLOR;
import static pizzeria.gui.settings.PizzeriaColors.BTN_COLOR;
import static pizzeria.gui.settings.PizzeriaTypography.H2_FONT;
public class CategorySelector extends AbstractGridBagPanel {
public CategorySelector(JFrame parentFrame, String desc, String path) {
super(parentFrame);
Dimension labelDim = new Dimension(200, 300);
setPreferredSize(labelDim);
setMaximumSize(labelDim);
setMinimumSize(labelDim);
setBackground(BTN_COLOR);
setBorder(BorderFactory.createMatteBorder(0,0,3,3, ACCENT_COLOR));
JLabel icon = new JLabel(new ImageIcon(path));
gbc.gridx = 0;
gbc.gridy = 0;
this.add(icon, gbc);
JLabel description = new JLabel(desc);
description.setFont(H2_FONT);
gbc.gridy = 1;
gbc.insets = new Insets(25, 0, 0, 0);
this.add(description, gbc);
}
}
|
4b87d446-b6a6-421b-8262-213c6cb15b3d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-03 10:08:56", "repo_name": "nixomniac/testing", "sub_path": "/AwesomeApp/source/awesome-project/ap-model/src/main/java/com/awesomeproject/model/weather/WeatherCurrentItem.java", "file_name": "WeatherCurrentItem.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "0cf1dc4f55da4bbaeac618bc29d5e62c1a316ed5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nixomniac/testing | 212 | FILENAME: WeatherCurrentItem.java | 0.252384 | package com.awesomeproject.model.weather;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import java.util.List;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonDeserialize(builder = WeatherCurrentItem.Builder.class)
public class WeatherCurrentItem {
private final List<CityItem> list;
public WeatherCurrentItem(Builder b) {
this.list = b.list;
}
public List<CityItem> getList() {
return list;
}
public static Builder builder() {
return new Builder();
}
@JsonPOJOBuilder(withPrefix = "")
public static final class Builder {
private List<CityItem> list;
public Builder list(List<CityItem> list) {
this.list = list;
return this;
}
public WeatherCurrentItem build() {
return new WeatherCurrentItem(this);
}
}
}
|
c38ec724-58e1-427a-9e91-8f4b1ff8c4a2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-14 15:21:01", "repo_name": "ebi-uniprot/QuickGOBE", "sub_path": "/rest-common/src/main/java/uk/ac/ebi/quickgo/rest/search/solr/SolrRetrievalConfigHelper.java", "file_name": "SolrRetrievalConfigHelper.java", "file_ext": "java", "file_size_in_byte": 1098, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "12550b3a1594651cc40a5ae2e273ddc97bb121bd", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/ebi-uniprot/QuickGOBE | 257 | FILENAME: SolrRetrievalConfigHelper.java | 0.276691 | package uk.ac.ebi.quickgo.rest.search.solr;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Helper functions associated with {@link SolrRetrievalConfig}.
*
* Created 08/02/16
* @author Edd
*/
public final class SolrRetrievalConfigHelper {
private static final String COMMA = ",";
public static final String DEFAULT_HIGHLIGHT_DELIMS = "<em>" + COMMA + "</em>";
public static final int HIGHLIGHT_START_DELIM_INDEX = 0;
public static final int HIGHLIGHT_END_DELIM_INDEX = 1;
private static final Logger LOGGER = LoggerFactory.getLogger(SolrRetrievalConfigHelper.class);
private SolrRetrievalConfigHelper() {}
public static String[] convertHighlightDelims(String highlightDelims, String delim) {
String[] delims = highlightDelims.split(delim);
if (delims.length != 2) {
LOGGER.warn("Invalid highlighting delimiters specified: " + highlightDelims + ". Using defaults: " +
DEFAULT_HIGHLIGHT_DELIMS);
delims = DEFAULT_HIGHLIGHT_DELIMS.split(COMMA);
}
return delims;
}
} |
2fc9ec58-f9ad-477b-ad48-425fd61a346c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-03 07:55:17", "repo_name": "nam-kyu-park/abstraction", "sub_path": "/java/abstraction/src/main/java/kr/co/sptek/abstraction/service/RemoteService.java", "file_name": "RemoteService.java", "file_ext": "java", "file_size_in_byte": 1216, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "9cab9bbdedad6d17d12dd8e5e89ea4e43b3aa1fc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nam-kyu-park/abstraction | 261 | FILENAME: RemoteService.java | 0.268941 | package kr.co.sptek.abstraction.service;
import kr.co.sptek.abstraction.common.ProxyRules;
import kr.co.sptek.abstraction.module.stream.proxy.DStreamProxy;
import kr.co.sptek.abstraction.service.handler.RemoteHandler;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import sptek.dcim.common.DcimTopicId;
public class RemoteService extends KafkaService {
private static final Logger logger = LogManager.getLogger(RemoteService.class);
@Autowired
RemoteHandler handler;
@Override
public void setProxy(DStreamProxy proxy, ProxyRules type) throws Exception {
super.setProxy(proxy, type);
this.handler.setProxy(proxy, type);
}
@KafkaListener(topics = DcimTopicId.TOPIC_REMOTE)
public void listen10(String message) {
logger.info("KafkaListener: topic = " + DcimTopicId.TOPIC_REMOTE + "data = " + message);
try {
handler.execute(message);
}
catch (NullPointerException e) {
logger.warn("TOPIC_REMOTE: Response remote handling failed.");
}
}
}
|
8a968537-c4d7-49eb-8cae-6561f9273ead | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-30 14:30:58", "repo_name": "sgoryachkin/nnmotors-eip", "sub_path": "/eip-web/src/main/java/ru/nnmotors/eip/web/common/util/UserProfileAssambleUtils.java", "file_name": "UserProfileAssambleUtils.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "af30419433cd5e1d531ec1ea9891c806b676348a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sgoryachkin/nnmotors-eip | 232 | FILENAME: UserProfileAssambleUtils.java | 0.275909 | package ru.nnmotors.eip.web.common.util;
import org.springframework.util.StringUtils;
import ru.nnmotors.eip.business.api.model.entity.UserProfile;
public final class UserProfileAssambleUtils {
private UserProfileAssambleUtils() {
}
public static String fullName(UserProfile user) {
StringBuilder sb = new StringBuilder();
if (StringUtils.hasText(user.getFirstName())) {
sb.append(user.getFirstName());
sb.append(' ');
}
if (StringUtils.hasText(user.getMiddleName())) {
sb.append(user.getMiddleName());
sb.append(' ');
}
if (StringUtils.hasText(user.getLastName())) {
sb.append(user.getLastName());
sb.append(' ');
}
String fullName = sb.toString().trim();
return StringUtils.hasText(fullName) ? fullName : user.getLogin();
}
public static String avatarUrl(UserProfile user, boolean small) {
if (user.getAvatar() != null) {
return "/attachment/download/" + user.getAvatar().getId() + "/avatar";
} else {
return "/static/img/no-avatar.png";
}
}
}
|
57da43bb-dbed-4aac-be17-4f02f6eab722 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-25 18:15:32", "repo_name": "XianqiZhang77/user_center_server_springBoot", "sub_path": "/src/main/java/com/concordia/service/impl/ToolServiceImpl.java", "file_name": "ToolServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "364e02853cc4219fcd1508e15a549629303bfdff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/XianqiZhang77/user_center_server_springBoot | 206 | FILENAME: ToolServiceImpl.java | 0.250913 | package com.concordia.service.impl;
import com.concordia.common.util.RandomCaptcha;
import com.concordia.rpcDomain.request.RegisterRequest;
import com.concordia.service.MailService;
import com.concordia.service.ToolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ToolServiceImpl implements ToolService {
@Autowired
private MailService mailService;
@Override
public String getCaptcha() {
return null;
}
@Override
public boolean sendRegisterMail(RegisterRequest registerRequest) {
// captcha
String captcha = RandomCaptcha.getCaptcha();
registerRequest.setCaptcha(captcha);
StringBuilder content = new StringBuilder();
content.append("Hello ")
.append(registerRequest.getUsername())
.append("\n")
.append("Here is your captcha number: ")
.append(captcha);
return mailService.sendSimpleMail(registerRequest.getEmail()
, "Activate Your Account", content.toString());
}
}
|
bc89ca0b-77ca-4ca9-b6e8-ec42a215e6cb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-12-21T11:29:49", "repo_name": "theflyingape/bidmc-its-xterm", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1138, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "135511d00b2a971f8b5a96319a8a31d3e402ebad", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/theflyingape/bidmc-its-xterm | 319 | FILENAME: README.md | 0.229535 | # ⚕️ BIDMC ITS Xterm.js services 🖥
> ## an Apache-NodeJs implementation for web SSH client needs
[](https://www.npmjs.com/package/bidmc-its-xterm)
[](https://github.com/theflyingape/bidmc-its-xterm/releases) [](https://www.npmjs.com/package/bidmc-its-xterm)
- ./build.sh [rpm]
- ./install.sh
- npm test
Create a new instance in the **its** folder. Each instance has an **app.json** (node app listener) and a **client.json** (terminal characteristics for the browser-side) configuration file.
## Resources
### [Xterm.js](https://xtermjs.org)
> terminal front-end component written in TypeScript that works in the modern-day browser
### [node-pty](https://www.npmjs.com/package/node-pty)
> node.js bindings to fork processes with pseudoterminal file descriptors. It returns a terminal object which allows reads and writes.
:us: :copyright: 2018-2021 [Robert Hurst](https://www.linkedin.com/in/roberthurstrius/)
|
23480e25-1b83-4087-94ee-e25e4091a636 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-19 19:42:22", "repo_name": "tingley/globalsight", "sub_path": "/main6/tools/client tools/GlobalSight Installer/source/src/com/plug/Version_7_1_6_0/JSFunctionCompany.java", "file_name": "JSFunctionCompany.java", "file_ext": "java", "file_size_in_byte": 1216, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "6a642e8cfa1d6de5cfe663b7aae86ae44d323642", "star_events_count": 7, "fork_events_count": 6, "src_encoding": "UTF-8"} | https://github.com/tingley/globalsight | 257 | FILENAME: JSFunctionCompany.java | 0.256832 | package com.plug.Version_7_1_6_0;
public class JSFunctionCompany
{
private long companyId;
private String jsFunction;
private String fileProfileName;
public JSFunctionCompany(long companyId, String jsFunction,
String fileProfileName)
{
super();
this.companyId = companyId;
this.jsFunction = jsFunction;
this.fileProfileName = fileProfileName;
}
public String getFileProfileName()
{
return fileProfileName;
}
public void setFileProfileName(String fileProfileName)
{
this.fileProfileName = fileProfileName;
}
public JSFunctionCompany(long companyId, String jsFunction)
{
this.companyId = companyId;
this.jsFunction = jsFunction;
}
public long getCompanyId()
{
return companyId;
}
public void setCompanyId(long companyId)
{
this.companyId = companyId;
}
public String getJsFunction()
{
return jsFunction;
}
public void setJsFunction(String jsFunction)
{
this.jsFunction = jsFunction;
}
public String toString()
{
return "jsFunction:"+jsFunction+", companyId:"+companyId;
}
}
|
52c3ead6-3710-4653-8586-87aa7ecef9bb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-15 05:04:05", "repo_name": "Meiguangya/think", "sub_path": "/src/file/FindDffFile.java", "file_name": "FindDffFile.java", "file_ext": "java", "file_size_in_byte": 1242, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "507449a1dd727d066d58122a96d4d2371bbc3fad", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Meiguangya/think | 272 | FILENAME: FindDffFile.java | 0.27048 | package file;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
public class FindDffFile {
public static void main(String[] args) {
File file1 = new File("/Users/meiguangya/Downloads/对比/1/web/WEB-INF/lib");
File file2 = new File("/Users/meiguangya/Downloads/对比/2/web/WEB-INF/lib");
if(file1.isDirectory()){
File[] files = file1.listFiles();
File[] files2 = file2.listFiles();
Set<String> file1Names = new HashSet<>();
for (File file : files) {
file1Names.add(file.getName());
}
System.out.println(file1Names.size());
for (File file : files2) {
if(file1Names.contains(file.getName())){
if(file.getName().contains("shiro-lang")){
System.out.println(file.getName());
}
file1Names.remove(file.getName());
}
}
System.out.println(file1Names.size());
file1Names.forEach(e-> System.out.println(e));
}
}
//commons-logging-1.1.1.jar
//commons-lang-2.5.jar
//commons-logging-1.0.4.jar
//commons-lang-2.3.jar
}
|
73d27635-b430-499c-85fa-760fe0892fcc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-27 07:59:32", "repo_name": "kunkun39/CH_APP_S_E", "sub_path": "/src/main/java/com/changhong/system/web/controller/HomePagePosterDeleteController.java", "file_name": "HomePagePosterDeleteController.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "e8bc6fd31516ab081972752e8cd25260d8abbf89", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kunkun39/CH_APP_S_E | 200 | FILENAME: HomePagePosterDeleteController.java | 0.242206 | package com.changhong.system.web.controller;
import com.changhong.system.service.AppService;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import org.springframework.web.servlet.view.RedirectView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* User: pengjie
* Date: 2016/3/16
* Time: 11:09
*/
public class HomePagePosterDeleteController extends AbstractController {
private AppService appService;
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
int id = ServletRequestUtils.getIntParameter(httpServletRequest, "id", -1);
appService.deleteHomePagePoster(id);
return new ModelAndView(new RedirectView("dashboard.html"));
}
public void setAppService(AppService appService) {
this.appService = appService;
}
}
|
704cf7a3-a0d5-4c18-90dc-5e36b2b0311e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-09 01:14:26", "repo_name": "gaoqinibm/skyeDocking", "sub_path": "/src/main/java/com/rocky/skyeDocking/controller/RechargeVerification.java", "file_name": "RechargeVerification.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "385357fd996ff4bbea1b1710a77dced760588200", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gaoqinibm/skyeDocking | 284 | FILENAME: RechargeVerification.java | 0.23092 | package com.rocky.skyeDocking.controller;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.rocky.skyeDocking.model.RechargeReq;
import static com.rocky.skyeDocking.utils.SnowflakeIdWorker.generateCurrentDate;
/**
* @Description: 充值验证
* @Author Baizhen
* @Date 2020/4/7 14:58
*/
public class RechargeVerification {
public static void main(String[] args) {
String strUrl = "http://member.51mrp.com/member-sell-plat/member/sell.do";
String strMerchantOrderId = generateCurrentDate();
RechargeReq rechargeReq = RechargeReq.builder()
.merchantId("23686")
.chargeAccount("110")
.merchantProductCode("ceshi001")
.phone("13634195169")
.merchantOrderId(strMerchantOrderId)
.merchantNotifyUrl("http://190gs90623.iok.la/notify/handleNotify")
.ip("")
.build();
String strJSON = JSON.toJSONString(rechargeReq);
String result = HttpUtil.post(strUrl, strJSON);
System.out.println(result);
}
}
|
51472270-a79a-4118-b708-266cf677d421 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-20 18:28:48", "repo_name": "helderdarocha/java8-course", "sub_path": "/Java9Examples/src/tdc.java9.exemplos/classes/tdc/java9/examples/concurrency/Assinante.java", "file_name": "Assinante.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "3dfe25d1ff64684818c4d59dd8e14d4491bfbd2b", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/helderdarocha/java8-course | 245 | FILENAME: Assinante.java | 0.246533 | /*
* 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 tdc.java9.examples.concurrency;
import java.util.concurrent.Flow;
import java.util.concurrent.Flow.Subscription;
/**
*
* @author helderdarocha
*/
public class Assinante<T> implements Flow.Subscriber<T> {
private Subscription assinatura;
@Override
public void onSubscribe(Flow.Subscription subscription) {
System.out.println("onSubscribe: " + subscription);
assinatura = subscription;
assinatura.request(1);
}
@Override
public void onNext(T item) {
System.out.println("onNext: " + item);
assinatura.request(1);
}
@Override
public void onError(Throwable throwable) {
System.out.println("onError: " + throwable);
synchronized("A") { "A".notifyAll(); }
}
@Override
public void onComplete() {
System.out.println("onComplete");
synchronized("A") { "A".notifyAll(); }
}
} |
ede40a8c-55b4-4062-bf4f-70dbf4283697 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-25 15:13:23", "repo_name": "badjaaga/epam-training", "sub_path": "/src/main/java/com/epam/upskills/base/Person.java", "file_name": "Person.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "d7b7b5daea8455de2a73f5988651c2e987214672", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/badjaaga/epam-training | 232 | FILENAME: Person.java | 0.225417 | package com.epam.upskills.base;
import java.io.IOException;
public class Person extends Object {
private String personId;
private String lastName;
public static String faculty;
public Person() {
super();
}
public Person(String personId1, String lastName) {
this.personId = personId1;
this.lastName = lastName;
}
public String getPersonId() {
return personId;
}
public void setPersonId(String personId) {
if(personId == null){
System.out.println("Wrong input");;
}
this.personId = personId;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public static String getFaculty() {
return faculty;
}
public static void setFaculty(String faculty) {
Person.faculty = faculty;
}
//@Override
public String toString() {
return "Person{" +
"personId='" + personId + '\'' +
", lastName='" + lastName + '\'' +
'}';
}
}
|
8f8c2ead-565e-475d-9340-a203f911e9ac | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-10 21:18:50", "repo_name": "MuriloSilva/kafkaintro", "sub_path": "/src/main/java/com/mumudeveloper/kafkaexample/KafkaConsumer.java", "file_name": "KafkaConsumer.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "28f57b0942233b27a98dfb43bec0ed8e9b05252c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MuriloSilva/kafkaintro | 273 | FILENAME: KafkaConsumer.java | 0.279042 | package com.mumudeveloper.kafkaexample;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;
@Component
public class KafkaConsumer {
private Logger logger = LoggerFactory.getLogger(KafkaConsumer.class);
@KafkaListener(topics = "topic1", groupId="group1", containerFactory = "kafkaListenerContainerFactory")
public void receiveTopic1(Person person) {
logger.info("Receiver on topic1: {}", person);
}
@KafkaListener(topics = "topic1", groupId = "group2", containerFactory = "kafkaListenerContainerFactoryWithFilter")
public void receiveTopic1WithFilter(Person person) {
logger.info("Receiver on topic1 WithFilter: {}, group: group2", person);
}
@KafkaListener(topics = "topic2", groupId = "group2", containerFactory = "kafkaListenerContainerFactory")
public void receiveTopic2(Person person) {
logger.info("Receiver on topic2: {}, group: group2", person);
}
@KafkaListener(topics = "topic2")
public void receiveTopic2WithoutGroup(Person person) {
logger.info("Receiver on topic2: {} without group", person);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.