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
80d20844-ba7b-493f-bd95-1572fdf521c7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-21 09:18:22", "repo_name": "Gaddale/qa-test-hf", "sub_path": "/src/test/java/com/hellofresh/challenge/steps/ExistingCustomer.java", "file_name": "ExistingCustomer.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 24, "lang": "en", "doc_type": "code", "blob_id": "f819ea8ecdaa58b987674c55ba2d7cbc945b8a2d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Gaddale/qa-test-hf
201
FILENAME: ExistingCustomer.java
0.258326
package com.hellofresh.challenge.steps; import com.hellofresh.challenge.pages.MyAccountPage; import com.hellofresh.challenge.pages.PageFactory; import cucumber.api.java.en.Then; import org.apache.log4j.Logger; import static org.assertj.core.api.Assertions.assertThat; import static org.apache.log4j.Logger.getLogger; public class ExistingCustomer { private static Logger logger = getLogger(ExistingCustomer.class.getName()); private MyAccountPage myAccountPage = PageFactory.getInstance(MyAccountPage.class); @Then("^user should land on my account page with username \"([^\"]*)\" as header$") public void userShouldLandOnMyAccountPageWithUsernameAsHeader(String userFullName) { assertThat(myAccountPage.getHeaderText()).contains("MY ACCOUNT"); assertThat(myAccountPage.getViewCustomerAccount().getText()).contains(userFullName); logger.info("Existing User: Proper username is shown in the header"); logger.info("Existing User: Log out action is available"); } }
d8f5e999-4c7d-4f00-ba9c-443c5646eeee
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-29 14:02:03", "repo_name": "mercutiy/MambaTest", "sub_path": "/app/src/main/java/ru/mamba/test/mambatest/activity/Anketa.java", "file_name": "Anketa.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "5aef5cf0b0311511640644550b08be9be6bb2f73", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mercutiy/MambaTest
187
FILENAME: Anketa.java
0.220007
package ru.mamba.test.mambatest.activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import ru.mamba.test.mambatest.fragment.AnketaFragment; import ru.mamba.test.mambatest.R; public class Anketa extends AppCompatActivity { public static String EXTRA_ANKETA_ID = "ANKETA_ID"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_anketa); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); int anketaId = getIntent().getIntExtra(EXTRA_ANKETA_ID, 0); AnketaFragment fragment = AnketaFragment.newInstance(anketaId); getSupportFragmentManager() .beginTransaction() .add(R.id.fragment_anketa, fragment) .commit(); } }
3cf8c43a-cb3d-4a2b-8e66-1fd89df1bf46
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-21 21:35:25", "repo_name": "jfspps/SpringAndRabbitMQDemo", "sub_path": "/src/main/java/com/example/rabbitmqandspring/listener/TVConsumer.java", "file_name": "TVConsumer.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "a78f1203c7118000ae2ef9b6edb2ade3ff225d0f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jfspps/SpringAndRabbitMQDemo
201
FILENAME: TVConsumer.java
0.258326
package com.example.rabbitmqandspring.listener; import com.example.rabbitmqandspring.model.Person; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.stereotype.Service; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectInputStream; @Service public class TVConsumer { // @RabbitListener(queues = {"TV-q"}) // public void getMessageTVQ(Person person){ // System.out.println("TV-q message received with person: " + person.getName()); // } @RabbitListener(queues = {"TV-q"}) public void getMessageACQ(byte[] message) throws IOException, ClassNotFoundException { ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(message); ObjectInput objectInput = new ObjectInputStream(byteArrayInputStream); Person person = (Person) objectInput.readObject(); objectInput.close(); byteArrayInputStream.close(); System.out.println("TV-q message received with name: " + person.getName()); } }
7fc946e8-385b-4510-8c49-d6e7a1847814
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-10 03:36:15", "repo_name": "hd-je/web", "sub_path": "/src/main/java/com/web/domain/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "ffebaed9b8a3ebcf339f3bfc68fd225276977ff9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hd-je/web
242
FILENAME: User.java
0.262842
package com.web.domain; import com.web.domain.enums.SocialType; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import javax.persistence.*; import java.io.Serializable; import java.time.LocalDateTime; import java.util.prefs.Preferences; @Getter @NoArgsConstructor @Entity @Table public class User implements Serializable { @Id @Column @GeneratedValue(strategy = GenerationType.IDENTITY) private Long idx; @Column private String name; @Column private String password; @Column private String email; @Column private String principal; @Column @Enumerated(EnumType.STRING) private SocialType socialType; @Column private LocalDateTime createdDate; @Column private LocalDateTime updatedDate; @Builder public User(String name, String password, String email, String principal ,SocialType socialType, LocalDateTime createdDate, LocalDateTime updatedDate){ this.name = name; this.password = password; this.principal = principal; this.email = email; this.socialType = socialType; this.createdDate = createdDate; this.updatedDate = updatedDate; } }
91a3a2d7-6bfc-48e0-b5e2-f0b461c4dd3e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-01 21:28:40", "repo_name": "ErikaFernandes/WeLoveLinux", "sub_path": "/WeLoveLinuxAPI/src/com/erika/welovelinuxapi/command/ExecCommand.java", "file_name": "ExecCommand.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "22fe09900dc7a489c0ab1132123f02c55bf1eb05", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ErikaFernandes/WeLoveLinux
193
FILENAME: ExecCommand.java
0.247987
package com.erika.welovelinuxapi.command; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class ExecCommand { public List<String> executeCommand(String command) throws IOException { List<String> result = new ArrayList<String>(); String line; ProcessBuilder builder = new ProcessBuilder( "/bin/bash", "-c", command); builder.redirectErrorStream(true); Process p = null; try { p = builder.start(); } catch (IOException e) { System.out.println("er " + e); } BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); while (true) { line = r.readLine(); if (line == null) { break; }else{ result.add(line); } System.out.println(line); } return result; } }
b3abb74d-7a2f-4694-b5fd-0ef1782be08a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-26 11:42:34", "repo_name": "lakshmiswetha98/javaproject", "sub_path": "/mavenweb-jdbc/src/main/java/com/cts/training/mavenweb/services/StudentServiceImpl.java", "file_name": "StudentServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "2bf1aab180176b9068e91f79ba595a6e61b63b7d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lakshmiswetha98/javaproject
189
FILENAME: StudentServiceImpl.java
0.277473
package com.cts.training.mavenweb.services; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; import com.cts.training.mavenweb.dao.IStudentDao; import com.cts.training.mavenweb.entity.Student; @Service public class StudentServiceImpl implements IStudentService { @Autowired private IStudentDao studentDao; @Override public List<Student> findAllStudents() { return this.studentDao.findAll(); } @Override public Student findStudentById(Integer id) { return this.studentDao.findById(id); } @Override public boolean addStudent(Student student) { return this.studentDao.add(student); } @Override public boolean updateStudent(Student student) { return this.studentDao.update(student); } @Override public boolean deleteStudent(Integer id) { return this.studentDao.delete(id); } }
6ab43d65-6cfa-4e61-a870-41a207fbddbd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-28 13:14:38", "repo_name": "Lekkie/fakebook", "sub_path": "/src/main/java/com/currencycloud/fakebook/service/RecipientService.java", "file_name": "RecipientService.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "b8911a8b54bb4287092c40c35bd1469a98679d8b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Lekkie/fakebook
222
FILENAME: RecipientService.java
0.23092
package com.currencycloud.fakebook.service; import com.currencycloud.fakebook.entity.Recipient; import com.currencycloud.fakebook.repository.RecipientRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * Created by lekanomotayo on 14/03/2018. */ @Service public class RecipientService { @Autowired RecipientRepository recipientRepository; public Recipient save(Recipient recipient) { return recipientRepository.save(recipient); } public Recipient findById(Long id) { return recipientRepository.findOne(id); } public Recipient findByFullname(String fullname) { return recipientRepository.findByFullname(fullname); } public Recipient findByRecipientId(Long recipientId) { return recipientRepository.findByRecipientId(recipientId); } public Recipient findByExtRecipientId(String extRecipientId) { return recipientRepository.findByExtRecipientId(extRecipientId); } public List<Recipient> findAll() { return recipientRepository.findAll(); } }
b881c87c-b2bd-4619-8ac7-e7e9a087592d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-14 00:21:12", "repo_name": "bankiry/bankomat", "sub_path": "/src/main/java/com/solvd/bankomat/model/Atm.java", "file_name": "Atm.java", "file_ext": "java", "file_size_in_byte": 1181, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "3ac3bdc756432a308fbeaf07905b182b8bc28e9f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/bankiry/bankomat
268
FILENAME: Atm.java
0.282988
package com.solvd.bankomat.model; import java.util.List; public class Atm { private Long id; private Bank ownerBank; private List<Language> languages; private List<BankNote> bankNotes; private List<Operation> operations; public enum Language { RUSSIAN, ENGLISH; } public enum Operation { WITHDRAWAL, VIEW_BALANCE } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Bank getOwnerBank() { return ownerBank; } public void setOwnerBank(Bank ownerBank) { this.ownerBank = ownerBank; } public List<Language> getLanguages() { return languages; } public void setLanguages(List<Language> languages) { this.languages = languages; } public List<BankNote> getBankNotes() { return bankNotes; } public void setBankNotes(List<BankNote> bankNotes) { this.bankNotes = bankNotes; } public List<Operation> getOperations() { return operations; } public void setOperations(List<Operation> operations) { this.operations = operations; } }
a50cfb19-ba58-48cf-b399-0f7199c3193f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-29 10:08:08", "repo_name": "Sindhurimaram98/Demo1", "sub_path": "/src/test/java/step_def/fblogin.java", "file_name": "fblogin.java", "file_ext": "java", "file_size_in_byte": 1190, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "f3739b3a265dd275c02aceeaa1a350ac74de5cb4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Sindhurimaram98/Demo1
287
FILENAME: fblogin.java
0.288569
package step_def; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import step_def.MyDrivers; public class fblogin { WebDriver d; @Given("user have chosen to sign in from home page") public void user_have_chosen_to_sign_in_from_home_page() { d=MyDrivers.getDriver("chrome"); d.get("https://en-gb.facebook.com/login/"); } @When("user gives valid username and password") public void user_gives_valid_username_and_password() { d.findElement(By.xpath("//input[@name='email']")).sendKeys("dfjfjdj"); d.findElement(By.name("pass")).sendKeys("fufh"); } @When("clicks on login button") public void clicks_on_login_button() { d.findElement(By.name("login")).click(); } @Then("user shall be able to login and should be taken to home page") public void user_shall_be_able_to_login_and_should_be_taken_to_home_page() { System.out.println("hello"); } @Then("sees his timeline page .") public void sees_his_timeline_page() { System.out.println("welcome to fb"); } }
1b9e7e62-79fe-4f5f-975a-b47387bf6a3e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-11-21T12:35:05", "repo_name": "aktalgat/store-java", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 989, "line_count": 51, "lang": "en", "doc_type": "text", "blob_id": "0de494506375df927fe3c2fb28243ffca8f56f03", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/aktalgat/store-java
253
FILENAME: README.md
0.278257
# Test project Store Store project backend in Java using Spring Boot. For storing products and checkout transaction used H2 embedded database. ### To run project in developer mode In Linux and macOS ```bash ./gradlew bootRun ``` In Windows ```bash gradlew.bat bootRun ``` If you want to run only backend without client add -x buildClient e.g. In Linux and macOS ```bash gradlew.bat bootRun -x buildClient ``` In Windows ```bash gradlew.bat bootRun -x buildClient ``` ### To build project In Linux and macOS ```bash ./gradlew buildClient bootJar ``` In Windows ```bash gradlew.bat buildClient bootJar ``` ### To run jar in production mode In Linux macOS and Windows ```bash java -jar build/libs/bookstore-0.0.1-SNAPSHOT.jar ``` ## Creator **Talgat Akunsartov** * <https://github.com/aktalgat> ## Copyright and license The code is released under the [MIT license](LICENSE?raw=true). --------------------------------------- Please feel free to send me some feedback or questions!
1dbe88cd-9d9a-4389-acd1-3a14de0f618d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-16 14:57:44", "repo_name": "FightingBob/new_community", "sub_path": "/src/main/java/com/littlebob/community/controller/AuthorizeController.java", "file_name": "AuthorizeController.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "30220cd7911aedca4e2a90612c553ace9bbd3e4e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/FightingBob/new_community
198
FILENAME: AuthorizeController.java
0.233706
package com.littlebob.community.controller; import com.littlebob.community.service.AuthorizeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @Controller public class AuthorizeController { @Value("${github.client.id}") private String clientId; @Value("${github.client.secret}") private String clientSecret; @Value("${github.redirect_url}") private String redirectUrl; @Autowired private AuthorizeService authorizeService; @GetMapping("/callback") public String callback(@RequestParam(name = "code") String code, @RequestParam(name = "state") String state, HttpServletRequest request, HttpServletResponse response) { authorizeService.callback(clientId , clientSecret, code, redirectUrl, state, response); return "redirect:/"; } }
77dd4d00-3989-48c2-956f-f7362f3f1fe4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-23 10:13:15", "repo_name": "macrock777/SBcom", "sub_path": "/src/main/java/com/mudra/mboss/master/restcontroller/ClientGroupmasterRestcontroller.java", "file_name": "ClientGroupmasterRestcontroller.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "8c77b3482ff857b47664908d541d47d157c3089a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/macrock777/SBcom
186
FILENAME: ClientGroupmasterRestcontroller.java
0.262842
package com.mudra.mboss.master.restcontroller; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.mudra.mboss.master.services.client.ClientGroupmasterService; @RestController @RequestMapping("/clientgroupmaster/*") public class ClientGroupmasterRestcontroller { @Autowired ClientGroupmasterService cgms; @RequestMapping(value= {"/getclientgrouplist/{uniqueid}/{clientgroupid}"},method=RequestMethod.GET) public List<Map<String,Object>> getClientGroupList(@PathVariable("uniqueid") String uniqueid,@PathVariable("clientgroupid") String clientgroupid) { System.out.println("==>"+clientgroupid); return cgms.getClientGroupList(uniqueid,clientgroupid); } }
6da72ab6-5e9b-4afc-8ae2-54858f113431
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2013-07-25T06:45:29", "repo_name": "badascii/pcs_notes", "sub_path": "/week3.md", "file_name": "week3.md", "file_ext": "md", "file_size_in_byte": 1100, "line_count": 53, "lang": "en", "doc_type": "text", "blob_id": "9a861112812cb2a0f86f88d2fd9a65f6f3f9b9d4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/badascii/pcs_notes
242
FILENAME: week3.md
0.249447
Week 3 Notes - JavaScript Functions -it is very easy to pass functions around as variables var ted = function() {} is better than function ted () {} Falsey Values false null 0 "" [] {} NaN undefined Local vs. Global Variables bacon = 3 <- global variable climbs up through scopes searching for bacon var bacon = 3 <- local variable var means not having to worry about overwriting variables Anonymous Functions -used to limit scope -used for one-off functions that are not reused -get pushed to the bottom of the stack Bind Events -ties an event (mouseclick, touch gesture, keypress) to an action -$('a').on('click', ted(e)) <- when calling a named function, do not pass an argument to the function or it will immediately execute and return null .on() is the main use for anonymous functions due to the fact that they are delayed to run at the bottom of the stack
d87cac6d-9097-4ffc-b8bc-6cbf2fcb6f21
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-02 15:35:43", "repo_name": "shadaki85/AndroidApps", "sub_path": "/Hello_World/app/src/main/java/com/example/svilupposw/hello_world/SingleUserShow.java", "file_name": "SingleUserShow.java", "file_ext": "java", "file_size_in_byte": 1181, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "efffe466de3a09c9bfa9a5cfec06453bab78653c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/shadaki85/AndroidApps
197
FILENAME: SingleUserShow.java
0.214691
package com.example.svilupposw.hello_world; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; public class SingleUserShow extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_single_user_show); SharedPreferences sp = getApplicationContext().getSharedPreferences(getString(R.string.pref_file_key), Context.MODE_PRIVATE); Intent intent = getIntent(); String email = intent.getStringExtra("email"); String description = intent.getStringExtra("description"); String uname = intent.getStringExtra("username"); TextView user = (TextView) findViewById(R.id.usernameResult); user.setText(uname); TextView mail = (TextView) findViewById(R.id.emailResult); mail.setText(email); TextView desc = (TextView) findViewById(R.id.profileDetails); desc.setText(description); } }
de549d93-78d3-4b1a-8e7e-cfbe35418d2b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-27 15:45:51", "repo_name": "juancrud/GymBackend", "sub_path": "/GymDao/src/main/java/com/juancrud/gym/dao/RoutineItem.java", "file_name": "RoutineItem.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "229b7c30ce36e46dbe2a49e215fe98b1872f5a43", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/juancrud/GymBackend
230
FILENAME: RoutineItem.java
0.286968
package com.juancrud.gym.dao; import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.OneToMany; @Entity public class RoutineItem extends EntityWithId { @Column(name="Comments", nullable = true) private String comments; @OneToMany(mappedBy="routineItem") private Set<RoutineItemLine> routineItemLines; public RoutineItem() { routineItemLines = new HashSet<RoutineItemLine>(); } public RoutineItem(String comments) { this(); setComments(comments); } public String getComments() { return comments; } public void setComments(String comments) { this.comments = comments; } public void addRoutineItemLine(RoutineItemLine routineItemLine) { routineItemLines.add(routineItemLine); routineItemLine.setRoutineItem(this); } public void removeRoutineItemLine(RoutineItemLine routineItemLine) { routineItemLines.remove(routineItemLine); routineItemLine.setRoutineItem(null); } }
59e9d059-fcb5-486a-9249-357bd08505b3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-10 20:30:17", "repo_name": "GianBruschini/Bejew", "sub_path": "/app/src/main/java/com/example/bejew/Presentation.java", "file_name": "Presentation.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "5e74702bb5f891b72e0f844e049af7bf180f0ff6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/GianBruschini/Bejew
211
FILENAME: Presentation.java
0.242206
package com.example.bejew; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.TextView; public class Presentation extends AppCompatActivity { public static int SPLASH_TIME_OUT= 2300; TextView bejew; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_presentation); new Handler().postDelayed(new Runnable() { @Override public void run() { Intent intent = new Intent(Presentation.this, Inicio.class); startActivity(intent); overridePendingTransition(R.anim.fade_in,R.anim.fade_out); finish(); } },SPLASH_TIME_OUT); bejew= findViewById(R.id.Bejew); startAnimation(); } public void startAnimation(){ Animation animation = AnimationUtils.loadAnimation(this , R.anim.rotate); bejew.startAnimation(animation); } }
07eeb074-916d-45ae-bd7e-daf63167a1a2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-30 22:29:35", "repo_name": "web-dev-guru/spring-boot-jps-mysql", "sub_path": "/src/main/java/com/cases/mysqls/service/ProdcuctServiceImpl.java", "file_name": "ProdcuctServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "cda6b2eaf073162314d457d9e85939d3d3e80208", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/web-dev-guru/spring-boot-jps-mysql
208
FILENAME: ProdcuctServiceImpl.java
0.276691
package com.cases.mysqls.service; import com.cases.mysqls.bean.Product; import com.cases.mysqls.repository.ProductRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; import java.util.Optional; @Service public class ProdcuctServiceImpl implements ProductService { @Autowired private ProductRepository productRepository; @Override public List<Product> findAll() { List<Product> products = new ArrayList<>(); productRepository.findAll(); //fun with Java 8 return products; } @Override public List<String> findByStr(String desc) { List<String> url=productRepository.findByStr(desc); return url; } @Override public Product saveOrUpdate(Product product) { productRepository.save(product); return product; } @Override public String updateStrByStr(String url) { productRepository.updateStrByStr(url); return "update successfully"; } }
8725985c-3d05-4204-8374-5912010454e2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-05-26T00:36:34", "repo_name": "fernando-mc/redmondpython.com", "sub_path": "/content/contributing.md", "file_name": "contributing.md", "file_ext": "md", "file_size_in_byte": 986, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "3641711d983f243c30217c1c03c65b4e4c43886d", "star_events_count": 2, "fork_events_count": 5, "src_encoding": "UTF-8"}
https://github.com/fernando-mc/redmondpython.com
260
FILENAME: contributing.md
0.189521
--- layout: page title: Contributing to Redmondpython.com --- This is a quick guide on how you can contribute to [Redmondpython.com](http://github.com/fernando-mc/redmondpython.com) - For help with git commands and repository management, here is a [quick guide](https://www.codeschool.com/courses/try-git) - You can also check out [GitKraken](https://www.gitkraken.com/) - an intuitive client for Git **The Repo** The repository is available [here @ Github](http://github.com/fernando-mc/redmondpython.com) **Requirements** You would need [Hugo](https://gohugo.io/getting-started/installing/) and additionaly [HomeBrew](https://brew.sh/) if you are on the macOS **Running the local instance** Running the instance locally is a simple `$ hugo server` At the root directory of the repo. You should get the instance up [locally](http://localhost:1313/) **Community** - [Slack](https://redmondpython.slack.com/) - [Meetup](https://www.meetup.com/Redmond-Python-User-Group/)
b0c8f4c8-da31-46b4-9366-ae3ad7736f2c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-08-12 08:30:58", "repo_name": "Younghusband/LeetCode", "sub_path": "/src/com/playground/extend/CreateObjectTest.java", "file_name": "CreateObjectTest.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "b065ed03bd13d3118cae0622d450d1e5f9fbd175", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Younghusband/LeetCode
227
FILENAME: CreateObjectTest.java
0.290981
package com.playground.extend; /** * @author: Vermouth * @create: 2021-08-06 16:32 * @description: **/ public class CreateObjectTest implements Cloneable { String name; int age; public CreateObjectTest() { } public CreateObjectTest(String name) { this.name = name; initAge(); } private void initAge() { this.age = 0; } // @Override // protected Object clone() throws CloneNotSupportedException { // return super.clone(); // } public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, CloneNotSupportedException { CreateObjectTest cot = new CreateObjectTest("xxx"); System.out.println(cot); CreateObjectTest cot1 = (CreateObjectTest) Class.forName("com.playground.extend.CreateObjectTest").newInstance(); System.out.println(cot1); CreateObjectTest cot2 = (CreateObjectTest) cot.clone(); System.out.println(cot2); } }
29d6f252-6fa8-43f7-a66e-43b1e977f05e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-13 14:44:41", "repo_name": "ncremaschini/maze-solver", "sub_path": "/src/main/java/it/niccrema/model/Maze.java", "file_name": "Maze.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "24f6dd6b7a1dbab2afc089f5046037333fac9c91", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ncremaschini/maze-solver
282
FILENAME: Maze.java
0.295027
package it.niccrema.model; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; public class Maze { private Set<Room> rooms; private Map<Integer, Room> mazeMap; public Set<Room> getRooms() { return this.rooms; } public void setRooms(Set<Room> rooms) { this.rooms = rooms; } public Map<Integer,Room> getMazeMap(){ if(mazeMap == null){ mazeMap = rooms.stream().collect(Collectors.toMap(Room::getId, Function.identity())); } return mazeMap; } @Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Maze)) { return false; } Maze maze = (Maze) o; return Objects.equals(rooms, maze.rooms) && Objects.equals(mazeMap, maze.mazeMap); } @Override public int hashCode() { return Objects.hash(rooms, mazeMap); } @Override public String toString() { return "{" + " rooms='" + getRooms() + "'" + ", mazeMap='" + getMazeMap() + "'" + "}"; } }
56ac70af-ec22-4ccb-ba86-f21903d01a73
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-19T19:55:52", "repo_name": "bhavinpatel08/homedepot_bhavinpatel", "sub_path": "/BootCamp_2953VA_Bhavinkumar_Patel_HomeDepot/src/main/java/pageActions/RegistrationPage.java", "file_name": "RegistrationPage.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "88ebd97bd8e2950560e518821b82d8b20c160f25", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/bhavinpatel08/homedepot_bhavinpatel
213
FILENAME: RegistrationPage.java
0.264358
package pageActions; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class RegistrationPage { WebDriver driver; public RegistrationPage(WebDriver driver) { this.driver=driver; PageFactory.initElements(driver, this); } @FindBy(xpath="(//input[@id='email_id'])[2]") WebElement Email; @FindBy(xpath="//input[@id='registrationPassword']") WebElement Password; @FindBy(xpath="//input[@id='zipcode']") WebElement Zipcode; @FindBy(xpath="//input[@id='phoneNumber']") WebElement PhoneNumber; @FindBy(xpath="//span[text()='Create Account']") WebElement Create_Account; public WebElement Email() { return Email; } public WebElement Password() { return Password; } public WebElement Zipcode() { return Zipcode; } public WebElement PhoneNumber() { return PhoneNumber; } public WebElement Create_Account() { return Create_Account; } }
ef4a5ca7-0e46-4144-9569-524af3b6b79b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-07 17:18:40", "repo_name": "dcwik96/TestJavaApplication", "sub_path": "/Projekt2/src/main/java/com/projekt/projekt2/entity/Article.java", "file_name": "Article.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "03f37eb65ecf885850f33b26f12f14b465a71281", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dcwik96/TestJavaApplication
255
FILENAME: Article.java
0.292595
package com.projekt.projekt2.entity; import javax.persistence.*; import java.util.List; @Entity public class Article { private Long id; private String name; private double value; private List<Purchase> purchases; public Article() { } public Article(String name, double value, List<Purchase> orders) { this.name = name; this.value = value; this.purchases = orders; } @Id @GeneratedValue() public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Column(unique = true) public String getName() { return name; } public void setName(String name) { this.name = name; } public double getValue() { return value; } public void setValue(double value) { this.value = value; } @ManyToMany(mappedBy = "articles", cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH}) public List<Purchase> getPurchases() { return purchases; } public void setPurchases(List<Purchase> purchases) { this.purchases = purchases; } }
03cfeb65-4ade-41ef-8607-c01b887bae7c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-08 03:01:17", "repo_name": "ndefilippis/SimpleNetworkLibrary", "sub_path": "/netcode/MessageReceiver.java", "file_name": "MessageReceiver.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "b3cd5bc5e5e2ed11746c570d8a8267909b5bc394", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ndefilippis/SimpleNetworkLibrary
227
FILENAME: MessageReceiver.java
0.275909
package netcode; import java.io.IOException; import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.channels.DatagramChannel; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import threading.RunnableLoop; public class MessageReceiver extends RunnableLoop{ private DatagramChannel channel; private ByteBuffer buf; private volatile Queue<ReceivedMessage> receivedMessages; public MessageReceiver(DatagramChannel channel){ super(); buf = ByteBuffer.allocate(512); this.channel = channel; this.receivedMessages = new ConcurrentLinkedQueue<ReceivedMessage>(); } @Override protected void update() { SocketAddress address = null; try { address = channel.receive(buf); } catch (IOException e) { e.printStackTrace(); } if(address != null){ receivedMessages.offer(new ReceivedMessage(address, buf, System.nanoTime())); buf.rewind(); } } public ReceivedMessage getLatestData(){ return receivedMessages.poll(); } public boolean hasMessages() { return !receivedMessages.isEmpty(); } }
087dee60-289d-47ea-81df-88c869201555
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-21 16:31:28", "repo_name": "tallesan/MyPublicJava", "sub_path": "/10_SQLAndHibernate/HibernateSQLExperements/src/main/java/PLKey.java", "file_name": "PLKey.java", "file_ext": "java", "file_size_in_byte": 1093, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "fdd171d2248828d713a2cf1b9c00aef323edeceb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tallesan/MyPublicJava
279
FILENAME: PLKey.java
0.271252
import java.io.Serializable; import java.util.Objects; import javax.persistence.Column; import javax.persistence.Embeddable; @Embeddable public class PLKey implements Serializable { public PLKey() { } private static final long serialVersionUID = 2472129826645489974L; public PLKey(String name, String course) { this.name = name; this.course = course; } @Column(name = "student_name") private String name; @Column(name = "course_name") private String course; public String getCourse() { return course; } public void setCourse(String course) { this.course = course; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PLKey plKey = (PLKey) o; return name.equals(plKey.name) && course.equals(plKey.course); } @Override public int hashCode() { return Objects.hash(name, course); } }
7a4a3f9f-6ad4-4c5c-8efb-57b660122e1f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-11 12:28:28", "repo_name": "PycomCompanion/sigfoxcompanion", "sub_path": "/app/src/main/java/com/dayman/sigfoxcompanion/AboutActivity.java", "file_name": "AboutActivity.java", "file_ext": "java", "file_size_in_byte": 1181, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "2f24aa80f2aec528c0f32ea7883ac387e57a56b2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/PycomCompanion/sigfoxcompanion
225
FILENAME: AboutActivity.java
0.195594
package com.dayman.sigfoxcompanion; import android.os.Build; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.text.Html; import android.text.method.LinkMovementMethod; import android.widget.TextView; public class AboutActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); Toolbar tb = (Toolbar) findViewById(R.id.main_toolbar); tb.setTitle(R.string.about_activity_title); TextView aboutTextSourceLink = (TextView) findViewById(R.id.about_text_source_link); // Perhaps use Chrome WebView here at some point String source_code_link = "<a href=\"https://github.com/PycomCompanion/sigfoxcompanion\">Source code</a>"; if (Build.VERSION.SDK_INT >= 24) aboutTextSourceLink.setText(Html.fromHtml(source_code_link, Html.FROM_HTML_MODE_LEGACY)); else Html.fromHtml(source_code_link); aboutTextSourceLink.setMovementMethod(LinkMovementMethod.getInstance()); } }
f6f8dfbf-cc41-4555-95bd-db1b2a0b87c4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-03-11 23:05:27", "repo_name": "PC-Logix/LanteaBot", "sub_path": "/src/main/java/pcl/lc/irc/entryClasses/CommandArgument.java", "file_name": "CommandArgument.java", "file_ext": "java", "file_size_in_byte": 1187, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "ae102807bac536e0570d48c75f217604a28b677f", "star_events_count": 5, "fork_events_count": 15, "src_encoding": "UTF-8"}
https://github.com/PC-Logix/LanteaBot
263
FILENAME: CommandArgument.java
0.256832
package pcl.lc.irc.entryClasses; import java.util.ArrayList; public class CommandArgument { public String name; public String description; public String type; public String arg; public ArrayList<String> argList; /** * * @param type The argument type, see docs of CommandArgumentParser constructor for list */ public CommandArgument(String type) { this.name = null; this.description = null; this.type = type; } /** * * @param type The argument type, see docs of CommandArgumentParser constructor for list * @param name The argument name displayed in command help contexts */ public CommandArgument(String type, String name) { this.name = name; this.description = null; this.type = type; } /** * * @param type The argument type, see docs of CommandArgumentParser constructor for list * @param name The argument name displayed in context help strings * @param description Argument description displayed in command help contexts */ public CommandArgument(String type, String name, String description) { this.name = name; this.description = description; this.type = type; this.arg = null; this.argList = new ArrayList<>(); } }
6f179d75-9275-4294-b4d7-c8a1d5479265
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-15 08:50:58", "repo_name": "low901028/bowls-forecast-lightweight", "sub_path": "/jrpc/src/test/java/com/jdd/rpc/test/demo/api/ClientDemo.java", "file_name": "ClientDemo.java", "file_ext": "java", "file_size_in_byte": 1357, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "2a126faef733a29aa4d5451b277e88cdccd00ff2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/low901028/bowls-forecast-lightweight
343
FILENAME: ClientDemo.java
0.282196
package com.jdd.rpc.test.demo.api; import com.jdd.rpc.config.ClientConfig; import com.jdd.rpc.config.RegistryConfig; import com.jdd.rpc.test.gen.EchoService.Iface; /** * The demo of client by api. * <p> * */ public class ClientDemo { /** * @param args */ public static void main(String[] args) { RegistryConfig registryConfig = new RegistryConfig(); registryConfig.setConnectstr("192.168.137.111:2181"); registryConfig.setAuth("admin:admin123"); String iface = Iface.class.getName(); ClientConfig<Iface> clientConfig = new ClientConfig<Iface>(); clientConfig.setService("com.jdd.rpc.test.demo$EchoService"); clientConfig.setIface(iface); // clientConfig.setAddress("172.18.1.23:19090;172.18.1.24:19090"); try { // 注意:代理内部已经使用连接池,所以这里只需要创建一个实例,多线程共享;特殊情况下,可以允许创建多个实例, // 但严禁每次调用前都创建一个实例。 Iface echoService = clientConfig.createProxy(registryConfig); for (int i = 0; i < 10; i++) { System.out.println(echoService.echo("world!")); Thread.sleep(100); } } catch (Exception e) { e.printStackTrace(); } } }
c7490702-0167-44d7-a8c1-a8db418e93a3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-07-31T07:50:35", "repo_name": "revh/gpxjson", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1156, "line_count": 59, "lang": "en", "doc_type": "text", "blob_id": "9261b652b42d1c93903a6ffbf31fae62ef2f7acd", "star_events_count": 8, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/revh/gpxjson
408
FILENAME: README.md
0.253861
GPXJSON ======= gpxjson is a command line utility and a little go library which aims you to convert a gpx file to a simplified JSON version GPX https://en.wikipedia.org/wiki/GPS_eXchange_Format ##Getting Started ###Installing To start using gpxjson, install Go and run `go get`: ```sh $ go get github.com/revh/gpxjson/... ``` This will retrieve the library and install the gpxjson command line utility into your `$GOBIN` path. ###Library You can use gpxjson package in your Go programs like this: ```go package main import ( "log" "github.com/revh/gpxjson" ) func main() { ... json, err := gpxjson.Convert([]byte(gpxXml)) if err != nil { log.Fatal(err) } ... } ``` ###CLI You can invoke gpxjson as a command line utility: ```sh $ gpxjson input.gpx > output.json output.json {"segments":[[{"lat":43.76319,"lon":11.149139,"time":"2015-07-25T07:17:59Z"}],[{"lat":43.76319,"lon":11.149139,"ele":95.1,"time":"2015-07-25T07:18:00Z"},{"lat":43.76319,"lon":11.149139,"ele":95.2,"time":"2015-07-25T07:18:00Z"}]]} ``` ###About This utility was made for study purpose to improve my Go skills. Any contributions are welcome.
7bddd74e-ba75-42ff-8aa0-99a1826525ac
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-05 02:26:31", "repo_name": "uuyongche/Helloworld", "sub_path": "/app/src/main/java/com/example/helloworld/A.java", "file_name": "A.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "141bc30b8a484c741be87e4e63d0fa79f44a0106", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/uuyongche/Helloworld
222
FILENAME: A.java
0.246533
package com.example.helloworld; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; public class A implements Serializable { volatile String a = ""; public class Solution { public boolean Find(int target, int [][] array) { for (int i = 0;i < array.length;i++) { for (int j = 0; j < array[i].length; j++) { if (target == array[i][j]) { return true; } } } List mList = new ArrayList<Integer>(); Collections.reverse(mList); return false; } } public int minNumberInRotateArray(int [] array) { if (array.length == 0) { return 0; } else { int min = array[0]; for (int i = 1; i < array.length; i++) { if (min > array[i]) { min = array[i]; } } return min; } } }
14f4020c-4ae8-4b10-be28-bacf033030ee
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-08 15:32:44", "repo_name": "smarthealthcaretoday/myhealth-backend", "sub_path": "/myhealth-web-api/src/main/java/today/smarthealthcare/myhealth/configuration/WebAppConfig.java", "file_name": "WebAppConfig.java", "file_ext": "java", "file_size_in_byte": 980, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "7457b7e2925f199588c64a32d12542575b3d8f6e", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/smarthealthcaretoday/myhealth-backend
169
FILENAME: WebAppConfig.java
0.213377
package today.smarthealthcare.myhealth.configuration; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.sparkpost.Client; import com.sparkpost.exception.SparkPostException; import com.sparkpost.transport.RestConnection; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; @Configuration public class WebAppConfig { @Autowired private Client client; @Bean public RestConnection restConnection() throws SparkPostException { return new RestConnection(client); } @Bean public ObjectMapper objectMapper() { return Jackson2ObjectMapperBuilder .json() .featuresToEnable(MapperFeature.DEFAULT_VIEW_INCLUSION) .build(); } }
7c529dfb-44db-4648-b043-371befc9d985
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-18 02:58:54", "repo_name": "hyjfine/spring-demo", "sub_path": "/src/main/java/hello/aspect/AspectOne.java", "file_name": "AspectOne.java", "file_ext": "java", "file_size_in_byte": 1232, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "64018c0d01b092e5071a988164ce9786cb97e1d3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hyjfine/spring-demo
275
FILENAME: AspectOne.java
0.290176
package hello.aspect; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.*; @Aspect public class AspectOne { @Before(value = "pointcutAddUser() && args(name)", argNames = "name") public void before(String name) { System.out.println("前置通知-----" + " || " + name); } @AfterReturning(value = "pointcutAddUser()", returning = "object") public void AfterReturning(Object object) { System.out.println("返回后通知-----" + object); } @Around(value = "pointcutAddUser()") public Object around(ProceedingJoinPoint joinPoint) throws Throwable { System.out.println("环绕通知前------"); Object object = joinPoint.proceed(); System.out.println("环绕通知后------"); return object; } @AfterThrowing(value = "pointcutAddUser()", throwing = "throwable") public void throwable(Throwable throwable) { System.out.println("Throwable------" + throwable); } @After(value = "pointcutAddUser()") public void after() { System.out.println("结束通知--------"); } @Pointcut("execution(* hello.aspect.UserDao.addUser(..))") private void pointcutAddUser() { } }
c0957e7b-b7d4-4bf0-9ad5-469287e95ad0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-11 00:36:16", "repo_name": "LuisEnriqueSosaHernandez/Android", "sub_path": "/Android Studio/Herramientas/app/src/main/java/com/example/pc/herramientas/ServicioMusica.java", "file_name": "ServicioMusica.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "4d77ed28028e82ca83231592ca8c18fd01b9a779", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LuisEnriqueSosaHernandez/Android
223
FILENAME: ServicioMusica.java
0.23092
package com.example.pc.herramientas; import android.app.Service; import android.content.Intent; import android.media.MediaPlayer; import android.os.IBinder; import android.support.annotation.Nullable; /** * Created by pc on 17/06/2017. */ public class ServicioMusica extends Service{ MediaPlayer miReproductor; public void OnCreate(){ super.onCreate(); miReproductor=MediaPlayer.create(this,R.raw.reproducir); miReproductor.setLooping(true); miReproductor.setVolume(100,100); } public int OnStartCommand(Intent intent,int flags,int startId){ miReproductor.start(); return START_STICKY_COMPATIBILITY; } public void OnDestroy(){ super.onDestroy(); if(miReproductor.isPlaying()){ miReproductor.stop(); } miReproductor.release(); miReproductor=null; } @Nullable @Override public IBinder onBind(Intent intent) { return null; } }
373d25bd-8644-44ad-b918-2e2a09777455
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-26 10:08:48", "repo_name": "developTiger/sy-oa", "sub_path": "/lemon-deanery/src/main/java/com/sunesoft/lemon/deanery/ReceptionFlow/domain/infrastructure/hibernate/WorkingLunchRepositoryImpl.java", "file_name": "WorkingLunchRepositoryImpl.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 25, "lang": "en", "doc_type": "code", "blob_id": "7e2af557db5f04636713b068369ad28a83cdd192", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/developTiger/sy-oa
235
FILENAME: WorkingLunchRepositoryImpl.java
0.292595
package com.sunesoft.lemon.deanery.ReceptionFlow.domain.infrastructure.hibernate; import com.sunesoft.lemon.deanery.ReceptionFlow.domain.WorkingLunch; import com.sunesoft.lemon.deanery.ReceptionFlow.domain.WorkingLunchRepository; import com.sunesoft.lemon.fr.ddd.infrastructure.repo.hibernate.GenericHibernateRepository; import org.hibernate.Query; import org.springframework.stereotype.Service; import java.util.List; /** * Created by wangwj on 2016/8/2 0002. */ @Service(value = "workingLunchRepository") public class WorkingLunchRepositoryImpl extends GenericHibernateRepository<WorkingLunch,Long> implements WorkingLunchRepository { @Override public WorkingLunch getByRecepid(Long recepId) { String sql = "from WorkingLunch where receptionId = ?"; Query query = this.getSession().createQuery(sql); query.setParameter(0,recepId); List<WorkingLunch> lists = query.list(); return lists != null && lists.size() > 0 ? lists.get(0) : null; } }
5bf3758e-3a29-42fb-82e6-fb973e467111
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-17 07:34:47", "repo_name": "MirrorrorriN/lionweb", "sub_path": "/src/main/java/com/lion/service/impl/ProjectPublicationServiceImpl.java", "file_name": "ProjectPublicationServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "e4c8c612f2726cc6b551a89fa8fb40ce92e43a64", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/MirrorrorriN/lionweb
242
FILENAME: ProjectPublicationServiceImpl.java
0.286968
package com.lion.service.impl; import com.lion.dao.ext.ProjectPublicationDao; import com.lion.entity.ProjectPublication; import com.lion.service.ProjectPublicationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * @author DJ * @date 2017/10/31. */ @Service("ProjectPublicationService") public class ProjectPublicationServiceImpl implements ProjectPublicationService{ @Autowired ProjectPublicationDao projectPublicationDao; public List<Long> listPubIdByProId(Long id) { return projectPublicationDao.selectPubIdByProId(id); } public int deleteRecordById(Long pubId,Long proId) { return projectPublicationDao.deleteRecordById(pubId,proId); } public int deleteRecordByProId(Long proId) { return projectPublicationDao.deleteRecordByProId(proId); } public int deleteRecordByPubId(Long pubId) { return projectPublicationDao.deleteRecordByPubId(pubId); } public int addRecord(ProjectPublication record) { return projectPublicationDao.insertSelective(record); } }
84e10c4b-dbdb-4a55-b40c-8239bad796f0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-15 17:37:42", "repo_name": "wyj5230/perfumexls", "sub_path": "/src/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 25, "lang": "en", "doc_type": "code", "blob_id": "57ac15d13941c3fe753e8789d017715125f09851", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wyj5230/perfumexls
232
FILENAME: Main.java
0.294215
import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Map<String, String> sampleMap = ExcelService.getSampleXls("./key.xls"); List<Cloth> cloths = new ArrayList<>(); Title title = ExcelService.getTitle("./1.xls"); ExcelService.getActualXls("./1.xls", 1, sampleMap, cloths); ExcelService.getActualXls("./2.xls", 1, sampleMap, cloths); Instant now = Instant.now(); Instant yesterday = now.minus(1, ChronoUnit.DAYS); DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); String yest = dateFormat.format(Date.from(yesterday)); System.out.println("正在生成结果表, 共有" + cloths.size() + "行"); ExcelService.printMergedXls("TMALL_SALES_"+ yest, title, cloths); Scanner input = new Scanner(System.in); input.nextLine(); } }
a480a0eb-61a5-40f9-804f-6b1900057f1a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-09 14:24:20", "repo_name": "TerrellChen/learnJVM", "sub_path": "/src/main/java/terrell/chen/learn/JVM/memory/error/JavaMethodAreaOOM.java", "file_name": "JavaMethodAreaOOM.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "5bf5f85e50d7581c83d7e4ce8ab84e70554c1964", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/TerrellChen/learnJVM
236
FILENAME: JavaMethodAreaOOM.java
0.256832
package terrell.chen.learn.JVM.memory.error; /** * @author: TerrellChen * @version: Created in 21:09 2018-12-10 */ import net.sf.cglib.proxy.Enhancer; import net.sf.cglib.proxy.MethodInterceptor; import net.sf.cglib.proxy.MethodProxy; import java.lang.reflect.Method; /** * Description: 方法区内存溢出测试 * book(JDK6): OOM PermGen space * JDK8: OOM: Metaspace */ public class JavaMethodAreaOOM { static class OOMObject{ } public static void main(final String[] args) { while (true){ Enhancer enhancer = new Enhancer(); enhancer.setSuperclass(OOMObject.class); enhancer.setUseCache(false); enhancer.setCallback(new MethodInterceptor() { @Override public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable { return methodProxy.invokeSuper(objects, args); } }); enhancer.create(); } } }
5aceb90f-9389-4efc-b659-f5cdcb09f01b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-10 03:55:26", "repo_name": "jmhu88/javautil", "sub_path": "/src/main/java/FinalFieldUtils.java", "file_name": "FinalFieldUtils.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 42, "lang": "zh", "doc_type": "code", "blob_id": "b6782d404ca2ff22cc557c3fd57965b7c1b7c17e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jmhu88/javautil
255
FILENAME: FinalFieldUtils.java
0.278257
import java.lang.reflect.Field; import java.lang.reflect.Modifier; /** * 修改final字段的值工具类 * * @author pengpeng * @date 2013-10-30 下午5:10:28 * @version 1.0 */ public class FinalFieldUtils { /** * 修改final字段的值 * @param targetClass * @param fieldName * @param newValue * @throws Exception */ public static void setFinalValue(Class<?> targetClass, String fieldName, Object newValue) throws Exception { Assert.notNull(targetClass); Assert.notNull(fieldName); setFinalValue(targetClass.getField(fieldName), newValue); } /** * 修改final字段的值 * @param field * @param newValue * @throws Exception */ public static void setFinalValue(Field field, Object newValue) throws Exception { Assert.notNull(field); field.setAccessible(true); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); field.set(null, newValue); } }
00d38c34-754d-40fd-ae44-974b46e3fee1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-25 20:00:37", "repo_name": "sidaxe/SprintBootSample", "sub_path": "/src/main/java/com/ephesoft/ephesoftCloudClient/Model/DocumentDetail.java", "file_name": "DocumentDetail.java", "file_ext": "java", "file_size_in_byte": 1181, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "7c51a7734f0db1b062a4c33b63d8ba879d58ae7e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sidaxe/SprintBootSample
261
FILENAME: DocumentDetail.java
0.264358
package com.ephesoft.ephesoftCloudClient.Model; import javax.persistence.*; import java.io.Serializable; @Entity @Table(name = "DocumentDetail") public class DocumentDetail extends ParentModel implements Serializable { public int id; public int noOfPages; public String documentType; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "document_detail_id") public int getId() { return id; } public void setId(int id) { this.id = id; } @Column(name = "pageCount" , nullable = false) public int getNoOfPages() { return noOfPages; } public void setNoOfPages(int noOfPages) { this.noOfPages = noOfPages; } @Column(name = "documentType") public String getDocumentType() { return documentType; } public void setDocumentType(String documentType) { this.documentType = documentType; } @Override public String toString() { return "DocumentDetail{" + "id=" + id + ", noOfPages=" + noOfPages + ", documentType='" + documentType + '\'' + '}'; } }
560653d4-521a-4769-97b4-c175bf338d7d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-18 10:59:51", "repo_name": "urbi-mobility/urbi-ca-server", "sub_path": "/HTTP/src/main/java/co/urbi/http/Provider4xx5xxException.java", "file_name": "Provider4xx5xxException.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "abe8943ee7a72793a5da2fc0034ad3127dc52b22", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/urbi-mobility/urbi-ca-server
253
FILENAME: Provider4xx5xxException.java
0.26588
package co.urbi.http; import lombok.Getter; @Getter public class Provider4xx5xxException extends UrbiException { private final int statusCode; private String rawResponse; private Object[] errorFormatArgs; public Provider4xx5xxException(int statusCode) { this(statusCode, null); } public Provider4xx5xxException(int statusCode, String rawResponse) { this("The provider returned an error", statusCode, rawResponse); } public Provider4xx5xxException(String message, int statusCode, String rawResponse) { super(message); this.statusCode = statusCode; this.rawResponse = rawResponse; } public Provider4xx5xxException setErrorFormatArgs(Object... formatArgs) { this.errorFormatArgs = formatArgs; return this; } @Override public String toString() { return String.format("Provider4xx5xxException(statusCode=%d, message=%s, rawResponse=%s)", statusCode, getMessage(), rawResponse); } @Override public boolean isStatusFromProvider() { return true; } @Override public String getResponseFromProvider() { return rawResponse; } }
b5619bfb-fa58-4f5b-b5bd-b9d4c8512203
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-14 15:45:16", "repo_name": "SergeyYakimaha/JavaEE_projects", "sub_path": "/Session_Cookie_jsp_jstl/src/ex_006_jstl_form/FormRequestServlet.java", "file_name": "FormRequestServlet.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "37f1227d9c2113943e2dbaefff29a3823f12ffbb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SergeyYakimaha/JavaEE_projects
168
FILENAME: FormRequestServlet.java
0.279828
package ex_006_jstl_form; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class FormRequestServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { processRequest(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { processRequest(req, resp); } private void processRequest(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { String name = req.getParameter("username"); req.setAttribute("name", name); RequestDispatcher dispatcher = req.getRequestDispatcher("ex_006_main.jsp"); dispatcher.forward(req, resp); } }
f04d95ac-11dd-47d6-890b-a03fcddc6bdb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-26 22:46:35", "repo_name": "venuancha/test-automation-excercise", "sub_path": "/src/test/java/CucumberRunnerTest.java", "file_name": "CucumberRunnerTest.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "eadf404af9bef12288ab87028521c330f107966f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/venuancha/test-automation-excercise
205
FILENAME: CucumberRunnerTest.java
0.253861
import java.util.concurrent.TimeUnit; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; import pageobject.LoginPage; import step_definitions.WebDriverSingletonClass; import cucumber.api.junit.Cucumber; import cucumber.api.CucumberOptions; @RunWith(Cucumber.class) @CucumberOptions(monochrome = true, plugin = { "pretty", "html:target/html" }, features = "src/test/features/TestAutomation.feature", strict = true) public class CucumberRunnerTest { static WebDriver driver; @BeforeClass public static void setup() { driver = WebDriverSingletonClass.instantiateWebDriverInstance(); driver.navigate().to("localhost:3003"); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); LoginPage loginPage = new LoginPage(); loginPage.login("admin", "password"); } @AfterClass public static void tearDown() { WebDriverSingletonClass.instantiateWebDriverInstance().quit(); } }
04e80ba5-6a13-4352-9f18-b2b691beb0f4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-13 02:25:48", "repo_name": "biantaiwuzui/netx", "sub_path": "/trunk/netx-common/src/main/java/com/netx/common/vo/common/AuditExamineFinanceDto.java", "file_name": "AuditExamineFinanceDto.java", "file_ext": "java", "file_size_in_byte": 1256, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "470ffe26cb7aea405848ffe44a2ad4718a533367", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/biantaiwuzui/netx
256
FILENAME: AuditExamineFinanceDto.java
0.204342
package com.netx.common.vo.common; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.hibernate.validator.constraints.NotBlank; import javax.validation.constraints.NotNull; @ApiModel public class AuditExamineFinanceDto { @ApiModelProperty(value = "记录id", required = true) @NotNull private String id; @ApiModelProperty(value = "审批状态1通过2不通过", required = true) @NotNull private Integer status; @ApiModelProperty(value = "审批用户id", required = true) @NotBlank private String updateUser; @ApiModelProperty(value = "理由", required = true) private String reason; public String getId() { return id; } public void setId(String id) { this.id = id; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public String getUpdateUser() { return updateUser; } public void setUpdateUser(String updateUser) { this.updateUser = updateUser; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } }
b299d8e5-a998-4a1a-93cd-3e757297480e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-17 00:12:26", "repo_name": "n0misain/6-1_source_from_JADX", "sub_path": "/sources/com/cranevalley/dontendword/features/shared/UserInfo.java", "file_name": "UserInfo.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "133ad9fa9063a61606358a9335e3c3402b3378ce", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/n0misain/6-1_source_from_JADX
232
FILENAME: UserInfo.java
0.280616
package com.cranevalley.dontendword.features.shared; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; public class UserInfo implements Parcelable { public static final Creator<UserInfo> CREATOR = new C06351(); public String displayName; public String photoUrl; public String userId; /* renamed from: com.cranevalley.dontendword.features.shared.UserInfo$1 */ static class C06351 implements Creator<UserInfo> { C06351() { } public UserInfo createFromParcel(Parcel source) { return new UserInfo(source); } public UserInfo[] newArray(int size) { return new UserInfo[size]; } } protected UserInfo(Parcel source) { this.userId = source.readString(); this.displayName = source.readString(); this.photoUrl = source.readString(); } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int flags) { dest.writeString(this.userId); dest.writeString(this.displayName); dest.writeString(this.photoUrl); } }
865f226a-8282-4a37-97b5-7c0d9dca1710
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-26 20:27:24", "repo_name": "zjpjohn/ontrack", "sub_path": "/ontrack-model/src/main/java/net/nemerosa/ontrack/model/security/Roles.java", "file_name": "Roles.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "5a57c75673a0b1bcfa5a144e2288e665a119b29b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zjpjohn/ontrack
255
FILENAME: Roles.java
0.252384
package net.nemerosa.ontrack.model.security; /** * List of predefined roles */ public interface Roles { /** * The project owner is allowed to all functions in a project, but for its deletion. */ String PROJECT_OWNER = "OWNER"; /** * A participant in a project is allowed to change statuses in validation runs. */ String PROJECT_PARTICIPANT = "PARTICIPANT"; /** * The validation manager can manage the validation stamps. */ String PROJECT_VALIDATION_MANAGER = "VALIDATION_MANAGER"; /** * The promoter can promote existing builds. */ String PROJECT_PROMOTER = "PROMOTER"; /** * The project manager can promote existing builds, manage the validation stamps, * manage the shared build filters and edit some properties. */ String PROJECT_MANAGER = "PROJECT_MANAGER"; /** * This role grants a read-only access to all components of the projects. */ String PROJECT_READ_ONLY = "READ_ONLY"; String GLOBAL_ADMINISTRATOR = "ADMINISTRATOR"; String GLOBAL_CREATOR = "CREATOR"; String GLOBAL_AUTOMATION = "AUTOMATION"; String GLOBAL_CONTROLLER = "CONTROLLER"; }
ffd00403-0f88-4295-bfc4-5216735cda28
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-22 02:52:12", "repo_name": "tangshengbo/myproject-design", "sub_path": "/src/main/java/com/tangshengbo/design/proxy/cglib/CGLibProxy.java", "file_name": "CGLibProxy.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "02fdabf7654d0f2c86b250f92e501eb334692406", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tangshengbo/myproject-design
261
FILENAME: CGLibProxy.java
0.286968
package com.tangshengbo.design.proxy.cglib; import net.sf.cglib.proxy.Enhancer; import net.sf.cglib.proxy.MethodInterceptor; import net.sf.cglib.proxy.MethodProxy; import java.io.Serializable; import java.lang.reflect.Method; /** * Created by TangShengBo on 2017/12/26. */ public class CGLibProxy { private static final CGLibProxy proxy = new CGLibProxy(); private CGLibProxy() { } public static CGLibProxy getInstance() { return proxy; } @SuppressWarnings("unchecked") public <T> T getProxy(Class<T> cls) { return (T) Enhancer.create(cls, new DynamicAdvisedInterceptor()); } private void before() { } private void after() { System.out.println("after..................."); } private static class DynamicAdvisedInterceptor implements MethodInterceptor, Serializable { @Override public Object intercept(Object obj, Method method, Object[] args, MethodProxy methodProxy) throws Throwable { System.out.println("before..................."); Object result = methodProxy.invokeSuper(obj, args); System.out.println("after..................."); return result; } } }
1412ed04-216e-4948-8c84-b2e905b547ab
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-18 10:51:07", "repo_name": "allegro/hermes", "sub_path": "/hermes-tracker/src/main/java/pl/allegro/tech/hermes/tracker/consumers/DiscardedSendingTracker.java", "file_name": "DiscardedSendingTracker.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "4ca516a8df28f8f57b13237b9b6965464a742c2c", "star_events_count": 811, "fork_events_count": 242, "src_encoding": "UTF-8"}
https://github.com/allegro/hermes
198
FILENAME: DiscardedSendingTracker.java
0.220007
package pl.allegro.tech.hermes.tracker.consumers; import java.time.Clock; import java.util.List; public class DiscardedSendingTracker implements SendingTracker { private final List<LogRepository> repositories; private final Clock clock; DiscardedSendingTracker(List<LogRepository> repositories, Clock clock) { this.repositories = repositories; this.clock = clock; } @Override public void logSent(MessageMetadata message, String hostname) { } @Override public void logFailed(MessageMetadata message, String reason, String hostname) { } @Override public void logDiscarded(MessageMetadata message, String reason) { repositories.forEach(r -> r.logDiscarded(message, clock.millis(), reason)); } @Override public void logInflight(MessageMetadata message) { } @Override public void logFiltered(MessageMetadata messageMetadata, String reason) { } }
9cbf9ec2-414e-4e3c-bbd5-83f6ddc2654f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-13 05:23:52", "repo_name": "monchemin/C19-Android", "sub_path": "/app/src/main/java/com/digitalink/c19/base/BaseViewModel.java", "file_name": "BaseViewModel.java", "file_ext": "java", "file_size_in_byte": 1083, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "84eda9af7d696f7134b35a5b24014d48e90f7988", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/monchemin/C19-Android
194
FILENAME: BaseViewModel.java
0.271252
package com.digitalink.c19.base; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; import com.digitalink.c19.api.Service; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public abstract class BaseViewModel extends ViewModel { protected Service.EndPoint api = Service.Api(); protected <T> MutableLiveData<BasePresenter<T>> getData(Call<BasePresenter<T>> call) { final MutableLiveData<BasePresenter<T>> data = new MutableLiveData<>(); call.enqueue(new Callback<BasePresenter<T>>() { @Override public void onResponse(Call<BasePresenter<T>> call, Response<BasePresenter<T>> response) { data.setValue(response.body()); } @Override public void onFailure(Call<BasePresenter<T>> call, Throwable t) { t.printStackTrace(); BasePresenter<T> err = new BasePresenter<>(); err.error = "500"; data.setValue(err); } }); return data; } }
69509df3-2e39-4e25-90b2-84c2f98dc6d6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-01 13:43:34", "repo_name": "ice61/SpringBootSSM", "sub_path": "/src/test/java/cn/itcast/mapper/UserMapperTest.java", "file_name": "UserMapperTest.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "07561172bfeb02c348d439d5479405a035e7361c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ice61/SpringBootSSM
219
FILENAME: UserMapperTest.java
0.245085
package cn.itcast.mapper; import cn.itcast.pojo.User; import lombok.extern.log4j.Log4j; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import javax.annotation.Resource; import java.util.Date; import static org.junit.Assert.*; /** * Created by WIN 10 on 2019/1/18. */ @RunWith(SpringRunner.class) @SpringBootTest public class UserMapperTest { @Autowired private UserMapper userMapper; @Test public void insertTest() { User user = new User(); user.setAge(23); user.setId(8888888L); user.setName("张三"); user.setBirthday(new Date()); int i = userMapper.insert(user); //System.out.println(i); User user1 = userMapper.selectByPrimaryKey(8888888L); System.out.println(user1); } }
df9fa585-8a6c-4441-9044-251cca9709ec
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-04 17:19:09", "repo_name": "ucims/crud-android", "sub_path": "/app/src/main/java/www/heartfilia/com/madun/SplashScreen.java", "file_name": "SplashScreen.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "62f925c3dc57ebe43d65fddcd8749b5d195d264a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ucims/crud-android
161
FILENAME: SplashScreen.java
0.214691
package www.heartfilia.com.madun; import android.app.Activity; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ImageView; public class SplashScreen extends Activity { ImageView logo; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash_screen); logo = (ImageView)findViewById(R.id.imageView); Thread thread = new Thread(){ public void run(){ try{ sleep(5000); logo = (ImageView)findViewById(R.id.imageView); } catch (InterruptedException e){ e.printStackTrace(); } finally { startActivity(new Intent(SplashScreen.this,Login.class)); finish(); } } }; thread.start(); } }
a5d265a8-4d94-4866-8d45-5b05edf23b41
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-03-29T02:46:59", "repo_name": "iceycc/rt-admin", "sub_path": "/website/example/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1156, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "9fc5e61b88a87d0ac013ebcc464c5d9a6d6dc4b0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/iceycc/rt-admin
310
FILENAME: README.md
0.217338
## Your Project Name The project description here. ## Development Cli Command ```bash # there are examples of 'yarn', you also can use 'npm'. yarn dev # start dev server yarn build # build bundle files yarn help # more cli information # optional command yarn scss # build scss files, need Manual installation 'node-sass' yarn dll # build webpack dll files. Most cases don't need it. ``` ## Projects Are Mainly Dependent On - [rt-admin](https://github.com/CareyToboo/rt-admin) the main core lib. - [amis](https://baidu.github.io/amis/docs/getting-started) extend the amis lib. - [styled-components](https://styled-components.com) css styles in js. - [font-awesome](http://fontawesome.dashgame.com) all icons out of box. - [bootstrap](https://getbootstrap.com/docs/4.4/getting-started/introduction) full bootstrap functions. ## Vscode Plugins You May Need - `eslint` - es code linter - `prettier` - prettify your codes - `vscode styled component`- css in js styles highlight - `search node_modules` - search file from `node_modules` - `code spell checker` - for words spell check > Any Issues? [Let Me Know](https://github.com/CareyToboo/rt-admin).
502a7e94-2abf-443d-a48a-37ac8e0feca8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-02 10:45:34", "repo_name": "m2studio/PokerScorer", "sub_path": "/src/test/java/Jirapat/Gambler/Poker/PokerPlayerTest.java", "file_name": "PokerPlayerTest.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "288990052259fd8cce28151525278611e4957ebf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/m2studio/PokerScorer
210
FILENAME: PokerPlayerTest.java
0.29584
package Jirapat.Gambler.Poker; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.Assert; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Hashtable; @RunWith(SpringRunner.class) @SpringBootTest public class PokerPlayerTest { @Test public void pokerPlayerConstructorInitiailizeCorrectly() { String name = "OAD"; PokerPlayer player = new PokerPlayer(name); Assert.isTrue(player.getName().equals(name)); Assert.isTrue(player.getCards().size() == 0); } @Test public void addCardMethodShouldWorkCorrectly() { PokerPlayer player = new PokerPlayer("name"); Card card = new Card("AS"); player.addCard(card); Assert.isTrue(player.getCards().size() == 1); Assert.isTrue(player.getCards().get(0) == card); } }
82ddfe0c-630e-4395-89b5-00cc047e0d60
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-19 11:37:53", "repo_name": "MultiCoke/Daily", "sub_path": "/0.Java/0.JavaBase/1.Demo/JavaStudy/src/com/study/reflect/test2.java", "file_name": "test2.java", "file_ext": "java", "file_size_in_byte": 1198, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "5fc53231997ec0e4d6141b328e0ed105204a8471", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MultiCoke/Daily
269
FILENAME: test2.java
0.285372
package com.study.reflect; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; /** * @author XH * @Package com.study.reflect * @date 2020/2/16 16:13 */ public class test2 { public static void main(String[] args) throws Exception { //传统创建对象 Person p1 = new Person(); //用字节码文件对象创建类的对象 //1.获取字节码文件对象 Class cp = Class.forName("com.study.reflect.Person"); //2.获取全部public构造器 Constructor[] constructors = cp.getConstructors(); // 获取全部构造器 Constructor[] constructors1 = cp.getDeclaredConstructors(); // 获取指定public构造器 Constructor constructor2 = cp.getConstructor(String.class, int.class); // 获取指定构造器 Constructor constructor3 = cp.getDeclaredConstructor(int.class); //3.指定构造器 Constructor c = constructor3; //4创建对象 // 私有构造器访问权限 c.setAccessible(true); Object obj = c.newInstance(18); Person p2 = (Person) obj; System.out.println(p2); } }
bc96d542-a0ad-4371-abe3-be20f804baca
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-07 01:30:55", "repo_name": "ersin-ertan/android-datastorage", "sub_path": "/sqldelight/src/main/java/com/nullcognition/sqldelight/hockey/ui/TeamRow.java", "file_name": "TeamRow.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "a8ce414ba1f10a9e62947003b97ef76a6122cbd7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ersin-ertan/android-datastorage
218
FILENAME: TeamRow.java
0.239349
package com.nullcognition.sqldelight.hockey.ui; import android.content.Context; import android.util.AttributeSet; import android.widget.LinearLayout; import android.widget.TextView; import com.nullcognition.sqldelight.hockey.R; import com.nullcognition.sqldelight.hockey.data.Team; import butterknife.Bind; import butterknife.ButterKnife; import java.text.SimpleDateFormat; public final class TeamRow extends LinearLayout { @Bind(R.id.team_name) TextView teamName; @Bind(R.id.coach_name) TextView coachName; @Bind(R.id.founded) TextView founded; private SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy"); public TeamRow(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onFinishInflate() { super.onFinishInflate(); ButterKnife.bind(this); } public void populate(Team team) { teamName.setText(team.name()); coachName.setText(team.coach()); founded.setText(getContext().getString(R.string.founded, df.format(team.founded().getTime()))); } }
4551a13d-c821-4df2-aab2-7f969c64ef9d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-02-18T05:13:36", "repo_name": "fhumayun/qa-work-projects", "sub_path": "/Kaizen/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 980, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "1ff33db39c48be660065a35e96286db323179db0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fhumayun/qa-work-projects
240
FILENAME: README.md
0.282196
# Kaizen ![Kaizen Logo](http://i.imgur.com/9Z1BFWs.png) ###### Kaizen - [kahy-zen] A business philosophy or system that is based on making positive changes on a regular basis, as to improve productivity. --- Kaizen is a Nodejs project that utilizes Cucumber and Allure to test the EagleEye SRM/SAC API and generate reports. Over time The Kaizen Project will evolve to encompass many other aspects of testing, quality assurance, and continuous improvement. When run Kaizen will bring itself up inside a Docker container running Ubuntu 16.04 and begin running its tests. First it will run Cucumber, a tool which runs BDD tests against our API and then generates Junit XML output. After the XML is generated it will be parsed by Allure which is a Maven plugin. Allure will take the results and generate a report in HTML. ## Running Kaizen: - https://slimwiki.com/gct/running-kaizen-tests ./rundockertests.sh ## Kaizen, under the hood - https://slimwiki.com/gct/srm-test-code
7424c59e-0dc1-4c5c-ad4e-6cf8aa490dd6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-01 10:39:55", "repo_name": "tommachine/rabbitmq", "sub_path": "/src/main/java/com/cafebabe/rabbitmq/fanout/FanoutSubscriber.java", "file_name": "FanoutSubscriber.java", "file_ext": "java", "file_size_in_byte": 1211, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "dfc9e3b09f602f4d20818d6beaa19ee4c0fc3c34", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tommachine/rabbitmq
240
FILENAME: FanoutSubscriber.java
0.273574
package com.cafebabe.rabbitmq.fanout; import com.cafebabe.rabbitmq.utils.RabbitmqUtil; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import java.io.IOException; import java.util.concurrent.TimeoutException; public class FanoutSubscriber { private String subscriberName; public FanoutSubscriber(String subscriberName) { this.subscriberName = subscriberName; } private void receive() throws IOException, TimeoutException { Connection connection = RabbitmqUtil.getConnection(); Channel channel = connection.createChannel(); //声明一个随机的队列 String queueName = channel.queueDeclare().getQueue(); channel.queueBind(queueName, FanoutPublisher.EXCHANGE_NAME, ""); channel.basicConsume(queueName, false, RabbitmqUtil.getDefaultAckConsumer(channel, subscriberName)); } public static void main(String[] args) throws IOException, TimeoutException { FanoutSubscriber fanoutSubscriber1 = new FanoutSubscriber("订阅者1"); FanoutSubscriber fanoutSubscriber2 = new FanoutSubscriber("订阅者2"); fanoutSubscriber1.receive(); fanoutSubscriber2.receive(); } }
e650ed24-5a7e-4b26-847d-067b6339e5e4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-22 13:51:35", "repo_name": "ahnseongeun/PeopleOfDelivery", "sub_path": "/src/main/java/SoftSquared/PeopleOfDelivery/domain/coupon/Coupon.java", "file_name": "Coupon.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "7093fd74e39fadde70e82a1636a2a5f37adaca69", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ahnseongeun/PeopleOfDelivery
290
FILENAME: Coupon.java
0.27513
package SoftSquared.PeopleOfDelivery.domain.coupon; import SoftSquared.PeopleOfDelivery.config.BaseEntity; import SoftSquared.PeopleOfDelivery.domain.user.User; import com.fasterxml.jackson.annotation.JsonBackReference; import lombok.*; import lombok.experimental.Accessors; import javax.persistence.*; @Entity @Data @Accessors(chain = true) @Builder @AllArgsConstructor @NoArgsConstructor(access = AccessLevel.PUBLIC) // Unit Test 를 위해 PUBLIC @EqualsAndHashCode(callSuper = false) @Table(name = "coupon") public class Coupon extends BaseEntity{ @Id @Column(name = "id",nullable = false,updatable = false) @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; /** * 쿠폰의 디폴트 값은 0으로 설정한다. */ @Column(name = "coupon1000",columnDefinition = "integer default 0") private Integer coupon1000; @Column(name = "coupon3000",columnDefinition = "integer default 0") private Integer coupon3000; @Column(name = "coupon5000",columnDefinition = "integer default 0") private Integer coupon5000; @OneToOne @JsonBackReference("coupon_user_id") @JoinColumn(name = "user_id",nullable = false) private User user; }
7b22207e-a29b-4d29-b94e-c94203524baf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-12 12:34:00", "repo_name": "ZzoeyYang/Android-StickyNavLayout", "sub_path": "/libBase/src/main/java/online/sniper/widget/MaxHeightRecyclerView.java", "file_name": "MaxHeightRecyclerView.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ddc6f923c64c6b2ff2147984cecb8c217bc8cd79", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ZzoeyYang/Android-StickyNavLayout
206
FILENAME: MaxHeightRecyclerView.java
0.273574
package online.sniper.widget; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; /** * 有最大高度限制的RecyclerView * Created by pingyongxia on 2017/12/11. */ public class MaxHeightRecyclerView extends RecyclerView { private final MaxSizeHelper mHelper = new MaxSizeHelper(); public MaxHeightRecyclerView(Context context) { this(context, null); } public MaxHeightRecyclerView(Context context, AttributeSet attrs) { super(context, attrs); if (isInEditMode()) { return; } mHelper.init(context, attrs); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { heightMeasureSpec = MeasureSpec.makeMeasureSpec(mHelper.getMaxHeight(), MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, heightMeasureSpec); } public void setMaxHeight(int maxHeight) { mHelper.setMaxHeight(maxHeight); } }
e1e98756-5a08-40ab-b09c-a502cd0022cb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-30 21:53:19", "repo_name": "RizBizKits/Hypnos", "sub_path": "/app/src/main/java/com/l/hypnos/Alarm.java", "file_name": "Alarm.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "9b165ee059852665c7f1af2a732aa6f0231ad93a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/RizBizKits/Hypnos
269
FILENAME: Alarm.java
0.290176
package com.l.hypnos; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.media.Ringtone; import android.media.RingtoneManager; import android.net.Uri; import android.os.VibrationEffect; import android.os.Vibrator; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.Toast; public class Alarm extends BroadcastReceiver { public static final int REQUEST_CODE = 222; private static Ringtone r = null; private static Vibrator vib = null; @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context,"Wake up",Toast.LENGTH_LONG).show(); vib = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); long[] mVibratePattern = new long[]{0, 400, 200, 400}; vib.vibrate(VibrationEffect.createWaveform(mVibratePattern, 0)); Uri alarmRingtone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE); r = RingtoneManager.getRingtone(context.getApplicationContext(), alarmRingtone); r.play(); } public static void stopRingtone() { r.stop(); vib.cancel(); } }
034f6cc4-a596-40bc-8bed-cdb213ef9515
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-04 08:24:54", "repo_name": "thingleme/java8-jersey2-guice4-webapp-archetype", "sub_path": "/src/main/resources/archetype-resources/src/main/java/HelloResource.java", "file_name": "HelloResource.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "550b04bb467f30a0ad822923c08ef5f099cf5f2c", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/thingleme/java8-jersey2-guice4-webapp-archetype
228
FILENAME: HelloResource.java
0.279042
#set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) package ${package}; import javax.inject.Inject; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.container.AsyncResponse; import javax.ws.rs.container.Suspended; import javax.ws.rs.core.MediaType; @Path("/") public class HelloResource { private final HelloService helloService; @Inject public HelloResource(HelloService helloService) { this.helloService = helloService; } @GET @Path("hello/{name}") @Produces(MediaType.APPLICATION_JSON) public void sayHello(@Suspended AsyncResponse response, @PathParam("name") String name) { helloService.sayHello(name) .thenAccept(response::resume); } @GET @Path("error") @Produces(MediaType.APPLICATION_JSON) public void error(@Suspended AsyncResponse response) { response.resume(new Exception("error message")); } }
9f98631b-5103-4b9b-8637-d5fd2fe78035
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-07 14:22:06", "repo_name": "visp-streaming/processingNodes", "sub_path": "/src/main/java/ac/at/tuwien/infosys/visp/processingNode/util/IncomingQueueExtractor.java", "file_name": "IncomingQueueExtractor.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "55ee2a5599cc9dc124072e224f0c75408d975eca", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/visp-streaming/processingNodes
218
FILENAME: IncomingQueueExtractor.java
0.277473
package ac.at.tuwien.infosys.visp.processingNode.util; import java.util.ArrayList; import java.util.List; public class IncomingQueueExtractor { private String incomingQueuesString; private String infrastructureHost; private String senderOperator; private String receiverOperator; public IncomingQueueExtractor(String incomingQueuesString, String infrastructureHost, String senderOperator, String receiverOperator) { this.incomingQueuesString = incomingQueuesString; this.infrastructureHost = infrastructureHost; this.senderOperator = senderOperator; this.receiverOperator = receiverOperator; } public List<QueueDefinition> getQueueDefinitions() { try { String[] incomingQueues = incomingQueuesString.split("_"); List<QueueDefinition> returnList = new ArrayList<>(); for (String queue : incomingQueues) { returnList.add(new QueueDefinition(queue)); } return returnList; } catch (Exception e) { throw new RuntimeException("Unable to parse list of incoming queues", e); } } }
a14227b6-ae13-4d2c-bf53-6b8939f10859
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-11 09:59:06", "repo_name": "dadisantosh/incture-zp-ereturns", "sub_path": "/ereturns-infrastructure/src/main/java/com/incture/zp/ereturns/model/ReturnReason.java", "file_name": "ReturnReason.java", "file_ext": "java", "file_size_in_byte": 1182, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "6df946bcaa06fb4afe3f31585a69d66bdad453e4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dadisantosh/incture-zp-ereturns
269
FILENAME: ReturnReason.java
0.250913
package com.incture.zp.ereturns.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "T_REASON") public class ReturnReason { @Id @Column(name = "REASON_CODE", length = 10,nullable=false) private String reasonCode; @Column(name = "REASON_DESC", length = 200) private String reasonDesc; @Column(name = "REASON_NAME", length = 50) private String reasonName; @Column(name = "BUS_UNIT", length = 20) private String businessUnit; public String getReasonCode() { return reasonCode; } public void setReasonCode(String reasonCode) { this.reasonCode = reasonCode; } public String getReasonDesc() { return reasonDesc; } public void setReasonDesc(String reasonDesc) { this.reasonDesc = reasonDesc; } public String getReasonName() { return reasonName; } public void setReasonName(String reasonName) { this.reasonName = reasonName; } public String getBusinessUnit() { return businessUnit; } public void setBusinessUnit(String businessUnit) { this.businessUnit = businessUnit; } }
838d5f06-43ce-44af-9244-bdc3d7d81220
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-05-13T07:34:03", "repo_name": "stevemao/ng-ua-parser", "sub_path": "/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1023, "line_count": 18, "lang": "en", "doc_type": "text", "blob_id": "f8f63f9fadc4ef7b8a54f740ddd65ba45267e979", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/stevemao/ng-ua-parser
292
FILENAME: readme.md
0.292595
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] > ng-ua-parser is an Angular factory wrapper for [ua-parser-js](https://github.com/faisalman/ua-parser-js) ua-parser-js doesn't have to be accessed by the `window` object. Use dependency injection instead. Great for unit test and do everything in the Angular manner. **NOTE:** You can use `uaParser` directly without `new`ing it. It's already initialised for you. Add `ngUaParser` as a module dependency to your app after including the `ng-ua-parser.js` script and inject `uaParser` anywhere you need. [npm-image]: https://badge.fury.io/js/ng-ua-parser.svg [npm-url]: https://npmjs.org/package/ng-ua-parser [travis-image]: https://travis-ci.org/stevemao/ng-ua-parser.svg?branch=master [travis-url]: https://travis-ci.org/stevemao/ng-ua-parser [daviddm-image]: https://david-dm.org/stevemao/ng-ua-parser.svg?theme=shields.io [daviddm-url]: https://david-dm.org/stevemao/ng-ua-parser
2c4ee16b-ee92-4693-9d27-590cafb0a09e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2022-02-17T07:19:44", "repo_name": "reecestart/snsBudgetsEnricher", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1084, "line_count": 18, "lang": "en", "doc_type": "text", "blob_id": "3a736c467e83bbc41baf2bf2f3c13256d099e304", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/reecestart/snsBudgetsEnricher
259
FILENAME: README.md
0.258326
# snsBudgetsEnricher This is an example Lambda function that enriches SMS messages. In this example the Lambda Function is triggered by the SNS Topic when an AWS Budget event occurs. The Lambda Function then checks to see if the event is actually over Budget or forecast to be over Budget. The function then calls Cost Explorer to determine which AWS Service cost the most in the last day with an amount spent on that service, then which API Call for that service, then which AZ for that API call. Then the function will post this information to an enriched SNS topic. ## Architecture ![Architecture](https://raw.githubusercontent.com/reecestart/snsBudgetsEnricher/master/SNS%20Budget%20Enricher%20Architecture.jpg) ## To Do Update the ARN on line 13 to your target, enriched SNS Topic. arn = "arn:aws:sns:region:123456789012:enriched-sns-topic" Create an SNS Topic for your Budget, ensure the Topic Policy is updated so Budgets can post to it. Once you have deployed the lambda function ensure that it has access to Cost Explorer and is triggered from the Budgets SNS Topic.
147cae39-2349-4224-a337-56f73ac41330
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-06 08:36:31", "repo_name": "CloudSen/clouds3n-blog-java", "sub_path": "/clouds3n-blog-api/src/main/java/com/clouds3n/blog/api/main/timeline/controller/TimeLineController.java", "file_name": "TimeLineController.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "dc254cc2b61aa619c6979ac5297a01626d52a880", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/CloudSen/clouds3n-blog-java
229
FILENAME: TimeLineController.java
0.221351
package com.clouds3n.blog.api.main.timeline.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.clouds3n.blog.common.dto.Res; import com.clouds3n.blog.common.entity.TimeLine; import com.clouds3n.blog.common.service.ITimeLineService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * <p> * 时间轴 前端控制器 * </p> * * @author CloudS3n * @since 2020-04-19 */ @RestController @RequestMapping("/main/time-line") public class TimeLineController { private final ITimeLineService timeLineService; public TimeLineController(ITimeLineService timeLineService) { this.timeLineService = timeLineService; } @GetMapping("") public Res getTimeLine() { LambdaQueryWrapper<TimeLine> wrapper = new LambdaQueryWrapper<>(); wrapper.orderByAsc(TimeLine::getCreateTime); return Res.ok(timeLineService.list(wrapper)); } }
a28186ca-d84c-4e7a-8976-77ef9b87f10f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-22 07:18:58", "repo_name": "292528867/study-java", "sub_path": "/src/main/java/com/yk/example/rabbitmq/helloworld/Send.java", "file_name": "Send.java", "file_ext": "java", "file_size_in_byte": 1181, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "1797e75ecb4a0dcc1c6aa5b2e8a7e6c1ee0cd134", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/292528867/study-java
220
FILENAME: Send.java
0.224055
package com.yk.example.rabbitmq.helloworld; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import java.io.IOException; import java.util.concurrent.TimeoutException; /** * Created by yk on 16/6/23. */ public class Send { public static final String QUEUE_NAME = "hello"; public void sendMessage() throws Exception { ConnectionFactory factory = new ConnectionFactory(); factory.setHost("localhost"); Connection connection = null; Channel channel = null; try { connection = factory.newConnection(); channel = connection.createChannel(); channel.queueDeclare(QUEUE_NAME, false, false, false, null); String message = "hello world"; channel.basicPublish("", QUEUE_NAME, null, message.getBytes()); System.out.println("xx send '" + message + "'"); } catch (IOException e) { e.printStackTrace(); } catch (TimeoutException e) { e.printStackTrace(); } finally { channel.close(); connection.close(); } } }
200e2495-2bcd-4e0c-8bf4-31fb067455fb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-12-06 13:03:29", "repo_name": "gitter-badger/eachievements-beta", "sub_path": "/de.tud.eclipse_achievements.index/src/de/tud/eclipse_achievements/index/EclipseAchievementsCachePlugin.java", "file_name": "EclipseAchievementsCachePlugin.java", "file_ext": "java", "file_size_in_byte": 1188, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "0af8e474c937fdfd1ed896b92838011bbfe57d73", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/gitter-badger/eachievements-beta
260
FILENAME: EclipseAchievementsCachePlugin.java
0.29584
package de.tud.eclipse_achievements.index; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; /** * The activator class controls the plug-in life cycle */ public class EclipseAchievementsCachePlugin extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "de.tud.eclipse_achievements.cache"; //$NON-NLS-1$ // The shared instance private static EclipseAchievementsCachePlugin plugin; /** * The constructor */ public EclipseAchievementsCachePlugin() { } /* * (non-Javadoc) * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) */ public void start(BundleContext context) throws Exception { super.start(context); plugin = this; } /* * (non-Javadoc) * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) */ public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); } /** * Returns the shared instance * * @return the shared instance */ public static EclipseAchievementsCachePlugin getDefault() { return plugin; } }
51920950-c595-4646-b95d-4661119e1e3f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-23 02:46:46", "repo_name": "lozturk/java8beyond", "sub_path": "/src/test/java/streams/isNotReusable/notReusable.java", "file_name": "notReusable.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "ab58359a59562006be1e56788a7375162289755a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lozturk/java8beyond
195
FILENAME: notReusable.java
0.294215
package streams.isNotReusable; import java.util.ArrayList; import java.util.List; import java.util.function.Predicate; import java.util.stream.Stream; public class notReusable { public static void main(String[] args) { List<String> objects = new ArrayList<>(); objects.add("Apple"); objects.add("Apple"); objects.add("Airplane"); objects.add("Ball"); objects.add("Boy"); objects.add("Cat"); objects.add("Dog"); objects.add("Delta"); Predicate<String> longerThan3Chars = s -> s.length() > 3; Stream<String> stream = objects.stream() .filter(longerThan3Chars); stream.forEach(System.out::println); stream.forEach(s -> System.out.println(s.toUpperCase())); // for the second forEach(), we will get below message: // Exception in thread "main" java.lang.IllegalStateException: stream has already been operated upon or closed } }
6950f217-e00a-4044-bf89-1760f556258a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-23 18:21:06", "repo_name": "froyomuffin/shortener", "sub_path": "/src/main/java/UniqueStringGenerator.java", "file_name": "UniqueStringGenerator.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "b0083c02082f5092234376bc3beb9adffd834ee2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/froyomuffin/shortener
252
FILENAME: UniqueStringGenerator.java
0.286169
package io.eclair.shortener; import io.eclair.jutils.map.DoubleHashMap; import java.util.Random; public class UniqueStringGenerator { private Random random; private int maxTries; private DoubleHashMap store; private int stringLength; private String characters; public UniqueStringGenerator(DoubleHashMap store, int stringLength) { this.random = new Random(); this.maxTries = 100; this.store = store; this.stringLength = stringLength; this.characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; } // Get a unique String according to the given store public String getUnique() { for (int i = 0; i < maxTries; i++) { String candidate = getRandom(); if (store.get(candidate) == null) { return candidate; } } return null; } // Get any random String of a given length private String getRandom() { char[] randomChars = new char[stringLength]; for (int i = 0; i < stringLength; i++) { randomChars[i] = characters.charAt(random.nextInt(characters.length())); } return new String(randomChars); } }
51fc371e-fbd0-48c3-aee9-9266207b1eb8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-19 13:34:31", "repo_name": "CESNET-Integracni-portal/integracni-portal", "sub_path": "/src/main/java/cz/cvut/fel/integracniportal/controller/AbstractController.java", "file_name": "AbstractController.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "fc8c7752e2d1589b694edff6600afd70f109feb1", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/CESNET-Integracni-portal/integracni-portal
174
FILENAME: AbstractController.java
0.250913
package cz.cvut.fel.integracniportal.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; import org.springframework.context.MessageSourceResolvable; import org.springframework.stereotype.Component; import org.springframework.validation.BindingResult; import java.util.ArrayList; import java.util.List; import java.util.Locale; /** * Abstract controller providing validation and other functionality. */ @Component public abstract class AbstractController { @Autowired protected MessageSource messageSource; protected List<String> resolveErrors(BindingResult bindingResult) { List<String> resolved = new ArrayList<String>(); for (MessageSourceResolvable error : bindingResult.getAllErrors()) { resolved.add(resolveError(error)); } return resolved; } protected String resolveError(MessageSourceResolvable error) { return messageSource.getMessage(error, Locale.getDefault()); } }
2569547c-821e-4457-9984-cfaef0d95b91
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-27 12:56:35", "repo_name": "ChandrikaBijalwan/MyFuture", "sub_path": "/app/src/main/java/com/equipesoftwares/google/direction/Results.java", "file_name": "Results.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "1c889eb635eef1a60f450188a785f3ba9315d286", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ChandrikaBijalwan/MyFuture
210
FILENAME: Results.java
0.218669
package com.equipesoftwares.google.direction; import java.util.ArrayList; /* * @author Sunny * Used to convert Google dirextion json response to Object using GSON * */ public class Results { private ArrayList<Address_components> address_components; private String formatted_address; private Geometry geometry; private ArrayList<String> types; public ArrayList<Address_components> getAddress_components(){ return this.address_components; } public void setAddress_components(ArrayList<Address_components> address_components){ this.address_components = address_components; } public String getFormatted_address(){ return this.formatted_address; } public void setFormatted_address(String formatted_address){ this.formatted_address = formatted_address; } public Geometry getGeometry(){ return this.geometry; } public void setGeometry(Geometry geometry){ this.geometry = geometry; } public ArrayList<String> getTypes(){ return this.types; } public void setTypes(ArrayList<String> types){ this.types = types; } }
80a72da2-eb15-45fc-bc7e-1bc0ae8fb323
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-06 02:48:05", "repo_name": "Byungmin/boardMvc2", "sub_path": "/testBoard/src/controller/BoardController.java", "file_name": "BoardController.java", "file_ext": "java", "file_size_in_byte": 1187, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "3fad5773ae31aacd3fa99711f1482cf439c1899b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Byungmin/boardMvc2
208
FILENAME: BoardController.java
0.272799
package controller; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class BoardController extends HttpServlet { protected void doPro(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String RequestURI = request.getRequestURI(); String contextPath = request.getContextPath(); System.out.println("RequestURI"+RequestURI); System.out.println("contextPath"+contextPath); String command = RequestURI.substring(contextPath.length()); System.out.println("command"+command); ActionForward forward = null; Action action = null; if(command.equals("/main.bo")){ System.out.println("check"); } } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doPro(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doPro(req, resp); } }
d37865eb-1f5c-493d-affe-7141a703db3a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-14 12:19:38", "repo_name": "google-code/aion-ger-engine", "sub_path": "/AE-Game/src/com/aionengine/gameserver/dataholders/WindstreamData.java", "file_name": "WindstreamData.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "31a21ada18cfb87a03e4007ae7b57687276a534e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/google-code/aion-ger-engine
229
FILENAME: WindstreamData.java
0.294215
package com.aionengine.gameserver.dataholders; import com.aionengine.gameserver.model.templates.windstreams.WindstreamTemplate; import gnu.trove.map.hash.TIntObjectHashMap; import javax.xml.bind.Unmarshaller; import javax.xml.bind.annotation.*; import java.util.List; /** * @author LokiReborn */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @XmlRootElement(name = "windstreams") public class WindstreamData { @XmlElement(name = "windstream") private List<WindstreamTemplate> wts; private TIntObjectHashMap<WindstreamTemplate> windstreams; void afterUnmarshal(Unmarshaller u, Object parent) { windstreams = new TIntObjectHashMap<WindstreamTemplate>(); for (WindstreamTemplate wt : wts) { windstreams.put(wt.getMapid(), wt); } wts = null; } public WindstreamTemplate getStreamTemplate(int mapId) { return windstreams.get(mapId); } /** * @return items.size() */ public int size() { return windstreams.size(); } }
78e871b1-0848-44eb-847a-231f7ca9e207
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-05 13:04:48", "repo_name": "xiaohuia233/v17springCloud", "sub_path": "/v17-father/index-server/src/main/java/com/qf/controller/IndexController.java", "file_name": "IndexController.java", "file_ext": "java", "file_size_in_byte": 1181, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "2b3b2b7f2a9e58bf317290063a21c523d99176a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/xiaohuia233/v17springCloud
216
FILENAME: IndexController.java
0.253861
package com.qf.controller; import com.qf.entity.Product; import com.qf.feign.IProductService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; import javax.print.attribute.standard.PrinterURI; import java.util.List; @RestController @RequestMapping("index") @Slf4j public class IndexController { @Value("${server.port}") private String serverPort; private String product_server_url = "http://PRODUCT-SERVICE/product/list"; @Autowired private RestTemplate restTemplate; @Autowired private IProductService productService; @RequestMapping("show") @ResponseBody public List<Product> show(){ log.info(serverPort); // List<Product> list = restTemplate.getForObject(product_server_url, List.class); List<Product> list = productService.list(); return list; } }
64e2d66a-0f62-45bf-8d71-4b6a69abe2e4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-14 05:05:49", "repo_name": "dishizhen/waFramework-web", "sub_path": "/src/main/java/com/wa/framework/user/dao/impl/MeetRoomDaoImpl.java", "file_name": "MeetRoomDaoImpl.java", "file_ext": "java", "file_size_in_byte": 1249, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "ad9b7431b1245ea5b7c8410413eaf729fa289d08", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dishizhen/waFramework-web
305
FILENAME: MeetRoomDaoImpl.java
0.275909
package com.wa.framework.user.dao.impl; import com.wa.framework.dao.BaseEntityDaoImpl; import com.wa.framework.user.dao.MeetRoomDao; import com.wa.framework.user.model.MeetRoom; import com.wa.framework.user.model.SysMeet; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Repository; import java.util.List; /** * 描述:会议室dao实现 * 创建人:Administrator * 创建时间:2020/10/10 16:55 */ @Repository("meetRoomDao") public class MeetRoomDaoImpl extends BaseEntityDaoImpl<MeetRoom> implements MeetRoomDao { /** * 查询所有会议室 * @return */ @Override public List<MeetRoom> findAll() { String sql="select * from SYS_MEETROOM m where 1=1"; List<MeetRoom> meetRooms = findBySql(sql, MeetRoom.class); return meetRooms; } /** * 根据id查询会议室 * @param id * @return */ @Override public MeetRoom findById(String id) { DetachedCriteria criteria = DetachedCriteria.forClass(MeetRoom.class); criteria.add(Restrictions.eq("id",id)); List<MeetRoom> list = findByDetachedCriteria(criteria); return list.get(0); } }
faaf0cc2-e8c2-4c8f-875a-b84a7d338c7a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-16 07:29:38", "repo_name": "Merlinoir/ATPLQUIZZ", "sub_path": "/src/main/java/com/atplquiz/entity/Reponse.java", "file_name": "Reponse.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "797534ac655b359b6208f6f4069e62d348de9a99", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Merlinoir/ATPLQUIZZ
307
FILENAME: Reponse.java
0.275909
package com.atplquiz.entity; public class Reponse { private long id; private String libelleReponse; private boolean veracite; private long idQuestion; public Reponse() { } public Reponse(long id, String libelleReponse, boolean veracite, long idQuestion) { super(); this.id = id; this.libelleReponse = libelleReponse; this.veracite = veracite; this.idQuestion = idQuestion; } public long getId() { return id; } public String getLibelleReponse() { return libelleReponse; } public void setLibelleReponse(String libelleReponse) { this.libelleReponse = libelleReponse; } public boolean isVeracite() { return veracite; } public void setVeracite(boolean veracite) { this.veracite = veracite; } public long getIdQuestion() { return idQuestion; } public void setIdQuestion(long idQuestion) { this.idQuestion = idQuestion; } public void setId(long id) { this.id = id; } @Override public String toString() { return "Reponse [id=" + id + ", libelleReponse=" + libelleReponse + ", veracite=" + veracite + ", idQuestion=" + idQuestion + "]"; } }
3c552f34-e102-4bb2-bf44-7f31c98f5594
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-27 00:06:06", "repo_name": "langston8182/bank-oauth2-authorization-server", "sub_path": "/src/main/java/com/cmarchive/bank/bankoauth2authorizationserver/configuration/CustomTokenEnhancer.java", "file_name": "CustomTokenEnhancer.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "97466fb4ccf04d5b21fc435a9f1776c09cc7e3e7", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/langston8182/bank-oauth2-authorization-server
222
FILENAME: CustomTokenEnhancer.java
0.239349
package com.cmarchive.bank.bankoauth2authorizationserver.configuration; import com.cmarchive.bank.bankoauth2authorizationserver.domaine.User; import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; import java.util.HashMap; import java.util.Map; public class CustomTokenEnhancer extends JwtAccessTokenConverter { @Override public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) { User user = (User) authentication.getPrincipal(); Map<String, Object> infos = new HashMap<>(accessToken.getAdditionalInformation()); infos.put("nom", user.getNom()); infos.put("prenom", user.getPrenom()); infos.put("entreprise", "alithya"); DefaultOAuth2AccessToken defaultOAuth2AccessToken = new DefaultOAuth2AccessToken(accessToken); defaultOAuth2AccessToken.setAdditionalInformation(infos); return super.enhance(defaultOAuth2AccessToken, authentication); } }
fb62f4a4-538d-4ba4-8d84-82e6bc7dfd9d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-24 07:10:59", "repo_name": "NightDW/DoItTogether", "sub_path": "/src/main/java/com/laidw/service/impl/UserDetailsServiceImpl.java", "file_name": "UserDetailsServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1277, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "01a9531dbf075fb8f479912812ddf7216499d685", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/NightDW/DoItTogether
216
FILENAME: UserDetailsServiceImpl.java
0.245085
package com.laidw.service.impl; import com.laidw.entity.User; import com.laidw.service.UserService; 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; /** * UserDetailsService的实现类,SpringSecurity通过该类来验证是否登录成功 */ @Service public class UserDetailsServiceImpl implements UserDetailsService { @Autowired private UserService userService; /** * SpringSecurity通过该方法来获取某个用户名对应的用户信息 * @param username 用户名 * @return 用户信息 * @throws UsernameNotFoundException 查找不到指定的用户名时抛出该异常 */ public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { User condition = new User(); condition.setUsername(username); User user = userService.selectUserByCondition(condition, true); if(user == null) throw new UsernameNotFoundException("Username no exist!"); return user; } }
2af27e55-db9d-44d3-b195-1b516e4ad916
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-08 14:05:00", "repo_name": "alienguy255/cec-bridge", "sub_path": "/src/main/java/org/scottsoft/cecserver/cecbridge/CECCommandExecutionHelper.java", "file_name": "CECCommandExecutionHelper.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "b5e0e3de55e3108311acbcd07714bc9fd843f78d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/alienguy255/cec-bridge
246
FILENAME: CECCommandExecutionHelper.java
0.27513
package org.scottsoft.cecserver.cecbridge; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import java.io.IOException; import java.text.MessageFormat; import java.util.List; /** * Created by slaplante on 5/17/17. */ @Component public class CECCommandExecutionHelper extends CommandLineHelper { private static final Logger LOGGER = LoggerFactory.getLogger(CECCommandExecutionHelper.class); public void sendCommand(String deviceId, String command) { try { String commandToExecute = MessageFormat.format("echo {0} {1} | cec-client -s -d 1", command, deviceId); LOGGER.info("Executing command: {}", commandToExecute); Process process = executeCommand(new String[]{"/bin/sh", "-c", commandToExecute}); List<String> resultLines = getExecutionResult(process.getInputStream()); resultLines.stream().forEach(resultLine -> LOGGER.info(resultLine)); LOGGER.info("Execution complete for command: {}", command); } catch (IOException e) { throw new IllegalStateException(MessageFormat.format("An error occurred executing command {0}", ""), e); } } }
823e6f9d-7403-4014-a023-c50c19a14e11
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-12 07:44:22", "repo_name": "Akshit077/OnlineDoctorAppointmentService", "sub_path": "/app/src/main/java/com/example/onlinedoctorappointmentservice/Dashboard_Activity.java", "file_name": "Dashboard_Activity.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "f4ca7fdfd752aa928abca6ec9b2fa6b8e66317e6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Akshit077/OnlineDoctorAppointmentService
170
FILENAME: Dashboard_Activity.java
0.214691
package com.example.onlinedoctorappointmentservice; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; import com.google.firebase.auth.FirebaseAuth; public class Dashboard_Activity extends AppCompatActivity { Button logout_button; FirebaseAuth firebaseAuth; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dashboard_); logout_button=findViewById(R.id.logout); firebaseAuth=FirebaseAuth.getInstance(); logout_button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { firebaseAuth.signOut(); Toast.makeText(Dashboard_Activity.this,"User sign out successful",Toast.LENGTH_SHORT).show(); startActivity(new Intent(getApplicationContext(),MainActivity.class)); } }); } }
35cd4eb4-4d47-487b-b987-020553dd90fe
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-24 14:31:22", "repo_name": "Long-Liu/passport-server", "sub_path": "/src/main/java/org/infinity/passport/utils/RandomUtils.java", "file_name": "RandomUtils.java", "file_ext": "java", "file_size_in_byte": 1252, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "fe82896103d190cc92f1b7172abc73453ff3c3b2", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Long-Liu/passport-server
273
FILENAME: RandomUtils.java
0.26588
package org.infinity.passport.utils; import java.security.SecureRandom; import org.apache.commons.lang3.RandomStringUtils; public final class RandomUtils { private static final int LENGTH = 20; private RandomUtils() { } /** * Generates a ID. * 非线程安全 * 测试用例写法:利用数据库主键唯一特性,for循环生成一万条数据插到数据库中,如果不报错则安全 * * @return the generated ID */ public static String generateId() { return "" + new IdWorker(new SecureRandom().nextInt(30), new SecureRandom().nextInt(10)).nextId(); } /** * Generates a password. * * @return the generated password */ public static String generatePassword() { return RandomStringUtils.randomAlphanumeric(LENGTH); } /** * Generates an activation key. * * @return the generated activation key */ public static String generateActivationKey() { return RandomStringUtils.randomNumeric(LENGTH); } /** * Generates a reset key. * * @return the generated reset key */ public static String generateResetKey() { return RandomStringUtils.randomNumeric(LENGTH); } }
d9ff55da-9a13-4aad-919e-5b62f6d47833
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-12-06T17:06:49", "repo_name": "AmiGanguli/rust-sql-parser", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1048, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "d2db76a1c708dca1f43f4069cbfa654bd1b8bd09", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AmiGanguli/rust-sql-parser
335
FILENAME: README.md
0.206894
# rust-sql-parser ## References and acknowledgements ### Direct sources of ideas and code I've made heavy use of the following sources, sometimes as guides and sometimes as direct sources for copy-and-paste code. Many thanks to the respective authors: * SQLite: - http://www.sqlite.org/ - https://books.google.com/books/?id=yWzwCwAAQBAJ * LlamaDB: - https://github.com/nukep/llamadb - https://nukep.github.io/progblog/2015/04/15/developing-llamadb.html * Andy Grove: - http://keepcalmandlearnrust.com/2016/08/iterator-and-peekable/ ### More general information: * Samuel Madden, Robert Morris, Michael Stonebraker, and Carlo Curino. 6.830 Database Systems. Fall 2010. Massachusetts Institute of Technology: MIT OpenCourseWare, - https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-830-database-systems-fall-2010/index.htm * Garcia-Molina, Ullman, Widom "Database Systems, the Complete Book" - https://www.amazon.com/gp/product/0130319953/ref=ox_sc_act_title_1?ie=UTF8&psc=1&smid=A2PQ9ZM79CIT1R
214e82ff-0906-446e-8ad1-e29c32b7c40a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-26 20:59:30", "repo_name": "PawelRadawiec/my-chat-backend", "sub_path": "/src/main/java/info/mychatbackend/modules/chat/contact/repository/ChatContactContactsRepository.java", "file_name": "ChatContactContactsRepository.java", "file_ext": "java", "file_size_in_byte": 1181, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "9b34a6e2d36e4668dfb4a815b958e4d75e6a361c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/PawelRadawiec/my-chat-backend
212
FILENAME: ChatContactContactsRepository.java
0.27048
package info.mychatbackend.modules.chat.contact.repository; import info.mychatbackend.modules.chat.contact.model.ChatContact; import info.mychatbackend.modules.chat.contact.model.ChatContentContacts; import org.springframework.stereotype.Repository; import javax.persistence.EntityManager; import javax.persistence.Query; import java.util.Optional; @Repository public class ChatContactContactsRepository { private EntityManager em; public ChatContactContactsRepository(EntityManager em) { this.em = em; } public ChatContentContacts create(ChatContentContacts contact) { em.persist(contact); return contact; } public Optional<ChatContentContacts> getByUsername(String username) { Query query = em.createNamedQuery("chatContentContacts.getByUsername"); query.setParameter(1, username); return query.getResultList().stream().findFirst(); } public Optional<ChatContact> getChatContactByUsername(String username) { Query query = em.createNamedQuery("chatContact.getByUsername"); query.setParameter(1, username); return query.getResultList().stream().findFirst(); } }
f45ef674-4382-4831-af44-197bc5d17139
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-20 19:27:34", "repo_name": "fabiofrc/mercado", "sub_path": "/src/main/java/com/gdados/projeto/facade/EnderecoFacade.java", "file_name": "EnderecoFacade.java", "file_ext": "java", "file_size_in_byte": 1187, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "fbb6b6a7c90112b462ae906eb455e8addbbd0e10", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fabiofrc/mercado
256
FILENAME: EnderecoFacade.java
0.290981
package com.gdados.projeto.facade; import com.gdados.projeto.model.Endereco; import java.io.Serializable; import java.util.List; import javax.inject.Inject; import javax.persistence.EntityManager; import javax.persistence.Query; public class EnderecoFacade implements Serializable { private static final long serialVersionUID = 1L; @Inject private EntityManager em; public Endereco save(Endereco entity) { em.persist(entity); return entity; } public Endereco update(Endereco entity) { em.merge(entity); return entity; } public void delete(Endereco entity) { em.remove(entity); } public List<Endereco> getAll() { Query q = em.createQuery("SELECT p FROM Endereco p"); return q.getResultList(); } public Endereco getById(Long id) { Query q = em.createQuery("SELECT c FROM Endereco c WHERE c.id = :id"); q.setParameter("id", id); return (Endereco) q.getSingleResult(); } public int count() { Query q = em.createQuery("select count(p) from Endereco p"); int contador = (int) q.getSingleResult(); return contador; } }
fd95d8fb-9456-4609-8569-846a37eb27dc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-19 14:43:49", "repo_name": "parvex/Hour-reporting-system", "sub_path": "/src/main/java/com/pik/application/dto/WorkReportData/WorkReportDateInput.java", "file_name": "WorkReportDateInput.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "241b24ee9b2657c8dee68673d0c68be5f075d7b4", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/parvex/Hour-reporting-system
265
FILENAME: WorkReportDateInput.java
0.282988
package com.pik.application.dto.WorkReportData; import java.util.Date; import java.util.List; public class WorkReportDateInput { private Date dateFrom; private Date dateTo; private List<Long> employeeIds; private List<Long> projectIds; public WorkReportDateInput(Date dateFrom, Date dateTo, List<Long> employeeIds, List<Long> projectIds) { this.dateFrom = dateFrom; this.dateTo = dateTo; this.employeeIds = employeeIds; this.projectIds = projectIds; } public Date getDateFrom() { return dateFrom; } public void setDateFrom(Date dateFrom) { this.dateFrom = dateFrom; } public Date getDateTo() { return dateTo; } public void setDateTo(Date dateTo) { this.dateTo = dateTo; } public List<Long> getEmployeeIds() { return employeeIds; } public void setEmployeeIds(List<Long> employeeIds) { this.employeeIds = employeeIds; } public List<Long> getProjectIds() { return projectIds; } public void setProjectIds(List<Long> projectIds) { this.projectIds = projectIds; } }
e1aac6a3-b50b-4a59-9cc2-937909271477
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-05 05:14:18", "repo_name": "NYIST-OS/CourseDesign", "sub_path": "/JavaBBS/BBS_with_SpringMVC_MyBatis/src/com/maimieng/bbs/controller/UserController.java", "file_name": "UserController.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "a2882b8f7b560dcd7b14779bf19925cf95ba199f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/NYIST-OS/CourseDesign
247
FILENAME: UserController.java
0.276691
package com.maimieng.bbs.controller; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.maimieng.bbs.po.UserVo; import com.maimieng.bbs.service.UserService; @Controller public class UserController { @Autowired private UserService userService; @RequestMapping("/login") public String login(HttpServletRequest request, UserVo userVo) throws Exception { String flag = "Failure"; String code = request.getParameter("rand"); String rand = (String) request.getSession().getAttribute("rand"); if (rand.equals(code)) { if (userService.verifyLogin(userVo)) { request.getSession().setAttribute("username", userVo.getUser().getUsername()); flag = "redirect:listms.action"; } } return flag; } @RequestMapping("/register") public String register(HttpServletRequest request, UserVo userVo) throws Exception { String flag = "Failure"; if (userService.saveUser(userVo)) { request.getSession().setAttribute("username", userVo.getUser().getUsername()); flag = "redirect:listms.action"; } return flag; } }
efc5fc1b-8cf7-4813-8fce-78b6b357d052
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-05-04T00:44:36", "repo_name": "jloosli/power-of-families-theme", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1181, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "b1c412a59423a77d8e183f72cf6e88d045ff685d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jloosli/power-of-families-theme
299
FILENAME: README.md
0.17441
Power of Families Wordpress Theme ------------ This repo only stores the theme files. In dev environment, it's recommended you install wordpress in a `public_html` directory. Then setup a symlink to the theme folder. `cd www/wp-content/themes` (the bluon theme directory shouldn't exist yet) `sudo ln -s ../../../power-of-families-theme/power-of-families pof-symlink` To create the symlink ### Developing ### This project uses node (make sure it is installed). Install node dependencies with `npm install` Run `npm run dev` while developing. This will: * Process and compile sass (scss) files * Run JS through a linter * Compile JS using webpack * Serve css and js bundles at `http://localhost:8010/assets/scripts.js` and `http://localhost:8010/assets/main.css` Don't forget to set `WP_DEBUG` to `true` in `wp-config`. For working with visual composer and our custom shortcodes, see: https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524332 ### Building ### Run `npm run build` to package up the theme into the `build` directory, ready for ftp upload. #### Notes https://alexjoverm.github.io/2017/03/06/Tree-shaking-with-Webpack-2-TypeScript-and-Babel/
9156afc6-6562-4aac-8b20-df8ad14e5a8d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-25 01:37:33", "repo_name": "its-Arish/tour-guide-app", "sub_path": "/app/src/main/java/com/example/pro5/besttourapp/ListItem.java", "file_name": "ListItem.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "c306783f2e2e55a792c18813b0025314d76d8cea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/its-Arish/tour-guide-app
238
FILENAME: ListItem.java
0.224055
package com.example.pro5.besttourapp; import java.io.Serializable; public class ListItem implements Serializable { private String Mname; private int imageID; private String description; private String locationGeo; public String getLocationGeo() { return locationGeo; } public void setLocationGeo(String locationGeo) { this.locationGeo = locationGeo; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public ListItem(String airport_info, int image, int description, String locationGeo){ } public ListItem(String name, int imageID, String description, String locationGeo) { this.Mname = name; this.imageID = imageID; this.description = description; this.locationGeo = locationGeo; } public String getName() { return Mname; } public void setName(String name) { this.Mname = name; } public int getImageID() { return imageID; } public void setImageID(int imageID) { this.imageID = imageID; } }
57079125-c0d9-414d-a022-5a5ea3fa05c8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-17 20:58:31", "repo_name": "chvishal182/Timetables_Notification", "sub_path": "/TimeTable_S/app/src/main/java/com/cvishaldev/timetable_s/Edit.java", "file_name": "Edit.java", "file_ext": "java", "file_size_in_byte": 1232, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "7d78577924d03735888fc5fe6baa1dbd0003209a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/chvishal182/Timetables_Notification
204
FILENAME: Edit.java
0.245085
package com.cvishaldev.timetable_s; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; public class Edit extends AppCompatActivity { Button askEdit; Intent toReceiveIn; String toSendTopic; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit); toReceiveIn = getIntent(); toSendTopic = toReceiveIn.getStringExtra("userToken"); askEdit = findViewById(R.id.btnAskEdit); askEdit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(),toSendTopic,Toast.LENGTH_LONG).show(); fcmSender sender = new fcmSender(toSendTopic, "SWC_TimeTables", "Change waiting for Approval", Edit.this, Edit.this); sender.sendNotifications(); } }); } }
61a9605a-5da8-40e6-8b12-6561bbfeebc5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-31 01:59:31", "repo_name": "mlglenn2015/Sample-Spring-Batch-Application", "sub_path": "/src/main/java/prv/mark/spring/batch/listener/ExampleChunkListener.java", "file_name": "ExampleChunkListener.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "ee82b69bb8438c97757c10ab9e603af6091ac0c8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mlglenn2015/Sample-Spring-Batch-Application
256
FILENAME: ExampleChunkListener.java
0.247987
package prv.mark.spring.batch.listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.batch.core.ChunkListener; import org.springframework.batch.core.scope.context.ChunkContext; /** * Example Spring Batch ChunkListener for .... * * @author mlglenn */ public class ExampleChunkListener implements ChunkListener { private static final Logger logger = LoggerFactory.getLogger(ExampleChunkListener.class); /** * The event that fires prior to the execution. * @param var1 @{link ChunkContext} */ @Override public void beforeChunk(final ChunkContext var1) { logger.debug("*** ExampleChunkListener.beforeChunk() ***"); } /** * The event that fires after the execution. * @param var1 @{link ChunkContext} */ @Override public void afterChunk(final ChunkContext var1) { logger.debug("*** ExampleChunkListener.afterChunk() ***"); } /** * The event that fires in case of error while executing. * @param var1 @{link ChunkContext} */ @Override public void afterChunkError(final ChunkContext var1) { logger.debug("*** ExampleChunkListener.afterChunkError() ***"); } }
47d47df4-80b6-4f8f-bfb4-d6ae1f9af65e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-06 22:30:17", "repo_name": "qgeffard/annuaireClient", "sub_path": "/parent-project/clientEntity/src/main/java/org/sales/amd/cc/entity/Client.java", "file_name": "Client.java", "file_ext": "java", "file_size_in_byte": 1005, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "ede395baa90798575093d1e8bda0735b54eab31f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/qgeffard/annuaireClient
217
FILENAME: Client.java
0.205615
package org.sales.amd.cc.entity; public class Client { private String name; private String entreprise; private String email; public Client() { } public Client(String name, String entreprise, String email) { this.name = new String(name); this.entreprise = new String(entreprise); this.email = email; } public String getEntreprise() { return entreprise; } public void setEntreprise(String enterprise) { this.entreprise = enterprise; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("Client [name="); builder.append(name); builder.append(", entreprise="); builder.append(entreprise); builder.append(", email="); builder.append(email); builder.append("]"); return builder.toString(); } }
555509a4-803f-44e0-b8a6-ff2b7b74acdf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-03 10:14:10", "repo_name": "chettrir1/MvpDaggerRxRetrofitSample", "sub_path": "/app/src/main/java/com/shiva/practice/application/CakesApplication.java", "file_name": "CakesApplication.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "7ea32a8c79645ffc6a9e1d3dead1d0322a01bcba", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/chettrir1/MvpDaggerRxRetrofitSample
175
FILENAME: CakesApplication.java
0.26588
package com.shiva.practice.application; import android.app.Application; import com.shiva.practice.di.components.ApplicationComponent; import com.shiva.practice.di.components.DaggerApplicationComponent; import com.shiva.practice.di.module.ApplicationModule; /*application is singleton object which will be available throughout entire lifecycle of the app*/ public class CakesApplication extends Application { private ApplicationComponent mApplicationComponent; @Override public void onCreate() { super.onCreate(); initializeApplicationComponent(); } private void initializeApplicationComponent() { mApplicationComponent = DaggerApplicationComponent.builder() .applicationModule(new ApplicationModule("https://gist.githubusercontent.com", this)).build(); } public ApplicationComponent getApplicationComponent() { return mApplicationComponent; } @Override public void onTerminate() { super.onTerminate(); } }
8e6dc780-53a7-4053-9152-08719e0e5618
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-10T03:06:05", "repo_name": "ykl7/sbu-nlp-final-project", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1153, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "9ea1e6becee427c258ce3d307e48ba9797f58481", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ykl7/sbu-nlp-final-project
284
FILENAME: README.md
0.250913
# Analysing and Improving Clarification Question Generation SBU CSE 538 Final Project by Yash Kumar Lal and Siddharth Mangalik ## Setup ### Data and Embeddings Available at: https://github.com/raosudha89/clarification_question_generation_pytorch ### Environment ``` conda create --name nlp-project python=3.6 pip install -r requirements.txt git clone https://github.com/pytorch/fairseq cd fairseq pip install --editable ./ ``` ## Running Code ### Baselines Scripts are available in ```src/fairseq-scripts``` and ```run.sh``` contains a list of all commands run for the same. To build a model using fairseq, first preprocess the data using ```src/fairseq-scripts/fairseq-preprocess.sh```, then train the required architecture with the corresponding train script. For inference, use ```src/fairseq-scripts/fairseq-inference.sh```. ### GPT-2 experiments They are available as notebooks in ```src/``` downloaded from Colab as they were run. ### MTurk HITs ```src/mturk``` contains Amazon HIT templates for the human evaluation tasks we designed. ```data/mturk-raw``` contains input files and ```data/mturk-processed``` contains annotated files.
cf56373b-9333-48b1-8a45-7caea8ca71cf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-12 13:43:48", "repo_name": "SmallCookieee/cmfz", "sub_path": "/cmfz-admin/src/main/java/com/baizhi/cmfz/service/impl/ManagerServiceImpl.java", "file_name": "ManagerServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "3dfd0aa939979905c895e4c921e6ae3aad778d47", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SmallCookieee/cmfz
222
FILENAME: ManagerServiceImpl.java
0.226784
package com.baizhi.cmfz.service.impl; import com.baizhi.cmfz.dao.ManagerDao; import com.baizhi.cmfz.entity.Manager; import com.baizhi.cmfz.service.ManagerService; import com.baizhi.cmfz.util.EncryptionUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** * Created by zxl on 2018/7/4. */ @Service @Transactional public class ManagerServiceImpl implements ManagerService { @Autowired private ManagerDao md; @Override public Manager login(String name, String password) { Manager manager = md.selectById(name); if(manager!=null){ String pwd = EncryptionUtil.encryption(password+manager.getSalt()); String inpwd = EncryptionUtil.encryption(password+manager.getSalt()); if(pwd.equals(inpwd)){ return manager; } } return null; } @Override public int insert(Manager manager) { return md.insert(manager); } }
b4792604-adf4-412d-a837-7ffcca5d9187
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-10T15:18:49", "repo_name": "startshineye/spring-security", "sub_path": "/spring-security-demo/src/main/java/com/yxm/security/async/MQ.java", "file_name": "MQ.java", "file_ext": "java", "file_size_in_byte": 1304, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "e2e29193578494c1aa77934502925af17bfd524c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/startshineye/spring-security
261
FILENAME: MQ.java
0.274351
package com.yxm.security.async; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; /** * @author yexinming * @date 2020/2/22 **/ @Component//定义为Spring的组件 public class MQ { private String placeOrder;//下单请求 private String completeOrder;//订单完成 private Logger logger = LoggerFactory.getLogger(getClass()); public String getPlaceOrder() { return placeOrder; } public void setPlaceOrder(String placeOrder) throws Exception{ /** * 下单业务逻辑处理:下单之后我们用线程休眠1秒替代应用2出路,然后设置completeOrder为完成 */ new Thread(() -> { logger.info("接到下单请求, " + placeOrder); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } this.completeOrder = placeOrder; logger.info("下单请求处理完毕," + placeOrder); }).start(); } public String getCompleteOrder() { return completeOrder; } public void setCompleteOrder(String completeOrder) { this.completeOrder = completeOrder; } }
23bd3c38-48b9-454a-afb3-a7c011708fa7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-06-23T04:37:25", "repo_name": "erdosmiller/lv-toml", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1186, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "59f5a3ace5aee9a58c63ed22993c63fc9c3fafd4", "star_events_count": 7, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/erdosmiller/lv-toml
343
FILENAME: README.md
0.274351
LV-TOML ================= LV-TOML is an open source LabVIEW library for parsing and composing [TOML v0.4.0 files](https://github.com/toml-lang/toml). LV-TOML is tested against the TOML test suite [toml-test](https://github.com/BurntSushi/toml-test). Installation ------------ [The most recent VI Package (.vip) can be downloaded here.](https://github.com/erdosmiller/lv-toml/releases) Open the VI Package using [VI Package Manager](http://vipm.jki.net/) and press ***Install***. In LabVIEW, The LV-TOML palette can be found in the ***Erdos Miller*** palette. Usage ----- The polymorphic VIs ***Read TOML File.vi*** and ***Write TOML File.vi*** can parse and compose TOML files to and from a variant or a ***TOML Value.ctl***. ***TOML Value.ctl*** values are composable and caseable using [LV-Tagged-Union](https://github.com/erdosmiller/lv-tagged-union). To use LV-Tagged-Union with this library, the types LV-TOML:TOML Value.ctl and LV-TOML:TOML Key-Value Pair.ctl from the TOML palette must be in memory. Dependencies ------------ OpenG Toolkit MGI Tools [LV-JSON](https://github.com/erdosmiller/lv-json) (only for needed for running tests) Requires LabVIEW 2015 or later
ef4275fe-72a8-4beb-9d36-a8d23f9b833e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-25 05:05:05", "repo_name": "crackvr/vraa_proj", "sub_path": "/app/src/main/java/com/example/remainderapp/theAbt.java", "file_name": "theAbt.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "0b0fc00520c8655d897ec08025f2c8110f4a6b75", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/crackvr/vraa_proj
197
FILENAME: theAbt.java
0.218669
package com.example.remainderapp; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; public class theAbt extends AppCompatActivity implements AdapterView.OnItemClickListener{ ListView lv; String instag[]={"@starkyboi0913","@crack.vr","@being_akhilistic","abhilash525"}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_the_abt); setContentView(R.layout.activity_settings); lv=findViewById(R.id.listv); ArrayAdapter<String> ada=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, instag); lv.setAdapter(ada); lv.setOnItemClickListener(this); } @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { } }
9fa8ee2b-55d5-4f36-9c62-a1c7eec0f6d1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-24 00:43:56", "repo_name": "NasKhalil/FormGeneratorMvvm", "sub_path": "/app/src/main/java/com/example/formgenerator/main/ui/dashboard/DashboardFragment.java", "file_name": "DashboardFragment.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "d9e1d07f10112920e29cb628cd4b79ed0a32aa90", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/NasKhalil/FormGeneratorMvvm
184
FILENAME: DashboardFragment.java
0.20947
package com.example.formgenerator.main.ui.dashboard; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProviders; import com.example.formgenerator.R; import com.example.formgenerator.databinding.FragmentDashboardBinding; public class DashboardFragment extends Fragment { FragmentDashboardBinding binding; private DashboardViewModel dashboardViewModel; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { dashboardViewModel = new ViewModelProvider(this).get(DashboardViewModel.class); binding = FragmentDashboardBinding.inflate(getLayoutInflater()); return binding.getRoot(); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); } }
3cc5a032-ab0e-4a56-9f65-9015144612a5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-17 20:56:27", "repo_name": "qixuanHou/autotraderSeleniumTest", "sub_path": "/main/java/com/autotrader/mdot/pages/TIM/TimRetrieveOfferPage.java", "file_name": "TimRetrieveOfferPage.java", "file_ext": "java", "file_size_in_byte": 1108, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "d3c8ce0902f161b31122ba3af559f066a498b254", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/qixuanHou/autotraderSeleniumTest
220
FILENAME: TimRetrieveOfferPage.java
0.264358
package com.autotrader.mdot.pages.TIM; import com.autotrader.mdot.pageselector.*; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import java.util.concurrent.TimeUnit; /** * Created by mwstratton on 10/14/2015. */ public class TimRetrieveOfferPage { public WebDriver driver; public WebDriverWait wait; TimRetrieveOfferPageSelector selector; public TimRetrieveOfferPage(WebDriver driver){ this.driver = driver; this.wait = new WebDriverWait(driver, 20); this.selector = new TimRetrieveOfferPageSelector(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } public boolean checkOnCorrectPage(){ wait.until(ExpectedConditions.textToBePresentInElementLocated(selector.getTimRetrieveOfferHeaderSelector(), "Review Existing Instant Cash Offer")); return driver.findElement(selector.getTimRetrieveOfferHeaderSelector()).getText().contains("Review Existing Instant Cash Offer"); } }
4297f977-fefb-4c47-b7ab-296fc5e20153
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-08 16:33:34", "repo_name": "davidmogar/nji", "sub_path": "/src/com/davidmogar/nji/InstructionsExecutor.java", "file_name": "InstructionsExecutor.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "4a225e090318f37402413a7d3f6e5c93acf5b898", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/davidmogar/nji
210
FILENAME: InstructionsExecutor.java
0.291787
package com.davidmogar.nji; import com.davidmogar.nji.instructions.Instruction; import com.davidmogar.nji.instructions.TagInstruction; import java.util.Iterator; import java.util.List; public class InstructionsExecutor { private Context context; private List<Instruction> instructions; public InstructionsExecutor(List<Instruction> instructions) { this.instructions = instructions; context = new Context(); prepareContext(); } public void execute() { while (context.instructionPointer < instructions.size()) { instructions.get(context.instructionPointer).execute(context); } } private void prepareContext() { Iterator<Instruction> iterator = instructions.iterator(); short i = 0; while(iterator.hasNext()) { Instruction instruction = iterator.next(); if (instruction instanceof TagInstruction) { String tag = ((TagInstruction) instruction).getName(); context.tags.put(tag, i); iterator.remove(); } else { i++; } } } }
4377c93b-ad54-4389-b1f7-f577ca443d02
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-13 08:07:11", "repo_name": "rafifyusa/rms-springboot", "sub_path": "/src/main/java/com/mitrais/rmsspringboot/RmsSpringbootApplication.java", "file_name": "RmsSpringbootApplication.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "5de90c66035f0ef559182bec2c4d5e860871edc3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rafifyusa/rms-springboot
216
FILENAME: RmsSpringbootApplication.java
0.258326
package com.mitrais.rmsspringboot; import com.mitrais.rmsspringboot.model.User; import com.mitrais.rmsspringboot.service.Implementation.UserServiceImpl; import com.mitrais.rmsspringboot.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration @SpringBootApplication public class RmsSpringbootApplication implements CommandLineRunner { private UserServiceImpl userService; @Autowired public RmsSpringbootApplication(UserServiceImpl userService) { this.userService = userService; } public static void main(String[] args) { SpringApplication.run(RmsSpringbootApplication.class, args); } @Override public void run(String... args) throws Exception { { User newAdmin = new User("admin@mail.com", "Admin", "admin"); userService.insertAdmin(newAdmin); } } }