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
|
|---|---|---|---|---|---|---|
1a24b349-7791-4248-a628-b31dabcc9b82
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-02 15:36:45", "repo_name": "sangaizhi/zookeeper", "sub_path": "/zookeeper-base/src/main/java/org/sangaizhi/zookeeper/base/watcher/ConnectWatcher.java", "file_name": "ConnectWatcher.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "de7ffc3c76a5a7e9840e42a57b64aecb8429fece", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sangaizhi/zookeeper
| 318
|
FILENAME: ConnectWatcher.java
| 0.288569
|
/**
* 文件名称: ConnectWatcher
* 系统名称: zookeeper
* 模块名称:
* 软件版权:
* 功能说明:
* 系统版本: 1.0.0.0
* 开发人员: sangaizhi
* 开发时间: 2017/6/11 14:52
* 审核人员:
* 相关文档:
* 修改记录:
* 修改日期:
* 修改人员:
* 修改说明:
*/
package org.sangaizhi.zookeeper.base.watcher;
import org.apache.zookeeper.WatchedEvent;
import java.util.concurrent.CountDownLatch;
/**
* @name ConnectWatcher
* @author sangaizhi
* @date 2017/6/11 14:52
* @version 1.0
*/
public class ConnectWatcher extends MyWatcher {
private CountDownLatch countDownLatch;
public ConnectWatcher(){};
public ConnectWatcher(CountDownLatch countDownLatch){
this.countDownLatch = countDownLatch;
}
/**
* 客户端与 Zookeeper 建立连接后,该方法就会被调用
* @param watchedEvent 连接的事件
*/
public void process(WatchedEvent watchedEvent) {
if(watchedEvent.getState() == Event.KeeperState.SyncConnected){
System.out.println("创建连接完成:" + watchedEvent.getWrapper());
countDownLatch.countDown();
}
}
}
|
135c70fb-9092-4457-a63b-c9433558a532
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-10-31 06:55:21", "repo_name": "dengjiaping/hn-apos", "sub_path": "/apos/apos-enterprise-android2.5/src/me/andpay/apos/vas/event/PurchaseOrderItemClickController.java", "file_name": "PurchaseOrderItemClickController.java", "file_ext": "java", "file_size_in_byte": 1056, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "589e7595e80a2e8eb9f78876dffe801c5cbded74", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/dengjiaping/hn-apos
| 247
|
FILENAME: PurchaseOrderItemClickController.java
| 0.294215
|
package me.andpay.apos.vas.event;
import me.andpay.apos.dao.model.PurchaseOrderInfo;
import me.andpay.apos.vas.VasProvider;
import me.andpay.apos.vas.activity.PurchaseOrderListActivity;
import me.andpay.timobileframework.mvc.AbstractEventController;
import me.andpay.timobileframework.mvc.form.FormBean;
import android.app.Activity;
import android.view.View;
import android.widget.AdapterView;
/**
* 列表点击事件
*
* @author tinyliu
*
*/
public class PurchaseOrderItemClickController extends AbstractEventController {
public void onItemClick(Activity refActivty, FormBean formBean,
AdapterView<?> adapterView, View view, int position, long id) {
PurchaseOrderListActivity activity = (PurchaseOrderListActivity) refActivty;
if (position >= activity.getAdapter().getCount()) {
return;
}
PurchaseOrderInfo info = (PurchaseOrderInfo) activity.getAdapter()
.getItem(position);
activity.getControl().setFlowContextData(info);
activity.getControl().nextSetup(activity,
VasProvider.VAS_FLOWS_QUERY_COMPLETE_DETAIL);
}
}
|
c18a8de9-3dcd-4e46-b94d-cfd963d46380
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-10 07:35:45", "repo_name": "panguixiang/zqgame-springmvc-maven", "sub_path": "/java/bw.zqgame.com/com/zqgame/services/ZsPhoneService.java", "file_name": "ZsPhoneService.java", "file_ext": "java", "file_size_in_byte": 1138, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "4ca3e440c589eec49d4fbdac088fc58f52c67ba8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/panguixiang/zqgame-springmvc-maven
| 327
|
FILENAME: ZsPhoneService.java
| 0.281406
|
package com.zqgame.services;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zqgame.mappers.ZsPhoneDao;
import com.zqgame.models.ZsPhone;
/**
* 签到激活码service
* @author panguixiang
*
*/
/**
* 签到激活码service
* @author panguixiang
*
*/
@Service
public class ZsPhoneService {
@Autowired
private ZsPhoneDao zsPhoneDao;
/**
* 查询单个ZsPhone
* @param cardCode
* @return
*/
public ZsPhone queryZsPhone(ZsPhone zsPhone) {
return zsPhoneDao.queryZsPhone(zsPhone);
}
/**
* 修改ZsPhone
* @param zsPhone
*/
public void updateZsPhone(ZsPhone zsPhone) {
zsPhoneDao.updateZsPhone(zsPhone);
}
/**
* 预约激活码前查看是否已经使用过此手机号码和邮箱 war2
*/
public Map getBespeakCardCodeByMobileOrEmail(String mobile, String email) {
return zsPhoneDao.getBespeakCardCodeByMobileOrEmail(mobile, email);
}
/**
* 预约激活码 war2
*/
public void insertBespeakCardCode(String mobile, String email) {
zsPhoneDao.insertBespeakCardCode(mobile, email);
}
}
|
0b9288db-6406-4627-a865-150b1653e007
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-17 09:58:36", "repo_name": "MrStrangerYang/RetrofitTest", "sub_path": "/api/src/main/java/com/example/api/ApiResponse.java", "file_name": "ApiResponse.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 76, "lang": "en", "doc_type": "code", "blob_id": "1702d6c55017089b1a69bd2ba5aa22688ad5b972", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MrStrangerYang/RetrofitTest
| 277
|
FILENAME: ApiResponse.java
| 0.253861
|
package com.example.api;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by mrstranger on 16/6/15.
*/
public class ApiResponse<T> {
@SerializedName("event")
@Expose
private String event;
@SerializedName("msg")
@Expose
private String msg;
@SerializedName("user")
@Expose
private T user;
/**
*
* @return
* The event
*/
public String getEvent() {
return event;
}
/**
*
* @param event
* The event
*/
public void setEvent(String event) {
this.event = event;
}
/**
*
* @return
* The msg
*/
public String getMsg() {
return msg;
}
/**
*
* @param msg
* The msg
*/
public void setMsg(String msg) {
this.msg = msg;
}
/**
*
* @return
* The user
*/
public T getUser() {
return user;
}
/**
*
* @param user
* The user
*/
public void setUser(T user) {
this.user = user;
}
}
|
06533c21-7da6-434f-8aa9-88f65b4e7ac3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-09-15T00:51:31", "repo_name": "ahuffma2/get-fit", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1137, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "920a531d1d054054da6a0264aa32e44b56d6a42a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ahuffma2/get-fit
| 278
|
FILENAME: README.md
| 0.259826
|
# Get Fit
[](https://opensource.org/licenses/MIT)
Use this handy application to track your daily workouts in detail. Visualize your progress via graphs to see your improvement over time!
## Table of Contents
--------
## Installation
For Local
* Clone this Repository using the green button in the top right.
* Using the terminal of choice type the comman ```npm i``` in the directory you cloned
* If you haven't installed MongoDB go to their site to get started
* In another teminal run ```Mongod``` (This needs to run in a separate terminal. All other commands will be in the original terminal used)
* Optional: Run the command ```Npm Run Seed`` if you want to have pre-made data instead of inputting your own
* Run ```Nodemon Server.js```
And that's it! Go to Localhost:3000 on your browser and and you're good!
--------
## Questions
If you need to reach me please contact me at my email
austinhuffman0@gmail.com
Find all my other projects at [Github](https://github.com/Ahuffma2)
|
e4f7775c-89c1-43f7-85f2-1eb4cbcd5977
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-23 01:00:14", "repo_name": "Petruzzi/final_project", "sub_path": "/src/main/java/com/iktpreobuka/final_project/entities/ParentEntity.java", "file_name": "ParentEntity.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "2544c04bb244db52563405566cc8eed73309965e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Petruzzi/final_project
| 248
|
FILENAME: ParentEntity.java
| 0.281406
|
package com.iktpreobuka.final_project.entities;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonView;
import com.iktpreobuka.final_project.security.Views;
@Entity
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class ParentEntity extends UserEntity{
@ManyToMany(fetch=FetchType.LAZY,cascade=CascadeType.REFRESH)
@JoinTable(name="parent_student",joinColumns=
{@JoinColumn(name="parent_id",nullable=false,updatable=false)},
inverseJoinColumns=
{@JoinColumn(name="student_id",nullable=false,updatable=false)})
@JsonView(Views.Private.class)
List<StudentEntity> students=new ArrayList<StudentEntity>();
public ParentEntity() {
super();
}
public List<StudentEntity> getStudents() {
return students;
}
public void setStudents(List<StudentEntity> students) {
this.students = students;
}
}
|
8186e7d0-9fa4-4485-be84-e0ba22530a69
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-24 09:07:42", "repo_name": "Andrew-Yang999/LockAndTransactional1", "sub_path": "/src/main/java/com/andrew/demo/controller/ProductController.java", "file_name": "ProductController.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "716a43808de17046a276f710a86dd4f392dfecbf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Andrew-Yang999/LockAndTransactional1
| 223
|
FILENAME: ProductController.java
| 0.242206
|
package com.andrew.demo.controller;
import com.andrew.demo.entity.Product;
import com.andrew.demo.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.CountDownLatch;
/**
* @Author Andrew Yang
* @ClassName ProductController
* @Description
* @Package com.andrew.demo.controller
* @Create 2021-08-24 10:40
*/
@RestController
@RequestMapping("/product")
public class ProductController {
@Autowired
private ProductService productService;
@RequestMapping("/sell")
public void sellProduct() {
CountDownLatch countDownLatch = new CountDownLatch(100);
for (int i = 0; i < 100; i++) {
new Thread(() -> {
try {
countDownLatch.await();
productService.sellProduct();
} catch (InterruptedException e) {
e.printStackTrace();
}
}).start();
countDownLatch.countDown();
}
// productService.sellProduct();
}
}
|
b1c385fa-83d7-4b5d-9ddf-95aca96d16b3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-11 06:04:13", "repo_name": "AppSecAI-TEST/practice-projects", "sub_path": "/practice-excel/src/main/java/excel/ProductJson.java", "file_name": "ProductJson.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "c2923bb369a237629d9941dad65d809dc8a19ca2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AppSecAI-TEST/practice-projects
| 220
|
FILENAME: ProductJson.java
| 0.233706
|
package excel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
/**
* Created by huang on 2017/6/16.
*/
public class ProductJson {
public static String getClassType(String productName) {
JSONArray jsonArray = JSON.parseArray(json);
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject each = jsonArray.getJSONObject(i);
String product_name = each.getString("PRODUCT_NAME");
if (product_name.equals(productName)) {
return each.getString("CLASS_TYPE");
}
}
return null;
}
public static String getClassCode(String productCode) {
JSONArray jsonArray = JSON.parseArray(json);
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject each = jsonArray.getJSONObject(i);
String product_name = each.getString("PRODUCT_NAME");
if (product_name.equals(productCode)) {
return each.getString("PRODUCT_CODE");
}
}
return null;
}
public static String json = "";
}
|
ab5bee73-d162-495e-8388-1bf21f9c41ac
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-05-31T14:17:19", "repo_name": "aas312/consumer-quorum", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1218, "line_count": 43, "lang": "en", "doc_type": "text", "blob_id": "37a7c2040dd6a31660ddd840a2b47a411be4b241", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/aas312/consumer-quorum
| 298
|
FILENAME: README.md
| 0.292595
|
## Trying out quorum and solidity
Trying out quorum and solidity.
I want to use modifiers to check if a user can execute a function.
Role.sol
contains mapping of role to a function. this is very basic. right now i just
want to assign one uint8 number to one string function
User.sol
contains mapping of user to their role
BaseContract.sol
contains the modifier that accepts th user's uid, gets the role and then checks if the
role is mapped to the string function.
BaseContract will be inherited by other other contracts.
Consumer.sol
Basically this is simple contract with get and set function.
getInfo is available for everyone.
setInfo requires the senderId/uid to have role 5.
## Prereqs
Quroum 7 node example
node v8.9.x
truffle v4.1.6 (because this version compiles with solidity v0.4.21)
# deploying contracts
```npm run buid``` removes the build folder, does truffle compile and truffle migrate.
On migrate call the initRoles(), which will record 5 to setInfo, in Role.sol.
# running test
```npm run test``` executes the tests in the mochatests folder.
# running the app
```node sandbox.js```
record a user with role 5
get the user role
set the info using the user created above
get the info
|
5dfe1339-0756-4619-8c7f-6843cd7bcd8e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-21 16:50:12", "repo_name": "kkmehta03/AndroidApp_sample", "sub_path": "/app/src/main/java/com/example/internship_app/LoginActivity.java", "file_name": "LoginActivity.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "51d58cb041ae463889b1a5b11b42c2d7a9081967", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kkmehta03/AndroidApp_sample
| 202
|
FILENAME: LoginActivity.java
| 0.220007
|
package com.example.internship_app;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class LoginActivity extends AppCompatActivity {
private static String USER_NAME1 = "blah";
private static String USER_PASSWORD1 = "more_blah";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
}
public void onSubmitClick(View v) {
EditText user_name = (EditText) findViewById(R.id.userName);
EditText user_pass = (EditText) findViewById(R.id.userPassword);
if((user_name.getText().toString().equals(USER_NAME1)) &&(user_pass.getText().toString().equals(USER_PASSWORD1))){
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}
else {
Toast.makeText(this, "Wrong UserName or Password!", Toast.LENGTH_SHORT).show();
}
}
}
|
b1c6507e-de39-479e-b875-95a5ec225bb4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-05-10T07:46:05", "repo_name": "esnunes/learning-notebook", "sub_path": "/content/notes/talk/driving-design-through-examples.md", "file_name": "driving-design-through-examples.md", "file_ext": "md", "file_size_in_byte": 1160, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "8277754a926bbecace06f9a869643dc869bcba5f", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/esnunes/learning-notebook
| 298
|
FILENAME: driving-design-through-examples.md
| 0.208179
|
---
date: 2017-04-09
title: Driving Design Through Examples
is: Talk
categories:
- Domain-Driven Design
- Behavior-Driven Development
- PHP
- Gherkin
- Behat
- Software Testing
source: https://www.youtube.com/watch?v=83GbyDpJDI4
---
A nice talk from Ciaran McNulty regarding how to use examples to describe
functionality. Ciaran starts introducing the concept of Behavior Driven
Development, he points out the [Gherkin](https://cucumber.io/docs/reference)
format used to describe scenarios.
Ciaran mentions who should be part of the definition of the scenarios as well
as when they should be listed.
On the second part Ciaran gives an overview of Domain Driven Design (DDD) and
how it helps the communication between all members of the team.
Ciaran points out the tool [Behat](http://behat.org/en/latest/) as a framework
for checking if the described behavior works.
Ciaran gives some tips of how to actively enhance the examples.
Ciaran gives some examples of how to map
[Gherkin](https://cucumber.io/docs/reference) scenarios to PHP code using
[Behat](http://behat.org/en/latest/). At this moment Ciaran implements the PHP
code using TDD.
|
88006e75-3d5a-4bb5-85f7-4960ac400f86
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-15 21:15:02", "repo_name": "dirishere/TourGuideApp", "sub_path": "/app/src/main/java/com/example/android/tourguideapp/SimpleFragmentPagerAdapter.java", "file_name": "SimpleFragmentPagerAdapter.java", "file_ext": "java", "file_size_in_byte": 1110, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "508324c4a9ceee1a73122f79ba84f6eb0b988f04", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dirishere/TourGuideApp
| 221
|
FILENAME: SimpleFragmentPagerAdapter.java
| 0.249447
|
package com.example.android.tourguideapp;
import android.content.Context;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
public class SimpleFragmentPagerAdapter extends FragmentPagerAdapter {
private Context context;
private String tabTitles[] = new String[]{"About.", "People.", "Places.", "Nature."};
public SimpleFragmentPagerAdapter(FragmentManager fm) {
super(fm);
this.context = context;
}
@Override
public Fragment getItem(int position) {
if (position == 0) {
return new AboutFragment();
} else if (position == 1) {
return new PeopleFragment();
} else if (position == 2) {
return new PlacesFragment();
} else {
return new NatureFragment();
}
}
@Override
public int getCount() {
return 4;
}
@Override
public CharSequence getPageTitle(int position) {
// Generate title based on item position
return tabTitles[position];
}
}
|
80e1dad6-f312-402c-8cc4-ba114e596edf
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-27 13:43:57", "repo_name": "parseiro/bds02", "sub_path": "/src/main/java/com/devsuperior/bds02/controller/CitiesController.java", "file_name": "CitiesController.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "22e276b1faf134d236e288e1899a8c19b85d2643", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/parseiro/bds02
| 222
|
FILENAME: CitiesController.java
| 0.262842
|
package com.devsuperior.bds02.controller;
import com.devsuperior.bds02.dto.CityDTO;
import com.devsuperior.bds02.entities.City;
import com.devsuperior.bds02.services.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/cities")
public class CitiesController {
@Autowired
private CityService cityService;
@GetMapping
public ResponseEntity<List<CityDTO>> findAll() {
var cities = cityService.findAll();
var citiesDto = cities.parallelStream()
.map(c -> new CityDTO(c))
.collect(Collectors.toList());
return ResponseEntity.ok().body(citiesDto);
}
@DeleteMapping("/{id}")
public ResponseEntity<City> delete(@PathVariable Long id) {
cityService.delete(id);
return ResponseEntity.noContent().build();
}
}
|
8a241dc2-59cd-45b2-9173-04e2ade3efdd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-08 10:59:29", "repo_name": "pengkun3508/App", "sub_path": "/app/src/main/java/com/vinnlook/www/surface/adapter/SearchHotAdapter.java", "file_name": "SearchHotAdapter.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "3264189a9f2faa046bf0d7ba50bbe0787a2b9482", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pengkun3508/App
| 222
|
FILENAME: SearchHotAdapter.java
| 0.245085
|
package com.vinnlook.www.surface.adapter;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import com.dm.lib.core.adapter.rv.state.BaseHolder;
import com.dm.lib.core.adapter.rv.state.BaseStateAdapter;
import com.flyco.roundview.RoundTextView;
import com.vinnlook.www.R;
import com.vinnlook.www.surface.bean.SearchListBean;
public class SearchHotAdapter extends BaseStateAdapter<SearchListBean.HotListBean, SearchHotAdapter.SearchHotHolder> {
@Override
protected SearchHotHolder getViewHolder(@NonNull ViewGroup parent, int holderType) {
return new SearchHotHolder(inflate(parent, R.layout.rv_item_search));
}
class SearchHotHolder extends BaseHolder<SearchListBean.HotListBean> {
RoundTextView searchText;
SearchHotHolder(View itemView) {
super(itemView);
searchText = getView(R.id.search_text);
}
@Override
public void bindData(SearchListBean.HotListBean data) {
searchText.setText(data.getKeyword());
}
}
}
|
0b85e277-052a-417a-a95f-1b0892e1aeed
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-21 03:26:54", "repo_name": "leaherleaher/wx-work", "sub_path": "/wechat-train/src/main/java/com/tf/train/wechattrain/util/WXAuthUtil.java", "file_name": "WXAuthUtil.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "fd07467b458d684d49b115030cdcfed952faa748", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/leaherleaher/wx-work
| 259
|
FILENAME: WXAuthUtil.java
| 0.23231
|
package com.tf.train.wechattrain.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
/**
* 公用网络请求工具类
*/
public class WXAuthUtil {
public static final String APPID="wx13d4875de26c0d12";
public static final String APPSECRET ="616007cd26751377a0c71bcf058bad5a";
private static final String TOKEN = "wxtoken";
public static JSONObject doGetJson(String url) throws IOException {
JSONObject jsonObject = null;
DefaultHttpClient client = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
HttpResponse response = client.execute(httpGet);
HttpEntity entity = response.getEntity();
if(null != entity){
//把返回的结果转换为JSON对象
String result = EntityUtils.toString(entity,"UTF-8");
jsonObject = JSON.parseObject(result);
}
return jsonObject;
}
}
|
7f10f3fc-cfe3-4eab-bcc4-0cc322ba62ff
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-02 06:28:47", "repo_name": "ice459pp/volley", "sub_path": "/src/main/java/com/shareba/volley/action/PostAction.java", "file_name": "PostAction.java", "file_ext": "java", "file_size_in_byte": 1220, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "bfa1fa5b8141b14d0b52d04c27e15c640d47ffb4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ice459pp/volley
| 265
|
FILENAME: PostAction.java
| 0.283781
|
package com.shareba.volley.action;
import java.io.File;
import java.util.HashMap;
public class PostAction<T> {
public static String UPLOAD_NAME = "upload_file";
private Class<T> cls;
private HashMap<String, String> params;
private HashMap<String, String> header;
private String url;
public PostAction(String url, Class<T> cls) {
this.url = url;
this.cls = cls;
}
public Class<T> getResponseClass() {
return cls;
}
public PostAction putParam(String key, String value) {
if (params == null) {
params = new HashMap<>();
}
params.put(key, value);
return this;
}
public PostAction putHeaders(String key, String value) {
if (header == null) {
header = new HashMap<>();
}
header.put(key, value);
return this;
}
public PostAction putFile(File file) {
params.put(UPLOAD_NAME, file.getAbsolutePath());
return this;
}
public String getUrl() {
return url;
}
public HashMap<String, String> getParams() {
return params;
}
public HashMap<String, String> getHeaders() {
return header;
}
}
|
a1077861-5835-4501-bf0c-b2b0ad082a21
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-23 10:32:36", "repo_name": "SHATONG/rest_server", "sub_path": "/src/main/java/com/ntt/smartglass/rest/converter/ModelConverter.java", "file_name": "ModelConverter.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "2ea9252b396e1616faa564702e833e6198766347", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SHATONG/rest_server
| 254
|
FILENAME: ModelConverter.java
| 0.287768
|
package com.ntt.smartglass.rest.converter;
import com.ntt.smartglass.rest.domain.SmartGlassData;
import com.ntt.smartglass.rest.domain.SmartGlassListResultData;
import com.ntt.smartglass.rest.entity.SmartGlass;
import org.springframework.beans.BeanUtils;
/**
* モデル<=>ドメイン 変換
*/
public class ModelConverter {
/**
* @param model SmartGlassモデル
* @return SmartGlassドメイン
*/
public static SmartGlassData toSmartGlassData(SmartGlass model) {
if (model == null) {
return null;
}
SmartGlassData data = new SmartGlassData();
BeanUtils.copyProperties(model, data);
return data;
}
/**
* @param model SmartGlassListモデル
* @return SmartGlassListドメイン
*/
public static SmartGlassListResultData toSmartGlassListResultData(SmartGlass model, String peerID) {
if (model == null) {
return null;
}
SmartGlassListResultData data = new SmartGlassListResultData();
data.setPeerID(peerID);
BeanUtils.copyProperties(model, data);
return data;
}
}
|
4e57fe88-0a27-4e53-8370-e05be720bbb2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-28 10:41:18", "repo_name": "punit-patil/RchiveAutomation", "sub_path": "/src/main/java/co/rchive/pages/adminpage/AdminHomePage.java", "file_name": "AdminHomePage.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "c3d17a6404478488f48a7bcd66630f1e2a9508ea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/punit-patil/RchiveAutomation
| 257
|
FILENAME: AdminHomePage.java
| 0.290176
|
package co.rchive.pages.adminpage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import co.rchive.util.Wait;
public class AdminHomePage {
WebDriver driver;
@FindBy(css = ".loginbox")
private WebElement loginBox;
@FindBy(id = "loginname")
private WebElement txtbx_UserName;
@FindBy(id = "password")
private WebElement txtbx_Password;
@FindBy(id = "btnLogin")
private WebElement btn_Login;
public AdminHomePage(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(this.driver, this);
}
public boolean isAdminPage() {
System.out.println(btn_Login.isEnabled());
new Wait(driver).waitForElementToBeVisible(btn_Login, 15);
return (btn_Login.isDisplayed());
}
public AdminDashboardPage adminLoginAction(String adminUserName,
String adminPasword) {
new Wait(driver).waitForElementToBeClickable(txtbx_UserName, 6);
txtbx_UserName.clear();
txtbx_UserName.sendKeys(adminUserName);
txtbx_Password.clear();
txtbx_Password.sendKeys(adminPasword);
btn_Login.click();
return new AdminDashboardPage(driver);
}
}
|
5c4c8656-ec76-4837-bc9d-bdad4603e324
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-12-21 08:35:41", "repo_name": "pki-sjin/SmartDoor", "sub_path": "/src/org/zero/servlet/web/activity/NotifyViaWx.java", "file_name": "NotifyViaWx.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "743b36dc9180908921e8bc2038f2b4c5e424d5d1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pki-sjin/SmartDoor
| 203
|
FILENAME: NotifyViaWx.java
| 0.258326
|
package org.zero.servlet.web.activity;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.wx.pay.business.ResultNotify;
@WebServlet("/NotifyViaWx")
public class NotifyViaWx extends HttpServlet {
/**
* Constructor of the object.
*/
public NotifyViaWx() {
super();
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
ResultNotify resultNotify = new ResultNotify(request, response);
try {
resultNotify.ProcessNotify();
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
ResultNotify resultNotify = new ResultNotify(request, response);
try {
resultNotify.ProcessNotify();
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
9c602e96-1106-4e5a-bdb3-abb7328b83fd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-13 10:53:47", "repo_name": "rbreje/PatientsManager", "sub_path": "/PatientsManager/src/com/breje/pm/model/Patient.java", "file_name": "Patient.java", "file_ext": "java", "file_size_in_byte": 1220, "line_count": 69, "lang": "en", "doc_type": "code", "blob_id": "28c4c657c866aa565b37a2d72aae291241fe401e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rbreje/PatientsManager
| 317
|
FILENAME: Patient.java
| 0.277473
|
package com.breje.pm.model;
import java.util.StringJoiner;
import com.breje.pm.exception.PatientsManagerException;
public class Patient implements Entity {
private String patientId;
private String name;
private String SSN;
private String address;
private int consNum;
public Patient(String name, String SSN, String address) {
patientId = SSN;
this.name = name;
this.SSN = SSN;
this.address = address;
consNum = 0;
}
public String getPatientID() {
return patientId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSSN() {
return SSN;
}
public void setSSN(String sSN) {
SSN = sSN;
patientId = SSN;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public void setConsNum(int num) throws PatientsManagerException {
if (num < 0) {
throw new PatientsManagerException("Invalid number of consultation.");
}
consNum = num;
}
public int getConsNum() {
return consNum;
}
@Override
public String toString() {
StringJoiner sj = new StringJoiner(", ");
sj.add(name).add(SSN).add(address);
return sj.toString();
}
}
|
d08af04c-93ee-4ea1-89c8-45cf3f2a402d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-28 11:39:56", "repo_name": "kodePhile/unify-framework", "sub_path": "/unify-core/src/main/java/com/tcdng/unify/core/notification/EmailRecipient.java", "file_name": "EmailRecipient.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "653d3f366affbc8da9ab052321abfea3b72433d9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kodePhile/unify-framework
| 263
|
FILENAME: EmailRecipient.java
| 0.282196
|
/*
* Copyright 2018-2020 The Code Department.
*
* 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.tcdng.unify.core.notification;
/**
* An email recipient data object.
*
* @author Lateef Ojulari
* @since 1.0
*/
public class EmailRecipient {
public enum TYPE {
TO, CC, BCC
}
private TYPE type;
private String address;
public EmailRecipient(TYPE type, String address) {
this.type = type;
this.address = address;
}
public TYPE getType() {
return type;
}
public String getAddress() {
return address;
}
}
|
384fdd43-cfef-4b98-8ff7-b380093043dd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-25 17:24:35", "repo_name": "xKr0/PixelGuess", "sub_path": "/app/src/main/java/com/example/asus_pc/drawmyapp/PartyManager.java", "file_name": "PartyManager.java", "file_ext": "java", "file_size_in_byte": 1040, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "3332ad9a8ada7e84ebfecc77684b8e6d5a88b7fc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/xKr0/PixelGuess
| 217
|
FILENAME: PartyManager.java
| 0.279828
|
package com.example.asus_pc.drawmyapp;
import android.util.Log;
import com.example.asus_pc.drawmyapp.model.User;
import java.util.ArrayList;
public class PartyManager {
private PartyManager()
{}
private static PartyManager INSTANCE = new PartyManager();
public static PartyManager getInstance()
{ return INSTANCE;
}
final ArrayList<User> usrList = new ArrayList<>();
public String answer;
public User currUser;
public String next = "";
public String state = "";
public GuessActivity guessActivity;
public void UpdateImageView(String bmpString) {
if (guessActivity != null)
guessActivity.setImageView(bmpString);
}
public void SetNextToDraw() {
int index = usrList.indexOf(currUser);
Log.d("index::", Integer.toString(index));
index++;
if (index >= usrList.size()) {
index = 0;
}
Log.d("index_next::", Integer.toString(index));
next = usrList.get(index).getPseudo();
}
}
|
1636c8dd-a6ed-4bf5-b18b-39bb7190350b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-09 01:25:26", "repo_name": "SarahAlDhowaihy/ABND_Project5", "sub_path": "/app/src/main/java/com/example/android/tourguideapp/HotelsFragment.java", "file_name": "HotelsFragment.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "c664bedc6401698cc4b365bca473186aae26ec04", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SarahAlDhowaihy/ABND_Project5
| 203
|
FILENAME: HotelsFragment.java
| 0.253861
|
package com.example.android.tourguideapp;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import java.util.ArrayList;
public class HotelsFragment extends Fragment {
public HotelsFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.places_list, container, false);
final ArrayList<Places> hotels = new ArrayList<Places>();
hotels.add(new Places(R.string.hotels_retaz_name, R.string.hotels_retaz_info, R.drawable.ritz));
hotels.add(new Places(R.string.hotels_rafal_name, R.string.hotels_rafal_info, R.drawable.rafal));
PlaceAdapter placeAdapter = new PlaceAdapter(getActivity(), hotels);
ListView listView = (ListView) rootView.findViewById(R.id.list);
listView.setAdapter(placeAdapter);
return rootView;
}
}
|
ecfdf2f6-a966-49e4-b778-33bbbbfbe10e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-02 07:15:16", "repo_name": "Minikot/phonecountrycode", "sub_path": "/app/src/main/java/com/aleksandr/phonecountrycode/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "752267ea5bb8f7f154a4b0919e86e110e6a31e36", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Minikot/phonecountrycode
| 187
|
FILENAME: MainActivity.java
| 0.225417
|
package com.aleksandr.phonecountrycode;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import com.aleksandr.phonecountrycode.model.CountryCode;
public class MainActivity extends AppCompatActivity implements CountryCodeDialogFragment.CodeSelectedListener {
private MainFragment mainFragment;
private FragmentManager fragmentManager = getSupportFragmentManager();
private FragmentTransaction ft = fragmentManager.beginTransaction();
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mainFragment = new MainFragment();
ft.add(R.id.container, mainFragment, "mainFragment");
ft.commit();
}
@Override
public void onChangeCode(CountryCode countryCode) {
if (mainFragment != null) {
mainFragment.setCode(countryCode);
}
}
}
|
1d5c140f-2963-4632-825b-66a445c31b17
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-13 23:58:50", "repo_name": "dilansalinda/extractor-tfs-rest", "sub_path": "/tfs-rest-client/src/main/java/com/dilan/sample/tfsrestclient/TfsRestService.java", "file_name": "TfsRestService.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "d687c4ea892d156fe6a0e614d93033911d283bce", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dilansalinda/extractor-tfs-rest
| 275
|
FILENAME: TfsRestService.java
| 0.268941
|
package com.dilan.sample.tfsrestclient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
import java.util.Map;
public class TfsRestService {
private static final Logger log = LoggerFactory.getLogger(TfsRestService.class);
public void getCommit(){
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.setBasicAuth("Basic","PAT");
//headers.add("Authorization","Basic N2EzeHVqZHNvczN2ZG9jbW5xYWYyemxvcnZsenNyeGJ3YmxyNmtweGR1dGFiY3Y3dXVrYQ==");
//log.info(restTemplate.getForObject("https://dev.azure.com/dilansalinda/dilan/_apis/tfvc/changesets?api-version=5.0-preview.3", String.class));
ResponseEntity<String> d =
restTemplate.exchange(
"https://dev.azure.com/dilansalinda/dilan/_apis/tfvc/changesets?api-version=5.0-preview.3", HttpMethod.GET, new HttpEntity<>(headers),
String.class);
System.out.println(d);
}
}
|
8925465a-9142-4a36-922c-083b92b7fe6b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-09 01:19:59", "repo_name": "NataliaCFavero/iddog", "sub_path": "/app/src/main/java/com/nataliafavero/iddog/data/service/ApiService.java", "file_name": "ApiService.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "3aeb0dd571c53ce418b427e63aa8cf1b1d016516", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/NataliaCFavero/iddog
| 253
|
FILENAME: ApiService.java
| 0.272025
|
package com.nataliafavero.iddog.data.service;
import com.nataliafavero.iddog.data.model.FeedResponse;
import com.nataliafavero.iddog.data.model.SignupRequest;
import com.nataliafavero.iddog.data.model.SignupResponse;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;
/**
* Created by nataliafavero on 06/03/18.
*/
public class ApiService {
private static String BASE_URL = "https://iddog-api.now.sh/";
public IdDogApi getApi() {
Retrofit retrofit = new Retrofit
.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
return retrofit.create(IdDogApi.class);
}
public interface IdDogApi {
@POST("signup")
Call<SignupResponse> signup(@Body SignupRequest email);
@GET("feed")
Call<FeedResponse> feed(@Header("Authorization") String authorization, @Query("category") String category);
}
}
|
2933e207-3ee2-4981-b7d2-7dddbd6ecb34
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-06-01 06:06:06", "repo_name": "cpinan/GDayX", "sub_path": "/src/com/gday/maps/CustomWindowsAdapter.java", "file_name": "CustomWindowsAdapter.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "1480f8a721e1c282da04a1ed28c4d2368a2ca5fa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cpinan/GDayX
| 215
|
FILENAME: CustomWindowsAdapter.java
| 0.268941
|
package com.gday.maps;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.android.gms.maps.GoogleMap.InfoWindowAdapter;
import com.google.android.gms.maps.model.Marker;
public class CustomWindowsAdapter implements InfoWindowAdapter {
private View view;
public CustomWindowsAdapter(Context context) {
view = ((Activity) context).getLayoutInflater().inflate(
R.layout.custom_info_layout, null);
}
@Override
public View getInfoContents(final Marker marker) {
TextView txtPlace = (TextView) view.findViewById(R.id.txtPlace);
txtPlace.setText(marker.getTitle());
ImageView imgData = (ImageView) view.findViewById(R.id.imgData);
imgData.setImageResource(R.drawable.ic_launcher);
if (GDayMaps.hashBitmaps.get(marker) != null) {
imgData.setImageBitmap(GDayMaps.hashBitmaps.get(marker));
}
return view;
}
@Override
public View getInfoWindow(Marker marker) {
return null;
}
}
|
0afcd235-5f38-4fc0-a331-cfe039a02251
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-02-13 15:53:12", "repo_name": "IlyasPatel/automation-poc", "sub_path": "/core/src/main/java/com/efinancialcareers/myefc/qa/utils/WhatIsMyIpPage.java", "file_name": "WhatIsMyIpPage.java", "file_ext": "java", "file_size_in_byte": 1095, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "fedc34e3cd585a9c26790af4ade5f7790bb402d1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/IlyasPatel/automation-poc
| 259
|
FILENAME: WhatIsMyIpPage.java
| 0.275909
|
package com.efinancialcareers.myefc.qa.utils;
import com.efinancialcareers.myefc.qa.desktop.BasePage;
import net.serenitybdd.core.pages.WebElementFacade;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.FindBy;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* User: ilyas.patel
* Date: 27/11/13
* Time: 15:16
*/
public class WhatIsMyIpPage extends BasePage {
private static final Pattern GET_COUNTRY_CODE = Pattern.compile("([a-zA-Z]{2})");
@FindBy(css = "#ip-box .the-country")
private WebElementFacade countryElement;
/**
* Constructor
*
* @param driver Webdriver
*/
public WhatIsMyIpPage(WebDriver driver) {
super(driver);
}
/**
* Get country
* @return Country found
*/
public String getCountry() {
return getCountryCodeFrom(countryElement.getTextValue()).toUpperCase();
}
private String getCountryCodeFrom(String str) {
Matcher matcher = GET_COUNTRY_CODE.matcher(str);
matcher.find();
return matcher.group(0);
}
}
|
e81e2194-d62a-4c1e-908d-ab87068a75b9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-01-26T11:15:38", "repo_name": "runonautomation/devops-talk", "sub_path": "/cfgmgmt-talk-plan/ansible.md", "file_name": "ansible.md", "file_ext": "md", "file_size_in_byte": 1220, "line_count": 51, "lang": "en", "doc_type": "text", "blob_id": "f514cd5128ed6c0f7b70a4d59841bc29296f24db", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/runonautomation/devops-talk
| 327
|
FILENAME: ansible.md
| 0.284576
|
## Ansible
https://www.ansible.com/how-ansible-works
https://sysadmincasts.com/episodes/43-19-minutes-with-ansible-part-1-4
https://github.com/ansible/ansible-examples/tree/master/language_features
## Practice
- Prepare a centos VM host or use a test docker host
https://github.com/runonautomation/dincd
- Run the container
- Prepare the playbook container
```
mkdir -p ansible_test
cp id_rsa ansible_test
cd ansible_test
mkdir -p playbook
wget https://github.com/runonautomation/devops-talk/raw/master/cfgmgmt-talk-plan/samples/pb/website.zip -O playbook/pb.zip
unzip playbook/pb.zip -d ./playbook
```
- Create an ansible Dockerfile
```aidl
FROM centos:centos7
RUN yum clean all && \
yum -y install epel-release && \
yum -y install git jq python-devel openssl-devel && \
yum -y install openssh-server libffi-devel gcc python-pip && \
yum clean all
RUN pip install ansible
COPY playbook /opt/playbook
COPY id_rsa /root/.ssh/id_rsa
```
- Build and run the container
```
docker build . -t ansible
docker run -it ansible bash
```
- Got to opt and try out the playbook
cd /opt/playbook/ansible-examples-master/lamp_simple_rhel7
- Modify the hosts file
ansible-playbook -i hosts.example site.yml
|
d96e43f0-7e67-4c37-9132-fd440cdeb654
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-27 10:41:46", "repo_name": "TejashreeAher/NioDatagramChannelExample", "sub_path": "/src/com/tejashree/nio/sender/DatagramSender.java", "file_name": "DatagramSender.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "66aa51abaf54c74cd88f7b4adc4e1a192be332a1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/TejashreeAher/NioDatagramChannelExample
| 205
|
FILENAME: DatagramSender.java
| 0.259826
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.tejashree.nio.sender;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.DatagramChannel;
/**
*
* @author tejashree
*/
public class DatagramSender {
//these properties can be changed as needed
private static final int PORT = 9999;
private static final String HOST = "localhost";
public static void main(String[] args) {
try {
DatagramChannel channel = DatagramChannel.open();
String newData = "New message :"+ System.currentTimeMillis();
ByteBuffer buf = ByteBuffer.allocate(48);
buf.clear();
buf.put(newData.getBytes());
buf.flip();
channel.send(buf, new InetSocketAddress(HOST, PORT));
} catch (IOException e) {
}
}
}
|
77810d34-5213-406d-9110-3193aade5f75
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-06-01T16:24:38", "repo_name": "thebombadier/godwinbot", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1185, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "0a8dc84ed0215d74bb79d1b4bd6d2f27a0014b2a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/thebombadier/godwinbot
| 269
|
FILENAME: README.md
| 0.216012
|
###Welcome to the source of /u/godwin_finder
====
####About the source
***
#####godwin.py
This is the main script for commenting on submissions. You may use the code in this script for your own purpose but please do not simply make a copy of my bot and claim it as your own
#####delete_bot.py
This is the script for deleting negative karma comments. And ones with a reply of delete. I encrouage you to use this script in your own bots, and you can do what you want with it. No credit is neccesary
#####[Main wiki page](http://www.reddit.com/r/godwinbot/wiki/index)
This is the main wiki page (on reddit) for this bot
######What is /u/godwin_finder ?
Godwin_finder is a bot that searches through all the top rated submissions and checks for a reference to the Nazis or Hitler in the comments. It will then post a reply to that comment stating how long it took for the post to acquire a comment that referenced Hitler.
######What is the point ?
Godwin's Law states that, if an internet conversation goes on for long enough eventually Hitler or the Nazis will be referenced, no matter how unrelated the original subject of the post. This bot is here to test that 'law'.
|
80d00ef3-d6d7-4215-bb9a-d9405d17b22c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-03-19 19:36:21", "repo_name": "cagney/mina-sshd-service", "sub_path": "/sshd-core/src/main/java/org/apache/sshd/client/auth/AbstractUserAuth.java", "file_name": "AbstractUserAuth.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "d94839e9e3d47f15f82a617c5a2c7b08e7b8890c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cagney/mina-sshd-service
| 221
|
FILENAME: AbstractUserAuth.java
| 0.235108
|
package org.apache.sshd.client.auth;
import org.apache.sshd.client.session.ClientSessionImpl;
import org.apache.sshd.common.service.ServiceClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created with IntelliJ IDEA.
* User: cagney
* Date: 12/03/13
* Time: 1:11 PM
* To change this template use File | Settings | File Templates.
*/
public abstract class AbstractUserAuth {
protected final Logger log = LoggerFactory.getLogger(this.getClass());
protected final ClientSessionImpl session;
protected final ServiceClient service;
protected final String serviceName;
protected final String username;
protected AbstractUserAuth(ClientSessionImpl session, ServiceClient service, String username) {
this.session = session;
this.username = username;
this.service = service;
this.serviceName = service.getName(); // make life easier
}
public String getUsername() {
return this.username;
}
public ServiceClient getService() {
return this.service;
}
}
|
0e9c574c-03e1-48f1-954d-af60f249987f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-09 03:01:32", "repo_name": "love2558/DistributedLock", "sub_path": "/src/main/java/com/web/lock/LockTest.java", "file_name": "LockTest.java", "file_ext": "java", "file_size_in_byte": 1169, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "f3de3b064fe45b7f1ea106126cda44c5db4d42bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/love2558/DistributedLock
| 217
|
FILENAME: LockTest.java
| 0.243642
|
package com.web.lock;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.concurrent.CountDownLatch;
/**
* Created by lihao on 2017/11/6.
*/
public class LockTest {
private static final int THREAD_NUM = 10;
public static CountDownLatch threadSemaphore = new CountDownLatch(THREAD_NUM);
public static void main(String[] args) {
for (int i = 0;i < THREAD_NUM;i++){
final int threadId = i;
new Thread(){
public void run(){
try{
new LockService().doService(new DoTemplate() {
public void dodo() {
System.out.println("修改了一个文件。。。"+threadId);
}
});
}catch (Exception e){
e.printStackTrace();
}
}
}.start();
}
try {
threadSemaphore.await();
System.out.println("所有线程运行结束");
}catch (Exception e){
e.printStackTrace();
}
}
}
|
36507c4b-0d98-4ba9-a7a4-987f990ead69
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-09 02:46:24", "repo_name": "huangered/java-learn", "sub_path": "/network/bank/src/main/java/com/yih/trans/service/BankService.java", "file_name": "BankService.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "e2605fc0bf093783177a8c1c730f954f0ecdb936", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/huangered/java-learn
| 238
|
FILENAME: BankService.java
| 0.29584
|
package com.yih.trans.service;
import com.yih.trans.entity.BankRecord;
import com.yih.trans.repo.BankReceiptRepo;
import com.yih.trans.repo.BankRepo;
import com.yih.trans.entity.BankReceipt;
import com.yih.trans.entity.MallReceipt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
@Service
public class BankService {
@Autowired
BankRepo bankRepo;
@Autowired
BankReceiptRepo bankReceiptRepo;
@Transactional
public void add(Long userId, Long money) {
}
@Transactional
public void deal(MallReceipt mallReceipt) {
BankRecord bankRecord = new BankRecord();
bankRecord.setUserId(mallReceipt.getUserId());
bankRecord.setMoney(mallReceipt.getMoney());
BankReceipt bankReceipt = new BankReceipt();
bankReceipt.setMoney(mallReceipt.getMoney());
bankReceipt.setUserId(mallReceipt.getUserId());
bankReceipt.setStatus("start");
bankReceipt.setReceiptId(mallReceipt.getId());
bankRepo.save(bankRecord);
bankReceiptRepo.save(bankReceipt);
}
}
|
ff7a2448-5691-40a7-96cc-40909959dedc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-27 06:48:19", "repo_name": "pengjianbo3478/sfront", "sub_path": "/src/main/java/com/gl365/app/remote/settlement/ApiResponse/BanksDto.java", "file_name": "BanksDto.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "4cc520275129620b84eb60869f4188b0a39c8001", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pengjianbo3478/sfront
| 257
|
FILENAME: BanksDto.java
| 0.220007
|
package com.gl365.app.remote.settlement.ApiResponse;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
/**
* Created by qiuchaojie on 2017/6/10.
*/
public class BanksDto {
@ApiModelProperty("返回码")
private String resultCode;
@ApiModelProperty("返回描述")
private String getResultCodeDesc;
@ApiModelProperty("总记录数")
private int totalNum;
@ApiModelProperty("银行基本")
private List<BankListDto> data;
public String getResultCode() {
return resultCode;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
public String getGetResultCodeDesc() {
return getResultCodeDesc;
}
public void setGetResultCodeDesc(String getResultCodeDesc) {
this.getResultCodeDesc = getResultCodeDesc;
}
public int getTotalNum() {
return totalNum;
}
public void setTotalNum(int totalNum) {
this.totalNum = totalNum;
}
public List<BankListDto> getData() {
return data;
}
public void setData(List<BankListDto> data) {
this.data = data;
}
}
|
bd8844d4-169b-4b01-bf90-4113f1e06839
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-23 01:31:57", "repo_name": "hack-feng/maple", "sub_path": "/src/main/java/com/maple/demo/controller/UploadController.java", "file_name": "UploadController.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "80e1c65e16873c0c2e6c3a428893ffea6624d024", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hack-feng/maple
| 208
|
FILENAME: UploadController.java
| 0.221351
|
package com.maple.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import com.maple.demo.utils.UploadUtils;
@Controller
@RequestMapping("/upload")
public class UploadController extends BaseController {
/**
* 跳转到上传页面
* http://127.0.0.1:8082/upload/upload
* @return
*/
@RequestMapping("/upload")
public String upload(){
return "upload";
}
/**
* 上传文件,并回显
* @param multipartFile
* @param model
* @return
*/
@PostMapping("/uploadOne")
public String uploadOne(MultipartFile multipartFile, ModelMap model){
String result = UploadUtils.upload(multipartFile);
System.out.println(result);
model.addAttribute("filename", result);
return "upload";
}
}
|
9a4de212-7b99-4b3c-9b59-b3ddca0e9ef1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-05-12T19:14:06", "repo_name": "sophiallen/loginRegClient", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1137, "line_count": 16, "lang": "en", "doc_type": "text", "blob_id": "63bc8aedce2f789830af2802c2236fb6b8121484", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sophiallen/loginRegClient
| 258
|
FILENAME: README.md
| 0.235108
|
# loginRegClient
-With service running in another vs instance, copy the localhost address.
-New blank website, add service reference to the service you have running. Remember to name it.
-Add new web form, create your table with asp text boxes and buttons.
- Remember to make set the textmode for the password field to password.
-double click the button to add event handler
- below the button click handler, add your method (login) and inside create a new loginserviceref object and call its client. (see first line of login()).
- Add a link to a registration page on the default.aspx page, the create new web form for register.
- Create registration page as a web form.
- to add jQuery, right click on project and select manage nuget packages.
- select asp.net.scriptmanager.jquery and install
- you will now have validation in your toolbox.
- You can drag and drop validation into the blank fields on your form.
- Click on the validation field to see properties, and set the control to validate to the field you want it to validate. You can aslo set things like color, and what the error message says.
|
852922c0-664e-4ffc-8d1f-a4af2214f6e2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-26 05:47:30", "repo_name": "atulya0622/Hacksprint_8_Team-Martin-s", "sub_path": "/BackEnd/help.java", "file_name": "help.java", "file_ext": "java", "file_size_in_byte": 1083, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "795b922f0b9bd822c0dbbc31ff7da956dfd2e85d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/atulya0622/Hacksprint_8_Team-Martin-s
| 181
|
FILENAME: help.java
| 0.259826
|
package com.example.employee;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class help extends AppCompatActivity {
Button btn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_help);
btn= findViewById(R.id.submit);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openActivity2(); //calls the openActivity2() method
Toast.makeText(help.this,"Your issue has been registered.",Toast.LENGTH_SHORT).show(); //popup to show the issue confirmation
}
});
}
//method to reset the help screen
public void openActivity2(){
Intent intent=new Intent(this,MainScreenActivity.class);
startActivity(intent);
}
}
|
f23197f6-ea42-496b-8056-07fabe530b7f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-06-20T19:23:07", "repo_name": "layersony/personal-blog", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1219, "line_count": 65, "lang": "en", "doc_type": "text", "blob_id": "2e6f6b168aa549b181aeea665bd4e50ce5927bc4", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/layersony/personal-blog
| 293
|
FILENAME: README.md
| 0.240775
|
# Maingi Blog
#### Created on 20th June 2021
#### By Samuel Maingi Mutunga
## Description
This is a personal blogging website where you can create and share your opinions and other users can read and comment on them. Additionally, There is a feature that displays random quotes to inspire my users.
This is a WebApp that will give you the opportunity and many more to express your concerns
---
## Access the website
Need the latest browser to be able to View
Follow this link https://maingiblog.herokuapp.com/
It is hosted by heroku
---
## SetUp
### Cloning
* In your terminal:
$ git clone `https://github.com/layersony/personal-blog.git`
$ cd personal-blog
## Running the Application
* To run the application, in your terminal:
* In manage.py change from `create_app('production') to create_app('development')`
$ pip install -r requirements.txt
$ chmod +x run.py
$ ./run.py
## Technologies Used
HTML, CSS & Bootstrap
Git
Python
Flask Framework
---
## Bugs
---
1. It loads when saving a new blog
---
## Contact Details
sammaingi5@gmail.com
@Maingi `Slack Moringa`
---
### License
This Project is under the [MIT](LICENSE) license
|
f41d96b7-55aa-481e-892b-d4cc000c856e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-14 18:20:07", "repo_name": "jameskirkpatrick23/chariotfitness", "sub_path": "/src/main/java/com/chariotsolutions/chariotfitness/users/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "5465cc84d22fc286eaeface050b71b0ea881da3b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jameskirkpatrick23/chariotfitness
| 235
|
FILENAME: User.java
| 0.252384
|
package com.chariotsolutions.chariotfitness.users;
import com.chariotsolutions.chariotfitness.workouts.Workout;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;
@Getter @Setter
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private boolean enabled;
private String firstName;
private String lastName;
private String email;
private String confirmationToken;
@OneToMany(mappedBy = "user", fetch = FetchType.LAZY)
private Set<Workout> workouts = new HashSet<>();
public User(String firstName, String lastName, String email, String confirmationToken, boolean enabled) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.confirmationToken = confirmationToken;
this.enabled = enabled;
}
public String getName() { return this.firstName + " " + this.lastName; }
@Override
public String toString() {
return "User{" +
"id=" + id +
", email='" + this.getEmail() + '\'' +
'}';
}
}
|
5ba862d2-87ff-4ece-b6cf-f20a77d76335
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-24 11:26:45", "repo_name": "RanasingheTKSA/DSA-03-LINKEDLIST", "sub_path": "/src/LabQuestions/LinkList.java", "file_name": "LinkList.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "992878d7c308eb89534c4fa2d2ba3ba0d361c804", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/RanasingheTKSA/DSA-03-LINKEDLIST
| 282
|
FILENAME: LinkList.java
| 0.286968
|
package LabQuestions;
public class LinkList {
private Link first;
public LinkList() {
first = null;
}
//is Empty method
public boolean isEmpty() {
return (first == null);
}
//insert method
public void insertFirst(String name, double avg) {
Link newLink = new Link(name, avg);
newLink.next = first;
first = newLink;
}
//delete first method
public Link deleteFirst() {
Link temp = first;
first = first.next;
return temp;
}
//display method
public void displayList() {
System.out.println("Display the list");
Link current = first;
while (current != null) {
current.displayLink();
current = current.next;
}
}
public Link deleteLink(String name) {
Link current = first;
Link previous =first;
while (current.Name != name) {
if(current.next == null) {
return null;
}
else {
previous = current;
current = current.next;
}
}
if (current == first) {
first = first.next;
}else {
previous.next = current.next;
}
return current;
}
}
|
d50bf187-bfbd-4fe4-baaa-6a304cd4b8aa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-18 10:07:00", "repo_name": "KushnirenkoIvan/ToTripComposer", "sub_path": "/src/main/java/ua/kushnirenko/ivan/domain/Request.java", "file_name": "Request.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "71dc678d30a6314744b6a34fcec9df8442528ccb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/KushnirenkoIvan/ToTripComposer
| 276
|
FILENAME: Request.java
| 0.27048
|
package ua.kushnirenko.ivan.domain;
import org.springframework.stereotype.Component;
/**
* This class represents request to server. Used in:
*
* @see ua.kushnirenko.ivan.util.HTTPConnector
*/
@Component
public class Request {
private static String url = "http://tripcomposer.net/rest/test/countries/get";
private String key = "$1$12309856$euBrWcjT767K2sP9MHcVS/";
private String echo = "test1234";
public static String getUrl() {
return url;
}
public static void setUrl(String url) {
Request.url = url;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getEcho() {
return echo;
}
public void setEcho(String echo) {
this.echo = echo;
}
public Request() {
}
public Request(String key, String echo) {
this.key = key;
this.echo = echo;
}
@Override
public String toString() {
return "Request{" +
"key='" + key + '\'' +
", echo='" + echo + '\'' +
'}';
}
}
|
7342ad95-a564-4e6e-8f0f-919b271f210f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-14 15:19:32", "repo_name": "toanitdev/Personal-To-Do-List", "sub_path": "/app/src/main/java/com/toanitdev/todolist/ui/base/BaseActivity.java", "file_name": "BaseActivity.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "bbc83caf40d868e8e44cf1ebc323ae617972ed70", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/toanitdev/Personal-To-Do-List
| 199
|
FILENAME: BaseActivity.java
| 0.255344
|
package com.toanitdev.todolist.ui.base;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import com.toanitdev.todolist.R;
public abstract class BaseActivity<T extends ViewDataBinding, VM extends BaseViewModel> extends AppCompatActivity {
T dataBinding;
VM viewModel;
public T getDataBinding() {
return dataBinding;
}
public abstract VM getViewModel();
public abstract int getBindingVariable();
public abstract int getLayoutId();
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
performDataBinding();
}
public void performDataBinding() {
dataBinding = DataBindingUtil.setContentView(this, getLayoutId());
this.viewModel = viewModel == null ? getViewModel() : viewModel;
dataBinding.setVariable(getBindingVariable(), viewModel);
//dataBinding.executePendingBindings();
}
}
|
3b7be767-4255-4207-9b9c-0c32c9f892a2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-02 02:35:16", "repo_name": "nyborr/PuppyMatch", "sub_path": "/app/src/main/java/edu/apsu/csci/puppymatch/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "232f2dd7489f2bde9d4a19d0f3ddfa28bfbfae5f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nyborr/PuppyMatch
| 206
|
FILENAME: MainActivity.java
| 0.235108
|
package edu.apsu.csci.puppymatch;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity implements View.OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button b = findViewById(R.id.swipe_button);
b.setOnClickListener(this);
b = findViewById(R.id.about_button);
b.setOnClickListener(this);
b = findViewById(R.id.matches_button);
b.setOnClickListener(this);
}
@Override
public void onClick(View v) {
Intent intent;
if (v.getId() == R.id.swipe_button) {
intent = new Intent(getApplicationContext(), SwipeActivity.class);
} else if (v.getId() == R.id.about_button){
intent = new Intent(getApplicationContext(), AboutActivity.class);
} else {
intent = new Intent(getApplicationContext(), MatchesActivity.class);
}
startActivity(intent);
}
}
|
a25732cd-8318-4941-9b1f-bdb3134c1510
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-09-23T13:01:40", "repo_name": "version0chiro/pokeball-toggle-component", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1106, "line_count": 42, "lang": "en", "doc_type": "text", "blob_id": "06b320cbedefa77e3b6b20a764ba9577ada55001", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/version0chiro/pokeball-toggle-component
| 270
|
FILENAME: README.md
| 0.229535
|
## A Toggle Switch in the style of Pokeball!
With this project, I wanted to create a toggle switch that looks like a Pokéball.
The switch is a toggle switch, which means that it can be turned on and off.
Currently only React is tested and the CSS is uncompiled so it won't work on Next.js.
The credit for the design goes to Mina who had made an amazing codepen here [Pokeball](https://codepen.io/codeanddream/pen/abwGgmJ). which you should check out.
To use the switch, first download it using from npm using npm or yarn
```bash
$ npm install pokeball-toggle
```
Inside your project import the Pokeball_Switch from pokeball-toggle and use it as a component
```jsx
import { Pokeball_Switch } from "pokeball-toggle";
<Pokeball_Switch />;
```
Currently the component also contains an onClick prop listener which you can pass
```jsx
import { Pokeball_Switch } from "pokeball-toggle";
const log = () => {
console.log("clicked");
};
<Pokeball_Switch
onClick={() => {
log();
}}
/>;
```
This is still a work in progress and open source so feel free to contribute to it and make it better!
|
50066f90-e295-4dd4-a939-f796ebe807de
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-19 07:36:42", "repo_name": "dolynhan15/Java-spring-boot", "sub_path": "/Project-new-spring/boost-server-master/boost-server-api/src/main/java/com/qooco/boost/data/mongo/embedded/LanguageEmbedded.java", "file_name": "LanguageEmbedded.java", "file_ext": "java", "file_size_in_byte": 1110, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "7ddad1764a2a4adfff7f87ca0fbda99f59b74486", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dolynhan15/Java-spring-boot
| 205
|
FILENAME: LanguageEmbedded.java
| 0.239349
|
package com.qooco.boost.data.mongo.embedded;
import com.qooco.boost.data.oracle.entities.UserFitLanguage;
import com.qooco.boost.data.oracle.entities.UserLanguage;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.Objects;
@Getter
@Setter
@NoArgsConstructor
public class LanguageEmbedded {
private Long id;
private String name;
private String code;
public LanguageEmbedded(UserLanguage language) {
if (Objects.nonNull(language)) {
this.id = language.getId();
if (Objects.nonNull(language.getLanguage())) {
this.name = language.getLanguage().getName();
this.code = language.getLanguage().getCode();
}
}
}
public LanguageEmbedded(UserFitLanguage language) {
if (Objects.nonNull(language)) {
this.id = language.getId();
if (Objects.nonNull(language.getLanguage())) {
this.name = language.getLanguage().getName();
this.code = language.getLanguage().getCode();
}
}
}
}
|
52873f74-e274-492e-89f4-92535ffc7f8f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-20 21:53:25", "repo_name": "vikasv2988/selenium-boot-1", "sub_path": "/selenium-boot/src/main/java/selenium/boot/hamcrest/matchers/text/pattern/ast/CaptureGroup.java", "file_name": "CaptureGroup.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "b48d3e30c8c5db2c11d52275c3e206600a1182ee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/vikasv2988/selenium-boot-1
| 201
|
FILENAME: CaptureGroup.java
| 0.283781
|
package selenium.boot.hamcrest.matchers.text.pattern.ast;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import selenium.boot.hamcrest.matchers.text.pattern.PatternComponent;
import selenium.boot.hamcrest.matchers.text.pattern.naming.GroupNamespace;
/**
* @author <a href="mailto:solmarkn@gmail.com">Dani Vainstein</a>
* @version %I%, %G%
* @since 1.0
*/
@AllArgsConstructor( access = AccessLevel.PUBLIC )
public class CaptureGroup implements PatternComponent
{
//region Static definitions, members, initialization and constructors
//---------------------------------------------------------------------
// Static definitions, members, initialization and constructors
//---------------------------------------------------------------------
private String name;
private PatternComponent pattern;
//endregion
@Override
public void buildRegex( StringBuilder builder, GroupNamespace groups )
{
GroupNamespace subgroups = groups.create( name );
builder.append( "(" );
pattern.buildRegex( builder, subgroups );
builder.append( ")" );
}
}
|
c98add1d-a1f2-40ef-b92a-d6d6fb52cddd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-07-05T07:06:32", "repo_name": "WhiteCatFly/Turing_Student_Code_2019", "sub_path": "/week_4/2018202098ZXK/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1273, "line_count": 47, "lang": "en", "doc_type": "text", "blob_id": "f2aaffd5800e190a6aab8ceb0b56ee886c937882", "star_events_count": 8, "fork_events_count": 27, "src_encoding": "UTF-8"}
|
https://github.com/WhiteCatFly/Turing_Student_Code_2019
| 351
|
FILENAME: README.md
| 0.274351
|
# HTMLParser
## intro
A very naive HTMLParser
author: ZXK
Feature
+ class Tag and class HTMLParser
+ use REGEX
+ use DOM tree
## Usage
```
make
./htmlParser
```
Then follow the instruction
##OUTPUT
Links.txt in current working directory
Texts.txt in current working directory
### HtmlParser Interface
+ HTMLParser(const &string)
+ HTMLParser(ifstream& in): two constructor
+ string getTitle() : return title
+ int getTexts(string& filename): return the num of texts and store it in file
+ int getLinks(string& filename): return the num of links and store it in file
+ Tag* find(string& tag_name): find the first tag whose name is the "tag_name"
+ int find_all(string& tag_name, std::vector<Tag*> &v):find all the tags and put them in the vector, return num
### Tag Interface
+ Tag* prev()
+ Tag* next()
+ Tag* parent()
+ Tag* son() //if not exists, return nullptr.
+ string operator[](string& key):like tagA["href"]
+ Tag* find(string& tag_name)
+ int find_all(string& tag_name, std::vector<Tag*> &v):The same as above
### To Do
+ 处理网页注释(在本程序中,所有的注释被暴力的忽略了……
+ 提高鲁棒性(本程序对不"规范”的网页容错性一般……
### 设计思路
参考了[W3C Dom](https://www.w3.org/DOM/)
|
91f26d63-cffc-4168-93ab-833bfbc18c64
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-04 07:15:41", "repo_name": "albertbecervas/EvilMemory", "sub_path": "/app/src/main/java/com/evilmem/albert/evilmemory/Activities/Flipper.java", "file_name": "Flipper.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "31942ecea9c568da0ac434e6cd79680f47a8187b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/albertbecervas/EvilMemory
| 225
|
FILENAME: Flipper.java
| 0.235108
|
package com.evilmem.albert.evilmemory.Activities;
import android.graphics.drawable.Drawable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import com.evilmem.albert.evilmemory.R;
import com.example.material.joanbarroso.flipper.CoolImageFlipper;
public class Flipper extends AppCompatActivity {
Drawable flipper, burger;
Boolean isBurger = true;
CoolImageFlipper fliper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_flipper);
fliper = new CoolImageFlipper(this);
flipper = getResources().getDrawable(R.drawable.ic_evil);
burger = getResources().getDrawable(R.drawable.ic_angel);
}
public void flip(View view) {
if(isBurger){
fliper.flipImage(flipper, ((ImageView) view));
}else{
fliper.flipImage(burger, ((ImageView) view));
}
isBurger= !isBurger;
}
}
|
ef3fd914-c81f-42de-8308-3451ec329665
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-23 04:42:29", "repo_name": "aphiratnimanussonkul/ProjectSA", "sub_path": "/Server/src/main/java/sut/sa/g20/entity/MemberHotelEntity.java", "file_name": "MemberHotelEntity.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "af713dd54ed15352d363e0fba1ab1a276f047645", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/aphiratnimanussonkul/ProjectSA
| 248
|
FILENAME: MemberHotelEntity.java
| 0.285372
|
package sut.sa.g20.entity;
import javax.persistence.*;
import lombok.*;
@Entity
@Data
@Table (name = "TableMemberHotel")
public class MemberHotelEntity {
@Id
@SequenceGenerator(name="memberHotel_seq",sequenceName="memberHotel_seq")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="memberHotel_seq")
@Column(name="memberHotelId",unique = true, nullable = false)
private @NonNull Long memberHotelId;
private String memberHotelName;
private Long memberHotelPassword;
public MemberHotelEntity(){ }
public MemberHotelEntity(String memberHotelName,Long memberHotelPassword){
this.memberHotelName = memberHotelName;
this.memberHotelPassword = memberHotelPassword;
}
public void setMemberHotelName(String memberHotelName){
this.memberHotelName = memberHotelName;
}
public String getMemberHotelName(){
return this.memberHotelName = memberHotelName;
}
public void setMemberHotelPassword(Long memberHotelPassword){
this.memberHotelPassword = memberHotelPassword;
}
public Long getMemberHotelPassword(){
return this.memberHotelPassword = memberHotelPassword;
}
}
|
7f808e0c-7738-41e5-be70-8c53bad7c12c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-26 12:48:57", "repo_name": "Luc-DuboisP/skywalker", "sub_path": "/src/main/java/com/springmsa/skywalker/controller/RebelsController.java", "file_name": "RebelsController.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "25ec802ff97caedb534a4321feb343210dfd9ae3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Luc-DuboisP/skywalker
| 238
|
FILENAME: RebelsController.java
| 0.286968
|
package com.springmsa.skywalker.controller;
import com.springmsa.skywalker.model.Rebels;
import com.springmsa.skywalker.form.BookingsForm;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.client.RestTemplate;
import java.util.Date;
@Controller
public class RebelsController {
@PostMapping("/addRebel")
public String addRebelPage(@ModelAttribute("rebelsForm") BookingsForm bookingsForm){
String lastName = bookingsForm.getLastName();
String firstName = bookingsForm.getFirstName();
Date birthDate = bookingsForm.getBirthDate();
String licenseNumber = bookingsForm.getLicenseNumber();
Date licenseDate = bookingsForm.getLicenseDate();
Date startDate = bookingsForm.getStartDate();
Date endDate = bookingsForm.getEndDate();
Rebels newRebel = new Rebels(lastName, firstName, birthDate, licenseNumber, licenseDate, startDate, endDate);
new RestTemplate().postForObject("http://localhost:8080/api/bookings/confirmation", newRebel, Rebels.class);
return "redirect:/vehicules";
}
}
|
209ce5c3-263f-448e-ba93-ae51eae362bc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-13 03:55:55", "repo_name": "daiweidong/fffgg", "sub_path": "/src/main/java/com/gzi/springbootdemo/controller/TestController.java", "file_name": "TestController.java", "file_ext": "java", "file_size_in_byte": 1056, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "774d9def3577027fe1fc01b659d43ee830fe28cc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/daiweidong/fffgg
| 213
|
FILENAME: TestController.java
| 0.216012
|
package com.gzi.springbootdemo.controller;
import com.gzi.springbootdemo.Service.SenderService;
import com.gzi.springbootdemo.config.Sender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestController {
@Autowired
private Sender sender;
@Autowired
private SenderService senderService;
/* @Autowired
private DelaySender delaySender;*/
@GetMapping("/sendDirectQueue")
public Object sendDirectQueue() {
//sender.sendDirectQueue();
senderService.sendDirectQueue("lllllll");
return "ok";
}
@GetMapping("/sendTopic")
public Object sendTopic() {
// sender.sendTopic();
senderService.sendTopic("ffffffff");
return "ok";
}
@GetMapping("/sendFanout")
public Object sendFanout() {
// sender.sendFanout();
senderService.sendFanout("ddddd");
return "ok";
}
}
|
aa248c8d-4dbc-49b8-b602-a8f2df7a70d2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-23 08:16:00", "repo_name": "amitkumargiri/Medicity", "sub_path": "/app/src/main/java/com/trulloy/bfunx/ui/share/ShareFragment.java", "file_name": "ShareFragment.java", "file_ext": "java", "file_size_in_byte": 1111, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "d15759ff82d68004f3b3b440281c8d4d5627be63", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/amitkumargiri/Medicity
| 215
|
FILENAME: ShareFragment.java
| 0.2227
|
package com.trulloy.bfunx.ui.share;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.trulloy.bfunx.R;
/**
* A simple {@link Fragment} subclass.
*/
public class ShareFragment extends Fragment {
public ShareFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_share, container, false);
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
String shareBody = "https://play.google.com/store/apps/details?id=com.trulloy.bfunx";
String shareSub = "App To Track Medical Expense";
shareIntent.putExtra(Intent.EXTRA_SUBJECT, shareSub);
shareIntent.putExtra(Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(shareIntent, "Using: "));
return root;
}
}
|
d1c5ab3a-0079-403b-9150-c3cb45cce091
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-08T21:22:10", "repo_name": "EnriqueMoran/hsk-vocabulary-flashcards", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1220, "line_count": 57, "lang": "en", "doc_type": "text", "blob_id": "cf9c3105ad41ecf0bdef97123092cdfb6da2c4b4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/EnriqueMoran/hsk-vocabulary-flashcards
| 313
|
FILENAME: README.md
| 0.273574
|
# hsk-vocabulary-flashcards
Online chinese HSK vocabulary flashcards
This is a customizable website to help people learn and review chinese characters.
Placing the mouse over any character will show info about it: its pinyin, meaning, usage example and notes.

