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
|
|---|---|---|---|---|---|---|
b0a9ad46-f7d9-4b22-aa86-5390cecea77a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-23 18:15:55", "repo_name": "VitaliyDragun1990/jcart", "sub_path": "/jcart-site/src/main/java/com/revenat/jcart/site/security/CustomUserDetailsService.java", "file_name": "CustomUserDetailsService.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "73b8678b8f99918e76d7bad0038bc6347f099850", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/VitaliyDragun1990/jcart
| 167
|
FILENAME: CustomUserDetailsService.java
| 0.233706
|
package com.revenat.jcart.site.security;
import com.revenat.jcart.core.customers.CustomerService;
import com.revenat.jcart.core.entities.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class CustomUserDetailsService implements UserDetailsService {
@Autowired
private CustomerService customerService;
@Override
public UserDetails loadUserByUsername(String email) {
Customer customer = customerService.getCustomerByEmail(email);
if (customer == null) {
throw new UsernameNotFoundException("Email " + email + " not found");
}
return new AuthenticatedCustomer(customer);
}
}
|
5d63f615-220b-4e2e-9944-e02044aff670
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-31 10:46:00", "repo_name": "sz332/epsilon-maven-plugin", "sub_path": "/src/main/java/hu/blackbelt/epsilon/maven/plugin/executeConfiguration/Ecl.java", "file_name": "Ecl.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "5066d06591ba5500edcd817acf2aa61579966b0f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sz332/epsilon-maven-plugin
| 208
|
FILENAME: Ecl.java
| 0.276691
|
package hu.blackbelt.epsilon.maven.plugin.executeConfiguration;
import hu.blackbelt.epsilon.maven.plugin.v1.xml.ns.definition.EclType;
import hu.blackbelt.epsilon.runtime.execution.contexts.EclExecutionContext;
import hu.blackbelt.epsilon.runtime.execution.contexts.ProgramParameter;
import lombok.Builder;
import java.net.URI;
import java.util.Collections;
import java.util.stream.Collectors;
import static hu.blackbelt.epsilon.runtime.execution.contexts.ProgramParameter.programParameterBuilder;
@Builder
public class Ecl {
EclType ecl;
EclExecutionContext toExecutionContext() {
return EclExecutionContext.eclExecutionContextBuilder()
.parameters(ecl.getParameters() != null ? ecl.getParameters().getParameter().stream()
.map(p -> programParameterBuilder().name(p.getName()).value(p.getValue()).build())
.collect(Collectors.toList()) : Collections.emptyList())
.source(URI.create(ecl.getSource()))
.exportMatchTrace(ecl.getExportMatchTrace())
.useMatchTrace(ecl.getUseMatchTrace())
.build();
}
}
|
bc055a1c-5cc9-4d2b-9d05-3c9be35aa10a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-25 08:03:15", "repo_name": "melioudas/JAVADesign", "sub_path": "/src/prototype/Video.java", "file_name": "Video.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "58c43d2ffe4980a4b575f27356b4a74dbd39c16b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/melioudas/JAVADesign
| 215
|
FILENAME: Video.java
| 0.245085
|
package prototype;
import java.util.Date;
/**
* 以视频拷贝为例
* <p>
* 1.实现cloneable接口
* 2.重写clone方法
*/
public class Video implements Cloneable {
//视频名称
private String name;
//视频日期
private Date createDate;
@Override
protected Object clone() throws CloneNotSupportedException {
return super.clone();
}
public Video() {
}
public Video(String name, Date createDate) {
this.name = name;
this.createDate = createDate;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Override
public String toString() {
return "Video{" +
"name='" + name + '\'' +
", createDate=" + createDate +
'}';
}
}
|
1899bf3f-3993-41cb-a720-27bd8e0df911
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-01 21:17:49", "repo_name": "onegambler/Chip-Collector-XP", "sub_path": "/src/main/java/com/chipcollector/util/StringUtils.java", "file_name": "StringUtils.java", "file_ext": "java", "file_size_in_byte": 1179, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "50c2460a57f12836d32c436688a8b3a498a409f5", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/onegambler/Chip-Collector-XP
| 220
|
FILENAME: StringUtils.java
| 0.256832
|
package com.chipcollector.util;
import com.google.common.collect.ImmutableSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Set;
import static java.lang.Character.toLowerCase;
import static java.lang.Character.toUpperCase;
import static java.util.Objects.isNull;
public class StringUtils {
@Nullable
public static String toCamelCase(final String string, Character... camelCaseDelimiter) {
if (isNull(string)) {
return null;
}
boolean isUppercase = true;
Set<Character> delimiters;
if (camelCaseDelimiter.length == 0) {
delimiters = ImmutableSet.of(' ');
} else {
delimiters = ImmutableSet.copyOf(camelCaseDelimiter);
}
final StringBuilder camelCaseString = new StringBuilder(string.length());
for (Character character : string.toCharArray()) {
character = isUppercase ? toUpperCase(character) : toLowerCase(character);
camelCaseString.append(character);
isUppercase = delimiters.contains(character);
}
return camelCaseString.toString();
}
}
|
2acc78a0-d3a9-4fe8-a878-4236f13d9d38
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-15 20:50:11", "repo_name": "MRALADAG/odev42", "sub_path": "/odev42/src/odev42/OrderManager.java", "file_name": "OrderManager.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "bc7d185179be6b641e8b8f261714a309d3aeda76", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "ISO-8859-9"}
|
https://github.com/MRALADAG/odev42
| 235
|
FILENAME: OrderManager.java
| 0.279042
|
package odev42;
public class OrderManager implements IOrderService {
private IPlayerValidationService playerValidationService;
private ICampaignService campaignGames;
public OrderManager(IPlayerValidationService playerValidationService, ICampaignService campaignGames) {
this.playerValidationService = playerValidationService;
this.campaignGames = campaignGames;
}
@Override
public void gameOrder(Player player, Game game) {
if ((this.playerValidationService.customerCheckIfPerson(player))
|| (this.campaignGames.checkCampaignIs(game))) {
System.out.println(
"Kampanyalı olan : " + game.getGameName() + " isimli oyunu aldınız. " + player.getFirstName());
} else if (this.playerValidationService.customerCheckIfPerson(player)) {
System.out.println(game.getGameName() + " isimli oyunun siparişini verdiniz. " + player.getFirstName());
} else {
System.out.println("Geçerli oyuncu bilgisi girilmediğinden sipariş verilemedi.");
}
}
}
|
82bef03a-3df2-4e33-a860-8ffe8a5193b8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-21 08:39:41", "repo_name": "giantsol/BakingTime", "sub_path": "/app/src/main/java/com/lee/hansol/bakingtime/utils/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "e02bdb9e01cd9b92f0ebca88978e3070c1e8e227", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/giantsol/BakingTime
| 206
|
FILENAME: User.java
| 0.281406
|
package com.lee.hansol.bakingtime.utils;
import android.app.Activity;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.DisplayMetrics;
public class User {
public static boolean hasInternetConnection(Context context) {
ConnectivityManager cm =
(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
}
public static boolean isTablet(Activity activity) {
DisplayMetrics metrics = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
int widthPixels = metrics.widthPixels;
int heightPixels = metrics.heightPixels;
float scaleFactor = metrics.density;
float widthDp = widthPixels / scaleFactor;
float heightDp = heightPixels / scaleFactor;
float smallestWidth = Math.min(widthDp, heightDp);
return smallestWidth > 600;
}
}
|
dd6f0105-be07-4f17-990f-48f909a2921f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-27 16:16:51", "repo_name": "SichYuriy/JavaLabs", "sub_path": "/Lab03/src/main/java/com/gmail/at/sichyuriyy/netcracker/lab03/entity/Customer.java", "file_name": "Customer.java", "file_ext": "java", "file_size_in_byte": 986, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "fb782b84904a47d4ba93554373d1a33d9a51a80f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SichYuriy/JavaLabs
| 208
|
FILENAME: Customer.java
| 0.258326
|
package com.gmail.at.sichyuriyy.netcracker.lab03.entity;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Yuriy on 21.01.2017.
*/
public class Customer extends User {
private List<Project> orderedProjects;
public List<Project> getOrderedProjects() {
return orderedProjects;
}
public void setOrderedProjects(List<Project> orderedProjects) {
this.orderedProjects = orderedProjects;
}
@Override
public String toString() {
return super.toString() +
"Customer {" +
"orderedProjects=" + orderedProjects +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Customer)) return false;
Customer customer = (Customer) o;
return orderedProjects.equals(customer.orderedProjects);
}
@Override
public int hashCode() {
return orderedProjects.hashCode();
}
}
|
1d4b57a1-f613-471b-a37a-d2ad23becd30
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-20 06:46:38", "repo_name": "wickedskillsexception/thebigproject", "sub_path": "/src/main/java/com/siit/thebigproject/recipesmanager/dao/sql/SQLRecipeIngredientsDAO.java", "file_name": "SQLRecipeIngredientsDAO.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "b220e76562c25481d86021114e8187a37110ee30", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wickedskillsexception/thebigproject
| 196
|
FILENAME: SQLRecipeIngredientsDAO.java
| 0.276691
|
package com.siit.thebigproject.recipesmanager.dao.sql;
import com.siit.thebigproject.domain.RecipeIngredient;
import com.siit.thebigproject.recipesmanager.db.TheBigProjectDB;
import com.siit.thebigproject.recipesmanager.db.TheBigProjectDBException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class SQLRecipeIngredientsDAO {
private TheBigProjectDB db;
public SQLRecipeIngredientsDAO(TheBigProjectDB db) {
this.db = db;
}
public void add(RecipeIngredient recipeIngredient) throws TheBigProjectDBException, SQLException {
try (Connection connection = db.connect()) {
PreparedStatement statement = connection.prepareStatement("INSERT INTO recipe_ingredients(recipe_id, ingredient_id) values(?, ?)");
statement.setLong(1, recipeIngredient.getRecipeId());
statement.setLong(2, recipeIngredient.getIngredientId());
statement.executeUpdate();
}
}
}
|
a276c931-14c6-4dde-8b80-5185f7c82f1d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-02 17:09:59", "repo_name": "GinaSnap/automation-framework", "sub_path": "/AutomationFramework/AutomationFramework/src/mobilepage/ProfileHome.java", "file_name": "ProfileHome.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "cd88fd03aebd6f596c51535f523fbd270b1ef424", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/GinaSnap/automation-framework
| 255
|
FILENAME: ProfileHome.java
| 0.247987
|
package mobilepage;
import element.BaseMobileElement;
/**
* This Class defines the behavior and elements on the Profile Page.
* Access by Clicking on Account and Selecting Profile.
* @author GMitchell
*
*/
public class ProfileHome extends BasePage {
//Main Account Page
public BaseMobileElement btnGoBack = new BaseMobileElement("your account");
public BaseMobileElement btnSave = new BaseMobileElement("save");
public BaseMobileElement firstName = new BaseMobileElement("First name");
public BaseMobileElement lastName = new BaseMobileElement("Last name");
public BaseMobileElement email = new BaseMobileElement("Email address");
public BaseMobileElement phoneNumber = new BaseMobileElement("Password"); //I'm not sure why this is labeled as Password.
public BaseMobileElement btnNewPassword = new BaseMobileElement("NewPassword");
/**
* Click the Back Arrow in the top Navigation.
*/
public void goBack()
{
btnGoBack.click();
}
/**
* Save Profile Changes
*/
public void save()
{
btnSave.click();
}
/**
* Update Password - not developed
*/
public void updatePassword(String password)
{
}
}
|
21e76ebe-d03c-49e0-ad5a-7620a9d12685
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-30 22:31:42", "repo_name": "lwhamilton03/AdvancedTestingAssessment", "sub_path": "/src/main/java/com/qa/AdvancedTesting/AddOwnerPage.java", "file_name": "AddOwnerPage.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "c091313c1ed1e43874b4af5fd454d7cbb7a09195", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lwhamilton03/AdvancedTestingAssessment
| 233
|
FILENAME: AddOwnerPage.java
| 0.272025
|
package com.qa.AdvancedTesting;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class AddOwnerPage
{
@FindBy(xpath = "//*[@id=\'firstName\']")
private WebElement firstNameBox;
@FindBy(xpath = "//*[@id=\'lastName\']")
private WebElement lastNameBox;
@FindBy(xpath = "//*[@id='address']")
private WebElement address;
@FindBy(xpath = "//*[@id=\'city\']")
private WebElement city;
@FindBy(xpath = "//*[@id=\'telephone\']")
private WebElement telephone;
@FindBy(xpath = "/html/body/app-root/app-owner-add/div/div/form/div[7]/div/button[2]")
private WebElement submitButton;
public void addOwner(String name, String lName, String addressTxt, String cityTxt, String phone)
{
firstNameBox.click();
firstNameBox.sendKeys(name);
lastNameBox.click();
lastNameBox.sendKeys(lName);
address.click();
address.sendKeys(addressTxt);
city.click();
city.sendKeys(cityTxt);
telephone.click();
telephone.sendKeys(phone);
submitButton.click();
}
}
|
4fb3d3b4-e60c-413e-8962-a3d93cce562e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-03 16:01:56", "repo_name": "0xNN/RumahAdat", "sub_path": "/app/src/main/java/com/sendi/rumahadat/Splash.java", "file_name": "Splash.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "5ca9784ac6c8e4aa5a0e6a87ced96f0072f8d2c4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/0xNN/RumahAdat
| 206
|
FILENAME: Splash.java
| 0.213377
|
package com.sendi.rumahadat;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
import android.view.WindowManager;
import android.widget.TextView;
public class Splash extends AppCompatActivity {
TextView tv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Typeface customFont = Typeface.createFromAsset(getAssets(),"font/LandasansMedium-ALmWA.ttf");
tv = findViewById(R.id.rumahadat);
tv.setTypeface(customFont);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(Splash.this, MainActivity.class);
startActivity(intent);
finish();
overridePendingTransition(R.anim.fadein,R.anim.fadeout);
}
}, 3000);
}
}
|
9118cf18-fc8c-4737-b1f8-b2c86dc02514
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-21 14:38:52", "repo_name": "hyunwook14/Webspring", "sub_path": "/Webspring/src/main/java/com/java/web/dao/BoardDao.java", "file_name": "BoardDao.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "5c48dc896d36d2be666be2820e342bb73260237c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hyunwook14/Webspring
| 201
|
FILENAME: BoardDao.java
| 0.256832
|
package com.java.web.dao;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class BoardDao implements BoardDaoInterface {
@Autowired
SqlSessionTemplate sqlSession;
@Override
public int insert(HashMap<String, Object> resultMap) {
System.out.println("resultMap:"+resultMap);
return sqlSession.insert("board.insert", resultMap);
}
@Override
public List<HashMap<String,Object>> select() {
List<HashMap<String,Object>> selectlist = new ArrayList<>();
selectlist = sqlSession.selectList("board.select");
return selectlist;
}
@Override
public int delete(HashMap<String, Object> data) {
return sqlSession.update("board.delete", data);
}
@Override
public int update(HashMap<String, Object> data) {
return sqlSession.update("board.update", data);
}
}
|
f9cb59b9-d6b4-45c3-b9e6-139027286c90
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2022-05-05T13:23:51", "repo_name": "roboconf/roboconf-maven-archetype", "sub_path": "/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1007, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "0f42ab68f65e5f50032590b5a465cc00e79ce793", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/roboconf/roboconf-maven-archetype
| 269
|
FILENAME: readme.md
| 0.245085
|
# Roboconf Maven Archetype
[](http://www.apache.org/licenses/LICENSE-2.0)
[](https://gitter.im/roboconf/roboconf)
[](https://roboconf.github.io)
A Maven archetype for Roboconf projects.
Use the following command to create a new Roboconf project from this archetype.
```
mvn archetype:generate \
-DarchetypeGroupId=net.roboconf \
-DarchetypeArtifactId=roboconf-maven-archetype \
-DarchetypeVersion=1.0 \
-DgroupId=<my.groupid> \
-DartifactId=<my-artifactId>
```
Because there should not be a lot of versions of this archetype,
it was placed in its own Git repository. Like the **Roboconf parent**,
it should be released on demand, independently of the Roboconf roadmap.
|
07ff7ac1-db19-4faf-b5ae-9b514290432c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-22 09:03:47", "repo_name": "xuxin511/EWMS", "sub_path": "/Lib_Base/src/main/java/com/xx/chinetek/chineteklib/util/dialog/MessageBox.java", "file_name": "MessageBox.java", "file_ext": "java", "file_size_in_byte": 1188, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "a4f38b60abc35fc5ca3346d034325caafc19bee9", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/xuxin511/EWMS
| 212
|
FILENAME: MessageBox.java
| 0.233706
|
package com.xx.chinetek.chineteklib.util.dialog;
import android.content.Context;
import com.xx.chinetek.chineteklib.R;
import cn.pedant.SweetAlert.SweetAlertDialog;
public class MessageBox {
static String Showmsg="";
/**
* 弹出默认提示框
*
* @param context 上下文
* @param message 需要弹出的消息
*/
public static void Show(Context context, String message) {
if(!Showmsg.equals(message)) {
new SweetAlertDialog(context, SweetAlertDialog.WARNING_TYPE)
.setTitleText(context.getResources().getString(R.string.common_warning))
.setContentText(message)
.setConfirmText(context.getResources().getString(R.string.common_comfig))
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sDialog) {
Showmsg="";
sDialog.dismissWithAnimation();
}
})
.show();
Showmsg=message;
}
}
}
|
ddf1ada1-eed7-4060-bce4-43f99bf5ef81
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-25 22:25:27", "repo_name": "MiztaOak/OOProjectGoD", "sub_path": "/KahIT/app/src/main/java/com/god/kahit/networkManager/packets/EventCategoryVoteResultPacket.java", "file_name": "EventCategoryVoteResultPacket.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "22eb0ac654b2389595f0a9ed8f69ffe8990f6467", "star_events_count": 4, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/MiztaOak/OOProjectGoD
| 209
|
FILENAME: EventCategoryVoteResultPacket.java
| 0.285372
|
package com.god.kahit.networkManager.packets;
/**
* responsibility: This class is responsible for building and parsing the necessary contents
* to convey a category vote result event.
* used-by: This class is used in the following classes:
* PacketHandler
*
* @author: Mats Cedervall
*/
public class EventCategoryVoteResultPacket extends Packet {
public static final int PACKET_ID = 23;
public EventCategoryVoteResultPacket(String categoryId) {
super(PACKET_ID, categoryId.getBytes());
}
/**
* Method used to parse the categoryId of a built EventCategoryVoteResultPacket
*
* @param rawPayload byte[] containing the packetID and the packet specific content of
* * a EventCategoryVoteResultPacket
* @return string containing the categoryId
*/
public static String getCategoryId(byte[] rawPayload) {
return new String(getPayloadContent(rawPayload)); //Parse rawPayload content, convert to string, return
}
}
|
bb602103-b1f4-4146-a978-8ecdebd78da0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-08 14:45:41", "repo_name": "lphx/ph_portiem_test", "sub_path": "/src/main/java/cn/phlos/ph_portiem_test/impl/UserServiceImpl.java", "file_name": "UserServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "94c5243d5c4b87423fd5d6c4a23de8ae19363116", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lphx/ph_portiem_test
| 213
|
FILENAME: UserServiceImpl.java
| 0.245085
|
package cn.phlos.ph_portiem_test.impl;
import cn.phlos.ph_portiem_test.domain.User;
import cn.phlos.ph_portiem_test.mapper.UserMapper;
import cn.phlos.ph_portiem_test.service.UserService;
import cn.phlos.ph_portiem_test.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserMapper userMapper;
public List<User> page(Page page) {
return userMapper.page(page);
}
public void update(User user) {
userMapper.update(user);
}
public int save(User user) {
return userMapper.save(user);
}
public void remove(Integer id) {
userMapper.remove(id);
}
public int count() {
return userMapper.count();
}
public User findOne(Integer id) {
return userMapper.findOne(id);
}
public List<User> findAllList() {
return userMapper.findAllList();
}
}
|
5374228a-6bfe-41ed-9447-cf11fb929716
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-09-23 16:19:04", "repo_name": "precog/jclouds-chef", "sub_path": "/demos/gae/src/main/java/org/jclouds/chef/demo/config/MessageFormatFormatter.java", "file_name": "MessageFormatFormatter.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "c4b928d3a95e6e21002c369924f7a7e632816305", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/precog/jclouds-chef
| 260
|
FILENAME: MessageFormatFormatter.java
| 0.271252
|
package org.jclouds.chef.demo.config;
import java.text.MessageFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.google.appengine.repackaged.com.google.common.base.Throwables;
public class MessageFormatFormatter extends Formatter {
private static final String FORMAT = "{0,date,hh:mm:ss.SSS} {3}[{1}|{2}]: {4} \n";
private static final MessageFormat messageFormat = new MessageFormat(FORMAT);
private static final MessageFormat thrownFormat = new MessageFormat(FORMAT + "{5}\n");
public MessageFormatFormatter() {
super();
}
@Override
public String format(LogRecord record) {
Object[] arguments = new Object[6];
arguments[0] = new Date(record.getMillis());
arguments[1] = record.getLevel();
arguments[3] = record.getLoggerName();
arguments[2] = Thread.currentThread().getName();
arguments[4] = record.getMessage();
arguments[5] = record.getThrown() != null ? Throwables.getStackTraceAsString(record.getThrown()) : null;
return arguments[5] == null ? messageFormat.format(arguments) : thrownFormat.format(arguments);
}
}
|
1e367038-2871-407b-911a-f2650c42be19
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-27 12:38:12", "repo_name": "Kalluri92/SamplePracticeSpring", "sub_path": "/OurPortal/src/main/java/com/ourportal/directory/Response.java", "file_name": "Response.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "a4ef5d43a401c02532865f1340333143c098afb0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Kalluri92/SamplePracticeSpring
| 190
|
FILENAME: Response.java
| 0.242206
|
package com.ourportal.directory;
import java.util.List;
public class Response {
private boolean success;
private String responseMessage;
private List<Object> optionalResponseObject;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getResponseMessage() {
return responseMessage;
}
public void setResponseMessage(String responseMessage) {
this.responseMessage = responseMessage;
}
public List<Object> getOptionalResponseObject() {
return optionalResponseObject;
}
public void setOptionalResponseObject(List<Object> optionalResponseObject) {
this.optionalResponseObject = optionalResponseObject;
}
public Response(boolean success, String responseMessage, List<Object> optionalResponseObject) {
this.success = success;
this.responseMessage = responseMessage;
this.optionalResponseObject = optionalResponseObject;
}
public Response() {
}
}
|
9f28471d-4519-4206-b300-61792073aa5a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-03 14:32:20", "repo_name": "subramanian162/CompletedWebProjects", "sub_path": "/ExpensesTracker/src/main/java/com/subu2code/expenses_tracker/config/SpringBeanConfig.java", "file_name": "SpringBeanConfig.java", "file_ext": "java", "file_size_in_byte": 1054, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "08834ad32bf1cb219901128b84eeec0518914d11", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/subramanian162/CompletedWebProjects
| 196
|
FILENAME: SpringBeanConfig.java
| 0.27048
|
package com.subu2code.expenses_tracker.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
/*
* This is the Spring Configuration class
* In this, I mentioned the scan package for components as com.subu2code.expenses_tracker
* And add my View resolver
*
* */
@Configuration
@EnableWebMvc
@ComponentScan(basePackages="com.subu2code.expenses_tracker")
public class SpringBeanConfig {
@Bean
public ViewResolver getViewResolver() {
System.out.println("ViewResolver Bean was created");
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setPrefix("WEB-INF/view/");
viewResolver.setSuffix(".jsp");
return viewResolver;
}
}
|
29137fee-7738-4cf4-955c-1f3311ab873e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-29 18:58:36", "repo_name": "mugilscloud/qa_automation", "sub_path": "/Ecommerce-Order-Test/src/test/java/com/apex/ecommerce/test/AmazonLoginTestNG.java", "file_name": "AmazonLoginTestNG.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "168cd20629f261c10750c5a2ccad5fdfe105fabe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mugilscloud/qa_automation
| 269
|
FILENAME: AmazonLoginTestNG.java
| 0.288569
|
package com.apex.ecommerce.test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class AmazonLoginTestNG {
WebDriver driver = null;
@BeforeTest
public void setUpTest() {
driver = new FirefoxDriver();
driver.get("http://www.amazon.com");
}
@Test
public void loginSuccess() throws Exception {
WebElement email = driver.findElement(By.id("ap_email"));
email.sendKeys("himani.g09@gmail.com");
Thread.currentThread().sleep(10000);
WebElement pwd = driver.findElement(By.id("ap_password"));
pwd.sendKeys("himani123");
Thread.currentThread().sleep(10000);
WebElement nextBtn2 = driver.findElement(By.id("signInSubmit"));
nextBtn2.click();
Thread.currentThread().sleep(30000);
//
// String signIn = driver.getPageSource();
// Assert.assertEquals(signIn.contains("Hello, Himani"), true);
}
@AfterTest
public void cleanUp() {
driver.close();
}
}
|
46b32be7-297e-4db7-82ee-75e116aa47f6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-21 07:57:07", "repo_name": "Sanjay007/Spring-Cloud-Examples", "sub_path": "/Eureka-Service-Client/src/main/java/com/frugalis/EurekaServiceClient/CustomerController.java", "file_name": "CustomerController.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "2284c1a5f942563e09cc8831eaf2d9390f596de9", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Sanjay007/Spring-Cloud-Examples
| 212
|
FILENAME: CustomerController.java
| 0.26588
|
package com.frugalis.EurekaServiceClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
public class CustomerController {
private static Map<String, List<Customer>> custList = new HashMap<String, List<Customer>>();
static {
custList = new HashMap<String, List<Customer>>();
List<Customer> lst = new ArrayList<Customer>();
Customer std = new Customer();
std.setId(7);
std.setName("testing");
lst.add(std);
std = new Customer();
std.setId(5);
std.setAddress("ASERT");
lst.add(std);
custList.put("first", lst);
}
@RequestMapping(value = "/getcustomer", method = RequestMethod.GET)
public List<Customer> getStudents() {
List<Customer> studentList = custList.get("first");
return studentList;
}
}
|
24a5e64e-a67e-4155-8ad9-f057675999ca
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-18 17:38:55", "repo_name": "ICY105/TheAvengersLeague-Backend", "sub_path": "/src/main/java/com/revature/models/json_mapping/CreateUser.java", "file_name": "CreateUser.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "debe9e03e1e675352564ef2d2bbb7a0469803bee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ICY105/TheAvengersLeague-Backend
| 255
|
FILENAME: CreateUser.java
| 0.264358
|
package com.revature.models.json_mapping;
import com.revature.models.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CreateUser {
private String firstName;
private String lastName;
private String username;
private String password;
private String email;
public String validate() {
if(this.firstName == null || this.firstName.length() < 1)
return "First name cannot be blank.";
if(this.lastName == null || this.lastName.length() < 1)
return "Last name cannot be blank.";
if(this.username == null || this.username.length() < 3 || this.username.replaceFirst("[^a-zA-Z0-9]", "*").indexOf('*') > -1)
return "Username must contain only alpha-numeric characters, and be at least 3 characters long.";
if(this.password == null || this.password.length() < 3)
return "Password much be at least 3 characters long.";
if(this.email == null || this.email.indexOf('@') == -1)
return "Not a valid email.";
return "valid";
}
public User getUserObject() {
return new User(this.firstName,this.lastName,this.username,this.password,this.email);
}
}
|
a65fc304-597d-47cb-b268-19e657a1af38
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-08 21:28:15", "repo_name": "luiznazari/nzz-tools", "sub_path": "/nzz-tools-parent/nzz-validation-api/src/main/java/br/com/nzz/validation/impl/CustomValidatorImpl.java", "file_name": "CustomValidatorImpl.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "f328dbb9b81040d326c11fc115d3388b1c7cb91b", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/luiznazari/nzz-tools
| 190
|
FILENAME: CustomValidatorImpl.java
| 0.261331
|
package br.com.nzz.validation.impl;
import br.com.nzz.validation.*;
import lombok.AccessLevel;
import lombok.Setter;
import org.jspare.core.Component;
import javax.validation.Validator;
import java.util.function.Supplier;
@Component
public class CustomValidatorImpl implements CustomValidator {
@Setter(AccessLevel.PACKAGE)
private Validator validator;
public CustomValidatorImpl() {
this.validator = new BeanValidator();
}
@Override
public ValidationResult validate(Object object) {
return ValidationResult.of(this.validator.validate(object));
}
@Override
public ValidationResult validate(Supplier<ValidationError> errorSupplier) {
return ValidationResult.empty().validate(errorSupplier);
}
@Override
public <T> ValidationBuilder<T> builder(Class<T> targetObjectClass) {
return new ValidationBuilderImpl<>();
}
@Override
public <T> ValidationObjectBuilder<T> builder(T target) {
return new ValidationObjectBuilderImpl<>(target);
}
}
|
62e5dd48-342c-4151-be35-b36d14f0e310
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-30 21:14:55", "repo_name": "pkErbynn/java-playground-tcl", "sub_path": "/src/io/turntabl/optional/Basic.java", "file_name": "Basic.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "e7044b1478c8178e19962970af85389a7254253f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pkErbynn/java-playground-tcl
| 200
|
FILENAME: Basic.java
| 0.285372
|
package io.turntabl.optional;
import java.util.Optional;
public class Basic {
public static void main(String[] args) {
Optional<Object> Impty = Optional.empty();
System.out.println(Impty.isPresent());
System.out.println(Impty.isEmpty());
// code smell
String name = null;
if (name != null) {
name.toLowerCase();
} else {
System.out.println("Invalid name");
}
// Optional<String> name = Optional.ofNullable("John Erbynn");
Optional<String> nameOptional = Optional.ofNullable(null);
String n = nameOptional.orElse("Invalid name");
System.out.println(n);
String n2 = nameOptional.map(e -> e.toLowerCase())
.orElse("pkay");
System.out.println(n2);
String n3 = nameOptional.orElseGet(() -> {
// ...some extra work
return "something";
});
System.out.println(n3);
}
}
|
29f2be97-11eb-44e1-b66e-2f73bc343077
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-30 20:56:28", "repo_name": "shstrophies/SHSTrophies", "sub_path": "/app/src/main/java/com/shs/trophiesapp/utils/TrophiesAppGlideModule.java", "file_name": "TrophiesAppGlideModule.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "c88a24fd3521cc27e05a77dd2119b09da878f781", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/shstrophies/SHSTrophies
| 227
|
FILENAME: TrophiesAppGlideModule.java
| 0.26971
|
package com.shs.trophiesapp.utils;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.load.engine.cache.ExternalPreferredCacheDiskCacheFactory;
import com.bumptech.glide.module.AppGlideModule;
@GlideModule
public class TrophiesAppGlideModule extends AppGlideModule {
@Override
public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
super.applyOptions(context, builder);
int diskCacheSizeBytes = 1024 * 1024 * 2000;
builder.setDiskCache(
new ExternalPreferredCacheDiskCacheFactory(context, Constants.DATA_DIRECTORY_DISK_CACHE_IMAGES, diskCacheSizeBytes)
);
builder.setLogLevel(Log.DEBUG);
}
@Override
public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
super.registerComponents(context, glide, registry);
}
}
|
77461c46-5a5d-4814-910a-a18e70f02343
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-16 02:50:23", "repo_name": "MaybeAction/LoadImageThree-level", "sub_path": "/app/src/main/java/com/example/maybe/loadimagethreelevel/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "4963f8342723783cf5dbf4faa91abc559afbe0bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MaybeAction/LoadImageThree-level
| 214
|
FILENAME: MainActivity.java
| 0.235108
|
package com.example.maybe.loadimagethreelevel;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private ImageView iv;
private Button btnLoadImage;
private String url="http://img15.3lian.com/2015/f2/160/d/65.jpg";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
iv= (ImageView) findViewById(R.id.iv);
btnLoadImage= (Button) findViewById(R.id.btnLoadImage);
btnLoadImage.setOnClickListener(this);
}
@Override
public void onClick(View view) {
Toast.makeText(this, "正在下载", Toast.LENGTH_SHORT).show();
//调用三级缓存下载
LoadImage.getLoadImage(MainActivity.this,url,iv,500,500);
}
}
|
98c7ddff-7242-409e-ad5c-54428c4894f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-09 07:51:39", "repo_name": "Shehroaz/epay-springBoot-webApp", "sub_path": "/src/main/java/com/sherry/epaydigital/data/model/PaymentRequest.java", "file_name": "PaymentRequest.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "f276d0e268db64f3ee6e3abe2817c0cb1454d033", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Shehroaz/epay-springBoot-webApp
| 234
|
FILENAME: PaymentRequest.java
| 0.261331
|
package com.sherry.epaydigital.data.model;
import javax.persistence.*;
import java.io.Serializable;
@Entity
@Table(name = "payment_request")
public class PaymentRequest implements Serializable {
private static final long serialVersionId = -3009157732242241606l;
@Id
@GeneratedValue
private Long id;
private String buyer_email;
@ManyToOne
@JoinColumn(name = "customer_id" , nullable = false)
private Customer customer_fk;
//region Setters
public void setId(Long id) {
this.id = id;
}
public void setBuyer_email(String buyer_email) {
this.buyer_email = buyer_email;
}
public void setCustomer_fk(Customer customer_fk) {
this.customer_fk = customer_fk;
}
//endregion
//region Getters
public Long getId() {
return id;
}
public String getBuyer_email() {
return buyer_email;
}
public Customer getCustomer_fk() {
return customer_fk;
}
//endregion
}
|
7f5b07b7-8ad6-491b-ad82-d3317efde738
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-16 08:05:34", "repo_name": "iamStephenFang/JavaEE_Course_Projects", "sub_path": "/实验七/hibernate-prj3/src/cn/edu/zjut/action/UserAction.java", "file_name": "UserAction.java", "file_ext": "java", "file_size_in_byte": 1108, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "48a030b25c324a46ae30594026f90617d40a27fd", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/iamStephenFang/JavaEE_Course_Projects
| 229
|
FILENAME: UserAction.java
| 0.272025
|
package cn.edu.zjut.action;
import cn.edu.zjut.po.Address;
import cn.edu.zjut.po.Customer;
import cn.edu.zjut.service.UserService;
public class UserAction {
private Customer loginUser;
private Address address;
public String login() {
UserService userServ = new UserService();
if (userServ.login(loginUser)) return "success";
else return "fail";
}
public String addAddr() {
UserService userServ = new UserService();
if (userServ.addAddr(loginUser, address))
return "success";
else
return "fail";
}
public String delAddr() {
UserService userServ = new UserService();
if (userServ.delAddr(loginUser, address))
return "success";
else
return "fail";
}
public Address getAddress() { return address; }
public Customer getLoginUser() {
return loginUser;
}
public void setAddress(Address address) {
this.address = address;
}
public void setLoginUser(Customer loginUser) {
this.loginUser = loginUser;
}
}
|
596c5740-d931-4865-9235-d7ec0111079e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-05 15:20:59", "repo_name": "xkamil/fishapp4", "sub_path": "/src/main/java/com/example/fishapp/UserRequestInterceptor.java", "file_name": "UserRequestInterceptor.java", "file_ext": "java", "file_size_in_byte": 985, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "3f997aef5fbb985f584da58cd1f1ffbe96ea1811", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/xkamil/fishapp4
| 158
|
FILENAME: UserRequestInterceptor.java
| 0.252384
|
package com.example.fishapp;
import com.example.fishapp.app.user.repository.UserRepository;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.UUID;
@Component
public class UserRequestInterceptor extends HandlerInterceptorAdapter {
private final UserRepository userRepository;
public UserRequestInterceptor(UserRepository userRepository) {
this.userRepository = userRepository;
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (request.getHeader("userId") != null) {
UUID userId = UUID.fromString(request.getHeader("userId"));
userRepository.findById(userId).ifPresent(user -> request.setAttribute("user", user));
}
return true;
}
}
|
1e2aa6cd-6405-47d4-b260-d951eec35bd5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-31 01:01:28", "repo_name": "Yuchengw/Lesbonne", "sub_path": "/core/appserver/src/main/java/com/lesbonne/api/config/ApiProtocol.java", "file_name": "ApiProtocol.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "cbd8c216f58d98e89e8ed4264cbbe7d9e3f28b0f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Yuchengw/Lesbonne
| 222
|
FILENAME: ApiProtocol.java
| 0.264358
|
package com.lesbonne.api.config;
public enum ApiProtocol {
RestJson("java.util", "/api/", "application/json", ApiFamily.Rest);
private final String rootClassName;
private final String rootPath;
private final String contentType;
private final ApiFamily apiFamily;
private final ObjectFamily objectFamily;
private ApiProtocol(String rootClassName, String rootPath, String contentType, ApiFamily apiFamily) {
this.rootClassName = rootClassName;
this.rootPath = rootPath;
this.contentType = contentType;
this.apiFamily = apiFamily;
this.objectFamily = apiFamily.isRestApi() ? ObjectFamily.JSON : null;
}
public String getRootClassName() {
return rootClassName;
}
public String getRootPath() {
return rootPath;
}
public String getContentType() {
return contentType;
}
public ApiFamily getApiFamily() {
return apiFamily;
}
public ObjectFamily getObjectFamily() {
return objectFamily;
}
public boolean acceptJSON() {
return this == RestJson;
}
}
|
a4a3f323-07d9-4d14-8b08-384bf55bf3c0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-21 20:14:37", "repo_name": "SadouskiYury/CustomPageFactory-Junit5-Jupiter-parallel", "sub_path": "/src/test/java/extension/CustomNameGenerator.java", "file_name": "CustomNameGenerator.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "13465d57cba0d160e338253225f03ec6ef677c19", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SadouskiYury/CustomPageFactory-Junit5-Jupiter-parallel
| 228
|
FILENAME: CustomNameGenerator.java
| 0.278257
|
package extension;
import org.apache.commons.lang.StringUtils;
import org.junit.jupiter.api.DisplayNameGenerator;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.stream.Collectors;
public class CustomNameGenerator implements DisplayNameGenerator {
@Override
public String generateDisplayNameForClass(Class<?> testClass) {
return this.replaceUnderscores(generateDisplayNameForClass(testClass.getName()));
}
@Override
public String generateDisplayNameForNestedClass(Class<?> nestedClass) {
return this.replaceUnderscores(nestedClass.getSimpleName());
}
@Override
public String generateDisplayNameForMethod(Class<?> testClass, Method testMethod) {
return this.replaceUnderscores(replaceUnderscores((testMethod.getName())) + DisplayNameGenerator.parameterTypesAsString(testMethod));
}
private String replaceUnderscores(String name) {
return StringUtils.capitalize(Arrays.stream(StringUtils.splitByCharacterTypeCamelCase(name)).map(String::toLowerCase).collect(Collectors.joining(" ")));
}
public String generateDisplayNameForClass(String name) {
int lastDot = name.lastIndexOf(46);
return name.substring(lastDot + 1);
}
}
|
27083bb2-8c30-4e43-9fdf-64ba0cb016d7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-02 03:00:18", "repo_name": "brakhin/job4j", "sub_path": "/2_io/src/test/java/ru/bgbrakhi/io/ClientTest.java", "file_name": "ClientTest.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "107862d61fda0fea43d6edc0ae03accbdf3878ea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/brakhin/job4j
| 211
|
FILENAME: ClientTest.java
| 0.275909
|
package ru.bgbrakhi.io;
import org.junit.Test;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class ClientTest {
private static final String LN = System.getProperty("line.separator");
@Test
public void whernUnknownResponseThenIncnownRequest() throws IOException {
Socket socket = mock(Socket.class);
String input = String.format("request%sexit%s", LN, LN);
Scanner scanner = new Scanner(input);
ByteArrayOutputStream out = new ByteArrayOutputStream();
ByteArrayInputStream in = new ByteArrayInputStream(
String.format("response%s%s%s", LN, LN, LN).getBytes()
);
when(socket.getOutputStream()).thenReturn(out);
when(socket.getInputStream()).thenReturn(in);
Client client = new Client(socket, scanner);
client.start();
assertThat(out.toString(), is(input));
}
}
|
60d811ef-a4e7-4039-8bf2-8d79f6b2b26f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-30 07:10:44", "repo_name": "DingSJ/Springboot-hello", "sub_path": "/src/main/java/com/example/demo/controller/HelloController.java", "file_name": "HelloController.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "874507025ed01bdccd6627a9c623e629e5f4a411", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/DingSJ/Springboot-hello
| 215
|
FILENAME: HelloController.java
| 0.262842
|
package com.example.demo.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.example.demo.bean.User;
/**
* @author dingsj
* */
@Controller
public class HelloController {
@Value("${test.prop.id}")
private String id;
@Value("${test.prop.name}")
private String name;
@Value("${test.prop.addr}")
private String addr;
Logger logger = LoggerFactory.getLogger(HelloController.class);
@RequestMapping("hello")
public String hello(Model model) {
logger.info("Hello Controller run ....");
User user = new User("U10000001","Test","北京市丰台区科技园");
User user2 = new User(id,name,addr);
logger.info("User : " + user2.toString());
model.addAttribute("user", user); // 传给页面
return "index";
}
}
|
4339f279-e30a-4135-a840-60ccae9d900c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-12 06:51:48", "repo_name": "originalkaratechop/CoreApp_Repo", "sub_path": "/app/src/main/java/com/example/android/coreapp/TabAdapter.java", "file_name": "TabAdapter.java", "file_ext": "java", "file_size_in_byte": 1056, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "2843b371abfd2d455563398f2a54f561a1a547f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/originalkaratechop/CoreApp_Repo
| 198
|
FILENAME: TabAdapter.java
| 0.258326
|
package com.example.android.coreapp;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.SparseArray;
public class TabAdapter extends FragmentPagerAdapter {
final int PAGE_COUNT = 2;
private Context mContext;
public TabAdapter(Context context, FragmentManager fm) {
super(fm);
mContext = context;
}
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return new FragmentCore();
default:
return new FragmentHistogram();
}
}
@Override
public int getCount() {
return PAGE_COUNT;
}
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return mContext.getString(R.string.tab0);
default:
return mContext.getString(R.string.tab1);
}
}
}
|
999d3564-8ec2-400b-b159-d23afe96bfdc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-12 10:54:55", "repo_name": "Jinshadnu/E-CommerceApp", "sub_path": "/app/src/main/java/com/example/e_commerceapp/activity/repository/FeaturedProductRepository.java", "file_name": "FeaturedProductRepository.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "d258f4c196f959689252c40417bc967b60fc976b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Jinshadnu/E-CommerceApp
| 208
|
FILENAME: FeaturedProductRepository.java
| 0.276691
|
package com.example.e_commerceapp.activity.repository;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.example.e_commerceapp.R;
import com.example.e_commerceapp.activity.pojo.FeaturedProducts;
import java.util.ArrayList;
import java.util.List;
public class FeaturedProductRepository {
public FeaturedProductRepository() {
}
public LiveData<List<FeaturedProducts>> getFearuredProducts(){
MutableLiveData mutableLiveData=new
MutableLiveData();
List<FeaturedProducts> featuredProducts=new ArrayList<>();
featuredProducts.add(new FeaturedProducts(R.drawable.watch,"Watch","2% off","Rs.550000/-"));
featuredProducts.add(new FeaturedProducts(R.drawable.iphone1,"Iphone11pro","2% off","Rs.550000/-"));
featuredProducts.add(new FeaturedProducts(R.drawable.shoes,"Shoes","2% off","Rs.550000/-"));
mutableLiveData.setValue(featuredProducts);
return mutableLiveData;
}
}
|
a08bf43a-e9c1-48c3-8cc4-3a44860608a9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-09 07:59:32", "repo_name": "HannanShaik/fcm-notifications", "sub_path": "/app/src/main/java/com/hs/fcm/FCMService.java", "file_name": "FCMService.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "c619e2a38fcbf9ad3dbbeacfdcafe3b24ef2fc54", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/HannanShaik/fcm-notifications
| 212
|
FILENAME: FCMService.java
| 0.228156
|
package com.hs.fcm;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.media.RingtoneManager;
import android.net.Uri;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
/**
* Created by hannan on 11/9/16.
*/
public class FCMService extends FirebaseMessagingService {
private static final String TAG = "FCMService";
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.e(TAG, "From: " + remoteMessage.getFrom());
if (remoteMessage.getData().size() > 0) {
Log.e(TAG, "Message data payload: " + remoteMessage.getData());
}
if (remoteMessage.getNotification() != null) {
Log.e(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
}
}
}
|
e51d538c-3c23-466c-94a6-713eeec81d8f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-08 06:00:08", "repo_name": "drajer-health/eCRNow", "sub_path": "/src/main/java/com/drajer/cda/utils/ValidateErrorHandler.java", "file_name": "ValidateErrorHandler.java", "file_ext": "java", "file_size_in_byte": 1152, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "e917ad01feb9284b0098092feb88644b4d86b614", "star_events_count": 30, "fork_events_count": 39, "src_encoding": "UTF-8"}
|
https://github.com/drajer-health/eCRNow
| 225
|
FILENAME: ValidateErrorHandler.java
| 0.23231
|
package com.drajer.cda.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
public class ValidateErrorHandler implements ErrorHandler {
public static final Logger logger = LoggerFactory.getLogger(ValidateErrorHandler.class);
private boolean isException = false;
public void warning(SAXParseException exception) throws SAXException {
logMessage(exception);
}
public void fatalError(SAXParseException exception) throws SAXException {
isException = true;
logMessage(exception);
}
public void error(SAXParseException exception) throws SAXException {
isException = true;
logger.info("error method called in ValidateErrorHandler");
logMessage(exception);
}
public boolean getIsException() {
return isException;
}
private static void logMessage(SAXParseException exception) {
logger.warn(
"Message: Error validating XML Data at Line: {} Column: {} Message: {}",
exception.getLineNumber(),
exception.getColumnNumber(),
exception.getMessage());
}
}
|
de3c6ee5-ee42-4d61-8d35-384b1dc9e57d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-09-01 08:54:54", "repo_name": "youtube/cobalt", "sub_path": "/starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfo.java", "file_name": "ClientLogInfo.java", "file_ext": "java", "file_size_in_byte": 1179, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "fa82de6660612fd428352c40535571fcdd990f80", "star_events_count": 169, "fork_events_count": 80, "src_encoding": "UTF-8"}
|
https://github.com/youtube/cobalt
| 269
|
FILENAME: ClientLogInfo.java
| 0.285372
|
package dev.cobalt.libraries.services.clientloginfo;
import static java.nio.charset.StandardCharsets.UTF_8;
import android.content.Context;
import dev.cobalt.coat.CobaltService;
import dev.cobalt.util.Log;
/** ClientLogInfo to report Android API support on android devices. */
public class ClientLogInfo extends CobaltService {
public static final String TAG = "ClientLogInfo";
// The application uses this identifier to open the service.
protected static final String SERVICE_NAME = "dev.cobalt.coat.clientloginfo";
private static String clientInfo = "";
public ClientLogInfo(Context appContext, long nativeService) {
Log.i(TAG, "Opening ClientLogInfo");
}
@Override
public void beforeStartOrResume() {}
@Override
public void beforeSuspend() {}
@Override
public void afterStopped() {}
@Override
public ResponseToClient receiveFromClient(byte[] data) {
ResponseToClient response = new ResponseToClient();
response.invalidState = false;
response.data = clientInfo.getBytes(UTF_8);
return response;
}
@Override
public void close() {}
public static void setClientInfo(String value) {
clientInfo = value;
}
}
|
a59decd6-1963-4ba9-bc94-852773fe91b2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-20 16:39:05", "repo_name": "Holub0816/Dialysis-Station", "sub_path": "/Dialysis - Android Project/app/src/main/java/com/example/dialysis/ConnectionClass.java", "file_name": "ConnectionClass.java", "file_ext": "java", "file_size_in_byte": 974, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f052633fc8d3937703532003755012f2329e76c1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Holub0816/Dialysis-Station
| 198
|
FILENAME: ConnectionClass.java
| 0.225417
|
package com.example.dialysis;
import android.annotation.SuppressLint;
import android.os.StrictMode;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectionClass {
String ip = "192.168.1.5:3306";
String db = "dializa_baza";
String url = "jdbc:mysql://" + ip + "/" + db + "?useSSL=false";
@SuppressLint("NewApi")
public Connection CONN(String user, String password) {
Connection conn = null;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection(url, user, password);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
return conn;
}
}
|
e48db6c2-8bf7-402c-8ffe-e074960998a7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-01 11:42:23", "repo_name": "lost-233/project-parent", "sub_path": "/service-parent/test-service/src/main/java/com/zhaoming/service/test/controller/CategoryController.java", "file_name": "CategoryController.java", "file_ext": "java", "file_size_in_byte": 986, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "f5e79a87af83b9b63e51156b59f748c9cec0bd74", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lost-233/project-parent
| 202
|
FILENAME: CategoryController.java
| 0.212069
|
package com.zhaoming.service.test.controller;
import com.zhaoming.base.service.ServiceResult;
import com.zhaoming.bean.test.dto.CategoryDto;
import com.zhaoming.bean.test.result.CategoryResult;
import com.zhaoming.client.test.CategoryClient;
import com.zhaoming.service.test.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author system
* @since 2019-05-16
*/
@RestController
public class CategoryController implements CategoryClient {
@Autowired
ICategoryService categoryService;
@Override
@GetMapping("/category")
public ServiceResult<CategoryResult.Result, List<CategoryDto>> list() {
List<CategoryDto> list = categoryService.getList();
return new ServiceResult(CategoryResult.Result.SUCCESS, list);
}
}
|
2a41ebd7-c9d5-4462-b046-7cdb0dc03fc8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-04 18:09:43", "repo_name": "usmandurrany/Pranky-5.1", "sub_path": "/app/src/main/java/com/fournodes/ud/pranky/models/ContactDetails.java", "file_name": "ContactDetails.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "bf7641d170cb0ed8f5f47bc85f3818851d846d37", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/usmandurrany/Pranky-5.1
| 241
|
FILENAME: ContactDetails.java
| 0.250913
|
package com.fournodes.ud.pranky.models;
/**
* Created by Usman on 12/1/2016.
*/
public class ContactDetails {
private int id;
private String[] numIDs;
private String name;
private String[] regNumbers;
public int getId() {
return id;
}
public String getName() {
return name;
}
public String[] getRegNumbers() {
return regNumbers;
}
public String[] getNumIDs() {
return numIDs;
}
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setNumIDs(String numIDs) {
if (numIDs != null)
this.numIDs = toArray(numIDs);
else
this.numIDs = new String[]{"-1"};
}
public void setRegNumbers(String regNumbers) {
this.regNumbers = toArray(regNumbers);
}
public String[] toArray(String s) {
return s.replace(" ", "").replace("[", "").replace("]", "").split(",");
}
}
|
0daf413f-52cb-49ce-aff2-b7315ebfeb1b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-13 15:49:32", "repo_name": "mahmedk13/IntelliPaatMayBatchSeleniumLearning", "sub_path": "/src/org/selenium/learning/ScreenshotExample.java", "file_name": "ScreenshotExample.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "58b0a4cf65dbbc890bcbd5f9b214bb20e37b48ed", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mahmedk13/IntelliPaatMayBatchSeleniumLearning
| 212
|
FILENAME: ScreenshotExample.java
| 0.26588
|
package org.selenium.learning;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.chrome.ChromeDriver;
public class ScreenshotExample {
public static void main(String[] args) throws IOException {
System.setProperty("webdriver.chrome.driver", "D:\\Eclipse_workspace_15Maybatch\\SeleniumLearning\\drivers\\chromedriver.exe");
ChromeDriver driver = new ChromeDriver();
driver.get("https://www.w3schools.com/tags/tag_frame.asp");
driver.manage().window().maximize();
Date d = new Date();
System.out.println(d);
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyyhh:mm:ss");
String time = sdf.format(d).replace(":", "_");
File screenshot =driver.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(screenshot, new File("./screenshots/myscreenshot_"+time+".png"));
}
}
|
4e7b0b88-ff84-4fb7-9ee2-8c44d97da7f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-26 07:19:00", "repo_name": "Devendra-Singh-Bhandari/Reporting", "sub_path": "/ReportingTool/Reporting-Tool/src/main/java/com/reporting/tool/ReportingTool/DBConfig.java", "file_name": "DBConfig.java", "file_ext": "java", "file_size_in_byte": 1062, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "665f48067781432e7c8a72925a0a194249486d57", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Devendra-Singh-Bhandari/Reporting
| 198
|
FILENAME: DBConfig.java
| 0.224055
|
package com.reporting.tool.ReportingTool;
import javax.sql.DataSource;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import com.zaxxer.hikari.HikariConfig;
@Configuration
@PropertySource("classpath:application.properties")
public class DBConfig {
@Bean
public DataSource getDataSource() {
System.out.println("--------DB Connection start--------");
DataSourceBuilder<DataSource> dataSourceBuilder = (DataSourceBuilder<DataSource>) DataSourceBuilder.create();
dataSourceBuilder.driverClassName("com.mysql.jdbc.Driver");
dataSourceBuilder.url("jdbc:mysql://localhost:3306/reporting?autoReconnect=true&useSSL=false");
dataSourceBuilder.username("root");
dataSourceBuilder.password("root");
System.out.println("--------DB Connected--------");
return dataSourceBuilder.build();
}
}
|
611b9b65-c0c9-4902-8ba7-cbc269311801
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-05-31 20:58:45", "repo_name": "rolandoberweger/WebEng", "sub_path": "/Aufgabe2/lab2/src/main/java/at/ac/tuwien/big/we15/lab2/api/DisplayQuestion.java", "file_name": "DisplayQuestion.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "4966841e08805d1f8bc5cd9b7ef0dffec00b5358", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rolandoberweger/WebEng
| 262
|
FILENAME: DisplayQuestion.java
| 0.261331
|
package at.ac.tuwien.big.we15.lab2.api;
import java.util.List;
/**
* For display of a question in the question view.
*/
public class DisplayQuestion {
private String categoryName;
private int value, id;
private String questionText;
private List<DisplayAnswer> answers;
public DisplayQuestion(String categoryName, int value, int id, String questionText,
List<DisplayAnswer> answers) {
super();
this.categoryName = categoryName;
this.value = value;
this.questionText = questionText;
this.answers = answers;
this.id = id;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public int getId() {
return id;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public String getQuestionText() {
return questionText;
}
public void setQuestionText(String questionText) {
this.questionText = questionText;
}
public List<DisplayAnswer> getAnswers() {
return answers;
}
public void setAnswers(List<DisplayAnswer> answers) {
this.answers = answers;
}
}
|
9f93b740-a6d8-4b24-84dc-f7f9f44a88c8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-09-14T17:58:35", "repo_name": "Nshiv011/BOT", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1011, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "ae99196c065bcd5cbedd1d690edb8301e3a709a9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Nshiv011/BOT
| 244
|
FILENAME: README.md
| 0.271252
|
# BOT
Basically Its a bot based on ONGC CHAT SYSTEM.
Developed with the help of RASA.
LANGUAGES- PYTHON for backend and HTML for frontend.
____________________________________________________
1. First of all, Download the file.
2. Setup Anaconda environment and install RASA in it- {command- (RASA INIT)}
3. You have to check that all the libraries are installed properly.
4. Once it is done, you have to open anaconda command prompt in your terminal and when you reach your folder location like - { (base) C:\Users\HP\Desktop\BOT> }
5. Run this command---{ rasa run -m models --enable-api --cors "*" } in one terminal.
6. Run this command---{ rasa run actions } in second terminal.
7. This will activate your rasa server and your bot will be activated.
8. Just simply open index.html
9. And here is your bot working properly.
10. You can configure your own data in .yml file
11. nlu.yml, stories.yml, domain.yml
ENJOY---------
--------------TECH LOVERS-------------------
|
75613783-a732-41a4-8162-6c3fc402e237
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2013-10-14T13:19:08", "repo_name": "optionalg/scripts", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1011, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "b1d7693322ac237592e4cee1aa5938e4c7ebd7bf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/optionalg/scripts
| 239
|
FILENAME: README.md
| 0.185947
|
# Scripts
These are various scripts I've written.
####git-hooks/
Scripts to be used as hooks for the Git version control system.
####init/
Scripts to control utilities starting/stopping, written with chkconfig in mind.
####mirror-scripts/
Scripts to mirror popular projects on a private mirror on your LAN. See mirror-scripts/README for more info.
####vmware/
Various VMware management scripts written using the vSphere SDK for Perl.
####cisco\_config\_mgr.pl
Uploads/downloads config files to/from Cisco network devices using SNMP and the Cisco::CopyConfig CPAN module.
####csv\_to\_wikitable.pl
Converts CSV and other delimited spreadsheets to wiki syntax.
####mysql\_backup.sh
Runs mysqldump against a list of databases and gzip's the result
####nessus-reporter.pl
Accepts a .nessus v2 file as input and returns per-host vulnerability counts, categorized by crit/high/med/low.
####print\_rfc1918\_networks.pl
Takes a Cisco routing table (such as `sh ip bgp`) and prints only the RFC 1918 networks.
|
eda6920d-388b-475b-a8fa-9219609ede9f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-29 13:33:06", "repo_name": "LJiangCheng/review", "sub_path": "/spider/src/main/java/com/review/spider/controller/SpiderController.java", "file_name": "SpiderController.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "a946865d5107293c4a6c88c80ef60171d59f32d7", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/LJiangCheng/review
| 175
|
FILENAME: SpiderController.java
| 0.226784
|
package com.review.spider.controller;
import com.review.spider.bean.BaseResult;
import com.review.spider.service.spec.Spider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/spider")
public class SpiderController {
private final Spider spiderService;
@Autowired
public SpiderController(Spider spiderService) {
this.spiderService = spiderService;
}
@PostMapping("/crawler")
public BaseResult crawler(@RequestParam String url) {
return spiderService.crawler(url);
}
@PostMapping("shutDown")
public BaseResult shutDown(@RequestParam String url) {
spiderService.shutDown(url);
return BaseResult.success();
}
}
|
9ac7c86d-8a3a-4c22-a415-247d89f88a03
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-17 21:11:11", "repo_name": "edostler/codeclan_classwork", "sub_path": "/week_08/day_4/untitled folder/music_shop_advnaced_solution/src/main/java/models/Guitar.java", "file_name": "Guitar.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "86b13d2253862322c9560912f4fec09c3615053f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/edostler/codeclan_classwork
| 208
|
FILENAME: Guitar.java
| 0.23231
|
package models;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name="guitars")
public class Guitar extends Instrument {
private String model;
private int numberOfStrings;
public Guitar() {
}
public Guitar(int buyPrice, int sellPrice, Shop shop, String colour, String model, int numberOfStrings) {
super(buyPrice, sellPrice, shop, colour, InstrumentType.STRING);
this.model = model;
this.numberOfStrings = numberOfStrings;
}
@Column(name="model")
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
@Column(name="number_of_strings")
public int getNumberOfStrings() {
return numberOfStrings;
}
public void setNumberOfStrings(int numberOfStrings) {
this.numberOfStrings = numberOfStrings;
}
public String play() {
return "Kerrang!!!";
}
}
|
87269677-ca4d-48d1-96da-ff6321e7d9ae
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-23 22:10:45", "repo_name": "sheldor14/Independant-Study", "sub_path": "/Live.java", "file_name": "Live.java", "file_ext": "java", "file_size_in_byte": 1152, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "0d3eb9c0f74d1d7f780978b9ef0c362478ef9c84", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sheldor14/Independant-Study
| 237
|
FILENAME: Live.java
| 0.259826
|
import java.io.*;
import javax.sound.sampled.*;
public class Live{
public static void main(String[] args) {
AudioFormat audioFormat = new AudioFormat(44100, 16, 2, true, true);
TargetDataLine m_targetLine;
SourceDataLine m_sourceLine;
int m_nExternalBufferSize;
try{
m_targetLine = (TargetDataLine) AudioSystem.getLine(
new DataLine.Info(TargetDataLine.class, audioFormat));
m_sourceLine = (SourceDataLine) AudioSystem.getLine(
new DataLine.Info(SourceDataLine.class, audioFormat));
m_targetLine.open(audioFormat);
m_sourceLine.open(audioFormat);
byte[] buffer = new byte[m_targetLine.getBufferSize()/5];
m_targetLine.start();
m_sourceLine.start();
while(true){
// int read = ;
m_sourceLine.write(buffer, 0, m_targetLine.read(buffer, 0, buffer.length));
}
}
catch (LineUnavailableException e){
System.out.println("an error has occured opening a line");
}
}
}
|
c9be3fb1-de80-482c-91e7-7171c8529c78
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-28 11:33:52", "repo_name": "kozhevnikovpe/java1", "sub_path": "/app/src/main/java/com/pavelekozhevnikov/homework1/BaseThemeActivity.java", "file_name": "BaseThemeActivity.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "a3e0eeab54f5afcb2ac2f1ed695cd0086f5f5f0f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kozhevnikovpe/java1
| 182
|
FILENAME: BaseThemeActivity.java
| 0.235108
|
package com.pavelekozhevnikov.homework1;
import android.annotation.SuppressLint;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
@SuppressLint("Registered")
public class BaseThemeActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(App.getInstance().isDarkTheme){
setTheme(R.style.AppDarkTheme);
}
}
@Override
public void onBackPressed(){
super.onBackPressed();
int countOfFragmentInManager = getSupportFragmentManager().getBackStackEntryCount();
if(countOfFragmentInManager>0){
getSupportFragmentManager().popBackStack();
}
}
protected void toggleTheme(){
App.getInstance().toggleTheme();
if(App.getInstance().isDarkTheme){
setTheme(R.style.AppDarkTheme);
}else{
setTheme(R.style.AppTheme);
}
recreate();
}
}
|
06f27922-be96-4423-92b4-b970c4e6f514
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-05 19:04:41", "repo_name": "mo3pheus/Mission.Control", "sub_path": "/src/main/java/nasa/gov/mission/control/weatherAnalysis/WeatherDataArchive.java", "file_name": "WeatherDataArchive.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "53917c44b8eff95d8a2d205acd84dd270d0a3176", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/mo3pheus/Mission.Control
| 191
|
FILENAME: WeatherDataArchive.java
| 0.262842
|
package nasa.gov.mission.control.weatherAnalysis;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
public class WeatherDataArchive {
public static final String FILENAME_PREFIX = "weatherDataCuriosityActual_";
private String weatherData = null;
public WeatherDataArchive(String weatherData) {
this.weatherData = weatherData;
}
public void archiveWeatherData() throws IOException {
URL fileURL = WeatherDataArchive.class.getResource("/WeatherDataArchive/");
String urlString = "src/main/resources/WeatherDataArchive/" + FILENAME_PREFIX
+ Long.toString(System.currentTimeMillis()) + ".log";
System.out.println(urlString);
File weatherDataFile = new File(urlString);
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(weatherDataFile));
bufferedWriter.write(weatherData);
bufferedWriter.close();
}
}
|
892cadcb-b5cb-40f5-b42f-a8df6b8c8e3b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-24 18:34:56", "repo_name": "SlavaErgonov/RedShelf", "sub_path": "/src/test/java/step_definitions/RedShelf_Search_StepDefs.java", "file_name": "RedShelf_Search_StepDefs.java", "file_ext": "java", "file_size_in_byte": 1179, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "be6aad362addf0cc318dc48f1d9cb714326b43a2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SlavaErgonov/RedShelf
| 248
|
FILENAME: RedShelf_Search_StepDefs.java
| 0.295027
|
package step_definitions;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import pages.RedShelfHomePage;
import pages.RedShelfSearchPage;
import utilities.Config;
import utilities.Driver;
public class RedShelf_Search_StepDefs {
RedShelfHomePage redShelfHomePage = new RedShelfHomePage();
RedShelfSearchPage redShelfSearchPage = new RedShelfSearchPage();
@When("User searches for {string}")
public void user_searches_for(String string) {
redShelfHomePage.searchBox.sendKeys(string + Keys.ENTER);
}
@Then("User should see {string} in result list")
public void User_should_see_in_result_list(String string) {
String firstResult = redShelfSearchPage.firstSearchResult.getText();
Assert.assertTrue(firstResult.contains(string));
}
@Then("User should see the {string} error message")
public void user_should_see(String string) {
String errorMessage = redShelfSearchPage.messageField.getText();
Assert.assertTrue(errorMessage.contains(string));
}
}
|
3ba69bc5-6183-4c07-a41e-1e923f0acee9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-07-20T05:36:19", "repo_name": "kaushalswap/ios-samples", "sub_path": "/ios12/VisionObjectTrack/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 975, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "f49efe3cbdae4938c256a6541b4194ea87e6ffe8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kaushalswap/ios-samples
| 214
|
FILENAME: README.md
| 0.279042
|
---
name: Xamarin.iOS - Tracking Multiple Objects or Rectangles in Video
description: This sample demonstrates how to apply Vision algorithms to track objects or rectangles throughout a video. Build Requirements Xamarin.iOS 12.0 or...
page_type: sample
languages:
- csharp
products:
- xamarin
technologies:
- xamarin-ios
urlFragment: ios12-visionobjecttrack
---
# Tracking Multiple Objects or Rectangles in Video
This sample demonstrates how to apply Vision algorithms to track objects or rectangles throughout a video.

