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
4e0a34bd-86f2-4528-87ff-79b501ed395a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-16 09:54:42", "repo_name": "Gaoxiang-Zhang/Lucene_v1.0", "sub_path": "/src/model/DBPedia.java", "file_name": "DBPedia.java", "file_ext": "java", "file_size_in_byte": 1179, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "c8853ca86060c2daf7c891719e86441871dd6365", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Gaoxiang-Zhang/Lucene_v1.0
262
FILENAME: DBPedia.java
0.291787
package model; /** * DBPedia: the model of DBPedia File * @author Gaoxiang Zhang * */ public class DBPedia { private String itemName; private String resourceAddress; private String itemContent; private double confidence; public DBPedia(){ itemName = ""; resourceAddress = ""; itemContent = ""; confidence = 0.0; } public DBPedia(String name, String address, String content, double d) { this.itemName = name; this.resourceAddress = address; this.itemContent = content; this.confidence = d; } public String getItemName() { return itemName; } public String getResourceAddress() { return resourceAddress; } public String getItemContent() { return itemContent; } public double getConfidence() { return confidence; } public void setItemName(String itemName) { this.itemName = itemName; } public void setResourceAddress(String resourceAddress) { this.resourceAddress = resourceAddress; } public void setItemContent(String itemContent) { this.itemContent = itemContent; } public void setConfidence(double confidence) { this.confidence = confidence; } }
de74b445-32e4-4dbf-a0cc-95dd089d48e3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-23 08:25:33", "repo_name": "kellensd/investimento", "sub_path": "/src/test/java/simulacoes/SimulacoesGetTest.java", "file_name": "SimulacoesGetTest.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "cf18f9352e6d0b254383b38335a2be01b671b54c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kellensd/investimento
226
FILENAME: SimulacoesGetTest.java
0.293404
package simulacoes; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import test.BaseTest; import java.util.ArrayList; import java.util.List; import static io.restassured.RestAssured.*; import static org.hamcrest.CoreMatchers.*; public class SimulacoesGetTest extends BaseTest { @Test public void getSimulacoes(){ List<String> mesesList = new ArrayList<>(); mesesList.add("112"); mesesList.add("124"); mesesList.add("136"); mesesList.add("148"); List<String> valoresList = new ArrayList<>(); valoresList.add("2.802"); valoresList.add("3.174"); valoresList.add("3.564"); valoresList.add("3.971"); when(). get("/simulador"). then(). statusCode(200). body("id", notNullValue()). body("meses", is(mesesList)). body("valor", is(valoresList)); } }
d3921d2e-7714-4581-9c72-6b0af79ec91a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-12 09:35:46", "repo_name": "jamerlan/jSpringLobbyLib", "sub_path": "/src/main/java/com/jamerlan/commands/impl/in/Clients.java", "file_name": "Clients.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "fd68b575a5f3c45e0ed28f708c46ccf6ca48fb65", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/jamerlan/jSpringLobbyLib
210
FILENAME: Clients.java
0.250913
package com.jamerlan.commands.impl.in; import com.jamerlan.ServerState; import com.jamerlan.commands.Command; import com.jamerlan.utils.CommandParser; import com.jamerlan.model.Channel; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; /** CLIENTS chanName {clients} */ public class Clients implements Command<String> { private ServerState serverState; public Clients(ServerState serverState) { this.serverState = serverState; } @Override public void execute(String line) throws IOException { CommandParser parser = new CommandParser(line); String commandName = parser.getString(" "); String chanName = parser.getString(" "); ArrayList<String> clientsList = new ArrayList<>(); serverState.getChannels().stream().filter(channel -> channel.getChanName().equals(chanName)).findAny().ifPresent(channel -> { while(parser.hasNext(" ")){ String client = parser.getString(" "); channel.getClients().add(client); } }); } }
291daa47-4741-4989-b387-73a9e09d1a30
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-27 12:38:36", "repo_name": "eduardscaueru/Energy-Management-System", "sub_path": "/src/writer/Contract.java", "file_name": "Contract.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "29759177030c9b445e49d800e1b3acfdd6c43235", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/eduardscaueru/Energy-Management-System
192
FILENAME: Contract.java
0.282988
package writer; public class Contract { private int consumerId; private int price; private int remainedContractMonths; public Contract(final int consumerId, final int price, final int remainedContractMonths) { this.consumerId = consumerId; this.price = price; this.remainedContractMonths = remainedContractMonths; } public final int getConsumerId() { return consumerId; } public final void setConsumerId(final int consumerId) { this.consumerId = consumerId; } public final int getPrice() { return price; } public final void setPrice(final int price) { this.price = price; } public final int getRemainedContractMonths() { return remainedContractMonths; } public final void setRemainedContractMonths(final int remainedContractMonths) { this.remainedContractMonths = remainedContractMonths; } }
6d8f5237-0227-4df1-a924-46b87e17003d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-03 22:10:11", "repo_name": "achowdhury3762/Adopt-an-Animal", "sub_path": "/app/src/main/java/nyc/c4q/ashiquechowdhury/adoptme/animalpicturerecycler/AnimalPictureAdapter.java", "file_name": "AnimalPictureAdapter.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "22542a65ba0edba2fce5dcaf0c49dcb0a76eea77", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/achowdhury3762/Adopt-an-Animal
242
FILENAME: AnimalPictureAdapter.java
0.290176
package nyc.c4q.ashiquechowdhury.adoptme.animalpicturerecycler; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.List; import nyc.c4q.ashiquechowdhury.adoptme.R; /** * Created by ashiquechowdhury on 12/2/16. */ public class AnimalPictureAdapter extends RecyclerView.Adapter<AnimalPictureViewHolder> { List<PetImages> petImages; public AnimalPictureAdapter(List<PetImages> petImages) { this.petImages = petImages; } @Override public AnimalPictureViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); View childView = inflater.inflate(R.layout.animalpicture_row, parent, false); return new AnimalPictureViewHolder(childView); } @Override public void onBindViewHolder(AnimalPictureViewHolder holder, int position) { holder.bind(petImages.get(position)); } @Override public int getItemCount() { return petImages.size(); } }
c3e01f70-8827-4d49-94a5-75dea58736f3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-23 14:25:43", "repo_name": "fmendezh/padrones", "sub_path": "/src/main/java/fmendez/padron/transforms/LineToElector.java", "file_name": "LineToElector.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "f25645924e616b2449e1580817584839e5138961", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fmendezh/padrones
247
FILENAME: LineToElector.java
0.274351
package fmendez.padron.transforms; import java.text.SimpleDateFormat; import fmendez.padron.dict.DistritosElectoralesDictionary; import fmendez.padron.model.Elector; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import org.apache.beam.sdk.transforms.SerializableFunction; @Data @RequiredArgsConstructor public class LineToElector implements SerializableFunction<String, Elector> { private final DistritosElectoralesDictionary distritosElectoralesDictionary; //Date parsing private static final String DATE_FMT = "YYYYMMdd"; private final SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FMT); @Override @SneakyThrows public Elector apply(String line) { String[] fields = line.split(","); return Elector.builder() .cedula(fields[0]) .distritoElectoral(distritosElectoralesDictionary.get(fields[1])) .fechaCaducidad(dateFormat.parse(fields[3])) .juntaReceptora(fields[4]) .nombre(fields[5].trim()) .primerApellido(fields[6].trim()) .segundoApellido(fields[7].trim()) .build(); } }
408e1b8d-1a96-4e7c-85bf-b285cdcd475b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-30 12:19:14", "repo_name": "hcoles/pitest", "sub_path": "/pitest-entry/src/test/java/org/pitest/mutationtest/build/intercept/exclude/FirstLineInterceptorFactoryTest.java", "file_name": "FirstLineInterceptorFactoryTest.java", "file_ext": "java", "file_size_in_byte": 978, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "07359ffa5672c2791e4eda57705ab2bda0ada3c3", "star_events_count": 1499, "fork_events_count": 388, "src_encoding": "UTF-8"}
https://github.com/hcoles/pitest
213
FILENAME: FirstLineInterceptorFactoryTest.java
0.267408
package org.pitest.mutationtest.build.intercept.exclude; import org.junit.Test; import org.pitest.mutationtest.build.InterceptorType; import org.pitest.mutationtest.build.intercept.groovy.GroovyFilterFactory; import org.pitest.verifier.interceptors.FactoryVerifier; public class FirstLineInterceptorFactoryTest { GroovyFilterFactory underTest = new GroovyFilterFactory(); @Test public void isOnChain() { FactoryVerifier.confirmFactory(underTest) .isOnChain(); } @Test public void isOnByDefault() { FactoryVerifier.confirmFactory(underTest) .isOnByDefault(); } @Test public void featureIsCalledFGroovy() { FactoryVerifier.confirmFactory(underTest) .featureName().isEqualTo("fgroovy"); } @Test public void createsFilters() { FactoryVerifier.confirmFactory(underTest) .createsInterceptorsOfType(InterceptorType.FILTER); } }
cdea120c-a949-4a9f-b12e-61c43c169f93
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-08 10:01:06", "repo_name": "zhangnengxian/GYPROJECT", "sub_path": "/GYproject-common/src/main/java/cc/dfsoft/uexpress/common/util/StringUtil.java", "file_name": "StringUtil.java", "file_ext": "java", "file_size_in_byte": 1062, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "a1be7add24508934623b74740b9f611e5af5fe82", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zhangnengxian/GYPROJECT
292
FILENAME: StringUtil.java
0.290176
package cc.dfsoft.uexpress.common.util; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.commons.lang3.StringUtils; /** * 字符串处理工具类 * @author van.zheng * */ public class StringUtil extends StringUtils{ /** * 去除以逗号分隔的字符串的重复项 * @param str * @return */ public static List<String> RemoveRepeatItem(String str) { if (!isNotBlank(str)) { return null; } List<String> list = new ArrayList<String>(); String[] array = str.split(","); for (String s : array) { if (Collections.frequency(list, s) < 1) { list.add(s); } } return list; } /** * 数字不足位数左补0 * @param str * @param strLength */ public static String addZeroForNum(String str, int strLength) { int strLen = str.length(); if (strLen < strLength) { while (strLen < strLength) { StringBuffer sb = new StringBuffer(); sb.append("0").append(str); // 左补0 str = sb.toString(); strLen = str.length(); } } return str; } }
c92e2174-8e90-4b9e-a367-b7894d6801a7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-24 08:44:43", "repo_name": "ZionSS/Object-oriented-programming-Lab", "sub_path": "/Lab06/src/lab06/Course.java", "file_name": "Course.java", "file_ext": "java", "file_size_in_byte": 1103, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "e28d67a9fc7ac3a3d717c9eaa6124bc0a2aea639", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ZionSS/Object-oriented-programming-Lab
241
FILENAME: Course.java
0.29584
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package lab06; /** * * @author Ailas */ import java.util.List; import java.util.ArrayList; public class Course { private List<String> studentName=new ArrayList<String>(); private String courseName; private int studentAmount=studentName.size(); Course(String courseName){ this.courseName=courseName; } void setStudent(String name) { studentName.add(name); } void getStudent() { for(int i=0;i<studentName.size();i++) System.out.println("Student Name:"+studentName.get(i)); } int getAmountOfStudent() { return studentName.size(); } void clear() { studentName.clear(); } void dropStudent(String name) { for(int i =0;i<=studentAmount;i++) { if(studentName.get(i).equals(name)) { studentName.remove(i); } } } }
53fa12a8-c085-48e0-a0b0-0da425dec32c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-03 20:32:39", "repo_name": "1204al/JavaEEKPIlabs", "sub_path": "/src/datasource/ConnectionSource.java", "file_name": "ConnectionSource.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "8951e454e0f469c8d1290012eafe86f919bac96b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/1204al/JavaEEKPIlabs
189
FILENAME: ConnectionSource.java
0.252384
package datasource; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; import java.sql.Connection; import java.sql.SQLException; /** * Created by aliubivyi on 17.04.17. */ public class ConnectionSource { private InitialContext initContext; private DataSource ds; private static ConnectionSource instance = new ConnectionSource(); private ConnectionSource() { try { initContext = new InitialContext(); ds = (DataSource) initContext.lookup("java:comp/env/jdbc/dictionary"); } catch (NamingException e) { } } public static synchronized ConnectionSource getInstance() { return instance; } public Connection getConnection() { Connection connection = null; try { connection = ds.getConnection(); } catch (SQLException e) { } return connection; } }
e1339165-9370-4eba-83ee-9101d0f23965
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-01-25T09:15:27", "repo_name": "Innarticles/oauth-one", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 977, "line_count": 40, "lang": "en", "doc_type": "text", "blob_id": "b5d26a251355ba728706bf67259e6212d8f318b8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Innarticles/oauth-one
239
FILENAME: README.md
0.253861
# OAuth-One Easly make Oath1 requests to other services ## Installation Add this line to your application's Gemfile: gem 'oauth-one', require: "oauth_one/helper" And then execute: $ bundle Or install it yourself as: $ gem install oauth-one ## Usage domain_url = 'https://www.example.com/some/service/' # Setup data method = :post user_data = {lis_person_contact_email_primary: email, lis_person_contact_name_given: first_name,lis_person_contact_name_family: last_name, user_id: id.to_s} oauth_config = { consumer_key: oauth_consumer_key, consumer_secret: secret_key } # Usage oauth = OauthOne::Helper.new(method, domain_url, user_data, oauth_config) response = oauth.make_request ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
9f0670df-1870-4bba-b4c5-f2b8ec800647
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-05-18 18:03:49", "repo_name": "Ehres/SafeDriving", "sub_path": "/SafeDriving-ejb/src/java/com/safedriving/model/Examen.java", "file_name": "Examen.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "4ff2797f6fcadba6bbccaa1bc6dcc1bc141dca17", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Ehres/SafeDriving
237
FILENAME: Examen.java
0.250913
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.safedriving.model; import com.safedriving.enumeration.TypeExam; import java.io.Serializable; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; /** * * @author Ehres */ @Entity @DiscriminatorValue(value="Examen") public class Examen extends SessionFormation implements Serializable { private static final long serialVersionUID = 1L; private TypeExam typeExamen; private boolean reussi; public boolean isReussi() { return reussi; } public void setReussi(boolean reussi) { this.reussi = reussi; } public TypeExam getTypeExamen() { return typeExamen; } public void setTypeExamen(TypeExam typeExamen) { this.typeExamen = typeExamen; } @Override public String toString() { return "com.safedriving.model.Examen[ id=" + getId() + " ]"; } }
120e936a-4501-4271-b35d-0759a58974c9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-10 10:38:25", "repo_name": "koushen001/study", "sub_path": "/src/main/java/com/cike/juc/sync/VectorExample2.java", "file_name": "VectorExample2.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "378a7a55674d77e3bfe6ef57a7441da39e969982", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/koushen001/study
219
FILENAME: VectorExample2.java
0.239349
package com.cike.juc.sync; import lombok.extern.slf4j.Slf4j; import java.util.List; import java.util.Vector; /** * @Description 线程不安全 * @Author CIKE * @Version 1.0 **/ @Slf4j public class VectorExample2 { private static List<Integer> vector = new Vector<>(); public static void main(String[] args) throws Exception { while (true) { for (int i = 0; i < 10; i++) { vector.add(i); } Thread thread1 = new Thread() { public void run() { for (int i = 0; i < vector.size(); i++) { vector.remove(i); } } }; Thread thread2 = new Thread() { public void run() { for (int i = 0; i < vector.size(); i++) { vector.get(i); } } }; thread1.start(); thread2.start(); } } }
168700b4-2e07-4962-8616-cbdd3580b9b8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-25 12:31:15", "repo_name": "Khangbt/qlts", "sub_path": "/services/project-service/src/main/java/com/hust/qlts/project/entity/DeviceToRequestAddEntity.java", "file_name": "DeviceToRequestAddEntity.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "c14f8aabf02dec0a59504287693aff4b25d85e9b", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/Khangbt/qlts
218
FILENAME: DeviceToRequestAddEntity.java
0.277473
package com.hust.qlts.project.entity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import javax.persistence.*; @Data @Entity //@Table(name = "DEVICE_TO_REQUEST_ADD") @Table(name = "device_to_request_add") @AllArgsConstructor @NoArgsConstructor //@EqualsAndHashCode(callSuper=false) public class DeviceToRequestAddEntity extends Auditable{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "ID") private Long id; @Column(name = "DEVICE_GROUP_ID") private Long deviceGroup; @Column(name = "DEVICE_REQUEST_ADD_ID") private Long deviceRequestAddId; @Column(name = "SIZE") private Long size; @Column(name = "PRICE") private Long price; @Column(name = "SUPPLIER_ID") private Long supplierId; @Column(name = "WAREHOUSE_ID") private Long warehouseId; @Column(name = "STATUS") private Integer status; @Version private Long version; }
425a1073-3ffe-41c0-92e8-373685b9cf42
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-05 02:56:27", "repo_name": "chentianming11/demo", "sub_path": "/src/test/java/com/study/demo/concurrent2/volatileTest/VolatileTest.java", "file_name": "VolatileTest.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "b078557f4ff87ff00139ffcbd0b3df6351848db1", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/chentianming11/demo
231
FILENAME: VolatileTest.java
0.276691
package com.study.demo.concurrent2.volatileTest; /** * @author 陈添明 * @date 2018/9/9 */ public class VolatileTest { private static int INIT_VALUE = 0; private static int MAX_LIMIT = 5; public static void main(String[] args) throws InterruptedException { new Thread(() -> { int localValue = INIT_VALUE; while (localValue < MAX_LIMIT){ if (localValue != INIT_VALUE){ System.out.printf("数值更新到到[%d]\n", INIT_VALUE); localValue = INIT_VALUE; } } }, "reader").start(); Thread.sleep(100); new Thread(() -> { int localValue = INIT_VALUE; while (localValue < MAX_LIMIT){ INIT_VALUE = ++localValue; System.out.printf("更新数值到[%d]\n", INIT_VALUE); try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } } }, "updater").start(); } }
586946a4-dc5c-4f89-8baf-cd682470cfb0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-27 08:53:20", "repo_name": "liuzonglin1226/hrms1", "sub_path": "/hrms/src/main/java/com/test/biz/Impl/EmployeeServiceImpl.java", "file_name": "EmployeeServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "51256f12c65f94fa58c2a19cb0a758600e67ad3a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/liuzonglin1226/hrms1
215
FILENAME: EmployeeServiceImpl.java
0.272799
package com.test.biz.Impl; import com.test.biz.EmployeeService; import com.test.dao.EmployeeMapper; import com.test.model.Employee; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class EmployeeServiceImpl implements EmployeeService { @Autowired private EmployeeMapper employeeMapper; @Override public void saveEmployee(Employee employee) { employeeMapper.saveEmployee(employee); } @Override public void deleteEmployee(Employee employee) { employeeMapper.deleteEmployee(employee); } @Override public void updateEmployee(Employee employee) { employeeMapper.updateEmployee(employee); } @Override public List<Employee> selectByVocationId(Employee employee) { return employeeMapper.selectByVocationId(employee); } @Override public Employee selectByName(Employee employee) { return employeeMapper.selectByName(employee); } @Override public Employee selectByNameAndPass(Employee employee) { return employeeMapper.selectByNameAndPass(employee); } }
9429bbca-2aa4-42a4-8799-6da8381a64aa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-12 00:18:20", "repo_name": "nahuelPascual/Vault-test", "sub_path": "/src/main/java/com/vault/test/model/utils/Messages.java", "file_name": "Messages.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "f8017ce45fbd4974a4f51a38b23d5149a41cfef5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nahuelPascual/Vault-test
179
FILENAME: Messages.java
0.235108
package com.vault.test.model.utils; import javax.inject.Inject; import javax.inject.Named; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.MessageSource; import org.springframework.context.i18n.LocaleContextHolder; @Named public class Messages { private static final Logger LOGGER = LoggerFactory.getLogger(Messages.class); @Inject private MessageSource messageSource; public String get(String key) { try { return messageSource.getMessage(key, null, LocaleContextHolder.getLocale()); } catch (Exception e) { LOGGER.error(e.getMessage()); return key; } } public String get(String key, String... args) { try { return messageSource.getMessage(key, args, LocaleContextHolder.getLocale()); } catch (Exception e) { LOGGER.error(e.getMessage()); return key ; } } }
5d44a67b-7341-4a40-8a3c-6f13901c8b06
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-01 20:19:58", "repo_name": "butterflyforever/Dating-App", "sub_path": "/app/src/main/java/com/example/pro/test1/people.java", "file_name": "people.java", "file_ext": "java", "file_size_in_byte": 1004, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "763433d1e3d694208d09a704922858b574e239f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/butterflyforever/Dating-App
220
FILENAME: people.java
0.229535
package com.example.pro.test1; /** * Created by liyang on 2017/6/16. */ public class people { public int id ; public String name; public String password; public String account; public String signature; public String introduction; public int age; public String place; public int sex; public String friendname; public int xingge; public String telephone; public people(int id, String name,String password,String account,String signature,String introduction,int age, String place, int sex, String friendname, int xingge, String telephone) { this.id = id; this.name = name; this.password = password; this.account = account; this.signature = signature; this.introduction = introduction; this.age = age; this.place = place; this.sex = sex; this.friendname = friendname; this.xingge = xingge; this.telephone = telephone; } public people(){}; }
092fce6c-6cef-4015-88e7-623386eb7abd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-08 16:36:23", "repo_name": "Susshki/learn", "sub_path": "/Springboot/webProjFilterFields13/src/main/java/com/sushma/springboot/webProjFilterFields13/FilterController.java", "file_name": "FilterController.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "b42719e64590a0ece259055f3f4a600d7d37e809", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Susshki/learn
202
FILENAME: FilterController.java
0.274351
package com.sushma.springboot.webProjFilterFields13; import org.springframework.http.converter.json.MappingJacksonValue; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import com.fasterxml.jackson.databind.ser.FilterProvider; import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter; import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider; @RestController public class FilterController { @GetMapping("/someBean") public MappingJacksonValue getSomeBean() { SomeBean someBean = new SomeBean("value", "value2"," value3"); MappingJacksonValue mapping = new MappingJacksonValue(someBean); SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept("field1", "field2"); FilterProvider filters = new SimpleFilterProvider().addFilter("SomeBeanFilter", filter);// this SomeBeanFilter need to be on defined on the POJO mapping.setFilters(filters ); return mapping; } }
93160328-49a1-45bb-be93-b60ba0ed026e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-28 08:16:14", "repo_name": "cnso/LuaAndroid", "sub_path": "/app/src/main/java/com/jash/luaandroid/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "cace425b906b06494ccc6de9ce0d3cfcec7e285f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cnso/LuaAndroid
219
FILENAME: MainActivity.java
0.242206
package com.jash.luaandroid; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; import java.io.File; import java.lang.reflect.Method; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Example of a call to a native method TextView tv = (TextView) findViewById(R.id.sample_text); getId(); tv.setText(stringFromJNI()); // try { // Method method = this.getClass().getMethod("getFilesDir"); // tv.setText(method.toString()); // } catch (NoSuchMethodException e) { // e.printStackTrace(); // } } /** * A native method that is implemented by the 'native-lib' native library, * which is packaged with this application. */ public native String stringFromJNI(); public native int getId(); // Used to load the 'native-lib' library on application startup. static { System.loadLibrary("native-lib"); } }
a2e12c7c-8e9c-4e10-97cb-0a2d51b5dabe
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-23 18:55:18", "repo_name": "saralein/java-server", "sub_path": "/server/src/test/java/com/saralein/server/middleware/verifier/DirectoryVerifierTest.java", "file_name": "DirectoryVerifierTest.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "fc0aa6d89562c762bd8feb57efd0a910a9d11f78", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/saralein/java-server
226
FILENAME: DirectoryVerifierTest.java
0.284576
package com.saralein.server.middleware.verifier; import com.saralein.server.filesystem.Directory; import com.saralein.server.filesystem.FilePath; import com.saralein.server.request.Request; import org.junit.Before; import org.junit.Test; import java.nio.file.Path; import java.nio.file.Paths; import static org.junit.Assert.assertFalse; public class DirectoryVerifierTest { private DirectoryVerifier directoryVerifier; @Before public void setUp() { Path root = Paths.get(System.getProperty("user.dir"), "src/test/public"); directoryVerifier = new DirectoryVerifier(new Directory(), new FilePath(root)); } @Test public void verifiesDirectoryRequest() { Request request = new Request.Builder() .method("GET") .uri("/") .build(); assert (directoryVerifier.validForMiddleware(request)); } @Test public void invalidatesNonDirectoryRequest() { Request request = new Request.Builder() .method("GET") .uri("/recipe.txt") .build(); assertFalse(directoryVerifier.validForMiddleware(request)); } }
56ff3cf3-0136-4a4f-9fbd-0533646404bc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-24 09:52:33", "repo_name": "justanhnt/spring-boot", "sub_path": "/src/main/java/com/learning/springmvc/HelloController.java", "file_name": "HelloController.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "492d09ee264e267c1514bfb6fa69689845851e1e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/justanhnt/spring-boot
206
FILENAME: HelloController.java
0.295027
package com.learning.springmvc; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import java.util.ArrayList; import java.util.List; import java.util.Random; /** * Created by justanhnt on 7/24/21 */ @Controller public class HelloController { @GetMapping("/") public String searchView() { return "search"; } private static final Random RANDOM = new Random(); @PostMapping("/search") public ModelAndView searchFunctionView(@RequestParam("term") String term, ModelAndView mav) { List<String> ans = new ArrayList<>(); for (int i = 0; i < 10; i ++) { ans.add(term + " " + (RANDOM.nextInt(26) + 'a')); } mav.addObject("results", ans); mav.setViewName("result"); return mav; } }
738f7982-0064-474d-9630-a0e29f15c300
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-12-13 05:20:32", "repo_name": "RAOE/RunnerManager", "sub_path": "/com-xyf-service/src/main/java/com/xyf/service/AdminService.java", "file_name": "AdminService.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "3abbdda318ba060394fbbf6864269ad572156ac5", "star_events_count": 294, "fork_events_count": 34, "src_encoding": "UTF-8"}
https://github.com/RAOE/RunnerManager
250
FILENAME: AdminService.java
0.282988
package com.xyf.service; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.xyf.mapper.AdminMapper; import com.xyf.mapper.UserMapper; import com.xyf.pojo.Admin; import com.xyf.utils.CommonUtils; import redis.clients.jedis.Protocol.Command; @Service public class AdminService extends BaseService<Admin>{ @Autowired private AdminMapper adminMapper; /** * 检查账号密码的方法 * @param account * @param password * @return */ public Admin checkPassword(String name,String password) { //先判断值是否为空 if(CommonUtils.isEmpty(name)||CommonUtils.isEmail(password)) { return null; } //开始登陆 else { Admin admin=new Admin(); admin.setName(name); admin.setPassword(password); admin=selectOne(admin); if(admin!=null) { return admin; } return null; } } public List<Admin> select(Admin admin) { return adminMapper.select(admin); } }
151b6fca-c105-439a-85fe-03a2cec85966
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-27 08:52:01", "repo_name": "misternerd/resteasytox-maven-plugin", "sub_path": "/src/main/java/com/misternerd/resteasytox/swift/objects/SwiftConstructorMethod.java", "file_name": "SwiftConstructorMethod.java", "file_ext": "java", "file_size_in_byte": 1004, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "ce1deaf0a4cf4ab09d78974df27f32143c1fdd1b", "star_events_count": 3, "fork_events_count": 4, "src_encoding": "UTF-8"}
https://github.com/misternerd/resteasytox-maven-plugin
245
FILENAME: SwiftConstructorMethod.java
0.286169
package com.misternerd.resteasytox.swift.objects; import java.util.ArrayList; public class SwiftConstructorMethod extends SwiftMethod { public SwiftConstructorMethod(ArrayList<SwiftProperty> properties, ArrayList<SwiftProperty> superProperties, boolean hasSuperclass) { super(INIT_FUNCTION_NAME); if (superProperties != null) { for (SwiftProperty property : superProperties) { addParameter(property); } } if (properties != null) { for (SwiftProperty property : properties) { addParameter(property); addBody(property.lineForConstructor()); } } if (hasSuperclass) { StringBuilder sb = new StringBuilder(); sb.append("super.init("); for (SwiftProperty property : superProperties) { property.buildParameter(sb); //  Add a comma for each element but the last. if (superProperties.indexOf(property) < superProperties.size() - 1) { sb.append(", "); } } sb.append(")"); addBody(sb.toString()); } } }
9c81937b-1801-4427-8b77-fc0aaff21be5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-12 07:45:38", "repo_name": "Drastaro/Accounting-data-ESB", "sub_path": "/SilverWiresAdmin/src/com/silverwiresapp/admin/quickbooks/data/DataServiceFactory.java", "file_name": "DataServiceFactory.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "20c7e4855cf4d85594789a062100ba662e7b5d6e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Drastaro/Accounting-data-ESB
234
FILENAME: DataServiceFactory.java
0.279828
package com.silverwiresapp.admin.quickbooks.data; import com.intuit.ipp.core.Context; import com.intuit.ipp.core.ServiceType; import com.intuit.ipp.exception.FMSException; import com.intuit.ipp.security.IAuthorizer; import com.intuit.ipp.security.OAuthAuthorizer; import com.intuit.ipp.services.DataService; import com.silverwiresapp.admin.quickbooks.pojo.QuickBooksTokens; import com.silverwiresapp.admin.utils.propertiesutils.QuickBooksPropertiesUtils; public class DataServiceFactory { public DataService getDataService(QuickBooksTokens tokens) { IAuthorizer authorizer = new OAuthAuthorizer(QuickBooksPropertiesUtils.OAUTH_CONSUMER_KEY, QuickBooksPropertiesUtils.OAUTH_CONSUMER_SECRET, tokens.getAccessToken(), tokens.getAccessTokenSecret()); Context context; try { context = new Context(authorizer, ServiceType.QBO, tokens.getQboCompanyId()); } catch (FMSException e) { throw new RuntimeException("Could not initialize Intuit context object", e); } return new DataService(context); } }
0f4477ce-82f9-4380-9caa-51ee4f429746
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-27 03:21:35", "repo_name": "armyant0920/IOProject", "sub_path": "/src/main/java/DBLab/TranscationLab.java", "file_name": "TranscationLab.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "45c798a8d65d17d4c9238b53a71447af74e71e65", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/armyant0920/IOProject
214
FILENAME: TranscationLab.java
0.288569
package DBLab; import java.sql.*; public class TranscationLab { public static void main(String[] args) { try (Connection conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=JDBCDB", "scott", "tiger"); Statement st=conn.createStatement(); ResultSet rs=st.executeQuery("select*from emp"); ) { conn.setAutoCommit(false); try { while (rs.next()){ int empno=rs.getInt("empno"); String name=rs.getString("enae"); System.out.println("empno:"+empno+" ename:"+name); } conn.commit(); }catch (SQLException e){ e.printStackTrace(); System.out.println("rollback"); conn.rollback(); }catch (Exception e){ e.printStackTrace(); System.out.println("rollback"); conn.rollback(); } System.out.println("query finished"); } catch (SQLException e) { e.printStackTrace(); } } }
235304b6-dd72-40bc-9ac3-e2df95a76431
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-04-02T11:20:42", "repo_name": "genmauger/rails-blog", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 991, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "60fef9f58d8ef17273d15ceda861457e8287aa42", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/genmauger/rails-blog
205
FILENAME: README.md
0.218669
# README This README would normally document whatever steps are necessary to get the application up and running. ## Practice Blog Application We are currently exploring the use of Application Programming Interfaces (APIs) in our class. After working with databases (such a sequel and sqlite3) and practicing pairing these databases with created servers (such as webrick and sinatra) to create basic websites, we have now moved onto using ruby on rails. This is my first attempt at creating an API in Rails. I will be following closely along with the Rails tutorial. As I expand my knowledge of rails, I will be using this project as a playground of sorts to try out many ideas and concepts. Things you may want to cover: * Ruby version This application runs in ruby 2.4.1 * System dependencies * Configuration * Database creation * Database initialization * How to run the test suite * Services (job queues, cache servers, search engines, etc.) * Deployment instructions * ...
de26dd0a-5e29-4330-8661-30b2cc0a2810
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-12-11T11:26:06", "repo_name": "thai-ng/FGO-Bot-Framework", "sub_path": "/Readme.MD", "file_name": "Readme.MD", "file_ext": "md", "file_size_in_byte": 1152, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "1c013cc1f63fba290988999d01b3cfda819ce6a3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/thai-ng/FGO-Bot-Framework
265
FILENAME: Readme.MD
0.250913
# This is a bot framework for Fate Grand Order. ## Roadmap: 1. Detect Servants present in battle scene. 2. Select servant skills 3. Detect cards in card selection scene 4. Select cards 5. Detect suit skills 6. Select suit skills 7. Detect NP cards 8. Select NP cards 9. Build scripting framework for scripting battle actions 10. Build Android App that consumes this framework. 11. Explore outside of battle scripting ## TODOs: ### Build coordinate primitives: 1. Get skill rect coordinates 2. Get Start button coordinate 3. Get face cards coordinates 4. Detect NP cards & Get NP cards coordinate 5. Get suit button coordinate 5. Get suit skills coordinates ### Touch injection 1. Get touch coordinate for each element 2. Get basic touch injection working 3. Touch injection from screen space ### Android port 1. Get Android project started. 2. Get Android screenshot with accessibility service 3. Get Android touch injection with accessibility service 4. Build library for Android app consumption 5. Android app entry and UI. ### GPU CV 1. Explore OpenCV using GPU (CUDA only? or use phone GPU as well?) 2. Port library to GPU 3. Test library on phone
5fae172f-30e0-4f71-80e5-4d744d4d68ee
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-27 15:03:55", "repo_name": "ninedao/javaProject", "sub_path": "/src/com/lzc/thinkingInJava/concurrency/DaemonFromFactory.java", "file_name": "DaemonFromFactory.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "1d4d33508394920aeb0e78fa34f7f90d73069d3f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ninedao/javaProject
193
FILENAME: DaemonFromFactory.java
0.272025
package com.lzc.thinkingInJava.concurrency; import com.lzc.thinkingInJava.util.DaemonThreadFactory; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; public class DaemonFromFactory implements Runnable{ @Override public void run() { while(true) { try { TimeUnit.MILLISECONDS.sleep(100); System.out.println(Thread.currentThread() + " " + this); } catch (InterruptedException e) { System.out.println("sleep() interrupted"); } } } public static void main(String[] args) throws InterruptedException { ExecutorService executorService = Executors.newCachedThreadPool(new DaemonThreadFactory()); for(int i = 0; i < 10; i++){ executorService.execute(new DaemonFromFactory()); } System.out.println("All daemons started"); TimeUnit.MILLISECONDS.sleep(175); } }
2d908e5b-c3a2-4b46-a2ab-f80c5a5007bf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-08T18:13:47", "repo_name": "KSxiao/xyz-editor", "sub_path": "/packages/editor/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 998, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "67499379dc7b26adc1b9a687d8d7c7d80556b90e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/KSxiao/xyz-editor
231
FILENAME: README.md
0.252384
# XYZ Maps JS: Editor XYZ Maps is an experimental and work in progress open-source map editor written in TypeScript/JavaScript. The editor module provides an API for editing map data that can be used to easily access, add, remove and edit various types of map data. Changes can be automatically synchronized with various remote backends services. ## Start developing 1. Install node module dependencies ``` yarn install ``` In case yarn is not installed already: [install yarn](https://yarnpkg.com/en/docs/install) 2. watch for source code changes and build dev version ``` yarn run watch-dev ``` Builds are located in located in `./dist/` ## Other * build dev version once `yarn run build-dev` (located in packages/*/dist/) * build release version only `yarn run build-release` (minified...) ## License Copyright (C) 2019-2021 HERE Europe B.V. This project is licensed under the Apache License, Version 2.0 - see the [LICENSE](LICENSE) file for details
508f3cc0-54f4-4b82-9f97-1a5d5e81e8e0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-01 09:19:12", "repo_name": "biin/AndroidLab", "sub_path": "/app/src/main/java/com/multicampus/androidlab/ch05/FrameLayoutActivity.java", "file_name": "FrameLayoutActivity.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "60c212cdbe3ec712ddd0815aeaa209b9d35e660f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/biin/AndroidLab
196
FILENAME: FrameLayoutActivity.java
0.23092
package com.multicampus.androidlab.ch05; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.ImageView; import com.multicampus.androidlab.R; public class FrameLayoutActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ch05_activity_frame_layout); Button pushButton = (Button)findViewById(R.id.btn); final ImageView img = (ImageView)findViewById(R.id.korando); pushButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(img.getVisibility() == View.VISIBLE){ img.setVisibility(View.GONE); }else{ img.setVisibility(View.VISIBLE); } } }); img.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { v.setVisibility(View.GONE); } }); } }
ebd044be-12f1-455e-adab-c4ae58b65fef
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-13 01:04:44", "repo_name": "zhenghuan12/nhis-web", "sub_path": "/src/main/java/com/zebone/nhis/base/bd/vo/BdDefdocSaveParam.java", "file_name": "BdDefdocSaveParam.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "f0d91e4ae2d0547bf022648095fcf0be31ee0083", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zhenghuan12/nhis-web
304
FILENAME: BdDefdocSaveParam.java
0.26588
package com.zebone.nhis.base.bd.vo; import java.util.List; import java.util.Set; import com.zebone.nhis.common.module.base.bd.code.BdDefdoc; public class BdDefdocSaveParam { private String codeDefdoclist; private List<BdDefdoc> bdDefdoc; private List<String> delPkDefdocs; //删除的公共字典信息主键 public Set<String> getUpdatePkDefdocs() { return updatePkDefdocs; } public void setUpdatePkDefdocs(Set<String> updatePkDefdocs) { this.updatePkDefdocs = updatePkDefdocs; } private Set<String> updatePkDefdocs;//修改的公共字典信息主键 public List<String> getDelPkDefdocs() { return delPkDefdocs; } public void setDelPkDefdocs(List<String> delPkDefdocs) { this.delPkDefdocs = delPkDefdocs; } public String getCodeDefdoclist() { return codeDefdoclist; } public void setCodeDefdoclist(String codeDefdoclist) { this.codeDefdoclist = codeDefdoclist; } public List<BdDefdoc> getBdDefdoc() { return bdDefdoc; } public void setBdDefdoc(List<BdDefdoc> bdDefdoc) { this.bdDefdoc = bdDefdoc; } }
b9a8d335-e9af-430b-8b95-e209e1ff6d1f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-07 10:26:10", "repo_name": "ouyangshixiong/redisson-test", "sub_path": "/src/main/java/com/example/controller/CommonInnerObjectController.java", "file_name": "CommonInnerObjectController.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "bc4175a47ab622e867ffa1b27e79ddfeaec24d6f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ouyangshixiong/redisson-test
256
FILENAME: CommonInnerObjectController.java
0.236516
package com.example.controller; import com.example.entity.CommonObject; import com.example.entity.SimTest4; import lombok.extern.slf4j.Slf4j; import org.redisson.api.RLiveObjectService; import org.redisson.api.RedissonClient; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author alexouyang * @Date 2019-12-26 */ @RestController @Slf4j public class CommonInnerObjectController { RedissonClient redissonClient; RLiveObjectService rloClient; public CommonInnerObjectController( RedissonClient redissonClient ){ this.redissonClient = redissonClient; rloClient = redissonClient.getLiveObjectService(); } @RequestMapping("/inner_common") public void innerCommon(){ CommonObject commonObject = new CommonObject(); commonObject.setName("common1"); commonObject.setValue(1); SimTest4 simTest4 = new SimTest4(); simTest4.setName("simtest4"); simTest4.setCommonObject(commonObject); SimTest4 temp = rloClient.persist(simTest4); log.info("temp:{}",temp); } }
80f81874-f1a9-4cbd-b557-b927f9021cc6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-17 02:40:28", "repo_name": "bkuschner/Carlton-app", "sub_path": "/WatchFootballActivity.java", "file_name": "WatchFootballActivity.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f7017dac817d4a66bb87bb5ef44e01ae74fc3c53", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/bkuschner/Carlton-app
206
FILENAME: WatchFootballActivity.java
0.204342
package com.example.carltonapp; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.MediaController; import android.widget.TextView; import android.widget.VideoView; import com.google.android.youtube.player.YouTubePlayerView; public class WatchFootballActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_watch_football); VideoView mVideoView = (VideoView) findViewById(R.id.videoview); String mediaName = "carltonvid"; Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/raw/" + mediaName); mVideoView.setVideoURI(videoUri); MediaController controller = new MediaController(this); controller.setMediaPlayer(mVideoView); mVideoView.setMediaController(controller); mVideoView.start(); } }
78f9c983-babe-4673-84c3-ef17eac419be
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-30 14:25:46", "repo_name": "pmatosevic/JavaCourse", "sub_path": "/hw07-0036505868/src/main/java/hr/fer/zemris/java/hw07/observer2/IntegerStorageChange.java", "file_name": "IntegerStorageChange.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "3c46840cfd0d5a06d183ea4db84439c6df786397", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/pmatosevic/JavaCourse
261
FILENAME: IntegerStorageChange.java
0.294215
package hr.fer.zemris.java.hw07.observer2; /** * A class that stores information about a change in the subject {@link IntegerStorage}. * * @author Patrik * */ public class IntegerStorageChange { /** * The subject */ private IntegerStorage istorage; /** * Old value */ private int oldValue; /** * New value */ private int newValue; /** * Creates a new {@code IntegerStorageChange}. * @param istorage {@link IntegerStorage} object * @param oldValue old value * @param newValue new value */ public IntegerStorageChange(IntegerStorage istorage, int oldValue, int newValue) { this.istorage = istorage; this.oldValue = oldValue; this.newValue = newValue; } /** * @return the {@link IntegerStorage} subject */ public IntegerStorage getIstorage() { return istorage; } /** * @return the old value */ public int getOldValue() { return oldValue; } /** * @return the new value */ public int getNewValue() { return newValue; } }
143504d4-7e01-4af6-8e19-5c1eec9323a5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-04-03T17:25:32", "repo_name": "Alicolliar/text-Battleships", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1011, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "3bf778fe26fb4701a7db1265bb52e83854ce7649", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Alicolliar/text-Battleships
267
FILENAME: README.md
0.240775
# Text Based Battleships ## This, is text based Battleships [![Run on Repl.it](https://repl.it/badge/github/Alicolliar/text-Battleships)](https://repl.it/github/Alicolliar/text-Battleships) ## Premise If you've ever played the game "Battleships" before, then this is like that, but worse much, much worse. ## Installation Simply copy the code, type `python3 battleships.py` # Or There is no need to install the code if you go to [repl.it](https://text-Battleships.alicolliar.repl.run) and run the program from there. ## How to play This should become fairly apparent as the game should prompt you at times on how to play it. If you are unaware of anything concerning Battleships, see [here](https://en.wikipedia.org/wiki/Battleship_%28game%29#History). ## Roadmap What I plan to do next: - [x] Implement the boat selection for both humans and AI - [ ] Implement the turn mechanism for both humans and AI - [ ] Implement an optional Salvo mode - [ ] *Maybe* implement some kind of pc-pc multiplayer system
0f0cbefe-1295-4655-bcc7-ce06def30cad
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-07-25T16:44:56", "repo_name": "kpu/usage", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1179, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "fc93e8cd9cfef0b46ac2a700878f0bd6bc539150", "star_events_count": 5, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kpu/usage
277
FILENAME: README.md
0.253861
usage ===== Prints resource usage of processes to stderr. Currently Linux only. Compile with ```bash ./compile.sh ``` Then use it: ```bash ./measure.sh true ``` You can also manually set `LD_PRELOAD` in the current shell: ```bash export LD_PRELOAD=$PWD/libusage.so:/usr/lib64/librt.so cat /dev/null ``` The fields are tab delimited. Memory is measured in kB. Time is measured in seconds. CPU is the sum of user and system time. Most fields apply to the process itself, but children (and not the process itself) are reported in fields that begin with `Child`. # Rationale The normal way to collect process statistics is to fork, exec, wait for SIGCHLD, and reap children with waitpid. However, zombie processes do not have virtual memory statistics in `/proc/$pid/status`. The `LD_PRELOAD` mechanism provides a way to inject code into dynamically linked processes so that statistics can be collected immediately before exit. # Bugs This will not work on programs with static linkage, setuid/setgid, or programs that need specific file descriptor numbers. Since some programs close stderr, fd 2 is duplicated at the beginning. See the limitations of `getrusage`.
c71d89f3-5a6b-4de2-ae48-a40be6791b68
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-09T14:56:10", "repo_name": "cmfcruz/balena-yocto-builder", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1153, "line_count": 45, "lang": "en", "doc_type": "text", "blob_id": "6ced3af9672e34ffee797f5ea89467aed543cbbe", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cmfcruz/balena-yocto-builder
294
FILENAME: README.md
0.20947
# balena-yocto-builder ## Introduction This application allows you to offload building a balenaOS image to your balena device. This is inspired by the docker-balena project from @alexgg: https://github.com/alexgg/docker-balena ## Preparing the application Clone the yocto repository which will be included in the image. ``` git clone https://github.com/balena-os/balena-intel yocto-builder/yocto ``` Set the `MACHINE` environment variable to the device type you are building. For example, `MACHINE: genericx86-64-ext`. Modify the yocto project to suit your needs. ## Push the application to balenaCloud Log into balenaCloud. ``` balena login ``` Create a fleet for this application. ``` balena app create balena-yocto-builder ``` Push the code to balenaCloud. ``` balena push balena-yocto-builder ``` Provision a balena device preferrably using a powerful x86_64 machine. The device will immediately start building the balenaOS image as soon as the container starts. Once the build completes, the image can be downloaded through a Caddy server listening on port 80. You should be able to download the images using the public device URL.
a5681624-a5ae-402a-93bb-7ce2b534b270
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-07 10:54:02", "repo_name": "dlsyaim/EQIMSERVER", "sub_path": "/src/main/java/com/gisinfo/sand/login/LoginService.java", "file_name": "LoginService.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "1a2c52a0f68852379b2b07093d68426ba0d4115f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dlsyaim/EQIMSERVER
227
FILENAME: LoginService.java
0.242206
package com.gisinfo.sand.login; import com.gisinfo.sand.core.auth.impl.User; import com.gisinfo.sand.core.exception.exception.LoginException; import com.gisinfo.sand.core.log.Log; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.subject.Subject; import org.springframework.stereotype.Service; @Service public class LoginService { /** * * @param userId 该参数是为了让日志获取到,否则登出之后,无法获取到登出的是谁 */ @Log("用户登出") public void logout(String userId){ SecurityUtils.getSubject().logout(); } @Log("用户登录") public User login(User user){ Subject subject = SecurityUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken(user.getLoginName(), user.getPassword()); try{ subject.login(token); }catch (Exception e){ throw new LoginException("用户名或密码不正确"); } user = (User) subject.getPrincipal(); return user; } }
cdade608-a795-451f-b459-b26a45673d2b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-10-16T08:31:22", "repo_name": "tryusweb/oBot", "sub_path": "/Readme.md", "file_name": "Readme.md", "file_ext": "md", "file_size_in_byte": 1001, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "e67c460912c75ee4c05cb55c3054d072576475c7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tryusweb/oBot
292
FILENAME: Readme.md
0.206894
Version: 7.8.7 Link Download: https://js.obot.it/obot.user.js Compatibility ogame version: 6.x,7.x Home: https://obot.it Facebook: https://www.facebook.com/oBot.it Youtute: https://www.youtube.com/channel/UC-JNcNJzWKs_JznrZQITqRw User manual: https://obot.it/manual Forum: https://obot-forum.tryus.it/ Support server: IT, EN, US, ES, AR, MX, FR, DE, PT, BR, DK, BA, CZ, FI, NL, GR, NO, RO, RU, SE, SI, SK, HU Ogame version: 6.x, 7.x oBot is a bot composed of various modules, which helps you keep an eye on your account. Integrated modules: • Self activity; • Check attacks and spy on arrival; • Notification Telegram; • Automatic login; • Auto transport; • Auto attacks; • Auto Expedition; • Advanced statistics; • rescue attacks and expedition. User manual and FAQ are present on the site. In case of anomalies, errors in the documentation or proposals on new features, write to us. Info@obot.it The bot is constantly developing on the requests that come to us.
43e6d866-5fed-443e-a299-22235c1f3c27
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-29T08:37:25", "repo_name": "Maixianda/work", "sub_path": "/liangce/GGLibrary/src/main/java/io/ganguo/library/core/cache/CacheManager.java", "file_name": "CacheManager.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "ff992db5bdf33941371a696a7c18341ad1d0473a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Maixianda/work
224
FILENAME: CacheManager.java
0.259826
package io.ganguo.library.core.cache; import android.content.Context; import java.io.File; /** * cache manager * <p/> * Created by Tony on 10/5/15. */ public class CacheManager { private static Cache mMemoryCache = null; private static DiskCache mDiskCache = null; /** * memory cache * * @param context * @return */ public static Cache memory(Context context) { if (mMemoryCache == null) { mMemoryCache = new MemoryCache(); } return mMemoryCache; } /** * disk cache * * @param context * @return */ public static Cache disk(Context context) { if (mDiskCache == null) { File diskPath = new File( context.getCacheDir().getAbsolutePath() + File.separator + "disk" ); diskPath.mkdirs(); mDiskCache = new DiskCache(diskPath); } return mDiskCache; } }
0a40d97e-326e-4a3c-b812-196a8c6e3eaf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-05 11:19:33", "repo_name": "jfylgw/base-back-end-demo", "sub_path": "/src/main/java/wtf/demo/listener/StartupListener.java", "file_name": "StartupListener.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "22a3b60722eaa34d947733a3ff55ada891782a69", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/jfylgw/base-back-end-demo
217
FILENAME: StartupListener.java
0.204342
package wtf.demo.listener; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; import wtf.demo.task.TagCacheTask; /** * 系统启动监听器 * @author gongjf * @since 2019年4月18日 10:24:48 */ @Component @Slf4j public class StartupListener implements ApplicationListener<ContextRefreshedEvent> { @Value("${system.test-environment}") private boolean testEnvironment = false; @Autowired private TagCacheTask tagCacheTask; @Override public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) { try { // 加载标签树缓存 tagCacheTask.setTree(null); } catch (Exception e) { if(testEnvironment) e.printStackTrace(); } } }
5d4a3acf-8451-40b0-bdd1-1bd7002b78a8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-11-10T15:36:10", "repo_name": "JoseManuelMunozManzano/spring-crm-rest", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 998, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "a128f769b5a0c512a364f5d5caeebfb9dd24128c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JoseManuelMunozManzano/spring-crm-rest
288
FILENAME: README.md
0.286169
# **Build a CRUD Demo using Spring REST** An example in which I show the usage of Spring REST and Hibernate It's a simple web customer tracker in which I do CRUD operations in a mysql Database using REST. The Spring Configuration is done in pure Java (no XML) * GET customers: http://localhost:8080/spring-crm-rest/api/customers * GET single customer: http://localhost:8080/spring-crm-rest/api/customers/{customerId} * POST customer: http://localhost:8080/spring-crm-rest/api/customers Example in Postman: POST, Body: raw and JSON { "firstName" : "Maria", "lastName" : "Pérez", "email" : "mperez@neimerc.com" } * PUT customer: http://localhost:8080/spring-crm-rest/api/customers Example in Postman: PUT, Body: raw and JSON { "id" : 1, "firstName" : "Maria", "lastName" : "Rodríguez", "email" : "mrodriguez@neimerc.com" } * DELETE customer: http://localhost:8080/spring-crm-rest/api/customers/{customerId} Note: There is a sql-script folder to create the schemas and the tables.
ce029abc-8fa9-418d-b252-238e30c2432a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-02 07:22:50", "repo_name": "wangwei216/springProject", "sub_path": "/springTest/src/spring_test01/HelloSpring.java", "file_name": "HelloSpring.java", "file_ext": "java", "file_size_in_byte": 1614, "line_count": 36, "lang": "zh", "doc_type": "code", "blob_id": "053d186612fff0a2ddb6fe01466d9473d71f72f0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wangwei216/springProject
406
FILENAME: HelloSpring.java
0.288569
package spring_test01; /* 一、实现IOC需要用到的底层技术有哪些? 1. XML的配置文件 2. dom4j解决XML 3. 工厂的设计模式 4. 反射机制 二、IOC原理流程: 1. 需要先配置一下xml文件,前面id就是当你直接用的时候直接把配置好的id传进去,后面就是你创建的类名的路径<bean id="test01" class="spring_test01.HelloSpring"> 2. 创建工厂类使用dom4j + 反射 来实现 三、如何从IOC容器中获取bean的实例( ApplicationContext)(记得在new ClassPathXmlApplicationContext后面一定要加xml的包名) 1. HelloSpring bean = context.getBean(HelloSpring.class);直接在getBean后面加上类名.class 2. HelloSpring bean = context.getBean("helloSpring"); 也就是在getBean后面加上你在xml文件中自己定义的的那个id名也可以 四、如何用xml配置文件给相应的类进行设置属性,而且怎么能够区分重名不同参数的构造方法 1. 可以使用相对应的type类型,或者是每个位置对应参数的下标,再或者两者中和使用,也是可以的(constructor-arg) 2. 还可以使用value直接使用对属性去赋值 3. 还可以使用ref 直接去引用另外一个已经定义好的bean类型的值,如<constructor-arg index="2" ref="car"/> * */ public class HelloSpring { private String name; public HelloSpring(String s, String s2, String s23) { } public void setName(String name){ this.name=name; } public void sayHello(String name){ System.out.println(name+"Hello Spring"); } }
336ad21e-ad7f-463c-b334-ae46e9f8450a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-13 09:00:19", "repo_name": "NaniiGheorghe/AccessControlSystem", "sub_path": "/project/AccessControlSystem-Server/src/main/java/com/acs/configuration/socket/communication/AcknowledgeProtocolEvent.java", "file_name": "AcknowledgeProtocolEvent.java", "file_ext": "java", "file_size_in_byte": 1100, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "5e30c14ef395922c69b017d85d904caf21ae21e5", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/NaniiGheorghe/AccessControlSystem
223
FILENAME: AcknowledgeProtocolEvent.java
0.272025
package com.acs.configuration.socket.communication; import com.acs.configuration.socket.communication.util.EventIdentifier; import org.apache.commons.lang3.StringUtils; public class AcknowledgeProtocolEvent extends OutgoingAbstractProtocolEvent { /** * Defined 10 positions */ private String scannerId; /** * Defined 10 positions */ private String doorLockId; public AcknowledgeProtocolEvent(String scannerId, String doorLockId) { super(null); this.scannerId = scannerId; this.doorLockId = doorLockId; build(); } @Override public void build() { String message = ""; message += EventIdentifier.ACNOWLEDGE_EVENT; message += StringUtils.rightPad(String.valueOf(getScannerId()), 10, ""); message += StringUtils.rightPad(String.valueOf(getDoorLockId()), 10, ""); setMessage(message); } private String getScannerId() { return scannerId; } private String getDoorLockId() { return doorLockId; } }
e5643087-54f4-4b3e-9317-2e3081caa56e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-18 06:27:14", "repo_name": "eminemRSO/analyticsRSO", "sub_path": "/src/main/java/me/eminem/analyticsRSO/StorageController.java", "file_name": "StorageController.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ab6695154d19756cc4a0ee0d12d56166051b7f12", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/eminemRSO/analyticsRSO
188
FILENAME: StorageController.java
0.236516
package me.eminem.analyticsRSO; import org.modelmapper.ModelMapper; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; import java.util.stream.Stream; @RestController public class StorageController { TaskService taskService; ModelMapper modelMapper; public StorageController(TaskService taskService) { modelMapper = new ModelMapper(); this.taskService = taskService; } @CrossOrigin(origins = "*") @GetMapping(path="/emptyCall") public void emptyCall(){ taskService.emptyCall(); } @CrossOrigin(origins = "*") @GetMapping(path="/returnNumber") public String returnNumber(){ return taskService.returnNumber(); } @GetMapping(path="/sleep") public String sleep() throws InterruptedException{ return taskService.sleep(); } }
ec2cca04-5001-441d-b917-055e784a167a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-05 15:04:13", "repo_name": "martinwangjun/spring_mybatis", "sub_path": "/src/main/java/controller/User2Controller.java", "file_name": "User2Controller.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "4c80de9295f31dea2f756ba68cbb5c40fb11c557", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/martinwangjun/spring_mybatis
207
FILENAME: User2Controller.java
0.267408
package controller; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import pojo.User; @Controller @RequestMapping(value="/user") public class User2Controller { private static final Logger logger = Logger.getLogger(User2Controller.class); @ModelAttribute private void userModel(String loginname, String password, ModelMap modelMap) { logger.info("User2Controller启动"); User user = new User(); user.setLoginname(loginname); user.setPassword(password); modelMap.addAttribute("user", user); } @RequestMapping(value="login2") public String login(ModelMap modelMap) { logger.info("User2Controller的login2被调用"); User user = (User)modelMap.get("user"); System.out.println(user); user.setUsername("测试ModelMap的User"); return "user/result2"; } }
fe1d60b7-d4b6-4d2d-82f5-e7cfe4264c1d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-28 03:14:17", "repo_name": "lililiyang/JavaBaseCode", "sub_path": "/src/ly/basetest/Stream/SimpleFileTransferTest.java", "file_name": "SimpleFileTransferTest.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "5dfc97fe0d4b9cfbd3c042507adaf518ca1eb825", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lililiyang/JavaBaseCode
272
FILENAME: SimpleFileTransferTest.java
0.282196
package ly.basetest.Stream; import java.io.*; /** * 普通io和nio */ public class SimpleFileTransferTest { public static long transferFile(File source,File des) throws IOException { long startTime = System.currentTimeMillis(); if(!des.exists()){ des.createNewFile(); } BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(source)); BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(des)); byte[] bytes = new byte[1024 * 1024]; int len; while((len = inputStream.read(bytes)) != -1){ outputStream.write(bytes,0,len); } long stopTime = System.currentTimeMillis(); return stopTime-startTime; } /* public static long transferFileWithNIO(File source,File des) throws IOException { }*/ public static void main(String[] args) throws IOException { File source = new File("E:\\SSM\\乐优商城\\Day57 - 商品表结构\\1_Ap4JZ.mp4"); File des = new File("E:\\SSM\\乐优商城\\Day57 - 商品表结构\\2222.avi"); long time = transferFile(source, des); System.out.println("普通字节流:"+time); } }
7092e629-4519-41a1-9f08-f731da44b8f3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-20 12:12:51", "repo_name": "adafflitto/java-web-dev-exercises", "sub_path": "/src/org/launchcode/java/demos/lsn3classes1/Course.java", "file_name": "Course.java", "file_ext": "java", "file_size_in_byte": 991, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "e450419875d28fce0ec557b2cadeeb236a2c357d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/adafflitto/java-web-dev-exercises
193
FILENAME: Course.java
0.242206
package org.launchcode.java.demos.lsn3classes1; import java.util.ArrayList; public class Course { private ArrayList<Student> students; private String courseName; private String courseDescription; public Course (ArrayList<Student> students, String courseName, String courseDescription) { this.students = students; this.courseName = courseName; this.courseDescription = courseDescription; } public ArrayList<Student> getStudents() { return students; } protected void setStudents(ArrayList<Student> aStudents) { students = aStudents; } public String getCourseName() { return courseName; } protected void setCourseName(String aCourseName) { courseName = aCourseName; } public String getCourseDescription() { return courseDescription; } protected void setCourseDescription(String aCourseDescription) { courseDescription = aCourseDescription; } }
a2905c7a-09ea-4084-9ab6-df5109ca5feb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-05 12:13:27", "repo_name": "zmPersevere/concurrencyzm", "sub_path": "/src/main/java/com/ming/concurrency/example/sync/SynchronizedExample2.java", "file_name": "SynchronizedExample2.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "95d1bf03b78c08065bfaac7b1a588738ecea16a1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zmPersevere/concurrencyzm
260
FILENAME: SynchronizedExample2.java
0.268941
package com.ming.concurrency.example.sync; import lombok.extern.slf4j.Slf4j; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * @Description : * @Author : zhangMing * @Date : Created in 8:06 PM 2019/4/24 */ @Slf4j public class SynchronizedExample2 { public void test1(){ synchronized (SynchronizedExample2.class){ for (int i = 0 ; i < 100 ; i ++){ log.info("test1 - {}",i); } } } public synchronized static void test2(){ for (int i = 0 ; i < 100 ; i ++){ log.info("test2 - {}",i); } } public static void main(String[] args) { SynchronizedExample2 example1 = new SynchronizedExample2(); SynchronizedExample2 example2 = new SynchronizedExample2(); ExecutorService executorService = Executors.newCachedThreadPool(); executorService.execute(() ->{ example1.test1(); }); executorService.execute(() ->{ example2.test2(); }); executorService.shutdown(); } }
882bf11f-2c71-4a18-bcb5-46d4442651a4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-13 01:23:27", "repo_name": "savioseb/wasproject", "sub_path": "/WhatAreWeSingingSongAnalyzer/src/com/savio/waslyzer/resource/impl/CheckDb.java", "file_name": "CheckDb.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "8cd79d2f750b1b24a039dac34f7d65f89e116058", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/savioseb/wasproject
226
FILENAME: CheckDb.java
0.247987
package com.savio.waslyzer.resource.impl; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class CheckDb { public static void main( String[] args ) { Connection con = null; Statement st = null; ResultSet rs = null; String url = "jdbc:mysql://localhost:3306/wasdb"; String user = "root"; String password = "root123"; try { con = DriverManager.getConnection(url, user, password); st = con.createStatement(); rs = st.executeQuery("SELECT VERSION()"); if (rs.next()) { System.out.println(rs.getString(1)); } } catch (SQLException ex) { } finally { try { if (rs != null) { rs.close(); } if (st != null) { st.close(); } if (con != null) { con.close(); } } catch (SQLException ex) { } } } }
38876b0c-7cbd-4c3a-bc07-42dce49132fd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-20 03:18:27", "repo_name": "AsTheStarsFall/JavaBase", "sub_path": "/base-sample/src/main/java/com/tianhy/javabase/serialize/SerializerTest.java", "file_name": "SerializerTest.java", "file_ext": "java", "file_size_in_byte": 1093, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7a665bef48e854a6e59a685dce13b3c2d25ae0bf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AsTheStarsFall/JavaBase
258
FILENAME: SerializerTest.java
0.264358
package com.tianhy.javabase.serialize; import com.tianhy.javabase.serialize.pojo.User; import com.tianhy.javabase.serialize.serializer.*; /** * {@link} * * @Desc: * @Author: thy * @CreateTime: 2019/6/18 **/ public class SerializerTest { public static void main(String[] args) { // ISerializer serializer = new XStreamSerializer(); // ISerializer serializer = new JavaSerializer(); ISerializer serializer = new FastJsonSerializer(); // ISerializer serializer = new HessianSerializer(); // ISerializer serializer = new JavaSerializerWithFile(); User user = new User(); user.setName("tianhy"); user.setAge(18); byte[] bytes = serializer.serialize(user); System.out.println("bytes length: " + bytes.length); System.out.println(new String(bytes)); /** * xstream: 299 * Java: 113 * FastJson :26 * Hessian: 71 * protobuf : 10 */ User user1 = serializer.deSerialize(bytes, User.class); System.out.println(user1); } }
ecd538d0-18b3-4baf-8efe-3f24b8da82ad
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-09 10:26:11", "repo_name": "silvioincalza/notifications-exercise", "sub_path": "/notification-bucket-domain/src/main/java/it/incalza/notification/bucket/domain/PutInToBucket.java", "file_name": "PutInToBucket.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "0e86375a954fb0e1ccad56f9946b33d20940c4c2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/silvioincalza/notifications-exercise
199
FILENAME: PutInToBucket.java
0.247987
package it.incalza.notification.bucket.domain; import java.util.Set; import static java.util.stream.Collectors.toSet; /** * Created by sincalza on 05/12/2016. */ public class PutInToBucket implements NotificationCommand<Notification> { private final String systemId; private final BucketRepository bucketRepository; private final UserRepository userRepository; public PutInToBucket(String systemId, BucketRepository bucketRepository, UserRepository userRepository) { this.systemId = systemId; this.bucketRepository = bucketRepository; this.userRepository = userRepository; } @Override public void onNotifications(Set<Notification> notifications) { Set<BucketItem> items = notifications.stream().map(v -> convert(v)).collect(toSet()); bucketRepository.put(items); } private BucketItem convert(Notification v) { return new BucketItem(v.getUuid(), systemId, userRepository.retrieveEmail(v.getUserId()), false); } }
bde7a2c6-e74a-49f1-8e34-336df5a03996
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-12 13:56:09", "repo_name": "jakob-ristner/DIT953-lab1", "sub_path": "/src/model/vehicles/TransportVehicle.java", "file_name": "TransportVehicle.java", "file_ext": "java", "file_size_in_byte": 1152, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "1839dcc61539e878678d3dfd7fde38f7acecd99d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jakob-ristner/DIT953-lab1
252
FILENAME: TransportVehicle.java
0.286169
package model.vehicles; import model.utilities.Vector; import model.vehicleparts.Flatbed; import java.awt.*; import java.util.Timer; import java.util.TimerTask; public abstract class TransportVehicle extends MotorisedVehicle { protected Flatbed flatbed; public TransportVehicle(int nrDoors, Color color, double enginePower, String modelName, int weight, Flatbed flatbed, Vector pos) { super(nrDoors, color, enginePower, modelName, weight, pos); this.flatbed = flatbed; } @Override public void startEngine() { if (!flatbed.isDeactivated()) return; super.startEngine(); Timer t = new Timer(); t.schedule(new TimerTask() { @Override public void run() { } }, 85); } public void activateFlatbed() { if (getCurrentSpeed() > 0) return; flatbed.activate(); } public void deActivateFlatbed() { flatbed.deActivate(); } public boolean isFlatbedDeactivated() { return flatbed.isDeactivated(); } public boolean isFlatbedActivated() { return flatbed.isActivated(); } }
fffbddca-4952-4a9d-b94b-5e0bd32b11bb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2022-07-10T00:46:42", "repo_name": "NorthConcepts/TemplateMaster", "sub_path": "/library/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1013, "line_count": 18, "lang": "en", "doc_type": "text", "blob_id": "52c405a4a237f4763738f5f0625ec0a398e11847", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/NorthConcepts/TemplateMaster
226
FILENAME: README.md
0.235108
# TemplateMaster TemplateMaster is a Java library for creating template driven content. It can be used to generate web pages, emails, and anything else that can be created based on a textual template. It uses [FreeMarker](https://freemarker.apache.org/) underneath for the heavy lifting and comes with [RESTEasy](https://resteasy.github.io/) hooks if that's your favourite RESTful framework. The code was originally developed as part of our blog ["How To Build Template Driven Java Websites with FreeMarker and RESTEasy"](https://blog.stackhunter.com/2014/01/21/build-template-driven-java-websites-freemarker-resteasy/). ## How to Build Build the library jar file in `build/libs` by executing `gradle build` on the command line. ## Example Web Apps - [Article submission example](https://github.com/NorthConcepts/TemplateMaster/tree/master/article-submission-example) - [Article submission example using Spring Boot](https://github.com/NorthConcepts/TemplateMaster/tree/master/spring-boot-example) Enjoy.
28267090-c4aa-4814-9ad2-2a74d6fb096a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-09-15 00:34:26", "repo_name": "don4of4/Herobrine", "sub_path": "/src/me/herobrine/gui/SettingsDialog.java", "file_name": "SettingsDialog.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "38d23a0aff9f0df56121fd4573b03a699da4967b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/don4of4/Herobrine
270
FILENAME: SettingsDialog.java
0.283781
package me.herobrine.gui; import java.awt.BorderLayout; import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; public class SettingsDialog extends JDialog { private final JPanel contentPanel = new JPanel(); public SettingsDialog(MainFrame parent) { super(parent, "Settings", JDialog.ModalityType.APPLICATION_MODAL); setBounds(100, 100, 450, 300); getContentPane().setLayout(new BorderLayout()); contentPanel.setLayout(new FlowLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton okButton = new JButton("OK"); okButton.setActionCommand("OK"); buttonPane.add(okButton); getRootPane().setDefaultButton(okButton); } { JButton cancelButton = new JButton("Cancel"); cancelButton.setActionCommand("Cancel"); buttonPane.add(cancelButton); } } super.setLocationRelativeTo(parent); } }
7f74e718-2f9e-4e0c-b12e-40e691802610
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-13T18:50:50", "repo_name": "AntonSergeichyk/rwm", "sub_path": "/src/main/java/com/example/inhouse/rwm/demo/model/order/OrderDto.java", "file_name": "OrderDto.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "73a08e4e68bdb2ab45676e96b96b7077da6909d9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AntonSergeichyk/rwm
235
FILENAME: OrderDto.java
0.295027
package com.example.inhouse.rwm.demo.model.order; import com.example.inhouse.rwm.demo.domein.dictionary.order.PassengerType; import com.example.inhouse.rwm.demo.domein.dictionary.order.Rate; import com.example.inhouse.rwm.demo.domein.order.Order; import com.example.inhouse.rwm.demo.model.ticket.TicketDto; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; @Getter @Setter @AllArgsConstructor @JsonInclude(NON_NULL) public class OrderDto { private Long id; private TicketDto ticket; private PassengerType passengerType; private Rate rate; private String amount; private Long customerId; public OrderDto(Order order) { if (order == null) { return; } this.id = order.getId(); this.ticket = new TicketDto(order.getTicket()); this.passengerType = order.getPassengerType(); this.rate = order.getRate(); this.amount = order.getAmount(); this.customerId = order.getCustomer().getId(); } }
081c4d2b-4846-4365-b8c9-15b794ca23a8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-12-12T14:57:30", "repo_name": "mgadan/instalitre-microservices-post", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1022, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "c790a52b7ede6f48682e43ee3538ac2a4b484c33", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mgadan/instalitre-microservices-post
277
FILENAME: README.md
0.247987
## Install rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ## .env DATABASE_URL_TEST=postgres://user:password@address/name_database accesskey= scaleway > api token > generate new token (access key) secretkey= scaleway > api token > generate new token (your ornisation id) nameBucket= scaleway > object storage > create bucket > bucket name region=fr-par endpoint=https://s3.fr-par.scw.cloud port=numero de port adresse est localhost ## run api cargo run ## Routes /post/ POST: add post /post/{id} GET: get post with post uuid DELETE: delete post with post uuid PUT: put post with post uuid /post/user/{id} GET: get all post with user uuid DELETE: delete all post with uuid user /image/{author}/{post} GET: return image in base 64 with uuid author and uuid photo ## POSTMAN requete: https://www.getpostman.com/collections/c0e2007560ad56852e67
77cdd092-0a1f-4c7e-b1f1-d12c97052f80
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-18 06:47:43", "repo_name": "ArchkWay/brewmapp", "sub_path": "/app/src/main/java/com/brewmapp/execution/task/RegisterTask.java", "file_name": "RegisterTask.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "1906154a33b0ecf71900a16209314488984ef530", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ArchkWay/brewmapp
226
FILENAME: RegisterTask.java
0.284576
package com.brewmapp.execution.task; import java.util.concurrent.Executor; import javax.inject.Inject; import com.brewmapp.execution.exchange.common.Api; import com.brewmapp.execution.exchange.request.base.WrapperParams; import com.brewmapp.execution.exchange.response.UserResponse; import com.brewmapp.execution.task.base.BaseNetworkTask; import ru.frosteye.ovsa.execution.executor.MainThread; import io.reactivex.Observable; /** * Created by oleg on 26.07.17. */ public class RegisterTask extends BaseNetworkTask<WrapperParams, UserResponse> { @Inject public RegisterTask(MainThread mainThread, Executor executor, Api api) { super(mainThread, executor, api); } @Override protected Observable<UserResponse> prepareObservable(WrapperParams params) { return Observable.create(subscriber -> { try { UserResponse response = executeCall(getApi().register(params)); subscriber.onNext(response); subscriber.onComplete(); } catch (Exception e) { subscriber.onError(e); } }); } }
d1a446fd-855e-4d35-8e3d-ca9c8da9e4f3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-26 06:48:04", "repo_name": "372473552/MyLab", "sub_path": "/hello world/src/Calendar/Table.java", "file_name": "Table.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "74f0fd1068a15a7b2b18015b41c54e1b80d8bdcd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/372473552/MyLab
254
FILENAME: Table.java
0.272025
package Calendar; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; public class Table { public enum week{Mon,Tue,Wed,Thur,Fri,Sat,Sun;} public static void main(String[] args) { List<ArrayList> tt=new ArrayList<>(); SimpleDateFormat sdf; Date prevD,nextD; List row1=new ArrayList(); for(int i=0;i<week.values().length;i++) { row1.add(week.values()[i]); } // String strDate=br.readLine(); // sdf=new SimpleDateFormat("yyMMdd"); // prevD=new Date(2019,sdf.parse(strDate).getMonth(),1); // nextD=new Date(2019,sdf.parse(strDate).getMonth()+1,1); // Calendar ca1=Calendar.getInstance(); Calendar ca2=Calendar.getInstance(); ca2.setTime(new Date()); System.out.println(ca2.DAY_OF_MONTH); } }
637e0cb3-18df-4fb1-8125-808fadfd561f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-03 10:03:46", "repo_name": "libin1993/nbl", "sub_path": "/4GHot/app/src/main/java/com/doit/net/Model/DBScanFcn.java", "file_name": "DBScanFcn.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 68, "lang": "en", "doc_type": "code", "blob_id": "b1bbf4b7cbfc481af0367961ff50e87e6dffd70b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/libin1993/nbl
321
FILENAME: DBScanFcn.java
0.242206
package com.doit.net.Model; import org.xutils.db.annotation.Column; import org.xutils.db.annotation.Table; /** * Author:Libin on 2020/7/13 09:56 * Email:1993911441@qq.com * Describe:扫网频点 */ @Table(name = "scan_fcn") public class DBScanFcn { @Column(name = "id", isId = true) private int id; @Column(name = "fcn") private int fcn; @Column(name = "is_check") private int isCheck; @Column(name = "status") private int status; public DBScanFcn(int fcn, int isCheck, int status) { this.fcn = fcn; this.isCheck = isCheck; this.status = status; } public DBScanFcn() { } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getFcn() { return fcn; } public void setFcn(int fcn) { this.fcn = fcn; } public int isCheck() { return isCheck; } public void setCheck(int isCheck) { this.isCheck = isCheck; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } }
7a51031b-112c-4738-b7a2-034141b200b1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-09 00:14:02", "repo_name": "zuku0404/FileManager", "sub_path": "/src/main/java/consumer/FileConsumerImpl.java", "file_name": "FileConsumerImpl.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ddff5a56d8d0f274de92e545ab47f63239870ce3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zuku0404/FileManager
220
FILENAME: FileConsumerImpl.java
0.26588
package consumer; import services.IFileService; import java.io.File; import java.util.List; import java.util.Optional; public class FileConsumerImpl implements IFileConsumer { private IFileService iFileService; public FileConsumerImpl(IFileService iFileService) { this.iFileService = iFileService; } @Override public void getByName(String name, String sourcePath, String targetPath) { iFileService.getByName(name, sourcePath, targetPath); } @Override public Optional<File> findByName(String name, String sourcePath) { return iFileService.findByName(name, sourcePath); } @Override public List<File> findAll(String sourcePath) { return iFileService.findAll(sourcePath); } @Override public void deleteByName(String name, String sourcePath) { iFileService.deleteByName(name, sourcePath); } @Override public void clearAll(String sourcePath) { iFileService.clearAll(sourcePath); } }
3f65d19b-415a-4e48-9f78-e91d0882b521
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-04 03:48:11", "repo_name": "fl-w/teach-hub", "sub_path": "/src/main/java/com/itsfolarin/teachhub/backend/service/UserService.java", "file_name": "UserService.java", "file_ext": "java", "file_size_in_byte": 1061, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "7df2bb794675cba3448fc0a570146c6c926bba11", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fl-w/teach-hub
172
FILENAME: UserService.java
0.20947
package com.itsfolarin.teachhub.backend.service; import com.itsfolarin.teachhub.backend.domain.User; import com.itsfolarin.teachhub.backend.repo.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import java.util.Optional; @Service public class UserService implements UserDetailsService { private final UserRepository userRepository; @Autowired public UserService(UserRepository userRepository) { this.userRepository = userRepository; } @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { return userRepository.loadUserByUsername(username); } public Optional<User> findByUserName(String username) { return userRepository.findByUsername(username); } }
89343704-59c5-45f1-9a6b-927e07554ea9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-16 22:50:37", "repo_name": "samuraiseoul/starbot", "sub_path": "/src/main/java/bot/Rules/DirectMessageRules/ImageRule.java", "file_name": "ImageRule.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "c0b5842bd7b9e4294fcc6ed1d2f4fcd359aade1d", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/samuraiseoul/starbot
219
FILENAME: ImageRule.java
0.259826
package bot.Rules.DirectMessageRules; import bot.Helpers.GoogleImageHelper; import com.ullink.slack.simpleslackapi.SlackSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.io.IOException; @Component public class ImageRule extends AbstractDirectMessageRule { private final GoogleImageHelper googleImageHelper; @Autowired public ImageRule(final GoogleImageHelper googleImageHelper) { this.googleImageHelper = googleImageHelper; } @Override public boolean canHandle(final String msg, final String botId, final boolean isDirect) { return super.canHandle(msg, botId, isDirect) && msg.contains("image me"); } @Override public String handle(final String msg, final String botId, SlackSession session) { try { return this.googleImageHelper.search(super.handle(msg, botId, session).replace("image me", "").trim()); } catch (IOException e) { e.printStackTrace(); } return null; } }
67f9d41d-d8e0-459d-a2b0-9c652afbd728
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-17 08:45:01", "repo_name": "peeyoosh20/Demo-hibe", "sub_path": "/src/main/java/org/example/Alien.java", "file_name": "Alien.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "d8ea0c765b8bd698183f798e4675d179a2640f82", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/peeyoosh20/Demo-hibe
280
FILENAME: Alien.java
0.268941
package org.example; import javax.persistence.*; import java.util.ArrayList; import java.util.List; @Entity() //@Table(name = "alien_table") public class Alien { @Id private int aId; //@Transient private AlienName aName; //@Column(name = "alien_color") private String color; @ManyToMany private List<Laptop> laptops=new ArrayList<>(); public List<Laptop> getLaptop() { return laptops; } public void setLaptop(List<Laptop> laptop) { this.laptops = laptops; } public int getaId() { return aId; } public void setaId(int aId) { this.aId = aId; } public AlienName getaName() { return aName; } public void setaName(AlienName aName) { this.aName = aName; } public String getColor() { return color; } @Override public String toString() { return "Alien{" + "aId=" + aId + ", aName=" + aName + ", color='" + color + '\'' + ", laptop=" + laptops + '}'; } public void setColor(String color) { this.color = color; } }
6d97d360-746e-4723-aa4c-b473f368c547
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-06 06:52:21", "repo_name": "raika11/-", "sub_path": "/moka-core/moka-core-tps/src/main/java/jmnet/moka/core/tps/common/code/AnswerRelDivCode.java", "file_name": "AnswerRelDivCode.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "53054ee4b77d7ac2642a8ff98b3cb95c531a48ff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/raika11/-
282
FILENAME: AnswerRelDivCode.java
0.291787
/* * Copyright (c) 2017 Joongang Ilbo, Inc. All rights reserved. */ package jmnet.moka.core.tps.common.code; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import jmnet.moka.common.utils.MapBuilder; /** * Description: 시민마이크 답변 부가정보의 타입 * * @author ssc * @since 2021-01-26 */ public enum AnswerRelDivCode { NONE("", "단문"), IMAGE("I", "이미지"), MOVIE("M", "동영상"), ARTICLE("A", "기사"); private String code; private String name; AnswerRelDivCode(String code, String name) { this.code = code; this.name = name; } public String getCode() { return code; } public String getName() { return name; } public static List<Map<String, Object>> toList() { return Arrays .stream(AnswerRelDivCode.values()) .map(statusCode -> MapBuilder .getInstance() .add("code", statusCode.code) .add("name", statusCode.name) .getMap()) .collect(Collectors.toList()); } }
a9e3fa66-dd3e-47bd-988d-c5bdc6ba18d6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-07 14:36:00", "repo_name": "ssvaghasiya/AllProject", "sub_path": "/Shopkeeper/app/src/main/java/com/example/shopkeeper/ui/models/Transfer_Model.java", "file_name": "Transfer_Model.java", "file_ext": "java", "file_size_in_byte": 1231, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "83f7d23e8f4d794bcffbd501ef402fd91e02401a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ssvaghasiya/AllProject
259
FILENAME: Transfer_Model.java
0.262842
package com.example.shopkeeper.ui.models; import java.io.Serializable; public class Transfer_Model implements Serializable { int id; String item_name; int quantity; float price; public Transfer_Model(int id, String item_name, int quantity, float price) { this.id = id; this.item_name = item_name; this.quantity = quantity; this.price = price; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getItem_name() { return item_name; } public void setItem_name(String item_name) { this.item_name = item_name; } public int getQuantity() { return quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public float getPrice() { return price; } public void setPrice(float price) { this.price = price; } @Override public String toString() { return "Transfer_Model{" + "id=" + id + ", item_name='" + item_name + '\'' + ", quantity=" + quantity + ", price=" + price + '}'; } }
1a935898-3993-4203-8f01-13199a5689ab
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-13 09:16:47", "repo_name": "praveenit219/quarkus_jaxrs", "sub_path": "/src/main/java/com/pheonix/pojo/JwtRequest.java", "file_name": "JwtRequest.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "226db87072773f6a5e547ba91ef8fd27e5a6f0de", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/praveenit219/quarkus_jaxrs
268
FILENAME: JwtRequest.java
0.279042
package com.pheonix.pojo; import java.util.Map; public class JwtRequest { private String issuer; private String subject; private Map<String, Object> claims; private int jwtExpiryInDays; public JwtRequest() {} public JwtRequest(String issuer, String subject, Map<String, Object> claims, int jwtExpiryInDays) { super(); this.issuer = issuer; this.subject = subject; this.claims = claims; this.jwtExpiryInDays = jwtExpiryInDays; } public int getJwtExpiryInDays() { return jwtExpiryInDays; } public void setJwtExpiryInDays(int jwtExpiryInDays) { this.jwtExpiryInDays = jwtExpiryInDays; } public String getIssuer() { return issuer; } public void setIssuer(String issuer) { this.issuer = issuer; } public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } public Map<String, Object> getClaims() { return claims; } public void setClaims(Map<String, Object> claims) { this.claims = claims; } }
0b854574-7eb1-49f6-8251-0bc45c4a1c73
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-10 01:37:11", "repo_name": "salahaz/DJ2", "sub_path": "/src/dj2/core/Node.java", "file_name": "Node.java", "file_ext": "java", "file_size_in_byte": 990, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "3ab017e54c33a20abd716056c788b48b63bfa167", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/salahaz/DJ2
254
FILENAME: Node.java
0.291787
package dj2.core; /** * The Node that makes elements which the linked list is made of * @author Salah Eddine Azekour * * @param <T> It is any type that extends methods from Performable */ public class Node<T extends Performable> { protected T node; protected Node<T> next; protected Node<T> previous; /** * The class takes a node date, to create a node * @param node the piece that is considerd an element in a linked list */ public Node (T node) { this.node = node; next = previous = null; } /** * Overrides the Object class toString() to display the contents of a Node * @return {String} The information to be returned back to the user */ public String toString() { return node.toString(); } /** * Plays the node */ public void play() { node.play(); } /** * Returns the title back to the user */ public String getTitle() { return node.getTitle(); } public T getNode() { return node; } public Node<T> getNext() { return next; } }
d429d666-1d68-4ac8-a4c9-43538056dd8c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-23 15:01:19", "repo_name": "PayneYu/e-commerce", "sub_path": "/e-commerce-quartz/src/main/java/com/ecommerce/quartz/service/impl/SysJobLogServiceImpl.java", "file_name": "SysJobLogServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "57a21efe5bd2a2729961c3183a81ed1b3ae4fe88", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/PayneYu/e-commerce
273
FILENAME: SysJobLogServiceImpl.java
0.253861
package com.ecommerce.quartz.service.impl; import com.ecommerce.framework.base.service.impl.BaseServiceImpl; import com.ecommerce.quartz.entity.SysJobLog; import com.ecommerce.quartz.mapper.SysJobLogMapper; import com.ecommerce.quartz.service.ISysJobLogService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * 定时任务调度日志信息 服务层 * * @author huizhe yu */ @Service public class SysJobLogServiceImpl extends BaseServiceImpl<SysJobLog, SysJobLogMapper> implements ISysJobLogService { @Autowired private SysJobLogMapper jobLogMapper; /** * 获取quartz调度器日志的计划任务 * * @param jobLog * 调度日志信息 * @return 调度任务日志集合 */ @Override public List<SysJobLog> selectJobLogList(SysJobLog jobLog) { return jobLogMapper.selectJobLogList(jobLog); } /** * 清空任务日志 */ @Override public void cleanJobLog() { jobLogMapper.cleanJobLog(); } }
7c36e64a-c7a5-48ee-956d-8be7f416c4f4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-01 10:30:04", "repo_name": "luping1994/Tenement", "sub_path": "/app/src/main/java/net/suntrans/tenement/bean/SceneInfo.java", "file_name": "SceneInfo.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "fec69f030ed3f5fe5c144612d6aa3bf602543586", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/luping1994/Tenement
249
FILENAME: SceneInfo.java
0.23231
package net.suntrans.tenement.bean; import android.os.Parcel; import android.os.Parcelable; /** * Created by Looney on 2017/11/15. * Des: */ public class SceneInfo implements Parcelable { public String name; public String id; public String image; public String img_url; @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(this.name); dest.writeString(this.id); dest.writeString(this.image); dest.writeString(this.img_url); } public SceneInfo() { } protected SceneInfo(Parcel in) { this.name = in.readString(); this.id = in.readString(); this.image = in.readString(); this.img_url = in.readString(); } public static final Parcelable.Creator<SceneInfo> CREATOR = new Parcelable.Creator<SceneInfo>() { @Override public SceneInfo createFromParcel(Parcel source) { return new SceneInfo(source); } @Override public SceneInfo[] newArray(int size) { return new SceneInfo[size]; } }; }
dcadcb90-b810-47f9-b1b2-f84984cbe501
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-11 10:29:21", "repo_name": "whatsthebeef/trello-doing", "sub_path": "/app/src/main/java/com/zode64/trellodoing/models/Action.java", "file_name": "Action.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "b552cbcc99be251b9ac581ebd33d27bd77bd1a3d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/whatsthebeef/trello-doing
238
FILENAME: Action.java
0.264358
package com.zode64.trellodoing.models; import com.zode64.trellodoing.utils.TrelloManager; public abstract class Action { public enum Type { CREATE, UPDATE_NAME, MOVE, DELETE } protected int id; protected Card card; protected Type type; protected TrelloManager trello; Action( int id, Type type, Card card, TrelloManager trello ) { this.id = id; this.card = card; this.type = type; this.trello = trello; } public int getId() { return id; } public void setId( int id ) { this.id = id; } public Card getCard() { return card; } public void setCard( Card card ) { this.card = card; } public Type getType() { return type; } public void setType( Type type ) { this.type = type; } public void setType( int type ) { this.type = Type.values()[ type ]; } public abstract boolean perform(); }
77a22832-4622-49f5-b798-b344d22a2862
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-12-03T23:25:04", "repo_name": "sysadmin-sergey/TwoButtonVerilogSimon", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1016, "line_count": 16, "lang": "en", "doc_type": "text", "blob_id": "aa3198fc9b1cdb79caccaa5a78572d09bd176183", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sysadmin-sergey/TwoButtonVerilogSimon
218
FILENAME: README.md
0.26588
# Two Button Verilog Simon This repository was made for an Honors Contract for a class. These verilog files (\*.v) can be compiled together and will result in a simon game that uses two buttons. # TwoToFour.diff This diff file was added to show how the file would be changed to implement 4 buttons rather than two. This diff file shows how to generally change the two button implementation to 2^n buttons by simply changing the differences from four bytes to 2^n bytes. To go to more than four bytes requires more changes on the main file but the diff file outlines the general process to expand the functionality. # The reason for two buttons Originally I had implementations for 4 and 8 buttons but since I have not been able to figure out how to properly wire additional buttons to my board that only has 2 buttons, I have made a 2 button edition so that I would be able to utilize the buttons. A useful resource that I referenced while making this simon game was https://github.com/cemulate/simple-simon.
566175df-d6ed-46bb-91b4-60a99667879d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-11 06:39:34", "repo_name": "xenryjake/StageBot", "sub_path": "/src/main/java/com/xenry/stagebot/audio/AudioPlayerSendHandler.java", "file_name": "AudioPlayerSendHandler.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "e66561b6c1ff45de89bbd5c93e1ec103e47711df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/xenryjake/StageBot
253
FILENAME: AudioPlayerSendHandler.java
0.272799
package com.xenry.stagebot.audio; import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; import com.sedmelluq.discord.lavaplayer.track.playback.AudioFrame; import net.dv8tion.jda.api.audio.AudioSendHandler; import java.nio.ByteBuffer; /** * StageBot created by Henry Blasingame (Xenry) on 5/19/20 * The content in this file and all related files are * Copyright (C) 2020 Henry Blasingame. * Usage of this content without written consent of Henry Blasingame * is prohibited. */ public class AudioPlayerSendHandler implements AudioSendHandler { private final AudioPlayer audioPlayer; private AudioFrame lastFrame; public AudioPlayerSendHandler(AudioPlayer audioPlayer) { this.audioPlayer = audioPlayer; } @Override public boolean canProvide() { lastFrame = audioPlayer.provide(); return lastFrame != null; } @Override public ByteBuffer provide20MsAudio() { return ByteBuffer.wrap(lastFrame.getData()); } @Override public boolean isOpus() { return true; } }
289fd3d8-6dfd-45d2-8957-16ec979539c9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-01 21:09:45", "repo_name": "DenisMartsenyuk/Lab8", "sub_path": "/Server/src/commands/CommandHelp.java", "file_name": "CommandHelp.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "4250d4beca0f0b76990e09fe67e58b5a191a0efd", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/DenisMartsenyuk/Lab8
210
FILENAME: CommandHelp.java
0.295027
package commands; import communication.Response; import java.util.Map; public class CommandHelp extends Command { @Override public String getName() { return "help"; } @Override public String getManual() { return "Вывести справку по всем командам сервера"; } @Override public Response execute() { try { if(context.handlerDatabase.isExistingUser(login, password) == -1) { throw new Exception(); } else { String result = "\n"; for (Map.Entry<String, Command> command : context.handlerCommands.getCommands().entrySet()) { if(!command.getValue().getManual().equals("")) { result = result + command.getKey() + ": " + command.getValue().getManual() + "\n"; } } return new Response(getName(), result); } } catch (Exception e) { return new Response(getName(), "Вы не прошли авторизацию."); } } }
92ea959f-ffee-46b7-a495-e18af2cc81c8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-27 21:10:43", "repo_name": "KarimElshaweish/LinesDriver", "sub_path": "/app/src/main/java/com/example/linesdriver/TabFragment/ContractsFragment.java", "file_name": "ContractsFragment.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "ba4340495c91db75bd946ad1d366c9df99dac1b3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/KarimElshaweish/LinesDriver
180
FILENAME: ContractsFragment.java
0.255344
package com.example.linesdriver.TabFragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.example.linesdriver.Adapter.ContractsAdapter; import com.example.linesdriver.R; public class ContractsFragment extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } RecyclerView rv; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View root= inflater.inflate(R.layout.fragment_contracts, container, false); rv=root.findViewById(R.id.rv); rv.setLayoutManager(new LinearLayoutManager(getContext())); rv.setHasFixedSize(true); ContractsAdapter adapter=new ContractsAdapter(getContext()); rv.setAdapter(adapter); return root; } }
d9096a15-4959-412c-ac20-b3aff0b27b80
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-11 14:05:06", "repo_name": "wangzhihaoaini/javaweb_news", "sub_path": "/src/com/zr/news/framework/JdbcDao.java", "file_name": "JdbcDao.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "7356bb8da0f8aefdbdd105e1015156c302612c15", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wangzhihaoaini/javaweb_news
187
FILENAME: JdbcDao.java
0.236516
package com.zr.news.framework; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Connection; public class JdbcDao { private static String driveClassName="com.mysql.jdbc.Driver"; private static String url="jdbc:mysql://localhost:3306/newsdb"; private static String user="root"; private static String password="wzh123456..."; private static Connection conn; public static Connection getConnection(){ try { Class.forName(driveClassName); conn=DriverManager.getConnection(url,user,password); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } return conn; } public static void closeConnection(){ if(conn!=null){ try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } }
b94e30ed-865a-4da1-8f77-6eedbf0a63a3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-28 00:02:09", "repo_name": "Alexander-Rodrigues/GestorSociosDS", "sub_path": "/src/visual/Warning.java", "file_name": "Warning.java", "file_ext": "java", "file_size_in_byte": 1103, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "eedf2b5025682dfa9da8d498837f7ceeb6e55689", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Alexander-Rodrigues/GestorSociosDS
251
FILENAME: Warning.java
0.286968
package visual; import java.awt.EventQueue; import javax.swing.JFrame; import java.awt.BorderLayout; import javax.swing.JLabel; import javax.swing.SwingConstants; public class Warning { private JFrame frmWarning; private String warning; /** * Launch the application. */ public static void newWarning(String message) { EventQueue.invokeLater(new Runnable() { @Override public void run() { try { Warning window = new Warning(message); window.frmWarning.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public Warning(String message) { warning = message; initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { frmWarning = new JFrame(); frmWarning.setAutoRequestFocus(true); frmWarning.setResizable(false); frmWarning.setBounds(50, 50, 300, 150); JLabel lblNewLabel = new JLabel(warning); lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER); frmWarning.getContentPane().add(lblNewLabel, BorderLayout.CENTER); } }
e4229049-f023-4065-a965-e426ba04b893
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-15 22:04:32", "repo_name": "MSD-ET/Security_API", "sub_path": "/Security_API/src/main/java/com/bah/api/ServiceAPI.java", "file_name": "ServiceAPI.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "5d1c37db1001077795cbc28fc3d93eadd85486e8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MSD-ET/Security_API
209
FILENAME: ServiceAPI.java
0.249447
package com.bah.api; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Random; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/") public class ServiceAPI { String apiHost = System.getenv("API_HOST"); String apiURL = "http://" + apiHost + "/api/customers"; public static long instanceId = new Random().nextInt(); public static int count = 0; @GetMapping public String healthCheck() { System.out.println("Health Check"); count += 1; Date date = new Date(); String dateformat = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.SHORT, SimpleDateFormat.FULL).format(date); return "<h3>The Authentication service is up and running!</h3>" + "<br/>Instance: " + instanceId + ", " + "<br/>DateTime: " + dateformat + "<br/>CallCount: "+count; } }
2c1bb3a3-699c-47c9-baa7-6fa17059d49e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-25 06:42:58", "repo_name": "with-ever/web-with-ever", "sub_path": "/src/main/java/kr/whenever/controller/notice/WSNoticeController.java", "file_name": "WSNoticeController.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "1f5505cfed0f068fef6417e4979e5d61c5782aca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/with-ever/web-with-ever
205
FILENAME: WSNoticeController.java
0.267408
package kr.whenever.controller.notice; import java.util.List; import kr.whenever.domain.Notice; import kr.whenever.service.NoticeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @Controller @RequestMapping(value = "/ws/notice") public class WSNoticeController { @Autowired private NoticeService noticeService; @RequestMapping(value = "/list", method = RequestMethod.GET) public @ResponseBody List<Notice> getNoticeList(){ // List<Notice> notices = this.noticeService.findNoticeList(); return notices; } @RequestMapping(value = "/{id}", method = RequestMethod.GET) public @ResponseBody Notice getNotice( @PathVariable(value = "id") Long id ){ // Notice notice = this.noticeService.findNotice(id); return notice; } }
92d11640-4f9b-49fd-88e2-9b1df9c43985
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-08-08 09:46:05", "repo_name": "jaiiye/ddd", "sub_path": "/ui/web/src/test/java/cn/ddd/core/tools/ModuleTest.java", "file_name": "ModuleTest.java", "file_ext": "java", "file_size_in_byte": 1241, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "d8521aeb3f5f75631bfc4c2720884186f174f28d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jaiiye/ddd
218
FILENAME: ModuleTest.java
0.261331
package cn.ddd.core.tools; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.TransactionConfiguration; import org.springframework.transaction.annotation.Transactional; import cn.ddd.core.security.domain.Module; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "/spring-base.xml", "/spring-data.xml" }) @TransactionConfiguration(transactionManager = "txManager", defaultRollback = false) public class ModuleTest { @Autowired private SessionFactory factory; @Test @Transactional public void testInsert() { Module internal = new Module(); internal.setTitle("用户管理"); internal.setName("user"); internal.setLink("user/index"); internal.addAction("view"); internal.addAction("create"); internal.addAction("update"); internal.addAction("delete"); Session session = factory.getCurrentSession(); session.save(internal); } }
dd2ecf08-db30-4d6c-8a0d-434f5922e5b1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-12 09:56:01", "repo_name": "DanielWeiser12/HeyCar", "sub_path": "/src/database/DbConnectionUtils.java", "file_name": "DbConnectionUtils.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "867a7000e5f107a19e39087733b0d39d433ce818", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/DanielWeiser12/HeyCar
204
FILENAME: DbConnectionUtils.java
0.277473
package database; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; /** * This class creates the connection to the database. * * @author Mohammed Al-Ashtal, Daniel Weiser * */ public final class DbConnectionUtils { private static Connection connection; private DbConnectionUtils() { } private static void createConnectionToDatabase() { try { Class.forName("org.h2.Driver"); connection = DriverManager.getConnection("jdbc:h2:./res/MoeDanHeyCar", "", ""); } catch (ClassNotFoundException e) { System.err.println("The Database driver can not be found!"); e.printStackTrace(); } catch (SQLException e) { System.err.println("The connection to the Database failed! Do you have allready an open connection to it?"); } } public static Connection getDatabaseConnection() { if (connection == null) { createConnectionToDatabase(); } return connection; } }
719a33dc-ba4f-4f05-8ff8-32a61f8e982d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-07 15:23:25", "repo_name": "saketkumar1/hackCBS3.0", "sub_path": "/app/src/main/java/com/example/hackcbs30/MobileContactObject.java", "file_name": "MobileContactObject.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "c16fa93bb862236dec834574a30ac8f243f63b58", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/saketkumar1/hackCBS3.0
216
FILENAME: MobileContactObject.java
0.229535
package com.example.hackcbs30; import java.io.Serializable; public class MobileContactObject implements Serializable { private String uid, name, phone, notificationKey; private Boolean selected = false; public MobileContactObject(String uid){ this.uid = uid; } public MobileContactObject(String uid, String name, String phone){ this.uid = uid; this.name = name; this.phone = phone; } public String getUid() { return uid; } public String getPhone() { return phone; } public String getName() { return name; } public String getNotificationKey() { return notificationKey; } public Boolean getSelected() { return selected; } public void setName(String name) { this.name = name; } public void setNotificationKey(String notificationKey) { this.notificationKey = notificationKey; } public void setSelected(Boolean selected) { this.selected = selected; } }
27dfff57-b4dd-4241-9012-1faf95b6c693
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-26 07:19:24", "repo_name": "ump90/JavaProject", "sub_path": "/WebDemo4/src/main/java/com/itheima/edu/web/servlet/DelBrandsServlet.java", "file_name": "DelBrandsServlet.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "9cf726a4ad4d567971155a23c2e2f048ca25d212", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ump90/JavaProject
219
FILENAME: DelBrandsServlet.java
0.290176
package com.itheima.edu.web.servlet; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.itheima.edu.mapper.BrandMapper; import com.itheima.edu.pojo.Brand; import com.itheima.edu.service.BrandService; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.annotation.*; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @WebServlet(name = "DelBrandsServlet", value = "/api/delByIds") public class DelBrandsServlet extends BrandServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject jsonObject = getJson(request); List<Brand> list = JSONArray.parseArray(jsonObject.get("multipleSelection").toString(), Brand.class); BrandService brandService = new BrandService(); brandService.delByIds(list); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doGet(request, response); } }
035be842-9401-46b8-a379-b4aa76da7d48
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-16 18:46:58", "repo_name": "OIMA/Classrooms-Mapping", "sub_path": "/Codigo Fuente/Aulas/src/main/java/coordinacion/sistemas/aulas/model/ValidarPlan.java", "file_name": "ValidarPlan.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "c7f28ca32d2efc683b78f5e153f1b2671605653a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/OIMA/Classrooms-Mapping
248
FILENAME: ValidarPlan.java
0.290176
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package coordinacion.sistemas.aulas.model; import coordinacion.sistemas.aulas.entities.CatalogoPlanes; import org.springframework.ui.Model; /** * * @author OIMA */ public class ValidarPlan extends AbstractError{ @Override public boolean validateForm(Model m, Object entidad) { boolean isValid = true; CatalogoPlanes plan = (CatalogoPlanes) entidad; if (isNull(plan.getNombrePlan())) { m.addAttribute("errorNombre","El nombre del plan no puede ser nulo"); isValid = false; } else if (isMoreThan(plan.getNombrePlan(), 20)) { m.addAttribute("errorNombre","El nombre debe contener maximo 20 letras"); isValid = false; } return isValid; } @Override public boolean isDuplicated(Object o) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }
1ea444e1-4f7f-4d86-9684-25816b952264
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-03-10T15:11:47", "repo_name": "Spidey01/rpigo-server", "sub_path": "/INSTALL.md", "file_name": "INSTALL.md", "file_ext": "md", "file_size_in_byte": 984, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "cb750c19f1c68713206ce6432ebbd92d6cf5958b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Spidey01/rpigo-server
242
FILENAME: INSTALL.md
0.256832
For general info run `make help` in this directory. Here's a snapshot of it: $ make help Available targets and variables are as follows: * help: You're reading it. * install: Install to /usr/local * uninstall: uninstall files but leave /etc/xdg/rpigo * purge: uninstall + purge /etc/xdg/rpigo * useradd: do a useradd for rpigo. * userdel: do a userdel for rpigo. You can change install location by setting PREFIX=yourpath. I.e.$ make PREFIX=/usr install DESTDIR will be respected as expected if given. RPIGO_USERNAME can be set to the username to run as. The useradd, userdel, and various install dependencies will respect this variable. In most cases you probably want to do this as root: # make useradd install # update-rc.d rpigo defaults # service rpigo start If you're not root then prefix the commands with sudo. If that doesn't work then contact your real system admin 8-).
6b4d4e2a-99a7-45c8-ab7a-5d35092776a5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-09 12:05:50", "repo_name": "akarengin/Repair-Service", "sub_path": "/src/main/java/com/enginakar/models/Phone.java", "file_name": "Phone.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "2ce6860aca9cec83fb9221ce040371e1db8c48e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/akarengin/Repair-Service
298
FILENAME: Phone.java
0.288569
package com.enginakar.models; import java.io.Serializable; import java.util.Calendar; import javax.persistence.MappedSuperclass; @MappedSuperclass public class Phone extends Product implements Serializable { private static final long serialVersionUID = 1L; private String adaptor; public void changedBasicPart(Product product) { if (((Phone) product).getAdaptor() != "") { product.setPiece("adaptor"); } } public int pieceChargeAndFixedDate() { Calendar calendarDate = Calendar.getInstance(); date = calendarDate.getTime(); int pieceCharge = 0; switch (piece) { case ("adaptor"): pieceCharge = 60; calendarDate.add(Calendar.MONTH, 10); break; case ("battery"): pieceCharge = 100; calendarDate.add(Calendar.YEAR, 1); break; case ("touchScreen"): pieceCharge = 140; calendarDate.add(Calendar.YEAR, 2); break; case ("receiver"): pieceCharge = 90; calendarDate.add(Calendar.YEAR, 5); break; } repairDate = calendarDate.getTime(); return pieceCharge; } public String getAdaptor() { return adaptor; } public void setAdaptor(String adaptor) { this.adaptor = adaptor; } }
328875de-26d9-49ee-b208-52e0caca49e1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-07-04 03:44:38", "repo_name": "atendrasuri/JavaDSAlgo", "sub_path": "/src/main/java/com/suri/java/concurrency/ProducerConsumer.java", "file_name": "ProducerConsumer.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "a071625d9326654966d2252b069cdc24dd3bbbee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/atendrasuri/JavaDSAlgo
265
FILENAME: ProducerConsumer.java
0.27048
package com.suri.java.concurrency; import java.util.Arrays; import java.util.List; /** * @Author: Atendra Kumar - FT2 - Sapient * @Current-Version: 1.0.0 * @Creation-Date: 11/10/18 * @Description: (Overwrite) * 1. Please describe the business usage of the class. * 2. Please describe the technical usage of the class. * @History: */ public class ProducerConsumer { private String value = ""; private volatile boolean hasValue = false; public void produce(String value) { while (hasValue) { try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } } System.out.println("Producing " + value + " as the next consumable"); this.value = value; hasValue = true; } public String consume() { while (!hasValue) { try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } } String value = this.value; hasValue = false; System.out.println("Consumed " + value); return value; } }
7e4ca062-0d25-4b88-bc97-6d82dee3a421
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-21 13:36:38", "repo_name": "554197854/Springboot-Security-Project", "sub_path": "/src/test/java/com/springboot/security/SecurityApplicationTests.java", "file_name": "SecurityApplicationTests.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "8560483db1a379e026585b06b60994d36ce4297b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/554197854/Springboot-Security-Project
178
FILENAME: SecurityApplicationTests.java
0.243642
package com.springboot.security; import com.springboot.security.bean.Menu; import com.springboot.security.dao.UserMapper; import com.springboot.security.service.MenuService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.util.List; @RunWith(SpringRunner.class) @SpringBootTest public class SecurityApplicationTests { // @Autowired // UserMapper userMapper; @Autowired MenuService menuService; @Test public void contextLoads() { // System.out.println(userMapper.selectByUsername("ni")); List<Menu> allMenu = menuService.getAllMenu(); System.out.println(allMenu.size()); for (Menu menu : allMenu) { System.out.println(menu.getPath()); System.out.println(menu.getRoles()); } } }
bea70e26-5947-4cbd-98f5-472f87f1526b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-27 13:21:34", "repo_name": "chen-hs/mobliesafe", "sub_path": "/app/src/main/java/cn/itcast/mobliesafe/SetUp1Activity.java", "file_name": "SetUp1Activity.java", "file_ext": "java", "file_size_in_byte": 1011, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "453d2fadeb319f5eaef1901f225ccb4cb140d687", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/chen-hs/mobliesafe
197
FILENAME: SetUp1Activity.java
0.203075
package cn.itcast.mobliesafe; import android.os.Bundle; import android.support.annotation.Nullable; import android.widget.RadioButton; import android.widget.Toast; public class SetUp1Activity extends BaseSetUpActivity { private RadioButton mRb_first; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_setup1); initView(); initData(); initListener(); } private void initView() { // 设置第一个小圆点的颜色 mRb_first=((RadioButton) findViewById(R.id.rb_first)); } private void initData(){ mRb_first.setChecked(true); } private void initListener(){ } @Override public void showNext() { startActivityAndFinishSelf(SetUp2Activity.class); } @Override public void showPre() { Toast.makeText(this, "当前页面已经是第一页", Toast.LENGTH_SHORT).show(); } }
b6a11204-e28c-44ae-a294-262420862694
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-17 18:58:34", "repo_name": "ottoszika/sokoban", "sub_path": "/core/src/main/java/com/ottoszika/sokoban/screens/PlayScreen.java", "file_name": "PlayScreen.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "08bb17c59414dfb6d4356536446c6aca3d7b53ad", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ottoszika/sokoban
246
FILENAME: PlayScreen.java
0.279828
package com.ottoszika.sokoban.screens; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL20; import com.ottoszika.sokoban.Sokoban; import com.ottoszika.sokoban.engine.GameEngine; public class PlayScreen extends AbstractScreen { /** * Game reference. */ private Sokoban game; /** * Game engine. */ private GameEngine gameEngine; /** * Play screen constructor. * * @param game the game instance. * @param gameEngine the game flow. */ public PlayScreen(Sokoban game, GameEngine gameEngine) { this.game = game; this.gameEngine = gameEngine; } /** * Render callback. * * @param delta the amount of time from the last rendered frame. */ @Override public void render(float delta) { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); this.game.getSpriteBatch().begin(); gameEngine.draw(game.getSpriteBatch()); this.game.getSpriteBatch().end(); } }
f937c694-fba7-4667-a419-f18b95038fee
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-22 07:03:31", "repo_name": "fidusio/zoxweb-core", "sub_path": "/src/test/java/org/zoxweb/shared/http/HTTPServerConfigTest.java", "file_name": "HTTPServerConfigTest.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "900fa961fc68d5792f687ca14dee5a6d795b9b78", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/fidusio/zoxweb-core
238
FILENAME: HTTPServerConfigTest.java
0.290981
package org.zoxweb.shared.http; import java.io.IOException; import java.util.Arrays; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.zoxweb.server.io.IOUtil; import org.zoxweb.server.util.GSONUtil; import org.zoxweb.shared.util.ArrayValues; import org.zoxweb.shared.util.SharedUtil; public class HTTPServerConfigTest { private static String ENV_VAR; @BeforeAll public static void init() { ENV_VAR = System.getenv("ENV_VAR"); } @Test public void valueChecks() throws IOException { System.out.println(System.getProperties()); HTTPServerConfig hsc = GSONUtil.fromJSON(IOUtil.inputStreamToString(ENV_VAR), HTTPServerConfig.class); System.out.println(hsc); System.out.println(hsc.getConnectionConfigs()); for (HTTPEndPoint ep : hsc.getEndPoints()) { System.out.println(ep.getMethods().getClass() + " " + Arrays.toString(ep.getMethods())); System.out.println(SharedUtil.toCanonicalID(',', ep.getName(), ep.getBean())); System.out.println(ep); } } }
ea9baf76-fe8c-4152-bb7a-8995ef378b08
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-28 18:45:22", "repo_name": "sabanhaim/server_java_client_c-_project", "sub_path": "/server/src/main/java/protocol/tbgp/TBGPUser.java", "file_name": "TBGPUser.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "538aed71a44d1093524f76c061554f9e5b5199ff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sabanhaim/server_java_client_c-_project
222
FILENAME: TBGPUser.java
0.255344
package protocol.tbgp; import java.io.IOException; import java.security.InvalidParameterException; import protocol.ProtocolCallback; import tokenizer.StringMessage; public class TBGPUser { private final String nickname; private final ProtocolCallback<StringMessage> callback; private TBGPRoom room; public TBGPUser(String nickname, ProtocolCallback<StringMessage> callback) { super(); this.nickname = nickname; this.callback = callback; this.room = null; } public void setRoom(TBGPRoom room) { if (this.room != null) { throw new InvalidParameterException(); } this.room = room; } public String getNickname() { return nickname; } public TBGPRoom getRoom() { return this.room; } public void sendMessage(TBGPMessage msg) { try { callback.sendMessage(new StringMessage(msg.toString())); } catch (IOException e) { System.out.print("IOException occurred when sending message to client " + this.nickname + ": "); e.printStackTrace(); } } }
a0d0d71b-92b1-4363-bd2b-a3a72fa3025b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-05-20T21:09:57", "repo_name": "ethanreeder/newlanginterpreter", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1153, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "c2feda752084d76804e8a27d918d81db266e7d06", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ethanreeder/newlanginterpreter
221
FILENAME: README.md
0.249447
# newlanginterpreter Interpreter for a novel simple programming language. Syntax is detailed in syntax.txt. Run from top level directory on file 'file.txt' as follows: > python3 interpreter.py -f file.txt Result is printed to stdout. Includes: - An abstract syntax tree of the novel language - Parsing from JSON to python readable format - A full interpreter for the language - Comprehensive errors - Easily expandable parser and interpreter context for tracking function and variable declarations Future plans: - Code structure for variable definition and access exists, and it would be fun to add that! - Context could also include a parsing and interpreting traceback which would make it feel like a real interpreter - Add other flags such as verbosity for detailed information while parsing or interpreting - Add simple terminal shell for easy testing - Could easily add simple lexer in the place of python's JSON library Issues: - bugs with evaluating functions - test cases or test syntax files not included - unittest module had issues with python enum (but would have been very time intensive to create with 3 hr constraint)
b79238b0-a843-4027-ada2-f3e51dab63ab
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-28 07:52:33", "repo_name": "tss0823/platform", "sub_path": "/src/main/java/com/usefullc/platform/common/dto/UserInfoSpringDto.java", "file_name": "UserInfoSpringDto.java", "file_ext": "java", "file_size_in_byte": 1199, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "00726d490409e28f614c3d8b6689161ead38da68", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tss0823/platform
262
FILENAME: UserInfoSpringDto.java
0.228156
/** * */ package com.usefullc.platform.common.dto; import java.util.Collection; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.User; /** * @author tangss * @2013年10月12日 @下午3:03:59 */ public class UserInfoSpringDto extends User { /** * */ private static final long serialVersionUID = 1L; /** * 用户中文名 */ private String cnName; /** * @param username * @param password * @param enabled * @param accountNonExpired * @param credentialsNonExpired * @param accountNonLocked * @param authorities */ public UserInfoSpringDto(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities){ super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); } public void setCnName(String cnName) { this.cnName = cnName; } public String getCnName() { return cnName; } }
98bf83af-0438-4fbe-9dc7-c38c75b35286
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-03 07:29:04", "repo_name": "zhouzhou3516/stjava", "sub_path": "/mybatis/src/main/java/com/zhou/jdbc/abstractdemo/dynamicproxy/ProxyRegister.java", "file_name": "ProxyRegister.java", "file_ext": "java", "file_size_in_byte": 971, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "91f12e032533c1793c8ab7555ec1b3131c9c4fe9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zhouzhou3516/stjava
194
FILENAME: ProxyRegister.java
0.2227
package com.zhou.jdbc.abstractdemo.dynamicproxy; import com.google.common.io.Files; import java.io.File; import java.io.IOException; import java.lang.reflect.Proxy; import java.nio.charset.StandardCharsets; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @author zhuchao on 2017/7/22. */ public class ProxyRegister { private Logger logger = LoggerFactory.getLogger(getClass()); private JdbcInvocationHandler jdbcInvocationHandler = new JdbcInvocationHandler(); public ProxyRegister(String configFile) { try { String content = Files.toString(new File(configFile), StandardCharsets.UTF_8); } catch (IOException e) { e.printStackTrace(); } } public <T> T getInstance(Class clazz) { Object obj = Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[]{clazz}, jdbcInvocationHandler); return (T) obj; } }
fb024056-9d95-4eb3-b379-8dccafaa50c1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-28 16:48:20", "repo_name": "DesireFactions/desirehcf", "sub_path": "/src/main/java/com/desiremc/hcf/validators/PlayerKitOffCooldownValidator.java", "file_name": "PlayerKitOffCooldownValidator.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "cf7596b71fe482b6841222d2670938458bdc7285", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/DesireFactions/desirehcf
218
FILENAME: PlayerKitOffCooldownValidator.java
0.267408
package com.desiremc.hcf.validators; import com.desiremc.core.api.newcommands.Validator; import com.desiremc.core.session.Session; import com.desiremc.core.utils.DateUtils; import com.desiremc.hcf.DesireHCF; import com.desiremc.hcf.session.FSession; import com.desiremc.hcf.session.FSessionHandler; import com.desiremc.hcf.session.HKit; public class PlayerKitOffCooldownValidator implements Validator<HKit> { @Override public boolean validateArgument(Session sender, String[] label, HKit kit) { FSession session = FSessionHandler.getGeneralFSession(sender.getUniqueId()); long cooldown = session.getKitCooldown(kit); if (session.hasKitCooldown(kit)) { DesireHCF.getLangHandler().sendRenderMessage(sender, "kits.has_cooldown", true, false, "{kit}", kit.getName(), "{time}", DateUtils.formatDateDiff(System.currentTimeMillis() + cooldown)); return false; } return true; } }
95da3800-af03-4639-bf4c-01aa7a7ef6f6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-22 10:51:31", "repo_name": "sparkaochong/java-advance-feature", "sub_path": "/src/com/ac/io/TestReader.java", "file_name": "TestReader.java", "file_ext": "java", "file_size_in_byte": 1241, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "193f6939af7bf999f1e37e52d6ab25ae90fe162a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sparkaochong/java-advance-feature
265
FILENAME: TestReader.java
0.285372
package com.ac.io; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.Reader; /** * Description: * <字符输入流> * Created by aochong on 2019/10/20 * * @author aochong * @version 1.0 */ public class TestReader { public static void main(String[] args) { String path = "." + File.separator + "data" + File.separator + "charWriter.txt"; try (Reader reader = new FileReader(path)) { // 读入一组字符 char[] chars = new char[10]; StringBuilder sb = new StringBuilder(); String line = null; // 当 read 方法返回 -1 的时候,表示已经读到文件末尾了 int charNum = -1; while((charNum = reader.read(chars))!=-1){ for(char c: chars){ if('\n'!=c){ sb.append(c); }else{ line = sb.toString(); System.out.println(line); sb = new StringBuilder(); } } chars = new char[100]; } }catch (IOException e){ e.printStackTrace(); } } }
7677e542-484e-43cc-a976-5a78e4a98ff2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-15 12:52:50", "repo_name": "fernandojr999/ecommerce", "sub_path": "/src/test/java/br/com/fernando/ecommerce/cepServiceTest/CepServiceTest.java", "file_name": "CepServiceTest.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "995b65062c989857a832990e99ed5431e1764748", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fernandojr999/ecommerce
260
FILENAME: CepServiceTest.java
0.253861
package br.com.fernando.ecommerce.cepServiceTest; import br.com.fernando.ecommerce.core.address.cep.CepDTO; import br.com.fernando.ecommerce.core.address.cep.CepService; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import static org.junit.jupiter.api.Assertions.assertEquals; @SpringBootTest public class CepServiceTest { @Autowired CepService cepUseCase; @Test public void queryCep_VIACEP_should_return_address_information(){ CepDTO cepDTO = cepUseCase.queryCep("89031490"); assertEquals(cepDTO.getCep(), "89031-490"); assertEquals(cepDTO.getLogradouro(), "Rua Theodoro Lueders"); } @Test public void queryCep_POSTMON_should_return_address_information(){ CepDTO cepDTO = cepUseCase.queryCep("89031490"); assertEquals(cepDTO.getCep(), "89031-490"); assertEquals(cepDTO.getLogradouro(), "Rua Theodoro Lueders"); } }
acebfeca-1dc1-461a-bcea-29fe51069af9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-16 02:47:51", "repo_name": "juanwalker/policy-kafka", "sub_path": "/kafka-policy/src/main/java/com/cognizant/kafkainsurer/model/Policy.java", "file_name": "Policy.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "19f0301c07ceb6a8eb07544888af7abe45c863a0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/juanwalker/policy-kafka
219
FILENAME: Policy.java
0.201813
package com.cognizant.kafkainsurer.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; @Document(collection="policydb") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public class Policy { @Id private String id; private String policyNumber; private String status; public Policy() { } public Policy(String id, String policyNumber ) { this.setId(id); this.setPolicyNumber(policyNumber); } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPolicyNumber() { return policyNumber; } public void setPolicyNumber(String policyNumber) { this.policyNumber = policyNumber; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } }