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
|
|---|---|---|---|---|---|---|
0c645879-bd38-41d6-99be-c830c760c59c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-08-27 05:00:35", "repo_name": "curtisullerich/attendance", "sub_path": "/src/main/java/edu/iastate/music/marching/attendance/model/store/MobileDataUpload.java", "file_name": "MobileDataUpload.java", "file_ext": "java", "file_size_in_byte": 1184, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "fb19058c36428e4fec16c76ffe8ff7105a737a44", "star_events_count": 6, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/curtisullerich/attendance
| 257
|
FILENAME: MobileDataUpload.java
| 0.239349
|
package edu.iastate.music.marching.attendance.model.store;
import java.util.Date;
import org.joda.time.DateTime;
import com.google.appengine.api.datastore.Text;
import com.google.code.twig.annotation.Activate;
import com.google.code.twig.annotation.Entity;
import com.google.code.twig.annotation.Type;
@Entity(kind = "MobileDataUpload", allocateIdsBy = 0)
public class MobileDataUpload {
public static final String FIELD_UPLOADER = "uploader";
@Activate
private User uploader;
private Date timestamp;
@Type(Text.class)
private String data;
@Type(Text.class)
private String error;
MobileDataUpload() {
}
public String getData() {
return this.data;
}
public String getErrorMessage() {
return this.error;
}
public DateTime getTimestamp() {
return new DateTime(this.timestamp);
}
public User getUploader() {
return this.uploader;
}
public void setData(String uploadData) {
this.data = uploadData;
}
public void setErrorMessage(String message) {
this.error = message;
}
public void setTimestamp(DateTime uploadTime) {
this.timestamp = uploadTime.toDate();
}
public void setUploader(User uploader) {
this.uploader = uploader;
}
}
|
635d867c-3580-4914-a399-1f0cd8a82e9d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-28 16:57:44", "repo_name": "psikoi/pa_project_01", "sub_path": "/PA_Project01/src/graphics/views/menus/AccountDetailsLoginMenu.java", "file_name": "AccountDetailsLoginMenu.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "74b9ba2a904d7f620786a569c791f60f7e0036be", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/psikoi/pa_project_01
| 205
|
FILENAME: AccountDetailsLoginMenu.java
| 0.290981
|
package graphics.views.menus;
import game.Main;
import game.models.User;
import session.SessionManager;
/**
*
* @author Tiago
*/
public class AccountDetailsLoginMenu extends LoginMenu{
public AccountDetailsLoginMenu(){
super();
super.getSingleLoginMenu().getLoginButton().setOnAction(e -> {
String username;
username = super.getSingleLoginMenu().getUsername();
if(super.getSingleLoginMenu().login()){
Main.switchContent(new AccountOptionsMenu(username));
}
});
super.getSingleLoginMenu().getSelectButton().setOnAction(e -> {
User s = SessionManager.getLoggedInUsers().get(super.getSingleLoginMenu().getUserSelection().getSelectionModel().getSelectedIndex());
if (s != null) {
Main.switchContent(new AccountOptionsMenu(s.getUsername()));
}
});
super.getBackButton().setOnAction(e -> {
Main.switchContent(new HomeScreenMenu());
});
}
}
|
ba2ef22c-2f4a-4d75-929c-7c82aa14ba26
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-30 19:30:29", "repo_name": "SharmilaSherin/ICTAssignmentAmazon", "sub_path": "/src/test/java/Execution.java", "file_name": "Execution.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "c4737fbd4f6582f7583eae3d61108c5b445170ad", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SharmilaSherin/ICTAssignmentAmazon
| 241
|
FILENAME: Execution.java
| 0.262842
|
import com.aventstack.extentreports.Status;
import org.openqa.selenium.By;
import org.openqa.selenium.ElementNotInteractableException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;
import java.io.IOException;
import java.net.InetAddress;
public class Execution extends Report {
WebDriver driver = Driver.openBrowser("chrome", "https://www.amazon.in/");
@Test(priority = 0)
public void Valid_LoginTest() throws IOException, InterruptedException {
extentTest=reports.createTest("LoginTest");
Login loginPage = new Login(driver);
loginPage.Login("sharmilasherin181@gmail.com","sherin123");
loginPage.is_Valid();
extentTest.log(Status.PASS,"Login Passed");
extentTest.addScreenCaptureFromPath(Driver.takeScreenshot());
Driver.closeBrowser();
}
//@Test(priority = 1)
// public void Invalid_LoginTest() throws IOException{
// Login login = new Login(driver);
// login.Login("sharmilashe@gmail.com","sherun123");
// Driver.closeBrowser();
// login.is_InValid();
//
// }
//
}
|
efddf97a-4f76-4181-8ee0-6cd4ca809d59
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-01-30T10:45:55", "repo_name": "StanczakDominik/sem7", "sub_path": "/HPC2.md", "file_name": "HPC2.md", "file_ext": "md", "file_size_in_byte": 1013, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "0101319199e88f8131bd6c72c755c1651483929d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/StanczakDominik/sem7
| 273
|
FILENAME: HPC2.md
| 0.262842
|
in 3 weeks: visit to IL cluster
~today: first task info
NERSC PDSF
* a "classical" cluster
* 18k jobs pending
* cluster security
* can actually create account there, if you're from a group
* a "farm of computers" - each core has memory, disk space. no need to communicate.
* nodes
* interactive (login, ~100 user sessions) - 16 cores, 125 gb memory, 200 gb scratch space
* transfer nodes - just moving data - 10gb/s network
* compute nodes
* various processors, hardware due to upgrades being spaced in time * throw away old power inefficient nodes
* TITAN 9MW includes a whole lot of cooling
* file systems
* tape!
* online monitoring
* buying computing time on cluster - responsibility of person running hardware
LHC prouction pass with ALIroot - 188y CPU time, 9y saving time
Xrootd - middleman, integrates any hardware and represents it outside as single file
ALICE LEGO trains: plug job into a specific setup, someone runs that centrally (on many nodes, more than you have permissions)
|
105f80ef-7e37-4e32-ac9a-7cdc589fa341
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-25 07:20:09", "repo_name": "renxiangnan/kbqa.techno-proto", "sub_path": "/src/main/java/fragment/collection/EntityFragmentCollection.java", "file_name": "EntityFragmentCollection.java", "file_ext": "java", "file_size_in_byte": 1158, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "1f57f7e4dfd954a980faf58815b1bfb48b1f60f7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/renxiangnan/kbqa.techno-proto
| 221
|
FILENAME: EntityFragmentCollection.java
| 0.253861
|
package fragment.collection;
import fragment.EntityFragment;
import lucene.EntityFragmentFields;
import java.util.HashMap;
import java.util.Map;
public class EntityFragmentCollection {
private Map<Integer, EntityFragment> entityFragmentMap;
public EntityFragmentCollection() {
entityFragmentMap = new HashMap<>();
}
public Map<Integer, EntityFragment> getEntityFragmentMap() { return entityFragmentMap; }
public EntityFragment getEntityFragmentById(int id, EntityFragmentFields entFgmtFields) {
if (!entityFragmentMap.containsKey(id)) {
entityFragmentMap.put(id, getEntityFragmentByEntityId(id, entFgmtFields));
}
return entityFragmentMap.get(id);
}
private EntityFragment getEntityFragmentByEntityId(Integer entityId,
EntityFragmentFields entFgmtFields) {
String entFgmt = "";
try {
entFgmt = entFgmtFields.getEntityFragment().get(entityId);
} catch (NullPointerException e) {
e.printStackTrace();
}
return new EntityFragment(entityId, entFgmt);
}
}
|
1bd9647e-e4fc-4694-b5ff-4862a3dab452
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-16 21:15:30", "repo_name": "Mega31/ShopServlet", "sub_path": "/src/main/java/com/shop/in/controller/PanelController.java", "file_name": "PanelController.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "36d6c71c16af0ab06471775981ee9a8965f3e977", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/Mega31/ShopServlet
| 170
|
FILENAME: PanelController.java
| 0.23793
|
package com.shop.in.controller;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet(urlPatterns = "/panel")
public class PanelController extends HttpServlet {
String fruits = "banana";
protected void process(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setAttribute("Fruits",fruits);
// req.setAttribute("vegetables",readingBean.vegReader());
req.getRequestDispatcher("panel.jsp").forward(req,resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
process(req,resp);
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
process(req,resp);
}
}
|
16f3dc29-d1c0-4f39-8f9f-b596758e22f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-25 01:32:03", "repo_name": "chuxuecentaline/AdvanceAndroid", "sub_path": "/app/src/main/java/com/example/cherish/salehouse_kotlin/utils/observer/LibraryManager.java", "file_name": "LibraryManager.java", "file_ext": "java", "file_size_in_byte": 1054, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "3c905294f3b5ccb024888d154dfa4dfe174d4e20", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/chuxuecentaline/AdvanceAndroid
| 224
|
FILENAME: LibraryManager.java
| 0.27513
|
package com.example.cherish.salehouse_kotlin.utils.observer;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
/**
* 图书管理
* Created by cherish
*/
public class LibraryManager extends Observable implements IBookFunction {
List<String> books;
public LibraryManager() {
books=new ArrayList<>();
}
@Override
public void addBook(String name) {
books.add(name);
setChanged();
notifyObservers(name);
}
@Override
public void removeBook(String name) {
books.remove(name);
setChanged();
notifyObservers(name);
}
@Override
public void updateBook(String name) {
books.add(name);
setChanged();
notifyObservers(name);
}
@Override
public int count() {
return books.size();
}
@Override
public void selectBook() {
for (int i = 0; i < books.size(); i++) {
System.out.println("查询"+books.get(i));
}
}
}
|
1af9b078-757a-4a1b-a13c-ccdec40cee68
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-05-12T20:05:38", "repo_name": "mxahan/GAN_DL_project", "sub_path": "/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1135, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "da58cc3478926426eac61e30e4fd56b2318d2d2e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mxahan/GAN_DL_project
| 387
|
FILENAME: readme.md
| 0.286169
|
## Project Materials
Project Presentation Link: https://drive.google.com/open?id=1twauAIF2LvdOTJyLwRNZ9-5RtGU2yC8v
Project Proposal link: https://drive.google.com/open?id=1MdT1NK2dv749-j0jRR2ToavHTVll3A-0
## Short Video presentation of the SGAN and the codes
Video Link: https://drive.google.com/open?id=1c_mJZpjAzQWQpH6KKyEF_BI_CIG4E2YU
## .gif Links
DCGAN link: https://drive.google.com/open?id=1aJMNTirSqS1TSuTDoSNDkxvIFn7iW4Hk
CatGAN link: https://drive.google.com/open?id=1MKy68pcrb_RTgo_uBimuwQO5sKWr1SKw
https://drive.google.com/open?id=15COl7px5dK-TtzfDC3UT4if4Neh_JGzO
## Code description
### CatGAN
The CatGAN files are
- CatGan-Monkey_256.ipynb - For running the dataset in 256x256 resolution
- CatGan-Monkey_64.ipynb - For running the dataset in 64x64 resolution
- Kaggle_Monkey_dataset_processing.ipynb - Data processing (Not used)
Others are developed by different developer.
### SGAN
The Semi-supervised codes are inside the working_codes directory in this repository. [link](https://github.com/mxahan/GAN_DL_project/tree/master/Working_codes)
The detail instructions are there for running SGAN codes.
|
a29d3169-ba88-4bed-893c-a1d9d0fa1fae
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-02 01:02:53", "repo_name": "landru29/Quizz", "sub_path": "/android/Quizz/app/src/main/java/fr/noopy/landru/quizz/tools/MarkdownProcessor.java", "file_name": "MarkdownProcessor.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "bc25ece7db7d0572e8c1f1e15a40e20f9e6f7d57", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/landru29/Quizz
| 248
|
FILENAME: MarkdownProcessor.java
| 0.253861
|
package fr.noopy.landru.quizz.tools;
import android.util.Log;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.markdown4j.Markdown4jProcessor;
/**
* Created by cyrille on 13/02/15.
*/
public class MarkdownProcessor {
private Markdown4jProcessor markdownFourJProcessor;
public MarkdownProcessor() {
this.markdownFourJProcessor = new Markdown4jProcessor();
}
public String toHtml(String data) {
String markdown = "";
try {
markdown = markdownFourJProcessor.process(preProcessing(data));
} catch (IOException err) {
Log.w("Markdown", err.getMessage());
}
return postProcessing(markdown);
}
private String preProcessing(String data) {
return data;
}
private String postProcessing(String data) {
Pattern regex = Pattern.compile("href=\"(\\/)([^\"]*)\"");
Matcher regexMatcher = regex.matcher(data);
String resultString = regexMatcher.replaceAll("href=\"http://quizz.noopy.fr/$2\"");
Log.i("RULES", resultString);
return resultString;
}
}
|
30e43378-5856-4c45-bad7-ae1ad97339b6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-07-10T02:07:14", "repo_name": "kenalib/datav-webapi-spring", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1090, "line_count": 56, "lang": "en", "doc_type": "text", "blob_id": "de0673c0f80812b514e5010363ed628d4e8ccda9", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kenalib/datav-webapi-spring
| 346
|
FILENAME: README.md
| 0.27513
|
# DataV Tools
## Heat Map
[Heat Map README](./README-heat-map.md)
## Flying Routes
[Flying Routes README](./README-flying-routes.md)
## Test and Run
```bash
mvn test
mvn spring-boot:run
open http://localhost:8080/air-data/aqi?date=2017012722
open http://localhost:8080/flying-routes.html
open http://localhost:8080/flying-routes/japan
```
## Run from DockerHub
* https://spring.io/guides/gs/spring-boot-docker/
```bash
mvn package
# sample docker ID: kenali (update to your ID in pom.xml docker.image.prefix)
mvn dockerfile:build
mvn dockerfile:push
# run manually in case of push error
docker push kenali/datav-quick-start:latest
```
```bash
docker run --name=datav-quick-start -d -p 80:8080 -t kenali/datav-quick-start
open http://localhost/air-data/aqi?date=2017012722
open http://localhost/flying-routes.html
```
```bash
# when image is updated
docker pull kenali/datav-quick-start
docker stop datav-quick-start
docker rm datav-quick-start
# docker run again
```
## Reference
* https://spring.io/guides/gs/rest-service/
* https://github.com/kenalib/datav-webapi-spring
|
2b1f8dcf-7d5d-4c24-bfae-cab344edd03e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-10 04:35:08", "repo_name": "minhkudo/project", "sub_path": "/src/main/java/com/dev/vin/demo/model/Sub_teach.java", "file_name": "Sub_teach.java", "file_ext": "java", "file_size_in_byte": 1184, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "9208bde9855b3e606885628c6963b5e8b6a69ef6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/minhkudo/project
| 279
|
FILENAME: Sub_teach.java
| 0.26971
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.dev.vin.demo.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
/**
*
* @author MinhKudo
*/
@Entity
@Table(name = "map_sub_teach")
public class Sub_teach {
@Id
@GeneratedValue
@Column(name = "ID", length = 11)
private int id;
@Column(name = "CODE_SUB", length = 255)
private String code_sub;
@Column(name = "CODE_TEACH", length = 255)
private String code_teach;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCode_sub() {
return code_sub;
}
public void setCode_sub(String code_sub) {
this.code_sub = code_sub;
}
public String getCode_teach() {
return code_teach;
}
public void setCode_teach(String code_teach) {
this.code_teach = code_teach;
}
}
|
41176e41-fc86-4a14-903f-8fbc5a0b5ff1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-17 06:06:04", "repo_name": "0r0loo/spring5-mvc-study", "sub_path": "/40_MiniProjectJava/src/com/cho/interceptor/TopMenuInterceptor.java", "file_name": "TopMenuInterceptor.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "796ce214166e4ebe8635ba5a3a775e11b90cbdde", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/0r0loo/spring5-mvc-study
| 227
|
FILENAME: TopMenuInterceptor.java
| 0.282988
|
package com.cho.interceptor;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.HandlerInterceptor;
import com.cho.beans.BoardInfoBean;
import com.cho.beans.UserBean;
import com.cho.service.TopMenuService;
public class TopMenuInterceptor implements HandlerInterceptor{
// 인터셉터에선 bean을 주입받을수없다
private TopMenuService topMenuService;
private UserBean loginUserBean;
public TopMenuInterceptor(TopMenuService topMenuService, UserBean loginUserBean) {
this.topMenuService = topMenuService;
this.loginUserBean = loginUserBean;
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
List<BoardInfoBean> topMenuList = topMenuService.getTopMenuList(); // 인터셉터에서는 객체를 자동주입을 못받는다
request.setAttribute("topMenuList", topMenuList);
request.setAttribute("loginUserBean", loginUserBean);
return true;
}
}
|
22573972-1705-4de7-bd89-1c2fdd0696e9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-02 09:49:59", "repo_name": "Enixma/Mobile-Sample-Project", "sub_path": "/app/src/main/java/com/enixma/sample/mobile/presentation/pager/MobilePagerAdapter.java", "file_name": "MobilePagerAdapter.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "ee88aa1e0a86e438b1f5a5027b904eef0ae2b444", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Enixma/Mobile-Sample-Project
| 221
|
FILENAME: MobilePagerAdapter.java
| 0.23092
|
package com.enixma.sample.mobile.presentation.pager;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.enixma.sample.mobile.presentation.alldevice.MobileListFragment;
import com.enixma.sample.mobile.presentation.favorite.FavoriteListFragment;
/**
* Created by nakarinj on 18/4/2018 AD.
*/
public class MobilePagerAdapter extends FragmentPagerAdapter {
private MobileListFragment mobileListFragment;
private FavoriteListFragment favoriteListFragment;
public MobilePagerAdapter(FragmentManager fragmentManager, MobileListFragment mobileListFragment, FavoriteListFragment favoriteListFragment) {
super(fragmentManager);
this.mobileListFragment = mobileListFragment;
this.favoriteListFragment = favoriteListFragment;
}
@Override
public Fragment getItem(int position) {
if (position == 0) {
return mobileListFragment;
} else {
return favoriteListFragment;
}
}
@Override
public int getCount() {
return 2;
}
}
|
6bcca2ef-cc5d-496d-8355-fe6a860fb265
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-07-24T06:22:33", "repo_name": "yvasilyev92/WeatherViewer", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1219, "line_count": 15, "lang": "en", "doc_type": "text", "blob_id": "ac2a8f1d235bc89503233c4a5732f75cb0c68fe3", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/yvasilyev92/WeatherViewer
| 256
|
FILENAME: README.md
| 0.286968
|
# WeatherViewer
Android App uses to OpenWeatherMap.org API to show user the Weather in the city of their choice.
This is the WeatherView App from the Android 6 for Programmers book 3rd Edition by Deitel Developer Series. (C) Copyright 1992-2014 by Deitel & Associates, Inc. and Pearson Education, Inc. All Rights Reserved.
This app shows how to use REST Web Services, AsyncTask, HttpUrlConnection, Processing JSON Responses, JSONObject, JSONArray, ListView,
ArrayAdapter, ViewHolder Pattern, and TextInputLayout.
The WeatherViewer App uses the free OpenWeatherMap.org REST Webservies to obtain a 16-day weather forecast depending on the city
the user specifies. We use an AsyncTask and HttpUrlConnection to invoke REST web service to download an image in a separate thread and
deliver the results to the GUI thread. We process a JSON response using package org.json classes JSONObjects and JSONArrays.
We define an ArrayAdapter that specifies the data to display in a ListView. We use the ViewHolder pattern to reuse views that scroll off
the screen in a ListView.
I, myself, specifically commented on every line of code so that a beginner Android developer may clearly understand and learn from this application.
|
151a58df-5333-456e-a044-b4fb8f545f86
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-31 17:23:16", "repo_name": "springdeveloper/BlockingQueue", "sub_path": "/src/com/app/navneet/Consumer.java", "file_name": "Consumer.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "b155b073d60fd013cfb9991ac13438a016511221", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/springdeveloper/BlockingQueue
| 257
|
FILENAME: Consumer.java
| 0.26971
|
package com.app.navneet;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;
public class Consumer implements Runnable{
private final String name;
private final Integer id;
BlockingQueue<Message> message;
private AtomicBoolean running = new AtomicBoolean();
public Consumer(String name, Integer id, BlockingQueue<Message> message) {
super();
this.name = name;
this.id = id;
this.message = message;
running.set(true);
}
@Override
public void run() {
try {
while (running.get()) {
System.out.println("Start Consuming Thread " + this.name+" "+this.message.size());
System.out.println(this.message.take().toString());
Thread.sleep(100);
}
} catch (Exception e) {
e.printStackTrace();
}finally {
Thread.currentThread().interrupt();
running.set(false);
System.out.println("Stop Running "+this.running.get());
}
}
public void setStop(boolean flag) {
this.running.set(flag);
}
@Override
public String toString() {
return "Producer [name=" + name + ", id=" + id + ", message=" + message + "]";
}
}
|
9a65ff9f-989a-4c2b-830b-6fcf335e8537
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-01 18:14:56", "repo_name": "pallavi17bhatt/Thor", "sub_path": "/app/src/main/java/com/example/thor/CityWeather.java", "file_name": "CityWeather.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "1bfa6e5bc3d495c833544fdf85277164e79d8d51", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pallavi17bhatt/Thor
| 211
|
FILENAME: CityWeather.java
| 0.246533
|
package com.example.thor;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
public class CityWeather extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_city__weather);
Intent i = getIntent();
String infoData = i.getStringExtra(MainActivity.info_data);
GsonBuilder builder = new GsonBuilder();
Gson gson = builder.create();
WeatherInfo info = gson.fromJson(infoData, WeatherInfo.class);
String description = info.getWeather()[0].getDescription();
String cityName = info.getName();
String speed = Double.toString(info.getWind().getSpeed());
String visibility = Integer.toString(info.getVisibility());
String temp = Double.toString(info.getMain().getTemp());
TextView t = findViewById(R.id.textView);
t.setText(description + "," + cityName + "," + speed + "," + visibility + "," + temp) ;
}
}
|
217caaeb-01d9-4e9e-81b6-fff2419894c2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-17 14:05:38", "repo_name": "Zdanchan/plwordnetMobile", "sub_path": "/plwordnetMobileService/src/main/java/com/pwr/bzapps/plwordnetmobile/service/database/entity/grammar/PartOfSpeechEntity.java", "file_name": "PartOfSpeechEntity.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "224d04c7bd4eb84dbdb80d54b03d3c32e195da89", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Zdanchan/plwordnetMobile
| 297
|
FILENAME: PartOfSpeechEntity.java
| 0.27048
|
package com.pwr.bzapps.plwordnetmobile.service.database.entity.grammar;
import javax.persistence.*;
/**
* `id` bigint(20) NOT NULL AUTO_INCREMENT,
* `name_id` bigint(20) DEFAULT NULL COMMENT 'Name of part of speech',
* `color` varchar(255) CHARACTER SET utf8 COLLATE utf8_polish_ci DEFAULT NULL COMMENT 'Color displayed on visualisation',
* */
@Entity
@Table(name = "part_of_speech")
public class PartOfSpeechEntity {
@Id
private Long id;
@Column(name = "name_id")
private Long nameId;
@Column(name = "color")
private String color;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getNameId() {
return nameId;
}
public void setNameId(Long nameId) {
this.nameId = nameId;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String toString(){
String string = "";
string+="POSE{";
string+="id:" + id + ";";
string+="nameId:" + nameId.toString() + ";";
string+="color:" + color;
string+="}POSE";
return string;
}
}
|
8d53e57c-46a8-4ed9-9381-31110c626165
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-22 12:58:41", "repo_name": "zhangbo1201/nacos-consumer", "sub_path": "/src/main/java/com/zhangbo/nacosconsumer/controller/ConsumerController.java", "file_name": "ConsumerController.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "ce2c8d0f95848c8fb0d9e55efd73b2c2337b4f37", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zhangbo1201/nacos-consumer
| 222
|
FILENAME: ConsumerController.java
| 0.210766
|
package com.zhangbo.nacosconsumer.controller;
import com.zhangbo.nacosconsumer.Service.UserService;
import com.zhangbo.nacosconsumer.client.ProviderClient;
import com.zhangbo.nacosconsumer.jpa.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
@RestController
public class ConsumerController {
@Autowired
RestTemplate restTemplate;
@Autowired
ProviderClient providerClient;
@Autowired
private UserService userService;
@GetMapping("/hi-resttemplate")
public String hiResttemplate(){
return restTemplate.getForObject("http://nacos-provider/hi?name=resttemplate",String.class);
}
@GetMapping("/hi-feign")
public String hiFeign(){
return providerClient.hi("feign");
}
@GetMapping("getUser")
public User getById(@RequestParam(value = "id" ,defaultValue = "1") String id){
return userService.queryById(id);
}
}
|
d479a959-5990-4c24-a484-4a5a40fbc6d1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-03 12:27:57", "repo_name": "jisiwang12/filemove", "sub_path": "/src/main/java/cn/gsq/run/FileDel.java", "file_name": "FileDel.java", "file_ext": "java", "file_size_in_byte": 1231, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "f1824087bea5fcd31a45057c31fb2dcc65075ec6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jisiwang12/filemove
| 267
|
FILENAME: FileDel.java
| 0.286968
|
package cn.gsq.run;
import java.io.File;
import java.util.Scanner;
import java.util.regex.Pattern;
/**
* @author qsefr
* @program: filemove
* @description: 删除jav目录下的poster文件
* @date 2021-03-31 22:09:22
*/
public class FileDel {
public static final String PATTERN = ".*poster.*";
//运行方法,比较字符并删除文件
public void run() {
Scanner scanner = new Scanner(System.in);
System.out.println("请输入路径:");
String path = scanner.nextLine();
File file = new File(path);
File[] files = file.listFiles();
//二级目录
for (File file1 : files) {
//三级文件夹
File[] files1 = file1.listFiles();
for (File file2 : files1) {
String fileName = file2.getName();
if (Pattern.matches(PATTERN, fileName)) {
boolean delete = file2.delete();
if (delete) {
System.out.println("文件" + fileName + "已删除");
} else {
System.out.println("文件" + fileName + "删除失败");
}
}
}
}
}
}
|
87ceccb0-50c0-4e25-9274-f0434a29cc5f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-30 17:35:13", "repo_name": "jwwj/JPetStore", "sub_path": "/src/test/java/com/clps/test/service/LoginServiceImplTest.java", "file_name": "LoginServiceImplTest.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "c745ec4040973ac55f2a0f9d89d2c4abc68f979f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jwwj/JPetStore
| 223
|
FILENAME: LoginServiceImplTest.java
| 0.253861
|
package com.clps.test.service;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.clps.demo.service.LoginService;
import com.clps.demo.util.LogUtil;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
public class LoginServiceImplTest {
@Autowired
private LoginService loginService;
@Test
public void userLogin() {
LogUtil.logger.info(loginService.userLogin("J2EE", "J2EE"));
LogUtil.logger.info(loginService.userLogin("J2EE", "abcd"));
}
@Test
public void querySignon() {
LogUtil.logger.info(loginService.querySignon("J2EE").getPassword());
}
@Test
public void queryProfile() {
LogUtil.logger.info(loginService.queryProfile("J2EE").getFavcategory());
}
}
|
8dc1b4d2-47a5-44f2-9bf5-229aad69dd2a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-08-10T15:58:28", "repo_name": "CharlesAttend/Wallpaper-Changer", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1076, "line_count": 20, "lang": "en", "doc_type": "text", "blob_id": "a6be8c67df1c67aea9eccc5e203bc4136ebeea48", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/CharlesAttend/Wallpaper-Changer
| 250
|
FILENAME: README.md
| 0.216012
|
# Wallpaper-Changer
Small python script to download a image from Unsplash and set it as windows wallpaper
### Set up the script
1) Create an apps here : https://unsplash.com/oauth/applications
2) Get your keys and your Redirect URI and write them in the python file
3) Set `saveImg` parameter to `True` to save all downloaded image. The images will be named with there description or the date that they have been downloaded.
If `saveImg` is set to `False`, every image will be named `background` and replace the last downloaded one.
### Automaticly execute the script
On linux you can use crontab !
On windows use the task scheduler !
You can download [my windows task file](/Wallpaper_Changer.xml) for quick add or create it manually:
Create a task and fill it like this :

