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 |
|---|---|---|---|---|---|---|
04bd3d3e-77df-4627-a63a-3c7269fff36d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-25 09:18:48", "repo_name": "aisnia/practice", "sub_path": "/java/jdk_practice/src/main/java/queue/MQClient.java", "file_name": "MQClient.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "6ab5246cb1d15985c955866753be2827d06c5f98", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aisnia/practice | 198 | FILENAME: MQClient.java | 0.23092 | package queue;
import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
/**
* @author xiaoqiang
* @date 2020/9/1-21:40
*/
public class MQClient {
public void produce(String message) throws IOException {
Socket socket = new Socket(InetAddress.getLocalHost(), BrokerServer.SERVICE_PORT);
PrintWriter out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));
out.println(message);
out.flush();
}
//消费消息
public String consume() throws IOException {
Socket socket = new Socket(InetAddress.getLocalHost(), BrokerServer.SERVICE_PORT);
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
PrintWriter out = new PrintWriter(socket.getOutputStream());
//先向消息队列发送CONSUME表示消费
out.println("CONSUME");
out.flush();
String msg = in.readLine();
return msg;
}
}
|
c0d77431-361e-4959-ab24-26cc514fd91c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-06-03 16:35:22", "repo_name": "michaelliu624/CMS", "sub_path": "/src/main/java/com.springmvc.cms/service/impl/TeacherPermissionImpl.java", "file_name": "TeacherPermissionImpl.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "b661e7b43b1127d698cdfcc6eeeb8155704f1c6d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/michaelliu624/CMS | 198 | FILENAME: TeacherPermissionImpl.java | 0.245085 | package com.springmvc.cms.service.impl;
import com.springmvc.cms.mapper.SelectTeacherPermissionMapper;
import com.springmvc.cms.mapper.StudentLoginMapper;
import com.springmvc.cms.model.TeacherPermission;
import com.springmvc.cms.service.SelectTeacherService;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author Michael Liu
* @Date 2015-06-03 11:03
*/
@Repository(value = "selectTeacherService")
@Transactional
public class TeacherPermissionImpl implements SelectTeacherService {
@Resource(name = "selectTeacherPermissionMapper")
private SelectTeacherPermissionMapper selectTeacherPermissionMapper;
@Override
public List<TeacherPermission> find(String id) {
String select_teacher_passwd_sql = "select * from teacher_permission where id='"+id+"'";
return this.selectTeacherPermissionMapper.operateReturnBeans(select_teacher_passwd_sql) ;
}
}
|
ae68a16b-1398-4703-b1e6-ddd7f5b00695 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-04-09 14:28:47", "repo_name": "oleaka/domeneparser", "sub_path": "/src/main/java/no/domeneparser/CrawlResultSummary.java", "file_name": "CrawlResultSummary.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "baf476c6cffb90f13e216515d274004ec0c0716c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/oleaka/domeneparser | 244 | FILENAME: CrawlResultSummary.java | 0.292595 | package no.domeneparser;
public class CrawlResultSummary {
public final int numberOfUrls;
public final long unknownWords;
public final long nynorskWords;
public final long bokmaalWords;
public final long englishWords;
public CrawlResultSummary(int numberOfUrls, long unknownWords, long nynorskWords, long bokmaalWords, long englishWords) {
this.numberOfUrls = numberOfUrls;
this.unknownWords = unknownWords;
this.nynorskWords = nynorskWords;
this.bokmaalWords = bokmaalWords;
this.englishWords = englishWords;
}
/*
public final int unknownPages;
public final int nynorskPages;
public final int bokmaalPages;
public final int englishPages;
public CrawlResultSummary(int numberOfUrls, int unknownPages, int nynorskPages, int bokmaalPages, int englishPages) {
this.numberOfUrls = numberOfUrls;
this.unknownPages = unknownPages;
this.nynorskPages = nynorskPages;
this.bokmaalPages = bokmaalPages;
this.englishPages = englishPages;
}
*/
}
|
8fa64e56-0062-456e-a101-3d845a3bfe54 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-03 13:46:20", "repo_name": "Omender123/ImTrade", "sub_path": "/app/src/main/java/com/trade/imtrade/Model/request/ForgetPasswordBody.java", "file_name": "ForgetPasswordBody.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "a0cd03e6b5ee7a64210dba9ded9457a0588b69c1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Omender123/ImTrade | 212 | FILENAME: ForgetPasswordBody.java | 0.193147 | package com.trade.imtrade.Model.request;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class ForgetPasswordBody {
@SerializedName("email")
@Expose
private String email;
@SerializedName("otp")
@Expose
private String otp;
@SerializedName("password")
@Expose
private String password;
public ForgetPasswordBody() {
}
public ForgetPasswordBody(String email, String otp, String password) {
super();
this.email = email;
this.otp = otp;
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getOtp() {
return otp;
}
public void setOtp(String otp) {
this.otp = otp;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
|
3064b833-ecc5-4487-84ff-a47555775c2c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-23 09:07:24", "repo_name": "a514760469/UnderstandJVM", "sub_path": "/src/main/java/com/concurrent/synchronizer/Preloader.java", "file_name": "Preloader.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "57e2f77d9b774b88bf0fcf577f027f85c8877f7d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/a514760469/UnderstandJVM | 226 | FILENAME: Preloader.java | 0.256832 | package com.concurrent.synchronizer;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
/**
* @author zhanglifeng
* @since 2020-06-15 17:37
*/
public class Preloader {
private final FutureTask<ProductInfo> future = new FutureTask<>(new Callable<ProductInfo>() {
@Override
public ProductInfo call() throws DataLoadException {
return loadProductInfo();
}
});
public ProductInfo get() throws InterruptedException, DataLoadException {
try {
return future.get();
} catch (ExecutionException e) {
Throwable cause = e.getCause();
if (cause instanceof DataLoadException)
throw (DataLoadException) cause;
// else
// throw LaunderThrowable.launderThrowable(cause);
}
return null;
}
interface ProductInfo{
}
ProductInfo loadProductInfo() throws DataLoadException {
return null;
}
class DataLoadException extends Exception { }
}
|
e0f65f8b-5910-4bce-a5c7-06aba73c3b2b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-28 17:42:30", "repo_name": "oxovu/SpringMVC", "sub_path": "/src/main/java/ru/Technopolis/TodoUserPrincipal.java", "file_name": "TodoUserPrincipal.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "391faf0cbf580dc26107d0af7dcb170103fd650f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/oxovu/SpringMVC | 205 | FILENAME: TodoUserPrincipal.java | 0.226784 | package ru.Technopolis;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import ru.Technopolis.model.entities.TodoUser;
import java.util.Collection;
public class TodoUserPrincipal implements UserDetails {
private TodoUser user;
public TodoUserPrincipal(TodoUser user) {
this.user = user;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return null;
}
@Override
public String getPassword() {
return user.getPassword();
}
@Override
public String getUsername() {
return user.getName();
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
}
|
91633c02-9226-4ab6-a3fd-908f2c3fdf83 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-31 07:06:48", "repo_name": "sebasbad/guice-async-extension", "sub_path": "/src/main/java/de/skuzzle/inject/async/internal/runnables/LatchLockableRunnable.java", "file_name": "LatchLockableRunnable.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "9191af419b2dd8e875deae27c03d6027f01f8604", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sebasbad/guice-async-extension | 227 | FILENAME: LatchLockableRunnable.java | 0.27513 | package de.skuzzle.inject.async.internal.runnables;
import static com.google.common.base.Preconditions.checkState;
import java.util.concurrent.CountDownLatch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
class LatchLockableRunnable implements LockableRunnable {
private static final Logger LOG = LoggerFactory
.getLogger(LatchLockableRunnable.class);
private final Runnable runnable;
private final CountDownLatch latch;
LatchLockableRunnable(Runnable runnable) {
this.runnable = runnable;
this.latch = new CountDownLatch(1);
}
@Override
public void run() {
try {
this.latch.await();
this.runnable.run();
} catch (final InterruptedException e) {
LOG.error("Interrupted while waiting to begin execution. "
+ "Execution of {} has been skipped.", this.runnable, e);
Thread.currentThread().interrupt();
}
}
@Override
public void release() {
checkState(this.latch.getCount() > 0, "Already released");
this.latch.countDown();
}
}
|
7ed08347-750f-45c2-9ac2-7b26d5b0745c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-24 03:23:48", "repo_name": "xddpool/mmj-cloud", "sub_path": "/mmj-cloud-oauth/src/main/java/com/mmj/oauth/supper/CustomOauthExceptionSerializer.java", "file_name": "CustomOauthExceptionSerializer.java", "file_ext": "java", "file_size_in_byte": 1226, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "1709728c68c9b2189865fae9f92e0a423a2d3146", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xddpool/mmj-cloud | 241 | FILENAME: CustomOauthExceptionSerializer.java | 0.255344 | package com.mmj.oauth.supper;
import java.io.IOException;
import java.util.Map;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
public class CustomOauthExceptionSerializer extends StdSerializer<CustomOauthException> {
/** @Fields serialVersionUID: */
private static final long serialVersionUID = 7229841454129538153L;
public CustomOauthExceptionSerializer() {
super(CustomOauthException.class);
}
@Override
public void serialize(CustomOauthException value, JsonGenerator gen, SerializerProvider provider) throws IOException {
gen.writeStartObject();
gen.writeStringField("code", "-1");
gen.writeStringField("desc", "用户名或密码错误");
if (value.getAdditionalInformation()!=null) {
for (Map.Entry<String, String> entry : value.getAdditionalInformation().entrySet()) {
String key = entry.getKey();
String add = entry.getValue();
gen.writeStringField(key, add);
}
}
gen.writeEndObject();
}
}
|
6a48ad58-400f-4692-b2ef-501506d7909f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-10 22:22:05", "repo_name": "pgaitan1/workspace", "sub_path": "/5thClass/src/functionGenerator/JunitTest.java", "file_name": "JunitTest.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "e28a04483eedfd3804eb0d664ce76e9d03752d93", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pgaitan1/workspace | 260 | FILENAME: JunitTest.java | 0.283781 | package functionGenerator;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class JunitTest {
String firstname = "Paul";
String lastname = "McConnel";
String phonenumber = "2402402400";
String url = "https://www.facebook.com/";
WebDriver driver = new FirefoxDriver();
@Before
public void beforetest(){
driver.navigate().to(url);
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
System.out.println ("I am in the before test");
}
@Test
public void maintest(){
driver.findElement(By.xpath(".//*[@id='u_0_2']")).sendKeys(firstname);
driver.findElement(By.xpath(".//*[@id='u_0_4']")).sendKeys(lastname);
driver.findElement(By.xpath(".//*[@id='u_0_7']")).sendKeys(phonenumber);
System.out.println ("I am in the main test");
}
@After
public void aftertest(){
driver.quit();
System.out.println ("I am in the after test");
}
}
|
33741791-70c2-4f18-9a52-f06bca247bae | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-25 14:01:34", "repo_name": "tomasda/PLAE", "sub_path": "/PortaFirmasFacadeCORE/src/es/apt/ae/facade/entities/DocumentoIndicePk.java", "file_name": "DocumentoIndicePk.java", "file_ext": "java", "file_size_in_byte": 1148, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "a1e3aede63d59e5c08e8b0954d0bbf3058b3fe15", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tomasda/PLAE | 275 | FILENAME: DocumentoIndicePk.java | 0.27048 | package es.apt.ae.facade.entities;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
@Embeddable
public class DocumentoIndicePk implements Serializable {
private static final long serialVersionUID = 7608279801899841257L;
@Column(name = "ADMINISTRATIVE_FILE_ID", nullable = false)
private String idExpediente;
@Column(name = "DOCUMENTO_ID", nullable = false)
private String idDocumento;
public DocumentoIndicePk() {
super();
}
public DocumentoIndicePk(String idExpediente, String idDocumento) {
super();
this.idExpediente = idExpediente;
this.idDocumento = idDocumento;
}
public String getIdExpediente() {
return idExpediente;
}
public void setIdExpediente(String idExpediente) {
this.idExpediente = idExpediente;
}
public String getIdDocumento() {
return idDocumento;
}
public void setIdDocumento(String idDocumento) {
this.idDocumento = idDocumento;
}
@Override
public int hashCode() {
return super.hashCode();
}
@Override
public boolean equals(Object obj) {
return super.equals(obj);
}
} |
2324b55b-722f-4f4b-bd35-0ecad95a89ef | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-07-13T04:42:00", "repo_name": "miskusi/LIRI-BotMaster", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 984, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "771ebe310faaa9321d04261112af95222c66e923", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/miskusi/LIRI-BotMaster | 260 | FILENAME: README.md | 0.286968 | # LIRI Bot
LIRI is a Language Interpretation and Recognition Interface. It will take in commands through the node app and gives you back data.
Commands you can enter:
* `my-tweets`
* `spotify-this-song`
* `movie-this`
* `do-what-it-says`
To Run the LIRI-Bot:
1: node liri.js my-tweets. This will show your last 20 tweets.
2: node liri.js spotify-this-song `<song name here>`
It will show you the following info:
* Artist
* The song's name
* A preview link of the song from spotify
* The album that the song is from
3: node liri.js movie-this `<movie name here>`
* This will output the following information to your terminal/bash window:
* Title of movie.
* Year of the movie.
* IMDB Rating of the movie.
* Country where the movie was produced.
* Language of the movie.
* Plot of the movie.
* Actors
* Rotten Tomatoes Rating.
* Rotten Tomatoes URL.
4: node liri.js do-what-it-says
This will output the command placed in random.txt file
|
392c7d4a-c4ec-48f7-b4f6-7f26a8d20454 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-24 05:11:32", "repo_name": "carpanese/gourmetGame", "sub_path": "/src/main/java/br/com/carpanese/objective/model/Node.java", "file_name": "Node.java", "file_ext": "java", "file_size_in_byte": 1208, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "e5e89f49d67e15c94331272555f345f5519211f1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/carpanese/gourmetGame | 279 | FILENAME: Node.java | 0.259826 | package br.com.carpanese.objective.model;
/**
* Classe de nos para arvore
* @author tiago.carpanese
*
*/
public class Node {
private String description;
private Node left;
private Node right;
public Node (String description) {
this.description = description;
right = null;
left = null;
}
public Node () {
//DEFAULT CONSTRUCTOR
}
/**
* Adiciona um novo no na arvore
* @param parent pai onde sera adicionado o novo no
* @param child no a ser adicionado
* @param left boleano para adicinar na esquerda ou direita
*/
public void add(Node parent, Node child, Boolean left) {
if (left) {
parent.setLeft(child);
} else {
parent.setRight(child);
}
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public void setLeft(Node left) {
this.left = left;
}
public Node getLeft() {
return left;
}
public void setRight(Node right ) {
this.right = right;
}
public Node getRight() {
return right;
}
}
|
1b8e6eb7-e124-4cb4-b151-69c7ea35e6ca | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-02-09T12:38:51", "repo_name": "lucascastejon/go-angular", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 993, "line_count": 45, "lang": "en", "doc_type": "text", "blob_id": "d6f9dea1f45e1f9371c46d9e63c78be67865687b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lucascastejon/go-angular | 265 | FILENAME: README.md | 0.245085 |
# Go - Angular
This is a test application to communicate Angular and Go with Sign-up
### The Go application is in the main.go file
### The Angular application is in the /assets folder
### Run
Just run `go run main.go` and it will start a server at :1357 so enter `localhost:1357` and you'll see the angular application
### Database
It is using PostgreSQL on version (9.3.5).
# requirements
### Install PostgreSQL and Config
Debian:
$ sudo apt-get install postgresql pgadmin3
ArchLinux (manjaro):
$ sudo pacman -S postgresql pgadmin3
User postgres
$ sudo -i -u postgres
Postgres SQL
$ psql
Create melancholia user
$ CREATE ROLE goangular LOGIN SUPERUSER;
Set melancholia password
$ ALTER USER goangular WITH PASSWORD 'an13gul45ar';
Create Database
$ CREATE DATABASE angularjs;
More information: http://bullingox.blogspot.com.br/2014/07/install-postgresql-in-linux.html
### Install GOlang and Config
https://golang.org/doc/install
|
dfa36f5a-457c-418e-8394-0563f9ca2552 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-15 02:26:51", "repo_name": "jpassgo/reactive-java", "sub_path": "/src/main/java/com/pascoe/reactivelearnings/filter/RedirectFilter.java", "file_name": "RedirectFilter.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "766068281163d30e2518eafe32bd30f2244e0c88", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jpassgo/reactive-java | 199 | FILENAME: RedirectFilter.java | 0.183594 | package com.pascoe.reactivelearnings.filter;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
import javax.xml.ws.ServiceMode;
import static org.springframework.web.reactive.function.client.WebClient.*;
public class RedirectFilter implements GlobalFilter {
WebClient webClient;
@Override
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
Mono<ResponseSpec> initialExchange = buildExchange(exchange);
Mono<ResponseSpec> onErrorExchange = buildExchange(exchange);
return initialExchange
.onErrorResume((error) -> {
return onErrorExchange;
})
.then(chain.filter(exchange));
}
Mono<ResponseSpec> buildExchange(ServerWebExchange exchange) {
return Mono.error(Exception::new);
}
}
|
03b13758-370a-41c2-9eda-45ee390de82c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-19 23:32:18", "repo_name": "al3xbr0/configuration-update-automation", "sub_path": "/src/main/java/automation/delegate/docs/GenerateConfluenceTableDelegate.java", "file_name": "GenerateConfluenceTableDelegate.java", "file_ext": "java", "file_size_in_byte": 1149, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "7bbdd6ae78dc9832df4aab0c8444ef5e9883b152", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/al3xbr0/configuration-update-automation | 201 | FILENAME: GenerateConfluenceTableDelegate.java | 0.247987 | package automation.delegate.docs;
import automation.domain.ConfluencePage;
import automation.domain.ProcessVariables;
import automation.service.ConfluenceIntegrationService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component("generateConfluenceTableDelegate")
public class GenerateConfluenceTableDelegate implements JavaDelegate {
@Autowired
private ConfluenceIntegrationService confluenceIntegrationService;
@Override
public void execute(DelegateExecution execution) {
ProcessVariables variables = new ProcessVariables(execution);
String confluenceTable = confluenceIntegrationService.generateConfluenceTable(variables.getRequest().getColumns());
String issueKey = variables.getIssueKey();
String spaceKey = issueKey.substring(0, issueKey.indexOf('-'));
ConfluencePage page = new ConfluencePage(spaceKey, variables.getJsonConfigName(), confluenceTable);
variables.setConfluencePage(page);
}
}
|
4ae585b3-023c-4a71-9093-951d090bc0f0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-22 10:03:22", "repo_name": "deanzd/micro", "sub_path": "/momp-model/src/main/java/com/eking/momp/model/po/ModelRelationPO.java", "file_name": "ModelRelationPO.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "4757a611575cfaff85f4a6b332f08be1b640c17f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/deanzd/micro | 232 | FILENAME: ModelRelationPO.java | 0.228156 | package com.eking.momp.model.po;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eking.momp.mybatis.BasePO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author Dean
* @since 2019-11-21
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("model_relation")
public class ModelRelationPO extends BasePO<ModelRelationPO> {
private static final long serialVersionUID = 1L;
private String code;
private String name;
private Integer relationTypeId;
private Mapping mapping;
private Integer modelId;
private Integer targetModelId;
private Integer modelFieldId;
private String description;
@Getter
public enum Mapping {
OneToOne("1:1"),
OneToMany("1:N"),
ManyToOne("N:1"),
ManyToMany("N:N");
private final String text;
Mapping(String text) {
this.text = text;
}
}
}
|
035cbd01-742c-44e9-83dc-78b620e5c21b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-16 20:28:10", "repo_name": "bcgov/gwa-ui", "sub_path": "/src/main/java/ca/bc/gov/gwa/servlet/developerkey/DeveloperApiServlet.java", "file_name": "DeveloperApiServlet.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "8bf3bca18e6f7e63ba1f67fb9fae678b5db4377b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bcgov/gwa-ui | 195 | FILENAME: DeveloperApiServlet.java | 0.208179 | package ca.bc.gov.gwa.servlet.developerkey;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import ca.bc.gov.gwa.v1.ApiService;
import ca.bc.gov.gwa.servlet.BaseServlet;
import ca.bc.gov.gwa.servlet.authentication.GitHubPrincipal;
@WebServlet(urlPatterns = "/rest/apis", loadOnStartup = 1)
public class DeveloperApiServlet extends BaseServlet {
private static final long serialVersionUID = 1L;
@Override
protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
throws ServletException, IOException {
if (GitHubPrincipal.hasDeveloperRole(request, response)) {
this.apiService.developerApiList(request, response);
} else {
response.setContentType(ApiService.APPLICATION_JSON);
try (
PrintWriter writer = response.getWriter()) {
writer.print("{}");
}
}
}
}
|
16a206de-ac37-4677-a5d1-3d7fe58fa5fb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-09-12T23:03:23", "repo_name": "mrVanDalo/module.krops", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1003, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "e5e4d4fa9c58cd305b322c4b2b0c35f2b5c26310", "star_events_count": 5, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/mrVanDalo/module.krops | 267 | FILENAME: README.md | 0.240775 | # module-krops
A repository to make some jobs using krops nicer.
## keys
```nix
krops.keys."foobar".path = /run/keys/foobar;
```
Will create a service `key.foobar.service` which is not started
until the key-file `/run/keys/foobar` is present.
You can reference the serivcename by `config.krops.keys."foobar".serviceName`.
### Additinal parameters
`requiredBy` will be forwarded to the `key.foobar.service` to block another serivce
from starting.
## userKeys
can be used to copy a key to a file that can be read only by the user
```nix
krops.userKeys."foobar" = {
user = "foobar";
source = config.krops.keys."foobar".path;
requires = [ "${config.krops.keys."foobar".serviceName}.service" ];
requiredBy = [ "foobar.service" ];
}
```
Will create a service `key.foobar.user.service` that waits until
the `/run/keys/foobar` is present
and than copy it to a place where it can be read by the user `foobar`.
You can reference the serivcename by `config.krops.userKeys."foobar".serviceName`.
|
e005b394-ade2-41d5-a866-d624e06b5384 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-10 20:37:17", "repo_name": "Ghostwritertje/etf", "sub_path": "/src/main/java/be/ghostwritertje/WicketSession.java", "file_name": "WicketSession.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "c2f78e415c8d351b702b49efa298dddfc1dc550d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Ghostwritertje/etf | 222 | FILENAME: WicketSession.java | 0.212069 | package be.ghostwritertje;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebSession;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.cycle.RequestCycle;
/**
* Created by jorandeboever
* on 19/03/16.
*/
public class WicketSession extends WebSession {
private String loggedInUser = "Joran";
private boolean authenticated = true;
/**
* Constructor. Note that {@link RequestCycle} is not available until this constructor returns.
*
* @param request
* The current request
*/
public WicketSession(Request request) {
super(request);
}
public static WicketSession get(){
return (WicketSession) Session.get();
}
public String getLoggedInUser() {
return loggedInUser;
}
public void setLoggedInUser(String loggedInUser) {
this.loggedInUser = loggedInUser;
this.authenticated = true;
}
public boolean isAuthenticated() {
return authenticated;
}
}
|
b519fde5-38bd-47fa-a2ad-57cbac1abcd0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-30 07:42:16", "repo_name": "yingwei0831/RecyclerView", "sub_path": "/app/src/main/java/com/yw/testrecyclerview/retrofitutils/model/fetch/LineDetailFetch.java", "file_name": "LineDetailFetch.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "aeb9156b158f45869b27322b3ee78937fbaefc93", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yingwei0831/RecyclerView | 288 | FILENAME: LineDetailFetch.java | 0.259826 | package com.yw.testrecyclerview.retrofitutils.model.fetch;
import com.yw.testrecyclerview.retrofitutils.model.BaseFetch;
/**
* Created by jiahe008_lvlanlan on 2017/2/24.
*/
public class LineDetailFetch {
/**
* head : {"code":"Publics_show"}
* field : {"id":"589","memberid":"73"}
*/
/**
* id : 589
* memberid : 73
*/
private String id;
private String memberid;
public LineDetailFetch(String id, String memberid) {
this.id = id;
this.memberid = memberid;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMemberid() {
return memberid;
}
public void setMemberid(String memberid) {
this.memberid = memberid;
}
// {"head":{"code":"Publics_show"},"field":{"id":"589","memberid":"73"}}
@Override
public String toString() {
return "LineDetailFetch{" +
"id='" + id + '\'' +
", memberid='" + memberid + '\'' +
'}';
}
}
|
e1f69724-d467-49e4-86d3-21675a405e74 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-10 01:28:39", "repo_name": "phronesys/EDDyA", "sub_path": "/Tareas/Tarea5/entropia.java", "file_name": "entropia.java", "file_ext": "java", "file_size_in_byte": 1209, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "3330139d6220e97245d03b00b9e1a3e51a2df5b9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/phronesys/EDDyA | 253 | FILENAME: entropia.java | 0.276691 | import java.util.*;
import java.lang.*;
public class entropia {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String line = scan.nextLine();
while(!line.equals("****END_OF_INPUT****"))
{
int nWords = 0;
while(!line.equals("****END_OF_TEXT****"))
{
// contar palabras
String words = line.replaceAll("[^\\w\\s]", ""); // separa palabras por espacios
String[] wordsA = words.split("\\s"); // cada word separada por un espacio
nWords += wordsA.length;
//System.out.println(words);
line = scan.nextLine();
}
System.out.println();
System.out.print(nWords + " " + getEntropy(nWords) + " " + getEntropyRel(nWords));
line = scan.nextLine();
}
scan.close();
}
public static int getEntropyRel(int n)
{
return (int)(getEntropy(n)/ getMaxEntropy());
}
public static float getEntropy(int n)
{
return n;
}
public static float getMaxEntropy()
{
return 0;
}
}
|
798005cc-3317-4399-af2d-36753755f4f6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-28 07:01:39", "repo_name": "irenkamalova/happyBDayBot", "sub_path": "/src/main/java/com/kamalova/bot/Question.java", "file_name": "Question.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "75fb60aa27f71e2c3c8fd03c4fced7662aba2edf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/irenkamalova/happyBDayBot | 189 | FILENAME: Question.java | 0.258326 | package com.kamalova.bot;
import java.util.List;
public class Question {
private final int number;
private final String question;
private final List<String> answers;
private final String correctAnswer;
public Question(int number, String question, List<String> answers, String correctAnswer) {
this.number = number;
this.question = question;
this.answers = answers;
this.correctAnswer = correctAnswer;
}
public String getQuestion() {
return question;
}
public List<String> getAnswers() {
return answers;
}
public String getCorrectAnswer() {
return correctAnswer;
}
@Override
public String toString() {
return "Question{" +
"number=" + number +
", question='" + question + '\'' +
", answers=" + answers +
", correctAnswer='" + correctAnswer + '\'' +
'}';
}
}
|
c800209b-0e26-4549-89ae-57fcf5e0c475 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-07-25T10:03:37", "repo_name": "rg-28/ant_hardware", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1149, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "b19aae9b6c4d1cb794096a79319aab863aea9556", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rg-28/ant_hardware | 246 | FILENAME: README.md | 0.273574 | # ant_hardware
Trying to create an autonomous bot using Raspberry Pi and Arduino Mega with other required hardware.
Integrated various hardware modules with ROS (like motors, encoders, camera etc.)
Code for the following cases:
* **ros_encoders_embed** - Embedded C code for integrating motor encoders with Arduino Mega and send the data to the server (or main computer) through ROS.
* **ros_motors** - Arduino IDE code for integrating two Geared DC motors with Arduino Mega.
* **ros_motors_embed** - Embedded C code for integrating two Geared DC motors with Arduino Mega and send the commands to the motor from the server (or main computer) through ROS.
* **ros_nav_embed** - Embedded C code for integrating both Geared DC motors and the encoders with each other and Arduino Mega and send/receive the data to/from the server (or main computer) through ROS.
* **ros_nav_pid** - Embedded C code for implementing **PID algorithm** to the motors to get accurate data from the encoders.
* **teleop_joystick_hardware** - C++ script for integrating a joystick controller with server (or main computer) and send the data to the motors through ROS.
|
c88ebb2c-e86b-4139-9ae1-882b6a303dbe | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-13 16:12:01", "repo_name": "srikanthisreal/jttapi", "sub_path": "/src/main/java/com/stech/jttapi/AgreementController.java", "file_name": "AgreementController.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "9a4e34b90deed3902b65983c456aa8b0710f7b78", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/srikanthisreal/jttapi | 233 | FILENAME: AgreementController.java | 0.245085 | package com.stech.jttapi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
* @author srikanth
*
*/
@RestController
@RequestMapping(value = "/api/v1/domains/jttapi/", produces = MediaType.APPLICATION_JSON_VALUE)
public class AgreementController {
private static final Logger LOGGER = LoggerFactory.getLogger(AgreementController.class);
/**
*
* @param agreementId
* @return
*/
@GetMapping("/{ag_id}/agreement")
public Agreement getAgreement(@PathVariable("ag_id") String agreementId) {
LOGGER.trace("ENTRY: getAgreement {}, {}", agreementId);
Agreement agreement = new Agreement();
agreement.setAgId(001);
agreement.setLicensee("test");
agreement.setLicensor("test");
LOGGER.trace("EXIT: getAgreement {}", agreement);
return agreement;
}
}
|
e2ee1102-65bb-4a0f-8447-33e84d6514c1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-03 06:55:14", "repo_name": "konstiak/bean-validation-demo", "sub_path": "/src/test/java/com/example/validation/demo/ValidationControllerTest.java", "file_name": "ValidationControllerTest.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "b779ed91baa3728e3e34a4c54f0f6a7ca21c2a6d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/konstiak/bean-validation-demo | 219 | FILENAME: ValidationControllerTest.java | 0.259826 | package com.example.validation.demo;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;
import java.util.HashMap;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
public class ValidationControllerTest {
@LocalServerPort
private int port;
@Autowired
private TestRestTemplate restTemplate;
@Test
void invalidValidation() {
ValidatedInput input = ValidatedInput.builder()
.eMail("invalid @ email.io")
.build();
var response = restTemplate.postForObject("http://localhost:" + port + "/", input, HashMap.class);
var errors = (List)response.get("errors");
assertThat(errors).hasSize(1);
log.info("Response: ", response);
}
}
|
278dc9d6-0ab3-4a08-ba61-2c57f833696c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-10 09:14:00", "repo_name": "gurvinder13/MarketSTask", "sub_path": "/app/src/main/java/com/example/marketstask/ui/ui/home/HomeDataSourceFactory.java", "file_name": "HomeDataSourceFactory.java", "file_ext": "java", "file_size_in_byte": 1148, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "ff099aef6dbd1a0c018bf7551875d5d92addcf8c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gurvinder13/MarketSTask | 199 | FILENAME: HomeDataSourceFactory.java | 0.26588 | package com.example.marketstask.ui.ui.home;
import androidx.lifecycle.MutableLiveData;
import androidx.paging.DataSource;
import com.example.marketstask.data.DataManager;
import com.example.marketstask.data.remote.models.PublicRepository;
import io.reactivex.disposables.CompositeDisposable;
public class HomeDataSourceFactory extends DataSource.Factory<Long, PublicRepository> {
private MutableLiveData<HomeDataSourceClass> liveData;
private DataManager dataManager;
private CompositeDisposable compositeDisposable;
public HomeDataSourceFactory(DataManager dataManager, CompositeDisposable compositeDisposable) {
this.dataManager = dataManager;
this.compositeDisposable = compositeDisposable;
liveData = new MutableLiveData<>();
}
public MutableLiveData<HomeDataSourceClass> getMutableLiveData() {
return liveData;
}
@Override
public DataSource<Long, PublicRepository> create() {
HomeDataSourceClass dataSourceClass = new HomeDataSourceClass(dataManager, compositeDisposable);
liveData.postValue(dataSourceClass);
return dataSourceClass;
}
}
|
40370f87-ff55-4495-bbfa-aee45785ab4d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-29 13:04:02", "repo_name": "chengxuyuan-sjw/Item1-sjw", "sub_path": "/src/com/sheng/Service/back/Impl/IDeptServiceBackImpl.java", "file_name": "IDeptServiceBackImpl.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "8298335aca06434dc484deb610d22e8a6ad9eb58", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/chengxuyuan-sjw/Item1-sjw | 257 | FILENAME: IDeptServiceBackImpl.java | 0.29584 | package com.sheng.Service.back.Impl;
import com.sheng.Dao.IDeptDao;
import com.sheng.Dao.IEmpDao;
import com.sheng.Service.back.IDeptServiceBack;
import com.sheng.vo.Dept;
import com.sheng.vo.Emp;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class IDeptServiceBackImpl implements IDeptServiceBack {
@Resource(name = "IDeptDaoImpl")
private IDeptDao DeptDao;
@Resource(name = "IEmpDaoImpl")
private IEmpDao EmpDao;
@Override
public Map<String, Object> list() {
Map<String,Object> map=new HashMap<String,Object>();
//获取所有部门信息
List<Dept> AllDept=DeptDao.findDeptById();
//获取所有部门的员工信息
List<Emp> AllEmp=EmpDao.findAllManager();
map.put("AllDept",AllDept);
map.put("AllEmp",AllEmp);
return map;
}
@Override
public boolean UpdateDname(Dept dept) {
return DeptDao.doUpdate(dept);
}
}
|
5324d2cd-ce04-48d5-96c7-e5df38617d59 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-22 09:31:19", "repo_name": "vimleshg/UserExperior-Demo-Project-Android", "sub_path": "/UeWallet/app/src/androidTest/java/com/userexperior/uewallet/MyViewAction.java", "file_name": "MyViewAction.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "1923ff78eef0b49fa01e65b891efc587ce84c0e9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vimleshg/UserExperior-Demo-Project-Android | 208 | FILENAME: MyViewAction.java | 0.242206 | package com.userexperior.uewallet;
import android.support.test.espresso.UiController;
import android.support.test.espresso.ViewAction;
import android.view.View;
import org.hamcrest.Matcher;
import java.util.ArrayList;
/**
* Created by userexperior on 03-08-2017.
*/
public class MyViewAction {
public static ViewAction clickChildViewWithId(final int id) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return null;
}
@Override
public String getDescription() {
return "Click on a child view with specified id.";
}
@Override
public void perform(UiController uiController, View view) {
View v = view.findViewById(id);
//v.performClick();
ArrayList<View> views = new ArrayList<>();
view.findViewsWithText(views, "Electricity Bill", 0);
views.get(0).performClick();
}
};
}
}
|
48feb93a-ae49-4a90-8936-c5d31a06d2b5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-02 10:32:30", "repo_name": "xiaopengxpgithub/mysqlreadwrite", "sub_path": "/src/main/java/com/atguigu/mysqlrw/service/impl/UserServiceImpl.java", "file_name": "UserServiceImpl.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "3f747fd0c478daed0b4ee3df6f0744facb834433", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xiaopengxpgithub/mysqlreadwrite | 193 | FILENAME: UserServiceImpl.java | 0.246533 | package com.atguigu.mysqlrw.service.impl;
import com.atguigu.mysqlrw.mapper.UserMapper;
import com.atguigu.mysqlrw.pojo.User;
import com.atguigu.mysqlrw.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class UserServiceImpl implements UserService {
private static final Logger logger=LoggerFactory.getLogger(UserServiceImpl.class);
@Autowired
private UserMapper userMapper;
@Override
public User getUser(Integer id) {
return this.userMapper.getUser(id);
}
@Transactional
@Override
public int insertUser(User user) {
logger.info("insert into user!!!");
return this.userMapper.insertUser(user);
}
@Override
public User findUser(Integer id) {
return this.userMapper.getUser(id);
}
}
|
10783135-1a90-4617-a197-a16985d1fd75 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-13 07:45:10", "repo_name": "DinnieJ/NovelOnline", "sub_path": "/app/src/main/java/com/example/novelonlineapp/model/hakore/Chapter.java", "file_name": "Chapter.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "9ec73ec5536cec3d7d0f95bc20201c4d338f432c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DinnieJ/NovelOnline | 212 | FILENAME: Chapter.java | 0.191933 | package com.example.novelonlineapp.model.hakore;
import java.util.ArrayList;
public class Chapter {
private ArrayList<String> content;
private String nextChapterUrl;
private String prevChapterUrl;
public Chapter() {
}
public Chapter(ArrayList<String> content, String nextChapterUrl, String prevChapterUrl) {
this.content = content;
this.nextChapterUrl = nextChapterUrl;
this.prevChapterUrl = prevChapterUrl;
}
public ArrayList<String> getContent() {
return content;
}
public void setContent(ArrayList<String> content) {
this.content = content;
}
public String getNextChapterUrl() {
return nextChapterUrl;
}
public void setNextChapterUrl(String nextChapterUrl) {
this.nextChapterUrl = nextChapterUrl;
}
public String getPrevChapterUrl() {
return prevChapterUrl;
}
public void setPrevChapterUrl(String prevChapterUrl) {
this.prevChapterUrl = prevChapterUrl;
}
}
|
21480937-8c7f-47e3-808f-05f11c03b202 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-31 02:25:55", "repo_name": "jiangyukun/commodity-manage", "sub_path": "/src/main/java/com/ieebook/wxshop/test/SpringContainerBeans.java", "file_name": "SpringContainerBeans.java", "file_ext": "java", "file_size_in_byte": 1209, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "564f2b458c8ae73650668c5d51c4295ef626a856", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/jiangyukun/commodity-manage | 210 | FILENAME: SpringContainerBeans.java | 0.253861 | package com.ieebook.wxshop.test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
public class SpringContainerBeans implements BeanPostProcessor, ApplicationContextAware {
private static final Logger logger = LoggerFactory.getLogger(SpringContainerBeans.class);
// private ApplicationContext applicationContext;
private String level;
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
logger.debug(this.level + ": " + bean.getClass().getName());
return bean;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
// this.applicationContext = applicationContext;
this.level = applicationContext.getParent() == null ? "Root" : "Web";
}
}
|
87e994a2-36aa-4ce6-ad26-e70623a6f094 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-08 14:38:25", "repo_name": "UncleSniper/uake", "sub_path": "/src/org/unclesniper/uake/Location.java", "file_name": "Location.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "b5d2a3c5831ae9bd551f80d3995a0a53ca3f2c7f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/UncleSniper/uake | 259 | FILENAME: Location.java | 0.273574 | package org.unclesniper.uake;
public final class Location {
public static final Location UNKNOWN = new Location(null, 0, 0);
private final String file;
private final int line;
private final int column;
public Location(String file, int line, int column) {
this.file = file;
this.line = line;
this.column = column;
}
public String getFile() {
return file;
}
public int getLine() {
return line;
}
public int getColumn() {
return column;
}
public boolean isUnknown() {
return (file == null || file.length() == 0) && line <= 0;
}
public String toString() {
String f;
if(file == null || file.length() == 0) {
if(line <= 0)
return "<unknown location>";
f = "<unknown file>";
}
else
f = file;
StringBuilder builder = new StringBuilder(f);
if(line > 0) {
builder.append(':' + String.valueOf(line));
if(column > 0)
builder.append(':' + String.valueOf(column));
}
else
builder.append(":<unknown line>");
return builder.toString();
}
}
|
19c55f65-bdd1-48cc-bebb-a2d8aa5245c0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-08-22T01:18:55", "repo_name": "bassguitarbill/titan", "sub_path": "/README.MD", "file_name": "README.MD", "file_ext": "md", "file_size_in_byte": 1069, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "6b62143b053900961e6d3571b88aca2d3439ea90", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bassguitarbill/titan | 265 | FILENAME: README.MD | 0.216012 | TITAN
=====
Theme: You Are the Monster
--------------------------
This is the theme I hoped would get chosen. Oh gosh.
Oh gosh.
This game will be a top-down, I guess what you'd call the very edge case of the beat-'em-up genre.
You play as a *titan*, a mythical, humongous humanoid creature, with a club. You're unleashed, by an army, as a WMD against a warring faction.
Your goal is to not die, and to cause as much destruction as possible. You can walk about, swing a club, all fun stuff.
Your enemies are swordsmen (if they're close, they're doing damage) and archers (you know what archers do I hope).
You have a, frankly, irresponsibly large health bar. It should be pretty hard to die in this game.
When you destroy the 'target' (a building), the mission is over. You gain points based on such levely things as
* slaughtering peasants
* widowing soldiers' wives
* destroying livelihoods
* demolishing nutrition sources
* eradicating enely culture
The point of the game I guess is to make you feel terrible about yourself? That's what I'm going for anyway. |
d15ec342-e6da-40e8-886a-49ff4e12fa13 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-05-09T09:20:16", "repo_name": "todor-enikov/InventoryManager-ASP.NET-MVC-Project", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1149, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "8ba147d152fcffc81583c537b1c021dca67b5de7", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/todor-enikov/InventoryManager-ASP.NET-MVC-Project | 242 | FILENAME: README.md | 0.294215 | # InventoryManager-ASP.NET-MVC-Project
The inventory management store application allows Store managers to manage (create, read, update and delete) clothes for their stores.
### Project desctiption:
#### ASP.NET MVC Inventory manager application.
This is application made on ASP .NET MVC.
It's purpose is to create clothes by user with role Administrator.
The application has administration panel and only user with role "Administrator", can create clothes, edit clothes information, delete clothes, edit information of given user, change role of given user.
Roles in the application and what can they visit.
* Administrator - can visit all pages in the application.
* Regular user - can visit home, about, contact, profile, all clothes, all users and details for user and clothes pages.
* Not registered user - can see only home, about, contact, login, register, view all clothes and details for clothes pages.
### Images from the application:




## GitHub repository:
https://github.com/todor-enikov/InventoryManager-ASP.NET-MVC-Project
|
a4e423c7-cc6b-4b6b-ad04-902f3ab2764f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-12-23 06:13:12", "repo_name": "rosmaini2014845352/itt786-Asgment2", "sub_path": "/hadapan.java", "file_name": "hadapan.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "2d6bffee6e78540038e04e8d24611b77dd45c37b", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/rosmaini2014845352/itt786-Asgment2 | 219 | FILENAME: hadapan.java | 0.2227 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package webscrapping;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
public class hadapan {
public static void main (String[] args){
Document doc;
try {
doc = Jsoup.connect("http://fskm.uitm.edu.my/v1/fakulti/staff-directory/academic/1097.html").get();
Element tajukLaman = doc.select("#ru-mainnav").first();
String tajuk;
System.out.println("Tajuk Laman Web:"+ tajuk);
Elements bahasa= doc.select("#ru-mainnav");
for (Element BahasaElement : bahasa){
System.out.println("Bahasa digunakan:"+BahasaElement.text());
}
} catch(IOException e){
}
}
}
|
3d41e39d-dbd9-4ae5-9b31-04c94806e571 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-15 08:29:13", "repo_name": "yjb951129/yjbprojectname", "sub_path": "/src/main/java/com/xm4399/dao/MysqlDao.java", "file_name": "MysqlDao.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "0d66dacfd03e9715a00bb6b5fbbc55226a96b3f3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yjb951129/yjbprojectname | 240 | FILENAME: MysqlDao.java | 0.294215 | package com.xm4399.dao;
import com.xm4399.run.RunArgs;
import com.xm4399.util.JdbcUtil;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;
@Component
public class MysqlDao implements InitializingBean {
@Autowired
RunArgs runArgs;
private JdbcTemplate jdbcTemplate;
@Override
public void afterPropertiesSet() throws Exception {
jdbcTemplate = JdbcUtil.getJdbcTemplate(runArgs.getMYSQL_URL(),runArgs.getMYSQL_USER(),runArgs.getMYSQL_PASSWORD());
}
/**
*
* @param sql
* @return
*/
public SqlRowSet queryResultSet(String sql){
return jdbcTemplate.queryForRowSet(sql);
}
/**
*
* @param sql
* @param args
* @return
*/
public SqlRowSet queryResultSet(String sql,@Nullable Object... args){
return jdbcTemplate.queryForRowSet(sql,args);
}
}
|
ae6b985c-b755-4b5c-b1f5-212607b630c6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-02 08:47:39", "repo_name": "VladManolache/jHttpServer", "sub_path": "/src/main/java/com/vmanolache/httpserver/request/LimitedBodyReader.java", "file_name": "LimitedBodyReader.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "2b8e74c14c2377b50a187b64230720d24732d54f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/VladManolache/jHttpServer | 236 | FILENAME: LimitedBodyReader.java | 0.273574 | package com.vmanolache.httpserver.request;
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
/**
* Used to read the body of a request when we know the body length in advance.
*/
class LimitedBodyReader {
byte[] read(BufferedReader reader, int length) throws IOException {
char[] buffer = null;
try {
buffer = new char[length];
reader.read(buffer, 0, length);
} catch (NumberFormatException e) {
e.printStackTrace();
}
return toBytes(buffer);
}
private byte[] toBytes(char[] chars) {
CharBuffer charBuffer = CharBuffer.wrap(chars);
ByteBuffer byteBuffer = StandardCharsets.UTF_8.encode(charBuffer);
byte[] bytes = Arrays.copyOfRange(byteBuffer.array(), byteBuffer.position(), byteBuffer.limit());
Arrays.fill(charBuffer.array(), '\u0000'); // clear sensitive data
Arrays.fill(byteBuffer.array(), (byte) 0); // clear sensitive data
return bytes;
}
}
|
d683dae9-4ff4-4a7a-85d2-3884e38bfc39 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-13 21:32:18", "repo_name": "Bizon15100/Tests-Begginer", "sub_path": "/src/test/java/MyAwsomeClassTest.java", "file_name": "MyAwsomeClassTest.java", "file_ext": "java", "file_size_in_byte": 978, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "9ee35765b38157992f22d8dd55cf816f05c454f9", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Bizon15100/Tests-Begginer | 225 | FILENAME: MyAwsomeClassTest.java | 0.292595 | import org.junit.Assert;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;
import static org.junit.Assert.*;
public class MyAwsomeClassTest {
@Test
public void shouldprintHappyText() {
//given
InternalClassMock mock = new InternalClassMock();
InternalClass mock2 = PowerMockito.mock(InternalClass.class);
MyAwsomeClass myAwsomeClass = new MyAwsomeClass(mock2);
//when
String result = myAwsomeClass.printHappyText();
//then
Assert.assertEquals("I AM HA",result);
}
@Test
public void shouldCosTamWhenCosTam(){
//given
InternalClass mock = PowerMockito.mock(InternalClass.class);
PowerMockito.when(mock.returnSomeString()).thenReturn("STUB");
MyAwsomeClass myAwsomeClass = new MyAwsomeClass(mock);
//when
String result = myAwsomeClass.thisMethodIsStubbed();
//then
Assert.assertEquals("STUB",result);
}
} |
aab441f5-bd5c-4f73-ae02-c62cc191fd1f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-12 20:20:13", "repo_name": "tgmrks/Android-course", "sub_path": "/Aula18SoftblueSMS/app/src/main/java/com/example/ismael/aula18softbluesms/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "c579257e61e86eb6010ac1c0bb6efd5c7b16ca20", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tgmrks/Android-course | 191 | FILENAME: MainActivity.java | 0.203075 | package com.example.ismael.aula18softbluesms;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
private EditText edt_telefone;
private EditText edt_mensagem;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
edt_telefone = (EditText)findViewById(R.id.edt_tel);
edt_mensagem = (EditText)findViewById(R.id.edt_mes);
}
public void send(View view) {
String telefone = edt_telefone.getText().toString();
String mensagem = edt_mensagem.getText().toString();
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(telefone, null, mensagem, null, null);
}
}
|
2d9d03ba-08c6-4c9c-8dd3-308fc734a613 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-12-20T23:14:49", "repo_name": "jvmdeveloperid/JVM-Meetup-14", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1030, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "ed2c896131b5fd4dbc91c5a23d04ce9ccb5b7b67", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/jvmdeveloperid/JVM-Meetup-14 | 362 | FILENAME: README.md | 0.249447 | # JVM-Meetup-14
Summarize form JVM Meetup #14 @ BBM Indonesia Office
JVM Meetup #14 : Git Workflow
Tuesday, 23 October 2018
From 6 PM - 9.30 PM
@ SCTV Tower 8th Floor
SCTV Tower Senayan City
Jl Asia Afrika Jakarta Selatan
Speaker :
1. Deny Prasetyo (Senior Engineer of GoPay) -> [Implementasi Trunk based Git Work flow di GoJek.](https://drive.google.com/open?id=1QaRLmKYV0YEVBUDSTLtcEWeCxPDNfT35)
2. Endy Muhardin (Senior Consultanf of Artivisi) -> [Git Workflow: From editor to production, no hands.](https://drive.google.com/open?id=1fyt9GC7GA6VvthcHhO1BgaAC8Vd1FuhM)

#### Photo Session


Ayo join JVM User Group di telegram untuk diskusi lebih lanjut.
Join Us : [@JVMUserGroup](http://t.me/JVMUserGroup)
Like & Follow : JVM Developer
Like & Follow -> https://www.facebook.com/JVMDeveloperID/ |
82dc9d7e-342b-4580-8c03-195fbac89051 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-27 11:25:33", "repo_name": "ItsKDM/AstroPic", "sub_path": "/src/main/java/com/example/kdm/astropic/Data.java", "file_name": "Data.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "12c2247fad08bb3c2cd0b957cafd95cc014d2fe4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ItsKDM/AstroPic | 192 | FILENAME: Data.java | 0.2227 | package com.example.kdm.astropic;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;
public class Data extends AppCompatActivity {
WebView webView;
TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_data2);
Intent intent = getIntent();
webView = findViewById(R.id.webview);
textView = findViewById(R.id.txt);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl(intent.getStringExtra("url"));
textView.setText(intent.getStringExtra("explanation"));
webView.setWebViewClient(new WebViewClient());
}
public void onBackPressed()
{
if(webView.canGoBack())
{
webView.goBack();
}
else
super.onBackPressed();
}
} |
438994fd-866e-4dc1-8885-f65c245c050a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-25 06:58:41", "repo_name": "amindraa05/CovidTracker", "sub_path": "/app/src/main/java/com/example/covidtracker/preference/UserPreference.java", "file_name": "UserPreference.java", "file_ext": "java", "file_size_in_byte": 1209, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "fe85ab47fe0f675b50e730080a71685334523ff5", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/amindraa05/CovidTracker | 211 | FILENAME: UserPreference.java | 0.242206 | package com.example.covidtracker.preference;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
public class UserPreference {
private final SharedPreferences sharedPreferences;
private final SharedPreferences.Editor editor;
private static final String PREFERENCE_NAME = "user_preference";
private static final String REMINDER_TIME = "reminder_time";
private static final String LANGUAGE = "language";
@SuppressLint("CommitPrefEdits")
public UserPreference(Context context){
sharedPreferences = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE);
editor = sharedPreferences.edit();
}
public String getReminderTime(){
return sharedPreferences.getString(REMINDER_TIME, "17:00"); // Default jam
}
public void setReminderTime(String reminderTime){
editor.putString(REMINDER_TIME, reminderTime);
editor.apply();
}
public String getLanguage(){
return sharedPreferences.getString(LANGUAGE, "in");
}
public void setLanguage(String language){
editor.putString(LANGUAGE, language);
editor.apply();
}
}
|
501968f4-acb9-4cc5-8a29-9494a0892b95 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-18 15:31:26", "repo_name": "NaiLii/crm", "sub_path": "/crm-ui/src/main/java/net/gddata/other/crm/Util/PropertyUtil.java", "file_name": "PropertyUtil.java", "file_ext": "java", "file_size_in_byte": 986, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "abe97d291a677e64159b1aa02835b058c6a7d010", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NaiLii/crm | 182 | FILENAME: PropertyUtil.java | 0.217338 | package net.gddata.other.crm.Util;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.lang.StringUtils;
import java.io.InputStream;
/**
* Created by knix on 16/2/29.
*/
@Slf4j
public class PropertyUtil {
public static Configuration getConfig(String pid) {
if (StringUtils.isEmpty(pid)) {
throw new RuntimeException("Property file ID must be specified.");
}
String filename = pid + ".properties";
PropertiesConfiguration config = new PropertiesConfiguration();
try {
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(filename);
if (stream != null) {
config.load(stream);
}
} catch (Exception e) {
log.warn("Can not load configuration file", e);
}
return config;
}
}
|
d0d143fb-379b-4069-b2a7-1496257b8fb8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-03-02T05:35:12", "repo_name": "MatthewKaes/BetterString", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1018, "line_count": 14, "lang": "en", "doc_type": "text", "blob_id": "c1ecf116d43fd8612d31b311fa6b0d462e2febe2", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MatthewKaes/BetterString | 226 | FILENAME: README.md | 0.26588 | Better String
============
After reading [this](https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ) post in the Chromium-dev group I thought it was about time to take a crack at creating a better C++ string library for average use. This is the result.
The better string library contains a whole host of improvements! Delayed transfer of ownership, Delayed memory allocation and copying, extended feature set built in (conversions, parsers, constructers), and a number of optimizations built in.
Better Strings contain all of the behavior of std::string and more! Preform common operations like converting a string to an integer, preforming an insensitive comparision, or even checking if a string is a palindrome right out of the box with a single function call.
Usage
============
Better string is ready for out of the box use in any C++ project. Simply include BetterString.cpp and BetterString.h in your project and you're ready to replace all those nasty std::strings.
|
23460e03-ee99-404a-a80f-de9ab4179dbe | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-27 21:09:10", "repo_name": "xmicore/hack-calculator", "sub_path": "/src/main/java/de/pmrd/hackcalculator/i18n/SimpleI18NProvider.java", "file_name": "SimpleI18NProvider.java", "file_ext": "java", "file_size_in_byte": 1149, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "cc117d15731a0c8ff86e0db26c64847f65574d58", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/xmicore/hack-calculator | 255 | FILENAME: SimpleI18NProvider.java | 0.268941 | package de.pmrd.hackcalculator.i18n;
import com.vaadin.flow.i18n.I18NProvider;
import java.text.MessageFormat;
import java.util.List;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
@Component
public class SimpleI18NProvider implements I18NProvider {
private Logger log = LoggerFactory.getLogger(SimpleI18NProvider.class);
public static final String BUNDLE_PREFIX = "translate";
@Override
public List<Locale> getProvidedLocales() {
return List.of(Locale.GERMAN);
}
@Override
public String getTranslation(String key, Locale locale, Object... params) {
Assert.notNull(key, "Got lang request for key with null value!");
String value;
try {
ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_PREFIX, locale);
value = MessageFormat.format(bundle.getString(key), params);
} catch (MissingResourceException e) {
log.warn("Missing resource", e);
value = key;
}
return value;
}
}
|
4fd3b565-06a6-4857-91cc-a226ec0fa01c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-08 16:32:32", "repo_name": "Gopi3614/Dino-Game", "sub_path": "/DinoGame/app/src/main/java/com/example/dinogame/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "f75777aa83e2217893ad264900a64ac7c6fbe17e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Gopi3614/Dino-Game | 169 | FILENAME: MainActivity.java | 0.20947 | package com.example.dinogame;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView webView = findViewById(R.id.wview);
WebSettings webSettings = webView.getSettings();
webSettings.setBuiltInZoomControls(true);
webSettings.setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("file:///android_asset/index.html");
}
private class WebViewClient extends android.webkit.WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return super.shouldOverrideUrlLoading(view, url);
}
}
} |
c7c72e83-1103-490f-84a9-d26ebc85aefc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-01-24T13:20:13", "repo_name": "Palmabit-IT/htmlToPdfMake", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1102, "line_count": 46, "lang": "en", "doc_type": "text", "blob_id": "dd503dfeb7d9e516d01f6728a2b6c1ebd5791bda", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Palmabit-IT/htmlToPdfMake | 292 | FILENAME: README.md | 0.27048 | # HtmlToPdfMake
Convert html to PdfMake schema
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
### Installing
```bash
npm i -S @palmabit/htmltopdfmake
```
### Usage
```javascript
const { pdfForElement } = require('@palmabit/htmltopdfmake')
const result = pdfForElement('<div><h1>header1</h1></div>')
//result
[
{ "stack": [
{ "text": [] },
{ "stack": [
{ "text": [
{ "text": "header1", "fontSize": 32, "bold": true }
]
}]
}
]
]
```
## Built With
* [Parse5](https://github.com/inikulin/parse5) - HTML parsing/serialization toolset for Node.js. WHATWG HTML Living Standard (aka HTML5)-compliant.
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
|
1a0665b4-2ade-4d82-a29c-472d6876a522 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-06-19 04:07:59", "repo_name": "csaki/FakkuDroidV3", "sub_path": "/app/src/main/java/com/devsaki/fakkudroid/MessageSupportActivity.java", "file_name": "MessageSupportActivity.java", "file_ext": "java", "file_size_in_byte": 1208, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "8b2c1d719dbe9180fcae9f55db7f45b64151edc9", "star_events_count": 4, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/csaki/FakkuDroidV3 | 226 | FILENAME: MessageSupportActivity.java | 0.240775 | package com.devsaki.fakkudroid;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import com.devsaki.fakkudroid.util.ConstantsPreferences;
public class MessageSupportActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_message_support);
try{
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
SharedPreferences prefs = PreferenceManager
.getDefaultSharedPreferences(this);
prefs.edit().putBoolean(ConstantsPreferences.SHOW_MESSAGE_SUPPORT + pInfo.versionCode, false).apply();
}catch (Exception ex){}
WebView wvHelp = (WebView) findViewById(R.id.wbSupport);
wvHelp.loadDataWithBaseURL(null, getResources().getString(R.string.help_to_fakkudroid),"text/html", "utf-8",null);
}
public void close(View view) {
finish();
}
}
|
06a7a76b-04b5-4044-ab63-90ae32eb8670 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-08 15:33:45", "repo_name": "LEEFFEE/NewAttribute", "sub_path": "/Android(6.0)/src/main/java/cn/huafei/androidm/databind/DataBindActivity.java", "file_name": "DataBindActivity.java", "file_ext": "java", "file_size_in_byte": 978, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "ac849bb769bbc68a03259a1c06c30af86f7abe74", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LEEFFEE/NewAttribute | 209 | FILENAME: DataBindActivity.java | 0.226784 | package cn.huafei.androidm.databind;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;
import cn.huafei.androidm.R;
import cn.huafei.androidm.bean.User;
import cn.huafei.androidm.databinding.ActivityDataBindBinding;
public class DataBindActivity extends AppCompatActivity {
private User mUser;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityDataBindBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_data_bind);
mUser = new User("zhangsan","30");
mUser.setPhone("1587964235");
mUser.setAddress("shengzhen");
binding.setUser(mUser);
binding.setGender("男");
}
public void click(View view){
Toast.makeText(DataBindActivity.this, mUser.toString(), Toast.LENGTH_SHORT).show();
}
}
|
31817ee0-0fe4-435b-8e80-be22d9d32120 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-06 21:59:01", "repo_name": "ManfredTremmel/gwtp-training", "sub_path": "/tecb2bwebgwt/src/main/java/de/baywa/tecb2bwebgwt/client/ui/page/privacy/PrivacyViewImpl.java", "file_name": "PrivacyViewImpl.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "9ed002ccb38a6c18b6a8bd225e82ecbc9ddbfcb6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ManfredTremmel/gwtp-training | 267 | FILENAME: PrivacyViewImpl.java | 0.283781 | package de.baywa.tecb2bwebgwt.client.ui.page.privacy;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import com.gwtplatform.mvp.client.ViewImpl;
import javax.inject.Inject;
/**
* View of the privacy page, gwt implementation.
*
* @author Manfred Tremmel
* @version $Rev$, $Date$
*
*/
public class PrivacyViewImpl extends ViewImpl implements PrivacyPresenter.MyView {
interface Binder extends UiBinder<Widget, PrivacyViewImpl> {
}
@UiField
HTML privacyHtml;
private final PrivacyMessages messages;
/**
* constructor injecting parameters.
*
* @param puiBinder ui binder of the page
* @param pmessages localized messages
*/
@Inject
public PrivacyViewImpl(final Binder puiBinder, final PrivacyMessages pmessages) {
super();
this.initWidget(puiBinder.createAndBindUi(this));
this.messages = pmessages;
}
@Override
public void setHtml(final String pbranchId) {
this.privacyHtml.setHTML(this.messages.privacyPage(pbranchId));
}
}
|
1e1e35b7-fc1a-42a0-80a9-2b1dff489bbe | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-03 07:45:39", "repo_name": "avoldsund/fpsoknad-mottak", "sub_path": "/src/main/java/no/nav/foreldrepenger/mottak/config/ClusterAwareSpringProfileResolver.java", "file_name": "ClusterAwareSpringProfileResolver.java", "file_ext": "java", "file_size_in_byte": 1149, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "ab291ccd8eb145bc2679811029ace715cd16a28a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/avoldsund/fpsoknad-mottak | 248 | FILENAME: ClusterAwareSpringProfileResolver.java | 0.224055 | package no.nav.foreldrepenger.mottak.config;
import static java.lang.System.getenv;
import static no.nav.foreldrepenger.mottak.util.EnvUtil.DEFAULT;
import static no.nav.foreldrepenger.mottak.util.EnvUtil.DEV;
import static no.nav.foreldrepenger.mottak.util.EnvUtil.LOCAL;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ClusterAwareSpringProfileResolver {
private static final Logger LOG = LoggerFactory.getLogger(ClusterAwareSpringProfileResolver.class);
private static final String NAIS_CLUSTER_NAME = "NAIS_CLUSTER_NAME";
public static String[] profiles() {
return Optional.ofNullable(clusterFra(getenv(NAIS_CLUSTER_NAME)))
.map(c -> new String[] { c })
.orElse(new String[0]);
}
private static String clusterFra(String cluster) {
if (cluster == null) {
LOG.info("NAIS cluster ikke detektert, antar {}", LOCAL);
System.setProperty(NAIS_CLUSTER_NAME, LOCAL);
return LOCAL;
}
if (cluster.contains(DEV)) {
return DEV;
}
return DEFAULT;
}
}
|
5cb3f761-bfea-47ad-950f-83ebc749a6e4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-14 20:59:52", "repo_name": "Luismoteando/apaw-ep-luismiguel-ortiz", "sub_path": "/src/main/java/es/upm/miw/apaw_ep_themes/api_controllers/OrderDishResource.java", "file_name": "OrderDishResource.java", "file_ext": "java", "file_size_in_byte": 989, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "adc57de5a6e5468f73f34f5a095905bd39c9ce74", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Luismoteando/apaw-ep-luismiguel-ortiz | 220 | FILENAME: OrderDishResource.java | 0.271252 | package es.upm.miw.apaw_ep_themes.api_controllers;
import es.upm.miw.apaw_ep_themes.business_controllers.OrderDishBusinessController;
import es.upm.miw.apaw_ep_themes.dtos.OrderDishDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(OrderDishResource.ORDERDISHES)
public class OrderDishResource {
public static final String ORDERDISHES = "/orderdishes";
public static final String ID_ID = "/{id}";
private OrderDishBusinessController orderDishBusinessController;
@Autowired
public OrderDishResource(OrderDishBusinessController orderDishBusinessController) {
this.orderDishBusinessController = orderDishBusinessController;
}
@PutMapping(value = ID_ID)
public void update(@PathVariable String id, @RequestBody OrderDishDto orderDishDto) {
orderDishDto.validate();
this.orderDishBusinessController.update(id, orderDishDto);
}
}
|
0dba345c-a53d-4d8e-8c56-4cedb4b80077 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-14 03:06:07", "repo_name": "YuanChenM/xcdv1.5", "sub_path": "/Services/msk-entity/src/main/java/com/msk/core/entity/SlBsCitySeqno.java", "file_name": "SlBsCitySeqno.java", "file_ext": "java", "file_size_in_byte": 1206, "line_count": 66, "lang": "zh", "doc_type": "code", "blob_id": "b8d396d076b32d0de7245e43c43a033df99ea3c1", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/YuanChenM/xcdv1.5 | 346 | FILENAME: SlBsCitySeqno.java | 0.271252 | /*
* 2014/09/23 自动生成 新規作成
*
* (c) 江苏润和.
*/
package com.msk.core.entity;
/**
* <p>表sl_bs_city_seqno对应的SlBsCitySeqno。</p>
*
* @author 自动生成
* @version 1.00
*/
public class SlBsCitySeqno extends BaseEntity{
/**
*
*/
private static final long serialVersionUID = 1L;
/** 地区编码 */
private String cityCode;
/** 已注册买手数 */
private Long bsCount;
/**
* <p>默认构造函数。</p>
*/
public SlBsCitySeqno() {
}
/**
* <p>地区编码。</p>
*
* @return the 地区编码
*/
public String getCityCode() {
return cityCode;
}
/**
* <p>地区编码。</p>
*
* @param cityCode 地区编码。
*/
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
/**
* <p>已注册买手数。</p>
*
* @return the 已注册买手数
*/
public Long getBsCount() {
return bsCount;
}
/**
* <p>已注册买手数。</p>
*
* @param bsCount 已注册买手数。
*/
public void setBsCount(Long bsCount) {
this.bsCount = bsCount;
}
}
|
83ca9063-d99e-4711-a855-16caab00e908 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-18 02:03:15", "repo_name": "GTsung/test", "sub_path": "/src/main/java/com/gradle/demo/base/io/cpiped/CSender.java", "file_name": "CSender.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "ccfad5061fc1b93ba735a42dcfd95f3727285dde", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/GTsung/test | 249 | FILENAME: CSender.java | 0.252384 | package com.gradle.demo.base.io.cpiped;
import java.io.IOException;
import java.io.PipedWriter;
/**
* @author guxc
* @date 2020/6/5
*/
public class CSender extends Thread {
private PipedWriter pipedWriter = new PipedWriter();
public PipedWriter getPipedWriter() {
return pipedWriter;
}
@Override
public void run() {
writerShort();
// writerLong();
}
private void writerShort() {
String msg = "this is a short message";
try {
pipedWriter.write(msg.toCharArray());
pipedWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}
private void writerLong() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 102; i++) {
sb.append("1234567890");
}
sb.append("abcdefghijklmnopqrstuvwxyz");
String str = sb.toString();
try {
pipedWriter.write(str);
pipedWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
bd41e4df-7c38-45a4-a85e-0a4ea2ea8069 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-07-16T01:13:55", "repo_name": "Kattjakt/soundmist", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1094, "line_count": 15, "lang": "en", "doc_type": "text", "blob_id": "4028583dc8f1e56f09a977ccd574dc5260540473", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/Kattjakt/soundmist | 280 | FILENAME: README.md | 0.200558 | <img align='right' src="http://i.imgur.com/7nR7HrI.png">
# Soundmist
A Soundcloud desktop client for Windows, Linux and Mac OS X. Built with Electron and AngularJS.
### Prerequisites
The first step is to register an SC app [here](http://soundcloud.com/you/apps). The Client ID and Client Secret will be automatically generated, but you'll have to enter `http://127.0.0.1:3000/callback` in the _Redirect URL_-field so we can fetch the token later on.
To authenticate we need to set up our own backend. The one I'm using can be found [here](https://github.com/Kattjakt/soundmist-auth) and is started by running `npm install && node index.js` in the root directory.
### Running and Building
Running the application is done through either `npm run watch-linux` or `npm run watch-windows` which will start a _livereload_-session and watch the working directory for changes.
Building is done with `electron-packager` and is initiated with `npm run build` which will build packages for Windows (_32/64 bit_), Linux (_x86/x86-64_) and Darwin. Generated packages can be found in the `dist`-folder.
|
cc5c21ae-39fd-4122-87a3-cafb7d3c3c83 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-03 15:32:56", "repo_name": "damiannolan/simulated-annealing-playfair-cipher-breaker", "sub_path": "/PlayfairCipherBreaker/src/main/java/ie/gmit/sw/ai/documents/DocumentService.java", "file_name": "DocumentService.java", "file_ext": "java", "file_size_in_byte": 1148, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "4271ef3e3c6adfdadda99a701150a1f9cc239338", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/damiannolan/simulated-annealing-playfair-cipher-breaker | 260 | FILENAME: DocumentService.java | 0.284576 | package ie.gmit.sw.ai.documents;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.stream.Collectors;
public class DocumentService {
private String basePath;
public DocumentService(String basePath) {
this.basePath = basePath;
}
public void listDocuments(String path) {
Arrays.stream(new File(basePath + path).listFiles())
.map(file -> file.getName())
.forEach(i -> System.out.println(i));
}
public TextDocument createTextDocument(String path, String name) throws IOException {
String text = parseTextFile(path, name);
return new TextDocument(name, text);
}
public String parseTextFile(String path, String textFile) throws IOException {
return Files.lines(Paths.get(basePath + path + "/" + textFile)).collect(Collectors.joining());
}
public void writeToFile(String path, String name, String text) {
try {
System.out.println("Writing to file...");
Files.write(Paths.get(basePath + path + "/" + name), text.getBytes());
} catch (IOException e) {
System.out.println("Error writing to file");
}
}
}
|
ff740fc4-80ca-472a-a82f-a4b60b83191c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-06 12:59:33", "repo_name": "daimaren/PhoneGuard-master", "sub_path": "/app/src/main/java/cn/ixuehu/phoneguard/receiver/BootCompleteReceiver.java", "file_name": "BootCompleteReceiver.java", "file_ext": "java", "file_size_in_byte": 1257, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "6555f4585e7130d1ba7d1119530959bcf43da1bb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/daimaren/PhoneGuard-master | 269 | FILENAME: BootCompleteReceiver.java | 0.253861 | package cn.ixuehu.phoneguard.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.telephony.SmsManager;
import android.telephony.TelephonyManager;
import cn.ixuehu.phoneguard.utils.MyConstants;
/**
* 项目名:PhoneGuard-master
* 包名:cn.ixuehu.phoneguard.receiver
* Created by daimaren on 2016/2/28.
*/
public class BootCompleteReceiver extends BroadcastReceiver{
private SharedPreferences sp;
private TelephonyManager telephonyManager;
@Override
public void onReceive(Context context, Intent intent) {
//判断是否更换sim卡
sp = context.getSharedPreferences(MyConstants.SP_NAME, Context.MODE_PRIVATE);
String oldSim = sp.getString(MyConstants.SIM, "") + "1";
telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String newSim = telephonyManager.getSimSerialNumber();
if (oldSim.equals(newSim)){
}
else {
SmsManager sm = SmsManager.getDefault();
sm.sendTextMessage(sp.getString(MyConstants.SAFEPHONE,"110"),null,"我是小偷,这是我的新号",null,null);
}
}
}
|
21c98e1f-7e07-4f37-b4b5-0be9fcb0e5b7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-27 15:17:10", "repo_name": "domako86/AutomatasFinitos", "sub_path": "/AutomatasFinitos/src/Parse.java", "file_name": "Parse.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "a796c12c227415417293b7d667b265a6c8855dc9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/domako86/AutomatasFinitos | 214 | FILENAME: Parse.java | 0.252384 | /*
* 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.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;
/**
*
* @author Fran
*/
public class Parse {
public Parse(){}
public void leer (File file) throws FileNotFoundException, IOException{
FileInputStream inputStream = null;
Scanner sc = null;
try{
//inputStream = new FileInputStream(file);
//sc = new Scanner(inputStream, "UTF-8");
sc = new Scanner(file);
while (sc.hasNextLine()){
String line = sc.nextLine();
System.out.println(line);
}
if(sc.ioException() != null){ throw sc.ioException(); }
}
finally{
if (inputStream != null){ inputStream.close(); }
if (sc != null) { sc.close(); }
}
}
}
|
d274a03d-e693-4c35-9adb-ae684cbd1a91 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-03-03T05:42:27", "repo_name": "balduran-cc/hugo", "sub_path": "/content/post/yahoo-oauth2-flow.md", "file_name": "yahoo-oauth2-flow.md", "file_ext": "md", "file_size_in_byte": 1274, "line_count": 46, "lang": "en", "doc_type": "text", "blob_id": "3edbdee456d95ca7bfaa21fb58cf022812118593", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/balduran-cc/hugo | 319 | FILENAME: yahoo-oauth2-flow.md | 0.236516 | +++
author = "Balduran Chang"
date = 2015-06-08T23:09:52Z
description = ""
draft = true
slug = "yahoo-oauth2-flow"
title = "Yahoo oauth2 flow"
+++
#yahoo oauth2
##work flow
https://developer.yahoo.com/oauth2/guide/flows_authcode/
server side要拉user資料,一定是通過explicit grant flow,如果是client side app才會是走implicit grant flow。
### get developer credential
拿到每個developer自己一組key/secret。
### redirect user to oauth endpoint
developer key為一組參數,將user轉入oauth endpoint
### Yahoo redirect user back to developer app
user 允許app取得個人資料後,yahpp endpoing轉回developer app,同時提供authorization code供之後使用
### developer app use authorization code to get token
authorization code 拿到之後,developer可以從token endpoint繼續拿到
1. access_token
2. refresh_token
### use access token to poke API
access token 過期前都可以用,過期後就拿refresh token取得新token
## trouble shooting
{"error":"invalid_grant"}
redirect_url必須一樣。
ref:
1. https://developer.linkedin.com/docs/signin-with-linkedin#images
2. https://dev.twitter.com/web/sign-in/desktop-browser
3. https://dev.twitter.com/web/sign-in/implementing
4. http://app.balduran.cc/index.php
|
eb70325e-60ef-43f3-a4a8-482648d3b962 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-22 00:16:41", "repo_name": "SkyloveQiu/CSE1105Project", "sub_path": "/server/src/main/java/nl/tudelft/oopp/group43/project/payload/BikeReservationResponse.java", "file_name": "BikeReservationResponse.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "94ddc62b6e09a82493e0106a5da673a990215760", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SkyloveQiu/CSE1105Project | 230 | FILENAME: BikeReservationResponse.java | 0.23793 | package nl.tudelft.oopp.group43.project.payload;
import nl.tudelft.oopp.group43.project.models.BikeReservation;
public class BikeReservationResponse {
BikeReservation bikeReservation;
String message;
int status;
/**
* init the bike reservation.
* @param bikeReservation the bike reservation.
* @param message the message.
* @param status the status of reservation.
*/
public BikeReservationResponse(BikeReservation bikeReservation, String message, int status) {
this.bikeReservation = bikeReservation;
this.message = message;
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public BikeReservation getBikeReservation() {
return bikeReservation;
}
public void setBikeReservation(BikeReservation bikeReservation) {
this.bikeReservation = bikeReservation;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
|
6879dd46-e4bf-4475-a2b5-3db27db37e9c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-31 13:46:51", "repo_name": "aliahmed-58/project_atlas", "sub_path": "/src/main/java/com/honda/atlas/security/service/UserServiceImpl.java", "file_name": "UserServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f9a7f08e13a296c7d9bce3ef7e7f9b17ff68de96", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aliahmed-58/project_atlas | 216 | FILENAME: UserServiceImpl.java | 0.26588 | package com.honda.atlas.security.service;
import com.honda.atlas.models.Users;
import com.honda.atlas.repo.RolesRepo;
import com.honda.atlas.repo.UsersRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;
import java.util.HashSet;
@Component
public class UserServiceImpl implements UserService {
private final UsersRepo usersRepo;
private final PasswordEncoder passwordEncoder;
private final RolesRepo rolesRepo;
@Autowired
public UserServiceImpl(UsersRepo usersRepo, PasswordEncoder passwordEncoder, RolesRepo rolesRepo) {
this.usersRepo = usersRepo;
this.passwordEncoder = passwordEncoder;
this.rolesRepo = rolesRepo;
}
@Override
public void save(Users user) {
user.setPassword(passwordEncoder.encode(user.getPassword()));
// user.setRoles(new HashSet<>(rolesRepo.findAll()));
usersRepo.save(user);
}
@Override
public Users findByUsername(String username) {
return usersRepo.findByUsername(username);
}
}
|
8e21ea17-e23a-4e90-b154-d64468fd5f67 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-10 15:03:41", "repo_name": "oysteinmyrmo/CollapsibleToolbarNestedScrollViewTest", "sub_path": "/app/src/main/java/com/oysteinmyrmo/test/collapsibletoolbarnestedscrollviewtest/YellowFragment.java", "file_name": "YellowFragment.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "041b577d0ab9b909e3ac40c7cc568c2b6d0f070d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/oysteinmyrmo/CollapsibleToolbarNestedScrollViewTest | 197 | FILENAME: YellowFragment.java | 0.247987 | package com.oysteinmyrmo.test.collapsibletoolbarnestedscrollviewtest;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class YellowFragment extends Fragment
{
public static YellowFragment newInstance()
{
return new YellowFragment();
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View rootView = inflater.inflate(R.layout.yellow_fragment, container, false);
RecyclerView recyclerView = (RecyclerView) rootView.findViewById(R.id.yellow_recyclerview);
recyclerView.setAdapter(new YellowFragmentRecyclerViewAdapter());
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
return rootView;
}
}
|
6b9a1f20-cbaf-45f5-af78-82b52776a554 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-08 00:46:53", "repo_name": "yingw/wcm-demo", "sub_path": "/src/main/java/cn/wilmar/wcmdemo/DemoUserDetailsService.java", "file_name": "DemoUserDetailsService.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "e019e401bd571db7309c8a1e124ba9eb8bab198b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yingw/wcm-demo | 180 | FILENAME: DemoUserDetailsService.java | 0.212069 | package cn.wilmar.wcmdemo;
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.Component;
import java.util.ArrayList;
/**
* 创建 by 殷国伟 于 2017/9/15.
*/
@Component
public class DemoUserDetailsService implements UserDetailsService {
private final UserRepository repository;
public DemoUserDetailsService(UserRepository repository) {
this.repository = repository;
}
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
User user = repository.findByUsername(username);
if (user == null ) {
throw new UsernameNotFoundException("用户找不到!" + username);
}
return new org.springframework.security.core.userdetails.User(
username, user.getPassword(), new ArrayList<>()
);
}
}
|
d0b2d2b6-41d5-47b9-9e91-aced85aebb88 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-21 09:19:18", "repo_name": "sofmeireles/ProjetoSD", "sub_path": "/Meta2/SD meta2/src/hey/action/PassaURLAction.java", "file_name": "PassaURLAction.java", "file_ext": "java", "file_size_in_byte": 1210, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "c00fc8b774c9d3d76070650f758b12d8b6c65f2d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sofmeireles/ProjetoSD | 256 | FILENAME: PassaURLAction.java | 0.268941 | package hey.action;
import com.opensymphony.xwork2.ActionSupport;
import hey.model.HeyBean;
import org.apache.struts2.interceptor.SessionAware;
import java.rmi.RemoteException;
import java.util.Map;
public class PassaURLAction extends ActionSupport implements SessionAware {
private Map<String, Object> session;
private String url;
@Override
public String execute() throws RemoteException {
//vai buscar o url do facebook
String url = this.getHeyBean().connectionURL();
session.put("url", url);
return SUCCESS;
}
public Map<String, Object> getSession() {
return session;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public HeyBean getHeyBean() {
if(!session.containsKey("heyBean"))
this.setHeyBean(new HeyBean());
return (HeyBean) session.get("heyBean");
}
public void setHeyBean(HeyBean heyBean) {
this.session.put("heyBean", heyBean);
}
@Override
public void setSession(Map<String, Object> session) {
this.session = session;
}
}
|
59f86b07-5ae9-4045-ac43-f774f30de486 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-07-10T11:33:30", "repo_name": "Yvonne-Ouma/kitchen-anita", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1006, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "9e996fb6527ad057f61e7699e8ce731708f40ab3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Yvonne-Ouma/kitchen-anita | 237 | FILENAME: README.md | 0.203075 | # Title
Anita's Kitchen
## Author
Yvonne Ouma
## Description
This application entails information on Anita's kitchen.It is a sample layout of what the hotel offers.
## Prerequisites
* web browser
* git
## Setup/Installation Requirements
* Go to Goggle Chrome or Google Chromium
* In the search button,search github
* log in if you have an account if not create an account
* You can clone my project on the clone button
* this is the link to my application https://yvonne-ouma.github.io/kitchen-anita/
## Known Bugs
Does not work in Internet-explorer.
## Technologies Used
In my application i used HTML language where i brought out the structure of the application.I also used CSS where i was able to make my application look more pleasant.It is easy to work on HTML and CSS, a'll highly recommend you to learn more on using this languages.
## Support and contact details
If any complication comes up when running this application please contact me on my gmail account yvonneouma98@gmail.com or 0706244461.
|
6796eaac-a8ed-4d48-9c73-ca2a07865c64 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-19 20:19:13", "repo_name": "CE-KMITL-OOAD-2015/Move-Alarm_ORCA", "sub_path": "/MoveAlarmAnd/Volleyball nuedit/MyApplication5/app/src/main/java/com/example/rxusagi/myapplication/model/Instruction.java", "file_name": "Instruction.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "19a1168fb6104afc208d259e0c7fb9ce3bd97d76", "star_events_count": 5, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/CE-KMITL-OOAD-2015/Move-Alarm_ORCA | 236 | FILENAME: Instruction.java | 0.253861 | package com.example.rxusagi.myapplication.model;
import android.util.Log;
/**
* Created by RXUsagi on 15/10/2015.
*/
public class Instruction {
private int key;
private String img;
private String instruction;
private String instruction2;
private String instruction_name;
private String style;
public Instruction(int key,String img,String instruction,String instruction2,String instruction_name,String style){
Log.i("TAG4", "INCre" + instruction_name +" " + style);
this.key = key;
this.img = img;
this.instruction = instruction;
this.instruction2 = instruction2;
this.instruction_name = instruction_name;
this.style = style;
}
public int getKey() {
return key;
}
public String getImg() {
return img;
}
public String getInstruction() {
return instruction;
}
public String getInstruction2() {
return instruction2;
}
public String getInstruction_name() {
return instruction_name;
}
public String getStyle() {
return style;
}
}
|
ae4850c5-b42c-45f5-9178-47a163507021 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-10-25T11:38:41", "repo_name": "PankajPathak18/LSA-PRACTICALS", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1106, "line_count": 42, "lang": "en", "doc_type": "text", "blob_id": "f8dafc29c8790c98e35020f489a53b5aa2c77c92", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/PankajPathak18/LSA-PRACTICALS | 177 | FILENAME: README.md | 0.259826 | # LSA_PRACTICALS
##INDEX
________________________________________________________________________________________________________________________________________________________________________________
Practical_1 Install DHCP Server
Practical_2 Initial settings: Add a user, Network settings, Configure services and List of services.
Practical_3 Configure NFS server to share directories or files on your network.
Practical_4 SSH Server: Password Authentication Configure SSH server.
Practical_5 Install Samba to share folders or files between Windows and Linux
Practical_6 Configure NTP, Install and Configure NTP Server, Configure NTP Client.
Practical_7 Install MySQL to configure database server
Practical_8 Configure NIS in order to share user accounts in your local network.
________________________________________________________________________________________________________________________________________________________________________________
# NAME : PANKAJ PATHAK
# ROLL NO : 6089
# CLASS : TYCS
|
f8481772-77a6-46be-8bd4-c85d117f06b4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-01T23:18:53", "repo_name": "soundasleep/jevon.org", "sub_path": "/wiki/From_HTML_4_to_XHTML_1.md", "file_name": "From_HTML_4_to_XHTML_1.md", "file_ext": "md", "file_size_in_byte": 1207, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "1efc65bbee94d501aa5bd5b13534e7a60e4fcb8f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/soundasleep/jevon.org | 385 | FILENAME: From_HTML_4_to_XHTML_1.md | 0.23092 | ---
layout: page
title: From HTML 4 to XHTML 1
author: jevon
date: 2005-12-09 08:14:42 +13:00
tags:
- Article
- HTML
redirect_from:
- "/wiki/From HTML 4 to XHTML 1"
---
[Articles](Articles.md)
Recently I made a [Journals](Journals.md) style that had to be valid to [XHTML](xhtml.md) (strict) instead of just [HTML](html.md). While working on this, I made a couple of observations.
## DOCTYPE
The doctype for [XHTML](xhtml.md) strict documents:
`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">`
## IFRAME
_IFRAME_ is no longer permitted in [XHTML](xhtml.md), but you can do the same thing with the _OBJECT_ tag (<a href="http://archivist.incutio.com/viewlist/css-discuss/42402">source</a>):
```
<object data="sourcefile.html" type="text/html">
(text for other browsers)
</object>
```
## NOBR
_NOBR_ was never part of the [HTML](html.md) 4.0 standard anyway. To do the same thing in [CSS](CSS.md):
`.nobr { white-space: nowrap; }`
## IMG
The _align="absmiddle"_ attribute is not supported in XHTML, but using _middle_ seems to work just as well. Also, you can't use a _border_ attribute on an _IMG_ tag (use [CSS](CSS.md) instead).
|
5e5c5f5c-6630-477f-be8f-0ed72da363dd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-04-05T13:58:24", "repo_name": "safeteeglasses/mainJava", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1126, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "5b65309ec6b406695726b5d3fd4130594268aa7a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/safeteeglasses/mainJava | 244 | FILENAME: README.md | 0.246533 | ## Module 1: Intro to Programming
Module 1 will cover an introduction to programming in the respective language of the cohort class, Java or C#. Included in the material will be
Data Types, Expressions and Statements, Object Oriented Programming Principles, Exception Handling, File I/O, and Testing using TDD.
[Module 1: Intro to Programming](module-1/)
## Module 2: Database Programming
The database module introduces SQL as a query language and then leverages C# and Java to issue SQL commands against our databases.
[Module 2: Database Programming](module-2)
## Module 3
Module 3 covers how to implement web applications that are dynamically generated using server-side code. The use of the Model View Controller (MVC) pattern is especially emphasized.
[Module 3: Server Side Programming](module-3)
## Module 4
Module 4 will cover an introduction to JavaScript. We will cover the fundamentals of JavaScript and look at a framework called VueJS that will help us build applications. We will wrap the module up by looking what web services are and how to consume and create them.
[Module 4: JavaScript](module-4) |
0d9f997b-53a5-45b0-ae65-83f151c456b2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-31 09:41:28", "repo_name": "selutin99/autodealer", "sub_path": "/modules/global/src/com/galua/autodealer/entity/PhysicalPerson.java", "file_name": "PhysicalPerson.java", "file_ext": "java", "file_size_in_byte": 1149, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "ea24e1eb967f22453901a9525c1b1b674b65db17", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/selutin99/autodealer | 256 | FILENAME: PhysicalPerson.java | 0.236516 | package com.galua.autodealer.entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import com.haulmont.cuba.core.entity.StandardEntity;
import com.haulmont.chile.core.annotations.NamePattern;
@NamePattern("%s %s %s|firstName,lastName,phone")
@Table(name = "AUTODEALER_PHYSICAL_PERSON")
@Entity(name = "autodealer$PhysicalPerson")
public class PhysicalPerson extends StandardEntity {
private static final long serialVersionUID = -4000120056723997493L;
@Column(name = "FIRST_NAME")
protected String firstName;
@Column(name = "LAST_NAME")
protected String lastName;
@Column(name = "PHONE")
protected String phone;
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getFirstName() {
return firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getLastName() {
return lastName;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPhone() {
return phone;
}
} |
4cdc71b3-3a6f-4cfa-b8a3-f779d1c1c146 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-25 05:22:18", "repo_name": "tharik007/kafka-policy-cluster", "sub_path": "/src/main/java/com/tc/poc/policy/event/engine/Producer.java", "file_name": "Producer.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "6dfc905d580bf9883cfe36a398e4dab1e38aaf1b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tharik007/kafka-policy-cluster | 209 | FILENAME: Producer.java | 0.258326 | package com.tc.poc.policy.event.engine;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;
import com.tc.poc.policy.event.model.Policy;
@Service
public class Producer {
private static final Logger logger = LoggerFactory.getLogger(Producer.class);
private static final String TOPIC = "posting";
/*
@Autowired
private KafkaTemplate<String, String> kafkaTemplate;
*/
@Autowired
private KafkaTemplate<String, Policy> kafkaTemplatePolicy;
/*
public void sendMessage(String message) {
logger.info(String.format("#### -> Producing message -> %s", message));
this.kafkaTemplate.send(TOPIC, message);
}
*/
public void sendPolicy(Policy policy) {
logger.info(String.format("#### -> Producing message -> %s", policy));
this.kafkaTemplatePolicy.send(TOPIC, policy);
}
}
|
a420a478-818c-4c77-a094-195a03d19753 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-07 08:38:54", "repo_name": "yyf1994/HappyFish", "sub_path": "/app/src/main/java/com/yyf/happyfish/receiver/NetWorkBroadcastReceiver.java", "file_name": "NetWorkBroadcastReceiver.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "9927a28ff6da1f64c520f9b641e00e6db3e58a65", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/yyf1994/HappyFish | 232 | FILENAME: NetWorkBroadcastReceiver.java | 0.259826 | package com.yyf.happyfish.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import com.yyf.happyfish.wechat.view.fragment.WeChatFragment;
/**
* Created by yyf on 2016/5/25.
*/
public class NetWorkBroadcastReceiver extends BroadcastReceiver {
// public static boolean isConnected;
@Override
public void onReceive(Context context, Intent intent) {
ConnectivityManager connectivityManager=(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo mobNetInfo=connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
NetworkInfo wifiNetInfo=connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
if (!mobNetInfo.isConnected() && !wifiNetInfo.isConnected()) {
WeChatFragment.isConnected = false;
}else {
WeChatFragment.isConnected = true;
//改变背景或者 处理网络的全局变量
}
Log.d("123","isConnected:"+ WeChatFragment.isConnected);
}
}
|
aff695eb-55c3-4306-8529-905aacb04d72 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-06 00:29:52", "repo_name": "jeag2002/ScalableTaskSystem", "sub_path": "/SymbioRestServer/src/es/restserver/service/consumer/KafkaConsumer.java", "file_name": "KafkaConsumer.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "cb31b718c3f06bb84d0203491be5b7cbffbd5683", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jeag2002/ScalableTaskSystem | 201 | FILENAME: KafkaConsumer.java | 0.259826 | package es.restserver.service.consumer;
import java.util.concurrent.CountDownLatch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;
import es.restserver.component.MessageStorage;
@Component
public class KafkaConsumer {
private static final Logger log = LoggerFactory.getLogger(KafkaConsumer.class);
public final CountDownLatch countDownLatch1 = new CountDownLatch(1);
@Autowired
MessageStorage storage;
@Value("${client.topic}") //--client.topic=client_1
private String clientTopic;
@KafkaListener(topics="${client.topic}", group="${spring.kafka.consumer.group-id}")
public void processMessage(String content) {
log.info("[KafkaConsumerREST-GET] topic='{}' data='{}'",clientTopic,content);
storage.put(content);
countDownLatch1.countDown();
}
}
|
dab80146-d0a8-4949-a6c9-c600768ed17e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-30 07:18:52", "repo_name": "mobile-app-programming-knu/Server", "sub_path": "/src/test/java/com/example/bookreservationserver/book/service/BookAddServiceTest.java", "file_name": "BookAddServiceTest.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "9626cf29a6e0e77ac1051b88586d6a66da7ccc52", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/mobile-app-programming-knu/Server | 229 | FILENAME: BookAddServiceTest.java | 0.274351 | package com.example.bookreservationserver.book.service;
import com.example.bookreservationserver.book.domain.repository.BookRepository;
import com.example.bookreservationserver.book.dto.BookRequestDto;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@ExtendWith(MockitoExtension.class)
class BookAddServiceTest {
@InjectMocks
private BookAddService bookAddService;
@Mock
private BookRepository bookRepository;
@Test
@DisplayName("책 추가 성공")
public void testAddBookSuccess(){
// given
BookRequestDto bookRequestDto = BookRequestDto.builder().book_name("book1").build();
// when
bookAddService.addBook(bookRequestDto);
// then
verify(bookRepository, times(1)).save(argThat(b -> b.getBook_name().equals("book1")));
}
} |
c31686fd-9654-4479-ac8a-037331acc352 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-16 14:20:30", "repo_name": "rodrigocbass/quub-chat", "sub_path": "/src/main/java/br/com/quub/jms/consumer/JmsConsumer.java", "file_name": "JmsConsumer.java", "file_ext": "java", "file_size_in_byte": 1208, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "37600209bb92d5058663491c762d520ecf98ba34", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rodrigocbass/quub-chat | 264 | FILENAME: JmsConsumer.java | 0.26588 | package br.com.quub.jms.consumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;
import br.com.quub.model.Chat;
import br.com.quub.model.User;
import br.com.quub.model.storage.ChatStorage;
import br.com.quub.service.RegisterUserService;
@Component
public class JmsConsumer {
@Autowired
JmsTemplate jmsTemplate;
@Autowired
private ChatStorage chatStorage;
@Autowired
private RegisterUserService registerUserService;
@JmsListener(destination = "${quub.activemq.queue.chat}", containerFactory = "jsaFactory")
public void receive(Chat chat) {
chatStorage.add(chat);
}
@JmsListener(destination = "${quub.activemq.queue.chat.login}")
public void receiveRegisterLogin(User user) {
try {
registerUserService.registraUsuario(user);
} catch (Exception e) {
e.printStackTrace();
}
}
@JmsListener(destination = "${quub.activemq.queue.chat.logout}")
public void receiveRegisterLogout(User user) {
try {
registerUserService.excluiRegistroUsuario(user);
} catch (Exception e) {
e.printStackTrace();
}
}
} |
c45b5f3b-ee86-43d1-91ba-1ee018fa5305 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-04-11T07:28:34", "repo_name": "shunwatai/SDN_school_project", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1208, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "c046a5e914ba3281eddd630b93f46296ba5e346c", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shunwatai/SDN_school_project | 299 | FILENAME: README.md | 0.253861 | # What is this?
- This is just a school project that about "SDN security". However, it is not really about the security in SDN. I was actually working on "detecting the traditional malicious traffics in SDN".
- Also:
- the code are messy and unreadable.
- do not expect has good performance
- many bugs
# Description
## read this first
- I am using the RYU controller in this project.
- All the experiments test in the Mininet VM
- I mainly aim to detect the following malicious traffics in SDN:
- Scanning probe traffics like nmap, ncat or maybe telnet for HTTP
- "Potential flooding" - it is a rubbish because I just set a threshold manually in ```simple_monitor_13.py``` for flow stat and port stat for the detection
- Currently, I only upload the parser coding for convert pcap to csv
- I will upload the codes of RYU later in May after the final presentation
## folder structure in this repo
- ```pcap_parsing_and_data_training/``` store the code of pcap parser and the ML code for training the clf(classifiers). Those clf are used in RYU later
- ```ryu_code/``` store the ryu controller codes, there will be only 2 files ```example_switch_13.py``` & ```simple_monitor_13.py```
|
fe0e61d9-ebdd-48fb-872c-2f0e7ac34e58 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-09-30 12:12:42", "repo_name": "RonnyatVDAB/Cultuurhuis-2015-09", "sub_path": "/src/main/java/be/vdab/servlets/IndexServlet.java", "file_name": "IndexServlet.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "58b8b371f13030823556b3e975097b09c0e30835", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/RonnyatVDAB/Cultuurhuis-2015-09 | 181 | FILENAME: IndexServlet.java | 0.271252 | package be.vdab.servlets;
import be.vdab.entities.Genre;
import be.vdab.services.GenreService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Servlet implementation class IndexServlet
*/
@WebServlet(name="indexservlet", urlPatterns="/index.htm")
public class IndexServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private static final String VIEW = "/WEB-INF/JSP/index.jsp";
private final transient GenreService genreservice = new GenreService();
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Iterable<Genre> genres = genreservice.findAllGenres();
request.setAttribute("genres", genres);
request.getRequestDispatcher(VIEW).forward(request, response);
}
} |
8fcf51ef-7e44-456f-9a54-06e65258619d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-09 05:58:44", "repo_name": "roysouvikk/wordwrap", "sub_path": "/src/test/java/com/test/wrapper/TestStringWrapper.java", "file_name": "TestStringWrapper.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "2303d1eb8f72f9d616823510023102ddfaa1a755", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/roysouvikk/wordwrap | 235 | FILENAME: TestStringWrapper.java | 0.29584 | package com.test.wrapper;
import com.test.wrapper.StringWrapper;
import org.junit.Test;
import static org.junit.Assert.*;
public class TestStringWrapper {
@Test
public void TestWrapperForValidLongStr(){
StringWrapper st = new StringWrapper();
st.maxLength = 23;
String out = st.wrapAString("Design a word wrap micro service which provides functionality.");
String expected = "Design a word wrap " + System.lineSeparator() + "micro service which " +
System.lineSeparator() + "provides functionality.";
assertEquals(out, expected);
}
@Test
public void TestWrapperForNullString(){
StringWrapper st = new StringWrapper();
st.maxLength = 23;
String out = st.wrapAString(null);
String expected = null;
assertEquals(out, expected);
}
@Test
public void TestWrapperForShortString(){
StringWrapper st = new StringWrapper();
st.maxLength = 23;
String out = st.wrapAString("test a string");
String expected = "test a string";
assertEquals(out, expected);
}
}
|
906fac39-20b5-4eab-a62f-6234208cf2c6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-15 15:16:29", "repo_name": "muzamirus/CarRepairs", "sub_path": "/app1/app/src/main/java/com/example/app1/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "03460fd95c8127042e3eac55a5f15463e7e7f0cf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/muzamirus/CarRepairs | 205 | FILENAME: MainActivity.java | 0.23231 | package com.example.app1;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
Button btn;
ImageView img;
CheckBox ck1, ck2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn=(Button) findViewById(R.id.next);
img=(ImageView) findViewById(R.id.img);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent= new Intent(MainActivity.this,Verification.class);
startActivity(intent);
}
});
ck1 = (CheckBox) findViewById(R.id.agree);
ck2=(CheckBox) findViewById(R.id.disagree);
if (!ck1.isChecked()) {
ck1.setChecked(true);
}
else if (!ck2.isChecked()){
ck2.setChecked(true);
}
}
}
|
f49884f8-2a2b-4bd0-895a-f54494d46b56 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-12-11 18:24:03", "repo_name": "yarivg/WaitForIt", "sub_path": "/app/src/main/java/company/wfi/com/waitforit/ItemInPlaylist.java", "file_name": "ItemInPlaylist.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "d6d82f01c2f20c1619356566722dd755d00fe13b", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yarivg/WaitForIt | 218 | FILENAME: ItemInPlaylist.java | 0.233706 | package company.wfi.com.waitforit;
public class ItemInPlaylist {
private String id;
private String url;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUrl() {
if(this.getType().equals("1")) {//video
int videoIdIndex = url.indexOf("?v=");
return url.substring(videoIdIndex+3);
}
else if(this.getType().equals("2")){
if(!url.contains("http"))
return "https://" + url;
else
return url;
}
return url;
}
public void setUrl(String url) {
this.url = url;
}
private String type;
public ItemInPlaylist(String id,String url,String type){
this.id = id;
this.url = url;
this.type = type;
}
}
|
4faf26c9-5f57-495f-9fd5-ba142f2d812a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-05T17:24:31", "repo_name": "zhdand/RainReminder-WeatherForecast", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1089, "line_count": 41, "lang": "en", "doc_type": "text", "blob_id": "26c90bc2218b65e84d75c662fe401dc83df9218e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhdand/RainReminder-WeatherForecast | 272 | FILENAME: README.md | 0.291787 | # Rain Reminder - Weather Forecast
This application is intended to help people to cope with rainy weather.
By sending automatic notifications about harsh weather conditions and things you might need to deal with them.
Like an umbrella, windbreaker or rain boots.
### Features list:
- current weather display
- weather forecast display
- rainy day notifications
- location detection automatic or manual
- customizable notification message and time
- easy notification skip - just swipe the notification to the right or use the stop button when the alarm is triggered
- automatic internet connection loss detection and notification.
### Technology:
- Kotlin
- Clean Architecture
- MVVM
- Coroutines
- Dagger
- Room
- Retrofit
- Glide
- Unit tests
## Screenshots:
<p align="center">
<img src="docs/1.png" width="250">
<img src="docs/2.png" width="250">
<img src="docs/3.png" width="250">
</p>
<p align="center">
<img src="docs/4.png" width="250">
<img src="docs/5.png" width="250">
<img src="docs/6_Internet_is_disconnected.png" width="250">
<img src="docs/7.png" width="250">
</p>
|
6126e1b8-2684-4832-8e29-d187b3f0f06a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-30 19:20:48", "repo_name": "nicolaivalsted/TAYS", "sub_path": "/filters/src/main/java/dk/yousee/randy/filters/monitoring/ServletResponseWithStatus.java", "file_name": "ServletResponseWithStatus.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "d0f435166f126353dcfe351d9549eaf0cf329e41", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nicolaivalsted/TAYS | 231 | FILENAME: ServletResponseWithStatus.java | 0.236516 | package dk.yousee.randy.filters.monitoring;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
/**
* Stop-gap temporary solution until we can switch to Servlet spec 3.0, where
* the http status code is readily available.
* @author jablo
*/
public class ServletResponseWithStatus extends HttpServletResponseWrapper {
private int httpStatus;
public ServletResponseWithStatus(HttpServletResponse response) {
super(response);
}
@Override
public void sendError(int sc) throws IOException {
httpStatus = sc;
super.sendError(sc);
}
@Override
public void sendError(int sc, String msg) throws IOException {
httpStatus = sc;
super.sendError(sc, msg);
}
@Override
public void setStatus(int sc) {
httpStatus = sc;
super.setStatus(sc);
}
@Override
public void setStatus(int sc, String sm) {
httpStatus = sc;
super.setStatus(sc, sm);
}
public int getStatus() {
return httpStatus;
}
} |
934a77ce-a1a9-4481-a986-8fd9b814717e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-08 16:46:19", "repo_name": "losthere/rest", "sub_path": "/src/main/java/com/optum/hedis/domain/Numerator.java", "file_name": "Numerator.java", "file_ext": "java", "file_size_in_byte": 1210, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "aba513cccba4cc41e0c143c8a20e7486209b5a95", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/losthere/rest | 269 | FILENAME: Numerator.java | 0.26588 | package com.optum.hedis.domain;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.optum.hedis.domain.NumeratorPK;
@Entity
@Table(name="NCQA_NUMERATORS")
public class Numerator implements Serializable {
private static final long serialVersionUID = 1L;
@EmbeddedId
private NumeratorPK id;
@JsonInclude
@Column(name="MEASURE_NAME")
private String measureName;
@JsonInclude
@Column(name="RPT_DESCR")
private String rptDescr;
@JsonInclude
@Column(name="DESCR")
private String descr;
@JsonInclude
@Column(name="IS_ACTIVE")
private Long isActive;
@Temporal(TemporalType.DATE)
@JsonInclude
@Column(name = "CREATE_DT")
private Date createDt;
@JsonInclude
@Column(name="CREATED_BY")
private String createdBy;
@JsonInclude
@Column(name="IS_REPORTABLE")
private Long isReportable;
@JsonInclude
@Column(name="OHM_DESCR")
private String ohmDescr;
}
|
586da67f-03b6-4f76-8e67-3c04c5a8e2e7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-09-20T10:47:46", "repo_name": "AdemolaAdedoyin/20questions", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 993, "line_count": 51, "lang": "en", "doc_type": "text", "blob_id": "8cc3a9d4b9348447461078de4abe4eed045f8e33", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AdemolaAdedoyin/20questions | 254 | FILENAME: README.md | 0.252384 | # 20questions
# Built With
The system was built using vuejs, while consuming my authentication Api using nodejs
# Getting Started
## Prerequisites
Your system must have npm and node installed, and this can be done on the terminal with
```
- npm install npm@latest -g
```
## Project setup
```
Clone the repo https://github.com/AdemolaAdedoyin/20questions.git
npm install
```
## Usage
NB: The backend is locally hosted but exposed using ngrok. If at any point authentication fails, kindly reach out to me via email, and this will be updated and shared with you
Configs to be passed when trying to start the server
```
VUE_APP_NEW_BASE_URL="THE BACKEND API"
```
To start the server, run this on your terminal
```
VUE_APP_NEW_BASE_URL=value npm start
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
# Contact
Kindly reach out if any issue is encountered or token and keys are needed, adedoyinademola397@gmail.com
|
2c1679ba-a668-47d9-a919-d91ae079d6be | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-09 12:52:56", "repo_name": "fisherevans/SudoCraftSuite", "sub_path": "/src/com/fisherevans/scs/cache/config/VoteConfig.java", "file_name": "VoteConfig.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "7a2102bbbb321ab21dcf7f025fb449b4f55847b7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fisherevans/SudoCraftSuite | 238 | FILENAME: VoteConfig.java | 0.285372 | package com.fisherevans.scs.cache.config;
import com.fisherevans.scs.cache.CacheObject;
import org.bukkit.configuration.ConfigurationSection;
/**
* Created by h13730 on 11/4/2015.
*/
public class VoteConfig implements CacheObject {
private static final String YML_TIMEOUT = "timeout";
private static final String YML_REQUIRED_PERCENTAGE = "required-percentage";
private Integer _timeout = 60;
private Double _requiredPercentage = 0.8;
public Integer getTimeout() {
return _timeout;
}
public Double getRequiredPercentage() {
return _requiredPercentage;
}
@Override
public void load(ConfigurationSection section) {
section.set(YML_TIMEOUT, _timeout);
section.set(YML_REQUIRED_PERCENTAGE, _requiredPercentage);
}
@Override
public void save(ConfigurationSection section) {
if(section.contains(YML_TIMEOUT))
_timeout = section.getInt(YML_TIMEOUT);
if(section.contains(YML_REQUIRED_PERCENTAGE))
_requiredPercentage = section.getDouble(YML_REQUIRED_PERCENTAGE);
}
}
|
401ea2be-32ef-49c4-8a10-08d3a6a04ad0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-16 13:38:42", "repo_name": "Ridwanhasanah/doaharian", "sub_path": "/app/src/main/java/com/indonesia/ridwan/kumpulandoa/About.java", "file_name": "About.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "a07ed434922f94c82a58c8ed181b53d41369410f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Ridwanhasanah/doaharian | 205 | FILENAME: About.java | 0.191933 | package com.indonesia.ridwan.kumpulandoa;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
public class About extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
ImageView img = (ImageView) findViewById(R.id.imgabout2);
img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Uri uriUrl = Uri.parse("https://www.facebook.com/ridwan.hasanah3?ref componenet=mbasic home header&ref page=%2Fwap%2Fhome.php&refid=7");
Intent i = new Intent(Intent.ACTION_VIEW,uriUrl);
startActivity(i);
}
});
}
}
|
0ea74dae-5f9f-447a-8024-c6a0914168d9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-03 17:25:15", "repo_name": "VladRybkin/PatternsHomeTask1", "sub_path": "/src/ua/training/model/entity/Order.java", "file_name": "Order.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "81be709de5432da1dc3a519aa35ab2e797795235", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/VladRybkin/PatternsHomeTask1 | 214 | FILENAME: Order.java | 0.26971 | package ua.training.model.entity;
import ua.training.model.entity.dishes.Dish;
import java.util.List;
public class Order {
private int orderId;
private Observer client;
private List<Dish> dishes;
public Order(Observer client, List<Dish> dishes) {
this.client = client;
this.dishes = dishes;
}
public int getOrderId() {
return orderId;
}
public void setOrderId(int orderId) {
this.orderId = orderId;
}
public Observer getClient() {
return client;
}
public void setClient(Observer client) {
this.client = client;
}
public List<Dish> getDishes() {
return dishes;
}
public void setDishes(List<Dish> dishes) {
this.dishes = dishes;
}
@Override
public String toString() {
return "Order{" +
"orderId=" + orderId +
", client=" + client +
", dishes=" + dishes +
'}';
}
}
|
b4253795-15b8-43c8-afcf-6551d2c6621f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-20 20:02:56", "repo_name": "osmanio2/Library-Management-System-Spring", "sub_path": "/src/main/java/com/library/management/system/validator/UserFormValidator.java", "file_name": "UserFormValidator.java", "file_ext": "java", "file_size_in_byte": 1069, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "40dc7680b8a34d2204d43ea312c94d1c72470a0c", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/osmanio2/Library-Management-System-Spring | 198 | FILENAME: UserFormValidator.java | 0.282988 | package com.library.management.system.validator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;
import com.library.management.system.model.User;
@Component
public class UserFormValidator implements Validator {
@Autowired
@Qualifier("emailValidator")
EmailValidator emailValidator;
@Override
public boolean supports(Class<?> clazz) {
return User.class.equals(clazz);
}
@Override
public void validate(Object target, Errors errors) {
User user = (User) target;
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "email", "NotEmpty.userForm.email");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "NotEmpty.userForm.password");
if(!emailValidator.valid(user.getEmail())){
errors.rejectValue("email", "Pattern.userForm.email");
}
}
} |
2754fdb6-6f76-492b-80f5-9e410a91d4af | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-11 11:34:55", "repo_name": "Elfaruqi/19104081_adil-elfaruqi_PBO", "sub_path": "/Java-OOP/src/com/adil/pertemuan2/tugas/NO_2/Menu.java", "file_name": "Menu.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "8f856f6de589eccae092f804c7cf4e11d9074f9f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Elfaruqi/19104081_adil-elfaruqi_PBO | 302 | FILENAME: Menu.java | 0.290176 | package com.adil.pertemuan2.tugas.NO_2;
public class Menu {
public static void main(String[] args) {
Binatang supperClass = new Binatang ();
System.out.println ( "SupperClass" );
supperClass.Makan ( "Harimau" );
supperClass.tidur ( "Harimau" );
System.out.println ();
System.out.println ( "subClass = 1 " );
Ikan subClass1 = new Ikan ( "ikan" );
subClass1.getNama ();
subClass1.Berenang ();
subClass1.Makan ( subClass1.nama );
subClass1.tidur ( subClass1.nama );
System.out.println ();
System.out.println ( "subClass = 2 " );
Burung subClass2 = new Burung ( "burung" );
subClass2.getNama ();
subClass2.terbang ();
subClass2.Makan ( subClass2.nama );
subClass2.tidur ( subClass2.nama );
System.out.println ();
System.out.println ( "subClass = 3 " );
Kucing subClass3 = new Kucing ( "kucing" );
subClass3.getNama ();
subClass3.Meong ();
subClass3.Makan ( subClass3.nama );
subClass3.tidur ( subClass3.nama );
}
}
|
e12bdd85-18af-491a-8c90-91c4b8628db0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-05 18:44:55", "repo_name": "JC-127/Mercado_Assignment4", "sub_path": "/app/src/main/java/edu/temple/mercado_assignment4/DisplayActivity.java", "file_name": "DisplayActivity.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "7556f6f7ad4d8ccdab10edb55c505abaabd1a030", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JC-127/Mercado_Assignment4 | 175 | FILENAME: DisplayActivity.java | 0.205615 | package edu.temple.mercado_assignment4;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class DisplayActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.new_activity);
this.setTitle("Display Activity");
Intent intent = getIntent();
String name = intent.getStringExtra(SelectionActivity.NAME);
String desc = intent.getStringExtra(SelectionActivity.DESC);
int imgID = intent.getIntExtra(SelectionActivity.IMG, 0);
TextView nameView = findViewById(R.id.nameView);
nameView.setText(name);
TextView descView = findViewById(R.id.descView);
descView.setText(desc);
ImageView imgView = findViewById(R.id.riderImg);
imgView.setImageResource(imgID);
}
}
|
e660c6f8-b100-46cd-937b-9c4cabcb2a84 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-25 15:58:48", "repo_name": "alibttb/CRS", "sub_path": "/src/me/bttb/crs/beans/symptom/SymptomService.java", "file_name": "SymptomService.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "f686f2f61312e8324ecd358c6406afd6403ed2e6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/alibttb/CRS | 247 | FILENAME: SymptomService.java | 0.293404 | package me.bttb.crs.beans.symptom;
import java.util.List;
import javax.persistence.PersistenceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import me.bttb.crs.model.Symptom;
@Service
@Scope("session")
public class SymptomService {
@Autowired
private SymptomDAO dao;
private Symptom selected;
public SymptomService() {
}
public List<Symptom> getAllSymptoms() {
return dao.findAllSymptoms();
}
public Symptom getSelected() {
return selected;
}
public void setSelected(Symptom selected) {
this.selected = selected;
}
public void createNewSymptom() {
this.selected = new Symptom();
}
public boolean save() {
try {
if (selected.getId() == 0) {
dao.addSymptom(selected);
} else {
dao.updateSymptom(selected);
}
selected = null;
return true;
} catch (PersistenceException pe) {
selected = null;
return false;
}
}
public void cancel() {
selected = null;
}
}
|
7410f44c-ea69-40ae-9d14-d7115120331c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-08 18:00:54", "repo_name": "mmanski/ZSTD", "sub_path": "/src/main/java/edu/uam/zstd1/input/adapter/ContentTypeDetector.java", "file_name": "ContentTypeDetector.java", "file_ext": "java", "file_size_in_byte": 1150, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "969c7c2d808e85308cab557371587fa931c85588", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mmanski/ZSTD | 263 | FILENAME: ContentTypeDetector.java | 0.284576 | package edu.uam.zstd1.input.adapter;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.tika.config.TikaConfig;
import org.apache.tika.exception.TikaException;
import org.apache.tika.io.TikaInputStream;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.mime.MediaType;
/**
*
* @author mmanski
*/
public class ContentTypeDetector {
private TikaConfig tikaConfig;
public ContentTypeDetector() {
try {
this.tikaConfig = new TikaConfig();
} catch (TikaException | IOException ex) {
Logger.getLogger(ContentTypeDetector.class.getName()).log(Level.SEVERE, null, ex);
}
}
public SupportedMediaType getMediaTypeFromFile(File file) {
Metadata metadata = new Metadata();
metadata.set(Metadata.RESOURCE_NAME_KEY, file.toString());
MediaType mediaType = null;
try {
mediaType = tikaConfig.getDetector().detect(
TikaInputStream.get(file.toPath()), metadata);
} catch (IOException ex) {
Logger.getLogger(ContentTypeDetector.class.getName()).log(Level.SEVERE, null, ex);
}
return SupportedMediaType.of(mediaType);
}
}
|
3090cd5a-0707-45fa-b1bf-87a18bc47a00 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-19 09:07:19", "repo_name": "Karthiksr1990/role-based-access-control", "sub_path": "/src/main/java/com/rbac/service/impl/RoleServiceImpl.java", "file_name": "RoleServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "ceada5d15316012f8be2de85cef36132ccdf1aab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Karthiksr1990/role-based-access-control | 200 | FILENAME: RoleServiceImpl.java | 0.256832 | package com.rbac.service.impl;
import com.rbac.dao.RoleManager;
import com.rbac.model.Person;
import com.rbac.model.Role;
import com.rbac.service.RolesService;
import com.rbac.service.UserService;
import lombok.AllArgsConstructor;
import java.util.Set;
@AllArgsConstructor
public class RoleServiceImpl implements RolesService {
private RoleManager roleManager;
private UserService userService;
@Override
public Role createRole(String roleName) {
return roleManager.createRole(roleName);
}
@Override
public boolean addUser(String userId, String roleId) {
Person person = userService.getUser(userId);
return roleManager.addUser(person,roleId);
}
@Override
public boolean removeUser(String userId, String roleId) {
Person person = userService.getUser(userId);
return roleManager.removeUser(person,roleId);
}
@Override
public Set<Role> getRoleForUser(String userId) {
return roleManager.getRoleForUser(userId);
}
}
|
7262c23b-0070-4f26-88ae-73dc66af2431 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-14 19:30:05", "repo_name": "topefremov/quote-service", "sub_path": "/src/main/java/com/github/phillipkruger/quoteservice/QuoteUpdaterTimer.java", "file_name": "QuoteUpdaterTimer.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "4dc7e242ef89288be67246a9b9fdcdf25e9763cf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/topefremov/quote-service | 218 | FILENAME: QuoteUpdaterTimer.java | 0.275909 | package com.github.phillipkruger.quoteservice;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.ejb.Timeout;
import javax.ejb.Timer;
import javax.ejb.TimerConfig;
import javax.ejb.TimerService;
import javax.inject.Inject;
import org.eclipse.microprofile.config.inject.ConfigProperty;
@Singleton
@Startup
public class QuoteUpdaterTimer {
@Inject
private QuoteUpdater updater;
@Resource
private TimerService timerService;
@Inject
@ConfigProperty(name = "quote.updateFrequency",defaultValue = "3600") // 1 hour
private int updateFrequency;
@PostConstruct
public void init(){
int timeout = updateFrequency * 1000;
TimerConfig config = new TimerConfig("Quote Cache update", false);
updater.update();
timerService.createIntervalTimer(timeout,timeout, config);
}
@Timeout
public void timeout(Timer timer) {
updater.update();
}
} |
dda28285-e55a-4038-9796-b3119cb8ba5c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-08 11:48:37", "repo_name": "MitsinVadzim/phoneshop-servlet-api", "sub_path": "/src/main/java/com/es/phoneshop/web/ProductListPageServlet.java", "file_name": "ProductListPageServlet.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "5c5d66626c18353cc54d8d67de0ca7fc4314f5ae", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/MitsinVadzim/phoneshop-servlet-api | 180 | FILENAME: ProductListPageServlet.java | 0.288569 | package com.es.phoneshop.web;
import com.es.phoneshop.service.ProductService;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class ProductListPageServlet extends HttpServlet {
private ProductService productService;
@Override
public void init() {
productService = ProductService.getInstance();
}
@Override
protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
String search = request.getParameter("search");
String sort = request.getParameter("sort");
if (search == null) {
search = "";
}
if (sort == null) {
sort = "ascDescription";
}
request.setAttribute("products", productService.findProducts(search, sort));
request.getRequestDispatcher("/WEB-INF/pages/productList.jsp").forward(request, response);
}
}
|
61570232-35c1-41a1-bffa-4c349eae40b1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-27 13:52:04", "repo_name": "zhuangYuFeiHelloGit/IRead", "sub_path": "/app/src/main/java/main/nini/com/iread/my_util/Constant.java", "file_name": "Constant.java", "file_ext": "java", "file_size_in_byte": 1143, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "d103b18f103b53d76de98b11ec759e817e7e21b5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhuangYuFeiHelloGit/IRead | 342 | FILENAME: Constant.java | 0.242206 | package main.nini.com.iread.my_util;
/**
* Created by zyf on 2017/2/12.
*/
public class Constant {
//搜索的url
public static String SEARCH_BY_NAME =
"http://api01pbmp.zhuishushenqi.com/book/auto-complete?query=";
//模糊搜索的url
public static String SEARCH_ON_FUZZY =
"http://api01pbmp.zhuishushenqi.com/book/fuzzy-search?query=";
public static String data = "http://api02u58f.zhuishushenqi.com/";
public static final int FROM_TYPE_SHELF = 0;
public static final int FROM_TYPE_SEARCH = 1;
public static String BOOK = "http://chapter2.zhuishushenqi.com/chapter/http://vip.zhuishushenqi.com/chapter/";//+"?cv=1487321257409";
public static String getGetBookList(String bookId){
return BOOK + bookId ;
}
public static String getTypeFromHasCp(boolean hasCp,String _id){
if(hasCp){
return data+"b"+"toc/"+_id+"?view=chapters";
}
return data+"mix-a"+"toc/"+_id;
}
public static String GET_BTOC_BY_ID(String bookId){
return "http://api02u58f.zhuishushenqi.com/btoc?view=summary&book="+bookId;
}
}
|
6db5eeb4-5988-4a03-86c7-29ce20d468b5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-07 06:53:34", "repo_name": "farmbytes/crud-springboot-dynamodb", "sub_path": "/src/main/java/com/example/crudspringbootdynamodb/config/DynamoDBConfig.java", "file_name": "DynamoDBConfig.java", "file_ext": "java", "file_size_in_byte": 1149, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "b4d8191c941779121a7d7411873212f4627a42a8", "star_events_count": 2, "fork_events_count": 4, "src_encoding": "UTF-8"} | https://github.com/farmbytes/crud-springboot-dynamodb | 249 | FILENAME: DynamoDBConfig.java | 0.250913 | package com.example.crudspringbootdynamodb.config;
import org.socialsignin.spring.data.dynamodb.repository.config.EnableDynamoDBRepositories;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
@Configuration
@EnableDynamoDBRepositories(basePackages = "com.example.crudspringbootdynamodb.dao")
public class DynamoDBConfig {
@Value("${amazon.dynamodb.endpoint}")
private String dynamoDBEndPoint;
@Value("${amazon.aws.accesskey}")
private String accessKey;
@Value("${amazon.aws.secretkey}")
private String secretKey;
@Bean
public AmazonDynamoDB amazonDynamoDB() {
AmazonDynamoDB amazonDynamoDB = new AmazonDynamoDBClient(new BasicAWSCredentials(accessKey, secretKey));
if (!StringUtils.isEmpty(amazonDynamoDB)){
amazonDynamoDB.setEndpoint(dynamoDBEndPoint);
}
return amazonDynamoDB;
}
}
|
464b3c97-1a2b-43bc-98a9-cec4ed535708 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-04 18:21:43", "repo_name": "rinighosh07/Rmg", "sub_path": "/RmgYantraApplication/src/test/java/com/comcast/EndToEnd/Create_Project_And_Allocate_User.java", "file_name": "Create_Project_And_Allocate_User.java", "file_ext": "java", "file_size_in_byte": 1233, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "2cf2f459095ee3bf428fb93c6bae6094eb245920", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rinighosh07/Rmg | 391 | FILENAME: Create_Project_And_Allocate_User.java | 0.287768 | package com.comcast.EndToEnd;
import static io.restassured.RestAssured.*;
import java.util.HashMap;
import org.testng.annotations.Test;
import io.restassured.http.ContentType;
public class Create_Project_And_Allocate_User {
@Test
public void createProjAndAllocateUser() {
baseURI = "http://localhost";
port = 8084;
//create body
HashMap map = new HashMap();
map.put("createdBy", "Rini860");
map.put("projectName", "airte560");
map.put("status", "Completed");
map.put("teamSize", 12);
// create project
given()
.contentType(ContentType.JSON)
.body(map)
.when()
.post("/addProject")
.then()
.log().all();
//create body
HashMap map1 = new HashMap();
map1.put("designation", "SDET99");
map1.put("dob", 25/06/1999);
map1.put("email", "nitesh4@gmail.com");
map1.put("empName", "nitesh3");
map1.put("experience", 15);
map1.put("mobileNo", "9888777657");
map1.put("project", "abch7");
map1.put("role", "ROLE_ADMIN");
map1.put("username", "nitesh2");
given()
.contentType(ContentType.JSON)
.body(map1)
.when()
//create empl
.post("http://localhost:8084/employees")
.then()
.log()
.all()
.assertThat().statusCode(201);
}
}
|
54629644-edfe-4107-8bb3-7202dcd08c17 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-04-22T19:29:58", "repo_name": "LukvonStrom/Amethyst", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1212, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "c9601dd0ecda2561ab7567b5a6c2f3bbc91aa047", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LukvonStrom/Amethyst | 394 | FILENAME: README.md | 0.20947 | # Amethyst [](https://travis-ci.com/LukvonStrom/Amethyst) [](https://nodesecurity.io/orgs/lukas/projects/e46837c8-2457-4f93-8e6f-d85a963de0b1)
Amethyst is a simple shop software designed especially for artists.
This Project is based on [node-express-boilerplate](https://github.com/inakianduaga/node-express-boilerplate)
## Suggestions
If you do have any suggestions for this project, just create a new issue which describes your idea. If the implementation is likely, the issue will be added to the project, where it will be implemented.
## Hosting [](https://uberspace.de/)
I do offer a hosting of this project for you.
This hosting is done via [uberspace](https://uberspace.de/).
If you do want to know the exact pricing, feel free to contact me via Discord.
## Discord
Feel free to join the Discord Server.
[](https://discord.gg/QPT6DeG)
|
3add3d38-1b9f-41ed-abfa-80710e99ed0c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-21 16:22:36", "repo_name": "Sadnan-Kawshik-015/Food-Safari", "sub_path": "/app/src/main/java/com/example/foodsafari/Payment_Choice.java", "file_name": "Payment_Choice.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "6eb83f6025e0bd27d187ec99b2715c460d8bd68f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Sadnan-Kawshik-015/Food-Safari | 180 | FILENAME: Payment_Choice.java | 0.224055 | package com.example.logintest;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class Payment_Choice extends AppCompatActivity {
TextView tv;
Button btn_paypal,btn_card;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_payment__choice);
tv = findViewById(R.id.tv_price);
btn_paypal = findViewById(R.id.btn_paypal_chc);
btn_card = findViewById(R.id.btn_card_chc);
tv.setText(Constant.cost + " TK");
btn_paypal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(Payment_Choice.this,Paypal.class);
startActivity(i);
}
});
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.