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 |
|---|---|---|---|---|---|---|
ba7b235b-a116-4a89-897f-8e78395b65e7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-04 08:19:38", "repo_name": "huttonj/chevrolet", "sub_path": "/chevrolet-api/src/main/java/com/chevrolet/api/enums/WarehouseStatusEnum.java", "file_name": "WarehouseStatusEnum.java", "file_ext": "java", "file_size_in_byte": 1442, "line_count": 49, "lang": "zh", "doc_type": "code", "blob_id": "907b3ad4396019a6274deaff238bd5ce854addc8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/huttonj/chevrolet | 339 | FILENAME: WarehouseStatusEnum.java | 0.287768 | package com.chevrolet.api.enums;
/**
* Created by zhouxiaoliu on 16/9/24.
*/
public enum WarehouseStatusEnum {
AVAILABLE(1, "正常"),
/**
* 2018 9月后的版本仓库,实际已不存在该状态,但是对外暴露仍沿用该状态,外部api仍按原需求继续使用
* 此状态代表所有仓库状态id大于3的列表集合
*/
SUSPEND(2, "暂停"),
CLOSED(3, "关闭");
private Integer code;
private String msg;
private WarehouseStatusEnum(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Integer getCode() {
return code;
}
public String getName() {
return msg;
}
/**
* 该方法在记录仓库基础信息日志时有用到,如果修改了请同时修改日志DTO com.mhc.mclaren.dto.warehouse.WarehouseBasicLogDTO
* 注意:因为仓库状态已经可配,所以实际状态已经入库,不局限于这三种,只是管尚目前对外暴露继续沿用上述三种,除1,3外其他全部状态均为暂停,获取真实状态请走api调用
*
*/
public static String getMsgByCode(Integer code){
for(WarehouseStatusEnum status : WarehouseStatusEnum.values()){
if(status.code.equals(code)){
if(code>3){
return SUSPEND.msg;
}
return status.msg;
}
}
return null;
}
}
|
a4adc47f-f5fc-4c85-aef7-11c27a79854e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-25 06:04:55", "repo_name": "coding-dogs/console", "sub_path": "/src/main/java/com/easyorder/modules/product/entity/ProductProperty.java", "file_name": "ProductProperty.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "833146cb966ee00c4d697676ecb9a08711fe8bfe", "star_events_count": 0, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/coding-dogs/console | 271 | FILENAME: ProductProperty.java | 0.259826 | package com.easyorder.modules.product.entity;
import com.jeeplus.common.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
/**
* 商品属性Entity
* @author qiudequan
* @version 2017-06-09
*/
public class ProductProperty extends DataEntity<ProductProperty> {
private static final long serialVersionUID = 1L;
private String productId; // 商品ID
private String name; // 属性名
private String value; // 属性值
public ProductProperty() {
super();
}
public ProductProperty(String id){
super(id);
}
@ExcelField(title="商品ID", align=2, sort=1)
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
@ExcelField(title="属性名", align=2, sort=2)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@ExcelField(title="属性值", align=2, sort=3)
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
} |
289b9758-c438-4b59-a1ad-a9ea4f45a005 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-28 00:37:58", "repo_name": "tamuten/jukuSystem2", "sub_path": "/src/main/java/com/example/demo/login/domain/service/MEmployeeService.java", "file_name": "MEmployeeService.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "5855f5be191b19106495c5eed728500c92e1a9f0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tamuten/jukuSystem2 | 163 | FILENAME: MEmployeeService.java | 0.246533 | package com.example.demo.login.domain.service;
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 com.example.demo.login.MEmployeeUserDetails;
import com.example.demo.login.domain.model.Employee;
import com.example.demo.login.domain.repository.MEmployeeDao;
@Service
public class MEmployeeService implements UserDetailsService {
@Autowired
private MEmployeeDao mEmployeeDao;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
Employee employee = mEmployeeDao.selectOne(username);
if (employee == null) {
throw new UsernameNotFoundException(username + " is not found");
}
return new MEmployeeUserDetails(employee);
}
}
|
2fb7a243-2712-4b4d-ac00-183892d0bd1a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-27 00:36:53", "repo_name": "vital667/Many-To-Many-Jpa", "sub_path": "/src/main/java/com/example/manytomanyjpa/entity/Photo.java", "file_name": "Photo.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "2f7fc8dda4b60ea4b934863c2af52c26ae1e708a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vital667/Many-To-Many-Jpa | 202 | FILENAME: Photo.java | 0.277473 | package com.example.manytomanyjpa.entity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
@Getter
@NoArgsConstructor
public class Photo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(
name = "followed_categories",
joinColumns = @JoinColumn(name = "photo_id"),
inverseJoinColumns = @JoinColumn(name = "category_id")
)
private List<Category> followedCategories = new ArrayList<>();
public Photo(String name) {
this.name = name;
}
public void followCategory(Category category) {
followedCategories.add(category);
}
public void showCategories() {
System.out.println(name + " belongs to:");
for (Category i : followedCategories)
System.out.println(i.getId() + " - " + i.getName());
}
}
|
126fc30d-5db9-451e-87f0-3430b365e434 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-06-17 01:38:42", "repo_name": "song-dev/android-study", "sub_path": "/app/src/main/java/com/song/androidstudy/testcpp/TestCppActivity.java", "file_name": "TestCppActivity.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "17a015c4677e15e7e71b99f6816a0e530820ce10", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/song-dev/android-study | 207 | FILENAME: TestCppActivity.java | 0.224055 | package com.song.androidstudy.testcpp;
import android.content.Context;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import android.widget.TextView;
import com.song.androidstudy.R;
import butterknife.BindView;
import butterknife.ButterKnife;
public class TestCppActivity extends AppCompatActivity {
private static final String TAG = "TestCppActivity";
// Used to load the 'native-lib' library on application startup.
static {
System.loadLibrary("native-lib");
}
@BindView(R.id.content)
TextView contentTv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test_cpp);
ButterKnife.bind(this);
String info = getData(this);
contentTv.setText(info);
Log.e(TAG, "onCreate: " + info);
}
/**
* A native method that is implemented by the 'native-lib' native library,
* which is packaged with this application.
*/
public native String getData(Context context);
}
|
bce46224-3ac2-464c-b4ea-c4e95890e80e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-16 11:44:18", "repo_name": "keligeri/spring_rest", "sub_path": "/src/main/java/com/codecool/spring/rest/model/Role.java", "file_name": "Role.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "008b90cecac370aee10cd0872d63c1ea55724bde", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/keligeri/spring_rest | 225 | FILENAME: Role.java | 0.23231 | package com.codecool.spring.rest.model;
import com.fasterxml.jackson.annotation.JsonBackReference;
import javax.persistence.*;
import java.util.List;
@Entity
@Table(name = "roles")
public class Role {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
private String role;
@OneToMany(mappedBy = "role", cascade = CascadeType.REMOVE)
@JsonBackReference
private List<User> users;
public Role() {}
public Role(String role, List<User> users) {
this.role = role;
this.users = users;
}
public Role(String role) {
this.role = role;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
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;
}
}
|
7cf97d57-78b2-4f69-b92f-ae5e7a71712a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-03 13:19:56", "repo_name": "rodriga/CSSE477-Homework5", "sub_path": "/homework5.pluginframework.gui/src/homework5/pluginframework/gui/AbstractGUIPanel.java", "file_name": "AbstractGUIPanel.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "591342306cebafbb53b5c766194d2ef60a7c8698", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rodriga/CSSE477-Homework5 | 226 | FILENAME: AbstractGUIPanel.java | 0.287768 | package homework5.pluginframework.gui;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.JPanel;
@SuppressWarnings("serial")
public abstract class AbstractGUIPanel extends JPanel {
private JLabel title;
private Color panelColor = new Color(0xFFFFFF);
private Color titlebgColor = new Color(0x003366);
private Color titlefgColor = new Color(0xFFFFFF);
public AbstractGUIPanel(String title, Dimension preferredSize) {
this.setPreferredSize(preferredSize);
this.setBackground(this.panelColor);
this.setLayout(new BorderLayout());
this.add(createTitle(title), BorderLayout.PAGE_START);
}
public JLabel createTitle(String titleName) {
this.title = new JLabel();
this.title.setFont(new Font("Helvetica", Font.BOLD, 20));
this.title.setText(titleName);
this.title.setOpaque(true);
this.title.setBackground(this.titlebgColor);
this.title.setForeground(this.titlefgColor);
return title;
}
public String getTitle(){
return this.title.getText();
}
}
|
a687c479-56b2-456e-91c1-8cfbd23c44f1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-01-08T15:05:33", "repo_name": "onabee/Empowered-Forum", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1060, "line_count": 52, "lang": "en", "doc_type": "text", "blob_id": "4788efd8c3acbbfd336382b185f3844949cf1bb1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/onabee/Empowered-Forum | 250 | FILENAME: README.md | 0.274351 | *project2*
# Internet Forum
## User Stories:
1. User should be able to discuss things by topic/category.
2. A post should belong to its relevant category.
3. User should be able to create posts *(which will belong to them)* and categories *(which will be for everyone, maybe ask them to put in necessary information to keep all categories similar)*.
4. User should be able to comment on existing posts.
*sub-comments are __unnecessary__*
5. User should be able to see which posts have the most comments.
6. User should be able to vote on posts.
7. User should see posts based on popularity.
## ERD

* Nevermind the user_id in topic/category. A category shouldn't be assigned to one user. Categories belong to all users.
## Wireframes