Trigger it when you want, don't forget to check `Run task as soon as possible after a scheduled start is missed` in the setting tab.
You can also check `start only if the following network connection is available` in the Condition tab.
You don't need admin privileges.
|
9a46d4d5-f94c-4227-938e-74989e654e0c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-21 23:34:14", "repo_name": "qiuchili/ggnn_graph_classification", "sub_path": "/program_data/JavaProgramData/77/112.java", "file_name": "112.java", "file_ext": "java", "file_size_in_byte": 1107, "line_count": 94, "lang": "en", "doc_type": "code", "blob_id": "a871927b015208b4ff92981bc59af88a2c40d588", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/qiuchili/ggnn_graph_classification
| 414
|
FILENAME: 112.java
| 0.276691
|
package <missing>;
public class GlobalMembers
{
public static int Main()
{
char s1;
char s2;
String a = new String(new char[100]);
char p;
int i;
int j;
int k;
int n;
int flag;
int tj;
int ttj;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
a = tempVar.charAt(0);
}
for (i = 0;;i++)
{
for (k = i;;k++)
{
if (a.charAt(k) == '\0')
{
break;
}
if (a.charAt(k) != '0')
{
flag = 1;
}
}
if (flag == 0)
{
break;
}
flag = 0;
for (j = i;;j++)
{
if (a.charAt(j) != '0')
{
s1 = a.charAt(j);
tj = j;
/* printf("%c",s); */
break;
}
}
for (j++;;j++)
{
if (a.charAt(j) != '0')
{
s2 = a.charAt(j);
ttj = j;
/* printf("%c",s); */
break;
}
}
if (s1 != s2)
{
System.out.printf("%d %d\n",tj,ttj);
a = tangible.StringFunctions.changeCharacter(a, tj, '0');
a = tangible.StringFunctions.changeCharacter(a, ttj, '0');
i = -1;
}
/*printf("%s\n",a); */
}
return 0;
}
}
|
18e5c6b6-5a87-49d5-a3f5-20649f6208d6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-06 17:04:06", "repo_name": "akansal1599/bugTracker", "sub_path": "/src/main/java/com/abhi/model/TicketEntity.java", "file_name": "TicketEntity.java", "file_ext": "java", "file_size_in_byte": 1184, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "ac9f6aca2db02f5ea31c388c0c466787f5a0e9ab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/akansal1599/bugTracker
| 227
|
FILENAME: TicketEntity.java
| 0.262842
|
package com.abhi.model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "tickets")
@Data
@NoArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class TicketEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ticket_id")
@EqualsAndHashCode.Include
private int ticketId;
@Column(name = "title")
@EqualsAndHashCode.Include
private String title;
@OneToMany(mappedBy = "ticket")
@JsonIgnoreProperties({"hibernateLazyInitializer","handler","ticket"})
private List<MessageEntity> messages;
@ManyToOne
@JoinColumn(name = "creator_id")
private UserEntity creator;
@ManyToOne
@JoinColumn(name = "holder_id")
private UserEntity holder;
@CreationTimestamp
private LocalDateTime createDate;
@UpdateTimestamp
private LocalDateTime updateDate;
}
|
7cf6cfaa-e115-478a-8b16-97d9550f2514
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-30 01:31:33", "repo_name": "Nicolas-Guasch/Proyecto-TDP", "sub_path": "/ProyectoTDP/src/Entities/Ships/Ship.java", "file_name": "Ship.java", "file_ext": "java", "file_size_in_byte": 1098, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "cf5403cffed2dbceedb9c43bf9aa55806535ef30", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Nicolas-Guasch/Proyecto-TDP
| 240
|
FILENAME: Ship.java
| 0.289372
|
package Entities.Ships;
import ADTs.IVector2;
import Engine.IGameObject;
import Tools.AnimatorsVolatiles;
import Entities.Entity;
import Entities.Weapons.Weapon;
import Entities.Weapons.Arsenal;
import IAs.Pilot;
public abstract class Ship extends Entity implements IShip
{
protected Arsenal weapons;
private Pilot pilot;
protected Ship(IGameObject referenced, Arsenal weapons) {
super(referenced);
this.weapons = weapons;
}
public void onDeath(){
super.onDeath();
IVector2 v = referenced().transform().position();
AnimatorsVolatiles.getInstance().getExplosion(v);
weapons.setActive(false);
if (pilot != null) {
pilot.setActive(false);
}
}
public void addWeapon(Weapon p){
weapons.add(p);
}
public void setPilot(Pilot pilot){
this.pilot = pilot;
referenced().removeComponent(pilot);
referenced().addComponent(pilot);
}
public Pilot getPilot() {
return pilot;
}
public Arsenal getArsenal() {
return weapons;
}
}
|
d5dc52da-09da-42e7-aad3-d84f9beb2073
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-25 19:35:15", "repo_name": "AlessioDP/CombatLogX", "sub_path": "/src/expansion/NotCombatLogX/com/SirBlobman/not/FinalMonitor.java", "file_name": "FinalMonitor.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "71e258b8ad939bb6833bd49da3712082e6a940e5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AlessioDP/CombatLogX
| 240
|
FILENAME: FinalMonitor.java
| 0.262842
|
package com.SirBlobman.not;
import com.SirBlobman.combatlogx.Combat;
import com.SirBlobman.combatlogx.config.ConfigOptions;
import com.SirBlobman.combatlogx.utility.CombatUtil;
import com.SirBlobman.combatlogx.utility.Util;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
public class FinalMonitor implements Listener {
@EventHandler(priority=EventPriority.MONITOR)
public void sce(SpecialCombatEvent e) {
if(e.isCancelled()) return;
Player p = e.getPlayer();
if(CombatUtil.canBeTagged(p)) Combat.tag(p, null);
}
@EventHandler(priority=EventPriority.MONITOR)
public void onCombat(SpecialCombatEvent e) {
if(ConfigOptions.OPTION_LOG_TO_FILE) {
LivingEntity attacker = e.getAttacker();
LivingEntity target = e.getTarget();
String msg = Combat.log(attacker, target);
if(ConfigOptions.OPTION_LOG_TO_CONSOLE) Util.print(msg);
}
}
}
|
95ee9dfb-bc42-47e0-8460-ade7331893a5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-23 15:02:26", "repo_name": "YehorHolyk/patternProj", "sub_path": "/src/main/java/ua/nure/patternProj/dao/mysql/entity/Order.java", "file_name": "Order.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "66843091e8cd8187e495c3c8b18d1228ca86d42a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/YehorHolyk/patternProj
| 226
|
FILENAME: Order.java
| 0.290176
|
package ua.nure.patternProj.dao.mysql.entity;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.Date;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public class Order {
private int id;
private Date orderingDate;
private double sum;
private String address;
private int userId;
public static OrderBuilder builder() {
return new OrderBuilder();
}
public static class OrderBuilder {
private Order order;
public OrderBuilder addId(int id){
order.id = id;
return this;
}
public OrderBuilder addOrderingDate(Date date){
order.orderingDate = date;
return this;
}
public OrderBuilder addSum(double sum){
order.sum=sum;
return this;
}
public OrderBuilder addAddress(String address){
order.address = new String(order.address + "; " + address);
return this;
}
public OrderBuilder addUserId(int userId){
order.userId = userId;
return this;
}
public Order build(){
return order;
}
}
}
|
b7d78103-dfdb-41af-8d89-e3344b9283d8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-05-02T17:46:59", "repo_name": "willmadd/notes", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1069, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "b6cfcf42c38e206297cfbe938fb1ac0c3c2310ee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/willmadd/notes
| 278
|
FILENAME: README.md
| 0.258326
|
# Notes
## Setup Instructions
1) ### Clone Repo
In the terminal, clone the notes repo.
`git clone https://www.github.com/willmadd/notes.git`
then `cd notes/`
2) ### Install 'Notes'
Run `composer install` followed by `npm install` followed by `npm run production`
3) ### Configure Laravel
In the project root, rename the file `.env.example` to `.env`
####
In the `.env` file, find the database configuration and add your database connection details eg: (you may need ot create a database first). e.g.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=notes
DB_USERNAME=root
DB_PASSWORD=root
run `php artisan key:generate` followed by `php artisan migrate` to create the database tables
####
finally run `php artisan serve` to start the laravel server. The project should then be viewable at `http://127.0.0.1:8000/`
####
You should now see a the 'Notes' App. If you just see a spinning 6b it's probably because your database credentials are incorrect!
|
6ef1b39d-5957-4d7e-a259-b423f3d84f77
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-14 14:09:14", "repo_name": "Gagandeep39/spring-boot-rest-crud-all", "sub_path": "/src/main/java/com/gagan/springbootcrud/service/EmployeeServiceImpl.java", "file_name": "EmployeeServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1158, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "f6ec2e0389ef301d833be3dedec542291f376713", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Gagandeep39/spring-boot-rest-crud-all
| 239
|
FILENAME: EmployeeServiceImpl.java
| 0.295027
|
package com.gagan.springbootcrud.service;
import com.gagan.springbootcrud.dao.EmployeeDao;
import com.gagan.springbootcrud.entity.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import javax.transaction.Transactional;
import java.util.List;
/**
* @author Gagandeep
* @date 14-04-2020
* @time 00:12
*/
@Repository
@Transactional
public class EmployeeServiceImpl implements EmployeeService {
/**
* Change the qualifier as per convenience
* Like whiich ever method is to be used
*/
@Qualifier("employeeDaoHibernateImpl")
@Autowired
private EmployeeDao employeeDao;
@Override
public List<Employee> findAll() {
return employeeDao.findAll();
}
@Override
public Employee findById(int id) {
return employeeDao.findById(id);
}
@Override
public void deleteById(int id) {
employeeDao.deleteById(id);
}
@Override
public Employee addEmployee(Employee employee) {
return employeeDao.addEmployee(employee);
}
}
|
58df520c-515e-4f67-b0fc-f6ecd6b89687
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-16 23:03:24", "repo_name": "rerun1129/DoItObject", "sub_path": "/src/collectionframework/collection/set/MemberTreeSet.java", "file_name": "MemberTreeSet.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "76bce72361d5366afe2e7d5cba90e8e9cd7e9e8b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rerun1129/DoItObject
| 202
|
FILENAME: MemberTreeSet.java
| 0.249447
|
package collectionframework.collection.set;
import collectionframework.collection.Member;
import java.util.HashSet;
import java.util.Iterator;
import java.util.TreeSet;
public class MemberTreeSet {
private TreeSet<Member> treeSet;
public MemberTreeSet() {
treeSet = new TreeSet<>();
}
public void addMember(Member member) {
treeSet.add(member);
}
public boolean removeMember(int memberId) {
Iterator<Member> iterator = treeSet.iterator();
while (iterator.hasNext()) {
Member member = iterator.next();
int tempId = member.getMemberId();
if (memberId == tempId) {
treeSet.remove(member);
return true; //지웠음
}
}
System.out.println(memberId + "가 존재하지 않습니다."); //못지웠음
return false;
}
public void showAll() {
for (Member member : treeSet) {
System.out.println(member);
}
}
}
|
5ef0c266-b178-449e-b91a-28bf0e41f573
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-11-19T02:39:51", "repo_name": "exe1023/dialogue_metrics_docker", "sub_path": "/usr/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1220, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "789abda638f20cd07af1f4599a3753bfaacb0cf7", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/exe1023/dialogue_metrics_docker
| 396
|
FILENAME: README.md
| 0.247987
|
# USR Dockerized Server
## Build Docker Image
```
sh build_docker.sh
```
## Run Docker Container
1. Please refer to [Google Drive](https://drive.google.com/drive/folders/1sxaSIpAh6XOcmWd6dm__96DCamN-lCFX?usp=sharing) to download the pretrained models. Updated: You can also download data using seperate links [ctx](https://drive.google.com/file/d/1jkUeqUG0WFzSCmisbo1xTClRlCo8JPF3/view?usp=sharing), [roberta](https://drive.google.com/file/d/1YkXrkUdCFldl0EJXoMBy_uiu71wz1rgE/view?usp=sharing), and [uk](https://drive.google.com/file/d/1KLB3NSDjNv-ZX1I8pz4IxVRbvD3Bzbyk/view?usp=sharing).
2. Create a directory named `pretrained_models` and unzip the model folders to it. You should end up with the `pretrained_models/roberta_ft`, `pretrainedd_models/roberta_uk`, and `pretrained_models/ctx`
3. Run
```
nvidia-docker run -p 8888:8888 -v /path/to/pretrained_models:/workspace/pretrained_models --rm usr-test
```
or you can choose to modify `run_server.sh` to the command above.
## Test the Running Docker
```
sh test_server.sh
```
## Code Structure
Entry Point: `usr_server.py`
Main API: `usr.py`
Retrieval Dialogue Metrics API: `dr_api.py`
Masked Language Model API: `mlm_api.py`
Arguments: `arguments.py`
|
dc8c3966-5b97-4d2f-85b9-cf9902c0f941
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-24 15:19:22", "repo_name": "infobip/mobile-messaging-sdk-android", "sub_path": "/infobip-mobile-messaging-android-sdk/src/main/java/org/infobip/mobile/messaging/app/WebViewSettingsResolver.java", "file_name": "WebViewSettingsResolver.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "f64e12619f66d962d305a04d487bedda68dcf5e6", "star_events_count": 50, "fork_events_count": 19, "src_encoding": "UTF-8"}
|
https://github.com/infobip/mobile-messaging-sdk-android
| 209
|
FILENAME: WebViewSettingsResolver.java
| 0.268941
|
package org.infobip.mobile.messaging.app;
import android.content.Context;
import org.infobip.mobile.messaging.R;
import org.infobip.mobile.messaging.util.ResourceLoader;
public class WebViewSettingsResolver {
private static final String RES_ID_WEBVIEW_THEME = "IB_AppTheme.WebView";
private static int webViewTheme;
private final Context context;
public WebViewSettingsResolver(Context context) {
this.context = context;
}
public int getWebViewTheme() {
if (webViewTheme != 0) {
return webViewTheme;
}
webViewTheme = getThemeResourceByName(RES_ID_WEBVIEW_THEME, R.style.IB_WebViewTheme);
return webViewTheme;
}
// region private methods
private int getThemeResourceByName(String name, int fallbackResourceId) {
int resourceId = ResourceLoader.loadResourceByName(context, "style", name);
if (resourceId == 0) {
resourceId = fallbackResourceId;
}
return resourceId;
}
// endregion
}
|
10ce0d8a-2223-4b3d-8d3b-de876b35aba2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-17 10:16:56", "repo_name": "bosto/wx-h5-user-api", "sub_path": "/src/main/java/com/bostoli/wxh5userapi/common/StringUtils.java", "file_name": "StringUtils.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "5189d30475d1fd1f35f31ce2ceb2ed6c04930c8d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bosto/wx-h5-user-api
| 258
|
FILENAME: StringUtils.java
| 0.243642
|
package com.bostoli.wxh5userapi.common;
import java.nio.charset.Charset;
import java.util.Base64;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringUtils {
private static Base64.Encoder encoder = Base64.getEncoder();
private static Base64.Decoder decoder = Base64.getDecoder();
private static Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
public static String base64Encode(String original) {
if (original == null || original.equals("")) {
return "";
}
return encoder.encodeToString(original.getBytes(DEFAULT_CHARSET));
}
public static String base64Decode(String original) {
if (original == null || original.equals("")) {
return "";
}
return new String(decoder.decode(original),DEFAULT_CHARSET);
}
public static String filter(String str) {
String regEx="[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(str);
return m.replaceAll("").trim();
}
}
|
7175b220-6a6d-4f0c-bf19-0b245da13415
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-20 18:38:54", "repo_name": "ManuYao/SmRP", "sub_path": "/src/fr/mineboyfr/SmRp/killEntity.java", "file_name": "killEntity.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "fccc66f06307b08f535c97a6f0d3e2234fb9054c", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ManuYao/SmRP
| 236
|
FILENAME: killEntity.java
| 0.216012
|
package fr.mineboyfr.SmRp;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.inventory.ItemStack;
public class killEntity implements Listener {
@EventHandler
public void onEDeath(EntityDeathEvent event) {
Player player = event.getEntity().getKiller();
if (player != null) {
System.out.println("heyyy");
if (event.getEntity().getCustomName().equalsIgnoreCase(ChatColor.BOLD + "SmRP" + ChatColor.GOLD + "Test")) {
ItemStack stuf = new ItemStack(Material.ROTTEN_FLESH, 1, (byte) 4);
event.getDrops().clear();
ItemStack stack = new ItemStack(Material.DIAMOND_BLOCK, 15);
event.setDroppedExp(30000);
player.sendMessage("MORT");
//event.getDrops().add(stack);
player.getLocation().getWorld().dropItem(player.getLocation(), stack);
}
}else {
return;
}
}
}
|
6a93212c-dc4c-4806-a1d1-edc0705859f1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-10 10:32:34", "repo_name": "wjdwns/Settingpreference", "sub_path": "/app/src/main/java/com/example/settingpreference/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "47db8b46cb5e260b67225343de66138da2b0e344", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wjdwns/Settingpreference
| 178
|
FILENAME: MainActivity.java
| 0.245085
|
package com.example.settingpreference;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceFragmentCompat;
public class MainActivity extends AppCompatActivity {
public static final String TARGET_SETTING_PAGE = "target";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SettingPreferenceFragment settingsFragment = new SettingPreferenceFragment();
Intent intent = getIntent();
if (intent != null) {
String rootKey = intent.getStringExtra(TARGET_SETTING_PAGE);
if (rootKey != null) {
Bundle args = new Bundle();
args.putString(PreferenceFragmentCompat.ARG_PREFERENCE_ROOT, rootKey);
settingsFragment.setArguments(args);
}
}
getSupportFragmentManager().beginTransaction()
.replace(android.R.id.content, settingsFragment, null)
.commit();
}
}
|
cc604d16-46c1-468b-9527-34775d761b47
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-03-24 04:29:19", "repo_name": "chenay/AndroidCommon", "sub_path": "/common/src/main/java/com/chenay/common/desgin/layout/BaseViewPager.java", "file_name": "BaseViewPager.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "837ffb0ef592fb79c97443c28812faa70651a559", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/chenay/AndroidCommon
| 229
|
FILENAME: BaseViewPager.java
| 0.240775
|
package com.chenay.common.desgin.layout;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
/**
* @author Y.Chen5
*/
public class BaseViewPager extends ViewPager {
private boolean isCanScroll = true;
public BaseViewPager(@NonNull Context context) {
super(context);
}
public BaseViewPager(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
return isCanScroll && super.onInterceptTouchEvent(ev);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
return isCanScroll && super.onTouchEvent(ev);
}
/**
* 设置是否能够滑动翻页
*
* @param canScroll true 可以滑动翻页 , false 不能翻页
*/
public void setCanScroll(boolean canScroll) {
isCanScroll = canScroll;
}
}
|
42f11b23-e947-4cac-8168-e8f237937009
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-10-20 03:23:48", "repo_name": "bdunko/EORhythm", "sub_path": "/src/songs/SongScore.java", "file_name": "SongScore.java", "file_ext": "java", "file_size_in_byte": 1051, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "adb35268570fefdae401c9360426f7b3aa96b847", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bdunko/EORhythm
| 258
|
FILENAME: SongScore.java
| 0.292595
|
package songs;
import game.GamePlayer;
import game.Trigger;
import java.net.URL;
import java.util.ArrayList;
public abstract class SongScore {
protected ArrayList<Trigger> score;
protected int highscore;
protected int currentNote;
protected URL filePath;
protected int songLength;
protected int style;
public SongScore(URL filePath, int songLength, int style) {
score = new ArrayList<Trigger>();
currentNote = 0;
this.filePath = filePath;
this.songLength = songLength;
this.style = style;
}
public int getStyle(){
return style;
}
public ArrayList<Trigger> getSong() {
return score;
}
public URL getFilePath() {
return filePath;
}
public int getLength() {
return songLength;
}
public int getNumNotes() {
return score.size();
}
public void update(int time, GamePlayer player) {
Trigger t;
for (int i = currentNote; i < score.size(); i++) {
t = score.get(i);
if (t.getTimeToCreate() < time && !t.isCreated()) {
player.addTrigger(t);
currentNote++;
t.setCreated(true);
}
}
}
}
|
d2661dfe-9097-467e-9da2-d97683d8f6ae
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-07-01 13:46:06", "repo_name": "DeveloperZJQ/scalavsjava", "sub_path": "/src/main/java/concurrent/TwoPhaseTermination.java", "file_name": "TwoPhaseTermination.java", "file_ext": "java", "file_size_in_byte": 1203, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "22fe36a0bb8f4723a6a510cde626ffa6286ad372", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/DeveloperZJQ/scalavsjava
| 225
|
FILENAME: TwoPhaseTermination.java
| 0.268941
|
package concurrent;
/**
* @author DeveloperZJQ
* @since 2022-4-26
*/
public class TwoPhaseTermination {
private Thread monitor;
public void start() {
monitor = new Thread(() -> {
while (true) {
Thread current = Thread.currentThread();
boolean interrupted = current.isInterrupted();
if (interrupted) {
System.out.println("料理后事");
break;
}
try {
Thread.sleep(1000);
System.out.println("执行监控记录");
} catch (InterruptedException e) {
e.printStackTrace();
// current.interrupt();
monitor.interrupt();
}
}
});
monitor.start();
}
public void stop() {
monitor.interrupt();
}
}
class TwoPhaseTest {
public static void main(String[] args) throws InterruptedException {
TwoPhaseTermination twoPhaseTermination = new TwoPhaseTermination();
twoPhaseTermination.start();
Thread.sleep(3500);
twoPhaseTermination.stop();
}
}
|
2c198e4f-8f83-4939-ad2e-8726be13f214
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-30 04:33:01", "repo_name": "jaypatelgit85/Capstone_Project", "sub_path": "/app/src/main/java/patel/mohawk/capstoneproject/AdminHome.java", "file_name": "AdminHome.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "5cb05f7a761654317d3801bb28fd7179777e727e", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jaypatelgit85/Capstone_Project
| 236
|
FILENAME: AdminHome.java
| 0.247987
|
package patel.mohawk.capstoneproject;
// I Jay Kumar Patel,000744834 have done this assignment by my own and haven't copied it from anywhere.
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class AdminHome extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin_home);
}
public void goToUserHome(View view) {
Intent intent = new Intent(this,HomePage.class);
startActivity(intent);
}
public void GoToManageEmployee(View view) {
Intent intent = new Intent(this,ManageEmployees.class);
startActivity(intent);
}
public void addNewEmployee(View view) {
Intent intent = new Intent(this,AdminEmployeeCreate.class);
startActivity(intent);
}
public void manageUsers(View view) {
Intent intent = new Intent(this,ManageUsers.class);
startActivity(intent);
}
public void addMovies(View view) {
Intent intent = new Intent(this,AddNewMovie.class);
startActivity(intent);
}
}
|
72b331b1-2648-4b97-8574-eb7afc2e1a15
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-08 14:00:34", "repo_name": "geekbanana/demo", "sub_path": "/app/src/main/java/com/cavalry/demo/date/DatePickerActivity.java", "file_name": "DatePickerActivity.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "bb9d8cc0de09b792f0c245f20cd6b51ad3b90ff2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/geekbanana/demo
| 196
|
FILENAME: DatePickerActivity.java
| 0.247987
|
package com.cavalry.demo.date;
import android.app.DatePickerDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.DatePicker;
import com.cavalry.demo.R;
import java.util.Calendar;
public class DatePickerActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_date_picker);
init();
}
private void init() {
final Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);
// Create a new instance of DatePickerDialog and return it
new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
}
}, year, month, day).show();
}
}
|
7a0999e4-d40a-4f15-9343-4c51a4eb2522
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-20 13:22:36", "repo_name": "ppairan/JDBCprogramm", "sub_path": "/src/main/java/com/example/connectionmysql/Ausgabe.java", "file_name": "Ausgabe.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "fed97eff7f96a4736c089ec6f91e87eab919ede0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ppairan/JDBCprogramm
| 229
|
FILENAME: Ausgabe.java
| 0.256832
|
package com.example.connectionmysql;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Scanner;
public class Ausgabe {
public static void auslese() {
System.out.println("Hier Kannst du deine Tabelle mit Werten aus lesen");
System.out.println("-------------------------------------------------" + "\n");
System.out.println("Welche Tabelle möchtest du ausgelesen bekommen?");
Scanner sc = new Scanner(System.in);
String eingabe = sc.next();
try {
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/praktikum", "root", "");
PreparedStatement stm = conn.prepareStatement("SELECT * FROM " + eingabe + ";");
ResultSet rs = stm.executeQuery();
while (rs.next()) {
System.out.println(rs.getString(2) + " | " + rs.getString(3) + " | " + rs.getString(4));
}
stm.close();
conn.close();
} catch (Exception e) {
System.err.println(e.getMessage());
}
return;
}
}
|
e88fe32a-4eb3-48f3-a0f7-eefa4e080e15
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-21 03:36:33", "repo_name": "JBrady4/DartmouthFriendFinder", "sub_path": "/app/src/main/java/edu/dartmouth/cs/dartmouthfriendfinder/Holder/QBUnreadMessagesHolder.java", "file_name": "QBUnreadMessagesHolder.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "8404ee5eb8cb3c5111c91bd3d0a34e87d2cf9ed8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/JBrady4/DartmouthFriendFinder
| 228
|
FILENAME: QBUnreadMessagesHolder.java
| 0.279828
|
package edu.dartmouth.cs.dartmouthfriendfinder.Holder;
import android.os.Bundle;
/**
* Created by johnnybrady on 12/15/17.
*
* Cache for all unread Messages of a chat dialog on the Quickblox Server
* (used for graphical purposes)
*/
public class QBUnreadMessagesHolder {
private static QBUnreadMessagesHolder instance ;
private Bundle bundle;
public static synchronized QBUnreadMessagesHolder getInstance(){
QBUnreadMessagesHolder qbUnreadMessagesHolder;
synchronized (QBUnreadMessagesHolder.class) {
if (instance == null) {
instance = new QBUnreadMessagesHolder();
}
qbUnreadMessagesHolder = instance;
}
return qbUnreadMessagesHolder;
}
private QBUnreadMessagesHolder(){
bundle = new Bundle();
}
public void setBundle(Bundle bundle){
this.bundle = bundle;
}
public Bundle getBundle(){
return this.bundle;
}
public int getUnreadMessagesByDialogId(String id){
return this.bundle.getInt(id);
}
}
|
7efed560-29a9-4dc8-8780-fc2ed32ead60
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-06-24T03:05:43", "repo_name": "kylejbrk/SimpleCSV", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1082, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "5cffadc75de18c4b5c59095391a3b2742dceb3f0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kylejbrk/SimpleCSV
| 244
|
FILENAME: README.md
| 0.23793
|
# SimpleCSV

