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
c01a1334-fe47-4c74-a1d7-b5ba7cc38cc3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-07-04 03:44:38", "repo_name": "atendrasuri/JavaDSAlgo", "sub_path": "/src/main/java/com/suri/java/concurrency/executorservice/customthreadpool/LinkedBlockingQueueCustom.java", "file_name": "LinkedBlockingQueueCustom.java", "file_ext": "java", "file_size_in_byte": 1062, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "78a0dfee1d2e6d51ec24282d3d56b9a7c6e2900d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/atendrasuri/JavaDSAlgo
258
FILENAME: LinkedBlockingQueueCustom.java
0.271252
package com.suri.java.concurrency.executorservice.customthreadpool; import java.util.LinkedList; import java.util.List; /** * @Author: atekumar * @Current-Version: 1.0.0 * @Creation-Date: 05/11/19 * @Description: (Overwrite) * 1. Please describe the business usage of the class. * 2. Please describe the technical usage of the class. * @History: */ public class LinkedBlockingQueueCustom<E> implements BlockingQueueCustom<E> { private List<E> queue; private int maxSize; public LinkedBlockingQueueCustom(int maxSize) { this.maxSize = maxSize; queue = new LinkedList<>(); } @Override public synchronized void put(E item) throws InterruptedException { while (queue.size() == maxSize) { this.wait(); } queue.add(item); this.notifyAll(); } @Override public synchronized E take() throws InterruptedException { while (queue.size() == 0) { this.wait(); } this.notifyAll(); return queue.remove(0); } @Override public synchronized int size() { return queue.size(); } }
af283bea-ce97-49f8-8fda-2b4ea4fd0d2f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-28 21:44:49", "repo_name": "Eduardojvr/lojaGeekZone", "sub_path": "/geekZone/src/main/java/com/geekzone/dao/ConnectionManager.java", "file_name": "ConnectionManager.java", "file_ext": "java", "file_size_in_byte": 1078, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "a24f912d151ee6ca98ae0c0f9121dd6afbcb5114", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/Eduardojvr/lojaGeekZone
226
FILENAME: ConnectionManager.java
0.268941
package com.geekzone.dao; import java.io.Serializable; import java.sql.Connection; import java.sql.DriverManager; public class ConnectionManager implements Serializable { private static final long serialVersionUID = 1L; private static final String DB_DRIVER = "com.mysql.cj.jdbc.Driver"; /* * * ######## BANCO LOCAL ######################################################### * * */ private static final String DB_CONNECTION = "jdbc:mysql://localhost:3306/loja?serverTimezone=America/Sao_Paulo&allowPublicKeyRetrieval=true&useSSL=false"; private static final String DB_USER = "loja"; private static final String DB_PASSWORD = "loja"; Connection dbConnection = null; public static Connection getDBConnection() throws Exception { return getDBConnection(DB_CONNECTION, DB_USER, DB_PASSWORD); } public static Connection getDBConnection(String conn, String user, String pass) throws Exception { Connection dbConnection = null; Class.forName(DB_DRIVER); dbConnection = DriverManager.getConnection(conn, user, pass); return dbConnection; } }
32be0344-fd85-40e5-a390-3d2efd08c80b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-03-19T07:54:53", "repo_name": "berc/nodejs-angular-starterkit", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1016, "line_count": 48, "lang": "en", "doc_type": "text", "blob_id": "1622fd6793bf394cb76729fe61f63482ff60f290", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/berc/nodejs-angular-starterkit
263
FILENAME: README.md
0.243642
download NodeJS + Angular starter kit ```bash git clone https://github.com/berc/nodejs-angular-starterkit.git ``` cd to the starter kit directory ```bash cd nodejs-angular-starterkit ``` install all dependencies ```bash npm install ``` cd to the server directory ```bash cd server ``` install node with monitoring of source files ```bash npm install -g nodemon ``` from server folder for running live reload environment ```bash nodemon ./bin/www.js ``` go to the http://localhost:4300/ in your browser for Angular 2 + Redux integration is needed additional step in 'nodejs-angular-starterkit' folder ```bash npm start ``` go to the http://localhost:3000/ in your browser for continuous ts development you can run in 'server' folder ```bash tsc -w **/*.ts ``` Based on @angularclass/angular2-webpack-starter + NodeJS Express with TypeScript Please note that Angular2 + Redux integration is working on localhost:3000 and server side rendering is working on localhost:4300 address. --- Rastislav Bertusek ---
dd6c324d-47c3-4456-9a37-75959e3a2a1b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-18 12:58:13", "repo_name": "shaikhistekhar/Maven_Omlete", "sub_path": "/src/main/java/com/ebay/pages/ProductDescription.java", "file_name": "ProductDescription.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "794cfbec34c156e55ae3a596c96c96a22c6184c0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/shaikhistekhar/Maven_Omlete
217
FILENAME: ProductDescription.java
0.272799
package com.ebay.pages; import java.util.Iterator; import java.util.Set; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class ProductDescription { WebDriver driver; @FindBy(id = "subCat2") private WebElement productDescription; @FindBy(linkText = "Tell us what you think") private WebElement feedbackLink; public ProductDescription(WebDriver driver) { this.driver = driver; PageFactory.initElements(driver, this); } public boolean clickProductDescriptionLink() { productDescription.click(); return true; } public boolean clickTellUsWhatYouThinkLink() { feedbackLink.click(); Set<String> strIds = driver.getWindowHandles(); Iterator<String> itr = strIds.iterator(); String mainWindow = itr.next(); String childWindow = itr.next(); driver.switchTo().window(childWindow); System.out.println("Survey URL: " + driver.getCurrentUrl()); return true; } }
bb99d3f3-1ff0-40d8-bde5-40dc6db1177f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-23 11:41:21", "repo_name": "kotlarchik/AutosalonBik", "sub_path": "/src/main/java/kotlarchik/model/Employee.java", "file_name": "Employee.java", "file_ext": "java", "file_size_in_byte": 1056, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "e2ad49f4ca24057d91bdfa604909a02428257e37", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/kotlarchik/AutosalonBik
224
FILENAME: Employee.java
0.278257
package kotlarchik.model; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.*; import java.util.Set; @Entity @Getter @Setter @NoArgsConstructor @Table public class Employee { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @Column(name = "name") private String name; @Column(name = "lastName") private String lastName; @Column(name = "patronymic") private String patronymic; @Column(name = "numberService") private int numberService; @OneToMany(mappedBy = "employee", fetch = FetchType.EAGER) private Set<Contract> contractSet; @ManyToOne @JoinColumn(name = "dealer_id") private Dealer dealer; @Override public String toString() { return "Employee{" + "id=" + id + ", name='" + name + '\'' + ", lastName='" + lastName + '\'' + ", patronymic='" + patronymic + '\'' + ", numberService=" + numberService; } }
20bdf581-3d2d-43fb-9635-6e268cea33c7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-24 12:05:20", "repo_name": "lolianer/javapro", "sub_path": "/src/com/neuedu/bean/Test2.java", "file_name": "Test2.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "8fb68562e178c656cbbdb0e3df7b46adc74d58fb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lolianer/javapro
222
FILENAME: Test2.java
0.27513
package com.neuedu.bean; import java.io.*; public class Test2 { public static void main(String[] args) { File from = new File("E:\\qq音乐\\QQMusic_YQQMusicHallList.exe"); File parent = new File("E:/a"); File to = new File("E:/a/QQMusic_YQQMusicHallList.exe"); if (!parent.exists()) parent.mkdir(); if (!to.exists()) { try { to.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } InputStream is = null; OutputStream os = null; try { is = new FileInputStream(from); os = new FileOutputStream(to); byte[] b = new byte[1024]; int a = is.read(b); while (a!=-1){ os.write(b,0,a); a = is.read(b); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
696e4245-2472-4b23-a446-11ab5fa73c1e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-08 16:10:04", "repo_name": "Kinuk97/PickMI", "sub_path": "/src/controller/Board/CompBoard/CompBoardWriteController.java", "file_name": "CompBoardWriteController.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "7e0a4a4dd8353ae221f79a5f981fee78334e0c06", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Kinuk97/PickMI
194
FILENAME: CompBoardWriteController.java
0.287768
package controller.Board.CompBoard; import java.io.IOException; 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 serivce.face.CompBoardService; import serivce.face.FileService; import serivce.impl.CompBoardServiceImpl; import serivce.impl.FileServiceImpl; @WebServlet("/compBoard/write") public class CompBoardWriteController extends HttpServlet { private FileService fileService = FileServiceImpl.getInstance(); @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.getRequestDispatcher("/WEB-INF/views/board/compBoard/write.jsp").forward(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.setCharacterEncoding("UTF-8"); fileService.writeBoard(req, 4); resp.sendRedirect("/compBoard/list"); } }
b0c4841b-f671-42bc-b685-cfb429bc8f61
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-16 09:11:03", "repo_name": "WPZC/nydp", "sub_path": "/src/main/java/com/example/nydp/service/impl/TerminalServiceImpl.java", "file_name": "TerminalServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "d85110626c81e252c9cf192f13f0d921f77b573c", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/WPZC/nydp
238
FILENAME: TerminalServiceImpl.java
0.286169
package com.example.nydp.service.impl; import com.example.nydp.dao.TerminalInfoDao; import com.example.nydp.entity.TerminalInfo; import com.example.nydp.mapper.TerminalInfoMapper; import com.example.nydp.service.TerminalService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class TerminalServiceImpl implements TerminalService { @Autowired TerminalInfoDao dao; @Autowired TerminalInfoMapper mapper; @Override public List<TerminalInfo> getlist() { return dao.list(); } @Override public int selectEqui(String sbid) { return dao.selectOneTerminalInfo(sbid); } @Override public TerminalInfo selectTerminalInfo(String sbid) { return dao.selectTerminalInfo(sbid); } @Override public TerminalInfo selectTerminalInfoSbid(String sbid) { return dao.selectTerminalInfoSbid(sbid); } @Override public int updateTerminalState(String state, String sbid) { return dao.updateTerminalState(state,sbid); } }
b84c46ab-22cc-48d8-ae8b-6718ef9ac8ab
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-02-15T18:43:01", "repo_name": "jonesca/Development", "sub_path": "/CSS/Responsive Web with BS3/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1038, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "81593ac15568505f8fed6ff8cab8c0387b0d221b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jonesca/Development
250
FILENAME: readme.md
0.214691
# Responsive Websites with Bootstrap 3 Mark Zamoyta www.curiousinvention.com mark@curiousinventions.com **Responsive** a single website that responds to the size of the users viewport **github.com/Formstone/Wallpaper** to add Video Wallpaper to our page **fortawesome.github.io/font-awesome/icons** for special / cool icons like the scroll down arrow ## Smooth Scrolling * In Google search for jQuery easing plugin * Look for gsgd plugin * Used jQuery Easing Plugin: http://gsgd.co.uk/sandbox/jquery/easing * jQuery's animate() function, setting scrollTop property ![Smooth Scrolling](./images/Smoothscrolling.jpg) ## Parallax Scrolling * When the background appears to scroll slowers than the foreground * Stellar.js * http://markdalgleish.com/projects/stellar.js ## Animation * Bootstrap's carousel component * An image gallery: **nanoGallery** * http://mynameismathieu.com/WOW for **WOW.js** coupled with **Animate.css** http://daneden.github.io/animate.css ### **Bear Grylls website is one of the coolest I've ever seen.**
7e599b60-14ea-496d-9508-75fc74507efd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-05 15:13:54", "repo_name": "MohamedSabbah/Android-apps-", "sub_path": "/Subscriptly/app/src/main/java/com/subscripty/sab/subscriptly/CountryActivity.java", "file_name": "CountryActivity.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "5ea312bd166951cec6c563fd1de54e6379a91bca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MohamedSabbah/Android-apps-
203
FILENAME: CountryActivity.java
0.245085
package com.subscripty.sab.subscriptly; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.Spinner; import java.util.ArrayList; public class CountryActivity extends AppCompatActivity { Spinner spinner; ArrayList<String> arrCountry; ArrayAdapter<String> arrayAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_country); spinner = findViewById(R.id.spiner); arrCountry = new ArrayList<>(); arrCountry.add("Select Country:"); arrCountry.add("Egypt"); arrCountry.add("USA"); arrCountry.add("England"); arrCountry.add("Germany"); arrCountry.add("Italy"); arrCountry.add("France"); arrCountry.add("Spain"); spinner.setPrompt("Select Country"); arrayAdapter = new ArrayAdapter<String>(CountryActivity.this , R.layout.row , arrCountry); spinner.setAdapter(arrayAdapter); spinner.setSelection(0); } }
038cb319-0716-4f85-ba93-9e90d8798fb0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-21 21:06:14", "repo_name": "victorvbello/android-androidchat", "sub_path": "/app/src/main/java/com/example/victorbello/androidchat/entities/ChatMessage.java", "file_name": "ChatMessage.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "eaf009b5f515a24b720058ba7509db979a61fe61", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/victorvbello/android-androidchat
237
FILENAME: ChatMessage.java
0.253861
package com.example.victorbello.androidchat.entities; /** * Created by ragnarok on 11/07/16. */ import com.google.firebase.database.Exclude; public class ChatMessage { private String msg; private String sender; @Exclude private boolean sentByMe; public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public String getSender() { return sender; } public void setSender(String sender) { this.sender = sender; } public boolean isSentByMe() { return sentByMe; } public void setSentByMe(boolean sentByMe) { this.sentByMe = sentByMe; } @Override public boolean equals(Object obj){ boolean equal=false; if(obj instanceof ChatMessage){ ChatMessage msg=(ChatMessage) obj; equal=this.msg.equals(msg.getMsg()) && this.sender.equals(msg.getSender())&& this.sentByMe==msg.sentByMe; } return equal; } }
f322f9cf-c390-4796-8aaf-73992caedf86
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-19 15:44:47", "repo_name": "a-wushie/ConsumingREST", "sub_path": "/src/main/java/com/adaidam/ConsumingREST/ConsumingRestApplication.java", "file_name": "ConsumingRestApplication.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "99c16008b1fb969956ce4d3b9460ab105f40b343", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/a-wushie/ConsumingREST
240
FILENAME: ConsumingRestApplication.java
0.262842
package com.adaidam.ConsumingREST; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.annotation.Bean; import org.springframework.web.client.RestTemplate; @SpringBootApplication public class ConsumingRestApplication { private static final Logger log = LoggerFactory.getLogger(ConsumingRestApplication.class); public static void main(String[] args) { SpringApplication.run(ConsumingRestApplication.class, args); } @Bean public RestTemplate restTemplate(RestTemplateBuilder builder) { return builder.build(); } @Bean public CommandLineRunner run(RestTemplate restTemplate) throws Exception { return args -> { Book book = restTemplate.getForObject( "https://api.nytimes.com/svc/books/v3/reviews.json?author=Akwaeke+Emezi&api-key=RlEPIEteL080D8F16mU6tzScoNWjB8Vr", Book.class); log.info(book.toString()); }; } }
af25a616-f05c-4ea5-aec0-66449da35827
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-03 10:25:56", "repo_name": "choiungsik/MessageSystem", "sub_path": "/src/com/controller/MessageServiceCon.java", "file_name": "MessageServiceCon.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "fb1f213e12ba566230811715a33f27a0af03ca16", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UHC"}
https://github.com/choiungsik/MessageSystem
208
FILENAME: MessageServiceCon.java
0.23092
package com.controller; import java.io.IOException; 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.model.memberDTO; import com.model.messageDAO; import com.model.messageDTO; @WebServlet("/MessageServiceCon") public class MessageServiceCon extends HttpServlet { protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("EUC-KR"); String send = request.getParameter("send"); String re = request.getParameter("receive"); String me = request.getParameter("message"); messageDTO dto = new messageDTO(send, re, me); messageDAO dao = new messageDAO(); int cnt = dao.send(dto); if (cnt >0) { System.out.println("메세지 전송성공"); } else { System.out.println("메세지 전송실패"); } response.sendRedirect("main.jsp"); } }
8ea00780-f688-4a17-b1a1-94560d5c5d0a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-16T11:44:02", "repo_name": "absinthe-graphql/absinthe", "sub_path": "/guides/tutorial/start.md", "file_name": "start.md", "file_ext": "md", "file_size_in_byte": 1012, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "f3e7a0090929fe57d2b56d6436c855ce74be6e11", "star_events_count": 4401, "fork_events_count": 625, "src_encoding": "UTF-8"}
https://github.com/absinthe-graphql/absinthe
259
FILENAME: start.md
0.191933
# Getting Started We'll be building a very basic GraphQL API for a blog, written in Elixir using Absinthe. ## Background Before you start, it's a good idea to have some background into GraphQL in general. Here are a few resources that might be helpful: - The official [GraphQL](https://graphql.org/) website - [How to GraphQL](https://www.howtographql.com/) (this includes another [brief tutorial](https://www.howtographql.com/graphql-elixir/0-introduction/) using Absinthe) ## The Example The tutorial expects you to have a properly set-up [Phoenix application](https://hexdocs.pm/phoenix/installation.html) with [absinthe](https://hex.pm/packages/absinthe) and [absinthe_plug](https://hex.pm/packages/absinthe_plug) added to the dependencies. > If you'd like to cheat, you can find the finished code for the tutorial > in the [Absinthe Example](https://github.com/absinthe-graphql/absinthe_tutorial) > project on GitHub. ## First Step Let's get started with [our first query](our-first-query.md)!
08f707c2-2d18-41b8-a904-604467215873
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-30 03:16:38", "repo_name": "SirSparksAlot401/Computer-Theory-338", "sub_path": "/src/com/company/game/Prone.java", "file_name": "Prone.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "3447045ffedf6556e0713291444985514793e937", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SirSparksAlot401/Computer-Theory-338
237
FILENAME: Prone.java
0.280616
package com.company.game; //Prone state public class Prone implements GameState { private GameLogic game; //Setting up the GameLogic object. public Prone(GameLogic g){ game = g; } //Moving left from prone. @Override public void moveLeft() { System.out.println("Standing."); game.setState(game.getStanding()); } //Moving right from prone. @Override public void moveRight() { System.out.println("Standing."); game.setState(game.getStanding()); } //Jumping from prone. @Override public void jump(){ System.out.println("Standing up."); game.setState(game.getStanding()); } //Handling the fireball game action while in prone state. @Override public void fireBall(){ System.out.println("Dodged fireball, remaining on ground."); game.setState(game.getProne()); } //Handling the gravity game action while in prone state. @Override public void gravity(){ System.out.println("Staying on ground."); game.setState(game.getProne()); } }
e7c46fb1-67a5-47f2-974d-62a8f8ec0965
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-30 16:08:56", "repo_name": "domhoff/design_pattern", "sub_path": "/src/study/com/imooc/week_6th_7th/Cat.java", "file_name": "Cat.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "aa67928a722c2450ccce8662e182d4a5ba73ba30", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/domhoff/design_pattern
279
FILENAME: Cat.java
0.267408
package com.imooc.week_6th_7th; /** * @version 1.0 * @author: dell-6530 * @date: 2021/1/2 * @description: * * Cat拷贝自: week_5th\set\Cat.java * 第6-7周,第1节,3-3 */ public class Cat { private String name; private int month; private String species; //构造方法 public Cat(String name, int month, String species) { this.name = name; this.month = month; this.species = species; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getMonth() { return month; } public void setMonth(int month) { this.month = month; } public String getSpecies() { return species; } public void setSpecies(String species) { this.species = species; } @Override public String toString() { return "[" + "名字:" + name +" ," + "年齡:" + month + " ," + "品种:" + species + "]"; } }
68cec4a4-f858-439e-bd17-92479bf0ea5f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-03 19:36:00", "repo_name": "halimbimantara/kemenkes-emova", "sub_path": "/app/src/main/java/com/emovakemenkes/framework/mvvm/data/model/api/emova/main/login/LoginRequestEmova.java", "file_name": "LoginRequestEmova.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "6cb1f1e9f57cf95041ec6b46682fac16abef675b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/halimbimantara/kemenkes-emova
215
FILENAME: LoginRequestEmova.java
0.206894
package com.emovakemenkes.framework.mvvm.data.model.api.emova.main.login; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public final class LoginRequestEmova { @Expose @SerializedName("username") private String Username; @Expose @SerializedName("password") private String Password; @Expose @SerializedName("firebaseid") private String FirebaseID; public LoginRequestEmova(String username, String password, String firebaseID) { Username = username; Password = password; FirebaseID = firebaseID; } public String getUsername() { return Username; } public void setUsername(String username) { Username = username; } public String getPassword() { return Password; } public void setPassword(String password) { this.Password = password; } public String getFirebaseID() { return FirebaseID; } public void setFirebaseID(String firebaseID) { FirebaseID = firebaseID; } }
081944e9-8a46-4b34-90a6-0c00a51f7103
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-08 07:03:32", "repo_name": "charliezqj/springboot-learning", "sub_path": "/src/main/java/com/example/demo/service/impl/UserServiceImpl.java", "file_name": "UserServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "9d22d707c08ebdad9196322f229ebd00a3d2ab99", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/charliezqj/springboot-learning
197
FILENAME: UserServiceImpl.java
0.245085
package com.example.demo.service.impl; import com.example.demo.domain.User; import com.example.demo.domain.UserRepository; import com.example.demo.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * Created by Administrator on 2018/8/5. */ @Service public class UserServiceImpl implements UserService { @Autowired UserRepository userRepository; @Override public List<User> findAll() { return userRepository.findAll(); } @Override public User insertByUser(User user) { return userRepository.save(user); } @Override public User update(User user) { return userRepository.save(user); } @Override public User delete(Long id) { User user = this.findById(id); userRepository.delete(user); return user; } @Override public User findById(Long id) { return userRepository.findById(id).get(); } }
70899b2b-575e-45b1-955e-a6a8b017985d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-08-28 03:59:24", "repo_name": "larrybriup/JDBC", "sub_path": "/src/com/briup/test/DriverTest1.java", "file_name": "DriverTest1.java", "file_ext": "java", "file_size_in_byte": 1377, "line_count": 58, "lang": "zh", "doc_type": "code", "blob_id": "ca955bab74c74164f093137f885b425083d6ae55", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/larrybriup/JDBC
355
FILENAME: DriverTest1.java
0.271252
package com.briup.test; import java.sql.Connection; import java.sql.DriverManager; public class DriverTest1 { public static void main(String[] args) { // 连接数据库必须要有的String字符串信息 // driver标明要连接的是哪一种数据库dbms // 驱动类的全包名加类名 // String driver = "oracle.jdbc.driver.OracleDriver"; // // // 标明要连接的是哪一个数据库实例(地址) // String url = "jdbc:oracle:thin:@localhost:1521:XE"; // // // // String username = "king"; // // // // String password = "king999"; String driver = "com.mysql.jdbc.Driver"; // 标明要连接的是哪一个数据库实例(地址) String url = "jdbc:mysql://localhost:3306/test"; // String username = "test"; // String password = "test"; try { // 1注册驱动 Class.forName(driver).newInstance(); // 2获得数据库连接对象Connection Connection conn = DriverManager.getConnection(url, username, password); System.out.println("conn=" + conn); // 3获得statement接口对象 // 4执行sql语句\ // 5如果是查询语句还要接受并处理得到的结果集resultSet // 6关闭之前打开的各种资源对象 if (conn != null) conn.close(); } catch (Exception e) { e.printStackTrace(); } finally { } } }
c10568ff-f265-4f6d-874b-d3456b07f762
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-20 06:23:35", "repo_name": "lancempoe/BikeFunClient", "sub_path": "/gwt/src/main/java/com/bikefunfinder/client/shared/model/printer/UserJSOWrapper.java", "file_name": "UserJSOWrapper.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "05c725882d0ab07e6e2e9fec5618c0023242e40d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lancempoe/BikeFunClient
262
FILENAME: UserJSOWrapper.java
0.255344
package com.bikefunfinder.client.shared.model.printer; /* * @author: tneuwerth * @created 4/25/13 6:53 PM */ import com.bikefunfinder.client.shared.model.User; public class UserJSOWrapper implements DescribeableAsString<User> { @Override public String describeAsString(User jsoObject) { final String id = (jsoObject==null) ? "null" :jsoObject.getId(); final String userName = (jsoObject==null) ? "null" :jsoObject.getUserName(); final String email = (jsoObject==null) ? "null" :jsoObject.getEmail(); final String describe = (jsoObject==null) ? "null" :JSODescriber.describe(jsoObject.getOAuth()); final String describe1 = (jsoObject==null) ? "null" :JSODescriber.describe(jsoObject.getDeviceAccount()); return "User("+ "id: " + id + "userName: " + userName + "email: " + email + "oAuth: " + describe + "deviceAccount: " + describe1 + ")"; } }
b5635cd4-0088-4604-810b-2424a6f76673
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-24 00:29:33", "repo_name": "Aminacait1/Microtesting", "sub_path": "/OrangeHRM/src/test/java/Microtesting/OrangeHRM/Connexion.java", "file_name": "Connexion.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "f538a1e7ccb9085959decf0840e0d5733b675283", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Aminacait1/Microtesting
229
FILENAME: Connexion.java
0.23793
package Microtesting.OrangeHRM; import java.util.concurrent.TimeUnit; import org.testng.annotations.*; import org.openqa.selenium.*; import org.openqa.selenium.chrome.ChromeDriver; public class Connexion { private WebDriver driver; public void setUp() throws Exception { System.setProperty("webdriver.chrome.driver", "C:\\webdrivers\\chromedriver.exe"); driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);} public void testConnexion() throws Exception { driver.get("http://127.0.0.1/orangehrm-4.3.5/symfony/web/index.php/auth/login"); driver.findElement(By.id("divLogo")).click(); driver.findElement(By.id("txtUsername")).click(); driver.findElement(By.name("txtUsername")).sendKeys("admin"); driver.findElement(By.name("txtPassword")).click(); driver.findElement(By.name("txtPassword")).sendKeys("Aminafaiz99@"); driver.findElement(By.id("btnLogin")).click(); } }
c63a997d-8a97-4938-8305-cc6ed8fecee4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-10-09T15:57:38", "repo_name": "rajkrisfive/ockeydockey_backend", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1003, "line_count": 48, "lang": "en", "doc_type": "text", "blob_id": "594d7a2dec8e5d70d9d27bca5c4f24622911593e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rajkrisfive/ockeydockey_backend
245
FILENAME: README.md
0.255344
# ockydocky_frontend > Backend end for ocky_docky ## Build Setup ``` bash # clone the repo git clone # create virtualenv virtualenv -p python3 env # activate the env source path/to/env/bin/activate # navigate to root folder and install dependencies, make sure vitualenv is activated # as shown in previous step pip install -r requirements.txt # run migrations python manage.py migrate # create superuser, use it to login to admin dashboard python manage.py createsuperuser # run fixtures to load default data python manage.py loadddata category python manage.py loaddata products python manage.py loaddata sub_category # run the server, in port 8000 python manage.py runserver ``` ## API Details ###Sub Category http://localhost:8000/products/sub-category-list/ ### Category API http://localhost:8000/products/category-list/ ### Product API http://localhost:8000/products/product-list-create/ ######Check the above API's in the browser to check out the filter and ordering options.
45e2722c-045c-4732-b021-5a861bb9b2d2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-06 19:14:45", "repo_name": "ep429/Morning-minion", "sub_path": "/app/src/main/java/com/example/bill/googleoauthandroidcapturecallback/OAuthWebViewClient.java", "file_name": "OAuthWebViewClient.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "bc322e2e2fff49c31070d90215c1a221c8b4b25c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ep429/Morning-minion
221
FILENAME: OAuthWebViewClient.java
0.240775
package com.example.bill.googleoauthandroidcapturecallback; import android.net.Uri; import android.util.Log; import android.webkit.WebView; import android.webkit.WebViewClient; /** * Created by bill on 3/22/15. */ public class OAuthWebViewClient extends WebViewClient { private MainActivity parent; public OAuthWebViewClient(MainActivity _parent) { super(); parent = _parent; } @Override public boolean shouldOverrideUrlLoading (final WebView view, String url) { Log.d("MONGAN", url); if(url.contains("localhost") && url.contains("code") && !url.contains("accounts")) { Log.d("MONGAN", "LOCALHOST"); Uri uri = Uri.parse(url); String code = uri.getQueryParameter("code"); Log.d("MONGAN", "code=" + code); parent.onOAuthAuthorization(code); return true; // override and handle the URL ourselves } else { return false; // let the webview handle the request } } }
083bf342-4b6a-4c3f-93be-bc62daa2bb9e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-13 02:15:46", "repo_name": "hawkWei07/study-opengl", "sub_path": "/StudyOpenGL/lessonfive/src/main/java/cn/hawk/lessonfive/LessonFiveGLSurfaceView.java", "file_name": "LessonFiveGLSurfaceView.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "2c5b478d78f75a1bc884cbf0eae9dd4756860b24", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hawkWei07/study-opengl
198
FILENAME: LessonFiveGLSurfaceView.java
0.256832
package cn.hawk.lessonfive; import android.content.Context; import android.opengl.GLSurfaceView; import android.view.MotionEvent; /** * Created by kehaowei on 16/9/28. */ public class LessonFiveGLSurfaceView extends GLSurfaceView { private LessonFiveRenderer mRenderer; public LessonFiveGLSurfaceView(Context context) { super(context); } @Override public boolean onTouchEvent(MotionEvent event) { if (event != null) { if (event.getAction() == MotionEvent.ACTION_DOWN) { if (null != mRenderer) { queueEvent(new Runnable() { @Override public void run() { mRenderer.switchMode(); } }); return true; } } } return super.onTouchEvent(event); } public void setRenderer(LessonFiveRenderer renderer) { mRenderer = renderer; super.setRenderer(renderer); } }
34c603ae-08c5-413e-9680-70078e008bb9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-07-10 20:46:07", "repo_name": "canemacchina/gdg-firenze-fiera-elettronica-2014-cecina", "sub_path": "/gae-java-python-go-php/website/website-war/src/main/java/it/aqquadro/webapp/IndexResource.java", "file_name": "IndexResource.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "fec3291582f3c429d5a77cfba36eca33abc1fdbc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/canemacchina/gdg-firenze-fiera-elettronica-2014-cecina
246
FILENAME: IndexResource.java
0.290981
package it.aqquadro.webapp; import java.util.HashMap; import java.util.Map; import java.util.Random; import java.util.logging.Logger; import javax.validation.constraints.NotNull; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; import org.glassfish.jersey.server.mvc.Template; @Path("/noscript") public class IndexResource { private final static Logger LOGGER = Logger.getLogger(IndexResource.class .getName()); @NotNull @Context private UriInfo uriInfo; @GET @Produces("text/html") @Template(name = "/index") public Map<String, Object> get() throws InterruptedException { LOGGER.info("IndexResource.get()"); Map<String, Object> model = new HashMap<String, Object>(); int sleepThisMillisec = new Random().nextInt(3000); Thread.sleep(sleepThisMillisec); model.put("msg", "Great! " + new Random().nextGaussian()); model.put("sleep", "Sleep for " + sleepThisMillisec + "ms"); return model; } }
fe2db685-c6b1-428a-830c-4c04735718fb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-08 09:50:00", "repo_name": "XueBaoPeng/OpenSource", "sub_path": "/app/src/main/java/com/ouyangzn/github/utils/CommonUtil.java", "file_name": "CommonUtil.java", "file_ext": "java", "file_size_in_byte": 497, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "b97a0a16b3e77617dfe80425ce07e6ee4788d720", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/XueBaoPeng/OpenSource
260
FILENAME: CommonUtil.java
0.253861
/* * Copyright (c) 2016. ouyangzn <email : ouyangzn@163.com> * Licensed 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 com.ouyangzn.github.utils; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; /** * Created by ouyangzn on 2016/9/30.<br/> * Description: */ public class CommonUtil { public static void copy(Context context, String content) { ClipboardManager clip = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); ClipData data = ClipData.newPlainText(content, content); clip.setPrimaryClip(data); } }
f1f230ee-2629-4c6d-9ff3-3c8341802a97
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-14 13:26:51", "repo_name": "firedevelop/id0000115-java-examples", "sub_path": "/src/Exercise_Proposed_03_04.java", "file_name": "Exercise_Proposed_03_04.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "341aa9aceccd438927e4e00fd2ba9390b31003ca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/firedevelop/id0000115-java-examples
220
FILENAME: Exercise_Proposed_03_04.java
0.278257
import java.util.ArrayList; import java.util.Locale; import java.util.Scanner; public class Exercise_Proposed_03_04 { public static void main(String[] args) { int totalInt,e = 0,numberDiff,num; double total = 0; Scanner scan = new Scanner(System.in); scan = scan.useLocale(Locale.US); num = scan.nextInt(); for (int i = 1; i <= num; i++) { total = Math.pow(i, 2); if(total <=num) { totalInt=(int) total; ArrayList<Integer> list = new ArrayList<Integer>(); list.add(totalInt); Integer[] nums = list.toArray(new Integer[0]); e = list.get(list.size() -1); for(int j=0; j<nums.length; j++){ System.out.println(nums[j]); } } } numberDiff = num-e; System.out.println("Result " + e + " the module is: " + numberDiff); } }
a460d344-64fb-42ca-84cb-af045cf09d5d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-23 12:08:49", "repo_name": "LXiong/hermes", "sub_path": "/hermes-api/src/main/java/pl/allegro/tech/hermes/api/SchemaSource.java", "file_name": "SchemaSource.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "a60738ae579fd1d8777fda61e234d7af830b4c08", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LXiong/hermes
211
FILENAME: SchemaSource.java
0.218669
package pl.allegro.tech.hermes.api; import java.util.Objects; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Strings.emptyToNull; public final class SchemaSource { private final String value; private SchemaSource(String value) { this.value = checkNotNull(emptyToNull(value)); } public static SchemaSource valueOf(String schemaSource) { return new SchemaSource(schemaSource); } public String value() { return value; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SchemaSource that = (SchemaSource) o; return value.equals(that.value); } @Override public int hashCode() { return Objects.hashCode(value); } @Override public String toString() { return "SchemaSource(" + value + ")"; } }
60fff4cc-a5a6-4e10-acdc-e515f352b9bf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-11 04:17:09", "repo_name": "LucasDev13/orange-talents-06-template-proposta", "sub_path": "/src/main/java/br/com/proposta/controller/request/CardRequest.java", "file_name": "CardRequest.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "c2243fd0073dbc3e45641b7cd5246650b492d667", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LucasDev13/orange-talents-06-template-proposta
226
FILENAME: CardRequest.java
0.193147
package br.com.proposta.controller.request; import br.com.proposta.card.Card; import br.com.proposta.card.Status; import javax.validation.constraints.NotBlank; public class CardRequest { @NotBlank private String idCard; @NotBlank private String ipClient; @NotBlank private String userAgent; private Status status; public CardRequest(String idCard, String ipClient, String userAgent, Status status) { this.idCard = idCard; this.ipClient = ipClient; this.userAgent = userAgent; this.status = status; } public String getIdCard() { return idCard; } public String getIpClient() { return ipClient; } public String getUserAgent() { return userAgent; } public Status getStatus() { return status; } @Override public String toString() { return "CardRequest{" + "idCard='" + idCard + '\'' + ", ipClient='" + ipClient + '\'' + ", userAgent='" + userAgent + '\'' + '}'; } }
e74590b6-b39c-436d-96f3-3e664059a005
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-27 22:26:03", "repo_name": "leandrogonqn/Proyecto2017Seguros", "sub_path": "/dom/src/main/java/com/pacinetes/dom/cliente/Sexo.java", "file_name": "Sexo.java", "file_ext": "java", "file_size_in_byte": 298, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "b3e5745eaf94dd9e812f9b89a513f2c09a68d85d", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/leandrogonqn/Proyecto2017Seguros
220
FILENAME: Sexo.java
0.214691
/******************************************************************************* * Copyright 2017 SiGeSe * * Licensed 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 com.pacinetes.dom.cliente; public enum Sexo { Masculino("Masculino"), Femenino("Femenino"); private final String nombre; public String getNombre() { return nombre; } private Sexo(String nom) { nombre = nom; } @Override public String toString() { return this.nombre; } }
c279009a-01fe-4122-b95a-23bcd4c11263
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-27 13:20:25", "repo_name": "arsalanshp/TebLiberary", "sub_path": "/app/src/main/java/library/tebyan/com/teblibrary/classes/Database/DatabaseHelper.java", "file_name": "DatabaseHelper.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "d0238332847134a3d43ea39e70c1d74f596b69fe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/arsalanshp/TebLiberary
189
FILENAME: DatabaseHelper.java
0.267408
package library.tebyan.com.teblibrary.classes.Database; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import library.tebyan.com.teblibrary.classes.Login.LoginDB; public class DatabaseHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "SNDB4"; private static final int DATABASE_VERSION = 2; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } // Method is called during creation of the database @Override public void onCreate(SQLiteDatabase database) { database.execSQL(LoginDB.TABLE_CREATE); } // Method is called during an upgrade of the database, @Override public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) { database.execSQL("DROP TABLE IF EXISTS " + LoginDB.TABLE); onCreate(database); } }
76c3ed7c-5daa-4c8b-b205-10d2b3d5dc79
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-10 08:07:19", "repo_name": "sh951118/java-study", "sub_path": "/network/src/main/java/chat/ChatClientThread.java", "file_name": "ChatClientThread.java", "file_ext": "java", "file_size_in_byte": 1143, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "407e2ee7bbd28015359270042848db692b6abadf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sh951118/java-study
259
FILENAME: ChatClientThread.java
0.290176
package chat; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; import java.net.SocketException; import java.util.List; public class ChatClientThread extends Thread { private Socket socket; List<PrintWriter> listWriters; public ChatClientThread(Socket socket, List<PrintWriter> listWriters) { this.socket = socket; this.listWriters = listWriters; } @Override public void run() { try { BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8")); while (true) { String data = bufferedreader.readLine(); if (data == null) { ChatServer.log("closed by server"); break; } ChatClient.log(data); } } catch(SocketException e) { ChatClient.log("클라이언트가 끝났습니다."); }catch (IOException e) { e.printStackTrace(); } finally { try { if (socket != null && !socket.isClosed()) { socket.close(); } } catch (IOException e) { e.printStackTrace(); } } } }
a2fdbfd2-acd4-456f-96a4-7e434be79a2a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-09 19:28:41", "repo_name": "SaumilP/design-patterns", "sub_path": "/proxy/src/main/java/design/patterns/proxy/BankAccount.java", "file_name": "BankAccount.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "3ca7842cb523b56b7c9ef00c7af260f7185dad30", "star_events_count": 5, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SaumilP/design-patterns
193
FILENAME: BankAccount.java
0.27513
package design.patterns.proxy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Class responsible for performing account specific operations */ public class BankAccount { private static final Logger log = LoggerFactory.getLogger(BankAccount.class); private double balance; public BankAccount(double balance) { this.balance = balance; } //OPERATIONS public void deposite(double depositAmount){ balance += depositAmount; String message = String.format(" >>> Amount[%.2f] deposited", depositAmount); log.debug(message); } public void withdraw(double withdrawalAmount){ balance -= withdrawalAmount; String message = String.format(" <<< Amount[%.2f] withdrawn", withdrawalAmount); log.debug(message); } // ACCESSORS public double getBalance() { return balance; } public void setBalance(double balance) { this.balance = balance; } }
96a95430-3098-469b-8eb4-fdd8a7a30735
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-04 09:18:11", "repo_name": "chenxsa/springbootdemo", "sub_path": "/src/main/java/com/xgstudio/springbootdemo/util/CopyObjectHelper.java", "file_name": "CopyObjectHelper.java", "file_ext": "java", "file_size_in_byte": 1104, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "b206c57e91aefa0eb9cf8415a164e6772d27af42", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/chenxsa/springbootdemo
221
FILENAME: CopyObjectHelper.java
0.221351
package com.xgstudio.springbootdemo.util; import com.fasterxml.jackson.annotation.JsonIgnore; import java.lang.reflect.Field; /** * 复制对象 */ public class CopyObjectHelper { /** * 将origin属性注入到destination中 * @param origin * @param destination * @throws Exception */ public static void mergeObject(Object origin, Object destination) throws Exception { if (origin == null || destination == null) { return; } if (!origin.getClass().equals(destination.getClass())) { return; } Field[] fields = origin.getClass().getDeclaredFields(); for (int i = 0; i < fields.length; i++) { JsonIgnore expose = fields[i].getAnnotation(JsonIgnore.class); if (expose == null) { fields[i].setAccessible(true); Object value = fields[i].get(origin); if (null != value) { fields[i].set(destination, value); } fields[i].setAccessible(false); } } } }
ea91c6ef-eec2-4831-a561-deda9ea857e2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-10 07:10:25", "repo_name": "Ninebrother/web-ssh", "sub_path": "/src/main/java/com/alon/ssh/service/SSHLogService.java", "file_name": "SSHLogService.java", "file_ext": "java", "file_size_in_byte": 1140, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "4874c9c66a30607bac43b7c656ad5abbb1f73148", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Ninebrother/web-ssh
259
FILENAME: SSHLogService.java
0.221351
package com.alon.ssh.service; import com.alibaba.fastjson.JSON; import com.alon.ssh.model.SSHLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.stereotype.Service; /** * Created by zhangyl on 2019/4/22 */ @Service public class SSHLogService implements ISSHLogService { public static final Logger logger=LoggerFactory.getLogger(SSHLogService.class); @Autowired private MongoTemplate mongoTemplate; @Override public int insertRecord(SSHLog sshLog) { mongoTemplate.insert(sshLog); if(logger.isInfoEnabled()){ logger.info("mongodb插入WebSSH记录:" + JSON.toJSONString(sshLog)); } return 1; } @Override public int insertCmd(SSHLog sshLog) { System.out.println("持久化Cmd:"+JSON.toJSON(sshLog).toString()); return 0; } @Override public int updateEnd(SSHLog sshLog) { System.out.println("退出刷新"+JSON.toJSON(sshLog).toString()); return 0; } }
8fa9e6b0-8c8a-4e8b-9fbf-005170f597be
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-04 13:03:14", "repo_name": "qianliok/spring-learning", "sub_path": "/chapter01/qli/BankApp/src/main/java/org/spring/bankapp/controller/HelloWorldController.java", "file_name": "HelloWorldController.java", "file_ext": "java", "file_size_in_byte": 1062, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "7d7c282b45a6fc53fd199bb523ed444bad09b88f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/qianliok/spring-learning
193
FILENAME: HelloWorldController.java
0.290981
package org.spring.bankapp.controller; import org.spring.bankapp.model.HelloWorldBean; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; @Controller public class HelloWorldController { @SuppressWarnings("resource") @RequestMapping("/hello") public ModelAndView showMessage( @RequestParam(value = "name", required = false, defaultValue = "World") String name) { // loading the definitions from the given XML file ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); HelloWorldBean helloWorld = (HelloWorldBean) context.getBean("HelloWorldBean"); ModelAndView mv = new ModelAndView("helloworld"); mv.addObject("message", helloWorld.getGreet()); mv.addObject("name", name); return mv; } }
8682e4a4-bd83-4e00-b13f-df9ce9bee609
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-26 19:28:30", "repo_name": "xuyanbo0123/TA_Auto", "sub_path": "/src/main/java/name/mi/buyer/revimedia/derivative/ReviRequestedPolicy.java", "file_name": "ReviRequestedPolicy.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "67d5388c27ce82176dd6c0d1dbdb899c5b6cb163", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/xuyanbo0123/TA_Auto
249
FILENAME: ReviRequestedPolicy.java
0.262842
package name.mi.buyer.revimedia.derivative; import name.mi.auto.model.AutoForm; import name.mi.buyer.revimedia.map.BodilyInjuryMap; import name.mi.buyer.revimedia.map.CoverageTypeMap; import name.mi.buyer.revimedia.map.PropertyDamageMap; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @XmlType(propOrder = {"coverageType", "bodilyInjury", "propertyDamage"}) public class ReviRequestedPolicy { AutoForm mAutoForm; public ReviRequestedPolicy() { } public ReviRequestedPolicy(AutoForm iAutoForm) { mAutoForm = iAutoForm; } @XmlElement(name = "CoverageType") String getCoverageType() { return CoverageTypeMap.valueOf(mAutoForm.getCoverageType()); } @XmlElement(name = "BodilyInjury") String getBodilyInjury() { return BodilyInjuryMap.valueOf(mAutoForm.getCoverageType()); } @XmlElement(name = "PropertyDamage") String getPropertyDamage() { return PropertyDamageMap.valueOf(mAutoForm.getCoverageType()); } }
ce03d16f-600c-459d-95b0-63ee6e2d19e6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-09 20:59:53", "repo_name": "harshab85/Ergo", "sub_path": "/app/src/main/java/uoftprojects/ergo/rewards/StickerReward.java", "file_name": "StickerReward.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "7ab4a5c508da1d0c3b34bf2968bdfb72ec39ecf9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/harshab85/Ergo
226
FILENAME: StickerReward.java
0.256832
package uoftprojects.ergo.rewards; /** * Created by harsha on 2015-04-04. */ public class StickerReward implements IReward { private int resourceId; private String name; public StickerReward(String name, int resourceId){ this.name = name; this.resourceId = resourceId; } @Override public RewardType getType() { return RewardType.Sticker; } @Override public String getName() { return this.name; } public int getResourceId(){ return this.resourceId; } @Override public boolean equals(Object o) { if(o instanceof StickerReward){ StickerReward stickerReward = (StickerReward)o; if(this.getName().equals(stickerReward.getName()) && this.getResourceId() == stickerReward.getResourceId()){ return true; } } return false; } @Override public int hashCode() { return 31 * this.getName().hashCode() * this.getResourceId(); } }
146d35cf-7982-49fb-9756-db08fc985c1a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-24 15:23:03", "repo_name": "m1dlace/Kursach", "sub_path": "/Flappy/core/src/com/flappygame/game/MenuState.java", "file_name": "MenuState.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "9c59538507fc4b2316a7c120989be45a0ca2e6f1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/m1dlace/Kursach
255
FILENAME: MenuState.java
0.275909
package com.flappygame.game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class MenuState extends State { private Texture background; private Texture playBtn; public MenuState(GameState gsm) { super(gsm); background = new Texture("back3.png"); playBtn = new Texture("Play2.png"); } @Override public void handleInput() { if (Gdx.input.justTouched()) { gsm.set(new PlayState(gsm)); } } @Override public void update(float dt) { handleInput(); } @Override public void render(SpriteBatch sb) { sb.begin(); sb.draw(background, 0, 0, FlappyGame.WIDTH, FlappyGame.HEIGHT); sb.draw(playBtn, (FlappyGame.WIDTH / 2) - (playBtn.getWidth() / 2), FlappyGame.HEIGHT / 2); sb.end(); } @Override public void dispose() { background.dispose(); playBtn.dispose(); System.out.println("MenuState Disposed"); } }
6fc4b173-0873-4d2d-8ea1-ffb4f6895ede
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-25 11:24:41", "repo_name": "phong9x/micimpact", "sub_path": "/src/main/java/com/app/micimpact/web/filter/CustomHttpServletRequestWrapper.java", "file_name": "CustomHttpServletRequestWrapper.java", "file_ext": "java", "file_size_in_byte": 1074, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "950d060b3541b007fb3b42fa954c957ce977e575", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/phong9x/micimpact
203
FILENAME: CustomHttpServletRequestWrapper.java
0.261331
package com.app.micimpact.web.filter; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import org.apache.commons.io.IOUtils; public class CustomHttpServletRequestWrapper extends HttpServletRequestWrapper{ private byte[] b; public CustomHttpServletRequestWrapper(HttpServletRequest request) throws IOException { super(request); InputStream is = super.getInputStream(); b = IOUtils.toByteArray(is); } @Override public ServletInputStream getInputStream() throws IOException { final ByteArrayInputStream bis = new ByteArrayInputStream(b); return new ServletImpl(bis); } class ServletImpl extends ServletInputStream { private InputStream is; public ServletImpl(InputStream bis) { is = bis; } @Override public int read() throws IOException { return is.read(); } @Override public int read(byte[] b) throws IOException { return is.read(b); } } }
7bf34c06-4354-4db1-9730-2e495797b264
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2012-08-03T12:19:26", "repo_name": "vshjxyz/django-compass-watches", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1119, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "da19448a93170a9fd9f43f8940e8a6a8260d44af", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/vshjxyz/django-compass-watches
244
FILENAME: README.md
0.23231
django-compass-watches ====================== This simple script that allows you to watch multiple compass directories inside a django project at the same time. Installation ---- 1. Place the `compass_watch.py` script in the root directory of your django project 2. `$ chmod +x compass_watch.py` to be able to execute it 3. Insert the `COMPASS_DIR` tuple inside the `settings.py` of your django project specifying the folders that you want to watch: <pre> # - This is just an example - COMPASS_DIRS = ( os.path.join(PROJECT_ROOT, 'apps/whatever/static/any/compass/project'), STATIC_ROOT + 'path/to/any/compass/project', ) </pre> Ensure yourself to have a config.rb file inside every folder that you want to watch Usage ---- Just run the script from your django project root with <pre> $ ./compass_watch.py </pre> and you will be able to modify every `.sass` or `.scss` inside your compass projects with real-time compiling in css. This allows you to have different target directories or configurations between multiple applications that use compass Requirements ---- * Django * Compass
954e1550-d57e-44bb-b617-e69ccea139c2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-29 06:53:26", "repo_name": "huangtingxiang/shareMusicApi", "sub_path": "/player/app/src/main/java/com/example/sharemusicplayer/httpService/MessageService.java", "file_name": "MessageService.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "775092ae2ea0403524a22fc219e0f5f53534cb22", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/huangtingxiang/shareMusicApi
233
FILENAME: MessageService.java
0.284576
package com.example.sharemusicplayer.httpService; import com.example.sharemusicplayer.config.BaseConfig; import com.example.sharemusicplayer.entity.Message; public class MessageService { public static MessageService messageService; public static MessageService getInstance() { if (messageService == null) { messageService = new MessageService(); } return messageService; } BaseHttpService httpService = BaseHttpService.getInstance(); /** * 创建消息 * * @param callBack * @param placeId * @param message */ public void createMessage(BaseHttpService.CallBack callBack, Long placeId, Message message) { httpService.put(BaseConfig.LOCAL_URL + "message/" + placeId, message, callBack, Message.class); } /** * 通过圈子id 获取消息 * @param callBack * @param placeId */ public void getMessageByPlace(BaseHttpService.CallBack callBack, Long placeId) { httpService.get(BaseConfig.LOCAL_URL + "message/" + placeId, callBack, Message[].class); } }
f3f79e75-d84a-4c0e-8b5d-91d2fdaf7b1a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-18 06:41:09", "repo_name": "ParkGwangSeok/board0318", "sub_path": "/src/main/java/com/example/service/JoinService.java", "file_name": "JoinService.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "6f2d2f991f480ec8b84be4d4d9f82aea56536cf3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ParkGwangSeok/board0318
203
FILENAME: JoinService.java
0.252384
package com.example.service; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import com.example.model.Users; import com.example.repository.UserRepository; @Service public class JoinService { // 알아서 객체주입 @Autowired private UserRepository userRepository; @Autowired private UserPasswordHash userPasswordHash; public String joinUser(String userId, String userPw, String userName) { if (userId.equals("") || userPw.equals("") || userName.equals("")) { return "index"; } System.out.println(userId); System.out.println(userName); System.out.println(userPw); Users users = new Users(); users.setUserid(userId); users.setUsername(userName); String hashpass = userPasswordHash.getSHA256(userPw); users.setPassword(hashpass); userRepository.save(users); return "index"; } }
cf4af20b-593f-43ac-b4ce-5e2a4dcc32ba
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-11 07:15:18", "repo_name": "RashSR/Yugioh", "sub_path": "/src/cards/spell/SpellCard.java", "file_name": "SpellCard.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "f6e698876c4a0f64c89e617de89c0130a24b6d22", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "ISO-8859-3"}
https://github.com/RashSR/Yugioh
294
FILENAME: SpellCard.java
0.292595
package cards.spell; import cards.Card; import cards.CardType; public class SpellCard extends Card{ /* * This class contains all functions to use and modify a Yu-Gi-Oh SpellCard */ private SpellType type; public SpellCard(String name, String type, String text) { super(name, text, CardType.SPELL); this.type = createType(type); } public SpellCard(String name, SpellType type, String text) { super(name, text, CardType.SPELL); this.type = type; } /* * Get the SpellType from the corresponding String */ private SpellType createType(String type) { switch (type) { case "Normal": return SpellType.NORMAL; case "Ritual": return SpellType.RITUAL; case "Ausrüstung": return SpellType.AUSRÜSTUNG; case "Permanent": return SpellType.PERMANENT; case "Feld": return SpellType.FELD; case "Schnell": return SpellType.SCHNELL; } return null; } public SpellType getSpellType() { return this.type; } @Override public String toString() { return getName() + " (type: " + type + ", text: " + getText() + ")"; } }
a750fdcf-4071-4b47-a3f9-19e898af1dcd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-22 16:23:55", "repo_name": "sgottsch/multiwiki", "sub_path": "/src/de/l3s/tfidf/ExternalLinkCollection.java", "file_name": "ExternalLinkCollection.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "8c3ffe02d74b61d2cddef60ca8301da8139efe75", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sgottsch/multiwiki
236
FILENAME: ExternalLinkCollection.java
0.277473
package de.l3s.tfidf; import java.util.HashSet; import org.apache.commons.lang3.StringUtils; import de.l3s.model.BinaryComparison; import de.l3s.model.Revision; import de.l3s.model.Sentence; import de.l3s.model.links.ExternalLink; public class ExternalLinkCollection extends TfIdfCollection implements Collection { public ExternalLinkCollection(BinaryComparison comparison, Revision revision1, Revision revision2) { super(comparison, revision1, revision2); } @Override String createTerms(Sentence annotation, Revision revision) { String linkText = ""; HashSet<String> externalLinkUris = new HashSet<String>(); for (ExternalLink dbl : annotation.getExternalLinks()) { externalLinkUris.add(dbl.getLink()); } linkText = StringUtils.join(externalLinkUris, (String) " "); annotation.setExternalLinksString(linkText); return linkText; } @Override String getTermName() { return "externalLinks"; } @Override CollectionType getCollectionType() { return CollectionType.ExternalLinkCollection; } }
175244d8-d0df-483f-895d-d6dec22441b6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-12-24 06:00:02", "repo_name": "palashjain/AgroStar_assessment", "sub_path": "/src/test/java/tests/ForkAndStarRepos.java", "file_name": "ForkAndStarRepos.java", "file_ext": "java", "file_size_in_byte": 1061, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "57ce530c2cba43684cf128f9cb09afc53b5b9647", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/palashjain/AgroStar_assessment
232
FILENAME: ForkAndStarRepos.java
0.294215
package tests; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import commonUtils.SeleniumUtils; import pages.HomePage; import pages.LoginPage; import pages.SearchResultPage; public class ForkAndStarRepos extends SeleniumUtils { HomePage objHome = new HomePage(); LoginPage objLogin = new LoginPage(); SearchResultPage objSearch = new SearchResultPage(); @BeforeClass @Parameters({ "browser", "filePath" }) public void openWebsite(String browser, String filePath) { openBrowser(browser, filePath); getURL(prop.getProperty("url")); } @Test(priority = 1) public void loginToGitHub() { objHome.clickSignInBtn(); objLogin.loginGitHub(prop.getProperty("username"), prop.getProperty("password")); } @Test(priority = 2) public void search_Fork_Star_repos() { objHome.searchProgLang(prop.getProperty("searchLang")); objSearch.fork_And_Star_ReposList(); } @AfterClass public void closeBrowser() { tearDown(); } }
751a37b5-6a42-4298-a8bc-fc67b95ef631
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-11 17:59:27", "repo_name": "basuha/word-games", "sub_path": "/src/main/java/words/attributes/primary/Time.java", "file_name": "Time.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "cc86fb6875c6bf1ae71473e362b231c51b896bfd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/basuha/word-games
227
FILENAME: Time.java
0.290981
package words.attributes.primary; import utilities.WAttribute; /** * Признак времени глагола */ public enum Time implements WAttribute { NULL (null,null), N_A ("n/a", "n/a"), PAST ("past", "прошлое"), PRESENT ("present", "настоящее"), FUTURE ("future", "будущее"); private final String VALUE; private final String LOCALIZED_VALUE; private final static String LOCALIZED_ATTRIBUTE_NAME = "время"; Time (String value, String localizedValue) { this.VALUE = value; this.LOCALIZED_VALUE = localizedValue; } public WAttribute[] getValues() { return values(); } public String[] getLocalizedValueArray() { return WAttribute.getLocalizedValueArray(this); } @Override public String getLocalizedValue() { return LOCALIZED_VALUE; } public String getLocalizedAttributeName() { return LOCALIZED_ATTRIBUTE_NAME; } @Override public String toString() { return VALUE; } }
aa8cbdca-eb38-40ab-a6ca-7bfd14773885
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-21 19:44:51", "repo_name": "xMastahx/rocketstars", "sub_path": "/src/main/java/aiss/model/telegram/sendMessage/Entity.java", "file_name": "Entity.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "48e9d57ba9cc58501d628c84fbc21d167d37160e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/xMastahx/rocketstars
200
FILENAME: Entity.java
0.210766
package aiss.model.telegram.sendMessage; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @JsonIgnoreProperties(ignoreUnknown=true) public class Entity { private String type; private Long offset; private Long length; private Map<String, Object> additionalProperties = new HashMap<String, Object>(); public String getType() { return type; } public void setType(String type) { this.type = type; } public Long getOffset() { return offset; } public void setOffset(Long offset) { this.offset = offset; } public Long getLength() { return length; } public void setLength(Long length) { this.length = length; } public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
d7633829-8c45-4c8e-ba03-f70bb645f563
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-20 21:28:40", "repo_name": "ayushbilala/spring-boot", "sub_path": "/UserDetailsApplication/src/main/java/com/paypalinterview/problem4/repository/UserRepositoryImpl.java", "file_name": "UserRepositoryImpl.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "43842f3dd2670f2ae8c4370df3a68d5bb5f59cbe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ayushbilala/spring-boot
193
FILENAME: UserRepositoryImpl.java
0.268941
package com.paypalinterview.problem4.repository; import com.paypalinterview.problem4.model.User; import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.Map; import java.util.Set; @Service public class UserRepositoryImpl implements UserRepository { Map<String, User> userMap = new HashMap<>(); @Override public User getUser(String userId) { return userMap.get(userId); } @Override public boolean addUser(User user) { if(userMap.containsKey(user.getUserId())) { User existingUser = userMap.get(user.getUserId()); existingUser.setUserAsset(user.getUserAsset()); existingUser.setLoginTime(user.getLoginTime()); Set<String> ipAddress = existingUser.getIpAddress(); ipAddress.addAll(user.getIpAddress()); existingUser.setIpAddress(ipAddress); userMap.put(user.getUserId(), existingUser); } else { userMap.put(user.getUserId(), user); } return true; } }
389b0496-96d2-459f-8ed1-756209f276c2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-21 14:04:30", "repo_name": "sgs98/warehouse", "sub_path": "/ERP/warehouse/src/main/java/com/sxt/business/controller/OutportController.java", "file_name": "OutportController.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "700008d7bc2e76d380173514b898a7e3f3303457", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sgs98/warehouse
243
FILENAME: OutportController.java
0.216012
package com.sxt.business.controller; import com.sxt.business.domain.Outport; import com.sxt.business.service.OutportService; import com.sxt.business.vo.OutportVo; import com.sxt.system.common.ResultObj; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author song * @data 2020/1/24 */ @RequestMapping("api/outport") @RestController public class OutportController { @Autowired private OutportService outportService; /** * 查询 */ @RequestMapping("loadAllOutport") public Object loadAllOutport(OutportVo outportVo) { return this.outportService.queryAllOutport(outportVo); } /** * 添加退货信息 */ @RequestMapping("addOutport") public ResultObj addOutport(Outport outport) { try { this.outportService.saveOutport(outport); return ResultObj.ADD_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.ADD_ERROR; } } }
01056230-d3ed-404f-b2ac-46c1848e90d8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-17 13:54:53", "repo_name": "MassPixel/StudyCards", "sub_path": "/app/src/main/java/com/example/studycards/AppDatabase.java", "file_name": "AppDatabase.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "31d3ebc4e126b96a3da7d26f612990944d186dad", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/MassPixel/StudyCards
196
FILENAME: AppDatabase.java
0.264358
package com.example.studycards; import android.content.Context; import androidx.room.Database; import androidx.room.Room; import androidx.room.RoomDatabase; //App database entity @Database(entities = {Question.class}, version = 1, exportSchema = false) public abstract class AppDatabase extends RoomDatabase { private static AppDatabase appDB; private static String DATABASE_NAME = "StudyCardsDatabase"; public synchronized static AppDatabase getInstance(Context context){ //Checks to see if database has been initialized if(appDB == null){ //Creates build of database appDB = Room.databaseBuilder(context.getApplicationContext() ,AppDatabase.class,DATABASE_NAME) .allowMainThreadQueries() .fallbackToDestructiveMigration() .build(); } return appDB; } public abstract QuestionDAO questionDAO(); /* public abstract CategoryDAO categoryDAO();*/ /*public abstract QuizSetDAO quizSetDAO();*/ }
ea786881-7d39-4269-8104-ac05164fd911
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-28 16:51:43", "repo_name": "nagraj0308/android", "sub_path": "/ViewPagerDemo/app/src/main/java/com/example/viewpagerdemo/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "9c3321d96d465a95a52114323747acdb3e2a1975", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nagraj0308/android
196
FILENAME: MainActivity.java
0.228156
package com.example.viewpagerdemo; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import android.os.Bundle; import android.view.MenuItem; import android.widget.EditText; import android.widget.Toast; import com.google.android.material.tabs.TabLayout; public class MainActivity extends AppCompatActivity { TabLayout week; EditText editText; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); week=findViewById(R.id.week); week.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { Toast.makeText(getApplicationContext(),tab.getText().toString()+""+tab.getPosition(),Toast.LENGTH_LONG).show(); } @Override public void onTabUnselected(TabLayout.Tab tab) { } @Override public void onTabReselected(TabLayout.Tab tab) { } }); } }
c65c63dc-f421-4e93-b362-7ccb912fc8e1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-15 02:24:07", "repo_name": "zhangchao-lub/NettyStudy", "sub_path": "/src/main/java/s01/io/bio/Server.java", "file_name": "Server.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "27e65724b89028125aa778e2c3a4aa556d11d1ec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zhangchao-lub/NettyStudy
255
FILENAME: Server.java
0.259826
package s01.io.bio; import lombok.extern.slf4j.Slf4j; import java.io.IOException; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; /** * @author czhang@mindpointeye.com * @version 1.0 * @Date 2020/12/7 15:58 * @descrption 半双工通信 */ @Slf4j public class Server { public static void main(String[] args) throws IOException { ServerSocket ss=new ServerSocket(); ss.bind(new InetSocketAddress("127.0.0.1",8888)); while (true){ Socket s=ss.accept();//阻塞方法 new Thread(()->{ handle(s); }).start(); } } static void handle(Socket s) { try { byte[] bytes=new byte[1024]; int len=s.getInputStream().read(bytes); log.info(new String(bytes, 0, len)); // s.getOutputStream().write(bytes, 0, len); // s.getOutputStream().flush(); } catch (IOException e) { e.printStackTrace(); } } }
82ce675a-f847-4509-b052-fca3262a6bbb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-07-06T08:56:58", "repo_name": "krisleech/krisleech.github.io", "sub_path": "/source/_posts/2013-05-14-upgrading-unsupported-ubuntu.markdown", "file_name": "2013-05-14-upgrading-unsupported-ubuntu.markdown", "file_ext": "markdown", "file_size_in_byte": 1049, "line_count": 47, "lang": "en", "doc_type": "text", "blob_id": "3ad944f2b4473d9ce9be7af60879bb4208d50e98", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/krisleech/krisleech.github.io
269
FILENAME: 2013-05-14-upgrading-unsupported-ubuntu.markdown
0.216012
--- layout: post title: "Upgrading an unsupported Ubuntu" date: 2013-06-19 21:01 comments: true published: true categories: [ruby] --- Upgrading Natty (11.04) the same should apply to other upgrades. <!-- more --> I use Rackspace which replaces the default apt repositories with its own mirrors. Once a Ubuntu becomes unsupported Rackspace removes the repository and installing any software results in 404 errors. First backup the entire server as an image incase something goes wrong. Next create a copy of the sources file for apt-get: ```bash $ cp /etc/apt/sources.list ~/sources.list.backup ``` Edit source.list: ```bash $ vi /etc/apt/sources.list ``` Replace all occurances of "mirrors.rackspace.com" with "old-releases.ubuntu.com" in "/etc/apt/sources.list", then: ```bash $ sudo apt-get update ``` And follow the usual upgrade path: ```bash $ sudo apt-get install update-manager-core $ sudo do-release-upgrade ``` I'd recommend running `do-release-upgrade` in a tmux session so it is not interrupted if you net connection dies.
f8e47446-0972-4ffa-857c-9befc11c9e2c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-30 01:24:59", "repo_name": "lptommyjohnson/LN-APIAutomation", "sub_path": "/LN-APIAutomation/src/test/java/Database/DbConnection.java", "file_name": "DbConnection.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "57e8167c2d9e7119d6164b41c68c749f2b27d0dd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lptommyjohnson/LN-APIAutomation
237
FILENAME: DbConnection.java
0.272799
package Database; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class DbConnection { private final static String url = "jdbc:postgresql://lqdnettest.cifpk9rhtssl.ap-southeast-1.rds.amazonaws.com:5432/LQDNETTEST?Schemas=lqdnetdev"; // /LQDNETTEST?currentSchema=lqdnetdev"; private final static String user = "lqdnetdev"; private final static String password = "dev444lqd444net"; private static Connection conn = null; /** * Connect to the PostgreSQL database * * @return a Connection object * @throws ClassNotFoundException */ public static Connection connect() throws Exception { //Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection(url, user, password); System.out.println("Connected to the PostgreSQL server successfully."); return conn; } public static void closeConnection() throws SQLException { if(conn!=null && !conn.isClosed()){ conn.close(); } } }
375abd86-39fd-41c3-8d36-60def441b836
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-04-03T10:11:52", "repo_name": "cristinae/CLUBS", "sub_path": "/corpora/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 992, "line_count": 49, "lang": "en", "doc_type": "text", "blob_id": "fa81205fe8bd35fd78164451e913d206d2b567a5", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cristinae/CLUBS
229
FILENAME: README.md
0.210766
CLuBS CORPORA EXTRACTION SCRIPTS -------------------------------- Scripts to extract parallel and monolingual corpora from an xml dump of the PubPshyc database ### Contents - README - splitCorpus.py - extractParallelCorpus.py - extractMonolingualCorpus.py - sentenceAligner.py - sentenceSplitter.py - splitAbstractSentences.py - final_evaluation_corpus_parallelAbst_IDs.dat - final_evaluation_corpus_only-en_IDs.dat - final_evaluation_IDs.dat ### Pipeline 1. Split the original xml file into training and test according to a list of IDs for testing (final_testIDs.dat) python splitCorpus.py 2. Extract the parallel corpora for the three language pairs for the desired partition python extractParallelCorpus.py test python extractParallelCorpus.py train 3. Extract the monolingual corpora for the four languages python extractMonolingualCorpus.py train ### Utilities 1. Sentence splitter for the abstracts python splitAbstractSentences.py train
2000bd65-d500-4104-aaea-5f36e886f025
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-26 09:10:52", "repo_name": "Dfmaaa/transferfile", "sub_path": "/Findnumber.java", "file_name": "Findnumber.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "fd5612996d56a2d5fd304dff414be6b8e5613f2b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Dfmaaa/transferfile
193
FILENAME: Findnumber.java
0.261331
import java.util.Scanner; public class Findnumber { public static void main(String[] args) { Scanner input = new Scanner(System.in); while (true) { System.out.print("Enter the sentence:"); String sentence = input.nextLine(); int length = sentence.length(); int[] a = new int[length]; int start = 0; char var; int var2; int counter = 0; for (start = 0; start <= length - 1; start++) { var = sentence.charAt(start); try { var2 = Integer.parseInt(String.valueOf(var)); int varcheck = var2 - 1; if (var2 - 1 == varcheck) { counter=counter+1; a[start] = var2; System.out.println(a[start]); } } catch (Exception e) { } } } } }
a6937a90-7c6a-4a32-a56b-52d8b8a2ebfc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-07-29T16:08:06", "repo_name": "keymanapp/lexical-models", "sub_path": "/release/gff/gff.ti.gff_tigrinya/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1065, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "9c70ab88283867d01ffdba21e6bba2e132ae2a03", "star_events_count": 10, "fork_events_count": 36, "src_encoding": "UTF-8"}
https://github.com/keymanapp/lexical-models
256
FILENAME: README.md
0.212069
GFF Tigrinya Lexical Model ========================== © 2020 – 2023 Geʾez Frontier Foundation Version 1.2 Description ----------- This is a Tigrinya (ትግርኛ , ISO-639-2 ti) lexical model developed to support predictive text in corresponding GFF Tigrinya keyboards. The lexical model relies on the UniLex projects's word List for Tigrinya. The word list has been modified to remove English entries only. The word list has not otherwise been reviewed to validate spelling or separate Eritrean Tigrinya from Ethiopian Tigrinya spelling conventions. These refinements are goals to be addressed in the future development of this lexical model. Links ----- * UniLex TI Word List: [https://github.com/unicode-org/unilex/blob/master/data/frequency/ti.txt](https://github.com/unicode-org/unilex/blob/master/data/frequency/ti.txt) Supported Platforms ------------------- * Windows * macOS * Linux * Web * iPhone * iPad * Android phone * Android tablet * Mobile devices * Desktop devices * Tablet devices
006e2d8f-1286-4fa3-8e4b-80aa9f8f49e4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-20 12:14:23", "repo_name": "PinPinx/Simplified_Logo", "sub_path": "/src/model/Variable.java", "file_name": "Variable.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "6a5a33e6c14490bcb32d587f96b592e93397a520", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/PinPinx/Simplified_Logo
224
FILENAME: Variable.java
0.278257
package model; import exceptions.VariableWrongTypeException; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; public abstract class Variable { protected StringProperty myDisplayProperty; protected StringProperty myNameProperty; public Variable(String name){ this.myNameProperty = new SimpleStringProperty(name); } /** * Returns a nondestructible value. */ abstract public Object getValue(); /** * This method is used to attempt to change the value (but NOT type) of the variable to a different value, edit. * @throws VariableWrongTypeException if edit is not of the same type as the variable's value */ abstract public void setValue(String edit) throws VariableWrongTypeException; /** * Returns a string of the variable's value. This String is binded to the Variable's * real property, and this StringProperty is handed to the front end. */ protected StringProperty getStringProperty() { return myDisplayProperty; } protected StringProperty getNameProperty(){ return myNameProperty; } }
5f3261b4-ee67-4686-b1ef-940034d348eb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-30 04:38:45", "repo_name": "manrique-code/ExamenIIParcial", "sub_path": "/src/main/java/backend/lib/controllers/ReqRes.java", "file_name": "ReqRes.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "8699f2c9ed9d2d93be76141cae972353801eec0a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/manrique-code/ExamenIIParcial
224
FILENAME: ReqRes.java
0.286169
package backend.lib.controllers; import com.sun.net.httpserver.HttpExchange; import org.json.JSONObject; import java.io.*; import java.nio.charset.StandardCharsets; public class ReqRes { public static JSONObject getRequest(HttpExchange he) throws IOException { InputStream is = he.getRequestBody(); InputStreamReader lectorBinario = new InputStreamReader(is, "utf-8"); BufferedReader br = new BufferedReader(lectorBinario); StringBuilder buf = new StringBuilder(512); int b; while((b = br.read()) != -1){ buf.append((char)b); } br.close(); lectorBinario.close(); return new JSONObject(buf.toString()); } public static void sendResponse(HttpExchange he, JSONObject jrespond) throws IOException{ he.getResponseHeaders().set("Content-Type", "application/json; charset=UTF-8"); byte[] bytes = jrespond.toString().getBytes(StandardCharsets.UTF_8); he.sendResponseHeaders(200, bytes.length); OutputStream os = he.getResponseBody(); os.write(bytes); os.close(); } }
8b9ae558-d931-43b7-ae2b-7a88597dbf73
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-17 10:15:42", "repo_name": "yanpgeng/springbootdemo", "sub_path": "/springbootdemo-thread/src/main/java/com/example/springbootdemothread/productAndConsumer/productAndConsumerDemo01/Producer.java", "file_name": "Producer.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "981e891513cefd51fb3ef97c68eba572259fbb15", "star_events_count": 32, "fork_events_count": 46, "src_encoding": "UTF-8"}
https://github.com/yanpgeng/springbootdemo
260
FILENAME: Producer.java
0.278257
package com.example.springbootdemothread.productAndConsumer.productAndConsumerDemo01; import java.util.Random; /** * @author YangPeng * @Title: Producer * @ProjectName springbootdemo * @Description: 生产者线程类; * @company ccxcredit * @date 2019/5/20-16:13 */ public class Producer implements Runnable { /** * 定义生产者的姓名,生产的产品的存放路径; */ private String name; private Storage s = null; /** * 构造方法; */ public Producer(String name, Storage s) { this.name = name; this.s = s; } @Override public void run() { try { //线程一直往容器中生产产品; while (true) { Product product = new Product(new Random().nextInt(1000)); s.push(product); System.out.println(name + "已生产(" + product.toString() + ").容器中现有产品个数为:"+s.size()); Thread.sleep(3000); } } catch (InterruptedException e) { e.printStackTrace(); } } }
72293d73-429e-4aef-858a-04277ffd9fb3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-23 02:15:20", "repo_name": "annkucherova/TestAutomationHomeTasks", "sub_path": "/FinalTask/FinalTaskBDD/src/main/java/pages/SavedItemsPage.java", "file_name": "SavedItemsPage.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "36a18aaed393e535a1124e61c66a9248c523e3dd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/annkucherova/TestAutomationHomeTasks
217
FILENAME: SavedItemsPage.java
0.264358
package pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; public class SavedItemsPage extends BasePage { @FindBy(xpath = "//header[@class='itemsHeader_saaZS']") private WebElement savedItemsAmountField; @FindBy(xpath = "//div[@class='itemCount_3vWat']") private WebElement savedItemsAmount; @FindBy(xpath = "//button[@aria-label='Delete']") private WebElement deleteItemButton; @FindBy(xpath = "//h2[contains(@class,'noItemsPrompt')]") private WebElement noItemsMessage; public SavedItemsPage(WebDriver driver) { super(driver); } public WebElement getSavedItemsAmountField() { return savedItemsAmountField; } public String getSavedItemsAmount() { return savedItemsAmount.getText(); } public void clickOnDeleteItemButton() { deleteItemButton.click(); } public String getNoItemsMessage() { return noItemsMessage.getText(); } }
3809f7f9-a807-441e-8205-b4748f5a45f6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-16 19:56:36", "repo_name": "lleyton/CustomHeads", "sub_path": "/src/main/java/com/innatical/CustomHeads/HeadCategories.java", "file_name": "HeadCategories.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "ed751fabed9d90416521af475a38678e222a5d67", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lleyton/CustomHeads
285
FILENAME: HeadCategories.java
0.277473
package com.innatical.CustomHeads; import org.bukkit.Material; enum HeadCategories { ALPHABET ("alphabet", "Alphabet", Material.WHITE_BANNER), ANIMALS ("animals", "Animals", Material.SKELETON_SPAWN_EGG), BLOCKS ("blocks", "Blocks", Material.BRICKS), DECORATION ("decoration", "Decoration", Material.PEONY), FOOD_DRINKS ("food-drinks", "Food/Drinks", Material.POTION), HUMANS ("humans", "Humans", Material.PLAYER_HEAD), HUMANOID ("humanoid", "Humanoid", Material.ARMOR_STAND), MISCELLANEOUS ("miscellaneous", "Miscellaneous", Material.LAVA_BUCKET), MONSTERS ("monsters", "Monsters", Material.ZOMBIE_HEAD), PLANTS ("plants", "Plants", Material.TALL_GRASS); private final String Id; private final String name; private final Material symbol; HeadCategories(String Id, String name, Material symbol) { this.Id = Id; this.name = name; this.symbol = symbol; } public String getId() { return Id; } public String getName() { return name; } public Material getSymbol() { return symbol; } }
3b48f8fb-d5b5-4515-ab0e-13eee292f420
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-28 03:45:48", "repo_name": "JumpingLi/dance", "sub_path": "/src/main/java/com/champion/dance/service/impl/CommentServiceImpl.java", "file_name": "CommentServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "c6e85ca7fa0b42bb787e8449bc88df29b83dd58a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JumpingLi/dance
230
FILENAME: CommentServiceImpl.java
0.258326
package com.champion.dance.service.impl; import com.champion.dance.domain.entity.Comment; import com.champion.dance.domain.mapper.CommentMapper; import com.champion.dance.service.CommentService; import com.champion.dance.domain.dto.CommentDto; import org.apache.ibatis.session.RowBounds; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; /** * Created with dance * Author: jiangping.li * Date: 2018/2/28 15:15 * Description: */ @Service public class CommentServiceImpl implements CommentService { @Autowired private CommentMapper commentMapper; @Override public List<CommentDto> findCommentsByCourseId(String courseId, RowBounds rowBounds) { return commentMapper.findCommentsByCourseId(courseId,rowBounds); } @Override public int insertComment(Comment comment) { return commentMapper.insertSelective(comment); } @Override public Comment findByParams(Map params) { return commentMapper.findByParams(params); } }
deb60b86-665c-41f2-b5bc-245da28ecf8d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-23 14:06:34", "repo_name": "derteuffel/publication-notes", "sub_path": "/src/main/java/com/derteuffel/publicationNotes/entities/Options.java", "file_name": "Options.java", "file_ext": "java", "file_size_in_byte": 1100, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "bd171bb034885224f8cf27a1a414a833714500ec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/derteuffel/publication-notes
236
FILENAME: Options.java
0.23231
package com.derteuffel.publicationNotes.entities; import lombok.Data; import javax.persistence.*; import java.io.Serializable; @Data @Entity @Table(name = "options") public class Options implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String slug; @ManyToOne private Departement departement; public Options() { } public Options(String name, String slug) { this.name = name; this.slug = slug; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSlug() { return slug; } public void setSlug(String slug) { this.slug = slug; } public Departement getDepartement() { return departement; } public void setDepartement(Departement departement) { this.departement = departement; } }
5bc5ef01-a2f5-4c04-a3ab-163d854e7a7f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-20 02:52:42", "repo_name": "ankushrayabhari/Zweihander", "sub_path": "/core/src/com/ankushrayabhari/zweihander/items/abilities/Ability.java", "file_name": "Ability.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "6f4a2a64ac37b5fd01fc3f305f5589081917b375", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ankushrayabhari/Zweihander
242
FILENAME: Ability.java
0.286968
package com.ankushrayabhari.zweihander.items.abilities; import com.ankushrayabhari.zweihander.items.Action; import com.ankushrayabhari.zweihander.items.Item; import com.ankushrayabhari.zweihander.screens.GameScreen; /** * Class Description * * @author Ankush Rayabhari */ public class Ability extends Item { private float fireDelay, fireTimeCounter; private int manaCost; private GameScreen game; private Action action; public Ability(GameScreen game, AbilityDef def) { super(def); fireDelay = def.getDelay(); fireTimeCounter = 0; this.game = game; this.manaCost = def.getManaCost(); this.action = def.getAction(); } public void update(Float delta) { fireTimeCounter += delta; } public void fire() { if((fireTimeCounter > fireDelay && game.getPlayer().getMana() > manaCost)) { fireTimeCounter = 0; action.execute(game); game.getPlayer().dealMana(manaCost); } }; }
8dc6f106-a109-4a59-a133-fade93b97220
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-06-26T22:49:14", "repo_name": "gSchool/g2-social-network", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1053, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "86abfede7b9e5fa7c83c3fe1b1034c8480a09e11", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/gSchool/g2-social-network
270
FILENAME: README.md
0.233706
[![Code Climate](https://codeclimate.com/github/gSchool/g2-social-network.png)](https://codeclimate.com/github/gSchool/g2-social-network)[![Build Status](https://travis-ci.org/gSchool/g2-social-network.svg?branch=master)](https://travis-ci.org/gSchool/g2-social-network) # g2-social-network ##Background The g2 Social Network application provides networking capabilities with between users. The App is built on Rails 4. ##Important Links + [Tracker](https://www.pivotaltracker.com/n/projects/1079706 "Tracker") + [Staging](http://g2-social-network-staging.herokuapp.com/ "Staging") ##Setup To get this application running locally, you should be able to simply clone this repository and run the following: + `cd g2-social_network` + `bundle install` + `rake db:create` + `rake db:migrate` + `rake db:seed` + `rake spec` + `rails s` Please note that this application is using carrierwave with rmagick. Please install 'imagemagick' prior to using this app through whatever means you use (i.e. if you use homebrew: `brew install imagemagick`).
db507a18-46c3-4d17-8742-44e83cf76d87
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-01-09 02:31:07", "repo_name": "drewgascoigne/Traffic-Brain", "sub_path": "/Traffic Brain/src/brain/trafficlight/TrafficLight.java", "file_name": "TrafficLight.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "15d03cd6fc3f0d917994f5723a237c80e15810c1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/drewgascoigne/Traffic-Brain
276
FILENAME: TrafficLight.java
0.282196
package brain.trafficlight; import java.util.ArrayList; import brain.violation.Violations; public class TrafficLight { //id of this traffic light private int id; //list of violations this traffic light has received //possibly the buffer to be added to the cloud? ArrayList<Violations> violations = new ArrayList<Violations>(); //private LightTiming timing; /* * initialize traffic light */ public TrafficLight(int id) { this.id = id; } public int getTID() { return id; } /* * link the timer to this traffic light */ /*public void addTimer(LightTiming lt) { timing = lt; }*/ /* * Add a violation to the violations array list * this will be used when the traffic light receives messages from the car */ public void addViolation(String type, int trafficId, String licensePlate, String date, String description) { //determine type of violation and add that type } /* * Used by the brain to alert a traffic light that a car has sent it a message */ public void receivedMessage(String message) { //deal with the contents of the message and respond accordingly } }
7781e5c8-30c5-443e-8cdd-4ed7ac0302ce
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-26 09:59:29", "repo_name": "all4youBy/LogisticSystem", "sub_path": "/webapp/src/servlets/ShowTrucksServlet.java", "file_name": "ShowTrucksServlet.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "0f9ab1facdaf6196c823d8405629e2e651aec113", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/all4youBy/LogisticSystem
192
FILENAME: ShowTrucksServlet.java
0.29584
package servlets; import entities.Truck; import remote.DbManagerRemote; import javax.ejb.EJB; 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; import java.util.List; @WebServlet("/viewtrucks") public class ShowTrucksServlet extends HttpServlet { @EJB private DbManagerRemote remote; @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { List<Truck> trucks = remote.getAllTrucks(); if(trucks == null) throw new ServletException("Trucks array is null."); req.setAttribute("trucks",trucks); req.getRequestDispatcher("/jspPages/adminMain.jsp").forward(req,resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doGet(req,resp); } }
bebee4eb-a590-450c-898b-3d9b89ec9b08
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-26 11:23:23", "repo_name": "DanieleM1999/OrtofruttaWebApp", "sub_path": "/OrtofruttaWebApp/src/main/java/it/dstech/accesso/Switch.java", "file_name": "Switch.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "21e14418686e01991fe6e453b353fdd71d7fad7e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/DanieleM1999/OrtofruttaWebApp
224
FILENAME: Switch.java
0.26588
package it.dstech.accesso; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class Switch extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String parametro = req.getParameter("switch"); if(parametro.equals("AggiungiAlCarrello")) { req.getRequestDispatcher("Carrello.jsp").forward(req, resp); } else if(parametro.equals("Paga")) { req.getRequestDispatcher("Stampa.jsp").forward(req, resp); } else if(parametro.equals("StampaCarrello")) { req.getRequestDispatcher("Aquisto.jsp").forward(req, resp); } else if(parametro.equals("StampaListaClienti")) { req.getRequestDispatcher("StampaClienti.jsp").forward(req, resp); } else if(parametro.equals("Fai2+2")) { req.getRequestDispatcher("2+2.jsp").forward(req, resp); } } }
1e4a9a33-81bf-43d7-a7ec-34aa78f7017c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-23 15:49:16", "repo_name": "nks2180/mvp-clean", "sub_path": "/app/src/main/java/com/mvp/ApplicationModule.java", "file_name": "ApplicationModule.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "febf4f6582a79a79801649c04aa7e3b27629bdef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nks2180/mvp-clean
182
FILENAME: ApplicationModule.java
0.253861
package com.mvp; import android.app.Application; import com.mvp.common.AnalyticsModule; import com.mvp.common.AndroidAssetLoader; import com.mvp.common.AssetLoader; import com.mvp.common.TimeZoneModule; import com.mvp.image.ImageLoaderModule; import com.mvp.network.JsonModule; import com.mvp.network.NetworkModule; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; @Singleton @Module(includes = { JsonModule.class, TimeZoneModule.class, NetworkModule.class, ImageLoaderModule.class, AnalyticsModule.class}) public class ApplicationModule { private final Application application; public ApplicationModule(Application application) { this.application = application; } @Provides @Singleton Application application() { return application; } @Provides @Singleton AssetLoader assetLoader() { return new AndroidAssetLoader(application); } }
cc765a0a-e8fd-4a72-8529-0df503500c02
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-13 09:41:40", "repo_name": "prathamApp/GIT_Assessment", "sub_path": "/app/src/main/java/com/pratham/assessment/domain/Modal_DownloadContent.java", "file_name": "Modal_DownloadContent.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "18a4c18647f2f0b1d7ec8392de1165259f028239", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/prathamApp/GIT_Assessment
238
FILENAME: Modal_DownloadContent.java
0.233706
package com.pratham.assessment.domain; import com.google.gson.annotations.SerializedName; import java.util.List; public class Modal_DownloadContent { @SerializedName("nodelist") List<ContentTable> nodelist; @SerializedName("downloadurl") String downloadurl; @SerializedName("foldername") String foldername; @Override public String toString() { return "Modal_DownloadContent{" + "nodelist=" + nodelist + ", downloadurl='" + downloadurl + '\'' + ", foldername='" + foldername + '\'' + '}'; } public List<ContentTable> getNodelist() { return nodelist; } public void setNodelist(List<ContentTable> nodelist) { this.nodelist = nodelist; } public String getDownloadurl() { return downloadurl; } public void setDownloadurl(String downloadurl) { this.downloadurl = downloadurl; } public String getFoldername() { return foldername; } public void setFoldername(String foldername) { this.foldername = foldername; } }
0569eb20-668b-4226-8576-d248330195c0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-03 05:49:14", "repo_name": "manasarc/practicemanasa", "sub_path": "/practicemanasa/src/POM/DiamondNecklaces_page.java", "file_name": "DiamondNecklaces_page.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "6a7042fb597ef083786bcc0bf5ccfe9c562f0fd7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/manasarc/practicemanasa
223
FILENAME: DiamondNecklaces_page.java
0.290981
package POM; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import Generic.Base_page; public class DiamondNecklaces_page extends Base_page { @FindBy(xpath="//span[@class='view-by-wrap title style-outline i-right']") private WebElement sortbybtn; @FindBy(xpath="//label [@for='filter_ndd']/span") private WebElement nextdaycheckbox; @FindBy(xpath="//a[.='Price High to Low ']") private WebElement discountbtn; public DiamondNecklaces_page(WebDriver driver) { super(driver); PageFactory.initElements(driver, this); } public void clicknextdaycheckbox(){ nextdaycheckbox.click(); } public void clicksortby(){ sortbybtn.click(); } public void clickDiscountbtn(){ discountbtn.click(); } public void verifyDiamondpage(String Diamondnecktitle) { verifyTitle(Diamondnecktitle); } public void verifyElement1() { verifyElement(sortbybtn); } }
fa796a46-aeab-4f50-bf38-2c2dc821b527
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-25 05:47:47", "repo_name": "qyhsmx/java-interview", "sub_path": "/src/main/java/com/qyy/interview/distribute/zk/BaseTemplate.java", "file_name": "BaseTemplate.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "08de2367887897fa1690276b1267f2da66e79fec", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/qyhsmx/java-interview
251
FILENAME: BaseTemplate.java
0.23793
package com.qyy.interview.distribute.zk; import org.I0Itec.zkclient.ZkClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Optional; import java.util.concurrent.CountDownLatch; /** * @author qyhsmx@outlook.com * @date */ public abstract class BaseTemplate implements ZKLock { Logger logger = LoggerFactory.getLogger(BaseTemplate.class); private static String SERVER = "127.0.0.1:2181"; ZkClient client = new ZkClient(SERVER,3000); CountDownLatch countDownLatch; protected abstract void waitForLock(); protected abstract boolean tryAcquire(); @Override public void lock() { if(tryAcquire()){ logger.info("获取锁"); }else { //等待 waitForLock(); //继续获取锁 lock(); } } @Override public void unlock() { Optional.ofNullable(client).ifPresent(zkClient -> zkClient.delete("/text")); //Optional.ofNullable(client).ifPresent(ZkClient::close); logger.info("释放锁"); } }
70afdb75-a9e1-43f5-98c7-720cbe437828
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-17 13:35:02", "repo_name": "VinAdmin/LessonSQL", "sub_path": "/src/lessonsqlite/Product.java", "file_name": "Product.java", "file_ext": "java", "file_size_in_byte": 1078, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ce3a6e2c79b4e775e4fea71023afa9ce2ae74f7c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/VinAdmin/LessonSQL
240
FILENAME: Product.java
0.290176
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package lessonsqlite; /** * * @author 7-2-0 */ public class Product { public int id; public String good; public double price; public String category_name; // Конструктор public Product(int id, String good, double price, String category_name) { this.id = id; this.good = good; this.price = price; this.category_name = category_name; } Product(String good, int price, String category_name) { this.id = id; this.good = good; this.price = price; this.category_name = category_name; } // Выводим информацию по продукту @Override public String toString() { return String.format("ID: %s | Товар: %s | Цена: %s | Категория: %s", this.id, this.good, this.price, this.category_name); } }
2e109fad-4e50-4d42-81ec-694952ef5ab2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-08 10:40:00", "repo_name": "leod1/Projets", "sub_path": "/PPMPermissions/src/fr/leod1/ppmPermissions/events/Leave.java", "file_name": "Leave.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "0c5b10764b55ff37f12b95d50bf5ef1ff0828234", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/leod1/Projets
227
FILENAME: Leave.java
0.259826
package fr.leod1.ppmPermissions.events; import fr.leod1.ppmPermissions.PlayerData.PlayerData; import fr.leod1.ppmPermissions.Utils.fileUtils; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerQuitEvent; import java.io.File; import java.io.IOException; import static fr.leod1.ppmPermissions.PPMPermissions.plugin; public class Leave implements Listener { @EventHandler public void leave(PlayerQuitEvent event) throws IOException { Player pl = event.getPlayer(); plugin.playerDataCache.remove(pl); //Unload playerdata File DirectoryPlayerData = new File(plugin.getDataFolder()+"/PlayerData/"); final File file = new File(DirectoryPlayerData,pl.getName()+".json"); fileUtils.createFile(file); PlayerData zebi = plugin.playerData.get(pl); String json = plugin.getProjectSerializationManager().serializePlayerData(zebi); fileUtils.save(file,json); plugin.scoreboard.getTeam(pl.getName()).unregister(); //Unload playerdata } }
b0b79dc2-c09b-46e3-82d4-7e06e01e0756
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-20 14:00:10", "repo_name": "andreyfillipe/nosso-banco-digital", "sub_path": "/src/main/java/com/andreyfillipe/nossobancodigital/resource/exception/ApiErros.java", "file_name": "ApiErros.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "a4afe69052cb0429295ae77da8f285ac9feeb6fa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/andreyfillipe/nosso-banco-digital
254
FILENAME: ApiErros.java
0.272799
package com.andreyfillipe.nossobancodigital.resource.exception; import com.andreyfillipe.nossobancodigital.service.exception.EntidadeNaoProcessavelException; import com.andreyfillipe.nossobancodigital.service.exception.NaoEncontradoException; import com.andreyfillipe.nossobancodigital.service.exception.RegraNegocioException; import org.springframework.validation.BindingResult; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class ApiErros { private List<String> erros; public ApiErros(BindingResult bindingResult) { this.erros = new ArrayList<>(); bindingResult.getAllErrors().forEach(erro -> this.erros.add(erro.getDefaultMessage())); } public ApiErros(RegraNegocioException ex) { this.erros = Arrays.asList(ex.getMessage()); } public ApiErros(NaoEncontradoException ex) { this.erros = Arrays.asList(ex.getMessage()); } public ApiErros(EntidadeNaoProcessavelException ex) { this.erros = Arrays.asList(ex.getMessage()); } public List<String> getErros() { return this.erros; } }
4fd1ff42-bbe8-46c6-aaab-475db39e12e0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-24 07:30:32", "repo_name": "colorfulfrog/springboot-dubbox", "sub_path": "/platform-system/platform-system-provider/src/main/java/com/yxhl/stationbiz/system/provider/task/CreateOperatePlanTask.java", "file_name": "CreateOperatePlanTask.java", "file_ext": "java", "file_size_in_byte": 1278, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "cb4aa02f704681bf1bdaeeb8db0f74890434b149", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/colorfulfrog/springboot-dubbox
286
FILENAME: CreateOperatePlanTask.java
0.283781
package com.yxhl.stationbiz.system.provider.task; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.yxhl.stationbiz.system.domain.request.CreateScheduleBusRequest; import com.yxhl.stationbiz.system.domain.service.schedule.ScheduleBusService; /** * 生成制作计划任务 */ public class CreateOperatePlanTask implements Runnable { /** * 日志对象 */ private static Logger LOGGER = LoggerFactory.getLogger(CreateOperatePlanTask.class); private ScheduleBusService scheduleBusService; private CreateScheduleBusRequest req; public CreateOperatePlanTask (ScheduleBusService scheduleBusService,CreateScheduleBusRequest req) { this.scheduleBusService = scheduleBusService; this.req = req; } @Override public void run() { try { scheduleBusService.createOperatePlan(req); } catch (Exception e) { LOGGER.error("====执行制作营运计划任务失败=========", req); } } public ScheduleBusService getScheduleBusService() { return scheduleBusService; } public void setScheduleBusService(ScheduleBusService scheduleBusService) { this.scheduleBusService = scheduleBusService; } public CreateScheduleBusRequest getReq() { return req; } public void setReq(CreateScheduleBusRequest req) { this.req = req; } }
48db2c1e-c7e8-4289-a91e-0dfe05368c8e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-16 16:55:31", "repo_name": "lidonghui-github/mySSC", "sub_path": "/src/main/java/cn/hd/enums/OrgProperty.java", "file_name": "OrgProperty.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "c9f7c72aee9390563c261c01f718f9c948c610ab", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lidonghui-github/mySSC
287
FILENAME: OrgProperty.java
0.293404
package cn.hd.enums; import java.util.HashMap; import java.util.Map; /** * @Description:.机构属性 */ public enum OrgProperty { 一般机构("00","一般机构"),//GENE_INS 公司部("01","公司部"),//COMP_DEPA 资保部("02","资保部"),//ENINS_DEPA 票据中心("03","票据中心"),//BILL_CENT 国际部("04","国际部"),//INTER_DEPA 小企业专营机构("05","小企业专营机构");//SMA_BUS_SPAGE public static OrgProperty getByCode(String code) { return map.get(code); } private static Map<String, OrgProperty> map; static { map = new HashMap<String, OrgProperty>(); for (OrgProperty e : OrgProperty.values()) { map.put(e.getCode(), e); } } public boolean equals(String code) { return this.code.equals(code); } public String getCode() { return code; } public String getName() { return name; } private final String code; private final String name; private OrgProperty(String code, String name) { this.code = code; this.name = name; } }
04c525c3-c24e-417b-861f-9f3ba0f9b083
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-05 07:38:29", "repo_name": "glirios/CSC305-Project-2-Facebook", "sub_path": "/Project2-Facebook/src/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "5aaffc300e91cab6103674f7ba63ff47076484e5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/glirios/CSC305-Project-2-Facebook
277
FILENAME: User.java
0.290176
import java.util.ArrayList; public class User { private String name; private ArrayList<String> feed; private boolean isFriend; private ArrayList<String> friends; public User(String name, ArrayList<String> feed, boolean isFriend) { this.name = name; this.feed = feed; this.isFriend = isFriend; friends = new ArrayList<String>(); } public void addToFeed(String text) { feed.add(text); } public boolean getIsFriend() { return isFriend; } public ArrayList<String> getFeed() { return feed; } public String getName() { return name; } public void setIsFriend(boolean value) { isFriend = value; } public void generateFriendsList(ArrayList<User> users, ArrayList<String> friendList) { this.friends = new ArrayList<String>(); for (String friend : friendList) { for (User u : users) { if (u.getName().equals(friend)) { this.friends.add(friend); u.setIsFriend(true); } } } } public ArrayList<String> getFriends() { //System.out.println(friends); return friends; } public void setFriends(ArrayList<String> values) { friends = values; } }
37481cef-74af-4f79-aba7-8dcf5adbd8ac
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-02-05 03:39:44", "repo_name": "GeoscienceAustralia/geodesy-sitelog-domain", "sub_path": "/src/main/java/au/gov/ga/geodesy/sitelog/domain/model/OtherInstrumentation.java", "file_name": "OtherInstrumentation.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "c8591d93f8aa3e554a5fdb0796d562c19af64aff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/GeoscienceAustralia/geodesy-sitelog-domain
246
FILENAME: OtherInstrumentation.java
0.236516
package au.gov.ga.geodesy.sitelog.domain.model; import javax.validation.Valid; import javax.validation.constraints.Size; /** * http://sopac.ucsd.edu/ns/geodesy/doc/igsSiteLog/equipment/2004/otherInstrumentation.xsd */ public class OtherInstrumentation { private Integer id; @Size(max = 4000) protected String instrumentation; @Valid protected EffectiveDates effectiveDates; @SuppressWarnings("unused") private Integer getId() { return id; } @SuppressWarnings("unused") private void setId(Integer id) { this.id = id; } /** * Return instrumentation. */ public String getInstrumentation() { return instrumentation; } /** * Set instrumentation. */ public void setInstrumentation(String value) { this.instrumentation = value; } /** * Return effective dates. */ public EffectiveDates getEffectiveDates() { return effectiveDates; } /** * Set effective dates. */ public void setEffectiveDates(EffectiveDates value) { this.effectiveDates = value; } }
dc236927-6a40-4255-b1c5-7e2d9b5b97e4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-20 23:36:42", "repo_name": "sylvainvincent/Dailyfeed", "sub_path": "/app/src/main/java/com/esgi/teamst/dailyfeed/dao/AbstractDAO.java", "file_name": "AbstractDAO.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "927d3ab7b48ebae0d4c1707f5e008836d4e4de52", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sylvainvincent/Dailyfeed
190
FILENAME: AbstractDAO.java
0.253861
package com.esgi.teamst.dailyfeed.dao; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; /** * Classe */ public abstract class AbstractDAO<T> { private DatabaseHandler mDatabaseHandler; private SQLiteDatabase mSqLiteDatabase; public SQLiteDatabase getSQLiteDb() { return mSqLiteDatabase; } public AbstractDAO(Context context) { mDatabaseHandler = new DatabaseHandler(context); } public SQLiteDatabase open(){ mSqLiteDatabase = this.mDatabaseHandler.getWritableDatabase(); return mSqLiteDatabase; } public void close(){mDatabaseHandler.close();} public abstract boolean add(T object); public abstract T get(int id); public abstract boolean update(T object); public abstract boolean delete(T object); public abstract T cursorToObject(Cursor cursor); protected abstract ContentValues objectToContentValues(T object); }
d7c5f119-22d6-4e5b-8f98-b7f764f736fc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-12-12 03:52:13", "repo_name": "Blacksmith99/FACEBIN-3.0--Authors--Christian-Alvarez---Josue-Perez-", "sub_path": "/Desktop/FACEB_4/src/face/BuscarAmigos.java", "file_name": "BuscarAmigos.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "fa9cd1ac7e6115d5cfec21cf275eb809b532c4ff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Blacksmith99/FACEBIN-3.0--Authors--Christian-Alvarez---Josue-Perez-
201
FILENAME: BuscarAmigos.java
0.221351
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package face; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; /** * * @author Josue */ public class BuscarAmigos { public File Verificar=null; public static boolean existe; public RandomAccessFile Data=null; public BuscarAmigos(){ } public boolean VerificarExistencia(String Emai)throws IOException{ String EmailGuardado; Data=new RandomAccessFile("Gerencia.fbn","rw"); Data.seek(0); while(Data.getFilePointer() < Data.length()){ Data.readUTF(); Data.readChar(); Data.readLong(); EmailGuardado=Data.readUTF(); if(Emai.equals(EmailGuardado)){ return true; } } return false; } }
39a107d2-a2bc-4b4c-af24-03755d615931
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-22 11:43:15", "repo_name": "sonnyit/onedev", "sub_path": "/server-core/src/main/java/io/onedev/server/model/support/administration/authenticator/Authenticated.java", "file_name": "Authenticated.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "c1863e50ba0279741ca3cb9e6784475a0cccf818", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sonnyit/onedev
241
FILENAME: Authenticated.java
0.256832
package io.onedev.server.model.support.administration.authenticator; import java.util.Collection; import javax.annotation.Nullable; import io.onedev.server.model.SshKey; public class Authenticated { private final String fullName; private final String email; private final Collection<String> groupNames; private final Collection<SshKey> sshPublicKeys; public Authenticated(String email, @Nullable String fullName, Collection<String> groupNames) { this(email, fullName, groupNames, null); } public Authenticated( String email, @Nullable String fullName, Collection<String> groupNames, @Nullable Collection<SshKey> sshPublicKeys ) { this.email = email; this.fullName = fullName; this.groupNames = groupNames; this.sshPublicKeys = sshPublicKeys; } @Nullable public String getFullName() { return fullName; } public String getEmail() { return email; } public Collection<String> getGroupNames() { return groupNames; } @Nullable public Collection<SshKey> getSSHPublicKeys() { return sshPublicKeys; } }
5c02da4f-91a2-42c4-aae0-d54a83d256c6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-07 22:31:28", "repo_name": "DDe3/matricula", "sub_path": "/src/main/java/com/ing_software/config/Configuracion.java", "file_name": "Configuracion.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "bd8e5d9d4a97f27e1e041f3f4461dadfa6cb91cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/DDe3/matricula
173
FILENAME: Configuracion.java
0.214691
package com.ing_software.config; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Disposes; import javax.enterprise.inject.Produces; import javax.enterprise.inject.se.SeContainer; import javax.enterprise.inject.se.SeContainerInitializer; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; @ApplicationScoped public class Configuracion { @Produces @ApplicationScoped public EntityManagerFactory entityManagerFactory() { EntityManagerFactory factory = Persistence .createEntityManagerFactory("matricula"); return factory; } @Produces @ApplicationScoped public EntityManager entityManager(EntityManagerFactory factory) { EntityManager em = factory.createEntityManager(); return em; } protected void closeEntityManager(@Disposes EntityManager entityManager) { if (entityManager.isOpen()) { entityManager.close(); } } }
5b77127c-d296-4818-83c4-8c6cde118313
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-24 21:06:29", "repo_name": "couchbaselabs/flink-connector-couchbase", "sub_path": "/src/main/java/com/couchbase/connector/flink/JsonDocument.java", "file_name": "JsonDocument.java", "file_ext": "java", "file_size_in_byte": 636, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "5859d37118885f5aeb0de57fd5f6cc8e0ef50f99", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/couchbaselabs/flink-connector-couchbase
222
FILENAME: JsonDocument.java
0.233706
/* * Copyright 2020 Couchbase, Inc. * * Licensed 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 com.couchbase.connector.flink; import static java.util.Objects.requireNonNull; public class JsonDocument { private final String id; private final byte[] content; public JsonDocument(String id, byte[] content) { this.id = requireNonNull(id); this.content = requireNonNull(content); } public String id() { return id; } public byte[] content() { return content; } }
f632fcac-b4e4-4af9-b0cb-7c415bb0fe5e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-10T02:16:20", "repo_name": "Karla-Rodrigues/StarWars", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1084, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "85dcd766570a9f959a430458093e402113aef664", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Karla-Rodrigues/StarWars
258
FILENAME: README.md
0.249447
* starwars-app * Developed by Karla Rodrigues - December 01, 2020. Access to API (https://swapi.dev/api/) to fetch information about characteres and spaceships. Each page will return 8 characters and 1 spaceship, with possibility to pagination. Store the data in Redux. The App is responsive for mobile, tablet and desktop. The App use one independent component for each part: 1 - Banner 2 - People: the collective of all characters 3 - Ships: the collective of all spaceships 4 - Pagination: the control for pagination 5 - Character: the detail information of each character 6 - Starship: the detail information of each spaceship 7 - Footer *The number of characters and spaceships can be adapt for diferent situations. The application uses: - Boostrap 4.1.1 - redux - Redux DevTools - react-router-dom - react-redux - react-loader-spinner - fonts.googleapis.com: Jura - CSS for react-loader-spinner ** To improve ** 1 - a secure Loop in the access to API with automatic control of pages (it's forced code at the moment); 2 - a better error control in the Redux information
32a10af0-d92f-4a96-8e87-0b296b6e8831
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-05 03:48:32", "repo_name": "y723109056/mx", "sub_path": "/src/main/java/com/mx/listener/DataSourceListener.java", "file_name": "DataSourceListener.java", "file_ext": "java", "file_size_in_byte": 961, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "3eb940d9bf56f01f6bd510bb0492191a6f7207f4", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/y723109056/mx
256
FILENAME: DataSourceListener.java
0.288569
/* * banger Inc. * Copyright (c) 2009-2012 All Rights Reserved. * ToDo :This is Class Description... * Author :huyb * Create Date:2014-5-23 */ package com.mx.listener; import com.mx.sql.util.SqlHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class DataSourceListener implements ServletContextListener { private static final Logger logger = LoggerFactory.getLogger(DataSourceListener.class); /** * @param arg0 * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) */ @Override public void contextDestroyed(ServletContextEvent arg0) { } /** * @param arg0 * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) */ @Override public void contextInitialized(ServletContextEvent arg0) { logger.info("DataSourceListener initialized"); try{ SqlHelper.testConnection(); }catch(Exception e){ e.printStackTrace(); } logger.info("DataSourceListener initialize done"); } }
2a3dce61-48d1-4172-a7b8-c08e78b36e85
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-06 06:56:55", "repo_name": "Gin594/Fitness-App", "sub_path": "/app/src/main/java/com/example/project/ui/routes/WalkFragment.java", "file_name": "WalkFragment.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "dd59d426de8cd1863c44b23b10f3164d43073279", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Gin594/Fitness-App
173
FILENAME: WalkFragment.java
0.200558
package com.example.cse110project.ui.routes; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import com.example.cse110project.R; public class WalkFragment extends Fragment { private RoutesViewModel routesViewModel; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { /*routesViewModel = ViewModelProviders.of(this).get(RoutesViewModel.class); final TextView textView = root.findViewById(R.id.text_routes); routesViewModel.getText().observe(this, new Observer<String>() { @Override public void onChanged(@Nullable String s) { textView.setText(s); } });*/ View root = inflater.inflate(R.layout.fragment_walk, container, false); return root; } }
e3d20a5f-b2e5-4a55-ad45-3f6c2dd2d159
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-22T18:24:00", "repo_name": "slokat/pullrequestwatcher", "sub_path": "/ansible/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1033, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "f2ba086a6994b00008cca1663f7781f8762efb2b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/slokat/pullrequestwatcher
231
FILENAME: README.md
0.246533
## ansible part This will basically setup on the remote host ( here server ) what is necessary for the docker-compose to run and be launched by ansible Assumption made here in this case, the vm is running UBUNTU 20.04 and network setup is done Used useful roles from geerlingguy that take care of docker installation ( compose included ) as well as pip and required modules for ansible docker_compose main playbook install_compose_up is doing the installation of components + docker compose up compose_up is doing the strict compose up ( could have factored code in task/role and include it) compose_down is doing the strict compose down to run this:\ ansible-galaxy role install -r requirements.yaml is required then:\ ansible-playbook install_compose_up.yaml -K --ask-vault-pass -K as become:true is required\ --ask-vault-pass as env file for docker compose has been encrypted ( it contains sensible information see sample)\ for other playbooks - ansible-playbook compose_up.yaml -K - ansible-playbook compose_down.yaml -K
73612381-4cac-456d-8fac-c1e005bb73e0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-10-30T19:29:02", "repo_name": "matiktli/droneApp", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1059, "line_count": 43, "lang": "en", "doc_type": "text", "blob_id": "e90005ee888edb4adfe21abc805b647e61f17464", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/matiktli/droneApp
305
FILENAME: README.md
0.27513
# Flying Drone from scratch - Weekend Project ## Idea: * Fly drone via script file :heavy_check_mark: * Fly drone via ps4 controller :heavy_check_mark: * Detec faces via drone camera: * CV2 Model :heavy_check_mark: * Own ML Model :construction: * Fly drone via AI Model :heavy_check_mark: ## Technology stack: * Python * OpenCv, PsDrone * Parrot Drone 2.0 * PS4 Controller ## MiniBlog: * First Flight (drone camera): https://youtu.be/9-TKB-jhHuk * Face Detection with OpenCV (drone camera): https://youtu.be/b6aHsCXbwkg * First flight controlled via Face Recognition AI (drone camera): https://youtu.be/b5_x-R-2N9c --- ### Run: * Pre-requirements: * Parrot AR Drone 2.0 - connected * PS4 Controller - connected * Lib: OpenCv * Run commands: * Normal run: `python app.py` * Dev mode (engines, recording disabled): `python app.py dev` ### Key binding: * L_toggle -> left,right,forward,backward * R_toggle -> turn_left,turn_right,up,down * Triangle -> AI Mode * Square -> Switch camera * Circle -> Land * X -> TakeOff * Options -> shutdown
fcc63bde-e908-4c0a-a1b7-f5f2ccc7ebc8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-23 10:14:32", "repo_name": "meiheyoupin/meiheyoupin", "sub_path": "/src/main/java/com/meiheyoupin/common/utils/CommonUtil.java", "file_name": "CommonUtil.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "20c2bb3b6289d92a20add565e2bd45a84d39d7e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/meiheyoupin/meiheyoupin
221
FILENAME: CommonUtil.java
0.236516
package com.meiheyoupin.common.utils; import javax.servlet.http.HttpServletRequest; public class CommonUtil { public CommonUtil() { } public static int getIntFromString(String str) { int ret = 0; if(str != null) { try { ret = Integer.parseInt(str); } catch (NumberFormatException var3) { ret = 0; } } return ret; } /** * 得到请求参数 * @param request request * @param name 请求参数key * @param def 默认值 * @return 请求参数value */ public static String GetRequestParam(HttpServletRequest request, String name, String def) { if(request == null) { return def; } else { String value = request.getParameter(name); return value != null && !value.equals("")?value:def; } } public static String getExtention(String fileName) { int pos = fileName.lastIndexOf("."); return fileName.substring(pos + 1).toLowerCase(); } }
4d2ab511-a3aa-4553-87c3-5746edb995c7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2012-05-31T03:49:03", "repo_name": "jrawlings/udacity_cs253", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1055, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "4098ae29c85f31863ddaf3075502e04a5d673e47", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jrawlings/udacity_cs253
242
FILENAME: README.md
0.240775
Udacity 253: Web Application Engineering ======================================== http://www.udacity.com/overview/Course/cs253/CourseRev/apr2012 Description ----------- Web applications have the power to provide useful services to millions of people worldwide. In this class, you will learn how to build your own blog application starting from the basics of how the web works and how to set up a web application and process user input, to how to use databases, manage user accounts, interact with other web services, and make your application scale to support large numbers of users. WEEK 1:How the Web Works * Introduction to HTTP and Web Applications WEEK 2:How to Have Users * Getting and processing user input WEEK 3:How to Manage State * Databases and persistent data WEEK 4:Whom to Trust * User authentication and access control WEEK 5:How to Connect * Web applications as services, using APIs WEEK 6:How to Serve Millions * Scaling, caching, optimizations WEEK 7:Changing the World * Building a successful web application, project
4a30de4f-cc86-4136-b45f-7465e2e37a3d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-09 14:09:55", "repo_name": "tjf952/AP_CompSci", "sub_path": "/GUI/2_Dialogs/SpiritAnimal.java", "file_name": "SpiritAnimal.java", "file_ext": "java", "file_size_in_byte": 974, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "915ca6dca71e8e5cfac7b995ef60bc05776a1a4e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tjf952/AP_CompSci
208
FILENAME: SpiritAnimal.java
0.271252
import javax.swing.*; public class SpiritAnimal { public static void main(String[]args){ // Choices Object[] choices = {"Eagle", "Bear", "Cobra", "Tiger", "Elephant", "Owl"}; //JFrame String result = (String)JOptionPane.showInputDialog( null, // Creates frame "Enter an Animal", // Heading "Spirit Animal", // Title JOptionPane.PLAIN_MESSAGE, // Font Stlye null, // Icon Logo null, // Choices null); // Default Answer if((result != null) && (result.length() > 0)){ System.out.println("You are now a " + result + "."); for (Object element: choices) { if(element.equals(result)) { System.out.println( "Your ancestors are watching over you!"); } } return; } System.out.println("You must pick an animal."); } }
2a08c083-425c-4bcd-92ad-4aaf0d9de04e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-04 15:10:05", "repo_name": "AAAliuAAA/LiujhHMS", "sub_path": "/src/main/java/com/smepms/smepmschats/websocket/websocketinterceptor/HandshakeInterceptor.java", "file_name": "HandshakeInterceptor.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "9fc4549385b5e3a588271d4b4ec18286099d55a8", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AAAliuAAA/LiujhHMS
230
FILENAME: HandshakeInterceptor.java
0.245085
package com.smepms.smepmschats.websocket.websocketinterceptor; import org.apache.log4j.Logger; import org.springframework.http.server.ServerHttpRequest; import org.springframework.http.server.ServerHttpResponse; import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor; import java.util.Map; /** * 握手拦截器,为了了解到什么时候握手以及是否成功握手 */ public class HandshakeInterceptor extends HttpSessionHandshakeInterceptor { private final static Logger logger = Logger.getLogger(HandshakeInterceptor.class); @Override public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception { //在握手发生之前 logger.info("即将开始进行握手"); return super.beforeHandshake(request,response,wsHandler,attributes); } @Override public void afterHandshake(ServerHttpRequest request,ServerHttpResponse response,WebSocketHandler wsHandler,Exception ex){ //在握手发生之后 logger.info("握手完成"); super.afterHandshake(request,response,wsHandler,ex); } }
b461e818-5da6-47ba-997d-5b1c69ff343a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-28 10:10:46", "repo_name": "bahaso/tests", "sub_path": "/BahasoTest/src/bahaso/testing/androidElement/Home.java", "file_name": "Home.java", "file_ext": "java", "file_size_in_byte": 1098, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "23029d2cd60de20f734fe5c8c824ea746692684f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/bahaso/tests
246
FILENAME: Home.java
0.288569
package bahaso.testing.androidElement; import java.util.ArrayList; import org.openqa.selenium.WebElement; import io.appium.java_client.android.AndroidDriver; public class Home { AndroidDriver driver; public Home(AndroidDriver driver){ this.driver = driver; } public ArrayList<WebElement> getTab(){ return (ArrayList<WebElement>) driver.findElementsById("com.bahaso:id/tab"); } public WebElement searchMenu(String menu){ ArrayList<WebElement> Element = (ArrayList<WebElement>) driver.findElementsById("com.bahaso:id/title"); for(int i=0;i<Element.size();i++){ if(Element.get(i).getText().equals(menu)){ return Element.get(i); } } return null; } public WebElement getMenuOverflow(){ return driver.findElementById("com.bahaso:id/menu_overflow"); } public WebElement getCourse(){ return driver.findElementById("com.bahaso:id/cv_lesson"); } public WebElement getBtnSetting(){ return driver.findElementById("com.bahaso:id/icon_setting"); } public WebElement getAllTypeCase(){ return driver.findElementById("com.bahaso:id/cv_type_case"); } }
c08bcbf7-cac6-4f2f-aa1e-16e7aced1583
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-11-03T12:24:15", "repo_name": "nmd88/datamining", "sub_path": "/docs/hadoop_intro.md", "file_name": "hadoop_intro.md", "file_ext": "md", "file_size_in_byte": 1020, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "8c679c7535c8bacacf52ee851a57c33dadf78049", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nmd88/datamining
210
FILENAME: hadoop_intro.md
0.229535
HADOOP INTRODUCTION --- Apache HADOOP is a framework used to develop data processing applications which are executed in a distributed computing environment. Similar to data residing in a local file system of personal computer system, in Hadoop, data resides in a distributed file system which is called as a Hadoop Distributed File system. Processing model is based on 'Data Locality' concept wherein computational logic is sent to cluster nodes(server) containing data. This computational logic is nothing but a compiled version of a program written in a high level language such as Java. Such a program, processes data stored in Hadoop HDFS. HADOOP is an open source software framework. Applications built using HADOOP are run on large data sets distributed across clusters of commodity computers. Commodity computers are cheap and widely available. These are mainly useful for achieving greater computational power at low cost. # 1. Components of Hadoop ## 1.1. Zookeeper - Coordination ## 1.2. Ambari -
c164f2ec-8e57-428c-880a-10760f55a785
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-18 14:44:13", "repo_name": "newbare/CorpDesk", "sub_path": "/src/main/java/lv/javaguru/java3/core/commands/comment/CreateCommentCommand.java", "file_name": "CreateCommentCommand.java", "file_ext": "java", "file_size_in_byte": 1120, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "de881a9c5abdc35415a09e619bf2061fd0fd8c40", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/newbare/CorpDesk
222
FILENAME: CreateCommentCommand.java
0.245085
package lv.javaguru.java3.core.commands.comment; import lv.javaguru.java3.core.commands.DomainCommand; import java.sql.Date; /** * Created by svetlana on 28/11/15. */ public class CreateCommentCommand implements DomainCommand<CreateCommentResult> { private Long postId; private Long userId; private String text; private Date postedDate; private Date modifiedDate; public CreateCommentCommand(Long postId, Long userId, String text, Date postedDate, Date modifiedDate) { this.postId = postId; this.userId = userId; this.text = text; this.postedDate = postedDate; this.modifiedDate = modifiedDate; } public Long getPostId() { return postId; } public Long getUserId() { return userId; } public String getText() { return text; } public Date getPostedDate() { return postedDate; } public Date getModifiedDate() { return modifiedDate; } }
4b2b133c-c166-484d-b098-0325802108aa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-08T19:31:09", "repo_name": "ebastreghi/springwebflux-heroes-management", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1058, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "40d3247bea6404d38859fe47c639768b742280a9", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ebastreghi/springwebflux-heroes-management
246
FILENAME: README.md
0.285372
Spring Webflux, AWS SDK, Swagger, DynamoDB, JUnit Enable AWS Access Key Install AWS CLI Open terminal and type: aws configure ****************************************** Download local DynamoDB in tyhe link bellow https://docs.aws.amazon.com/pt_br/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html Execute the command bellow in the directory that you extract the zip file java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb OR docker run -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -inMemory -sharedDb ******************************************* ******************** Open the project run the class com.springwebfluxheroesmanagement.config.HeroesTable to create the table run the class com.springwebfluxheroesmanagement.config.HeroesData to populate the table and then openthe url bellow to make tests with swagger http://localhost:8080/swagger-ui-heroes-reactive-api.html ******************** Acces DynamoDB in localhost aws dynamodb list-tables --endpoint-url http://localhost:8000
6216b8fe-2275-47f4-96f0-b481e8b364f5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-20 08:21:33", "repo_name": "jfs-rupesh/jfs-repo", "sub_path": "/Spring/Labs/l05-crud-hibernate-oracle-lab/src/com/demo/dao/CustomerDAOImpl.java", "file_name": "CustomerDAOImpl.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "561cb416c21ef723f58711ace5ae15091bac8cdc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jfs-rupesh/jfs-repo
200
FILENAME: CustomerDAOImpl.java
0.242206
package com.demo.dao; import javax.persistence.EntityManager; import javax.persistence.EntityTransaction; import com.demo.entity.Customer; public class CustomerDAOImpl implements CustomerDao{ private EntityManager entityManager = null; public CustomerDAOImpl() { entityManager = JPAUtil.getEntityManager(); } @Override public Customer getCustomerById(int id) { return entityManager.find(Customer.class, 100); } @Override public void addCustomer(Customer customer) { entityManager.persist(customer); System.out.println("Customer persisted in the database"); } @Override public void removeCustomer(Customer customer) { entityManager.remove(customer); } @Override public void updateCustomer(Customer customer) { entityManager.merge(customer); } @Override public void commitTransaction() { EntityTransaction entityTransaction = entityManager.getTransaction(); entityTransaction.commit(); } @Override public void beginTransaction() { EntityTransaction entityTransaction = entityManager.getTransaction(); entityManager.getTransaction().begin(); } }