## Build Requirements
Xamarin.iOS 12.0 or later; Xcode 10.0 or later;
## Related Links
- [Original sample](https://developer.apple.com/documentation/vision/tracking_multiple_objects_or_rectangles_in_video).
- [Documentation](https://developer.apple.com/documentation/vision)
## License
Xamarin port changes are released under the MIT license.
## Author
Ported to Xamarin.iOS by Mykyta Bondarenko
|
040c7897-3a34-48ce-9bdb-62af241226e8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-13 19:49:35", "repo_name": "VitorPeixoto/GameEngine", "sub_path": "/src/engine/renderer/models/ModelType.java", "file_name": "ModelType.java", "file_ext": "java", "file_size_in_byte": 980, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "55b50f4967e89a44e7106a079fae074ba1e462d4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/VitorPeixoto/GameEngine
| 227
|
FILENAME: ModelType.java
| 0.284576
|
package engine.renderer.models;
import engine.loaders.Model;
import engine.loaders.ModelLoader;
import engine.terrain.TerrainGenerator;
import java.io.IOException;
public enum ModelType {
SPHERE("sphere"),
CUBE("cube"),
TERRAIN("terrain"),
SPACESHIP("spaceship"),
PERSON("person"),
TREE("tree"),
ROCK("rock"),
DUCK("duck"),
EAGLE("eagle"),
BRACHIOSAURUS("brachiosaurus"),
;
ModelType(String name) {
this.modelName = name;
}
public void load() {
if(model != null) return;
try {
if(this == TERRAIN)
this.model = TerrainGenerator.generateTerrain(128, 10);
else
this.model = ModelLoader.loadModel(this.modelName);
} catch (IOException e) {
e.printStackTrace();
}
}
public Model getModel() {
load();
return model;
}
private final String modelName;
private Model model = null;
}
|
b09bf9ae-479a-4e20-8eeb-ea2cf67f09f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-04 14:55:15", "repo_name": "qinjiajuny/JDBCLearning", "sub_path": "/learning-template/curd-demo-jdk11/src/main/java/pers/huangyuhui/curd/utils/ConfigUtil.java", "file_name": "ConfigUtil.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "b9ffb779e7729838255f740d7b5a0a613cfa5599", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/qinjiajuny/JDBCLearning
| 252
|
FILENAME: ConfigUtil.java
| 0.26588
|
package pers.huangyuhui.curd.utils;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
* @project: curd-demo
* @description: 读取数据库配置文件的工具类
* @author: 黄宇辉
* @date: 8/22/2019-3:49 PM
* @version: 1.0
* @website: https://yubuntu0109.github.io/
*/
class ConfigUtil {
private ConfigUtil() { }
private static Properties properties;
// 读取数据库配置文件
private static InputStream inputStream = ConfigUtil.class.getResourceAsStream("/db.properties");
static {
try {
properties = new Properties();
properties.load(inputStream);
properties.getProperty("Url");
properties.getProperty("UserName");
properties.getProperty("UserPassword");
properties.getProperty("DriverName");
} catch (FileNotFoundException e) {
System.err.println("error: not found db.properties file");
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
//获取数据库配置
static Properties getProperties() { return properties; }
}
|
116f6d7c-5a19-4408-8b56-3610ac434de2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-20 11:34:20", "repo_name": "matteoranzi/HomeMessaging", "sub_path": "/src/models/chat/Chat.java", "file_name": "Chat.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "7d88ae44d33feb38271132f362098d5a5a016722", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/matteoranzi/HomeMessaging
| 203
|
FILENAME: Chat.java
| 0.259826
|
package models.chat;
import models.messages.MessagesList;
import models.messages.Message;
import models.user.User;
import java.util.ArrayList;
/**
* Created by IntelliJ IDEA.
* User: matteoranzi
* Date: 10/12/18
* Time: 18.54
*/
public class Chat {
private int notificationCounter;
private MessagesList messagesList;
private User user;
public Chat(User user){
messagesList = new MessagesList();
this.user = user;
notificationCounter = 0;
}
public int getNotificationCounter(){
return notificationCounter;
}
public User getUser(){
return user;
}
public ArrayList<Message> getMessages(){
return messagesList.getMessages();
}
public void incrementNotificationCounter(){
notificationCounter++;
}
public void resetNotificationCounter(){
notificationCounter = 0;
}
public void addMessage(Message message){
messagesList.addMessage(message);
}
}
|
ef8f47ba-1438-46e1-9ccd-1d693565f1cb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-17 19:51:49", "repo_name": "code-glutton/DI-and-autowiring-practice", "sub_path": "/src/main/java/com/osahonAtm/DogAndOwnerProf.java", "file_name": "DogAndOwnerProf.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "1aceb106be5df827ccf05ceb5bd5123ec7a6135d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/code-glutton/DI-and-autowiring-practice
| 262
|
FILENAME: DogAndOwnerProf.java
| 0.284576
|
package com.osahonAtm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component("implementbean")
public class DogAndOwnerProf {
private Person person;
private Dog dog;
public Person getPerson() {
return person;
}
@Autowired
public void setPerson(Person person) {
this.person = person;
}
public Dog getDog() {
return dog;
}
@Autowired
public void setDog(Dog dog) {
this.dog = dog;
}
public void impl(){
person.setFirstName("Osahon");
person.setLastName("Jonathan-Odia");
person.setAge(21);
dog.setName("Ragnar");
dog.setBreed("German Shepherd");
dog.setAge(0.3);
System.out.println("owner details:");
System.out.println("Name: " + person.getFirstName() + " " + person.getLastName());
System.out.println("Age: " + person.getAge());
System.out.println("Dog details:");
System.out.println("Name: " + dog.getName());
System.out.println("Breed: " + dog.getBreed());
System.out.println("Age: " + dog.getAge());
}
}
|
4d1130b7-14f6-48dc-b1f4-c3eef129ecc9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-17 13:12:27", "repo_name": "tomocrafter/uma", "sub_path": "/src/main/java/net/tomocraft/uma/utils/StackTraceDialog.java", "file_name": "StackTraceDialog.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "876148741fd5632517f73eab7e6b383387474ef0", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tomocrafter/uma
| 196
|
FILENAME: StackTraceDialog.java
| 0.212069
|
package net.tomocraft.uma.utils;
import javax.swing.*;
import java.awt.*;
import java.io.PrintWriter;
import java.io.StringWriter;
public class StackTraceDialog {
public static void showStackTraceDialog(Throwable e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JLabel label = new JLabel("処理できない例外が発生しました。");
JTextArea area = new JTextArea();
area.setText(sw.toString());
area.setCaretPosition(0);
area.setEditable(false);
JScrollPane scrollPane = new JScrollPane(area);
scrollPane.setPreferredSize(new Dimension(600, 200));
panel.add(label, BorderLayout.NORTH);
panel.add(scrollPane, BorderLayout.SOUTH);
// ダイアログ表示
JOptionPane.showMessageDialog(null, panel, "Error", JOptionPane.ERROR_MESSAGE);
}
}
|
6f38d47c-3ff0-4a0f-a4e2-b2442e8a8c11
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-06 19:29:07", "repo_name": "jmarkman/CSC240-JsonMap", "sub_path": "/app/src/main/java/com/learningprojects/jmarkman/jsonmap/PopupAdapter.java", "file_name": "PopupAdapter.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "4db6ac8fd72bc72bb9277a84a1e4924b035f8b2e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jmarkman/CSC240-JsonMap
| 193
|
FILENAME: PopupAdapter.java
| 0.243642
|
package com.learningprojects.jmarkman.jsonmap;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.Marker;
public class PopupAdapter implements GoogleMap.InfoWindowAdapter
{
private View popup = null;
private LayoutInflater inflater = null;
public PopupAdapter(LayoutInflater inflater)
{
this.inflater = inflater;
}
@Override
public View getInfoWindow(Marker marker)
{
return null;
}
@Override
public View getInfoContents(Marker marker)
{
if (popup == null)
{
popup = inflater.inflate(R.layout.marker_popup, null);
}
TextView markerTitle = popup.findViewById(R.id.marker_title);
TextView markerSnippet = popup.findViewById(R.id.marker_snippet);
markerTitle.setText(marker.getTitle());
markerSnippet.setText(marker.getSnippet());
return popup;
}
}
|
8f74c9d7-470f-4897-80a8-9cae528f68f0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-30 17:37:21", "repo_name": "FuriKuri/technicalchallenge1", "sub_path": "/src/main/java/com/gft/bench/service/WatchingComponent.java", "file_name": "WatchingComponent.java", "file_ext": "java", "file_size_in_byte": 1054, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "dfcf11dfef7d316da807269204bd5957bc6484ea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/FuriKuri/technicalchallenge1
| 201
|
FILENAME: WatchingComponent.java
| 0.286169
|
package com.gft.bench.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import rx.Observable;
import rx.subjects.PublishSubject;
import java.nio.file.Path;
@Component
public class WatchingComponent {
private FileService fileService;
@Autowired
public WatchingComponent( FileService fileService ){
this.fileService = fileService;
}
private PublishSubject<String> publishSubject = PublishSubject.create();
private int currentCount;
@Scheduled(fixedRate = 1000)
public synchronized void emitData(){
int countOfElements = fileService.getObservable().count().toBlocking().first();
if(currentCount != countOfElements){
currentCount = countOfElements;
fileService.getObservable().map(Path::toString).forEach(publishSubject::onNext);
}
}
public Observable<String> getPublishSubject(){
return this.publishSubject;
}
}
|
9bba4509-8870-4c4a-b8f3-0e6b3762da17
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-22 21:25:58", "repo_name": "tkrutowski/Twitter", "sub_path": "/src/main/java/org/sda/twitter/servlets/FollowerAddServlet.java", "file_name": "FollowerAddServlet.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "bfaafe7c17818099620f5f96b9c9bcb55db3a586", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tkrutowski/Twitter
| 180
|
FILENAME: FollowerAddServlet.java
| 0.279828
|
package org.sda.twitter.servlets;
import org.sda.twitter.database.dao.FollowersDao;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet( name = "FollowerAddServlet", urlPatterns = {"/followerAdd"})
public class FollowerAddServlet extends HttpServlet {
FollowersDao followersDao;
@Override
public void init() throws ServletException {
followersDao=new FollowersDao();
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
int followedId = Integer.valueOf(req.getParameter("followed"));
int followerId = Integer.valueOf(req.getParameter("follower"));
if(followersDao.add(followerId,followedId)){
resp.sendRedirect("/twitter/users.jsp");
}
}
}
|
5d25a2c3-4ccc-4058-91df-31a76beac3df
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-10 03:11:58", "repo_name": "Swiddis/SRChess", "sub_path": "/src/widdis/unroe/chess/board/pieces/Queen.java", "file_name": "Queen.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "18e52a874c41ec7fb362cfdde0b48d6c66107cd9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Swiddis/SRChess
| 242
|
FILENAME: Queen.java
| 0.279042
|
package widdis.unroe.chess.board.pieces;
import widdis.unroe.chess.board.Board;
import widdis.unroe.chess.board.Square;
import java.util.HashSet;
public class Queen extends Piece {
public Queen(Color color) {
this.setColor(color);
}
@Override
public HashSet<Square> getLegalMoves(Square curr, Square[][] board) {
HashSet<Square> moveSet = new HashSet<>();
moveSet.addAll((new Rook(this.getColor())).getLegalMoves(curr, board));
moveSet.addAll((new Bishop(this.getColor())).getLegalMoves(curr, board));
return moveSet;
}
public Queen clone() {
return new Queen(color);
}
@Override
public String toFEN() {
if(color == Color.WHITE) {
return "Q";
}
return "q";
}
@Override
public String toUnicode() {
if(color == Color.WHITE) {
return "\u2655";
}
return "\u265B";
}
@Override
public String toString() {
return "queen";
}
}
|
eb85819e-90d5-4236-a6b0-1d33a944bd92
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-18 15:05:50", "repo_name": "cedric313/checkpoint4Android", "sub_path": "/app/src/main/java/com/example/checkpoint4/model/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "aa293f526c9523afee74e69cf82e6a61ced856a3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cedric313/checkpoint4Android
| 235
|
FILENAME: User.java
| 0.23231
|
package com.example.checkpoint4.model;
import java.util.ArrayList;
import java.util.List;
public class User {
private String email;
private String password;
private Long idUser;
private List<Rider> riders = new ArrayList<>();
public User() {
}
public User(String email, String password, Long idUser, List<Rider> riders) {
this.email = email;
this.password = password;
this.idUser = idUser;
this.riders = riders;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Long getIdUser() {
return idUser;
}
public void setIdUser(Long idUser) {
this.idUser = idUser;
}
public List<Rider> getRiders() {
return riders;
}
public void setRiders(List<Rider> riders) {
this.riders = riders;
}
}
|
94200174-cfb5-4d2c-b487-420ac847e0f1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-03 18:29:19", "repo_name": "infostroytraining/Gridin", "sub_path": "/Task2/src/com/infostroy/web/listener/ContextListener.java", "file_name": "ContextListener.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "fbe33976303d331a7f974fb826d6a66afd970780", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/infostroytraining/Gridin
| 211
|
FILENAME: ContextListener.java
| 0.286169
|
package com.infostroy.web.listener;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.infostroy.service.UserService;
import com.infostroy.web.listener.factory.ServiceFactory;
public class ContextListener implements ServletContextListener {
private static Logger logger = LogManager.getLogger(ContextListener.class);
private static final String STORAGE_INIT_PARAMETER = "storage";
@Override
public void contextInitialized(ServletContextEvent sce) {
ServletContext context = sce.getServletContext();
String storageMode = context.getInitParameter(STORAGE_INIT_PARAMETER);
logger.debug("Try to initialize service for {} storage mode", storageMode);
UserService userService = ServiceFactory.getUserService(storageMode);
logger.debug("service initialized. Service: {}", userService);
context.setAttribute("userService", userService);
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
logger.debug("servlet context is destroyed");
}
}
|
5ee2e7c7-f82c-4804-9105-241dae32570e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-17 18:09:13", "repo_name": "anthonylavell/Park-Rate", "sub_path": "/src/main/java/spot_hero/concrete/JsonFile.java", "file_name": "JsonFile.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "ca4442cd2e44d67f31b4a2494719372f2ad15f4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/anthonylavell/Park-Rate
| 178
|
FILENAME: JsonFile.java
| 0.262842
|
package spot_hero.concrete;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
public class JsonFile {
public JSONObject getJsonObject(){
JSONParser parser = new JSONParser();
JSONObject jsonObject = null;
JSONArray rates = null;
try (Reader reader = new FileReader("C:\\Users\\Anthony\\Documents\\Programming\\Code\\Java-Projects\\InterviewChallenge\\src\\main\\resources\\rates.json")) {
jsonObject = (JSONObject) parser.parse(reader);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
return jsonObject;
}
}
|
7905ed1a-6d9d-486e-9ceb-80ba96f9b0ae
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-13 04:21:49", "repo_name": "kevingroque/MyPersonalApp", "sub_path": "/app/src/main/java/app/roque/com/mypersonalapp/repository/UserRepository.java", "file_name": "UserRepository.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "c6db0a39b9503a281f5d7b5643b3f42ee3e8977f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kevingroque/MyPersonalApp
| 256
|
FILENAME: UserRepository.java
| 0.27048
|
package app.roque.com.mypersonalapp.repository;
import java.util.ArrayList;
import java.util.List;
import app.roque.com.mypersonalapp.model.User;
public class UserRepository {
public static List<User> users = new ArrayList<>();
static{
users.add(new User(100, "ebenites", "tecsup"));
users.add(new User(200, "jfarfan", "tecsup"));
users.add(new User(300, "drodriguez", "tecsup"));
}
public static User login(String username, String password){
for (User user : users){
if(user.getUsername().equalsIgnoreCase(username) && user.getPassword().equals(password)){
return user;
}
}
return null;
}
public static User addUser(String username, String password){
for(int i = 400; i<=9999;i+=100){
users.add(new User(i,username,password));
}
return login(username,password);
}
public static User getUser(String username){
for (User user : users){
if(user.getUsername().equalsIgnoreCase(username)){
return user;
}
}
return null;
}
}
|
650afd07-b991-4c5e-a240-bfdc173579db
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-05 01:50:06", "repo_name": "DylanRedfield/IowaCaucusResults", "sub_path": "/src/main/java/me/dylanredfield/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 990, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "dc079b6aeb78912fbc23e42db5259ad84edcbb3a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/DylanRedfield/IowaCaucusResults
| 178
|
FILENAME: Main.java
| 0.235108
|
package me.dylanredfield;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import retrofit.Call;
import retrofit.GsonConverterFactory;
import retrofit.Retrofit;
import java.io.IOException;
public class Main {
public static final String BASE_URL = "https://www.idpcaucuses.com/api/";
public static void main(String[] args) {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
ApiEndPointInterface service = retrofit.create(ApiEndPointInterface.class);
Call<StateResults> call = service.getStateResults();
try {
StateResults results = call.execute().body();
results.getStateResults().remove(3);
results.getStateResults().remove(3);
System.out.print(results.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
05960c0a-7a91-49e1-8839-049306550ff4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-25 08:39:29", "repo_name": "geelaro/spring-boot-samples", "sub_path": "/spring-boot-multi-mongodb/src/main/java/com/geelaro/multimongo/entity/Role.java", "file_name": "Role.java", "file_ext": "java", "file_size_in_byte": 1095, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "923711340bda7481cecafc361c8bb7ed1359120b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/geelaro/spring-boot-samples
| 235
|
FILENAME: Role.java
| 0.216012
|
package com.geelaro.multimongo.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection = "role")
public class Role {
@Id
private Long id;
private String role;
private String desc;
public Role(Long id, String role, String desc) {
this.id = id;
this.role = role;
this.desc = desc;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
@Override
public String toString() {
return "Role{" +
"id=" + id +
", role='" + role + '\'' +
", desc='" + desc + '\'' +
'}';
}
}
|
fd2e84a0-8f0a-40b9-9182-058f7e689e1a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-20 02:50:34", "repo_name": "mirse/StudyCollection", "sub_path": "/module_architecture/src/main/java/com/wdz/module_architecture/rxjava/http/BaseObserver.java", "file_name": "BaseObserver.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "b6ef870c00896502c5e2a15776389b7694d7c3d2", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mirse/StudyCollection
| 212
|
FILENAME: BaseObserver.java
| 0.267408
|
package com.wdz.module_architecture.rxjava.http;
import android.util.Log;
import com.wdz.module_architecture.rxjava.bean.BaseResponse;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
public abstract class BaseObserver<T> implements Observer<BaseResponse<T>> {
private static final String TAG = "BaseObserver";
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(BaseResponse<T> tBaseResponse) {
Log.i(TAG, "onNext: "+tBaseResponse.toString());
if (tBaseResponse.getStatus()==0){
onSuccess(tBaseResponse);
}
else{
onFailure(tBaseResponse);
}
}
protected abstract void onSuccess(BaseResponse tBaseResponse);
protected abstract void onFailure(BaseResponse tBaseResponse);
@Override
public void onError(Throwable e) {
Log.i(TAG, "onError: "+e.toString());
onFailure(null);
}
@Override
public void onComplete() {
}
}
|
33e63f27-b523-402e-9724-46da76b1cb26
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-05 15:11:32", "repo_name": "fobird/ProjectLocal01", "sub_path": "/day17_case/src/cn/itcast/web/servlet/DelSelectedServlet.java", "file_name": "DelSelectedServlet.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "7823a92e01a7a97878728b3e892d23000aaa7d28", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fobird/ProjectLocal01
| 200
|
FILENAME: DelSelectedServlet.java
| 0.2227
|
package cn.itcast.web.servlet;
import cn.itcast.service.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @author superLin
* @date 2021-04-24 23:38
*/
@WebServlet("/delSelectedServlet")
public class DelSelectedServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//获取页面传来的所有uid
String[] ids = request.getParameterValues("uid");
//调用service方法删除
UserService userService=new cn.itcast.service.impl.UserService();
userService.delUsers(ids);
//重定向回userListServlet
response.sendRedirect(request.getContextPath()+"/userListServlet");
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doPost(request, response);
}
}
|
be540ec9-ab1b-47be-8385-d7f67be84432
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-04 13:27:01", "repo_name": "MarcosApp/ProjetoUSJT", "sub_path": "/src/conexao/Conexao.java", "file_name": "Conexao.java", "file_ext": "java", "file_size_in_byte": 1179, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "57b282a9e6d7a11be62325dfe727426b4c0bc04f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MarcosApp/ProjetoUSJT
| 239
|
FILENAME: Conexao.java
| 0.274351
|
/*
* 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 conexao;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
*
* @author Marcos
*/
public class Conexao {
private final Connection conexao;
public Connection getConexao() {
return conexao;
}
public Conexao() throws SQLException{
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException ex) {
System.exit(0);
}
this.conexao = conectar();
}
public Connection conectar() throws SQLException{
String servidor = "127.0.0.1";
String porta = "3306";
String banco = "projetousjt";
String usuario = "root";
String senha = "";
return DriverManager.getConnection("jdbc:mysql://" + servidor + ":" + porta + "/"+banco,
usuario, senha);
}
public void desconectar() throws SQLException{
conexao.close();
}
}
|
646a3f66-2c53-449d-b11a-59b90a6ce10d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-04 08:31:55", "repo_name": "547291213/CommodityManagerment", "sub_path": "/app/src/main/java/com/example/commoditymanagerment/Util/TimeUtil.java", "file_name": "TimeUtil.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "0249a4aeb8df02e62585dff7913fb90c06c921fe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/547291213/CommodityManagerment
| 203
|
FILENAME: TimeUtil.java
| 0.259826
|
package com.example.commoditymanagerment.Util;
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class TimeUtil {
public static String getNowDate() {
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(currentTime);
return dateString;
}
//时间转化毫秒
public static long date2ms(String dateForamt, String time) {
Calendar calendar = Calendar.getInstance();
try {
calendar.setTime(new SimpleDateFormat(dateForamt).parse(time));
} catch (ParseException e) {
e.printStackTrace();
}
return calendar.getTimeInMillis();
}
//毫秒转化成日期
public static String ms2date(String dateForamt, long ms) {
Date date = new Date(ms);
SimpleDateFormat format = new SimpleDateFormat(dateForamt);
return format.format(date);
}
}
|
ce186c1c-cb39-452d-b357-617736f02e78
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-31T00:45:12", "repo_name": "antaljanosbenjamin/build-latex-with-make", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 999, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "55a79e02cc14ebd9e8b9c59f633a136ed4ffcf5a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/antaljanosbenjamin/build-latex-with-make
| 241
|
FILENAME: README.md
| 0.247987
|
# :negative_squared_cross_mark: THIS REPOSITORY IS ARCHIVED
# Build latex with make
This action can be used to build latex documents with make. The `texlive-latex-extra texlive-fonts-extra texlive-bibtex-extra biber make git` packages are installed on the base ubuntu image, so everything can be used that is available in the ubuntu base image or installed by these packages. My focus is on `pdflatex` and `biber` as I am using these tools.
Basically it calls `make` in the root directory of the repository, so the build process can be configured within the `Makefile`. An example makefile is the
## Inputs
### `directory`
Path of the directory that contains the makefile relative to the root of the repository.
## Example usage
```
name: test
on: [push]
jobs:
test-example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: antaljanosbenjamin/build-latex-with-make@master
```
For further examples check the [test workflow](.github/workflows/test.yml).
|
38e35bd6-9aad-4a11-9f93-98d55cd7d81b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-19 22:28:24", "repo_name": "tonte/SlydepayAndroidTutorial1", "sub_path": "/app/src/main/java/slydepay/com/tonte/sampleslydepayintegration/model/APIResponse.java", "file_name": "APIResponse.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "ad169e9c9ae268554a0d4ef4e5367c77dca318a4", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/tonte/SlydepayAndroidTutorial1
| 232
|
FILENAME: APIResponse.java
| 0.20947
|
package slydepay.com.tonte.sampleslydepayintegration.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by Tonte on 6/15/17.
*/
public class APIResponse {
@SerializedName("success")
@Expose
private Boolean success;
@SerializedName("result")
@Expose
private Object result;
@SerializedName("errorMessage")
@Expose
private String errorMessage;
@SerializedName("errorCode")
@Expose
private Object errorCode;
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public Object getResult() {
return result;
}
public void setResult(Object result) {
this.result = result;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public Object getErrorCode() {
return errorCode;
}
public void setErrorCode(Object errorCode) {
this.errorCode = errorCode;
}
}
|
946ffa10-d7c4-47bf-b571-d11b302ddc79
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-04 03:16:35", "repo_name": "ynfeng/todo", "sub_path": "/src/main/java/com/github/ynfeng/todo/todolist/Item.java", "file_name": "Item.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "6e2943a6c152edc4646a3c6ae8185d679569ae68", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ynfeng/todo
| 263
|
FILENAME: Item.java
| 0.292595
|
package com.github.ynfeng.todo.todolist;
public class Item {
private final String name;
private Status status;
private Item(String name) {
this.name = name;
status = Status.UnFinished;
}
public static Item newItem(String name) {
return new Item(name);
}
public String name() {
return name;
}
public Item done() {
status = Status.Done;
return this;
}
public boolean isDone() {
return status == Status.Done;
}
public String toString(int index) {
if (isDone()) {
return String.format("%d. [Done] %s", index, name);
}
return String.format("%d. %s", index, name);
}
public Status status() {
return status;
}
public enum Status {
UnFinished, Done
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Item)) {
return false;
}
Item item = (Item) o;
return name.equals(item.name);
}
@Override
public int hashCode() {
return name.hashCode();
}
}
|
96d5e9ca-4fe6-4f7c-adc8-b71c1377e6ee
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-26 15:45:58", "repo_name": "geyi/fast", "sub_path": "/src/main/java/com/kuaidi100/fast/server/OrderConsumer.java", "file_name": "OrderConsumer.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "9e9b799655f0e1e77e817e5cd43785c40ce85d49", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/geyi/fast
| 204
|
FILENAME: OrderConsumer.java
| 0.243642
|
package com.kuaidi100.fast.server;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.List;
//@Component
public class OrderConsumer {
private static final Logger log = LoggerFactory.getLogger(OrderConsumer.class);
@PostConstruct
public void init() {
new Thread(() -> {
List<String> list;
while (true) {
try {
list = OrderQueue.take();
log.debug("data list:{}", list.size());
if (list == null || list.isEmpty()) {
continue;
}
for (String dto : list) {
}
int length;
if ((length = OrderQueue.size()) > 8000) {
log.warn("OrderQueue size is {}", length);
}
} catch (Exception e) {
log.error("execute queue task|ERROR", e);
}
}
});
}
}
|
991f2775-633b-4fa7-851b-96ae386885fc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-27 12:43:25", "repo_name": "leocaliban/finance-api-spring", "sub_path": "/src/main/java/com/finance/api/config/property/FinanceApiProperty.java", "file_name": "FinanceApiProperty.java", "file_ext": "java", "file_size_in_byte": 974, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "9be90ef4343d591b83fbb7938dedf14695e6e418", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/leocaliban/finance-api-spring
| 217
|
FILENAME: FinanceApiProperty.java
| 0.236516
|
package com.finance.api.config.property;
import java.util.Arrays;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties("finance")
public class FinanceApiProperty {
private List<String> originsPermitidas = Arrays.asList("http://localhost:4200", "http://localhost:8100",
"https://finance-angular.herokuapp.com");
private final Seguranca seguranca = new Seguranca();
public static class Seguranca {
private boolean enableHttps;
public boolean isEnableHttps() {
return enableHttps;
}
public void setEnableHttps(boolean enableHttps) {
this.enableHttps = enableHttps;
}
}
public List<String> getOriginsPermitidas() {
return originsPermitidas;
}
public void setOriginsPermitidas(List<String> originsPermitidas) {
this.originsPermitidas = originsPermitidas;
}
public Seguranca getSeguranca() {
return seguranca;
}
}
|
8960b2fd-1cd8-4904-bca2-133ceac99e0e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-13 14:11:00", "repo_name": "swapnadhabadia/BrowserImages", "sub_path": "/app/src/main/java/com/example/browseimages/utils/DialogUtil.java", "file_name": "DialogUtil.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "4c15b51a29c38f67572f390827a9b97ab9bd8b25", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/swapnadhabadia/BrowserImages
| 202
|
FILENAME: DialogUtil.java
| 0.226784
|
package com.example.browseimages.utils;
import android.content.Context;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import com.example.browseimages.R;
public class DialogUtil {
public static void showOrHideKeyboard(Context ctx, EditText editText, boolean show) {
final InputMethodManager imm = (InputMethodManager) ctx.getSystemService(
Context.INPUT_METHOD_SERVICE);
if (show) {
imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED);
} else {
imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
}
editText.setFocusable(true);
}
public static void showNoNetworkAlert(Context ctx) {
try {
new android.app.AlertDialog.Builder(ctx).setTitle(R.string.app_name).setMessage(R.string.no_internet)
.setPositiveButton(R.string.ok, null).create().show();
} catch (WindowManager.BadTokenException e) {
e.printStackTrace();
}
}
}
|
e03307e8-bf00-4af9-a06d-e43819c98a11
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-31 19:16:24", "repo_name": "pawkrol/fractality", "sub_path": "/src/main/java/engine/scene/GameObject.java", "file_name": "GameObject.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "b5b9c904739fb69fb624b5a8e359811a272dd1f0", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pawkrol/fractality
| 233
|
FILENAME: GameObject.java
| 0.291787
|
package engine.scene;
import engine.model.Model;
import engine.scene.shader.ShaderProgram;
public abstract class GameObject extends Node {
private Scene scene;
private ShaderProgram shaderProgram;
private Model model;
public GameObject(Scene scene) {
this(scene, null, null);
}
public GameObject(Scene scene, ShaderProgram shaderProgram) {
this(scene, null, shaderProgram);
}
public GameObject(Scene scene, Model model, ShaderProgram shaderProgram) {
this.type = Type.OBJECT;
this.scene = scene;
this.model = model;
this.shaderProgram = shaderProgram;
}
public void updateUniforms() {}
public Scene getScene() {
return scene;
}
public void setScene(Scene scene) {
this.scene = scene;
}
public Model getModel() {
return model;
}
public void setModel(Model model) {
this.model = model;
}
public ShaderProgram getShaderProgram() {
return shaderProgram;
}
protected void setShaderProgram(ShaderProgram shaderProgram) {
this.shaderProgram = shaderProgram;
}
}
|
d7477567-a8f7-4975-ba3b-511da663883a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-16 12:55:15", "repo_name": "gpraveenk88/williamssonomachallenge", "sub_path": "/src/main/java/com/test/williamssonoma/challenge/helpers/StringHelper.java", "file_name": "StringHelper.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "4d6d8fa3dbb3f6d044f5d01dba479b3cace5cee9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gpraveenk88/williamssonomachallenge
| 189
|
FILENAME: StringHelper.java
| 0.239349
|
package com.test.williamssonoma.challenge.helpers;
import com.test.williamssonoma.challenge.bean.ZipCodeRange;
public class StringHelper {
public static String connect(String[] arr, String delimiter) {
StringBuffer buf = new StringBuffer();
boolean first = false;
for(String item : arr) {
if(first == false) {
buf.append(item);
first = true;
} else {
buf.append(delimiter + item);
}
}
return buf.toString();
}
public static String connect(ZipCodeRange[] ranges, String delimiter) {
StringBuffer buf = new StringBuffer();
boolean first = false;
for(ZipCodeRange range : ranges) {
if(first == false) {
buf.append(range.toString());
first = true;
} else {
buf.append(delimiter + range.toString());
}
}
return buf.toString();
}
}
|
8a533206-6139-4d18-afa1-f2baa2b32eb0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-18 02:08:53", "repo_name": "joaomarccos/AirSoft-Association", "sub_path": "/pos-airsoft-business-rules/src/main/java/io/github/joaomarccos/pos/airsoft/repositories/GameInvitationRepositoryImpl.java", "file_name": "GameInvitationRepositoryImpl.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "d9006ccd85f12ba8e8211389419c2d6ff137301d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/joaomarccos/AirSoft-Association
| 271
|
FILENAME: GameInvitationRepositoryImpl.java
| 0.26971
|
package io.github.joaomarccos.pos.airsoft.repositories;
import io.github.joaomarccos.pos.airsoft.dao.DAO;
import io.github.joaomarccos.pos.airsoft.dao.DaoJPAFactory;
import io.github.joaomarccos.pos.airsoft.entitys.GameInvitation;
import io.github.joaomarccos.pos.airsoft.repositories.interfaces.GameInvitationRepository;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author João Marcos <joaomarccos.github.io>
*/
public class GameInvitationRepositoryImpl implements GameInvitationRepository {
private final DAO<GameInvitation> dao;
public GameInvitationRepositoryImpl() {
this.dao = DaoJPAFactory.createDefaultDao();
}
@Override
public void save(GameInvitation entity) {
dao.save(entity);
}
@Override
public void delete(GameInvitation entity) {
dao.delete(entity);
}
@Override
public void update(GameInvitation entity) {
dao.update(entity);
}
@Override
public GameInvitation findByToken(String token) {
Map<String, Object> params = new HashMap<>();
params.put("token", token);
return dao.simpleQuery("invitation.findbytoken", params);
}
}
|
3b166d1d-54c6-484b-94d9-173da3127d27
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-10 07:17:09", "repo_name": "arts95/JavaTestTask", "sub_path": "/src/main/java/com/practice/demo/controller/CommonExceptionHandlerController.java", "file_name": "CommonExceptionHandlerController.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "9f679994dccb7be2643fab7e4cfd3ca196d0b9de", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/arts95/JavaTestTask
| 155
|
FILENAME: CommonExceptionHandlerController.java
| 0.233706
|
package com.practice.demo.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import com.practice.demo.exception.EntityNotFoundException;
@ControllerAdvice
public class CommonExceptionHandlerController {
private static final Logger logger = LoggerFactory.getLogger(CommonExceptionHandlerController.class);
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(EntityNotFoundException.class)
public void handleEntityNotFoundException(EntityNotFoundException ex) {
logger.error(ex.getMessage(), ex);
}
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ExceptionHandler(Exception.class)
public void handleAllExceptions(Exception ex) {
logger.error(ex.getMessage(), ex);
}
}
|
3ea46920-5a1d-4e16-bf6f-2799afd9acc8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-03 10:21:30", "repo_name": "Ondrej-vojtisek/bbmri", "sub_path": "/src/main/java/cz/bbmri/entities/enumeration/SystemRole.java", "file_name": "SystemRole.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "8f978e8539ba50ecbd0744e74359cb9d4f0d1259", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Ondrej-vojtisek/bbmri
| 254
|
FILENAME: SystemRole.java
| 0.262842
|
package cz.bbmri.entities.enumeration;
/**
* General system role of user.
* USER - anyone who is authorized to access system (who fullfill authorization requirements to acces)
* implicit role
* ADMINISTRATOR - administrator of system. He has access to global settings of BBMRI, can browse everything
* DEVELOPER - programmer responsible for maintenance of system
* BIOBANK_OPERATOR - user managing at least one biobank
* PROJECT_TEAM_WORKER - user working on at leat one project which is upload to system
* PROJECT_TEAM_MEMBER_CONFIRMED - user working on at least one confirmed project
*
* @author Ondrej Vojtisek (ondra.vojtisek@gmail.com)
* @version 1.0
*/
public enum SystemRole {
USER("user"),
ADMINISTRATOR("administrator"),
BIOBANK_OPERATOR("biobank_operator"),
PROJECT_TEAM_MEMBER("project_team_member"),
PROJECT_TEAM_MEMBER_CONFIRMED("project_team_member_confirmed"),
DEVELOPER("developer");
private final String state;
private SystemRole(String state) {
this.state = state;
}
@Override
public String toString() {
return this.state;
}
}
|
9c253dff-e90a-45cc-9cd5-dd7418d42f19
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-29 14:02:48", "repo_name": "wangshujing/asaml", "sub_path": "/ASAML-Modeling-and-verification-system-Demo/src/com/saml/util/StateTransitionInfo.java", "file_name": "StateTransitionInfo.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "22df938ba605acdc82b08020036977dc5bfc4d9d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wangshujing/asaml
| 237
|
FILENAME: StateTransitionInfo.java
| 0.278257
|
package com.saml.util;
import java.util.ArrayList;
import com.saml.util.StateTransitionRule;
public class StateTransitionInfo {
private ArrayList<StateTransitionRule> stRuleSet;
private ArrayList<String> states;
private ArrayList<String> edges;
public StateTransitionInfo(){
stRuleSet = new ArrayList<StateTransitionRule>();
states = new ArrayList<String>();
edges = new ArrayList<String>();
}
public void clearST(){
if (stRuleSet.size() > 0) {
stRuleSet.clear();
states.clear();
edges.clear();
}
}
public ArrayList<StateTransitionRule> getStRuleSet() {
return stRuleSet;
}
public void setStRuleSet(ArrayList<StateTransitionRule> stRuleSet) {
this.stRuleSet = stRuleSet;
}
public ArrayList<String> getStates() {
return states;
}
public void setStates(ArrayList<String> states) {
this.states = states;
}
public ArrayList<String> getEdges() {
return edges;
}
public void setEdges(ArrayList<String> edges) {
this.edges = edges;
}
}
|
454d40d8-34d3-4a46-a96b-f95d7d885cf5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-23 11:44:57", "repo_name": "irdi1/ManagmentSystem", "sub_path": "/src/main/java/com/ManagmentSystem/FleetApp/services/SupplierService.java", "file_name": "SupplierService.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "513196f7241004a359f98abd84156e3f5f4b5a49", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/irdi1/ManagmentSystem
| 190
|
FILENAME: SupplierService.java
| 0.262842
|
package com.ManagmentSystem.FleetApp.services;
import com.ManagmentSystem.FleetApp.models.Supplier;
import com.ManagmentSystem.FleetApp.repositories.ClientRepository;
import com.ManagmentSystem.FleetApp.repositories.SupplierRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class SupplierService {
@Autowired
private SupplierRepository supplierRepository;
// Return list of Clients
public List<Supplier> getSuppliers() {
return supplierRepository.findAll();
}
//Save new Clients
public void save(Supplier supplier) {
supplierRepository.save(supplier);
}
//Find Supplier by Id
public Optional<Supplier> findById(Integer id) {
return supplierRepository.findById(id);
}
//Delete by Supplier id
public void delete(Integer id) {
supplierRepository.deleteById(id);
}
}
|
d1fafdcd-193d-45b7-ad31-b40cd0e3478e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-24 15:39:17", "repo_name": "jpbassinello/superlogica-java", "sub_path": "/src/main/java/br/com/jpb/superlogica/model/RespostaCheckout.java", "file_name": "RespostaCheckout.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "d5880548e71a37d97dff2b1a936e055cf9f62445", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/jpbassinello/superlogica-java
| 257
|
FILENAME: RespostaCheckout.java
| 0.224055
|
package br.com.jpb.superlogica.model;
import br.com.jpb.JsonUtil;
import lombok.Getter;
import lombok.Setter;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import java.io.Serializable;
import java.math.BigDecimal;
@JsonIgnoreProperties(ignoreUnknown = true)
@Getter
@Setter
public final class RespostaCheckout implements Serializable {
@JsonProperty("id_plano_pla")
private int idPlano;
@JsonProperty("st_nome_sac")
private String nomeOuRazaoSocial;
@JsonProperty("st_nomeref_sac")
private String nomeFantasia;
@JsonProperty("st_cgc_sac")
private String cpfCnpj;
@JsonProperty("st_email_sac")
private String email;
@JsonProperty("st_telefone_sac")
private String telefone;
@JsonProperty("valor_primeira_cobranca")
private BigDecimal valorPrimeiraCobranca;
@JsonProperty("link_boleto")
private String linkBoleto;
@JsonProperty("valor_boleto")
private BigDecimal valorBoleto;
@JsonProperty("urlcallback")
private String urlCallback;
@JsonProperty("msg")
private String msg;
protected RespostaCheckout() {
}
@Override
public String toString() {
return JsonUtil.serialize(this);
}
}
|
baefc711-948c-49dd-b5fc-1f485aefe903
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-30 08:59:55", "repo_name": "lucifax301/chelizi", "sub_path": "/chelizi/access/src/main/java/com/lili/net/mina/CommonMessageEncoder.java", "file_name": "CommonMessageEncoder.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "95c6c2ea316e17d182fc38f9d61a897b2dbc76f1", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lucifax301/chelizi
| 220
|
FILENAME: CommonMessageEncoder.java
| 0.233706
|
package com.lili.net.mina;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
import org.apache.mina.filter.codec.ProtocolEncoderOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.lili.net.CommonMessage;
public class CommonMessageEncoder extends ProtocolEncoderAdapter
{
private static Logger LOGGER = LoggerFactory
.getLogger(CommonMessageEncoder.class);
public CommonMessageEncoder()
{
}
/**
* 对数据包进行二进制流编码
*/
public void encode(IoSession session, Object message,
ProtocolEncoderOutput out) throws Exception
{
CommonMessage rsp = (CommonMessage) message;
IoBuffer buffer = IoBuffer.wrap(rsp.toByteBuffer());
if (buffer == null)
{
// 丢弃这个数据包
LOGGER.error("Drop this packet: {}.", rsp.headerToStr());
return;
}
out.write(buffer);
}
}
|
27326b5a-4670-4a0c-b8aa-9d0e10b1bbfc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-14 06:19:52", "repo_name": "SoulofSZY/steamedfish-all", "sub_path": "/java/jdk8op/src/test/java/com/szy/lamda/concurrent/threads_runnable/DeadLockSample.java", "file_name": "DeadLockSample.java", "file_ext": "java", "file_size_in_byte": 1260, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "15fa1086218ac7cd6136d48164e25f7ad909e051", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SoulofSZY/steamedfish-all
| 299
|
FILENAME: DeadLockSample.java
| 0.282196
|
package com.szy.lamda.concurrent.threads_runnable;
/**
* 〈一句话功能简述〉<br>
* 〈测试java 死锁〉
*
* @author sunzhengyu
* @create 2019/8/20
* @since 1.0.0
*/
public class DeadLockSample extends Thread {
private String first;
private String second;
public DeadLockSample(String name, String first, String second) {
super(name);
this.first = first;
this.second = second;
}
@Override
public void run() {
synchronized (first) {
System.out.println(this.getName() + " obtained: " + first);
try {
Thread.sleep(1_000);
synchronized (second) {
System.out.println(this.getName() + " obtained:" + second);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) throws InterruptedException {
String lockA = "lockA";
String lockB = "lockB";
DeadLockSample t1 = new DeadLockSample("ThreadA", lockA, lockB);
DeadLockSample t2 = new DeadLockSample("ThreadB", lockB, lockA);
t1.start();
t2.start();
t1.join();
t2.join();
}
}
|
16fb2ee2-0ce1-4af1-bc93-2ff5967a6c29
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-22 06:59:51", "repo_name": "vijayEE1997/Chat-App-Kafka", "sub_path": "/Project 2/SpringKafkaMessaging/src/main/java/com/vijay/SpringKafkaMessaging/persistence/model/AccessToken.java", "file_name": "AccessToken.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "4243e9de4fdd1d8228a2adec8f6f60234c80182f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/vijayEE1997/Chat-App-Kafka
| 182
|
FILENAME: AccessToken.java
| 0.229535
|
package com.vijay.SpringKafkaMessaging.persistence.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name="access_token")
public class AccessToken implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long token_id;
@Column(name="token")
private String token;
@Column(name="user_id")
private Long userId;
@Column(name="created_at")
private Date createdAt;
public AccessToken(String token,Long userId,Date createdAt) {
this.token = token;
this.userId = userId;
this.createdAt = createdAt;
}
}
|
d3aadd5e-f8d0-412d-9d10-16d58b7c82e0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-18 05:17:49", "repo_name": "XanderYe/service-monitor", "sub_path": "/api/src/main/java/cn/xanderye/controller/SystemController.java", "file_name": "SystemController.java", "file_ext": "java", "file_size_in_byte": 1244, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "3112d7248be175978993948f61d4cefb5b599b6a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/XanderYe/service-monitor
| 291
|
FILENAME: SystemController.java
| 0.247987
|
package cn.xanderye.controller;
import cn.xanderye.base.ResultBean;
import cn.xanderye.entity.AccessLog;
import cn.xanderye.service.AccessLogService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author XanderYe
* @description:
* @date 2021/7/29 18:49
*/
@RestController
@RequestMapping("system")
public class SystemController {
@Autowired
private AccessLogService accessLogService;
/**
* 分页获取日志
* @param pageNum
* @param pageSize
* @return cn.xanderye.base.ResultBean<com.github.pagehelper.PageInfo>
* @author XanderYe
* @date 2021/7/29
*/
@GetMapping("getAccessLogList")
public ResultBean<Page<AccessLog>> getAccessLogList(Integer pageNum, Integer pageSize) {
pageNum = pageNum == null || pageNum < 0 ? 0 : pageNum;
pageSize = pageSize == null || pageSize < 0 ? 12 : pageSize;
return new ResultBean<>(accessLogService.getAccessLogPageInfo(pageNum, pageSize));
}
}
|
9481fc21-7855-4be3-b063-a46dde6a78cf
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-09 15:11:12", "repo_name": "villegascmarco/android-studio-projects", "sub_path": "/ChineseCalendar/app/src/main/java/com/example/chinesecalendar/Foo.java", "file_name": "Foo.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "252dc23ab84eb838803763df04f5432377256aa5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/villegascmarco/android-studio-projects
| 205
|
FILENAME: Foo.java
| 0.217338
|
package com.example.chinesecalendar;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import java.io.IOException;
import java.util.List;
import us.codecraft.xsoup.Xsoup;
public class Foo implements Runnable {
private String intentName;
private volatile String value;
public Foo(String intentName) {
this.intentName = intentName;
}
@Override
public void run() {
String scrap = "";
Document document = null;
try {
document = Jsoup.connect("https://www.viaje-a-china.com/zodiacos-chinos/" + intentName + ".asp").get();
List<String> list = Xsoup.compile("//meta[@name=\"description\"]/@content").evaluate(document).list();
for (String element : list) {
scrap += element;
}
value = scrap;
} catch (IOException e) {
e.printStackTrace();
}
}
public String getValue() {
return value;
}
}
|
19b0845b-9c30-47cc-87a9-d77b05b55a27
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-02-26T20:47:37", "repo_name": "rscarlisle/blockchain-voting-system", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1239, "line_count": 43, "lang": "en", "doc_type": "text", "blob_id": "ce05b0706ba287b25779adbd340d42bb767a3d0c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rscarlisle/blockchain-voting-system
| 320
|
FILENAME: README.md
| 0.264358
|
http://blockchain-voting-system.surge.sh/

# Blockchain voting app.
• In this project I’m exploring blockchain basics and how it can be made tamper-proof through use of blockchain technology.
• The 3 main files of this small project are:
• > blockchanManager.js - describe the functions
• > blockchain.js aka index.js - describe the functions
• > index.html - describe the functions
• The technologies are:
• > webpack.config.js
• > Handlebars.js
• > Crypto-JS library provides the SHA256.js module
• > Jasmine Testing library
• Testing:
• to run the test: [ jasmine spec/spec-test.js ]
• the test file is: spec/spec-test.js
• The Readme.md file contains:
• screenshot of a block form
• future features
• instructions for installation and operation
• technologies used
• link to Pivotal Tracker
• Things to demonstrate:
• run the test and play with it a bit
• show the raw block data in console & in code
• show the blocks being mined - via hash & nonce
• The Design Phase:
• describe basic interactivity - simple voting
• OAuth 2.0 login
• more ideas
• Deployment:
• use Surge.sh to deploy the application
|
adaa9245-29f8-4d47-a2ec-3e29daa36194
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-01 08:44:54", "repo_name": "TianXingKeJi/YiKeZhong", "sub_path": "/NeiHanDuanZi/app/src/main/java/com/example/y_xl/neihanduanzi/view/adapter/MBaseAdapter.java", "file_name": "MBaseAdapter.java", "file_ext": "java", "file_size_in_byte": 972, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "734cdcef39282091a9a8e5a2c7f77ef9ec784279", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/TianXingKeJi/YiKeZhong
| 207
|
FILENAME: MBaseAdapter.java
| 0.27048
|
package com.example.y_xl.neihanduanzi.view.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.BaseAdapter;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2018/4/14 0014.
*/
public abstract class MBaseAdapter<T> extends android.widget.BaseAdapter {
private List<T> entities;
private LayoutInflater inflater;
public MBaseAdapter(Context context) {
this.entities = new ArrayList<>();
this.inflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return entities.size();
}
@Override
public T getItem(int i) {
return entities.get(i);
}
@Override
public long getItemId(int i) {
return i;
}
public void addAll(List<T> dd){
entities.addAll(dd);
notifyDataSetChanged();
}
public LayoutInflater getInflater() {
return inflater;
}
}
|
271e1d90-c36a-4223-b222-f0e382c7dd0d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-23 04:35:07", "repo_name": "bradchao/MyGoogleTutor2", "sub_path": "/GTutor2/src/tw/brad/gtest2/Brad62.java", "file_name": "Brad62.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "b8b5e153a75796f8fdf88d9b06c1c5017dc25e10", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bradchao/MyGoogleTutor2
| 245
|
FILENAME: Brad62.java
| 0.286169
|
package tw.brad.gtest2;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Brad62 {
public static void main(String[] args) {
String urlString = "http://www.gamer.com.tw";
try {
URL url = new URL("https://pdfmyurl.com/index.php?url=" + urlString);
HttpURLConnection conn =
(HttpURLConnection) url.openConnection();
conn.connect();
String filename = urlString.replace("/", "_");
FileOutputStream fout = new FileOutputStream("mytest/" + filename + ".pdf");
BufferedInputStream bin = new BufferedInputStream(conn.getInputStream());
byte[] buf = new byte[1024*4096];
int len;
while ( (len = bin.read(buf)) != -1) {
fout.write(buf, 0, len);
}
bin.close();
fout.flush();
fout.close();
System.out.println("finish");
}catch(Exception e) {
System.out.println(e.toString());
}
}
}
|
d0c04adb-ac85-4523-8b40-99f1fe5cfe6f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-23 18:06:58", "repo_name": "EixoX/jetfuel", "sub_path": "/jetfuel-core/src/main/java/com/eixox/JetfuelException.java", "file_name": "JetfuelException.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "0aa6d1a3ad109d42bfdad295b53ab385f0d528e1", "star_events_count": 4, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/EixoX/jetfuel
| 271
|
FILENAME: JetfuelException.java
| 0.26588
|
package com.eixox;
import java.lang.System.Logger;
/**
* Generic exceptions should never be thrown (squid:S00112). Using such generic
* exceptions as Error, RuntimeException, Throwable, and Exception prevents
* calling methods from handling true, system-generated exceptions differently
* than application-generated errors.
*
* @author rportela
*
*/
public class JetfuelException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = 4286269740011946021L;
public JetfuelException(String msg) {
super(msg);
}
public JetfuelException(Throwable cause) {
super(cause);
}
public JetfuelException(String msg, Throwable cause) {
super(msg, cause);
}
public static void log(Object source, System.Logger.Level level, Throwable t) {
Logger logger = System.getLogger(source == null
? "GLOBAL"
: source.getClass().getName());
logger.log(level, t);
}
public static void log(Object source, System.Logger.Level level, String message, Throwable t) {
Logger logger = System.getLogger(source == null
? "GLOBAL"
: source.getClass().getName());
logger.log(level, message, t);
}
}
|
275c4f87-1ea0-483c-a080-6dd9856bf6f0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-12 01:08:15", "repo_name": "matt3327/Classwork", "sub_path": "/AdminDep.java", "file_name": "AdminDep.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "1e3f01c2edac3ef35326c802bc6316fe76026e8c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/matt3327/Classwork
| 259
|
FILENAME: AdminDep.java
| 0.250913
|
public class AdminDep extends CollegeAcc{
private String studentAddress;
private String studentEthnicity;
private String studentGender;
public AdminDep()
{
this(0,"","","","");
}
public AdminDep(int accNo, String name,String Address,String Ethnicity, String Gender)
{
super(accNo, name);
this.studentAddress = Address;
this.studentEthnicity = Ethnicity;
this.studentGender = Gender;
}
public String getStudentAddress() {
return studentAddress;
}
public void setStudentAddress(String studentAddress) {
this.studentAddress = studentAddress;
}
public String getStudentEthnicity() {
return studentEthnicity;
}
public void setStudentEthnicity(String studentEthnicity) {
this.studentEthnicity = studentEthnicity;
}
public String getStudentGender() {
return studentGender;
}
public void setGender(String studentGender) {
this.studentGender = studentGender;
}
@Override
public String toString() {
return "Administration Department [studentAddress=" + studentAddress + ", studentEthnicity=" + studentEthnicity
+ ", studentGender=" + studentGender + "]";
}
}
|
7227d5c5-748d-44ab-8961-412cefd5bc28
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-12 07:41:13", "repo_name": "tomermusafi/MemoryGame", "sub_path": "/app/src/main/java/com/musafi/memorygame/game/Card.java", "file_name": "Card.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "58d663b02d91175db73bd7e2d222b1bfc56da16c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tomermusafi/MemoryGame
| 219
|
FILENAME: Card.java
| 0.236516
|
package com.musafi.memorygame.game;
public class Card {
private int id;
private int image;
private boolean enable;
private boolean discovered;
public Card() {
}
public Card(int id, int image, boolean enable, boolean discovered) {
this.id = id;
this.image = image;
this.enable= enable;
this.discovered = discovered;
}
public int getId() {
return id;
}
public Card setId(int id) {
this.id = id;
return this;
}
public int getImage() {
return image;
}
public Card setImage(int image) {
this.image = image;
return this;
}
public boolean isEnable() {
return enable;
}
public Card setEnable(boolean enable) {
this.enable = enable;
return this;
}
public boolean isDiscovered() {
return discovered;
}
public Card setDiscovered(boolean discovered) {
this.discovered = discovered;
return this;
}
}
|
7e6f2583-d5e2-4a66-aadd-4d54c2a25534
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-15 10:52:19", "repo_name": "teaphy/TodoAdvanced", "sub_path": "/app/src/main/java/advanced/todo/com/todoadvanced/base/BaseActivity.java", "file_name": "BaseActivity.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "b168d9934e6d5ff029eddbada2e1962707fd8eeb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/teaphy/TodoAdvanced
| 246
|
FILENAME: BaseActivity.java
| 0.264358
|
package advanced.todo.com.todoadvanced.base;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import advanced.todo.com.todoadvanced.R;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* @author Tiany
* @desc
* @date 2017/3/9
*/
public abstract class BaseActivity extends AppCompatActivity {
@BindView(R.id.toolBar)
Toolbar mToolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(getLayoutId());
ButterKnife.bind(this);
initData();
initView();
setListener();
initToolBar();
}
private void initToolBar() {
mToolbar.setTitle(initTitle());
mToolbar.setNavigationIcon(R.mipmap.ic_back);
setSupportActionBar(mToolbar);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
BaseActivity.this.finish();
}
});
}
public abstract int getLayoutId();
public abstract void initData();
public abstract void initView();
public abstract void setListener();
public abstract String initTitle();
}
|
4fa1b817-b131-409b-8c7d-112a54f1d3de
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-08 01:30:12", "repo_name": "sunhaipeng1997/npc_platform", "sub_path": "/domain/src/main/java/com/cdkhd/npc/entity/GovernmentUser.java", "file_name": "GovernmentUser.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "42d921ea57182434bce73beee9e927c2e862595e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sunhaipeng1997/npc_platform
| 296
|
FILENAME: GovernmentUser.java
| 0.221351
|
package com.cdkhd.npc.entity;
import com.cdkhd.npc.enums.StatusEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.persistence.*;
/**
* @Description
* @Author rfx
* @Date 2019-12-03
*/
@Setter
@Getter
@Entity
@Table(name = "government_user")
public class GovernmentUser extends BaseDomain {
/**
* 1、正常
* 2、锁定
*/
@Column(name = "status")
private Byte status = StatusEnum.ENABLED.getValue();
/**
* 等级,县/区后台管理员 or 镇后台管理员
* 见com.cdkhd.npc.enums.LevelEnum
*/
@Column(name = "level")
private Byte level;
//关联区
@ManyToOne(targetEntity = Area.class, fetch = FetchType.LAZY)
@JoinColumn(name = "area", referencedColumnName = "id")
private Area area;
//关联镇
@ManyToOne(targetEntity = Town.class, fetch = FetchType.LAZY)
@JoinColumn(name = "town", referencedColumnName = "id")
private Town town;
/**
* 账号表id
*/
@OneToOne(targetEntity = Account.class, fetch = FetchType.LAZY)
private Account account;
@OneToOne(targetEntity = Government.class, fetch = FetchType.LAZY)
private Government government;
}
|
57548d1b-62b3-452b-84a1-da5c3252d04f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-23 20:31:02", "repo_name": "Lamborz/CRM", "sub_path": "/service/src/main/java/com/transport/service/RegistrationServiceImpl.java", "file_name": "RegistrationServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1054, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "c977a75fc25451aa3f4da95c1837b7ea0be5c0a4", "star_events_count": 2, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/Lamborz/CRM
| 180
|
FILENAME: RegistrationServiceImpl.java
| 0.268941
|
package com.transport.service;
import com.transport.form.RegistrationForm;
import com.transport.model.Employee;
import com.transport.repository.EmployeeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
/**
* Created by 1 on 6/13/2016.
*/
@Service
public class RegistrationServiceImpl implements RegistrationService {
@Autowired
EmployeeRepository employeeRepository;
@Override
@Transactional
public void addEmployee(RegistrationForm registrationForm) {
Employee employee = new Employee();
employee.setFirstName(registrationForm.getFirstName());
employee.setLastName(registrationForm.getLastName());
employee.setPosition(registrationForm.getPosition());
employee.setMail(registrationForm.getMail());
employee.setPhone(registrationForm.getPhone());
employee.setRate(registrationForm.getRate());
employee = employeeRepository.save(employee);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.