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
cfb699ea-62dc-4bf2-8622-247d82bbc503
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-09-07 18:14:39", "repo_name": "htchepannou/login-app", "sub_path": "/src/main/java/com/tchepannou/app/login/service/login/LogoutCommand.java", "file_name": "LogoutCommand.java", "file_ext": "java", "file_size_in_byte": 1078, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "ea1e068465efa3122a0fcb2d003754a9b9a6ceec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/htchepannou/login-app
209
FILENAME: LogoutCommand.java
0.264358
package com.tchepannou.app.login.service.login; import com.tchepannou.app.login.client.v1.Constants; import com.tchepannou.app.login.service.CommandContext; import com.tchepannou.app.login.service.impl.AbstractSecuredCommand; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Scope; import org.springframework.web.context.WebApplicationContext; import java.io.IOException; @Scope(value = WebApplicationContext.SCOPE_REQUEST) public class LogoutCommand extends AbstractSecuredCommand<Void, Void> { //-- Attributes @Value("${auth.hostname}") private String authHostname; @Value("${auth.port}") private int authPort; //-- Command overrides @Override protected Void doExecute(Void request, CommandContext context) throws IOException { getHttp() .withPort(authPort) .withHost(authHostname) .withPath(Constants.URI_AUTH + "logout/") .withPayload(request) .post() ; return null; } }
b94b1b53-7cf4-4d37-9a7b-672f28c94fe0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-15 02:59:27", "repo_name": "kris37/JavaDemo", "sub_path": "/src/main/java/jvm/io/reactor/Analysit.java", "file_name": "Analysit.java", "file_ext": "java", "file_size_in_byte": 1078, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "5165f247e32c73569461915220869d9b74eaeee6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kris37/JavaDemo
256
FILENAME: Analysit.java
0.264358
package jvm.io.reactor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.concurrent.atomic.AtomicInteger; /** * Created with IntelliJ IDEA. * * @author panqiang37@gmail.com * @version kris37 * Date: 2018/11/23 下午2:28 * To change this template use File | Settings | File Templates. * Description: * <p> * <br> */ public class Analysit extends Thread{ private static final Logger LOG = LoggerFactory.getLogger(Analysit.class); private AtomicInteger read; private AtomicInteger write; private AtomicInteger exec; public Analysit(AtomicInteger read,AtomicInteger write,AtomicInteger exec){ this.read =read; this.write =write; this.exec =exec; } @Override public void run() { try { while (true) { Thread.sleep(5000); LOG.info("--read--:" + read.get() + " -----write---:" + write.get() + " ------exec-----:" + exec.get()); } } catch (InterruptedException e) { e.printStackTrace(); } } }
a1fb02b4-a66e-4a4d-98df-c9e63883e6b3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-04 08:58:30", "repo_name": "devpuck/zz-core", "sub_path": "/src/main/java/com/zz/core/util/ApiResultUtil.java", "file_name": "ApiResultUtil.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "fe74a5296212eace9af546b755f63427f562a031", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/devpuck/zz-core
259
FILENAME: ApiResultUtil.java
0.283781
package com.zz.core.util; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.util.ParameterizedTypeImpl; import com.zz.core.api.ApiResult; import java.lang.reflect.Type; import java.util.List; public class ApiResultUtil { /** * 解析ApiResult * * @param jsonStr * @param <T> * @return */ public static <T> T jsonToBo(String jsonStr, Class<T> targetClass) { return JSON.parseObject(jsonStr, new TypeReference<ApiResult<T>>(targetClass) { }).getData(); } /** * 解析列表 * * @param json * @param clazz * @param <T> * @return */ public static <T> ApiResult<List<T>> parseListResult(String json, Class<T> clazz) { ParameterizedTypeImpl inner = new ParameterizedTypeImpl(new Type[]{clazz}, null, List.class); ParameterizedTypeImpl outer = new ParameterizedTypeImpl(new Type[]{inner}, null, ApiResult.class); return JSONObject.parseObject(json, outer); } }
3fafa119-552d-453f-ac7b-6186eaa3ef58
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-16 09:08:04", "repo_name": "jdolf/javagame", "sub_path": "/src/placeholder/game/screen/overlay/contextmenu/entry/ContextMenuEntry.java", "file_name": "ContextMenuEntry.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "010abc8b47a5d9b66d2ebc260248810efa2ca0e2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jdolf/javagame
226
FILENAME: ContextMenuEntry.java
0.26971
/* * 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 placeholder.game.screen.overlay.contextmenu.entry; import placeholder.game.util.Dimension; import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.TextAlignment; import placeholder.game.screen.overlay.ScreenItem; import placeholder.game.screen.render.Renderable; import placeholder.game.screen.render.Renderer; /** * * @author jdolf */ public abstract class ContextMenuEntry extends ScreenItem implements Renderable { public static final Dimension DEFAULT_DIMENSION = new Dimension(100, 20); public static final Font DEFAULT_FONT = new Font("Arial", 14); protected String displayName; public ContextMenuEntry(String displayName) { super(DEFAULT_DIMENSION); this.displayName = displayName; } @Override public void render(Renderer renderer) { renderer.renderText(Color.BLACK, DEFAULT_FONT, displayName, this, TextAlignment.LEFT); } public abstract void execute(); }
94a7aeff-8596-464c-b34a-e0fc26758dfd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-04-16 00:31:19", "repo_name": "MadTribe/jwechat-parent", "sub_path": "/jwechat-api-core/src/main/java/org/madtribe/wechat/core/client/jsapi/JSAPITicket.java", "file_name": "JSAPITicket.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "4a84ed9e653ccc73c1d710f83376143691ff1941", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/MadTribe/jwechat-parent
257
FILENAME: JSAPITicket.java
0.26588
package org.madtribe.wechat.core.client.jsapi; import com.fasterxml.jackson.annotation.JsonProperty; import javax.validation.Valid; import javax.validation.constraints.NotNull; import java.util.Date; public class JSAPITicket { @Valid @NotNull @JsonProperty("errcode") private int errorCode; @Valid @NotNull @JsonProperty("errmsg") private String errorMessgae; @Valid @NotNull @JsonProperty("ticket") private String ticket; @Valid @NotNull @JsonProperty("expires_in") private Long expiresInSeconds; private long creationTime = new Date().getTime(); /** * Returns +ve number if in the future -ve if in the past. * @return */ public long timeInMillisToExpiry(){ return creationTime + (expiresInSeconds * 1000) - new Date().getTime(); } public int getErrorCode() { return errorCode; } public String getErrorMessgae() { return errorMessgae; } public String getTicket() { return ticket; } public Long getExpiresInSeconds() { return expiresInSeconds; } public long getCreationTime() { return creationTime; } }
d15fcd7d-a3b2-43a9-885c-30a3ade8b10c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-01-14T18:42:00", "repo_name": "desprezj/twissandra-java", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1134, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "cc4204a5e6c4d44f926cb8bb3ce5bc74234c48bd", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/desprezj/twissandra-java
298
FILENAME: README.md
0.272799
twissandra-java =============== Twitter on Cassandra in Java Deps: + Maven: this will load our build deps. + Cassandra 0.6: the important thing. + Pelops: this is how we talk to the important thing. + Wicket: this is how we show other people the important thing. Setup: + Install Cassandra 0.6 from http://cassandra.apache.org/ as well as its dependencies (Thrift). + Copy the storage_conf.xml over the default configuration + Install Wicket with default packages and structure: `mvn archetype:create -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.4.9 -DgroupId=example -DartifactId=twissjava` + Replace default files in the Wicket hierarchy with Twissjava files from this checkout. + Include Pelops as a library from http://code.google.com/p/pelops/ Start: + Start bin/cassandra + java src/test/java/example/Start.java (starts Jetty, our appserver) + NOTE: Jetty uses port 8080 by default, which is used for JMX for Cassandra. Start.java in this checkout has it changed to 8888. + localhost:8888
b4af8999-e9df-42c7-b776-cad603c3c98e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-11 16:31:23", "repo_name": "Anass-ABEA/SimpleSwingApplication", "sub_path": "/src/com/projet/interfaces/Login.java", "file_name": "Login.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "617e4667839b6543f6b361a0f270efce12e58372", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Anass-ABEA/SimpleSwingApplication
213
FILENAME: Login.java
0.278257
package com.projet.interfaces; import com.projet.intermediary.AuthenticationForm; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Login extends MyJDialog { private JPanel panel1; private JTextField textLogin; private JPasswordField textPassword; private JButton button1; private LoginListener listener; public interface LoginListener { boolean onLoginPressed(AuthenticationForm form); void onUserConnected(); } public Login() { setup("Connexion", panel1); listeners(); } public void init(LoginListener listener) { this.listener = listener; display(); } private void listeners() { button1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { AuthenticationForm data = new AuthenticationForm(textLogin.getText(), textPassword.getText()); if (listener.onLoginPressed(data)) { listener.onUserConnected(); } else { System.err.println("WRONG"); } } }); } }
e0ef1ec2-59f4-474d-9344-c42bed5c34da
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-11 10:34:57", "repo_name": "sebastienlebecq/amensite", "sub_path": "/src/fr/nations/amen/client/mvp/places/SouvenirDetailsPlace.java", "file_name": "SouvenirDetailsPlace.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "1a4649fc2a9318b1fe4fd29627af1bd3a8aa390a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sebastienlebecq/amensite
258
FILENAME: SouvenirDetailsPlace.java
0.290981
package fr.nations.amen.client.mvp.places; import com.google.gwt.place.shared.Place; import com.google.gwt.place.shared.PlaceTokenizer; import com.google.gwt.place.shared.Prefix; public class SouvenirDetailsPlace extends Place { private String photoId; private String startPage; private String category; //private String pageSize; public SouvenirDetailsPlace(String token) { String[] args = token.split("&"); this.photoId = args[0]; this.startPage = args[1]; this.category = args[2]; } public String getCategory() { return category; } public String getSouvenirId() { return photoId; } public String getStartPage() { return startPage; } // public String getPageSize() { // return pageSize; // } @Prefix("Souvenir") public static class Tokenizer implements PlaceTokenizer<SouvenirDetailsPlace>{ public SouvenirDetailsPlace getPlace(String token) { return new SouvenirDetailsPlace(token); } public String getToken(SouvenirDetailsPlace place) { return place.getSouvenirId()+"&"+place.getStartPage()+"&"+place.getCategory(); } } }
a0e0bb41-fd44-4c82-9c16-1e8254e06371
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-09 15:29:22", "repo_name": "fedpet/Galactic-Adventures", "sub_path": "/src/it/unibo/oop17/ga_game/model/entities/components/OneTimeTriggerable.java", "file_name": "OneTimeTriggerable.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "b4c50823f1eb1876b5af2c761cbc6a19a6615512", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fedpet/Galactic-Adventures
246
FILENAME: OneTimeTriggerable.java
0.277473
package it.unibo.oop17.ga_game.model.entities.components; import it.unibo.oop17.ga_game.model.entities.events.TriggeredEvent; /** * A {@link Triggerable} component for triggerable entities that can be triggered only once. */ public class OneTimeTriggerable extends AbstractEntityComponent implements Triggerable { private final String password; private boolean triggered; /** * * @param password * A {@link Trigger} object can trigger this component if they have the same password. * @param triggered * The initial state of the {@link OneTimeTriggerable} object (if triggered or not). */ public OneTimeTriggerable(final String password, final boolean triggered) { super(); this.password = password; this.triggered = triggered; } @Override public final String getPassword() { return password; } @Override public final void trigger() { if (!isTriggered()) { post(new TriggeredEvent(getEntity())); triggered = true; } } @Override public final boolean isTriggered() { return triggered; } }
c5a12351-2898-4759-9dcc-08069761875f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-17 08:44:02", "repo_name": "AlexYu-MrSAY/MemeTinder", "sub_path": "/src/main/java/com/company/syugai/serealization_deserealization/MemeDeserialization.java", "file_name": "MemeDeserialization.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "b509f925630dabb2d7f278ae06d45ca29772a845", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AlexYu-MrSAY/MemeTinder
219
FILENAME: MemeDeserialization.java
0.29584
package com.company.syugai.serealization_deserealization; import com.company.syugai.model.Meme; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import java.io.IOException; import java.time.LocalDate; import java.time.format.DateTimeFormatter; public class MemeDeserialization extends StdDeserializer<Meme> { public MemeDeserialization(){ super(Meme.class); } @Override public Meme deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { JsonNode root = p.getCodec().readTree(p); int id = root.get(Meme.ID).asInt(); String link = root.get(Meme.LINK).asText(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy"); LocalDate data = LocalDate.now(); String data1 = String.valueOf(data); data = LocalDate.parse(data1, formatter); return new Meme(id, link, data); } }
0fdc19a2-3511-4bd9-a5c5-769f4ef2df3e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-09 21:47:01", "repo_name": "theknut/XposedGELSettings", "sub_path": "/src/de/theknut/xposedgelsettings/hooks/notificationbadges/PendingNotification.java", "file_name": "PendingNotification.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7d69d2f672cb3751824ab3904d4d9dea63b98b6e", "star_events_count": 32, "fork_events_count": 9, "src_encoding": "UTF-8"}
https://github.com/theknut/XposedGELSettings
236
FILENAME: PendingNotification.java
0.255344
package de.theknut.xposedgelsettings.hooks.notificationbadges; import android.content.ComponentName; import android.content.pm.ResolveInfo; /** * Created by Alexander Schulz on 06.09.2014. */ public class PendingNotification { private ComponentName componentName; private int count; public PendingNotification(ResolveInfo info, int count) { this.componentName = new ComponentName(info.activityInfo.packageName, info.activityInfo.name); this.count = count; } public PendingNotification(ComponentName componentname, int count) { this.componentName = componentname; this.count = count; } public int getCount() { return this.count; } public void setCount(int count) { this.count = count; } @Override public boolean equals(Object o) { if (o instanceof PendingNotification) { return ((PendingNotification) o).componentName.equals(this.componentName); } return this.componentName.equals(o); } @Override public String toString() { return componentName + " Count: " + count; } }
24bfc19a-e888-4a09-85de-d1c647dcaaa4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-23 07:04:17", "repo_name": "anyjava/jpa-book", "sub_path": "/src/main/java/jpabook/start/Board.java", "file_name": "Board.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "a6f203ec464f1bcf5d23dc7fa7393827cd4d8e5b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/anyjava/jpa-book
267
FILENAME: Board.java
0.23231
package jpabook.start; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; /** * Created by anyjava on 2016. 3. 18.. */ @Entity public class Board { @Id @Column(name = "BOARD_ID") private String id; private String title; private String content; @Column(name = "VIEW_COUNT") private Integer viewCount; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Integer getViewCount() { return viewCount; } public void setViewCount(Integer viewCount) { this.viewCount = viewCount; } @Override public String toString() { return "Board{" + "id='" + id + '\'' + ", title='" + title + '\'' + ", content='" + content + '\'' + ", viewCount=" + viewCount + '}'; } }
be824a5e-fad6-4689-b034-9c08e7c880e3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-04-07T18:39:03", "repo_name": "rista404/deno-debug", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1100, "line_count": 46, "lang": "en", "doc_type": "text", "blob_id": "9c5c89da7fc1b259aec7a1b967e6173e28382d15", "star_events_count": 15, "fork_events_count": 3, "src_encoding": "UTF-8"}
https://github.com/rista404/deno-debug
312
FILENAME: README.md
0.23793
# Deno Debug [![Build Status](https://travis-ci.org/rista404/deno-debug.svg?branch=master)](https://travis-ci.org/rista404/deno-debug) <img width="647" src="https://raw.githubusercontent.com/rista404/deno-debug/master/demo.png"> Debug utility for deno. ## Usage ```javascript import debug from "https://deno.land/x/debuglog/debug.ts"; // create debugger const service = debug("service"); const serviceName = "app"; // log service("booting %s", serviceName); ``` Then run your app. ```sh > DEBUG=* deno run --allow-env app.ts ``` ## Todo - [x] extending debuggers - [x] custom log functions - [x] custom formatters - [x] `log` override in all namespaces - [x] inspect opts - [x] detecting color support - [ ] non-tty env - [x] add `debug` to registry ## Notes - Currently debug assumes it is TTY and shows colors by default. - Deno's `inspect` differs from node's `util.inspect` so the output may not be the same. - We're using a custom `format` function ported from `util`. Might be cool to extract it when `util` is ported entirely. - We should cover more functionality with tests.
7f62cac5-21b1-4ec6-950b-f948456c59da
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-23 07:29:43", "repo_name": "hieutran111/TranMinhHieu_android_kiemtraTK2", "sub_path": "/TMH_Cau1/app/src/main/java/com/example/student/tmh_cau1/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "56c1a175a0e6081f24c70acf128a5c5974117e94", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hieutran111/TranMinhHieu_android_kiemtraTK2
280
FILENAME: MainActivity.java
0.287768
package com.example.student.tmh_cau1; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ListView; import java.util.ArrayList; public class MainActivity extends AppCompatActivity { ListView lvFilm; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); lvFilm = findViewById(R.id.lvFilm); ArrayList<Film> list = new ArrayList<>(); Film f1 = new Film("Wolfverin", "American", 30000); list.add(f1); Film f2 = new Film("SwordFish", "American", 15000); list.add(f2); Film f3 = new Film("DeadPool", "American", 29000); list.add(f3); Film f4 = new Film("RobinHood", "American", 35000); list.add(f4); Film f5 = new Film("EndGame", "American", 100000); list.add(f5); Film f6 = new Film("IronMan", "American", 70000); list.add(f6); FilmAdapter adapter = new FilmAdapter(this, R.layout.film, list); lvFilm.setAdapter(adapter); } }
ba617890-76a6-4da2-a6d7-07949b1bcf6a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-17 01:58:23", "repo_name": "guohongji/spring-cloud", "sub_path": "/feign-service/src/main/java/com/shylock/feignservice/UserFeignController.java", "file_name": "UserFeignController.java", "file_ext": "java", "file_size_in_byte": 1078, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "77e4f6b95a3c11dc6b8ca48c706f72545b257603", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/guohongji/spring-cloud
212
FILENAME: UserFeignController.java
0.217338
package com.shylock.feignservice; import com.shylock.feignservice.feign.UserService; import com.shylock.userservice.bean.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** * Created by macro on 2019/8/29. */ @RestController @RequestMapping("/user") public class UserFeignController { @Autowired private UserService userService; @GetMapping("/{id}") public Object getUser(@PathVariable Long id) { return userService.getUser(id); } @GetMapping("/getByUsername") public Object getByUsername(@RequestParam String username) { return userService.getByUsername(username); } @PostMapping("/create") public Object create(@RequestBody User user) { return userService.create(user); } @PostMapping("/update") public Object update(@RequestBody User user) { return userService.update(user); } @PostMapping("/delete/{id}") public Object delete(@PathVariable Long id) { return userService.delete(id); } }
39cf5108-3930-4539-a2ae-8cc9acc03f53
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-26 10:55:45", "repo_name": "xpttxsok123/coffee-life", "sub_path": "/cl-log-center/src/main/java/com/coffee/life/log/center/controller/LogController.java", "file_name": "LogController.java", "file_ext": "java", "file_size_in_byte": 1240, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "a5155167ebac22d8b1045b8a608a4c24bfd16bbb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/xpttxsok123/coffee-life
270
FILENAME: LogController.java
0.247987
package com.coffee.life.log.center.controller; import com.coffee.life.framework.domain.log.Log; import com.coffee.life.framework.model.response.Page; import com.coffee.life.log.center.service.LogService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Map; @RestController public class LogController { @Autowired private LogService logService; @PostMapping("/logs-anon/internal") public void save(@RequestBody Log log) { logService.save(log); } /** * 日志模块<br> * 2018.07.29作废 */ @Deprecated // @PreAuthorize("hasAuthority('log:query')") @GetMapping("/logs-modules") public Map<String, String> logModule() { return null; } /** * 日志查询 * * @param params * @return */ // @PreAuthorize("hasAuthority('log:query')") @GetMapping("/logs") public Page<Log> findLogs(@RequestParam Map<String, Object> params) { return logService.findLogs(params); } }
8cb45dcf-8782-40cc-8b6f-b1c1127c9d56
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-29 05:35:37", "repo_name": "FedorovVladimir/ChessMatch", "sub_path": "/src/main/java/real_data_base/entity_from_data_base/CityEntity.java", "file_name": "CityEntity.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "e1f74c25fb5261c298794842753b35f20551c54b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/FedorovVladimir/ChessMatch
275
FILENAME: CityEntity.java
0.29584
package real_data_base.entity_from_data_base; import javax.persistence.*; import java.util.Objects; @Entity @Table(name = "CITY", schema = "vladimir7_match", catalog = "") public class CityEntity { private int id; private int code; private String name; @Id @Column(name = "ID") public int getId() { return id; } public void setId(int id) { this.id = id; } @Basic @Column(name = "CODE") public int getCode() { return code; } public void setCode(int code) { this.code = code; } @Basic @Column(name = "NAME") public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CityEntity that = (CityEntity) o; return id == that.id && code == that.code && Objects.equals(name, that.name); } @Override public int hashCode() { return Objects.hash(id, code, name); } }
c2c6623b-7309-4b2e-89e0-dbe31f84d90d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-13 03:35:18", "repo_name": "vishvajitravalji/servlet-and-jsp", "sub_path": "/src/java/model/dao/LoginDao.java", "file_name": "LoginDao.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "bc8bc34b192b0c18c60adcad4759524da0a388db", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/vishvajitravalji/servlet-and-jsp
206
FILENAME: LoginDao.java
0.27513
package model.dao; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import model.LoginBean.LoginBean; import model.db.DBConnection; /** * * @author St-201906349 */ public class LoginDao { public String authenticateUser(LoginBean loginbean) throws ClassNotFoundException, SQLException{ String username=loginbean.getUsername(); String password=loginbean.getPassword(); String usernameDB=""; String passwordDB=""; Connection con = DBConnection.createConnection(); Statement st = con.createStatement(); ResultSet result = st.executeQuery("select username,password from login"); while(result.next()){ usernameDB=result.getString("username"); passwordDB=result.getString("password"); if(username.equals(usernameDB) && password.equals(passwordDB)) { return "success"; } else { return "invalid details"; } } con.close(); return "invalid details"; } }
f75cf81a-570f-41c5-9535-4013bef9f2fa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-16T13:06:31", "repo_name": "dankaiurchenko/all_labs_5_year", "sub_path": "/security_labs/src/main/java/com/danarossa/states/SenderStateTwo.java", "file_name": "SenderStateTwo.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "02570776fbb08c5cecf13db56648b07ef08c843b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dankaiurchenko/all_labs_5_year
210
FILENAME: SenderStateTwo.java
0.256832
package com.danarossa.states; import com.danarossa.Package; public class SenderStateTwo extends AbstractClientState { public SenderStateTwo(AbstractClientState one, boolean file) { super(one, file); } public void receivePackage(Package aPackage) throws Exception { if (file) { this.client.setState(new SenderStateThree(this)); // state three // and transmit info this.client.transmitFile(this.receiverId); } else { System.out.println("transmission finished successfully"); client.removeState(this.receiverId); } } public Package sendPackage() throws Exception { final String message; if (file) { return new Package(this.client.getClientId(), this.receiverId, client.encryptAsymmetrical(client.getPassword()), this.file); } else { message = client.encryptAsymmetrical((String) this.message); } return new Package(this.client.getClientId(), this.receiverId, message.getBytes(), this.file); } }
f31bab09-9fbb-4a7b-aa29-098e4f8836a9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-29 07:25:30", "repo_name": "NIck0526/webProgram", "sub_path": "/web04_FormServlet/src/checkbox/servlet/CheckboxServlet.java", "file_name": "CheckboxServlet.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "10f5517c091246d07f7379a63f0889401eed622c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UHC"}
https://github.com/NIck0526/webProgram
218
FILENAME: CheckboxServlet.java
0.267408
package checkbox.servlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class CheckboxServlet extends HttpServlet { private static final long serialVersionUID = 1L; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html; charset=utf-8"); request.setCharacterEncoding("utf-8"); PrintWriter out = response.getWriter(); String kisu = request.getParameter("kisu"); String gender = request.getParameter("gender"); String [] menu = request.getParameterValues("menu"); out.println("<html><body bgcolor='green'>"); out.println("<h3>다음은 "+kisu+" 기 "+gender+"성 들이 좋아하는 메뉴입니다. "); out.println("</h3><p>"); for(String str : menu) { out.println("<li>"+str+"</li>"); } out.println("</body></html>"); out.close(); } }
f808425e-626e-4b06-9397-997229379ee3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-23 01:57:20", "repo_name": "KevinCT/projectGamma", "sub_path": "/AndroidProject/Gasqueue/app/src/main/java/pekl/gasqueue/com/gasqueue/model/StopWatch.java", "file_name": "StopWatch.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "12373fc8d2b6f2e87c0204df7eb37f76143cbc1b", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/KevinCT/projectGamma
242
FILENAME: StopWatch.java
0.291787
package pekl.gasqueue.com.gasqueue.model; import java.util.Scanner; import java.util.Timer; import java.util.TimerTask; import java.util.Scanner; import java.util.Timer; import java.util.TimerTask; public class StopWatch { private static int interval; static Timer timer; private static int currentTime = 60; public StopWatch(){ interval = 60; } public void runTimer() { int delay = 1000; int period = 1000; timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() {currentTime = setInterval();}}, delay, period); } public static final int setInterval() { if (interval == 0) timer.cancel(); return --interval; } public void cancelTimer(){ timer.cancel(); interval = 0; } public boolean isRunning(){ if (interval == 0){ return false; } else{return true;} } public int getCurrentTime(){ return currentTime; } public int getInterval(){ return interval; } }
81e0ef26-fc74-4a0f-8e30-084a3ae5f82d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-03 15:09:22", "repo_name": "OlegSidor/SmartCraftAuction", "sub_path": "/src/smartcraft/auction/Items/SortItems/Che2Exp.java", "file_name": "Che2Exp.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "80224b3a1a93cf3b87057f04c6925d5c8a800c29", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/OlegSidor/SmartCraftAuction
244
FILENAME: Che2Exp.java
0.283781
package smartcraft.auction.Items.SortItems; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.persistence.PersistentDataType; import smartcraft.auction.Inventory.InventoryA; import smartcraft.auction.Main; public class Che2Exp implements Item { private Main plugin = Main.getPlugin(Main.class); private NamespacedKey key = new NamespacedKey(plugin, "Sort"); @Override public ItemStack give() { ItemStack item = new ItemStack(Material.COAL); ItemMeta itemMeta = item.getItemMeta(); itemMeta.setDisplayName(ChatColor.RED + "От дешевых к дорогим"); itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); itemMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING, "Che2Exp"); item.setItemMeta(itemMeta); return item; } @Override public boolean click(InventoryA inventory) { inventory.setSort("Che2Exp"); inventory.goBack(); return true; } }
48268dce-469a-4c7b-be80-0b90b978c847
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-21 14:13:21", "repo_name": "hardenikhil/Selenium_Nikhil", "sub_path": "/src/newpackage/myclass.java", "file_name": "myclass.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "bf29065de625bd9f53751f4c0ccb675e503542cd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "WINDOWS-1252"}
https://github.com/hardenikhil/Selenium_Nikhil
253
FILENAME: myclass.java
0.278257
package newpackage; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class myclass { public static void main(String[] args) throws Exception { System.setProperty("webdriver.chrome.driver", "C:\\Users\\nikhil\\chromedriver.exe"); // Create a new instance of the Firefox driver WebDriver driver = new ChromeDriver(); //Launch the Online Store Website driver.get("https://www.orangehrm.com/User_Survey_Registration"); WebElement element = driver.findElement(By.xpath(".//*[@id='register-form']/div[1]/div[2]/div/input")); element.sendKeys("nikhil"); WebElement dropdown=driver.findElement(By.id("mail")); dropdown.click(); List <WebElement> list=driver.findElements(By.id("dd")); for(WebElement ele:list) { if(ele.getAttribute("innerHTML").contains("JavaScript")) { ele.click(); break; } } } } //xpath("//input[@value='Submit »]"
c721d043-588f-4539-9760-b14ba82482c3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-08-15T04:24:39", "repo_name": "JainamZobaliya/Househepers_Web-Development_Internship", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1092, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "11040b0608b81e5d3939f9ab8931fa587a7e48e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JainamZobaliya/Househepers_Web-Development_Internship
273
FILENAME: README.md
0.210766
# Househepers_Web-Development_Internship Django-Project-House-Helpers This is a Django project done by me and my group. Developed a website (The website topic is similar to UrbanClap where household services are provided by helpers and professionals and all of it is coordinated online ) using Django. Visit the website: https://househelpers.herokuapp.com/ # Pls install: 1. Python 2. Django 3. Django Crispy Forms 4. Pillow # What is Included/ Features? 1. User Registration 2. Email Verification 3. Password Reset (using Email) and Password Change 4. Profile Update 5. Form Validations 6. Form for all the tasks provided by the website(Housekeeping, Electric Device Repair, Plumbing,........) 7. Form Submission and further procedures # Follow this Drive Link for accessing my Project: https://drive.google.com/drive/folders/1QqGPR1j70tP3aIKufxXNT57vd3JXTaLK?usp=sharing #Note: The Email (EMAIL_HOST_USER) and Password (EMAIL_HOST_PASSWORD) Fields are empty in Setting.py File (given ****** as values). But you can run the code by editting the fields by adding you emails and passwords!
b6a034ff-5b48-4b8e-8759-8139a5940b5a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-04-11T10:20:14", "repo_name": "thirtyfiveparts/live", "sub_path": "/repos/live/packages/tools/webstorm/jetbrains-project/docs/future-features.md", "file_name": "future-features.md", "file_ext": "md", "file_size_in_byte": 1160, "line_count": 61, "lang": "en", "doc_type": "text", "blob_id": "524dd3c87049b3a40973c995ef707fb21e40f3e3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/thirtyfiveparts/live
244
FILENAME: future-features.md
0.195594
# Future Features > Ideas for future features. ### Generate a project _TODO_ ### Create scopes for each sub-package _TODO_ In the Project Tool Window you can have it only show files and folders from a scope (defined as a regex). This tool allows scopes to be automatically created for each package. - Scopes can filter navigation like find symbols... - Scopes can be contexts. ### Move changes into a changelist for each sub-package _TODO_ When working with a monorepo you may want to separately commit changes by package. This tool allows changes to be automatically added to their packages's changelist. ### Automatic context management _TODO_ ### Look for nested `jbp.config.js` files. ### Sync with VSCode ### Single process for multiple roots This would support AppCode and CLion projects we have for native code. Maybe also Python iml support for our Python modules. ### set task server to repo ## See misc.xml We pretty much want everything configurable from json. We want smart in-place tho. No loss of data. # Interesting - rehype for parsing html? alternative to cheerio? i think cheerio will be easier to work with tho
953367a7-6853-4467-90c3-2b99a5dd25e5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-01 16:29:33", "repo_name": "Dicxie1/InvMusica", "sub_path": "/src/main/java/modelo/Conexion.java", "file_name": "Conexion.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "9e844f1c495f17fe1dfe8ac12958bf56f4a7ea79", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Dicxie1/InvMusica
211
FILENAME: Conexion.java
0.217338
package modelo; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Connection; import com.mysql.cj.jdbc.exceptions.CommunicationsException; import javax.swing.JOptionPane; public class Conexion { private String driver = "com.mysql.cj.jdbc.Driver"; private String url = "jdbc:mysql://localhost/inventario?serverTimezone=America/Managua"; private String user = "root"; private String pwd = ""; private Connection con = null; public Conexion(){ try{ Class.forName(driver); con = DriverManager.getConnection(url, user, pwd); }catch(ClassNotFoundException ex){ ex.printStackTrace(); } catch(SQLException ex){ ex.printStackTrace(); if(ex.getClass() == CommunicationsException.class){ JOptionPane.showMessageDialog(null, "No se establecion conexión con la base de datos" + "\n contacese con el Administrador", "Error de Conexion", JOptionPane.ERROR_MESSAGE); } } } public Connection getConnection() { return con; } }
8fd6fd41-9a1b-438e-97cd-bcc5ddc6e9d6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-12-01 21:36:13", "repo_name": "mohammadsj2/AP_5", "sub_path": "/src/Network/Message.java", "file_name": "Message.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 68, "lang": "en", "doc_type": "code", "blob_id": "4bc8f12a197932426440c03dbaff35fa4ce1f245", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mohammadsj2/AP_5
256
FILENAME: Message.java
0.250913
package Network; import Network.Client.Client; public class Message { String text; Client client; // Message replied; String repliedText; Client repliedClient; public Message(Client client, String text, Message replied) { this.text = text; this.client = client; if (replied != null) { this.repliedText = replied.getText(); this.repliedClient = replied.getClient(); } else { repliedText = null; repliedClient = null; } } public String getText() { return text; } public void setText(String text) { this.text = text; } public Client getClient() { return client; } public void setClient(Client client) { this.client = client; } public String getRepliedText() { return repliedText; } public void setRepliedText(String repliedText) { this.repliedText = repliedText; } public Client getRepliedClient() { return repliedClient; } public void setRepliedClient(Client repliedClient) { this.repliedClient = repliedClient; } }
2770ffc7-d384-47b6-9f23-77304f66aaff
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-10-31 02:36:52", "repo_name": "josefalcon/friendly", "sub_path": "/app/src/main/java/falcon/com/friendly/resolver/CallLogResolver.java", "file_name": "CallLogResolver.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "4890d1e8a3150bd1428519d618e82374cdaeb93e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/josefalcon/friendly
196
FILENAME: CallLogResolver.java
0.26588
package falcon.com.friendly.resolver; import android.content.ContentResolver; import android.database.Cursor; import android.net.Uri; import android.provider.CallLog; public class CallLogResolver { private final ContentResolver contentResolver; public CallLogResolver(final ContentResolver contentResolver) { this.contentResolver = contentResolver; } public long getLastContact(final String number) { final Uri uri = Uri.withAppendedPath(CallLog.Calls.CONTENT_FILTER_URI, Uri.encode(number)); final String selection = CallLog.Calls.DURATION + " > 300"; final Cursor cursor = contentResolver.query(uri, new String[]{CallLog.Calls.DATE}, selection, null, CallLog.Calls.DATE + " DESC"); try { if (cursor.moveToFirst()) { return cursor.getLong(cursor.getColumnIndex(CallLog.Calls.DATE)); } } finally { cursor.close(); } return -1; } }
2433da92-68df-46d0-977d-b4e44ec1a05b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-03-09T04:26:46", "repo_name": "AutumnIDavis/digitalClock", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1043, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "3d8048e28ae07b7644d214289409ae914cf99074", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AutumnIDavis/digitalClock
192
FILENAME: README.md
0.253861
# digitalClock A digital clock written with HTML, CSS, and JavaScript This clock changes it's greeting message and background image in relation to time in JS. Language: HTML, CSS, JavaScript I. Goal --------- To sucessfully link three different types of files (JavaScript, HTML, CSS) to one, and create a working, digital clock that changes it's greeting and background image according to the time. II. File list --------------- images/ images folder digital_clock_workshop.js the JS that contains the clock function and controls when the images and greetings appear digital_clock_workshop.css stylesheet containing styling for the clock and greeting digital_clock_workshop.html HTML that contains actual greeting and clock README.md This II. Design ---------- A simple, but elegant page designed to be simplistic and minimalistic. Attention is put on the clock with a transparent background that highlights the time and beautiful background images.
700c1a7a-5025-4010-99b9-9ba1b94a657d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-18 08:33:51", "repo_name": "suns303/hi", "sub_path": "/src/passwordre.java", "file_name": "passwordre.java", "file_ext": "java", "file_size_in_byte": 1093, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "e6d0a824d28897a8006de8ac6e74113ded523659", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/suns303/hi
272
FILENAME: passwordre.java
0.281406
import java.util.Scanner; /** * Created by danawacomputer on 2017-04-05. */ public class passwordre { public static void main(String[]args){ Scanner in = new Scanner(System.in); System.out.println("단어하나를 입력하세요"); String soonsung = in.nextLine(); String prefix ="$$"; String prepost ="##"; int SquareLengchar = soonsung.length()*soonsung.length(); soonsung = soonsung.substring(0,1).toUpperCase()+soonsung.substring(1); String password = prefix+soonsung+SquareLengchar+prepost; double hwang = result(soonsung.length()); String jusun = sujung(prefix,soonsung,SquareLengchar,prepost); System.out.println(hwang); System.out.println(jusun); } public static double result(int soonsung){ double hwang =soonsung*soonsung; return hwang; } public static String sujung(String prefix,String soonsung,int SquareLengchar,String prepost){ String jusun = prefix+soonsung+SquareLengchar+prepost; return jusun; } }
49849a49-1e3a-4a32-9e1f-a90a54fd6751
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-03-15T05:36:08", "repo_name": "JakeJMattson/DirectoryFlattener", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1186, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "338464e30b6fe222bb25904560a09a5f746f63dd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JakeJMattson/DirectoryFlattener
321
FILENAME: README.md
0.272025
<p align="center"> <a href="https://kotlinlang.org/"> <img src="https://img.shields.io/badge/Kotlin-1.3.70-blue.svg" alt="Kotlin 1.3.70"> </a> <a href="LICENSE.md"> <img src="https://img.shields.io/github/license/JakeJMattson/DirectoryFlattener.svg" alt="license"> </a> </p> # DirectoryFlattener <p align="justify"> This program flattens a directory by extracting all files in all sub-directories into to a single root directory. </p> ## Prerequisites ### Languages * [Kotlin](https://kotlinlang.org/) ## Getting Started (Software) ### Installing Java <p align="justify"> Visit the <a href="https://www.oracle.com/technetwork/java/javase/downloads/index.html">Java Downloads</a> page and select the version of your choice. Run the installer and follow the instructions provided. </p> ## Building This project is built with Maven. To build the `pom.xml`, please follow the import instructions for your IDE. * [IntelliJ](https://www.tutorialspoint.com/maven/maven_intellij_idea.htm) * [Eclipse](https://www.tutorialspoint.com/maven/maven_eclispe_ide.htm) ## License This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
db630744-51ca-4892-96d2-18735ae21651
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-15 20:45:40", "repo_name": "Evan8456/Quiz-Applet", "sub_path": "/FileChooser.java", "file_name": "FileChooser.java", "file_ext": "java", "file_size_in_byte": 1074, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "3cd1c82e97ed34cf5420c4c3efbbfde318780e95", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Evan8456/Quiz-Applet
223
FILENAME: FileChooser.java
0.282196
import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import java.io.*; public class FileChooser /* * By: Evan NG * ICS4U0-D1 * 323058826 */ { private static String fileName; public static void chooseFile() { // creates a file chooser so the user can choose a file from his/her library. JFileChooser chooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter("TXT Files", "txt"); chooser.setFileFilter(filter); int returnVal = chooser.showOpenDialog(null); if(returnVal == JFileChooser.APPROVE_OPTION) { //System.out.println("You chose to open this file: " + chooser.getSelectedFile()); fileName = chooser.getSelectedFile().getAbsolutePath(); } } public static String getFile() /* * This method returns the File that the user has choosen. */ { chooseFile(); return fileName; } }
ff08d3c4-a902-4b17-ac75-9f7b08923efa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-02 12:06:02", "repo_name": "mustaevrmn/restapp", "sub_path": "/src/main/java/ru/mustaev/restapp/service/ClientService.java", "file_name": "ClientService.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "b70b3d43fc3aaf496949f2be38a510bc1a248b03", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mustaevrmn/restapp
188
FILENAME: ClientService.java
0.284576
package ru.mustaev.restapp.service; import org.springframework.stereotype.Service; import ru.mustaev.restapp.domain.Client; import ru.mustaev.restapp.repo.ClientRepository; import java.util.List; import java.util.Optional; @Service public class ClientService { private final ClientRepository clientRepository; public ClientService(ClientRepository clientRepository) { this.clientRepository = clientRepository; } public List<Client> findAll(){ return clientRepository.findAll(); } public Client save(Client client){ return clientRepository.save(client); } public Optional<Client> findById(Long id){ return clientRepository.findById(id); } public void deleteById(Long id){ clientRepository.deleteById(id); } public List<String> findAllByName(){ return clientRepository.findAllByName(); } public List<String> findAllContainingNameAsc(String filter){ return clientRepository.findAllContainingNameAsc(filter); } }
fdffef5e-c26a-40eb-a445-2d7c1cde6cf6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-19 10:32:03", "repo_name": "homertruong66/research", "sub_path": "/uma/src/main/java/com/hoang/uma/common/dto/ResponseDto.java", "file_name": "ResponseDto.java", "file_ext": "java", "file_size_in_byte": 1138, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "01f9c5c75d3520738a777d9deb87934f4b7d8dee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/homertruong66/research
253
FILENAME: ResponseDto.java
0.23231
package com.hoang.uma.common.dto; import com.fasterxml.jackson.annotation.JsonProperty; import java.io.Serializable; /** * homertruong */ public class ResponseDto implements Serializable { private static final long serialVersionUID = 1398775962163354764L; @JsonProperty private int status = 1; @JsonProperty private Object data; @JsonProperty private int code = 200; @JsonProperty private String message = "Request has been processed successfully!"; public ResponseDto() {} public ResponseDto(Object data) { this.data = data; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public Object getData() { return data; } public void setData(Object data) { this.data = data; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
7f4c27c0-a5b4-48ce-967d-f45f373d8af8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-29 14:56:46", "repo_name": "drendina/CommerceApp", "sub_path": "/src/main/java/com/sopra/model/Cart.java", "file_name": "Cart.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 67, "lang": "en", "doc_type": "code", "blob_id": "4736c09b5454391a42c5fb6ef4b5c3dad826151f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/drendina/CommerceApp
262
FILENAME: Cart.java
0.278257
package com.sopra.model; import org.springframework.stereotype.Repository; import javax.persistence.*; import java.io.Serializable; @Repository @Entity @Table(name = "cart") public class Cart implements Serializable { @Id @Column @GeneratedValue(strategy = GenerationType.AUTO) private int idCart; @Column private int amount; @Column private int idUser; public Cart() { this.amount = 0; } public Cart(int idUser) { this.amount = 0; this.idUser = idUser; } public int getIdCart() { return idCart; } public void setIdCart(int idCart) { this.idCart = idCart; } public int getAmount() { return amount; } public void setAmount(int amount) { this.amount = amount; } public int getIdUser() { return idUser; } public void setIdUser(int idUser) { this.idUser = idUser; } @Override public String toString() { return "Cart{" + "idCart=" + idCart + ", amount=" + amount + ", idUser=" + idUser + '}'; } }
f4b5c87d-228a-4e07-b660-5e857809c61d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-01 02:41:37", "repo_name": "MichaelTran502/Helsinki-MOOC-Java-Programming-II", "sub_path": "/part08-Part08_07.Abbreviations/src/main/java/Abbreviations.java", "file_name": "Abbreviations.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "1590c705b983cde8645027d3cc24aab655345068", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MichaelTran502/Helsinki-MOOC-Java-Programming-II
236
FILENAME: Abbreviations.java
0.285372
import java.util.HashMap; /* * 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. */ /** * * @author michael */ public class Abbreviations { private HashMap<String, String> hashmap; public Abbreviations() { this.hashmap = new HashMap<>(); } public void addAbbreviation(String abbreviation, String explanation) { String name = sanitizedString(abbreviation); if (this.hashmap.containsKey(name)) { System.out.println("Already contains abbreviation"); } else { this.hashmap.put(name, explanation); } } public boolean hasAbbreviation(String abbreviation) { return this.hashmap.containsKey(sanitizedString(abbreviation)); } public String findExplanationFor(String abbreviation) { return this.hashmap.get(sanitizedString(abbreviation)); } public static String sanitizedString(String string) { if (string == null) { return ""; } string = string.toLowerCase(); return string.trim(); } }
1d4c71a3-aba8-4a4f-a109-284b52355e16
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-14 01:44:09", "repo_name": "beisir/ThreeMagicNumber", "sub_path": "/dataweb/src/main/java/com/hc360/dataweb/service/impl/UpdownExcelServiceImpl.java", "file_name": "UpdownExcelServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1095, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "6dc4fefb90ae8c64ed170616f2e6ff5ad55e84a9", "star_events_count": 2, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/beisir/ThreeMagicNumber
247
FILENAME: UpdownExcelServiceImpl.java
0.276691
package com.hc360.dataweb.service.impl; import com.hc360.dataweb.dao.UpdownExcelMapper; import com.hc360.dataweb.model.OrderMoveTable; import com.hc360.dataweb.model.TaskTable; import com.hc360.dataweb.service.UpdownExcelService; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Map; /** * Created by dell on 2017/12/8. */ @Service public class UpdownExcelServiceImpl implements UpdownExcelService { private Logger logger = Logger.getLogger(UpdownExcelServiceImpl.class); @Autowired private UpdownExcelMapper udMapper; @Override public int insertTasks(ArrayList<TaskTable> tasks) throws Exception { return udMapper.insertTasks(tasks); } @Override public ArrayList<TaskTable> getTasks(Map<String, Object> params) throws Exception { return null; } @Override public int insertOrders(ArrayList<OrderMoveTable> orders) throws Exception { return udMapper.insertOrders(orders); } }
535c08bf-dae0-4fe9-85aa-a62fd8709e5d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-26 02:37:25", "repo_name": "yiranyyu/2019SummerBlogBackend_Deprecated", "sub_path": "/src/main/java/buaasoft/blog/utils/Responses.java", "file_name": "Responses.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "ba23735c9f9ff9fa09420d418770b9a58a1529f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/yiranyyu/2019SummerBlogBackend_Deprecated
193
FILENAME: Responses.java
0.216012
package buaasoft.blog.utils; import com.alibaba.fastjson.JSONObject; /** * @author Yirany * @version 1.0 * @since 8/25/2019 **/ public class Responses { public static String userNotFoundResponse(String username) { JSONObject response = new JSONObject(); response.put(Constants.STATUS, false); response.put(Constants.errorMessage, "Cannot find user " + username); return response.toJSONString(); } public static String postNotFoundResponse(long postID) { JSONObject response = new JSONObject(); response.put(Constants.STATUS, false); response.put(Constants.errorMessage, "Cannot find post " + postID); return response.toJSONString(); } public static String tagNotFoundResponse(String tagName) { JSONObject response = new JSONObject(); response.put(Constants.STATUS, false); response.put(Constants.errorMessage, "Cannot find tag " + tagName); return response.toJSONString(); } }
f6268b7a-a55a-48bb-a776-8d868a0336ac
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2022-09-12T23:31:08", "repo_name": "davidmkirby/Coursework", "sub_path": "/ECE420 - Senior Design II/Code/I2C_string/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1135, "line_count": 16, "lang": "en", "doc_type": "text", "blob_id": "cf47cab6f5a5201efadf6f88907eda7f662b9c3f", "star_events_count": 3, "fork_events_count": 4, "src_encoding": "UTF-8"}
https://github.com/davidmkirby/Coursework
300
FILENAME: README.md
0.278257
## Adafruit I2C FRAM 16-bit Strings ## This driver is for the [Adafruit I2C FRAM](https://www.adafruit.com/product/1895) breakout. Install this library & example by downloading the .zip file from this Git and unzipping it into your Arduino > Library folder ([more info here](https://www.arduino.cc/en/Guide/Libraries)). ## About this Driver ## These modules use I2C to communicate, two pins are required to interface. Adafruit I2C breakouts use MB85RC256V FRAMs and are only able to write 8 bits of data per memory location. To write 16 bits to the memory, a function (write16) takes a 16-bit variable and splits it into two parts then saves the two 8-bit halves into two adjacent memory locations. This allows them to be concatenated using [bitwise operations](https://en.wikipedia.org/wiki/Bitwise_operation). Memory addresses may be changed by driving the different pins higher as explained by Adafruit [here](https://learn.adafruit.com/adafruit-i2c-fram-breakout/pinouts#i2c-logic-pins-2-3): Library, inspiration, and thanks go out to [Mario](http://mario.mtechcreations.com/programing/my-adafruit-fram-i2c-plus-library/):
46a27b75-2ec5-44b8-b7b0-f041a7ea55d3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-16 07:29:42", "repo_name": "Dean-Hu-Nan/deanframework", "sub_path": "/src/main/java/com/dean4j/framework/uitl/PropsUtil.java", "file_name": "PropsUtil.java", "file_ext": "java", "file_size_in_byte": 1295, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "5aa958d6884009e788a52e1bf4d0fcd5f13591b6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Dean-Hu-Nan/deanframework
252
FILENAME: PropsUtil.java
0.243642
package com.dean4j.framework.uitl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; /** * 提供加载配置文件公共类 * * @author hunan * @since 1.0.0 */ public final class PropsUtil { private static final Logger LOGGER = LoggerFactory.getLogger(PropsUtil.class); /** * 加载属性文件 * @param fileName * @return */ public static Properties loadProps(String fileName) { Properties properties = null; InputStream is = null; try { is = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); if (is == null) { throw new FileNotFoundException("配置文件不存在"); } properties = new Properties(); properties.load(is); } catch (Exception e) { LOGGER.error("加载文件错误", e); } finally { if (is != null) { try { is.close(); } catch (IOException e) { LOGGER.error("关闭文件流错误", e); } } } return properties; } }
9eec4099-076e-4751-bb96-424174af67a9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-25 03:03:13", "repo_name": "utrycloud/openticket", "sub_path": "/src/main/java/com/utry/openticket/config/DevolopMvc.java", "file_name": "DevolopMvc.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "d17afbe3e7f21386199c1d6a9d66028dd505bb57", "star_events_count": 7, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/utrycloud/openticket
222
FILENAME: DevolopMvc.java
0.224055
package com.utry.openticket.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration public class DevolopMvc implements WebMvcConfigurer { @Autowired private LoginHandlerInterceptor loginHandlerInterceptor; @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/login.html").setViewName("/login"); registry.addViewController("/login2.html").setViewName("/login2"); } @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(loginHandlerInterceptor).addPathPatterns("/**") .excludePathPatterns("/login.html", "/login", "/login2.html","/logout","/error","/403", "/assets/**","/scripts/**","/css/**","/fonts/**","/img/**","/plugins/**", "/table/**"); } }
6e0ff1e4-9fb0-48de-aa9e-19c8bbd74ec4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-15 12:07:31", "repo_name": "xuxiaowei-com-cn/captcha", "sub_path": "/src/main/java/cn/com/xuxiaowei/captcha/servlet/SpecCaptchaHttpServlet.java", "file_name": "SpecCaptchaHttpServlet.java", "file_ext": "java", "file_size_in_byte": 1140, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "84eb33fd0d3c0627294469a4602e54053f481d8d", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/xuxiaowei-com-cn/captcha
246
FILENAME: SpecCaptchaHttpServlet.java
0.2227
package cn.com.xuxiaowei.captcha.servlet; import com.pig4cloud.captcha.SpecCaptcha; import lombok.extern.slf4j.Slf4j; 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; /** * 普通验证码 * * @author xuxiaowei * @since 0.0.1 */ @Slf4j @WebServlet(urlPatterns = "/spec-captcha") public class SpecCaptchaHttpServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { SpecCaptcha specCaptcha = new SpecCaptcha(130, 48); String text = specCaptcha.text(); log.info("图片验证码:{}", text); // 设置响应头 resp.setContentType(specCaptcha.getContentType()); resp.setHeader("Pragma", "No-cache"); resp.setHeader("Cache-Control", "no-cache"); resp.setDateHeader("Expires", 0); // 转换流信息写出 specCaptcha.out(resp.getOutputStream()); } }
45286f5a-1920-4d00-b27d-1422aa946fc1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-01 12:08:27", "repo_name": "fengyhaispeech/learngit2", "sub_path": "/app/src/main/java/com/yihengke/robotspeech/clockUtils/MyAlarmReceiver.java", "file_name": "MyAlarmReceiver.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "50ddb109b41e17a78755aaaba1c9e2f6b156e8e3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fengyhaispeech/learngit2
232
FILENAME: MyAlarmReceiver.java
0.259826
package com.yihengke.robotspeech.clockUtils; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; import com.yihengke.robotspeech.activity.ClockActivity; /** * Created by android on 2016/3/21. * * @author YHX */ public class MyAlarmReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.e("MyAlarmReceiver", "接收到提醒的广播..."); String msg = intent.getStringExtra("msg"); long intervalMillis = intent.getLongExtra("intervalMillis", 0); if (intervalMillis != 0) { AlarmManagerUtil.setAlarmTime(context, System.currentTimeMillis() + intervalMillis, intent); } int flag = intent.getIntExtra("soundOrVibrator", 0); Intent clockIntent = new Intent(context, ClockActivity.class); clockIntent.putExtra("msg", msg); clockIntent.putExtra("flag", flag); clockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(clockIntent); } }
28d24ac7-ddfd-4ab6-ab83-4214fab0bd1a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-06 10:03:39", "repo_name": "codermahadi/drawerNavigation", "sub_path": "/app/src/main/java/com/example/mahadi/drowerlayout/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "c677625f787397b08e4a45347402f9b4c532c975", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/codermahadi/drawerNavigation
195
FILENAME: MainActivity.java
0.216012
package com.example.mahadi.drowerlayout; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends AppCompatActivity { private DrawerLayout myDrawerLayout; private ActionBarDrawerToggle drawerToggle; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); myDrawerLayout = (DrawerLayout) findViewById(R.id.drawer); drawerToggle = new ActionBarDrawerToggle(this, myDrawerLayout, R.string.open, R.string.close); myDrawerLayout.addDrawerListener(drawerToggle); drawerToggle.syncState(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } @Override public boolean onOptionsItemSelected(MenuItem item) { if (drawerToggle.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } }
74ccc8c1-d7f3-47b5-bc6f-2a5e3c8ba9fa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-29 14:02:03", "repo_name": "mercutiy/MambaTest", "sub_path": "/app/src/main/java/ru/mamba/test/mambatest/api/controller/SecretAuth.java", "file_name": "SecretAuth.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "67086a5888d3778f80f9d6cca3793992055cf57c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mercutiy/MambaTest
224
FILENAME: SecretAuth.java
0.289372
package ru.mamba.test.mambatest.api.controller; import org.json.JSONException; import org.json.JSONObject; import ru.mamba.test.mambatest.api.Request; public class SecretAuth extends Controller<SecretAuth.Model> implements Authorise { private final static String METHOD = Request.POST; private final static String URI = "/login/secret/"; private final static String A_STR_SECRET = "secret"; public SecretAuth(String secret) throws JSONException { JSONObject jsonRequest = new JSONObject(); jsonRequest.put(A_STR_SECRET, secret); setRequest(new Request(URI, METHOD, null, jsonRequest)); } @Override protected Model parseResponse(JSONObject json) throws JSONException { Model response = new Model(); if (json.has(F_INT_ERROR_CODE)) { response.setErrorCode(json.getInt(F_INT_ERROR_CODE)); } return response; } public class Model { private int mErrorCode; public int getErrorCode() { return mErrorCode; } public void setErrorCode(int errorCode) { mErrorCode = errorCode; } } }
f24bf197-3aba-46a4-a1a6-2d26fc1f8ca4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-08 18:52:52", "repo_name": "dasilva-gabriel/spigot-projects", "sub_path": "/2014-pvp-warcraft/2020-SheepWars/src/fr/cmuagab/sheepwars/event/player/PlayerPickupItem.java", "file_name": "PlayerPickupItem.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "da95fe4b23d6b9adec3635abf48148c323fe6c55", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dasilva-gabriel/spigot-projects
269
FILENAME: PlayerPickupItem.java
0.272799
package fr.cmuagab.sheepwars.event.player; import fr.cmuagab.sheepwars.SheepWarsPlugin; import fr.cmuagab.sheepwars.event.SheepListener; import fr.cmuagab.sheepwars.handler.Sheep; import fr.cmuagab.sheepwars.handler.Step; import fr.cmuagab.sheepwars.handler.Team; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerPickupItemEvent; public class PlayerPickupItem extends SheepListener { public PlayerPickupItem(final SheepWarsPlugin plugin) { super(plugin); } @EventHandler(priority = EventPriority.HIGHEST) public void onPlayerPickupItem(final PlayerPickupItemEvent event) { if (!Step.isStep(Step.IN_GAME) || Team.getPlayerTeam(event.getPlayer()) == Team.SPEC) { event.setCancelled(true); } else { boolean cancel = true; for (final Sheep sheep : Sheep.values()) { if (sheep.getIcon().isSimilar(event.getItem().getItemStack())) { cancel = false; break; } } if (cancel) { event.setCancelled(true); } } } }
f0104021-c139-462b-b5f5-522f0d73d86f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-07T21:24:01", "repo_name": "pjhg14/ApartMate", "sub_path": "/src/com/graham/apartmate/ui/windows/dbgwindow/DebugWindowController.java", "file_name": "DebugWindowController.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "66999bf7280e0d3b9129350feb3aa09e8db14090", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/pjhg14/ApartMate
232
FILENAME: DebugWindowController.java
0.26588
package com.graham.apartmate.ui.windows.dbgwindow; import com.graham.apartmate.database.utilities.unordered.TestingData; import com.graham.apartmate.main.Main; import com.graham.apartmate.ui.res.classes.FXMLLocation; import javafx.fxml.FXML; import javafx.scene.control.Alert; import javafx.scene.control.ButtonType; import javafx.scene.text.Text; import java.util.Optional; public class DebugWindowController { @FXML private Text exeText; @FXML public void loadSampleData() { Alert confirmation = new Alert(Alert.AlertType.CONFIRMATION); confirmation.setContentText("Are you sure you want to load sample data?"); Optional<ButtonType> optional = confirmation.showAndWait(); if (optional.isPresent() && optional.get() == ButtonType.OK){ TestingData sampleData = new TestingData(); sampleData.useTestingData(); exeText.setVisible(true); exeText.setText("Sample Data Loaded"); } } @FXML public void done() { Main.getLibrary().mainWindow(FXMLLocation.MAIN); } }
8b32d58e-958c-484a-a6a8-d497afeeb285
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-15 12:50:06", "repo_name": "dilipduraiswamy/HouseHoldIncomeCalculator", "sub_path": "/HouseHoldIncomeCalculator/src/com/one/jan/one/dto/Items.java", "file_name": "Items.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 81, "lang": "en", "doc_type": "code", "blob_id": "231134172a23a016713264a7dff2b0b5ba5e9978", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dilipduraiswamy/HouseHoldIncomeCalculator
303
FILENAME: Items.java
0.279042
/** * */ package com.one.jan.one.dto; /** * @author dilip.duraiswamy * */ public class Items { private String itemName; private float itemCost; private int quantity; /** * @return the quantity */ public int getQuantity() { return quantity; } /** * @param quantity * the quantity to set */ public void setQuantity(int quantity) { this.quantity = quantity; } /** * @return the itemName */ public String getItemName() { return itemName; } /** * @param itemName * the itemName to set */ public void setItemName(String itemName) { this.itemName = itemName; } /** * @return the itemCost */ public float getItemCost() { return itemCost; } /** * @param itemCost * the itemCost to set */ public void setItemCost(float itemCost) { this.itemCost = itemCost; } /** * @param itemName * @param itemCost * @param quantity */ public Items(String itemName, float itemCost, int quantity) { super(); this.itemName = itemName; this.itemCost = itemCost; this.quantity = quantity; } /** * */ public Items() { super(); } }
658b73ed-f7e9-4c38-8ace-f04521b85dce
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-22 07:43:59", "repo_name": "WassiW80/MoodAnalyzer", "sub_path": "/src/main/java/com/moodanalyzer/MoodAnalyzer.java", "file_name": "MoodAnalyzer.java", "file_ext": "java", "file_size_in_byte": 1078, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "b282e470772df9b5f4eae5631e3cb77dcb3d96b2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/WassiW80/MoodAnalyzer
211
FILENAME: MoodAnalyzer.java
0.256832
package com.moodanalyzer; import com.moodanalyzer.exception.MoodAnalysisException; public class MoodAnalyzer { private String message; public MoodAnalyzer() { message = "default"; } public MoodAnalyzer(String message) { this.message = message; } private String analyseMood(String message) { this.message = message; return analyseMood(); } public String analyseMood() { try { if (message.isEmpty()) throw new MoodAnalysisException("Entered field cannot be empty.", MoodAnalysisException.ExceptionType.EXCEPTION_EMPTY); if (message.contains("sad")) return "SAD"; return "HAPPY"; } catch (NullPointerException e) { throw new MoodAnalysisException("Please enter a proper mood.", MoodAnalysisException.ExceptionType.EXCEPTION_NULL); } } public boolean equals(Object another) { if (this.message.equals(((MoodAnalyzer) another).message)) return true; return false; } }
d172191a-784c-4dd0-9970-0ad9373b8f6a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-17 19:04:54", "repo_name": "qazkth/hw", "sub_path": "/3/src/server/startup/Server.java", "file_name": "Server.java", "file_ext": "java", "file_size_in_byte": 1157, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "d109624f86c693397225a7fb8eb0951877cb40e9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/qazkth/hw
220
FILENAME: Server.java
0.29584
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package server.startup; import java.rmi.Naming; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import server.controller.Controller; /** * * @author Oscar */ public class Server { public static void main(String[] args) { try { new Server().startRegistry(); Controller contr = new Controller(); Naming.rebind(Controller.SERVER_NAME_IN_REGISTRY, contr); System.out.println("Server is running"); new Thread(new TCPServer(contr)).start(); } catch (Exception e) { System.err.println("Server exception: " + e.toString()); e.printStackTrace(); } } private void startRegistry() throws RemoteException { try { LocateRegistry.getRegistry().list(); } catch (Exception e) { LocateRegistry.createRegistry(Registry.REGISTRY_PORT); } } }
36fe268b-44a9-490a-9828-a9c08ad47f6f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-21 08:22:12", "repo_name": "yOneChu/hyo_pms", "sub_path": "/src/main/java/org/kyhslam/controller/HelloController.java", "file_name": "HelloController.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "e5156f0f89cbf7b4613a74bcc41c911458649a2a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/yOneChu/hyo_pms
228
FILENAME: HelloController.java
0.195594
package org.kyhslam.controller; import lombok.extern.slf4j.Slf4j; import org.dom4j.rule.Mode; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import java.lang.reflect.Member; @Controller @Slf4j public class HelloController { @GetMapping("/hello") public String hello(Model model) { String data = "kyhslam"; model.addAttribute("data", data); //return "board/boardList"; return "main"; } @GetMapping("/hello/list") public String list(Model model) { return "/members/memberList"; } @GetMapping("/hello/create") public String create(Model model){ model.addAttribute("memberForm", new MemberForm()); return "/members/createMemberForm"; } @GetMapping("/hello/jsptest") public String tt(Model model) { log.info("ttjspTest ======"); return "main"; } @GetMapping("/hello/issueList") public String issueList(Model model) { return "issueBoard"; } }
48af7b5c-4c27-4f5c-bec0-98209d14d998
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-06 10:28:28", "repo_name": "susiha/AspectJLecture", "sub_path": "/app/src/main/java/com/susiha/aspectjlecture/SecondaryActivity.java", "file_name": "SecondaryActivity.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "bd23b54b9d3f932cba0d925d87df18a8a5d565db", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/susiha/AspectJLecture
218
FILENAME: SecondaryActivity.java
0.249447
package com.susiha.aspectjlecture; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import com.susiha.aspectjlecture.bean.FirstBean; import com.susiha.aspectjlecture.fast.ThirdActivity; public class SecondaryActivity extends Activity { public static void startActivity(Activity activity){ Intent intent = new Intent(activity,SecondaryActivity.class); activity.startActivity(intent); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_secondary); findViewById(R.id.secondary_button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ThirdActivity.startActivity(SecondaryActivity.this); } }); getmFlag(); } private void getmFlag(){ FirstBean bean = new FirstBean(20); bean.getmFlag(); } @Override protected void onStart() { super.onStart(); } @Override protected void onStop() { super.onStop(); } }
aa8245ab-3e0b-4696-bf0c-581e2a5983d1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-02-02T09:30:48", "repo_name": "apache/servicecomb-docs", "sub_path": "/java-chassis-reference/en_US/docs/packaging/standalone.md", "file_name": "standalone.md", "file_ext": "md", "file_size_in_byte": 1112, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "b24da5270b8530efdb05bedbc03edb7c73abf9cd", "star_events_count": 568, "fork_events_count": 74, "src_encoding": "UTF-8"}
https://github.com/apache/servicecomb-docs
231
FILENAME: standalone.md
0.273574
## Concept Description A Standalone container that loads Spring with a simple Main, because the service usually does not require the properties of a Web container such as Tomcat/JBoss, and there is no need to use the Web container to load the service. The microframework provides a standalone deployment run mode. The service container is just a simple Main method and loads a simple Spring container to expose the service. ## Operation steps * **Step 1** Write the Main function, initialize the log and load the service configuration as follows: ```java import org.apache.servicecomb.foundation.common.utils.BeanUtils; import org.apache.servicecomb.foundation.common.utils.Log4jUtils; public class MainServer { public static void main(String[] args) throws Exception {  Log4jUtils.init(); # Log initialization  BeanUtils.init(); # Spring bean initialization } } ``` * **Step 2** Run the MainServer to start the microservice process and expose the service. ## Notes If you are using the rest network channel, you need to change the transport in the pom to use the cse-transport-rest-vertx package.
b9b929a4-bc26-4367-a30d-2c45cde3c577
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-26 21:38:10", "repo_name": "doaaessam98/steganography-app", "sub_path": "/app/src/main/java/com/example/steganography/base/BaseFragment.java", "file_name": "BaseFragment.java", "file_ext": "java", "file_size_in_byte": 1089, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "22ecbe56c1f8162d9d9eaf9af526c11ecc3ec6ab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/doaaessam98/steganography-app
181
FILENAME: BaseFragment.java
0.26588
package com.example.steganography.base; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.databinding.ViewDataBinding; import androidx.fragment.app.Fragment; public abstract class BaseFragment<VM extends BaseViewModel, DB extends ViewDataBinding> extends Fragment { //open var useSharedViewModel: Boolean = false public DB dataBinding; protected VM viewModel; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); dataBinding = getViewBinding(); viewModel = getViewModel(); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return dataBinding.getRoot() ; } protected abstract VM getViewModel(); public abstract DB getViewBinding(); }
d933b5ae-7379-4300-8053-1e190bd0f4da
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-10 11:22:58", "repo_name": "Lubycon/DEVTI-back", "sub_path": "/src/main/java/com/lubycon/devti/domain/event_log/dto/EventLogPostDto.java", "file_name": "EventLogPostDto.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "470f952ef3100b3d4989adfa9292d0f15b0c5c4d", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/Lubycon/DEVTI-back
251
FILENAME: EventLogPostDto.java
0.272025
package com.lubycon.devti.domain.event_log.dto; import com.lubycon.devti.global.code.EventType; import com.lubycon.devti.global.code.TestType; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.NotNull; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; public class EventLogPostDto { @Getter @NoArgsConstructor public static class EventLogPostReqDto { @NotNull @ApiModelProperty(value = "event type", example = "CLICK_CTA_BUTTON") private EventType eventType; @NotNull @ApiModelProperty(value = "Bucket test type", example = "TYPE_COMMON_1") private TestType testType; } @Getter @Setter @NoArgsConstructor public static class EventLogPostResDto { private Long id; @org.jetbrains.annotations.NotNull private TestType testType; @org.jetbrains.annotations.NotNull private EventType eventType; @Builder public EventLogPostResDto(Long id, TestType testType, EventType eventType) { this.id = id; this.testType = testType; this.eventType = eventType; } } }
758597cb-2f4d-49be-85c8-2a7a075c2cb2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-20 10:29:27", "repo_name": "junkdog/artemis-odb", "sub_path": "/artemis-fluid/artemis-fluid-core/src/main/java/com/artemis/generator/model/type/TypeModel.java", "file_name": "TypeModel.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "d83269bbe4f30bb6015f959282fc2958d263d453", "star_events_count": 774, "fork_events_count": 164, "src_encoding": "UTF-8"}
https://github.com/junkdog/artemis-odb
238
FILENAME: TypeModel.java
0.272025
package com.artemis.generator.model.type; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; /** * Sourcecode generator agnostic model of class. * <p> * @author Daan van Yperen */ public class TypeModel { public String name = "unnamed"; public String packageName = "com.artemis"; public List<MethodDescriptor> methods = new ArrayList<MethodDescriptor>(); public List<FieldDescriptor> fields = new ArrayList<FieldDescriptor>(); public Type superclass; public Type superinterface; // currently supports only 1 interface. /** Add method to model. */ public void add(MethodDescriptor method) { methods.add(method); } /** * Get method that matches signature exactly. * @return {@code method}, or {@code null}. */ public MethodDescriptor getMethodBySignature(String signature) { for (MethodDescriptor method : methods) { if (signature.equals(method.signature(true, true))) { return method; } } return null; } public void add(FieldDescriptor field) { fields.add(field); } }
b0471aff-71f7-47ec-961a-6cc2bd27fda4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-07 14:46:15", "repo_name": "disconnect101/FPO_portal", "sub_path": "/Farmer App/app/src/main/java/com/example/ruralcaravan/ResponseClasses/LoginResponse.java", "file_name": "LoginResponse.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "c7cbde166c18eda58fa30d13fee9499e6fd6cf0e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/disconnect101/FPO_portal
230
FILENAME: LoginResponse.java
0.206894
package com.example.ruralcaravan.ResponseClasses; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "statuscode", "token", "category" }) public class LoginResponse { @JsonProperty("statuscode") private String statuscode; @JsonProperty("token") private String token; @JsonProperty("category") private String category; @JsonProperty("statuscode") public String getStatuscode() { return statuscode; } @JsonProperty("statuscode") public void setStatuscode(String statuscode) { this.statuscode = statuscode; } @JsonProperty("token") public String getToken() { return token; } @JsonProperty("token") public void setToken(String token) { this.token = token; } @JsonProperty("category") public String getCategory() { return category; } @JsonProperty("category") public void setCategory(String category) { this.category = category; } }
4dcfaa08-7c45-45fa-ac74-6c1a9003b737
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-15 11:21:46", "repo_name": "rmatag/TrafficDrones", "sub_path": "/src/main/java/com/rmatag/traffic/components/Dispatcher.java", "file_name": "Dispatcher.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "4b07683ec8f1bc40de3a41da728fd1f399e9fc4f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rmatag/TrafficDrones
257
FILENAME: Dispatcher.java
0.264358
package com.rmatag.traffic.components; import com.rmatag.traffic.TrafficDronesApp; import com.rmatag.traffic.dto.DroneMessage; import com.rmatag.traffic.dto.DroneMessageType; import java.util.List; public class Dispatcher implements Runnable { public static final String SIMULATION_TIMEOUT = "08:10:00"; private MessageGateway messageGateway; private List<DroneMessage> droneMessages; public Dispatcher(MessageGateway messageGateway, List<DroneMessage> dronesMessages) { this.messageGateway = messageGateway; this.droneMessages = dronesMessages; } @Override public void run() { boolean shutdown = false; int i = 0; while (!shutdown && i < droneMessages.size()) { DroneMessage message = droneMessages.get(i); if (!DroneMessageType.SHUTDOWN.equals(message.getDroneMessageType())) { messageGateway.sendMessage(message); i++; } else { shutdown = true; TrafficDronesApp.shutdownTrafficDronesApp(); } } } public void setDroneMessages(List<DroneMessage> droneMessages) { this.droneMessages = droneMessages; } }
0cc3f085-8a35-4822-b67b-b0b44bbbd135
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-02 17:23:40", "repo_name": "Vladeslaw/Vlad2122", "sub_path": "/Homework/Lesson1/part2/Foodgoods.java", "file_name": "Foodgoods.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 24, "lang": "en", "doc_type": "code", "blob_id": "1eb66eab6aa6afa16f9663c6bd5819a45f724a01", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/Vladeslaw/Vlad2122
245
FILENAME: Foodgoods.java
0.274351
public class Foodgoods { public char name // name of the rpoduct public float prc; // price in dollars public float mas; // weight in kilograms public float vol; // volume in liters public byte expd; // day of expiration public byte expm; // motnth of expiration public byte expy; // year of expiration public byte dis; // % of discount private boolean eco // is a product ecologibally clean private boolean fat // does a product contain animal fat private short pcs; // number of pieces to buy public unpack(); // to unpack, unfold the product public moveToClos(); // to place a product into closet public moveToFrid(); // to place a product into fridge private moveToBas(); // to place a product into basement public dropToDish(); // to place a product into dish public moveToMicro(); // to place a product into microwave public putOnPan(); // to place product onto frying pan private putOnConservation(); // to conservate the product private moveToTrash(); // to trough out a product private moveToShop(); // to return product back to shop }
89a63195-df9a-4e42-a032-a3659fcdb248
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-06-27T15:02:35", "repo_name": "mkbaldwin/notes-public", "sub_path": "/conferences/2019-DevNexus/2019-03-07-DevNexus-S5-Spring_Security.md", "file_name": "2019-03-07-DevNexus-S5-Spring_Security.md", "file_ext": "md", "file_size_in_byte": 1048, "line_count": 18, "lang": "en", "doc_type": "text", "blob_id": "24e749a40fd8129973ce0ca08349677f62679b7e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mkbaldwin/notes-public
237
FILENAME: 2019-03-07-DevNexus-S5-Spring_Security.md
0.193147
# Spring Security 5.1 Rob Winch / @rob_winch Live demo of some microservices and setting up Spring Security * Example application with spring security 5.1 and oauth2 * Using [Keycloak](https://www.keycloak.org/about.html) as the sample IdP for OAuth * OAUTH scopes * Kind of like roles? * `@AuthenticationPrincipal` annotation lets you provide expressions to access values in your principal object. * Good idea to create a custom annotation (RUNTIME retention) and apply the authentication principal to that annotation. That way you don't have as much spring security stuff mixed into your code. * Method Security * `@EnableReactiveMethodSecurity` * `@PostAuthorize("returnObject?.to == principal?.claims['user_id']")` annotation applied to the repository paths * Only allows the requested message to be returned if the "to" contained the user's id. Can be used to prevent access based on the data being returned. * Spring security has support for Mock MVC for unit testing as well as spring web test client.
a5b255ec-2405-41b5-985b-5d89b99ffad5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-12 11:11:11", "repo_name": "vijayOL/demo", "sub_path": "/src/main/java/com/will/demo/controller/HelloController.java", "file_name": "HelloController.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "f7fcbe0125fb4f7a10af90b6167f4603a4dcecb1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/vijayOL/demo
249
FILENAME: HelloController.java
0.221351
package com.will.demo.controller; import com.will.demo.vo.Person; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; /** * @Description: * @see: demo * @Date 2018/1/24 15:07 * @Author Vijay Tang */ @RestController public class HelloController { @Autowired private Person person; @GetMapping(value="/hello") public String hello(@RequestParam("name")String name,@RequestParam("date")String date){ return "Hello SpringBoot,I am coming!"+name+",date:"+date; } @Value("${name}") private String name; @Value("${age}") private String age; @Value("${content}") private String content; @GetMapping(value ="/hi") public String say(){ return "name:"+name+",age:"+age; } @GetMapping(value ="/print") public String print(){ return "name:"+person.getName()+",age:"+person.getAge(); } @GetMapping(value ="/printContent") public String printContent(){ return content; } }
d2568596-07a5-4dd9-b117-6c25d6ffce6b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-06 08:32:33", "repo_name": "yaowenyu0927/helloGit", "sub_path": "/springboot-order-rabbitmq-consumer/src/main/java/com/ausware/yao/service/MessageAck/Producer.java", "file_name": "Producer.java", "file_ext": "java", "file_size_in_byte": 1226, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "8d8ef84723f7bba5493899d503cdfb2ba8b42d90", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/yaowenyu0927/helloGit
234
FILENAME: Producer.java
0.261331
package com.ausware.yao.service.MessageAck; import com.ausware.yao.utils.RabbitMQUtils; import com.rabbitmq.client.Channel; import com.rabbitmq.client.MessageProperties; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Scanner; import java.util.concurrent.TimeoutException; public class Producer { public final static String QUEUE_NAME = "ack_queue"; public static void main(String[] args) throws IOException, TimeoutException { Channel channel = RabbitMQUtils.getChannel(); //队列持久化 boolean durable = true; //开启发布确认 channel.confirmSelect(); long begin = System.currentTimeMillis(); channel.queueDeclare(QUEUE_NAME,durable,false,false,null); //从控制台中输入信息 Scanner scanner = new Scanner(System.in); while (scanner.hasNext()){ String message = scanner.next(); //消息持久化 MessageProperties.PERSISTENT_TEXT_PLAIN channel.basicPublish("",QUEUE_NAME, MessageProperties.PERSISTENT_TEXT_PLAIN,message.getBytes(StandardCharsets.UTF_8)); System.out.println("生产者发出消息:"+message); } } }
77cead39-8f58-4479-aebf-2810a1b7bb80
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-15 12:33:59", "repo_name": "assemtynyshtybay/AndroidLab7", "sub_path": "/JobDeveloper/app/src/main/java/com/example/jobdeveloper/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "8fb7a83e595da2476638b4ff4e80b6cc8dfc1e45", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/assemtynyshtybay/AndroidLab7
182
FILENAME: MainActivity.java
0.218669
package com.example.jobdeveloper; import androidx.appcompat.app.AppCompatActivity; import android.app.FragmentManager; import android.os.Bundle; import com.google.android.material.tabs.TabLayout; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // // com.tigerliang.tablayout.TabLayout tabs; // tabs = findViewById(R.id.tabs); // tabs.getTabAt(0).setIcon(R.drawable.ic_book); // tabs.getTabAt(1).setIcon(R.drawable.ic_fav); // tabs.getTabAt(2).setIcon(R.drawable.ic_more); //добавляем наш fragment jobs if (savedInstanceState == null) { FragmentManager fragmentManager = getFragmentManager(); fragmentManager .beginTransaction() .replace(R.id.fragment, FragJobs.newInstance()) .commit(); } } }
8673cdda-e287-480b-bf50-8540444ee75d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-20 15:15:45", "repo_name": "gustavolira/radargun", "sub_path": "/core/src/main/java/org/radargun/sysmonitor/SystemSlaveMonitor.java", "file_name": "SystemSlaveMonitor.java", "file_ext": "java", "file_size_in_byte": 1073, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "baa67c9942a0b54b2458206871ef7848626f9309", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/gustavolira/radargun
233
FILENAME: SystemSlaveMonitor.java
0.278257
package org.radargun.sysmonitor; import org.radargun.state.ServiceListener; import org.radargun.state.SlaveState; import org.radargun.traits.Lifecycle; /** * Retrieves system statistics from slave nodes. */ public class SystemSlaveMonitor extends AbstractMonitors<SlaveState, ServiceListener> implements ServiceListener { public static final String MONITORS = SystemSlaveMonitor.class.getName(); public SystemSlaveMonitor(SlaveState state, long period) { super(state, period); } @Override public synchronized void start() { state.addListener(this); state.put(MONITORS, this); Lifecycle lifecycle = state.getTrait(Lifecycle.class); if (lifecycle != null && lifecycle.isRunning()) { startInternal(); } } @Override public void afterServiceStart() { startInternal(); } @Override public void beforeServiceStop(boolean graceful) { stopInternal(); } @Override public void serviceDestroyed() { stop(); } public String getName() { return MONITORS; } }
beff9378-db41-45b7-9a11-ff60a3ecc222
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-22 19:52:03", "repo_name": "relax94/smapme_main", "sub_path": "/app/src/main/java/com/studio/a4kings/qr_code_app/Utils/DialogUtils.java", "file_name": "DialogUtils.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "220a11f86290e5e7d05fbbfed0f81d14169ef27a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/relax94/smapme_main
224
FILENAME: DialogUtils.java
0.272025
package com.studio.a4kings.qr_code_app.Utils; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import com.studio.a4kings.qr_code_app.R; /** * Created by DUX on 03.05.2016. */ public class DialogUtils { Context context; AlertDialog dialog; ImageUtils imageUtils; public DialogUtils(Context context, ImageUtils imageUtils) { this.context = context; this.imageUtils = imageUtils; } private void buildDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setItems(R.array.takePhoto, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { switch (item) { case 0: imageUtils.openCamera(); break; case 1: imageUtils.openGallery(); break; } } }); dialog = builder.create(); } public void showDialog() { if (dialog == null) buildDialog(); dialog.show(); } }
73509b9e-0ceb-4232-9f5f-694cb3b6cda5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-01 20:33:41", "repo_name": "MaxHronic/adaptcourse", "sub_path": "/src/main/java/sructures/AdaptError.java", "file_name": "AdaptError.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "846871fee7ad5b61e533f73579db938c8331d790", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MaxHronic/adaptcourse
252
FILENAME: AdaptError.java
0.258326
package sructures; /** * Created by JR on 21.04.2016. */ public class AdaptError extends Exception { private int errorCode; private String errDescription; private boolean m_throwMe; public AdaptError() { errDescription = "Success"; m_throwMe = true; } public AdaptError(int code, String description) { errDescription = "Success"; m_throwMe = true; errorCode = code; errDescription = description; } public AdaptError(int code, String description, boolean throwMe) { this(code, description); m_throwMe = throwMe; } public int getErrorCode() { return errorCode; } public void setErrorCode(int errorCode) { this.errorCode = errorCode; } @Override public String getMessage() { return errDescription; } public void setErrDescription(String errDescription) { this.errDescription = errDescription; } public boolean isM_throwMe() { return m_throwMe; } public void setM_throwMe(boolean m_throwMe) { this.m_throwMe = m_throwMe; } }
66cc54c6-823b-4a6c-9f2e-cfa09cad6582
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-19 07:30:42", "repo_name": "alejopalacioduque/spring-webflux", "sub_path": "/src/main/java/com/reactor/academic/mapper/CourseMapper.java", "file_name": "CourseMapper.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "775f9680d63dee6e8c7911826187544b724a8422", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/alejopalacioduque/spring-webflux
252
FILENAME: CourseMapper.java
0.295027
package com.reactor.academic.mapper; import com.reactor.academic.documment.Course; import com.reactor.academic.dto.CourseDTO; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @Component public class CourseMapper { public Flux<CourseDTO> courseToDTO(Flux<Course> course) { return course.map(this::toDTO); } public Flux<Course> courseToEntity(Flux<CourseDTO> courseDTO) { return courseDTO.map(this::toEntity); } public Mono<CourseDTO> courseToDTO(Mono<Course> course) { return course.map(this::toDTO); } public Mono<Course> courseToEntity(Mono<CourseDTO> courseDTO) { return courseDTO.map(this::toEntity); } public CourseDTO toDTO(Course course) { CourseDTO courseDTO = new CourseDTO(); BeanUtils.copyProperties(course, courseDTO); return courseDTO; } public Course toEntity(CourseDTO courseDTO) { Course courseEntity = new Course(); BeanUtils.copyProperties(courseDTO, courseEntity); return courseEntity; } }
8a62163b-f3d5-4a06-a00a-8ccc0537cc76
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-09-03T07:13:57", "repo_name": "smkim89/UberQL-Server", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1085, "line_count": 53, "lang": "en", "doc_type": "text", "blob_id": "95fe0f600c48a6cddcfe0c90669272e4c8c9d3ee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/smkim89/UberQL-Server
263
FILENAME: README.md
0.246533
UBERQL-SERVER ============= #### Config 1. yarn add typescript ts-node ts-node nodemon --dev 2. yarn add tslint-config-prettier --dev 3. yarn add @types/node --dev <hr/> ## 참고 - DefinitelyTyped : TypeScript의 타입 정의를 제공하는 리포지터리 서비스 ## Resolvers ### Public Resolvers: - Sign In / Sign Up with Facebook - Sign In with Email - Start Phone Number Verification - Complete Phone Number Verification - Sign Up with Email ### Authentication: - Generate JWT - Verifiy JWT ### Private Resolvers: - Get my Profile - Request Email Verification - Complete Email Verification - Update my Profile - Toggle Driving Mode - Report Location / Orientation - Add Place - Edit Place - Delete Place - Get My Places - See Nearby Drivers - Subscribe to Nearby Drivers - Request a Ride - Get Nearby Ride Requests - Subscribe to Nearby Ride Requests - Update Ride Status - Get Ride - Subscribe to Ride Status - Create a Chat Room - Get Chat Room Messages - Send a Chat Message - Subscribe to Chat Room Messages ### Code Challenge - Get Ride History - See Ride Detail
33006654-d4fb-475c-9629-dbf5cf30869c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-05 02:37:18", "repo_name": "mengshijian/okdeer-mall", "sub_path": "/okdeer-mall-activity/src/main/java/com/okdeer/mall/activity/discount/job/ActivityDiscountJob.java", "file_name": "ActivityDiscountJob.java", "file_ext": "java", "file_size_in_byte": 1328, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "84de83bd12cba3d0f949356db0c04eadca59e686", "star_events_count": 0, "fork_events_count": 3, "src_encoding": "UTF-8"}
https://github.com/mengshijian/okdeer-mall
309
FILENAME: ActivityDiscountJob.java
0.286968
package com.okdeer.mall.activity.discount.job; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.dangdang.ddframe.job.api.JobExecutionMultipleShardingContext; import com.dangdang.ddframe.job.plugin.job.type.simple.AbstractSimpleElasticJob; import com.okdeer.base.common.utils.DateUtils; import com.okdeer.mall.activity.discount.service.ActivityDiscountService; /** * @pr mall * @desc 修改满减满折活动状态job * @author zengj * @date 2016年1月28日 下午1:59:59 * @copyright ©2005-2020 yschome.com Inc. All rights reserved */ @Service public class ActivityDiscountJob extends AbstractSimpleElasticJob { private static final Logger logger = LoggerFactory.getLogger(ActivityDiscountJob.class); @Autowired private ActivityDiscountService activityDiscountService; @Override public void process(JobExecutionMultipleShardingContext arg0) { try { logger.info("满减满折活动定时任务开始-----"+DateUtils.getDateTime()); activityDiscountService.updateStatus(); } catch (Exception e) { logger.error("定时修改满减满折活动状态失败", e); }finally{ logger.info("满减满折活动定时任务结束-----"+DateUtils.getDateTime()); } } }
c477eba0-fdac-4804-a22c-fec1737fb3f4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-24 09:43:08", "repo_name": "altamira/data-model", "sub_path": "/src/main/java/br/com/altamira/data/model/shipping/planning/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "789d5cfbe53940b92b2373d33f7da524b5c0e95b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/altamira/data-model
275
FILENAME: User.java
0.236516
package br.com.altamira.data.model.shipping.planning; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; /** * * @author */ @Entity(name = "br.com.altamira.data.model.shipping.planning.User") @Table(name = "SS_USER") public class User extends br.com.altamira.data.model.Resource { /** * Serial number ID */ private static final long serialVersionUID = -3725014293364656727L; @NotNull @Size(min = 1) @Column(name = "FIRST_NAME") private String firstName = ""; @NotNull @Size(min = 1) @Column(name = "LAST_NAME") private String lastName = ""; @NotNull @Size(min = 5) @Column(name = "EMAIL") private String email = ""; /** * * @return */ public String getFirstName() { return firstName; } /** * * @return */ public String getLastName() { return lastName; } /** * * @return */ public String getEmail() { return email; } }
b012eb7c-d3db-481a-8461-f8f84e52ff27
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-10 15:06:38", "repo_name": "freshchen/fresh-ad-system", "sub_path": "/ad-gateway/src/main/java/com/ecnu/lingc/ad/gateway/filter/PreRequestFilter.java", "file_name": "PreRequestFilter.java", "file_ext": "java", "file_size_in_byte": 1141, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "1f9afc3fde6efb5812c1a164393a66d0fc519582", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/freshchen/fresh-ad-system
272
FILENAME: PreRequestFilter.java
0.229535
package com.ecnu.lingc.ad.gateway.filter; import com.netflix.zuul.ZuulFilter; import com.netflix.zuul.context.RequestContext; import com.netflix.zuul.exception.ZuulException; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.netflix.zuul.filters.support.FilterConstants; import org.springframework.stereotype.Component; /** * @program: fresh-ad-system * @Date: 2019/6/25 21:47 * @Author: Ling Chen * @Description: */ @Slf4j @Component public class PreRequestFilter extends ZuulFilter { @Override /** * filter类型 */ public String filterType() { return FilterConstants.PRE_TYPE; } /** * order 越小优先级越高 * * @return */ @Override public int filterOrder() { return 0; } /** * 是否执行 * * @return */ @Override public boolean shouldFilter() { return true; } @Override public Object run() throws ZuulException { RequestContext context = RequestContext.getCurrentContext(); context.set("startTime", System.currentTimeMillis()); return null; } }
00c7c835-250a-4c4e-ac52-1f956655ad5a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-09 03:37:08", "repo_name": "anvh2/WalletBook", "sub_path": "/04_Implement/02_Source/SaveMyMoneyV3/app/src/main/java/com/example/black/savemymoneyv3/mActivity/AboutUsActivity.java", "file_name": "AboutUsActivity.java", "file_ext": "java", "file_size_in_byte": 1011, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "7fac0b7c2191be49630220d4432f673461eb84b1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/anvh2/WalletBook
170
FILENAME: AboutUsActivity.java
0.198064
package com.example.black.savemymoneyv3.mActivity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import com.example.black.savemymoneyv3.R; public class AboutUsActivity extends AppCompatActivity { private Toolbar mtoolbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about_us); mtoolbar = findViewById(R.id.about_toolbar); setSupportActionBar(mtoolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } @Override public void onBackPressed() { finish(); } @Override public boolean onOptionsItemSelected(MenuItem item) { if(item.getItemId() == android.R.id.home){ onBackPressed(); return true; } return super.onOptionsItemSelected(item); } }
b8eef4bb-93fa-4766-9662-846879c4ca24
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-18 12:47:23", "repo_name": "LMU2018/WarungDanaNew", "sub_path": "/app/src/main/java/com/lmu/warungdana/Response/ListLogDesc.java", "file_name": "ListLogDesc.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "7f4a60f3a26c720f9de843a5073b97f19f841eec", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LMU2018/WarungDanaNew
270
FILENAME: ListLogDesc.java
0.212069
package com.lmu.warungdana.Response; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class ListLogDesc { @SerializedName("id") @Expose private Integer id; @SerializedName("id_mst_log_status") @Expose private Integer idMstLogStatus; @SerializedName("mst_log_status_status") @Expose private String mstLogStatusStatus; @SerializedName("description") @Expose private String description; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getIdMstLogStatus() { return idMstLogStatus; } public void setIdMstLogStatus(Integer idMstLogStatus) { this.idMstLogStatus = idMstLogStatus; } public String getMstLogStatusStatus() { return mstLogStatusStatus; } public void setMstLogStatusStatus(String mstLogStatusStatus) { this.mstLogStatusStatus = mstLogStatusStatus; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
ca586187-25ec-4096-a18d-5d41ecfd54a6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-03 21:40:28", "repo_name": "ojan2021/mapversity", "sub_path": "/app/src/main/java/com/example/mapversitydemo/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1220, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "e17258ec60a1b54f5f90ef254ec80f3b75277c3c", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ojan2021/mapversity
210
FILENAME: MainActivity.java
0.208179
package com.example.mapversitydemo; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.view.View; import android.view.Window; import android.view.WindowManager; public class MainActivity extends AppCompatActivity { public static int isWelcome =0; @Override protected void onResume() { super.onResume(); hideNavigationBar(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); hideNavigationBar(); if(isWelcome!=1) { isWelcome=1; Intent welcome = new Intent(getApplicationContext(),WelcomeScreen.class); startActivity(welcome); } } private void hideNavigationBar() { this.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); } }
f52a30e7-8920-4e3b-84c0-7a871a952acb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-18 07:55:11", "repo_name": "draklorx/villages_overhauled", "sub_path": "/src/main/java/space/gamr/villages_overhauled/data/client/ModItemModelProvider.java", "file_name": "ModItemModelProvider.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "ef235029df126317fa7ced56d86b357f3519509a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/draklorx/villages_overhauled
225
FILENAME: ModItemModelProvider.java
0.236516
package space.gamr.villages_overhauled.data.client; import net.minecraft.block.Block; import net.minecraft.data.DataGenerator; import net.minecraftforge.client.model.generators.ItemModelProvider; import net.minecraftforge.client.model.generators.ModelProvider; import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.fml.RegistryObject; import space.gamr.villages_overhauled.VillagesOverhauled; import space.gamr.villages_overhauled.setup.ModBlocks; public class ModItemModelProvider extends ItemModelProvider { public ModItemModelProvider(DataGenerator generator, ExistingFileHelper existingFileHelper) { super(generator, VillagesOverhauled.MOD_ID, existingFileHelper); } private void registerBlockModel(RegistryObject<Block> block) { String path = block.getId().getPath(); withExistingParent(path, modLoc(ModelProvider.BLOCK_FOLDER + "/" + path)); } @Override protected void registerModels() { registerBlockModel(ModBlocks.COBBLED_SANDSTONE); registerBlockModel(ModBlocks.SAND_PATH); } }
ccd589c0-cdf3-4ffc-ab82-b12833321dbe
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-26 11:37:49", "repo_name": "alysson12/automationPratice", "sub_path": "/src/pageObjects/java/pages/MyAccountPage.java", "file_name": "MyAccountPage.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "522ddd74bc9643dec5f5ac39d72587b7e413be1d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/alysson12/automationPratice
227
FILENAME: MyAccountPage.java
0.292595
package pages; import locators.LocatorsDresses; import locators.LocatorsMyAccount; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import utils.Commons; import java.util.function.Consumer; public class MyAccountPage extends BasePage{ public MyAccountPage(WebDriver driver){ super (driver); } public ProductPage goShopping(){ Actions actions = new Actions(driver); Consumer< By > hover = (By by) -> { actions.moveToElement(driver.findElement(by)) .perform(); }; hover.accept(LocatorsMyAccount.dressesMenu); Commons.sleep(300); hover.accept(LocatorsMyAccount.eveningDressesMenu); driver.findElement(LocatorsMyAccount.eveningDressesMenu).click(); new WebDriverWait(driver, 10) .until(ExpectedConditions.presenceOfElementLocated(LocatorsDresses.sortByLoc)); return new ProductPage(getDriver()); } }
00802e57-c603-46b4-b1c0-2fc6ed2ab564
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-22 19:05:02", "repo_name": "TimurDubov/JavaRush", "sub_path": "/questtwo/eighthlevel/lecture11/MergingFiles.java", "file_name": "MergingFiles.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "259961d31eb596083dc81b6f391cca63129ce847", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/TimurDubov/JavaRush
201
FILENAME: MergingFiles.java
0.26588
package questtwo.eighthlevel.lecture11; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStreamReader; public class MergingFiles { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String fileName1 = reader.readLine(); String fileName2 = reader.readLine(); FileInputStream fileInputStream = new FileInputStream(fileName1); byte[] buffer1 = new byte[fileInputStream.available()]; while (fileInputStream.available() > 0){ fileInputStream.read(buffer1, 0, buffer1.length); } fileInputStream.close(); FileOutputStream fileOutputStream = new FileOutputStream(fileName1); FileInputStream fileInputStream2 = new FileInputStream(fileName2); while (fileInputStream2.available() > 0){ fileOutputStream.write(fileInputStream2.read()); } fileOutputStream.write(buffer1); reader.close(); fileInputStream2.close(); fileOutputStream.close(); } }
38468d61-5dab-460e-a245-62f4249c7555
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-08-02T08:48:35", "repo_name": "Tenvolin/HotkeyRebinder", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1083, "line_count": 17, "lang": "en", "doc_type": "text", "blob_id": "0f57e5acfa7d7866e0cfdecbeafa557c9c9c83bb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Tenvolin/HotkeyRebinder
236
FILENAME: README.md
0.236516
# HotkeyRebinder This is a program designed to mute, create and rebind hotkeys. This program makes use of WINAPI and thus only works on Windows. # How to Use The user will be prompted to keypress a hotkey, before keypressing a resulting action. After binding, the user has to begin the event handling loop. At this point, the program will now globally register all hotkey presses and output the associated action. On keybinding and registering an action, the alt and ctrl keys will also be registered. This allows for more variety in keybinds. # Files Involved There are three main files(and their corresponding headers): KeyBinder.cpp, KeyManager.cpp, and KeyReceiver.cpp. KeyManager is the main entry point where keys are bound and Windows messages are handled; resulting in functional rebinds. KeyReceiver reads a single key press from the user and can return a struct containing the following: virtual key code and any alt+ctrl flags (a KeyNFlag struct). KeyBinder performs the act of binding a key press to an action; the key press or action may have alt or ctrl flags.
50e29c4e-0ac8-4d79-849e-578fb4192358
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-13 02:54:06", "repo_name": "Sir-Baconn/Photos", "sub_path": "/src/stuff/UserFocusPhotoController.java", "file_name": "UserFocusPhotoController.java", "file_ext": "java", "file_size_in_byte": 1085, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "70a59ee979237eb6b5e93f7b589141ee7d6c5156", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Sir-Baconn/Photos
256
FILENAME: UserFocusPhotoController.java
0.261331
package stuff; import java.util.ArrayList; import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.Pane; public class UserFocusPhotoController { @FXML private Pane layout; @FXML private ImageView imageView; @FXML private Label captionLabel; @FXML private Label tagsLabel; @FXML private Label dateLabel; public void initialize(Photo photo){ imageView.setImage(new Image("file:" + photo.getFilePath())); if(photo.getCaption() != null) this.captionLabel.setText("Caption: " + photo.getCaption()); if(photo.getTags() != null && photo.getTags().values().size() > 0){ ArrayList<String> tags = new ArrayList<String>(photo.getTags().values()); String tagsAsOne = ""; for(String tag : tags){ tagsAsOne += tag; } this.tagsLabel.setText("Tags: " + tagsAsOne); } if(photo.getDateUploaded() != null) this.dateLabel.setText("Date Created: " + photo.getDateUploaded()); } public void start(Pane pane) { this.layout = pane; } }
4ef65140-47b9-45a5-818c-dcb8e224a032
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-27 06:08:16", "repo_name": "YAtOff/rx-lecture", "sub_path": "/RxExamples/src/main/java/bg/nemetschek/theory/promise/Promise.java", "file_name": "Promise.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "da7a062822b02738e304ce5f4783ee309e3a6805", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/YAtOff/rx-lecture
232
FILENAME: Promise.java
0.295027
package bg.nemetschek.theory.promise; import java.util.function.Consumer; import java.util.function.Function; public class Promise <T> { private T result; public static void main(String[] args) { Promise<Integer> promise = Promise.runAsync(1); promise.thenAccept(result -> System.out.println("Result is " + result)); } static Promise<Integer> runAsync(int source) { Promise<Integer> promise = new Promise<>(); System.out.println("Doing stuff ..."); promise.result = 42; return promise; } void thenAccept(Consumer<T> callback) { callback.accept(result); } <U> Promise<U> thenApply(Function<T, U> transformer) { return null; // executes next when current promise is resolved // creates new promise that holds the result with transformer applied to in } <U> Promise<U> thenCompose(Function<T, Promise<U>> next) { return null; // executes next when current promise is resolved // creates new promise that is resolved when next is ready } }
0f51a17d-e482-4104-a4f1-db8516a90312
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-12-05 09:02:17", "repo_name": "toopa/ImOnIt", "sub_path": "/app/src/main/java/com/toopa/imonit/model/Task.java", "file_name": "Task.java", "file_ext": "java", "file_size_in_byte": 1184, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "a4f29408d7f27c5026544ca8ce8383bd6117a2af", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/toopa/ImOnIt
250
FILENAME: Task.java
0.239349
package com.toopa.imonit.model; import java.util.UUID; /** * Created by Toopa on 24/02/2015. */ public class Task { private UUID id; private String description; private TaskStatus status; public Task(final String description) { this(UUID.randomUUID(), description); } public Task(final UUID id, final String description) { this(id, description, TaskStatus.POSTED); } public Task(final UUID id, final String description, final TaskStatus status) { this.id = id; this.description = description; this.status = status; } public UUID getId() { return id; } public void setId(final UUID id) { this.id = id; } public String getDescription() { return description; } public void setDescription(final String description) { this.description = description; } public TaskStatus getStatus() { return status; } public void setStatus(final TaskStatus status) { this.status = status; } @Override public String toString() { return this.description + "\t[" + this.status.toString() + "]"; } }
90eecebd-4d4c-4495-b492-1882d3a09e2e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-10 12:38:34", "repo_name": "gerritjvv/pseidon", "sub_path": "/pseidon-plugin/src/main/java/pseidon/util/Util.java", "file_name": "Util.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "d750a39f15b6ae6b079f9545ccaa0768bfd77114", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/gerritjvv/pseidon
238
FILENAME: Util.java
0.283781
package pseidon.util; import pseidon.plugin.Plugin; import us.bpsm.edn.Named; import java.util.*; import java.util.stream.Stream; /** * Simple utility functions */ public class Util { public static final <T> Collection<T> reverse(Collection<T> coll){ List<T> list = new ArrayList<>(coll); Collections.reverse(list); return list; } public static Class<Plugin> asPluginClass(String cls){ try{ return (Class<Plugin>)Class.forName(cls); }catch (ClassNotFoundException e1){ try{ return (Class<Plugin>)Thread.currentThread().getContextClassLoader().loadClass(cls); }catch (ClassNotFoundException e2){ try { return (Class<Plugin>)cls.getClass().forName(cls); } catch (ClassNotFoundException e) { throw new RuntimeException(String.format("Plugin class %s not found", cls)); } } } } public static String asString(Object o) { if(o == null) return ""; else if(o instanceof Named) return ((Named)o).getName(); else return o.toString(); } }
81a875fb-4c29-4a00-94de-ca1d1d671f2e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-11 23:57:37", "repo_name": "IronMustang3711/frc2019", "sub_path": "/src/main/java/org/usfirst/frc3711/deepspace/commands/ManualTalonControl.java", "file_name": "ManualTalonControl.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "9be6c8cc977dcec1a9e170b331f02ead21fc15e4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/IronMustang3711/frc2019
248
FILENAME: ManualTalonControl.java
0.259826
package org.usfirst.frc3711.deepspace.commands; import com.ctre.phoenix.motorcontrol.ControlMode; import edu.wpi.first.wpilibj.command.Command; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import org.usfirst.frc3711.deepspace.Robot; import org.usfirst.frc3711.deepspace.subsystems.TalonSubsystem; public class ManualTalonControl extends Command { private final TalonSubsystem subsystem; public ManualTalonControl(TalonSubsystem subsystem) { this.subsystem = subsystem; requires(subsystem); requires(Robot.chassis); } @Override protected void initialize() { Shuffleboard.selectTab(subsystem.getName()); } @Override protected void execute() { double output = Robot.oi.joystick1.getY(); subsystem.talon.set(ControlMode.PercentOutput, output); Robot.chassis.drive(0, 0); // just in case } @Override protected void end() { subsystem.talon.neutralOutput(); } @Override protected boolean isFinished() { return false; } }
fba91c08-4309-4171-b140-3ce5c7500395
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-15 12:30:06", "repo_name": "KIRTISHD/E-PreCAT-System", "sub_path": "/Backend/E-PreCAT-1/src/main/java/project/mainpackage/sample/UserResponseController.java", "file_name": "UserResponseController.java", "file_ext": "java", "file_size_in_byte": 1137, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "b292a45f2d19a870f7ef4b28b06e4a1681f91d29", "star_events_count": 0, "fork_events_count": 5, "src_encoding": "UTF-8"}
https://github.com/KIRTISHD/E-PreCAT-System
216
FILENAME: UserResponseController.java
0.287768
package project.mainpackage.sample; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import project.mainpackage.dao.IUserResponseDao; import project.mainpackage.pojos.UserResponse; @RestController @RequestMapping("/response") @CrossOrigin(origins = "http://localhost:4200",maxAge = 4800,allowCredentials = "false",methods= {RequestMethod.GET,RequestMethod.POST}) public class UserResponseController { @Autowired private IUserResponseDao responsedao; @RequestMapping(value="/add",method=RequestMethod.POST,produces="application/json") public boolean addResponse(@RequestParam UserResponse re) { return responsedao.addUserResponse(re); } @RequestMapping(value="/delete/{id}",method=RequestMethod.GET) public void deleteResponse(@RequestParam Integer id) { responsedao.deleteUserResponse(id); } }
e4a68340-d915-4215-af04-12ec5dccf938
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-01 22:40:57", "repo_name": "tschmidleithner/edge-monitoring", "sub_path": "/trace-parser/src/main/java/at/ac/tuwien/tschmidleithner/edgemonitoring/traceparser/service/impl/TimestepService.java", "file_name": "TimestepService.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "289255bb3a41363744580097efc9bb6dd922fd9f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tschmidleithner/edge-monitoring
225
FILENAME: TimestepService.java
0.242206
package at.ac.tuwien.tschmidleithner.edgemonitoring.traceparser.service.impl; import at.ac.tuwien.tschmidleithner.edgemonitoring.shared.domain.Timestep; import at.ac.tuwien.tschmidleithner.edgemonitoring.traceparser.dao.ITimestepDao; import at.ac.tuwien.tschmidleithner.edgemonitoring.traceparser.service.AbstractService; import at.ac.tuwien.tschmidleithner.edgemonitoring.traceparser.service.ITimestepService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service @Transactional public class TimestepService extends AbstractService<Timestep, Long> implements ITimestepService { private ITimestepDao timestepDao; @Autowired public TimestepService(ITimestepDao timestepDao) { this.timestepDao = timestepDao; } @Override protected JpaRepository<Timestep, Long> getRepository() { return timestepDao; } }
a024531e-8305-4c2b-9ed3-25c303cfe7c5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-13 16:07:09", "repo_name": "colddew/micro-service", "sub_path": "/micro-service-server2/src/main/java/edu/ustc/server/config/CassandraConfig.java", "file_name": "CassandraConfig.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "b944b072f5c134e13d85a6b3ba62db31d93943e1", "star_events_count": 27, "fork_events_count": 11, "src_encoding": "UTF-8"}
https://github.com/colddew/micro-service
205
FILENAME: CassandraConfig.java
0.286169
package edu.ustc.server.config; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Cluster.Builder; @Configuration @EnableConfigurationProperties(CassandraProperties.class) public class CassandraConfig { @Autowired private CassandraProperties cassandraProperties; @Bean public Cluster cassandraCluster() { Builder builder = Cluster.builder(); if(StringUtils.isNoneBlank(cassandraProperties.getUsername()) && StringUtils.isNotBlank(cassandraProperties.getPassword())) { builder = builder.withCredentials(cassandraProperties.getUsername(), cassandraProperties.getPassword()); } String[] contactPoints = cassandraProperties.getContactPoints().toArray(new String[cassandraProperties.getContactPoints().size()]); builder = builder.addContactPoints(contactPoints).withPort(cassandraProperties.getPort()); return builder.build(); } }
7899a2e5-a303-406f-a4dc-c3fe1a56cf7a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-02-14 06:56:45", "repo_name": "warterWu/my-javaweb-project-demo", "sub_path": "/testjava/src/main/java/test/ReflectionAndPerformance/TestGetFieldsClassType.java", "file_name": "TestGetFieldsClassType.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "c898d362d509ec2a8371d84704a6621d4cc122fe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/warterWu/my-javaweb-project-demo
195
FILENAME: TestGetFieldsClassType.java
0.280616
package test.ReflectionAndPerformance; import java.lang.reflect.Field; import test.json.pojo; public class TestGetFieldsClassType { public static void main(String[] args) { for(Field f: pojo.class.getDeclaredFields()){ StringBuilder sb = new StringBuilder(); sb.append("\n").append(f.getDeclaringClass());//class test.json.pojo sb.append("\n").append(f.getClass());//class java.lang.reflect.Field sb.append("\n").append(f.getType());//class java.lang.String Class<?> c = f.getType(); Object obj = c.cast("abc"); pojo pojo = new pojo(); try { f.setAccessible(true); f.set(pojo, obj); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } System.out.println(pojo); System.out.println(sb.toString()); } } }
c61f76c5-6980-4e53-90b8-d748a32c25b4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-05 23:13:36", "repo_name": "sofiane10/filmApp", "sub_path": "/src/main/java/fr/sofiane/applications/controller/FilmController.java", "file_name": "FilmController.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "69de32b53c3eb19779163e7cabd44e55bcf815d2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sofiane10/filmApp
257
FILENAME: FilmController.java
0.274351
package fr.sofiane.applications.controller; import fr.sofiane.applications.dto.ActeurDto; import fr.sofiane.applications.dto.FilmDto; import fr.sofiane.applications.repository.FilmRepository; import fr.sofiane.applications.service.FilmService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.text.ParseException; import java.util.List; import java.util.Map; /** * Created by Sofiane on 29/10/2016. */ @RestController @RequestMapping("/film") public class FilmController { @Autowired FilmRepository filmRepository; @Autowired FilmService filmService; @RequestMapping(value = "", method = RequestMethod.GET) public List<FilmDto> getFilms(){ return filmService.getFilms(); } @RequestMapping(value = "/{idFilm}", method = RequestMethod.GET) public FilmDto getFilm(@PathVariable("idFilm") Long id ){ return filmService.getFilm(id); } @RequestMapping(value = "/add", method = RequestMethod.PUT) public List<FilmDto> addFilm(@RequestBody Map<String, Object> filmDto) throws ParseException { return filmService.add(filmDto); } }
bd6771b1-354f-4ba2-99d5-5a2c43c63c57
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-03 14:36:38", "repo_name": "18710603308/Altman", "sub_path": "/src/main/java/com/mzy/queue/ArrayBlockingQueueDemo.java", "file_name": "ArrayBlockingQueueDemo.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "a89861d88df2cdbdc34c837c3d439070b6eb39d2", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/18710603308/Altman
248
FILENAME: ArrayBlockingQueueDemo.java
0.271252
package com.mzy.queue; import java.util.ArrayList; import java.util.concurrent.ArrayBlockingQueue; /** * @Author Jack Miao * @date 2021/2/25 15:11 * @desc */ public class ArrayBlockingQueueDemo { public static void main(String[] args) throws InterruptedException { ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<String>(5, false); //非阻塞添加,队列满抛异常 queue.add("1"); queue.poll(); queue.add("2"); queue.clear(); //添加成功返回true,失败返回false boolean offer = queue.offer("3"); System.out.println(offer); //返回队列头元素 System.out.println(queue.peek()); //删除指定元素 System.out.println(queue.remove("1")); queue.offer("4"); queue.offer("3"); System.out.println("reaming: " + queue.remainingCapacity()); ArrayList<String> strings = new ArrayList<>(); //将queue中的所有元素移动到指定collection queue.drainTo(strings); System.out.println(queue); System.out.println(strings); } }
b147f94b-08fd-4544-a36c-173d18edb931
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-16 14:39:02", "repo_name": "shsun/xray_java", "sub_path": "/x/x-service/src/main/java/org/ibase4j/core/SysServerListener.java", "file_name": "SysServerListener.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "daf34e4efc0b7e33ed458567cde27e2d2e2b8dec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/shsun/xray_java
187
FILENAME: SysServerListener.java
0.240775
package org.ibase4j.core; import javax.servlet.ServletContextEvent; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import base.listener.XServerListener; import org.ibase4j.service.SysDicService; import org.ibase4j.service.SysUserService; import org.springframework.web.context.ContextLoader; import org.springframework.web.context.WebApplicationContext; public class SysServerListener extends XServerListener { protected final Logger logger = LogManager.getLogger(this.getClass()); /** * @param contextEvent */ public void contextInitialized(ServletContextEvent contextEvent) { WebApplicationContext context = ContextLoader.getCurrentWebApplicationContext(); SysUserService sysUserService = context.getBean(SysUserService.class); sysUserService.init(); SysDicService sysDicService = context.getBean(SysDicService.class); sysDicService.getAllDic(); // super.contextInitialized(contextEvent); } }
c30d2dfe-e1af-4615-ac58-95bc6b04e6ba
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-09 08:48:30", "repo_name": "jackpoit/MySpring", "sub_path": "/SpringDemo02/src/main/java/com/woniuxy/test/DBTest.java", "file_name": "DBTest.java", "file_ext": "java", "file_size_in_byte": 1198, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "4f2bce671c755264ffa28e28a40aa45500295cc2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jackpoit/MySpring
269
FILENAME: DBTest.java
0.292595
package com.woniuxy.test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.jdbc.core.JdbcTemplate; import javax.sql.DataSource; import java.sql.SQLException; /** * @Author: rua * @Date: 2021/8/14 16:00 * @Description: */ /** * SSM框架所用的数据库连接池 主要是这三个 * druid c3p0 dbcp * harika (springboot中的) * * */ public class DBTest { public static void main(String[] args) throws SQLException { ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application3.xml"); // DataSource c3p0 = (DataSource) applicationContext.getBean("c3p0"); // DataSource druid = (DataSource) applicationContext.getBean("druid"); // DataSource dbcp = (DataSource) applicationContext.getBean("dbcp"); // System.out.println(c3p0.getConnection()); // System.out.println(druid.getConnection()); // System.out.println(dbcp.getConnection()); JdbcTemplate jdbcTemplate = applicationContext.getBean(JdbcTemplate.class); String sql ="delete from t_emp where id=?"; int row = jdbcTemplate.update(sql, 54); System.out.println(row); } }
5875f90b-4c0d-4a4f-b5f2-57bd24f39b38
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-28 17:46:09", "repo_name": "ColonelKai/IronForgePack", "sub_path": "/src/main/java/colonelkai/ironforgepack/localdeathmessage/LocalDeathMessageListener.java", "file_name": "LocalDeathMessageListener.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ca56dc8188e6a85851d974b3eff0f42895fbf89c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ColonelKai/IronForgePack
276
FILENAME: LocalDeathMessageListener.java
0.294215
package colonelkai.ironforgepack.localdeathmessage; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.ChatColor; /* I thought making death messages limited to 50 blocks would make RP much better during situations where death is important. So I just did it. - Colonel_Kai */ public class LocalDeathMessageListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onPlayerDeath(PlayerDeathEvent e) { // store death message for later String deathMessage = e.getDeathMessage(); // destroy the normal one e.setDeathMessage(null); // caching this would probably be a tiny bit faster Location loc = e.getEntity().getLocation(); for(Player p : Bukkit.getOnlinePlayers()) { if(loc.distance(p.getLocation()) < 50) { // make it red and all for extra spook effect // don't ask why this has to be like this, it just has to be. p.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + deathMessage); } } } }
d64c2fe7-fc80-4a25-a5a4-3da2b53f9e86
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-30 10:34:49", "repo_name": "XJLXR/AndroidDemo", "sub_path": "/myRefresh/src/main/java/com/demo/android/myswiperef/MainActitity.java", "file_name": "MainActitity.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "c90a95a7f5a0ed13610bb60840a127b779ebe833", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/XJLXR/AndroidDemo
259
FILENAME: MainActitity.java
0.283781
package com.demo.android.myswiperef; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; /** * Created by XiongRun on 2017/5/9. */ public class MainActitity extends AppCompatActivity implements View.OnClickListener { private Button swipeRefresh,xRecyclerRefresh; private Intent intent; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initView(); } private void initView() { swipeRefresh = (Button) findViewById(R.id.SwipeRefresh); xRecyclerRefresh = (Button) findViewById(R.id.XRecyclerRefresh); swipeRefresh.setOnClickListener(this); xRecyclerRefresh.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.SwipeRefresh: intent = new Intent(this,SwipeRefreshActivity.class); startActivity(intent); break; case R.id.XRecyclerRefresh: intent = new Intent(this,XRecyclerRefreshActivity.class); startActivity(intent); break; default: break; } } }
49a76143-9e96-463c-9422-f79f5c6aebaf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-17 23:52:46", "repo_name": "vasilnv/Authentication-Server", "sub_path": "/java-course-project/src/bg/sofia/uni/fmi/mjt/auth/domain/commands/CommandRemoveAdmin.java", "file_name": "CommandRemoveAdmin.java", "file_ext": "java", "file_size_in_byte": 1054, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "b70d1810a2d4e473a56dc9b5ef63666e16700181", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/vasilnv/Authentication-Server
210
FILENAME: CommandRemoveAdmin.java
0.277473
package bg.sofia.uni.fmi.mjt.auth.domain.commands; import java.nio.channels.SocketChannel; import bg.sofia.uni.fmi.mjt.auth.domain.Domain; public class CommandRemoveAdmin implements CommandOperation{ private static final String STRING_DELIMITER = " "; private static final int SESSION_ID_ARGUMENT = 1; private static final int USERNAME_ARGUMENT = 2; private String message; private Domain domain; private SocketChannel socketChannel; public CommandRemoveAdmin(SocketChannel channel, String message, Domain domain) { this.message = message; this.domain = domain; this.socketChannel = channel; } @Override public String execute() { String[] tokens = message.split(STRING_DELIMITER); String currUsername = domain.getChannelsByUsername().get(socketChannel); String currSessionID = tokens[SESSION_ID_ARGUMENT]; String usernameToRemoveAdmin = tokens[USERNAME_ARGUMENT]; String result = domain.removeAdmin(currUsername, usernameToRemoveAdmin, currSessionID, socketChannel); return result; } }
d91f7225-c64c-4e30-8692-92b20cc16f45
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-05-18 01:28:39", "repo_name": "RosianeSantos/PrimerioTrabalho", "sub_path": "/src/br/edu/ifnmg/Teste/DataAcess/BancoDados.java", "file_name": "BancoDados.java", "file_ext": "java", "file_size_in_byte": 1138, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "9e0b629dff38a35711f75c81c603ef2b8c33058e", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/RosianeSantos/PrimerioTrabalho
222
FILENAME: BancoDados.java
0.229535
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package br.edu.ifnmg.Teste.DataAcess; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Rosy */ public class BancoDados { private Connection conexao; public Connection getConexao() { return conexao; } public void setConexao(Connection conexao) { this.conexao = conexao; } public BancoDados(){ try { Class.forName("com.mysql.jdbc.Driver"); conexao = DriverManager .getConnection("jdbc:mysql://localhost:3306/trabalhovendas","root","1234"); } catch (ClassNotFoundException ex) { Logger.getLogger(BancoDados.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(BancoDados.class.getName()).log(Level.SEVERE, null, ex); } } }
543d74f4-4da1-4ff8-a554-25cd69e4438c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-06 06:23:07", "repo_name": "skettios/Project-Semester-Reboot", "sub_path": "/src/main/java/com/skettios/lpreboot/gfx/TransitionTween.java", "file_name": "TransitionTween.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "7a0d1c9b42a73220e18184937f0e5599d16cf662", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/skettios/Project-Semester-Reboot
249
FILENAME: TransitionTween.java
0.282988
package com.skettios.lpreboot.gfx; import com.skettios.lpreboot.entity.component.SpriteRenderer; /** * Only transition for now is fade until I learn the maths for the rest xd */ public class TransitionTween { public enum TransitionType { FADE_IN, FADE_OUT } private TransitionType type; private SpriteRenderer renderer; public TransitionTween(TransitionType type, SpriteRenderer renderer) { this.type = type; this.renderer = renderer; } public boolean doTransition(float step) { switch (type) { case FADE_IN: return fadeIn(step); case FADE_OUT: return fadeOut(step); default: return false; } } private boolean fadeIn(float step) { float currAlpha = Math.min(1f, renderer.alpha + step); renderer.setAlpha(currAlpha); return currAlpha == 1f; } private boolean fadeOut(float step) { float currAlpha = Math.max(0f, renderer.alpha - step); renderer.setAlpha(currAlpha); return currAlpha == 0f; } }
4ee91509-d805-48f4-8608-c71358089e7a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-25 09:49:34", "repo_name": "Akshat-Shah12/Tic-Tac-Toe", "sub_path": "/TicTacToe/app/src/main/java/com/example/tictactoe/Start.java", "file_name": "Start.java", "file_ext": "java", "file_size_in_byte": 1111, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "d679cb600ec0642ffe12a859165bb542c86cc769", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Akshat-Shah12/Tic-Tac-Toe
220
FILENAME: Start.java
0.273574
package com.example.tictactoe; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.text.Editable; import android.view.View; import android.widget.EditText; import android.widget.Toast; public class Start extends AppCompatActivity { EditText p1,p2; String a; String b; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_start); p1=(EditText)findViewById(R.id.p1); p2=(EditText)findViewById(R.id.p2); } public void startGame(View view){ if(p1.getText().length()==0 || p2.getText().length()==0){ Toast.makeText(this,"Please enter the names",Toast.LENGTH_SHORT).show(); } else { Intent i = new Intent(); i.setClass(this, MainActivity.class); a=p1.getText().toString(); b=p2.getText().toString(); i.putExtra("player1",a); i.putExtra("player2",b); startActivity(i); } } }
0981c0c3-1c3e-4c18-ac51-44c520505971
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-08 10:07:16", "repo_name": "targaryenj/JTab", "sub_path": "/app/src/main/java/com/example/jdm/jtab/view/CustomViewPager.java", "file_name": "CustomViewPager.java", "file_ext": "java", "file_size_in_byte": 1250, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "5a61e994baa6945a63de4da5cb39d42861f74156", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/targaryenj/JTab
268
FILENAME: CustomViewPager.java
0.295027
package com.example.jdm.jtab.view; import android.content.Context; import android.graphics.Rect; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; /** * 自定义ViewPager,重写onInterceptTouchEvent,解决子视图和ViewPager的滑动冲突 * Created by JDM on 2016/6/3. */ public class CustomViewPager extends ViewPager { // 子视图Id private int childId; public CustomViewPager(Context context) { super(context); } public CustomViewPager(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (childId > 0){ View childView = findViewById(childId); if (childView != null){ Rect rect = new Rect(); childView.getHitRect(rect); // 判断事件是否在子视图内 if (rect.contains((int)ev.getX(),(int)ev.getY())){ return false; } } } return super.onInterceptTouchEvent(ev); } public void setChildId(int childId) { this.childId = childId; } }
2e3c099f-cba2-4d1c-8ee6-ce4d1ce44773
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-24 13:10:14", "repo_name": "luzhenting66/springcloud-demo", "sub_path": "/hello-service/src/main/java/cn/ppl/hello/controller/HelloController.java", "file_name": "HelloController.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "0ada4f79f030077d8c32e68e4ab021f050fa95e0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/luzhenting66/springcloud-demo
250
FILENAME: HelloController.java
0.228156
package cn.ppl.hello.controller; import cn.ppl.hello.entity.User; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/springcloud-demo/hello/") public class HelloController { @Value("${server.port}") private int port; @RequestMapping("/hello") public String hello(){ return "say,hello--port:"+port; } @RequestMapping(value = "/get/{name}",method = RequestMethod.GET) public String name( @PathVariable("name") String name){ return "say,hello "+name+",---port:"+port; } @RequestMapping(value = "/hello2get",method = RequestMethod.GET) public User user(@RequestHeader("name") String name,@RequestHeader("age") int age){ return new User(name,age,"port:"+port); } @RequestMapping(value = "/hello3post",method = RequestMethod.POST) public String postUser(@RequestBody User u){ return "hello,"+u.getName()+", "+u.getAge()+",port:"+port; } @RequestMapping(value = "/public/get") public String pub(){ return "public get...no token"; } }
46b9f71d-98ab-46b8-b54b-bce001d98733
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-28 15:07:43", "repo_name": "fcu-d0486484/Android-HW3", "sub_path": "/app/src/main/java/md/iecs/fcu/lab4/Sayhello.java", "file_name": "Sayhello.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "a2b43b819bc062af6757c8b5816bff5a7b0a27f9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fcu-d0486484/Android-HW3
174
FILENAME: Sayhello.java
0.247987
package md.iecs.fcu.lab4; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; public class Sayhello extends AppCompatActivity { Button back; EditText output; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sayhello_main); back=(Button)findViewById(R.id.bbt); output=(EditText)findViewById(R.id.name_input); back.setOnClickListener(backmain); } private View.OnClickListener backmain=new View.OnClickListener() { @Override public void onClick(View v) { Intent backin=new Intent(); backin.putExtra("backname",output.getText().toString()); output.setText(""); setResult(RESULT_OK,backin); finish(); } }; }