# About
SimpleCSV is a Windows Form app written in VB.Net to bulk import .csv and .xlsx files into a SQL Server database.
# Features
* Supports .csv and .xlsx files
* Can bulk import 400,000+ rows
* Dynamically add what tables to import to via the TableNamesList table
* Can store filenames of the files being imported
* Recognizes key constraints and will fire triggers
* Developer mode, which allows bulk imports to a test enviornment
# Setup
You will need a table in your database named TableNamesList. View the script.sql in the ExampleDB folder to get a better understanding of how it works. This table will fill the list for which tables can be imported to.
You will also need to setup your project settings to include your database connection strings and Dev password.
# Dev Mode
Dev Mode can be accessed by right clicking the icon in the top left corner. This will propmt for the password in the project settings. Once entered, the connection string will change to one specified again in the project settings.
|
e883730a-140b-479a-bb72-d31facbe092e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-09-21 21:13:46", "repo_name": "Orabig/TaskManager", "sub_path": "/app/src/main/java/fr/julienheissat/utils/PlayConnectionService.java", "file_name": "PlayConnectionService.java", "file_ext": "java", "file_size_in_byte": 1108, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "5592fd3082195985a3777b83df189e567adca649", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Orabig/TaskManager
| 225
|
FILENAME: PlayConnectionService.java
| 0.279828
|
package fr.julienheissat.utils;
import android.content.Context;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import fr.julienheissat.taskmanager.R;
/**
* Created by juju on 20/09/2014.
*/
public class PlayConnectionService
{
/*
* Method to check if app is connected to Google Play services
*/
public static boolean servicesConnected(Context thisContext)
{
// Check that Google Play services is available
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(thisContext);
// If Google Play services is available
if (ConnectionResult.SUCCESS == resultCode)
{
// In debug mode, log the status
Log.d(LocationUtils.APPTAG, thisContext.getString(R.string.play_services_available));
// Continue
return true;
// Google Play services was not available for some reason
} else
{
// Display an error dialog
}
return false;
}
}
|
a49c2dee-7b1a-4acf-bc1d-d994081404d4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-28 06:27:43", "repo_name": "littleeyes/Springboot-ApacheCamel", "sub_path": "/src/main/java/com/qindaorong/framework/dto/MessageDTO.java", "file_name": "MessageDTO.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "4787ab44c5211331d4fd403cf7d971ebbf786c12", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/littleeyes/Springboot-ApacheCamel
| 237
|
FILENAME: MessageDTO.java
| 0.224055
|
package com.qindaorong.framework.dto;
import java.io.Serializable;
/**
* @auther: qindaorong
* @Date: 2018/6/22 17:07
* @Description:
*/
public class MessageDTO implements Serializable {
private static final long serialVersionUID = 4309991981688309458L;
public MessageDTO() {
}
public MessageDTO(String from, String topic, String responseBody) {
this.from = from;
this.topic = topic;
this.responseBody = responseBody;
}
private String from;
private String topic;
private String responseBody;
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getTopic() {
return topic;
}
public void setTopic(String topic) {
this.topic = topic;
}
public String getResponseBody() {
return responseBody;
}
public void setResponseBody(String responseBody) {
this.responseBody = responseBody;
}
}
|
9a22c0fc-a23f-46e7-b2a0-dfb0d8ef9154
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-01T06:11:58", "repo_name": "michalgosek/bus-tracker", "sub_path": "/src/main/java/com/example/bustracker/city/street/StreetController.java", "file_name": "StreetController.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "6c2d38de9581a95653a2d13c8cebcc10ace7f0f7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/michalgosek/bus-tracker
| 204
|
FILENAME: StreetController.java
| 0.272025
|
package com.example.bustracker.city.street;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
@Controller
@RequestMapping("streets")
public class StreetController{
private final StreetService streetService;
@Autowired
public StreetController(StreetService streetService) {
this.streetService = streetService;
}
@GetMapping
public String getStreets(Model model){
List<Street> streetList = streetService.getAllStreets();
model.addAttribute("streets", streetList);
return "streets";
}
@GetMapping("/{streetId}" )
public String getStreetView(Model model, @PathVariable("streetId") Long streetId) {
System.out.println(streetId);
model.addAttribute("streetId", streetId);
return "stop";
}
}
|
14f61793-ec8d-47df-8dab-8e31ded04fa6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-10 18:41:52", "repo_name": "awalden007/reactjs-flux-comment-server", "sub_path": "/src/main/java/com/sample/comments/Comment.java", "file_name": "Comment.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "6804024b8a571c593265ba445c8316b0418aa338", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/awalden007/reactjs-flux-comment-server
| 300
|
FILENAME: Comment.java
| 0.290176
|
package com.sample.comments;
import java.util.ArrayList;
import com.sample.users.User;
public class Comment {
private int id;
private User author;
private String text;
private ArrayList<User> likedBy;
public Comment() {
setLikedBy(new ArrayList<User>());
//this.likedBy.add(new User(1,"Andy","Walden","awalden"));
}
public Comment(int id, User author, String text) {
this.id = id;
this.author = author;
this.text = text;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public User getAuthor() {
return author;
}
public void setAuthor(User author) {
this.author = author;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public ArrayList<User> getLikedBy() {
return likedBy;
}
public void setLikedBy(ArrayList<User> likedBy) {
this.likedBy = likedBy;
}
public void addLikedBy(User likedByUser) {
for(User user : this.likedBy) {
if(user.getId() == likedByUser.getId()) return;
}
if(this.author.getId() == likedByUser.getId()) return;
this.likedBy.add(likedByUser);
}
}
|
b4029d74-646f-4f2d-b269-ff58ee618d24
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-10-07 08:27:59", "repo_name": "sahils/file-auth-plugin", "sub_path": "/src/main/java/com/dcsquare/hivemq/plugin/fileauthentication/authentication/HashedSaltedPassword.java", "file_name": "HashedSaltedPassword.java", "file_ext": "java", "file_size_in_byte": 475, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "53d99a408a9d6ce787b7ba0ab5d53d6d549535e9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sahils/file-auth-plugin
| 249
|
FILENAME: HashedSaltedPassword.java
| 0.268941
|
/*
* Copyright 2013 dc-square GmbH
*
* 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.dcsquare.hivemq.plugin.fileauthentication.authentication;
/**
* Helper class, which holds hash and salt
*
* @author Christian Goetz
*/
public class HashedSaltedPassword {
private String salt;
private String hash;
public HashedSaltedPassword(String hash, String salt) {
this.hash = hash;
this.salt = salt;
}
public String getHash() {
return hash;
}
public String getSalt() {
return salt;
}
}
|
340a2dd4-9056-47c5-8205-4977902fd4f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-04 13:35:44", "repo_name": "AntonMykytiuk/buyabook", "sub_path": "/src/main/java/ua/singleton/buyabook/controller/UserController.java", "file_name": "UserController.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "46a3d069409d70c0b8580b9392b3998b07fb7a96", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AntonMykytiuk/buyabook
| 194
|
FILENAME: UserController.java
| 0.261331
|
package ua.singleton.buyabook.controller;
import org.springframework.web.bind.annotation.*;
import ua.singleton.buyabook.model.User;
import ua.singleton.buyabook.service.UserService;
import java.util.List;
@RestController
@RequestMapping("rest/api/users")
public class UserController {
private UserService userService;
public UserController(UserService userService) {
this.userService = userService;
}
@GetMapping
public List<User> getAllUsers() {
return userService.getAll();
}
@GetMapping("/{id}")
public User getUserById(@PathVariable Long id) {
return userService.getById(id);
}
@PostMapping
public void createUser(@RequestBody User user) {
userService.create(user);
}
@PutMapping("/{id}")
public void updateUser(@PathVariable Long id, @RequestBody User user) {
userService.update(id, user);
}
@DeleteMapping("/{id}")
public void deleteUser(@PathVariable Long id) {
userService.removeById(id);
}
}
|
805bbbb3-5026-4330-93ca-7700aef7d407
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-08 11:46:32", "repo_name": "zhanglong-daniel/Damocles", "sub_path": "/app/src/main/java/com/damocles/sample/util/Utils.java", "file_name": "Utils.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "14ccb4793fc4306b5c51dec2e410f052b0cdaa8e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zhanglong-daniel/Damocles
| 228
|
FILENAME: Utils.java
| 0.264358
|
package com.damocles.sample.util;
import com.damocles.R;
import com.damocles.android.util.DeviceInfoUtils;
import android.app.Activity;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.LinearLayout;
/**
* Created by zhanglong02 on 16/3/3.
*/
public class Utils {
public static Toolbar initToolbar(Activity activity, int id) {
Toolbar toolbar = (Toolbar) activity.findViewById(id);
int statusBarHeight = DeviceInfoUtils.getStatusBarHeight();
int w = LinearLayout.LayoutParams.MATCH_PARENT;
int h = activity.getResources().getDimensionPixelSize(R.dimen.tool_bar_height);
if (Build.VERSION.SDK_INT > 19) {
toolbar.setPadding(0, statusBarHeight, 0, 0);
h += statusBarHeight;
}
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(w, h);
toolbar.setLayoutParams(params);
if (activity instanceof AppCompatActivity) {
((AppCompatActivity) activity).setSupportActionBar(toolbar);
}
return toolbar;
}
}
|
30db4872-f0ba-4546-af7a-c807256b9411
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-26 15:43:45", "repo_name": "this-software/this.pos", "sub_path": "/ThisPOS/src/main/java/dis/software/pos/Application.java", "file_name": "Application.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "581e1d73af81ee30cd62a41c0bdc969279c52bba", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/this-software/this.pos
| 218
|
FILENAME: Application.java
| 0.26588
|
package dis.software.pos;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* Clase para inicializar el contexto de la configuración de Spring
* @author Milton Cavazos
*/
public class Application
{
private static Logger logger = LogManager.getLogger(Application.class.getSimpleName());
private static ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring.cfg.xml");
private static Setting setting;
public Application()
{
logger.info("New instance of Application class to initiate Spring context");
if (context == null) context = new ClassPathXmlApplicationContext("spring.cfg.xml");
}
public static ClassPathXmlApplicationContext getContext() {
return context;
}
public void setContext(ClassPathXmlApplicationContext context) {
Application.context = context;
}
public static Setting getSetting() {
return setting;
}
public static void setSetting(Setting setting) {
Application.setting = setting;
}
}
|
c0ba21c1-bd27-46b9-9dcb-bdd299b47a71
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-05 12:39:42", "repo_name": "jammaGlobal/spring-hib", "sub_path": "/src/main/java/com/example/springhib/controllers/PostController.java", "file_name": "PostController.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "542cadb7d30fdbd2b10e30f8af4b229744117305", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jammaGlobal/spring-hib
| 200
|
FILENAME: PostController.java
| 0.291787
|
package com.example.springhib.controllers;
import com.example.springhib.dto.PostData;
import com.example.springhib.service.PostService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
//Controller merely presents business functions that are implemented in the application service layer as "Services"
@RestController
@RequestMapping("/posts")
public class PostController {
@Resource(name = "postService")
private PostService postService;
@GetMapping
public List <PostData> getPosts(){
return postService.getAllPosts();
}
@GetMapping("/post/{id}")
public PostData getPost(@PathVariable Long id){
return postService.getPostById(id);
}
@PostMapping("/post")
public PostData savePost(final @RequestBody PostData postData){
return postService.savePost(postData);
}
@DeleteMapping("/post/{id}")
public Boolean deletePost(@PathVariable Long id){
return postService.deletePost(id);
}
}
|
3be3d954-2689-41cf-95a4-5dd6bf7b535e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-14 14:02:54", "repo_name": "monikakocot/mykwejk", "sub_path": "/src/main/java/pl/akademiakodu/kwejk/api/CategoryApiController.java", "file_name": "CategoryApiController.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "c1b83131214e2507421bf3f3d72c89c8b7d71cf8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/monikakocot/mykwejk
| 203
|
FILENAME: CategoryApiController.java
| 0.256832
|
package pl.akademiakodu.kwejk.api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import pl.akademiakodu.kwejk.model.Category;
import pl.akademiakodu.kwejk.repository.CategoryRepository;
import java.util.List;
@RestController
public class CategoryApiController {
private CategoryRepository categoryRepository = new CategoryRepository();
@GetMapping("api/categories")
public List<Category> findAll(){
return categoryRepository.findAll();
}
@GetMapping("api/categories/find")
public List<Category> findByName(@RequestParam String name){
return categoryRepository.findCategoriesByNameIgnoreCase(name);
}
/*
@GetMapping("api/categories/find")
public List<Category> findByName(@RequestParam String name){
List<Category> categories = categoryRepository.findCategoriesByNameIgnoreCase(name);
if(categories.isEmpty())
return categoryRepository.findAll();
else
return categoryRepository.findCategoriesByNameIgnoreCase(name);
}
*/
}
|
8a1cc6a3-642f-49d5-ac58-5a6c09854416
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-06T21:58:48", "repo_name": "MartaAnthony/reading-notes", "sub_path": "/class-11.md", "file_name": "class-11.md", "file_ext": "md", "file_size_in_byte": 1186, "line_count": 48, "lang": "en", "doc_type": "text", "blob_id": "5b4aa9dbd37408a7499f6c4960207f5718bfa13a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MartaAnthony/reading-notes
| 279
|
FILENAME: class-11.md
| 0.23092
|
## Images in CSS
You can control size of images in CSS.
You can use float property to align images. It is common to add margin so the images don’t touch.
Images are inline elements. To center an image, you need to turn it into a block-level element using the display property.
Images can become background.
You can create a link or button that changes to a second style when the user moves their mouse over, and a third style when they click.
## Practical information
**SEO** - search engine optimization - a practice of trying to help your site appear nearer the top of search engine results.
- On-page techniques - including keywords in your HTML code.
- Off-page techniques - getting other sites to link to you.
7 key places where keywords can appear on the page:
- Page title
- Url
- Headings
- Text (repeat keywords 2-3 times)
- Link text
- Image alt text
- Page descriptions:
`<head>`
`<meta>`
How to identify keywords:
- Organize
- Research
- Compare
- Refine
- Map
Google analytics
- Visits
- Unique visits
- Page views
- Pages per visit
- Average time on site
- Date selector
- Export
**FTP** - File transfer protocol
|
29132158-2333-47aa-a050-ea3190a8a991
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-31 02:49:27", "repo_name": "carlosthe19916/sunat-jms-thorntail-examples", "sub_path": "/wildfly-swarm-application/src/main/java/io/github/carlosthe19916/wildflyswarm/controller/MessageSenderController.java", "file_name": "MessageSenderController.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "489051bf5fc752a36c12944733ec5d7cebb06e4d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/carlosthe19916/sunat-jms-thorntail-examples
| 227
|
FILENAME: MessageSenderController.java
| 0.23793
|
package io.github.carlosthe19916.wildflyswarm.controller;
import javax.annotation.Resource;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.jms.*;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@ApplicationScoped
@Path("/send-message")
public class MessageSenderController {
@Inject
@JMSConnectionFactory("java:/jms/remote-mq")
private JMSContext context;
@Resource(mappedName = "jms/queue/SunatQueue")
private Queue queue;
@GET
@Produces("text/plain")
public String sendMessage() throws JMSException {
Destination replyDestination = context.createTemporaryQueue();
TextMessage message = context.createTextMessage("Hello");
message.setJMSReplyTo(replyDestination);
JMSProducer producer = context.createProducer();
producer.send(queue, message);
JMSConsumer consumer = context.createConsumer(replyDestination);
Message replyMessage = consumer.receive();
System.out.println(replyMessage);
return "Message sended";
}
}
|
8d2cb673-d2e9-4f80-ba8e-6fedfa787e74
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-08-28 23:52:56", "repo_name": "MontealegreLuis/ticketbeast-java", "sub_path": "/src/test/java/com/montealegreluis/ticketbeast/adapters/jpa/converters/concerts/address/StreetAndNumberConverterTest.java", "file_name": "StreetAndNumberConverterTest.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "3741d7fa63672f194d92df160551ee9ecad0c120", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MontealegreLuis/ticketbeast-java
| 258
|
FILENAME: StreetAndNumberConverterTest.java
| 0.290176
|
package com.montealegreluis.ticketbeast.adapters.jpa.converters.concerts.address;
import static org.junit.jupiter.api.Assertions.*;
import com.montealegreluis.ticketbeast.concerts.address.StreetAndNumber;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
final class StreetAndNumberConverterTest {
@Test
void it_converts_street_and_number_to_database_value() {
var streetAndNumberValue = "Main St. 123";
var streetAndNumber = new StreetAndNumber(streetAndNumberValue);
assertEquals(streetAndNumberValue, converter.convertToDatabaseColumn(streetAndNumber));
assertNull(converter.convertToDatabaseColumn(null));
}
@Test
void it_converts_database_value_to_street_and_number() {
var streetAndNumberValue = "Main St. 123";
var streetAndNumber = new StreetAndNumber(streetAndNumberValue);
assertEquals(streetAndNumber, converter.convertToEntityAttribute(streetAndNumberValue));
assertNull(converter.convertToEntityAttribute(null));
}
@BeforeEach
void let() {
converter = new StreetAndNumberConverter();
}
private StreetAndNumberConverter converter;
}
|
f505a5af-3b4d-4652-b2fb-19ee1f959f20
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-19 08:35:19", "repo_name": "mahmoudhesham009/StopTheBomb", "sub_path": "/app/src/main/java/com/target/runningapp/viewModel/LogInViewModel.java", "file_name": "LogInViewModel.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "b90ae263ca2d0f50af0f218a2f13fc5a6d50ef6f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mahmoudhesham009/StopTheBomb
| 196
|
FILENAME: LogInViewModel.java
| 0.247987
|
package com.target.runningapp.viewModel;
import android.content.Context;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.google.firebase.auth.FirebaseUser;
import com.target.runningapp.repositories.AuthRepository;
public class LogInViewModel extends ViewModel {
private AuthRepository authRepository;
private Context mContext;
private MutableLiveData<FirebaseUser> userMutableLiveData;
private MutableLiveData<Boolean> loadingMutableLiveData;
public void init(Context context) {
mContext = context;
authRepository = AuthRepository.getInstance(mContext);
userMutableLiveData = authRepository.getUserMutableLiveData();
loadingMutableLiveData= authRepository.getLoadingMutableLiveData();
}
public void logIn(String email, String password) {
authRepository.logIn(email, password);
}
public LiveData<FirebaseUser> getUserMutableLiveData() {
return userMutableLiveData;
}
public MutableLiveData<Boolean> getLoadingMutableLiveData() {
return loadingMutableLiveData;
}
}
|
39d2b400-c8e8-4d0b-aa82-92e09e1d8a02
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-21 20:33:42", "repo_name": "harrisdb/AppWorld-CSE-201", "sub_path": "/grails/AppWorld/src/main/java/myPackage/Comment.java", "file_name": "Comment.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "e021218169de1c3005dbdd13be6357b5dd8fc85e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/harrisdb/AppWorld-CSE-201
| 233
|
FILENAME: Comment.java
| 0.258326
|
package myPackage;
import java.io.Serializable;
/**
* @author Devin Harris
*/
public class Comment implements Serializable {
/**
* String that contains text of comment
*/
private String text;
/**
* int that contains votes on comment
* can go negative.
*/
private int votes;
private String user;
/**
* Method to instantiate a comment object
* @param commentText text that is contained in comment
*/
public Comment(String commentText,String User) {
text = commentText;
votes = 0;
user = User;
}
/**
* @return votes on comment
*/
public int getVotes() {
return votes;
}
/**
* @return text with comment
*/
public String getText() {
return text;
}
/**
* Increment the votes on comment, meaning votes = votes + 1
* Happens when a user upvotes a comment
*/
public void incrementVotes() {
votes++;
}
public String getUser() {
return user;
}
}
|
982934f7-7807-4673-9a0d-bf565e9021b7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-04-26T16:08:50", "repo_name": "NattyNarwhal/cchat", "sub_path": "/chat_sidechannel_format.md", "file_name": "chat_sidechannel_format.md", "file_ext": "md", "file_size_in_byte": 1075, "line_count": 20, "lang": "en", "doc_type": "text", "blob_id": "2778d18e90bc86b023115beddded9a324e2399c3", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/NattyNarwhal/cchat
| 243
|
FILENAME: chat_sidechannel_format.md
| 0.23231
|
## Emotion format
Enclosed in () at the beginning of the message. TODO
## Character announcement
Clients will announce `# Appears as CHARACTER` when changing their character, joining a comic channel, or switching to comic mode for the first time on a channel. After announcing it, Comic Chat clients seeing this message will supress it and then proceed to PRIVMSG the user who sent it their `# Appears as` block.
## Away announcement
An away message in comic channels will be send as a to-channel CTCP `AWAY` message, and the client will also use the normal IRC away message.
## Sending character without message
A <Chr> message with an emotion block will be send. Clients will filter this out and place the character without a message.
## Sounds
It sends a `CTCP SOUND` message, but since the message is prefixed by an emotion block, it doesn't show as such. Parameters are the sound's file name, then a message. Sounds will be looked for in the media search path, and played if they are WAV or MIDI. (An MP3 patch [exists](http://www.mermeliz.com/xpmp3help.htm).)
|
8744e75c-da2f-4eb2-901f-77e7061b74f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-04 01:40:34", "repo_name": "atorres815/sce-test", "sub_path": "/src/main/java/mx/com/gnp/sce/consultarpolizav1/pojo/CriterioBusquedaPoliza.java", "file_name": "CriterioBusquedaPoliza.java", "file_ext": "java", "file_size_in_byte": 1013, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "8a556c523993eca362b03f90eaa028f8e364ef42", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/atorres815/sce-test
| 243
|
FILENAME: CriterioBusquedaPoliza.java
| 0.206894
|
package mx.com.gnp.sce.consultarpolizav1.pojo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
public class CriterioBusquedaPoliza {
@JsonProperty(required = true)
@ApiModelProperty(value = "Numero de poliza", required = true)
private String numPoliza;
@JsonProperty(required = true)
@ApiModelProperty(value = "Numero de version", required = true)
private Integer numVersion;
@JsonProperty(required = true)
@ApiModelProperty(value = "Indicador de tipo poliza")
private String indPolCompleta = "C";
public String getNumPoliza() {
return numPoliza;
}
public void setNumPoliza(String numPoliza) {
this.numPoliza = numPoliza;
}
public Integer getNumVersion() {
return numVersion;
}
public void setNumVersion(Integer numVersion) {
this.numVersion = numVersion;
}
public String getIndPolCompleta() {
return indPolCompleta;
}
public void setIndPolCompleta(String indPolCompleta) {
this.indPolCompleta = indPolCompleta;
}
}
|
efe922fe-569c-4a37-878f-19f69d1d70ce
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-01 13:07:05", "repo_name": "JINNYYUN/Inphomation", "sub_path": "/src/bit/com/inpho/dto/PostLocationDto.java", "file_name": "PostLocationDto.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "d9c7db7e0e6d5fa1d7de26423c62b04790568638", "star_events_count": 0, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/JINNYYUN/Inphomation
| 231
|
FILENAME: PostLocationDto.java
| 0.246533
|
package bit.com.inpho.dto;
public class PostLocationDto {
private int post_seq;
private String post_latitude;
private String post_longitude;
public PostLocationDto() {
}
public int getPost_seq() {
return post_seq;
}
public void setPost_seq(int post_seq) {
this.post_seq = post_seq;
}
public String getPost_latitude() {
return post_latitude;
}
public void setPost_latitude(String post_latitude) {
this.post_latitude = post_latitude;
}
public String getPost_longitude() {
return post_longitude;
}
public void setPost_longitude(String post_longitude) {
this.post_longitude = post_longitude;
}
public PostLocationDto(int post_seq, String post_latitude, String post_longitude) {
super();
this.post_seq = post_seq;
this.post_latitude = post_latitude;
this.post_longitude = post_longitude;
}
@Override
public String toString() {
return "PostLocationDto [post_seq=" + post_seq + ", post_latitude=" + post_latitude + ", post_longitude="
+ post_longitude + "]";
}
}
|
4ad9295b-139f-4717-978b-62f481633960
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-01 09:36:01", "repo_name": "Immountain/gsis.kwdi.re.kr", "sub_path": "/src/main/java/infomind/com/cmm/bean/InfoLoginPageCacheManager.java", "file_name": "InfoLoginPageCacheManager.java", "file_ext": "java", "file_size_in_byte": 1220, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "ffe9d0a93818b40e4d515fa64e5e58faa9b7c5f3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Immountain/gsis.kwdi.re.kr
| 247
|
FILENAME: InfoLoginPageCacheManager.java
| 0.268941
|
package infomind.com.cmm.bean;
import infomind.com.cmm.InfoConstants;
import infomind.com.cms.info.site.service.InfoSiteMenuService;
import infomind.com.cms.info.site.vo.InfoSiteMenuVO;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
@Service
public class InfoLoginPageCacheManager implements InitializingBean {
private Map<String, String> LogInPageMap = new HashMap<>();
@Override
public void afterPropertiesSet() throws Exception {
if (InfoConstants.SERVER_MODE.equals(InfoConstants.SERVER_MODE_SERVICE)) {
loadLoginPage();
}
}
public void loadLoginPage() throws Exception {
LogInPageMap.clear();
LogInPageMap.put("page","");
}
public String getPage() {
String page =LogInPageMap.get("page");
return page;
}
public void setPage(String page) {
LogInPageMap.clear();
LogInPageMap.put("page",page);
}
}
|
3b674475-5577-4eac-8c7d-2dd68099f10c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-27 23:18:46", "repo_name": "marcinmajkowski/kawasaki-robots-rest-api", "sub_path": "/src/main/java/com/marcinmajkowski/robotics/kawasaki/rest/domain/RealVariable.java", "file_name": "RealVariable.java", "file_ext": "java", "file_size_in_byte": 1158, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "63df44680836daac8fe2030230586e8faabfabd9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/marcinmajkowski/kawasaki-robots-rest-api
| 267
|
FILENAME: RealVariable.java
| 0.274351
|
package com.marcinmajkowski.robotics.kawasaki.rest.domain;
import org.springframework.hateoas.ResourceSupport;
public class RealVariable extends ResourceSupport {
private String name;
private Double value;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
RealVariable that = (RealVariable) o;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
return !(value != null ? !value.equals(that.value) : that.value != null);
}
@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (value != null ? value.hashCode() : 0);
return result;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Double getValue() {
return value;
}
public void setValue(Double value) {
this.value = value;
}
}
|
228cda2e-1100-4687-918c-7d4568959156
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-08-16T02:34:43", "repo_name": "marinofelipe/geofence-coupon", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1184, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "8cbff8692d2226ea75809c1fa589d065059f872a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/marinofelipe/geofence-coupon
| 366
|
FILENAME: README.md
| 0.239349
|
# geofence-coupon
Simple Coursera course app which adds custom locations for simulator and send notifications when user enters a region
### Simulating Locations
Create a GPX file with the route to be simulated.
You can access [GPX-POI](http://gpx-poi.com) **_OR_** use the basic .gpx files sintax as shown below
#### GPX files sintax
```
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
version="1.1"
creator="gpx-poi.com">
<wpt lat="53.343147" lon="-6.275468">
<time>2017-08-16T00:27:21Z</time>
</wpt>
</gpx>
```
It's only necessary to add more ```wpt``` itens and change the disered location and time
### Using on Xcode
On debugging options, after running your app on simulator, you must select **Simulate Location > Add GPX File to Project...**
Import your gpx file and then just run again _**OR**_ select the main scheme and then **Edit Scheme...Run > Options**, check the item **Allow Location Simulation** and define your gpx file on **Default Location**.
|
0760d093-e654-428a-ae5f-6a05bcbd24f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-25 16:01:27", "repo_name": "mr-hec24/Group-Creator", "sub_path": "/Group Creator/src/Student.java", "file_name": "Student.java", "file_ext": "java", "file_size_in_byte": 1220, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "d202303abc2d090bf976f0a597ab16f69109d2f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mr-hec24/Group-Creator
| 293
|
FILENAME: Student.java
| 0.26971
|
import java.util.ArrayList;
public class Student
{
private String firstName;
private String lastName;
private ArrayList<String> previousPartners;
private boolean alreadyInGroup = false;
public Student(String f, String l, ArrayList<String> p)
{
firstName = f;
lastName = l;
previousPartners = p;
}
public Student(String f, String l)
{
firstName = f;
lastName = l;
previousPartners = new ArrayList<>();
}
public String getFirstName()
{
return firstName;
}
public void setFirstName(String firstName)
{
this.firstName = firstName;
}
public String getLastName()
{
return lastName;
}
public void setLastName(String lastName)
{
this.lastName = lastName;
}
public ArrayList<String> getPreviousPartners()
{
return previousPartners;
}
public void setPreviousPartners(ArrayList<String> previousPartners)
{
this.previousPartners = previousPartners;
}
public boolean isAlreadyInGroup()
{
return alreadyInGroup;
}
public void setAlreadyInGroup(boolean alreadyInGroup)
{
this.alreadyInGroup = alreadyInGroup;
}
}
|
234d0bb9-3073-49ce-bdb8-ce43cc7682a8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-20 09:53:37", "repo_name": "hansonqC/EDI", "sub_path": "/src/main/java/pl/hansonq/models/EdiModel/InvoicePartiesModel.java", "file_name": "InvoicePartiesModel.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "f3425da7d16df1b98cceaea43e4a568d34b13289", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hansonqC/EDI
| 258
|
FILENAME: InvoicePartiesModel.java
| 0.247987
|
package pl.hansonq.models.EdiModel;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "Invoice-Parties")
public class InvoicePartiesModel {
private BuyerModel buyerModel;
private SellerModel sellerModel;
public InvoicePartiesModel(BuyerModel buyerModel, SellerModel sellerModel) {
this.buyerModel = buyerModel;
this.sellerModel = sellerModel;
}
public InvoicePartiesModel() {
}
public BuyerModel getBuyerModel() {
return buyerModel;
}
@XmlElement(name = "Buyer")
public void setBuyerModel(BuyerModel buyerModel) {
this.buyerModel = buyerModel;
}
public SellerModel getSellerModel() {
return sellerModel;
}
@XmlElement(name = "Seller")
public void setSellerModel(SellerModel sellerModel) {
this.sellerModel = sellerModel;
}
@Override
public String toString() {
return "InvoicePartiesModel{" +"\n"+
"buyerModel=" + buyerModel +"\n"+
", sellerModel=" + sellerModel +"\n"+
'}';
}
}
|
fc13a4e5-c553-47f5-bfaa-343402cb4784
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-25 12:40:41", "repo_name": "ILDAR1976/JavaFxWithAssimp2", "sub_path": "/src/main/java/edu/lwjgl_fx_01/ui/model/engine/SceneFx.java", "file_name": "SceneFx.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "8ef0b839c568d17e9638baf1d4c5fcf91ffe6b91", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ILDAR1976/JavaFxWithAssimp2
| 254
|
FILENAME: SceneFx.java
| 0.286169
|
package edu.lwjgl_fx_01.ui.model.engine;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javafx.scene.Group;
import edu.lwjgl_fx_01.ui.model.engine.graph.NodeFx;
import edu.lwjgl_fx_01.ui.model.engine.graph.animation.Animation;
import edu.lwjgl_fx_01.ui.model.engine.shape3d.SkinningMesh;
@SuppressWarnings("restriction")
public class SceneFx extends Group {
private NodeFx rootNode;
private String name;
private List<SkinningMesh> meshes = new ArrayList<>();
private Map<String, Animation> animations = new HashMap<>();
public SceneFx(String name) {
this.name = name;
}
public NodeFx getRootNode() {
return rootNode;
}
public void setRootNode(NodeFx rootNode) {
this.rootNode = rootNode;
}
public List<SkinningMesh> getMeshes() {
return meshes;
}
public void setMeshes(List<SkinningMesh> meshes) {
this.meshes = meshes;
}
public Map<String, Animation> getAnimations() {
return animations;
}
public void setAnimations(Map<String, Animation> animations) {
this.animations = animations;
}
}
|
6f2d192d-f090-4c7a-81a5-fa5f150ae61a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-12 15:12:14", "repo_name": "daniszam/TokenChat", "sub_path": "/chat/src/main/java/ru/itis/darzam/security/util/JwtHeaderTokenExtractor.java", "file_name": "JwtHeaderTokenExtractor.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "43a6e0e4699764d8f933e9414c5e384032777429", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/daniszam/TokenChat
| 173
|
FILENAME: JwtHeaderTokenExtractor.java
| 0.240775
|
package ru.itis.darzam.security.util;
import org.apache.logging.log4j.util.Strings;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.provider.authentication.TokenExtractor;
import org.springframework.stereotype.Component;
import ru.itis.darzam.security.authentication.JWTAuthentication;
import ru.itis.darzam.security.config.SecurityConfig;
import javax.servlet.http.HttpServletRequest;
@Component
public class JwtHeaderTokenExtractor implements TokenExtractor {
@Override
public Authentication extract(HttpServletRequest httpServletRequest) {
String token = httpServletRequest.getHeader(SecurityConfig.JWT_TOKEN_HEADER_PARAM);
if (Strings.isBlank(token)) {
throw new AuthenticationServiceException("Authorization header cannot be blank!");
}
JWTAuthentication jwtAuthentication = new JWTAuthentication();
jwtAuthentication.setToken(token);
return jwtAuthentication;
}
}
|
a0692ccc-549d-4082-91ef-d534bdbafb67
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-23T16:02:22", "repo_name": "simplecto/ghost-compose", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1111, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "822bc5a5ab6c6ece4ace73b4d46910af49886de0", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/simplecto/ghost-compose
| 289
|
FILENAME: README.md
| 0.194368
|
# ghost-compose
Docker-compose and Makefile task runner to setup and run Ghost, filebrowser, and Traefik with Letsencrypt SSL
## Purpose and context
I run a Ghost blog, but it does not offer arbitrary file management for things
such as PDFs or other archives. This repo outlines my simple `docker-compose.yml`
and automation for a simple filemanager that I can use on the side.
## Assumptions
Ok, so you are in my head a bit, and these are the assumptions when deploying
this stack:
* Docker
* Traefik runs as front-end proxy with letsencrypt support.
* DNS Domains are pointed at your server/ip.
* My blog lives on www.simplecto.com
* The filebrower lives on files.simplecto.com (separate admin for that)
## Check labels and env files!
These files are hard-coded to my settings (hey, my repo, my rules). I will accept
pull requests for fixing that...
## My Workflow
If there is a file I want to link or shar in the blog:
1. Login on the filebrowser app (files.simplecto.com)
1. Upload the file
1. Generate the download link, copy
1. Goto my blog post
1. Paste in the link.
1. Done
|
468d209f-8670-4f77-95e3-dedc84766505
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-21 03:01:17", "repo_name": "SShnoodles/db2j-ce", "sub_path": "/src/main/java/cc/ssnoodles/db/util/TimeUtil.java", "file_name": "TimeUtil.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "fea6172fe998d2ee076c9692e6c9de3e0fe89711", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SShnoodles/db2j-ce
| 236
|
FILENAME: TimeUtil.java
| 0.282196
|
package cc.ssnoodles.db.util;
import java.time.*;
import java.time.format.DateTimeFormatter;
/**
* @author ssnoodles
* @version 1.0
* Create at 2019-03-11 12:45
*/
public class TimeUtil {
public static final DateTimeFormatter DATE_TIME = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
public static final DateTimeFormatter DATE_TIME_SS = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
public static String getTime() {
return DATE_TIME.format(LocalDateTime.now());
}
public static String getTimeSS() {
return DATE_TIME_SS.format(LocalDateTime.now());
}
public static LocalDateTime timestampToLocalDateTime(long timestamp) {
Instant instant = Instant.ofEpochMilli(timestamp);
ZoneId zone = ZoneId.systemDefault();
return LocalDateTime.ofInstant(instant, zone);
}
public static long localDateTimeToTimestamp(LocalDateTime localDateTime) {
ZoneId zoneId = ZoneId.systemDefault();
Instant instant = localDateTime.atZone(zoneId).toInstant();
return instant.toEpochMilli();
}
}
|
d663c522-f028-4158-98b8-8e9ea815b9d1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-16 13:29:31", "repo_name": "sonnv25/GCMTranport", "sub_path": "/java/com/onesimply/sonnv/androidtransportgcm/entities/UserNote.java", "file_name": "UserNote.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "91e7b68895559aa633e9c366c2784ac197abf683", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sonnv25/GCMTranport
| 227
|
FILENAME: UserNote.java
| 0.224055
|
package com.onesimply.sonnv.androidtransportgcm.entities;
/**
* Created by N on 29/03/2016.
*/
public class UserNote {
private int id;
private String email;
private int productId;
public int getProductId() {
return productId;
}
public void setProductId(int productId) {
this.productId = productId;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return "UserNote{" +
"id=" + id +
", email='" + email + '\'' +
", productId=" + productId +
'}';
}
public UserNote() {
}
public UserNote(int id, String email, int productId) {
this.id = id;
this.email = email;
this.productId = productId;
}
}
|
51b18dae-7b60-4e91-bd8f-ced959da39ef
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-13 08:09:34", "repo_name": "an9elkiss/api-union-user", "sub_path": "/src/main/java/com/an9elkiss/api/user/service/AuthService.java", "file_name": "AuthService.java", "file_ext": "java", "file_size_in_byte": 1207, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "4baa3a3ec5a36cd7db2af932ea2f1b8f8258881b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/an9elkiss/api-union-user
| 290
|
FILENAME: AuthService.java
| 0.293404
|
package com.an9elkiss.api.user.service;
import java.util.List;
import com.an9elkiss.api.user.command.MenusCmd;
import com.an9elkiss.api.user.command.TokenCmd;
import com.an9elkiss.api.user.command.UserPersonCmd;
import com.an9elkiss.commons.command.ApiResponseCmd;
public interface AuthService {
String QUERY_PARAM_USER_NAME = "name";
String QUERY_PARAM_USER_PASSWORD = "password";
String QUERY_PARAM_STATUS = "status";
ApiResponseCmd<TokenCmd> login(String loginName, String password);
ApiResponseCmd<MenusCmd> findMenus(String token);
/**
* 返回當前token下属用户和下属用户的用户直到最下面
* @param token
* @return
*/
ApiResponseCmd<List<UserPersonCmd>> findUserPersonCmd(String token);
/**
* 拿到所有人的信息
* @param token
* @return
*/
ApiResponseCmd<List<UserPersonCmd>> findAllPersonCmd(String token);
/**
* 重置密码
* @param oldPassword 旧密码
* @param newPassword 新密码
* @param repeatNewPassword 再次输入的新密码
* @param token 用户令牌
* @return
*/
ApiResponseCmd<Object> resetPassword(String oldPassword,String newPassword,String repeatNewPassword,String token);
}
|
fdcdb1b9-eafa-48a4-8236-33f0e5e29eb9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-10 20:05:03", "repo_name": "frealgagu/SharingApp", "sub_path": "/app/src/main/java/com/example/sharingapp/ViewUserActivity.java", "file_name": "ViewUserActivity.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "384bac8b318645dc7931197a7b13b39f001b586c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/frealgagu/SharingApp
| 188
|
FILENAME: ViewUserActivity.java
| 0.226784
|
package com.example.sharingapp;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
public class ViewUserActivity extends AppCompatActivity {
private UserList userList = new UserList();
private UserListController userListController = new UserListController(userList);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_user);
Intent intent = getIntent(); // Get intent from EditItemActivity
String usernameString = intent.getStringExtra(Constants.BORROWER_USERNAME_STR);
TextView username = (TextView) findViewById(R.id.username_right_tv);
TextView email = (TextView) findViewById(R.id.email_right_tv);
userListController.getRemoteUsers();
User user = userListController.getUserByUsername(usernameString);
UserController userController = new UserController(user);
username.setText(usernameString);
email.setText(userController.getEmail());
}
}
|
7cf797a3-83e7-41e4-ba64-4bcac7a9a553
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-11-11 10:07:44", "repo_name": "yzjgogo/YZJCourse", "sub_path": "/app/src/main/java/com/yin/yzjcourse/Base/ISActivity.java", "file_name": "ISActivity.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "a1c09d62920e4c9bc118cb3b40a639d6b98c1e16", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/yzjgogo/YZJCourse
| 229
|
FILENAME: ISActivity.java
| 0.242206
|
package com.yin.yzjcourse.Base;
import android.content.Intent;
import android.os.Bundle;
import com.yin.yzjcourse.BaseActivity;
import com.yin.yzjcourse.R;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class ISActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_is);
ButterKnife.bind(this);
}
/**
* 发起多个后台任务,后台任务会顺序执行,执行完所有的后台任务后IntentService才销毁
*/
private void runIntentService() {
Intent service = new Intent(this, LocalIntentService.class);
service.putExtra("task_action", "com.ryg.action.TASK1");
startService(service);
service.putExtra("task_action", "com.ryg.action.TASK2");
startService(service);
service.putExtra("task_action", "com.ryg.action.TASK3");
startService(service);
}
@OnClick(R.id.bt_start_is)
public void onClick() {
runIntentService();
}
}
|
3076b866-926d-451e-ba30-1f936bdc0bc4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-23 01:00:37", "repo_name": "eleniKougiou/Distributed-systems-project", "sub_path": "/ProjectKatanem/ProjectKatanem_src/forPublishers.java", "file_name": "forPublishers.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "0423f215818f2ea1acc9b7623940e324a80002a9", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/eleniKougiou/Distributed-systems-project
| 229
|
FILENAME: forPublishers.java
| 0.258326
|
import java.io.Serializable;
import java.util.ArrayList;
public class forPublishers implements Serializable {
private int port;
private boolean first;
private String ip;
private ArrayList<String> avArtists;
public forPublishers(){
}
public forPublishers(String ip, int port, boolean first, ArrayList<String> avArtists){
this.ip = ip;
this.port = port;
this.first = first;
this.avArtists = avArtists;
}
public String getIp(){
return ip;
}
public void setIp(String ip){
this.ip = ip;
}
public boolean getFirst(){
return first;
}
public void setFirst(boolean first){
this.first = first;
}
public ArrayList<String> getAvArtists(){
return avArtists;
}
public void setAvArtists(ArrayList<String> avArtists){
this.avArtists = avArtists;
}
public int getPort () { return port; }
public void setPort (int port) { this.port = port; }
}
|
2ae39af6-8f7f-4e36-8b69-f2203dc94aeb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-02-15T09:07:59", "repo_name": "jayson-temporas/nativescript-temp-sms", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1220, "line_count": 58, "lang": "en", "doc_type": "text", "blob_id": "b5e61149e085702de1266ef4d92e3ea571d66268", "star_events_count": 4, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/jayson-temporas/nativescript-temp-sms
| 282
|
FILENAME: README.md
| 0.262842
|
# nativescript-temp-sms
Warning: I don't have time to maintain and upgrade this plugin. If you want to implement it in IOS, just fork this repo and create your own plugin. Thanks.
Sending sms without user interaction.
var smsManager = android.telephony.SmsManager.getDefault();
smsManager.sendTextMessage("0123232332",null,"Hello",null,null);
## (Optional) Prerequisites / Requirements
To send sms without user interaction on Android your app must request permission to do so. The following must be in your app's AndroidManifest.xml
```xml
<uses-permission android:name="android.permission.SEND_SMS" />
```
iOS sms feature will soon be implemented.
## Installation
Install the plugin using the NativeScript CLI tooling
```javascript
tns plugin add nativescript-temp-sms
```
## Usage
To use the module you must first require() it from your project's node_modules directory:
After you have a reference to the module you can then call the available methods.
```js
var temp = require( "nativescript-temp-sms" );
temp.sms(number,message);
```
Methods:
sms(number,message)
Send sms on the background.
Parameters:
number: SMS number to use.
message: String to send.
## License
MIT, 2017
|
9a7782a1-1aeb-4d23-912d-43f1cdeec994
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-08-24T03:28:15", "repo_name": "andymikulski/Code-Samples", "sub_path": "/Work/Mondo Robot (2015)/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1103, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "8edc46b7a463e0c2c5199d21df237ef7d35c7aef", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/andymikulski/Code-Samples
| 247
|
FILENAME: README.md
| 0.199308
|
Andy Mikulski Sample Code
Mondo Robot samples
===
Here you can find samples I've produced while working full-time for [Mondo Robot](http://www.mondorobot.com/) in Boulder, CO.
## Gretzky
A jQuery UI-based widget framework, complete with sample components you too could make with gretzky.js! Due to client needs, we were required to work within certain technical bounds. Gretzky was developed to leverage good stuff from $.ui while maintaining our sanity when building a complex, multi-component application.
## LaterGatorf
This is a fun one! String-based deferred/lazy loader, for when you need to lazy load a page but can't/don't want to change the markup coming from the server. It's a little smelly, but it's an interesting concept to explore!
## WinWin
Simple module to bind events to the Window, while throttling via requestAnimationFrame. Instead of defining a millisecond-based throttle, events only fire on animation frames, when the browser is ready. Simple concept, effective results.
Questions, comments, concerns? Contact me at [andy.mikulski@gmail.com](andy.mikulski@gmail.com).
|
a1b14a58-85b0-4b04-9c23-7c47d0536baa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-23 15:27:39", "repo_name": "Kanuo007/text-email_genertator", "sub_path": "/src/main/java/edu/neu/css/cs5004/seattle/assignment9/Paragraph.java", "file_name": "Paragraph.java", "file_ext": "java", "file_size_in_byte": 1158, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "6d29fff31ade35ef0d821867adf33f5b92ea5ec4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Kanuo007/text-email_genertator
| 290
|
FILENAME: Paragraph.java
| 0.272025
|
package edu.neu.css.cs5004.seattle.assignment9;
import java.util.LinkedList;
public class Paragraph implements TextElement {
public static final String PATTERN = "(?![(\\*\\*\\*\\*)(\\>)(\\#+ )(( )*(1\\.| \\*) )]).+";
private String text;
/**
* Create a new paragraph
*/
private Paragraph(String line) {
this.text = line;
}
/**
* Create a new paragraph
*
* @param line the line of the paragraph
* @return a new paragraph
*/
public static Paragraph createParagraph(String line) {
return new Paragraph(line);
}
/**
* Return the text of this paragraph
*
* @return the text of this paragraph
*/
public String getText() {
return this.text;
}
/**
* {@inheritDoc}
*/
@Override
public void process(String line) {
this.text += line;
}
/**
* {@inheritDoc}
*/
@Override
public LinkedList<String> getFormattedContent(Formatter formatter) {
LinkedList<String> formattedContent = formatter.format(this, this.text);
return formattedContent;
}
/**
* {@inheritDoc}
*/
@Override
public String getPattern() {
return Paragraph.PATTERN;
}
}
|
897ee6db-3218-447f-8d75-00756790d6ff
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-27 15:22:31", "repo_name": "kingsamchen/Eureka", "sub_path": "/LearnAndroid/Step1-Activity/app/src/main/java/com/kc/step1_activity/app/SecondActivity.java", "file_name": "SecondActivity.java", "file_ext": "java", "file_size_in_byte": 1184, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "4b0a66a15edff88c5b9f89cf5aa3b74946d27cd0", "star_events_count": 28, "fork_events_count": 16, "src_encoding": "UTF-8"}
|
https://github.com/kingsamchen/Eureka
| 199
|
FILENAME: SecondActivity.java
| 0.255344
|
package com.kc.step1_activity.app;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
public class SecondActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_second);
Intent intent = getIntent();
String msg = intent.getStringExtra("welcome_message");
((TextView)findViewById(R.id.msg)).setText(msg);
Button reply = (Button)findViewById(R.id.button_2);
reply.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String reply = "Received your greeting message";
Intent intent = new Intent();
intent.putExtra("reply_message", reply);
setResult(RESULT_OK, intent);
finish();
}
});
}
}
|
79282383-dfc3-4053-87fd-4509a844feb7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-19 05:49:12", "repo_name": "tkdgur97/GCP", "sub_path": "/src/test/TCPClient2.java", "file_name": "TCPClient2.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "e2981151177a7129b82ccffe7a18154568a260db", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tkdgur97/GCP
| 205
|
FILENAME: TCPClient2.java
| 0.272025
|
package test;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.ByteBuffer;
import javax.imageio.ImageIO;
public class TCPClient2 {
private static String IMAGE_PATH = "2.jpg";// 파일 포맷 일치 필요
public static void main(String[] args) throws Exception {
Socket socket = new Socket("localhost", 9400);
OutputStream outputStream = socket.getOutputStream();
BufferedImage image = ImageIO.read(new File(IMAGE_PATH));
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ImageIO.write(image, "jpg", byteArrayOutputStream); // 파일 포맷 일치 필요
byte[] size = ByteBuffer.allocate(4).putInt(byteArrayOutputStream.size()).array();
outputStream.write(size);
outputStream.write(byteArrayOutputStream.toByteArray());
outputStream.flush();
System.out.println("Flushed: " + System.currentTimeMillis());
socket.close();
}
}
|
5cbcb82c-1f98-4425-9fb1-099416227d90
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-20 20:38:18", "repo_name": "aifsbei/loopit", "sub_path": "/app/src/main/java/com/tmvlg/loopit/PagerAdapter.java", "file_name": "PagerAdapter.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "8c6758205ba43c1ab319662752d2cb8c35c84cf6", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/aifsbei/loopit
| 214
|
FILENAME: PagerAdapter.java
| 0.278257
|
package com.tmvlg.loopit;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
public class PagerAdapter extends FragmentStatePagerAdapter {
int mNoOfTabs;
private boolean locked = false;
private int lockedIndex;
public void setLocked(boolean locked, int page) {
this.locked = locked;
lockedIndex = page;
notifyDataSetChanged();
}
public PagerAdapter(FragmentManager fm, int NumberOfTabs){
super(fm);
this.mNoOfTabs = NumberOfTabs;
}
@Override
public Fragment getItem(int position) {
if (locked) position = lockedIndex;
switch (position){
case 0:
Tab1 tab1 = new Tab1();
return tab1;
case 1:
Tab2 tab2 = new Tab2();
return tab2;
default:
return null;
}
}
@Override
public int getCount() {
return mNoOfTabs;
}
}
|
bfb00cd0-69f2-4387-9b42-6c2c3ae8871c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-21 13:37:44", "repo_name": "mehta4tejas/cricket", "sub_path": "/ecw/src/main/java/com/ecw/cricketscore/controller/PlayerController.java", "file_name": "PlayerController.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "7ccadf260694e9d60880a7129f54df9df4a644d9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mehta4tejas/cricket
| 187
|
FILENAME: PlayerController.java
| 0.279042
|
package com.ecw.cricketscore.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ecw.cricketscore.entities.Player;
import com.ecw.cricketscore.pojo.ResponseMessage;
import com.ecw.cricketscore.service.PlayerService;
import com.ecw.cricketscore.validity.PlayerValidator;
@RestController
@RequestMapping("/player/")
public class PlayerController {
@Autowired
PlayerValidator playerValidator;
@Autowired
PlayerService playerService;
@PostMapping()
public ResponseMessage addPlayer(@RequestBody Player player)
{
ResponseMessage responseMessage = playerValidator.addPlayer(player);
if(responseMessage==null)
{
responseMessage= playerService.addPlayer(player);
}
return responseMessage;
}
}
|
9138d92a-251c-4b68-96d5-68075fa5a56c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-24 07:09:47", "repo_name": "dahyoun-daddy/TOTORO", "sub_path": "/TOTORO/src/main/java/com/sist/totoro/domain/PrizesVO.java", "file_name": "PrizesVO.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "dd378d5a2fa09f77d69089d7ed55670eba3b79e9", "star_events_count": 0, "fork_events_count": 8, "src_encoding": "UTF-8"}
|
https://github.com/dahyoun-daddy/TOTORO
| 312
|
FILENAME: PrizesVO.java
| 0.286968
|
package com.sist.totoro.domain;
import com.sist.totoro.common.DTO;
public class PrizesVO extends DTO{
private String betwPrice;
private String userId;
private String betReturn;
private String betSeq;
public String getBetwPrice() {
return betwPrice;
}
public void setBetwPrice(String betwPrice) {
this.betwPrice = betwPrice;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getBetReturn() {
return betReturn;
}
public void setBetReturn(String betReturn) {
this.betReturn = betReturn;
}
public String getBetSeq() {
return betSeq;
}
public void setBetSeq(String betSeq) {
this.betSeq = betSeq;
}
public PrizesVO(String betwPrice, String userId, String betReturn, String betSeq) {
super();
this.betwPrice = betwPrice;
this.userId = userId;
this.betReturn = betReturn;
this.betSeq = betSeq;
}
@Override
public String toString() {
return "PrizesVO [betwPrice=" + betwPrice + ", userId=" + userId + ", betReturn=" + betReturn + ", betSeq="
+ betSeq + "]";
}
public PrizesVO() {
super();
}
}
|
7cacc9d9-d93b-42a8-84d1-e7c0208f0ec8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-28 18:16:34", "repo_name": "gitskarios/Gitskarios", "sub_path": "/app/src/main/java/com/alorma/github/ui/fragment/users/FollowingFragment.java", "file_name": "FollowingFragment.java", "file_ext": "java", "file_size_in_byte": 1217, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "15a1e6ed38f95df82887c614bca578291b103fc0", "star_events_count": 678, "fork_events_count": 172, "src_encoding": "UTF-8"}
|
https://github.com/gitskarios/Gitskarios
| 251
|
FILENAME: FollowingFragment.java
| 0.256832
|
package com.alorma.github.ui.fragment.users;
import android.os.Bundle;
import com.alorma.github.R;
import com.alorma.github.sdk.services.user.UserFollowingClient;
public class FollowingFragment extends BaseUsersListFragment {
private String username;
public static FollowingFragment newInstance() {
return new FollowingFragment();
}
public static FollowingFragment newInstance(String username) {
FollowingFragment followingFragment = new FollowingFragment();
if (username != null) {
Bundle bundle = new Bundle();
bundle.putString(USERNAME, username);
followingFragment.setArguments(bundle);
}
return followingFragment;
}
@Override
protected void executeRequest() {
super.executeRequest();
setAction(new UserFollowingClient(username), true);
}
@Override
protected void executePaginatedRequest(int page) {
super.executePaginatedRequest(page);
setAction(new UserFollowingClient(username, page), true);
}
@Override
protected void loadArguments() {
if (getArguments() != null) {
username = getArguments().getString(USERNAME);
}
}
@Override
protected int getNoDataText() {
return R.string.no_followings;
}
}
|
84071ff9-56d8-4c6b-90e9-ac7f623d4a28
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-24 16:57:00", "repo_name": "norwicaksana/AKAKOMSTMIK1", "sub_path": "/app/src/main/java/egaakakom/gmail/com/akakomstmik/PagerAdapter.java", "file_name": "PagerAdapter.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "26850196841ad702bb2c34db94e8f5493fd78f3e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/norwicaksana/AKAKOMSTMIK1
| 230
|
FILENAME: PagerAdapter.java
| 0.258326
|
package egaakakom.gmail.com.akakomstmik;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.widget.Switch;
/**
* Created by Student on 17/12/2017.
*/
public class PagerAdapter extends FragmentStatePagerAdapter {
int mNoOfTabs;
public PagerAdapter(FragmentManager fm, int NumberOfTabs)
{
super(fm);
this.mNoOfTabs = NumberOfTabs;
}
@Override
public Fragment getItem(int position) {
switch(position)
{
case 0:
ProfileFragment pf = new ProfileFragment();
return pf;
case 1:
VismisFragment vismis = new VismisFragment();
return vismis;
case 2:
PejabatFragment jabat = new PejabatFragment();
return jabat;
default:
return null;
}
}
@Override
public int getCount() {
return mNoOfTabs;
}
}
|
1d44c105-bab2-499a-bb09-d400e70cb14a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-25 23:16:39", "repo_name": "moraiseverton/DesignPatternsExamples", "sub_path": "/src/br/com/designpatterns/creational/factorymethod/UseFactoryMethod.java", "file_name": "UseFactoryMethod.java", "file_ext": "java", "file_size_in_byte": 1100, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "bd74fc895f494374c56e73b185826fd40d040a39", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/moraiseverton/DesignPatternsExamples
| 204
|
FILENAME: UseFactoryMethod.java
| 0.27048
|
package br.com.designpatterns.creational.factorymethod;
import java.util.Scanner;
public class UseFactoryMethod {
@SuppressWarnings("resource")
public static void main(String[] args) {
System.out.println("1 - Tablet ");
System.out.println("2 - Laptop ");
System.out.println("3 - Smartphone ");
Scanner scanner = new Scanner(System.in);
int option = scanner.nextInt();
String connectionType = "";
switch (option) {
case 1:
connectionType = DeviceFactory.TABLET;
break;
case 2:
connectionType = DeviceFactory.LAPTOP;
break;
case 3:
connectionType = DeviceFactory.SMARTPHONE;
break;
default:
connectionType = "other";
break;
}
DeviceFactory factory = new DeviceFactory();
Device connection = factory.createDevice(connectionType);
System.out.println("I have just bought a new eletronic device! " + connection.buy());
}
}
|
f72ecd59-0755-4898-bd65-6b74146f066a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-25 18:16:01", "repo_name": "SleepyKolosLolya/WintWare-Before-Zamorozka", "sub_path": "/src/me/wintware/client/module/visual/ShadowESP.java", "file_name": "ShadowESP.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "077dd5d24f864cfaa9f69a4997539e8e200945f1", "star_events_count": 6, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SleepyKolosLolya/WintWare-Before-Zamorozka
| 227
|
FILENAME: ShadowESP.java
| 0.253861
|
package me.wintware.client.module.visual;
import java.util.Iterator;
import me.wintware.client.event.EventTarget;
import me.wintware.client.event.impl.EventUpdate;
import me.wintware.client.module.Category;
import me.wintware.client.module.Module;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
public class ShadowESP extends Module {
public ShadowESP() {
super("ShadowEsp", Category.Visuals);
}
public void onDisable() {
Iterator var1 = mc.world.playerEntities.iterator();
while(var1.hasNext()) {
EntityPlayer player = (EntityPlayer)var1.next();
if (player.isGlowing()) {
player.setGlowing(false);
}
}
super.onDisable();
}
@EventTarget
public void onUpdate(EventUpdate event) {
Iterator var2 = mc.world.loadedEntityList.iterator();
while(var2.hasNext()) {
Entity player = (Entity)var2.next();
if (player instanceof EntityPlayer) {
player.setGlowing(true);
}
}
}
}
|
8ccb4f18-db1f-41ec-87b4-feea66410cf4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-05 22:56:44", "repo_name": "IskanderGilaziev/ru.innopolis.stc9.Servlets_Student", "sub_path": "/src/main/java/Servlets/Controller/filter/UserFilter.java", "file_name": "UserFilter.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "196304adeeb636854eb8803c9fce42666c3c1e49", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/IskanderGilaziev/ru.innopolis.stc9.Servlets_Student
| 193
|
FILENAME: UserFilter.java
| 0.264358
|
package Servlets.Controller.filter;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
public class UserFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
//do it
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
HttpSession httpSession = ((HttpServletRequest)servletRequest).getSession();
if(httpSession.getAttribute("login")!= null) {
filterChain.doFilter(servletRequest, servletResponse);
}
else {
HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
httpServletResponse.sendRedirect(httpServletRequest.getContextPath()+"/login?errorMsg=noAuth");
}
}
@Override
public void destroy() {
//do it
}
}
|
7793c825-42a4-4445-a48c-6faac057f533
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-17 14:48:45", "repo_name": "maxtkachenkoua/jason-upwork-test", "sub_path": "/src/main/java/com/upwork/tkachenko/module/account/model/Account.java", "file_name": "Account.java", "file_ext": "java", "file_size_in_byte": 1220, "line_count": 65, "lang": "en", "doc_type": "code", "blob_id": "5697d397d9ef8a3ede83d71b125a64427f54cf8e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/maxtkachenkoua/jason-upwork-test
| 258
|
FILENAME: Account.java
| 0.272799
|
package com.upwork.tkachenko.module.account.model;
import java.math.BigDecimal;
public class Account {
private String accountId;
private String customerName;
private String currency;
private BigDecimal amount;
public Account() {
// intentionally left empty
}
public Account(String accountId, String customerName, String currency, BigDecimal amount) {
this.accountId = accountId;
this.customerName = customerName;
this.currency = currency;
this.amount = amount;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
@Override
public String toString() {
return "Account [accountId=" + accountId + ", customerName=" + customerName + ", currency="
+ currency + ", amount=" + amount + "]";
}
}
|
984ae500-5b53-4692-a15b-ce32ab377bcf
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-29 09:31:57", "repo_name": "RyzeUserName/cryptography", "sub_path": "/add_and_decrypt/src/main/java/com/example/add_and_decrypt/crypto/CipherOutputStreamTest.java", "file_name": "CipherOutputStreamTest.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "f0527a4f3ad4e5f0cd78b01adc44dcc419960c24", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/RyzeUserName/cryptography
| 226
|
FILENAME: CipherOutputStreamTest.java
| 0.278257
|
package com.example.add_and_decrypt.crypto;
import javax.crypto.*;
import java.io.*;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
/**
* CipherOutputStream 测试类
* @author Ryze
* @date 2019-09-25 16:43
*/
public class CipherOutputStreamTest {
public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, IOException {
//des 生成key
KeyGenerator keyGenerator = KeyGenerator.getInstance("DES");
SecretKey secretKey = keyGenerator.generateKey();
//初始化
Cipher cipher = Cipher.getInstance("DES");
//加密模式
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
//初始化流
CipherOutputStream cipherInputStream = new CipherOutputStream(new FileOutputStream(new File("secret")), cipher);
DataOutputStream dataInputStream = new DataOutputStream(cipherInputStream);
//写入加密的数据
dataInputStream.writeUTF("data");
dataInputStream.close();
cipherInputStream.close();
}
}
|
070de672-8f56-44c4-95ed-2e18e675fd89
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-13 16:04:24", "repo_name": "lxmiccio/Chat-Server", "sub_path": "/src/chat/ChatServer.java", "file_name": "ChatServer.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "cb799d17fea90d5afc7fa895e2791c7993b87af1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lxmiccio/Chat-Server
| 217
|
FILENAME: ChatServer.java
| 0.264358
|
package chat;
import chat.server.gui.*;
import java.net.*;
import javax.swing.*;
/**
*
* @author Alex
*/
public class ChatServer {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Windows".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception exception) {
}
JForm jForm = new JForm();
jForm.initialize();
}
public static String getIpAddress() {
String ip = "";
try {
InetAddress[] inetAddresses = InetAddress.getAllByName(InetAddress.getLocalHost().getCanonicalHostName());
if (inetAddresses != null) {
ip = inetAddresses[0].toString().substring(inetAddresses[0].toString().lastIndexOf("/") + 1);
}
} catch (UnknownHostException exception) {
exception.printStackTrace();
}
return ip;
}
}
|
eca51906-8181-4790-82d2-e547a66c1ef7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-25 17:39:58", "repo_name": "isha1110/Daily_needs", "sub_path": "/app/src/main/java/com/skinfotech/dailyneeds/models/responses/ProfileResponse.java", "file_name": "ProfileResponse.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "09b92bb9cc3c8f234b443fa45d5a3040747fe2b6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/isha1110/Daily_needs
| 205
|
FILENAME: ProfileResponse.java
| 0.203075
|
package com.skinfotech.dailyneeds.models.responses;
import com.google.gson.annotations.SerializedName;
public class ProfileResponse extends CommonResponse{
@SerializedName("username")
private String mUserName = "";
@SerializedName("mail")
private String mUserEmail = "";
@SerializedName("mobileNumber")
private String mMobileNumber = "";
@SerializedName("userImage")
private String mUserImage = "";
@SerializedName("primaryAddress")
private String mPrimaryAddress = "";
@SerializedName("cartCount")
private String mCartCount = "";
public String getCartCount() {
return mCartCount;
}
public String getUserName() {
return mUserName;
}
public String getUserEmail() {
return mUserEmail;
}
public String getMobileNumber() {
return mMobileNumber;
}
public String getUserImage() {
return mUserImage;
}
public String getPrimaryAddress() {
return mPrimaryAddress;
}
}
|
7881cfdd-1510-46fa-bda8-914176ff263b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-01-17 09:00:16", "repo_name": "yueban/AndroidExercise", "sub_path": "/MotionLayoutDemo/app/src/main/java/com/yueban/motionlayoutdemo/codelab/CodeLab8Activity.java", "file_name": "CodeLab8Activity.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "97cd3b3676a943687065b79849cc1970c167de33", "star_events_count": 17, "fork_events_count": 6, "src_encoding": "UTF-8"}
|
https://github.com/yueban/AndroidExercise
| 200
|
FILENAME: CodeLab8Activity.java
| 0.286968
|
package com.yueban.motionlayoutdemo.codelab;
import android.os.Bundle;
import com.google.android.material.appbar.AppBarLayout;
import com.yueban.motionlayoutdemo.R;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.motion.widget.MotionLayout;
public class CodeLab8Activity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_code_lab8);
coordinateMotion();
}
private void coordinateMotion() {
final AppBarLayout appBarLayout = findViewById(R.id.appbar_layout);
final MotionLayout motionLayout = findViewById(R.id.motion_layout);
appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout layout, int i) {
float seekPosition = -i * 1.0f / appBarLayout.getTotalScrollRange();
motionLayout.setProgress(seekPosition);
}
});
}
}
|
2634b364-6d8a-4d7e-bf1c-7549a22861a2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-31 14:26:18", "repo_name": "GoogleJ/HelloWorld", "sub_path": "/app/src/main/java/com/zxjk/duoduo/ui/externalfunc/ThirdPartPayResultActivity.java", "file_name": "ThirdPartPayResultActivity.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "4f8de46d48b57823d866cb298f0358b224b40d24", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/GoogleJ/HelloWorld
| 239
|
FILENAME: ThirdPartPayResultActivity.java
| 0.243642
|
package com.zxjk.duoduo.ui.externalfunc;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.zxjk.duoduo.R;
import com.zxjk.duoduo.bean.response.ThirdPartyPaymentOrderResponse;
import com.zxjk.duoduo.ui.base.BaseActivity;
import com.zxjk.duoduo.utils.GlideUtil;
public class ThirdPartPayResultActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_third_part_pay_result);
ThirdPartyPaymentOrderResponse r = getIntent().getParcelableExtra("data");
if (r == null) {
finish();
return;
}
TextView tvMoney = findViewById(R.id.tvMoney);
TextView tvSymbol = findViewById(R.id.tvSymbol);
ImageView ivSymbol = findViewById(R.id.ivSymbol);
tvMoney.setText("-" + r.getAmount());
tvSymbol.setText(r.getSymbol());
GlideUtil.loadCircleImg(ivSymbol, r.getSymbolLogo());
}
public void back(View view) {
finish();
}
}
|
54bbd428-c7b8-4adb-bd1a-e0baa469f6d1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-27 10:12:35", "repo_name": "moranmo29/Final_Project", "sub_path": "/app/src/main/java/com/example/user/myd/AlarmReceiver.java", "file_name": "AlarmReceiver.java", "file_ext": "java", "file_size_in_byte": 1226, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "1daa5b4e87acf8bafdf093a9098eba3280c10257", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/moranmo29/Final_Project
| 220
|
FILENAME: AlarmReceiver.java
| 0.246533
|
package com.example.user.myd;
/**
* This class created for 'orders set alarm'
*/
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;
import android.widget.Toast;
public class AlarmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent arg1) {
Toast.makeText(context, "תזכורת! הגעת הזמנה", Toast.LENGTH_LONG).show();
String title="אפליקציה לניהול ושיווק מוצר";
String msg = "תזכורת! הגעת הזמנה - קבלת הזמנה חדשה";
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(title)
.setTicker(title)
.setContentText(msg);
mBuilder.setDefaults(NotificationCompat.DEFAULT_SOUND);
mBuilder.setAutoCancel(true);
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(1, mBuilder.build());
}
}
|
51ebd850-2a20-4b19-8b23-7330840e1bac
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-29 21:30:38", "repo_name": "Sgrygorczuk/Hunter", "sub_path": "/core/src/com/mygdx/templet/screens/textures/MenuScreenTextures.java", "file_name": "MenuScreenTextures.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "3804d86f56775a5a6a5b3dd04bd2bd6d3ba6141b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Sgrygorczuk/Hunter
| 226
|
FILENAME: MenuScreenTextures.java
| 0.281406
|
package com.mygdx.templet.screens.textures;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
public class MenuScreenTextures {
//============================================= Textures =======================================
public Texture backgroundTexture;
public Texture menuBackgroundTexture; //Pop up menu to show menu buttons and Help screen
public TextureRegion[][] buttonSpriteSheet;
public Texture controlsTexture;
public MenuScreenTextures(){ showTextures(); }
/**
* Purpose: Sets up all of the textures
*/
private void showTextures(){
backgroundTexture = new Texture(Gdx.files.internal("UI/MenuBackground.png"));
menuBackgroundTexture = new Texture(Gdx.files.internal("UI/BoarderBox.png"));
controlsTexture = new Texture(Gdx.files.internal("UI/Instructions.png"));
Texture menuButtonTexturePath = new Texture(Gdx.files.internal("UI/Button.png"));
buttonSpriteSheet = new TextureRegion(menuButtonTexturePath).split(
menuButtonTexturePath.getWidth()/2, menuButtonTexturePath.getHeight());
}
}
|
18ccf080-ccc6-4c52-a236-2e34d4542243
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-06-20 13:05:00", "repo_name": "kdyzm/day20_2", "sub_path": "/src/com/kdyzm/listener/SessionListener.java", "file_name": "SessionListener.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "2570c983502b39ce23170ba64010769462bc7178", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "GB18030"}
|
https://github.com/kdyzm/day20_2
| 237
|
FILENAME: SessionListener.java
| 0.29584
|
package com.kdyzm.listener;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
public class SessionListener implements HttpSessionListener {
@Override
public void sessionCreated(HttpSessionEvent arg0) {
System.out.println(arg0.getSource()+" session被创建!");
ServletContext sc=arg0.getSession().getServletContext();
List<HttpSession>list=(List<HttpSession>) sc.getAttribute("userlist");
if(list==null)
{
list=new ArrayList<HttpSession>();
}
list.add(arg0.getSession());
sc.setAttribute("userlist", list);
}
@Override
public void sessionDestroyed(HttpSessionEvent arg0) {
System.out.println(arg0.getSession().getId()+" 退出!");
//退出的时候需要将该session从userlist中删除
HttpSession session=arg0.getSession();
String sessionid=session.getId();
List<HttpSession>list=(List<HttpSession>) arg0.getSession().getServletContext().getAttribute("userlist");
list.remove(session);
}
}
|
5681b539-a00f-439b-91cc-cecb869634e4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-28 07:48:34", "repo_name": "behroohj/senikshop", "sub_path": "/app/src/main/java/com/abideveloprs/smartmarket/debug/parser/contactUsJsonParser.java", "file_name": "contactUsJsonParser.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "9cf32073f22d69b066702ef8962bc4866189db30", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/behroohj/senikshop
| 198
|
FILENAME: contactUsJsonParser.java
| 0.243642
|
package com.abideveloprs.smartmarket.debug.parser;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Created by imanbahmani on 9/1/16 AD.
*/
public class contactUsJsonParser {
public void contactUsJsonParserInput(String input)
{
try
{
try
{
JSONArray jsonarray = new JSONArray(input);
for(int i=0; i<jsonarray.length(); i++)
{
JSONObject obj = jsonarray.getJSONObject(i);
int id = obj.getInt("id");
String title = obj.getString("title");
String number = obj.getString("number");
Boolean trash = obj.getBoolean("trash");
}
}
catch (JSONException e)
{
e.printStackTrace();
}
} catch (Exception e)
{
Log.e("Error: ", e.getMessage());
}
}
}
|
052c1196-8383-4858-815b-d7deb1c2d104
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-14 18:11:01", "repo_name": "rahat14/Chatter", "sub_path": "/app/src/main/java/com/syntexerror/chatter/PlaceholderFragment.java", "file_name": "PlaceholderFragment.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "59845c3e8c1dfc961448d9256cd11747c3babd1b", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rahat14/Chatter
| 171
|
FILENAME: PlaceholderFragment.java
| 0.201813
|
package com.syntexerror.chatter;
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;
public class PlaceholderFragment extends Fragment {
private static final String ARG_SECTION_NUMBER = "section_number";
public static PlaceholderFragment newInstance(int index) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle bundle = new Bundle();
bundle.putInt(ARG_SECTION_NUMBER, index);
fragment.setArguments(bundle);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(
@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_main, container, false);
return root;
}
}
|
daa2548a-cb93-48d2-8ff6-ee77c11e851e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-06 06:58:11", "repo_name": "prateektdev/need82-package", "sub_path": "/need82-packages/src/main/java/com/need82/packag/utils/BaseResponse.java", "file_name": "BaseResponse.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "fa658519b79e159f8aba409e6929e3545484fb13", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/prateektdev/need82-package
| 246
|
FILENAME: BaseResponse.java
| 0.264358
|
package com.need82.packag.utils;
import java.util.List;
import com.need82.packag.model.PackageModel;
public class BaseResponse {
private String message;
private Boolean success;
private List<PackageModel> response;
public String getMessage() {
return message;
}
public Boolean getSuccess() {
return success;
}
public List<PackageModel> getResponse() {
return response;
}
public void setMessage(String message) {
this.message = message;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public void setResponse(List<PackageModel> response) {
this.response = response;
}
@Override
public String toString() {
return "BaseResponse [message=" + message + ", success=" + success + ", response=" + response + "]";
}
public BaseResponse(Boolean success,String message, List<PackageModel> response) {
super();
this.message = message;
this.success = success;
this.response = response;
}
public BaseResponse(Boolean success,String message) {
super();
this.message = message;
this.success = success;
}
public BaseResponse() {
}
}
|
acc0bfc0-ea72-4d43-8373-3a8d6c7d9473
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-17T08:06:58", "repo_name": "ebh/mockdynamodb", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1220, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "7bf16e69d48e077b0708a554b7a4597aa576dbec", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ebh/mockdynamodb
| 298
|
FILENAME: README.md
| 0.23793
|
# github.com/ebh/mockdynamodb
In-memory implementation of DynamoDB, ideal for unit testing

[](https://pkg.go.dev/github.com/ebh/mockdynamodb)
## Credit
This module was inspired by and basically copies [github.com/elliotchance/mocksqs](https://github.com/elliotchance/mocksqs) by [Elliot Chance](https://github.com/elliotchance).
## Creating the Service
The simplest way to create a new DynamoDB service is with `mockdynamodb.New()`. However,
if you need tables you can use `mockdynamodb.NewWithTables()`:
```go
tableName := "foobar"
client := mocksqs.NewWithTables({tableName})
result, err := client.PutItem(&dynamodb.PutItemInput{
TableName: aws.String(tableName),
})
```
## Supported Functionality
Only some DynamoDB methods are implemented, at moment. Methods not implemented
will panic. If you want a method implemented please [raise an issue](https://github.com/ebh/mockdynamodb/issues/new).
You can view the specific implementation details in the
[godoc documentation](https://pkg.go.dev/github.com/ebh/mockdynamodb).
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.