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
b7b492fa-9b0f-4b46-8f89-11cd5fb8167f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-26 08:28:28", "repo_name": "gitzzp/ECode", "sub_path": "/baselib/src/main/java/com/gitzzp/ecode/baselib/utils/DialogUtil.java", "file_name": "DialogUtil.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "a970d74f94d60f17a48185e8474ce1f1ef6f8564", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/gitzzp/ECode
218
FILENAME: DialogUtil.java
0.239349
package com.gitzzp.ecode.baselib.utils; import android.app.ProgressDialog; import android.content.Context; import com.gitzzp.ecode.baselib.R; import com.gitzzp.ecode.baselib.view.LoadingDialog; /** * 创建人:gitzzp * 创建日期:17/3/29 12:13 * 类描述: */ public class DialogUtil { private static ProgressDialog loadingDialog; public static void showLoadingDialog(Context context){ cancelLoadingDialog(); try { loadingDialog = new LoadingDialog(context, R.style.CustomProgressDialog); loadingDialog.show(); } catch (Exception e) { e.printStackTrace(); } } public static void cancelLoadingDialog(){ if(LoadingDialogIsShowing()){ try{ loadingDialog.cancel(); loadingDialog = null; }catch (Exception e){ e.printStackTrace(); } } } public static boolean LoadingDialogIsShowing(){ return loadingDialog!=null&&loadingDialog.isShowing(); } }
d31f2d53-334d-48d1-ac88-545f6f40f1da
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-07-05 15:31:36", "repo_name": "stal111/Forbidden-Arcanus", "sub_path": "/src/main/java/com/stal111/forbidden_arcanus/client/renderer/entity/BoomArrowRenderer.java", "file_name": "BoomArrowRenderer.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "a1d4c345b91234a46871f164a8208a9492b65cc3", "star_events_count": 90, "fork_events_count": 56, "src_encoding": "UTF-8"}
https://github.com/stal111/Forbidden-Arcanus
241
FILENAME: BoomArrowRenderer.java
0.261331
package com.stal111.forbidden_arcanus.client.renderer.entity; import com.stal111.forbidden_arcanus.ForbiddenArcanus; import com.stal111.forbidden_arcanus.common.entity.projectile.BoomArrow; import net.minecraft.client.renderer.entity.ArrowRenderer; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.resources.ResourceLocation; import javax.annotation.Nonnull; /** * Boom Arrow Renderer <br> * Forbidden Arcanus - com.stal111.forbidden_arcanus.client.renderer.entity.BoomArrowRenderer * * @author stal111 * @version 2.0.0 * @since 2021-12-16 */ public class BoomArrowRenderer extends ArrowRenderer<BoomArrow> { private static final ResourceLocation LOCATION = new ResourceLocation(ForbiddenArcanus.MOD_ID, "textures/entity/projectiles/boom_arrow.png"); public BoomArrowRenderer(EntityRendererProvider.Context context) { super(context); } @Nonnull @Override public ResourceLocation getTextureLocation(@Nonnull BoomArrow entity) { return LOCATION; } }
64a25eae-e514-484d-97e9-f3277d11431d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-20 21:18:52", "repo_name": "Kainazar/java-programming", "sub_path": "/src/practice_my_self/LoopPractice.java", "file_name": "LoopPractice.java", "file_ext": "java", "file_size_in_byte": 1004, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "a39b34844dbbe7a71c51a9fb16cf5b7e825cf11a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Kainazar/java-programming
211
FILENAME: LoopPractice.java
0.249447
package practice_my_self; //import java.util.Scanner; public class LoopPractice { public static void main(String[] args) { // String name = "sam smith"; // System.out.println("Enter the name:"); // System.out.println(name); // System.out.println(); // System.out.print(name.toUpperCase().charAt(0)+"."); // System.out.print(name.toUpperCase().charAt(4)); // Scanner scan = new Scanner(System.in); // String name = scan.nextLine(); // //String name = "Vlad Smith"; // if(name.equalsIgnoreCase(name) && name.contains(" ")){ // int index = name.indexOf(" "); // System.out.println(name.toUpperCase().substring(0,1) + "." + // name.toUpperCase().charAt(index +1)); // }else{ // // System.out.println("Invalid entry"); String str = "Cybertek Hello"; str.trim(); int z = str.indexOf(" "); System.out.println(z); } }
fe19469c-35ac-429f-96ce-0b44c091c3d4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-21 22:02:32", "repo_name": "JeremyFSMoreau/AndroidESGI", "sub_path": "/app/src/main/java/com/team/esgi/projet_esgi/models/Series/Links.java", "file_name": "Links.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "cd4a1a57dbc4e77f1ea3667392fc738b6804c4c7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JeremyFSMoreau/AndroidESGI
210
FILENAME: Links.java
0.191933
package com.team.esgi.projet_esgi.models.Series; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Links { @SerializedName("first") @Expose private Integer first; @SerializedName("last") @Expose private Integer last; @SerializedName("next") @Expose private Integer next; @SerializedName("previous") @Expose private Integer previous; public Integer getFirst() { return first; } public void setFirst(Integer first) { this.first = first; } public Integer getLast() { return last; } public void setLast(Integer last) { this.last = last; } public Integer getNext() { return next; } public void setNext(Integer next) { this.next = next; } public Integer getPrevious() { return previous; } public void setPrevious(Integer previous) { this.previous = previous; } }
18dca546-e814-4936-abb6-471d6b7437c7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-14 07:09:26", "repo_name": "Hyq0823/GpsDemo", "sub_path": "/GpsDemo/src/main/java/com/spzh/controller/PdfController.java", "file_name": "PdfController.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "9f91195e51f1f8b3ddfefa4dd3d8815bc4815b8e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Hyq0823/GpsDemo
196
FILENAME: PdfController.java
0.2227
package com.spzh.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletRequest; @Controller @RequestMapping("pdf") public class PdfController { @RequestMapping("/parse") public String upload(HttpServletRequest request, Model model,String pdf_name) throws Exception { String contextPath = request.getServletContext().getContextPath(); /* Pdf2htmlEXUtil.pdf2html("C:\\Users\\hyq\\Downloads\\pdf2htmlEX-0.12-win32-static-with-poppler-data\\pdf2htmlEX.exe", contextPath + pdf_name+".pdf", contextPath ,pdf_name+".html"); model.addAttribute("html",pdf_name+".html"); */ model.addAttribute("html",pdf_name+".html"); return "pdfview"; } @RequestMapping({"","index"}) public String pdfMain(){ return "pdfmain"; } }
edbcdb16-c4ce-41e5-80a2-09447040621c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-16 15:39:15", "repo_name": "ThierryAcc/Jumper_Java", "sub_path": "/src/inheritance2/Dog.java", "file_name": "Dog.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "dcea96bd536437d227127a95a937870794ffd0a8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ThierryAcc/Jumper_Java
302
FILENAME: Dog.java
0.295027
package inheritance2; import inheritance.Animal; public class Dog extends Animal { // DRY = DON'T REPEAT YOURSELF public Dog() { this("Hundy", 22); } public Dog(String name, int age) { super(name, age); } @Override public void giveLoud() { System.out.println("WUFF"); } @Override public void onlyAnimalsCanUseMe() { System.out.println("I AM A DOG!"); } public void DogShout() { System.out.println("I AM A DOG?!"); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + age; result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Dog other = (Dog) obj; if (age != other.age) return false; if (getName() == null) { if (other.getName() != null) return false; } else if (!getName().equals(other.getName())) return false; return true; } }
8791f7c1-6880-4298-9a04-79e6d175d98c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-13 08:38:00", "repo_name": "chlbeyond/smartPos", "sub_path": "/smartpos/smartPOS/src/main/java/com/rainbow/smartpos/gson/DateTimeDeserializer.java", "file_name": "DateTimeDeserializer.java", "file_ext": "java", "file_size_in_byte": 990, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "3ff37f1892752fc6fc09de39676f75e02398a885", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/chlbeyond/smartPos
217
FILENAME: DateTimeDeserializer.java
0.264358
package com.rainbow.smartpos.gson; import java.lang.reflect.Type; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonParseException; public class DateTimeDeserializer implements JsonDeserializer<Date> { @Override public Date deserialize(JsonElement arg0, Type arg1, JsonDeserializationContext arg2) throws JsonParseException { SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { return formater.parse(arg0.getAsString()); } catch (ParseException e) { } formater = new SimpleDateFormat("yyyy-MM-dd"); try { return formater.parse(arg0.getAsString()); } catch (ParseException e) { } formater = new SimpleDateFormat("HH:mm:ss"); try { return formater.parse(arg0.getAsString()); } catch (ParseException e) { } return null; } }
e7e3da45-e398-4050-b371-063390e87c81
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-27 07:14:50", "repo_name": "mirai2333/Java-Mall_SSM-Distribute", "sub_path": "/taotao-rest/src/main/java/com/taotao/rest/controller/ContentController.java", "file_name": "ContentController.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "87d4d3b1b523aae9fdb8b20c4d4c41b8954ed982", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mirai2333/Java-Mall_SSM-Distribute
219
FILENAME: ContentController.java
0.250913
package com.taotao.rest.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.taotao.common.pojo.TaotaoResult; import com.taotao.rest.service.ContentService; @Controller @RequestMapping("/content") public class ContentController { @Autowired private ContentService contentService; @RequestMapping("/list/{cid}") @ResponseBody public TaotaoResult findContentByCatId(@PathVariable Long cid) { return TaotaoResult.ok(contentService.findTbContents(cid)); } //内容缓存同步服务 @RequestMapping("/cachesync/{cid}") @ResponseBody public TaotaoResult contentCacheSync(@PathVariable Long cid) { try { return contentService.contentCacheDelete(cid); } catch (Exception e) { return TaotaoResult.build(500, "根据分类id的内容缓存同步失败!"); } } }
1a623553-408a-40c9-9808-59fa1b8da64c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-21 20:06:02", "repo_name": "rezastallone/clean-news-app", "sub_path": "/domain/src/main/java/com/rsa/cleannewsapp/core/domain/usecase/DeleteBookmarkedNews.java", "file_name": "DeleteBookmarkedNews.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "37d45b2a0a697f35a8f5a2c50f368564a215f403", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rezastallone/clean-news-app
187
FILENAME: DeleteBookmarkedNews.java
0.256832
package com.rsa.cleannewsapp.core.domain.usecase; import com.rsa.cleannewsapp.core.domain.entity.Article; import com.rsa.cleannewsapp.core.domain.repository.NewsArticleRepository; import java.util.concurrent.Callable; import javax.inject.Inject; import javax.inject.Named; import io.reactivex.Observable; import io.reactivex.Scheduler; public class DeleteBookmarkedNews extends CompletableUseCase<Article> { private NewsArticleRepository newsArticleRepository; @Inject public DeleteBookmarkedNews( @Named("executor_thread") Scheduler executorThread, NewsArticleRepository newsArticleRepository ) { super(executorThread); this.newsArticleRepository = newsArticleRepository; } @Override protected Observable createObservableUseCase(Article article) { return Observable.fromCallable((Callable<Object>) () -> { newsArticleRepository.deleteBookmarkedNews(article); return true; }); } }
fd605360-8aae-4006-bfeb-233d31689253
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-19 00:24:21", "repo_name": "dinaurazalina460/jd-spring", "sub_path": "/Spring-05-JavaAnnotations-Autowired/src/main/java/com/cybertek/services/Java.java", "file_name": "Java.java", "file_ext": "java", "file_size_in_byte": 964, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "543d15958670b69f3674e4a0cdc37bad3a55e556", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dinaurazalina460/jd-spring
203
FILENAME: Java.java
0.282196
package com.cybertek.services; import com.cybertek.interfaces.Course; import com.cybertek.interfaces.ExtraSessions; import lombok.AllArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class Java implements Course { @Autowired private ExtraSessions extraSessions; //Constructor Injection //@autowired is not nesessary if the is only ine consturctor //if there are more than 1 constuctor, the annotation is required for 1 constructor @Autowired public Java(ExtraSessions extraSessions) { this.extraSessions = extraSessions; } // //Setter Injection // @Autowired // public void setOfficeHours(OfficeHours officeHours) { // this.officeHours = officeHours; // } @Override public void getTeachingHours() { System.out.println("Weekly teaching hours: "+ (25 + extraSessions.getHours())); } }
24389aa6-7223-4430-b7dc-9a376b5acbca
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-11 16:56:27", "repo_name": "Mohamad-Altahan/antlrTest", "sub_path": "/src/Java/AST/JavaStmt/Call_Json_Var.java", "file_name": "Call_Json_Var.java", "file_ext": "java", "file_size_in_byte": 985, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "fd9fd3f4722bfabf48fcdc056fc69c5fe8dd2986", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Mohamad-Altahan/antlrTest
226
FILENAME: Call_Json_Var.java
0.282196
package Java.AST.JavaStmt; import Java.AST.Node; import Java.AST.Visitor.ASTVisitor; import java.util.ArrayList; import java.util.List; public class Call_Json_Var extends Node { public List<String> key = new ArrayList<String>(); private String jsonName ; public String getJsonName() { return jsonName; } public void setJsonName(String jsonName) { this.jsonName = jsonName; } @Override public void accept(ASTVisitor astVisitor) { astVisitor.visit(this); String FullName=""; if(this.jsonName!=null){ System.out.println(" JsonName : "+this.jsonName); FullName = this.jsonName; } if(this.key.size()>0){ for(int i = 0 ;i<this.key.size();i++){ System.out.println(" Key("+ (i+1) +") : "+this.key.get(i)); FullName += "."+this.key.get(i); } } System.out.println(" FullName : " + FullName); } }
955c2342-0f43-4ac3-a5af-77fa20261e53
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-09-18 20:46:56", "repo_name": "sri420/spring-mvc-sample", "sub_path": "/DBProject/src/com/sri/QueryParam.java", "file_name": "QueryParam.java", "file_ext": "java", "file_size_in_byte": 1061, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "711c40d78bf75787f6d4dbe2df3f92a1066c3f76", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sri420/spring-mvc-sample
238
FILENAME: QueryParam.java
0.268941
package com.sri; public class QueryParam { public QueryParam(String paramType,String paramValue) { this.paramType=paramType; this.paramValue=paramValue; } public QueryParam(int paramPosition,String paramName,String paramType,String paramValue) { this.paramPosition=paramPosition; this.paramName=paramName; this.paramType=paramType; this.paramValue=paramValue; } int paramPosition; public int getParamPosition() { return paramPosition; } public void setParamPosition(int paramPosition) { this.paramPosition = paramPosition; } public String getParamName() { return paramName; } public void setParamName(String paramName) { this.paramName = paramName; } public String getParamType() { return paramType; } public void setParamType(String paramType) { this.paramType = paramType; } String paramName; String paramType; public String getParamValue() { return paramValue; } public void setParamValue(String paramValue) { this.paramValue = paramValue; } String paramValue; }
d7753e90-0e14-4782-af01-a7e28ab4b296
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-16 17:31:12", "repo_name": "Calvinjmin/Personal_Projects", "sub_path": "/JSON + GSON Demo/Movie.java", "file_name": "Movie.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "e70ad65c8ebf8ee40ede5b3fb588702ca372ce4e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Calvinjmin/Personal_Projects
272
FILENAME: Movie.java
0.290981
import java.util.Arrays; public class Movie { private String title; private int year; private String [] cast; private String [] genres; public Movie ( String title, int year, String [] cast, String [] genres) { this.title = title; this.year = year; this.cast = cast; this.genres = genres; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public int getYear() { return year; } public void setYear(int year) { this.year = year; } public String[] getCast() { return cast; } public void setCast(String[] cast) { this.cast = cast; } public String[] getGenres() { return genres; } public void setGenres(String[] genres) { this.genres = genres; } public String toString() { return title + " (" + year + ")\nGenres: " + Arrays.toString( genres ).substring( 1 , Arrays.toString( genres ).length() - 1 ) + "\nCast: " +Arrays.toString( cast ).substring( 1 , Arrays.toString( cast ).length() - 1 ) + "\n"; } }
a33f7200-7049-4a7c-9d0d-7f97b35c6d32
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-06-25T15:18:50", "repo_name": "JamesKyburz/create-files", "sub_path": "/readme.markdown", "file_name": "readme.markdown", "file_ext": "markdown", "file_size_in_byte": 1050, "line_count": 50, "lang": "en", "doc_type": "text", "blob_id": "9d05ff14179de3dbf7c1df844f7398f4dc14501b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JamesKyburz/create-files
320
FILENAME: readme.markdown
0.276691
# create-files [![Greenkeeper badge](https://badges.greenkeeper.io/JamesKyburz/create-files.svg)](https://greenkeeper.io/) create-files I find myself adding the same files to most projects eg * LICENSE * .gitignore * package.json for package.json I use [pkginit](http://npm.im/pkginit) but wanted a solution for the others. So I created this simple utility for me. It reads the gist or url given and downloads the files. The first time it runs it will prompt for the url and remember it. # manifest contains the filenames and urls. ```json { "files": [ {".travis.yml" : "https://gist.githubusercontent.com/JamesKyburz/647f93b862eb71745fed/raw"}, {".zuul.yml" : "https://gist.githubusercontent.com/JamesKyburz/a1adfeafb15f7a25c40c/raw/"}, {"LICENSE" : "https://gist.githubusercontent.com/JamesKyburz/f67ebb7e160ccc93d2ac/raw/"}, {".gitignore" : "https://gist.githubusercontent.com/JamesKyburz/b6bde24344ef7fd189ef/raw/"} ] } ``` # install With [npm](https://npmjs.org) do: ``` npm install create-files ``` # license MIT
bd7721dc-aefb-43a0-9c16-6a4a3acde167
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-10 17:24:36", "repo_name": "AjibolaOlayemi/LeaderboardProj", "sub_path": "/app/src/main/java/com/example/leaderboard/SubmitActivity.java", "file_name": "SubmitActivity.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "c6cf88e705d0b4420a53e64ed9c4acebad233b14", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AjibolaOlayemi/LeaderboardProj
160
FILENAME: SubmitActivity.java
0.200558
package com.example.leaderboard; import android.os.Bundle; import android.view.View; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; public class SubmitActivity extends AppCompatActivity { private Toolbar toolbar2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_submit); Toolbar toolbar2 = findViewById(R.id.toolbar2); setSupportActionBar(toolbar2); toolbar2.setNavigationIcon(getResources().getDrawable(R.drawable.ic_arrow_back_black_24dp)); toolbar2.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setContentView(R.layout.activity_main); } }); } @Override public boolean onSupportNavigateUp(){ onBackPressed(); return true; } }
eacacafa-d559-4b26-b5ef-213e44f6865f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-06 01:14:14", "repo_name": "HalcyonDays11/DiscordRPBot", "sub_path": "/src/main/java/com/dreaminsteam/rpbot/web/util/ViewUtil.java", "file_name": "ViewUtil.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "d32cd75f3112e32d15e5fb79faf7e4a039c98c4f", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/HalcyonDays11/DiscordRPBot
186
FILENAME: ViewUtil.java
0.247987
package com.dreaminsteam.rpbot.web.util; import java.util.Map; import org.apache.velocity.app.VelocityEngine; import spark.ModelAndView; import spark.Request; import spark.template.velocity.VelocityTemplateEngine; public class ViewUtil { public static String render(Request request, Map<String, Object> model, String templatePath) { model.put("currentUser", RequestUtil.getSessionCurrentUser(request)); model.put("WebPath", Path.Web.class); // Access application URLs from templates return strictVelocityEngine().render(new ModelAndView(model, templatePath)); } private static VelocityTemplateEngine strictVelocityEngine() { VelocityEngine configuredEngine = new VelocityEngine(); configuredEngine.setProperty("resource.loader", "class"); configuredEngine.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); return new VelocityTemplateEngine(configuredEngine); } }
51d3182b-b4dd-4f5e-8cf3-b31162a64aeb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-09 19:53:28", "repo_name": "luisfon/Android", "sub_path": "/componentesBasicos/CheckRadio/app/src/main/java/com/example/acer/checkradio/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "a7b0d565902a1b6d830b382e764a80b7bbb76ae4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/luisfon/Android
168
FILENAME: MainActivity.java
0.250913
package com.example.acer.checkradio; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.Toast; public class MainActivity extends AppCompatActivity { RadioGroup rg; Button btn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); rg=(RadioGroup)findViewById(R.id.rg); btn=(Button)findViewById(R.id.btn); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String opcion=((RadioButton)findViewById(rg.getCheckedRadioButtonId())).getText().toString(); Toast.makeText(getApplicationContext(),opcion,Toast.LENGTH_SHORT).show(); } }); } }
8ad2dcbf-4883-483e-83aa-28febac53911
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-04 16:34:37", "repo_name": "searchgadchiroli/search-config", "sub_path": "/search-csv/search-registration/src/main/java/org/bahmni/implementation/searchconfig/request/PatientAddress.java", "file_name": "PatientAddress.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "94fc0e5b145efd793ddc98fc97cde8243f9943c0", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/searchgadchiroli/search-config
204
FILENAME: PatientAddress.java
0.204342
package org.bahmni.implementation.searchconfig.request; import lombok.Data; @Data public class PatientAddress { private String uuid; private String address3; private String cityVillage; private String countyDistrict; private String stateProvince; private String country; public PatientAddress(String uuid, String address3, String cityVillage, String countyDistrict, String stateProvince, String country) { this.uuid = uuid; this.address3 = address3; this.cityVillage = cityVillage; this.countyDistrict = countyDistrict; this.stateProvince = stateProvince; this.country = country; } public PatientAddress(String address3, String cityVillage, String countyDistrict, String stateProvince, String country) { this.address3 = address3; this.cityVillage = cityVillage; this.countyDistrict = countyDistrict; this.stateProvince = stateProvince; this.country = country; } }
2ed84d91-1ef3-4c20-a5ce-d4d6dc010ac9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-31T23:30:30", "repo_name": "rstruempf/FragmentTest", "sub_path": "/app/src/main/java/com/ronstruempf/fragmenttest/DetailActivity.java", "file_name": "DetailActivity.java", "file_ext": "java", "file_size_in_byte": 985, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "4f174d302d766fd662340c42b0d4a80800e05202", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rstruempf/FragmentTest
196
FILENAME: DetailActivity.java
0.224055
package com.ronstruempf.fragmenttest; import android.app.Activity; import android.os.Bundle; /** * Activity for displaying detail in single pane view * * Created by Ron on 1/31/2016. */ public class DetailActivity extends Activity { public static final String EXTRA_URL = "url"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // check if dual pane mode is active // if yes, finish this activity if (getResources().getBoolean(R.bool.dual_pane)) { finish(); return; } setContentView(R.layout.content_detail); Bundle extras = getIntent().getExtras(); if (extras != null) { String url = extras.getString(EXTRA_URL); DetailFragment detailFragment = (DetailFragment) getFragmentManager() .findFragmentById(R.id.detailFragment); detailFragment.setText(url); } } }
07afc88f-2333-4b21-ad85-e2155af06710
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-04 13:01:30", "repo_name": "jahtzee/gdi2-uebungen", "sub_path": "/gdi2-uebungen/src/test1/LayoutVBox.java", "file_name": "LayoutVBox.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "9779309aaeac27b381e97b9097e7f15f98a80488", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "ISO-8859-3"}
https://github.com/jahtzee/gdi2-uebungen
218
FILENAME: LayoutVBox.java
0.27513
package test1; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class LayoutVBox extends Application { @Override public void start(Stage stage) { String javaVersion = System.getProperty("java.version"); String javafxVersion = System.getProperty("javafx.version"); Label l1 = new Label("Hello World!"); Label l2 = new Label("This is JavaFX " + javafxVersion); Label l3 = new Label("Running on Java " + javaVersion); l2.setStyle("-fx-text-fill:red"); // überschreiben VBox box = new VBox(10); box.getChildren().addAll(l1, l2, l3); Scene scene = new Scene(box); scene.getStylesheets().add("/fx/css/style.css"); stage.setScene(scene); stage.setTitle("VBox Demo"); stage.show(); } public static void main(String[] args) { launch(); } }
f36969eb-d650-4029-8998-80ea3222374c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-15 23:12:56", "repo_name": "daniel-kranowski/bluegreen-manager", "sub_path": "/src/main/java/bluegreen/manager/tasks/SshVmDeleteConfig.java", "file_name": "SshVmDeleteConfig.java", "file_ext": "java", "file_size_in_byte": 1232, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "d7239132069ae6f79b70a98d2be7a26fef17dbf1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/daniel-kranowski/bluegreen-manager
268
FILENAME: SshVmDeleteConfig.java
0.240775
package bluegreen.manager.tasks; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; /** * Configures the commands sent over ssh for vm deletion. */ @Lazy @Component public class SshVmDeleteConfig { @Value("${bluegreen.sshvmdelete.initial.command}") private String initialCommand; @Value("${bluegreen.sshvmdelete.initial.regexp.success}") private String initialRegexpSuccess; //Warning: don't try to examine exitValue for success/failure, our ssh library Ganymed does not reliably return it. public SshVmDeleteConfig() { } public SshVmDeleteConfig(String initialCommand, String initialRegexpSuccess) { this.initialCommand = initialCommand; this.initialRegexpSuccess = initialRegexpSuccess; } public String getInitialCommand() { return initialCommand; } public void setInitialCommand(String initialCommand) { this.initialCommand = initialCommand; } public String getInitialRegexpSuccess() { return initialRegexpSuccess; } public void setInitialRegexpSuccess(String initialRegexpSuccess) { this.initialRegexpSuccess = initialRegexpSuccess; } }
5e7e90b7-21c7-4626-b031-cda1a1220fe8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-15 16:10:29", "repo_name": "nsipid/chargerks", "sub_path": "/src/main/java/com/michaelgrenon/chargerks/cg/ActorInfo.java", "file_name": "ActorInfo.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "d09d1f4d686cc0e441a17c43213d6aea6d712d30", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nsipid/chargerks
223
FILENAME: ActorInfo.java
0.27513
package com.michaelgrenon.chargerks.cg; import java.util.ArrayList; import java.util.List; import charger.obj.Actor; import charger.obj.Concept; import charger.obj.GEdge; public class ActorInfo { private ArrayList<Concept> inputs = new ArrayList<Concept>(); private ArrayList<Concept> outputs = new ArrayList<Concept>(); private String label; public List<Concept> getInputs() { return inputs; } public List<Concept> getOutputs() { return outputs; } public String getLabel() { return label; } public ActorInfo(Actor actor) { this.label = actor.getTextLabel(); ArrayList<GEdge> edges = actor.getEdges(); //charger orders edges by their text label, this order must be maintained edges.stream().forEachOrdered(ge -> { if ( ge.fromObj == actor ) { outputs.add((Concept) ge.toObj); } if ( ge.toObj == actor ) { inputs.add((Concept) ge.fromObj); } }); } }
8cc4101f-731e-459d-b6bd-fc5eb075778c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-28 18:11:47", "repo_name": "tobiasquinteiro/alura-cursos", "sub_path": "/jsf2/livraria/src/br/com/caelum/livraria/dao/UsuarioDAO.java", "file_name": "UsuarioDAO.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "0ecabacf22fae2c731efdc7992a3d15d7bc01b3f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tobiasquinteiro/alura-cursos
199
FILENAME: UsuarioDAO.java
0.240775
package br.com.caelum.livraria.dao; import java.io.Serializable; import java.util.List; import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.persistence.EntityManager; import javax.persistence.TypedQuery; import br.com.caelum.livraria.modelo.Usuario; public class UsuarioDAO implements Serializable { private static final long serialVersionUID = 1L; @Inject private EntityManager manager; private DAO<Usuario> dao; @PostConstruct public void init() { this.dao = new DAO<>(Usuario.class, manager); } public boolean existe(Usuario usuario) { TypedQuery<Usuario> query = manager .createQuery("select u from Usuario u where u.email = :pEmail and u.senha = :pSenha", Usuario.class) .setParameter("pEmail", usuario.getEmail()) .setParameter("pSenha", usuario.getSenha()); List<Usuario> resultList = query.getResultList(); return !resultList.isEmpty(); } }
eeb46fd7-7bba-40df-b3fb-0dd803cfd6a6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-18 09:32:20", "repo_name": "jakubriegel/Lets_Chess_on_Android", "sub_path": "/app/src/main/java/eu/jrie/lets_chess/SurrenderFragment.java", "file_name": "SurrenderFragment.java", "file_ext": "java", "file_size_in_byte": 1013, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "be1bf643ff14785aa3c11e8ebddc236e28d0b5b3", "star_events_count": 6, "fork_events_count": 6, "src_encoding": "UTF-8"}
https://github.com/jakubriegel/Lets_Chess_on_Android
182
FILENAME: SurrenderFragment.java
0.226784
package eu.jrie.lets_chess; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; public class SurrenderFragment extends Fragment { private PlayerPadFragment pad; public SurrenderFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { pad = (PlayerPadFragment) getParentFragment(); View view = inflater.inflate(R.layout.fragment_surrender, container, false); Button confirmButton = view.findViewById(R.id.surrender_confirm_button); confirmButton.setOnClickListener(v -> pad.surrender(true)); Button declineButton = view.findViewById(R.id.surrender_decline_button); declineButton.setOnClickListener(v -> pad.surrender(false)); return view; } }
f4fbf669-8882-412d-9aeb-12c4337f57e4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-08-18T13:59:34", "repo_name": "tobbbe/docker-templates", "sub_path": "/aspnetcore-webapi/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1059, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "62f2dae502d53a31ce0de4ca6d623d5e8c27685d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tobbbe/docker-templates
277
FILENAME: README.md
0.279828
why not only use docker and prod env?\ because im not able to setup `dotnet watch run` and debugger with docker.\ maybe because rebuilding binaries requires to stop/build/start of the debugger ## Local environment i.e using local runtime/sdk, not using production docker container environment. Easy to debug and can use watch/reload. ### Run from terminal ```sh dotnet watch -p src run # or inside /src dotnet watch run ``` ### Run vscode debugger Choose `.NET Core Launch (web)` or (F5) in vscode debug menu.\ Then use reload-button or shift+cmd+f5 to rebuild+reload ## Production environment i.e will run Dockerfile with aspnet runtime 3.1 **alpine (linux)** ### Run vscode debugger with docker container Choose `Docker .NET Core Launch` in vscode debug menu ### Run in docker container ```sh cd src docker build -t netcorewebapi . --no-cache docker run --rm -p 8080:8080 netcorewebapi ``` - to(local machine):from(container port) - make sure port 80 is exposed in Dockerfile - if trouble: mess with webBuilder.UseUrls("http://+:5000") in Program.cs
26ce4556-c36d-42c4-95e7-adc22f8e3628
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-03 05:31:41", "repo_name": "patriciamarch3/Me_Learning_Android", "sub_path": "/AndroidStudioProjects/ChallengeRoomAPI/app/src/main/java/com/example/challengeroomapi/room/AppDatabase.java", "file_name": "AppDatabase.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "1bb80455909528fa427b09c3c9971f0ad77f89e3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/patriciamarch3/Me_Learning_Android
184
FILENAME: AppDatabase.java
0.26588
package com.example.challengeroomapi.room; import android.content.Context; import androidx.room.Database; import androidx.room.Room; import androidx.room.RoomDatabase; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @Database(entities = {Book.class}, version = 1, exportSchema = false) public abstract class AppDatabase extends RoomDatabase { public abstract BookDAO getBookDAO(); private static volatile AppDatabase instance; private static final int NUMBER_OF_THREADS = 4; public static final ExecutorService databaseExecutor = Executors.newFixedThreadPool(NUMBER_OF_THREADS); public static AppDatabase getInstance(Context context) { if (instance == null) { synchronized (AppDatabase.class) { if (instance == null) { instance = Room.databaseBuilder(context, AppDatabase.class, "app_database").build(); } } } return instance; } }
9eb0399d-800f-4b86-aa94-b192e92cbd46
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-04-16T18:48:14", "repo_name": "recursivecodes/oci-policy-generator", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1035, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "0c14e1669f0176a6a26080289e2a59f143419fdc", "star_events_count": 13, "fork_events_count": 6, "src_encoding": "UTF-8"}
https://github.com/recursivecodes/oci-policy-generator
241
FILENAME: README.md
0.213377
# OCI Policy Generator ## Purpose ## Prerequisites Please ensure that you have the OCI CLI [installed](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/cliconcepts.htm) and configured on the machine where you run this script. To test, open a command prompt and type: ```oci --version``` If this command does not work, this script will be unable to generate a policy. You must also have Groovy and Gradle installed if you plan to edit and/or recompile (or if you just want to invoke the Groovy script directly). ## Building Run `gradle shadowJar` to create a new jar. ## Running Run `java -jar /path/to/jar`, or `groovy /path/to/PolicyGenerator.groovy`. Answer the prompts to generate a new policy, then copy/paste this into your OCI IAM Policy online or follow the prompts to create the new policy directly from this tool. You may download the [latest release](https://github.com/recursivecodes/oci-policy-generator/releases) on GitHub if you'd just like to use the tool without downloading/building the source.
fc01a6fc-f6db-4b05-857d-1621ff6f36a0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-30 10:27:16", "repo_name": "BenedictwOw/P02-SGHols", "sub_path": "/app/src/main/java/com/myapplicationdev/android/p02_sghols/Festive.java", "file_name": "Festive.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "b5d727f0900cb8d6f20e9075627e0ec1d3068693", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/BenedictwOw/P02-SGHols
221
FILENAME: Festive.java
0.217338
package com.myapplicationdev.android.p02_sghols; public class Festive { private String festivename; private String date; private Integer image; public Festive(String festivename, String date, int image) { this.festivename = festivename; this.date = date; this.image = image; } public Integer getImage() { return image; } public void setImage(Integer image) { this.image = image; } public String getFestivename() { return festivename; } public void setFestivename(String festivename) { this.festivename = festivename; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } @Override public String toString() { return "Festive{" + "festivename='" + festivename + '\'' + ", date='" + date + '\'' + '}'; } }
c7e576a9-8a7d-42ae-b378-34f0dde9140e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-03T18:04:21", "repo_name": "SteveImmanuel/furious-birds-unity", "sub_path": "/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1012, "line_count": 18, "lang": "en", "doc_type": "text", "blob_id": "de590ad459fd37b1c2d626efcb0d424df35cddad", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SteveImmanuel/furious-birds-unity
217
FILENAME: readme.md
0.287768
# Furious Birds Remake of Angry Birds using Unity. Consist of 3 levels and 1 final level. ## Improvements From the base tutorial I make lots of improvements which are: - Refactor base code so that each script has single purpose responsibility and optimize performance (remove unused delegate, GetComponent function call, etc) - Implement dynamic camera control that follows bird upon shooting, zoom in and out, and also pan to look around the map - Woods now can be destroyed - Add many particles system to make the gameplay more "alive" like bird fur when the bird dies, smokes when the woods and pigs dissapear, and explosion effect when the brown bird explodes - Add rope on the slingshooter - Bird trail has contant distance between each other independent of the bird shoot initial velocity - Aim trajectory trail has contant length independent of the bird shoot initial velocity ## Showcase ![showcase](showcase.gif) ## Controls Uses mouse only. Pan to move around the map, scroll to zoom in or zoom out.
3bd8637c-a980-424d-8155-cae18569c231
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-09 05:49:33", "repo_name": "PedramVeisi/BuildItBigger", "sub_path": "/backend/src/main/java/si/vei/pedram/builditbigger/backend/JokeEndpoint.java", "file_name": "JokeEndpoint.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "9d16bcc218be44f0aec09019fc0caa6604b42c31", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/PedramVeisi/BuildItBigger
243
FILENAME: JokeEndpoint.java
0.261331
/* For step-by-step instructions on connecting your Android application to this backend module, see "App Engine Java Endpoints Module" template documentation at https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloEndpoints */ package si.vei.pedram.builditbigger.backend; import com.google.api.server.spi.config.Api; import com.google.api.server.spi.config.ApiMethod; import com.google.api.server.spi.config.ApiNamespace; import javax.inject.Named; import si.vei.pedram.Joker; /** An endpoint class we are exposing */ @Api( name = "jokeApi", version = "v1", namespace = @ApiNamespace( ownerDomain = "backend.builditbigger.pedram.vei.si", ownerName = "backend.builditbigger.pedram.vei.si", packagePath="" ) ) public class JokeEndpoint { @ApiMethod(name = "getJoke") public JokeBean getJoke() { JokeBean response = new JokeBean(); response.setData(new Joker().getJoke()); return response; } }
c4bd8d37-a4ef-4d6a-b263-eaf7a5c0c4f8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-30 03:03:53", "repo_name": "chelin192837/FaceToFace", "sub_path": "/FaceToFace/faceToface-mall/mall-API/src/main/java/com/macro/mall/api/service/impl/FacConsultationServiceImpl.java", "file_name": "FacConsultationServiceImpl.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "147f6cc9457a5fca4097182c0392d74f76205ee2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/chelin192837/FaceToFace
203
FILENAME: FacConsultationServiceImpl.java
0.264358
package com.macro.mall.api.service.impl; import com.macro.mall.api.service.FacConsultationService; import com.macro.mall.mapper.FacConsultationMapper; import com.macro.mall.model.FacConsultation; import com.macro.mall.model.FacConsultationExample; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class FacConsultationServiceImpl implements FacConsultationService { @Autowired private FacConsultationMapper facConsultationMapper; @Override public int insert(FacConsultation facConsultation) { return facConsultationMapper.insert(facConsultation); } @Override public List<FacConsultation> getConsultationByDeviceId(String deviceId) { FacConsultationExample example = new FacConsultationExample(); example.createCriteria().andDevice_idEqualTo(deviceId); return facConsultationMapper.selectByExample(example); } }
2f2fb7e2-649f-462b-93ad-17c8cb2a3d8b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-30 09:47:16", "repo_name": "oville92/al-geek-v2", "sub_path": "/gateway/api-gateway/src/main/java/fr/afcepf/algeek/rest/ProductCompatibilityRestController.java", "file_name": "ProductCompatibilityRestController.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "4bf7f58c029349d15d72923d52c09495bd732e0a", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/oville92/al-geek-v2
202
FILENAME: ProductCompatibilityRestController.java
0.26971
package fr.afcepf.algeek.rest; import fr.afcepf.algeek.dto.Produit; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @Slf4j @RestController @CrossOrigin(origins = "*") @RequestMapping(value = "/product") public class ProductCompatibilityRestController { private final ResponseEntityRestCommunicator<Produit[]> communicator = new ResponseEntityRestCommunicator<Produit[]>(Produit[].class, Produit[][].class); @Value("${algeek.manager.product.address}") private String productManagerUrl; // "http://ip:port/al-geek-gateway/product/configure/compatibility" @PostMapping("/configure/compatibility") public ResponseEntity<Produit[]> isCompatible(@RequestBody Produit[] products) { String url = productManagerUrl + "/configure/compatibility"; return communicator.post(url, products); } }
26d5e8b3-2574-4d15-a2ce-e1dd44dc9ff8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-28 16:47:15", "repo_name": "devarthurribeiro/web-final-backend", "sub_path": "/src/main/java/com/arthur/web/user/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "1df90198118af24e26e4b45098cbb713695ae910", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/devarthurribeiro/web-final-backend
203
FILENAME: User.java
0.258326
package com.arthur.web.user; import com.arthur.web.credential.Auth; import com.arthur.web.product.Product; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.Set; @AllArgsConstructor @NoArgsConstructor @Data @EqualsAndHashCode(exclude = "favorites") @Entity(name = "users") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; private String name; private String email; private String phone; private String course; @JsonIgnore private String password; @ManyToMany(cascade = CascadeType.ALL) @JoinTable(name = "favorites", joinColumns = { @JoinColumn(name = "user_id", referencedColumnName = "id") }, inverseJoinColumns = { @JoinColumn(name = "produto_id") }) @JsonIgnore private Set<Product> favorites; @OneToOne private Auth auth; }
6e105eae-e8e7-4f6a-8c0c-bf59eafb5233
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-19 02:28:28", "repo_name": "ekubatov/ejercicio_Eric_Kubatov", "sub_path": "/src/main/java/dispatcher/CallProducer.java", "file_name": "CallProducer.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "c398130d6e0fa23dd5c0587e4a975196ced35627", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ekubatov/ejercicio_Eric_Kubatov
256
FILENAME: CallProducer.java
0.295027
package dispatcher; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadLocalRandom; import model.InboundCall; /** * * * @author Eric Kubatov * */ public class CallProducer implements Runnable { private static final int INBOUNDCALL_MINIMUM_COUNT = 10; private static final int INBOUNDCALL_MAXIMUM_COUNT = 20; private Boolean run; @Override public void run() { while (this.getRun()) { if(Dispatcher.getListInboundCalls().isEmpty()){ int inboudCallCant = ThreadLocalRandom.current().nextInt(INBOUNDCALL_MINIMUM_COUNT, INBOUNDCALL_MAXIMUM_COUNT); List<InboundCall> calls = new ArrayList <>(); for(int i=0; i<inboudCallCant; i++) { calls.add(InboundCall.createCall()); } calls.forEach(call -> { Dispatcher.addCalls(call);}); } } } public synchronized Boolean getRun() { return run; } public synchronized void stop() { this.run = false; } public CallProducer() { this.run = true; } }
e9ef5fe3-7f8b-4464-8e6c-59927e405592
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-03-15T15:29:22", "repo_name": "BobbyBakes/leaflet-meteor-spike", "sub_path": "/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1012, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "d0593c55437714ba4cd52842048cec2403d0c4af", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/BobbyBakes/leaflet-meteor-spike
342
FILENAME: readme.md
0.26588
run: meteor run for atlas db MONGO_URL='mongodb://Bobbys-MacBook-Pro.local:27000' meteor meteor run for local (not meteor) db MONGO_URL='mongodb://192.168.128.210:27017' meteor update car: meteor:PRIMARY> db.locations.update({'id': id}, {'$set': {'x': x, 'y': y}}) *Python script written to update via TCP Packet Env Variable setup for external DB's setting up Atlas DB: export MONGO_URL='mongodb://Bobbys-MacBook-Pro.local:27000' setting up local DB: export MONGO_URL='mongodb://192.168.128.210:27017' Notes* - Mongo Cloud DB (Atlas): Easy agent setups: ~10 seconds latency - Local Mongo DB: Easy setup: ~9 seconds of latency -- WHHYYYYY? - Local Metoeor Mongo DB: NO latency: - Caveat Meteor, in its brilliancy, decided to hard code the binded ip address on a local apps. - https://github.com/meteor/meteor/blob/722082f343f121c39d004c384f0486175eb6f0ed/tools/runners/run-mongo.js#L49 - Due to this, an external application cannot update a local mongo DB (hence the quick tcp solution)
197e7a8e-b807-4105-8617-adb7e241d3c4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-03 21:09:11", "repo_name": "cbochs/AndroidExamples", "sub_path": "/21_DialogActivityCommunicationExample/app/src/main/java/com/calvin/a21_dialogactivitycommunicationexample/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "b3068afd00036d945bdf08b6c1dc55ae44f99a44", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cbochs/AndroidExamples
178
FILENAME: MainActivity.java
0.250913
package com.calvin.a21_dialogactivitycommunicationexample; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.TextView; import java.util.List; public class MainActivity extends AppCompatActivity implements MyDialogFragment.ToppingSelectionListener { private TextView tvDisplay; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tvDisplay = findViewById(R.id.tv_display); } public void openDialog(View view) { new MyDialogFragment().show(getSupportFragmentManager(), "comms"); } @Override public void onToppingSelected(List<String> toppings) { String final_selection = ""; for (String topping : toppings) { final_selection = final_selection + "\n" + topping; } tvDisplay.setText(final_selection); } }
96ca31b0-ec94-4b98-8c0d-360249fe7553
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-11 02:55:06", "repo_name": "chenchang-lime/easyBuy_SSM", "sub_path": "/src/main/java/com/easybuy/entity/News.java", "file_name": "News.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 73, "lang": "en", "doc_type": "code", "blob_id": "21ce345eee0b4dea881f039492817d450cc8f2fb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/chenchang-lime/easyBuy_SSM
262
FILENAME: News.java
0.245085
package com.easybuy.entity; import java.util.Date; /** * 表名:easybuy_news * 新闻表 * @author 陈昌 */ public class News { /** * 新闻ID */ private Integer id; /** * 新闻标题 */ private String title; /** * 新闻内容 */ private String content; /** * 创建时间,默认为系统当前时间 */ private Date createTime; public News() { super(); } public News(Integer id, String title, String content, Date createTime) { super(); this.id = id; this.title = title; this.content = content; this.createTime = createTime; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } }
ee3c7640-78f7-4350-92fe-1e20348800a9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-01 12:37:00", "repo_name": "HeenaNautiyal/Joshua2", "sub_path": "/D2DApplicationHeena/BackUpD2d/TestingFirebaseCloud/app/src/main/java/com/heena/D2dmedicine/Admincla.java", "file_name": "Admincla.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "cf7d761f4e8c9720f86e9b35fc523bc6f345facc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/HeenaNautiyal/Joshua2
175
FILENAME: Admincla.java
0.189521
package com.heena.D2dmedicine; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import com.example.heena.testingfirebasecloud.R; public class Admincla extends AppCompatActivity { ImageView btnback; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_admincla); getSupportActionBar().setDisplayOptions(android.support.v7.app.ActionBar.DISPLAY_SHOW_CUSTOM); getSupportActionBar().setDisplayShowCustomEnabled(true); getSupportActionBar().hide(); btnback = (ImageView) findViewById(R.id.imgback); btnback.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent it= new Intent(Admincla.this,UploadMedicine.class); startActivity(it); } }); } }
45c027e0-1ade-4ddb-a63d-9d184b99904f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-09 19:28:16", "repo_name": "foyst/smalldata-cep", "sub_path": "/smalldata-cep-core/src/main/java/uk/co/foyst/smalldata/cep/dao/StreamViewFactory.java", "file_name": "StreamViewFactory.java", "file_ext": "java", "file_size_in_byte": 1011, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "c08e99430b7c9eaa5210971bb57e66b953132090", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/foyst/smalldata-cep
209
FILENAME: StreamViewFactory.java
0.262842
package uk.co.foyst.smalldata.cep.dao; import org.springframework.stereotype.Component; import uk.co.foyst.smalldata.cep.Stream; import uk.co.foyst.smalldata.cep.StreamId; import java.util.ArrayList; import java.util.List; @Component public class StreamViewFactory { public StreamView build(final Stream stream) { return new StreamView(stream.getStreamId().toString(), stream.getName(), stream.getDefinition(), stream.getDescription()); } public Stream convertToStream(final StreamView view) { final StreamId streamId = StreamId.fromString(view.getStreamId()); return new Stream(streamId, view.getName(), view.getDefinition(), view.getDescription()); } public List<Stream> convertToStream(final List<StreamView> streamViews) { final List<Stream> streams = new ArrayList<>(streamViews.size()); for (final StreamView streamView : streamViews) { streams.add(convertToStream(streamView)); } return streams; } }
494c2a83-0abb-4aaf-9e75-58535cb7ec3e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-07 01:53:22", "repo_name": "rraaff/tdil-pq", "sub_path": "/ tdil-pq --username subcmd@gmail.com/JavaBase/src/com/tdil/ga/MeasurementProtocol.java", "file_name": "MeasurementProtocol.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "264616370468bea182738a12f37157e40ca82f57", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rraaff/tdil-pq
193
FILENAME: MeasurementProtocol.java
0.226784
package com.tdil.ga; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import com.tdil.web.ProxyConfiguration; public class MeasurementProtocol { protected static String HTTP = "http://www.google-analytics.com/collect?"; protected static String HTTPS = "https://ssl.google-analytics.com/collect?"; private static boolean useHttps = false; private static ProxyConfiguration proxyConfiguration; private static ExecutorService executor = Executors.newFixedThreadPool(5); public static void track(PageView runnable) { executor.submit(runnable); } public static boolean useHttps() { return useHttps; } public static void setUseHttps(boolean useHttps) { MeasurementProtocol.useHttps = useHttps; } public static ProxyConfiguration getProxyConfiguration() { return proxyConfiguration; } public static void setProxyConfiguration(ProxyConfiguration proxyConfiguration) { MeasurementProtocol.proxyConfiguration = proxyConfiguration; } }
51b492d1-6a4b-4416-b220-60a7f1147beb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-13 18:41:01", "repo_name": "FRCTeam2910/2020CompetitionRobot", "sub_path": "/src/main/java/org/frcteam2910/c2020/commands/PlayTheWheelOfFortuneCommand.java", "file_name": "PlayTheWheelOfFortuneCommand.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "d50f0d538f6800a11d4393f73487f7feea690340", "star_events_count": 2, "fork_events_count": 3, "src_encoding": "UTF-8"}
https://github.com/FRCTeam2910/2020CompetitionRobot
259
FILENAME: PlayTheWheelOfFortuneCommand.java
0.282988
package org.frcteam2910.c2020.commands; import edu.wpi.first.wpilibj2.command.CommandBase; import org.frcteam2910.c2020.subsystems.WheelOfFortuneSubsystem; public class PlayTheWheelOfFortuneCommand extends CommandBase { private final WheelOfFortuneSubsystem wheelOfFortune; private double lastPosition = 0.0; public PlayTheWheelOfFortuneCommand(WheelOfFortuneSubsystem wheelOfFortune) { this.wheelOfFortune = wheelOfFortune; addRequirements(wheelOfFortune); } @Override public void initialize() { lastPosition = wheelOfFortune.getEncoderPosition(); } @Override public void execute() { wheelOfFortune.setMotorSpeed(0.75); } @Override public boolean isFinished() { return Math.abs(wheelOfFortune.getEncoderPosition() - lastPosition) >= 4.0 * (9.0 * (32.0 / 2.0)); } @Override public void end(boolean interrupted) { wheelOfFortune.stopMotor(); } }
b5f61cee-904c-4ffe-a55a-574f3f06e1fb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-10-16T19:37:32", "repo_name": "nthdeveloper/InnoSetupSamples", "sub_path": "/SampleProjects/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 999, "line_count": 13, "lang": "en", "doc_type": "text", "blob_id": "ac5216fbf1c6fdafd8cb4faaeea14c01c61377e8", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nthdeveloper/InnoSetupSamples
182
FILENAME: README.md
0.246533
# Sample Projects ## DesktopApp Sample Windows Forms desktop application with a class library project. Inno Setup script file installs tha application, creates a desktop shortcut and an uninstall shortcut in Add/Remove Programs. ## OptionalFeatures Sample Windows Forms desktop application with 3 class libraries that demostrate optional features/plugins that can installed by the setup wizard. Inno Setup script displays additinal setup wizard page for selecting optinal features. ## Windows Service Simple Windows service project that writes a mesage to the console periodically. In debug mode it runs as a console application and in release mode it runs as a windows service. Inno Script file installs and registers the service. ## Windows Service With Login Sample Windows service which runs with a user account instead of local system accounts. Inno Setup script displays additional setup wizard page for entering user account name and password, and sets the Windows service's user account.
6660ed5f-d3f8-4947-92ae-d4d4336ce4c9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-08-05T17:20:58", "repo_name": "Nippius/apa102c", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1038, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "78ee6b26d48d6ad82b071d56dc1f105149202977", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Nippius/apa102c
264
FILENAME: README.md
0.204342
# apa102c - Tiva C series driver for APA102C Super LED IC's This repository contains the software driver for controling APA102C LED driver IC's using Tiva C series hardware. The driver was tested using a Tiva C EK-TM4C123GXL development board. ## Getting started: Using this driver is simple: 1. Add apa102c_conf.h, apa102c.h and apa102c.c to your project 2. Edit apa102c_conf.h and set the SPI peripheral you intend to use and the number of LED's in the strip. 3. Import apa102c.h After that: - Use clear_strip() to clear the strip data (this only clears the internal representation of the LED states). - Use set_pixel() and clear_pixel() to manipulate individual pixel values. - Use display_strip() to send the internal pixel data to the strip. ## TODOs: - Use interrupts - Use uDMA - Use CMSIS instead of the TivaWare library - Add functions to allow creation of effects by manipulating the internal representation. ## License All files are licensed under the MIT License. For more information, please read the LICENSE file.
d0f68d8a-8c29-4527-93bf-d8155306a126
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-01 07:04:21", "repo_name": "gaocn/eshop-inventory", "sub_path": "/src/main/java/govind/inventory/hystrix/command/SaveProductInfoToRedisCommand.java", "file_name": "SaveProductInfoToRedisCommand.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "61f342224c98a9d219aae8906eb06e70a8fe36e1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/gaocn/eshop-inventory
226
FILENAME: SaveProductInfoToRedisCommand.java
0.279042
package govind.inventory.hystrix.command; import com.alibaba.fastjson.JSONObject; import com.netflix.hystrix.HystrixCommand; import com.netflix.hystrix.HystrixCommandGroupKey; import govind.inventory.dao.entity.ProductInfo; import govind.inventory.product.SpringContext; import redis.clients.jedis.JedisCluster; public class SaveProductInfoToRedisCommand extends HystrixCommand<Boolean> { private ProductInfo productInfo; public SaveProductInfoToRedisCommand(ProductInfo productInfo) { //所有redis访问采用同一个线程池 super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("RedisGroup"))); this.productInfo = productInfo; } @Override protected Boolean run() throws Exception { JedisCluster jedisCluster = (JedisCluster) SpringContext.getWebAppCtx().getBean("jedisClusterFactory"); String key = "product_info_" + productInfo.getId(); jedisCluster.set(key, JSONObject.toJSONString(productInfo)); return true; } @Override protected Boolean getFallback() { return true; } }
5f51c321-93e3-41ec-961e-de7a7e38caad
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-08-09 16:46:28", "repo_name": "Foxkid/Oarlok", "sub_path": "/src/oarlok/resources/dbo/DatabaseConnection.java", "file_name": "DatabaseConnection.java", "file_ext": "java", "file_size_in_byte": 965, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "fc68bd0020c6a2eba11f252c7bf12dd4b8731532", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Foxkid/Oarlok
240
FILENAME: DatabaseConnection.java
0.279042
/* * This file connects to the database server on AMAZON. * Author - OARLOK Team * Data Modified - 7th Aug 2012 * */ package oarlok.resources.dbo; import java.sql.Connection; import java.sql.DriverManager; public class DatabaseConnection { private String jdbcUsername = "flippers"; private String jdbcPassword = "framehawk"; private String jdbcURL = "jdbc:mysql://row.c7irj4yygfgf.us-west-1.rds.amazonaws.com:3306/row"; Connection myConnection = null; private String getJdbcUsername() { return jdbcUsername; } private String getJdbcPassword() { return jdbcPassword; } private String getJdbcURL() { return jdbcURL; } public Connection getConnectionHandler() { String driver = "com.mysql.jdbc.Driver"; try { Class.forName(driver).newInstance(); myConnection = DriverManager.getConnection(getJdbcURL(), getJdbcUsername(), getJdbcPassword()); } catch (Exception e) { e.printStackTrace(); } return myConnection; } }
00c26da9-d9c2-42b4-8a8e-030a6b38016a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-02 07:22:50", "repo_name": "wangwei216/springProject", "sub_path": "/springTest/src/spring_test01/TestMain.java", "file_name": "TestMain.java", "file_ext": "java", "file_size_in_byte": 1352, "line_count": 38, "lang": "zh", "doc_type": "code", "blob_id": "5adff5b36c33cba957e1b00408d9c3d99e1ee9c6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wangwei216/springProject
278
FILENAME: TestMain.java
0.291787
package spring_test01; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class TestMain { public static void main(String[] args){ // helloSpring.sayHello("这是我要传进来的参数的名字"); //这个是传统的正常调用对象去实现 // HelloSpring helloSpring = new HelloSpring(); // helloSpring.sayHello("这是我要传进来的参数的名字"); /*这部分是利用了spring这个框架*/ //1. 加载spring配置文件,创建一个Spring的IOC容器对象 ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");//这个传进来的是你所要创建类所在的配置文件 //2. 然后得到配置创建的对象,从IOC容器中获取这个bean对象那个 // HelloSpring helloSpring = (HelloSpring) context.getBean("test01");//这个传进来的一定是要和你配置XML文件中的那个bean的id 是一样的 Car bean = (Car) context.getBean(Car.class); //3. 直接调用你想调用的那个sayHello的方法 System.out.println(bean); Object bean1 = context.getBean("person"); // Person bean1 = context.getBean(Person.class); System.out.println(bean1); bean.shuchu(); } }
7282e0d6-7156-4b4d-831c-b2bc694f108e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-20 15:53:12", "repo_name": "preetkewl/My_Application", "sub_path": "/app/src/main/java/com/example/myapplication/beans/RegisterData.java", "file_name": "RegisterData.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "85356886bcc4aa89ecf71677b471cef0afc385b2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/preetkewl/My_Application
203
FILENAME: RegisterData.java
0.187133
package com.example.myapplication.beans; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class RegisterData { @SerializedName("user_id") @Expose private String userId; @SerializedName("name") @Expose private String name; @SerializedName("email") @Expose private String email; @SerializedName("number") @Expose private String number; public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } }
23c7bf41-1cd5-4367-9fe1-6daee16b9180
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-30 15:49:10", "repo_name": "SmokedKoala/tamagotchi", "sub_path": "/app/src/main/java/ru/practice/tamagotchi/tamagotchiactivity/TamagotchiActivity.java", "file_name": "TamagotchiActivity.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "60fc62c9437810009945c6c98a000fcff20e02b0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SmokedKoala/tamagotchi
202
FILENAME: TamagotchiActivity.java
0.272799
package ru.practice.tamagotchi.tamagotchiactivity; import android.graphics.Point; import android.os.Bundle; import android.view.Display; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; public class TamagotchiActivity extends AppCompatActivity { private TamagotchiView tamagotchiView; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); //создание переменной Point для получения размеров экрана Display display = getWindowManager().getDefaultDisplay(); Point point = new Point(); display.getSize(point); tamagotchiView = new TamagotchiView(this,point.x,point.y); setContentView(tamagotchiView); } @Override protected void onPause() { super.onPause(); tamagotchiView.pause(); } @Override protected void onResume() { super.onResume(); tamagotchiView.resume(); } }
09771092-837f-44e4-86b4-e99c838a12eb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-08 19:39:00", "repo_name": "jooccoo/JavaHazik_AgocsJozsef", "sub_path": "/JavaHazik_AgocsJozsef/HF2/src/tizennegyedik_feladat/Szotar.java", "file_name": "Szotar.java", "file_ext": "java", "file_size_in_byte": 985, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "52d92c1d37ef332c20a687fda9dbd614e81028ca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jooccoo/JavaHazik_AgocsJozsef
247
FILENAME: Szotar.java
0.216012
/* * 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 tizennegyedik_feladat; import java.util.Objects; /** * * @author Jocó */ public class Szotar { private String angol; private String magyar; public String getAngol() { return angol; } public String getMagyar() { return magyar; } public Szotar(String angol, String magyar) { this.angol = angol; this.magyar = magyar; } @Override public int hashCode() { int hash = 5; return hash; } @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof Szotar)) { return false; } return this.angol.equals(((Szotar) obj).angol); } @Override public String toString() { return this.angol + ":" + this.magyar; } }
cbad23bb-5fa4-4b50-acb2-2f7ffefb2164
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-10 15:47:30", "repo_name": "elkhader/jee-first-webapp", "sub_path": "/src/java/com/LoginDAO.java", "file_name": "LoginDAO.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "efb712c9bc18949d58d6223aec6a3edea6a757b9", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/elkhader/jee-first-webapp
191
FILENAME: LoginDAO.java
0.259826
/* * 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; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; /** * * @author Admin */ public class LoginDAO { public static String loginCheck(LoginBean loginBean){ String query="select * from login where email=? and password=?"; try{ Connection con=DBConnection.getConnection(); PreparedStatement ps=con.prepareStatement(query); ps.setString(1,loginBean.getEmail()); ps.setString(2,loginBean.getPassword()); ResultSet rs=ps.executeQuery(); if(rs.next()){ return "true"; } else{ return "false"; } }catch(Exception e){ e.printStackTrace(); } return "error"; } }
0252ac6d-2b70-4f0d-b0c9-56353e41150a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-13 01:40:08", "repo_name": "teepidge/mooc.fi", "sub_path": "/Part 5/Part05_15 Item.java", "file_name": "Part05_15 Item.java", "file_ext": "java", "file_size_in_byte": 985, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "481bac8d66059ea4a8400d2a647fe05d9110c84e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/teepidge/mooc.fi
197
FILENAME: Part05_15 Item.java
0.27513
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author Taylor Pigeon */ public class Item { private String identifier; private String name; public Item(String identifier, String name) { this.identifier = identifier; this.name = name; } @Override public String toString() { return this.identifier + ": " + this.name; } public Boolean equals(Item item) { if (this == item) { return true; } if(!(this instanceof Item)) { return false; } // create new object and cast Item class Item objectCompared = (Item) item; //if identifier is same, then they are considered equal return (item.identifier.equals(this.identifier)); } }
9017c605-68d1-42b8-a1c9-0cf37ddacef9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-26T02:07:13", "repo_name": "JessicaSellers/habit-tracker", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1000, "line_count": 44, "lang": "en", "doc_type": "text", "blob_id": "9dda0b59d8d6a14732fa8ad2948453972f225a4f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JessicaSellers/habit-tracker
245
FILENAME: README.md
0.196826
# habit-tracker ## Installation All terminal commands below are relative to the directory where you've checked out the source code. Install Node Version Manager & Node 10+ curl https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash source ~/.nvm/nvm.sh nvm install 15 nvm use 15 Install Yarn globally Install any dependencies: yarn install ## Available Scripts In the project directory, you can run: ### `yarn start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. ### `yarn test` Launches the test runner in the interactive watch mode.\ ### `yarn build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.\ Your app is ready to be deployed!
1502fd6a-81a1-4a58-a2bc-8a5601cb47d7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-09T03:57:36", "repo_name": "Wilson13/vision-web-app", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1018, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "06c5e5a4d6cd819711ce2811123ed6149d30bafa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Wilson13/vision-web-app
224
FILENAME: README.md
0.198064
# Google Cloud Vision API - Object Detection ## Name vision-web-app ## Description This is a simple project that demonstrates the usage of Next.js with TypeScript, GrommetJS, FireBase Auth that provides object detection based on image file uploaded by user. Separately, it is powered by a backend application called vision-backend-app that is powered by NodeJS, ExpressJS, AWS Lambda, Serverless Framework, and Google Vision API. ## Running ### Local npm run dev ## Deployment ### Automated Currently CI/CD pipeline is deployed using AWS CodePipeline and AWS CodeBuild, deployment is performed during the build stage. ## Screenshots ![Landing Page](assets/screenshot_1.png?raw=true "Title") ![Detection](assets/screenshot_2.png?raw=true "Title") # Notes - Wanted to perform the drawing of bounding boxes in front end (Static Site using NextJS for SSG) but couldn't do it due to Sharp library dependency on fs, which is only available in NodeJS. - Still requires some refactoring and code clean up.
6d23a0cd-69b5-431d-b903-10e6c50f7a73
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-03 09:33:08", "repo_name": "Valentyna-Pavliv/database", "sub_path": "/interface/src/sample/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "660a37b6cf583d89191526936177f29a00e1157c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Valentyna-Pavliv/database
197
FILENAME: Main.java
0.256832
package sample; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.text.Text; import javafx.stage.Stage; public class Main extends Application { @Override public void start(Stage primaryStage) throws Exception{ Parent root = FXMLLoader.load(getClass().getResource("interface.fxml")); primaryStage.setTitle("Interface"); Scene scene = new Scene(root, 1024, 800); primaryStage.setScene(scene); primaryStage.show();g Button button = (Button) scene.lookup("#search_button"); Text test_text = (Text) scene.lookup("#test_text"); button.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { test_text.setText("Accepted"); } }); } public static void main(String[] args) { launch(args); } }
7104917b-cbd8-4a85-9e14-36705da287e3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-08T17:29:08", "repo_name": "alanorthon/spring_sandBox", "sub_path": "/src/main/java/ru/springCRUDapp/testSpring/security/UserDetailsServiceImpl.java", "file_name": "UserDetailsServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1033, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "371f365917287a1772c35024b0f410163735ce86", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/alanorthon/spring_sandBox
181
FILENAME: UserDetailsServiceImpl.java
0.253861
package ru.springCRUDapp.testSpring.security; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import ru.springCRUDapp.testSpring.DAO.UserDAO; import ru.springCRUDapp.testSpring.model.User; import ru.springCRUDapp.testSpring.service.UserService; @Service public class UserDetailsServiceImpl implements UserDetailsService { private final UserDAO userDAO; @Autowired public UserDetailsServiceImpl(UserDAO userDAO) { this.userDAO = userDAO; } @Override public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException { User user = userDAO.getUserByUsername(s); if (user == null) { throw new UsernameNotFoundException("User not found"); } return user; } }
188d2a02-a2dd-4651-8d82-aaf8babe7ccc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-06 09:46:43", "repo_name": "LoaySrouji/ex8", "sub_path": "/app/src/main/java/com/image/get/talkwitharemoteserver/ServerHolder.java", "file_name": "ServerHolder.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "3982259280d05e3ed07f530c4dec2b780cd02f84", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LoaySrouji/ex8
187
FILENAME: ServerHolder.java
0.252384
package com.image.get.talkwitharemoteserver; import okhttp3.OkHttpClient; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class ServerHolder { private static ServerHolder instance = null; private static final String URL = "http://hujipostpc2019.pythonanywhere.com"; public final MainActivity.MyServer serverInterface; public synchronized static ServerHolder getInstance(){ if(instance != null) return instance; OkHttpClient okHttpClient = new OkHttpClient.Builder().build(); Retrofit retrofit = new Retrofit.Builder().client(okHttpClient) .baseUrl(URL) .addConverterFactory(GsonConverterFactory.create()) .build(); MainActivity.MyServer serverInterface = retrofit.create(MainActivity.MyServer.class); instance = new ServerHolder(serverInterface); return instance; } private ServerHolder(MainActivity.MyServer serverInterface) { this.serverInterface = serverInterface; } }
842fe2ee-33d3-4f9a-baf1-22938b2f9114
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-16 16:27:52", "repo_name": "TVanLinh/bai-tap-lon-mon-thuong-mai-dien-tu", "sub_path": "/sale/src/main/java/linhtran/it/vnua/sale/form/OrderForm.java", "file_name": "OrderForm.java", "file_ext": "java", "file_size_in_byte": 1033, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "1f56229bbd77a461fa56cdf80973687927ff4c70", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/TVanLinh/bai-tap-lon-mon-thuong-mai-dien-tu
222
FILENAME: OrderForm.java
0.271252
package linhtran.it.vnua.sale.form; import linhtran.it.vnua.sale.entities.OrderDetail; import java.util.HashSet; import java.util.List; import java.util.Set; /** * Created by linhtran on 04/10/17. */ public class OrderForm { private Set<EngredientForm> engredients; private CustomerLoginForm customerLoginForm; public Set<EngredientForm> getEngredients() { return engredients; } public void setEngredients(Set<EngredientForm> engredients) { this.engredients = engredients; } public CustomerLoginForm getCustomerLoginForm() { return customerLoginForm; } public void setCustomerLoginForm(CustomerLoginForm customerLoginForm) { this.customerLoginForm = customerLoginForm; } public Set<OrderDetail> toOrderDetail() { Set<OrderDetail> orderDetails = new HashSet<>(); for (EngredientForm engredientForm : this.engredients) { orderDetails.add(engredientForm.toOrderDetail()); } return orderDetails; } }
9f53753b-5cea-49f6-8731-adb2ff4a4a95
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-23 11:22:01", "repo_name": "kdsalvy/SpringBoot-OnlineTravelAgent", "sub_path": "/OnlineTravelAgent-SpringBoot/src/main/java/com/putnam/online/travel/agent/application/booking/service/CustomerService.java", "file_name": "CustomerService.java", "file_ext": "java", "file_size_in_byte": 978, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "4b5ff519c30132ac26105758823b8137ef9510a2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kdsalvy/SpringBoot-OnlineTravelAgent
161
FILENAME: CustomerService.java
0.286968
package com.putnam.online.travel.agent.application.booking.service; import java.util.ArrayList; import java.util.List; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.putnam.online.travel.agent.application.booking.model.entity.Customer; import com.putnam.online.travel.agent.application.booking.model.repository.CustomerRepository; @Service public class CustomerService { @Autowired private CustomerRepository customerRepository; public Long addCustomer(Customer customer) { return customerRepository.save(customer).getId(); } public List<Customer> fetchAllCustomers() { List<Customer> customerList = new ArrayList<>(); customerRepository.findAll().forEach(customerList::add); return customerList; } public Optional<Customer> fetchCustomerById(Long id) { return customerRepository.findById(id); } }
ae67e7d8-13c3-4596-b2ba-9370efaaaaba
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-24 01:13:23", "repo_name": "leondavidtb/biblioteca", "sub_path": "/Biblioteca/src/dao/EmprestimoDao.java", "file_name": "EmprestimoDao.java", "file_ext": "java", "file_size_in_byte": 980, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "966502887ac1c41a72bc497b05d3b7fb2ec8012b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/leondavidtb/biblioteca
253
FILENAME: EmprestimoDao.java
0.290176
package dao; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import conexao.ConnectionFactory; public class EmprestimoDao { public void busca(String valor, ArrayList<Object> vetor) { String sql = "SELECT * FROM Emprestimo WHERE codigo = ? || cod_exemplar = ?"; try { PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql); ResultSet rs; if (valor.matches("[0-9]*") && !valor.isEmpty()) { stmt.setInt(1, Integer.parseInt(valor)); } else { stmt.setInt(1, 0); } if (valor.matches("[0-9]*") && !valor.isEmpty()) { stmt.setInt(2, Integer.parseInt(valor)); } else { stmt.setInt(2, 0); } rs = stmt.executeQuery(); while (rs.next()) { vetor.add(rs.getInt("codigo")); vetor.add(rs.getInt("cod_exemplar")); vetor.add(rs.getInt("prazo")); vetor.add(rs.getInt("id_usuario")); } } catch (Exception e) { e.printStackTrace(); } } }
8d7d672d-a9ed-4b0f-ab5b-31d5f03f76fb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-15 10:13:01", "repo_name": "zhangjiweiuser/rabbit", "sub_path": "/src/main/java/com/zhang/rabbit/controller/LoginController.java", "file_name": "LoginController.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "0c1a3d6b805f81034695ad2cc7308ced8f4ba430", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zhangjiweiuser/rabbit
185
FILENAME: LoginController.java
0.176672
package com.zhang.rabbit.controller; import com.zhang.rabbit.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; /** * @author jiwei.zhang * @DATE 2017/12/18 0018 */ @RestController public class LoginController { @Autowired private UserService userService; @RequestMapping(path = "/toLogin") public ModelAndView toLogin(@RequestParam(value = "a", required = false) String a) { return new ModelAndView("login"); } @RequestMapping(path = "/login") public ModelAndView testFreemarker(@RequestParam(value = "epyId") Integer epyId, String userName, String password) { return new ModelAndView("login"); } }
c5db73e7-f65d-4879-bbfa-555fe8fe83e9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-16 23:48:07", "repo_name": "smdb21/java-miape-api", "sub_path": "/src/main/java/org/proteored/miapeapi/cv/SampleInformation.java", "file_name": "SampleInformation.java", "file_ext": "java", "file_size_in_byte": 1005, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "e33ff003d32a9cdcebf906cd122b9c5975906e79", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/smdb21/java-miape-api
258
FILENAME: SampleInformation.java
0.272025
package org.proteored.miapeapi.cv; public class SampleInformation extends ControlVocabularySet { public static Accession SAMPLE_BATCH_ACC = new Accession("MS:1000053"); public static Accession SAMPLE_VOLUME_ACC = new Accession("MS:1000005"); /* ; */ private static SampleInformation instance; public static SampleInformation getInstance(ControlVocabularyManager cvManager) { if (instance == null) instance = new SampleInformation(cvManager); return instance; } private SampleInformation(ControlVocabularyManager cvManager) { super(cvManager); String[] tmpParentAccessions = { "MS:1000548", // SAMPLE ATTRIBUTE "BTO:0001489", // whole body "DOID:4" // Disease }; this.parentAccessions = tmpParentAccessions; this.setExcludeParents(true); } public ControlVocabularyTerm getSampleBatchTerm() { return this.getCVTermByAccession(SAMPLE_BATCH_ACC); } public ControlVocabularyTerm getSampleVolumenTerm() { return this.getCVTermByAccession(SAMPLE_VOLUME_ACC); } }
bda44679-86f9-41b6-9760-c05724c2b4ed
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-18 20:16:03", "repo_name": "MakRaamWilliam/DesignPatterns", "sub_path": "/src/IteratorPattern/Waiter.java", "file_name": "Waiter.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "612435113b2353c233b3fb553ba5249b0aaa392e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MakRaamWilliam/DesignPatterns
200
FILENAME: Waiter.java
0.282988
package IteratorPattern; public class Waiter { private Menu DinnerMenu, PancakeMenu; public Waiter(DinnerMenu dinnerMenu, PancakeMenu pancakeMenu){ this.DinnerMenu = dinnerMenu; this.PancakeMenu = pancakeMenu; } public void printMenu(){ Iterator PancakeIterator = PancakeMenu.createIterator(); System.out.println("BreakFast Menu ---------"); printMenuIterator(PancakeIterator); Iterator DinnerIterator = DinnerMenu.createIterator(); System.out.println("Dinner Menu ------------"); printMenuIterator(DinnerIterator); } private void printMenuIterator(Iterator iterator){ while (iterator.hasNext()){ MenuItem item = iterator.next(); System.out.print("Name: "+ item.getItemName() + ","); System.out.print("Price: "+ item.getPrice() + ","); System.out.println("Isvegeterian: "+ item.isVegetrian() + ","); } } }
3b2d1223-6f6f-4509-9193-943cbabf7660
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-12 06:13:53", "repo_name": "dlatldud11/romanticseoul", "sub_path": "/RomanticSeoul/src/main/java/utility/GlobalData.java", "file_name": "GlobalData.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "9c6da2f01a1e76a33e94dbfdaee45f40bec11c06", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dlatldud11/romanticseoul
215
FILENAME: GlobalData.java
0.286968
package utility; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; public class GlobalData { public static final String HOST_URL = "http://localhost:8000"; public static final String POST_START = "/start"; public static final String GET_ONCALLS = "/oncalls"; public static final String POST_ACTION = "/action"; public void main() throws IOException { URL url = new URL("http://localhost:8089"); HttpURLConnection con = (HttpURLConnection)url.openConnection(); con.setRequestMethod("GET"); int status = con.getResponseCode(); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer content = new StringBuffer(); while((inputLine = in.readLine()) != null) content.append(inputLine); in.close(); con.disconnect(); System.out.println("Response status: " + status); System.out.println(); } }
ed4a5916-cd44-4ac8-a291-4a7f01ffd4ba
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-03 06:37:03", "repo_name": "lianghe423/netty_http2", "sub_path": "/src/main/java/netty/mmb/http2/Http2ExampleUtil.java", "file_name": "Http2ExampleUtil.java", "file_ext": "java", "file_size_in_byte": 353, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "b81c38a393ccc5bb6dfc85881814d6611cbf14b1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lianghe423/netty_http2
226
FILENAME: Http2ExampleUtil.java
0.239349
/* * Copyright 2014 The Netty Project * * The Netty Project licenses this file to you under the Apache License, version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package netty.mmb.http2; /** * Utility methods used by the example client and server. */ public final class Http2ExampleUtil { /** * Response header sent in response to the http->http2 cleartext upgrade request. */ public static final String UPGRADE_RESPONSE_HEADER = "Http-To-Http2-Upgrade"; private Http2ExampleUtil() { } }
83f5d18e-782e-4341-b337-7e1e4f4c6b00
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-14 07:31:49", "repo_name": "bulkeshswami9999/CigarDriver", "sub_path": "/app/src/main/java/com/hav/cigar/driver/model/MobileNoExistsData.java", "file_name": "MobileNoExistsData.java", "file_ext": "java", "file_size_in_byte": 1232, "line_count": 69, "lang": "en", "doc_type": "code", "blob_id": "858c83f036a201ab7bc9ac00e9f3f8c1efd94348", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/bulkeshswami9999/CigarDriver
263
FILENAME: MobileNoExistsData.java
0.226784
package com.hav.cigar.driver.model; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.io.Serializable; public class MobileNoExistsData implements Serializable { @SerializedName("message") @Expose String message; @SerializedName("id") @Expose String id=""; @SerializedName("full_name") @Expose String fullName=""; @SerializedName("email_id") @Expose String emailId=""; @SerializedName("mob") @Expose String mob; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getFullName() { return fullName; } public void setFullName(String fullName) { this.fullName = fullName; } public String getEmailId() { return emailId; } public void setEmailId(String emailId) { this.emailId = emailId; } public String getMob() { return mob; } public void setMob(String mob) { this.mob = mob; } }
bd3aa235-84b7-4833-aa09-503034a586d7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-09 13:31:05", "repo_name": "willbe058/Pigggeon", "sub_path": "/app/src/main/java/com/me/xpf/pigggeon/model/entity/LikedUser.java", "file_name": "LikedUser.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "63563e7c97245cc288afb0e9d6d3e358649c1d78", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/willbe058/Pigggeon
243
FILENAME: LikedUser.java
0.210766
package com.me.xpf.pigggeon.model.entity; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; /** * Created by xpf on 2015/8/31. */ public class LikedUser { @Expose private Integer id; @SerializedName("created_at") @Expose private String createdAt; @Expose private User user; /** * @return The id */ public Integer getId() { return id; } /** * @param id The id */ public void setId(Integer id) { this.id = id; } /** * @return The createdAt */ public String getCreatedAt() { return createdAt; } /** * @param createdAt The created_at */ public void setCreatedAt(String createdAt) { this.createdAt = createdAt; } /** * @return The user */ public User getUser() { return user; } /** * @param user The user */ public void setUser(User user) { this.user = user; } }
2296acf1-4ce1-4681-9b7f-696ee5d53e9c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-02-26 05:23:53", "repo_name": "matthew7j/Blackjack", "sub_path": "/src/com/matthew7j/Shoe.java", "file_name": "Shoe.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "74bc97f8aecf0ef9483a27c436e8c1a355cb1a6c", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/matthew7j/Blackjack
236
FILENAME: Shoe.java
0.290981
package com.matthew7j; import java.util.ArrayList; import java.util.Collections; import java.util.Random; public class Shoe { int numDecks; boolean yellow; ArrayList<Card> cards = new ArrayList<Card>(); public Shoe(int numDecks) { this.numDecks = numDecks; initialize(); } private void initialize() { for (int i = 0; i < numDecks; i++) { new Deck(cards); } } public String toString() { String results = ""; for (Card c : cards) { results += c.toString() + "\n"; } return results; } public void shuffle() { Collections.shuffle(cards); insertYellowCard(); } private void insertYellowCard() { Random rand = new Random(); int yellowCardLocation = (52 * numDecks) - (numDecks * (rand.nextInt((15 - 10) + 1) + 10)); Card yellowCard = new Card(); cards.add(yellowCardLocation, yellowCard); } }
e28bad4c-a4ea-4696-a35e-edc946717b0e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-09 10:03:01", "repo_name": "zerolancher/MybatisProject", "sub_path": "/src/main/java/com/itheima/zero/pojo/Role.java", "file_name": "Role.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "ab7ac00590ae2aaf77738e53cb90186fe64beb27", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zerolancher/MybatisProject
238
FILENAME: Role.java
0.23092
package com.itheima.zero.pojo; import java.util.List; public class Role { private Integer rid; private String rname; private String rdesc; private List<User> userList; public List<User> getUserList() { return userList; } public void setUserList(List<User> userList) { this.userList = userList; } public Integer getRid() { return rid; } public void setRid(Integer rid) { this.rid = rid; } public String getRname() { return rname; } public void setRname(String rname) { this.rname = rname; } public String getRdesc() { return rdesc; } public void setRdesc(String rdesc) { this.rdesc = rdesc; } @Override public String toString() { return "Role{" + "rid=" + rid + ", rname='" + rname + '\'' + ", rdesc='" + rdesc + '\'' + ", userList=" + userList + '}'; } }
57c7023e-1ad3-4016-a457-df730a7c979d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-03-23T09:13:44", "repo_name": "paulgreg/roomba_pilot", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1028, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "ba5f8b630288517a03e0971b494547ef9e571049", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/paulgreg/roomba_pilot
285
FILENAME: README.md
0.23231
# Piloting a Roomba with an Arduino # Watch a [video of what source code is doing here](https://www.youtube.com/watch?v=7rpqySur7gI). ## What you need ## - A roomba with a serial port (mine is the 555 model), - An arduino, - to build a cable to connect the Arduino to the Roomba, see [theses instructions](http://www.instructables.com/id/Web-controlled-Twittering-Roomba/), - download that nice [Roomba library](http://www.airspayce.com/mikem/arduino/Roomba/) into the Arduino library folder. ## Connections ## Connect the Roomba RX wire to Arduino pin 0 (RX) and Roomba TX to Arduino pin 1 (TX). To power the Arduino, you’ll need to convert the 20 volts from Roomba to 5 volts using a 7805 5V voltage regulator (see [theses instructions](http://www.instructables.com/id/Web-controlled-Twittering-Roomba/)). ## References ## - [Roomba library](http://www.airspayce.com/mikem/arduino/Roomba/) - [Roomba serial communication specifications](http://irobot.lv/uploaded_files/File/iRobot_Roomba_500_Open_Interface_Spec.pdf)
2e05c966-d1c0-4453-8a99-4cc86a085c7e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-07 04:59:17", "repo_name": "janggege/moni", "sub_path": "/moni/app/src/main/java/com/example/lenovo/moni/mvp/model/Loginmodel.java", "file_name": "Loginmodel.java", "file_ext": "java", "file_size_in_byte": 970, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "2160d7fac491c21ea75d28c969b70de7562b9aa7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/janggege/moni
219
FILENAME: Loginmodel.java
0.229535
package com.example.lenovo.moni.mvp.model; import com.example.lenovo.moni.mvp.Myinterface.Logininterface; import com.example.lenovo.moni.mvp.okhttp.Okhttputils; import java.io.IOException; import java.util.Map; import okhttp3.Call; import okhttp3.Callback; import okhttp3.Response; /*Time:2019/4/4 *Author:刘江 *Description: */public class Loginmodel implements Logininterface.Loginmodel { @Override public void Requset(Map<String, String> list, final Callback callback) { String url = "http://172.17.8.100/small/user/v1/login"; Okhttputils.getinstance().doPost(url, list, new okhttp3.Callback() { @Override public void onFailure(Call call, IOException e) { callback.shibsai(); } @Override public void onResponse(Call call, Response response) throws IOException { callback.chenggong(response.body().string()); } }); } }
d668c0c6-c8bc-4144-bcaa-170870d30c07
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-02-25T15:22:34", "repo_name": "AmosFord/gitclass", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 973, "line_count": 43, "lang": "en", "doc_type": "text", "blob_id": "accfb074d18500423efca5d7425f1a5ff0b9f45f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AmosFord/gitclass
213
FILENAME: README.md
0.198064
# gitclass Basic web app to use for in class project Initial set up generated from Yoeman Web App generator: https://github.com/yeoman/generator-webapp # Features Please see our gulpfile for up to date information on what we support. enable ES2015 features using Babel CSS Autoprefixing Built-in preview server with BrowserSync Automagically compile Sass with libsass Automagically lint your scripts Map compiled CSS to source stylesheets with source maps Awesome image optimization Automagically wire-up dependencies installed with Bower # Generate you own project? Getting Started Install: npm install --global yo gulp-cli bower generator-webapp Run yo webapp to scaffold your webapp Run gulp serve to preview and watch for changes Run bower install --save <package> to install frontend dependencies Run gulp serve:test to run the tests in the browser Run gulp to build your webapp for production Run gulp serve:dist to preview the production build
e9166e0d-ee2f-4c7b-83e2-93e87e934570
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-11 09:39:19", "repo_name": "GnohiSiaM/demos", "sub_path": "/java/form-validation/src/main/java/com/gnohisiam/service/UserService.java", "file_name": "UserService.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "f9e1ea61822065310a64acab7dd2a3805fbe8929", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/GnohiSiaM/demos
227
FILENAME: UserService.java
0.27048
package com.gnohisiam.service; import com.gnohisiam.model.User; import com.gnohisiam.repository.UserRepository; import com.gnohisiam.util.CipherUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Objects; @Service public class UserService { @Autowired private UserRepository repository; /** * 根据用户名从DB查找用户,用户不存在则返回 0,密码一致则返回 1,否则返回 2 * @param name * @param password * @return */ public int login(String name, String password) { User user = repository.findByName(name); if (Objects.isNull(user)) { return 0; } return CipherUtil.validatePassword(user.getPassword(), password) ? 1 : 2; } public boolean isNameExist(String name) { return Objects.nonNull(repository.findByName(name)); } public void save(User user) { user.setPassword(CipherUtil.generatePassword(user.getPassword())); repository.save(user); } }
0d84fd6c-b3d6-43e1-a456-ab3ee28f7472
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-26 14:58:54", "repo_name": "13555785106/AndroidPPT-V01", "sub_path": "/04-GeoQuiz-Final/app/src/main/java/com/telecom/geoquiz/Question.java", "file_name": "Question.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "b1a78369b536ca88b007907c413950d1f4f6a253", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/13555785106/AndroidPPT-V01
250
FILENAME: Question.java
0.26588
package com.telecom.geoquiz; /** * Created by xiaojf on 17/12/18. */ public class Question { private int mTextResId; private boolean mAnswerTrue; private boolean mPassed; public Question(int textResId, boolean answerTrue) { mTextResId = textResId; mAnswerTrue = answerTrue; } public int getTextResId() { return mTextResId; } public void setTextResId(int textResId) { mTextResId = textResId; } public boolean isAnswerTrue() { return mAnswerTrue; } public void setAnswerTrue(boolean answerTrue) { mAnswerTrue = answerTrue; } public boolean isPassed() { return mPassed; } public void setPassed(boolean passed) { mPassed = passed; } @Override public String toString() { return "Question{" + "mTextResId=" + getTextResId() + ", mAnswerTrue=" + isAnswerTrue() + ", mPassed=" + isPassed() + '}'; } }
0d60611c-58aa-4a1b-8675-18e04405d8e5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-11 09:20:50", "repo_name": "ranganath98/SeleniumJavaFramework", "sub_path": "/SeleniumFramework/src/test/java/test/Test_GoogleSearch.java", "file_name": "Test_GoogleSearch.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "03b8f6bdae1ac0643ecb20a3136f562ee1a0ef03", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ranganath98/SeleniumJavaFramework
213
FILENAME: Test_GoogleSearch.java
0.279828
package test; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.chrome.ChromeDriver; public class Test_GoogleSearch { public static void main(String[] args) throws InterruptedException { googleSearch(); } private static void googleSearch() throws InterruptedException { String location=System.getProperty("user.dir"); System.setProperty("webdriver.chrome.driver", location+"/lib/chromedriver/chromedriver.exe"); ChromeDriver driver = new ChromeDriver(); //goto Google.com driver.get("https://google.com/"); //enter the text in textbox driver.findElement(By.name("q")).sendKeys("Google"); //click onsearch button //driver.findElement(By.name("btnK")).click(); //enter key driver.findElement(By.name("btnK")).sendKeys(Keys.RETURN); Thread.sleep(5000); //close browser driver.close(); System.out.println("Test Completed.."); } }
34451fd2-7c4d-40ff-8eb7-0b36a2d29b44
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-14 01:19:49", "repo_name": "MaykiHu/cse331-20sp-mayki", "sub_path": "/hw-marvel/src/main/java/marvel/MarvelHeroModel.java", "file_name": "MarvelHeroModel.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "2539dfb454b31000bac637708e044c8f9b924547", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MaykiHu/cse331-20sp-mayki
249
FILENAME: MarvelHeroModel.java
0.236516
package marvel; import com.opencsv.bean.CsvBindByName; /* * This is the Java representation of a Marvel Hero */ public class MarvelHeroModel { /* * name of the marvel hero */ @CsvBindByName private String hero; /* * comic's title where the marvel hero appeared */ @CsvBindByName private String book; /* * Where abstraction function would go if an ADT, but it's not */ /* * Where rep invariant would go if an ADT, but it's not */ /* * returns the name of the hero */ public String getName() { return hero; } /* * sets the name of the hero */ public void setName(String name) { this.hero = name; } /* * returns the title of the comic the hero appeared in */ public String getTitle() { return book; } /* * sets the title of the comic the hero appeared in */ public void setTitle(String title) { book = title; } }
24c848ed-3697-4c97-9ae9-686816ff97b6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-09-25T00:32:22", "repo_name": "latimercaleb/mockups", "sub_path": "/Design 2/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 975, "line_count": 14, "lang": "en", "doc_type": "text", "blob_id": "521426691c2674420e6d123cd6fcc460662ce393", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/latimercaleb/mockups
200
FILENAME: readme.md
0.190724
# Mockup 2 This mockup and all the other ones are done differently from the first. This code written on top of a template downloaded from quackit linked here: https://www.quackit.com/html/templates/business_website_templates.cfm Within this folder you will find a .html and .css file consisting of the code for the main page. Please download the zip, extract it and run the index.html file to view the page. ## Design Scheme With this mockup I wanted to go for a more professional business-look. This approach should not only draw the attention of other academics interested or associated to the research project but also pull in some views from other R&D groups from outside companies. The color scheme chosen here is has a green accent using a picture background and white outlines. Text alternates depending on the background. This mockup features a sticky header, hover animations on buttons, and like all of the other mockups some sort of responsive control flow.
515d0eda-0b71-4250-95ad-864e31028330
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-09-27T06:06:11", "repo_name": "sbsabapathi/selenium-java", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1040, "line_count": 20, "lang": "en", "doc_type": "text", "blob_id": "cea3b4df0a4b0884f3bca6fda625255963b730a1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sbsabapathi/selenium-java
212
FILENAME: README.md
0.279042
#cucumber JVM Test #=========================== #Applicants are politely asked not to disseminate or discuss the details of this coding test to others. #Cucumber JVM Test #The feature file that requires automating (search.feature) is included, the User Story and scenario is within that file. The aim of this task is for you to automate that scenario using cucumber JVM #? Please complete the automation of the search scenario and get as far as you can within 2 hours, #? We are interested in a fully working automated scenario that demonstrates your ability to automate a scenario and actively contribute towards an existing automated test suite, the quality of your solution is as important as how far through the test you get. #? Your code should be as if you were contributing towards an existing automation test suite in a 'professional' environment. #TASKS #1. Complete the step definitions and add any necessary Java code. #2. You should aim to get all steps passing and validate that the story passes.
d9ba30d8-fcee-4253-a141-85f237f2efd9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-05-01 11:33:59", "repo_name": "shareyan/winfly-android", "sub_path": "/TestFragment/src/com/example/testfragment/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 987, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "a9833bb161f7dd345cd60e9d71a0264695854596", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/shareyan/winfly-android
204
FILENAME: MainActivity.java
0.278257
package com.example.testfragment; import android.app.Activity; import android.graphics.Point; import android.os.Bundle; import android.view.Display; import android.view.Menu; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Point size = new Point(); Display display = getWindowManager().getDefaultDisplay(); display.getSize(size); if(size.x > size.y){ Fragment1 fragment1 = new Fragment1(); getFragmentManager().beginTransaction().replace(R.id.main_layout,fragment1).commit(); }else{ Fragment2 fragment2 = new Fragment2(); getFragmentManager().beginTransaction().replace(R.id.main_layout,fragment2).commit(); } } @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; } }
67b1efb7-718b-4c88-8bb7-dc448d7d897c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-15 01:29:53", "repo_name": "nerJll/amet", "sub_path": "/src/main/java/com/aixu/meeting/utils/WeChatUtil.java", "file_name": "WeChatUtil.java", "file_ext": "java", "file_size_in_byte": 1123, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "4c3658ce1e90994a79041e25d1ee350d4bafe641", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/nerJll/amet
344
FILENAME: WeChatUtil.java
0.271252
package com.aixu.meeting.utils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import com.aiko.config.wxcp.WxcpApi; import com.google.gson.Gson; import me.chanjar.weixin.cp.bean.WxCpMessage; /** * @author RenBowen * @date 2017年11月6日-上午10:03:36 * @since 1.0.0 */ public class WeChatUtil { /** * 企业号常量 */ private static final Integer cId = 74; /** * 微信推送TEXT * @param uId */ public static String weChatPush(String uId, String content) { WxCpMessage msg=new WxCpMessage(); Gson gson = new Gson(); MultiValueMap<String, Object> requestEntity = new LinkedMultiValueMap<String, Object>(); //推送TEXT msg.setAgentId(cId);//企业应用id msg.setContent(content); msg.setToUser(uId);//1013608|1014906|1014709 requestEntity.add("requestJson", gson.toJson(msg)); //跳转url,可不传,url中会默认一个参数userid,值为微信接收人的工号 //requestEntity.add("redirectUri","http://portal.aikosolar.com/?test=2"); String result = WxcpApi.send(WxcpApi.TEXT,requestEntity); return result; } }
5dcc1a2d-eb37-4d4d-9660-877868c387c7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-22 06:09:48", "repo_name": "Json-Liu/spring-amqp-samples", "sub_path": "/helloworld/src/main/java/org/springframework/amqp/helloworld/financepush/mq/pushrequest/PushRequestListener.java", "file_name": "PushRequestListener.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "a869d9084812b20b0ded6dc4e0b7b48e984a4134", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Json-Liu/spring-amqp-samples
177
FILENAME: PushRequestListener.java
0.217338
package org.springframework.amqp.helloworld.financepush.mq.pushrequest; import com.fasterxml.jackson.core.JsonProcessingException; import org.springframework.amqp.helloworld.financepush.mq.AbstractBaseListener; import org.springframework.amqp.helloworld.sync.annotation.Message; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; /** * Created by hongshuwei on 4/22/16. */ public class PushRequestListener extends AbstractBaseListener<Message> { @Override protected void onMessageInternal(Message message) { try { System.out.println(objectMapper.writeValueAsString(message)); } catch (JsonProcessingException e) { e.printStackTrace(); } } public static void main(String[] args) throws Exception { ApplicationContext context = new ClassPathXmlApplicationContext("rabbitmq_push_request_consumer.xml"); } }
45d5a5c4-469c-480e-b071-38e9708fb4cd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-02-23T23:49:50", "repo_name": "NYU-CS6313-Projects/d3-labs-example-repo", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1031, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "1d888b11f7bf5f2898e2666a41b1e22cda0265c1", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/NYU-CS6313-Projects/d3-labs-example-repo
224
FILENAME: README.md
0.218669
# Example Git Repo This is an example git repo. ## Master Branch The master branch is the default branch. Branches are useful tools when making modifications, as any commits you make as a team don't interfere with each other. Once you're done with your feature, you can merge it back into master. You can also use branches for hosting on [Github Pages](https://pages.github.com/) ## Branching This repo features an additional branch called examplebranch. To make a branch type `git branch BRANCHNAME`. That will make a branch called BRANCHNAME Then changes you make will be isolated to that branch. Once you're done, you can merge your changes back into the master branch by typing `git checkout master` and `git merge BRANCHNAME` Changes made to files both in the master, and in a branch are usually automatically merged, but you can see [here](https://help.github.com/articles/resolving-a-merge-conflict-from-the-command-line/) for instructions on how to reserve merge conflicts when they do arise. It's very simple!
d12787c6-84e5-460d-a6aa-a2e78a11e2f0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-03 16:40:07", "repo_name": "danishm026/ResumeManager", "sub_path": "/DAO/src/main/java/com/arc/dto/UserRegistrationDetails.java", "file_name": "UserRegistrationDetails.java", "file_ext": "java", "file_size_in_byte": 987, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "fbb27bc61626d8b94629cb6e892171ece477fcd5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/danishm026/ResumeManager
215
FILENAME: UserRegistrationDetails.java
0.250913
package com.arc.dto; import javax.persistence.Entity; import javax.persistence.Id; import javax.validation.constraints.NotNull; @Entity public class UserRegistrationDetails { @Id private String rollNumber; @NotNull private String email; @NotNull private String passwordHash; public UserRegistrationDetails() { this.rollNumber = ""; this.email = ""; this.passwordHash = ""; } public UserRegistrationDetails(String rollNumber, String email, String passwordHash) { this.rollNumber = rollNumber; this.email = email; this.passwordHash = passwordHash; } public String getRollNumber() { return rollNumber; } public void setRollNumber(String rollNumber) { this.rollNumber = rollNumber; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPasswordHash() { return passwordHash; } public void setPasswordHash(String passwordHash) { this.passwordHash = passwordHash; } }
8d77990b-c97f-40fe-9fa5-021b916bcc53
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-13 08:03:56", "repo_name": "patrickbucher/ad_exercises", "sub_path": "/src/main/java/ch/hslu/ad/sw06/ex02/RaceHorse.java", "file_name": "RaceHorse.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "b1a359f3def28b8e7839c28988a1d8020f8028e0", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/patrickbucher/ad_exercises
242
FILENAME: RaceHorse.java
0.276691
package ch.hslu.ad.sw06.ex02; import java.util.Random; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public final class RaceHorse implements Runnable { private static final Logger LOG = LogManager.getLogger(); private final Synch startSignal; private volatile Thread runThread; private final Random random; public RaceHorse(Synch startSignal) { this.startSignal = startSignal; this.random = new Random(); } @Override public void run() { runThread = Thread.currentThread(); LOG.info("Rennpferd " + runThread.getName() + " geht in die Box."); try { startSignal.acquire(); LOG.info("Rennpferd " + runThread.getName() + " laeuft los..."); Thread.sleep(random.nextInt(3000)); } catch (InterruptedException ex) { LOG.info("Rennpferd " + runThread.getName() + " gibt auf."); return; } LOG.info("Rennpferd " + runThread.getName() + " ist im Ziel."); } }
38893b9d-02d3-4a97-97eb-88511396a283
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-09 08:28:56", "repo_name": "git867/smq", "sub_path": "/src/com/cn/pre/show_module/servlet/ShowServlet.java", "file_name": "ShowServlet.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "8b9a05f3e51c01041882442e9092c5f58ca3668a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/git867/smq
169
FILENAME: ShowServlet.java
0.236516
package com.cn.pre.show_module.servlet; import com.cn.pre.show_module.service.Imp.ShowServiceImp; import com.cn.pre.show_module.service.ShowService; 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; public class ShowServlet extends HttpServlet { HttpServletRequest request=null; HttpServletResponse response=null; ShowService showService = new ShowServiceImp(); protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { this.request=req; this.response=resp; String method = request.getParameter("method"); if(method.equals("show")){ response.sendRedirect("jsp/product.jsp"); } } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request,response); } }
4f2075dc-d401-48e1-b050-53655d86948c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-17 03:15:09", "repo_name": "BanofCat/MaoPuNews", "sub_path": "/app/src/main/java/com/ban/Activity/StartActivity.java", "file_name": "StartActivity.java", "file_ext": "java", "file_size_in_byte": 978, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "6c6218ce289158121ba62176711d55b70ca9c979", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/BanofCat/MaoPuNews
188
FILENAME: StartActivity.java
0.190724
package com.ban.Activity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import com.ban.maopu.R; import java.io.File; /** * Created by Administrator on 2016/4/11. */ public class StartActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.start_layout); File maopu = new File(Environment.getExternalStorageDirectory()+"/猫扑篮球/uploadCache"); if(!maopu.exists()) { maopu.mkdirs(); } new Handler().postDelayed(new Runnable() { @Override public void run() { Intent intent = new Intent(); intent.setClass(StartActivity.this, LoginActivity.class); startActivity(intent); finish(); } },1500); } }
24e1feb6-525e-4850-afb0-e4c5c8477212
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-29 15:43:59", "repo_name": "victorursan/banana", "sub_path": "/src/main/java/com/victor/banana/models/events/stickies/ActionUpdate.java", "file_name": "ActionUpdate.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "831b8fa9be913da225d4adb61c3cde04ddd91969", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/victorursan/banana
220
FILENAME: ActionUpdate.java
0.246533
package com.victor.banana.models.events.stickies; import com.victor.banana.utils.Constants.PersonnelRole; import io.vertx.codegen.annotations.DataObject; import io.vertx.core.json.JsonObject; import lombok.*; import org.jetbrains.annotations.NotNull;import java.util.List; import java.util.Optional; import java.util.UUID; import static com.victor.banana.utils.SerdesUtils.deserializeIntoObject; import static com.victor.banana.utils.SerdesUtils.serializeToJsonObject; @Builder @AllArgsConstructor @NoArgsConstructor @ToString @EqualsAndHashCode @Getter @DataObject public class ActionUpdate { @NotNull private UUID id; @Builder.Default private Optional<String> action = Optional.empty(); @Builder.Default private Optional<String> description = Optional.empty(); @Builder.Default private List<PersonnelRole> roles = List.of(); public ActionUpdate(JsonObject jsonObject) { deserializeIntoObject(this, jsonObject); } public JsonObject toJson() { return serializeToJsonObject(this); } }
91d8ea95-7aa5-45d0-8b35-428e30c85eb0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-04 02:12:31", "repo_name": "SM-Leee/Spring-IOC-Container", "sub_path": "/src/main/java/com/douzone/springcontainer/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "140226dc163041247f9e0ba89155ea0584f7b27c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SM-Leee/Spring-IOC-Container
243
FILENAME: User.java
0.23092
package com.douzone.springcontainer; import java.util.List; public class User { private Long no; private Friend friend; private String name = "이성민"; private List<String> friends; public List<String> getFriends() { return friends; } public void setFriends(List<String> friends) { this.friends = friends; } public User() { } public User(String name) { this.name = name; } public User(Long no,String name) { this.name = name; this.no = no; } public Friend getFriend() { return friend; } public void setFriend(Friend friend) { this.friend = friend; } public Long getNo() { return no; } public void setNo(Long no) { this.no = no; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return "User [no=" + no + ", friend=" + friend + ", name=" + name + ", friends=" + friends + "]"; } }
c84d991b-8d63-4376-a59b-33a760d9ba61
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-16 17:35:54", "repo_name": "JMastroionni/Android251_public", "sub_path": "/ScottsExamples/Services/IntentService/app/src/main/java/com/ebookfrenzy/startedservice1/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "35f114eabda0552ad4f2d1099fa7bab746b42f30", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JMastroionni/Android251_public
163
FILENAME: MainActivity.java
0.23092
package com.ebookfrenzy.startedservice1; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent intent = new Intent(this, MyIntentService.class); startService(intent); Button button = findViewById(R.id.button); button.setOnClickListener( new Button.OnClickListener() { int i; String msg; public void onClick(View v) { i++; msg = "Button Clicked " + i; TextView textView = findViewById(R.id.textView); textView.setText(msg); } } ); } }
bc9c650c-9afc-4e2b-9402-fcc9868834d5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-12 18:32:25", "repo_name": "marc-x-andre/Infectious_Mobile", "sub_path": "/app/src/main/java/com/m224/infectious/adapters/GridImageAdapter.java", "file_name": "GridImageAdapter.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 70, "lang": "en", "doc_type": "code", "blob_id": "eabfef32e8bcc4eb37bb4a075a9b07cacd33b7e9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/marc-x-andre/Infectious_Mobile
229
FILENAME: GridImageAdapter.java
0.262842
package com.m224.infectious.adapters; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import com.m224.infectious.domaine.GridImageView; import com.m224.infectious.utils.GridConfig; import java.util.List; /** * Created by 224 on 2017-10-20. */ public class GridImageAdapter extends BaseAdapter { private Context context; private List<GridImageView> gridImage; public GridImageAdapter(Context context, List<GridImageView> gridImage) { this.context = context; this.gridImage = gridImage; } @Override public int getCount() { return GridConfig.MAX_TILE; } @Override public Object getItem(int i) { return null; } @Override public long getItemId(int i) { return 0; } @Override public View getView(int position, View view, ViewGroup viewGroup) { return gridImage.get(position); } }
52601c93-a62e-486e-a65a-0084e43f2b07
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-09 12:46:10", "repo_name": "Ruchika0810/Hiber", "sub_path": "/src/main/java/com/lti/Fetch.java", "file_name": "Fetch.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "e6cca38976f4551414f56afcb5941a4537d2106e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Ruchika0810/Hiber
190
FILENAME: Fetch.java
0.279042
package com.lti; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.lti.dao.CustomerDao; import com.lti.entity.Customer; @WebServlet("/fet") public class Fetch extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { CustomerDao dao = new CustomerDao(); int id=Integer.parseInt(request.getParameter("id")); Customer c= dao.display(id); PrintWriter out = response.getWriter(); out.println("City : " +c.getCity()+"<br>"); out.println("Email : " +c.getEmail()+"<br>"); out.println("Name : " +c.getName()+"<br>"); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
88533c0a-4306-45be-a35a-6edeaed050ca
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-04 10:26:20", "repo_name": "nazar-art/auto_stub", "sub_path": "/src/main/java/net/lelyak/edu/core/driver/Driver.java", "file_name": "Driver.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "ea9cc5d7d396f403fdb705f7e027673f543d4e22", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nazar-art/auto_stub
191
FILENAME: Driver.java
0.245085
package net.lelyak.edu.core.driver; import net.lelyak.edu.core.common.Config; import net.lelyak.edu.core.parallel.WebDriverPool; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriverService; public class Driver { public final static WebDriverPool driver = new WebDriverPool(Config.getIntProperty(Config.WD_THREAD_COUNT)); public final static ThreadLocal<ChromeDriverService> chromeService = new ThreadLocal<ChromeDriverService>(); // public final static ThreadLocal<RemoteWebDriver> driver = new ThreadLocal<RemoteWebDriver>(); // public final static ThreadLocal<ChromeDriverService> chromeService = new ThreadLocal<ChromeDriverService>(); // public static RemoteWebDriver driver; public static void getUrl(String url) { driver.get().get(url); } public static WebElement findElementById(String id) { return driver.get().findElement(By.id(id)); } }
bdd65843-97f3-421a-b2a5-6b160a482d59
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-10 01:06:11", "repo_name": "Acomy/flowtreatment-service", "sub_path": "/src/main/java/com/bossien/flowtreatmentservice/handler/MessageContainer.java", "file_name": "MessageContainer.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "171a8e7b8fb7f0446dd5abb734775a3e145d05ab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Acomy/flowtreatment-service
214
FILENAME: MessageContainer.java
0.267408
package com.bossien.flowtreatmentservice.handler; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicInteger; /** * 消息容器 * * @author gb */ public class MessageContainer<K extends MessageHandler<V>,V> { private CopyOnWriteArrayList<K> messageHandlers = new CopyOnWriteArrayList<>(); private AtomicInteger point = new AtomicInteger(0); private MessageContainer() { } public static MessageContainer newMessageContainer() { return new MessageContainer(); } public void onNext(V v) { try { messageHandlers.get(point.get()).process(v); } catch (Exception e) { e.printStackTrace(); } finally { // resetPoint(); } } private void resetPoint() { point.getAndIncrement(); if (messageHandlers.size() == point.get()) { point.set(0); } } public MessageContainer addMessageHandler(K k) { messageHandlers.add(k); return this; } }
1bb9ebc3-75fe-40e9-8bc8-55988cae6d8d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-23 01:45:43", "repo_name": "18380163461/transformer", "sub_path": "/src/main/java/transformer/demo/BaseConstants.java", "file_name": "BaseConstants.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "4cbd152128b9e6c9cfaaba3aed4388bf576b7d58", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/18380163461/transformer
200
FILENAME: BaseConstants.java
0.253861
package transformer.demo; public class BaseConstants { /** * @Author: youpengda@qq.com * @Description: 0:失效 1:生效 */ public enum State { INVALID("0", "失效"), VALID("1", "生效"), ; private String key; private String name; State(String key, String name) { this.key = key; this.name = name; } public static String getNameBykey(String key) { for (State type : State.values()) { if (type.getKey().equals(key)) { return type.getName(); } } return null; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getName() { return name; } public void setName(String name) { this.name = name; } } }
de963215-fecb-4ab1-9234-9602deef2990
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-30 06:13:25", "repo_name": "MRLEILOVE/log2mongo", "sub_path": "/log2mongo-server/src/main/java/xyz/yuanwl/job/LogsCleanupTask.java", "file_name": "LogsCleanupTask.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "55cf12fd1a4483cd53868b9e3d45f232f23aa8e1", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MRLEILOVE/log2mongo
328
FILENAME: LogsCleanupTask.java
0.272799
package xyz.yuanwl.job; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import xyz.yuanwl.config.LogsRtProperties; import xyz.yuanwl.service.ProdService; import xyz.yuanwl.service.TestService; /** * <p>日志定时清理任务 * * @author Yuanwl * @date 2018/10/21 17:14 */ @Component @Slf4j public class LogsCleanupTask { @Autowired private LogsRtProperties logsRtProperties; @Autowired private TestService testService; @Autowired private ProdService prodService; /** * 定时执行清理 * @author Yuanwl * @date 2018-10-21 18:02:04 * @version v1.0.0 */ @Scheduled(cron = "0 0 2 * * ?") // 每天凌晨2点执行 // @Scheduled(cron = "*/5 * * * * ?") // 每5秒钟执行一次 public void clean(){ log.info("LogsCleanupTask.clean()..."); // 清理测试环境日志 testService.deleteLogsBefore(logsRtProperties.getTest()); // 清理生产环境日志 prodService.deleteLogsBefore(logsRtProperties.getProd()); } }
b2b6e62e-d4e5-40b4-a6f5-9908d6bcf082
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-04-15T17:56:20", "repo_name": "nealmatrix/emulator", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1029, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "c00b4ad879022dacd3affbbf09224869a2f76ec6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nealmatrix/emulator
263
FILENAME: README.md
0.258326
# CHIP-8 Emulator ## Usage After download or clone the repository, I use CMake to build the code, then run the `chip8` program. The default game is Tetris. If you want to use CLI, please uncomment `#define CLI` in the main.cpp file. ### Command Line Usage chip8 \<Scale> \<Delay> \<Rom> Scale: scale factor to enlarge the game window, 10 is recommanded. Delay: time between the cycles to determine the game speed. Rom: CHIP-8 file to load ## Prerequisite 1. CMake For MacOS, you can download CMake using `brew install CMake`. If you use M1 chip Mac, please open terminal using Rosetta. 2. SDL2 library For MacOS, you can download SDL2 using `brew install sdl2`. If you use M1 chip Mac, please open terminal using Rosetta. You can use `brew info sdl2` to find the directory of SDL2 library. ## Note Please change the SDL2 library directory ${SDL_DIR} to your own directory in the CMakeLists.txt file. ## Acknowledge Special thanks to Austin Morlan and his detailed guide of CHIP-8 emulator.
816d9f85-cd0f-47ad-aabf-07a039c5a9ef
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-15 12:24:46", "repo_name": "avshabavsha/rabbitmqplainjava", "sub_path": "/src/main/java/com/rabbitmq/tutorial/RabbitHelper.java", "file_name": "RabbitHelper.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "d8a43b26f6d6b82bfe78268871c639b8055271d7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/avshabavsha/rabbitmqplainjava
184
FILENAME: RabbitHelper.java
0.233706
package com.rabbitmq.tutorial; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import java.io.IOException; import java.net.URISyntaxException; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.util.concurrent.TimeoutException; import static com.rabbitmq.tutorial.ExampleConstants.*; import static com.rabbitmq.tutorial.ExampleConstants.QUEUE_NAME; public class RabbitHelper { static Channel initRabbitMqClient() throws URISyntaxException, NoSuchAlgorithmException, KeyManagementException, IOException, TimeoutException { ConnectionFactory factory = new ConnectionFactory(); factory.setUri(AMPQ_URI); factory.setConnectionTimeout(300000); Connection connection = factory.newConnection(); Channel channel = connection.createChannel(); channel.queueDeclare(QUEUE_NAME, true, false,false,null); return channel; } }
f1478031-0e7d-4e15-96ef-a9b8aad10094
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-12-23 12:12:48", "repo_name": "zhongl/lab", "sub_path": "/benchmarker/src/test/java/com/github/zhongl/benchmarker/FixInstanceSizeFactoryTest.java", "file_name": "FixInstanceSizeFactoryTest.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "63ecaff08dac5814cdbd90d5bc437778bc6935cd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zhongl/lab
199
FILENAME: FixInstanceSizeFactoryTest.java
0.285372
package com.github.zhongl.benchmarker; import org.junit.Test; import java.util.concurrent.Callable; import static org.hamcrest.Matchers.*; import static org.junit.Assert.assertThat; /** @author <a href="mailto:zhong.lunfu@gmail.com">zhongl<a> */ public class FixInstanceSizeFactoryTest { @Test public void returnNullIfOverFixSize() throws Exception { CallableFactory runnablefactory = new CallableFactory() { @Override public Callable<?> create() { return new Callable() { @Override public Object call() throws Exception { return null; } }; } }; int size = 5; FixInstanceSizeFactory factory = new FixInstanceSizeFactory(size, runnablefactory); for (int i = 0; i < size; i++) { assertThat(factory.create(), is(notNullValue())); } assertThat(factory.create(), is(nullValue())); } }
af267f2e-ad6e-4ca3-8e06-1ca03eb1659a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-08 16:35:09", "repo_name": "rexlManu/decompiled-shop-plugin", "sub_path": "/src/main/java/conj/Shop/tools/StringUtil.java", "file_name": "StringUtil.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "ae61f1338321afdc5529d3bab010d0e0d2708dd6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rexlManu/decompiled-shop-plugin
213
FILENAME: StringUtil.java
0.261331
package conj.Shop.tools; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; public class StringUtil { public static String toString(List<String> list) { if (list == null) { return null; } else { String string = ""; String s; for(Iterator var3 = list.iterator(); var3.hasNext(); string = string + s + "/;") { s = (String)var3.next(); } return string; } } public static List<String> fromString(String string) { if (string == null) { return null; } else { List<String> list = new ArrayList(); List<String> split = Arrays.asList(string.split("/;")); Iterator var4 = split.iterator(); while(var4.hasNext()) { String s = (String)var4.next(); list.add(s); Debug.log("Added lore: " + s); } return list; } } }
df4f1b0d-3fbe-45d1-a66b-0d4725cddeaf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-05 05:56:57", "repo_name": "kanaktenguria/Tello-Drone-Simulator", "sub_path": "/src/Flyer/StateReceiver.java", "file_name": "StateReceiver.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "ec550b4a30e1335f00d3975309ee0595ef5dfe47", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kanaktenguria/Tello-Drone-Simulator
193
FILENAME: StateReceiver.java
0.253861
package Flyer; import Common.DroneCommunicator; import Common.DroneState; import Message.Status; import java.net.SocketException; public class StateReceiver implements Runnable{ DroneState droneState; private Status status; public StateReceiver(DroneState droneState) { this.droneState=droneState; } @Override public void run() { DroneCommunicator State = null; try { State = new DroneCommunicator(8890); } catch (SocketException e) { e.printStackTrace(); } while(true) { try { String reply = State.receiveRequest(); status = new Status(reply); droneState.updateFlyingInfo(this.status); } catch (Exception e) { e.printStackTrace(); } try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } }
8e016bcd-8372-4543-977b-4c76352f62b5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-25 12:25:31", "repo_name": "rohitguta2432/tr-learn-api", "sub_path": "/src/main/java/com/workevr/api/config/AwsConfig.java", "file_name": "AwsConfig.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "5096baa941108585343915895504113dc6370a9b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rohitguta2432/tr-learn-api
207
FILENAME: AwsConfig.java
0.20947
package com.workevr.api.config; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; /** * @Author rohit * @Date 23/09/21 **/ @Configuration public class AwsConfig { @Value("${alpha.s3.accessKey}") private String accessKey; @Value("${alpha.s3.secretKey}") private String secretKey; @Value("${alpha.s3.region}") private String region; public AmazonS3 getS3Client(){ AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey); return AmazonS3Client.builder() .withRegion(region) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); } }