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 |
|---|---|---|---|---|---|---|
acb20298-6926-4a2e-8f5f-732a7c45ed5f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-23 01:13:03", "repo_name": "screenableinc/Project_Everest", "sub_path": "/app/src/main/java/reply_cirlce/screenable/project_everest/HorizontalImagePicker.java", "file_name": "HorizontalImagePicker.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "127ced2ede7748e0518aabfe1069f9d05c581860", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/screenableinc/Project_Everest | 183 | FILENAME: HorizontalImagePicker.java | 0.229535 | package reply_cirlce.screenable.project_everest;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.DragEvent;
import android.view.View;
import android.view.ViewGroup;
public class HorizontalImagePicker{
View controller;
View controlled;
public HorizontalImagePicker(View controller, View controlled){
this.controller=controller;
this.controlled=controlled;
setListeners();
}
public void setListeners(){
controller.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.w(Globals.TAG,"cliccked");
}
});
controller.setOnDragListener(new View.OnDragListener() {
@Override
public boolean onDrag(View view, DragEvent dragEvent) {
Log.w(Globals.TAG,dragEvent.toString());
return false;
}
});
}
}
|
bd91d8a2-0d2b-445e-85e8-0051c6a5ceb1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-07T03:03:18", "repo_name": "PyroFlareX/Zymon", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 998, "line_count": 12, "lang": "en", "doc_type": "text", "blob_id": "3008cf4a481fde2afddc8368b7b7be111229388d", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/PyroFlareX/Zymon | 227 | FILENAME: README.md | 0.224055 | # Zymon
Open Source Engine clone of PKMN, inspired by Cyriel's OpMon project that I am also contributing too.
The purpose of doing this over simply contributing to OpMon is because this is not a game. This is an engine. The engine comes with tools to create maps and Zymon and more, and there likely will be a default game to go along with this. However, this is mostly a community driven, portable, OS project for fun.
There are no current plans to make an installer or release version for the engine. However, if you feel like it, please feel free to do so. You are probably better at creating UI and GUI stuff than I am.
# Compiling
Pretty simple. Compatible with Code::Blocks and VS 2017. I use SFML 2.5.1 which is the most current at the time of writing. It will probably work with some other versions though.
Submit an issue if you have any problems related to the compiling. Help with linking will not be provided, nor with anything not strictly related to problems with the above code.
|
2bd2b762-93aa-4d1c-9bdf-ac10d7f75911 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-05-09T11:05:47", "repo_name": "FancyChaos/fcopy", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 997, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "3c868b85c54e9e5c2b99a23678af7de615d13d2c", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/FancyChaos/fcopy | 271 | FILENAME: README.md | 0.198064 | # f(ile)copy - Copy the content of a file
**fcopy** is a simple and fast program, to copy the content of a file into the clipboard.
**fcopy** is programmed for the *X Window System* and currently does only support that (to an extend).
# Usage
For now, **fcopy** can only copy the whole content of a file to the clipboard:
fcopy <file>
Simple.
# Current status
Currently **fcopy** is not really usable yet and more or less in an experimental state. That's why there are no official builds yet.
But it's working to an extend. So you could build it from source to try it out if you are really bored.
# To-do's and goals
- [ ] Get the [ICCCM](https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html) standard as right as possible
- [ ] Support more targets (atoms)
- [ ] Adding better error handling
- [ ] Refactor much of the current code
- [ ] Adding more options
- [ ] *-n* for lines
- [ ] *-r* for regex expression (maybe)
- [ ] Anything that comes to my mind
|
f313a556-a5b4-4270-8fae-944c21418855 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-13 07:00:08", "repo_name": "nelke-jp/excsv", "sub_path": "/src/main/java/jp/nelke/excsv/converter/BigIntegerConverter.java", "file_name": "BigIntegerConverter.java", "file_ext": "java", "file_size_in_byte": 980, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "df7e0048e920e66dd62e3063641c34051463cc96", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nelke-jp/excsv | 172 | FILENAME: BigIntegerConverter.java | 0.295027 | package jp.nelke.excsv.converter;
import java.math.BigInteger;
import jp.nelke.excsv.exception.ConvertException;
public class BigIntegerConverter implements Converter<BigInteger> {
public BigInteger convert(Object value) throws ConvertException {
if (value == null) {
return null;
}
BigInteger integer = null;
try {
if (value instanceof String) {
integer = new BigInteger((String) value);
}
else if (value instanceof Double) {
integer = BigInteger.valueOf(((Double) value).longValue());
}
}
catch (NumberFormatException nfe) {
throw new ConvertException(value.toString() + " cannot convert to BigInteger.");
}
if (integer == null) {
throw new ConvertException(value.toString() + " cannot convert to BigInteger.");
}
return integer;
}
}
|
fec96a4d-4f26-4ee1-bce3-673c47a9241a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-04 20:13:29", "repo_name": "dmitry-baranov/webapitest", "sub_path": "/src/main/java/example/dmitry/dao/BdConnectionParams.java", "file_name": "BdConnectionParams.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "8964e03ae8ba570b6a73e0d9465aae1358b5ed9e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dmitry-baranov/webapitest | 176 | FILENAME: BdConnectionParams.java | 0.278257 | package example.dmitry.dao;
import example.dmitry.errors.MyException;
import example.dmitry.errors.Response;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
@Data
@Builder
@AllArgsConstructor
public class BdConnectionParams {
private String url;
private String login;
private String pass;
public BdConnectionParams() {
Properties properties = new Properties();
ClassLoader classLoader = BdConnectionParams.class.getClassLoader();
InputStream inputStream = classLoader.getResourceAsStream("db-connection.properties");
try {
properties.load(inputStream);
url = properties.getProperty("url");
login = properties.getProperty("login");
pass = properties.getProperty("pass");
} catch (IOException e) {
throw new MyException(Response.BD_CONNECTION_ERROR);
}
}
}
|
a0630b5c-9b56-40a5-9476-6e7af0faa3d5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-16 08:12:21", "repo_name": "evanholt1/qrCodeParserServer", "sub_path": "/src/main/java/com/example/demo/Controller.java", "file_name": "Controller.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "2b641d58d80b97d7085a464004ee889d3de61c7d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/evanholt1/qrCodeParserServer | 205 | FILENAME: Controller.java | 0.259826 | package com.example.demo;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@RestController
@RequestMapping("")
public class Controller {
private final Service service;
public Controller(Service service) {
this.service = service;
}
@GetMapping
public String test() {
System.out.println("In Get Request");
return "hello world";
}
@GetMapping("/parseQr")
public ObjectNode parseQr(@RequestParam("data")String qrCodeData) throws JsonProcessingException {
//String qrCode = (String) payload.get("data");
return this.service.parseQr(qrCodeData);
}
// @PostMapping
// public ObjectNode parseQr(@RequestBody Map<String,Object> payload) throws JsonProcessingException {
// String qrCode = (String) payload.get("data");
// return this.service.parseQr(qrCode);
// }
}
|
4c67bb07-153d-48a2-89f3-236d19fb3e12 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-15 08:36:01", "repo_name": "neoul-wiki/pado", "sub_path": "/src/main/java/wiki/neoul/pado/domain/actor/Actor.java", "file_name": "Actor.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "35d20bba57501e1202243c0e838081c586220139", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/neoul-wiki/pado | 206 | FILENAME: Actor.java | 0.253861 | package wiki.neoul.pado.domain.actor;
import wiki.neoul.pado.domain.account.Account;
import javax.persistence.*;
import java.time.LocalDateTime;
/**
* Actor refers to all users, including non-signed-in user, acting on wiki system.
*
* @author hyeyoom
*/
@Entity
@Table(
name = "actors",
indexes = {
@Index(name = "idx_actor_id", columnList = "ip_address, account_id")
},
uniqueConstraints = {
@UniqueConstraint(name = "uq_actor", columnNames = {"ip_address", "account_id"})
}
)
public class Actor {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "ip_address",nullable = false)
private String ipAddress;
@OneToOne(optional = true, fetch = FetchType.LAZY)
@JoinColumn(name = "account_id")
private Account account = null;
@Column(nullable = false)
private LocalDateTime createdAt = LocalDateTime.now();
}
|
bcf26e79-7cd3-4595-92e9-a3d483d233e8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-07-02T01:34:26", "repo_name": "i0jupiter/SimpleTwitterClient", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 999, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "7779336c1b27bf188ab0e30fba0fff76df9a47fe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/i0jupiter/SimpleTwitterClient | 225 | FILENAME: README.md | 0.226784 | This is a limited edition Android app for Twitter using Fragments.
Time spent: 15 hours
Completed User Stories: ALL required.
Required:
- Includes all required user stories from Week 3 Twitter Client
- User can switch between Timeline and Mention views using tabs.
- User can view their home timeline tweets.
- User can view the recent mentions of their username.
- User can scroll to bottom of either of these lists and new tweets will load ("infinite scroll")
- User can navigate to view their own profile
- User can see picture, tagline, # of followers, # of following, and tweets on their profile.
- User can click on the profile image in any tweet to see another user's profile.
- User can see picture, tagline, # of followers, # of following, and tweets of clicked user.
- Profile view should include that user's timeline
Walkthrough of all user stories:

GIF created with [LiceCap](http://www.cockos.com/licecap/).
|
3c509b99-41d3-4808-b13f-0273e8cf733c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-12-08 06:54:37", "repo_name": "schmoe735/MaterialTest5", "sub_path": "/app/src/main/java/com/cliff/ozbargain/util/L.java", "file_name": "L.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "d5aa1f12cb5f736078b41fbc96c77e97959145c4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/schmoe735/MaterialTest5 | 222 | FILENAME: L.java | 0.253861 | package com.cliff.ozbargain.util;
import android.content.Context;
import android.util.Log;
import android.widget.Toast;
import com.ocpsoft.pretty.time.PrettyTime;
import java.util.Date;
import javax.xml.parsers.ParserConfigurationException;
/**
* Created by Clifford on 27/11/2015.
*/
public class L {
public static final String RESULT = "RESULT";
public static final String ERROR = "ERROR";
public static final String PAGE_PARAM ="?page=%d";
public static final String DEAL_TYPE= "DEAL_TYPE";
private static final PrettyTime prettyTime = new PrettyTime();
public static void m(Context context, String message){
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
}
public static void d(String tag, String text){
d(tag, text, null);
}
public static void d(String tag, String text, Exception e){
Log.d(tag, text, e);
}
public static String time(Date date){
return prettyTime.format(date);
}
}
|
4c02fe43-0282-4d84-b8d7-ab91c0058d87 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-10-12 14:15:37", "repo_name": "mmbase/didactor", "sub_path": "/components/assessment/src/main/java/nl/didactor/component/assessment/Assessment.java", "file_name": "Assessment.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "6ebf2511af7f603f5a3eb6ec4f207b91d8d69d65", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mmbase/didactor | 211 | FILENAME: Assessment.java | 0.261331 | package nl.didactor.component.assessment;
import org.mmbase.module.core.*;
import org.mmbase.core.*;
import org.mmbase.bridge.Field;
import org.mmbase.core.util.Fields;
import org.mmbase.datatypes.DataTypes;
import org.mmbase.util.logging.*;
public class Assessment extends org.mmbase.framework.BasicComponent {
private static final Logger log = Logging.getLoggerInstance(Assessment.class);
public Assessment(String name) {
super(name);
}
@Override
protected void init() {
MMObjectBuilder learnblocks = MMBase.getMMBase().getBuilder("learnblocks");
CoreField assessment= Fields.createField("assessment", Field.TYPE_BOOLEAN, Field.STATE_VIRTUAL, DataTypes.getDataType("didactor_assessment_field"));
assessment.setParent(learnblocks);
assessment.setStoragePosition(100);
learnblocks.addField(assessment);
log.info("Added virtual field " + assessment + " to " + learnblocks + " -> " + learnblocks.getFields());
}
}
|
aa0485bb-215e-4fdf-bba1-aaf86ca7f271 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-10 21:13:40", "repo_name": "vsbpro/webserver", "sub_path": "/src/main/java/org/vsb/webserver/Request.java", "file_name": "Request.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "25b0062ac133b983acea2b8c72e3ad05355e7eb7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vsbpro/webserver | 210 | FILENAME: Request.java | 0.246533 | package org.vsb.webserver;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
public class Request {
public static void main(String[] args) {
HttpClient httpClient = HttpClientBuilder.create().build();
try {
HttpPost request = new HttpPost("http://localhost:8080");
TestPojo pojo = new TestPojo();
pojo.age = "20";
pojo.name = "Vish";
StringEntity params =new StringEntity(pojo.toString());
request.addHeader("content-type", "application/x-www-form-urlencoded");
request.setEntity(params);
HttpResponse response = httpClient.execute(request);
//handle response here...
}catch (Exception ex) {
//handle exception here
} finally {
//Deprecated
//httpClient.getConnectionManager().shutdown();
}
}
}
|
c5ca4dbc-5b44-4235-b318-202c686ccd35 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-23 09:07:24", "repo_name": "a514760469/UnderstandJVM", "sub_path": "/src/main/java/com/effective/annotation/RunTests.java", "file_name": "RunTests.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "a7287089129631e76fd2c7d155ec03b20c3d79ee", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/a514760469/UnderstandJVM | 184 | FILENAME: RunTests.java | 0.276691 | package com.effective.annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class RunTests {
public static void main(String[] args) throws Exception {
int tests = 0;
int passed = 0;
Class<?> testClass = Class.forName(args[0]);
for (Method method : testClass.getDeclaredMethods()) {
if (method.isAnnotationPresent(Test.class)) {
tests++;
try {
method.invoke(null);
passed++;
} catch (InvocationTargetException wrappedExc) {
Throwable cause = wrappedExc.getCause();
System.out.println(method + " failed: " + cause);
} catch (Exception e) {
System.out.println("Invalid @Test: " + method);
}
}
}
System.out.printf("Passed: %d, Failed: %d%n", passed, tests - passed);
}
}
|
4e0fd533-56b9-487e-9f2b-2ae9f261af75 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-19 05:44:11", "repo_name": "nicebyy/Inf_ItemService", "sub_path": "/item-service/src/main/java/hello/itemservice/domain/member/MemberController.java", "file_name": "MemberController.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "ed5fb72b434d9b69c7e7828b425a06d6114de28d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nicebyy/Inf_ItemService | 175 | FILENAME: MemberController.java | 0.249447 | package hello.itemservice.domain.member;
import hello.itemservice.domain.item.Item;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@Controller
@RequestMapping("/basic/members")
@RequiredArgsConstructor
public class MemberController {
private final MemberService memberService;
@GetMapping
public String members(Model model)
{
model.addAttribute("members",memberService.findAll());
return "basic/members";
}
@GetMapping("/addMemberForm")
public String addForm()
{
return "basic/addMemberForm";
}
@PostMapping("/addMemberForm")
public String addMember(@ModelAttribute Member member)
{
Member savedMember = memberService.addMember(member);
return "redirect:/basic/members";
}
}
|
68f5fa92-d599-45ba-a26a-39fa62333216 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-18 06:00:14", "repo_name": "ichoukou/thirdapp", "sub_path": "/thirdpp-manager/src/main/java/com/zdmoney/manager/service/impl/TTppChannelMessageServiceImpl.java", "file_name": "TTppChannelMessageServiceImpl.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "ed1848fdf7e8af1d817a069aeadd17dfdd259387", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ichoukou/thirdapp | 221 | FILENAME: TTppChannelMessageServiceImpl.java | 0.267408 | package com.zdmoney.manager.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zdmoney.manager.mapper.TppChannelTMessageMapper;
import com.zdmoney.manager.service.TTppChannelMessageService;
@Service
public class TTppChannelMessageServiceImpl implements TTppChannelMessageService {
@Autowired
private TppChannelTMessageMapper tppChannelTMessageMapper;
@Override
public List select_tppChannelTMessageList(Map<String, Object> params) {
return tppChannelTMessageMapper.select_tppChannelTMessageList(params);
}
@Override
public Integer select_tppChannelTMessageList_count(
Map<String, Object> params) {
return tppChannelTMessageMapper.select_tppChannelTMessageList_count(params);
}
@Override
public List select_tppChannelTMessageByReqId(Map<String, Object> params) {
return tppChannelTMessageMapper.select_tppChannelTMessageByReqId(params);
}
}
|
62752989-8bb6-4523-bc0b-4baa1fc24b3f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-03 18:53:09", "repo_name": "nuron142/Chatter", "sub_path": "/app/src/main/java/com/nuron/chatter/LocalModel/SearchUser.java", "file_name": "SearchUser.java", "file_ext": "java", "file_size_in_byte": 971, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "253f06aef14cbdb96f3d3a0947e02749f0a0434b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/nuron142/Chatter | 215 | FILENAME: SearchUser.java | 0.226784 | package com.nuron.chatter.LocalModel;
import com.parse.ParseUser;
/**
* Created by nuron on 31/12/15.
*/
public class SearchUser {
public static final String STRING_TRUE = "true";
public static final String STRING_FALSE = "false";
ParseUser parseUser;
String isRequestSent;
String isRequestAccepted;
public SearchUser(ParseUser parseUser) {
this.parseUser = parseUser;
this.isRequestSent = STRING_FALSE;
this.isRequestAccepted = STRING_FALSE;
}
public ParseUser getParseUser() {
return parseUser;
}
public String getIsRequestSent() {
return isRequestSent;
}
public void setIsRequestSent(String isRequestSent) {
this.isRequestSent = isRequestSent;
}
public String getIsRequestAccepted() {
return isRequestAccepted;
}
public void setIsRequestAccepted(String isRequestAccepted) {
this.isRequestAccepted = isRequestAccepted;
}
}
|
5b932ce3-0304-4317-a0fa-482c9d5b4ab9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-25 18:26:02", "repo_name": "Amagesoft/workingrecyckerview", "sub_path": "/app/src/main/java/com/example/manje/myapplication/activity/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "4c0edc71de7bc1e160aa7ede953d3f4353d68291", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Amagesoft/workingrecyckerview | 168 | FILENAME: MainActivity.java | 0.20947 | package com.example.manje.myapplication.activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.example.manje.myapplication.R;
import com.example.manje.myapplication.adapter.CustomAdapter;
public class MainActivity extends AppCompatActivity {
private RecyclerView listRV;
String[] names = {"abc","tyur","adhd","adsd","fdfd"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listRV = (RecyclerView)findViewById(R.id.listRV);
LinearLayoutManager layoutManager = new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
listRV.setLayoutManager(layoutManager);
CustomAdapter adapter = new CustomAdapter((MainActivity) getApplicationContext(),names);
listRV.setAdapter(adapter);
}
}
|
1c2d811a-6417-4312-aa55-7485c085fcc8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-11 11:10:22", "repo_name": "xuhao-98/hongtu", "sub_path": "/src/com/zjy/spring/serviceImpl/ArticleServiceImpl.java", "file_name": "ArticleServiceImpl.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "5f1dc200c0c723de2401b0071b19042f22efc9e1", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xuhao-98/hongtu | 218 | FILENAME: ArticleServiceImpl.java | 0.267408 | package com.zjy.spring.serviceImpl;
import com.zjy.spring.mapper.ArticleMapper;
import com.zjy.spring.model.tm_info;
import com.zjy.spring.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ArticleServiceImpl implements ArticleService {
private ArticleMapper articleMapper;
@Autowired
public void setArticleMapper(ArticleMapper articleMapper) {
this.articleMapper = articleMapper;
}
@Override
public int InsArtService(tm_info tm) {
return articleMapper.InsArtDao(tm);
}
@Override
public List<tm_info> SelArtService(tm_info tm) {
return articleMapper.SelArtDao(tm);
}
@Override
public int DelArtService(tm_info tm) {
return articleMapper.DelArtDao(tm);
}
@Override
public List<tm_info> SearchArtDao(tm_info tm) {
return articleMapper.SearchArtDao(tm);
}
}
|
5d3af141-5c26-4a1b-900b-670282fceb77 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-30 20:27:03", "repo_name": "oracle/weblogic-kubernetes-operator", "sub_path": "/integration-tests/src/test/java/oracle/verrazzano/weblogic/VerrazzanoWebLogicWorkload.java", "file_name": "VerrazzanoWebLogicWorkload.java", "file_ext": "java", "file_size_in_byte": 832, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "2b553ea06c04d8f92c8a6a2279d70785e459a537", "star_events_count": 250, "fork_events_count": 270, "src_encoding": "UTF-8"} | https://github.com/oracle/weblogic-kubernetes-operator | 235 | FILENAME: VerrazzanoWebLogicWorkload.java | 0.255344 | // Copyright (c) 2023, Oracle and/or its affiliates.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
package oracle.verrazzano.weblogic;
import io.kubernetes.client.openapi.models.V1ObjectMeta;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(description = "VerrazzanoWebLogicWorkload is a description of a VerrazzanoWebLogicWorkload.")
public class VerrazzanoWebLogicWorkload {
@ApiModelProperty("The API version for the VerrazzanoWebLogicWorkload.")
private String apiVersion;
@ApiModelProperty("The type of resource. Must be 'VerrazzanoWebLogicWorkload'.")
private String kind;
@ApiModelProperty("The VerrazzanoWebLogicWorkload meta-data. Must include the name and namespace.")
private V1ObjectMeta metadata = new V1ObjectMeta();
@ApiModelProperty("Configuration for the VerrazzanoWebLogicWorkload.")
private VerrazzanoWebLogicWorkloadSpec workLoadSpec;
}
|
3ef9ae7e-e14c-41e3-a00e-8a905cc98b17 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-08 10:01:06", "repo_name": "zhangnengxian/GYPROJECT", "sub_path": "/GYproject-biz-base/src/main/java/cc/dfsoft/project/biz/base/constructmanage/entity/GraphicProgress.java", "file_name": "GraphicProgress.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "b69fb494d3e447a63682503f3dc536345e4e0644", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhangnengxian/GYPROJECT | 267 | FILENAME: GraphicProgress.java | 0.250913 | package cc.dfsoft.project.biz.base.constructmanage.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* 形象进度
* @author fuliwei
*
*/
@Entity
@Table(name = "GRAPHIC_PROGRESS")
public class GraphicProgress {
private String gpId;
private String gpName;
private Double gpVal;
private String type;
public GraphicProgress() {
}
@Id
@Column(name = "GP_ID", unique = true)
public String getGpId() {
return gpId;
}
public void setGpId(String gpId) {
this.gpId = gpId;
}
@Column(name = "GP_NAME")
public String getGpName() {
return gpName;
}
public void setGpName(String gpName) {
this.gpName = gpName;
}
@Column(name = "GP_VAL")
public Double getGpVal() {
return gpVal;
}
public void setGpVal(Double gpVal) {
this.gpVal = gpVal;
}
@Column(name = "TYPE")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
|
e6b016c9-b9cd-47be-9993-77e3f25f885b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-17 18:14:53", "repo_name": "rafagameiro/SD", "sub_path": "/P3/src/impl/srv/soap/SoapMediaResources.java", "file_name": "SoapMediaResources.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "b6e631a3d3db8d6c12e4bf4a2ba2a99e3a6e8f03", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rafagameiro/SD | 226 | FILENAME: SoapMediaResources.java | 0.267408 | package impl.srv.soap;
import impl.srv.shared.JavaMedia;
import microgram.api.java.Media;
import microgram.api.java.Result;
import microgram.api.rest.RestMediaStorage;
import microgram.api.soap.MicrogramException;
import microgram.api.soap.SoapMedia;
public class SoapMediaResources implements SoapMedia {
final Media impl;
final String baseUri;
public SoapMediaResources(String baseUri) {
this.baseUri = baseUri + RestMediaStorage.PATH;
this.impl = new JavaMedia();
}
@Override
public String upload(byte[] bytes) throws MicrogramException {
Result<String> result = impl.upload(bytes);
result.toString();
if (result.isOK())
return baseUri + "/" + result.value();
else
throw new MicrogramException(result.error().toString());
}
@Override
public byte[] download(String id) throws MicrogramException {
Result<byte[]> result = impl.download(id);
if (result.isOK())
return result.value();
else
throw new MicrogramException(result.error().toString());
}
}
|
fd815ac1-0a59-42f9-b2aa-6eb619e071dc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-05 05:03:45", "repo_name": "Mazin-hub/Library-Manage-System", "sub_path": "/Library-Manage-System/src/com/Library/Service/Impl/MyBooksServiceImpl.java", "file_name": "MyBooksServiceImpl.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "6a5c41ab3a2d00356eb29eed02bdeada908bddb3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Mazin-hub/Library-Manage-System | 225 | FILENAME: MyBooksServiceImpl.java | 0.290981 | package com.Library.Service.Impl;
import com.Library.Dao.MyBooks.MyBookBackDao;
import com.Library.Dao.MyBooks.MyBooksTableDao;
import com.Library.Dao.MyBooks.UploadMyBookDao;
import com.Library.Service.MyBooksService;
import com.Library.domain.MyBooks;
import java.util.List;
public class MyBooksServiceImpl implements MyBooksService {
MyBooksTableDao myBooksTableDao = new MyBooksTableDao();
UploadMyBookDao uploadMyBookDao = new UploadMyBookDao();
MyBookBackDao myBookBackDao = new MyBookBackDao();
@Override
public List<MyBooks> getMyBooksTableInformation() {
return myBooksTableDao.getMyBooksTableInformation();
}
@Override
public int uploadMyBook(String bookName, String author, String provider, String uploadDate) {
return uploadMyBookDao.uploadMyBook(bookName,author,provider,uploadDate);
}
@Override
public int MyBookBack(String bookId) {
return myBookBackDao.MyBookBack(bookId);
}
}
|
3cad0b85-ef81-4c60-abf6-cc61bb2ac429 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-23 22:51:35", "repo_name": "jercymarc/price-service", "sub_path": "/src/main/java/com/mizuho/trade/instrument/mock/JMSInternalMockConsumer.java", "file_name": "JMSInternalMockConsumer.java", "file_ext": "java", "file_size_in_byte": 972, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "e3cd237a023cef63ded8a2b4eb0b5747727323b3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jercymarc/price-service | 190 | FILENAME: JMSInternalMockConsumer.java | 0.240775 | package com.mizuho.trade.instrument.mock;
import com.mizuho.trade.instrument.entity.Price;
import com.mizuho.trade.instrument.util.PriceConstants;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by Dilip on 23/07/2017.
*/
public class JMSInternalMockConsumer extends RouteBuilder {
private static final Logger LOG = LoggerFactory.getLogger(JMSInternalMockConsumer.class);
@Override
public void configure() throws Exception {
from(PriceConstants.TOPIC_INTERNAL_FEED_PRICE).process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
Price price = exchange.getIn().getBody(Price.class);
LOG.info("Received price on internal JMS feed: " + price);
}
});
}
}
|
209b66c3-fccf-4ae5-b3b6-b80491bf11fc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-04-20 11:41:59", "repo_name": "automician/snippets", "sub_path": "/java/properties/profile-properties-demo/src/test/java/com/automician/profileproperties/testconfigs/BaseTest.java", "file_name": "BaseTest.java", "file_ext": "java", "file_size_in_byte": 974, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "4f8dc119ab08dd87b82370fbd8837927cfad9135", "star_events_count": 4, "fork_events_count": 7, "src_encoding": "UTF-8"} | https://github.com/automician/snippets | 183 | FILENAME: BaseTest.java | 0.23231 | package com.automician.profileproperties.testconfigs;
import com.codeborne.selenide.Configuration;
import org.junit.After;
import org.junit.Before;
import static com.codeborne.selenide.Selenide.executeJavaScript;
import static com.codeborne.selenide.Selenide.open;
public class BaseTest {
public static String appURL;
static {
System.out.println("\n[Properties reading] ---------------------------------------------------------");
appURL = System.getProperty("app.url");
System.out.println("app.url = " + appURL );
Configuration.browser = System.getProperty("browser");
System.out.println("browser = " + Configuration.browser );
System.out.println("[Properties reading] ---------------------------------------------------------\n");
}
@Before
public void openApp() {
open(appURL);
}
@After
public void clearData() {
executeJavaScript("localStorage.clear();");
}
}
|
17241091-187b-46a4-a7bd-381f2ca973ac | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-23 14:34:11", "repo_name": "ishtiaqahmad/dotwebstack-framework", "sub_path": "/core/src/main/java/org/dotwebstack/framework/param/ParameterUtils.java", "file_name": "ParameterUtils.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "2e0f67b270648c91609699655ea9c14df2f77c08", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ishtiaqahmad/dotwebstack-framework | 199 | FILENAME: ParameterUtils.java | 0.247987 | package org.dotwebstack.framework.param;
import java.util.Collection;
import lombok.NonNull;
import org.dotwebstack.framework.config.ConfigurationException;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
public final class ParameterUtils {
private static final ValueFactory VALUE_FACTORY = SimpleValueFactory.getInstance();
private ParameterUtils() {}
/**
* @throws ConfigurationException If no Parameter can be found within the supplied Parameters
*/
public static Parameter getParameter(@NonNull Collection<Parameter> parameters,
@NonNull String parameterId) {
IRI iri = VALUE_FACTORY.createIRI(parameterId);
for (Parameter<?> p : parameters) {
if (p.getIdentifier().equals(iri)) {
return p;
}
}
throw new ConfigurationException(
String.format("No parameter found for vendor extension value: '%s'", parameterId));
}
}
|
348da361-3827-4660-8473-86a51f0c2039 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-17 03:14:26", "repo_name": "rileyL6122428/PokemonTrivia", "sub_path": "/src/main/java/org/l2k/trivia2/repository/RoomRepository.java", "file_name": "RoomRepository.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "004a863d098beac976e36ab4ac94a6a818d1e559", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rileyL6122428/PokemonTrivia | 237 | FILENAME: RoomRepository.java | 0.293404 | package org.l2k.trivia2.repository;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.l2k.trivia2.domain.Room;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
@Component
public class RoomRepository {
private Map<String, Room> rooms;
@Autowired
public RoomRepository(@Qualifier("rooms") Map<String, Room> rooms) {
this.rooms = rooms;
}
public List<Room> getAll() {
ArrayList<Room> roomCopies = new ArrayList<Room>();
for (String roomName : rooms.keySet()) {
roomCopies.add(get(roomName));
}
return roomCopies;
}
public Room get(String roomName) {
Room room = rooms.get(roomName);
if (room != null) {
Room roomCopy = new Room.Builder(room).build();
return roomCopy;
} else {
return null;
}
}
public void save(Room room) {
rooms.put(room.getMascotName(), room);
}
}
|
d33b2b62-08c9-4ffe-b33f-507b3145ec7b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-21 13:31:36", "repo_name": "tianjinrui/barrageDemo", "sub_path": "/app/src/main/java/com/example/a65175/myapplication/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "3ed7c1ce61366528d76b4a472be1ff570a1c32ef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tianjinrui/barrageDemo | 231 | FILENAME: MainActivity.java | 0.262842 | package com.example.a65175.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
BarrageView barrageview;
ArrayList<Barrage> date;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.barrageview_test);
initView();
}
private void initView() {
date = new ArrayList<>();
for (int i = 0; i < 100; i++) {
date.add(new Barrage(
"测试弹幕" + i, "http://pic.818today.com/imgsy/image/2016/0215/6359114592207963687677523.jpg"));
}
barrageview = (BarrageView) findViewById(R.id.barrageview);
Log.d("xiaojingyu", date.size() + "");
barrageview.setSentenceList(date);
}
}
|
6620edf0-a3d2-40e0-85c8-6238d0ccb07b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-15 09:36:07", "repo_name": "wyfsxs/cloud2020", "sub_path": "/seata-storage-service2002/src/main/java/com/atguigu/springcloud/alibaba/controller/StorageController.java", "file_name": "StorageController.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f52f9d982a341b1668f257be70c87b72e806d82b", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wyfsxs/cloud2020 | 230 | FILENAME: StorageController.java | 0.235108 | package com.atguigu.springcloud.alibaba.controller;
import com.atguigu.springcloud.alibaba.domain.CommonResult;
import com.atguigu.springcloud.alibaba.service.StorageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @function:
* @author: create by Alfred.Wong
* @date: 2020/4/14 15:28
* @version: v1.0
*/
@RestController
@Slf4j
public class StorageController {
@Resource
StorageService storageService;
/**
* 减库存
*
* @param productId
* @param count
* @return
*/
@PostMapping(value = "/storage/decrease")
public CommonResult decrease(@RequestParam("productId") Long productId, @RequestParam("count") Integer count) {
storageService.decrease(productId, count);
return new CommonResult(200, "扣减库存成功");
}
}
|
c14505a9-2bcd-4db2-b9e2-a8c8109baee7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-14 12:22:52", "repo_name": "vitory1/Super_learning", "sub_path": "/src/com/cjc/annotation/Test.java", "file_name": "Test.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "2de542bf77f1455fb926f51b431a7f5b277830ca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vitory1/Super_learning | 183 | FILENAME: Test.java | 0.246533 | package com.cjc.annotation;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
public class Test {
public static void main(String[] args) throws ClassNotFoundException {
Class<?> forName = Class.forName("com.cjc.annotation.UserEntity");
SetTable setTable = forName.getAnnotation(SetTable.class);
Field[] declaredFields = forName.getDeclaredFields();
StringBuffer sf = new StringBuffer();
sf.append("select ");
for (int i= 0;i<declaredFields.length;i++){
SetProperty setProperty = declaredFields[i].getAnnotation(SetProperty.class);
String property = setProperty.value();
if (!(i<declaredFields.length-1)){
sf.append(property+" from ");
}else {
sf.append(property+" , ");
}
}
String tableName = setTable.value();
sf.append(tableName);
System.out.println(sf);
}
}
|
152ea843-c203-405e-8393-7850f79785cc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-16 16:15:21", "repo_name": "Valks-Minecraft-Plugins/Viesta", "sub_path": "/io/github/gods/Vasa.java", "file_name": "Vasa.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "10355e8742677f0ac82bd52d131bf86927236ccf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Valks-Minecraft-Plugins/Viesta | 222 | FILENAME: Vasa.java | 0.236516 | package io.github.gods;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import io.github.configs.PlayerFiles;
import io.github.valk.Viesta;
public class Vasa implements Listener {
Viesta plugin;
public Vasa(Viesta instance) {
plugin = instance;
}
@EventHandler
private boolean onBlockPlace(BlockPlaceEvent event) {
Player p = event.getPlayer();
PlayerFiles cm = PlayerFiles.getConfig(p);
FileConfiguration config = cm.getConfig();
Material type = event.getBlockPlaced().getType();
if (type.equals(Material.TORCH) || type.equals(Material.REDSTONE_TORCH)) {
if (config.get("god").equals("Vasa")) {
event.setCancelled(true);
plugin.sendActionMessage(p, "The god you chose does not allow you to do that.", "red");
}
}
return true;
}
}
|
281bef94-cd8b-4159-9342-5839c7facefd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-31 09:12:25", "repo_name": "1758973467/alg4practice", "sub_path": "/src/Chapter5/DataCompress/RunLength.java", "file_name": "RunLength.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "5da812bfabf1654b616745addcb6b78c85b3bc60", "star_events_count": 7, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/1758973467/alg4practice | 213 | FILENAME: RunLength.java | 0.288569 | package Chapter5.DataCompress;
import stdlib.BinaryIn;
import stdlib.BinaryOut;
/**
* 游程编码-二进制
*/
public class RunLength {
public static void compress(BinaryIn bin, BinaryOut bout){
char cnt=0;
boolean b,old = false;
while (!bin.isEmpty()){
b=bin.readBoolean();
if(b!=old){
bout.write(cnt);
cnt=0;
old=!old;
}else {
if(cnt==255){
bout.write(cnt);
cnt=0;
bout.write(cnt);
}
}
cnt++;
}
bout.write(cnt);
bout.close();
}
public static void expand(BinaryIn bin, BinaryOut bout){
boolean b=false;
while (!bin.isEmpty()){
char cnt=bin.readChar();
for (int i = 0; i < cnt; i++) {
bout.write(b);
}
b=!b;
}
bout.close();
}
}
|
37ef9121-3662-4a47-baa6-2184d6a885fc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-22 07:23:57", "repo_name": "CHeuberger/Brainfuck", "sub_path": "/src/java/cfh/bf/BFRuntimeException.java", "file_name": "BFRuntimeException.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7c01e7f26dcd17eb632db277dd6504ea71f77e1c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CHeuberger/Brainfuck | 208 | FILENAME: BFRuntimeException.java | 0.273574 | package cfh.bf;
public class BFRuntimeException extends Exception {
private final int pointer;
private final int index;
private final int value;
private final String name;
public BFRuntimeException(String message, int pointer, int index, int value, String name) {
super(message);
this.pointer = pointer;
this.index = index;
this.value = value;
this.name = name;
}
public int getPointer() {
return pointer;
}
public int getIndex() {
return index;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
@Override
public String toString() {
String string = super.toString() + " at pointer:" + pointer + " index:" + index;
if (getCause() != null) {
string += "\nCaused by: " + getCause();
}
return string;
}
}
|
40bc7d26-388b-4af1-a4a2-d03cae291dc0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2011-12-01T21:10:36", "repo_name": "jaekwon/YCatalyst", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 995, "line_count": 39, "lang": "en", "doc_type": "text", "blob_id": "ef1b2ff37b9128676463f19ffa9c759949ea0de7", "star_events_count": 48, "fork_events_count": 4, "src_encoding": "UTF-8"} | https://github.com/jaekwon/YCatalyst | 264 | FILENAME: README.md | 0.185947 | DEAD PROJECT
============
This project is dead. A new web framework for node.js+coffeescript is in the works.
YCatalyst
=========
YCatalyst is a Hacker News clone written for Node.js in Coffeescript.
You can view the original site at http://ycatalyst.com.
Please note that this is alpha quality and very much a work in progress.
If you would like to contribute, please email me at jkwon.work@gmail.com.
If you want to check out the real-time features, you can create a test
account at our staging server: http://staging.ycatalyst.com:8080/.
Use invite-code 'staging'.
Features
========
* Real-time updates of comments
* Invite-only membership with an application process
Dependencies
============
* Node.js v0.3.2 or higher, preferably v0.4.2
* Coffeescript v1.0.1
* Sass (as in Haml/Sass)
npm install:
* coffee-script
* node-mongodb-native
* nodemailer
git submodule init will install more dependencies, some from my personal forks.
|
f5ee6630-240e-4115-b236-9e4790910aaa | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-17 17:02:11", "repo_name": "dbohn/FU-Kundenprojekt-2016-17", "sub_path": "/Demonstrator/src/main/java/de/fuberlin/kundenprojekt/friedrich/social/messages/Participant.java", "file_name": "Participant.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "b17c642e79452f0b54623243dcc31c710b3768a0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dbohn/FU-Kundenprojekt-2016-17 | 214 | FILENAME: Participant.java | 0.191933 | package de.fuberlin.kundenprojekt.friedrich.social.messages;
import de.fuberlin.kundenprojekt.friedrich.models.User;
/**
* A participant wraps a HumHub user in a conversation.
* If possible, it will be attached to a user.
*
* @author Team Friedrich
*/
public class Participant {
private User user;
private String displayName;
private Long socialId;
public Participant(User user, String displayName, Long socialId) {
this.user = user;
this.displayName = displayName;
this.socialId = socialId;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public Long getSocialId() {
return socialId;
}
public void setSocialId(Long socialId) {
this.socialId = socialId;
}
}
|
0d974ff3-f9b5-4abf-bb7a-063f18cd3d61 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-01 03:49:26", "repo_name": "n4kong/spring-cloud-contract-mountebank", "sub_path": "/stub-converter/src/main/java/com/demo/CustomConverter.java", "file_name": "CustomConverter.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "bd35e426f22773c19355794832573c8ed56413f6", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/n4kong/spring-cloud-contract-mountebank | 195 | FILENAME: CustomConverter.java | 0.218669 | package com.demo;
import org.springframework.cloud.contract.spec.Contract;
import org.springframework.cloud.contract.verifier.converter.StubGenerator;
import org.springframework.cloud.contract.verifier.file.ContractMetadata;
import java.util.HashMap;
import java.util.Map;
public class CustomConverter implements StubGenerator {
@Override
public boolean canHandleFileName(String fileName) {
return true;
}
@Override
public Map<Contract, String> convertContents(String rootName, ContractMetadata content) {
System.out.println("HELLO");
Map map = new HashMap<Contract,String>();
content.getConvertedContract().stream().forEach(c -> {
map.put(c, "This is Dummy " + c.getName());
});
return map;
}
@Override
public String generateOutputFileNameForInput(String inputFileName) {
return "CUSTOM_" + inputFileName;
}
@Override
public String fileExtension() {
return ".ejs";
}
}
|
9f7d9d8b-7a3e-4b00-9024-a16119d51ca7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-04-10T14:27:34", "repo_name": "awurth/SlimValidation", "sub_path": "/CHANGELOG.md", "file_name": "CHANGELOG.md", "file_ext": "md", "file_size_in_byte": 1002, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "6b9300c8e766bde522802caad0f6c8c55a243a73", "star_events_count": 75, "fork_events_count": 33, "src_encoding": "UTF-8"} | https://github.com/awurth/SlimValidation | 239 | FILENAME: CHANGELOG.md | 0.258326 | # Changelog
## v5.0.0
Complete rewrite
* Require PHP 8.1 or newer
* Changed namespace from `Awurth\SlimValidation` to `Awurth\Validator`
* Added support for Respect Validation v2, drop support for v1
* Removed error groups, use `context` instead for a similar feature
* Merged the `request`, `array`, `object` and `value` methods into a single `validate` method
* Made the validator stateless. The `validate` method now returns a `ValidationFailureCollection`
* Added a `StatefulValidator` to be able to use the Twig extension
* Renamed `Awurth\SlimValidation\ValidatorExtension` to `Awurth\Validator\Twig\LegacyValidatorExtension`
* Moved validation logic to an `Asserter` class
* Added a `DataCollectorAsserter` to collect all data passing through the validator, not just invalid values, as an instance of `ValidatedValueCollection`
* Added `ValueReaders` to get values from array keys, object properties or request parameters
* Made all classes final while adding extension points for everything
|
c8f80fae-3025-45a9-a919-f23cf404ef74 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-29 03:26:31", "repo_name": "garymabin/Startkit", "sub_path": "/app/src/main/java/com/thoughtworks/android/startkit/AppExecutors.java", "file_name": "AppExecutors.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "22c841e7b3d75a2d9a128c90d3241ec854ed2e86", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/garymabin/Startkit | 188 | FILENAME: AppExecutors.java | 0.271252 | package com.thoughtworks.android.startkit;
import android.os.Handler;
import android.os.Looper;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Singleton
@AllArgsConstructor
public class AppExecutors {
@Getter
private final Executor diskIO;
@Getter
private final Executor networkIO;
@Getter
private final Executor mainThread;
@Inject
public AppExecutors() {
diskIO = Executors.newSingleThreadExecutor();
networkIO = Executors.newFixedThreadPool(3);
mainThread = new MainThreadExecutor();
}
private static class MainThreadExecutor implements Executor {
private Handler mainThreadHandler = new Handler(Looper.getMainLooper());
@Override
public void execute(Runnable command) {
mainThreadHandler.post(command);
}
}
}
|
cc94db8c-3a99-4fbf-bbdc-84552ddff737 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-28 12:02:38", "repo_name": "xxzzll/springcloud-learning", "sub_path": "/springcloud02/cloud-consumer-feign-hystrix-order80/src/main/java/com/huawei/springcloud/controller/HystrixOrderController.java", "file_name": "HystrixOrderController.java", "file_ext": "java", "file_size_in_byte": 991, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "420869aee4880a66f4fe56ef8f559e97d31d1f01", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xxzzll/springcloud-learning | 218 | FILENAME: HystrixOrderController.java | 0.208179 | package com.huawei.springcloud.controller;
import com.huawei.springcloud.service.HystrixPaymentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author xixi
* @Description:
* @create 2020/3/17
* @since 1.0.0
*/
@RestController
public class HystrixOrderController {
@Resource
private HystrixPaymentService hystrixPaymentService;
@GetMapping("/customer/hystrixPayment/hystrixPayment_ok/{id}")
String paymentInfo_OK(@PathVariable("id") Integer id){
String result = hystrixPaymentService.paymentInfo_OK(id);
return result;
}
@GetMapping("/customer/hystrixPayment/hystrixPayment_Timeout/{id}")
String paymentInfo_TimeOut(@PathVariable("id") Integer id){
String result = hystrixPaymentService.paymentInfo_TimeOut(id);
return result;
}
}
|
887c7bde-90aa-4a95-9322-adcbbfadfc10 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-12 06:08:02", "repo_name": "zhaoxu77/netty_study", "sub_path": "/src/main/java/com/dixn/netty/client/ClientChannelInitializer.java", "file_name": "ClientChannelInitializer.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "6d364cc8faeb88dafa4ea2f14e0d92731898fe79", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhaoxu77/netty_study | 216 | FILENAME: ClientChannelInitializer.java | 0.23092 | package com.dixn.netty.client;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.handler.codec.FixedLengthFrameDecoder;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
/**
* ${DESCRIPTION}
*
* @author
* @create 2019-03-05 14:07
**/
public class ClientChannelInitializer extends ChannelInitializer {
protected void initChannel(Channel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
/* ByteBuf delimiter = Unpooled.copiedBuffer("\t".getBytes());
pipeline.addLast("framer", new DelimiterBasedFrameDecoder(2048,delimiter));
*/
pipeline.addLast(new FixedLengthFrameDecoder(23));
pipeline.addLast("decoder", new StringDecoder());
pipeline.addLast("encoder", new StringEncoder());
// 客户端的逻辑
pipeline.addLast("handler", new HelloWorldClientHandler());
}
}
|
a2f1d589-2a3b-42ad-8505-d9d5a0a942a1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-07 13:49:54", "repo_name": "sadisha123/student-management", "sub_path": "/src/view/AppInitializer.java", "file_name": "AppInitializer.java", "file_ext": "java", "file_size_in_byte": 985, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "19cdc5d9d7241673f3b4dcd7dd8fa18fc3e23984", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sadisha123/student-management | 162 | FILENAME: AppInitializer.java | 0.240775 | package view;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import java.io.IOException;
public class AppInitializer extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws IOException {
Parent root = FXMLLoader.load(this.getClass().getResource("/view/MainForm.fxml"));
Scene mainScene = new Scene(root);
mainScene.setFill(Color.TRANSPARENT);
primaryStage.initStyle(StageStyle.TRANSPARENT);
primaryStage.setScene(mainScene);
primaryStage.setTitle("Student Management System");
primaryStage.setResizable(false);
primaryStage.show();
primaryStage.centerOnScreen();
}
}
|
f699c089-31e8-4609-8e76-029c5446ea10 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-03 13:11:52", "repo_name": "9reynas/fragment_to_acti_omunicacion", "sub_path": "/app/src/main/java/proyect/my/of/example/miyuki/myapplication/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 987, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "bc8261f8ca76ce0a92a0d324cc72f8338fa1239f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/9reynas/fragment_to_acti_omunicacion | 179 | FILENAME: MainActivity.java | 0.224055 | package proyect.my.of.example.miyuki.myapplication;
import android.app.Fragment;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity implements BlankFragment.OnFragmentInteractionListener {
Interfaz interfaz = new Interfaz() {
@Override
public void llenarTextview(String s) {
textView.setText(s);
}
};
TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
BlankFragment fragment = new BlankFragment();
fragment.setInterfaz(interfaz);
getFragmentManager().beginTransaction().replace(R.id.frameLayout, fragment).commit();
}
@Override
public void onFragmentInteraction(Uri uri) {
}
}
|
0b740f5c-9563-41e3-839d-64bf4c9732c5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-18 01:22:06", "repo_name": "sunyue1380/QuickAPI", "sub_path": "/src/main/java/cn/schoolwow/quickapi/domain/APIController.java", "file_name": "APIController.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "34877b0f721185f6e54a07d0a8449021a7d5e895", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sunyue1380/QuickAPI | 216 | FILENAME: APIController.java | 0.249447 | package cn.schoolwow.quickapi.domain;
import java.util.ArrayList;
import java.util.List;
public class APIController {
/**是否被废弃*/
public boolean deprecated;
/**控制器*/
private String name;
/**控制器类名*/
public String className;
/**接口*/
public List<API> apiList = new ArrayList<>();
/**控制器类*/
public transient Class clazz;
public String getName() {
return name;
}
public void setName(String name) {
if(null==this.name||this.name.isEmpty()){
this.name = name;
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
APIController that = (APIController) o;
return className != null ? className.equals(that.className) : that.className == null;
}
@Override
public int hashCode() {
return className != null ? className.hashCode() : 0;
}
}
|
5cf0019a-b914-49a4-b882-1e881c882e62 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-14 09:15:14", "repo_name": "rohanagarwal36/Polling", "sub_path": "/src/java/com/onps/actions/VoterVerifyInfo.java", "file_name": "VoterVerifyInfo.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "4dba8d5c45961414124283c32d85388ed128300f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rohanagarwal36/Polling | 196 | FILENAME: VoterVerifyInfo.java | 0.259826 |
package com.onps.actions;
import static com.opensymphony.xwork2.Action.SUCCESS;
import com.opensymphony.xwork2.ActionSupport;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.struts2.interceptor.ServletRequestAware;
public class VoterVerifyInfo extends ActionSupport implements ServletRequestAware{
private String vid;
HttpSession session;
HttpServletRequest request;
@Override
public String execute(){
session=request.getSession(false);
session.setAttribute("vid", vid);
return SUCCESS;
}
@Override
public void validate(){
if(vid==null||vid.equals(""))
addFieldError("vid", "Select Voter");
}
public String getVid() {
return vid;
}
public void setVid(String vid) {
this.vid = vid;
}
public void setServletRequest(HttpServletRequest hsr) {
request=hsr;
}
}
|
c4842658-aea6-4e35-8a08-c055203263ab | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-02 11:55:31", "repo_name": "LiviaMitrica/News-Reader", "sub_path": "/app/src/main/java/com/liviamitrica/nr/ui/main/bindings/RecyclerBinding.java", "file_name": "RecyclerBinding.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "e95c1a10f5bcc29537f0ca82bba35b045cf1a2c6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LiviaMitrica/News-Reader | 182 | FILENAME: RecyclerBinding.java | 0.255344 | package com.liviamitrica.nr.ui.main.bindings;
import androidx.databinding.BindingAdapter;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.liviamitrica.nr.ui.main.adapter.ArticleAdapter;
import com.liviamitrica.nr.ui.main.listener.NewsArticleHandler;
import com.liviamitrica.nr.ui.main.model.ArticleItemViewModel;
import java.util.List;
public class RecyclerBinding {
@BindingAdapter({"items", "todoHandler"})
public static void addFeedItems(RecyclerView recyclerView, List<ArticleItemViewModel> newsList, NewsArticleHandler handler) {
ArticleAdapter taskAdapter = (ArticleAdapter) recyclerView.getAdapter();
if (taskAdapter == null) {
taskAdapter = new ArticleAdapter();
recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));
recyclerView.setAdapter(taskAdapter);
}
taskAdapter.setItems(newsList, handler);
}
}
|
b87988c1-7281-4e9e-9024-b86a0f69bf65 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-06 08:27:52", "repo_name": "CaiXiaoShuang/FastLibrary", "sub_path": "/app/src/main/java/com/intelligence/androidapplication/ui/main/fragment/MyFragment.java", "file_name": "MyFragment.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "d8caec908bfbc6b8e15925c1a1ea0dc81e21ee32", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CaiXiaoShuang/FastLibrary | 190 | FILENAME: MyFragment.java | 0.204342 | package com.intelligence.androidapplication.ui.main.fragment;
import android.os.Bundle;
import com.intelligence.androidapplication.R;
import com.intelligence.androidapplication.utils.CommonDialog;
/**
* Created by Administrator
* on 2017/9/18.
*/
public class MyFragment extends BaseFragment {
public static MyFragment newInstance() {
Bundle args = new Bundle();
MyFragment fragment = new MyFragment();
fragment.setArguments(args);
return fragment;
}
@Override
protected int getLayoutResource() {
return R.layout.fragment_my;
}
@Override
public void initData() {
}
@Override
protected void initView() {
final CommonDialog confirmDialog = new CommonDialog(mActivity);
confirmDialog.show();
confirmDialog.setClicklistener(new CommonDialog.ClickListenerInterface() {
@Override
public void doConfirm() {
}
});
}
}
|
c6213576-182d-40d9-8c7b-44c523777dfc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-31 09:23:39", "repo_name": "Prkleenpojat/EV3robo", "sub_path": "/eclipse-workspace/alkuperainen/src/alkuperainen/ColorSensor.java", "file_name": "ColorSensor.java", "file_ext": "java", "file_size_in_byte": 974, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "bbc45ff1aa788fc95bdce06c2efd0e70426a5422", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Prkleenpojat/EV3robo | 257 | FILENAME: ColorSensor.java | 0.277473 | package alkuperainen;
import java.util.Arrays;
import lejos.hardware.port.Port;
import lejos.hardware.sensor.EV3ColorSensor;
import lejos.robotics.Color;
import lejos.robotics.ColorDetector;
import lejos.robotics.ColorIdentifier;
public class ColorSensor implements ColorDetector, ColorIdentifier{
test asd;
ColorSensor(test i){
asd = i;
}
@Override
public void run() {
EV3ColorSensor sensor;
float[] sample;
//EV3ColorSensor color = new EV3ColorSensor(SensorPort.S1);
//color.setCurrentMode("Red");
// Luodaan ColorSensor -objekti
public ColorSensor(Port port) {
sensor = new EV3ColorSensor(port);
//setRedMode();
//setAmbientMode();
//setFloodLight(false);
}
public void setRedMode() {
sensor.setCurrentMode("Red");
sample = new float[sensor.sampleSize()];
}
public float getRed() {
sensor.fetchSample(sample, 0);
return sample[0];
}
}
}
|
017e5736-eef0-4e62-a43d-8b33ff95628d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-07-09 00:40:50", "repo_name": "chenjiali5211/TimeMagic", "sub_path": "/src/main/java/wl/action/UserAjaxAction.java", "file_name": "UserAjaxAction.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "8f377cfdf080be8e1ac80754b1c759ce77e39464", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/chenjiali5211/TimeMagic | 192 | FILENAME: UserAjaxAction.java | 0.233706 | package wl.action;
import javax.annotation.Resource;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import com.opensymphony.xwork2.ActionSupport;
import wl.entity.User;
import wl.service.UserService;
@Controller
@Scope("prototype")
public class UserAjaxAction extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
@Resource
private UserService userService;
private String userName;
private String result;
public String getUser(){
User user = userService.getUserByUserName(userName);
if(user != null){
result = "已存在";
}else{
result = "不存在";
}
return SUCCESS;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
}
|
c2bdc7db-f34c-44d8-be98-c58c0fa4e282 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-12 01:35:42", "repo_name": "18bshiraki/Yamazon", "sub_path": "/Yamazon/src/main/java/yamazon/controller/ManagerDeleteController.java", "file_name": "ManagerDeleteController.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "79da3775d8b1eafce0a4b916da1b59c32d7ed2e2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/18bshiraki/Yamazon | 193 | FILENAME: ManagerDeleteController.java | 0.264358 | package yamazon.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import yamazon.dao.ManagerDao;
import yamazon.entity.Manager;
import yamazon.form.ManagerForm;
@Controller
public class ManagerDeleteController {
@Autowired
ManagerDao managerDao;
@GetMapping("/managerDeleteResult")
String delete(@ModelAttribute("yamazon")ManagerForm form, Model model) {
String id = form.getManagerId();
int ids = Integer.parseInt(id);
if(ids == 1) {
List<Manager> manager = managerDao.findAll();
model.addAttribute("list", manager);
model.addAttribute("msg","管理者番号1を削除することは出来ません");
return "managerSearch";
}
managerDao.delete(ids);
return"managerDeleteResult";
}
}
|
9f226d51-db3b-462c-ab43-dc75bc6b7624 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-13 09:24:17", "repo_name": "Liushao1/sentinel", "sub_path": "/src/main/java/com/ls/cloud/SentinelApplication.java", "file_name": "SentinelApplication.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "1810e32d8170077f93eb327e846bd0bce2861660", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Liushao1/sentinel | 206 | FILENAME: SentinelApplication.java | 0.253861 | package com.ls.cloud;
import com.alibaba.csp.sentinel.slots.block.RuleConstant;
import com.alibaba.csp.sentinel.slots.block.flow.FlowRule;
import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.util.ArrayList;
import java.util.List;
@SpringBootApplication
public class SentinelApplication {
public static void main(String[] args) {
//在启动类中开启了,则不会注册到dashboard
//initFlowRules();
SpringApplication.run(SentinelApplication.class, args);
}
/**
* 方法的限流规则集合
*/
private static void initFlowRules(){
List<FlowRule> rules = new ArrayList<>();
FlowRule rule = new FlowRule();
rule.setResource("PersonGetBody");
rule.setGrade(RuleConstant.FLOW_GRADE_QPS);
rule.setCount(2);
rules.add(rule);
FlowRuleManager.loadRules(rules);
}
}
|
db6bd600-ec4e-4484-841e-639d9e99090c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-08-13T22:14:26", "repo_name": "sbkammann/Classic-Arcade-Game-Clone", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 984, "line_count": 15, "lang": "en", "doc_type": "text", "blob_id": "7beb5661bf09836e875373af1e358ef31edcebc0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sbkammann/Classic-Arcade-Game-Clone | 225 | FILENAME: README.md | 0.262842 | # Classic Arcade Game Clone
The game is a clone of the classic game frogger.
### How to play
First, the user needs to select one of the difficulties levels. Baby is easy and iNSane(insane) is hard. The player can't progress without choosing either one. Next, the user needs to select the character s/he wants to play. Arrow keys move the selection image. Clicking the start button locks in the selection and applies it to the game.
In game, the user must avoid bug enemies and make it to the water. Reaching the water will win the game and enter the player's points on the highscore board under YOU. Colliding with an enemy bug will end the game and reset points and the timer. Collecting gems increases points. Blue gems are worth 300, green gems are worth 200, and orange gems are worth 100.
### How to start
Open the index.html file in your browser and follow the prompts in the modal windows.
### Acknowledgments
Visual assets and game loop engine were provided by Udacity.
|
bdf711fd-c264-409e-bd74-9b92d53a0d47 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-31 15:24:21", "repo_name": "JMavrelos/pbca", "sub_path": "/core/src/main/java/gr/blackswamp/core/app/AttachedFragment.java", "file_name": "AttachedFragment.java", "file_ext": "java", "file_size_in_byte": 974, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "615c8c05f3ccb4d5760099b6d82ecfc9652d90ca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/JMavrelos/pbca | 189 | FILENAME: AttachedFragment.java | 0.256832 | package gr.blackswamp.core.app;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
public abstract class AttachedFragment<T extends CoreInteraction> extends CoreFragment {
private T _parent;
protected T parent() {
return _parent;
}
@Override
@Deprecated
public void onAttach(Activity activity) {
super.onAttach(activity);
do_attach(activity);
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
do_attach(context);
}
private void do_attach(final Context context) {
//this SHOULD throw an exception if the parent is not set correctly
//noinspection unchecked
_parent = (T) context;
}
@Override
public void onDetach() {
super.onDetach();
_parent = null;
}
}
|
49c2e487-02f6-4190-94c2-d76a7d44d4b1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-07-02T23:20:47", "repo_name": "AccessBell/AccessBellVideoAndroidSDK1", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 971, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "7c2dab23c114794a37329e1d7203c98bd8c189e3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AccessBell/AccessBellVideoAndroidSDK1 | 189 | FILENAME: README.md | 0.206894 | # AccessBellVideoAndroidSDK1
Android SDK for AccessBell video conferencing
The following is a guide on how to set up the sdk in an existing Android project.
Clone this repository to your device.
Add the Maven repository in the build.gradle file for the Android Studio application.
allprojects {
repositories {
google()
jcenter()
maven {
url "/Users/USERNAME/desktop/AccessBellVideoAndroidSDK1/releases"
}
}
}
Note that the url points to the location of the repository, which you have cloned.
Add the following implementation under the dependencies section of the build.gradle section.
implementation ('org.accessbell.react:accessbell-meet-sdk:2.9.0') { transitive = true }
Rebuild your application and use the sdk by adding "import org.accessbell.meet.sdk" to the respective files in which you want to
display your video conference.
|
a74b423d-5ed5-4c34-9301-f3f359d28a60 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-28 20:26:22", "repo_name": "Bertrand3135/TP-RPG", "sub_path": "/src/com/imie/rpg/database/DBManager.java", "file_name": "DBManager.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "0ff2b3a86c49df42ff1012ea8357963bf8cf0578", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Bertrand3135/TP-RPG | 238 | FILENAME: DBManager.java | 0.284576 | /**
*
*/
package com.imie.rpg.database;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
* @author florian
*
*/
public class DBManager {
public DBManager() {
}
public ResultSet select(String request) {
ResultSet rs = null;
Statement stmt = null;
try {
stmt = DBOpenHelper.getInstance().getConnection().createStatement();
rs = stmt.executeQuery(request);
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
rs.close();
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return rs;
}
public void update(String request) {
Statement stmt = null;
try {
stmt = DBOpenHelper.getInstance().getConnection().createStatement();
stmt.executeUpdate(request);
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
|
dcec55cd-8dae-4ee5-ba46-e934afd81463 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-01-04T19:08:48", "repo_name": "IvanCoronado/running-statistics-from-Barcelona", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 978, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "5609efabc6a0d5fdffc8731110f5a71e28345cc0", "star_events_count": 7, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/IvanCoronado/running-statistics-from-Barcelona | 241 | FILENAME: README.md | 0.245085 | # running-statistics-from-Barcelona
This project is based on [this amazing design](https://dribbble.com/shots/2218824-Running-statistics-from-Barcelona). I loved the concept and i made it real, just for fun :)
[angular-google-maps directive](https://github.com/angular-ui/angular-google-maps) was used on deep for this project. So if you are interested on cool features like markerLabel or infoBox you can check the code, or open an issue.
# Preview
(Optimized for Chrome, still not fully responsive)
[DEMO](http://htmlpreview.github.io/?https://rawgit.com/IvanCoronado/running-statistics-from-Barcelona/master/dist/index.html#/)
# Installation
Download de project go to the directory and:
```
npm install
bower install
gulp serve
```
This project uses [this angular seed](https://github.com/swiip/generator-gulp-angular#readme), check it for more info.
# Coming soon
Responsive and new cool animations.
# About me
[linkedin](https://es.linkedin.com/in/ivancoronadomoreno)
|
056e5e4f-2a8d-4e88-8d56-49c4aceedf0a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-31 20:34:06", "repo_name": "CharlieM1997/Webapps2019", "sub_path": "/webapps2019/src/main/java/com/cpwm20/webapps2019/jsf/StartupBean.java", "file_name": "StartupBean.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "db28c4ac08b554e92f40ad1f6715765040ab8bed", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CharlieM1997/Webapps2019 | 246 | FILENAME: StartupBean.java | 0.267408 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.cpwm20.webapps2019.jsf;
import com.cpwm20.webapps2019.ejb.UserService;
import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.inject.Inject;
/**
*
* @author cpwm20 Registers an initial admin to the database.
*/
@Singleton
@Startup
public class StartupBean {
@Inject
private UserService usrSrv;
/**
* Calls the user service with details for admin1 and the name 'Root
* Administrator' after the project has been constructed.
*/
@PostConstruct
public void init() {
if (usrSrv.findUser("admin1", "admin1") == null) {
usrSrv.registerSupervisor("admin1", "admin1", "Root", "Administrator", "admin1@sussex.ac.uk", "Informatics", "+447000000000", true);
}
}
}
|
d7d89d9c-e515-43fc-940d-c19c90b86f73 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-13 17:06:37", "repo_name": "IncPlusPlus/classpath-fixer", "sub_path": "/src/main/java/io/github/incplusplus/classpathfixer/ImlClasspathPair.java", "file_name": "ImlClasspathPair.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "c329714ad83026f8f7cb2219bea97e053a3bbaf2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/IncPlusPlus/classpath-fixer | 230 | FILENAME: ImlClasspathPair.java | 0.26971 | package io.github.incplusplus.classpathfixer;
import io.github.incplusplus.classpathfixer.ec.classpath.Classpath;
import io.github.incplusplus.classpathfixer.ij.module.Module;
import java.io.File;
/**
* This is just an easy way to return both a .classpath and .iml from one method
*/
public class ImlClasspathPair
{
private final Classpath classPath;
private final File classPathLocation;
private final Module module;
private final File modulePathLocation;
public ImlClasspathPair(Classpath classPath, File classPathLocation, Module module, File modulePathLocation) {
this.classPath = classPath;
this.classPathLocation = classPathLocation;
this.module = module;
this.modulePathLocation = modulePathLocation;
}
public Classpath getClassPath()
{
return classPath;
}
public File getClassPathLocation()
{
return classPathLocation;
}
public Module getModule()
{
return module;
}
public File getModulePathLocation()
{
return modulePathLocation;
}
}
|
45e511e3-a44b-43dd-b457-e7ed5d78ccd1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-07 17:55:08", "repo_name": "renanrts/teste_SpringMVC", "sub_path": "/testeSpringMVC/src/main/java/br/com/renantorres/conf/ServletSpringMVC.java", "file_name": "ServletSpringMVC.java", "file_ext": "java", "file_size_in_byte": 990, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f47c958c06e04d8566ea35ff0e39a517004c623b", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/renanrts/teste_SpringMVC | 193 | FILENAME: ServletSpringMVC.java | 0.195594 | package br.com.renantorres.conf;
import javax.servlet.Filter;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class ServletSpringMVC extends AbstractAnnotationConfigDispatcherServletInitializer{
@Override
protected Class<?>[] getRootConfigClasses() {
return null;
}
//para o Spring encontrar a classe JPAConfiguration
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class[] { AppWebConfiguration.class, JPAConfiguration.class};
}
@Override
protected String[] getServletMappings() {
return new String[] {"/"};
}
@Override
protected Filter[] getServletFilters() {
CharacterEncodingFilter encodingFilter = new CharacterEncodingFilter();
encodingFilter.setEncoding("UTF-8");
return new Filter[] {encodingFilter};
}
}
|
65f713e7-be3d-4eeb-839f-2c205ab850a5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-19 01:01:26", "repo_name": "diegocolombo/ebanx-home-assignment", "sub_path": "/src/main/java/com/colombo/ebanx/dao/AccountDAO.java", "file_name": "AccountDAO.java", "file_ext": "java", "file_size_in_byte": 988, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "1fb0809236cfefb5e221e515bd6d4ac6de53429b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/diegocolombo/ebanx-home-assignment | 234 | FILENAME: AccountDAO.java | 0.274351 | package com.colombo.ebanx.dao;
import com.colombo.ebanx.model.Account;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.ApplicationScope;
import java.util.Map;
import java.util.Optional;
import java.util.WeakHashMap;
/**
* Simulates a DAO, doing operations over a map
*
* @author Diego Colombo <diego.colombo@wssim.com.br>
* @since v0.0.1 2020-09-18
*/
@Component
@ApplicationScope
public class AccountDAO {
private static final Map<String, Account> ACCOUNTS = new WeakHashMap<>();
public void reset() {
ACCOUNTS.clear();
final Account account100 = new Account("100");
final Account account300 = new Account("300");
save(account100);
save(account300);
}
public void save(final Account account) {
ACCOUNTS.put(account.getId(), account);
}
public Optional<Account> findById(final String id) {
return Optional.ofNullable(ACCOUNTS.get(id));
}
}
|
7a2b9025-9eee-4f3f-bb54-add72b44a649 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-13 06:59:20", "repo_name": "principrincess/Selenium", "sub_path": "/src/main/java/MouseMovementConcept.java", "file_name": "MouseMovementConcept.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "2e1e0b21cb24b80901edf34eb0a37ffb4c32ab38", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/principrincess/Selenium | 205 | FILENAME: MouseMovementConcept.java | 0.247987 |
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import java.util.concurrent.TimeUnit;
public class MouseMovementConcept{
private WebDriver driver;
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.gecko.driver", "C:/Webdriver/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
// Maximize the browser's window
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://www.compliancekey.us/");
Actions action =new Actions (driver);
action.moveToElement(driver.findElement(By.linkText("Industries"))).build().perform();
Thread.sleep(3000);
driver.findElement(By.xpath("/html/body/div[1]/nav/div[2]/ul/li[2]/ol/li[1]/a")).click();
}
}
|
94f13936-b2e7-4a5f-b015-ccfee2c480e4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-10-21 07:15:14", "repo_name": "zimoguo/WeChatDemo", "sub_path": "/WeChatDemo/src/com/lili/guo/wechatdemo/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 989, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ab93899762b97b7d605eb09f2a53b1d89e0d7b36", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "IBM852"} | https://github.com/zimoguo/WeChatDemo | 219 | FILENAME: MainActivity.java | 0.246533 | package com.lili.guo.wechatdemo;
import java.lang.reflect.Field;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.ViewConfiguration;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setOverflowShowingAlways();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
/**
* Ă┴▒╬╬´└Ýmenu╝Ř
*/
private void setOverflowShowingAlways() {
try {
ViewConfiguration config = ViewConfiguration.get(this);
Field menuKeyField = ViewConfiguration.class
.getDeclaredField("sHasPermanentMenuKey");
menuKeyField.setAccessible(true);
menuKeyField.setBoolean(config, false);
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
678b13c4-faea-41d8-a811-e3536d370817 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-05 02:57:03", "repo_name": "18575783085/jt_parent", "sub_path": "/jt_web/src/main/java/top/ou/jt/web/threadlocal/UserThreadLocal.java", "file_name": "UserThreadLocal.java", "file_ext": "java", "file_size_in_byte": 765, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "f8647dd7d26fdd735bb8d06874d0fc3563259e94", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/18575783085/jt_parent | 315 | FILENAME: UserThreadLocal.java | 0.268941 | /**
* Copyright (C), 2017-?, OYE有限公司
* FileName: UserThreadLocal
* Author: OYE 517553812@qq.com
* Date: 2017/12/24 20:24
* Description:
* History:
* <author> <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
package top.ou.jt.web.threadlocal;
import top.ou.jt.web.pojo.User;
/**
* 〈一句话功能简述〉<br>
* 〈拦截器〉
*
* @author OYE 517553812@qq.com
* @create 2017/12/24 20:24
* @since 1.0.0
*/
public class UserThreadLocal {
private static ThreadLocal<User> CURTHREAD = new ThreadLocal<User>();
/**
* 获取用户对象
* @return
*/
public static User get(){
return CURTHREAD.get();
}
public static void set(User user){
CURTHREAD.set(user);
}
/**
* 获取用户的id
* @return
*/
public static Long getUserId(){
User user = CURTHREAD.get();
if(user != null){
return user.getId();
}else{
return null;
}
}
}
|
39613038-9f5f-43da-b366-9ba31bbe9028 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-09 14:50:34", "repo_name": "lbzhello/caiwei", "sub_path": "/caiwei-web/src/main/java/xyz/lius/web/service/impl/HelloWorldServiceImpl.java", "file_name": "HelloWorldServiceImpl.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "58107a0e4d437c52879bbdc5f1800867fbed6b83", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lbzhello/caiwei | 200 | FILENAME: HelloWorldServiceImpl.java | 0.240775 | package xyz.lius.web.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xyz.lius.web.entity.HelloWorld;
import xyz.lius.web.mapper.HelloWorldMapper;
import xyz.lius.web.service.HelloWorldService;
import java.util.List;
@Service
public class HelloWorldServiceImpl implements HelloWorldService {
@Autowired
private HelloWorldMapper helloWorldMapper;
@Override
public List<HelloWorld> findAll() {
return helloWorldMapper.findAll();
}
@Override
public HelloWorld findOne(String id) {
return helloWorldMapper.findOne(id);
}
@Override
public void insert(HelloWorld helloWorld) {
helloWorldMapper.insert(helloWorld);
}
@Override
public void update(HelloWorld helloWorld) {
helloWorldMapper.update(helloWorld);
}
@Override
public void delete(String id) {
helloWorldMapper.delete(id);
}
}
|
78d4c41e-20db-4a8d-b076-7bd23d1f30e1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-18 18:05:23", "repo_name": "treyzania/BlockParticles", "sub_path": "/src/main/java/com/treyzania/mc/blockparticles/WorldLoadStateListener.java", "file_name": "WorldLoadStateListener.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "580adfd7098fbdddd983a6a8977b39c10ec11c15", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/treyzania/BlockParticles | 218 | FILENAME: WorldLoadStateListener.java | 0.282988 | package com.treyzania.mc.blockparticles;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.event.world.WorldUnloadEvent;
public class WorldLoadStateListener implements Listener {
private DataManager manager;
public WorldLoadStateListener(DataManager man) {
this.manager = man;
}
@EventHandler
public void onWorldLoad(WorldLoadEvent event) {
World w = event.getWorld();
Bukkit.getLogger().info("Loading BlockParticles data for " + w.getName() + ".");
this.manager.loadWorld(w);
Bukkit.getLogger().fine("Done!");
}
@EventHandler
public void onWorldUnload(WorldUnloadEvent event) {
World w = event.getWorld();
Bukkit.getLogger().info("Saving and unloading BlockParticles data for " + w.getName() + ".");
this.manager.flushAndUnloadWorld(w);
Bukkit.getLogger().fine("Done!");
}
}
|
34d2bb0d-93f2-4d1f-9405-f1f2dc810819 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-25 17:32:25", "repo_name": "rishav2/31-DAYS-OF-CODE", "sub_path": "/DAY 7/solution.java", "file_name": "solution.java", "file_ext": "java", "file_size_in_byte": 972, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "13fb8a49c3e89057bfc71994224ec3bdebd8386a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rishav2/31-DAYS-OF-CODE | 192 | FILENAME: solution.java | 0.287768 | import java.io.*;
import java.util.*;
import javax.lang.model.util.ElementScanner6;
public class Solution {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
ArrayList<String> strings = new ArrayList();
int a = scanner.nextInt();
scanner.nextLine();
for(int i=0;i<a;i++)
{
String b = scanner.nextLine();
strings.add(b);
String d = strings.get(i);
char[] characters = d.toCharArray();
for(int j=0;j<characters.length;j++)
{
if(j%2==0)
{
System.out.print(characters[j]);
}
}
System.out.print(" ");
for(int j=0;j<characters.length;j++)
{
if(j%2!=0)
System.out.print(characters[j]);
}
System.out.println("");
}
scanner.close();
}
}
|
e399f398-2127-4bb8-af3e-09f8a76a4320 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-16 15:13:27", "repo_name": "lajosadam/training-solutions", "sub_path": "/src/main/java/jdbc2/ConnectDb.java", "file_name": "ConnectDb.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "8f30058725084d274328a2eb739eba5bc055ee80", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lajosadam/training-solutions | 180 | FILENAME: ConnectDb.java | 0.246533 | package jdbc2;
import org.mariadb.jdbc.MariaDbDataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
public class ConnectDb {
public static void main(String[] args) {
MariaDbDataSource dataSource = new MariaDbDataSource();
try {
dataSource.setUrl("jdbc:mysql://localhost:3306/employees?useUnicode=true");
dataSource.setUser("root");
dataSource.setPassword("12345");
}
catch (SQLException throwables) {
throwables.printStackTrace();
}
try (
Connection conn = dataSource.getConnection();
PreparedStatement stmt = conn.prepareStatement("INSERT INTO employees(emp_name) VALUES (?)");) {
stmt.setString(1, "Pista");
stmt.executeUpdate();
}
catch (SQLException se) {
throw new IllegalStateException(se);
}
}
}
|
4ede3c22-70a4-43ac-ad9c-d94726089f5e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-01 16:46:23", "repo_name": "DeaishaJohnson/FRC203INFINITERECHARGE", "sub_path": "/2020_Robot_v.0.3/src/main/java/frc/robot/subsystems/LEDLights.java", "file_name": "LEDLights.java", "file_ext": "java", "file_size_in_byte": 492, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "b62024eb9a01ea5c910f865097b5fa981a8d502a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DeaishaJohnson/FRC203INFINITERECHARGE | 187 | FILENAME: LEDLights.java | 0.185947 | /*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc.robot.subsystems;
import edu.wpi.first.wpilibj.Spark;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class LEDLights extends SubsystemBase {
Spark lights = new Spark(0);
public LEDLights() {
SmartDashboard.getNumber("LED", 0);
}
public void setLight(double lightValue){
lights.set(lightValue);
}
@Override
public void periodic() {
SmartDashboard.putNumber("LED", 0);
}
}
|
62d50e3b-7bbf-4c67-8040-8a55da5fe571 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-06-14T17:42:15", "repo_name": "laols574/nlp-portfolio", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 992, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "9de6f6127bced3dd06d6ae0b069e651e2283c1be", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/laols574/nlp-portfolio | 206 | FILENAME: README.md | 0.229535 | # nlp-portfolio
This tar file contains multiple nlp projects which can be run by executing "pytest" in each repository.
Decompressing files depends on your OS but you can use
tar -xvf nlp_portfolio.tar.gz
on the command line
## Project #1: transition-parser
This program acts as a transition dependency parser. It reads in text data, parses the input and
uses an oracle to predict the transition for all dependency trees in the training set. This is then used to train a classifer which predicts transitions for dependency trees in the testing set.
## Project #2: memm-classifier
This Maximum-entropy Markov model is a discriminative model which assumes conditional dependence. This program uses logistic regression to make a part of speech prediction for each word.
## Project #3: ngram-classifier
A simple logistic regression model which determines the difference between spam and ham samples.
## Project #4: words
This project uses word vectors to determine parts of speech.
|
bae9f1fd-eaf2-4cad-ad84-4eeceb014a5a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-24 06:16:59", "repo_name": "ravi84184/SWTRAINING", "sub_path": "/app/src/main/java/com/nikpatel/digitalgrow/WebView/WebViewActivity.java", "file_name": "WebViewActivity.java", "file_ext": "java", "file_size_in_byte": 989, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "838af62e823b34edc7bb55a4db857894543fd3fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ravi84184/SWTRAINING | 193 | FILENAME: WebViewActivity.java | 0.20947 | package com.nikpatel.digitalgrow.WebView;
import android.annotation.SuppressLint;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.nikpatel.digitalgrow.R;
public class WebViewActivity extends AppCompatActivity {
private WebView webView;
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web_view);
// webView = (WebView) findViewById(R.id.webView);
webView = new WebView(this);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://www.google.com");
setContentView(webView);
webView.setWebViewClient(new WebViewClient());
// String web = "<html><body><h1>Hello Ravi </h1></body></html>";
// webView.loadData(web,"text/html","UTF-8");
}
}
|
ca6ce550-bdea-4978-bfbb-effddbc68444 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-14 00:20:37", "repo_name": "arjun2064/JavaSwing_Airline_Tickit_Booking_system", "sub_path": "/airlineticketbookings/src/Business/masterschedule.java", "file_name": "masterschedule.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "2c2fa57843da91ccb2d6fc60b39046279ee43b7b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/arjun2064/JavaSwing_Airline_Tickit_Booking_system | 190 | FILENAME: masterschedule.java | 0.272799 | /*
* 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 Business;
import java.util.ArrayList;
/**
*
* @author Pranjal
*/
public class masterschedule {
private ArrayList<flightclass> masterflightdirectory;
public masterschedule() {
masterflightdirectory=new ArrayList<flightclass>();
}
public ArrayList<flightclass> getMasterflightdirectory() {
return masterflightdirectory;
}
public void setMasterflightdirectory(ArrayList<flightclass> masterflightdirectory) {
this.masterflightdirectory = masterflightdirectory;
}
public void addflight(flightclass flight){
masterflightdirectory.add(flight) ;
}
public void deleteflight(flightclass flight)
{
masterflightdirectory.remove(flight);
}
}
|
f82c0553-6761-46e0-ba8a-6fbd9f231e5d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-06 12:18:48", "repo_name": "SonarBoy/javaMasterClass", "sub_path": "/src/com/InterfacesExamples/MobilePhone.java", "file_name": "MobilePhone.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "44f78425321d84899fe59f64ec20e4bc159847b4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SonarBoy/javaMasterClass | 258 | FILENAME: MobilePhone.java | 0.256832 | package com.InterfacesExamples;
public class MobilePhone implements ITelephone{
private int myNumber;
private boolean isRinging;
private boolean isOn;
public MobilePhone(int num) {
this.myNumber = num;
}
@Override
public void powerOn() {
System.out.println("HELLO MOTO");
this.isOn = true;
}
@Override
public void dial(int phoneNumber) {
if(isOn) {
System.out.println("Now ringing " + myNumber + " on deskphone.");
}else {
System.out.println("Phone is off.");
}
}
@Override
public void answer() {
if(isRinging) {
System.out.println("Answering the mobile phone.");
isRinging = false;
}
}
@Override
public boolean callPhone(int phoneNumber) {
if(phoneNumber == myNumber && isOn) {
isRinging = true;
System.out.println("The Phone is Ringing!");
System.out.println("Play Ring tone");
}else {
isRinging = false;
}
return isRinging;
}
@Override
public boolean isRinging() {
return isRinging;
}
}
|
43033bf3-5e47-48ee-9cd9-f6f87b45ccd7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-07 06:35:04", "repo_name": "sourcewc/MoundaryClient", "sub_path": "/app/src/main/java/com/team/moundary/network/AlarmHandler.java", "file_name": "AlarmHandler.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "f267101d2d72b29112f59bfbaa53b6daccae37e6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/sourcewc/MoundaryClient | 203 | FILENAME: AlarmHandler.java | 0.253861 | package com.team.moundary.network;
import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Created by ccei on 2016-08-28.
*/
public class AlarmHandler {
public static AlarmEntityObject getJSONBloodRequestAllList(StringBuilder buf) {
JSONObject myStoryJSON = null;
AlarmEntityObject alarmEntityObject = null;
try {
Log.e("서버데이터", buf.toString());
myStoryJSON = new JSONObject(buf.toString());
String msg = myStoryJSON.optString("msg");
if(msg.equalsIgnoreCase("success")){
JSONObject data = myStoryJSON.optJSONObject("data");
alarmEntityObject = new AlarmEntityObject();
alarmEntityObject.alarmBoolean = data.optString("notificationCount");
}
} catch (JSONException je) {
Log.e("RequestAllList", "JSON파싱 중 에러발생", je);
}
return alarmEntityObject;
}
}
|
3b97079f-8181-4206-ad8a-d062237b05e4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-12 10:26:34", "repo_name": "N3bby/web3-webshop", "sub_path": "/Webshop_Web/src/main/java/controller/handler/RequestProductUpdateHandler.java", "file_name": "RequestProductUpdateHandler.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "02d3b80274e32159f976c5fc413d0611575a16ee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/N3bby/web3-webshop | 158 | FILENAME: RequestProductUpdateHandler.java | 0.294215 | package controller.handler;
import controller.Handler;
import controller.WebAction;
import domain.Product;
import service.ShopService;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebAction("requestProductUpdate")
public class RequestProductUpdateHandler extends Handler {
public RequestProductUpdateHandler(ShopService service) {
super(service);
}
@Override
public void handle(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Product product = getService().getProduct(id);
request.setAttribute("id", product.getId());
request.setAttribute("description", product.getDescription());
request.setAttribute("price", product.getPrice());
forward("productUpdate.jsp", request, response);
}
}
|
a7107aaf-9ea5-4d90-a151-d9f9c820d7c3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-21 20:08:59", "repo_name": "testcurry/javaweb", "sub_path": "/javaweb-servlet/servlet1/src/com/testcy/servlet/RequestServlet.java", "file_name": "RequestServlet.java", "file_ext": "java", "file_size_in_byte": 1110, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "b0b550246d9d770afa67481cff5629ac0c8bb859", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/testcurry/javaweb | 198 | FILENAME: RequestServlet.java | 0.216012 | package com.testcy.servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class RequestServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//获取请求资源路径
String requestURI = req.getRequestURI();
System.out.println("URI:"+requestURI);
//获取请求的统一资源定位符
StringBuffer requestURL = req.getRequestURL();
System.out.println("URL:"+requestURL);
//获取请求的客户端的地址
String remoteHost = req.getRemoteHost();
System.out.println("客户端的地址:"+remoteHost);
//获取请求头
String agent = req.getHeader("user-agent");
System.out.println("浏览器版本:"+agent);
//获取请求方式
String method = req.getMethod();
System.out.println("请求方式"+method);
}
}
|
d7066f0b-916a-49bc-88bd-41ac63e55787 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-29 03:00:30", "repo_name": "danielpacker/stats-rest-api", "sub_path": "/src/main/java/org/danielpacker/restapi/service/Transaction.java", "file_name": "Transaction.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "0c5002802af95cf8ba99fc93d25e208f9257de09", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/danielpacker/stats-rest-api | 206 | FILENAME: Transaction.java | 0.289372 | package org.danielpacker.restapi.service;
public class Transaction {
private double amount;
private long timestamp;
public Transaction(double amount, long timestamp) {
this.amount = amount;
this.timestamp = timestamp;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public boolean hasValidTimestamp() {
long current = System.currentTimeMillis();
long delta = (current - timestamp) / 1000;
//System.out.println("Current epoch millis: " + current);
//System.out.println("timestamp: " + timestamp);
//System.out.println("delta: " + delta);
// Reject future and old (>1 min) timestamps
return (delta >= 0 && delta <= 60);
}
}
|
ecc40371-84e7-4540-9bd1-e56e390782c1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-03-03 09:29:41", "repo_name": "qinweiforandroid/QUtils", "sub_path": "/app/src/androidTest/java/com/qw/utils/ExampleInstrumentedTest.java", "file_name": "ExampleInstrumentedTest.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "97226b2e78047802378ab23872c49582e63935b6", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/qinweiforandroid/QUtils | 211 | FILENAME: ExampleInstrumentedTest.java | 0.236516 | package com.qw.utils;
import android.content.Context;
import android.net.Uri;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
Uri uri = Uri.parse("ilisten:///topic/info?vip_is_free=1&id=542&title=专题列表");
System.out.println("Authority "+uri.getAuthority());
System.out.println("Path "+uri.getPath());
System.out.println("size "+uri.getQueryParameterNames().size());
assertEquals("com.qw.utils", appContext.getPackageName());
}
}
|
f4699e13-373e-467c-8293-e378ade8f84a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-12-11T19:21:34", "repo_name": "maggifs/HGOP", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 976, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "2bd8cebe91c67adc685270811334397785c45828", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/maggifs/HGOP | 356 | FILENAME: README.md | 0.225417 | # HGOP
Hagnýt gæðastjórnun og prófanir
[](http://54.242.184.100:8080/job/Github%20pipeline/)
---
## URL
Url to the Jenkins instance
<a href="http://54.242.184.100:8080">**54.242.184.100:8080**</a>
---
## DataDog Dashboard
Public link to the <a href="https://p.datadoghq.eu/sb/n6h2d11xqrvy3hk8-4362905296babb451155fa0a01b40f37">**DataDog Dashboard**</a> showing the past week.
Screenshot of the DataDog Dashboard

We also invited HrafnOrri1207@gmail.com to our team in DataDog.
## Other
**Week 3**
* Two extra things that are in the project, script to start a local instance of the game. Test script for the tests.
**Week 2**
* We added a build status for the README for jenkins and can be seen above.
**Week 1**
* We made two scripts for the setup, one for Linux and one for MacOS, since we are using seperate operating systems on our PCs. |
bd081f45-2316-4bd5-96b9-c340f54f1135 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-09-05 17:45:42", "repo_name": "steingrd/tempstation", "sub_path": "/src/main/java/com/github/steingrd/tempmonitor/commands/CreateSecret.java", "file_name": "CreateSecret.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "9e20f9a25021839810d16267a15983638eb85d09", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/steingrd/tempstation | 229 | FILENAME: CreateSecret.java | 0.285372 | package com.github.steingrd.tempmonitor.commands;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import redis.clients.jedis.JedisPool;
import com.github.steingrd.tempmonitor.app.JedisPoolFactory;
import com.github.steingrd.tempmonitor.security.AuthorizationService;
public class CreateSecret {
final static Logger log = LoggerFactory.getLogger(CreateSecret.class);
public static void main(String[] args) {
try {
createSecret(args);
} catch (Exception e) {
log.error("createSecret failed!", e);
}
}
static void createSecret(String[] args) throws Exception {
if (args.length != 1) {
log.info("Missing args: " + args.length);
return;
}
final String brewId = args[0];
final JedisPool jedisPool = new JedisPoolFactory().create();
final AuthorizationService authService = new AuthorizationService(jedisPool);
String secret = authService.createSecret(brewId);
log.info("Secret for brew {} is {} ", brewId, secret);
}
} |
f479955b-4aed-4e35-ad85-e0f054b82f1e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-04 09:35:35", "repo_name": "jajvirta/liiga", "sub_path": "/src/main/java/fi/tfs/liiga/filters/ServerHeaderFilter.java", "file_name": "ServerHeaderFilter.java", "file_ext": "java", "file_size_in_byte": 980, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "8aa9b99bf724abc70d652484cb89f364013eb675", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jajvirta/liiga | 193 | FILENAME: ServerHeaderFilter.java | 0.221351 | package fi.tfs.liiga.filters;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
public class ServerHeaderFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
// emme tarvitse
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletResponse resp = (HttpServletResponse) response;
// Ettei IE mene johonkin sovelluksen rikkovaan compatibility-moodiin.
resp.setHeader("X-UA-Compatible", "IE=edge");
chain.doFilter(request, response);
}
@Override
public void destroy() {
// emme tarvitse
}
}
|
5587538a-307e-4a67-a80c-59002ad72cc0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-27 03:44:36", "repo_name": "weiyang-jiang/java_advance", "sub_path": "/Login_web/demo/src/main/java/com/example/demo/Login.java", "file_name": "Login.java", "file_ext": "java", "file_size_in_byte": 990, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "0b062b71d2b454fc91b16de387df6079665a5345", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/weiyang-jiang/java_advance | 196 | FILENAME: Login.java | 0.226784 | package com.example.demo;
/*
* @Author: Weiyang Jiang
* @Date: 2021-09-07 12:40:47
*/
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;
@WebServlet(urlPatterns = {"/login"})
public class Login extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String username = req.getParameter("username");
String pwd = req.getParameter("password");
if ("weiyang".equals(username) && "123456".equals(pwd)){
resp.getWriter().write("login success");
}else {
resp.getWriter().write("login failed");
}
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
}
}
|
2f965566-6316-4d79-969d-2854f284d08a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-04-07T10:21:18", "repo_name": "phfa26/ES6_JavaScript_Training", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 976, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "487929826995d03195d65927cb4c5521aff7d64c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/phfa26/ES6_JavaScript_Training | 253 | FILENAME: README.md | 0.225417 | # Accelerated ES6 JavaScript Training
> Diving in ES6 features and build a page with a few of the course topics.
# Code
- The created page is a code along project. Therefore, not planned by me.
- You can build the same page doing the course and coding along with it. Just hit the link below, buy the course and have fun!
- https://www.udemy.com/course/es6-bootcamp-next-generation-javascript/
> Course by: Academind
> https://academind.com/
# Features/topics covered in this course
- **ES6 Compatibility with Browsers**;
- **Declaring variables with let and const and their differences with var**;
- **Fat arrow functions () => {}**;
- **Object Literal Extensions**;
- **Rest .. and Spread ... operators**;
- **For-of loop**;
- **Template Literals \${}**;
- **Destructuring Arrays and Objects**;
- **Modules**;
- **Classes**;
- **Symbols**;
- **Iterators and Generators**;
- **Promises**;
- **Built-in Objects**;
- **Maps and Sets**;
- **Reflect API**;
- **Proxy API**.
|
8654527d-8115-48fc-b840-78020845fd90 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-28 13:38:07", "repo_name": "vagnersabadi/blogSeguranca", "sub_path": "/src/br/ufsm/csi/seguranca/dao/LogDAO.java", "file_name": "LogDAO.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "2dc05e5ab41d696f347b3b029f5a2a8de86519a8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vagnersabadi/blogSeguranca | 197 | FILENAME: LogDAO.java | 0.212069 | package br.ufsm.csi.seguranca.dao;
import br.ufsm.csi.seguranca.model.Comentario;
import br.ufsm.csi.seguranca.model.Log;
import br.ufsm.csi.seguranca.model.Post;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.sql.SQLException;
import java.util.Collection;
@Repository
public class LogDAO {
//Hibernate bloqueia injeções usando PreparedStatement do Criteria
@Autowired
private SessionFactory sessionFactory;
public Object carregaObjeto(Class classe, Serializable id) {
return sessionFactory.getCurrentSession().get(classe, id);
}
public void criaObjeto(Object o) {
sessionFactory.getCurrentSession().save(o);
}
public void removeObjeto(Object o) {
sessionFactory.getCurrentSession().remove(o);
}
}
|
4652ab27-d418-4434-affa-840c3791b035 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-27 16:03:37", "repo_name": "RaphiOriginal/kvanC-Chatapp", "sub_path": "/src/ch/fhnw/kvan/chat/socket/ConnectionListener.java", "file_name": "ConnectionListener.java", "file_ext": "java", "file_size_in_byte": 980, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "6680830ba8d68ff04a19e3d63ccc777e4b7ae77c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/RaphiOriginal/kvanC-Chatapp | 215 | FILENAME: ConnectionListener.java | 0.267408 | package ch.fhnw.kvan.chat.socket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import org.apache.log4j.Logger;
import ch.fhnw.kvan.chat.utils.Out;
public class ConnectionListener extends Thread{
private ArrayList<ConnectionHandler> connections = new ArrayList<>();
private Queue<String> buffer = new LinkedList<String>();
private Logger logger = Logger.getLogger(ConnectionListener.class);
public void run(){
while(true){
if(buffer.size() != 0){
String msg = buffer.poll();
logger.info("Send to All: " + msg);
for(ConnectionHandler ch: connections){
Out out = ch.getOutputStream();
out.println(msg);
}
}
try {
Thread.sleep(20);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public synchronized void addHandler(ConnectionHandler connection){
connections.add(connection);
}
public void addMessageToAll(String msg){
buffer.add(msg);
}
}
|
dbebc12d-083f-4c63-8e99-565debb4677d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-05 06:09:45", "repo_name": "UilamDracarys/sportsmedaltally", "sub_path": "/app/src/main/java/com/cpsu/sports/data/model/College.java", "file_name": "College.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "4de17377a8d7001862063e4f16cc102413980a5f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/UilamDracarys/sportsmedaltally | 215 | FILENAME: College.java | 0.210766 | package com.cpsu.sports.data.model;
import java.lang.reflect.Array;
import java.util.ArrayList;
public class College {
public static final String TABLE_COLLEGES = "colleges";
public static final String COL_COLLEGE_ID = "college_id";
public static final String COL_COLLEGE_CODE = "college_code";
public static final String COL_COLLEGE_NAME = "college_name";
private String collegeID;
private String collegeCode;
private String collegeName;
public String getCollegeCode() {
return collegeCode;
}
public void setCollegeCode(String collegeCode) {
this.collegeCode = collegeCode;
}
public String getCollegeID() {
return collegeID;
}
public void setCollegeID(String collegeID) {
this.collegeID = collegeID;
}
public String getCollegeName() {
return collegeName;
}
public void setCollegeName(String collegeName) {
this.collegeName = collegeName;
}
}
|
95a1a0d0-14d0-43b0-8071-b4b4fc7056e0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-14 16:06:34", "repo_name": "wcjwctwy/netty-study", "sub_path": "/src/main/java/wang/congjun/demo01/TestHttpServer.java", "file_name": "TestHttpServer.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 25, "lang": "en", "doc_type": "code", "blob_id": "247693a77b78d7197eec00b0656ca7175bf0e9fe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wcjwctwy/netty-study | 215 | FILENAME: TestHttpServer.java | 0.236516 | package wang.congjun.demo01;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.*;
import io.netty.util.CharsetUtil;
/**
* @author WangCongJun
* Created by WangCongJun on 2018/12/13.
*/
public class TestHttpServer extends SimpleChannelInboundHandler<HttpObject> {
@Override
protected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
System.out.println(msg);
ByteBuf buffer = Unpooled.copiedBuffer("Hello world", CharsetUtil.UTF_8);
DefaultFullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1,HttpResponseStatus.OK,buffer);
response.headers().set(HttpHeaderNames.CONTENT_TYPE,HttpHeaderValues.TEXT_PLAIN)
.set(HttpHeaderNames.CONTENT_LENGTH,buffer.readableBytes());
ctx.writeAndFlush(response);
}
}
|
aadf9dcd-17d1-4771-a6bd-00051fd01dd8 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-10 05:23:03", "repo_name": "thaslimcodes/user-service", "sub_path": "/src/main/java/com/ysg/security/CrossOriginFilter.java", "file_name": "CrossOriginFilter.java", "file_ext": "java", "file_size_in_byte": 990, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "4e5effcb39cf1ab9ab2a3329456a40895fb02c91", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/thaslimcodes/user-service | 201 | FILENAME: CrossOriginFilter.java | 0.201813 | package com.ysg.security;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Created by jayaprakash
*/
@Component
public class CrossOriginFilter implements Filter {
private final Logger log = LoggerFactory.getLogger(CrossOriginFilter.class);
@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
response.addHeader("Access-Control-Allow-Origin", "*");
response.addHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS, PUT");
response.addHeader("Access-Control-Allow-Headers", "Content-Type,Accept,Authorization");
chain.doFilter(req, res);
}
@Override
public void init(FilterConfig filterConfig) {
}
@Override
public void destroy() {
}
}
|
36824605-28c6-4407-ab99-0d9849f51dea | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-29 17:42:04", "repo_name": "DavidGrath/MovieBrowser", "sub_path": "/app/src/main/java/com/example/moviebrowser/framework/RetrofitHelper.java", "file_name": "RetrofitHelper.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "0efb7ce807fccaf1b246d838fde5cc931ccaafa2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/DavidGrath/MovieBrowser | 155 | FILENAME: RetrofitHelper.java | 0.245085 | package com.example.moviebrowser.framework;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import static com.example.moviebrowser.Constants.BASE_URL;
public class RetrofitHelper {
private static Retrofit retrofit = null;
public static Retrofit retrofitInstance() {
if (retrofit == null) {
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(interceptor)
.build();
retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.client(client)
.build();
}
return retrofit;
}
}
|
ac1a6be6-5ae8-489b-ae93-14d6d1c23626 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-06 09:55:44", "repo_name": "punitjain1989/Logical-Clocks", "sub_path": "/LogicalClock/src/com/cpsc471/logicalclock/process/Process.java", "file_name": "Process.java", "file_ext": "java", "file_size_in_byte": 986, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "3b1cc57c29870abee30b5a33ad213f85ff90ab90", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/punitjain1989/Logical-Clocks | 218 | FILENAME: Process.java | 0.264358 | package com.cpsc471.logicalclock.process;
/**
* This class is a <i>representation</i> of Process/Node in distributed system.
*
* @author Puneet
*
*/
public class Process {
private String processName;
private String processId;
private static int activeProcess;
public Process(String processName, String processId) {
activeProcess++;
if (activeProcess > 5)
throw new IllegalArgumentException("You can not have more than 5 process");
this.processName = processName;
this.processId = processId;
}
public static int getActiveProcess() {
return activeProcess;
}
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public String getProcessId() {
return processId;
}
public void setProcessId(String processId) {
this.processId = processId;
}
@Override
public String toString() {
return processName;
}
}
|
801a1760-e1b4-4fc1-a98a-2fbf420b6dc9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-02-10 09:36:29", "repo_name": "KnightAndroid/wanandroid", "sub_path": "/library_util/src/main/java/com/knight/wanandroid/library_util/toast/SystemToast.java", "file_name": "SystemToast.java", "file_ext": "java", "file_size_in_byte": 985, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "5184aae80748b4c10c0ed254acca201d553400cc", "star_events_count": 31, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/KnightAndroid/wanandroid | 216 | FILENAME: SystemToast.java | 0.236516 | package com.knight.wanandroid.library_util.toast;
import android.app.Application;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.knight.wanandroid.library_util.toast.callback.ToastInterface;
/**
* @author created by knight
* @organize wanandroid
* @Date 2021/9/8 16:07
* @descript:
*/
public class SystemToast extends Toast implements ToastInterface {
/** 吐司消息 View */
private TextView mMessageView;
public SystemToast(Application application) {
super(application);
}
@Override
public void setView(View view) {
super.setView(view);
if (view == null) {
mMessageView = null;
return;
}
mMessageView = findMessageView(view);
}
@Override
public void setText(CharSequence text) {
super.setText(text);
if (mMessageView == null) {
return;
}
mMessageView.setText(text);
}
}
|
bec1d430-bada-4fca-a14e-dcb7e6ffa67f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-01-31 23:36:55", "repo_name": "hfaulds/Satellites-Client", "sub_path": "/src/main/java/net/msgs/LoginRequestMsg.java", "file_name": "LoginRequestMsg.java", "file_ext": "java", "file_size_in_byte": 991, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "4cfccaf5b072b823cfa16524d2f62afb425bafb3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hfaulds/Satellites-Client | 223 | FILENAME: LoginRequestMsg.java | 0.262842 | package net.msgs;
public class LoginRequestMsg {
private final String username;
private final String password;
public LoginRequestMsg() {
this("", "");
}
public LoginRequestMsg(String username, String password) {
this.username = username;
this.password = password;
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof LoginRequestMsg))
return false;
LoginRequestMsg other = (LoginRequestMsg) obj;
if (password == null) {
if (other.password != null)
return false;
} else if (!password.equals(other.password))
return false;
if (username == null) {
if (other.username != null)
return false;
} else if (!username.equals(other.username))
return false;
return true;
}
}
|
c454fd02-9196-4d40-ab4a-720cda782798 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-10-29 07:40:15", "repo_name": "liangjian103/BuildProjectRun", "sub_path": "/BuildProjectRun/src/com/lj/test/Hello.java", "file_name": "Hello.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "bc608f32dc332a35b1bd9442bbd10abc41a6574e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liangjian103/BuildProjectRun | 208 | FILENAME: Hello.java | 0.26971 | package com.lj.test;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;
public class Hello {
private static final Logger LOG = LoggerFactory.getLogger(Hello.class);
public static void main(String[] args) {
Hello hello = new Hello();
hello.springTest();
}
public void springTest() {
ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
JdbcTemplate jdbcTemplate = (JdbcTemplate) context.getBean("oracleJdbcTemplate");
@SuppressWarnings("unchecked")
List<Map<String, Object>> list = jdbcTemplate.queryForList("select * from tb_vehicle");
System.out.println(list);
LOG.info("rs:{}",list);
try {
Thread.sleep(60000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
|
e41e36c6-e18e-4be5-8b24-702f9bde8d8f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-24 08:34:48", "repo_name": "xybxjb/dysms-demo", "sub_path": "/DEMO_Day_1/src/ddd/test6.java", "file_name": "test6.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "0c6ab7f584ce7fb602dc863b367d05380fc3974d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/xybxjb/dysms-demo | 256 | FILENAME: test6.java | 0.281406 | package ddd;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Month;
import java.time.temporal.ChronoUnit;
import java.util.Calendar;
import java.util.Date;
/**
* @author 加鑫宇
* @DATE 2021/4/17 13:13
*/
public class test6 {
public static void main(String[] args) {
LocalDate localDate = LocalDate.now();
LocalDate localDate1 = LocalDate.of(2019, 4, 16);
Calendar c = Calendar.getInstance();
LocalDateTime localDateTime = LocalDateTime.of(2019, Month.SEPTEMBER, 10, 14, 46, 56);
//增加一年
localDateTime = localDateTime.plusYears(1);
localDateTime = localDateTime.plus(1, ChronoUnit.YEARS);
int year = c.get(Calendar.YEAR);
Date date2 = new Date();
SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd");
df.format(date2).replace("mm", "9");
df.format(date2).replace("dd", "14");
System.out.println(df);
}
}
|
bf0fce3e-3c4e-447b-8275-52430f7fdfd4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-15 17:17:10", "repo_name": "D641593/NaviMap", "sub_path": "/app/src/main/java/com/example/navimap/ui/bottom_bar/SwitchPage.java", "file_name": "SwitchPage.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "8434cbdb81f7bcb51b6f71f15a255c139eb8dc6e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/D641593/NaviMap | 177 | FILENAME: SwitchPage.java | 0.201813 | package com.example.navimap.ui.bottom_bar;
import android.os.Bundle;
import android.view.MenuItem;
import com.example.navimap.R;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
public class SwitchPage extends AppCompatActivity {
private BottomNavigationView btmView;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.switch_page);
}
@Override
public boolean onOptionsItemSelected(MenuItem item){
int ID = item.getItemId();
if( ID == R.id.NotePageItem){
}else if( ID == R.id.GoogleMapItem ){
}else if( ID == R.id.JournalPageItem){
}
return super.onOptionsItemSelected(item);
}
public void viewInit(){
}
public void DBinit(){
}
}
|
c9e6aceb-fc71-4ed2-a113-5b59008711a5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-11-02 16:36:49", "repo_name": "wmilczarek/NSC", "sub_path": "/src/main/java/Converter/ModelController/Controller/DB/DocumentDB/Mongo/MongoConnector.java", "file_name": "MongoConnector.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "66a65e7fa9e762494e1c0d1b8002a282943a0259", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wmilczarek/NSC | 176 | FILENAME: MongoConnector.java | 0.286169 | package Converter.ModelController.Controller.DB.DocumentDB.Mongo;
import Converter.ViewModel.DocumentTypesDB;
import com.mongodb.DB;
import com.mongodb.MongoClient;
import java.net.UnknownHostException;
public class MongoConnector {
private static final MongoConnector ourInstance = new MongoConnector();
private static MongoClient mongoClient;
private MongoConnector() {}
public static MongoConnector getInstance() {
return ourInstance;
}
public MongoClient getMongoClient(DocumentTypesDB noSql){
if(mongoClient == null){
try {
mongoClient = new MongoClient(noSql.getHost(),noSql.getDefPort());
} catch (UnknownHostException e) {
e.printStackTrace();
}
}
return mongoClient;
}
public DB getDB(String DbName) throws UnknownHostException {
mongoClient = new MongoClient();
return mongoClient.getDB(DbName);
}
}
|
281cd0b8-9993-4727-b0e8-57435318fd95 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-04-06 14:02:24", "repo_name": "golden-hu/tos", "sub_path": "/fos/FOS/src/main/java/com/hitisoft/fos/sys/entity/PGroupUser.java", "file_name": "PGroupUser.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "d13f80eec89ea01654c4e1e780462a5dd3bfd188", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/golden-hu/tos | 229 | FILENAME: PGroupUser.java | 0.250913 | package com.hitisoft.fos.sys.entity;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import com.hitisoft.fw.orm.jpa.BaseDomain;
@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true)
@Table(name = "P_GROUP_USER")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class PGroupUser extends BaseDomain implements Serializable {
private static final long serialVersionUID = -6767615898606516815L;
private Integer grouId;
private Integer userId;
public PGroupUser() {
}
@Column(name = "GROU_ID")
public Integer getGrouId() {
return this.grouId;
}
public void setGrouId(Integer grouId) {
this.grouId = grouId;
}
@Column(name = "USER_ID")
public Integer getUserId() {
return this.userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
}
|
624913c3-4d4a-4f5e-97ee-676282ec9b83 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-03-11T09:44:54", "repo_name": "lawrencewoodman/vintage_basic_benchmark", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 978, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "808e540ebca261cf7ab80b451efa5de8f79d15ba", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lawrencewoodman/vintage_basic_benchmark | 263 | FILENAME: README.md | 0.289372 | Vintage Basic Benchmark
=======================
A benchmark tool written in Basic for various vintage computers.
Machines Tested
---------------
Amstrad: CPC 6128, PCW 9256
Atari: ST
Commodore: Pet 8032, Vic-20, C64, C128, Plus/4
Sinclair: Spectrum 48k, QL
Contributing
------------
I would love contributions to improve this project. To do so easily I ask the following:
* Please put your changes in a separate branch to ease integration.
* Make a pull request to the [repo](https://github.com/lawrencewoodman/vintage_basic_benchmark) on github.
If you find a bug, please report it at the project's [issues tracker](https://github.com/lawrencewoodman/vintage_basic_benchmark/issues) also on github.
Licence
-------
Copyright (C) 2019 Lawrence Woodman <lwoodman@vlifesystems.com>
This software is licensed under an MIT Licence. Please see the file, [LICENCE.md](https://github.com/lawrencewoodman/vintage_basic_benchmark/blob/master/LICENCE.md), for details.
|
419dd661-45fe-49a7-8d21-8b31766834fc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-01 20:18:51", "repo_name": "mateusleiteaalmeida/codenation-java-central-de-erros-back-end", "sub_path": "/src/main/java/com/project/centralDeErros/converter/LogConverter.java", "file_name": "LogConverter.java", "file_ext": "java", "file_size_in_byte": 991, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "61fb0b1f0f5a4ddbe96a6dc4d2e2bc40e03e6752", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mateusleiteaalmeida/codenation-java-central-de-erros-back-end | 210 | FILENAME: LogConverter.java | 0.262842 | package com.project.centralDeErros.converter;
import com.project.centralDeErros.dto.LogDto;
import com.project.centralDeErros.entity.Log;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.stream.Collectors;
@Component
public class LogConverter {
public LogDto entityToDto(Log log) {
LogDto dto = new LogDto();
dto.setId(log.getId());
dto.setLevel(log.getLevel());
dto.setDescription(log.getDescription());
dto.setOrigin(log.getOrigin());
dto.setDate(log.getDate());
return dto;
}
public Page<LogDto> entityToDto(Page<Log> logPage) {
List<Log> logList = logPage.getContent();
List<LogDto> logDtoList = logList.stream().map(this::entityToDto).collect(Collectors.toList());
Page<LogDto> logDtoPage = new PageImpl<>(logDtoList);
return logDtoPage;
}
}
|
8d5a3e8d-315c-402e-85aa-a5c83f5cf64c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-14 20:09:21", "repo_name": "yeyaodada/MagicPlugin", "sub_path": "/Magic/src/main/java/com/elmakers/mine/bukkit/action/builtin/TameAction.java", "file_name": "TameAction.java", "file_ext": "java", "file_size_in_byte": 990, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "297e5d1b1a3ad4442ec86a2ff7c706791175aabb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/yeyaodada/MagicPlugin | 209 | FILENAME: TameAction.java | 0.23793 | package com.elmakers.mine.bukkit.action.builtin;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import com.elmakers.mine.bukkit.action.BaseSpellAction;
import com.elmakers.mine.bukkit.api.action.CastContext;
import com.elmakers.mine.bukkit.api.spell.SpellResult;
import com.elmakers.mine.bukkit.utility.CompatibilityLib;
public class TameAction extends BaseSpellAction
{
@Override
public SpellResult perform(CastContext context)
{
Player player = context.getMage().getPlayer();
if (player == null) {
return SpellResult.PLAYER_REQUIRED;
}
Entity entity = context.getTargetEntity();
boolean tamed = CompatibilityLib.getCompatibilityUtils().tame(entity, player);
return tamed ? SpellResult.CAST : SpellResult.NO_TARGET;
}
@Override
public boolean isUndoable()
{
return false;
}
@Override
public boolean requiresTargetEntity()
{
return true;
}
}
|
f7aad809-ec47-4d31-8d64-d86806c54d18 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-15 19:09:17", "repo_name": "bartgerard/omega", "sub_path": "/value/service/src/main/java/be/gerard/value/service/ValueRecord.java", "file_name": "ValueRecord.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "4183a5a4f2c9cba328c94929580c40f396045987", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bartgerard/omega | 219 | FILENAME: ValueRecord.java | 0.256832 | package be.gerard.value.service;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;
import java.util.Objects;
/**
* ValueObject
*
* @author bartgerard
* @version v0.0.1
*/
@Embeddable
public class ValueRecord<T extends Serializable> implements Serializable {
@Column(name = "value")
private final T value;
public ValueRecord(T value) {
this.value = value;
}
public T get() {
return value;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ValueRecord<?> that = (ValueRecord<?>) o;
return Objects.equals(value, that.value);
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public String toString() {
return String.valueOf(value);
}
}
|
1989077a-0f37-42e9-8003-21b9d9c89776 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-04 12:04:57", "repo_name": "NeoHui/ssm_project", "sub_path": "/export_manager_web/src/main/java/com/itheima/exception/SaaSException.java", "file_name": "SaaSException.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "393593944b639f472a94f4f69fa897e60b0ffda4", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NeoHui/ssm_project | 173 | FILENAME: SaaSException.java | 0.221351 | package com.itheima.exception;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class SaaSException implements HandlerExceptionResolver{
@Override
public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
//如果是UnauthorizedException异常,跳转到unauthorized.jsp
ModelAndView modelAndView = new ModelAndView();
//判断,如果是 UnauthorizedException 转发到 页面
if (ex instanceof UnauthorizedException){
//请求转发,不通过视图解析器
modelAndView.setViewName("forward:/unauthorized.jsp");
}else {
modelAndView.setViewName("error");
}
modelAndView.addObject("errorMsg",ex.getMessage());
return modelAndView;
}
}
|
9b0f4309-62c5-4457-99ea-023ed86c9219 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-18 09:02:50", "repo_name": "fidsusj/JavaProgramming", "sub_path": "/src/de/dhbwka/java/exercise/ui/TextfileViewer.java", "file_name": "TextfileViewer.java", "file_ext": "java", "file_size_in_byte": 985, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "f218090aba92a4d568972ea97d5e4ff4d132e0d1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/fidsusj/JavaProgramming | 242 | FILENAME: TextfileViewer.java | 0.278257 | package de.dhbwka.java.exercise.ui;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;
public class TextfileViewer {
public TextfileViewer() {
JFileChooser filechooser = new JFileChooser();
filechooser.setCurrentDirectory(new File("../../eclipse-workspace/"));
filechooser.setFileFilter(new FileFilter() {
@Override
public boolean accept(File f) {
return f.isDirectory() || f.getName().toLowerCase().endsWith(".txt");
}
@Override
public String getDescription() {
return "Text Files";
}
});
int state = filechooser.showOpenDialog(null);
if (state == JFileChooser.APPROVE_OPTION) {
new TextFrame(filechooser.getSelectedFile().getAbsolutePath(), 640, 480);
new TextFrameJLabel(filechooser.getSelectedFile().getAbsolutePath(), 640, 480);
} else {
System.out.println("Es wurde keine Datei ausgewählt");
}
}
public static void main(String[] args) {
new TextfileViewer();
}
}
|
328a7671-5407-4191-a0fc-361427cdbc3e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-08-01T17:22:39", "repo_name": "shirbr510/microsoft-graph-notification-server-example", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 976, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "0c4e78a7f919a962736203167aeb6b6d07eec751", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/shirbr510/microsoft-graph-notification-server-example | 244 | FILENAME: README.md | 0.225417 | # microsoft-graph-notification-server-example
a minimal example of a notification service to receive notifications from Microsoft Graph subscriptions
## Running the server
in order to run the server, you have 2 choices:
1. locally:
* `npm install`
* `npm start`
2. docker:
* `docker-compose up`
## Receiving Notifications
in order to do that, you need to subscribe the service to microsoft graph.
this can be done in one of 2 ways:
1. use [Microsoft Graph Exlporer](https://developer.microsoft.com/en-us/graph/graph-explorer)
2. perform a proper POST request to Microsoft Graph [Subscription Endpoint](https://graph.microsoft.com/v1.0/subscriptions).
you can use the following sample as your body:
```js
{
"changeType": "created, updated, deleted",
"notificationUrl": "<your server's https url>",
"resource": "me/messages",
"expirationDateTime": "2019-08-03T18:23:45.9356913Z"
}
```
pay attention the `notificationUrl` MUST be an https endpoint
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.