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
|
|---|---|---|---|---|---|---|
d5a770cb-5316-41de-afb3-35ca8a5718a1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-26 18:54:54", "repo_name": "MhmDSmdi/My-Time-Line", "sub_path": "/app/src/main/java/com/blucode/mhmd/timeline/data/model/ImageMessage.java", "file_name": "ImageMessage.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "5e0d4a1478e785c1cd6ccc8dad86a48fe01bf384", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MhmDSmdi/My-Time-Line
| 237
|
FILENAME: ImageMessage.java
| 0.247987
|
package com.blucode.mhmd.timeline.data.model;
import android.net.Uri;
import java.util.Date;
import io.objectbox.annotation.Entity;
import io.objectbox.annotation.Id;
import io.objectbox.relation.ToOne;
@Entity
public class ImageMessage extends BasicMessage {
@Id
public long id;
private ToOne<UriAddress> imageAddress;
public ImageMessage() {
messageType = MessageType.IMAGE_MESSAGE;
}
public ImageMessage(Uri imageAddress) {
this.imageAddress.setTarget(new UriAddress(imageAddress));
messageType = MessageType.IMAGE_MESSAGE;
}
public Uri getUri() {
return Uri.parse(imageAddress.getTarget().getAddress());
}
public ToOne<UriAddress> getImageAddress() {
return imageAddress;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public void setImageAddress(ToOne<UriAddress> imageAddress) {
this.imageAddress = imageAddress;
}
public void setImageAddress(Uri imageAddress) {
this.imageAddress.setTarget(new UriAddress(imageAddress));
}
}
|
b2392e55-1bb1-4f0f-a305-6f3dce7db869
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-08-29T03:11:06", "repo_name": "shendepu/fedora-dockfiles", "sub_path": "/mariadb/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1213, "line_count": 67, "lang": "en", "doc_type": "text", "blob_id": "430f7db376b2ff649f774960c6461d9f00758653", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/shendepu/fedora-dockfiles
| 325
|
FILENAME: README.md
| 0.293404
|
# Fedora Dockerfile for mariadb
## Create docker image for mariadb with root password configured
Based on https://github.com/fedora-cloud/Fedora-Dockerfiles/tree/master/mariadb
Change root password of mysql in **mysql.conf** file
MYSQL_ROOT_PASSWORD=Root_Passowrd
Perform the build
sudo docker build -t <yourname>/fedora:mariadb .
Check the image out
sudo docker images
Run it:
sudo docker run -d -p 3306:3306 <yourname>/fedora:mariadb
## Create a new image on top of mariadb image for mysql database
Clone the testdb folder and change the configurations
Example:
Go to **testdb** folder
cd testdb
Change configuration in **mysql_db.conf**
# Configure mysql root password here
MYSQL_ROOT_PASSWORD=Root_Passowrd
# DB configuration
DB_NAME=testdb
DB_CHARACTER_SET=utf8
DB_COLLATE_RULE=utf8_bin
# DB local user configuration
DB_LOCAL_USER=testdb
DB_LOCAL_PASSWORD=testdb
# DB remote user configuration
DB_REMOTE_USER=testdb
DB_REMOTE_PASSWORD=testdb
DB_REMOTE_ALLOWED_HOST=%
Perform the build
sudo docker build -t <yourname>/fedora:mariadb_testdb .
Check the image out
sudo docker images
Run it:
sudo docker run -d -p 3306:3306 <yourname>/fedora:mariadb_testdb
|
8e5e1e84-a4df-4af4-9479-092934dc4670
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-29 23:35:02", "repo_name": "petrolingus/phonebook-database-task", "sub_path": "/src/main/java/me/petrolingus/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1111, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "b4038bede4f0edafbc28ff8b14a2a3fcc2e10790", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/petrolingus/phonebook-database-task
| 197
|
FILENAME: Main.java
| 0.240775
|
package me.petrolingus;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
public class Main extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("/table-view-test.fxml"));
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("/style.css").toExternalForm());
Properties columnMappings = new Properties();
try (FileReader reader = new FileReader("columnMappings.properties")) {
columnMappings.load(reader);
} catch (IOException e) {
e.printStackTrace();
}
String title = columnMappings.getProperty("application_title");
primaryStage.setTitle(title);
primaryStage.setScene(scene);
primaryStage.show();
}
}
|
28c31ea1-ae33-43d4-9eeb-d5f55f384f06
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-15 05:48:42", "repo_name": "jchenga/spring-redis-chat-service", "sub_path": "/src/main/java/com/study/SpringBootWebSocketChatServer/redis/RedisPublisher.java", "file_name": "RedisPublisher.java", "file_ext": "java", "file_size_in_byte": 1261, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "478b79b3dab0cd1f7a6deb5b041e5b1f3290be65", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jchenga/spring-redis-chat-service
| 223
|
FILENAME: RedisPublisher.java
| 0.246533
|
package com.study.SpringBootWebSocketChatServer.redis;
import com.study.SpringBootWebSocketChatServer.model.ChatMessage;
import com.study.SpringBootWebSocketChatServer.model.ChatMessagePayload;
import com.study.SpringBootWebSocketChatServer.repository.ChatMessageRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.ChannelTopic;
import org.springframework.stereotype.Service;
@Service
public class RedisPublisher {
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@Autowired
private ChatMessageRepository chatMessageRepository;
/**
* Description:
* - 메시지를 Redis Topic(채팅방 고유 아이디)에 발행(Publish)합니다.
*
*/
public void publish(ChannelTopic topic, ChatMessagePayload message) {
ChatMessage publishMessage = ChatMessage.of(
Long.parseLong(topic.getTopic()),
message.getSender(),
message.getMessage(),
message.getMessageType()
);
chatMessageRepository.save(publishMessage);
redisTemplate.convertAndSend(topic.getTopic(), message);
}
}
|
03c2502a-a41c-4b2d-a93d-406ec75f3fc8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-11-15T11:46:05", "repo_name": "bfv/pc2017", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1124, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "29cd36c719263a25b79f11756170b8edef0f0ed1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bfv/pc2017
| 252
|
FILENAME: README.md
| 0.23092
|
# PUG Challenge CDC to the Max!
These are the sources accompanying my presentation on the EMEA PUG Challenge 2017 in Prague.
High over the archtecture is:
```
MongoDB ◄===== NodeJS ◄===== Dispatcher =====► OE db ◄===== (any client, 4GL, SQL)
▲
║
║
search client (angular)
```
## directories
### cdc
In the cdc is the dispatcher. The dispatcher send every update in the cdc table to the node.js backend.
### crud
Some test programs for reading and updating the data in the OE database
### mining
This directory contains the source which I used to create the OE database with 14 million names and addresses.
With these sources names are extracted from a website which list all (well almost all) last names of people living in the Netherland.
### mongo
These are the OE sources to communicate with Mongo from OE. Uses an implementation of the OE HTTP client.
### search
This is the node.js project which implements both the search API and the connection to the MongoDB.
### webui
An Angular based website to display the search results.
|
03469fc9-439d-4614-822e-e3bd620fa15f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-28T02:02:48", "repo_name": "mlq1542906484/dispatch", "sub_path": "/src/main/java/com/jiadun/dispatch/validator/annotation/validator/FieldIsBooleanValidator.java", "file_name": "FieldIsBooleanValidator.java", "file_ext": "java", "file_size_in_byte": 1234, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "1f1f3c2e0ce64bf531771329f5dd0a63a05bd5f8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mlq1542906484/dispatch
| 250
|
FILENAME: FieldIsBooleanValidator.java
| 0.259826
|
package com.jiadun.dispatch.validator.annotation.validator;
import com.fit.utils.se.EmptyUtils;
import com.jiadun.dispatch.validator.annotation.FieldIsBoolean;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
/**
* @description: 布尔验证器
* @author: caiping
* @date: created in 2018/1/26 18:05
*/
public class FieldIsBooleanValidator implements ConstraintValidator<FieldIsBoolean,Object> {
private FieldIsBoolean fieldIsBoolean;
@Override
public void initialize(FieldIsBoolean fieldIsBoolean) {
this.fieldIsBoolean = fieldIsBoolean;
}
@Override
public boolean isValid(Object value, ConstraintValidatorContext context) {
if(value == null){
return true;
}
if(value instanceof Boolean){
return true;
}
String str = value.toString();
if(!str.matches("^true|false$")){
if(EmptyUtils.isEmpty(fieldIsBoolean.message())){
context.buildConstraintViolationWithTemplate(String.format("%s必须是true或者false!",fieldIsBoolean.fieldName())).addConstraintViolation();
}
return false;
}
return true;
}
}
|
bf17b957-39e3-463d-925b-cf493f38fb8a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-06 14:33:25", "repo_name": "gjorgjij/student-system-spring-boot-app", "sub_path": "/src/main/java/com/example/studentsystem/servicesImpl/StudentServiceImpl.java", "file_name": "StudentServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1224, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "8932ef9f5ef02d63e3449584c9f072540e8c037d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gjorgjij/student-system-spring-boot-app
| 228
|
FILENAME: StudentServiceImpl.java
| 0.291787
|
package com.example.studentsystem.servicesImpl;
import com.example.studentsystem.dao.Dao;
import com.example.studentsystem.dto.StudentDto;
import com.example.studentsystem.repositories.StudentRepository;
import com.example.studentsystem.services.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Optional;
@Component
public class StudentServiceImpl implements StudentService {
@Autowired
private Dao<StudentDto> studentDao;
@Autowired
private StudentRepository studentRepository;
@Override
public Optional<StudentDto> getById(int id) {
return studentDao.getById(id);
}
@Override
public StudentDto getByEmail(String email) {
return studentRepository.getByEmail(email);
}
@Override
public StudentDto getByHash(String hash) {
return studentRepository.getByHash(hash);
}
@Override
public List<StudentDto> getAll() {
return (List<StudentDto>) studentDao.getAll();
}
@Override
public Integer save(StudentDto studentDto) throws Exception {
return studentDao.save(studentDto).getId();
}
}
|
409fb800-a248-46f0-b10b-0f2fe5a20cef
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-22 21:25:58", "repo_name": "tkrutowski/Twitter", "sub_path": "/src/main/java/org/sda/twitter/filters/AuthenticationFilter.java", "file_name": "AuthenticationFilter.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "bba52e2ba521060b3cffca5eefb7f0e1f2fdf9c7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tkrutowski/Twitter
| 197
|
FILENAME: AuthenticationFilter.java
| 0.229535
|
package org.sda.twitter.filters;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
@WebFilter(filterName = "AuthenticationFilter", servletNames = {"PublishTweetServlet"}, urlPatterns = {"/profile.jsp", "/users.jsp", "/newTweet.html"})
public class AuthenticationFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
HttpSession session = httpServletRequest.getSession(false);
if (session != null) {
chain.doFilter(request,response);
} else {
((HttpServletResponse) response).sendError(HttpServletResponse.SC_UNAUTHORIZED);
}
}
@Override
public void destroy() {
}
}
|
386d47cf-c56b-446c-a388-76e021cc538d
|
{"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/test/java/co/rchive/test/spec/share/ShareScreenplayForFirstTimeTest.java", "file_name": "ShareScreenplayForFirstTimeTest.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "cc543c4aaa5cea03da3ae7963a28ff29a7f4fbdd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/punit-patil/RchiveAutomation
| 225
|
FILENAME: ShareScreenplayForFirstTimeTest.java
| 0.264358
|
package co.rchive.test.spec.share;
import java.util.Properties;
import org.testng.annotations.Test;
import co.rchive.spec.userpages.ShareSpecDefinition;
import co.rchive.test.testbase.TestBase;
public class ShareScreenplayForFirstTimeTest extends TestBase {
// TestBase tb=new TestBase();
Properties prop = getpropValues();
public ShareScreenplayForFirstTimeTest() {
super();
setBrowser(prop.getProperty("browser1"));
setBaseURL(prop.getProperty("beta_url"));
}
@Test
public void shareScreenplayForFirstTime() {
ShareSpecDefinition shareUser = new ShareSpecDefinition(driver);
shareUser.loginToRchiveWithEmail(prop.getProperty("email"), prop.getProperty("password"));
shareUser.selectScreenPlay();
shareUser.shareSidForFirstTime();
shareUser.goToShareWindowAndSmartShare(prop.getProperty("smartshare_user"),
prop.getProperty("smartshare_fname"), prop.getProperty("smartshare_lname"), prop.getProperty("email"),
prop.getProperty("privacyUpdatedInvitedUsers"));
}
}
|
2872baec-b43d-4286-9938-3071bdd35bf8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-05 06:34:19", "repo_name": "czq080/vshop", "sub_path": "/wechat-official-message/src/main/java/com/vigoss/wechat/official/event/model/OfficialMenuViewEventMessage.java", "file_name": "OfficialMenuViewEventMessage.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "f04043dc351e15b237320e895b913f26f1347f84", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/czq080/vshop
| 256
|
FILENAME: OfficialMenuViewEventMessage.java
| 0.246533
|
package com.vigoss.wechat.official.event.model;
import com.vigoss.wechat.core.MessageConstant;
import com.vigoss.wechat.core.event.model.EventMessage;
import com.vigoss.wechat.core.event.type.EventMessageType;
import javax.xml.bind.annotation.XmlElement;
/**
* @author chenzhiqiang
* @date 2018/7/8
*/
public class OfficialMenuViewEventMessage extends EventMessage {
private static final long serialVersionUID = -2928373252957560011L;
public OfficialMenuViewEventMessage() {
super(EventMessageType.view.name());
}
/**
* 事件类型
*/
@XmlElement(name = "MenuID")
private String menuID;
public String getMenuID() {
return menuID;
}
@Override
public int hashCode() {
return MessageConstant.odd_prime * super.hashCode() + (menuID == null ? 0 : menuID.hashCode());
}
@Override
public String toString() {
return "OfficialMenuViewEventMessage{" +
"menuID='" + menuID + super.toString() + '\'' +
"} ";
}
}
|
1bae6d86-3432-4cb2-bf5d-9ecac91eed5c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-29T12:33:52", "repo_name": "sakshamdongre/MyApplicationtest", "sub_path": "/app/src/main/java/com/sample/sampleapplication/api/APIClient.java", "file_name": "APIClient.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "c606e50ec17557a17bdf1e5ba7defe541f539a97", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sakshamdongre/MyApplicationtest
| 185
|
FILENAME: APIClient.java
| 0.255344
|
package com.sample.sampleapplication.api;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class APIClient {
private static final String BASE_URL = "http://192.168.43.95:5000/api/";
private static APIInterface apiInterface = null;
private APIClient(){
}
public static APIInterface getApiInterface(){
final OkHttpClient okHttpClient = new OkHttpClient.Builder()
.readTimeout(60, TimeUnit.SECONDS)
.connectTimeout(60, TimeUnit.SECONDS)
.build();
if(apiInterface == null){
apiInterface = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.client(okHttpClient)
.build().create(APIInterface.class);
}
return apiInterface;
}
}
|
e973a218-2675-41d9-b06a-70bf9cc85817
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-05 15:59:42", "repo_name": "YevheniiVerkhovych/ConnectionPoolAndButchExecutorJDBC", "sub_path": "/src/main/java/DbWriteInfo.java", "file_name": "DbWriteInfo.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "77166a7b9620048e960b00d3edd8754449fe8bf2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/YevheniiVerkhovych/ConnectionPoolAndButchExecutorJDBC
| 203
|
FILENAME: DbWriteInfo.java
| 0.277473
|
import java.io.FileInputStream;
import java.io.IOException;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
public class DbWriteInfo implements Runnable {
private int id;
List<String> list = new ArrayList<>();
public DbWriteInfo(int id){
this.id = id;
}
public void run() {
FileInputStream fis;
Properties property = new Properties();
Connection connection = null;
try {
fis = new FileInputStream("src/main/resources/config.properties");
property.load(fis);
} catch (IOException e) {
System.err.println("File with resources NOT FOUND!");
}
list.add(property.getProperty("query2"));
list.add(property.getProperty("query3"));
try {
connection = ConnectionPool.getConnection();
} catch (SQLException e) {
e.printStackTrace();
}
try {
BatchQueriesExecutor.executeBatch(connection, list);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
|
30af5665-42cb-470a-8982-0899bd188079
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-24 14:21:54", "repo_name": "dineshbabu/springBootUnitTests", "sub_path": "/src/test/java/com/example/SanTest/repository/AccountRepositoryUnitTest.java", "file_name": "AccountRepositoryUnitTest.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "e48f5f0a90a919bada2264ef1759020208184c70", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dineshbabu/springBootUnitTests
| 172
|
FILENAME: AccountRepositoryUnitTest.java
| 0.291787
|
package com.example.SanTest.repository;
import com.example.SanTest.dto.Account;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.assertTrue;
@RunWith(SpringRunner.class)
@DataJpaTest
public class AccountRepositoryUnitTest {
@Autowired
private TestEntityManager testEntityManager;
@Autowired
private AccountRepository accountRepository;
@Test
public void canCreateAccount(){
Account expectedAccount = new Account();
expectedAccount.setName("RepoTest");
testEntityManager.persist(expectedAccount);
Account actualAccount = accountRepository.findByName("RepoTest");
assertTrue(expectedAccount.getName().equals(actualAccount.getName()));
}
}
|
1f69fa10-7831-421c-92bf-d2bcd541310d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-19 07:00:49", "repo_name": "xinshangyu/demo2", "sub_path": "/app/src/main/java/com/example/administrator/demo/adapter/Personal_SQ_Adapter.java", "file_name": "Personal_SQ_Adapter.java", "file_ext": "java", "file_size_in_byte": 1229, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "aa7129e8e30d2c0e980faf70787d119644f63463", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/xinshangyu/demo2
| 238
|
FILENAME: Personal_SQ_Adapter.java
| 0.250913
|
package com.example.administrator.demo.adapter;
import android.content.Context;
import android.view.View;
import com.example.administrator.demo.R;
import com.example.administrator.demo.entity.SQBean;
import com.example.baselibrary.zh.adapter.CommonAdapter;
import com.example.baselibrary.zh.adapter.base.ViewHolder;
import java.util.ArrayList;
/**
* 商圈adapter
*/
public class Personal_SQ_Adapter extends CommonAdapter<SQBean.BizCircleBean> {
private Context context;
public Personal_SQ_Adapter(Context context, ArrayList<SQBean.BizCircleBean> datas) {
super(context, R.layout.item_personal_sq, datas);
this.context = context;
}
@Override
protected void convert(ViewHolder holder, SQBean.BizCircleBean messageListBean, int position) {
holder.setText(R.id.tv_name, messageListBean.getUserInfo().getNickName())
.setText(R.id.tv_content, messageListBean.getContent())
.setOnClickListener(R.id.iv_dot, new View.OnClickListener() {
@Override
public void onClick(View view) {
mOnItemClickListener.onItemClick(view, holder, position);
}
});
}
}
|
9c2ea0cf-1db3-423e-9c85-f6ddccdb3c17
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-04 11:30:53", "repo_name": "rudwns/teamproject", "sub_path": "/teamSsum/src/com/service/RemoveContent.java", "file_name": "RemoveContent.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "06956eb5f078738e0a04cdd0456df00107e34dc9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UHC"}
|
https://github.com/rudwns/teamproject
| 197
|
FILENAME: RemoveContent.java
| 0.240775
|
package com.service;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.model.BoardDAO;
/**
* Servlet implementation class RemoveContent
*/
@WebServlet("/RemoveContent")
public class RemoveContent extends HttpServlet {
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int num = Integer.parseInt(request.getParameter("num"));
BoardDAO dao = BoardDAO.getInstance();
String moveUrl = "";
try {
int cnt = dao.deleteContent(num);
if(cnt>0){
System.out.println("삭제성공");
moveUrl = "greenright.jsp";
}else {
System.out.println("삭제실패");
moveUrl = "content.jsp";
}
response.sendRedirect(moveUrl);
}catch (Exception e) {
e.printStackTrace();
}
}
}
|
ffdc6cad-edfe-41da-b178-2d12c5b6328c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-18 10:43:43", "repo_name": "OussamaCeltica/MyStore", "sub_path": "/plus/MyBD.java", "file_name": "MyBD.java", "file_ext": "java", "file_size_in_byte": 1123, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "2a517bc7a55e881f940722a3ce1ce210f97295aa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/OussamaCeltica/MyStore
| 201
|
FILENAME: MyBD.java
| 0.272025
|
package plus;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class MyBD {
Connection connect=null;
Statement s=null;
PreparedStatement p=null;
ResultSet r=null;
public MyBD(String lien,String typeDB){
try {
Class.forName(typeDB);
connect=DriverManager.getConnection(lien);
s=connect.createStatement();
write("PRAGMA foreign_keys = ON;");
}
catch (Exception e){
e.printStackTrace();
}
}
//read from DB , avec while(r.next()){ r.getString(nom_Column); }
public ResultSet read(String query) throws SQLException{
r=s.executeQuery(query);
return r;
}
//write into db ..
public void write(String query) throws SQLException{
connect.prepareStatement(query).executeUpdate();
}
}
|
85013561-dd3e-4885-adae-770548903c14
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-05 12:44:52", "repo_name": "Naufal-FTech/Modul_3_Mobile", "sub_path": "/app/src/main/java/com/example/loginregister/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "d581fe9ad680f9b6e28e3ce319bed11bec4904c1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Naufal-FTech/Modul_3_Mobile
| 194
|
FILENAME: MainActivity.java
| 0.218669
|
package com.example.loginregister;
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 loginButton, registerButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
loginButton = (Button) findViewById(R.id.button_login);
registerButton = (Button) findViewById(R.id.button3_register);
loginButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// Start NewActivity.class
Intent myIntent = new Intent(MainActivity.this, Menu.class);
startActivity(myIntent);
}
});
registerButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// Start NewActivity.class
Intent myIntent = new Intent(MainActivity.this, Register.class);
startActivity(myIntent);
}
});
}
}
|
4c9a8399-1fb4-4f93-81e9-6d789288db3f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-10 15:32:21", "repo_name": "partnerccz/soa", "sub_path": "/src/main/java/com/soa/balance/RoundRobinBalance.java", "file_name": "RoundRobinBalance.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "4ab41cd037dca1389619ed6241e330ac46ab8c60", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/partnerccz/soa
| 240
|
FILENAME: RoundRobinBalance.java
| 0.292595
|
package com.soa.balance;
import com.alibaba.fastjson.JSONObject;
import com.soa.invoke.NodeInfo;
import java.util.Collection;
import java.util.List;
public class RoundRobinBalance implements LoadBalance {
private static Integer index = 0;
@Override
public NodeInfo doSelect(List<String> registryInfo) {
String registry = "";
synchronized (index) {
if (index > registryInfo.size()) {
index = 0;
}
registry = registryInfo.get(index);
index++;
}
JSONObject parseObject = JSONObject.parseObject(registry);
Collection<Object> values = parseObject.values();
for (Object value : values) {
parseObject = JSONObject.parseObject(value.toString());
}
JSONObject protocol = parseObject.getJSONObject("protocol");
NodeInfo nodeInfo = new NodeInfo();
nodeInfo.setHost(protocol.get("host") != null ? protocol.getString("host") : "");
nodeInfo.setPort(protocol.get("port") != null ? protocol.getString("host") : "");
nodeInfo.setContextPath(protocol.get("contextPath") != null ? protocol.getString("contextPath") : "");
return nodeInfo;
}
}
|
4789fae0-af13-4993-bc93-fe2aef84856b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-20 09:37:20", "repo_name": "NickMeeus/Bierhuis", "sub_path": "/src/main/java/be/vdab/services/BestelbonServiceImpl.java", "file_name": "BestelbonServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "f29a6cc9fcf4df32aa7161439c8a0cce93f37743", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/NickMeeus/Bierhuis
| 228
|
FILENAME: BestelbonServiceImpl.java
| 0.284576
|
package be.vdab.services;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import be.vdab.entities.Bestelbon;
import be.vdab.repositories.BestelbonRepository;
@Service
public class BestelbonServiceImpl implements BestelbonService {
private final BestelbonRepository bestelbonRepository;
@Autowired
BestelbonServiceImpl(BestelbonRepository bestelbonRepository) {
this.bestelbonRepository = bestelbonRepository;
}
@Override
public void create(Bestelbon bestelbon) {
bestelbonRepository.save(bestelbon);
}
@Override
public Bestelbon read(long id) {
return bestelbonRepository.findOne(id);
}
@Override
public void update(Bestelbon bestelbon) {
bestelbonRepository.save(bestelbon);
}
@Override
public void delete(long id) {
bestelbonRepository.delete(id);
}
@Override
public List<Bestelbon> findAll() {
return bestelbonRepository.findAll();
}
}
|
9a3be589-9461-48a5-a280-fc602c508d17
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-01 10:31:16", "repo_name": "wangxu-96/algorithm_leisure", "sub_path": "/src/main/java/com/at/socket/ServerThread.java", "file_name": "ServerThread.java", "file_ext": "java", "file_size_in_byte": 1360, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "687aa7afb47c7634d73ae964cd3ee4a9967579bf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wangxu-96/algorithm_leisure
| 230
|
FILENAME: ServerThread.java
| 0.289372
|
package com.at.socket;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.Socket;
public class ServerThread implements Runnable {
private Socket client=null;
public ServerThread(Socket socket){
this.client=socket;
}
@Override
public void run() {
try {
PrintStream printStream=new PrintStream(client.getOutputStream());//获取Socket的输出流,用来向客户端发送数据
BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(client.getInputStream()));//获取Socket的输入流,用来接收从客户端发送过来的数据
boolean flag=true;
while (flag){
String str=bufferedReader.readLine();//接收从客户端发送过来的数据
if (str==null||"".equals(str)){
flag=false;
}else {
if ("bye".equals(str)){
flag=false;
}else {
printStream.println("echo:"+str);//将接收到的字符串前面加上echo,发送到对应的客户端
}
}
}
printStream.close();
client.close();
}catch (Exception e){
e.printStackTrace();
}
}
}
|
aba498db-2f0a-4c0c-adba-b15e0cc51c0b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-06 07:23:58", "repo_name": "2042601376/LanGuoDemo", "sub_path": "/app/src/main/java/com/example/administrator/languodemo/Activity/ChangeCircleActivity.java", "file_name": "ChangeCircleActivity.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "e08aae1140afb4d4050cf9ec7bf64687884d5919", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/2042601376/LanGuoDemo
| 179
|
FILENAME: ChangeCircleActivity.java
| 0.282196
|
package com.example.administrator.languodemo.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import com.example.administrator.languodemo.R;
public class ChangeCircleActivity extends AppCompatActivity {
private EditText et_number;
private String number;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_change_circle);
et_number = (EditText)findViewById(R.id.change_et_number);
}
public void changeNumber(View view) {
Intent back = new Intent(ChangeCircleActivity.this,CurveActivity.class);
number = et_number.getText().toString().trim();
Log.i("Number","+++" + number);
back.putExtra("number",number);
startActivity(back);
finish();
}
}
|
7ea4ed85-23fe-4617-a534-409cefa76908
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-05-07T16:13:27", "repo_name": "mintae0424/CT-Buds", "sub_path": "/frontend/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1093, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "33a7bd567b751ab1c85ff82e83702df9e35d7a2c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mintae0424/CT-Buds
| 240
|
FILENAME: README.md
| 0.180107
|
# Buds Website (Front-end)
## Project Descriptions
Prototype of Buds website. Designed using React Javascript using Redux and Hooks.
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### Credits
Note that initial images were used for demonstration purposes only.
|
7ac34fde-1b3d-4bcc-bfe9-311ace6129a0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-24 12:14:47", "repo_name": "KunakbaevAV/Sociometry", "sub_path": "/src/main/java/backend/Group.java", "file_name": "Group.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "f98457d1986a2bb7e044eee81c32d71532d36cd4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/KunakbaevAV/Sociometry
| 247
|
FILENAME: Group.java
| 0.290981
|
package backend;
import java.util.ArrayList;
import java.util.List;
/**
* @autor Kunakbaev Artem
*/
public class Group {
private List<Respondent> group;
private String nameGroup;
private int groupSize;
public Group(String nameGroup) {
group = new ArrayList<Respondent>();
this.nameGroup = nameGroup;
groupSize = 0;
}
public void addRespondent(Respondent r) {
group.add(r);
groupSize++;
}
public int getGroupSize() {
return groupSize;
}
public String getNameGroup() {
return nameGroup;
}
public List getRespondents(){
return group;
}
public Respondent getRespondent(int index){
return group.get(index);
}
public Respondent getRespondent(String name){
for (Respondent r :
group) {
if (r.getName().equals(name)) return r;
}
return null;
}
@Override
public String toString() {
return "Group{" +
"group=" + group +
", nameGroup='" + nameGroup + '\'' +
'}';
}
}
|
f872f73c-d38b-4e41-b83a-7d4fd9f910bd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-17 21:54:02", "repo_name": "YasmineHassan/Wuzzuf_Task", "sub_path": "/src/TestWuzzufJobs.java", "file_name": "TestWuzzufJobs.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "a1253d730b83fd0ab16ac4d049aeb1e2a2f97dd2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/YasmineHassan/Wuzzuf_Task
| 211
|
FILENAME: TestWuzzufJobs.java
| 0.272025
|
import java.io.File;
import java.util.List;
public class TestWuzzufJobs {
public void test(){
IO Reader = new IO();
//For Reading DataSet (.csv) File.
List<JobDetails> Dataset = Reader.ReadCSVFile("C:\\Users\\Yasoo\\Documents\\AAAAa\\Section_Dr.Ghozia\\04_Pyramids_CSV_Task\\Pyramids\\src\\pyramids.csv");
JobsDataService job = new JobsDataService();
//Testing Filter functions on jobs into wuzzuf dataset.
System.out.println("#Jobs according to Title:");
job.FilterJobsByTitle(Dataset);
System.out.println("");
System.out.println("#Jobs according to Country:");
job.FilterJobsByCountry(Dataset);
System.out.println("");
System.out.println("#Jobs according to Level:" );
job.FilterJobsByLevel(Dataset);
System.out.println("");
System.out.println("#Jobs according to Years_experience:");
job.FilterJobsByExp_Years(Dataset);
}
}
|
45c5302c-12b8-4aa4-8a86-b8547dee1fe1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-11 12:17:51", "repo_name": "ravindrarjpt9/alpha", "sub_path": "/src/java/com/skt/web/alpha/controller/RuleController.java", "file_name": "RuleController.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "4091215f006544e84ac0323fd17cb24538bbd17e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ravindrarjpt9/alpha
| 230
|
FILENAME: RuleController.java
| 0.281406
|
package com.skt.web.alpha.controller;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.skt.web.alpha.service.RuleService;
import com.skt.web.alpha.to.ErrorResponse;
import com.skt.web.alpha.to.Response;
import com.skt.web.common.exception.ApplicationException;
@Controller
public class RuleController {
private static final Logger LOG = Logger.getLogger(RuleController.class);
@Autowired
RuleService ruleService;
@Transactional
@RequestMapping(value = "/getRules", method = RequestMethod.GET, consumes = "application/json", produces = "application/json")
@ResponseBody
public Response getRules() {
boolean success = false;
Object data = null;
try {
data = ruleService.getRules();
success = true;
} catch (ApplicationException e) {
data = new ErrorResponse(e.getErrorCode(), e.getMessage());
}
return new Response(success, data);
}
}
|
0464d031-6dd1-4058-b317-a86e0e8108d7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-30 16:29:46", "repo_name": "zhenllllll/SpotifyMVP", "sub_path": "/app/src/main/java/gdg/androidtitlan/spotifymvp/music/api/model/ArtistImages.java", "file_name": "ArtistImages.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "9864d27c781b4a242178a6648ced1739d24532a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zhenllllll/SpotifyMVP
| 230
|
FILENAME: ArtistImages.java
| 0.247987
|
package gdg.androidtitlan.spotifymvp.music.api.model;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.SerializedName;
/**
* Created by Jhordan on 20/11/15.
*/
public class ArtistImages implements Parcelable {
@SerializedName("height") public int heigth;
@SerializedName("url") public String url;
@SerializedName("width") public int width;
@Override public int describeContents() {
return 0;
}
@Override public void writeToParcel(Parcel parcel, int i) {
parcel.writeInt(this.heigth);
parcel.writeString(this.url);
parcel.writeInt(this.width);
}
protected ArtistImages(Parcel in){
this.heigth = in.readInt();
this.url = in.readString();
this.width = in.readInt();
}
public static final Creator<ArtistImages> CREATOR = new Creator<ArtistImages>() {
public ArtistImages createFromParcel(Parcel source) {
return new ArtistImages(source);
}
public ArtistImages[] newArray(int size) {
return new ArtistImages[size];
}
};
}
|
5661264d-6349-42eb-9e4a-4a02408eeaf5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-16 14:39:22", "repo_name": "Ramesh7214/Hibernate", "sub_path": "/CRUD Operations/InsertEX/src/com/gbn/model/Employee.java", "file_name": "Employee.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "62a9435b77961b78ce80dfb85b9a3d9f607bda7b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Ramesh7214/Hibernate
| 247
|
FILENAME: Employee.java
| 0.294215
|
package com.gbn.model;
import java.math.BigDecimal;
/**
* Employee entity. @author MyEclipse Persistence Tools
*/
public class Employee implements java.io.Serializable {
// Fields
private Integer empId;
private String empName;
private BigDecimal empSal;
// Constructors
/** default constructor */
public Employee() {
}
/** minimal constructor */
public Employee(Integer empId) {
this.empId = empId;
}
/** full constructor */
public Employee(Integer empId, String empName, BigDecimal empSal) {
this.empId = empId;
this.empName = empName;
this.empSal = empSal;
}
// Property accessors
public Integer getEmpId() {
return this.empId;
}
public void setEmpId(Integer empId) {
this.empId = empId;
}
public String getEmpName() {
return this.empName;
}
public void setEmpName(String empName) {
this.empName = empName;
}
public BigDecimal getEmpSal() {
return this.empSal;
}
public void setEmpSal(BigDecimal empSal) {
this.empSal = empSal;
}
}
|
dc813742-d8f3-498c-b3ba-7735d3ff18b8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-04-16T05:27:19", "repo_name": "nhunt16/APCS-Final-Project", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1047, "line_count": 11, "lang": "en", "doc_type": "text", "blob_id": "7f0254331f51cb6c968e29cdfea4603851af4bca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nhunt16/APCS-Final-Project
| 246
|
FILENAME: README.md
| 0.193147
|
# APCS-Final-Project
Okay so I made a minecraft mod and uploaded the src or main source file.
To use my code simply download forge set it up in eclipe (I used eclipse NEON), set your Minecraft client to 1.7.10,
and replace the default src file. Now all you have to do is run the program in the IDE and
the mod should build and run. I'm sure there is a way to use the src file in a normal Minecraft client but I don't know for sure.
Run into any troubles? Watch this tutorial on setting up a mac forge mod: "https://www.youtube.com/watch?v=rhc3I9jx474".
All in all my minecraft mod includes two different full item sets, two armor sets, various custom items with specific item rarity,
one block, one smelting recipe, and custom crafting recipes for all items (legendary item crafting recipes include super rare items!). The combat tab of items is basically doubled now, with room for more items (rare or otherwise). I wanted to do this because I felt like Minecraft missed that classic RPG element of lots of items and an item rarity system.
|
3097445e-1682-411d-9a11-b128dcd731eb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-18 14:16:50", "repo_name": "CoOwner/StaffUtilities", "sub_path": "/src/main/java/me/dreamzy/staff/handlers/ServerHandler.java", "file_name": "ServerHandler.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "757cfc9d65b95d46d0904a6b5c00665720c9f0b3", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/CoOwner/StaffUtilities
| 230
|
FILENAME: ServerHandler.java
| 0.272025
|
package me.dreamzy.staff.handlers;
import java.util.HashMap;
import java.util.UUID;
import lombok.Data;
import redis.clients.jedis.JedisPool;
import me.dreamzy.staff.StaffPlugin;
import me.dreamzy.staff.redis.JedisPublisher;
import me.dreamzy.staff.redis.JedisSubscriber;
@Data
public class ServerHandler {
private StaffPlugin plugin;
private JedisPool pool;
private JedisPublisher publisher;
private JedisSubscriber subscriber;
private HashMap<UUID, Long> cooldowns;
public ServerHandler(StaffPlugin plugin) {
this.plugin = plugin;
cooldowns = new HashMap<UUID, Long>();
this.setupJedis();
}
private void setupJedis() {
this.pool = new JedisPool(plugin.getConfig().getString("REDIS.HOST"), plugin.getConfig().getInt("REDIS.PORT"));
this.publisher = new JedisPublisher(this.getPlugin());
this.subscriber = new JedisSubscriber(this.getPlugin());
}
public void disable() {
this.subscriber.getJedisPubSub().unsubscribe();
this.cooldowns.clear();
}
}
|
5ad508f2-8ae9-4eba-98e7-bb445df9475d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-01 10:04:58", "repo_name": "k24pci/session2", "sub_path": "/src/main/java/com/ucx/training/sessions/session2/Program.java", "file_name": "Program.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "2ecc3b65cf1d79971801a154b995da7f720c35e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/k24pci/session2
| 254
|
FILENAME: Program.java
| 0.291787
|
package com.ucx.training.sessions.session2;
import com.ucx.training.sessions.session2.packageA.A;
import com.ucx.training.sessions.session2.packageB.B;
public class Program {
private static int x = 0;
public static void main(String[] args) {
A a = new A();
B b = new B();
System.out.println(a.getX());
System.out.println(b.getValue());
System.out.println(a.display("null"));
Program program = new Program();
program.printValue();
final ImmutableClass immutable = new ImmutableClass("Agon", "agon@email.com");
ImmutableClass immutable2 = new ImmutableClass("Arta", "arta@email.com");
// immutable = new ImmutableClass("agron", "agron@email.com");
System.out.println(immutable.getName() + immutable.getEmail());
System.out.println(immutable2.getName() + immutable2.getEmail());
Error error = Error.ERR_100;
System.out.println(error.getCode() + " " + error.getDescription());
for (Error error1 : Error.values()){
System.out.println(error1.getCode() + " " + error1.getDescription());
}
}
private void printValue(){
System.out.println(x);
}
}
|
97178e2c-e5b4-4c78-a606-4b4a0c195ab8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-30 16:29:50", "repo_name": "rlp390/Test-Project", "sub_path": "/src/main/java/org/launchcode/TestProject/controllers/AbstractController.java", "file_name": "AbstractController.java", "file_ext": "java", "file_size_in_byte": 1110, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "b50240af553b062eb57f11918bb1721ac29490e6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rlp390/Test-Project
| 195
|
FILENAME: AbstractController.java
| 0.243642
|
package org.launchcode.TestProject.controllers;
import org.launchcode.TestProject.models.User.User;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
public class AbstractController {
@Autowired
AuthenticationController authenticationController;
public String returnLoginName(HttpServletRequest request) {
HttpSession session = request.getSession();
User user = authenticationController.getUserFromSession(session);
String str = "";
if(user == null) {
str = "Not logged in | ";
} else {
str = "Logged in as " + user.getUsername() + " | ";
}
return str;
}
public String returnLoginURL(HttpServletRequest request) {
HttpSession session = request.getSession();
User user = authenticationController.getUserFromSession(session);
String str = "";
if(user == null) {
str = "Login";
} else {
str = "Logout";
}
return str;
}
}
|
ea3f353c-4b87-4712-b5d6-8ec548e255c8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-07-12 15:38:17", "repo_name": "ssh352/Chronicle-Wire", "sub_path": "/src/test/java/net/openhft/chronicle/wire/method/ChronicleEvent.java", "file_name": "ChronicleEvent.java", "file_ext": "java", "file_size_in_byte": 1038, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "27a3d61b40887c28a14158fa41e158e0c5986473", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ssh352/Chronicle-Wire
| 252
|
FILENAME: ChronicleEvent.java
| 0.264358
|
package net.openhft.chronicle.wire.method;
import net.openhft.chronicle.wire.Base64LongConverter;
import net.openhft.chronicle.wire.BytesInBinaryMarshallable;
import net.openhft.chronicle.wire.LongConversion;
import net.openhft.chronicle.wire.NanoTimestampLongConverter;
public class ChronicleEvent extends BytesInBinaryMarshallable implements Event {
@LongConversion(NanoTimestampLongConverter.class)
private long sendingTimeNS;
@LongConversion(NanoTimestampLongConverter.class)
private long transactTimeNS;
@LongConversion(Base64LongConverter.class)
private long text1;
private String text3;
@Override
public void sendingTimeNS(long sendingTimeNS) {
this.sendingTimeNS = sendingTimeNS;
}
@Override
public long sendingTimeNS() {
return sendingTimeNS;
}
@Override
public void transactTimeNS(long transactTimeNS) {
this.transactTimeNS = transactTimeNS;
}
@Override
public long transactTimeNS() {
return transactTimeNS;
}
}
|
548a45b8-cb21-4162-a22c-4533c05ce5b7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-23 14:23:52", "repo_name": "Albert-cmd/Android-Realm", "sub_path": "/app/src/main/java/com/example/m8_uf1_activitat6_bdlocal_realm/PersonaBD.java", "file_name": "PersonaBD.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "62a9df7e06017a554f73d69ce7b8e3f3d8ead2d3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Albert-cmd/Android-Realm
| 258
|
FILENAME: PersonaBD.java
| 0.20947
|
package com.example.m8_uf1_activitat6_bdlocal_realm;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
public class PersonaBD extends RealmObject {
@PrimaryKey
private String nom;
private String residencia;
private int edat;
public PersonaBD() {
}
@Override
public String toString() {
return
"nom:" + nom + '\'' +
"residencia:" + residencia + '\'' +
"edat:" + edat ;
}
public PersonaBD(String nom, String residencia, int edat) {
this.nom = nom;
this.residencia = residencia;
this.edat = edat;
}
public String getnom() {
return nom;
}
public void setnom(String nom) {
this.nom = nom;
}
public String getResidencia() {
return residencia;
}
public void setResidencia(String residencia) {
this.residencia = residencia;
}
public int getEdat() {
return edat;
}
public void setEdat(int edat) {
this.edat = edat;
}
}
|
cd46b147-dfc9-4621-95c9-36b12b4a618a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-21 16:16:42", "repo_name": "zachf/edgebot", "sub_path": "/src/main/java/com/metaui/edgebot/SlackBotContext.java", "file_name": "SlackBotContext.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "37982a52026243a6826d01a7a03285ef8e1715a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zachf/edgebot
| 213
|
FILENAME: SlackBotContext.java
| 0.224055
|
package com.metaui.edgebot;
import com.slack.api.Slack;
import com.slack.api.model.Conversation;
public class SlackBotContext {
private final String slackBotName;
private final Slack slack;
private final SlackQueryHelper queryHelper;
private final String token;
private final Conversation homeChannel;
public SlackBotContext(String slackBotName, Slack slack, SlackQueryHelper queryHelper, String token, Conversation homeChannel) {
this.slackBotName = slackBotName;
this.slack = slack;
this.queryHelper = queryHelper;
this.token = token;
this.homeChannel = homeChannel;
}
public String getSlackBotName() {
return slackBotName;
}
public Slack getSlack() {
return slack;
}
public SlackQueryHelper getQueryHelper() {
return queryHelper;
}
public String getToken() {
return token;
}
public Conversation getHomeChannel() {
return homeChannel;
}
}
|
9dea2bf1-50d4-4145-9eb2-d5aacfd97eb3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-28 07:48:34", "repo_name": "behroohj/senikshop", "sub_path": "/app/src/main/java/com/abideveloprs/smartmarket/debug/parser/buyRangeJsonParser.java", "file_name": "buyRangeJsonParser.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "1a190f220be46aa8f906de4618efde93f206c13e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/behroohj/senikshop
| 208
|
FILENAME: buyRangeJsonParser.java
| 0.283781
|
package com.abideveloprs.smartmarket.debug.parser;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Created by imanbahmani on 9/1/16 AD.
*/
public class buyRangeJsonParser {
public void buyRangeJsonParserInput(String input)
{
try
{
try
{
JSONArray jsonarray = new JSONArray(input);
for(int i=0; i<jsonarray.length(); i++)
{
JSONObject obj = jsonarray.getJSONObject(i);
int id = obj.getInt("id");
int price = obj.getInt("price");
int min = obj.getInt("min");
int max = obj.getInt("max");
String title = obj.getString("title");
}
}
catch (JSONException e)
{
e.printStackTrace();
}
} catch (Exception e)
{
Log.e("Error: ", e.getMessage());
}
}
}
|
e5177cf9-bf45-4ddb-b1b5-70b8296902e9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-10 11:41:45", "repo_name": "ParshakovaIrina/backendBooks", "sub_path": "/src/main/java/com/example/libr/domain/MyUser.java", "file_name": "MyUser.java", "file_ext": "java", "file_size_in_byte": 1208, "line_count": 67, "lang": "en", "doc_type": "code", "blob_id": "6c705c2ceb4fe8c1196d3a0cf7f4fe6372397227", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ParshakovaIrina/backendBooks
| 268
|
FILENAME: MyUser.java
| 0.272025
|
package com.example.libr.domain;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.util.Set;
@Getter
@Setter
@Entity
@Table(name = "usr")
public class MyUser {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String login;
private String password;
private String role;
// @OneToMany(mappedBy = "user", fetch = FetchType.EAGER)
// Set<Relations> relationsUser;
public MyUser() {
}
/* public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public void setRole(String role) {
this.role = role;
}
public String getRole() {
return role;
}
public Set<Relations> getRelationes() {
return relationes;
}
public void setRelationes(Set<Relations> relationes) {
this.relationes = relationes;
}*/
}
|
ae83ec37-1732-46f4-a6c9-1efa554f4f5a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-31 10:54:00", "repo_name": "poolborges/com-poolborges-example", "sub_path": "/com.poolborges.example.springframework/com.poolborges.example.springjpa.employee/src/test/java/com/poolborges/example/springjpa/employee/repository/EmployeeRepositoryTest.java", "file_name": "EmployeeRepositoryTest.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "7bb86446e1cddefec7626164a1e6fc6a0166e596", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/poolborges/com-poolborges-example
| 224
|
FILENAME: EmployeeRepositoryTest.java
| 0.27513
|
package com.poolborges.example.springjpa.employee.repository;
import com.poolborges.example.springjpa.employee.domain.Employee;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
*
* @author Borges
*/
public class EmployeeRepositoryTest extends AbstractRepositoryTest{
private Employee employee;
@Autowired
private EmployeeRepository employeeRepository;
@Before
public void setUp() {
employee = new Employee ();
employee.setName("Siyaphambili");
employee.setType("High");
employee.setEmis("Something");
employee.setTelephone("039 433 5555");
employee.setFax("039 433 5551");
employee.setAddress("Pisgah, KwaMachi, Harding");
}
@Test
public void saveNewEmployee () {
Employee newEmployee = employeeRepository.save(employee);
assertTrue("There must be a employee now", newEmployee != null);
}
}
|
23aa2413-0b48-4dfc-be29-30b747ac1f54
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-11 12:58:11", "repo_name": "tianyu097/myShop", "sub_path": "/src/main/java/com/li/filter/ZongFilter.java", "file_name": "ZongFilter.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "2ca7c159e8926b43a4fb82e9168017394de82427", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tianyu097/myShop
| 231
|
FILENAME: ZongFilter.java
| 0.268941
|
package com.li.filter;
import com.li.utils.CookieUtil;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.UUID;
@WebFilter("/*")
public class ZongFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest request= (HttpServletRequest) servletRequest;
HttpServletResponse response= (HttpServletResponse) servletResponse;
String token1 = CookieUtil.getValue(request, "token");
if (token1==null) {
String uuid = UUID.randomUUID().toString().toUpperCase();
Cookie token = new Cookie("token", uuid);
token.setMaxAge(10 * 24 * 3600);
token.setPath("/");
response.addCookie(token);
}
filterChain.doFilter(request,response);
}
@Override
public void destroy() {
}
}
|
93bc062b-79ff-408a-b46f-3620e1fa79be
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-01 01:53:40", "repo_name": "SiarheiBialevich/SenlaCourseJavaEE", "sub_path": "/Lection12/ElectronicRegistry/server/src/main/java/ru/senla/bialevich/Server.java", "file_name": "Server.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "bcb87fab585ae09598517f03b13819baa75d0f0e", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/SiarheiBialevich/SenlaCourseJavaEE
| 204
|
FILENAME: Server.java
| 0.276691
|
package ru.senla.bialevich;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class Server {
private static final int PORT = 8787;
private static final Logger LOG = Logger.getLogger(Server.class);
public static void main(String[] args) {
ServerSocket server = null;
try {
ServerThread thread;
server = new ServerSocket(PORT);
while (true) {
System.out.println("Waiting for a client...");
Socket socket = server.accept();
thread = new ServerThread(socket);
System.out.println("Client " + thread.getName() + " connected.");
thread.start();
}
} catch (IOException e) {
LOG.error(e.getMessage(), e);
} finally {
try {
assert server != null;
server.close();
} catch (IOException e) {
LOG.error(e.getMessage(), e);
}
}
}
}
|
2cfa9a14-b356-44e8-add9-3f818adbc7e4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-06 00:40:33", "repo_name": "JoinDevathon/poutian-2016", "sub_path": "/src/main/java/org/devathon/contest2016/PlayerInteractListener.java", "file_name": "PlayerInteractListener.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "58183b08bea12308440a02bdb071da46261410db", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/JoinDevathon/poutian-2016
| 213
|
FILENAME: PlayerInteractListener.java
| 0.23231
|
package org.devathon.contest2016;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.plugin.Plugin;
public class PlayerInteractListener implements Listener {
Plugin plugin;
String machineblk;
public PlayerInteractListener(Plugin pl) {
plugin = pl;
machineblk = plugin.getConfig().getString("machine");
}
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if(event.isBlockInHand()) {
return;
}
if(event.getClickedBlock().getType().toString().equalsIgnoreCase(machineblk) && event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
Inventory deconInv = Bukkit.createInventory(null, 9, "Deconstruction");
Player p = event.getPlayer();
p.openInventory(deconInv);
event.setCancelled(true);
}
}
}
|
49923053-8c04-48f7-95a8-72190d23ea5d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-19 12:01:31", "repo_name": "efkaxlog/Trax", "sub_path": "/app/src/main/java/com/bajera/xlog/trax/data/AndroidResourceManager.java", "file_name": "AndroidResourceManager.java", "file_ext": "java", "file_size_in_byte": 987, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "b0590be955d5c565355d254f8aee017490232f3f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/efkaxlog/Trax
| 189
|
FILENAME: AndroidResourceManager.java
| 0.233706
|
package com.bajera.xlog.trax.data;
import android.content.Context;
import android.content.res.Resources;
import androidx.core.content.ContextCompat;
import com.bajera.xlog.trax.R;
public class AndroidResourceManager implements ResourceManager {
private Resources resources;
private Context context;
public AndroidResourceManager(Context context) {
this.resources = context.getResources();
this.context = context;
}
@Override
public int getCalendarNumbersDrawableId() {
// return context.getDrawable(R.drawable.calendar_numbers);
return 0;
}
@Override
public int getCalendarDailyTaskDrawableId() {
return R.drawable.calendar_daily_task;
}
@Override
public int getChartDatasetColour() {
return ContextCompat.getColor(context, R.color.chartColor);
}
@Override
public int getSecondaryColour() {
return ContextCompat.getColor(context, R.color.colorSecondary);
}
}
|
e1d71e8f-07d5-463c-b3fa-6112e0bf755a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-17 14:09:11", "repo_name": "eltonschmoeller/ManutencaoEquipamentos", "sub_path": "/src/main/java/com/example/me/ManutencaoEquipamentosApplication.java", "file_name": "ManutencaoEquipamentosApplication.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "3c8c5945256b77485dc664047da07ef8764e5f18", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/eltonschmoeller/ManutencaoEquipamentos
| 264
|
FILENAME: ManutencaoEquipamentosApplication.java
| 0.262842
|
package com.example.me;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.example.me.entities.OrdemServico;
import com.example.me.entities.User;
import com.example.me.repositories.OrdemServicoRepository;
import com.example.me.repositories.UserRepository;
@SpringBootApplication
public class ManutencaoEquipamentosApplication implements CommandLineRunner {
@Autowired
private UserRepository userRepository;
@Autowired
private OrdemServicoRepository ordemServicoRepository;
public static void main(String[] args) {
SpringApplication.run(ManutencaoEquipamentosApplication.class, args);
}
@Override
public void run(String... args) throws Exception {
userRepository.save(new User("one", "one"));
userRepository.save(new User("two", "one"));
userRepository.save(new User("three", "one"));
ordemServicoRepository.save(new OrdemServico("João dos Santos", "Av. Centenário - Centro", "(48) 91234 5678",
"eltonschmoeller@gmail.com", "Geladeira", "Consul", "Não liga a luz interna.", "Novo"));
}
}
|
f626c11a-94db-4eeb-b549-85245d8c0ecd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-23 01:51:06", "repo_name": "Moonphy/oldProject", "sub_path": "/crm/crm-web/crm-web-biz/src/main/java/com/qipeipu/crm/dtos/statistics/crmAnalyse/StatisticsPersonalEntity.java", "file_name": "StatisticsPersonalEntity.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 63, "lang": "zh", "doc_type": "code", "blob_id": "5e6395c495d8c0c0ea8b0839ceeacb26c360177b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Moonphy/oldProject
| 286
|
FILENAME: StatisticsPersonalEntity.java
| 0.272025
|
package com.qipeipu.crm.dtos.statistics.crmAnalyse;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Builder;
import java.util.List;
/**
* Created by laiyiyu on 2015/4/22.
*/
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
public class StatisticsPersonalEntity {
/**
* 用户id
*/
private Integer userID;
/**
* 用户名
*/
private String userName;
/**
* 所在地区
*/
private String area;
/**
* 拜访客户数
*/
private int visitCustNum;
/**
* 任务数
*/
private int taskNum;
/**
* 是否使用crm:visitCustNum>1
*/
private boolean isUserCrm;
/**
* 工作天数
*/
private int workDay;
/**
* 工作时长
*/
private String workTime;
/**
* 工作时长:毫秒数
*/
private long workTimeForLong;
/**
* 建厂数
*/
private int createMfctyNum;
/**
* 拜访详情集合
*/
List<VisitDetailEntity> visitDetailEntityList;
}
|
955b7694-3811-4db2-b8d7-27b741a377af
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-11-15 09:11:17", "repo_name": "tietang/fqueue", "sub_path": "/src/test/java/com/google/code/fqueue/Example.java", "file_name": "Example.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "0945a1811c39c0e2348d8285c5d8468155bbbc7d", "star_events_count": 29, "fork_events_count": 22, "src_encoding": "UTF-8"}
|
https://github.com/tietang/fqueue
| 193
|
FILENAME: Example.java
| 0.259826
|
package com.google.code.fqueue;
import java.util.Random;
public class Example {
private static FileQueue fileFQueue;
public static FileBlockableQueue queue;
static {
try {
fileFQueue = new FileQueue("db", 1024);
queue = new FileBlockableQueue(fileFQueue);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) throws InterruptedException {
new Thread() {
@Override
public void run() {
while (true) {
queue.poll();
try {
Thread.sleep(1);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
}.start();
Random r = new Random();
while (true) {
queue.offer(("testqueueoffer" + r.nextDouble()).getBytes());
Thread.sleep(5);
}
}
}
|
892757cc-245e-4b40-982e-3b26edcf8ce9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-19 10:16:06", "repo_name": "a7956232/Survey", "sub_path": "/src/main/java/com/yxj/action/LogAction.java", "file_name": "LogAction.java", "file_ext": "java", "file_size_in_byte": 1171, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "d09dcc6177549e95117136c9c8fb97a17773b84d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/a7956232/Survey
| 289
|
FILENAME: LogAction.java
| 0.286169
|
package com.yxj.action;
import com.yxj.entity.Log;
import com.yxj.service.LogService;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import java.util.List;
/**
* Created by 95 on 2016/12/15.
*/
@Controller("logAction")
@Scope("prototype")
public class LogAction extends BaseAction<Log>{
private static final long serialVersionUID = 1854829617087635451L;
@Resource
private LogService logService;
private List<Log> logs;
//默认查询的月份数
private int monthNum = 1;
public int getMonthNum() {
return monthNum;
}
public void setMonthNum(int monthNum) {
this.monthNum = monthNum;
}
public List<Log> getLogs() {
return logs;
}
public void setLogs(List<Log> logs) {
this.logs = logs;
}
//查询全部日志
public String findAllLogs(){
this.logs = logService.findAllEntities();
return SUCCESS;
}
//查询最近的日志
public String findNearestLogs(){
this.logs = logService.findNearestLogs(monthNum);
return SUCCESS;
}
}
|
714b8810-d673-4790-9955-7504ca96aba7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-16 05:41:45", "repo_name": "wangquanjava/wq_exam", "sub_path": "/src/main/java/com/wq/vo/ProblemVO.java", "file_name": "ProblemVO.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "ab24991c8210c0d297a26e98dedab04854f254ec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wangquanjava/wq_exam
| 258
|
FILENAME: ProblemVO.java
| 0.258326
|
package com.wq.vo;
import java.util.List;
/**
* Created by wqquan.wang on 2018/3/16.
*/
public class ProblemVO {
private Integer problemId;
private String question;
private List<Answer> answers;
public static class Answer {
private String value;
private String text;
public Answer(String value, String text) {
this.value = value;
this.text = text;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public List<Answer> getAnswers() {
return answers;
}
public void setAnswers(List<Answer> answers) {
this.answers = answers;
}
public Integer getProblemId() {
return problemId;
}
public void setProblemId(Integer problemId) {
this.problemId = problemId;
}
}
|
f9c14005-1dcf-43a3-bb69-1909b700041e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-07 07:06:29", "repo_name": "ChangShen0925/Project2", "sub_path": "/Whist/src/game/TrumpSavingDecorator.java", "file_name": "TrumpSavingDecorator.java", "file_ext": "java", "file_size_in_byte": 1089, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "20c2ad0b286673444135331c790979ab22c0e6b0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ChangShen0925/Project2
| 249
|
FILENAME: TrumpSavingDecorator.java
| 0.282196
|
package game;
import ch.aplu.jcardgame.Card;
import ch.aplu.jcardgame.Hand;
import java.util.ArrayList;
public class TrumpSavingDecorator extends FilteringDecorator {
public ArrayList<Card> card;
public TrumpSavingDecorator(NPC npc, Suit lead, Suit trump){
super(npc, lead, trump);
this.card = npc.getHand().getCardList();
}
@Override
public void CardSet() {
npc.setCards(trumpSavingSet());
}
private ArrayList<Card> trumpSavingSet(){
ArrayList<Card> cards = new ArrayList<Card>();
for (int i = 0; i < card.size(); i++){
if (card.get(i).getSuit() == lead){
cards.add(card.get(i));
}
}
if(cards.size() == 0) {
for (int i = 0; i < card.size(); i++) {
if (card.get(i).getSuit() == trump) {
cards.add(card.get(i));
}
}
}else{
return cards;
}
if(cards.size() == 0){
return card;
}else{
return cards;
}
}
}
|
35363c32-8def-4eee-a9b1-500b523cf106
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-07-19T15:39:21", "repo_name": "SparkPost/support-docs", "sub_path": "/content/momentum/mobile/mobile-developer-guide/mm-7-log-inband-bounce-hook.md", "file_name": "mm-7-log-inband-bounce-hook.md", "file_ext": "md", "file_size_in_byte": 1099, "line_count": 16, "lang": "en", "doc_type": "text", "blob_id": "5973d4ce69e6db1ae22807992c44faafed9062c4", "star_events_count": 13, "fork_events_count": 46, "src_encoding": "UTF-8"}
|
https://github.com/SparkPost/support-docs
| 261
|
FILENAME: mm-7-log-inband-bounce-hook.md
| 0.290981
|
---
lastUpdated: "03/26/2020"
title: "MM7 Log Inband Bounce Hook"
description: "An MM 7 MT message submitted by Mobile Momentum is treated as an inband message When such a submission permanently fails it will be logged to the bounce log as well as the main log using the hook implementation of the MM 7 log permfail hook mms log permfail This..."
---
## <a name="MM7LogInbandBounceHook.purpose"></a> Purpose
An MM7 MT message submitted by Mobile Momentum is treated as an inband message. When such a submission permanently fails it will be logged to the bounce log, as well as the main log using the hook implementation of the MM7 log permfail hook, `mms_log_permfail`.
This hook is triggered in the same way as the MM7 log permfail hook. The <StatusCode> from a remote response or hook return value indicates when an MM7 submission is considered permanently failed. The only differences between the M7 Log Inband Bounce Hook and the MM7 log permfail hook are as follows:
* The log destination. A permanent failure is logged to the main log and a bounce to the bounce log.
* The log format
|
caeddf27-aa90-4c41-9e7e-b9166eefb8f2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-07 14:05:17", "repo_name": "Masudj6/Mass_manage", "sub_path": "/app/src/main/java/com/example/masud/mess_manage/activity/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "daef5c3fa81c6981c0e1b029ca2841950f542bfc", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/Masudj6/Mass_manage
| 198
|
FILENAME: MainActivity.java
| 0.214691
|
package com.example.masud.mess_manage.activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import com.example.masud.mess_manage.R;
public class MainActivity extends AppCompatActivity {
private Button signin,signup;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
signin=findViewById(R.id.btn_signin);
signup=findViewById(R.id.signup);
signup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(MainActivity.this,SignUp.class);
startActivity(intent);
}
});
signin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(MainActivity.this,Signin.class);
startActivity(intent);
}
});
}
}
|
fef98589-0532-42f6-88bf-ebc576cf54b3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-23 06:41:45", "repo_name": "dianaimao/DesignPattern", "sub_path": "/netty/src/main/java/oio/OIO.java", "file_name": "OIO.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "0aaa449e79c3d4dc7ef3ab234e6ecdfb8ea044cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dianaimao/DesignPattern
| 174
|
FILENAME: OIO.java
| 0.286169
|
package oio;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
public class OIO {
public static void main(String[] args) throws IOException {
final int portNumber=12456;
ServerSocket serverSocket=new ServerSocket(portNumber);
Socket socket=serverSocket.accept();
BufferedReader in=new BufferedReader(new InputStreamReader(socket.getInputStream()));
PrintWriter out=new PrintWriter(socket.getOutputStream());
String request,response;
while ((request=in.readLine())!=null){
if ("Done".equals(request)){
break;
}
response=processRequest(request);
out.write("server say-->"+response+"\n");
out.flush();
}
}
private static String processRequest(String request) {
return request.toUpperCase();
}
}
|
eaa57fc8-13b9-48f9-8c3c-ad0b5152fd0f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-02 06:27:44", "repo_name": "zkhus567/Piano-Player", "sub_path": "/Instrument.java", "file_name": "Instrument.java", "file_ext": "java", "file_size_in_byte": 1213, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "7f1b3d1ae181c1c61bdcede800de2e7cba2e926e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zkhus567/Piano-Player
| 295
|
FILENAME: Instrument.java
| 0.29584
|
/**
*
* Gets input from the instrument of choice and BPM.
* TextPrintInstrument and MIDIInstrument both extend off of this class
*
*/
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
public class Instrument {
private int instrumentId;
private int bpm;
HashMap<Integer, Note> beatMap = new HashMap<>();
Map<Integer, Note> sortedMap = new TreeMap<>(beatMap);
// this method load the Sheet data to be used in the subclasses
public void loadMusic(Sheet music) {
getValues();
sortedMap = music.sortedMap;
}
// abstract method
public void play() {
}
// returns value of instrumentId and BPM
public void getValues() {
Scanner scan = new Scanner(System.in);
System.out.println("Enter Instrument ID (0-144): ");
setInstrumentId(scan.nextInt());
System.out.print("Enter BPM (beats per min.): ");
setBpm(scan.nextInt());
}
public int getInstrumentId() {
return instrumentId;
}
public void setInstrumentId(int instrumentId) {
this.instrumentId = instrumentId;
}
public int getBpm() {
return bpm;
}
public void setBpm(int bpm) {
this.bpm = bpm;
}
}
|
ad9b051f-d3c9-49a4-8f8f-3d5c077946f3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-07 09:57:18", "repo_name": "duy170597/project_oop_20191", "sub_path": "/src/main/java/entitygeneration/EventGeneration.java", "file_name": "EventGeneration.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "c9a230294033816d6eae6cbb267bef54eb0922e2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/duy170597/project_oop_20191
| 202
|
FILENAME: EventGeneration.java
| 0.292595
|
package entitygeneration;
import com.google.gson.Gson;
import entity.Event;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.Random;
public class EventGeneration extends EntityGeneration {
public EventGeneration loadFromFile(String fileName) {
try {
Gson gson = new Gson();
Reader reader = new FileReader(fileName);
// Convert JSON File to Java Object
EventGeneration eg = gson.fromJson(reader, EventGeneration.class);
return eg;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public Event[] generate(int amount) {
Event[] events = new Event[amount];
Random rd = new Random();
for (int i = 0; i < amount; i++) {
events[i] = new Event(
"event"+i,
getLabel()[rd.nextInt(getLabel().length)],
getDescription()[rd.nextInt(getDescription().length)]);
}
return events;
}
}
|
5e40dd3e-8ed8-4a20-ba79-815957da439a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-25 20:03:32", "repo_name": "jordanasalamon/PortalMedicaodeSoftware", "sub_path": "/PortalMedicaoSoftware/src/br/ufes/inf/nemo/PortalMedicaoSoftware/gerenciaConteudo/application/ManageAnotherWorksServiceBean.java", "file_name": "ManageAnotherWorksServiceBean.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "1a63533165ee5a9e08fb2d1acf5611094a88012e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jordanasalamon/PortalMedicaodeSoftware
| 230
|
FILENAME: ManageAnotherWorksServiceBean.java
| 0.274351
|
package br.ufes.inf.nemo.PortalMedicaoSoftware.gerenciaConteudo.application;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import br.ufes.inf.nemo.PortalMedicaoSoftware.gerenciaConteudo.domain.AnotherWork;
import br.ufes.inf.nemo.PortalMedicaoSoftware.gerenciaConteudo.persistence.AnotherWorkDAO;
import br.ufes.inf.nemo.util.ejb3.application.CrudServiceBean;
import br.ufes.inf.nemo.util.ejb3.persistence.BaseDAO;
@Stateless
public class ManageAnotherWorksServiceBean extends CrudServiceBean<AnotherWork> implements ManageAnotherWorksService {
/**
*
*/
private static final long serialVersionUID = 1L;
@EJB
private AnotherWorkDAO anotherWorkDAO;
@Override
public BaseDAO<AnotherWork> getDAO() {
return anotherWorkDAO;
}
@Override
protected AnotherWork createNewEntity() {
return new AnotherWork();
}
@Override
public AnotherWork retrieveByName(String name) {
return anotherWorkDAO.retrieveByName(name);
}
}
|
cf9be133-7249-483e-ae76-ed3b3376d6f5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-23 12:10:50", "repo_name": "MahmoudAboNayel/MyNotes", "sub_path": "/app/src/main/java/com/example/abo_nayel/mynotes/Note.java", "file_name": "Note.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "4687ad3800ccbc02ce85aacc7aad36e8125cecb5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MahmoudAboNayel/MyNotes
| 241
|
FILENAME: Note.java
| 0.221351
|
package com.example.abo_nayel.mynotes;
import android.widget.CheckBox;
/**
* Created by Abo-Nayel on 22/09/2017.
*/
public class Note {
int id;
String note;
String status;
String owner;
public Note(int id, String note, String owner) {
this.id = id;
this.note = note;
this.owner = owner;
}
public Note() {
}
public Note(String note, String owner) {
this.note = note;
this.owner = owner;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
|
c3a8c067-6a6a-4e2e-914e-ce9004a7c11b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-03 07:29:04", "repo_name": "zhouzhou3516/stjava", "sub_path": "/mtomcat/src/main/java/com/zhou/dp/filter/filter/SensitiveFilter.java", "file_name": "SensitiveFilter.java", "file_ext": "java", "file_size_in_byte": 1252, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "46dfd6d82e40eeffd261c76d8151a6e2e6946bcd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zhouzhou3516/stjava
| 258
|
FILENAME: SensitiveFilter.java
| 0.252384
|
package com.zhou.dp.filter.filter;
import com.google.common.collect.Maps;
import com.zhou.dp.filter.MyRequest;
import com.zhou.dp.filter.MyResponse;
import com.zhou.dp.filter.chain.FilterChain;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
/**
* Created by liqingzhou on 17/7/30.
*/
public class SensitiveFilter implements Filter {
static Map<String, String> sensitiveMap = Maps.newHashMap();
static {
sensitiveMap.put("习近平", "习大大");
sensitiveMap.put("翻墙", "科学上网");
sensitiveMap.put("恐怖", "和平");
sensitiveMap.put("天朝", "中国");
}
@Override
public void doFilter(MyRequest request, MyResponse response, FilterChain filterChain) {
String content = request.getContent();
Iterator<Entry<String, String>> iter = sensitiveMap.entrySet().iterator();
while (iter.hasNext()) {
Entry<String, String> entry = iter.next();
content = content.replaceAll(entry.getKey(), entry.getValue());
}
request.setContent(content);
response.setContent(content);
System.out.println("Do sensitiveFilter:"+content);
filterChain.doFilter(request, response);
}
}
|
aae6ed27-79ba-45a0-bf18-eca898f2882b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-12 14:18:13", "repo_name": "radiment/jugroote-idea-plugin", "sub_path": "/src/com/epam/jugroote/plugin/GrutFileType.java", "file_name": "GrutFileType.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "5453b7e4d0286dbb2477dc0c0b30c261be71afe2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/radiment/jugroote-idea-plugin
| 234
|
FILENAME: GrutFileType.java
| 0.235108
|
package com.epam.jugroote.plugin;
import com.epam.jugroote.plugin.highlighter.GrutHighlighter;
import com.intellij.openapi.fileTypes.FileTypeEditorHighlighterProviders;
import com.intellij.openapi.fileTypes.LanguageFileType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
public class GrutFileType extends LanguageFileType {
public static final GrutFileType INSTANCE = new GrutFileType();
private GrutFileType() {
super(GrutLanguage.INSTANCE);
FileTypeEditorHighlighterProviders.INSTANCE.addExplicitExtension(this,
(project, fileType, virtualFile, colors) -> new GrutHighlighter(project, virtualFile, colors));
}
@NotNull
@Override
public String getName() {
return "Groovy html file";
}
@NotNull
@Override
public String getDescription() {
return "Groovy Html language file";
}
@NotNull
@Override
public String getDefaultExtension() {
return "gr";
}
@Nullable
@Override
public Icon getIcon() {
return GrutIcons.FILE;
}
}
|
7d483481-5c06-43f7-8b6f-1517d19a3e6e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-09 12:05:15", "repo_name": "oskar117/MineEdit", "sub_path": "/src/com/olek/nbt/tags/TagList.java", "file_name": "TagList.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "1a24876a95d834c797d49f97c8a8ab98ac6f1c9d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/oskar117/MineEdit
| 241
|
FILENAME: TagList.java
| 0.259826
|
package com.olek.nbt.tags;
import java.util.ArrayList;
import java.util.List;
public class TagList extends Tag {
private List<Tag> payload;
private byte payloadType;
private int length;
public TagList(String name, byte type, int length) {
super(name);
this.payloadType = type;
this.length = length;
this.payload = new ArrayList<>();
}
public Tag getTag(String name) {
for(Tag tag : payload) {
if(tag.getName().equals(name)) {
return tag;
}
}
return null;
}
public int getLength() {
return length;
}
public void setLength(int length) {
this.length = length;
}
public byte getPayloadType() {
return payloadType;
}
public void setPayloadType(byte payloadType) {
this.payloadType = payloadType;
}
public void addTag(Tag e) {
payload.add(e);
}
public List<Tag> getPayload() {
return payload;
}
public void setPayload(List<Tag> payload) {
this.payload = payload;
}
}
|
913054d5-2b32-4cf0-b9ab-ee88a36ade32
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-10 10:01:19", "repo_name": "hanyongheng/WebShop", "sub_path": "/src/main/java/org/seckill/dto/SeckillResult.java", "file_name": "SeckillResult.java", "file_ext": "java", "file_size_in_byte": 1285, "line_count": 68, "lang": "en", "doc_type": "code", "blob_id": "6e41c4e3167099e5240950a257d1b7b5d2c23d3e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hanyongheng/WebShop
| 294
|
FILENAME: SeckillResult.java
| 0.261331
|
package org.seckill.dto;
/**
* Created by hanyh on 16/9/2.
* 封装秒杀结果的ajax的json数据
*/
public class SeckillResult<T> {
private boolean success;
private T data;
private String error;
/**
* 如果成功就会有数据
* @param success
* @param data
*/
public SeckillResult(boolean success, T data) {
this.success = success;
this.data = data;
}
/**
* 如果失败就会有错误信息
* @param success
* @param error
*/
public SeckillResult(boolean success,String error) {
this.success = success;
this.error = error;
}
public boolean isSuccess() {
return success;
}
public T getData() {
return data;
}
public void setSuccess(boolean success) {
this.success = success;
}
public void setData(T data) {
this.data = data;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
@Override
public String toString() {
return "SeckillResult{" +
"success=" + success +
", data=" + data +
", error='" + error + '\'' +
'}';
}
}
|
af71eecc-3dc6-47dd-bb93-b53865e211b8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-27 01:56:51", "repo_name": "isaacborges92/ExemploRetrofit", "sub_path": "/app/src/main/java/com/example/isaac/exemploretrofit/models/MeuOpenHelper.java", "file_name": "MeuOpenHelper.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "e6bf105ed0cd30561e6327f6e1fc3219e6c9a496", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/isaacborges92/ExemploRetrofit
| 220
|
FILENAME: MeuOpenHelper.java
| 0.229535
|
package com.example.isaac.exemploretrofit.models;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
/**
* Created by Isaac on 22/08/2017.
*/
public class MeuOpenHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1;
private static final String DATABASE_NAME = "banco";
public MeuOpenHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
sqLiteDatabase.execSQL("create table filmes(id INTEGER PRIMARY KEY, " +
"title TEXT, original_title TEXT, poster_path TEXT, release_date TEXT, " +
"overview TEXT, runtime INTEGER, cod_filme INTEGER, visto INTEGER);");
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) {
//upgrade de banco de dados
//sqLiteDatabase.execSQL("alter table add()");
}
}
|
7d84af75-6f91-403a-90d3-239f30c87955
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-12 14:05:44", "repo_name": "RockMother/mobileOffice", "sub_path": "/mobileOffice/src/main/java/mobileoffice/controllers/RegistrationController.java", "file_name": "RegistrationController.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "c832e1bd318eca5b515a10c49a1cb056447559d6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/RockMother/mobileOffice
| 183
|
FILENAME: RegistrationController.java
| 0.255344
|
package mobileoffice.controllers;
import base.controllers.BaseController;
import mobileoffice.business.contracts.RegistrationService;
import mobileoffice.models.RegistrationModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* Created by kiril_000 on 02.04.2017.
*/
@Controller
public class RegistrationController extends BaseController {
@Autowired
private RegistrationService registrationService;
@RequestMapping(value = "/registration", method = RequestMethod.GET)
public String get(){
return "registration";
}
@RequestMapping(value = "/register", method = RequestMethod.POST)
public String register(@ModelAttribute RegistrationModel registrationModel) throws Exception {
registrationService.registerNewUser(registrationModel);
return "redirect:index";
}
}
|
d61a0466-a3ac-41cc-bd9c-44e93c4b1794
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-02 06:56:34", "repo_name": "ukiras123/JavaDeckOfCard", "sub_path": "/src/com/kiran/deckoOfCard/game/Player.java", "file_name": "Player.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 75, "lang": "en", "doc_type": "code", "blob_id": "035de4d5280f7cd7ee2217211ee85b7074cbe971", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ukiras123/JavaDeckOfCard
| 302
|
FILENAME: Player.java
| 0.274351
|
package com.kiran.deckoOfCard.game;
import java.util.ArrayList;
import com.kiran.deckoOfCard.Cards;
/**
* Player Entity. Create this object for players.
*
* @author Kiran
* @version 1.0 May 1, 2017
*/
public class Player implements Entity {
private int money = 1000;
private String name;
ArrayList<Cards> cards;
int cardValue;
public Player(String name) {
this.name = name;
cards = new ArrayList<>();
}
public void addCard(Cards c) {
cards.add(c);
}
public int getMoney() {
return money;
}
public void addMoney(int money) {
this.money += money;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ArrayList<Cards> getCards() {
return cards;
}
@Override
public void clearCard() {
cards.clear();
}
@Override
public void removeMoney(int money) {
this.money -= money;
}
@Override
public void setCardValue(int cardValue) {
this.cardValue = cardValue;
}
@Override
public int getCardValue() {
return cardValue;
}
@Override
public String toString() {
return "Name: " + name + ". Money: $" + money;
}
}
|
50580849-e70d-40e5-8973-74d4a7d3e612
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-11-09T10:22:51", "repo_name": "cocohub/menuScraper", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1129, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "ae96f9d3bf9931792d34456ed253f716b4c6ccb5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cocohub/menuScraper
| 328
|
FILENAME: README.md
| 0.290176
|
How to use:
1. Clone repo.
2. Run "setup.bat". It will download YAML and urllib3 using pip. It will also create mat.bat.
3. Add mat.bat to PATH or put it in your System32 folder so that you can execute the scraper by typing mat in your command line.
Right now it will scrape Nya Etage (http://www.nyaetage.se/veckans-meny) by default.
I have added support for it to scrape Nya Etage and Restaurang Södra Porten.
By writing "mat porten" it will scrape the Södra Porten menu.
Whatever key:value pair you put in the top of urls.yaml, that one will be scraped by default.
To add support for more websites, add an alias and url in urls.yaml.
Then write your custom parser in htmlParser.py and remember to add the parser to the chooseParser() function.
EXAMPLE OUTPUT:
<p>> mat<br>
----------<br>
DAGENS MAT<br>
----------<br>
* Helstekt fläskfilé Provencale med råstekt potatis, rödvinssås och ört- & vitlöksmör<br>
* Husets fisk- och skaldjurssoppa på torsk, lax, räkor, grönsaker, rostat vitlöksbröd samt aioli<br>
* Spaghetti Bolognese med grana padano<br>
* Veg/Vegan: Vego Bolognese med grana padano<br>
</p>
|
02925d32-a83a-42d8-8b49-83a49dafc465
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-19 00:23:06", "repo_name": "fabiano-cortez-souza/testeDeConceitoJC", "sub_path": "/teste-conceito-agenda-tecnico/src/main/java/br/com/fcs/agendatecnico/vo/Param.java", "file_name": "Param.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "fb5b335276f418afe9a4d409367fedf01e024f6c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fabiano-cortez-souza/testeDeConceitoJC
| 293
|
FILENAME: Param.java
| 0.264358
|
package br.com.fcs.agendatecnico.vo;
import java.util.Objects;
import javax.validation.Valid;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Param {
@JsonProperty("value")
private ParamValue value = null;
public Param value(ParamValue value) {
this.value = value;
return this;
}
@Valid
public ParamValue getValue() {
return value;
}
public void setValue(ParamValue value) {
this.value = value;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Param param = (Param) o;
return Objects.equals(this.value, param.value);
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Param {\n");
sb.append(" value: ").append(toIndentedString(value)).append("\n");
sb.append("}");
return sb.toString();
}
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
092d88d4-ea10-4965-b8b2-6801d70a0ceb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-01 12:37:36", "repo_name": "juliusborja/TutorialSession", "sub_path": "/app/src/main/java/com/example/julius/tutorialsession/Student.java", "file_name": "Student.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "854d06444296590c0e241074771342a0053f50d1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/juliusborja/TutorialSession
| 240
|
FILENAME: Student.java
| 0.236516
|
package com.example.julius.tutorialsession;
import java.util.jar.Attributes;
/**
* Created by Dell on 6/1/2018.
*/
public class Student {
private String studName;
private String studCourse;
private int studGrade;
public Student(String studName, String studCourse, int studGrade){
this.studName = studName;
this.studCourse = studCourse;
this.studGrade = studGrade;
}
public Student(){
studName = "";
studCourse = "";
studGrade = 0;
}
public String getStudName() {
return studName;
}
public void setStudName(String studName) {
this.studName = studName;
}
public String getStudCourse() {
return studCourse;
}
public void setStudCourse(String studCourse) {
this.studCourse = studCourse;
}
public int getStudGrade() {
return studGrade;
}
public void setStudGrade(int studGrade) {
this.studGrade = studGrade;
}
}
|
4e04c7bc-eb1a-4f39-bfbe-d55671d4889b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-21 13:42:30", "repo_name": "yuzhongbutong/voice-control", "sub_path": "/src/com/ibm/watson/voice/VoiceControl.java", "file_name": "VoiceControl.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "2763c32c1a0189f3c65208d5ed91d12a76a364de", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yuzhongbutong/voice-control
| 198
|
FILENAME: VoiceControl.java
| 0.240775
|
package com.ibm.watson.voice;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.gson.JsonObject;
/**
* Servlet implementation class Talk
*/
@WebServlet("/Car")
public class VoiceControl extends HttpServlet {
private static final long serialVersionUID = 1L;
private static final HttpApplicationDeviceEventPublish publish = new HttpApplicationDeviceEventPublish();
/**
* @see HttpServlet#HttpServlet()
*/
public VoiceControl() {
super();
}
/**
* @throws IOException
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
String command = request.getParameter("command");
JsonObject data = new JsonObject();
data.addProperty("id", "100");
data.addProperty("data", command);
publish.publishEvent(data);
}
}
|
4541ea23-ae90-4774-b705-57efbc4df765
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-04 11:26:35", "repo_name": "lindar-open/intercom-java", "sub_path": "/intercom-java/src/main/java/io/intercom/api/AdminCollection.java", "file_name": "AdminCollection.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "76d8d865b719575adf2da8e30160303667d3f3da", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lindar-open/intercom-java
| 212
|
FILENAME: AdminCollection.java
| 0.247987
|
package io.intercom.api;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class AdminCollection extends TypedDataCollection<Admin> implements Iterator<Admin> {
protected TypedDataCollectionIterator<Admin> iterator;
public AdminCollection() {
type = "company.list";
iterator = new TypedDataCollectionIterator<Admin>(this);
}
@Override
public AdminCollection nextPage() {
return fetchNextPage(AdminCollection.class);
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("admins")
@Override
public List<Admin> getPage() {
return super.getPage();
}
public boolean hasNext() {
return iterator.hasNext();
}
public Admin next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
}
|
33ddfc82-fd19-4aed-b0e6-f22ce27d7a75
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-26 14:03:41", "repo_name": "Einstein12345/survivalgames", "sub_path": "/survivalgames/src/edu/moravian/schirripad/sg/Arena.java", "file_name": "Arena.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "666d5a8ea15faff4da7324590f8fb5ea9335ded1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Einstein12345/survivalgames
| 348
|
FILENAME: Arena.java
| 0.271252
|
package edu.moravian.schirripad.sg;
import java.util.HashSet;
import edu.moravian.edu.sg.mapping.Coordinate3D;
public class Arena {
private String name;
private int x1, y1, z1, x2, y2, z2;
HashSet<String> flags = new HashSet<String>();
public Arena(String name, Coordinate3D[] d, ArenaType type) {
this.name = name;
x1 = d[0].getX();
y1 = d[0].getY();
z1 = d[0].getZ();
x2 = d[0].getX();
y2 = d[0].getY();
z2 = d[0].getZ();
}
public Arena(String name, Coordinate3D[] d, ArenaType type, String... flags) {
this.name = name;
x1 = d[0].getX();
y1 = d[0].getY();
z1 = d[0].getZ();
x2 = d[0].getX();
y2 = d[0].getY();
z2 = d[0].getZ();
for (String s : flags)
this.flags.add(s);
}
public void addFlags(String... flags) {
for (String s : flags)
this.flags.add(s);
}
public void removeFlags(String... flags) {
for (String s : flags) {
if (this.flags.contains(s))
this.flags.remove(s);
}
}
public static enum ArenaType {
TYPE_MOB, TYPE_CTF, TYPE_SG, TYPE_SPLEEF;
}
}
|
99fdb78e-f83e-461d-b7d0-b7e14f8adb5c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-26 14:02:45", "repo_name": "jorisvanlaar/employee-of-the-month", "sub_path": "/app/src/main/java/com/jorisvanlaar/employeeofthemonth/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "4246c71e96171cd536ebaa8a79cc92070229af5e", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jorisvanlaar/employee-of-the-month
| 210
|
FILENAME: MainActivity.java
| 0.2227
|
package com.jorisvanlaar.employeeofthemonth;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ViewPager viewPager = findViewById(R.id.viewpager);
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(adapter);
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int i, float v, int i1) {
}
@Override
public void onPageSelected(int i) {
if (i == 1) {
viewPager.getAdapter().notifyDataSetChanged();
}
}
@Override
public void onPageScrollStateChanged(int i) {
}
});
TabLayout tabLayout = findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
}
}
|
276bbf25-9e5d-49ea-b248-22e402c0228a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-20 01:51:34", "repo_name": "JemyHe/plugin", "sub_path": "/src/main/java/com/xingxue/plugin/sms/TestSms.java", "file_name": "TestSms.java", "file_ext": "java", "file_size_in_byte": 1211, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "2bbe518692241db2a5d2060b5acfbd5c1de28b9a", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/JemyHe/plugin
| 375
|
FILENAME: TestSms.java
| 0.267408
|
package com.xingxue.plugin.sms;
/*
* 1.登录注册阿里云
* 2.全部导航---产品---云通信---短信服务
* 3.开通服务
* 4.设置短信签名,短信模板(2小时的审核)
* 5.充值
* 6.获取accesskeys和密码
* 7.加入maven依赖
mvn install:install-file -Dfile=C:\aliyun-java-sdk-core-3.2.3.jar -DgroupId=com.aliyun -DartifactId=aliyun-java-sdk-core -Dversion=3.2.3 -Dpackaging=jar
mvn install:install-file -Dfile=C:\aliyun-java-sdk-dysmsapi-1.0.0-SANPSHOT.jar -DgroupId=com.aliyun -DartifactId=aliyun-java-sdk-dysmsapi -Dversion=1.0.0 -Dpackaging=jar
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>1.0.0</version>
</dependency>
* */
public class TestSms {
public static void main(String[] args){
//发送的手机号
String phone = "15209181772";
//验证码
String code = "6823";
try{
SmsUtil.send(phone,code);
}catch (Exception e){
e.printStackTrace();
}
}
}
|
e300ffd5-22ca-4653-95e0-b9a5d750209b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-17 09:50:06", "repo_name": "emirmaydemir/ShopApp", "sub_path": "/app/src/main/java/com/example/smartshopping/ViewHolder/ProductViewHolder.java", "file_name": "ProductViewHolder.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "e7a08d3d3e50215e42c7940f30780eb9e0db7d9d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/emirmaydemir/ShopApp
| 189
|
FILENAME: ProductViewHolder.java
| 0.255344
|
package com.example.smartshopping.ViewHolder;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.smartshopping.Interfacee.ItemClickListener;
import com.example.smartshopping.R;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class ProductViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
public TextView ProductDescription,ProductName,ProductPrice;
public ImageView ProductImage;
public ItemClickListener listener;
public ProductViewHolder(@NonNull View itemView) {
super(itemView);
ProductImage=itemView.findViewById(R.id.product_imagee);
ProductName=itemView.findViewById(R.id.product_namee);
ProductDescription=itemView.findViewById(R.id.product_desc);
ProductPrice=itemView.findViewById(R.id.product_pricee);
}
public void setItemClickListener(ItemClickListener listener){
this.listener=listener;
}
@Override
public void onClick(View v) {
listener.onClick(v,getAdapterPosition(),false);
}
}
|
ccb823c4-eedd-43f0-8a72-49ba7f16c175
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-04 07:20:27", "repo_name": "ChinaDragonNB/blog-open", "sub_path": "/blog-website/src/main/java/com/ak47007/model/ArticleTag.java", "file_name": "ArticleTag.java", "file_ext": "java", "file_size_in_byte": 1237, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "3f9381554cf701bfcdab0fa51dd23658ccdba42c", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ChinaDragonNB/blog-open
| 286
|
FILENAME: ArticleTag.java
| 0.245085
|
package com.ak47007.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author AK47007
* @date 2020/5/18
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "article_tag")
public class ArticleTag implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 文章id
*/
@TableField(value = "article_id")
private Long articleId;
/**
* 标签id
*/
@TableField(value = "tag_id")
private Long tagId;
/**
* 标签名称
*/
@TableField(exist = false)
private String tagName;
/**
* 标签链接
*/
@TableField(exist = false)
private String tagLink;
private static final long serialVersionUID = 1L;
public static final String COL_ID = "id";
public static final String COL_ARTICLE_ID = "article_id";
public static final String COL_TAG_ID = "tag_id";
}
|
12615b87-c59d-41a2-a372-62a058521470
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-12 21:42:38", "repo_name": "bogdanovmn/tutorialspoint-full-pdf", "sub_path": "/tutorialspoint-full-pdf-lib/src/main/java/com/github/bogdanovmn/tpfp/lib/domain/Article.java", "file_name": "Article.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "64ace40354a4c4d3a37a5053d8d6df75c200b2ce", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bogdanovmn/tutorialspoint-full-pdf
| 224
|
FILENAME: Article.java
| 0.286169
|
package com.github.bogdanovmn.tpfp.lib.domain;
import com.github.bogdanovmn.tpfp.lib.common.LinkedHashMapArrayList;
import org.apache.pdfbox.io.MemoryUsageSetting;
import org.apache.pdfbox.multipdf.PDFMergerUtility;
import java.io.File;
import java.io.IOException;
import java.util.List;
/**
*
*/
public class Article {
private final LinkedHashMapArrayList<String, Page> pages;
public Article(LinkedHashMapArrayList<String, Page> pages) {
this.pages = pages;
}
public void toPdf(String output)
throws IOException
{
PDFMergerUtility pdfMergerUtility = new PDFMergerUtility();
for (String sectionTitle : this.pages.keys()) {
List<Page> pages = this.pages.get(sectionTitle);
for (Page page : pages) {
File pdfFile = page.toPdf();
pdfMergerUtility.addSource(pdfFile);
}
}
pdfMergerUtility.setDestinationFileName(output);
pdfMergerUtility.mergeDocuments(MemoryUsageSetting.setupTempFileOnly());
}
}
|
5a69263b-25e4-4dbe-abc4-58e757098de4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-07-27T20:44:12", "repo_name": "forana/das-migrator", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1016, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "3962960fcf4acb34e2dede149af807602d5ef0b4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/forana/das-migrator
| 242
|
FILENAME: README.md
| 0.172172
|
# das-migrator
*das* (dumb and simple) *migrator* is a stupidly simple bash script that does postgres migrations via psql.
## What does it do?
Given:
1. A connection string
2. A directory of migration files to run in order
It:
1. Runs them in order
That's it. That's all it does.
It does _not_:
* selectively run only new migrations
* ...but postgres has pretty good `IF NOT EXISTS` support across the board.
* automatically roll back if errors occur partway through
* ...see above.
* allow "down" migrations
* ...but you can configure it to run against a different directory of migration scripts.
If you need more functionality, you probably need a better tool.
## Why? Who needs this?
This is a quick-and-dirty solution. It's _probably_ a better idea than using an entirely separate language's tool for your application, just because your language doesn't have a good migration tool yet. _Probably_.
## Installation
Clone this, copy it wherever you want to use it. Rename it, alias it, whatever.
|
52e12283-bc43-4914-9f88-9dcb7a9648b6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-14 10:06:22", "repo_name": "ahsan265/ctpapp", "sub_path": "/app/src/main/java/com/example/citytrafficpolice/WardenAdapter.java", "file_name": "WardenAdapter.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "94994ca1efec28a1bc99d87c412e86dc5b2e12fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ahsan265/ctpapp
| 208
|
FILENAME: WardenAdapter.java
| 0.26588
|
package com.example.citytrafficpolice;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class WardenAdapter extends RecyclerView.Adapter<WardenAdapter.WardenViewHolder> {
private String[] data;
public WardenAdapter (String [] data)
{
this.data = data;
}
@NonNull
@Override
public WardenViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
{
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
View view = inflater.inflate(R.layout.activity_warden_data, parent, false);
return new WardenViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull WardenViewHolder holder, int position)
{
}
@Override
public int getItemCount() {
return data.length;
}
public class WardenViewHolder extends RecyclerView.ViewHolder
{
public WardenViewHolder(@NonNull View itemView) {
super(itemView);
}
}
}
|
f1b97005-1952-4596-94dd-f08ea6bc7761
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-05-20 09:35:45", "repo_name": "waitinghu/XueBa", "sub_path": "/src/com/yctc/XuebaConnect/XuebaConnectActivity.java", "file_name": "XuebaConnectActivity.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "8b7b794fb318a6fa2cf986445984d852522f5e5b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/waitinghu/XueBa
| 231
|
FILENAME: XuebaConnectActivity.java
| 0.246533
|
package com.yctc.xuebaconnect;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import com.yctc.util.MusicPlayHelper;
public class XuebaConnectActivity extends Activity implements OnClickListener {
public Button btn_start, btn_quit;
private MusicPlayHelper helper;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btn_start = (Button) findViewById(R.id.btn_start);
btn_quit = (Button) findViewById(R.id.btn_quit);
btn_quit.setOnClickListener(this);
btn_start.setOnClickListener(this);
helper = MusicPlayHelper.getInstance(this);
helper.playBackGroundMusic();
}
public void onClick(View v) {
int id = v.getId();
if (id == btn_start.getId()) {
Intent intent = new Intent();
intent.setClass(XuebaConnectActivity.this, Select.class);
startActivity(intent);
} else if (id == btn_quit.getId()) {
XuebaConnectActivity.this.finish();
}
}
}
|
a646801c-8209-4b55-b43a-a1f1aa486ad7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-07 16:39:01", "repo_name": "otech47/funder-android", "sub_path": "/app/src/main/java/com/setmusic/funder/ApiPostRequest.java", "file_name": "ApiPostRequest.java", "file_ext": "java", "file_size_in_byte": 1213, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "e6bc5ab20275943f25058ae736669963daac6cbe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/otech47/funder-android
| 247
|
FILENAME: ApiPostRequest.java
| 0.281406
|
package com.setmusic.funder;
import android.content.Context;
import com.squareup.okhttp.Call;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import java.util.concurrent.TimeUnit;
/**
* Created by oscarlafarga on 2/6/16.
*/
public class ApiPostRequest extends ApiRequest {
public static final MediaType JSON
= MediaType.parse("application/json; charset=utf-8");
private Context context;
public ApiPostRequest(Context context) {
client.setConnectTimeout(10, TimeUnit.SECONDS);
client.setWriteTimeout(10, TimeUnit.SECONDS);
client.setReadTimeout(30, TimeUnit.SECONDS);
this.context = context;
}
public void run(String route, String json, Callback callback) {
RequestBody body = RequestBody.create(JSON, json);
Request request = new Request.Builder()
.url(route)
.post(body)
.addHeader("Authorization", "bearer " + Constants.VIMEO_KEY)
.build();
Call call = client.newCall(request);
call.enqueue(callback);
this.call = call;
}
}
|
4567bb90-cc96-4913-9d2a-a865b46a8f51
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-16 11:19:38", "repo_name": "invoke-source/text", "sub_path": "/text-mybatis/src/main/java/com/bjpowernode/InvactionHandler/MyInvocationHandler.java", "file_name": "MyInvocationHandler.java", "file_ext": "java", "file_size_in_byte": 1253, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "79acfbfa27b3c2534ba70cf8ea4d8c54c511725b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/invoke-source/text
| 248
|
FILENAME: MyInvocationHandler.java
| 0.262842
|
package com.bjpowernode.InvactionHandler;
import com.bjpowernode.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;
import javax.net.ssl.SSLSession;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
/**
* @author Administrator
* @2021/6/13 @16:49
*/
public class MyInvocationHandler implements InvocationHandler {
private Object target;
public MyInvocationHandler() {
}
public MyInvocationHandler(Object target) {
this.target = target;
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) {
Object result = null;
SqlSession sqlSession = null;
System.out.println("------调用目标方法前------");
try {
sqlSession = SqlSessionUtil.getSqlSession();
result = method.invoke(target,args);
sqlSession.commit();
} catch (IllegalAccessException | InvocationTargetException e) {
sqlSession.rollback();
sqlSession.close();
e.printStackTrace();
}
System.out.println("------调用目标方法后------");
return result;
}
}
|
1a4c3157-1871-409b-9af7-65496335c880
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-03-18 20:15:47", "repo_name": "tarynsauer/javaserver", "sub_path": "/tests/tddserver/LogsPageTest.java", "file_name": "LogsPageTest.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "58df1fe476b85d5c054f8d7fed22c83d67a4f394", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tarynsauer/javaserver
| 225
|
FILENAME: LogsPageTest.java
| 0.285372
|
package tddserver;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
/**
* Created by Taryn on 3/13/14.
*/
public class LogsPageTest extends TestHelpers {
private LogsPage page;
@Before
public void setUp() throws Exception {
page = new LogsPage("/logs");
setUpParserForResponseTesting();
}
@Test
public void testGetAuthenticatedShouldReturnFalse() throws Exception {
assertFalse(page.getAuthenticated());
}
@Test
public void testGetContentDisplaysAuthenticationMessageWhenNotAuthenticated() throws Exception {
assertEquals(page.getContent(requestParser), "<h1>Authentication required</h1>GET /log HTTP/1.1 PUT /these HTTP/1.1 HEAD /requests HTTP/1.1");
}
@Test
public void testGetContentDisplaysLogsHeaderWhenAuthenticated() throws Exception {
page.setAuthenticated(true);
assertEquals(page.getContent(requestParser), "<h1>Logs</h1>");
}
}
|
e2e6a257-de48-43f0-a3f2-ba7b30f59c68
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-12-19 01:08:11", "repo_name": "bountin/oop", "sub_path": "/Aufgabe5/TestString.java", "file_name": "TestString.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "4b14cb5e2d2cf9e6d486b5a3c44e011ffc090a75", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bountin/oop
| 230
|
FILENAME: TestString.java
| 0.261331
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Johannes Wawerda <johannes.wawerda@student.tuwien.ac.at>
*/
public class TestString implements Shorter<TestString> {
private String s;
public TestString(String s) {
this.s = s;
}
@Override
public boolean shorter(TestString element) {
if (this.s.length() < element.toString().length()) {
return true;
} else {
return false;
}
}
@Override
public String toString() {
return s;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TestString other = (TestString) obj;
if ((this.s == null) ? (other.s != null) : !this.s.equals(other.s)) {
return false;
}
return true;
}
}
|
9cc544a6-7f43-4f7e-b926-79322ac9cfd4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-28 11:03:45", "repo_name": "kaganyasar/spring-cloud-contract-eg", "sub_path": "/spring-cloud-contract-data/src/main/java/data/WebSocketResponseSimpleMessage.java", "file_name": "WebSocketResponseSimpleMessage.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "c27b5386ce387e0584245813b6cfc6416f5ddc30", "star_events_count": 2, "fork_events_count": 5, "src_encoding": "UTF-8"}
|
https://github.com/kaganyasar/spring-cloud-contract-eg
| 224
|
FILENAME: WebSocketResponseSimpleMessage.java
| 0.229535
|
package data;
public class WebSocketResponseSimpleMessage {
private String message;
private Person messagedToPerson;
private Person messagedByPerson;
public WebSocketResponseSimpleMessage() {
}
public WebSocketResponseSimpleMessage(String message, Person messagedToPerson, Person messagedByPerson) {
this.message = message;
this.messagedToPerson = messagedToPerson;
this.messagedByPerson = messagedByPerson;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Person getMessagedToPerson() {
return messagedToPerson;
}
public void setMessagedToPerson(Person messagedToPerson) {
this.messagedToPerson = messagedToPerson;
}
public Person getMessagedByPerson() {
return messagedByPerson;
}
public void setMessagedByPerson(Person messagedByPerson) {
this.messagedByPerson = messagedByPerson;
}
}
|
b9f70c97-776d-4221-bf25-93ece3495299
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-05 23:15:52", "repo_name": "stevehav/iowa-caucus-app", "sub_path": "/sources/org/slf4j/MarkerFactory.java", "file_name": "MarkerFactory.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "79f8ee18c504a5c76d4a3bde90b8de518abcf8b3", "star_events_count": 21, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/stevehav/iowa-caucus-app
| 251
|
FILENAME: MarkerFactory.java
| 0.281406
|
package org.slf4j;
import org.slf4j.helpers.BasicMarkerFactory;
import org.slf4j.helpers.Util;
import org.slf4j.impl.StaticMarkerBinder;
public class MarkerFactory {
static IMarkerFactory MARKER_FACTORY;
private MarkerFactory() {
}
private static IMarkerFactory bwCompatibleGetMarkerFactoryFromBinder() throws NoClassDefFoundError {
try {
return StaticMarkerBinder.getSingleton().getMarkerFactory();
} catch (NoSuchMethodError unused) {
return StaticMarkerBinder.SINGLETON.getMarkerFactory();
}
}
static {
try {
MARKER_FACTORY = bwCompatibleGetMarkerFactoryFromBinder();
} catch (NoClassDefFoundError unused) {
MARKER_FACTORY = new BasicMarkerFactory();
} catch (Exception e) {
Util.report("Unexpected failure while binding MarkerFactory", e);
}
}
public static Marker getMarker(String str) {
return MARKER_FACTORY.getMarker(str);
}
public static Marker getDetachedMarker(String str) {
return MARKER_FACTORY.getDetachedMarker(str);
}
public static IMarkerFactory getIMarkerFactory() {
return MARKER_FACTORY;
}
}
|
70627b25-ebc7-4af3-af8e-6cfe661565c4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-07-30T11:36:28", "repo_name": "Elaine1908/Travellers-Paradise-ver-2", "sub_path": "/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 2368, "line_count": 95, "lang": "zh", "doc_type": "text", "blob_id": "7b3929bf05c29c3c0e02ad9b70db32e865ac2f89", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Elaine1908/Travellers-Paradise-ver-2
| 566
|
FILENAME: readme.md
| 0.29584
|
PJ 说明文档
==========
[TOC]
### 个人信息
*****
姓名:朱亦文<br>
学号:19302010075
[我的GitHub地址](https://github.com/Elaine1908/)
### 项目完成情况
****
#### 0.MVC 架构
本项目使用 MVC 架构完成后端访问数据库的各项操作,较好地实现了前后端代码分离。
为了更好地实现前后端交互,引入jquery,通过ajax前后端发送与接收消息。
#### 1.页面制作
**·Home**
1.首页轮播图展示收藏次数最多的 5 张图片,轮播图下方六张图按照更新时间依次排序。
2.导航栏:html头部ajax引入 /navServlet,在其中通过`request.getSession()`判断登陆情况后正确展示/隐藏下拉菜单.
>大部分页面的导航栏均由这种方法实现
**·Search**
1.实现 4 种不同筛选方式
2.实现分页
**·Friends**
1.在好友页面可以通过搜索本网站注册过的用户名来添加对方,点击搜索按钮后页面上显示用户名与其邮箱;若查无此人,则返回通知信息
2.搜索栏下方有一个消息栏,显示其他人发出的加好友请求,若用户点击按钮同意通过,则页面同步增加一行相应好友信息
3.点击好友名跳转至其收藏界面
**·Details**
1.正确显示图片收藏数、名称、描述等基本信息;若描述/名称为空,则为unknown
2.用户在未登录的情况下点击收藏按钮,则会有登陆提示
**·My photos & My favorites**
1.可正确删除/修改图片;若无图片展示,则有相应提示
2.删除图片前会有相应确认提示
3.我的收藏界面上有一个开关设置自己的收藏对好友可见与否
4.鼠标划至页面左侧出现边栏,其中为用户在网站的图片浏览足迹
**·Upload & Modify**
1.用户未填充表单时发出提示并转回原界面,提交成功后,跳转至myPhotos
2.点击 modify 跳转至表单,其上保留了图片的原有值
**·Log in & Sign up**
按照项目需求定义用户名与密码强弱度要求
#### 2.Bonus
**·验证码**
在注册/登陆页面加入验证码功能,若用户输入与图片字符不符则拒绝登陆注册,由servlet实现(大小写相关)
**·局部放大**
在图片详情页面,用户将鼠标停留于图片上时,会在右侧出现局部放大的图片,通过js与css结合实现。
|
2baf8048-b9b6-4e25-a08f-378c7a76779d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-23 09:10:09", "repo_name": "cttlhy/spring-boot", "sub_path": "/boot1.5.2/src/main/java/com/cc/sys/core/controller/SysIndexController.java", "file_name": "SysIndexController.java", "file_ext": "java", "file_size_in_byte": 1141, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "e38c590e8d3a0983cc5110f40dd9ef1db2692776", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cttlhy/spring-boot
| 204
|
FILENAME: SysIndexController.java
| 0.2227
|
package com.cc.sys.core.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
/**
* 跳转系统首页
* @author chenchao
*/
@Controller
@RequestMapping(path="cc/sys/core/controller/sysIndexController")
public class SysIndexController {
@RequestMapping(path="index",method=RequestMethod.GET)
public ModelAndView gotoIndexPage(HttpServletRequest request, HttpServletResponse reponse){
ModelAndView mav = new ModelAndView();
mav.setViewName("cc/sys/core/index");
request.setAttribute("url", "cc/sys/core/controller/sysIndexController/operation/");
return mav;
}
@RequestMapping(path="operation/hello",method=RequestMethod.GET)
@ResponseBody
public String sayHello(HttpServletRequest request, HttpServletResponse reponse){
System.out.println("Hello");
return "Hello";
}
}
|
5466bbe9-19b2-4b69-9fc2-c9c7fd9d21b2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-12-01 09:11:06", "repo_name": "w9ahmed/WasalnyTask", "sub_path": "/src/com/asyn/wasalnytaskfsq/utilities/DataCache.java", "file_name": "DataCache.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "7f49e1189db7ae9a6ab38c1c17aca236e25585a7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/w9ahmed/WasalnyTask
| 234
|
FILENAME: DataCache.java
| 0.29584
|
package com.asyn.wasalnytaskfsq.utilities;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
public class DataCache {
private SharedPreferences preferences;
public DataCache(Context context, String name) {
this.preferences = context.getSharedPreferences(name, Context.MODE_PRIVATE);
}
public void cache(String key, String value) {
Editor editor = preferences.edit();
editor.putString(key, value);
editor.apply();
}
public String getCachedString(String key) {
return preferences.getString(key, null);
}
public void cache(String key, double value) {
Editor editor = preferences.edit();
editor.putFloat(key, (float) value);
editor.apply();
}
public double getCachedDouble(String key) {
return preferences.getFloat(key, 0);
}
public boolean isItCached(String key, String value) {
if(preferences.getString(key, value) != null)
return true;
else
return false;
}
public void clear() {
Editor editor = preferences.edit();
editor.clear();
editor.apply();
}
}
|
4da5f4b8-cf71-49a6-baae-eae70bb25752
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-22 06:29:24", "repo_name": "shihugh/spring-work", "sub_path": "/src/main/java/com/netease/course/web/controller/LoginController.java", "file_name": "LoginController.java", "file_ext": "java", "file_size_in_byte": 1254, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "ba516c731fccfdb85b06587cacffc91a2dcdcc66", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/shihugh/spring-work
| 245
|
FILENAME: LoginController.java
| 0.274351
|
package com.netease.course.web.controller;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.netease.course.dao.PersonMapper;
import com.netease.course.service.impl.User;
import com.netease.course.service.impl.Work;
@Controller
public class LoginController {
@Autowired
private PersonMapper personMapper;
@RequestMapping("/api/login")
public void alogin(@RequestParam("userName") String userName,
@RequestParam("password") String password,
ModelMap map,HttpSession session) throws Exception {
if (userName!=null && (Work.login(userName, password, personMapper))) {
User user = new User(userName, personMapper.select(userName).getUserType());
session.setAttribute("user", user);
map.addAttribute("code",200);
map.addAttribute("message","登陆成功");
map.addAttribute("result",true);
} else {
map.addAttribute("code",401);
map.addAttribute("message","用户不存在或密码错误");
map.addAttribute("result",false);
}
}
}
|
d2567508-4f29-4f1b-9c72-52ad38cd512b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-25 19:41:06", "repo_name": "2359451d/lightweight-blog-backend", "sub_path": "/blog-api/src/main/java/top/bento/blog/config/ThreadPoolConfig.java", "file_name": "ThreadPoolConfig.java", "file_ext": "java", "file_size_in_byte": 1145, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "3c528979dd08621259aa5e2b78973bd6ee72d0f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/2359451d/lightweight-blog-backend
| 213
|
FILENAME: ThreadPoolConfig.java
| 0.258326
|
package top.bento.blog.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
@Configuration
@EnableAsync // Enable multi-threads
public class ThreadPoolConfig {
@Bean("taskExecutor")
public Executor asyncServiceExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// set core threads number in the pool
executor.setCorePoolSize(5);
// set max pool size
executor.setMaxPoolSize(20);
// set queue size
executor.setQueueCapacity(Integer.MAX_VALUE);
// set thread keeping alive time
executor.setKeepAliveSeconds(60);
// set default thread name
executor.setThreadNamePrefix("码神之路博客项目");
// once all the tasks to be done shut down the pool
executor.setWaitForTasksToCompleteOnShutdown(true);
executor.initialize();
return executor;
}
}
|
702be118-1d25-4e93-ac71-58c643237503
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-20 09:38:54", "repo_name": "APLK/rxjava2_Demo", "sub_path": "/src/main/java/com/szinternet/crm/adapter/BasePagerAdapter.java", "file_name": "BasePagerAdapter.java", "file_ext": "java", "file_size_in_byte": 1282, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "a41c066207c244847145ed924896037741db42ea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/APLK/rxjava2_Demo
| 263
|
FILENAME: BasePagerAdapter.java
| 0.276691
|
package com.szinternet.crm.adapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.szinternet.crm.base.BaseFragment;
import com.szinternet.crm.utils.CommonUtil;
import java.util.ArrayList;
import java.util.List;
/**
* * 免责声明:本项目不可用于违法用途,否则后果自负,技术无罪
*/
public class BasePagerAdapter extends FragmentPagerAdapter {
private List<BaseFragment> mFragmentList = new ArrayList<>();
private List<String> mTitles;
public BasePagerAdapter(FragmentManager fm, List<BaseFragment> fragmentList) {
super(fm);
this.mFragmentList = fragmentList;
}
public BasePagerAdapter(FragmentManager fm, List<BaseFragment> fragmentList, List<String> titles) {
super(fm);
this.mFragmentList = fragmentList;
this.mTitles = titles;
}
@Override
public CharSequence getPageTitle(int position) {
return !CommonUtil.isNullOrEmpty(mTitles) ? mTitles.get(position) : "";
}
@Override
public Fragment getItem(int position) {
return mFragmentList.get(position);
}
@Override
public int getCount() {
return mFragmentList.size();
}
}
|
2787f015-c605-47e6-9014-df3fd0079c19
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-28 14:21:55", "repo_name": "lipeng0817/hadoopWork", "sub_path": "/homework/1026/huangxiaonan/Countquchong.java", "file_name": "Countquchong.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "e3129d772d1b79a813d111de8b3a1e03fd578edf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lipeng0817/hadoopWork
| 306
|
FILENAME: Countquchong.java
| 0.291787
|
package hadoop;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Count {
public static void main(String[] args) {
//List<Count> list = new ArrayList<Count>();
Scanner sc = new Scanner(System.in);
Set<String> st= new HashSet<String>();
String line = sc.nextLine();
String[] tokens = line.split("\t");
while(sc.hasNext()){
String lines = sc.nextLine();
String[] tokenss = lines.split("\t");
if(tokenss[0].equals(tokens[0])){
st.add(tokens[1]);
tokens = tokenss;
}else{
System.out.println(tokens[0]+"\t"+(st.size()+1));
st.clear();
tokens = tokenss;
}
}
System.out.println(tokens[0]+"\t"+(st.size()+1));
/*int firt = 0;
if(firt==0){
t = tokens[0];
firt=1;
}
if(tokens[0].equals(t)){
count++;
}else{
System.out.println(tokens[0]+"\t"+count);
}
if(sc.hasNext()==false){
t = tokens[0];
count=1;
System.out.println(tokens[0]+"\t"+count);
}
t = tokens[0];
count=1;*/
}
}
|
a14b08f3-8954-4460-918a-08438c782c91
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-27 15:01:15", "repo_name": "KrisD123/TVacProject", "sub_path": "/TVacProject/src/test/java/RepresentativesTests.java", "file_name": "RepresentativesTests.java", "file_ext": "java", "file_size_in_byte": 1039, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "d0f5ed08f2d270a564091649e4bb47997bb75aab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/KrisD123/TVacProject
| 215
|
FILENAME: RepresentativesTests.java
| 0.288569
|
import listeners.RunListener;
import org.apache.log4j.Logger;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import pages.RepresentativesPage;
import java.util.Set;
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
/**
* Created by kdodonov on 13.10.2017.
*/
@Listeners(value = RunListener.class)
public class RepresentativesTests extends BaseTest {
private static final Logger LOGGER = Logger.getLogger(RepresentativesTests.class);
@BeforeClass
public void performLogin() {
login(userName, userPassword);
}
@Test
public void openRepresentativesSectionInNewWindowTest() {
LOGGER.info("Test to open 'My representatives' page in a new window");
tVacMainPage.openRepresentativesSectionInNewWindow();
Assert.assertTrue(representativesPage.checkRepresentativesPageIsOpen());
LOGGER.info("'My representatives' page was open in a new window");
}
}
|
d7635d03-58e9-4ca1-9110-03d76b2c8839
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-06 07:50:13", "repo_name": "cdc123/graduation", "sub_path": "/src/main/java/com/graduation/controller/VideoSearchedController.java", "file_name": "VideoSearchedController.java", "file_ext": "java", "file_size_in_byte": 1246, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "0ee4bdde4b0d9692d7ad2d1dd84e4454c7fd25c5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cdc123/graduation
| 234
|
FILENAME: VideoSearchedController.java
| 0.262842
|
package com.graduation.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/videoSearched")
public class VideoSearchedController {
/* 返回查找关键字 */
@PostMapping(value = "/getKeyword")
public String getKeyword(HttpServletRequest request, HttpServletResponse response) {
String keyword = "";
try {
keyword = (String) request.getSession().getAttribute("searchKeyword");
} catch (Exception e) {
e.printStackTrace();
}
return keyword;
}
/* 返回关键字查询结果 */
@PostMapping(value = "/getDataForVideoSearched")
public List<Map<String, Object>> getDataForVideoSearched(HttpServletRequest request, HttpServletResponse response) {
List<Map<String, Object>> list = null;
try {
list = (List<Map<String, Object>>) request.getSession().getAttribute("searchVideoList");
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
}
|
12b8e33f-0d5e-4bd5-9b54-e9ddb4cc1bc4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-16 13:53:51", "repo_name": "IhsanGokalp/Back-End-Development", "sub_path": "/Exam/src/main/java/com/Midterm/Exam/Service/CustomerService.java", "file_name": "CustomerService.java", "file_ext": "java", "file_size_in_byte": 1074, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "d3953433b1f2a188859ab546c992c5b79abf3c10", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/IhsanGokalp/Back-End-Development
| 194
|
FILENAME: CustomerService.java
| 0.281406
|
package com.Midterm.Exam.Service;
import com.Midterm.Exam.Dao.CustomerCreateDao;
import com.Midterm.Exam.Dao.CustomerReturnDao;
import com.Midterm.Exam.Entity.Customer;
import com.Midterm.Exam.Repository.CustomerRepository;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class CustomerService {
private final CustomerRepository customerRepository;
private final CustomerMapper customerMapper;
public CustomerService(CustomerRepository customerRepository, CustomerMapper customerMapper) {
this.customerRepository = customerRepository;
this.customerMapper = customerMapper;
}
public List<CustomerReturnDao> findAll() {
return customerRepository.findAll()
.stream()
.map(customerMapper::toCustomerReturnDto)
.collect(Collectors.toList());
}
public Customer save(CustomerCreateDao customerCreateDto) {
return customerRepository.save(customerMapper.toCustomer(customerCreateDto));
}
}
|
ff947ce2-ae56-420d-8d27-2041e14b41ce
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-12-13 06:57:46", "repo_name": "TTvcloud/vcloud-sdk-java", "sub_path": "/src/test/java/com/bytedanceapi/example/imagex/GetUploadTokenDemo.java", "file_name": "GetUploadTokenDemo.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "2b76992a76e19e88098444a00752b80ae92d7064", "star_events_count": 8, "fork_events_count": 11, "src_encoding": "UTF-8"}
|
https://github.com/TTvcloud/vcloud-sdk-java
| 245
|
FILENAME: GetUploadTokenDemo.java
| 0.258326
|
package com.bytedanceapi.example.imagex;
import com.bytedanceapi.service.imagex.IImageXService;
import com.bytedanceapi.service.imagex.impl.ImageXServiceImpl;
import java.util.HashMap;
import java.util.Map;
public class GetUploadTokenDemo {
public static void main(String[] args) {
// default region cn-north-1, for other region, call ImageXServiceImpl.getInstance(region)
IImageXService service = ImageXServiceImpl.getInstance();
// call below method if you dont set ak and sk in ~/.vcloud/config
service.setAccessKey("ak");
service.setSecretKey("sk");
Map<String, String> params = new HashMap<>();
params.put("ServiceId", "imagex service id");
// set expires time of the upload token, defalut is 15min(900s),
// set only if you know the params' meaning exactly.
params.put("X-Amz-Expires", "60");
try {
String token = service.getUploadToken(params);
System.out.println(token);
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
8feecb8a-91b0-45a8-9769-56a60b8d8f69
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-09-06T09:02:43", "repo_name": "dick7005/js-application", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1132, "line_count": 41, "lang": "en", "doc_type": "text", "blob_id": "e1fbe03a00d1fc3acd7b72b73ba190dd104311bb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dick7005/js-application
| 280
|
FILENAME: README.md
| 0.262842
|
# *akana names
an application ..to help give names to children ..according to when there were born ..including the date of birth..day of birth ..and the .month of birth
# *author
DICKSON NJUGUNA
student at moringa campus
## Description
{This is a detailed description of your application, including its purpose and usage. Give as much detail as needed to explain what the application does, and any other information you want users or other developers to have. }
## Setup/Installation Requirements
* This is an odinary website
* straight forward in using
* no requirments or any scripting that need to be run
## Known Bugs
*no bugs left un debugged
*the code is bug free..
## Technologies Used
progrming languages:
*html {to wright text}
*css {to style the website}
*javascript {a scripting language to give functionality}
## Support and contact details
* in case of any emergencies or issues please feel free to contact:
* email:pythonscript254@gmail.com
* tell: 0757116399
*LAUNCH DATE:
SEPTEMBER/5TH/2021
### License
Copyright (c) {2021}
*contributors:MIT license
|
d54922c5-ff59-4d0e-81eb-f37ceeff0c9a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-03-18T15:50:37", "repo_name": "enterstudio/gtbjj.github.io", "sub_path": "/_drafts/linux/aur-updates.md", "file_name": "aur-updates.md", "file_ext": "md", "file_size_in_byte": 1213, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "d316e98a972515957b6f2ce1e5e46a70dc9d241f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/enterstudio/gtbjj.github.io
| 296
|
FILENAME: aur-updates.md
| 0.201813
|
---
layout: post
title:
excerpt:
category:
- Linux
tags:
comments: true
---
There are many AUR helper programs that will allow for pacmna-like use of the Arch User Responsitory, but I always feel sense of accomplishment
when I'm able to figure out / do something myself.
I've often flip flopped on AUR / Git versions of packages because I like the simple "sync and upgrade all" (```-Syu```) option for pacman. I
learned to compile and install my AUR packages manually which has helped me make a few [contributions of my own to the AUR](). I've made
scripts in the past to check my currently installed AUR packages against the AUR's RSS feed of recent updates, but only seems beneficial if my
machine is online 100% of the time (e.g. a desktop rather than a laptop).
It dawned on me to lump together a shell script that will:
* pull down a snapshot of my currently installed AUR packages
* extract the tarball(s)
* fetch the source materials
* compile the package(s)
* install the package(s)
* clean up after
Adding a shell alias, such as ```aur-upd```, give a short command that you can run every month, every week, or every day if you'd like to make
sure you're staying on top of those Git pushes!
|
95cf3ee1-2be1-424b-b713-2b4dd3d4a334
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-14 17:44:03", "repo_name": "saneh/AND_A_PopularMoviesStage2", "sub_path": "/app/src/main/java/in/lemonco/popularmovies/MovieAdapter.java", "file_name": "MovieAdapter.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "6b1258f12122ac28170a7859623cdd91eca8a404", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/saneh/AND_A_PopularMoviesStage2
| 204
|
FILENAME: MovieAdapter.java
| 0.290176
|
package in.lemonco.popularmovies;
import android.content.Context;
import android.database.Cursor;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import in.lemonco.popularmovies.data.MovieContract;
/**
* Movie CursorAdapter
*/
public class MovieAdapter extends CursorAdapter {
public MovieAdapter(Context context,Cursor c, int flags){
super(context,c,flags);
}
@Override
public View newView(Context context,Cursor cursor,ViewGroup parent){
View view = LayoutInflater.from(context).inflate(R.layout.grid_item_layout,parent,false);
return view;
}
@Override
public void bindView(View view,Context context,Cursor cursor){
ImageView poster = (ImageView)view;
Picasso.with(context).load(Utility.getPosterPath(cursor.getString(cursor.getColumnIndex(MovieContract.MovieEntry.COLUMN_POSTER_PATH)))).into(poster);
}
}
|
fbae6735-0ca1-4f9a-910a-6df9119101e3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-07T11:42:34", "repo_name": "alanszlosek/relaxing-with-code", "sub_path": "/rust/05-edge-cases/script.md", "file_name": "script.md", "file_ext": "md", "file_size_in_byte": 1226, "line_count": 18, "lang": "en", "doc_type": "text", "blob_id": "8fe2b525cdc0631e18d2734b59a17e034abc7ec5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/alanszlosek/relaxing-with-code
| 272
|
FILENAME: script.md
| 0.267408
|
Good morning, and Happy New Year!
If you're new to this series of videos, I am writing a sharding StatsD proxy in Rust as a way to learn the language. And today we're going to handle some edge cases to avoid crashes
I think I remarked in 2 previous videos about the collect() function. This one here, where we collect our Regex split() results int a Vec. So I finally looked it up, and it does what you'd expect: it turns an iterable into a collection. See here: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.collect If you want to get technical, the split() function returns a Split struct, which implements the Iterator trait, which is why we can use the collect() function.
Talk about MTU, and finding it on linux. Haven't found programmatic way to query it from Rust yet.
Talk thorugh string length
Show lines function in docs
Show len() function
Looks like line.len() -- which returns bytes -- should be sufficient. Other option is to use chars().count(), which interprets bytes as unicode characters. Doesn't seem necessary since the present of any bytes indicates we have something to parse.
Check that parts length is at least 2. Not a robust check, but hopefully good enough
Seems good for now
|
64c75786-e134-4b25-8420-bd0e3a4148b3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-22 22:19:22", "repo_name": "Nihalkhamis/GoodTeam", "sub_path": "/app/src/main/java/com/example/nihal/goodteam/doneLoginActivity.java", "file_name": "doneLoginActivity.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "1b52c8e73be307f871c1956d65acafc6e847a405", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Nihalkhamis/GoodTeam
| 221
|
FILENAME: doneLoginActivity.java
| 0.253861
|
package com.example.nihal.goodteam;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
public class doneLoginActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
List<Info> infos = new ArrayList<>();
String names[] = {"Nihal" , "Nadine" , "Toka" , "Aly" , "Amr"};
int ids[] = {10 , 20 , 30 , 40};
for (int i=0; i<ids.length; i++){
Info info = new Info(names[i],ids[i]);
infos.add(info);
}
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
InfoAdapter infoAdapter = new InfoAdapter(infos);
recyclerView.setAdapter(infoAdapter);
}
}
|
f7650a5d-a735-421f-a3e6-9d32c5127529
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-25 14:51:20", "repo_name": "rofle100lvl/prog_lab8", "sub_path": "/prog_lab8_client/src/main/java/utils/Response.java", "file_name": "Response.java", "file_ext": "java", "file_size_in_byte": 1005, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7e838afb7a8223047abd6c12c13264c74b78f441", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rofle100lvl/prog_lab8
| 224
|
FILENAME: Response.java
| 0.291787
|
package utils;
import model.Flat;
import java.io.Serializable;
import java.util.ArrayList;
public class Response implements Serializable {
private static final long serialVersionUID = -7879056808897113742L;
private int code;
private String requestText;
private ArrayList<Flat> flats = null;
public Response(int code, String requestText) {
this.code = code;
this.requestText = requestText;
}
public ArrayList<Flat> getFlats() {
return flats;
}
public String getRequestText() {
return requestText;
}
public int getCode() {
return code;
}
public Response(int code, ArrayList<Flat> flats, String requestText) {
this.code = code;
this.flats = flats;
this.requestText = requestText;
}
public void printResponse(){
System.out.println("Статус ответа: " + String.valueOf(code));
System.out.println("Ответ сервера: " + requestText);
}
}
|
a611d2ec-4df2-4900-be13-b7ce36b5594e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-01-14 13:34:03", "repo_name": "Legyver/fenxlib", "sub_path": "/fenxlib.core/src/main/java/com/legyver/fenxlib/core/lifecycle/hooks/InitComponentRegistryLifecycleHook.java", "file_name": "InitComponentRegistryLifecycleHook.java", "file_ext": "java", "file_size_in_byte": 1213, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "e6f81f5a0b38a53505fbc08bf94a734f7d3f32fd", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Legyver/fenxlib
| 248
|
FILENAME: InitComponentRegistryLifecycleHook.java
| 0.27048
|
package com.legyver.fenxlib.core.lifecycle.hooks;
import com.legyver.fenxlib.api.context.ApplicationContext;
import com.legyver.fenxlib.api.lifecycle.LifecyclePhase;
import com.legyver.fenxlib.api.lifecycle.hooks.ApplicationLifecycleHook;
import com.legyver.fenxlib.api.lifecycle.hooks.ExecutableHook;
import com.legyver.fenxlib.core.locator.query.DefaultComponentRegistry;
import com.legyver.fenxlib.api.locator.query.QueryableComponentRegistry;
/**
* Lifecycle hook to initialize the component registry during the POST_INIT phase
*/
public class InitComponentRegistryLifecycleHook implements ApplicationLifecycleHook {
@Override
public LifecyclePhase getLifecyclePhase() {
return LifecyclePhase.POST_INIT;
}
@Override
public ExecutableHook getExecutableHook() {
return () -> {
QueryableComponentRegistry componentRegistry = ApplicationContext.getComponentRegistry();
if (componentRegistry == null) {
ApplicationContext.setComponentRegistry(new DefaultComponentRegistry());
}
};
}
@Override
public String getName() {
return InitComponentRegistryLifecycleHook.class.getSimpleName();
}
}
|
fb25eb1f-4743-4c12-b7df-12686d91966d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-04 10:40:39", "repo_name": "jungeunlee95/jblog2", "sub_path": "/src/test/java/com/cafe24/jblog/controller/BlogControllerTest.java", "file_name": "BlogControllerTest.java", "file_ext": "java", "file_size_in_byte": 1281, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "923f2e57f0fde2d2ba916fda014f672025d53525", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jungeunlee95/jblog2
| 293
|
FILENAME: BlogControllerTest.java
| 0.281406
|
package com.cafe24.jblog.controller;
import static org.junit.Assert.assertNotNull;
import java.util.List;
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 com.cafe24.jblog.service.BlogService;
import com.cafe24.jblog.vo.BlogVo;
import com.cafe24.jblog.vo.CategoryVo;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:/applicationContext.xml")
public class BlogControllerTest {
@Autowired
private BlogService blogService;
// 블로그 정보 가져오기
// @Test
public void getBlogInfo() {
String userId = "aaa";
assertNotNull(blogService.getBlogInfo(userId));
}
// 카테고리 가져오기
// @Test
public void getCategory() {
String userId = "aaa";
List<CategoryVo> list = blogService.getCategory(userId);
assertNotNull(list);
}
// 블로그 정보 수정 test
// @Test
public void modifyBlogInfo() {
BlogVo vo = new BlogVo();
vo.setBlogId("aaa");
vo.setTitle("333");
vo.setLogo("111");
blogService.modifyBlogInfo(vo);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.