## Data structure
Data is stored in MongoDB using the following structure:
```
{
"character": "",
"pinyin" : "",
"meaning" : "",
"level" : "",
"example" : "",
"notes" : ""
}
```
Character data can be edited through the website by right clicking on it.

## Installation guide
Download this project, using this command:
```
git clone https://github.com/EnriqueMoran/hsk-vocabulary-flashcards.git
```
Fill the required parameters on *index.js* and *main.js* with your own url:
### index.js:
```
const url = 'ws://localhost:8080'; // must have ws://
```
Next, install docker-compose.
Run docker-compose:
```
docker-compose up --build
```
Import data (modify its content to import another file):
```
./import.sh
```
Note: For changing anything in BBDD (user, pass, etc), first, /data/ must be empty!
Access through X.X.X.X:8080/hsk
|
2626e37c-122c-44de-aa82-c95878bb092b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-03 10:57:04", "repo_name": "Piotrek2002/register", "sub_path": "/src/main/java/com/register/register/entity/ClassDTO.java", "file_name": "ClassDTO.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "3f48e2a434f868602340794716bf3ad7e1fa154a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Piotrek2002/register
| 237
|
FILENAME: ClassDTO.java
| 0.259826
|
package com.register.register.entity;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
public class ClassDTO {
private Long id;
private List<Long> studentsId=new ArrayList<>();
private List<Long> subjectsId=new ArrayList<>();
private String className;
private Long teacherId;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public List<Long> getStudentsId() {
return studentsId;
}
public void setStudentsId(List<Long> studentsId) {
this.studentsId = studentsId;
}
public List<Long> getSubjectsId() {
return subjectsId;
}
public void setSubjectsId(List<Long> subjectsId) {
this.subjectsId = subjectsId;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public Long getTeacherId() {
return teacherId;
}
public void setTeacherId(Long teacherId) {
this.teacherId = teacherId;
}
}
|
aa602f53-0ed5-4aa1-90fa-948a153551f8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-27 05:59:41", "repo_name": "NishadShamsudeen/JustPark", "sub_path": "/app/src/main/java/com/example/android/justpark/Basement2.java", "file_name": "Basement2.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "ab3f35414198571d6cddf703b7945834d34c96a4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/NishadShamsudeen/JustPark
| 221
|
FILENAME: Basement2.java
| 0.247987
|
package com.example.android.justpark;
import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
/**
* A simple {@link Fragment} subclass.
*/
public class Basement2 extends Fragment {
TextView twohours,twoplus,moreday;
String mallname;
public Basement2() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view;
view = inflater.inflate(R.layout.fragment_basement2, container, false);
twohours = (TextView)view.findViewById(R.id.datefrom);
twoplus = (TextView)view.findViewById(R.id.dateuntil);
moreday = (TextView)view.findViewById(R.id.duration_hrs);
mallname = getArguments().getString("mallnamekey");
Toast.makeText(getActivity(),mallname,Toast.LENGTH_SHORT).show();
//Toast.makeText(getActivity(),name,Toast.LENGTH_SHORT).show();
return view;
}
}
|
f2f9e568-f49c-45d8-8da0-622ce2deb557
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-30T00:51:26", "repo_name": "tensorflow/lingvo", "sub_path": "/lingvo/jax/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1182, "line_count": 44, "lang": "en", "doc_type": "text", "blob_id": "29071148ab433add19916ad9088d49ba6372ea1e", "star_events_count": 2963, "fork_events_count": 485, "src_encoding": "UTF-8"}
|
https://github.com/tensorflow/lingvo
| 351
|
FILENAME: README.md
| 0.290176
|
# Lingvo JAX
This directory contains code to train machine learning models in
[Jax](htts://github.com/google/jax) using a user API mechanism very similar to
the one of [TensorFlow lingvo](http://github.com/tensorflow/lingvo).
More specifically:
* It adopts the same functional programming API.
* It adopts the same Params-based configuration system.
## Dependencies
* [lingvo (Tensorflow)](http://github.com/tensorflow/lingvo)
* [Jax](http://github.com/google/jax)
* [TensorFlow](http://github.com/tensorflow/tensorflow)
* [TensorFlow Text](http://github.com/tensorflow/text)
* [NumPy](http://github.com/numpy/numpy)
* [Sympy](https://github.com/sympy/sympy)
* [flax](http://github.com/google/flax)
* [optax](http://github.com/deepmind/optax)
* [optax-shampoo](https://pypi.org/project/optax-shampoo)
* [jax-bitempered-loss](https://pypi.org/project/jax-bitempered-loss)
* [einops](https://github.com/arogozhnikov/einops)
* [abseil](http://github.com/abseil/abseil-py)
* [clu](http://pypi.org/project/clu/)
* [tensorstore](http://github.com/google/tensorstore)
* (optional) [MLPerf logging](http://github.com/mlcommons/logging)
|
e8d31f4c-6f8e-4565-8bb1-6fdd8394bd47
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-08 12:15:57", "repo_name": "sarahbruh/uebung9", "sub_path": "/src/sample/Model.java", "file_name": "Model.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 24, "lang": "en", "doc_type": "code", "blob_id": "57f84c19660fc34b86a05a8f964504af054c8387", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sarahbruh/uebung9
| 234
|
FILENAME: Model.java
| 0.29584
|
package sample;
import java.util.ArrayList;
import java.util.Arrays;
public class Model {
public boolean isCorrectLogin(String name, String password){
if(name.equals("Sarah") && password.equals("1234")){
return true;
}
else{
System.err.println("Wrong username or password!");
}
return false;
}
ArrayList<String> positiveAnswers = new ArrayList<String> (Arrays.asList("It is certain.", "It is decidedly so.", "Without a doubt.", "Yes – definitely.", "You may rely on it.", "As I see it, yes.", "Most likely.", "Outlook good.", "Yes.", "Signs point to yes."));
ArrayList<String> neutralAnswers = new ArrayList<String> (Arrays.asList("Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again."));
ArrayList<String> negativeAnswers = new ArrayList<String> (Arrays.asList("Don’t count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."));
}
|
2bea9255-b731-46b8-a6c0-305fc51991c5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-14 02:37:49", "repo_name": "liepeiming/xposed_chatbot", "sub_path": "/alimama/src/main/java/com/ali/user/mobile/model/RegistParam.java", "file_name": "RegistParam.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "171ab0a157a6c66b25be578270ba1b6245e9ef5d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/liepeiming/xposed_chatbot
| 227
|
FILENAME: RegistParam.java
| 0.252384
|
package com.ali.user.mobile.model;
import android.os.Parcel;
import android.os.Parcelable;
public class RegistParam implements Parcelable {
public static final Parcelable.Creator<RegistParam> CREATOR = new Parcelable.Creator<RegistParam>() {
public RegistParam[] newArray(int i) {
return new RegistParam[i];
}
public RegistParam createFromParcel(Parcel parcel) {
return new RegistParam(parcel);
}
};
public String regFrom;
public String registAccount;
public int registSite;
public String token;
public int describeContents() {
return 0;
}
public RegistParam() {
}
public RegistParam(Parcel parcel) {
this.registAccount = parcel.readString();
this.token = parcel.readString();
this.registSite = parcel.readInt();
this.regFrom = parcel.readString();
}
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(this.registAccount);
parcel.writeString(this.token);
parcel.writeInt(this.registSite);
parcel.writeString(this.regFrom);
}
}
|
40231c5f-646d-4d69-8559-6516b904557c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-23 17:41:08", "repo_name": "yousef1876/Ecommerce-Banking-IngenicoConnectAPI", "sub_path": "/src/main/java/com/hr/framework/po/business/crm/meeting/Role.java", "file_name": "Role.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "a7b15d66ee2702ebda1d14801b60d951a9eb98d2", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/yousef1876/Ecommerce-Banking-IngenicoConnectAPI
| 243
|
FILENAME: Role.java
| 0.255344
|
package com.hr.framework.po.business.crm.meeting;
import com.hr.framework.config.audit.Auditable;
import com.hr.framework.config.audit.EntityListener;
import com.hr.framework.po.business.crm.users.AssignedUsers;
import com.hr.framework.po.employee.base.Department;
import lombok.Data;
import javax.persistence.*;
@Entity
@Table(name = "roles_")
@Data
@EntityListeners(EntityListener.class)
@Cacheable(true)
public class Role extends Auditable<Role>{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id", updatable = false, nullable = false)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id" , nullable = false)
private AssignedUsers assignedUsers;
@Column(name = "description" , nullable = true)
private String description;
@Column(name = "note" , nullable = true)
private String note;
@Column(name = "deleted" , nullable = false)
private boolean isDeleted;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "department_id" , nullable = false)
private Department departments;
}
|
89336cf8-5b20-46f0-9c69-919b0322c816
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-27 14:30:46", "repo_name": "Caddarik/theblog", "sub_path": "/src/main/java/fr/caddarik/theblog/service/exeption/mapper/TheBlogExceptionMapper.java", "file_name": "TheBlogExceptionMapper.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "09d6029c54438effad2b73ccb678751bdbab9e2f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Caddarik/theblog
| 232
|
FILENAME: TheBlogExceptionMapper.java
| 0.279828
|
/*
* 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 fr.caddarik.theblog.service.exeption.mapper;
import fr.caddarik.theblog.service.exeption.TheBlogException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import lombok.extern.slf4j.Slf4j;
/**
* Mapper to build the response in case of error
*
* @author cedric
*/
@Provider
@Slf4j
public class TheBlogExceptionMapper implements ExceptionMapper<TheBlogException> {
@Override
public Response toResponse(TheBlogException exception) {
String msg = exception.getClass().getName() + " ; " + exception.getMessage() + " ; " + exception.getErrorCode();
Status status = exception.getStatus();
log.debug("toResponse() msg = {}, status = {}", msg, status);
return Response.status(status)
.entity(msg)
.build();
}
}
|
cfdc7981-1a00-4583-ac3c-bd8db44ad920
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-26 16:37:25", "repo_name": "mamedzavr/eCare", "sub_path": "/src/main/java/com/telekom/ecare/service/implementation/ClientServiceImpl.java", "file_name": "ClientServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "4fc7e2ef60ea4753e442cf87d48deb8d813ed69a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mamedzavr/eCare
| 217
|
FILENAME: ClientServiceImpl.java
| 0.273574
|
package com.telekom.ecare.service.implementation;
import com.telekom.ecare.dao.ClientDao;
import com.telekom.ecare.domain.Client;
import com.telekom.ecare.service.api.ClientService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Optional;
@Service
@AllArgsConstructor
public class ClientServiceImpl implements ClientService {
private ClientDao clientDao;
@Override
@Transactional
public List<Client> getAll() {
return clientDao.findAll();
}
@Override
@Transactional
public Client getById(Long id) {
return clientDao.findById(id).get();
}
@Override
@Transactional
public Optional<Client> getByEmail(String email) {
return clientDao.findClientByEmail(email);
}
@Override
@Transactional
public void create(Client client) {
clientDao.save(client);
}
@Override
@Transactional
public void removeById(Long id) {
clientDao.deleteById(id);
}
}
|
c636e4e6-bfbc-4bad-abe6-19d6b2512904
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-13 21:49:18", "repo_name": "Jobicycle/SQLite_Demo", "sub_path": "/app/src/main/java/com/justin/sqlite_demo/model/Student.java", "file_name": "Student.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "270524ce997e685e6f5d2a40d8dc5ec04ce9969a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Jobicycle/SQLite_Demo
| 271
|
FILENAME: Student.java
| 0.239349
|
package com.justin.sqlite_demo.model;
public class Student {
// Labels Table and Columns names
public static final String TABLE = "Student";
public static final String KEY_ID = "id";
public static final String KEY_NAME = "name";
public static final String KEY_EMAIL = "email";
public static final String KEY_AGE = "age";
private int student_ID;
private String name;
private String email;
private int age;
public Student() {
}
public Student(int student_ID, String name, String email, int age) {
this.student_ID = student_ID;
this.name = name;
this.email = email;
this.age = age;
}
public int getStudent_ID() {
return student_ID;
}
public void setStudent_ID(int student_ID) {
this.student_ID = student_ID;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
|
5c7c76cd-e0f6-410c-9bc5-9c2ba34670ac
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-03 06:21:13", "repo_name": "hhk8691608/spike", "sub_path": "/src/test/java/com/ace/study/spike/cache/CacheApplicationTest.java", "file_name": "CacheApplicationTest.java", "file_ext": "java", "file_size_in_byte": 1241, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "099e3640119e411580afd29df93d5cb37d52fd4d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hhk8691608/spike
| 276
|
FILENAME: CacheApplicationTest.java
| 0.259826
|
package com.ace.study.spike.cache;
import com.ace.study.spike.VO.cache.UserVo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class CacheApplicationTest {
@Autowired
private RedisTemplate redisTemplate;
@Test
public void redisTest() {
// redis存储数据
String key = "name";
redisTemplate.opsForValue().set(key, "yukong");
// 获取数据
String value = (String) redisTemplate.opsForValue().get(key);
System.out.println("获取缓存中key为" + key + "的值为:" + value);
UserVo user = new UserVo();
user.setUsername("yukong");
user.setSex(18);
user.setId(1L);
String userKey = "yukong";
redisTemplate.opsForValue().set(userKey, user);
UserVo newUser = (UserVo) redisTemplate.opsForValue().get(userKey);
System.out.println("获取缓存中key为" + userKey + "的值为:" + newUser);
}
}
|
1a06c098-fadd-428e-a61e-4d485b81e5d3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-08 05:15:34", "repo_name": "DGHGYK/GYK", "sub_path": "/Project/app/src/main/java/com/inwhiter/inviteapp/project/Fragment/Fragments/ProfileFragment.java", "file_name": "ProfileFragment.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "ba352c3f7b6b201606b22f89dcc386808860fdad", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/DGHGYK/GYK
| 218
|
FILENAME: ProfileFragment.java
| 0.247987
|
package com.inwhiter.inviteapp.project.Fragment.Fragments;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.Button;
import com.inwhiter.inviteapp.project.Fragment.BaseFragment;
import com.inwhiter.inviteapp.project.Fragment.FragmentController;
import com.inwhiter.inviteapp.project.R;
/**
* A simple {@link Fragment} subclass.
*/
public class ProfileFragment extends BaseFragment {
Button purchase;
public ProfileFragment() {
// Required empty public constructor
}
@Override
protected int getFID() {
return R.layout.fragment_profile;
}
@Override
protected void init() {//ONCREATE İŞLEMLERİN BURADA OLACAK
purchase = (Button) getActivity().findViewById(R.id.bt_profile_purchase);
}
@Override
protected void handlers() {
purchase.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.changeFragment(FragmentController.PURCHASE);
}
});
}
}
|
812ccc1a-be32-4e3b-aebc-9bfda7f2e6d0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-17 11:14:10", "repo_name": "aku-sama/Capstone-Project", "sub_path": "/app/src/main/java/raspopova/diana/exptracker/ui/login/LoginViewState.java", "file_name": "LoginViewState.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "92eb420cc37798a4573f1925510e751e65e372c1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/aku-sama/Capstone-Project
| 257
|
FILENAME: LoginViewState.java
| 0.272799
|
package raspopova.diana.exptracker.ui.login;
import android.os.Bundle;
import android.support.annotation.NonNull;
import com.hannesdorfmann.mosby3.mvp.viewstate.RestorableViewState;
/**
* Created by Diana.Raspopova on 5/13/2017.
*/
public class LoginViewState implements RestorableViewState<ILoginView> {
public static final String EMAIL = "email";
public static final String PASSWORD = "password";
String email;
String password;
@Override
public void saveInstanceState(@NonNull Bundle out) {
out.putString(EMAIL, email);
out.putString(PASSWORD, password);
}
@Override
public RestorableViewState<ILoginView> restoreInstanceState(Bundle in) {
if (in == null) {
return null;
}
email = in.getString(EMAIL);
password = in.getString(PASSWORD);
return this;
}
@Override
public void apply(ILoginView view, boolean retained) {
view.fillView(email, password);
}
public void setEmail(String email) {
this.email = email;
}
public void setPassword(String password) {
this.password = password;
}
}
|
7ff4028f-69b4-420d-95b5-7c76ca339700
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-31 08:51:53", "repo_name": "Xceptance/neodymium-example", "sub_path": "/src/test/java/posters/tests/testdata/processes/GuestOrderTestData.java", "file_name": "GuestOrderTestData.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "34047a49038ff043c621cd7d4019b033ed6970a9", "star_events_count": 8, "fork_events_count": 7, "src_encoding": "UTF-8"}
|
https://github.com/Xceptance/neodymium-example
| 239
|
FILENAME: GuestOrderTestData.java
| 0.258326
|
package posters.tests.testdata.processes;
import posters.tests.testdata.dataobjects.Address;
import posters.tests.testdata.dataobjects.CreditCard;
public class GuestOrderTestData
{
private String topCategory;
private int resultPosition;
private String sizeProduct;
private String styleProduct;
private Address shippingAddress;
private Boolean shipAddrEqualBillAddr;
private Address billingAddress;
private CreditCard creditCard;
public String getTopCategory()
{
return topCategory;
}
public int getResultPosition()
{
return resultPosition;
}
public String getsSizeProduct()
{
return sizeProduct;
}
public String getStyleProduct()
{
return styleProduct;
}
public Address getShippingAddress()
{
return shippingAddress;
}
public Boolean getShipAddrEqualBillAddr()
{
return shipAddrEqualBillAddr;
}
public Address getBillingAddress()
{
return billingAddress;
}
public CreditCard getCreditCard()
{
return creditCard;
}
}
|
19477379-deea-4a7e-a33d-0d7d6a19da7a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-02-03 13:04:50", "repo_name": "tygroo/bibiCloudPix", "sub_path": "/src/main/java/fr/kisuke/dao/picture/JpaPictureDao.java", "file_name": "JpaPictureDao.java", "file_ext": "java", "file_size_in_byte": 1011, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "e8d38065a1688b924a2a9a3503b46cd215ed0845", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tygroo/bibiCloudPix
| 210
|
FILENAME: JpaPictureDao.java
| 0.294215
|
package fr.kisuke.dao.picture;
import fr.kisuke.dao.JpaDao;
import fr.kisuke.entity.Pictures;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import java.util.List;
/**
*
*/
public class JpaPictureDao extends JpaDao<Pictures, Long> implements PictureDao
{
public JpaPictureDao()
{
super(Pictures.class);
}
@Override
@Transactional(readOnly = true)
public List<Pictures> findAll()
{
final CriteriaBuilder builder = this.getEntityManager().getCriteriaBuilder();
final CriteriaQuery<Pictures> criteriaQuery = builder.createQuery(Pictures.class);
Root<Pictures> root = criteriaQuery.from(Pictures.class);
//criteriaQuery.orderBy(builder.desc(root.get("date")));
TypedQuery<Pictures> typedQuery = this.getEntityManager().createQuery(criteriaQuery);
return typedQuery.getResultList();
}
}
|
457b4d3e-9d7a-4359-9856-49ebb184c7fb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-01 21:41:05", "repo_name": "guevie/java_RMI", "sub_path": "/PersonneRMIClient/src/fr/doranco/com/client/Personne_Stub.java", "file_name": "Personne_Stub.java", "file_ext": "java", "file_size_in_byte": 1137, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "9a0038561e03934f6512e0d2da7b388cac7df086", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/guevie/java_RMI
| 255
|
FILENAME: Personne_Stub.java
| 0.289372
|
package fr.doranco.com.client;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import fr.doranco.com.Personne;
public class Personne_Stub implements Personne {
private Socket pSocket;
public Personne_Stub() throws Throwable {
pSocket = new Socket("localhost", 9000);
}
@Override
public int getAge() {
return (Integer) this.get("age");
}
@Override
public String getNom() {
return (String) this.get("nom");
}
private Object get(String champ) {
ObjectOutputStream outStream;
ObjectInputStream inStream;
try {
outStream = new ObjectOutputStream(pSocket.getOutputStream());
outStream.writeObject(champ);
outStream.flush();
inStream = new ObjectInputStream(pSocket.getInputStream());
if (champ == "age")
return inStream.readInt();
else if (champ == "nom")
return (String) inStream.readObject();
}
catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
return null;
}
public void close() throws Throwable {
pSocket.close();
}
}
|
cfc9a829-9886-4f6a-bd7b-cdc661ffb34e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-28 08:36:07", "repo_name": "EmptyPages0430/bxxc", "sub_path": "/app/src/main/java/com/jgkj/bxxc/tools/BitmapFromURL.java", "file_name": "BitmapFromURL.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "59deba5b568e7c24eed845be27f15226b64020af", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/EmptyPages0430/bxxc
| 219
|
FILENAME: BitmapFromURL.java
| 0.247987
|
package com.jgkj.bxxc.tools;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.widget.Toast;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* Created by fangzhou on 2016/11/14.
* 读取url图片并转化为bitmap类型
*/
public class BitmapFromURL {
private Context context;
public BitmapFromURL(Context context){
this.context = context;
}
//imageView加载url
public Bitmap getBitmapFromURL(String src) {
try {
URL url = new URL(src);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(input);
return myBitmap;
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(context,"图片加载失败!", Toast.LENGTH_SHORT).show();
return null;
}
}
}
|
6f93a203-4908-4a04-a766-aba777a15ce6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-31 09:10:54", "repo_name": "NicholasExxonite/2D_Guilds_Of_Lancaster", "sub_path": "/src/hashpizza/game/engine/GameSprite.java", "file_name": "GameSprite.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "ec4ae517e7d3c4f92b80fc3d218c5ae221dee432", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/NicholasExxonite/2D_Guilds_Of_Lancaster
| 268
|
FILENAME: GameSprite.java
| 0.291787
|
package hashpizza.game.engine;
import org.jsfml.graphics.ConstTexture;
import org.jsfml.graphics.Sprite;
/**
* Class to represent a textured object to render to the screen.
* Uses the JSFML library to handle drawing internally
*/
public class GameSprite extends Sprite implements GameObject {
/**
* The screen that this sprite belongs to
*/
private GameScreen screen;
/**
* Creates a game sprite with the specified texture
*
* @param texture the texture to use
*/
public GameSprite(GameScreen screen, ConstTexture texture) {
super(texture);
this.screen = screen;
}
/**
* Sets the sprite to an exact width and height, using the scale feature
*
* @param width the width to set this sprite to
* @param height the height to set this sprite to
*/
public void setSize(float width, float height) {
setScale(width / getTexture().getSize().x, height / getTexture().getSize().y);
}
/**
* Gets the screen
*
* @return the screen that this sprite belongs to
*/
public GameScreen getScreen() {
return screen;
}
@Override
public void update(float delta) {
}
}
|
b8e01478-415b-4848-a1f0-fe582de9e51f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-27 02:38:13", "repo_name": "heyaoyu/JavaRelated", "sub_path": "/netty-usage/src/main/java/websocket/WebSocketServer.java", "file_name": "WebSocketServer.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "37174c4bd03ffcbdf6add21ea3e5d7c16acca6f8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/heyaoyu/JavaRelated
| 255
|
FILENAME: WebSocketServer.java
| 0.253861
|
package websocket;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
/**
* Created by heyaoyu on 2018/10/8.
*/
public final class WebSocketServer {
final static int PORT = 8080;
public static void main(String[] args) {
EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
ServerBootstrap b = new ServerBootstrap();
b.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
.handler(new LoggingHandler(LogLevel.INFO))
.childHandler(new WebSocketServerInitializer());
Channel channel = b.bind(PORT).sync().channel();
System.out.println("running websocket server...");
channel.closeFuture().sync();
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
bossGroup.shutdownGracefully();
workerGroup.shutdownGracefully();
}
}
}
|
7891ed89-9206-4d1a-925a-17c85900c4e2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-30 14:39:48", "repo_name": "npee/geteip", "sub_path": "/src/main/java/com/npee/eip/service/SubjectServiceImpl.java", "file_name": "SubjectServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1135, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "a2b2b44924dd52a07e4ebb62e48dea7486438606", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/npee/geteip
| 236
|
FILENAME: SubjectServiceImpl.java
| 0.23793
|
package com.npee.eip.service;
import com.npee.eip.advice.exception.CustomSubjectNotExistsException;
import com.npee.eip.model.entity.Subject;
import com.npee.eip.model.request.RequestQuizDto;
import com.npee.eip.repository.SubjectJpaRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@RequiredArgsConstructor
@Slf4j
public class SubjectServiceImpl implements SubjectService {
private final SubjectJpaRepository subjectJpaRepository;
@Override
public Subject insertSubject(RequestQuizDto quizDto) {
return null;
}
@Override
public List<Subject> selectSubjects() {
return subjectJpaRepository.findAll();
}
@Override
public Subject selectASubject(Long subjectId) {
return subjectJpaRepository.findById(subjectId).orElseThrow(CustomSubjectNotExistsException::new);
}
@Override
public Subject updateSubject(Long subjectId, RequestQuizDto quizDto) {
return null;
}
@Override
public void deleteSubject(Long subjectId) {
}
}
|
465adc68-6a84-447d-8c53-7cbecc09551e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-27 11:38:19", "repo_name": "2663018864/java_code_test", "sub_path": "/Java_code/web_case/src/com/milo/util/JDBCUtils.java", "file_name": "JDBCUtils.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "ab93bf4a740534e24bf588e9201a918a88739096", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/2663018864/java_code_test
| 207
|
FILENAME: JDBCUtils.java
| 0.235108
|
package com.milo.util;
import com.alibaba.druid.pool.DruidDataSourceFactory;
import javax.sql.DataSource;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
public class JDBCUtils {
private static DataSource ds;
//初始化连接池对象
static{
try {
InputStream is = JDBCUtils.class.getClassLoader().getResourceAsStream("druid.properties");
Properties prop = new Properties();
prop.load(is);
ds = DruidDataSourceFactory.createDataSource(prop);
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 获取连接池对象
* @return
*/
public static DataSource getDataSource() {
return ds;
}
/**
* 获取连接对象
* @return
* @throws SQLException
*/
public static Connection getConnection() throws SQLException {
return ds.getConnection();
}
}
|
e163dbf7-c46d-4c03-95ae-b17745db4521
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-17 13:27:29", "repo_name": "STAMP-project/stamp-ide", "sub_path": "/eu.stamp.eclipse.descartes.wizard/src/eu/stamp/wp4/descartes/wizard/utils/DescartesWizardConstants.java", "file_name": "DescartesWizardConstants.java", "file_ext": "java", "file_size_in_byte": 1098, "line_count": 22, "lang": "en", "doc_type": "code", "blob_id": "e37c9c7b4d247da8c0e3252760aeb9d162f30ef3", "star_events_count": 2, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/STAMP-project/stamp-ide
| 232
|
FILENAME: DescartesWizardConstants.java
| 0.26588
|
/*******************************************************************************
* Copyright (c) 2019 Atos
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* Ricardo Jose Tejada Garcia (Atos) - main developer
* Jesús Gorroñogoitia (Atos) - architect
* Initially developed in the context of STAMP EU project https://www.stamp-project.eu
*******************************************************************************/
package eu.stamp.wp4.descartes.wizard.utils;
public abstract class DescartesWizardConstants {
public static final String DESCARTES_PLUGIN_ID = "eu.stamp.eclipse.descartes.wizard";
public static final String MAVEN_NATURE_ID = "org.eclipse.m2e.core.maven2Nature";
public static final String POM_NAME_LAUNCH_CONSTANT = "pom name";
public static final String LAUNCH_CONFIGURATION_DESCARTES_ID =
"eu.stamp.wp4.descartes.wizard.launchConfiguration";
}
|
8d68739a-b2e5-4d3c-a5ba-306e0960594b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-05-30T22:53:47", "repo_name": "chris-b1/ibis", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1159, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "c87efe710939d0fdb3efa3ca56ff9f338b9ab0e1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/chris-b1/ibis
| 317
|
FILENAME: README.md
| 0.295027
|
[](https://circleci.com/gh/pandas-dev/ibis/tree/master)
Current release from Anaconda.org [](https://anaconda.org/conda-forge/ibis-framework)
# Ibis: Python data analysis framework for Hadoop and SQL engines
Ibis is a toolbox to bridge the gap between local Python environments and
remote storage and execution systems like Hadoop components (HDFS, Impala,
Hive, Spark) and SQL databases (Postgres, etc.). Its goal is to simplify
analytical workflows and make you more productive.
Install Ibis from PyPI with:
$ pip install ibis-framework
At this time, Ibis provides tools for the interacting with the following
systems:
- [Apache Impala (incubating)](http://impala.io/)
- [Apache Kudu](http://getkudu.io)
- Hadoop Distributed File System (HDFS)
- PostgreSQL (Experimental)
- SQLite
Learn more about using the library at http://docs.ibis-project.org and read the
project blog at http://ibis-project.org for news and updates.
|
829e3577-7c88-4941-a203-840356ec8e3c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-15 01:58:42", "repo_name": "sahilde3p/web-customer-tracker", "sub_path": "/web-customer-tracker/src/com/sahil/testdb/TestDbServlet.java", "file_name": "TestDbServlet.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "cb5fe6944cbd7ac3dff8295e90abd6931fea692d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sahilde3p/web-customer-tracker
| 214
|
FILENAME: TestDbServlet.java
| 0.264358
|
package com.sahil.testdb;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/TestDbServlet")
public class TestDbServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public TestDbServlet() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String user = "springstudent";
String pass = "springstudent";
String url = "jdbc:mysql://localhost:3306/web_customer_tracker?useSSL=false";
String driver = "com.mysql.jdbc.Driver";
try
{
Class.forName(driver);
Connection con = DriverManager.getConnection(url, user, pass);
System.out.println("Connected");
}
catch(Exception e)
{
e.printStackTrace();
throw new ServletException();
}
}
}
|
afb74e76-6c10-4992-8b9c-621ba58f44eb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-24 15:06:47", "repo_name": "fanW96/ordersystem-ssm", "sub_path": "/src/main/java/com/ordersystem/entity/Orders.java", "file_name": "Orders.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "47f43e4379998bfc0e2a32999d81f0be537fdc4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fanW96/ordersystem-ssm
| 229
|
FILENAME: Orders.java
| 0.253861
|
package com.ordersystem.entity;
import java.security.Timestamp;
public class Orders {
private String order_ID;
private User user;
private Timestamp order_TIME;
private int status = 0;
public Orders(String order_ID, User user, Timestamp order_TIME, int status) {
super();
this.order_ID = order_ID;
this.user = user;
this.order_TIME = order_TIME;
this.status = status;
}
public Orders() {
super();
}
public String getOrder_ID() {
return order_ID;
}
public void setOrder_ID(String order_ID) {
this.order_ID = order_ID;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Timestamp getOrder_TIME() {
return order_TIME;
}
public void setOrder_TIME(Timestamp order_TIME) {
this.order_TIME = order_TIME;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
|
08ced1b1-65ce-49d8-bea5-9d565a493a13
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-09 14:53:13", "repo_name": "Zhengyupei/DeepWalkProject", "sub_path": "/src/main/java/com/liu/service/impl/PeopleServiceImpl.java", "file_name": "PeopleServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "766fe7eb5241938fdcf6338bf603d9c6597b289e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Zhengyupei/DeepWalkProject
| 241
|
FILENAME: PeopleServiceImpl.java
| 0.267408
|
package com.liu.service.impl;
import com.liu.mapper.PeopleMapper;
import com.liu.model.People;
import com.liu.service.IPeopleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by liujiayu on 2017/9/9.
*/
@Service("peopleService")
public class PeopleServiceImpl implements IPeopleService {
@Autowired
private PeopleMapper peopleMapper;
@Override
public List<People> selectPeople(){
return peopleMapper.selectPeople();
}
@Override
public void insertPeople(People people){
peopleMapper.insertPeople(people);
}
@Override
public People selectPeopleByName(String name){
return peopleMapper.selectPeopleByName(name);
}
@Override
public People selectPeopleByMail(String mail){
return peopleMapper.selectPeopleByMail(mail);
}
@Override
public People selectPeopleById(int id){
return peopleMapper.selectPeopleById(id);
}
@Override
public void activePeople(int id){
peopleMapper.activePeople(id);
}
}
|
3066c31e-be79-4891-a973-6d42a46e632c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-20 23:33:25", "repo_name": "CraigRodewald/CommunityLibraryWebApp", "sub_path": "/src/com/CraigRodewlad/login/LibraryLoginApp.java", "file_name": "LibraryLoginApp.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "41617a91e12f6dccde22c7f781a742dd91c9bf39", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/CraigRodewald/CommunityLibraryWebApp
| 296
|
FILENAME: LibraryLoginApp.java
| 0.295027
|
package com.CraigRodewlad.login;
import java.util.Scanner;
public class LibraryLoginApp {
public static void main(String[] args) {
// Initialize objects
Scanner scan = new Scanner(System.in);
// Initialize variables
String userAnswer;
// Title bar
System.out.println("Bharatiya Community Library Application");
System.out.println("\tMain Page");
// Ask user if they are a member or not
System.out.println("\n\t1-MEMBER LOGIN\n\t2-Not a memeber? Sign up here!\n\n\tEnter a selection:");
userAnswer=scan.next();
// Runs the users selected option
switch (Integer.parseInt(userAnswer)) {
case 1:
CurrentMember currentMember = new CurrentMember();
// Login screen
currentMember.checkLoginPhoneNumber(scan);
// Check login vs database credentials
break;
case 2:
NewMember newMember = new NewMember();
// User sign up page
newMember.createNewMember(scan);
// Enters a first name, last name, and phone number
System.out.println("You have been added to our database");
break;
default:
break;
// Show calendar events
// Loop back to top
}
scan.close();
}
}
|
b48da5c3-466a-43b8-a5ce-e86f7536140d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-23 23:13:26", "repo_name": "sahinbesinci/WebView", "sub_path": "/app/src/main/java/test/com/webview/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "17b399998309cf7d69f1e16a9262e4e45266e7ab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sahinbesinci/WebView
| 190
|
FILENAME: MainActivity.java
| 0.217338
|
package test.com.webview;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.webkit.WebView;
import android.webkit.WebViewClient;
/**
* Created by sahin on 24.08.2016.
*/
public class MainActivity extends AppCompatActivity {
WebView webView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout);
install_elements();
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("https://www.youtube.com/");
}
private void install_elements()
{
webView = (WebView) findViewById(R.id.webView);
}
@Override
public void onBackPressed() {
if (webView.canGoBack()) {
webView.goBack();
} else {
super.onBackPressed();
}
}
}
|
38159f64-a184-44b2-869a-319577424ecd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-08 00:48:16", "repo_name": "huahua495/GeziJoke", "sub_path": "/app/src/main/java/com/example/gezijoke/ui/ShareDialog.java", "file_name": "ShareDialog.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "5acc7c6805de22a3051369b44ce9a7ce522b1db6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/huahua495/GeziJoke
| 187
|
FILENAME: ShareDialog.java
| 0.210766
|
package com.example.gezijoke.ui;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.RecyclerView;
public class ShareDialog extends AlertDialog {
public ShareDialog(@NonNull Context context) {
super(context);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
FrameLayout layout = new FrameLayout(getContext());
RecyclerView gridView = new RecyclerView(getContext());
layout.addView(gridView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
setContentView(layout);
getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
}
}
|
7053826c-030c-464b-aba7-5f517ab4dac7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-07 12:53:06", "repo_name": "MohilTanti/ScarnesDice", "sub_path": "/app/src/main/java/com/example/dell/scarnesdice/Main2Activity.java", "file_name": "Main2Activity.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "9ed4332c9b943097690d0415f010449383f5b79a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MohilTanti/ScarnesDice
| 204
|
FILENAME: Main2Activity.java
| 0.247987
|
package com.example.dell.scarnesdice;
import android.content.Intent;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class Main2Activity extends AppCompatActivity {
FloatingActionButton fb,fb1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
fb=(FloatingActionButton)findViewById(R.id.floatingActionButton);
fb.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent in = new Intent("com.example.dell.scarnesdice.MainActivity");
startActivity(in);
}
});
fb1=(FloatingActionButton)findViewById(R.id.floatingActionButton3);
fb1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent in = new Intent("com.example.dell.scarnesdice.Main3Activity");
startActivity(in);
}
});
}
}
|
ba7fd2a7-b3f9-41b6-a707-81d335a9a8e7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-14 07:38:58", "repo_name": "pankajnegi1893/webview_android", "sub_path": "/app/src/main/java/com/pankaj/webviewapp/Utility.java", "file_name": "Utility.java", "file_ext": "java", "file_size_in_byte": 1220, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "a11656913ccfd2c6a71eeac2db0f78003c0822b8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pankajnegi1893/webview_android
| 208
|
FILENAME: Utility.java
| 0.259826
|
package com.pankaj.webviewapp;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public class Utility {
public static boolean isOnline(Context context) {
ConnectivityManager cm = (ConnectivityManager)context. getSystemService(context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && netInfo.isConnectedOrConnecting()) {
return true;
}
return false;
}
public static void showAlertMessage(Activity context, String strAlertMessage, String title) {
AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.AlertDialogTheme);
builder.setTitle(title);
builder.setMessage(strAlertMessage)
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
AlertDialog alert = builder.create();
alert.show();
//style id
}
}
|
a3986be6-b77e-45d2-aa63-0dcfd97c602f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-21 07:16:59", "repo_name": "GSIL-Monitor/ssd-rpc", "sub_path": "/src/main/java/com/shabro/comm/util/AuthConvert.java", "file_name": "AuthConvert.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 44, "lang": "zh", "doc_type": "code", "blob_id": "9f5b3dc54a3824984c8c5ad3ecec1b937a0d5b53", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/GSIL-Monitor/ssd-rpc
| 349
|
FILENAME: AuthConvert.java
| 0.274351
|
package com.shabro.comm.util;
import java.util.HashMap;
import java.util.Map;
/**
* 转换工具
* Created by vanya on 2017/8/10.
*/
public class AuthConvert {
/**
* 将认证服务器返回结果转为map(login)
* 1.0
* */
public static Map loginResultTomap(String result){
String [] str = result.split(",");
Map map = new HashMap();
map.put(str[0],str[1]);//token
map.put(str[2],str[3]);//用户(app)id
map.put(str[4],str[5]);//用户手机
return map;
}
/**
* 将认证服务器返回结果转为map(check)
* 1.0
* */
public static Map checkResultTomap(String result){
String [] str = result.split(",");
Map map = new HashMap();
map.put(str[0],str[1]);//结果
map.put(str[2],str[3]);//用户手机
map.put(str[4],str[5]);//用户(app)id
map.put(str[6],str[7]);//用户类型(决定token表单的user_id填写的是手机号还是id,默认手机号)
map.put(str[8],str[9]);//商城用户类型,APP可能为空
map.put(str[10],str[11]);//mallUserId 商城用
map.put(str[12],str[13]);//STATUS 200
return map;
}
}
|
50651db4-265d-44b4-9a46-0ce41250d646
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-08 11:04:01", "repo_name": "jonylok/OSSRH-69705", "sub_path": "/vtm-persistence/vtm-persistence-jpa/src/main/java/com/vtm/ddd/persistence/jpa/NamedQueryParser.java", "file_name": "NamedQueryParser.java", "file_ext": "java", "file_size_in_byte": 1306, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "3297a1d8f12eae5059fdf8c4fcb697722a254fbb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jonylok/OSSRH-69705
| 296
|
FILENAME: NamedQueryParser.java
| 0.280616
|
package com.vtm.ddd.persistence.jpa;
import javax.persistence.EntityManager;
/**
* 用于获取命名查询的查询字符串。由于JPA规范不直接支持这一功能,所以要由使用JPA实现的本地API
* 实现它。
<<<<<<< HEAD:vtm-persistence/vtm-persistence-jpa/src/main/java/com/vtm/persistence/jpa/NamedQueryParser.java
* @author
=======
* @author jony
>>>>>>> 9c046b3f97c1e6d4438ccaf4ef5ad67749ca193e:vtm-persistence/vtm-persistence-jpa/src/main/java/com/vtm/ddd/persistence/jpa/NamedQueryParser.java
*/
public abstract class NamedQueryParser {
private EntityManagerProvider entityManagerProvider;
public NamedQueryParser() {
}
public NamedQueryParser(EntityManagerProvider entityManagerProvider) {
this.entityManagerProvider = entityManagerProvider;
}
public void setEntityManagerProvider(EntityManagerProvider entityManagerProvider) {
this.entityManagerProvider = entityManagerProvider;
}
protected EntityManager getEntityManager() {
return entityManagerProvider.getEntityManager();
}
/**
* 获取命名查询的查询字符串
* @param queryName 命名查询的名字
* @return 命名查询的查询字符串
*/
public abstract String getQueryStringOfNamedQuery(String queryName);
}
|
e21165e9-893b-4506-b926-c9a3e787a040
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-27 10:59:23", "repo_name": "AlexDevyatov/BitmasterTestTask", "sub_path": "/app/src/main/java/com/example/myapplication/view/FullScreenImageActivity.java", "file_name": "FullScreenImageActivity.java", "file_ext": "java", "file_size_in_byte": 1184, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "a9c6e54dabd97bec99a39018bfbc0aa06eb977a3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AlexDevyatov/BitmasterTestTask
| 184
|
FILENAME: FullScreenImageActivity.java
| 0.221351
|
package com.example.myapplication.view;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.example.myapplication.R;
public class FullScreenImageActivity extends AppCompatActivity {
private ImageView imageView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_full_screen_image);
imageView = findViewById(R.id.ivFullscreen);
String url = getIntent().getStringExtra("imageUrl");
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getSupportActionBar().hide();
imageView.getLayoutParams().height = ViewGroup.LayoutParams.MATCH_PARENT;
imageView.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
imageView.setAdjustViewBounds(false);
imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
Glide.with(this).load(url).into(imageView);
}
}
|
7d1120ad-ee8b-40af-990a-3ef2f989262c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-07 10:03:02", "repo_name": "mikeliz89/PottumaaJava", "sub_path": "/PottumaaJava/src/Handlers/ExplosionHandler.java", "file_name": "ExplosionHandler.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "78d2897f7a4ae65c10346ee3c9ac34b4d1924d93", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mikeliz89/PottumaaJava
| 221
|
FILENAME: ExplosionHandler.java
| 0.275909
|
package Handlers;
import Entity.Explosion;
import TileMap.TileMap;
import java.awt.*;
import java.util.ArrayList;
public class ExplosionHandler extends BaseHandler {
private ArrayList<Explosion> explosions;
private TileMap groundTileMap;
public ExplosionHandler(TileMap groundTileMap) {
explosions = new ArrayList<>();
this.groundTileMap = groundTileMap;
}
public void draw(Graphics2D g) {
for (Explosion explosion : explosions) {
explosion.setMapPosition((int) groundTileMap.getX(), (int) groundTileMap.getY());
explosion.draw(g);
}
}
public void update() {
updateExplosions();
}
private void updateExplosions() {
for(int i = 0; i < explosions.size(); i++) {
explosions.get(i).update();
if(explosions.get(i).shouldRemove()) {
explosions.remove(i);
i--;
}
}
}
public void addExplosion(Explosion explosion) {
explosions.add(explosion);
}
}
|
42367d6f-ea48-4aea-80ed-ae6a2e43be73
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-15 09:07:18", "repo_name": "myaq1314/commons", "sub_path": "/src/main/java/org/czh/commons/utils/proxy/CglibProxy.java", "file_name": "CglibProxy.java", "file_ext": "java", "file_size_in_byte": 1245, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "ed7064d9104d2c6ea666c95f9d042dbdabe665f0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/myaq1314/commons
| 275
|
FILENAME: CglibProxy.java
| 0.277473
|
package org.czh.commons.utils.proxy;
import lombok.AllArgsConstructor;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
import java.lang.reflect.Method;
/**
* @author : czh
* description :
* date : 2021-07-03
* email 916419307@qq.com
*/
@AllArgsConstructor
public class CglibProxy implements MethodInterceptor {
private final Object target;
// 为目标对象创建一个代理对象
public Object getProxyInstance() {
// 工具类
Enhancer enhancer = new Enhancer();
// 设置父类
enhancer.setSuperclass(target.getClass());
// 设置回调函数
enhancer.setCallback(this);
// 创建子类
return enhancer.create();
}
@Override
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
pre();
Object returnValue = invoke(target, method, args);
post();
return returnValue;
}
protected void pre() {
}
protected Object invoke(Object target, Method method, Object[] args) throws Throwable {
return method.invoke(target, args);
}
protected void post() {
}
}
|
4dc7bfbf-4312-480c-8a54-e49da5ae7344
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-30 02:05:57", "repo_name": "ntnc-se/SpringBoot-Backend", "sub_path": "/src/main/java/com/example/demo/Controller/KPIComponentController.java", "file_name": "KPIComponentController.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "79f43fe18da1ef3fd7cb2d2704d65b7b6cfb9692", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ntnc-se/SpringBoot-Backend
| 200
|
FILENAME: KPIComponentController.java
| 0.262842
|
package com.example.demo.Controller;
import com.example.demo.Model.KPIComponent;
import com.example.demo.Services.ComponentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
@CrossOrigin
@RestController
public class KPIComponentController {
@Autowired
private ComponentService componentService;
@GetMapping("/api/kpi_ids")
public ArrayList<String> getAllKPI_ID(){
return componentService.getAllKPI_Name();
}
@GetMapping("/api/kpi_component_id/{kpi_id}/{component_type}")
public int getKPIComponentID(@PathVariable String kpi_id,
@PathVariable int component_type){
KPIComponent component = componentService.getKPIComponentByID(kpi_id, component_type);
System.out.println(component.getComponent_id());
return component.getComponent_id();
}
}
|
ac4a5cfe-3e36-472b-9ea0-ba8675449463
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-06 20:36:20", "repo_name": "Mladen97/MyApplication1", "sub_path": "/app/src/main/java/com/gosho/android/myapplicationhomework/LoginActivity.java", "file_name": "LoginActivity.java", "file_ext": "java", "file_size_in_byte": 1158, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "895003853af80152fb47bdb3fc683905649763bd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Mladen97/MyApplication1
| 208
|
FILENAME: LoginActivity.java
| 0.240775
|
package com.gosho.android.myapplicationhomework;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class LoginActivity extends AppCompatActivity {
TextView inputYN;
EditText name;
Button btnLogIn;
EditText txtInf;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.input);
inputYN= (TextView) findViewById(R.id.editTxt_name);
name= (EditText) findViewById(R.id.textView);
btnLogIn= (Button) findViewById(R.id.btn_logIn);
txtInf= (EditText) findViewById(R.id.txt_information);
btnLogIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent= new Intent(LoginActivity.this,DetailsActivity.class);
intent.putExtra("name", name.getText().toString());
startActivity(intent);
}
});
}
}
|
028ebabd-78cc-4fb0-a157-ae82707761ff
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-26 05:23:10", "repo_name": "bssathish86/SpringJavaProjects", "sub_path": "/jpa-hibernate-examples/jpa-hibernate-crud-deleting-entity/src/main/java/com/hellokoding/jpa/book/Book.java", "file_name": "Book.java", "file_ext": "java", "file_size_in_byte": 1078, "line_count": 74, "lang": "en", "doc_type": "code", "blob_id": "0616c1f570767ee6528a999014343e3dbcf24be2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bssathish86/SpringJavaProjects
| 252
|
FILENAME: Book.java
| 0.262842
|
package com.hellokoding.jpa.book;
import lombok.*;
import javax.persistence.*;
import java.util.Objects;
@Data
@RequiredArgsConstructor
@NoArgsConstructor
@ToString(exclude = "category")
@Entity
public class Book {
public Book() {
super();
}
public Book(@NonNull String name) {
super();
this.name = name;
}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private @NonNull String name;
@ManyToOne
@JoinColumn
private Category category;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof Book))
return false;
Book book = (Book) o;
return Objects.equals(name, book.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
}
|
9f9fe534-4cc9-4be3-b647-6778292a2e2a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-18 06:18:22", "repo_name": "tornaia/jimglabel", "sub_path": "/src/main/java/com/github/tornaia/jimglabel/gui/domain/Annotation.java", "file_name": "Annotation.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "af7235fb98bd0211f4a0c84349b8dc20cc6eaa1f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tornaia/jimglabel
| 269
|
FILENAME: Annotation.java
| 0.255344
|
package com.github.tornaia.jimglabel.gui.domain;
import java.util.List;
public class Annotation {
private String name;
private long size;
private int width;
private int height;
private List<DetectedObject> objects;
public Annotation() {
}
public Annotation(String name, long size, int width, int height, List<DetectedObject> objects) {
this.name = name;
this.size = size;
this.width = width;
this.height = height;
this.objects = objects;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public long getSize() {
return size;
}
public void setSize(long size) {
this.size = size;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public List<DetectedObject> getObjects() {
return objects;
}
public void setObjects(List<DetectedObject> objects) {
this.objects = objects;
}
}
|
37dcf59b-1fd4-4bed-9902-494410dbc3d9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-09-26 12:49:28", "repo_name": "nzel0121/javaThreadClass", "sub_path": "/src/blockingQueue/BlockingQueueMain.java", "file_name": "BlockingQueueMain.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "59acb8842576ba74af286301f4ebbc78a5708108", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nzel0121/javaThreadClass
| 199
|
FILENAME: BlockingQueueMain.java
| 0.291787
|
package blockingQueue;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
public class BlockingQueueMain {
private static volatile LinkedBlockingQueue<Socket> queue = new LinkedBlockingQueue<Socket>();
private static final int nThreads = 100;
private static final Executor produceExecutor = Executors.newFixedThreadPool(nThreads);
private static final Executor consumerExecutor = Executors.newFixedThreadPool(nThreads);
public static void main(String[] args) throws IOException {
int serverPort = 8888;
ServerSocket serverSocket = new ServerSocket(serverPort);
System.out.println("started server");
while(true){
System.out.println("waiting client request.");
final Socket socket = serverSocket.accept();
produceExecutor.execute(new RequestProducer(socket,queue));
consumerExecutor.execute(new RequestConsumer(queue));
}
}
}
|
226c5665-cf4a-4d46-943d-bf3a03deb831
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-07-07 14:05:51", "repo_name": "jenkinsci/browserstack-integration-plugin", "sub_path": "/src/main/java/com/browserstack/automate/ci/jenkins/observability/ObservabilityCause.java", "file_name": "ObservabilityCause.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "98c5b4563186a235f87448e3db68655f0a79818e", "star_events_count": 15, "fork_events_count": 39, "src_encoding": "UTF-8"}
|
https://github.com/jenkinsci/browserstack-integration-plugin
| 245
|
FILENAME: ObservabilityCause.java
| 0.252384
|
package com.browserstack.automate.ci.jenkins.observability;
import hudson.model.Cause;
import net.sf.json.JSONObject;
import javax.annotation.Nonnull;
import static com.browserstack.automate.ci.common.BrowserStackEnvVars.BROWSERSTACK_RERUN;
import static com.browserstack.automate.ci.common.BrowserStackEnvVars.BROWSERSTACK_RERUN_TESTS;
/**
* Indicates that a build was started because of one or more Observability params.
*/
public class ObservabilityCause extends Cause {
private JSONObject params;
private String tests;
private String reRun;
public ObservabilityCause(@Nonnull JSONObject params) {
this.tests = params.getString(BROWSERSTACK_RERUN_TESTS);
this.reRun = params.getString(BROWSERSTACK_RERUN);
this.params = params;
}
@Nonnull
public JSONObject getParams() {
return params;
}
public String getTests() {
return tests;
}
public String getReRun() {
return reRun;
}
/** {@inheritDoc} */
@Override
public String getShortDescription() {
return "Observability Params: " + params.toString();
}
}
|
57ee47a0-2218-4d80-bb62-ba2d60d5f55f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-08-02 09:43:28", "repo_name": "huhuhan/yh-cloud", "sub_path": "/yh-common/yh-common-auth/src/main/java/com/yh/common/auth/handler/flux/FluxAuthenticationEntryPoint.java", "file_name": "FluxAuthenticationEntryPoint.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "46c0530f87c03fefeed92445c3c040b612479338", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/huhuhan/yh-cloud
| 193
|
FILENAME: FluxAuthenticationEntryPoint.java
| 0.188324
|
package com.yh.common.auth.handler.flux;
import com.yh.common.auth.util.TempUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.server.ServerAuthenticationEntryPoint;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
/**
* 未登录访问
*
* @author yanghan
* @date 2020/12/8
*/
//@Component
public class FluxAuthenticationEntryPoint implements ServerAuthenticationEntryPoint {
@Override
public Mono<Void> commence(ServerWebExchange exchange, AuthenticationException e) {
ServerHttpResponse response = exchange.getResponse();
response.setStatusCode(HttpStatus.valueOf(HttpStatus.UNAUTHORIZED.value()));
String msg = "未登陆或令牌失效,请重新登录!";
return TempUtils.responseWriter(response,
TempUtils.tempResult(HttpStatus.UNAUTHORIZED.value(), msg, e.getMessage(), null));
}
}
|
1bbbcc78-e8ee-42ac-aabe-90c7f53bd856
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-25 05:42:17", "repo_name": "sundarkk/Imagefetch", "sub_path": "/app/src/main/java/com/vikas/imagesendingfetching/MyAdapter.java", "file_name": "MyAdapter.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "34f9428c44d6af867de60acfca7029155c1bed8a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sundarkk/Imagefetch
| 198
|
FILENAME: MyAdapter.java
| 0.284576
|
package com.vikas.imagesendingfetching;
import android.app.Activity;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
class MyAdapter extends ArrayAdapter<String> {
Activity activity;
String [] imageurl;
public MyAdapter(MainActivity mainActivity, int item, String[] imageurl) {
super(mainActivity,item,imageurl);
this.activity=mainActivity;
this.imageurl=imageurl;
}
@Override
public int getCount() {
return super.getCount();
}
@Nullable
@Override
public View getView(int position, View convertView, ViewGroup parent) {
convertView=LayoutInflater.from(activity.getApplicationContext()).inflate(R.layout.item,parent,false);
ImageView imageView=convertView.findViewById(R.id.image);
Glide.with(activity).load(imageurl[position]).into(imageView);
return convertView;
}
}
|
c81a7bcb-dadc-45d2-ad56-c6be986be508
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-09 13:52:04", "repo_name": "doringraf/fall-2019-selenium-project", "sub_path": "/src/test/java/com/cybertek/tests/office_hours/GoogleHoverTest.java", "file_name": "GoogleHoverTest.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "55ab10466f648fa861837aae5035cc00090b552d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/doringraf/fall-2019-selenium-project
| 231
|
FILENAME: GoogleHoverTest.java
| 0.267408
|
package com.cybertek.tests.office_hours;
import com.cybertek.utilities.WebDriverFactory;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class GoogleHoverTest {
WebDriver driver;
@BeforeMethod
public void beforeMethod() {
driver = WebDriverFactory.getDriver("chrome");
driver.get("https://google.com");
}
@AfterMethod
public void afterTest() {
driver.quit();
}
@Test
public void test(){
Actions actions = new Actions(driver);
WebElement button = driver.findElement(By.id("gbqfbb"));
actions.pause(1000).
moveToElement(button).pause(1000).
build().perform();
String notUnExpected = "I'm Feeling lucky";
String actual = button.getAttribute("value");
System.out.println("Actual: "+actual);
Assert.assertNotEquals(actual,notUnExpected);
}
}
|
fe824d11-eb05-462f-ba5c-928bab71a0ba
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-09 11:47:30", "repo_name": "zxh197811/-a", "sub_path": "/movie-api-hou/src/main/java/com/fh/service/impl/PermissionServiceImpl.java", "file_name": "PermissionServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "4403fe8e9a8701146c52b5e0ad3b355ff42ed97b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zxh197811/-a
| 213
|
FILENAME: PermissionServiceImpl.java
| 0.276691
|
package com.fh.service.impl;
import com.fh.mapper.PermissionMapper;
import com.fh.model.Permission;
import com.fh.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class PermissionServiceImpl implements PermissionService {
@Autowired(required = false)
private PermissionMapper permissionMapper;
@Override
public List<Permission> selectPermission() {
return permissionMapper.selectList(null);
}
@Override
public void addPermission(Permission permission) {
permission.setCreateDate(new Date());
permissionMapper.insert(permission);
}
@Override
public Permission selectPermissionById(Integer id) {
return permissionMapper.selectById(id);
}
@Override
public void updatePermission(Permission permission) {
permission.setUpdateDate(new Date());
permissionMapper.updateById(permission);
}
@Override
public void deleteAllPermission(List<Integer> ids) {
permissionMapper.deleteBatchIds(ids);
}
}
|
955ddf3d-0c20-4623-bdfd-cbf22fe46730
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-03 20:07:08", "repo_name": "michaelmsinclair/Ja-Tor", "sub_path": "/src/main/java/org/sinclair/jator/view/SeaView.java", "file_name": "SeaView.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "387eb6b6d0d5cdaa48e7fe8eaa3656729540629d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/michaelmsinclair/Ja-Tor
| 259
|
FILENAME: SeaView.java
| 0.283781
|
/*
* 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 org.sinclair.jator.view;
import org.sinclair.jator.model.Sea;
import org.sinclair.jator.model.SeaCreature;
/**
*
* @author michael
*/
public class SeaView {
private final Sea sea;
/**
*
* @param sea
*/
public SeaView(Sea sea) {
this.sea = sea;
}
public void display() {
int maxX = sea.getMaxX();
int maxY = sea.getMaxY();
SeaCreature creature;
for (int y = 0; y < maxY; y++) {
String seaRow = "";
for (int x = 0; x < maxX; x++) {
creature = this.sea.getCell(x, y);
if (creature == null) {
seaRow += " ";
} else if (!creature.isAlive()) {
seaRow += " ";
} else {
seaRow += creature.getShape();
}
}
System.out.println(String.format("%2d %s", y, seaRow));
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.