## Technologies Used
* HTML
* CSS
* Ruby & Sinatra
* SQL/ActiveRecord
* JavaScript/jQuery
## My Approach
## Installation Instructions
```
$ gem install sinatra
```
## Unsolved Problems
|
5c9a945b-71e0-4669-b0e2-d9242dd8f3a5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-25 13:32:11", "repo_name": "CaioEduardoMouta/maratonajava", "sub_path": "/Dev-DojoMaratonaJava/src/javacore/Xnio/test/PossixFileAtrtibutesTest.java", "file_name": "PossixFileAtrtibutesTest.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "19778e610f746f70631a89e573cde90126574b5a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CaioEduardoMouta/maratonajava | 238 | FILENAME: PossixFileAtrtibutesTest.java | 0.240775 | package javacore.Xnio.test;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.PosixFileAttributes;
import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
import java.util.Set;
// Esperar ter um sistema operacional Linux ou um note melhor que suporte uma maquina virtual
public class PossixFileAtrtibutesTest {
public static void main(String[] args) throws IOException {
Path path = Paths.get("/home/caio/dev/arquivo");
PosixFileAttributes posix = Files.readAttributes(path, PosixFileAttributes.class);
System.out.println(posix.permissions());
System.out.println("Alterando as permissoes");
// PosixFileAttributeView view = Files.getFileAttributeView(path, PosixFileAttributeView.class);
// view.setPermissions();
Set<PosixFilePermission> permissions = PosixFilePermissions.fromString("rw-rw-rw-");
Files.setPosixFilePermissions(path, permissions);
System.out.println(posix.permissions());
}
}
|
30fc5002-75fc-4e3e-9768-c2da0807e2c8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-15 05:25:04", "repo_name": "u-malichenko/DivisionOfExpenses", "sub_path": "/src/main/java/ru/division/of/expenses/app/dto/UserDto.java", "file_name": "UserDto.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ee651a16dac8876205bccb95f167799403420eba", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/u-malichenko/DivisionOfExpenses | 211 | FILENAME: UserDto.java | 0.284576 | package ru.division.of.expenses.app.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import ru.division.of.expenses.app.models.Event;
import ru.division.of.expenses.app.models.Role;
import ru.division.of.expenses.app.models.User;
import java.util.List;
import java.util.stream.Collectors;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class UserDto {
private Long id;
private String firstname;
private String lastname;
private String username;
private List<String> roles;
private List<String> events;
public UserDto(User user) {
this.id = user.getId();
this.firstname = user.getFirstName();
this.lastname = user.getLastName();
this.username = user.getUsername();
// if(this.id != null) {
this.roles = user.getRoles().stream()
.map(Role::getName)
.collect(Collectors.toList());
this.events = user.getEventList().stream()
.map(Event::getName)
.collect(Collectors.toList());
// }
}
}
|
86c9391f-6164-4b0f-9e7c-f743453b0b19 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-09 23:10:17", "repo_name": "urandumani/file-io", "sub_path": "/src/main/java/com/ekipa/model/DirectoryModel.java", "file_name": "DirectoryModel.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "6aad3237d3809fddcddf6e96a81acf46b64b4d99", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/urandumani/file-io | 212 | FILENAME: DirectoryModel.java | 0.253861 | package com.ekipa.model;
import com.ekipa.constant.Permission;
import java.nio.file.Path;
import java.nio.file.attribute.BasicFileAttributes;
public class DirectoryModel extends FileModel {
private ChildrenModel childrenModel;
public ChildrenModel getChildrenModel() {
return childrenModel;
}
public void setChildrenModel(ChildrenModel childrenModel) {
this.childrenModel = childrenModel;
}
public static DirectoryModel createDirectory(String id, Path path, BasicFileAttributes attributes, ChildrenModel childrenModel) {
DirectoryModel directoryModel = new DirectoryModel();
directoryModel.setName(path.getFileName().toString());
directoryModel.setId(id);
directoryModel.setLastmodified(attributes.lastModifiedTime().toMillis());
directoryModel.setSize(attributes.size());
if (path.getParent() != null) {
directoryModel.setParent(path.getParent().getFileName().toString());
}
directoryModel.setPermission(Permission.getPermission(path));
directoryModel.setChildrenModel(childrenModel);
return directoryModel;
}
}
|
dbed190d-5858-4e29-a51f-80943493b428 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-16 11:54:53", "repo_name": "lparisot/confusion-spring", "sub_path": "/src/test/java/com/lpa/confusionspring/repositories/reactive/CommentReactiveRepositoryTest.java", "file_name": "CommentReactiveRepositoryTest.java", "file_ext": "java", "file_size_in_byte": 1056, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "92bf19af8775a6a370c1a6eafafa2004bfb27a27", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lparisot/confusion-spring | 199 | FILENAME: CommentReactiveRepositoryTest.java | 0.26588 | package com.lpa.confusionspring.repositories.reactive;
import com.lpa.confusionspring.domain.Comment;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.*;
@RunWith(SpringRunner.class)
@DataMongoTest
public class CommentReactiveRepositoryTest {
@Autowired
private CommentReactiveRepository commentReactiveRepository;
@Before
public void setUp() throws Exception {
commentReactiveRepository.deleteAll().block();
}
@Test
public void testSave() throws Exception {
Comment comment = new Comment();
comment.setAuthor("TEST");
comment.setComment("Yummy");
commentReactiveRepository.save(comment).block();
Long count = commentReactiveRepository.count().block();
assertEquals(Long.valueOf(1L), count);
}
} |
8a7f401a-4853-47e1-b8b2-b42e7cd5aa8a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-19 15:55:45", "repo_name": "Iokhin/java-se", "sub_path": "/tm-client/src/main/java/ru/iokhin/tm/command/system/HelpCommand.java", "file_name": "HelpCommand.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "342edc9ef29cc92dac73111e5985a9805fb5425d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Iokhin/java-se | 207 | FILENAME: HelpCommand.java | 0.294215 | package ru.iokhin.tm.command.system;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import ru.iokhin.tm.command.AbstractCommand;
import ru.iokhin.tm.config.Bootstrap;
@Component
@NoArgsConstructor
public final class HelpCommand extends AbstractCommand {
@Autowired
private Bootstrap bootstrap;
@Override
public boolean security() {
return false;
}
@Override
public boolean admin() {
return false;
}
@Override
public String name() {
return "help";
}
@Override
public String description() {
return "Show description of all commands";
}
@Override
public void execute() {
helpCommand();
}
private void helpCommand() {
for (@NotNull AbstractCommand abstractCommand : bootstrap.getCommandMap().values()) {
System.out.println(abstractCommand.name() + ": " + abstractCommand.description());
}
}
}
|
e8f434fc-f72b-4ac9-8ef8-d894fe710487 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-07 18:48:35", "repo_name": "girayserter/FragmentApp", "sub_path": "/app/src/main/java/com/example/fragmentapp/FragmentB.java", "file_name": "FragmentB.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "2a83a91e7f5109f23791e581c092f203d5cfb0db", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/girayserter/FragmentApp | 172 | FILENAME: FragmentB.java | 0.245085 | package com.example.fragmentapp;
import android.content.Intent;
import android.os.Bundle;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.fragmentapp.databinding.FragmentBBinding;
public class FragmentB extends Fragment {
public FragmentB() {
}
MainActivityViewModel viewModel;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
FragmentBBinding binding= DataBindingUtil.inflate(inflater,R.layout.fragment_b, container, false);
viewModel=new ViewModelProvider(requireActivity()).get(MainActivityViewModel.class);
binding.txtText.setText(viewModel.getText());
binding.btnSecondActivity.setOnClickListener(v -> {
Intent intent=new Intent(getActivity(),SecondActivity.class);
startActivity(intent);
});
return binding.getRoot();
}
} |
1ca4ba37-8fb9-4ced-a8e1-e81c4d86cae9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-02-26T13:04:13", "repo_name": "bubblecloud/ilves-seed", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1082, "line_count": 55, "lang": "en", "doc_type": "text", "blob_id": "26e5aa527752d26aa2a647399d80e26b292e8f57", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/bubblecloud/ilves-seed | 229 | FILENAME: README.md | 0.27048 | Ilves Seed Project
==================
Ilves simplifies Java web site creation. This is seed project to simplify new project setup.
Preconditions
------------
1. Git
2. JDK 7
3. Maven 3
Features
--------
1. Example of navigation, page, localization and theme icon customization.
2. Procfile for running the project in Heroku.
3. Build file to generate executable jar.
4. Configuration examples for HSQL (default), PostgreSQL and MySQL.
Clone
-----
Clone projec to your local workstation from command line with the following command:
git clone https://github.com/bubblecloud/ilves-seed.git
Integrated Development Environments
-----------------------------------
Import project to IDE of choice (IntelliJ Idea, Eclipse, NetBeans...) by importing the maven pom.xml.
Building
--------
Build from command line with the following command:
mvn clean install
Executing
---------
Execute from command line with the following command:
ilves
Debugging
---------
Debug from IDE by executing IlvesMain class in debug mode.
Browse
------
Open browser at https://localhost:8443/ |
385aac47-0faf-4ed7-a2a0-b1de318a2cfc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-18 12:52:20", "repo_name": "shaktysingh/webfluxdemo", "sub_path": "/src/main/java/com/webservice/webfluxdemo/model/ErrorResponse.java", "file_name": "ErrorResponse.java", "file_ext": "java", "file_size_in_byte": 1068, "line_count": 69, "lang": "en", "doc_type": "code", "blob_id": "f7afaaf6accb51fd62be613a93284e386801882e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shaktysingh/webfluxdemo | 240 | FILENAME: ErrorResponse.java | 0.206894 | /**
*
*/
package com.webservice.webfluxdemo.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ErrorResponse {
@JsonProperty("message")
private String message;
@JsonProperty("type")
private String type;
@JsonProperty("field")
private String field;
/**
* @return the message
*/
public String getMessage() {
return message;
}
/**
* @param message the message to set
*/
public void setMessage(String message) {
this.message = message;
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
* @return the field
*/
public String getField() {
return field;
}
/**
* @param field the field to set
*/
public void setField(String field) {
this.field = field;
}
}
|
9fa213d6-3e22-4bf4-aded-e76940ee47b5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-09 12:21:47", "repo_name": "Przemek94/Gra", "sub_path": "/app/src/main/java/com/example/ziom/jtr/Gra.java", "file_name": "Gra.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "e2963beb00d999aff0fec330c2bbd58b8a8c8479", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Przemek94/Gra | 198 | FILENAME: Gra.java | 0.218669 | package com.example.ziom.jtr;
import android.content.Intent;
import android.media.MediaPlayer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class Gra extends AppCompatActivity {
MediaPlayer pytanie;
@Override
public void onStop() {
super.onStop();
pytanie.release();
finish();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gra);
pytanie = MediaPlayer.create(this, R.raw.ostr);
pytanie.start();
android.support.v7.app.ActionBar bar = getSupportActionBar();
if (bar != null) {
bar.hide();
}
}
public void Dobrze(View view) {
Intent intent = new Intent(this, dobrze.class);
startActivity(intent);
}
public void Zle(View view) {
Intent intent = new Intent(this, zle.class);
startActivity(intent);
}
}
|
27d29a1d-4e1d-46ea-8eac-a447647af9cd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-15 09:05:31", "repo_name": "fabienb-bm/zDeprecated_ServiceWeb_BuyManager", "sub_path": "/src/java/WS/Avnet.java", "file_name": "Avnet.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "73df79c765fb03f609772eb4c9af2b748acaaf0c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fabienb-bm/zDeprecated_ServiceWeb_BuyManager | 222 | FILENAME: Avnet.java | 0.226784 | /*
* 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 WS;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import org.glassfish.jersey.client.ClientConfig;
/**
*
* @author dupont
*/
public class Avnet {
public String interroAvnet() {
Client client = ClientBuilder.newClient(new ClientConfig());
WebTarget webTarget = client.target("http://avnetexpress.avnet.com/part/c/")
.path("/part/c/BAV99")
.queryParam("r", "EMEA")
.queryParam("l", "-2")
.queryParam("c", "EUR");
Invocation.Builder invocationBuilder = webTarget.request(MediaType.TEXT_PLAIN_TYPE);
String reponse = invocationBuilder.get(String.class);
return reponse;
}
}
|
37355d40-e3b0-43b9-b514-f19d2134081c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-07 09:30:24", "repo_name": "artempolischuk4315/hybris-repos", "sub_path": "/extensions/mymoduleext/mymoduleextcore/src/org/training/core/workflow/SupervisorRegistrationConfirmationActionJob.java", "file_name": "SupervisorRegistrationConfirmationActionJob.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "c6d3c32e61540f5c3eb60e3343ff05410a3af3d1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/artempolischuk4315/hybris-repos | 192 | FILENAME: SupervisorRegistrationConfirmationActionJob.java | 0.278257 | package org.training.core.workflow;
import de.hybris.platform.core.model.user.CustomerModel;
import de.hybris.platform.servicelayer.model.ModelService;
import de.hybris.platform.workflow.model.WorkflowActionModel;
import de.hybris.platform.workflow.model.WorkflowDecisionModel;
import org.apache.log4j.Logger;
public class SupervisorRegistrationConfirmationActionJob extends AbstractAdvancedUserRegistrationActionJob {
private static final Logger LOG = Logger.getLogger(SupervisorRegistrationConfirmationActionJob.class);
@Override
public WorkflowDecisionModel perform(final WorkflowActionModel action)
{
final CustomerModel customer = getAttachedCustomer(action);
LOG.info("Customer " + customer.getUid() + " confirmed by supervisor!");
customer.setLoginDisabled(false);
ModelService modelService = getModelService();
modelService.save(customer);
for (final WorkflowDecisionModel decision : action.getDecisions())
{
return decision;
}
return null;
}
}
|
b6a8e00e-fc33-4388-a302-b28a30d4962b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-25 09:53:56", "repo_name": "aripratom/FrontEndCodingTest", "sub_path": "/app/src/main/java/com/aripratom/frontendcodingtest/tokenmanager/TokenManager.java", "file_name": "TokenManager.java", "file_ext": "java", "file_size_in_byte": 1083, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "1da24773b5d05c7f1a6b6c5c26362a149d113ed1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aripratom/FrontEndCodingTest | 201 | FILENAME: TokenManager.java | 0.221351 | package com.aripratom.frontendcodingtest.tokenmanager;
import android.content.Context;
import android.content.SharedPreferences;
public class TokenManager {
private SharedPreferences sharedPreferences;
private SharedPreferences.Editor editor;
private int Mode = 0;
private static final String REFNAME="JWTTOKEN";
private static final String KEY_EMAIL="email";
private static final String KEY_USER_NAME="username";
private static final String KEY_PASS="password";
private static final String KEY_JWT_TOKEN="jwttoken";
private Context context;
public TokenManager(Context context){
this.context = context;
sharedPreferences = context.getSharedPreferences(REFNAME,Mode);
editor = sharedPreferences.edit();
}
public void createSession(String email, String username, String password){
editor.putString(KEY_EMAIL, email);
editor.putString(KEY_USER_NAME,username);
editor.putString(KEY_PASS, password);
//editor.putString(KEY_JWT_TOKEN,jwtvalue);
editor.commit();
}
}
|
ff991a9f-7e18-4f4b-9da9-1bbeafa288a3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-10 03:40:53", "repo_name": "originer/HZRPC", "sub_path": "/HZRPC/hzr-spring-provider/src/main/java/hzr/spring/provider/bean/ServerFactoryBean.java", "file_name": "ServerFactoryBean.java", "file_ext": "java", "file_size_in_byte": 1231, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "bd5f399312285c76d1c76a2195835d8a1a298a8c", "star_events_count": 11, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/originer/HZRPC | 251 | FILENAME: ServerFactoryBean.java | 0.233706 | package hzr.spring.provider.bean;
import hzr.common.bootstrap.ServerBuilder;
import hzr.common.transport.server.Server;
import hzr.common.transport.server.ServerImpl;
import lombok.Data;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* @author Zz
**/
@Data
public class ServerFactoryBean implements FactoryBean<Object> {
private Class<?> serviceInterface;
private Object serviceImpl;
private int port;
private String zkConn;
private ServerImpl rpcServer;
private Map<String,Object> serviceMap;
public void start() {
Server build = ServerBuilder.builder().zkConn(zkConn)
.serviceMap(serviceMap)
.port(port)
.zkConn(zkConn).build2();
build.start();
}
public void destroy() {
rpcServer.shutdown();
}
@Nullable
@Override
public Object getObject() throws Exception {
return this;
}
@Nullable
@Override
public Class<?> getObjectType() {
return this.getClass();
}
@Override
public boolean isSingleton() {
return true;
}
} |
8201cb42-d06a-4616-acd6-9f2c9608b047 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-10 21:57:24", "repo_name": "jr091291/sisobeem", "sub_path": "/src/main/java/sisobeem/artifacts/Log.java", "file_name": "Log.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "d7a45e0aad3e811edd0de16f99e105cc9ba7f03d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jr091291/sisobeem | 250 | FILENAME: Log.java | 0.272025 | package sisobeem.artifacts;
import java.net.URL;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.helpers.Loader;
public class Log {
private final static Logger log = Logger.getLogger(Log.class);
private static Log ObLog;
private Log (){
URL url = Loader.getResource("log4j.properties");
PropertyConfigurator.configure(url);
// Logger.addAppender(new FileAppender(new PatternLayout(),"prueba.log", false));
}
/**
* Singelton
* @return
*/
public static Log getLog(){
if(ObLog==null){
ObLog = new Log();
return ObLog;
}
return ObLog;
}
public void setWarn(String x){
log.warn(x);
}
public void setError(String x){
log.error(x);
}
public void setFatal(String x){
log.fatal(x);
}
public void setInfo(String x){
log.info(x);
}
public void setDebug(String x){
log.debug(x);
}
}
|
59b7b0e7-b557-4c41-b943-02acea8ea6af | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-23 16:44:57", "repo_name": "dangnamlss/DangPhuongNam", "sub_path": "/DangPhuongNam/GPU/DictionaryManagement.java", "file_name": "DictionaryManagement.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "d9788dd79b0a1bd6754abca4f0342f226f8543df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dangnamlss/DangPhuongNam | 207 | FILENAME: DictionaryManagement.java | 0.27513 | package sample;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Scanner;
public class DictionaryManagement extends Dictionary {
public ArrayList<Word> insertFromFile() throws IOException {
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader("C:\\Users\\namde\\OneDrive\\Desktop\\dictionaryGPU\\data\\wordAndMeaning"));
while (br.readLine() != null) {
String string = br.readLine();
String[] s;
s = string.split("\t", 4);
Word word = new Word(s[0], s[1], s[2], s[3]);
super.words.add(word);
}
} catch (IOException e) {
e.printStackTrace();
}
finally {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return words;
}
}
|
68176789-ff93-4d05-9e15-a4f2e3f4210b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-06-20 05:23:13", "repo_name": "aman207/ShortIt", "sub_path": "/src/net/targetcraft/shortit/CheckUserBlacklist.java", "file_name": "CheckUserBlacklist.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "99b888c572615b6bf5e0aaaf44bee548a55ed090", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aman207/ShortIt | 249 | FILENAME: CheckUserBlacklist.java | 0.291787 | package net.targetcraft.shortit;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
public class CheckUserBlacklist {
static MainClass plugin;
public CheckUserBlacklist(MainClass config) {
plugin = config;
}
public static boolean findUser(String string)
{
List<String>blacklistUser = plugin.getConfig().getStringList("user-blacklist");
List<String>blacklistUserCopy=new ArrayList<String>(blacklistUser);
int count = 0;
while (blacklistUserCopy.contains(string))
{
blacklistUserCopy.remove(string);
count++;
}
if(count==1)
{
return true;
}
else
return false;
}
public static int findUser2(String string)
{
List<String>blacklistUser = plugin.getConfig().getStringList("user-blacklist");
List<String>blacklistUserCopy=new ArrayList<String>(blacklistUser);
string=ChatColor.RED+"It works";
int count = 0;
while (blacklistUserCopy.contains(string))
{
blacklistUserCopy.remove(string);
count++;
}
return count;
}
} |
410384d5-ed4f-4dea-a35a-e90aa69fabbf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-02 05:24:13", "repo_name": "bralbers/LoginRegister", "sub_path": "/src/main/java/com/brian/albers/loginregisterexercise/listener/ApplicationListener.java", "file_name": "ApplicationListener.java", "file_ext": "java", "file_size_in_byte": 1062, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "4938727a2948bf2e5429e4ccffa0fc3829d4a6bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bralbers/LoginRegister | 205 | FILENAME: ApplicationListener.java | 0.286968 | package com.brian.albers.loginregisterexercise.listener;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.jboss.logging.Logger;
import com.brian.albers.loginregisterexercise.persistence.UsersDAO;
/**
* Application Lifecycle Listener implementation class ApplicationListener
*
*/
public class ApplicationListener implements ServletContextListener {
private Logger myLogger = Logger.getLogger(ApplicationListener.class);
/**
* Default constructor.
*/
public ApplicationListener() {
}
/**
* @see ServletContextListener#contextDestroyed(ServletContextEvent)
*/
public void contextDestroyed(ServletContextEvent sce) {
UsersDAO.getEmf().close();
}
/**
* @see ServletContextListener#contextInitialized(ServletContextEvent)
*/
public void contextInitialized(ServletContextEvent sce) {
sce.getServletContext().setAttribute("dao", new UsersDAO());
myLogger.info("INFO:Application listener has created a UsersDAO object");
}
}
|
5f22d038-2397-4374-b49f-84f10b41a947 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-05-18 18:19:56", "repo_name": "keithsjohnson/accounts", "sub_path": "/src/main/java/uk/co/keithsjohnson/accounts/model/payments/RegularPayment.java", "file_name": "RegularPayment.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "c28f5a92d2515817450a2d6a4a1f18ebef27b580", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/keithsjohnson/accounts | 224 | FILENAME: RegularPayment.java | 0.262842 | package uk.co.keithsjohnson.accounts.model.payments;
import java.time.LocalDate;
import uk.co.keithsjohnson.accounts.model.accounts.Account;
public class RegularPayment {
private final LocalDate dueDate;
private final String payee;
private final Account account;
private final long amount;
private final PaymentFrequency paymentFrequency;
private final String memo;
public RegularPayment(LocalDate dueDate, String payee, Account account, long amount, PaymentFrequency paymentFrequency, String memo) {
super();
this.dueDate = dueDate;
this.payee = payee;
this.account = account;
this.amount = amount;
this.paymentFrequency = paymentFrequency;
this.memo = memo;
}
public LocalDate getDueDate() {
return dueDate;
}
public String getPayee() {
return payee;
}
public Account getAccount() {
return account;
}
public long getAmount() {
return amount;
}
public PaymentFrequency getPaymentFrequency() {
return paymentFrequency;
}
public String getMemo() {
return memo;
}
}
|
e4c20208-69a9-4985-bf43-5de7d9d95833 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-30 06:25:07", "repo_name": "wallellen/study-jpa", "sub_path": "/src/test/java/alvin/configs/TestSupport.java", "file_name": "TestSupport.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "a4d42b36ad52b4853b7d0ea92c13918126c3353c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wallellen/study-jpa | 194 | FILENAME: TestSupport.java | 0.272799 | package alvin.configs;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.persist.PersistService;
import com.google.inject.persist.jpa.JpaPersistModule;
import org.junit.Before;
import javax.inject.Inject;
import javax.persistence.EntityManager;
public abstract class TestSupport {
private Injector injector;
@Inject
protected EntityManager em;
@Before
public void setUp() {
injector = Guice.createInjector(new JpaPersistModule("default"));
injector.getInstance(PersistService.class).start();
injector.injectMembers(this);
em.getTransaction().begin();
try {
for (String table : getTruncateTables()) {
em.createNativeQuery("truncate table " + table).executeUpdate();
}
em.getTransaction().commit();
} catch (Exception e) {
em.getTransaction().rollback();
throw e;
}
}
protected abstract String[] getTruncateTables();
}
|
3a59f124-e623-4b70-907f-f3c3c5abe822 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-15 14:00:41", "repo_name": "nb8g13/gdp-alignment", "sub_path": "/src/Printer.java", "file_name": "Printer.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "b1293a4d17084ff9166781147e5ca973e2063577", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nb8g13/gdp-alignment | 232 | FILENAME: Printer.java | 0.255344 | import java.util.ArrayList;
/**
* Created by Pro on 02/02/2018.
*/
public class Printer {
public Printer() {
}
public void printTrans(ArrayList<Caption> trData) {
for (Caption sentence: trData) {
System.out.println(sentence.getText());
}
}
public void printMutations(ArrayList<ArrayList<Mutation>> allMutations) {
int count = 0;
int othercount = 0;
for (ArrayList<Mutation> captionMuts: allMutations) {
count ++;
System.out.println("CAPTION " + count + " MUTATIONS");
for (Mutation mut: captionMuts) {
othercount++;
System.out.print("MUTATION " + othercount + " ");
String s = " ";
for (Operation op: mut.getO().operations) {
s = s + op.toString() + " ";
}
System.out.println(s + " " + mut.getA() + " " + mut.getT());
}
othercount = 0;
}
}
}
|
537d71a8-bb61-4a60-9d51-c946fc346b6b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-26 08:25:08", "repo_name": "blueshen/pomelo-rpc", "sub_path": "/pomelo-examples/src/main/java/cn/shenyanchao/pomelo/rpc/demo/entity/RpcUser.java", "file_name": "RpcUser.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "d9bca32e149ebfb8869fe7ddc26926f122b82bf0", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/blueshen/pomelo-rpc | 244 | FILENAME: RpcUser.java | 0.226784 | package cn.shenyanchao.pomelo.rpc.demo.entity;
import java.io.Serializable;
/**
* @author shenyanchao
*/
public class RpcUser implements Serializable {
private static final long serialVersionUID = -467668234191746603L;
private String name;
private String age;
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the age
*/
public String getAge() {
return age;
}
/**
* @param age the age to set
*/
public void setAge(String age) {
this.age = age;
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("RpcUser{");
sb.append("name='").append(name).append('\'');
sb.append(", age='").append(age).append('\'');
sb.append('}');
return sb.toString();
}
}
|
1fb794b4-a4cc-459a-9665-00758ff47eb1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-07-23 18:09:30", "repo_name": "dennywangdengyu/coprhd-controller", "sub_path": "/exportLibraries/xtremio/src/main/java/com/emc/storageos/xtremio/restapi/model/response/XtremIOPorts.java", "file_name": "XtremIOPorts.java", "file_ext": "java", "file_size_in_byte": 542, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "f61b8ea8ba625f59ac135e66df16fc762b42f1d6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dennywangdengyu/coprhd-controller | 218 | FILENAME: XtremIOPorts.java | 0.23092 | /*
* Copyright 2015 EMC Corporation
* All Rights Reserved
*/
/**
* Copyright (c) 2014 EMC Corporation
* All Rights Reserved
*
* This software contains the intellectual property of EMC Corporation
* or is licensed to EMC Corporation from third parties. Use of this
* software and the intellectual property contained therein is expressly
* limited to the terms and conditions of the License Agreement under which
* it is provided by or on behalf of EMC.
*/
package com.emc.storageos.xtremio.restapi.model.response;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonRootName;
import com.google.gson.annotations.SerializedName;
@JsonRootName(value="xtremio_ports")
public class XtremIOPorts {
@SerializedName("content")
@JsonProperty(value="content")
private XtremIOPort content;
public XtremIOPort getContent() {
return content;
}
public void setContent(XtremIOPort content) {
this.content = content;
}
}
|
a19dc9db-5d09-4713-b24f-b5d1b80d7f80 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-10-13T02:57:54", "repo_name": "SpaceWorksCo/guides", "sub_path": "/Stake-With-Spacecoind.md", "file_name": "Stake-With-Spacecoind.md", "file_ext": "md", "file_size_in_byte": 1024, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "76c4a1f3c6b8b8792eb13ac8b3ca6fc84379586c", "star_events_count": 2, "fork_events_count": 4, "src_encoding": "UTF-8"} | https://github.com/SpaceWorksCo/guides | 252 | FILENAME: Stake-With-Spacecoind.md | 0.249447 | # Stake With Spacecoind
This guide will teach you how to stake with Spacecoind.
## Table of Contents
- [Please Note](#Please-Note)
- [Instructions](#Instructions)
### Please Note
With Spacecoind the commands will need to be used with `spacecoin-cli`.
For staking to work the wallet needs to be unlocked. If you encrypted your wallet you will need to unlock it with the command `walletpassphrase`.
Example: `spacecoin-cli walletpassphrase "your passphrase" 3600`
`3600` is the time in seconds the wallet will stay unlocked before locking again. This means you will need to unlock it again after this specified amount of time to continue staking.
The wallet must stay open and online to be able to stake.
### Instructions
1. Run `spacecoind` and let the blockchain fully sync.
2. Send coins to your wallet if you do not have any in your wallet already.
3. Run `spacecoin-cli setgenerate true 0`.
You can check to make sure you are staking with `spacecoin-cli getgenerate`. [(Guide)](Check-If-You-Are-Staking.md)
|
a5c5ff2b-fe8a-4704-a6b2-34e916c34d11 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-17 04:53:56", "repo_name": "wscJayasooriya/Textile-Management-System", "sub_path": "/LOOPER-Common/src/lk/ijse/LOOPER_gentsWear/dto/GRNDetailsDTO.java", "file_name": "GRNDetailsDTO.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "3cb3f49d65ac34252a1492fbcf41c3b1830f61a9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wscJayasooriya/Textile-Management-System | 282 | FILENAME: GRNDetailsDTO.java | 0.283781 | /*
* 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 lk.ijse.LOOPER_gentsWear.dto;
/**
*
* @author Sandun_CJ
*/
public class GRNDetailsDTO extends SuperDTO{
private ItemDTO itemDTO;
private GRNDTO grndto;
public GRNDetailsDTO() {
}
public GRNDetailsDTO(ItemDTO itemDTO, GRNDTO grndto) {
this.itemDTO = itemDTO;
this.grndto = grndto;
}
/**
* @return the itemDTO
*/
public ItemDTO getItemDTO() {
return itemDTO;
}
/**
* @param itemDTO the itemDTO to set
*/
public void setItemDTO(ItemDTO itemDTO) {
this.itemDTO = itemDTO;
}
/**
* @return the grndto
*/
public GRNDTO getGrndto() {
return grndto;
}
/**
* @param grndto the grndto to set
*/
public void setGrndto(GRNDTO grndto) {
this.grndto = grndto;
}
}
|
41e7922b-60f8-4ef1-8860-a66301e2fdff | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-21 18:45:16", "repo_name": "npathai/tic-tac-toe-kata", "sub_path": "/src/main/java/org/npathai/tictactoe/GameState.java", "file_name": "GameState.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "9cac7191e2dbfb5304507509e0575a6f1e9cf3f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/npathai/tic-tac-toe-kata | 214 | FILENAME: GameState.java | 0.285372 | package org.npathai.tictactoe;
public class GameState {
private final char[][] board;
private final Player currentPlayer;
private final Player nextPlayer;
private final Player winnerPlayer;
private final boolean isOver;
public GameState(char[][] board, Player currentPlayer, Player nextPlayer, Player winnerPlayer) {
this(board, currentPlayer, nextPlayer, winnerPlayer, false);
}
public GameState(char[][] board, Player currentPlayer, Player nextPlayer, Player winnerPlayer, boolean isOver) {
this.board = board;
this.currentPlayer = currentPlayer;
this.nextPlayer = nextPlayer;
this.winnerPlayer = winnerPlayer;
this.isOver = isOver;
}
public Player currentPlayer() {
return nextPlayer;
}
public Player lastPlayer() {
return currentPlayer;
}
public char[][] board() {
return board;
}
public Player winnerPlayer() {
return winnerPlayer;
}
public boolean isOver() {
return isOver;
}
}
|
8173188d-a040-4cfd-af99-ee164ea7656d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-03 13:10:02", "repo_name": "ekyrych/Homeworks", "sub_path": "/task10_IO_NIO/src/com/company/task7/NIOClient.java", "file_name": "NIOClient.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "4895ba892e4a8723adae9c7f2ba994200de09b10", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ekyrych/Homeworks | 212 | FILENAME: NIOClient.java | 0.255344 | package com.company.task7;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.util.ArrayList;
import java.util.List;
public class NIOClient {
public static void main(String[] args) throws IOException, InterruptedException {
InetSocketAddress addr = new InetSocketAddress("localhost", 7777);
SocketChannel client = SocketChannel.open(addr);
List<String> messages = new ArrayList<>();
messages.add("mean");
messages.add("nmea");
messages.add("eman");
messages.add("mane");
messages.add("name");
for (String message : messages) {
byte[] messageBytes = new String(message).getBytes();
ByteBuffer buffer = ByteBuffer.wrap(messageBytes);
client.write(buffer);
client.read(buffer);
String response = new String(buffer.array()).trim();
System.out.println("response=" + response);
buffer.clear();
Thread.sleep(2000);
}
client.close();
}
}
|
57f1f27f-143b-4dd8-9ffb-f917fe45a5c3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-25 06:23:30", "repo_name": "zuyunbo/blogs", "sub_path": "/boke-main/src/main/java/com/boke/main/ex/UEditorController.java", "file_name": "UEditorController.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "80b6fccbcd24551566da0b64dd74163969693c4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zuyunbo/blogs | 180 | FILENAME: UEditorController.java | 0.214691 | package com.boke.main.ex;
import com.boke.main.ueditor.ActionEnter;
import org.json.JSONException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Created by ldb on 2017/4/9.
*/
@Controller
@RequestMapping("ueditor")
public class UEditorController {
@RequestMapping("/index")
private String showPage() {
return "index";
}
@RequestMapping(value = "/exec")
public ResponseEntity config(HttpServletRequest request, HttpServletResponse response) throws JSONException {
response.setContentType("application/json");
String rootPath = request.getSession().getServletContext().getRealPath("/");
String exec = new ActionEnter(request, rootPath).exec();
return new ResponseEntity(exec, HttpStatus.OK);
}
}
|
049fef17-057d-404c-9734-84c5b1bb8242 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-01 08:42:23", "repo_name": "ttytt1978/gimbridge", "sub_path": "/src/main/java/com/maincontroller/ImageController.java", "file_name": "ImageController.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "931b78d9ad81fd6d0e446a6b65441f0c5620a402", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ttytt1978/gimbridge | 199 | FILENAME: ImageController.java | 0.253861 | package com.maincontroller;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@RestController
@RequestMapping("/")
public class ImageController {
@RequestMapping(value = "/getImage",produces = MediaType.IMAGE_JPEG_VALUE)
@ResponseBody
public byte[] getImage() throws IOException {
File file = new File("c:/bg.jpg");
FileInputStream inputStream = new FileInputStream(file);
byte[] bytes = new byte[inputStream.available()];
inputStream.read(bytes, 0, inputStream.available());
return bytes;
}
@RequestMapping(value = "/Image",produces = MediaType.IMAGE_JPEG_VALUE)
@ResponseBody
public BufferedImage getImage1() throws IOException {
return ImageIO.read(new FileInputStream(new File("c:/bg.jpg")));
}
}
|
d5cac004-bb9c-4723-843f-b3304e70b972 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-21 09:17:56", "repo_name": "Ayushmorankar/Question-Answer-Platform", "sub_path": "/src/main/java/com/example/ayush/questionanswerplatform/models/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "c04abcf625461c1c367ac2e4b24e486abe0ea573", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Ayushmorankar/Question-Answer-Platform | 198 | FILENAME: User.java | 0.26971 | package com.example.ayush.questionanswerplatform.models;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.persistence.*;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Data
@Entity
@JsonIdentityInfo(
generator = ObjectIdGenerators.PropertyGenerator.class,
property = "id")
@ToString(exclude = {"likedQuestions", "likedAnswers"})
@EqualsAndHashCode(exclude = {"likedQuestions", "likedAnswers"})
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToMany(mappedBy = "likedBy", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private Set<Question> likedQuestions = new HashSet<>();
@ManyToMany(mappedBy = "likedBy", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private Set<Answer> likedAnswers = new HashSet<>();
}
|
5e51c6e5-8ec9-4e4f-a3be-8977f439911d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-01-09T11:51:16", "repo_name": "billwiliams/FinProject", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1022, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "4dfa4585746df9f89d85c99b30fb3155baa46092", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/billwiliams/FinProject | 212 | FILENAME: README.md | 0.258326 | # FinProject
##Proximity Marketting Using Bluetooth Low Energy(BLE) beacons
This android application uses Estimote Beacons to determine relative distance between the smartphone and the beacon. Depending on the Distance
Different Actions are triggered
###Login
A user can opt to log on or skip the login on application start. The login is available for facebook only and upon login the user details arecaptured which
are used for personalized advertising
###Parse
using parse users shopping lists are synchronized to the cloud and it enables using push notifications to alert users of neew promotions and products
###Attributes
user attrinutes such as when they entered a store and item search is stored in a webserver hosted by namecheap.com
###Services
presence of speak to a specialist feature allows a user to request a specialist based on where he/she is currently located in the store
###Cart
users can add items to the cart and view prices for the items in the navigation drawer
Bill Williams 2015 Proxisys Ltd
|
7632c731-9679-437b-bccf-93b8d19ca224 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-11 10:40:22", "repo_name": "ginald-tkb/TwitterFeeds", "sub_path": "/src/main/java/com/company/models/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "b6241765144ef226f6c56ad0b62e5c201d1483cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ginald-tkb/TwitterFeeds | 235 | FILENAME: User.java | 0.276691 | package com.company.models;
import java.util.ArrayList;
import java.util.List;
/**
* Created by tshiamo on 2019/03/09.
*/
public class User implements Comparable<User> {
private String name;
/** All tweets by this user and the user's followers*/
private List<Tweet> tweets;
private List<User> followers;
public User(String name) {
this.name = name;
this.tweets = new ArrayList<>();
this.followers = new ArrayList<>();
}
public String getName() {
return name;
}
public List<Tweet> getTweets() {
return tweets;
}
public void addTweet(Tweet tweet) {
tweets.add(tweet);
}
public void addFollower(User follower) {
this.followers.add(follower);
}
public List<User> getFollowers() {
return followers;
}
@Override
public int compareTo(User u) {
if (getName() == null || u.getName() == null) {
return 0;
}
return getName().compareTo(u.getName());
}
}
|
b5346dfc-c376-4d20-9f10-b7cc9215714c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-15 17:05:41", "repo_name": "ShriLingam23/dms", "sub_path": "/app/src/main/java/com/mad/dms/salesRep/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "7b57ec568b4986e7ba353c7024cc9bbd03b64bc5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ShriLingam23/dms | 236 | FILENAME: User.java | 0.216012 | package com.mad.dms.salesRep;
public class User {
private String fullname;
private String email;
private String phoneNo;
private String password;
public User() {
}
public User(String fullname, String email, String phoneNo, String password) {
this.fullname = fullname;
this.email = email;
this.phoneNo = phoneNo;
this.password = password;
}
public User(String email,String password) {
this.email = email;
this.password = password;
}
public String getFullname() {
return fullname;
}
public void setFullname(String fullname) {
this.fullname = fullname;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhoneNo() {
return phoneNo;
}
public void setPhoneNo(String phoneNo) {
this.phoneNo = phoneNo;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
|
08a2d030-01f8-4716-9b46-07652855d97f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-22 22:33:01", "repo_name": "abarson/PA-Google-API", "sub_path": "/gactions-sample/src/main/java/com/frogermcs/gactions/api/request/RawInput.java", "file_name": "RawInput.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "b0145890131a85eab39d8c6f4fecccea2a9ccc79", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/abarson/PA-Google-API | 298 | FILENAME: RawInput.java | 0.267408 | package com.frogermcs.gactions.api.request;
/**
* Created by froger_mcs on 17/01/2017.
*/
public class RawInput {
public Time create_time;
public String query;
public InputType input_type;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RawInput rawInput = (RawInput) o;
if (create_time != null ? !create_time.equals(rawInput.create_time) : rawInput.create_time != null)
return false;
if (query != null ? !query.equals(rawInput.query) : rawInput.query != null) return false;
return input_type == rawInput.input_type;
}
@Override
public int hashCode() {
int result = create_time != null ? create_time.hashCode() : 0;
result = 31 * result + (query != null ? query.hashCode() : 0);
result = 31 * result + (input_type != null ? input_type.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "RawInput{" +
"create_time=" + create_time +
", query='" + query + '\'' +
", input_type=" + input_type +
'}';
}
}
|
f247b700-121d-49bf-94bc-e14ed4810637 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2022-09-29T07:42:22", "repo_name": "carlohamalainen/carlohamalainen.github.io", "sub_path": "/_posts/2009-09-15-crackle-in-audio-ubuntu-8-049-04-fix.md", "file_name": "2009-09-15-crackle-in-audio-ubuntu-8-049-04-fix.md", "file_ext": "md", "file_size_in_byte": 1091, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "a5a0abe8b9c6e350e321258d6a5bf0e833f71691", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/carlohamalainen/carlohamalainen.github.io | 413 | FILENAME: 2009-09-15-crackle-in-audio-ubuntu-8-049-04-fix.md | 0.233706 | ---
id: 739
title: Crackle in audio (Ubuntu 8.04/9.04) fix
date: 2009-09-15T00:00:00+00:00
author: Carlo Hamalainen
layout: post
guid: http://carlo-hamalainen.net/2009/09/15/crackle-in-audio-ubuntu-8-049-04-fix/
permalink: /2009/09/15/crackle-in-audio-ubuntu-8-049-04-fix/
restapi_import_id:
- 596a05ef0330b
original_post_id:
- "16"
categories:
- Uncategorized
format: image
---
The left audio channel on my work computer crackled badly. Ubuntu 8.04. Soundcard info from lspci:
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
Remove ``snd_hda_intel``:
$ sudo modprobe -r snd_hda_intel
FATAL: Module snd_hda_intel is in use.
$ sudo lsof /dev/snd/* | grep mixer
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
mixer_app 9593 carlo 20u CHR 116,0 11357 /dev/snd/controlC0
$ kill -9 (pid of mixer_app)
The fix: load with ``position_fix`` and ``model`` parameters.
$ sudo modprobe snd-hda-intel position_fix=1 model=3stack
Then use alsamixer to turn up and unmute main/pcm/etc.
|
47a0e3c3-c2b1-46ac-aaf4-5b89d95cca92 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-31T06:19:50", "repo_name": "buildkite/docs", "sub_path": "/pages/agent/v3/prioritization.md", "file_name": "prioritization.md", "file_ext": "md", "file_size_in_byte": 1054, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "c96dca9294d32e33159d83894dfc37b849513cea", "star_events_count": 41, "fork_events_count": 277, "src_encoding": "UTF-8"} | https://github.com/buildkite/docs | 237 | FILENAME: prioritization.md | 0.273574 | ---
toc: false
---
# Buildkite Agent prioritization
By setting an Agent's priority value you determine when it gets assigned build jobs compared to other agents.
Agents with a higher value priority number are assigned work first, with the last priority being given to Agents with the default value of `null`.
To set an Agent's priority you can set it in the configuration file:
```
priority=9
```
or with the `--priority` command line flag:
```
buildkite-agent start --priority 9
```
or with the `BUILDKITE_AGENT_PRIORITY` an environment variable:
```
env BUILDKITE_AGENT_PRIORITY=9 buildkite-agent start
```
## Load balancing
You can use the Agent priority value to load balance jobs across machines running multiple Agents.
For example if you have 2 machines with 3 Agents on each machine, you would set one Agent on each machine to `priority=3`, one on each to `priority=2`, and one on each to `priority=1`.
Buildkite will then automatically load balance the jobs across machines, as it will assign jobs to the high priority agents first.
|
5f29c655-d8f5-4321-a900-98a67b8f2f99 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-21 23:34:14", "repo_name": "qiuchili/ggnn_graph_classification", "sub_path": "/program_data/JavaProgramData/78/446.java", "file_name": "446.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 71, "lang": "en", "doc_type": "code", "blob_id": "d594a0236a4c1c17bf62233635199dc0026e966f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/qiuchili/ggnn_graph_classification | 440 | FILENAME: 446.java | 0.29584 | package <missing>;
public class GlobalMembers
{
public static int Main()
{
char[][] c = new char[10][10];
int sum1 = 0;
int sum2 = 0;
int sum3 = 0;
int i = 0;
int j = 0;
int k = 0;
int p = 0;
int a = 0;
int m = 0;
for (i = 1;i <= 5;i++)
{
c[i][2] = ' ';
}
for (i = 1;i <= 5;i++)
{
for (j = 1;j <= 5;j++)
{
if (i == j)
{
continue;
}
for (k = 1;k <= 5;k++)
{
if (i == k || j == k)
{
continue;
}
for (p = 1;p <= 5;p++)
{
if (i == p || j == p || k == p)
{
continue;
}
sum1 = (i + j == k + p);
sum2 = (i + p > j + k);
sum3 = (i + k < j);
if (sum1 + sum2 + sum3 == 3)
{
c[i][2] = 'z';
c[j][2] = 'q';
c[k][2] = 's';
c[p][2] = 'l';
}
}
}
}
}
for (m = 5;m >= 1;m--)
{
if (c[m][2] != ' ')
{
a = 10 * m;
System.out.print(c[m][2]);
System.out.print(" ");
System.out.print(a);
System.out.print("\n");
}
}
return 0;
}
}
|
cc5974ce-236c-41cc-b0bc-d3094cda390d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-13 06:24:28", "repo_name": "rohitkatiyar/cccmixology", "sub_path": "/webProject/src/connection/JdbcConnection.java", "file_name": "JdbcConnection.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "ca72f505e646b8ecddea9a65c56acf26233edfdb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rohitkatiyar/cccmixology | 244 | FILENAME: JdbcConnection.java | 0.289372 | package connection;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class JdbcConnection {
public static Connection getConnection() {
Connection connection = null;
try {
String url = "jdbc:mysql://127.0.0.1:3306/computerCooking?user=root&password=password";
Class.forName("com.mysql.jdbc.Driver");
connection = DriverManager.getConnection(url);
} catch(SQLException e) {
e.printStackTrace();
} catch(ClassNotFoundException e) {
e.printStackTrace();
}
return connection;
}
public static void main(String[] args) {
Connection conn = null;
try {
conn = JdbcConnection.getConnection();
System.out.println(conn);
String query = "Select * from ingredients where name='white rum';";
conn = JdbcConnection.getConnection();
PreparedStatement prepStmt = conn.prepareStatement(query);
ResultSet rs = prepStmt.executeQuery();
while(rs.next()) {
System.out.println(rs.getInt("ingId"));
}
}catch(Exception e) {
e.printStackTrace();
}
}
}
|
e458d0ab-96b0-46b7-a53f-04a4e1a1710c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-22 08:45:21", "repo_name": "wiLLLL23/ApiRestSpringBoot", "sub_path": "/api/src/main/java/com/example/api/serviceImpl/CarServiceImpl.java", "file_name": "CarServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "f0a9341be9257a60cccb3d76713fccb804fd2f20", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wiLLLL23/ApiRestSpringBoot | 221 | FILENAME: CarServiceImpl.java | 0.282988 | package com.example.api.serviceImpl;
import com.example.api.entity.Car;
import com.example.api.repository.CarRepo;
import com.example.api.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class CarServiceImpl implements CarService {
@Autowired
CarRepo carRepo;
@Override
public Iterable<Car> listAll() {
return carRepo.findAll();
}
@Override
public Optional<Car> listById(Long id) {
return carRepo.findById(id);
}
@Override
public Car saveCar(Car car) {
return carRepo.save(car);
}
@Override
public void deleteCar(Car car) {
carRepo.delete(car);
}
@Override
public void deleteAllCar(Iterable<Car> cars) {
carRepo.deleteAll(cars);
}
@Override
public List<Car> saveAllCars(List<Car> cars) {
return carRepo.saveAll(cars);
}
}
|
7e1a1c36-6008-41ee-9641-33cd9f535d38 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-25 05:03:08", "repo_name": "anthonymlortiz/MDP", "sub_path": "/Action.java", "file_name": "Action.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "1d78e98239a4ffc9ff543eb71aa132111df3fcea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/anthonymlortiz/MDP | 216 | FILENAME: Action.java | 0.268941 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mdp;
import java.util.ArrayList;
/**
*
* @author Anthony Ortiz && Jerry Uranga
*/
public class Action {
//ArrayList<Transition> transitions;
int index;
String actionCode;
/*public Action(Transition goalState) {
transitions = new ArrayList<Transition>();
transitions.add(goalState);
}
*/
public Action(int index) {
this.index = index;
if(index == 0)
actionCode = "P";
else if(index == 1)
actionCode = "R";
else
actionCode = "S";
}
public Action(int index, String actionCode) {
this.index = index;
this.actionCode = actionCode;
}
/*
public void addTransition(Transition goalState) {
transitions.add(goalState);
}
*/
}
|
4c19cc14-a4ef-4635-a62c-ee87581167b0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-23 00:58:33", "repo_name": "chengjiamei/BleConnect", "sub_path": "/BLEConnect/app/src/main/java/roc/cjm/bleconnect/bles/BleLeScanCallback.java", "file_name": "BleLeScanCallback.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "0cb6f60ca120ae52083553d2668804a107d0949e", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/chengjiamei/BleConnect | 235 | FILENAME: BleLeScanCallback.java | 0.291787 | package roc.cjm.bleconnect.bles;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.util.Log;
import java.util.Calendar;
/**
* Created by Carmy Cheng on 2017/8/23.
*
*/
public class BleLeScanCallback implements BluetoothAdapter.LeScanCallback {
private String TAG = "BleLeScanCallback";
private OnLeScanCallback mScanCallback;
public BleLeScanCallback() {
}
@Override
public void onLeScan(BluetoothDevice bluetoothDevice, int rssi, byte[] scanRecord) {
Log.e(TAG, "onLeScan");
ScanResult result = new ScanResult(bluetoothDevice,ScanRecord.parseFromBytes(scanRecord), rssi, Calendar.getInstance().getTimeInMillis());
if(mScanCallback != null) {
mScanCallback.onScanResult(result);
}
}
public void setScanCallback(OnLeScanCallback mScanCallback) {
this.mScanCallback = mScanCallback;
}
interface OnLeScanCallback {
void onScanResult(ScanResult result);
}
}
|
f25a04a8-a31c-4c29-bc2c-7e470b2f1cb9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-06-02 07:04:52", "repo_name": "mizool/mizool", "sub_path": "/core/src/main/java/com/github/mizool/core/validation/CheckDatabaseIdentifier.java", "file_name": "CheckDatabaseIdentifier.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "6a15f9cd6070d216b0aa1d57202d7a593b2b75c3", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/mizool/mizool | 199 | FILENAME: CheckDatabaseIdentifier.java | 0.272799 | package com.github.mizool.core.validation;
import java.util.regex.Pattern;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
public class CheckDatabaseIdentifier implements ConstraintValidator<DatabaseIdentifier, Object>
{
private static final Pattern PATTERN = Pattern.compile("[a-zA-Z]\\w*");
private boolean mandatory;
@Override
public void initialize(DatabaseIdentifier identifier)
{
mandatory = identifier.mandatory();
}
@Override
public boolean isValid(Object validationObject, ConstraintValidatorContext constraintValidatorContext)
{
return ConstraintValidators.isValid(validationObject, mandatory, this::isValidValue);
}
private boolean isValidValue(Object validationObject)
{
boolean valid = false;
if (validationObject instanceof String)
{
String validationString = (String) validationObject;
valid = PATTERN.matcher(validationString)
.matches() && validationString.length() <= 48;
}
return valid;
}
}
|
5d589324-ab48-4d9d-87f2-44e0fb096990 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-23 15:07:59", "repo_name": "carbage/RuneMate-API", "sub_path": "/darkapi/webwalker/web/loader/util/LoaderThread.java", "file_name": "LoaderThread.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "1386d80827798c9f50a50ad95d821c5fa0ff502d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/carbage/RuneMate-API | 217 | FILENAME: LoaderThread.java | 0.272025 | package darkapi.webwalker.web.loader.util;
import darkapi.webwalker.web.Web;
import darkapi.webwalker.web.loader.AbstractWebLoader;
public final class LoaderThread extends Thread {
private final AbstractWebLoader loader;
private final String[] set;
private final Web web;
private int index;
private int length;
private final int start;
private final int end;
public LoaderThread(AbstractWebLoader loader, String[] set, Web web, int start, int end) {
this.loader = loader;
this.web = web;
this.set = set;
this.start = start;
this.end = end;
this.length = start - end;
}
public final void run() {
loader.log(index + " " + start + " " + end);
for (index = start; index <= end; index++) {
loader.parseLine(set[index]);
}
}
public final int getIndex() {
return index;
}
public final int getLength() {
return length;
}
}
|
52a08332-2df6-43b1-a451-22c8175617ee | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-10 20:33:06", "repo_name": "GurekamSidhu/RecipeSearch", "sub_path": "/app/src/main/java/com/example/recipesearch/network/QueryResponse.java", "file_name": "QueryResponse.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "f0013b3076d9b049d8cfeeb6d2a1d0da5fc11d0b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/GurekamSidhu/RecipeSearch | 221 | FILENAME: QueryResponse.java | 0.253861 | package com.example.recipesearch.network;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class QueryResponse {
/**
* Response from spoonacular server when searching for recipes with keywords
*/
@SerializedName("offset")
int offset;
@SerializedName("number")
int number;
@SerializedName("results")
List<RetroRecipe> recipeList;
@SerializedName("totalResults")
int totalResults;
@SerializedName("baseUri")
String baseUri;
public List<RetroRecipe> getRecipeList() {
return recipeList;
}
// Object for a detailed query reponse, used in retrofit calls
public QueryResponse (
int offset, int number, List<RetroRecipe>recipeList,
int totalResults, String baseUri)
{
this.number = number;
this.offset = offset;
this.recipeList = recipeList;
this.totalResults = totalResults;
this.baseUri = baseUri;
}
public String getBaseURI() {
return baseUri;
}
}
|
e813c0c3-d0bb-4893-b902-fa22389de193 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-17 03:47:52", "repo_name": "busyFox/bak", "sub_path": "/engine-server-ws/src/main/java/com/gotogames/bridge/engineserver/request/QueueTestRemoveOldest.java", "file_name": "QueueTestRemoveOldest.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 24, "lang": "en", "doc_type": "code", "blob_id": "a4f125c1726a735005c3c758d64c3edde76c24bf", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/busyFox/bak | 215 | FILENAME: QueueTestRemoveOldest.java | 0.272799 | package com.gotogames.bridge.engineserver.request;
import com.gotogames.bridge.engineserver.common.ContextManager;
import com.gotogames.bridge.engineserver.common.EngineConfiguration;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class QueueTestRemoveOldest implements Job {
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
QueueMgr queueMgr = ContextManager.getQueueMgr();
if (!queueMgr.taskRemoveOldestTestRunning && EngineConfiguration.getInstance().getIntValue("user.engineForTest.taskRemoveOldestEnable", 1) == 1) {
queueMgr.taskRemoveOldestTestRunning = true;
try {
queueMgr.removeOldestTestQueueDataList();
} catch (Exception e) {
queueMgr.getLog().error("QueueTestRemoveOldest - exception to removeOldestTestQueueDataList", e);
}
queueMgr.taskRemoveOldestTestRunning = false;
}
}
}
|
e39b803b-2ad2-444c-a08f-25b839a6446a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-12-18 20:44:54", "repo_name": "Gemei/PushUpsCounter", "sub_path": "/src/com/exotics/pushupscounter/Logs.java", "file_name": "Logs.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "8ce561fc92e3cf3c72a61752769adb0f29ea8d0a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Gemei/PushUpsCounter | 196 | FILENAME: Logs.java | 0.233706 | package com.exotics.pushupscounter;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.MenuItem;
public class Logs extends SherlockActivity {
private StorageManager myManager = new StorageManager();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_logs);
// ActionBar
getSupportActionBar().setBackgroundDrawable(
new ColorDrawable(Color.GRAY));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
TextView readHistory = (TextView) findViewById(R.id.Logs);
readHistory.append(myManager.getLogs(getApplicationContext()));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
break;
default:
return super.onOptionsItemSelected(item);
}
return true;
}
}
|
36e9ead9-9fe5-4ab7-b1a9-ad2d514997e0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-23 18:55:18", "repo_name": "saralein/java-server", "sub_path": "/server/src/test/java/com/saralein/server/mocks/MockIO.java", "file_name": "MockIO.java", "file_ext": "java", "file_size_in_byte": 1005, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "213ad09dcb548b9f19e0af4863e3902fd7bb5952", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/saralein/java-server | 211 | FILENAME: MockIO.java | 0.235108 | package com.saralein.server.mocks;
import com.saralein.server.filesystem.IO;
import java.io.IOException;
import java.nio.file.Path;
public class MockIO implements IO {
private final byte[] response;
private Path readPath;
private Path writePath;
private String writeContent;
public MockIO(byte[] response) {
this.response = response;
this.readPath = null;
this.writePath = null;
this.writeContent = null;
}
@Override
public byte[] readAllBytes(Path path) throws IOException {
readPath = path;
return response;
}
@Override
public void write(Path path, String content) throws IOException {
writePath = path;
writeContent = content;
}
public boolean readCalledWithPath(Path path) {
return path.equals(readPath);
}
public boolean writeCalledWith(Path path, String content) {
return path.equals(writePath)
&& content.equals(writeContent);
}
}
|
e0faacbf-a891-440d-a775-ad78a80ea8b8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-01-17 09:36:37", "repo_name": "caprice/sissi", "sub_path": "/src/main/java/com/sissi/protocol/iq/bytestreams/Streamhost.java", "file_name": "Streamhost.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "42f51d974cbf7640e3a3d3fcf72f06f561dc9f54", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/caprice/sissi | 271 | FILENAME: Streamhost.java | 0.226784 | package com.sissi.protocol.iq.bytestreams;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import com.sissi.read.MappingMetadata;
/**
* @author kim 2013年12月18日
*/
@MappingMetadata(uri = Bytestreams.XMLNS, localName = Streamhost.NAME)
@XmlRootElement
public class Streamhost {
public final static String NAME = "streamhost";
private String jid;
private String host;
private String port;
public Streamhost() {
}
public Streamhost(String jid, String host, String port) {
super();
this.jid = jid;
this.host = host;
this.port = port;
}
public Streamhost setJid(String jid) {
this.jid = jid;
return this;
}
public Streamhost setHost(String host) {
this.host = host;
return this;
}
public Streamhost setPort(String port) {
this.port = port;
return this;
}
@XmlAttribute
public String getJid() {
return jid;
}
@XmlAttribute
public String getHost() {
return host;
}
@XmlAttribute
public String getPort() {
return port;
}
}
|
cee48588-e1dd-4376-81aa-4e36943deb8b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-14 09:52:56", "repo_name": "YashinSergey/Material_design", "sub_path": "/app/src/main/java/com/example/materialdesign/SnackbarActivity.java", "file_name": "SnackbarActivity.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "630b9926e60eaa5e301888fbeeae28690ec4de7f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/YashinSergey/Material_design | 184 | FILENAME: SnackbarActivity.java | 0.224055 | package com.example.materialdesign;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.snackbar.Snackbar;
public class SnackbarActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_snackbar);
Button button = findViewById(R.id.snackbar_call_button);
button.setOnClickListener(clickListener);
}
private View.OnClickListener clickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
final Snackbar snackbar = Snackbar.make(v, "Snackbar test", Snackbar.LENGTH_INDEFINITE);
snackbar.setAction("Close", new View.OnClickListener() {
@Override
public void onClick(View v) {
snackbar.dismiss();
}
});
snackbar.show();
}
};
}
|
7c3d7d9b-fafe-4bfe-843e-9b3884be80fc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-08 06:52:30", "repo_name": "urgenmagger/JavaSandbox", "sub_path": "/JavaSandbox/tracker/Item.java", "file_name": "Item.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 65, "lang": "en", "doc_type": "code", "blob_id": "466e45f049dfe1ef94e694ab3d8bb6722837fd68", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/urgenmagger/JavaSandbox | 252 | FILENAME: Item.java | 0.279828 | package ru.job4j.tracker;
/**
* Item class tracker.
*
* @author Megger
* @version $Id$
* @since 0.1
*/
public class Item {
/**
* id - id.
*/
private String id;
/**
* name - name.
*/
private String name;
/**
* created - created.
*/
private Long created;
/**
* users constructor.
*
* @param id - specification.
* @param name - qualification.
* @param created - group.
*/
public Item(String id, String name, Long created) {
this.id = id;
this.name = name;
this.created = created;
}
/**
* @return id.
*/
public String getId() {
return id;
}
/**
* @param id - id.
*/
public void setId(String id) {
this.id = id;
}
/**
* @return getName.
*/
public String getName() {
return name;
}
/**
* @return getCreated.
*/
public Long getCreated() {
return created;
}
}
|
9e06723d-706b-408d-8611-d46e1762a7cf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-21 23:34:14", "repo_name": "qiuchili/ggnn_graph_classification", "sub_path": "/program_data/JavaProgramData/20/217.java", "file_name": "217.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "3e40d77bd819f651a9f22238a0a1193e041369e3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/qiuchili/ggnn_graph_classification | 361 | FILENAME: 217.java | 0.286169 | package <missing>;
public class GlobalMembers
{
public static int Main()
{
String a = new String(new char[100]);
char c;
String str = new String(new char[100]);
String substr = new String(new char[100]);
char x;
int i;
int j;
int k;
int s;
int t;
while (gets(a))
{
for (i = 0;(c = a.charAt(i)) != ' ';i++)
{
str = tangible.StringFunctions.changeCharacter(str, i, a.charAt(i));
}
s = i + 1;
k = 0;
for (j = s;(c = a.charAt(j)) != '\0';j++)
{
substr = tangible.StringFunctions.changeCharacter(substr, k, a.charAt(j));
k++;
}
x = str.charAt(0);
for (i = 0;i < s - 1;i++)
{
if (str.charAt(i) > x)
{
t = i + 1;
x = str.charAt(i);
}
}
for (i = 0;i < t;i++)
{
System.out.printf("%c",str.charAt(i));
}
for (j = 0;j < 3;j++)
{
System.out.printf("%c",substr.charAt(j));
}
for (i = t;i < s - 1;i++)
{
System.out.printf("%c",str.charAt(i));
}
System.out.print("\n");
}
return 0;
}
}
|
580fa385-1c5a-49c0-8d90-8e754128b5cb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-18 06:33:59", "repo_name": "agkee/Java-Programming", "sub_path": "/Problems/first.java", "file_name": "first.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "c4de9ccbb03eed301bdf767913f472519bd0c422", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/agkee/Java-Programming | 249 | FILENAME: first.java | 0.264358 |
public class first{
public static class ListNode{
int val;
ListNode next;
ListNode(int a){
val = a;
}
}
public static ListNode findmid(ListNode head){
// The pointer used to disconnect the left half from the mid node.
ListNode slowPtr = head;
ListNode fastPtr = head;
ListNode prevPtr = slowPtr;
prevPtr = new ListNode(1212);
while(prevPtr != null){
System.out.println("prev = " + prevPtr.next.val);
prevPtr = prevPtr.next;
}
while(slowPtr != null){
System.out.println("slow = " + slowPtr.next.val);
slowPtr = slowPtr.next;
}
return slowPtr;
}
public static void main(String[] args) {
ListNode b = new ListNode(1);
b.next = new ListNode(2);
b.next.next = new ListNode(3);
b.next.next.next = new ListNode(4);
b.next.next.next.next = new ListNode(5);
b.next.next.next.next.next = new ListNode(6);
findmid(b);
}
} |
a1ea1549-3169-43e1-ad54-62ea30157462 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-28 06:51:16", "repo_name": "ufjf-dcc196/2019-1-dcc196-exr01-raihlima", "sub_path": "/Exercicio01/app/src/main/java/com/example/exercicio01/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "d4f0d106745c4a9fc08deda876b3562368d46cdb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ufjf-dcc196/2019-1-dcc196-exr01-raihlima | 197 | FILENAME: MainActivity.java | 0.233706 | package com.example.exercicio01;
import android.annotation.SuppressLint;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
EditText nome;
EditText sobrenome;
EditText nomeCompleto;
Button gerarNome;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
nome = (EditText) findViewById(R.id.nome_usuario);
sobrenome = (EditText) findViewById(R.id.sobrenome_usuario);
nomeCompleto = (EditText) findViewById(R.id.nome_completo);
gerarNome = (Button) findViewById(R.id.botao_nome);
gerarNome.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
nomeCompleto.setText(nome.getText()+" "+sobrenome.getText());
}
});
}
}
|
01d5a617-8cff-4081-bda8-2325ab252f95 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-09-22T15:39:24", "repo_name": "jhart99/hugo-resume-medline", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1028, "line_count": 18, "lang": "en", "doc_type": "text", "blob_id": "dd20e44b260664df39603bd85b4e8a5a5ae18d13", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jhart99/hugo-resume-medline | 234 | FILENAME: README.md | 0.199308 | # hugo-resume-medline
This script takes a medline result file and converts the results into the markdown format used by [hugo-resume](https://github.com/eddiewebb/hugo-resume). The medline results can be produced using [PubMed](https://pubmed.ncbi.nlm.nih.gov/) and choosing the save the results as "PubMed" format. The results can also be taken from [SciENcv](https://www.ncbi.nlm.nih.gov/sciencv/) if you have already used that tool to generate an NIH biosketch for grant submission.
## Usage
### Prerequisites
* Python >3.7
* Biopython
### Command line
To generate templates for your publications download the Medline format results file and run the script on the results as shown:
python3 parser.py medline.txt
This will generate a markdown file for each of your publications in a format suitable for further manual refinement. The Tags are left unset because PubMed sets a *lot* of tags per publication.
To use these publications with hugo-resume, just copy the results to your content/publications directory.
|
0e5f210b-3032-4630-9337-6cf652ad1746 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-18 12:16:58", "repo_name": "xaoo90/Zoo", "sub_path": "/System/ZooSystemFX/src/run/MainWindow.java", "file_name": "MainWindow.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "1a31be7291a71a9634deb994ebdf4b4ee0e530a6", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/xaoo90/Zoo | 200 | FILENAME: MainWindow.java | 0.2227 | /*
* 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 run;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
*
* @author Xaoo
*/
public class MainWindow extends Application {
@Override
public void start(Stage stage) throws Exception {
mainWindow();
}
public void mainWindow() throws IOException {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("/run/MainWindowFXML.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root);
Stage stage = new Stage();
stage.setTitle("Zoo System");
stage.setScene(scene);
stage.setResizable(false);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
|
87a47c5e-0c31-4fdc-a2fe-b6a7aa553a16 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-06 17:07:45", "repo_name": "AlexRefery/gahelp", "sub_path": "/src/main/java/io/khasang/gahelp/service/imol/BirdServiceImpl.java", "file_name": "BirdServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "87cd57f640fedf64360cc841612b2fa448d0b6c4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AlexRefery/gahelp | 249 | FILENAME: BirdServiceImpl.java | 0.272025 | package io.khasang.gahelp.service.imol;
import io.khasang.gahelp.dao.BirdDao;
import io.khasang.gahelp.entity.Bird;
import io.khasang.gahelp.service.BirdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("birdService")
public class BirdServiceImpl implements BirdService {
private BirdDao birdDao;
@Override
public Bird add(Bird bird) {
return birdDao.add(bird);
}
@Override
public Bird getById(long id) {
return birdDao.getById(id);
}
@Override
public List<Bird> getAll() {
return birdDao.getAll();
}
@Override
public Bird deleteById(long id) {
return birdDao.delete(getById(id));
}
@Override
public Bird updateById(long id, Bird bird) {
if(getById(id) != null){
bird.setId(id);
}
return birdDao.update(bird);
}
@Autowired
public void setBirdDao(BirdDao birdDao) {
this.birdDao = birdDao;
}
}
|
20700be0-e1eb-4853-ac86-04d3b02e1c7c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-23 17:43:52", "repo_name": "razor54/DAW-Checklist-Manager", "sub_path": "/spring_server/src/main/java/group1/spring_server/domain/resource/ChecklistItemResource.java", "file_name": "ChecklistItemResource.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "e129eb78f8003e88ed49246105efc9ddc8f6af29", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/razor54/DAW-Checklist-Manager | 198 | FILENAME: ChecklistItemResource.java | 0.249447 | package group1.spring_server.domain.resource;
import group1.spring_server.control.ServiceController;
import group1.spring_server.domain.model.ChecklistItem;
import group1.spring_server.exceptions.MyException;
import org.springframework.hateoas.ResourceSupport;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
public class ChecklistItemResource extends ResourceSupport {
private final ChecklistItem checklistItem;
public ChecklistItemResource(final ChecklistItem checklistItem) throws MyException {
this.checklistItem = checklistItem;
add(linkTo(methodOn(ServiceController.class)
.getChecklistItem(checklistItem.getId(), null))
.withSelfRel());
add(linkTo(methodOn(ServiceController.class)
.getCheckList(checklistItem.getlist_id(), null))
.withRel("parent"));
}
public ChecklistItem getChecklistItem() {
return checklistItem;
}
} |
9f0d2827-37ea-4a64-a7d0-decb1d0316b0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-09-16T05:04:23", "repo_name": "stormynico/StormyIdleBoost", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1072, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "08a3a401777c5c758f52720b31880cd00b300b86", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/stormynico/StormyIdleBoost | 260 | FILENAME: README.md | 0.226784 | # StormyIdleBoost
Set up ur accounts 24/7 Online & In-game even your pc close.
# Terms of service
-
# FAQ
-
# Will VAC Dectected This? Can I get banned for this?
- No, VAC doesn't detect this. this is not so dll cheat. Source are from Python.
- In order to answer that question, we should take a closer look at Steam ToS. Steam doesn't prohibit using of multiple accounts, in fact, it allows it implying that you can use same mobile authenticator on more than one account. What it however doesn't allow is sharing accounts with other people, but we're not doing that here.
# Can Farming Trading Cards and Playtimes?
- Of course Yes
# Can I choose which games should be idled?
- Yes. Remember, use Notepad++ to easily change your Steam App ID. This only the way.
# Is SIB very similar to Idle Master?
- I take sources from orignal idle boost then made in Python.
# Server Disconnected!, My idle got error to continue.
- If your account was error, thats means you created account from https://accgen.cathook.club/. Or Maybe your accounts was disabled by Valve.
|
6f308801-7ccd-4267-bd89-30384fa147a0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-02-07T19:38:04", "repo_name": "CodaCrop/hiwim", "sub_path": "/sass/components/toast/_toast.md", "file_name": "_toast.md", "file_ext": "md", "file_size_in_byte": 1119, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "d09dc6cde85d015e87a62fffd9110d033a9de9d7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CodaCrop/hiwim | 219 | FILENAME: _toast.md | 0.272025 | ---
title: Toast
---
## Toast
<button type="button" class="button-primary" onClick='TMNL.Toast.message({"position": "bottom", "backdrop": true, "content": "<h3>This is a toast</h3><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae ornare urna.</p>"})'>Show toast</button>
```javascript
TMNL.Toast.message({
"position": "bottom",
"backdrop": true,
"content": "<h3>This is a toast</h3>"
});
```
| Option | Default | Description |
| ---------------------- | ------------ | ----------------------------------------------------------------------- |
| position | `'top'` | Position of the toast (top/bottom/left/right/right-start/right-end) |
| backdrop | `false` | Show backdrop |
| content | `''` | Content of the toast as an HTML string |
| fullscreen | `false` | Toast container takes the full height of the window |
|
cb0672eb-dcd2-4734-93f0-b59fc37dfbc0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-19T16:22:17", "repo_name": "jntingyu/sadasen-search", "sub_path": "/src/main/java/com/sadasen/search/modules/post/entity/Post.java", "file_name": "Post.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 65, "lang": "en", "doc_type": "code", "blob_id": "ec9fbc880eea4fcfa543b378022dbf478fc7e7b1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jntingyu/sadasen-search | 266 | FILENAME: Post.java | 0.246533 | package com.sadasen.search.modules.post.entity;
import org.beetl.sql.core.annotatoin.Table;
import com.fasterxml.jackson.annotation.JsonView;
import com.sadasen.search.base.BaseEntity;
/**
* @date 2018年8月16日
* @author lei.ys
* @addr home
* @desc
*/
@Table(name="t_post")
public class Post extends BaseEntity {
private static final long serialVersionUID = 4080756678140689827L;
public interface Index{};
@JsonView(Index.class)
private long id;
private long userId;
@JsonView(Index.class)
private String title;
@JsonView(Index.class)
private String content;
public Post() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
|
351518a0-5414-44e9-8ebc-2138b7c6733d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-23 18:58:42", "repo_name": "alenkasob/forum", "sub_path": "/forum/src/main/java/com/frm/dao/entity/UserEntity.java", "file_name": "UserEntity.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "b4269b40e2f6c0b581d184e1b75919ff2fe4e698", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/alenkasob/forum | 235 | FILENAME: UserEntity.java | 0.250913 | package com.frm.dao.entity;
import com.frm.utils.enums.UserType;
import javax.persistence.*;
import java.io.Serializable;
@Entity
@Table(name = "frm_users")
public class UserEntity implements Serializable {
@Id
private String id;
@Column(name = "name")
private String name;
@Column(name = "pass")
private String pass;
@Column(name = "role")
@Enumerated(EnumType.STRING)
private UserType role;
public String getId() {
return id;
}
public UserEntity setId(String id) {
this.id = id;
return this;
}
public String getName() {
return name;
}
public UserEntity setName(String name) {
this.name = name;
return this;
}
public String getPass() {
return pass;
}
public UserEntity setPass(String pass) {
this.pass = pass;
return this;
}
public UserType getRole() {
return role;
}
public UserEntity setRole(UserType role) {
this.role = role;
return this;
}
} |
dec4d66e-078a-4426-a4fa-ed5583977ac8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-16 21:32:08", "repo_name": "riki89/mpp", "sub_path": "/src/orderTracking/ACustomer.java", "file_name": "ACustomer.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 77, "lang": "en", "doc_type": "code", "blob_id": "50fb62079833bfdaf670cb963913c72bb0524e4c", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/riki89/mpp | 255 | FILENAME: ACustomer.java | 0.275909 | package orderTracking;
import java.util.ArrayList;
import java.util.List;
public abstract class ACustomer implements ICustomer{
private String name;
private String adress;
private String phone;
private double points;
private List<Order> orders;
public ACustomer(String name, String adress, String phone, double price) {
super();
this.name = name;
this.adress = adress;
this.phone = phone;
this.points = price;
this.orders = new ArrayList<Order>();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAdress() {
return adress;
}
public void setAdress(String adress) {
this.adress = adress;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public double getPoints() {
return points;
}
public void setPoints(double price) {
this.points = price;
}
public List<Order> getOrders() {
return orders;
}
public void addOrder(Order order) {
this.orders.add(order);
}
@Override
public abstract String getCreditRating();
}
|
2d8e42a0-5370-488b-9d23-a4dc349151f7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-24 10:37:14", "repo_name": "AladdinKevin/rbac", "sub_path": "/src/main/java/com/turnsole/rbac/exception/ParamException.java", "file_name": "ParamException.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "2e1c1cb1c41d85a754e853d38896ace5d7095d30", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AladdinKevin/rbac | 251 | FILENAME: ParamException.java | 0.240775 | package com.turnsole.rbac.exception;
import org.apache.ibatis.executor.ErrorContext;
/**
* @author:徐凯
* @date:2019/8/1,17:31
* @what I say:just look,do not be be
*/
public class ParamException extends RuntimeException {
private static final long serialVersionUID = 6958499248468627021L;
/**错误码*/
private String errorCode;
/**错误上下文*/
private ErrorContext errorContext;
public ParamException(String errorCode, String errorMsg){
super(errorMsg);
this.errorCode = errorCode;
}
public ParamException(RBACExceptionEnum rbacExceptionEnum){
super(rbacExceptionEnum.getErrorMsg());
this.errorCode = rbacExceptionEnum.getErrorCode();
}
public ParamException(String errorCode, String errorMsg, Throwable throwable){
super(errorMsg, throwable);
this.errorCode = errorCode;
}
public ParamException(RBACExceptionEnum rbacExceptionEnum, Throwable throwable){
super(rbacExceptionEnum.getErrorMsg(), throwable);
this.errorCode = rbacExceptionEnum.getErrorCode();
}
}
|
e62fc793-d4e1-4502-b6ae-ad676e568b27 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-11 18:38:07", "repo_name": "MKDenys/TrackEnsureTest", "sub_path": "/app/src/main/java/com/example/trackensuretest/utils/InternetStatusChangeReceiver.java", "file_name": "InternetStatusChangeReceiver.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "78ea7ce882399f854af236c389e2ab6dd5ac3e19", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MKDenys/TrackEnsureTest | 169 | FILENAME: InternetStatusChangeReceiver.java | 0.240775 | package com.example.trackensuretest.utils;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import com.example.trackensuretest.Constants;
import com.example.trackensuretest.services.SyncDBService;
public class InternetStatusChangeReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
intent.setClass(context, SyncDBService.class);
intent.putExtra(Constants.IS_NETWORK_CONNECTED_KEY, isConnected(context));
context.startService(intent);
}
public boolean isConnected(Context context) {
ConnectivityManager connectivityManager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
return networkInfo != null && networkInfo.isAvailable() && networkInfo.isConnected();
}
}
|
9681dffe-61e5-4008-9e94-39b8f8a892f9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-01 18:46:40", "repo_name": "Belfegor8625/ShoppingList-App", "sub_path": "/app/src/main/java/com/bartoszlewandowski/shoppinglist/registration/SignUpAndLoginActivity.java", "file_name": "SignUpAndLoginActivity.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "ec68a3192072e7e016909c07b98006507814f54b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Belfegor8625/ShoppingList-App | 206 | FILENAME: SignUpAndLoginActivity.java | 0.226784 | package com.bartoszlewandowski.shoppinglist.registration;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import com.bartoszlewandowski.shoppinglist.R;
import com.bartoszlewandowski.shoppinglist.registration.adapters.TabAdapter;
import butterknife.BindView;
import butterknife.ButterKnife;
public class SignUpAndLoginActivity extends AppCompatActivity {
@BindView(R.id.sign_up_or_log_in_toolbar)
Toolbar toolbar;
@BindView(R.id.viewPager)
ViewPager viewPager;
@BindView(R.id.tabLayout)
TabLayout tabLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_up_and_login);
ButterKnife.bind(this);
setSupportActionBar(toolbar);
TabAdapter tabAdapter = new TabAdapter(getSupportFragmentManager());
viewPager.setAdapter(tabAdapter);
tabLayout.setupWithViewPager(viewPager);
}
}
|
05f09e16-afdb-42c2-bd21-689d9fe78f03 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-03 22:08:47", "repo_name": "Juik/TestWeb", "sub_path": "/src/com/pb/entity/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "773aae18b1021e559690d7fd09ff56ffd31bddde", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Juik/TestWeb | 218 | FILENAME: User.java | 0.23092 | package com.pb.entity;
public class User {
private int id;
private String userName;
private String userPassword;
private String authority;
public User() {
userName = "";
userPassword = "";
authority = "";
}
public User(int inputID, String inputUserName, String inputUserPassword,
String inputAuthority) {
this.id = inputID;
this.userName = inputUserName;
this.userPassword = inputUserPassword;
this.authority = inputAuthority;
}
public String getAuthority() {
return authority;
}
public void setAuthority(String authority) {
this.authority = authority;
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPassword() {
return userPassword;
}
public void setUserPassword(String userPassword) {
this.userPassword = userPassword;
}
}
|
2d462f0e-d91c-485c-8a0e-741cc577699d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-08-21T05:37:06", "repo_name": "BreakthrougBackEndTech/Aboo", "sub_path": "/springCloud/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1596, "line_count": 72, "lang": "zh", "doc_type": "text", "blob_id": "303a72b1d29c15fdbd4de4ce33292c849ef4e108", "star_events_count": 1, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/BreakthrougBackEndTech/Aboo | 440 | FILENAME: README.md | 0.282988 | 
### config-server
统一的配置服务,所有服务默认都会读取application.yml里面的配置,然后每个服务读取和自己服务名一样的配置
### regist-server
服务发现eureka
服务分区 region 和zone https://segmentfault.com/a/1190000014107639
https://www.cnblogs.com/ldws/p/12379994.html
一个机房内的服务优先调用同一个机房内的服务,当同一个机房的服务不可用的时候,
再去调用其它机房的服务,以达到减少延时的作用
### recommend-web
推荐系统前端界面
#### Done
```task
spring security授权
Feign 服务调用,熔断,降级
csrf 解决方法, jwt
```
#### Todo
```task
mybatis 分页
重构前端统一提交token js
添加movie-service
```
### user-service
用户服务
#### Done
```task
swagger集成 http://localhost:port/swagger-ui.html
mybatis注解
```
#### Todo
### admin-server
可以监控健康状态, 线程, 性能等
#### Todo
```task
认证
```
### zuul-server
统一的网关
http://localhost:5555/user-service/loadUserByUsername/luffy
请求统一在header添加correlation id
#### Todo
```
AB测试时使用
```
### zipkin-server
```
http://localhost:9411/zipkin
调用跟踪 生产环境需要将Sampler.ALWAYS_SAMPLE 去掉, 设置为百分比
官方版本https://search.maven.org/remote_content?g=io.zipkin&a=zipkin-server&v=LATEST&c=exec
```
还有两种链路跟踪的
zipkin,pinpoint和skywalking
### log-server
统一日志管理
#### Todo
ELK
### movie-service
电影服务
微信公众号

|
47ca0314-7ca9-4f67-b90a-d137c27dbf2a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-20 12:46:52", "repo_name": "GXMUHATE/Android-app-with-firebase-database", "sub_path": "/app/src/main/java/com/gracane/synecoculture/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "7f1a1578cc3996277b1f7844ff980354803c0266", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/GXMUHATE/Android-app-with-firebase-database | 167 | FILENAME: MainActivity.java | 0.194368 | package com.gracane.synecoculture;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
public class MainActivity extends AppCompatActivity {
FloatingActionButton fabNewUpload;
FloatingActionButton fabSeeUploads;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
fabNewUpload = findViewById(R.id.fabNewUpload);
fabSeeUploads = findViewById(R.id.fabSeeUploads);
fabNewUpload.setOnClickListener(v -> {
Intent intent = new Intent(this, UploadImageActivity.class);
startActivity(intent);
});
fabSeeUploads.setOnClickListener(v -> {
Intent intent = new Intent(this, ImagesActivity.class);
startActivity(intent);
});
}
} |
ef8639bf-63e2-4807-9baf-46b18a3aa34a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-21 19:29:07", "repo_name": "faisal-hameed/advance-spring-app", "sub_path": "/src/main/java/pk/habsoft/demo/estore/db/entity/PermissionEntity.java", "file_name": "PermissionEntity.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "984976c910b7786be2464842d1d391adbd59b2df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/faisal-hameed/advance-spring-app | 212 | FILENAME: PermissionEntity.java | 0.240775 | package pk.habsoft.demo.estore.db.entity;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Table(name = "permissions")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class PermissionEntity {
/*
* Id will be provided.
*/
@Id
private Long id;
@NotNull
@Column(name = "code", unique = true)
private String code;
@NotNull
@Column(name = "label")
private String label;
@NotNull
@Column(name = "menu_path")
private String menuPath;
@ManyToMany(mappedBy = "permissions")
private List<RoleEntity> roles;
@Override
public String toString() {
return "PermissionEntity [id=" + id + ", code=" + code + ", label=" + label + ", menuPath=" + menuPath + "]";
}
}
|
391dc180-41a9-42da-849c-ce5bbf90fcc7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-24 03:05:44", "repo_name": "davilav/Ekaa", "sub_path": "/app/src/main/java/com/pma/ekaa/data/models/Modality.java", "file_name": "Modality.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "147e5bd7bc17d4c6d65848ab6c575ab53934e2c5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/davilav/Ekaa | 221 | FILENAME: Modality.java | 0.199308 | package com.pma.ekaa.data.models;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Modality {
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("name")
@Expose
private String name;
@SerializedName("color")
@Expose
private String color;
@SerializedName("modality_type")
@Expose
private Integer modalityType;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public Integer getModalityType() {
return modalityType;
}
public void setModalityType(Integer modalityType) {
this.modalityType = modalityType;
}
}
|
3e9f36a1-2181-4bbd-81de-63a629a6b1fe | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-06-09T16:50:39", "repo_name": "aaronats/jsmidi-examples", "sub_path": "/electronic/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1033, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "e6a7bcae5b9384f8c5231055873fbc953eed2365", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/aaronats/jsmidi-examples | 267 | FILENAME: README.md | 0.243642 | ## JSMidi Examples: 10 Part Electronic
This is a simple 10 part electronic song using Logic Pro X software instruments
without any modifications made. See the instrument list below and the screenshot
for the levels I used. Also please read the documentation on
[multi track setup](https://github.com/aaronats/jsmidi/blob/master/docs/LOGIC.md#multitrack).
Here is the [track on SoundCloud](https://soundcloud.com/aaron-strachan-704055056/jsmidi-examples-electronic).
#### Usage
To use this yourself just clone the jsmidi-examples repo, navigate to the `electronic`
folder and run `npm install`. Open the project in Atom, setup your project in Logic
and you should be good to go.
#### Tracks
1. Electronic Pop: `Electronic Drum Kit -> Electronic Pop`
2. Ambient Lead: `Lead -> Ambient Lead`
3. Classic Pad: `Classics -> Classic Pad`
4. String Bells: `Bells -> String Bells`
5. Fast Pad: `Pad -> Fast Pad`
6. Micro Pulse: `Classics -> Micro Pulse`
7. Floating Plasma: `Pad -> Floating Plasma`
<img src="docs/logic-tracks.png" />
|
18332e36-c2af-4cf6-ab7d-ce1aa0fb9062 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-02 13:18:40", "repo_name": "sandeepgondal/SpringPrograms", "sub_path": "/src/main/java/com/sandy/spring/di/beanconfig/annotationconfig/Address.java", "file_name": "Address.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "5ce41886b22cd79ea738a47c504f0b69f2c76195", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sandeepgondal/SpringPrograms | 247 | FILENAME: Address.java | 0.236516 | package com.sandy.spring.di.beanconfig.annotationconfig;
import org.springframework.stereotype.Component;
@Component
public class Address {
private String city;
private String state;
private int pin;
public Address() {
this.city = "Pune";
this.state = "Maharashtra";
this.pin = 411058;
}
public Address(final String city, final String state, final int pin) {
this.city = city;
this.state = state;
this.pin = pin;
}
public String getCity() {
return city;
}
public void setCity(final String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(final String state) {
this.state = state;
}
public int getPin() {
return pin;
}
public void setPin(final int pin) {
this.pin = pin;
}
@Override
public String toString() {
return "Address{" +
"city='" + city + '\'' +
", state='" + state + '\'' +
", pin=" + pin +
'}';
}
}
|
339c412a-3de2-488e-b6c5-eb1aa87427f2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-01 12:34:40", "repo_name": "Ddd1101/CXShop_Mall", "sub_path": "/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/SeckillController.java", "file_name": "SeckillController.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "6e8f843b5ed89f0ae3493a7f28e913760707b0b5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Ddd1101/CXShop_Mall | 229 | FILENAME: SeckillController.java | 0.201813 | package com.wayn.mobile.api.controller;
import com.wayn.common.base.controller.BaseController;
import com.wayn.common.util.R;
import com.wayn.mobile.api.service.ISeckillService;
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;
/**
* <p>
* 秒杀库存表 前端控制器
* </p>
*
* @author wayn
* @since 2020-08-04
*/
@RestController
@RequestMapping("seckill")
public class SeckillController extends BaseController {
@Autowired
private ISeckillService iSeckillService;
@GetMapping("update")
public R update(Long id) {
return iSeckillService.updateSec(id);
}
@GetMapping("update1")
public R update1(Long id) {
return iSeckillService.updateSec1(id);
}
@GetMapping("update2")
public R update2(Long id) {
return iSeckillService.updateSec2(id);
}
}
|
02842fb3-2800-4b42-8751-b0cafd83dd61 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-01 02:50:30", "repo_name": "senjoeson/CordovaHelp", "sub_path": "/src/application/utils/LogUtils.java", "file_name": "LogUtils.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "e757395f667d16236395057bc720a5e3d0602119", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/senjoeson/CordovaHelp | 254 | FILENAME: LogUtils.java | 0.26588 | package application.utils;
import java.io.File;
import java.nio.charset.Charset;
/**
* @author MyPC
* @date 2018/7/18
* @function 主要用作日志收集
*/
public class LogUtils {
private static final boolean isLogShow = true;
private static String LOG_FILE = System.getProperty("user.dir") + File.separator + "logFile.log";
public static void d(String message) {
if (isLogShow) {
System.out.println(addErrorInfo(message));
}
writeLog(addErrorInfo(message) + "\n");
}
private static String addErrorInfo(String message) {
String location = "";
StackTraceElement[] stacks = Thread.currentThread().getStackTrace();
location = String.format("[%s]\t[Method:%s]\t[LineNumber:%d]\t: ", stacks[2].getClassName(), stacks[2].getMethodName(), stacks[2].getLineNumber());
return location + " " + message;
}
public static void writeLog(String message) {
File file = new File(LOG_FILE);
WriteUtils.writeFile(file, message, file.exists() && file.length() > 0);
}
}
|
c8be81fa-3165-4e98-9b73-f9be47ced71c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-06-02 13:21:04", "repo_name": "Baeldung/reddit-app", "sub_path": "/reddit-common/src/main/java/org/baeldung/web/metric/MetricFilter.java", "file_name": "MetricFilter.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "6d4d6e9aa171826bdce3146147f19cc19dfb6ce9", "star_events_count": 86, "fork_events_count": 61, "src_encoding": "UTF-8"} | https://github.com/Baeldung/reddit-app | 210 | FILENAME: MetricFilter.java | 0.285372 | package org.baeldung.web.metric;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class MetricFilter implements Filter {
@Autowired
private IMetricService metricService;
@Override
public void init(final FilterConfig config) throws ServletException {
}
@Override
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws java.io.IOException, ServletException {
final HttpServletRequest httpRequest = ((HttpServletRequest) request);
final String req = httpRequest.getMethod() + " " + httpRequest.getRequestURI();
chain.doFilter(request, response);
final int status = ((HttpServletResponse) response).getStatus();
metricService.increaseCount(req, status);
}
@Override
public void destroy() {
}
}
|
2837bee5-382b-41c5-b92a-45df2748d8c0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-11-08T15:42:56", "repo_name": "quyenjd/Cryptocurrency-Graph-Tracer", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1026, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "987f22cded5203d9ec15762d9d578360ef180a38", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/quyenjd/Cryptocurrency-Graph-Tracer | 248 | FILENAME: README.md | 0.208179 | # Cryptocurrency Graph Tracer (2017)
A black screen version of cryptocurrency graph used for tracing prices. It also has an alarm at which you can set the price for going off.
Powered by [Bitfinex](www.bitfinex.com) and [30rates](30rates.com).
## Installation
1. Download the source.
2. Compile the `cpp` files (with linkers from `linker.txt`).
3. Copy your alarm ringtone to the folder where `launcher.exe` is put and rename it to `default.mp3`.
## How to use
You just need to read and follow the instructions from the program carefully. Believe me, it's very easy to use.
## Changelog
Initial release (on Github).
The project was abandoned.
## Cons
- Shortcut has bugs. If you run multiple programs at once, shortcut is triggered on every program.
- Graph rendering is not optimized.
- The project is **not** up to date so everything won't work as expected on the long run.
- qEngine is not available.
## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. |
2fb80928-aa47-4519-8521-b1deb3a0d995 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-12-02 12:41:45", "repo_name": "gleywsonribeiro/Retaguarda", "sub_path": "/src/java/beans/PesquisaController.java", "file_name": "PesquisaController.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "20fb2c28f0975d1d027e44b7df3b7cf4e9f9f0d6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gleywsonribeiro/Retaguarda | 202 | FILENAME: PesquisaController.java | 0.236516 | /*
* 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 beans;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import modelo.Paciente;
/**
*
* @author gleywson
*/
@ManagedBean(name = "pesquisa")
@RequestScoped
public class PesquisaController {
@PersistenceContext(unitName = "TestePU")
private EntityManager em;
public PesquisaController() {
}
public EntityManager getEntityManager() {
return em;
}
public void setEntityManager(EntityManager em) {
this.em = em;
}
List<Paciente> buscaPacientes(String nome) {
Query query = getEntityManager().createQuery(nome);
return query.getResultList();
}
}
|
4090a5fb-11da-4579-8c99-c7ff21e5b2f8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-08 22:11:15", "repo_name": "MarcelaRivera2000/ProyectoProgra2", "sub_path": "/src/proyectoprogra/pkg2/UsuarioSockets.java", "file_name": "UsuarioSockets.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "82fe7c9922328bb0c2d4c6a4fb763d0d0cc7b8eb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MarcelaRivera2000/ProyectoProgra2 | 210 | FILENAME: UsuarioSockets.java | 0.245085 | /*
* 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 proyectoprogra.pkg2;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
public class UsuarioSockets extends ConexionSockets {
public UsuarioSockets() throws IOException {
super("cliente");
}
public void startClient(String Usuario, String NumCuenta, String tipo, double dineroAcutal, double dineroGastado) {
String datos = Usuario + "," + NumCuenta + "," + tipo + "," + dineroAcutal + "," + dineroGastado;
System.out.println(datos);
try {
salidaServidor = new DataOutputStream(cs.getOutputStream());
entradaServidor = new DataInputStream(cs.getInputStream());
salidaServidor.writeUTF(datos);
cs.close();
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
|
0fe131b8-97fe-445b-a134-bd2fd89bb64e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-20 18:08:59", "repo_name": "ChatCamp/ChatCamp-Android-Example", "sub_path": "/app/src/main/java/io/chatcamp/app/ChatCampAppFirebaseInstanceIDService.java", "file_name": "ChatCampAppFirebaseInstanceIDService.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "a97189edf17cc7914f2b625c7b3bd7e4b85e4951", "star_events_count": 4, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/ChatCamp/ChatCamp-Android-Example | 229 | FILENAME: ChatCampAppFirebaseInstanceIDService.java | 0.285372 | package io.chatcamp.app;
import com.google.firebase.iid.FirebaseInstanceIdService;
import com.google.firebase.iid.FirebaseInstanceId;
import android.util.Log;
import io.chatcamp.sdk.ChatCamp;
import io.chatcamp.sdk.ChatCampException;
import io.chatcamp.sdk.User;
/**
* Created by ChatCamp Team on 07/12/17.
*/
public class ChatCampAppFirebaseInstanceIDService extends FirebaseInstanceIdService {
@Override
public void onTokenRefresh() {
// Get updated InstanceID token.
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
Log.d("CHATCAMP APP", "Refreshed token: " + refreshedToken);
if(FirebaseInstanceId.getInstance().getToken() != null && ChatCamp.getConnectionState() == ChatCamp.ConnectionState.OPEN) {
ChatCamp.updateUserPushToken(FirebaseInstanceId.getInstance().getToken(), new ChatCamp.UserPushTokenUpdateListener() {
@Override
public void onUpdated(User user, ChatCampException e) {
Log.d("CHATCAMP_APP", "PUSH TOKEN REGISTERED");
}
});
}
}
}
|
e4eb14d0-9455-4588-a5f7-50a8d753a0ec | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-22 06:32:15", "repo_name": "bradchao/FSIT07_JavaEE", "sub_path": "/Brad/src/tw/brad/javaee/Brad03.java", "file_name": "Brad03.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "fd86ab6e01c0df0428108a1846fdf922cd40755e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bradchao/FSIT07_JavaEE | 208 | FILENAME: Brad03.java | 0.243642 | package tw.brad.javaee;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/Brad03")
public class Brad03 extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
String account = request.getParameter("account");
String passwd = request.getParameter("passwd");
String gender = request.getParameter("gender");
//String like = request.getParameter("like");
String area = request.getParameter("area");
String memo = request.getParameter("memo");
System.out.println(account + ":" + passwd
+ ":" + gender + ":" + area + ":" + memo);
String[] likes = request.getParameterValues("like");
if (likes != null) {
for (String like : likes) {
System.out.println(like);
}
}
}
}
|
016ddb19-d0bd-48d1-96c7-d620f7926f1a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-11 23:41:09", "repo_name": "yavuzkavus/java-commons", "sub_path": "/src/main/java/com/readjournal/db/DbWrapper.java", "file_name": "DbWrapper.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "7e936e5d9197e9dd20aa5c3ac5cbe342c8ce025f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yavuzkavus/java-commons | 263 | FILENAME: DbWrapper.java | 0.295027 | package com.readjournal.db;
import java.util.Date;
import com.readjournal.db.DbPool.PDB;
import com.readjournal.util.DateUtil;
public class DbWrapper {
private PDB db;
private Date lastAccessTime;
private Date borrowTime;
private boolean locked;
private boolean reapable;
public DbWrapper(DB db) {
this.db = (PDB)db;
syncValues();
}
public void syncValues() {
this.lastAccessTime = db.getLastAccessTime();
this.borrowTime = db.getBorrowTime();
this.locked = db.isLocked();
this.reapable = db.isReapable();
}
public DB getDb() {
return db;
}
public int getId() {
return db.getId();
}
public boolean isLocked() {
return locked;
}
public boolean isReapable() {
return reapable;
}
public Date getLastAccessTime() {
return lastAccessTime;
}
public long getBorrowDuration() {
return Math.max(0, locked ? System.currentTimeMillis() - borrowTime.getTime() : 0);
}
public String getFormattedBorrowDuration() {
return locked ? DateUtil.formatDuration( System.currentTimeMillis() - borrowTime.getTime() ) : null;
}
}
|
dc55cc47-5a14-4773-915c-91a13cfe5fb3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-08 03:28:38", "repo_name": "wangye1987/HeheDrink", "sub_path": "/BusinesMove/businessDrinkApp/src/main/java/com/heheys/ec/controller/receiver/AppRegister.java", "file_name": "AppRegister.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "afc27cd7a23389dcdccda35697177b8a99815b79", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wangye1987/HeheDrink | 243 | FILENAME: AppRegister.java | 0.277473 | package com.heheys.ec.controller.receiver;
import com.alibaba.wireless.security.jaq.JAQException;
import com.alibaba.wireless.security.jaq.SecurityCipher;
import com.alibaba.wireless.security.jaq.SecurityInit;
import com.heheys.ec.utils.ConstantsUtil;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.WXAPIFactory;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class AppRegister extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
final IWXAPI msgApi = WXAPIFactory.createWXAPI(context, null);
try {
if(SecurityInit.Initialize(context) == 0){
SecurityCipher securityCipher = new SecurityCipher(context);
String wx_later_wx = securityCipher.decryptString(ConstantsUtil.APP_ID,ConstantsUtil.JAQ_KEY);
msgApi.registerApp(wx_later_wx);
}else{
msgApi.registerApp(ConstantsUtil.APP_ID_WX);
}
} catch (JAQException e) {
msgApi.registerApp(ConstantsUtil.APP_ID_WX);
e.printStackTrace();
}
}
}
|
d26f2aa0-8e63-4e48-b640-c61a5023eec7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-09-21T18:02:00", "repo_name": "hourliert/generator-jspm-angular", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1286, "line_count": 54, "lang": "en", "doc_type": "text", "blob_id": "309de6bab586cfdbdcd5b5f74da2667d55883caa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hourliert/generator-jspm-angular | 323 | FILENAME: README.md | 0.26588 | # generator-jspm-angular [](https://travis-ci.org/hourliert/generator-jspm-angular)
## Getting Started
### Install
```bash
npm install -g yo generator-jspm-angular
yo jspm-angular
```
### Structure
The scaffolded project has this structure:
```
.
├── .editorconfig
├── .gitignore
├── .vscode
│ └── settings.json
├── LICENSE
├── README.md
├── app
│ ├── all.d.ts
│ ├── greeter
│ │ ├── greeter-ctrl.spec.ts
│ │ ├── greeter-ctrl.ts
│ │ └── greeter.ts
│ └── main.ts
├── gulpfile.js
├── index.html
├── jspm.config.js
├── karma.conf.js
├── package.json
├── tsconfig.json
├── tsd.json
└── tslint.json
```
### Gulp tasks
* `default` cleans the project, install type definition files and build a production ready version in `./dist`.
* `serve` launches a dev server with hot reloading. Runs TypeScript Linter each time a .ts file has changed.
* `serve:dist` builds and serves the production version.
* `typedoc` generates the project documentation.
### Tests
Run `npm test` to launch karma an run unit tests.
## License
MIT
|
02bd3c8e-372e-429a-9ea2-b16dbaf852cd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-26 11:48:46", "repo_name": "2842902295/2842902295", "sub_path": "/status/src/com/company/service/impl/StudentServiceImpl.java", "file_name": "StudentServiceImpl.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "300e9f0c9f4e4a9f8b8feb7953c5e46a8076ec4c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/2842902295/2842902295 | 204 | FILENAME: StudentServiceImpl.java | 0.288569 | package com.company.service.impl;
import com.company.dao.StudentDao;
import com.company.dao.impl.StudentDaoImpl;
import com.company.pojo.Student;
import com.company.service.StudentService;
import java.util.List;
/**
* @Description:
* @Data:Created in 17:04 2/26
* @Modified By:
*/
public class StudentServiceImpl implements StudentService {
private StudentDao studentDao=new StudentDaoImpl();
@Override
public void addStudent(Student student) {
studentDao.addStudent(student);
}
@Override
public void deleteStudentById(Integer id) {
studentDao.deleteStudentById(id);
}
@Override
public void updateStudent(Student student) {
studentDao.updateStudent(student);
}
@Override
public Student queryStudentById(Integer id) {
return studentDao.queryBookById(id);
}
@Override
public List<Student> queryStudents() {
return studentDao.queryStudent();
}
}
|
c7aad773-732b-4519-b9a0-d35b03597ecb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-26 04:39:19", "repo_name": "fengsha990817/question", "sub_path": "/src/main/java/com/question/service/impl/UserServiceImpl.java", "file_name": "UserServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "6c47d8a6209097e0dbb06a69a9ca0511f7008768", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/fengsha990817/question | 215 | FILENAME: UserServiceImpl.java | 0.279042 | package com.question.service.impl;
import com.question.dao.UserMapper;
import com.question.entity.User;
import com.question.service.UserService;
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;
@Override
public boolean addUser(User user) {
return usermapper.insertSelective(user)>0;
}
@Override
public boolean updateUser(User user) {
return usermapper.updateByPrimaryKeySelective(user)>0;
}
@Override
public User getUserByUsername(String username) {
return usermapper.getUserByUsername(username);
}
@Override
public User getUserById(Integer id) {
return usermapper.selectByPrimaryKey(id);
}
@Override
public List<User> getUserListByPage(User user) {
return usermapper.getUserListByPage(user);
}
@Override
public int countUserList(User user) {
return usermapper.getUserCountByPage(user);
}
}
|
ca997de2-1f06-463f-8bef-121143b919bd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-07-12 05:42:13", "repo_name": "kanimozhimurugan/SplunkModularInputsJavaFramework", "sub_path": "/kinesis/src/com/splunk/modinput/kinesis/AbstractMessageHandler.java", "file_name": "AbstractMessageHandler.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "33280308f0549c1672afd64299b333613d04bd3a", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/kanimozhimurugan/SplunkModularInputsJavaFramework | 243 | FILENAME: AbstractMessageHandler.java | 0.274351 | package com.splunk.modinput.kinesis;
import java.util.Map;
import com.splunk.modinput.SplunkLogEvent;
import com.splunk.modinput.Stream;
import com.splunk.modinput.kinesis.KinesisModularInput.MessageReceiver;
public abstract class AbstractMessageHandler {
public abstract Stream handleMessage(String record,String seqNumber,String partitionKey,MessageReceiver context) throws Exception;
public abstract void setParams(Map<String, String> params);
protected SplunkLogEvent buildCommonEventMessagePart(MessageReceiver context)
throws Exception {
SplunkLogEvent event = new SplunkLogEvent("kinesis_record_received",
"", true, true);
return event;
}
protected String getMessageBody(byte[] messageContents) {
return new String(messageContents);
}
protected String stripNewlines(String input) {
if (input == null) {
return "";
}
char[] chars = input.toCharArray();
for (int i = 0; i < chars.length; i++) {
if (Character.isWhitespace(chars[i])) {
chars[i] = ' ';
}
}
return new String(chars);
}
}
|
9a056b10-7859-4a27-8f3f-18f86dcffa14 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-15 18:19:31", "repo_name": "lukFisz/journal", "sub_path": "/src/main/java/luk/fisz/journal/common/util/mail/MailSenderImpl.java", "file_name": "MailSenderImpl.java", "file_ext": "java", "file_size_in_byte": 1232, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "b0ee34abe43103065cfe563b86fc95e8bf440fd6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lukFisz/journal | 235 | FILENAME: MailSenderImpl.java | 0.275909 | package luk.fisz.journal.common.util.mail;
import luk.fisz.journal.common.definition.mail.MailProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;
@Service
public class MailSenderImpl implements MailSender {
private final Logger logger = LoggerFactory.getLogger(MailSenderImpl.class);
private final MailProperties mailProperties;
private final JavaMailSender mailSender;
public MailSenderImpl(MailProperties mailProperties, JavaMailSender mailSender) {
this.mailProperties = mailProperties;
this.mailSender = mailSender;
}
@Override
public void send(Mail mail) {
SimpleMailMessage message = new SimpleMailMessage();
message.setFrom(mailProperties.SENDER);
message.setTo(mail.getReceiver());
message.setSubject(mail.getSubject());
message.setText(mail.getBody());
mailSender.send(message);
logger.info(
"Email was sent. Receiver: " + mail.getReceiver()
+ " | Event type: " + mail.getEventType()
);
}
}
|
ee2c74b1-45c2-4087-aa39-a701d0189bee | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-09 19:09:04", "repo_name": "Arce2603/MySimpleTweets", "sub_path": "/app/src/main/java/com/codepath/apps/restclienttemplate/models/Tweet.java", "file_name": "Tweet.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "2eb6fe80a39f49058ea7ad1a2f43fb2f1a011fac", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Arce2603/MySimpleTweets | 231 | FILENAME: Tweet.java | 0.276691 | package com.codepath.apps.restclienttemplate.models;
import org.json.JSONException;
import org.json.JSONObject;
import org.parceler.Parcel;
@Parcel
public class Tweet {
//list of attribute
public String body;
public long uid; //database ID for the tweet
public String createdAt;
public User user;
public String retweets;
public String favs;
public int tweetID;
public String handel;
public Tweet() {
}
//deserialized Data
public static Tweet fromJSON(JSONObject jsonObject) throws JSONException{
Tweet tweet = new Tweet();
//extract values from JSON
tweet.body= jsonObject.getString("text");
tweet.uid=jsonObject.getLong("id");
tweet.createdAt = jsonObject.getString("created_at");
tweet.retweets = jsonObject.getString("retweet_count");
tweet.favs=jsonObject.getString("favorite_count");
tweet.user = User.fromJSON(jsonObject.getJSONObject("user"));
tweet.handel= "@"+ tweet.user.screenName;
return tweet;
}
public String getHandel() {
return handel;
}
}
|
ca07c674-17c5-4801-a56d-1286f1927ee8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-06 04:48:53", "repo_name": "omarfaruqe/iText-Java-PDF", "sub_path": "/src/PdfReaderTest.java", "file_name": "PdfReaderTest.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "1f7a1661cd59aab7e913e4d17d944b7075f114ee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/omarfaruqe/iText-Java-PDF | 220 | FILENAME: PdfReaderTest.java | 0.259826 | import com.itextpdf.text.pdf.PdfReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
/**
* Created by faruqe on 05/04/15.
*/
public class PdfReaderTest {
public static void main(String[] args) {
try {
PdfReader reader = new PdfReader(new FileInputStream("OutputPdf.pdf"));
System.out.println("PDF Version: "+reader.getPdfVersion());
System.out.println("Number of pages: "+reader.getNumberOfPages());
System.out.println("File Length: "+reader.getFileLength());
System.out.println("Is it encrypted? "+reader.isEncrypted());
System.out.println("Width of Page 1: "+reader.getPageSize(1).getWidth());
System.out.println("Height of page 1: "+reader.getPageSize(1).getHeight());
System.out.println("Rotaion of Page 1: "+reader.getPageRotation(1));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception exception) {
exception.printStackTrace();
}
}
}
|
11746875-bb50-42c1-b775-499c3f6aa874 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-16 18:02:53", "repo_name": "TristanNeret/Oops", "sub_path": "/Oops-web/src/main/java/com/gdf/validators/ZipCodeValidator.java", "file_name": "ZipCodeValidator.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "7c663f7b34b615a30d0f1c16cbbc3dbe4d6013f9", "star_events_count": 4, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/TristanNeret/Oops | 260 | FILENAME: ZipCodeValidator.java | 0.282988 | package com.gdf.validators;
import com.gdf.singleton.PopulateDB;
import javax.ejb.EJB;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
/**
* Test if the zip code is correct
* @author bibo
*/
@FacesValidator("com.gdf.zipValidator")
public class ZipCodeValidator implements Validator {
private final static String NOT_VALIDE = "Veuillez saisir un code postal valide ! ";
private final static String EMPTY = "Veuillez saisir un code postal ! ";
@EJB
private PopulateDB pdb;
/**
* Creates a new instance of ZipCodeValidator
*/
public ZipCodeValidator() {
}
@Override
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
if (value != null) {
String code = value.toString();
if (code.length() == 5 && pdb.getAllTown(code) == null) {
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, NOT_VALIDE, null));
}
}
}
}
|
e06789eb-296c-4598-bd46-df8c565b76ee | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-18 06:18:41", "repo_name": "minhdat1602/2021_mobile_group17_backend", "sub_path": "/src/main/java/com/nlu/entity/StatusEntity.java", "file_name": "StatusEntity.java", "file_ext": "java", "file_size_in_byte": 1074, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "432bb6bd9752f1ee13239ca9b46b22ac8ce0e63b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/minhdat1602/2021_mobile_group17_backend | 234 | FILENAME: StatusEntity.java | 0.264358 | package com.nlu.entity;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonBackReference;
@Entity
@Table(name = "order_status")
public class StatusEntity extends BaseEntity{
@Column(name = "status_code")
private String code;
@Column(name = "status_name")
private String name;
@Column(name = "active")
private int active;
@JsonBackReference
@OneToMany(mappedBy = "status", targetEntity = OrderEntity.class)
private List<OrderEntity> orders;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getActive() {
return active;
}
public void setActive(int active) {
this.active = active;
}
public List<OrderEntity> getOrders() {
return orders;
}
public void setOrders(List<OrderEntity> orders) {
this.orders = orders;
}
}
|
4528d6c0-a347-4955-9bde-6755ea03fd90 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-27 06:45:59", "repo_name": "d2vfactory/throw-money", "sub_path": "/src/main/java/com/d2vfactory/throwmoney/aspect/EventAspect.java", "file_name": "EventAspect.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "5aed94c7043c5375a266c95a0a31e96f0cc19fb9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/d2vfactory/throw-money | 211 | FILENAME: EventAspect.java | 0.289372 | package com.d2vfactory.throwmoney.aspect;
import com.d2vfactory.throwmoney.domain.event.Event;
import com.d2vfactory.throwmoney.domain.event.repository.EventRepository;
import com.d2vfactory.throwmoney.domain.money.ReceiveMoneyDTO;
import com.d2vfactory.throwmoney.domain.money.ThrowMoneyDTO;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
@Aspect
@Component
public class EventAspect {
private final EventRepository eventRepository;
public EventAspect(EventRepository eventRepository) {
this.eventRepository = eventRepository;
}
@AfterReturning(pointcut = "@annotation(PublishEvent)", returning = "retVal")
public void saveEvent(Object retVal) throws RuntimeException {
if (retVal instanceof ThrowMoneyDTO) {
eventRepository.save(new Event((ThrowMoneyDTO) retVal));
} else if (retVal instanceof ReceiveMoneyDTO) {
eventRepository.save(new Event((ReceiveMoneyDTO) retVal));
}
}
}
|
fe1de6d4-725a-4b16-a465-8cf165ed0218 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-09 10:05:50", "repo_name": "iholen/rpc-based-netty", "sub_path": "/rpc-core/src/main/java/com/heoller/entity/Request.java", "file_name": "Request.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "7e42014aae9d97ca9f1ffc2958730ad492133d4f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/iholen/rpc-based-netty | 276 | FILENAME: Request.java | 0.247987 | package com.heoller.entity;
/**
* 〈一句话功能简述〉
*
* @author 19093070
* @date 2021/1/9 15:59
* @see [相关类/方法](可选)
* @since [产品/模块版本] (可选)
*/
public class Request {
private String clazz;
private String method;
private String arg;
public Request() {
}
public Request(String clazz, String method, String arg) {
this.clazz = clazz;
this.method = method;
this.arg = arg;
}
public String getArg() {
return arg;
}
public void setArg(String arg) {
this.arg = arg;
}
public String getClazz() {
return clazz;
}
public void setClazz(String clazz) {
this.clazz = clazz;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
@Override
public String toString() {
return "Request{" +
"clazz='" + clazz + '\'' +
", method='" + method + '\'' +
", arg='" + arg + '\'' +
'}';
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.