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 |
|---|---|---|---|---|---|---|
8775b1b6-3850-46dd-878f-5a8f5d8c0af9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-28 06:49:01", "repo_name": "BookArchive/BookArchive", "sub_path": "/src/main/java/Comp271/BookArchive/BookArchive/DataModels/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "7d7201aac9f389c9337d66f02b2af7fdc8336572", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/BookArchive/BookArchive | 243 | FILENAME: User.java | 0.20947 | package Comp271.BookArchive.BookArchive.DataModels;
import javax.persistence.*;
@Entity
@NamedQuery(name = "User.findByUsername",query = "SELECT u FROM User u WHERE u.username = ?3")
@Table(name = "Users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String username;
private String password; //need to change this to something more secure
private String major;
public User(){}
public User(String username, String major){
this.username = username;
this.password = password;
this.major = major;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
}
|
1b719c5d-fbbc-4deb-a219-1cb08223ba68 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-10-27T19:55:52", "repo_name": "jonathanxlee/order-tracker", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1115, "line_count": 16, "lang": "en", "doc_type": "text", "blob_id": "8c4b1550fef95763f0eb3257c68eda150d4495f2", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jonathanxlee/order-tracker | 249 | FILENAME: README.md | 0.217338 | # Order Tracker
This application should be able to identify emails in your gmail inboc that involve orders and display the status
of these orders within a web app
## Status 10/12/19
After consulting with a professional, I decided to restructure my design process to be more in-depth. I am changing my course of action to begin with the design of the application and then work towards the back-end functionality. I also want to begin prototyping with the fundamentals and then expand. Because of this, the repo will be a little messy for a while as I seek to restructure.
## Status 10/12/19
I have figured out how to parse the text from an email, and I am not going to transition into being able to extract all the information I would need to be able to track (the order number, the company with which the order was placed, the tracking number, etc.).
## Status 10/06/19
I am currently developing an understanding of the gmail api so that I can understand the structure of receiving messages from the users inbox. I am working on being able to read messages since they are returned in an encoded format. |
c34ed1c1-3ccd-4613-8bd6-5bb2a22751a7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-12 08:37:31", "repo_name": "salmanit/MyDemoTest", "sub_path": "/app/src/main/java/com/sage/mydemotest/adapter/AdapterRVanima.java", "file_name": "AdapterRVanima.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "c2fd99bd4044b9b3ef11690aba6538cf2505ad2a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/salmanit/MyDemoTest | 208 | FILENAME: AdapterRVanima.java | 0.249447 | package com.sage.mydemotest.adapter;
import android.view.View;
import android.widget.TextView;
import com.sage.mydemotest.R;
/**
* Created by Sage on 2016/4/1.
*/
public class AdapterRVanima extends AdapterVHbase {
@Override
public int getLayoutID() {
return R.layout.item_rv_anima;
}
@Override
public void onBindViewHolder(ChangeViewHolder holder, int position) {
TextView tvDescription= (TextView) holder.itemView.findViewById(R.id.tv_description);
tvDescription.setText("position="+position);
holder.itemView.findViewById(R.id.iv_top).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
holder.itemView.findViewById(R.id.iv_bottom).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
}
@Override
public int getItemCount() {
return 10;
}
}
|
e7701f3d-2ccd-4d74-8c52-e99a489054b6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-01 17:06:58", "repo_name": "damiana/app-crud-cliente-sqlite", "sub_path": "/app/src/main/java/fatec/exemplo/sqlite/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "392a6bd2f99e9c2b6f1a7c8789220a18d6653aaa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/damiana/app-crud-cliente-sqlite | 196 | FILENAME: MainActivity.java | 0.195594 | package fatec.exemplo.sqlite;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button btnCadastro = null;
Button btnListar = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnCadastro = (Button) findViewById(R.id.btnCadastro);
btnListar = (Button) findViewById(R.id.btnListar);
btnCadastro.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent i = new Intent(MainActivity.this, CadastrarClienteActivity.class);
startActivity(i);
finish();
}
});
btnListar.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent i = new Intent(MainActivity.this, ListarClienteActivity.class);
startActivity(i);
finish();
}
});
}
}
|
bd8b78d7-60b2-43d2-b838-1feb044b168c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-05-25 20:02:32", "repo_name": "yohanbeschi/jvm_hardcore", "sub_path": "/03_projects/pjba/01_src/main/java/org/isk/jvmhardcore/pjba/instruction/meta/ShortArgMetaInstruction.java", "file_name": "ShortArgMetaInstruction.java", "file_ext": "java", "file_size_in_byte": 1174, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "8892877a9dca0b8b4202293c07f39a6295a9301e", "star_events_count": 5, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/yohanbeschi/jvm_hardcore | 218 | FILENAME: ShortArgMetaInstruction.java | 0.293404 | package org.isk.jvmhardcore.pjba.instruction.meta;
import org.isk.jvmhardcore.pjba.instruction.factory.ShortArgInstructionFactory;
import org.isk.jvmhardcore.pjba.structure.Instruction;
public class ShortArgMetaInstruction extends MetaInstruction {
final private static short SHORT_ZERO = 0;
private ShortArgInstructionFactory instructionBuilder;
public ShortArgMetaInstruction(final String mnemonic,
final ArgsType argsType,
final ShortArgInstructionFactory instructionBuilder) {
this(mnemonic, mnemonic, argsType, instructionBuilder);
}
public ShortArgMetaInstruction(final String mnemonic,
final String pjbMnemonic,
final ArgsType argsType,
final ShortArgInstructionFactory instructionBuilder) {
super(mnemonic, pjbMnemonic, argsType);
this.instructionBuilder = instructionBuilder;
this.opcode = instructionBuilder.buildInstruction(SHORT_ZERO).getOpcode();
}
public Instruction buildInstruction(short s) {
return this.instructionBuilder.buildInstruction(s);
}
}
|
e299676e-caa9-4206-b6d1-ef2fc848f7b0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-19 16:23:14", "repo_name": "escoffier/springormdemo", "sub_path": "/src/main/java/com/example/xmljpademo/service/PhoneService.java", "file_name": "PhoneService.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "cc0ae889d8ceb9dbbaf82d3071c341a03e4618a0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/escoffier/springormdemo | 177 | FILENAME: PhoneService.java | 0.271252 | package com.example.xmljpademo.service;
import com.example.xmljpademo.model.Phone;
import com.example.xmljpademo.repository.empsrepository.PhoneRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
@Component
public class PhoneService {
@Autowired
private PhoneRepository phoneRepository;
@Transactional(value = "employeesTransactionManager", propagation = Propagation.REQUIRED)
public List<Phone> getPhones(Long id) {
List<Phone> phones = phoneRepository.findAllById(Arrays.asList(id));
if (phones.isEmpty()) {
throw new RuntimeException("no phone");
}
return phones;
}
public Phone insertPhone(Phone phone) {
return phoneRepository.save(phone);
}
}
|
4114fc0d-867b-4c25-84fb-0ff01fe0d1c5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-15 13:38:28", "repo_name": "wuhao939/ctf", "sub_path": "/src/main/java/com/pojo/Message.java", "file_name": "Message.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "038a78e1516f8b787c22e80a645ca806e7e3b958", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wuhao939/ctf | 197 | FILENAME: Message.java | 0.225417 | package com.pojo;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class Message {
@Id
private int id;
private String username;
private String contexts;
private String time;
public Message(){}
public Message(String username,String contexts,String time){
this.username = username;
this.contexts = contexts;
this.time = time;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getContexts() {
return contexts;
}
public void setContexts(String contexts) {
this.contexts = contexts;
}
}
|
6fa28a97-3332-4e00-85f5-cf0788b11fbd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-07-05T07:34:46", "repo_name": "HackAfro/ionic-graph-app", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1177, "line_count": 43, "lang": "en", "doc_type": "text", "blob_id": "a5ce55ffe71c6fbe0625da0a95ffb88dc8634409", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/HackAfro/ionic-graph-app | 322 | FILENAME: README.md | 0.289372 | # Ionic-Realtime-Data-Visualization
Realtime data visualisation using Pusher and Ionic
You can find the article [here](https://pusher.com/tutorials/live-graph-ionic)
## Prerequisites
- [Ionic](https://ionicframework.com/)
- [Express](https://expressjs.com/)
- [Pusher](https://pusher.com)
- [ChartJs](http://www.chartjs.org/)
- A [Pusher account](https://pusher.com/signup) and [Pusher app credentials](http://dashboard.pusher.com/)
## Getting started
- Clone the project and install dependencies:
- Create a file named `.env`. Update the `.env` file with the content below:
```
PUSHER_APP_ID=app-id
PUSHER_APP_KEY=app-key
PUSHER_APP_SECRET=app-secret
PUSHER_CLUSTER=cluster
```
- Update the `pusher.ts` file with your pusher key
> **Note**: ensure to replace the placeholder values with your pusher `appId`, `key` and `secret`.
- Clone the repo
- Run npm install
- Start server by running `node server`
- Run `ionic serve` to start the Ionic dev server
## Built With
* [Pusher](https://pusher.com/)
* [Ionic](https://ionicframework.com/)
* [Express](https://expressjs.com/)
* [Pusher](https://pusher.com)
* [ng2-charts](https://valor-software.com/ng2-charts/)
|
d2fefa67-a957-4b3a-8429-8cfb29e4ba9f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-08-05T23:59:06", "repo_name": "NareshAruna/WebSocket", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1230, "line_count": 42, "lang": "en", "doc_type": "text", "blob_id": "9803ee4e875196d6372aae7facbaa271a1af9f67", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NareshAruna/WebSocket | 308 | FILENAME: README.md | 0.27048 | # WebsocketNew
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng new app-name` to generate a new application.
Brose into the project folder app-name by `cd app-name`
install the below libraries
1) npm install stompjs;
2) npm install sockjs-client
3) npm install jquery (just to quickly access the DOM elements)
If error comes up like `net` module not found, perform the below action
`npm i --save net -compact`
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
28844ef2-8bf3-45aa-bac9-238f84da7fb1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-18 18:10:34", "repo_name": "AliaksandrKlimets/FinalProj", "sub_path": "/src/main/java/com/epam/car_rental/tag/FullNameTag.java", "file_name": "FullNameTag.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "a93781d14fa68bd3a0372d2e1389f80608929cc9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AliaksandrKlimets/FinalProj | 212 | FILENAME: FullNameTag.java | 0.264358 | package com.epam.car_rental.tag;
import com.epam.car_rental.util.TagUtil;
import org.apache.log4j.Logger;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
public class FullNameTag extends TagSupport {
private final static Logger LOGGER = Logger.getLogger(FullNameTag.class);
private String name;
private String surname;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
@Override
public int doStartTag() throws JspException {
String fullName = name + " " +surname;
JspWriter out = pageContext.getOut();
pageContext.setAttribute("fullName",fullName);
return TagUtil.writeTag(out,fullName,"Cannot write user status tag to page", LOGGER);
}
}
|
06bdda3d-ffde-407d-91cd-ef15a2b6bf67 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-14 10:01:16", "repo_name": "Minuit-Z/MyTickets", "sub_path": "/app/src/main/java/ziye/mytickets/adapters/SmsAdapter.java", "file_name": "SmsAdapter.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "95572d8e4aba04a8ce691702ec15a88890d14e09", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Minuit-Z/MyTickets | 253 | FILENAME: SmsAdapter.java | 0.295027 | package ziye.mytickets.adapters;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.ArrayList;
import ziye.mytickets.R;
import ziye.mytickets.dao.SmsBean;
/**
* Created by Administrator on 2018/9/25 0025.
*/
public class SmsAdapter extends BaseAdapter {
private ArrayList<SmsBean> lists;
private Context context;
public SmsAdapter(ArrayList<SmsBean> lists,Context context) {
this.lists=lists;
this.context=context;
}
@Override
public int getCount() {
return lists.size();
}
@Override
public Object getItem(int position) {
return lists.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
SmsBean smsBean = lists.get(position);
View v=View.inflate(context, R.layout.item_sms,parent);
TextView tvContent=v.findViewById(R.id.tv_content);
tvContent.setText(smsBean.body);
return v;
}
}
|
19797a22-0651-4cd5-ad5e-74de409cd7d7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-07-06T01:39:29", "repo_name": "sivasamyk/logtrail-tools", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 987, "line_count": 18, "lang": "en", "doc_type": "text", "blob_id": "d6dcfe167fc4dbf96daf4c89fd3891575dfd6840", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sivasamyk/logtrail-tools | 201 | FILENAME: README.md | 0.199308 | # Logtrail-tools
Consists a bunch of tools that can be used to enhance the log messages shown in logtrail. Currently there are 2 modules
### Source Analyzer
Analyze the source code to extract logger information along with the variables logged. This will convert all the
log statement in source code into patterns that can be used by log-parser. Currently supports analyzing Java source code
to find patterns for slf4j log methods. Will be extended in future to support multiple loggers in Java and for other
languages like go, etc.
This tool will be run as part of compilation of the application source code and will generate pattern file as output.
### Log Parser
Consists of logstash filter plugin and a Java API used by the plugin. Given the pattern file as input, this will match
the log messages to the pattern and extract the variables from the message. The extracted variables will be added as
additional info to the JSON source document to be stored in Elasticsearch.
|
3cd7c1de-8351-4eee-a90b-d3ea4fb39092 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-06 13:15:35", "repo_name": "lindar-open/getAddress.io-client", "sub_path": "/src/main/java/com/lindar/getaddress/io/client/api/IPAddressResource.java", "file_name": "IPAddressResource.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "6768dd9a93921c56259379ae768024d5318a75e9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lindar-open/getAddress.io-client | 206 | FILENAME: IPAddressResource.java | 0.245085 | package com.lindar.getaddress.io.client.api;
import com.google.gson.reflect.TypeToken;
import com.lindar.getaddress.io.client.util.GetAddressConfigs;
import com.lindar.getaddress.io.client.vo.GetAddressResponse;
import com.lindar.getaddress.io.client.vo.IPAddressVO;
import com.lindar.wellrested.vo.Result;
import java.util.List;
public class IPAddressResource extends AbstractResource {
private static final String IP_ADDRESS_ENDPOINT = "/security/ip-address-whitelist";
public IPAddressResource(GetAddressConfigs getAddressConfigs) {
super(getAddressConfigs);
}
public Result<List<IPAddressVO>> list() {
return getListRequest(IP_ADDRESS_ENDPOINT, new TypeToken<List<IPAddressVO>>() {});
}
public Result<GetAddressResponse> add(IPAddressVO ipAddressVO) {
return postRequest(IP_ADDRESS_ENDPOINT, ipAddressVO);
}
public Result<GetAddressResponse> delete(String id) {
return deleteRequest(IP_ADDRESS_ENDPOINT, id);
}
}
|
9302c120-8af9-4b28-b6b9-5c9f95aac064 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-28 05:44:06", "repo_name": "ysakanaka/BioNEAT", "sub_path": "/src/main/java/erne/mutation/rules/TogglePseudoTemplate.java", "file_name": "TogglePseudoTemplate.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "978326ecb9c0fd4254c5ec6f5626317008aa6550", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ysakanaka/BioNEAT | 250 | FILENAME: TogglePseudoTemplate.java | 0.289372 | package erne.mutation.rules;
import erne.Individual;
import erne.mutation.MutationRule;
import reactionnetwork.Node;
public class TogglePseudoTemplate extends MutationRule {
public double probGeneMutation = 0.3;
public TogglePseudoTemplate(int weight) {
super(weight);
}
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public Individual mutate(Individual indiv) {
for (Node node : indiv.getNetwork().nodes) {
if (node.type == Node.SIMPLE_SEQUENCE && !node.protectedSequence && !node.reporter) { //Elongating protected sequences would be a mess... Reporter would give wrong readouts
if (rand.nextDouble() < probGeneMutation) {
node.hasPseudoTemplate = !node.hasPseudoTemplate;
}
}
}
return indiv;
}
@Override
public boolean isApplicable(Individual indiv) {
for (Node node : indiv.getNetwork().nodes) {
if (node.type == Node.SIMPLE_SEQUENCE && !node.protectedSequence && !node.reporter) return true;
}
return false;
}
}
|
b2e261c7-289c-4893-94ac-d4729f048a5f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-22 16:28:38", "repo_name": "yanisdxw/micro-service", "sub_path": "/service-1/src/test/java/com/dxw/cloud/account/AccountServiceTest.java", "file_name": "AccountServiceTest.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "23062c010e255bed291fb6ba1428b9b1b279355f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yanisdxw/micro-service | 207 | FILENAME: AccountServiceTest.java | 0.286169 | package com.dxw.cloud.account;
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 static org.junit.Assert.*;
@RunWith(SpringRunner.class)
@SpringBootTest
public class AccountServiceTest {
@Autowired
AccountService accountService;
@Autowired
AccountMapper accountMapper;
@Test
public void test(){
Account account = new Account();
account.setName("yanis");
account.setNum("136057");
account.setBalance(10000D);
accountService.createAccount(account);
}
@Test
public void test2(){
Account account = accountMapper.getAccountById(1);
System.out.println(account);
}
@Test
public void test3(){
Double balance = accountService.drawMoney(2,500d);
System.out.println("left:"+balance);
}
} |
a878287f-c37b-4c41-a7a2-bc295b624645 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-03 15:24:05", "repo_name": "MahmoudAymann/MySpareOld", "sub_path": "/app/src/main/java/com/spectraapps/myspare/navdrawer/AboutActivity.java", "file_name": "AboutActivity.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "b3506e188f6f437737a92fabb5fcf1087be23d60", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MahmoudAymann/MySpareOld | 210 | FILENAME: AboutActivity.java | 0.203075 | package com.spectraapps.myspare.navdrawer;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import com.spectraapps.myspare.R;
public class AboutActivity extends AppCompatActivity {
private static final String MOBILE_NUM = "+97455894745";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent dialIntent = new Intent(Intent.ACTION_DIAL);
dialIntent.setData(Uri.parse("tel:" + MOBILE_NUM));
startActivity(dialIntent);
}
});
}
}
|
04973a24-9014-42db-be64-cbb8d155b8c2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-11 15:26:15", "repo_name": "Adronik/Book", "sub_path": "/src/main/java/Pages/LandingPage.java", "file_name": "LandingPage.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "bbd254d1ec6d1d2ea84edb16340a6492453c98a3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Adronik/Book | 200 | FILENAME: LandingPage.java | 0.252384 | package Pages;
import Utils.BasePage;
import Utils.WebdriverControl;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
public class LandingPage extends BasePage {
@FindBy(xpath = "//a[@href = \"/chapter1\"]")
private WebElement chapter1Link;
@FindBy(className = "mainbody")
private WebElement landingText;
public ChapterOnePage clickOnChapterOneLink() {
WebDriverWait wait = new WebDriverWait(WebdriverControl.driver, 10);
wait.until(ExpectedConditions.elementToBeClickable(chapter1Link));
chapter1Link.click();
return new ChapterOnePage();
}
public String textFromLandingPage() {
WebDriverWait wait = new WebDriverWait(WebdriverControl.driver, 10);
wait.until(ExpectedConditions.elementToBeClickable(chapter1Link));
return landingText.getText();
}
} |
dc3f4038-e7c7-428c-afd9-52e997e5d485 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-15 13:08:03", "repo_name": "xinghen110/szjh", "sub_path": "/src/main/java/com/magustek/szjh/config/ApplicationStartup.java", "file_name": "ApplicationStartup.java", "file_ext": "java", "file_size_in_byte": 1078, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "d28a3c36d308bf18b4eaee35c7b1db50618354ea", "star_events_count": 2, "fork_events_count": 5, "src_encoding": "UTF-8"} | https://github.com/xinghen110/szjh | 205 | FILENAME: ApplicationStartup.java | 0.214691 | package com.magustek.szjh.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
/**
* 初始化方法
*
* */
@Slf4j
@Component
public class ApplicationStartup implements ApplicationListener<ContextRefreshedEvent> {
@Autowired
private InitConfigData initConfigData;
@Value("${zuser.service}")
private String zuser_service;
/**
* Handle an application event.
*
* @param event the event to respond to
*/
@Override
public void onApplicationEvent(ContextRefreshedEvent event){
log.warn("初始化开始!");
try {
if(initConfigData!=null){
//initConfigData.init();
}
} catch (Exception e) {
e.printStackTrace();
}
log.warn("初始化完成!");
}
}
|
5360fda4-2312-47d6-b885-d41668bfed36 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-10-30T11:58:27", "repo_name": "heyjaywilson/moodlogger", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 995, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "2d0dc540094fa0c67712106d0abc593c2f7aba10", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/heyjaywilson/moodlogger | 261 | FILENAME: README.md | 0.193147 | 



# Mood Log
An iOS App to log your mood and see health stats.
# T.O.C
- [iOS Requirements](ios-requirements)
- [Data in the App](data-in-the-app)
# iOS Requirments
- iOS 13.0 or greater
- HealthApp data
- Apple Watch
- An Apple Watch is not required.
- The Apple Watch can be used to log moods and send Activity Ring information back to the phone
# Data in the App
All of your data is stored on your device. I will **not** **get** any of your data or **see** any of your data.
This application requires access to the Health App on the iPhone to read the health data you already have been storing. |
a3caf1e0-74f6-4a03-91d6-7a202d785602 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-30 02:58:24", "repo_name": "newSue/aster", "sub_path": "/aster.crawler/aster/src/main/java/com/bluestone/aster/user/bean/UserSystemLog.java", "file_name": "UserSystemLog.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ea59c21a0c24685378786349f3981838924e418b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/newSue/aster | 248 | FILENAME: UserSystemLog.java | 0.245085 | package com.bluestone.aster.user.bean;
import com.bluestone.aster.utils.UUIDUtil;
import java.io.Serializable;
/**
* Created by lichong on 2016/9/12.
*/
public class UserSystemLog implements Serializable {
private String sysLogId;
private String userId;//用户ID
private String userIP;
private String channel;
private String version;
private String serviceId;
private String inputData;
private String startTime;
private String endTime;
private String state;//是否成功 success正常返回 error异常返回
private String errorMessage;//异常信息
public UserSystemLog(String userId, String userIP, String channel, String version,String serviceId, String inputData, String startTime, String endTime,String state,String errorMessage) throws Exception {
this.sysLogId = new UUIDUtil().getNextIdTime();
this.userId = userId;
this.userIP = userIP;
this.channel = channel;
this.version = version;
this.serviceId = serviceId;
this.inputData = inputData;
this.startTime = startTime;
this.endTime = endTime;
this.state = state;
this.errorMessage = errorMessage;
}
}
|
446c05fd-37b1-463e-9b45-b8d8e5adde18 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-10-22T12:56:35", "repo_name": "gossie/magnanimous-writer", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1176, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "ed01bb2f986db54eca5cc79e0c6dc4266c5e6b84", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gossie/magnanimous-writer | 263 | FILENAME: README.md | 0.268941 | # Magnanimous writer
The repository contains a Spring-Boot implementation of a magnanimous writer to handle several versions of a REST API. Also the application implements
## Run the application
Compile all parts of the application by running `mvn clean package` on the parent. Start the application with `java -jar app/target/magnanimouswriter-app-0.0.1-SNAPSHOT.jar`.
## Domain
The REST API makes it possible to retrieve and create movies. The datamodel looks like this:

## API
The REST API provides a GET and a POST method on the movie resource.
Description | URL | Method
------------------- | -------------------------------- | ------
Retrieve all movies | http://localhost:8080/api/movies | GET
Create a movie | http://localhost:8080/api/movies | POST
There are three versions of the REST API. The version is part of the media type.
* application/vnd.magnanimouswriter.v1+json
* application/vnd.magnanimouswriter.v2+json
* application/vnd.magnanimouswriter.v3+json
When an older version is requested, the request is forwarded through each newer version and finally executed on the domain.
|
21dae3ea-691a-4438-8753-207aabc58329 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-07 18:50:38", "repo_name": "Ginbob/ArtistDemo", "sub_path": "/src/main/java/de/burandt/artists/contact/config/ContactConfiguration.java", "file_name": "ContactConfiguration.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "fca4d4cda6efdc3fdd02dca3b8bb8cf62febfcdc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Ginbob/ArtistDemo | 196 | FILENAME: ContactConfiguration.java | 0.214691 | package de.burandt.artists.contact.config;
import de.burandt.artists.contact.service.ContactServiceProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import java.util.Properties;
@Configuration
public class ContactConfiguration {
@Bean
public JavaMailSenderImpl javaMailSenderImpl(ContactServiceProperties properties) {
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost("send.one.com");
mailSender.setPort(587);
mailSender.setUsername(properties.getSender());
mailSender.setPassword(properties.getPassword());
Properties props = mailSender.getJavaMailProperties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.debug", "true");
return mailSender;
}
}
|
8890daae-9d75-4ba3-b524-428a193c0c76 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-08 19:21:54", "repo_name": "RLegun/JavaCoreProject", "sub_path": "/src/TaxiService/TaxiDriver.java", "file_name": "TaxiDriver.java", "file_ext": "java", "file_size_in_byte": 1181, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "a3cd1fcf848724c7be0abec05d665eb8b5e6476e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/RLegun/JavaCoreProject | 257 | FILENAME: TaxiDriver.java | 0.253861 | package TaxiService;
import java.time.LocalDate;
public final class TaxiDriver extends Employee {
private Car car;
private int id;
public TaxiDriver() {
super();
car = car;
id = 0;
}
public TaxiDriver(String name, String surname, LocalDate bornDate, String numberPhone, Car car) {
super(name, surname, bornDate, numberPhone);
this.car = car;
this.id = TaxiDriverList.getTaxiDrivers().size()+1;
}
public Car getCar() {
return car;
}
public void setCar(Car car) {
this.car = car;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Override
public String toString() {
return "Водій{" +
"id='" + getId() +'\'' +
"name='" + getName() + '\'' +
", surname='" + getSurname() + '\'' +
", bornDate=" + getBornDate() +
", numberPhone='" + getNumberPhone() +
"\n"+ getCar()+
"\n-----------------------------------------------------------------------------------------------";
}
}
|
0207117f-6ccf-4feb-869c-829f1b10c760 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-07 05:56:00", "repo_name": "Bhismydv/FirebasePhoneNumberAuthentication", "sub_path": "/app/src/main/java/com/example/firebasephonenumberauthentication/ProfileActivity.java", "file_name": "ProfileActivity.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "3a6ee77669d7e85897388224921430c9e90b698e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Bhismydv/FirebasePhoneNumberAuthentication | 147 | FILENAME: ProfileActivity.java | 0.205615 | package com.example.firebasephonenumberauthentication;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.google.firebase.auth.FirebaseAuth;
public class ProfileActivity extends AppCompatActivity {
FirebaseAuth firebaseAuth;
Button btnLogout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
firebaseAuth=FirebaseAuth.getInstance();
btnLogout=findViewById(R.id.buttonLogout);
btnLogout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
firebaseAuth.signOut();
Intent intent=new Intent(getApplicationContext(),MainActivity.class);
startActivity(intent);
}
});
}
}
|
1125186e-e49a-42c1-abb4-d2b14cd98001 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-28 10:41:18", "repo_name": "punit-patil/RchiveAutomation", "sub_path": "/src/main/java/co/rchive/pages/verifyemailspages/RchiveEmailVerificationForConRequest.java", "file_name": "RchiveEmailVerificationForConRequest.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "2f26476ee279687049d66f89a0b5ee56a9f5b075", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/punit-patil/RchiveAutomation | 231 | FILENAME: RchiveEmailVerificationForConRequest.java | 0.290981 | package co.rchive.pages.verifyemailspages;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import co.rchive.util.Wait;
public class RchiveEmailVerificationForConRequest extends RchiveEmailVerificationForSignUp {
private WebDriver driver;
@FindBy(xpath = "//table/tbody/tr/td/div/table[2]/tbody/tr/td/div[1]/div/p[3]")
private WebElement mailText;
public RchiveEmailVerificationForConRequest(WebDriver driver) {
super(driver);
this.driver = driver;
PageFactory.initElements(this.driver, this);
}
public boolean verifyRchiveConRequestEmail(String senderName, String subject,String connectionReqMsg) {
boolean flag = this.verifyRchiveWelcomeEmail(senderName, subject);
new Wait(driver).waitForElementToBeVisible(mesageContent, 6);
if (flag) {
System.out.println(mailText.getText());
flag = mailText.getText().contentEquals(connectionReqMsg);
}
return flag;
}
}
|
b6c33729-d9ae-432c-8194-66e45576fbc9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-05-13T21:46:46", "repo_name": "wunsmat/BVU-Info", "sub_path": "/src/com/example/bvinfo/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "4ab9e3f5b37eb7a7224da18795a662d0784d6ea7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wunsmat/BVU-Info | 234 | FILENAME: MainActivity.java | 0.294215 | package com.example.bvinfo;
import org.apache.cordova.Config;
import org.apache.cordova.DroidGap;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;
import com.pushbots.push.Pushbots;
public class MainActivity extends DroidGap {
private String SENDER_ID = "396995276909";
private String PUSHBOTS_APPLICATION_ID = "5355f0aa1d0ab1096b8b456a";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.init();
appView.addJavascriptInterface(this, "MainActivity");
super.loadUrl(Config.getStartUrl());
Pushbots.init(this, SENDER_ID,PUSHBOTS_APPLICATION_ID);
}
public int customFunction() {
return 42;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
|
5383694a-63fc-48df-a5af-4c5b170a9fd6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-15 19:09:49", "repo_name": "amrm2018/amr_project", "sub_path": "/app/src/main/java/atfalna/atfalna/Login_Register_Java/Send_Data_Registration.java", "file_name": "Send_Data_Registration.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "40309ccf8efedaad754608bb7e85b66dd3ea0613", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/amrm2018/amr_project | 247 | FILENAME: Send_Data_Registration.java | 0.271252 | package atfalna.atfalna.Login_Register_Java;
/**
* Created by amr1 on 2/21/2018.
*/
import com.android.volley.Response;
import com.android.volley.toolbox.StringRequest;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
public class Send_Data_Registration extends StringRequest {
private static final String SEND_DATA_URL = "http://192.168.1.3/atfalna_app/register.php"; // "http://localhost/app_atf/register_db_atf.php"
private Map<String, String> MapData;
public Send_Data_Registration(String name, String email, String password,String gender, String phone, Response.Listener<String> listener) {
super(Method.POST, SEND_DATA_URL, listener, null);
MapData = new HashMap<>();
MapData.put("user_name", name);
MapData.put("user_email", email);
MapData.put("password", password);
MapData.put("user_gender", gender);
MapData.put("user_phone", phone);
}
@Override
public Map<String, String> getParams() {
return MapData;
}
} |
faed810f-f8bd-4fbc-9790-fc57d407ac7f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-16 22:48:46", "repo_name": "mehrdadinho/review-product", "sub_path": "/src/main/java/com/mehrdad/reviewproduct/model/Order.java", "file_name": "Order.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "b67077d48d9514865a3a749019aaac6e37284e64", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mehrdadinho/review-product | 221 | FILENAME: Order.java | 0.282988 | package com.mehrdad.reviewproduct.model;
import com.mehrdad.reviewproduct.model.enums.OrderStatus;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;
/**
* Created by m.peykari on 2/15/2021.
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "orders")
public class Order {
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Long id;
@Column(name = "status")
@Enumerated(value = EnumType.ORDINAL)
private OrderStatus orderStatus;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id")
private User user;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "product", orphanRemoval = true,
cascade = {javax.persistence.CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE})
private Set<OrderDetail> orderDetails;
@Column(name = "date")
private Date date;
}
|
9ac5a29f-d0af-42f2-99cc-412619aa48dd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-11 20:31:48", "repo_name": "AlisherNurgazin/Scheduler", "sub_path": "/src/main/java/kz/spring/product/model/Role.java", "file_name": "Role.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "aeb94a97c49669468cfd41f9b3424cca4cef721d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AlisherNurgazin/Scheduler | 234 | FILENAME: Role.java | 0.27513 | package kz.spring.product.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.security.core.GrantedAuthority;
import javax.persistence.*;
import java.util.List;
@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "roles")
@EntityListeners(AuditingEntityListener.class)
@EqualsAndHashCode
public class Role implements GrantedAuthority{
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "roleSequenceGenerator")
@SequenceGenerator(name = "roleSequenceGenerator", sequenceName = "roleSequence", allocationSize = 1)
private Long id;
private String name;
@ManyToMany(mappedBy = "roles" , fetch = FetchType.EAGER)
private List<User> users;
@Override
public String toString() {
return "Role{" +
"id=" + id +
", name='" + name + '\'' +
", users=" + users +
'}';
}
public Role(String name) {
this.name = name;
}
@Override
public String getAuthority() {
return name;
}
} |
7583eae1-9a84-4859-b971-f40037d7ea08 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-08 11:13:51", "repo_name": "flypig5211/Jcoffe", "sub_path": "/memshell/src/main/java/com/sorry/bug/UnserializeServlet.java", "file_name": "UnserializeServlet.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "c9c8ebc316ce9696385da5286f670308ed67d092", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/flypig5211/Jcoffe | 232 | FILENAME: UnserializeServlet.java | 0.233706 | package com.sorry.bug;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.Writer;
/**
* created by 0x22cb7139 on 2021/7/9
*/
public class UnserializeServlet implements Servlet {
@Override
public void init(ServletConfig servletConfig) throws ServletException {
}
@Override
public ServletConfig getServletConfig() {
return null;
}
@Override
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException{
HttpServletRequest req = (HttpServletRequest) servletRequest;
HttpServletResponse rsp = (HttpServletResponse) servletResponse;
try{
InputStream is = req.getInputStream();
ObjectInputStream ois = new ObjectInputStream(is);
ois.readObject();
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public String getServletInfo() {
return null;
}
@Override
public void destroy() {
}
}
|
63ddd29f-0ada-4433-8810-103c9c521ecf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-21 04:31:48", "repo_name": "xfeier53/Snake", "sub_path": "/Server/src/com/anu/GetBestScore.java", "file_name": "GetBestScore.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "2f46e31b6ef2f17b3710542a1df3b6c730d6e558", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xfeier53/Snake | 203 | FILENAME: GetBestScore.java | 0.29584 | /*
Authorship: Feier Xiao
*/
package com.anu;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class GetBestScore {
public int getBestScore(String account){
int score = 0;
// Set query
String query = "SELECT BestScore FROM AndroidUser WHERE Account = '" + account + "'";
try{
// Get the driver class
Class.forName(CONSTANTS.DRIVER);
// Create connection and retrieve the result
Connection conn = DriverManager.getConnection(CONSTANTS.URL, CONSTANTS.USER, CONSTANTS.PASSWORD);
Statement stm = conn.createStatement();
ResultSet rs = stm.executeQuery(query);
if (rs.next()) {
score = rs.getInt(1);
}
// close Connection and ResultSet
rs.close();
stm.close();
conn.close();
}catch (Exception e) {
System.out.println(e);
}
return score;
}
}
|
75105bbb-d278-46e4-8652-433bde6cff65 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-23 05:51:15", "repo_name": "luyulove001/coeus-weibo", "sub_path": "/app/src/main/java/net/tatans/coeus/weibo/util/HomeSpan.java", "file_name": "HomeSpan.java", "file_ext": "java", "file_size_in_byte": 1184, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "ef16eed5889593c4a1b7fae4012ec7bc99698e0d", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/luyulove001/coeus-weibo | 270 | FILENAME: HomeSpan.java | 0.26971 | package net.tatans.coeus.weibo.util;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;
/**
* Created by LCM on 2016/8/5. 13:38
* 链接跳转
*/
public class HomeSpan extends ClickableSpan {
private String mtext;
private Context mContext;
private static HomeSpan homeSpan;
private HomeSpan(String text, Context context) {
this.mtext = text;
this.mContext = context;
}
public static HomeSpan getInstance(String text, Context context) {
homeSpan = new HomeSpan(text, context);
return homeSpan;
}
@Override
public void updateDrawState(TextPaint ds) {
super.updateDrawState(ds);
ds.setColor(Color.parseColor("#ff00ffff"));
ds.setUnderlineText(true);
}
@Override
public void onClick(View widget) {
String vvv = mtext;
System.out.println(vvv);
final Uri uri = Uri.parse(mtext);
final Intent it = new Intent(Intent.ACTION_VIEW, uri);
mContext.startActivity(it);
}
}
|
261e1f7c-9824-4119-b036-5ff8d3f2e11b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-18 13:40:48", "repo_name": "r0384156/gameSite", "sub_path": "/src/test/java/be/multimedi/gameSite/AppTest.java", "file_name": "AppTest.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "07840f366f2cae584d77b63d0189a79e7742d74f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/r0384156/gameSite | 222 | FILENAME: AppTest.java | 0.249447 | package be.multimedi.gameSite;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class AppTest {
@BeforeAll
void startSomething() {
System.out.println("Starting something");
}
@BeforeEach
void createSomething() {
System.out.println("Creating something");
}
@Test
@DisplayName("sampleMyTest")
void sampleTest() {
assertTrue(true, "This should be true!");
}
@Test
@DisplayName("failMyTest")
void failTest() {
boolean failTheTest = false;
if (failTheTest) {
System.out.println("Oh NO!");
fail("I made a programming mistake here!");
} else {
System.out.println("Lucky me!");
assertTrue(true);
}
}
@AfterEach
void closeSomething() {
System.out.println("Closing something");
}
@AfterAll
void endSomething() {
System.out.println("Ending something");
}
}
|
26243011-8193-44e5-89e3-e0ea89203d80 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-06-16T00:05:17", "repo_name": "DigHis2020/weekSix", "sub_path": "/notes.md", "file_name": "notes.md", "file_ext": "md", "file_size_in_byte": 1053, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "cce4e8ce8aed902d377f1a18050c0cc2f99e4dc8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DigHis2020/weekSix | 236 | FILENAME: notes.md | 0.239349 | pg. 16-24 Voyant link
details mostly family and friend relationships. Definitely the most sparse of the sections in my opinion in regards to worthwhile data.
pg. 25-43 Voyant link
contains details related to her social networks and how she interacted with her wider social connections. What did she do for fun? Who was she friends with? Where did she frequently go?
pg. 44 - end Voyant link
once again details her wide social network in relation to Christmas gift giving. Also has her financial tables which are very revealing.
Breakdown of chart categories on Excel:
food - bread, paying for lunches
home management - sewing, paying the cleaning lady, clothing, sending telegrams to family
entertainment - opera tickets, art tickets
car - car fares
miscellaneous - any unknown purchases by Bailey, writing cheques etc.
I had some difficutly uploading my png file of my Inkscape poster so I had to upload it as a screenshot.
I exported it properly but when I tried to view it in Github after uploading it, it showed up as blank.
|
46edbe67-c293-46a3-911e-ed32a4a69a95 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-06-13 05:50:00", "repo_name": "saaperezru/iudex", "sub_path": "/src/main/java/org/xtremeware/iudex/businesslogic/service/updateimplementations/UsersUpdate.java", "file_name": "UsersUpdate.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "f3623367adbd2abc9c20765320a18345ba64af2f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/saaperezru/iudex | 256 | FILENAME: UsersUpdate.java | 0.282196 | package org.xtremeware.iudex.businesslogic.service.updateimplementations;
import javax.persistence.EntityManager;
import org.xtremeware.iudex.businesslogic.service.crudinterfaces.Update;
import org.xtremeware.iudex.dao.CrudDao;
import org.xtremeware.iudex.entity.UserEntity;
import org.xtremeware.iudex.helper.DataBaseException;
import org.xtremeware.iudex.helper.SecurityHelper;
/**
*
* @author healarconr
*/
public class UsersUpdate implements Update<UserEntity> {
private CrudDao<UserEntity> dao;
public UsersUpdate(CrudDao<UserEntity> dao) {
this.dao = dao;
}
@Override
public UserEntity update(EntityManager em, UserEntity entity) throws DataBaseException {
UserEntity existingUser = getDao().read(em, entity.getId());
if (existingUser != null) {
entity.setUserName(existingUser.getUserName());
entity.setRole(existingUser.getRole());
entity.setPassword(SecurityHelper.hashPassword(entity.getPassword()));
return getDao().update(em, entity);
} else {
return null;
}
}
public CrudDao<UserEntity> getDao() {
return dao;
}
}
|
516cb6ef-c99e-411a-b72b-252bd3ea2c6f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-02-06 03:06:30", "repo_name": "foilen/database-tools", "sub_path": "/src/main/java/com/foilen/databasetools/manage/CommonCreateManageConfigOptions.java", "file_name": "CommonCreateManageConfigOptions.java", "file_ext": "java", "file_size_in_byte": 860, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "d54b9adb3a9af51cdc1b3ab2790b193946b7716f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/foilen/database-tools | 225 | FILENAME: CommonCreateManageConfigOptions.java | 0.255344 | /*
Database Tools
https://github.com/foilen/database-tools
Copyright (c) 2020-2023 Foilen (https://foilen.com)
The MIT License
http://opensource.org/licenses/MIT
*/
package com.foilen.databasetools.manage;
import org.kohsuke.args4j.Option;
/**
* The arguments to pass to the application.
*/
public class CommonCreateManageConfigOptions {
@Option(name = "--connectionConfig", usage = "The config files that contains the connection information")
private String connectionConfig;
@Option(name = "--outputFile", usage = "The file where to store the configuration (default: output to shell)", required = false)
private String outputFile;
public String getConnectionConfig() {
return connectionConfig;
}
public String getOutputFile() {
return outputFile;
}
public void setConnectionConfig(String connectionConfig) {
this.connectionConfig = connectionConfig;
}
public void setOutputFile(String outputFile) {
this.outputFile = outputFile;
}
}
|
506bfc10-4746-4293-8e88-a1133a63f4fd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-12-19 03:38:41", "repo_name": "gauravrmazra/gauravbytes", "sub_path": "/springjdbc-examples/src/main/java/com/gauravbytes/springjdbc/ProductBatchPreparedStatementSetter.java", "file_name": "ProductBatchPreparedStatementSetter.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "783129984762364f4623ff26831ee155b8ec6f7b", "star_events_count": 62, "fork_events_count": 159, "src_encoding": "UTF-8"} | https://github.com/gauravrmazra/gauravbytes | 213 | FILENAME: ProductBatchPreparedStatementSetter.java | 0.273574 | package com.gauravbytes.springjdbc;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;
import java.util.Objects;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import com.gauravbytes.springjdbc.dto.Product;
/**
*
* @author Gaurav Rai Mazra <a href="https://gauravbytes.com">My blog</a>
* <a href="https://lineofcode.in">Website</a>
*/
public class ProductBatchPreparedStatementSetter implements BatchPreparedStatementSetter {
private final List<Product> products;
public ProductBatchPreparedStatementSetter(List<Product> products) {
Objects.requireNonNull(products);
this.products = products;
}
@Override
public void setValues(PreparedStatement ps, int i) throws SQLException {
Product product = products.get(i);
ps.setString(1, product.getName());
ps.setString(2, product.getCategory());
ps.setString(3, product.getDescription());
}
@Override
public int getBatchSize() {
return products.size();
}
}
|
f3d896bb-5a32-423d-8f89-5373e01102db | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-19 13:00:58", "repo_name": "RedIce1999/zhbMusic", "sub_path": "/music/src/test/java/com/zhb/music/dao/CommentTest.java", "file_name": "CommentTest.java", "file_ext": "java", "file_size_in_byte": 1061, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "2113f5a713071e68c73947079274174fd57ae878", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/RedIce1999/zhbMusic | 213 | FILENAME: CommentTest.java | 0.228156 | package com.zhb.music.dao;
import com.zhb.music.domain.Comment;
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 java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest
public class CommentTest {
@Autowired
private CommentMapper commentMapper;
//插入一条数据
@Test
public void insert(){
Comment comment=new Comment();
comment.setUserId(1);
comment.setSongId(1);
comment.setSongListId(80);
comment.setContent("好");
comment.setType((byte)1);
comment.setUp(1);
commentMapper.insertSelective(comment);
}
//根据id删除
@Test
public void deleteById(){
commentMapper.deleteComment(59);
}
@Test
public void allComment(){
List<Comment> comments = commentMapper.allComment();
System.out.println(comments);
}
}
|
2711be5e-5a6b-42e5-bcb4-4d61b1f2f37f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-03-31T16:30:19", "repo_name": "Zeukkari/terminal-corona", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 978, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "1319cdf38f6d8df0e3431ce9c948af2cf18582ea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Zeukkari/terminal-corona | 232 | FILENAME: README.md | 0.291787 | # terminal-corona
corona status view shell script.
table, list and lingle line output.
1. clone web-data branch from https://github.com/CSSEGISandData/COVID-19.git to temp folder
2. parse intresting list countrie data and show it in terminal.
## source
CSSE at Johns Hopkins University COVID-19
https://github.com/CSSEGISandData/COVID-19/blob/web-data/data/cases_country.csv
## help output
-- ujo.guru terminal-corona help -----------------------------------
usage: terminal-corona [command|Country]
commands:
status all interesting (hard coded) countries
table some kind of table view
short <Country> one line statistics
view <interval> table vie of all countries, updates
hourly (or input amount of seconds)
web open web view in source github page
example:
terminal-corona status
terminal-corona Estonia
terminal-corona view 10
## screen shot
"
|
63abd6c0-95a1-442e-89c6-b9f1118d8b2e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-13 12:13:00", "repo_name": "atymkiv/Arduino_Checkers", "sub_path": "/Checkers_algorithm/src/test.java", "file_name": "test.java", "file_ext": "java", "file_size_in_byte": 1056, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "eca7acdc19f800b01d9bee1bd104c7a2e356dd04", "star_events_count": 0, "fork_events_count": 9, "src_encoding": "UTF-8"} | https://github.com/atymkiv/Arduino_Checkers | 223 | FILENAME: test.java | 0.264358 | import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
public class test {
public static void main (String[]args) throws IOException {
ObjectMapper mapper = new ObjectMapper();
File file = new File("HashMapForBoards(StringHash).json");
TypeReference<HashMap<String,char[][]>> typeRef
= new TypeReference<HashMap<String, char[][]>>() {};
HashMap<String,char[][]> newHash= mapper.readValue(file,typeRef);
int count = 1;
for (HashMap.Entry<String,char[][]> entry : newHash.entrySet())
{
}
System.out.println(count);
}
static void printBoard(char board[][]) {
for (int i = 0; i < board.length; i++) {
for (int j = 0; j < board.length; j++) {
System.out.print(" " + board[i][j] + " ");
}
System.out.println();
}
}
}
|
f4ce02fa-95d5-443c-a289-22574294a353 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-01 14:46:59", "repo_name": "hefuren/iplatform", "sub_path": "/src/iplatform/src/main/java/com/bluesky/iplatform/component/from/model/FormList.java", "file_name": "FormList.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "9946ed1f61c56511b5f4257786c29565f54aae73", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hefuren/iplatform | 287 | FILENAME: FormList.java | 0.282196 | package com.bluesky.iplatform.component.from.model;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import lombok.Data;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Data
@Component(value = "FormList")
@Entity
@Scope(value = "prototype")
@Table(name = "fm_formlist", schema = "public")
public class FormList {
/**
* 排序方式:ASC 升序排列
*/
public static final int ORDER_TYPE_ASC = 0;
/**
* 排序方式:DSEC 升序排列
*/
public static final int ORDER_TYPE_DSEC = 1;
//Field
@Id
@Column(name = "id", unique = true, nullable = false)
private Integer id;
@Column(name = "schemaid", nullable = false)
private Integer schemaID;
/**
* 默认排序的字段名称
*/
@Column(name = "orderby", length = 50)
private String orderBy;
@Column(name = "ordertype")
private Integer orderType;
@Column(name = "companyid", nullable = false)
private Integer companyID;
@Transient
private List<FormListItem> formListItems = new ArrayList<FormListItem>();
}
|
7abf66a9-62e9-4e40-b536-3ad6fdf44370 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-18 18:30:21", "repo_name": "MehdiChouag/OnceAndroidTest", "sub_path": "/app/src/main/java/com/once/android/testandroid/OnceApplication.java", "file_name": "OnceApplication.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "58899007b7e7d62d0d31dbfded4319734df99089", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MehdiChouag/OnceAndroidTest | 188 | FILENAME: OnceApplication.java | 0.23793 | package com.once.android.testandroid;
import android.app.Application;
import android.content.Context;
import android.support.annotation.NonNull;
import com.once.android.testandroid.di.component.ApplicationComponent;
import com.once.android.testandroid.di.component.DaggerApplicationComponent;
import com.once.android.testandroid.di.module.ApplicationModule;
import com.once.android.testandroid.di.module.NetModule;
/**
* Created by mehdi on 18/05/2017.
*/
public class OnceApplication extends Application {
private ApplicationComponent applicationComponent;
public static OnceApplication get(@NonNull Context context) {
return (OnceApplication) context;
}
@Override public void onCreate() {
super.onCreate();
applicationComponent = DaggerApplicationComponent.builder()
.applicationModule(new ApplicationModule(this))
.netModule(new NetModule(this))
.build();
}
public ApplicationComponent getApplicationComponent() {
return applicationComponent;
}
}
|
d419caff-23b0-4a3f-bffe-28990cb4bd3a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-06-25T01:11:37", "repo_name": "fernandamariscal/Equipo_2_D14", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1181, "line_count": 42, "lang": "en", "doc_type": "text", "blob_id": "ec31f313630204d6a212c9f342848d2eca6fef44", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fernandamariscal/Equipo_2_D14 | 345 | FILENAME: README.md | 0.214691 | ## Final_Projet.
* This repository contains our final project.
# Members | Phase 1.
<ol>
<li>Oscar Beltran Villegas | <strong>Scripter</strong>.</li>
<li>Mariscal Viorato Maria Fernanda | <strong>Admin</strong>.</li>
<li>Ramírez Vázquez Ezequiel Alberto | <strong>Documenter</strong>.</li>
<li> De La Cruz Chavarria Christian Israel | <strong>H-Designer</strong>.</li>
</ol>
# Members | Phase 2.
<ol>
<li>Oscar Beltran Villegas | <strong>Scripter</strong>.</li>
<li>Mariscal Viorato Maria Fernanda | <strong>Documenter</strong>.</li>
<li>Ramírez Vázquez Ezequiel Alberto | <strong>H-Designer</strong>.</li>
<li> De La Cruz Chavarria Christian Israel | <strong>Admin</strong>.</li>
</ol>
## Commands to use git.
* '***git status***' to view your repo status.
* '***git add***' to add files what you want upload to changes.
* '***git commit -m "tag"***' to put a tag in your changes.
* '***git push***' to upload your changes to origin/master repo.
* '***git fetch -a***' to update your repo.
* '***git pull***' to set new changes in my local repo.
## Folders:
* Modules >> Verilog codes.
* Screen >> S. Captures.
* Script >> C program.
* Test_B >> Code test. |
cf7ee8cd-ca88-4f1e-b46e-27a2cb5b7e99 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-30 15:40:46", "repo_name": "fabriciolfj/spring-webflux", "sub_path": "/src/main/java/com/github/fabriciolfj/springwebflux/domain/service/ItemService.java", "file_name": "ItemService.java", "file_ext": "java", "file_size_in_byte": 1207, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "5907d6683270581a9aea23b6f17d830f66626576", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fabriciolfj/spring-webflux | 218 | FILENAME: ItemService.java | 0.26588 | package com.github.fabriciolfj.springwebflux.domain.service;
import com.github.fabriciolfj.springwebflux.domain.document.Item;
import com.github.fabriciolfj.springwebflux.domain.repository.ItemRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@Service
public class ItemService {
@Autowired
private ItemRepository itemRepository;
public Flux<Item> findAll() {
return itemRepository.findAll();
}
public Mono<Item> findById(final String id) {
return itemRepository.findById(id);
}
public Mono<Item> create(final Item item) {
return itemRepository.save(item);
}
public Mono<Void> delete(final String id) {
return itemRepository.deleteById(id);
}
public Mono<Item> update(String id, Item item) {
return itemRepository.findById(id)
.flatMap(current -> {
current.setPrice(item.getPrice());
current.setDescription(item.getDescription());
return itemRepository.save(current);
});
}
}
|
3a6c9a7a-fbbe-47a7-8730-27f1c17ed842 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-16 13:19:27", "repo_name": "Tony-Tor/Diplom", "sub_path": "/src/main/java/com/example/diplom/controllers/UserRestController.java", "file_name": "UserRestController.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "3335fd2ce44dcdc36275049465a3e8401d640768", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/Tony-Tor/Diplom | 213 | FILENAME: UserRestController.java | 0.273574 | package com.example.diplom.controllers;
import com.example.diplom.model.User;
import com.example.diplom.model.web.UserTo;
import com.example.diplom.service.UserService;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping(value = "/rest/user", produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("hasAuthority('ADMIN')")
public class UserRestController {
private final UserService service;
public UserRestController(UserService service) {
this.service = service;
}
@GetMapping("/{id}")
public UserTo get(@PathVariable("id") Integer id){
return new UserTo(service.get(id));
}
@GetMapping("/all")
public List<UserTo> getAll(){
return service.getAll().stream().map(UserTo::new).collect(Collectors.toList());
}
}
|
90cc6cf8-558e-4d0e-848e-e454244e758c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-03 11:59:58", "repo_name": "nvthao-math/zada-ml", "sub_path": "/src/main/java/com/zada/data/type/Tuple.java", "file_name": "Tuple.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "3a5cc71549952103d2ddeda64d5cbb46973f43b4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nvthao-math/zada-ml | 302 | FILENAME: Tuple.java | 0.290981 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.zada.data.type;
/**
*
* @author bigdata
* @param <T1>
* @param <T2>
*/
public class Tuple<T1, T2> {
private T1 _1;
private T2 _2;
// constructor
public Tuple() {
super();
}
public Tuple(T1 _1, T2 _2) {
this._1 = _1;
this._2 = _2;
}
/**
* @return the _1
*/
public T1 _1() {
return _1;
}
/**
* @param _1 the _1 to set
*/
public void set1(T1 _1) {
this._1 = _1;
}
/**
* @return the _2
*/
public T2 _2() {
return _2;
}
/**
* @param _2 the _2 to set
*/
public void set2(T2 _2) {
this._2 = _2;
}
@Override
public String toString() {
return String.format("_1: %s, _2: %s", this._1, this._2);
}
}
|
5714baf6-bd58-4191-8d5d-c0140d89fa2a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-06-11 00:33:41", "repo_name": "kvr000/zbynek-java-exp", "sub_path": "/pdf-exp/pdfbox-basic-exp/src/test/java/cz/znj/kvr/sw/exp/java/pdf/pdfbox/ReadTextTest.java", "file_name": "ReadTextTest.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "5c6bd4e10b7440cdd427e23edf3a359072e28c63", "star_events_count": 6, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kvr000/zbynek-java-exp | 261 | FILENAME: ReadTextTest.java | 0.284576 | package cz.znj.kvr.sw.exp.java.pdf.pdfbox;
import lombok.extern.log4j.Log4j2;
import org.apache.pdfbox.cos.COSDocument;
import org.apache.pdfbox.io.RandomAccessFile;
import org.apache.pdfbox.pdfparser.PDFParser;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.text.PDFTextStripper;
import org.testng.annotations.Test;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
/**
* @author
* Zbyněk Vyškovský
*/
@Log4j2
@Test(groups = "unit")
public class ReadTextTest
{
@Test
public void testRead()
{
try (InputStream documentStream = getClass().getResourceAsStream("test-table.pdf");
PDDocument document = PDDocument.load(documentStream)) {
COSDocument cosDocument = document.getDocument();
PDFTextStripper stripper = new PDFTextStripper();
//stripper.setPageStart("1");
//stripper.setPageEnd("10");
String text = stripper.getText(document);
System.out.print(text);
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
}
|
ed50a186-5382-4458-8c01-7677014115f5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-23 00:12:33", "repo_name": "lenik/stack", "sub_path": "/plover/modeling/plover-ox1/src/main/java/com/bee32/icsf/principal/UserController.java", "file_name": "UserController.java", "file_ext": "java", "file_size_in_byte": 1043, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "b31d213dadd26714e2748c25c2b667966327b652", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lenik/stack | 212 | FILENAME: UserController.java | 0.233706 | package com.bee32.icsf.principal;
import java.io.IOException;
import java.io.PrintWriter;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import com.bee32.plover.restful.IRESTfulRequest;
import com.bee32.plover.restful.IRESTfulResponse;
import com.bee32.plover.restful.util.TemplateController;
@Scope("prototype")
@Lazy
@Controller
public class UserController
extends TemplateController<User> {
public UserController() {
super(User.class);
}
@Override
protected void template(int mode, IRESTfulRequest req, IRESTfulResponse resp)
throws Exception {
}
@Transactional(readOnly = true)
public void content(IRESTfulRequest req, IRESTfulResponse resp)
throws IOException {
PrintWriter out = resp.getWriter();
User user = cast(req);
out.println("Template: " + user);
}
}
|
2a11f839-ad73-4d42-9714-dc1a8659af9d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-08 10:42:52", "repo_name": "rocknacl/amws", "sub_path": "/AMWS/src/control/transmission/SocketWriter.java", "file_name": "SocketWriter.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "6799e9355e6808348ab526a005b78aa5b47748e9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rocknacl/amws | 246 | FILENAME: SocketWriter.java | 0.292595 | package control.transmission;
import javax.swing.JOptionPane;
/**
* The thread created to send messages to the server.
* @author kerry
*
*/
public class SocketWriter extends Thread{
private int connectErrorTimes = 0;
private final int connectMaxErrorTimes = 3;
private Connection connection = Connection.getInstance();
private MessageBuffer buffer = MessageBuffer.getInstance();
public SocketWriter(){
}
@Override
public void run() {
while(connection.isConnected()){
System.out.println("Socket Writer ...");
Message message = null;
try {
message = buffer.getMessage();
if(message!=null){
connection.writeMessage(message);
connectErrorTimes = 0;
}
}catch (Exception e) {
try {
if (message != null) buffer.putMessage(message);
} catch (Exception e2) {
e2.printStackTrace();
}
e.printStackTrace();
if(connectErrorTimes>=connectMaxErrorTimes){
try{
connection.disconnect();
}catch(Exception e1){
e1.printStackTrace();
}
}
connectErrorTimes++;
}
}
System.out.println("Socket Writer Close!");
}
}
|
9e24e3a3-50f9-4dc8-955e-44fc842fce4a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-09-02T14:25:08", "repo_name": "sebastianmarines/DevOps-Bootcamp", "sub_path": "/SPRINT-3/SMDB-44.md", "file_name": "SMDB-44.md", "file_ext": "md", "file_size_in_byte": 1176, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "4b7b554c5535d099d68355771323ac3371138607", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sebastianmarines/DevOps-Bootcamp | 284 | FILENAME: SMDB-44.md | 0.259826 | # Logging
Linux logs are stored in the `/var/log` directory.
- **syslog/messages**: This files store all system activity data, including startup messages. Debian based systems use *syslog* and Red Hat based systems use *messages*.
- **auth.log/secure**: Security related events such as logins, root user actions, and PAM outputs. Debian based systems use *auth.log* and Red Hat based systems use *secure*.
- **kern.log**: Kernel events, errors, and warnings.
- **cron.log**: Logs about cronjobs.
## Syslog
Syslog is a standard for creating and transmitting logs.
It is composed of:
- **Syslog service**: Receives and processes syslog messages. It listens to events by creating a socket which applications can write to.
- **Syslog protocol**: A transport protocol that specifies how to transmit logs over a network.
- **Syslog message**: Any log formatted with the Syslog message format.
## Syslog message format
```
Jun 4 22:14:15 server1 sshd[41458] : Failed password for root from 10.0.2.2 port 22 ssh2
```
This format includes a header with the timestamp, the name of the application that generated the event, the location in the filesystem, and the priority.
|
5964e036-6b13-4aea-9baa-abde4e3e8283 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-21 23:34:14", "repo_name": "qiuchili/ggnn_graph_classification", "sub_path": "/program_data/JavaProgramData/19/1112.java", "file_name": "1112.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "39d2d5dc84fb23bcadf9d1fa2e48b7adc2b3842b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/qiuchili/ggnn_graph_classification | 386 | FILENAME: 1112.java | 0.272799 | package <missing>;
public class GlobalMembers
{
public static int Main()
{
String juzi = new String(new char[100]);
char[][] danci = new char[200][200];
String ci1 = new String(new char[200]);
String ci2 = new String(new char[200]);
int i = 0;
int j = 0;
int k = 0;
int f;
int index;
juzi = new Scanner(System.in).nextLine();
ci1 = new Scanner(System.in).nextLine();
ci2 = new Scanner(System.in).nextLine();
index = 0;
for (i = 0;;i++)
{
for (k = 0;;)
{
if (juzi.charAt(index) != ' ' && juzi.charAt(index) != 0)
{
danci[i][k] = juzi.charAt(index);
index++;
k++;
}
else
{
danci[i][k] = 0;
index++;
k++;
break;
}
}
if (juzi.charAt(index - 1) == 0)
{
break;
}
}
for (f = 0;f < 100;f++)
{
if (strcmp(danci[f],ci1) == 0)
{
danci[f] = ci2;
}
}
for (j = 0;j <= i;j++)
{
if (j == i)
{
System.out.printf("%s",danci[j]);
}
else
{
System.out.printf("%s ",danci[j]);
}
}
return 0;
}
}
|
28e3e6d2-2215-4bd1-90c4-ad7c199d7865 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-08-06 14:44:23", "repo_name": "yuanyaosmile/Ly", "sub_path": "/ly-item/ly-item-service/src/main/java/com/yy/item/service/impl/CategoryServiceImpl.java", "file_name": "CategoryServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "8f7e028727b1863c59fe01419b6941dfb1946b2d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yuanyaosmile/Ly | 222 | FILENAME: CategoryServiceImpl.java | 0.27513 | package com.yy.item.service.impl;
import com.leyou.item.pojo.Category;
import com.ly.common.exception.GlobalException;
import com.ly.common.vo.CodeMsg;
import com.yy.item.mapper.CategoryMapper;
import com.yy.item.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService {
@Autowired
CategoryMapper categoryMapper;
@Override
public List<Category> queryCategoryListByPid(Long pid) {
Category t = new Category();
t.setParentId(pid);
List<Category> list = categoryMapper.select(t);
if(CollectionUtils.isEmpty(list)){
throw new GlobalException(CodeMsg.CATEGORY_NOT_FOUND);
}
return list;
}
@Override
public List<Category> queryByIds(List<Long> ids) {
List<Category> list = categoryMapper.selectByIdList(ids);
if(CollectionUtils.isEmpty(list)){
throw new GlobalException(CodeMsg.CATEGORY_NOT_FOUND);
}
return list;
}
}
|
07170b2a-7ffd-4414-a132-656db6cfd21c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-24 10:10:03", "repo_name": "huxinsheng/spring_shiro_mybatis", "sub_path": "/ssm-commons/src/main/java/com/hxs/ssm/utils/CreateHelper.java", "file_name": "CreateHelper.java", "file_ext": "java", "file_size_in_byte": 1248, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "29e3a91df6f662ae95314a752ee6d69aa409fbf6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/huxinsheng/spring_shiro_mybatis | 265 | FILENAME: CreateHelper.java | 0.272799 | package com.hxs.ssm.utils;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.io.StringWriter;
import java.util.Iterator;
import java.util.Map;
/**
* @项目名称: hxs-ssm
* @类名称: MemberCreateHelper
* @类描述:
* @创建人: huxinsheng
* @创建时间: 2017-05-06 10:59
* @联系方式: hxsysh@gmail.com
* @修改备注:
*/
public class CreateHelper {
public static String toJson(Map<String, Object> inData)
throws IOException {
// 创建数据JSON
StringWriter writer = new StringWriter();
JsonFactory factory = new JsonFactory();
JsonGenerator json = factory.createJsonGenerator(writer);
json.writeStartObject();
if (!CollectionUtils.isEmpty(inData)) {
Iterator<String> iter = inData.keySet().iterator();
while (iter.hasNext()) {
String key = iter.next();
Object value = inData.get(key);
json.writeObjectField(key, value);
}
}
json.writeEndObject();
json.close();
return writer.toString();
}
}
|
e42918ec-3b03-4ffe-8ce2-be5e6155cf2a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-05-17T23:39:27", "repo_name": "cagdaskarademir/aspnetcore-graphql-dapper-sqlkata-sqlserver", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1229, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "5f7cab122179eca49185ca0015da463bcd1a2698", "star_events_count": 8, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/cagdaskarademir/aspnetcore-graphql-dapper-sqlkata-sqlserver | 295 | FILENAME: README.md | 0.279828 | # tutorial-aspnetcore-graphql-sqlserver
Tutorial Asp.Net Core 3.0 + GraphQLApi + Sql Server
This tutorial sample was created by .net core, dapper and sqlkata.
If you new on graphql for .net, you could use that sample.
This example is very simple. You could connect database, search entity or entities and show the result data.
You must run below commands. ...
- Create New Database
- Run database scripts in database folder (create-table, bulk-data)
- Change connection string in AppSettings file
- dotnet restore
- dotnet build
- dotnet run
Open the browser and enter the address : https://localhost:5001/ui/playground
Sample :
query {
company(companyId:5) {
id
name
isActive
}
}


 |
2ab1153b-de1c-4a21-b24c-9f08e55bf582 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-04-19 13:42:27", "repo_name": "seratch/jslack-maintenance-releases", "sub_path": "/jslack-api-client/src/main/java/com/github/seratch/jslack/api/methods/response/chat/scheduled_messages/ChatScheduledMessagesListResponse.java", "file_name": "ChatScheduledMessagesListResponse.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "ab28b4483b3f711ff611f61bd81f0f68b099dc75", "star_events_count": 8, "fork_events_count": 6, "src_encoding": "UTF-8"} | https://github.com/seratch/jslack-maintenance-releases | 193 | FILENAME: ChatScheduledMessagesListResponse.java | 0.253861 | package com.github.seratch.jslack.api.methods.response.chat.scheduled_messages;
import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.Attachment;
import com.github.seratch.jslack.api.model.ResponseMetadata;
import com.github.seratch.jslack.api.model.block.LayoutBlock;
import lombok.Data;
import java.util.List;
@Data
public class ChatScheduledMessagesListResponse implements SlackApiResponse {
private boolean ok;
private String warning;
private String error;
private String needed;
private String provided;
private List<ScheduledMessage> scheduledMessages;
private ResponseMetadata responseMetadata;
@Data
public static class ScheduledMessage {
private String id;
private String channelId;
private String text;
private List<Attachment> attachments;
private List<LayoutBlock> blocks;
private Integer postAt;
private Integer dateCreated;
}
} |
4e8570ac-8381-403f-a392-15130a542b64 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-29 21:45:44", "repo_name": "Elikill58/Negativity", "sub_path": "/src/com/elikill58/deps/yaml/snakeyaml/nodes/ScalarNode.java", "file_name": "ScalarNode.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "dafef8a340ac873c73cf73bfcdcc97f525862031", "star_events_count": 257, "fork_events_count": 148, "src_encoding": "UTF-8"} | https://github.com/Elikill58/Negativity | 258 | FILENAME: ScalarNode.java | 0.264358 | package com.elikill58.deps.yaml.snakeyaml.nodes;
import com.elikill58.deps.yaml.snakeyaml.error.Mark;
public class ScalarNode extends Node {
private Character style;
private String value;
public ScalarNode(final Tag tag, final String value, final Mark startMark, final Mark endMark, final Character style) {
this(tag, true, value, startMark, endMark, style);
}
public ScalarNode(final Tag tag, final boolean resolved, final String value, final Mark startMark, final Mark endMark, final Character style) {
super(tag, startMark, endMark);
if (value == null) {
throw new NullPointerException("value in a Node is required.");
}
this.value = value;
this.style = style;
this.resolved = resolved;
}
public Character getStyle() {
return this.style;
}
@Override
public NodeId getNodeId() {
return NodeId.scalar;
}
public String getValue() {
return this.value;
}
@Override
public String toString() {
return "<" + this.getClass().getName() + " (tag=" + this.getTag() + ", value=" + this.getValue() + ")>";
}
}
|
410e847a-cc54-40a8-8709-8642b42a709b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2010-07-15 11:55:13", "repo_name": "uzzal/smart-user", "sub_path": "/smart-user-api/src/main/java/com/smartitengineering/user/domain/BasicIdentity.java", "file_name": "BasicIdentity.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "58a13384c5a637f7647930df69cbb6a0c94cd4b8", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/uzzal/smart-user | 248 | FILENAME: BasicIdentity.java | 0.242206 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.smartitengineering.user.domain;
import com.smartitengineering.domain.AbstractPersistentDTO;
import org.apache.commons.lang.StringUtils;
/**
*
* @author modhu7
*/
public class BasicIdentity extends AbstractPersistentDTO<BasicIdentity> {
private String nationalID;
private Name name;
public Name getName() {
if (name == null) {
name = new Name();
}
return name;
}
public void setName(Name name) {
if (name == null) {
return;
}
this.name = name;
}
public String getNationalID() {
if (nationalID == null) {
nationalID = "";
}
return nationalID;
}
public void setNationalID(String nationalID) {
if (nationalID == null) {
return;
}
this.nationalID = nationalID;
}
public boolean isValid() {
if (!StringUtils.isEmpty(nationalID) && name != null) {
if (name.isValid()) {
return true;
}
}
return false;
}
}
|
b6f65ca5-4e76-4883-9122-be65324b2253 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-04-25T07:27:24", "repo_name": "alexpasta/Native-Ads-in-RecyclerView", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1020, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "3d0a3828f2b95906f2e20fd1fa44d74e1e798611", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/alexpasta/Native-Ads-in-RecyclerView | 267 | FILENAME: README.md | 0.250913 | # Native Ads in RecyclerView
### Demo
Note: In order to avoid showing real ads, we only show the MoPub demo ad in this video.

### How to Setup
1. Setup a FAN native ad placement ID. (Go through the steps in https://developers.facebook.com/docs/audience-network/getting-started)
2. Create a MoPub native ad unit. (Go through the steps in https://www.mopub.com/resources/docs/mopub-ui-account-setup/creating-apps-ad-units/)
3. Replace the values in LocalConfig.java with your FAN placement ID and MoPub ad unit ID.
4. (Optional) Adjust the configs in Config.java.
5. Run app.
### Facebook Audience Network (FAN)

### MoPub

### Image Sources:
- http://www.flaticon.com/free-icons/avatar_273
- https://pixabay.com/
- http://tw.weibo.com/linariel
|
fe02d90b-4b3d-4698-b98c-431200f8288b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-28 15:42:08", "repo_name": "SergeyChere/swapper", "sub_path": "/src/main/java/com/example/demo/controller/CommonController.java", "file_name": "CommonController.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "0695665a3b17409799d07537865473f7fec77a2b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SergeyChere/swapper | 173 | FILENAME: CommonController.java | 0.245085 | package com.example.demo.controller;
import com.example.demo.model.Item;
import com.example.demo.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.logging.Logger;
@RestController
public class CommonController {
private static Logger logger = Logger.getLogger(CommonController.class.getName());
@Autowired
private CommonService commonService;
@GetMapping("/getItems")
public List<Item> getItems(Integer scrollNumber) {
logger.info("Request received");
return commonService.scrollHistory(scrollNumber);
}
@GetMapping("/getItemsById/{id}")
public Item getItemById(@PathVariable("id") Integer id) {
logger.info("Request received");
return commonService.getItem(id);
}
}
|
d9a024e5-416a-4c03-afb6-c5c4b801049f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-16 12:17:08", "repo_name": "XGKerwin/city_boot", "sub_path": "/src/main/java/com/city/service/impl/NewsServiceImpl.java", "file_name": "NewsServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "7386bbb09a845f8237c56207ff22b57ccf2863af", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/XGKerwin/city_boot | 224 | FILENAME: NewsServiceImpl.java | 0.236516 | package com.city.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.city.bean.News;
import com.city.mapper.NewsMapper;
import com.city.service.base.NewsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author XGKerwin
* @since 2021-09-17
*/
@Service
public class NewsServiceImpl extends ServiceImpl<NewsMapper, News> implements NewsService {
@Autowired
private NewsMapper newsMapper;
public List<News> selectNews() {
List<News> newsList = newsMapper.selectList(new QueryWrapper());
return newsList;
}
public List<News> selectThem(String theme){
QueryWrapper<News> wrapper = new QueryWrapper<>();
wrapper.eq("theme",theme);
List<News> newsList = newsMapper.selectList(wrapper);
return newsList;
}
}
|
f71357fa-25ec-4e68-b752-3b3c5c387651 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-29 15:19:00", "repo_name": "fengGitHub8/shopiin", "sub_path": "/src/main/java/com/zs/service/impl/CategoryServiceImpl.java", "file_name": "CategoryServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1187, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "cc8187531778b72522f1ba1daa21e068f1d82438", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fengGitHub8/shopiin | 250 | FILENAME: CategoryServiceImpl.java | 0.247987 | package com.zs.service.impl;
import com.zs.entity.Category;
import com.zs.mapper.CategoryMapper;
import com.zs.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @program: shopin
* @description: 品类管理Service实现类
* @author: FengYang
* @create: 2019-06-24 14:29
**/
@Service
public class CategoryServiceImpl implements CategoryService{
@Autowired
private CategoryMapper categoryMapper;
@Override
public List<Category> findByShopId(Integer shopId) {
return categoryMapper.findByShopId(shopId);
}
@Override
public Boolean addCategory(Category category) {
categoryMapper.addCategory(category);
return true;
}
@Override
public Boolean updateCategory(Category category) {
categoryMapper.updateCategory(category);
return true;
}
@Override
public Boolean deleteCategory(String id) {
return categoryMapper.deleteCategory(Integer.parseInt(id));
}
@Override
public Category findById(Integer id) {
return categoryMapper.findById(id);
}
}
|
d2ffb8d6-07d1-4a33-8feb-cf0c8397251d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-30 03:10:45", "repo_name": "tuoyi5/TcpTest", "sub_path": "/app/mobile/bracelet/src/main/java/com/arvin/bracelet/ui/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "31de3ac4d3bf714eba5ef5287e174715b5c5c0e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tuoyi5/TcpTest | 214 | FILENAME: MainActivity.java | 0.240775 | package com.arvin.bracelet.ui;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import com.arvin.bracelet.R;
import com.arvin.bracelet.service.manager.TcpServiceManager;
public class MainActivity extends AppCompatActivity {
TcpServiceManager mTcpServiceManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button = findViewById(R.id.test_button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sendMessage("发送测试消息");
}
});
initTcpServiceManager();
mTcpServiceManager.bindService(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
mTcpServiceManager.unbindService(this);
}
public void initTcpServiceManager(){
mTcpServiceManager = new TcpServiceManager(this);
};
public void sendMessage(String value) {
mTcpServiceManager.sendMessage(value);
}
} |
8574d7c5-1ee0-453e-9caf-d642ee463acb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-18 09:03:10", "repo_name": "navspeak/CommentAPI", "sub_path": "/CommentProj/src/main/java/com/nav/target/services/mapservices/CommentServiceImpl.java", "file_name": "CommentServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "49f85026266c0b2b2bb4a409be0108ff66f01200", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/navspeak/CommentAPI | 210 | FILENAME: CommentServiceImpl.java | 0.26971 | package com.nav.target.services.mapservices;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
import com.nav.target.domain.Comment;
import com.nav.target.domain.DomainObject;
import com.nav.target.exception.OffensiveCommentException;
import com.nav.target.services.CommentService;
import com.nav.target.strategy.ICommentValidation;
@Service
@Profile("map")
public class CommentServiceImpl extends AbstractMapService implements CommentService{
@Autowired
private ICommentValidation commentValidator;
@Override
public List<DomainObject> listAll() {
return super.listAll();
}
@Override
public Comment getById(Integer id) {
return (Comment) super.getById(id);
}
@Override
public Comment saveOrUpdate(Comment comment) {
if (commentValidator.validateComment(comment) == false)
throw new OffensiveCommentException();
return (Comment) super.saveOrUpdate(comment);
}
@Override
public void delete(Integer id) {
super.delete(id);
}
}
|
8dbb0c50-2fe6-45f7-9ecc-77ff788b0dad | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-17 21:37:40", "repo_name": "mbatyra/AuctionHouseWebDev", "sub_path": "/src/main/java/com/example/AuctionHouse/user/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "8563d4a7e18e97c539c022b4a8b60ff00a11b53b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mbatyra/AuctionHouseWebDev | 247 | FILENAME: User.java | 0.289372 | package com.example.AuctionHouse.user;
import com.example.AuctionHouse.auction.Auction;
import com.example.AuctionHouse.bid.Bid;
import lombok.*;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "users", uniqueConstraints = {@UniqueConstraint(columnNames = {"login"})})
public class User {
@Id
@GeneratedValue(generator = "users_seq")
private Long id;
@Column(name = "login", length = 50, nullable = false)
private String login;
@Column(name = "password", length = 128, nullable = false)
private String password;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "role_id", nullable = false)
private UserRole userRole;
@OneToMany(mappedBy = "user")
private List<Auction> auctions = new ArrayList<>();
@OneToMany(mappedBy = "user")
private List<Bid> bids = new ArrayList<>();
public User(String login, String password, UserRole userRole) {
this.login = login;
this.password = password;
this.userRole = userRole;
}
}
|
b4b031b3-6770-49a5-9972-64a29988e1b8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-12 10:09:30", "repo_name": "mohamed-shalash/simple-booking-pro", "sub_path": "/app/src/main/java/com/example/trainbooking/remaking_per.java", "file_name": "remaking_per.java", "file_ext": "java", "file_size_in_byte": 1233, "line_count": 65, "lang": "en", "doc_type": "code", "blob_id": "66debf7c8e2c6e08fb36d6ccc892a8d3fae0aace", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mohamed-shalash/simple-booking-pro | 278 | FILENAME: remaking_per.java | 0.275909 | package com.example.trainbooking;
public class remaking_per {
int num;
String name;
String address;
String seat;
String hour;
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getSeat() {
return seat;
}
public void setSeat(String seat) {
this.seat = seat;
}
public String getHour() {
return hour;
}
public void setHour(String hour) {
this.hour = hour;
}
public remaking_per(String name, String address, String seat, String hour) {
this.name = name;
this.address = address;
this.seat = seat;
this.hour = hour;
}
public remaking_per(int num, String name,String seat, String hour, String address) {
this.num = num;
this.name = name;
this.address = address;
this.seat = seat;
this.hour = hour;
}
}
|
dd0c0f1c-264d-4470-9d95-710a93b0ceb5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-11-16T17:39:54", "repo_name": "chb/survey-wrapper-ios", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1067, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "fbf4c01b96b03825c896a8efebd5fc383bbc2f49", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/chb/survey-wrapper-ios | 238 | FILENAME: README.md | 0.26971 | Survey Wrapper
==============
Simple app to wrap launching a web page via link embedded into QR-code.
Building
--------
The project includes the [ZBar][] library as a submodule.
Xcode should automatically build and link the ZBar library when running the app.
1. Clone the repo: `$ git clone --recursive git@github.com:chb/survey-wrapper-ios.git`
2. Open `Surveys.xcodeproj` in Xcode
3. Build and run
Apache License, Version 2.0
===========================
Copyright 2013 Boston Children's Hospital
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
[zbar]: https://github.com/p2/ZBar
|
51cb8cec-98a8-4bf5-ae10-18413907968b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-07-05 17:56:54", "repo_name": "dharanimishra/DD-ZJPlatform", "sub_path": "/ziksana-app/zsecurity/src/test/java/com/ziksana/service/security/impl/EmailSenderTest.java", "file_name": "EmailSenderTest.java", "file_ext": "java", "file_size_in_byte": 1211, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "98dfb167de9c7dfc67e601201230e99487020d08", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dharanimishra/DD-ZJPlatform | 245 | FILENAME: EmailSenderTest.java | 0.290981 | package com.ziksana.service.security.impl;
import org.apache.velocity.app.VelocityEngine;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.ui.velocity.VelocityEngineUtils;
import com.ziksana.domain.member.Member;
import com.ziksana.security.velocitymail.ZiksanaEmailSender;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:/ziksanaMailContext.xml"})
public class EmailSenderTest {
@Autowired
private ZiksanaEmailSender emailSender;
@Autowired
private VelocityEngine velocityEngine;
@Test
public void testSendEmail() throws Exception {
String body="";
body+="Hello User,<br/>";
body+= VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, "mailtemplate/reminder.vm", "UTF-8", null);
Member member = new Member();
member.setPrimaryEmailId("selvan.kumar@vtgindia.com");
emailSender.sendEmailText1( member);
}
}
|
fb389903-2c15-488c-a9d3-26c5bab398eb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-28 23:51:08", "repo_name": "jskim1991/spring-boot-webflux-sample", "sub_path": "/src/test/java/io/jay/springbootwebfluxsample/CustomerRepositoryTests.java", "file_name": "CustomerRepositoryTests.java", "file_ext": "java", "file_size_in_byte": 1099, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "faf5ebd9a7ec6b73b76182b4d1bfdf946c1171e5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jskim1991/spring-boot-webflux-sample | 200 | FILENAME: CustomerRepositoryTests.java | 0.226784 | package io.jay.springbootwebfluxsample;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.r2dbc.AutoConfigureDataR2dbc;
import org.springframework.boot.test.autoconfigure.data.r2dbc.DataR2dbcTest;
import reactor.test.StepVerifier;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
@DataR2dbcTest
@AutoConfigureDataR2dbc
public class CustomerRepositoryTests {
@Autowired
private CustomerRepository customerRepository;
@Test
void test_findById_returnsCustomer() {
Customer customer = new Customer("first", "last");
customerRepository.save(customer).subscribe();
StepVerifier.create(customerRepository.findById(1L))
.assertNext(c -> {
assertThat(c.getId(), equalTo(1L));
assertThat(c.getFirstName(), equalTo("first"));
assertThat(c.getLastName(), equalTo("last"));
})
.verifyComplete();
}
}
|
ffa7cb2c-2061-4cd0-8b47-bb798c9f594b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-17T21:29:21", "repo_name": "zlowuj/DTO", "sub_path": "/src/main/java/com/example/demo/controllers/DemoController.java", "file_name": "DemoController.java", "file_ext": "java", "file_size_in_byte": 1149, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "b260f2f218e7637ba6a85ad7cb7f88728b7eb614", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zlowuj/DTO | 200 | FILENAME: DemoController.java | 0.245085 | package com.example.demo.controllers;
import com.example.demo.dtos.DemoRequest;
import com.example.demo.dtos.DemoResponse;
import com.example.demo.repositories.DemoRepository;
import com.example.demo.services.DemoService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
public class DemoController {
private final DemoService demoService;
public DemoController(DemoService demoService) {
this.demoService = demoService;
}
@GetMapping("/api/demo")
public ResponseEntity<List<DemoResponse>> getAll() {
return new ResponseEntity<>(demoService.getAll(), HttpStatus.OK);
}
@PostMapping("/api/demo")
public ResponseEntity addDemo(@RequestBody DemoRequest demoRequest) {
demoService.addDemo(demoRequest);
return new ResponseEntity(HttpStatus.CREATED);
}
}
|
cc5c559b-023b-44b9-a5ca-28be6907e0c5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-12 06:08:11", "repo_name": "zhangqifan1/Demo_ok32", "sub_path": "/indicator/src/main/java/com/as/indicator/xiaoguo/Xiaoguo5Activity.java", "file_name": "Xiaoguo5Activity.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "9bec6baf676897d4a933263678e3a81af512eaf7", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/zhangqifan1/Demo_ok32 | 181 | FILENAME: Xiaoguo5Activity.java | 0.213377 | package com.as.indicator.xiaoguo;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.as.indicator.R;
import com.as.indicator.widgt.AnimationButton;
public class Xiaoguo5Activity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_xiaoguo5);
final AnimationButton ab_btn = findViewById(R.id.ab_btn);
ab_btn.setAnimationButtonListener(new AnimationButton.AnimationButtonListener() {
@Override
public void onClickListener() {
ab_btn.start();
}
@Override
public void animationFinish() {
Toast.makeText(Xiaoguo5Activity.this,"动画执行完毕",Toast.LENGTH_SHORT).show();
// finish();
ab_btn.reset();
}
});
}
}
|
a4f40a3b-819e-439b-8db8-3b65948d85f8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-24 23:30:41", "repo_name": "adityaraj52/AgentDrive_BachelorsThesis", "sub_path": "/highway/src/main/java/cz/agents/highway/storage/VehicleActuator.java", "file_name": "VehicleActuator.java", "file_ext": "java", "file_size_in_byte": 1074, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "a9c7821f9cad58d3496326d6fee6d970b5d2178e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/adityaraj52/AgentDrive_BachelorsThesis | 209 | FILENAME: VehicleActuator.java | 0.276691 | package cz.agents.highway.storage;
import cz.agents.alite.common.entity.Entity;
import cz.agents.alite.environment.eventbased.EventBasedAction;
import cz.agents.alite.environment.eventbased.EventBasedEnvironment;
import cz.agents.highway.storage.plan.Action;
import cz.agents.highway.util.Utils;
import java.util.LinkedList;
import java.util.List;
public class VehicleActuator extends EventBasedAction {
private HighwayStorage storage;
private int id;
public VehicleActuator(EventBasedEnvironment environment, Entity relatedEntity, HighwayStorage storage) {
super(environment, relatedEntity);
this.storage = storage;
this.id = Utils.name2ID(relatedEntity.getName());
}
public void act(Action action){
List<Action> actions = new LinkedList<Action>();
actions.add(action);
act(actions);
}
public void act(List<Action> actions){
storage.act(id, actions);
getEventProcessor().addEvent(HighwayEventType.NEW_PLAN, null, null, actions);
}
}
|
280e996e-d9e3-4bbd-b273-9935021af912 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-03-02T23:40:32", "repo_name": "Shimmering-Buddhism/Guide", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1126, "line_count": 14, "lang": "en", "doc_type": "text", "blob_id": "66e6ed026001073005d518d2f09b0cc60e45b84f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Shimmering-Buddhism/Guide | 236 | FILENAME: README.md | 0.255344 | # Guide #
The goal of this path is to be awake, easy, happy and loving.
## Method ##
All of the above follow from selflessness (translation of emptiness in Buddhism). Understanding selflessness and empty mind is to be awake to the nature of reality. That leads to being easy and happy, since "you" isn't a concept to be taken seriously. It also leads to a total love of everything you perceive, including all others. Naturally your relationships all improve and you even understand that upset or angry people just are that way, and that's okay with you. It doesn't make you a doormat to those people either, just more understanding.
But to get to understanding selflessness you first have to immerse yourself in the theory and understanding of why that's the case - why "you" aren't special but that the world you experience is the most special thing you can ever experience. First understand the theory.
Once you understand the theory, put it into practice. Don't expect anything and don't cling to any precious ideas, just do it.
All the best. Please open an Issue if you have any questions or improvements to make :)
|
790f3220-66ee-488c-bcf0-9841af1a5674 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-01 07:53:07", "repo_name": "colinbut/rabbitmq-tutorials", "sub_path": "/helloworld/src/main/java/com/mycompany/rabbitmq/Send.java", "file_name": "Send.java", "file_ext": "java", "file_size_in_byte": 821, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "795cc8d94f550a53ae8853883efce0d0a0f92f32", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/colinbut/rabbitmq-tutorials | 177 | FILENAME: Send.java | 0.245085 | /*
* |-------------------------------------------------
* | Copyright © 2017 Colin But. All rights reserved.
* |-------------------------------------------------
*/
package com.mycompany.rabbitmq;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Channel;
import java.io.IOException;
public class Send {
public static void main(String[] args) throws IOException {
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("localhost");
Connection connection = connectionFactory.newConnection();
Channel channel = connection.createChannel();
channel.queueDeclare(Broker.QUEUE_NAME, false, false, false, null);
String message = "Hello Message";
channel.basicPublish("", Broker.QUEUE_NAME, null, message.getBytes());
System.out.println(" [x] sent " + message);
channel.close();
connection.close();
}
}
|
8ec246c8-10f9-4038-9036-6ee16abd3419 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-02-27 03:35:21", "repo_name": "leo-at-rsmart/kuali_kc", "sub_path": "/src/main/java/org/kuali/kra/negotiations/auth/CreateActivitiesAuthorizer.java", "file_name": "CreateActivitiesAuthorizer.java", "file_ext": "java", "file_size_in_byte": 1149, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "ddaf753c40845e59da99792fe44d8458277176c3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/leo-at-rsmart/kuali_kc | 245 | FILENAME: CreateActivitiesAuthorizer.java | 0.294215 | /*
* Copyright 2005-2010 The Kuali Foundation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/ecl1.php
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kuali.kra.negotiations.auth;
import org.kuali.kra.infrastructure.PermissionConstants;
public class CreateActivitiesAuthorizer extends NegotiationAuthorizer {
@Override
public boolean isAuthorized(String userId, NegotiationTask task) {
boolean retVal = hasPermission(userId, task.getNegotiationDocument().getNegotiation(), PermissionConstants.NEGOTIATION_CREATE_ACTIVITIES)
&& !task.getNegotiationDocument().isViewOnly();
return retVal;
}
}
|
d28d05bb-4945-47f2-b174-dd335300087c | {"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/business/UpdateAddressRequestDto.java", "file_name": "UpdateAddressRequestDto.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "14af59dcf017ab25ffb125109a1d32c8d8f6124b", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/biantaiwuzui/netx | 224 | FILENAME: UpdateAddressRequestDto.java | 0.185947 | package com.netx.common.vo.business;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotBlank;
import java.util.List;
/**
* Created By liwei
* Description: 修改用户收货地址请求参数
* Date: 2018-01-29
*/
@ApiModel
public class UpdateAddressRequestDto {
@ApiModelProperty(required = true, value = "用户id")
private String userId;
@ApiModelProperty(value = "地址列表下标,0开始")
private long index;
@ApiModelProperty(value = "地址详情")
private List<String> address;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public long getIndex() {
return index;
}
public void setIndex(long index) {
this.index = index;
}
public List<String> getAddress() {
return address;
}
public void setAddress(List<String> address) {
this.address = address;
}
}
|
694c9e69-78bc-4bd6-8c95-03499595b4ed | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-01 19:29:58", "repo_name": "cClaude/cchlib", "sub_path": "/apps/xcchlib-apps-duplicatefilesmanager/src/main/java/com/googlecode/cchlib/apps/duplicatefiles/console/taskhash/HashFile.java", "file_name": "HashFile.java", "file_ext": "java", "file_size_in_byte": 1089, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "bbec739e7934bafde978a63e138ff7bbdb2d69f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cClaude/cchlib | 243 | FILENAME: HashFile.java | 0.279828 | package com.googlecode.cchlib.apps.duplicatefiles.console.taskhash;
import java.io.File;
import java.io.Serializable;
/**
* Convenience version to store couple of value (hash,file)
*/
class HashFile implements Serializable
{
private static final long serialVersionUID = 1L;
private String hash;
private File file;
/** Default empty constructor */
public HashFile()
{
// Empty
}
/**
* Default constructor
*
* @param hash Hash string for {@code file}
* @param file Related file
*/
public HashFile( final String hash, final File file )
{
this.hash = hash;
this.file = file;
}
@Override
public String toString()
{
return "" + this.hash + "\t" + this.file.getPath();
}
public String getHash()
{
return this.hash;
}
public void setHash( final String hash )
{
this.hash = hash;
}
public File getFile()
{
return this.file;
}
public void setFile( final File file )
{
this.file = file;
}
}
|
f0419204-f7e5-45e1-9ee1-05c05cb301c3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-18 18:16:52", "repo_name": "Dreambotcoder/ArtiAirOrbs-PRO", "sub_path": "/src/org/dreambot/articron/api/controller/impl/node/NodeTree.java", "file_name": "NodeTree.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "de00db9f130fce44ffd53c7fcf513c0d0cb955eb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Dreambotcoder/ArtiAirOrbs-PRO | 227 | FILENAME: NodeTree.java | 0.290176 | package org.dreambot.articron.api.controller.impl.node;
import org.dreambot.articron.api.APIProvider;
import org.dreambot.articron.api.util.CronConstants;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.BooleanSupplier;
public abstract class NodeTree extends Node {
private List<Node> children;
public NodeTree(BooleanSupplier condition) {
super(condition);
children = new ArrayList<>();
}
public Node addChildren(Node... nodes) {
Collections.addAll(children, nodes);
return this;
}
public void empty() {
children.clear();
}
public void removeChild(Node n) {
children.remove(n);
}
public Node[] getChildren() {
return (Node[]) children.toArray();
}
@Override
public int onLoop(APIProvider api) {
for (Node node : children) {
if (node.isValid()) {
api.getPaintManager().setStatus(node.getStatus());
return node.onLoop(api);
}
}
return CronConstants.BASE_SLEEP;
}
}
|
9472f73b-bbe5-457c-a1f8-ae5f8b278e8a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-27 10:59:36", "repo_name": "EchoKoreyoshi/heartake_care_device_app", "sub_path": "/app/src/main/java/com/cjyun/heartakecare/utils/LanguageUtil.java", "file_name": "LanguageUtil.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "f02fc1623c756708dedb53d64bab33f0f25a259f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/EchoKoreyoshi/heartake_care_device_app | 230 | FILENAME: LanguageUtil.java | 0.236516 | package com.cjyun.heartakecare.utils;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import com.cjyun.heartakecare.App;
import java.util.Locale;
/**
* 创建者: vee
* 时 间: 2016/8/31 0031
* 描 述: 语言工具类
*/
public class LanguageUtil {
/**
* 设置语言
*
* @param language "cn" = 中文, "en" = 英文
*/
public static void setLanguage(Context context, String language) {
Resources resources = App.getApp(context).getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = new Locale(language);
resources.updateConfiguration(configuration, null);
saveLanguage(context, language);
}
public static void saveLanguage(Context context, String language) {
SharedPreferencesUtils.setString(context, "language", language);
}
public static String getSavedLanguage(Context context) {
return SharedPreferencesUtils.getString(context, "language", "");
}
}
|
6fae90c0-dc9e-44be-a954-dfffa7ac5bf1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-19 16:36:48", "repo_name": "cwasserman1/SchoolAdminSystem", "sub_path": "/Wasserman_HW1/src/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "09e476ee7d580ac214a4ca01c01761dd619d2d31", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cwasserman1/SchoolAdminSystem | 257 | FILENAME: User.java | 0.229535 |
public class User {
protected String username, password, fname, lname;
public User(String username, String password, String fname, String lname) {
this.username = username;
this.password = password;
this.fname = fname;
this.lname = lname;
}
public User() {
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
public String getFname() {
return fname;
}
public String getLname() {
return lname;
}
public void viewAllCourses() {
int count = 0;
for(Course i : CourseData.getAllCourses())
{
count++;
System.out.println("Course"+count);
System.out.println(" Name: "+i.getCourseName()+"\n ID: "+i.getCourseId()+"\n Instructor: "+i.getCourseInstructor()+ "\n Section Number: "+i.getSectionNumber());
System.out.println(" Location: "+i.getLocation()+"\n Max Capacity: "+i.getMaxReg()+"\n Current capacity: "+ i.getCurrentReg());
}
}
public void displayCourseInfo(String courseId, String sectionNumber) {
System.out.println("Hello");
}
}
|
16bfb2f6-05e2-4ee9-a25b-1335a1dd9e3d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-09 15:43:03", "repo_name": "ChenKangQiang/javaSE", "sub_path": "/javaSE-core/src/main/java/edu/tongji/comm/example/thread/concurrencyutils/cyclicBarrier/Sportsman.java", "file_name": "Sportsman.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "3b23799897c0b2a052b3d6b151d15cf961b0b969", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ChenKangQiang/javaSE | 260 | FILENAME: Sportsman.java | 0.285372 | package edu.tongji.comm.example.thread.concurrencyutils.cyclicBarrier;
import java.util.Random;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.TimeUnit;
/**
* @Author chenkangqiang
* @Data 2017/10/18
*/
public class Sportsman implements Runnable {
private String name;
private CyclicBarrier barrier;
private static Random random = new Random();
private int cycleTime;
private int count;
public Sportsman(String name, CyclicBarrier barrier, int cycleTime) {
this.name = name;
this.barrier = barrier;
this.cycleTime = cycleTime;
}
@Override
public void run() {
try {
TimeUnit.MILLISECONDS.sleep(1000);
System.out.println(name + " is ready");
while (count < cycleTime) {
barrier.await(); //CyclicBarrier可重用
System.out.println(name + " has run " + random.nextInt(10) + " m");
count++;
}
} catch (InterruptedException e) {
e.printStackTrace();
} catch (BrokenBarrierException e) {
e.printStackTrace();
}
}
}
|
fdac262c-247f-4547-8111-c234812f2493 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-20 18:30:35", "repo_name": "Jaky88/MyTest", "sub_path": "/app/src/main/java/com/onyx/test/styletest/translator/network/RetrofitWrapper.java", "file_name": "RetrofitWrapper.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "be50418bea8eb22f64733173d5455dc8cdfc5a34", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Jaky88/MyTest | 177 | FILENAME: RetrofitWrapper.java | 0.261331 | package com.onyx.test.styletest.translator.network;
import android.content.Context;
import com.onyx.test.styletest.translator.config.Constants;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class RetrofitWrapper {
private static RetrofitWrapper instance;
private Context mContext;
private Retrofit retrofit;
private RetrofitWrapper(String platform) {
retrofit = new Retrofit.Builder().baseUrl(Constants.getBaseUrl(platform))
.addConverterFactory(GsonConverterFactory.create())
.build();
}
public static RetrofitWrapper getInstance(String platform) {
if (instance == null) {
synchronized (RetrofitWrapper.class) {
if (instance == null) {
instance = new RetrofitWrapper(platform);
}
}
}
return instance;
}
public <T> T create(final Class<T> service) {
return retrofit.create(service);
}
}
|
0c97a52f-cfcc-4522-819f-ed5c79f5170c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-23 12:13:20", "repo_name": "UddhavGanorkar/tsl949_Selenium", "sub_path": "/src/day1/Locator_exp.java", "file_name": "Locator_exp.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "ad57ccde3e63d705486fb0b0dd23c21f93de460b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/UddhavGanorkar/tsl949_Selenium | 256 | FILENAME: Locator_exp.java | 0.286968 | package day1;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
public class Locator_exp {
public static void main(String[] args) throws Exception{
System.setProperty("webdriver.chrome.driver", "drivers/chromedriver.exe");
WebDriver driver = new ChromeDriver();
/*driver.get("https://selenium.dev");
String s= driver.getTitle();
System.out.println("You are on "+s+" page!!");
driver.findElement(By.linkText("Downloads")).click();
String title2 = driver.getTitle();
System.out.println("You are on "+title2+" page!!");
Thread.sleep(3000);
driver.quit();*/
driver.get("https://opensource-demo.orangehrmlive.com/");
driver.findElement(By.id("txtUsername")).sendKeys("admin");
driver.findElement(By.name("txtPassword")).sendKeys("admin123");
driver.findElement(By.id("btnLogin")).click();
driver.findElement(By.id("welcome")).click();
Thread.sleep(2000);
driver.findElement(By.linkText("Logout")).click();
Thread.sleep(3000);
driver.quit();
}
}
|
c2994ff0-b8bb-477d-9040-c52c4397b4d8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-04-27T07:26:41", "repo_name": "neilbalch/CPPM-HID-Adapter", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1149, "line_count": 20, "lang": "en", "doc_type": "text", "blob_id": "93c6decff4f0d73498dfdbe53999d0983f3ef5b7", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/neilbalch/CPPM-HID-Adapter | 283 | FILENAME: README.md | 0.208179 | # CPPM-HID-Adapter
## Description
USB Joystick HID adapter for CPPM RC recievers. (*requires microprocesor with native USB support, e.g. Arduino Pro Micro or Arduino Duemilanove*) Dependent upon [`jmparatte/jm_CPPM`](https://github.com/jmparatte/jm_CPPM) and [`MHeironimus/ArduinoJoystickLibrary`](https://github.com/MHeironimus/ArduinoJoystickLibrary) for CPPM reading and Joystick HID support respectively.
This project makes use of the [PlatformIO](https://platformio.org) extension to VSCode for compilation and upload.
## Repository Map
* `.vscode/*`: Visual Studio Code workspace config files
* `Arduino_old`: Old project files from the Arduino IDE
* `Debug-CPPM-Monitor.ino`: Debug program to test functionality of CPPM reading library
* `Debug-JoystickTest.ino`: Debug program to test functionality of Joystick library
* `Joystick.ino`: Main program, upload this to Arduino
## Hardware Setup
CPPM reader detects signals on Arduino pin 4. (*silkscreen lettering on Arduino Pro Micro*) Most RC RXs can be powered straight off the board's VCC rail. Pretty much just that; make sure that the correct wires go to the correct places.
|
cfdea91f-cc75-4c1e-b7e3-4c2f07bca4f1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-11 13:39:17", "repo_name": "RohanKumar12345/samajsewa", "sub_path": "/app/src/main/java/com/smartwebarts/samajsewa/Activity/MobileveriActivity.java", "file_name": "MobileveriActivity.java", "file_ext": "java", "file_size_in_byte": 988, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "f631a27d1c8902419ac9e8df651d336f11979a75", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/RohanKumar12345/samajsewa | 160 | FILENAME: MobileveriActivity.java | 0.176672 | package com.smartwebarts.samajsewa.Activity;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.smartwebarts.samajsewa.databinding.ActivityMobileveriBinding;
public class MobileveriActivity extends AppCompatActivity {
ActivityMobileveriBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding=ActivityMobileveriBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
binding.mobileVerifi.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), OtpActivity.class);
intent.putExtra("varification", "mobileverification");
startActivity(intent);
finish();
}
});
}
} |
4e73aa43-928b-4cf2-872f-33330fed9ebf | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-06 12:27:25", "repo_name": "alexandraseeme/swapitestexample", "sub_path": "/src/main/java/my/company/models/Film.java", "file_name": "Film.java", "file_ext": "java", "file_size_in_byte": 1207, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "8711b7881101c0f8d8f3b0ebb1eaf7a632ea52e2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/alexandraseeme/swapitestexample | 239 | FILENAME: Film.java | 0.233706 | package my.company.models;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import java.util.List;
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@EqualsAndHashCode
@JsonIgnoreProperties(ignoreUnknown = true)
public class Film {
@JsonProperty("characters")
public List<String> characters = null;
@JsonProperty("created")
public String created;
@JsonProperty("director")
public String director;
@JsonProperty("edited")
public String edited;
@JsonProperty("episode_id")
public Integer episodeId;
@JsonProperty("opening_crawl")
public String openingCrawl;
@JsonProperty("planets")
public List<String> planets = null;
@JsonProperty("producer")
public String producer;
@JsonProperty("release_date")
public String releaseDate;
@JsonProperty("species")
public List<String> species = null;
@JsonProperty("starships")
public List<String> starships = null;
@JsonProperty("title")
public String title;
@JsonProperty("url")
public String url;
@JsonProperty("vehicles")
public List<String> vehicles = null;
}
|
bf66ebb8-60d7-4ee0-ab62-50afca9050bc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-22 23:32:39", "repo_name": "iwolfsdorf/cash-online", "sub_path": "/cash-online/src/main/java/ar/com/cash/online/backend/service/impl/LoanServiceImpl.java", "file_name": "LoanServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "a6a7c921115af25e5d63234e6e31ddafd6b564cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/iwolfsdorf/cash-online | 231 | FILENAME: LoanServiceImpl.java | 0.288569 | package ar.com.cash.online.backend.service.impl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ar.com.cash.online.backend.exception.ServiceException;
import ar.com.cash.online.backend.model.Loan;
import ar.com.cash.online.backend.model.Page;
import ar.com.cash.online.backend.repository.LoanRepository;
import ar.com.cash.online.backend.service.LoanService;
@Service
public class LoanServiceImpl implements LoanService {
private final Logger log = LoggerFactory.getLogger(LoanServiceImpl.class);
@Autowired
private LoanRepository loanRepository;
@Override
public Page<Loan> getPage(final Integer limit, final Integer offset, final Long user_id) throws ServiceException {
log.info("Se busca pagina de Loans. limit: {}, offset: {}, user_id: {}.", limit, offset, user_id);
try {
return loanRepository.findAllByUserId(limit, offset, user_id);
} catch (final Exception ex) {
throw new ServiceException("Ocurrio un error al obtener una pagina.", ex);
}
}
}
|
a94b14ee-db7b-4732-bb63-a4c8b81ba1aa | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-14 16:11:02", "repo_name": "dimka668/java_study", "sub_path": "/springproject1/src/main/java/com/klyshov/ioc/autowired/FieldAutowiredIntegrationTest.java", "file_name": "FieldAutowiredIntegrationTest.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "bcbc10d9879ded0733d4b581e793367e6cfdefd9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dimka668/java_study | 214 | FILENAME: FieldAutowiredIntegrationTest.java | 0.288569 | package com.klyshov.ioc.autowired;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.web.context.ContextLoaderListener;
import static junit.framework.TestCase.assertNotNull;
import static org.junit.Assert.assertEquals;
/**
* Created by 16688641 on 31.10.2019.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(
loader=AnnotationConfigContextLoader.class,
classes=ApplicationContextTestAutowiredName.class)
public class FieldAutowiredIntegrationTest {
@Autowired
private ArbitraryDependency arbitraryDependencyy;
@Test
public void givenAutowired_WhenSetOnField_ThenDependencyResolved() {
assertNotNull(arbitraryDependencyy);
assertEquals("Arbitrary Dependency", arbitraryDependencyy.toString());
}
}
|
00e93173-8753-4739-a02d-e1e8eb021719 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-11 12:12:49", "repo_name": "MinerArcana/RunicDungeons", "sub_path": "/src/main/java/com/minerarcana/runicdungeons/RunicDungeons.java", "file_name": "RunicDungeons.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "1bd3f433e988adc6dca3e5e59b713f5c51961565", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MinerArcana/RunicDungeons | 225 | FILENAME: RunicDungeons.java | 0.235108 | package com.minerarcana.runicdungeons;
import com.minerarcana.runicdungeons.content.BlockRegistry;
import com.minerarcana.runicdungeons.content.DimensionRegistry;
import com.minerarcana.runicdungeons.content.StructureRegistry;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
;import static com.minerarcana.runicdungeons.RunicDungeons.MOD_ID;
@Mod(MOD_ID)
public class RunicDungeons
{
public static final String MOD_ID = "runicdungeons";
private static final Logger LOGGER = LogManager.getLogger();
public RunicDungeons() {
MinecraftForge.EVENT_BUS.register(this);
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
BlockRegistry.register(bus);
StructureRegistry.register(bus);
DimensionRegistry.register(bus);
}
}
|
541d186b-39c2-4d8e-97c1-b23658aed751 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-26 10:35:18", "repo_name": "atguiguliuyan/myspring2.0", "sub_path": "/src/main/java/com/spring/demo/action/DemoAction.java", "file_name": "DemoAction.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "a8bb43b942c9015593ba7f5f3ad25f7e84c36bfb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/atguiguliuyan/myspring2.0 | 216 | FILENAME: DemoAction.java | 0.261331 | package com.spring.demo.action;
import com.spring.demo.service.IDemoService;
import com.spring.framework.annotation.LyAutowired;
import com.spring.framework.annotation.LyController;
import com.spring.framework.annotation.LyRequestMapping;
import com.spring.framework.annotation.LyRequestParam;
import com.spring.framework.webmvc.LyModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@LyController
@LyRequestMapping("/demo")
public class DemoAction {
@LyAutowired
private IDemoService demoService;
@LyRequestMapping("/query.json")
public LyModelAndView query(HttpServletRequest req, HttpServletResponse resp,
@LyRequestParam("name") String name){
String result = demoService.get(name);
System.out.println(result);
try {
resp.getWriter().write(result);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@LyRequestMapping("/edit.json")
public LyModelAndView edit(HttpServletRequest req, HttpServletResponse resp, Integer id){
return null;
}
}
|
14611415-9bc6-411c-9578-0ed7d5bfdfc2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-28 02:12:46", "repo_name": "thomas-dean/GITS", "sub_path": "/src/main/java/me/tomdean/gits/daos/InvestigationStatusDaoImpl.java", "file_name": "InvestigationStatusDaoImpl.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "74c76c5b08b77434241131902ccc6e4a5a2db747", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/thomas-dean/GITS | 201 | FILENAME: InvestigationStatusDaoImpl.java | 0.261331 | package me.tomdean.gits.daos;
import me.tomdean.gits.models.InvestigationStatus;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("investigationStatusDao")
public class InvestigationStatusDaoImpl extends AbstractDao<Long, InvestigationStatus> implements InvestigationStatusDao {
@SuppressWarnings("unchecked")
@Override
public List<InvestigationStatus> findAll() {
Criteria crit = createEntityCriteria();
crit.addOrder(Order.asc("status"));
return (List<InvestigationStatus>) crit.list();
}
@Override
public InvestigationStatus findByStatus(String status) {
Criteria crit = createEntityCriteria();
crit.add(Restrictions.eq("status", status));
return (InvestigationStatus) crit.uniqueResult();
}
@Override
public InvestigationStatus findById(Long id) {
return getByKey(id);
}
}
|
05975a58-a227-4b27-bdc9-be416240cf03 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-21 08:30:40", "repo_name": "liyunfengfengfeng/appliancesales", "sub_path": "/src/main/java/com/appliancesales/entity/Saler.java", "file_name": "Saler.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "3819acbfed474a8b200b982cde9632374052e0c7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liyunfengfengfeng/appliancesales | 213 | FILENAME: Saler.java | 0.2227 | package com.appliancesales.entity;
import java.io.Serializable;
public class Saler implements Serializable{
private Integer id;
private String name;
private String password;
private Integer account;
public Saler() {
super();
}
public Saler(Integer id,String name,String password,Integer account) {
super();
this.id = id;
this.name = name;
this.password = password;
this.account = account;
}
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
public Integer getAccount() {
return this.account;
}
public void setAccount(Integer account) {
this.account = account;
}
}
|
867d1e07-0cc5-440f-89b3-d2882ad68cea | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-28 09:53:00", "repo_name": "Archer0110/MountianRubbit", "sub_path": "/app/src/main/java/com/mr/mountainrabbit/adapter/RacreationFirst.java", "file_name": "RacreationFirst.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "f3717a41838fbc784359e15f55bd075adf116a1a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Archer0110/MountianRubbit | 217 | FILENAME: RacreationFirst.java | 0.240775 | package com.mr.mountainrabbit.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.mr.mountainrabbit.R;
import java.util.List;
/**
* 娱乐页面的第一个模块的子适配器
*/
public class RacreationFirst extends RecyclerView.Adapter {
List list ;
Context context;
public RacreationFirst(List list, Context context) {
this.list = list;
this.context = context;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.racreation_first,parent,false);
return new viewHolder(view);
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 1;
}
private class viewHolder extends RecyclerView.ViewHolder{
public viewHolder(View itemView) {
super(itemView);
}
}
}
|
b24dbe23-2e96-4091-8365-a45617ad26ff | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-19T17:27:22", "repo_name": "mstepovanyy/PQC", "sub_path": "/src/main/java/com/stepomy/core/consumer/MessageFetch.java", "file_name": "MessageFetch.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "f5588ad2ea68aa8bcee63c34c55000f337982a90", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mstepovanyy/PQC | 199 | FILENAME: MessageFetch.java | 0.27048 | package com.stepomy.core.consumer;
import com.stepomy.core.Configuration;
import com.stepomy.core.Queue;
import com.stepomy.core.QueueItem;
import java.util.TimerTask;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.stream.IntStream;
public class MessageFetch extends TimerTask {
private LinkedBlockingQueue<QueueItem> queue;
public MessageFetch(LinkedBlockingQueue<QueueItem> queue) {
this.queue = queue;
}
@Override
public void run() {
IntStream.range(0, Configuration.CONSUMER_POOLING_MESSAGES).forEach(index-> {
QueueItem item = Queue.getInstance().poll();
while(item.isExpired()) {
item.printExpired();
item = Queue.getInstance().poll();
}
try {
queue.put(item);
} catch (InterruptedException e) { return; }
});
System.out.println("END Message fetch " + queue.size() + " , " + Queue.getInstance().size());
}
} |
56bfb835-c636-454a-8abb-356bc42edf8a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-06-28 13:42:24", "repo_name": "fabianacristina89/agenda-caelum", "sub_path": "/app/src/main/java/receiver/caelum/com/br/cadastrocaelum/SMSReceiver.java", "file_name": "SMSReceiver.java", "file_ext": "java", "file_size_in_byte": 1209, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "adbee122d2927f0c10c1184aea16c09133268585", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fabianacristina89/agenda-caelum | 271 | FILENAME: SMSReceiver.java | 0.286169 | package receiver.caelum.com.br.cadastrocaelum;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.widget.Toast;
import cadastro.caelum.com.br.cadastrocaelum.AlunoDAO;
import cadastro.caelum.com.br.cadastrocaelum.DBHelper;
/**
* Created by IT-CPS on 24/06/2015.
*/
public class SMSReceiver extends BroadcastReceiver{
private AlunoDAO alunoDAO;
private DBHelper dbHelper;
@Override
public void onReceive(Context context, Intent intent) {
dbHelper = new DBHelper(context);
alunoDAO = new AlunoDAO(dbHelper);
Bundle extras = intent.getExtras();
Object[] messages = (Object[]) extras.get("pdus");
byte[] message = (byte[]) messages[0];
SmsMessage sms = SmsMessage.createFromPdu(message);
if(alunoDAO.isAluno(sms.getOriginatingAddress())){
Toast.makeText(context, "Chegou um SMS de " + sms.getOriginatingAddress(), Toast.LENGTH_LONG).show();
//MediaPlayer mp = MediaPlayer.create(context, R.raw.msg);
//mp.start();
}
}
}
|
d6fbbb04-37c1-4b03-9b8d-b20d2a1df737 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-07 19:00:59", "repo_name": "tiagopoa/NetbeansProjects", "sub_path": "/NetbeansProjects/DashBoard/src/RecebeDados.java", "file_name": "RecebeDados.java", "file_ext": "java", "file_size_in_byte": 1039, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "052bd72ff32157d8648856730036180e5795961f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tiagopoa/NetbeansProjects | 221 | FILENAME: RecebeDados.java | 0.246533 |
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
class RecebeDados implements Runnable {
int sensor1;
private JLabel janela1;
public RecebeDados(JLabel janela1){
this.janela1 = janela1;
}
RecebeDados(int sensor1) {
this.sensor1 = sensor1;
}
@Override
public void run() {
System.out.println("Valor passado pelo sensor1: " + sensor1);
janela1.setText("teste");
janela1.updateUI();
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
Logger.getLogger(RecebeDados.class.getName()).log(Level.SEVERE, null, ex);
}
}
void start() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
|
d4c43ac0-7d6d-4914-b1ea-49ae459e0988 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-03 11:18:42", "repo_name": "jiwangyu/tzsc", "sub_path": "/web/bjtumidas/bjtumidas/src/com/jwy/bjtumidas/action/UpdatePwdServlet.java", "file_name": "UpdatePwdServlet.java", "file_ext": "java", "file_size_in_byte": 1170, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "3a944c27583da210ce11d01a21dc429ddaf11bb8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jiwangyu/tzsc | 219 | FILENAME: UpdatePwdServlet.java | 0.264358 | package com.jwy.bjtumidas.action;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jwy.bjtumidas.engine.UpdateService;
public class UpdatePwdServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
String userName = request.getParameter("username");
String pwd=request.getParameter("pwd");
String json="";
if(new UpdateService().isSuccessfulUpdatePwd(userName, pwd)){
json="{\"update_pwd\":\"successful\"}";
// System.out.println("修改成功了");
}else{
json="{\"update_pwd\":\"failed\"}";
// System.out.println("修改失败了");
}
PrintWriter pw = response.getWriter();
pw.write(json);
pw.flush();
pw.close();
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}
|
f0717459-9238-4fff-b73a-459cd12a8eee | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-29 21:31:32", "repo_name": "eye-dee/Polytech", "sub_path": "/src/main/java/prospring/chapter4/classforconfig/AppConfig.java", "file_name": "AppConfig.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "4297aab67063880838b69040dbd9ffed6402e99c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/eye-dee/Polytech | 206 | FILENAME: AppConfig.java | 0.283781 | package prospring.chapter4.classforconfig;
import org.springframework.context.annotation.*;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* Polytech
* Created by igor on 17.03.17.
*/
@Configuration
@ImportResource(value="classpath:META-INF/spring/app-context-xml.xml")
@PropertySource(value="classpath:message.properties")
@ComponentScan(basePackages = {"prospring.chapter4"})
@EnableTransactionManagement
public class AppConfig {
/*@Autowired
Environment env;
*/
@Bean
@Lazy(value = true)
public MessageProvider messageProvider() {
return new ConfigurableMessageProvider("Hello World"/*env.getProperty("message")*/);
}
@Bean(name = "messageRenderer")
@Scope(value = "prototype")
@DependsOn(value = "messageProvider")
public MessageRenderer messageRenderer() {
final MessageRenderer renderer = new StandartOutMessageRenderer();
renderer.setMessageProvider(messageProvider());
return renderer;
}
}
|
4123aaa9-1885-49cf-9603-82f275c2d74a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-22 18:59:47", "repo_name": "Bruno-Lerner/5-Exemplo-Hello-World-Lombok", "sub_path": "/5-exemplo-HelloWorld-lombok/src/main/java/lerner/bruno/exemplohelloworldlombok/controller/ClientController.java", "file_name": "ClientController.java", "file_ext": "java", "file_size_in_byte": 1206, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "c36e3056f98e40b716b61eed25e49d55301b2abd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Bruno-Lerner/5-Exemplo-Hello-World-Lombok | 265 | FILENAME: ClientController.java | 0.262842 | package lerner.bruno.exemplohelloworldlombok.controller;
import lerner.bruno.exemplohelloworldlombok.model.Client;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
/**
* @author Bruno Lerner
* @version 1.0
* @since 15/04/2020 11:05
*/
@RestController
public class ClientController {
@GetMapping("/clientes")
public Client getClient() {
Client client = new Client();
client.setName("Bruno");
client.setLastName("Lerner");
client.setEmail("brunolerner@gmail.com");
return client;
}
@GetMapping("/listaclientes")
public ArrayList<Client> getListClient() {
Client client1 = new Client();
client1.setName("Bruno");
client1.setLastName("Lerner");
client1.setEmail("brunolerner@gmail.com");
Client client2 = new Client();
client2.setName("Fernanda");
client2.setLastName("Silva");
client2.setEmail("fernandasilva@gmail.com");
ArrayList<Client> clients = new ArrayList<>();
clients.add(client1);
clients.add(client2);
return clients;
}
}
|
e9612b36-f810-434a-a2cd-9d2cc6dfef23 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-20 23:58:52", "repo_name": "menolascino/final-project", "sub_path": "/src/main/java/com/claim/entity/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1068, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "23737ee1d7b5d0feee6e76dbdd9f2243a3ecf6b1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/menolascino/final-project | 224 | FILENAME: User.java | 0.214691 | package com.claim.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table
public class User {
@Id
@Column
private String username;
@Column
private String email;
@Column
private String phoneNumber;
@Column
private String password;
@Column
private String retypePassword;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRetypePassword() {
return retypePassword;
}
public void setRetypePassword(String retypePassword) {
this.retypePassword = retypePassword;
}
}
|
e06db43b-1c92-4941-8850-5618aec68cf3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-17 08:47:07", "repo_name": "hckjCRM/shop", "sub_path": "/Servlet/src/servletwork/RegistServlet.java", "file_name": "RegistServlet.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "a681ca7a1099633f878ba99b06fe2c0770c0e1d5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hckjCRM/shop | 207 | FILENAME: RegistServlet.java | 0.284576 | package servletwork;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class RegistServlet extends HttpServlet{
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String username=req.getParameter("username");
String password =req.getParameter("password");
PrintWriter pw=resp.getWriter();
try {
Connection conn=ConnectionUtils.getConnection();
String sql="insert into users values(?,?)";
PreparedStatement prsm=conn.prepareStatement(sql);
prsm.setString(1, username);
prsm.setString(2, password);
prsm.executeUpdate();
pw.println("regist");
resp.sendRedirect("login.html");
} catch (SQLException e) {
e.printStackTrace();
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.