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
|
|---|---|---|---|---|---|---|
81ef050d-592b-454d-8c60-a37749b1784b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-01 13:50:55", "repo_name": "dimensionl3ss/Login-System", "sub_path": "/src/java/com/loginBase/Login.java", "file_name": "Login.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "e644c9398b00e35c4dd17cbe666430b7a8d06f90", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dimensionl3ss/Login-System
| 194
|
FILENAME: Login.java
| 0.242206
|
package com.loginBase;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class Login extends HttpServlet {
public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException {
String em = request.getParameter("email");
String pass = request.getParameter("password");
int flag=0;
System.out.println(em+" "+pass);
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Verify validate=new Verify();
String person=validate.check(em, pass);
if(person!=null){
HttpSession session = request.getSession(true);
session.setAttribute("name",person);
response.sendRedirect("home.jsp");
}
else{
out.print(
"<script lang='javascript'>"
+ "alert('Invalid username or password');"+
"</script>"
);
out.print("<meta http-equiv='refresh' content='0;URL=login.html'>");
}
}
}
|
b31d9ead-a505-41a7-9051-a1e51e078ca8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-12 22:09:44", "repo_name": "akhfa/IF4031-tweetCassandra", "sub_path": "/tweetCassandra/src/model/Friend.java", "file_name": "Friend.java", "file_ext": "java", "file_size_in_byte": 1157, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "ce150264863e370c88089796800da3a295d814c4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/akhfa/IF4031-tweetCassandra
| 218
|
FILENAME: Friend.java
| 0.262842
|
/*
* 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 model;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.querybuilder.Insert;
import com.datastax.driver.core.querybuilder.QueryBuilder;
/**
*
* @author akhfa
*/
public class Friend {
private String username;
private String friend;
private long timestamp;
public Friend(String _username, String _friend, long _timestamp)
{
username = _username;
friend = _friend;
timestamp = _timestamp;
}
public void save()
{
Session session = Connection.getSession();
Insert insert = QueryBuilder.insertInto(Connection.getKeySpace(), "friends")
.value("username", username)
.value("friend", friend)
.value("since", timestamp);
ResultSet result = session.execute(insert.toString());
Connection.close();
}
}
|
c8c580f7-22dd-4327-99a7-dc98411c259e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-25 09:47:59", "repo_name": "yaozhoucn/javaweb_smbms", "sub_path": "/src/main/java/com/yaozhou/servlet/log/Log4jInit.java", "file_name": "Log4jInit.java", "file_ext": "java", "file_size_in_byte": 1111, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "d36ee7a70e4e765e820683613acf3b6cc60e6695", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yaozhoucn/javaweb_smbms
| 221
|
FILENAME: Log4jInit.java
| 0.216012
|
package com.yaozhou.servlet.log;
import org.apache.log4j.PropertyConfigurator;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Created by WXHang on HANG at 2021/6/25 9:12
* Desc:
*/
public class Log4jInit extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doGet(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doPost(req, resp);
}
@Override
public void init() throws ServletException {
super.init();
String prefix = getServletContext().getRealPath("/");
String file = getInitParameter("log4j-init-file");
if (file != null) {
System.out.println("read log4j.properties:"+prefix + file);
PropertyConfigurator.configure(prefix + file);
}
}
}
|
bfe3ecb9-2d5a-435c-b75e-0fcf98870971
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-15 20:00:11", "repo_name": "fernandohfs/course", "sub_path": "/src/main/java/com/luizalabs/course/business/impl/UserBusinessImpl.java", "file_name": "UserBusinessImpl.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "6a0c64650f6fa5e1c33d74135d3a0ab571f63d49", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fernandohfs/course
| 240
|
FILENAME: UserBusinessImpl.java
| 0.282196
|
package com.luizalabs.course.business.impl;
import com.luizalabs.course.business.UserBusiness;
import com.luizalabs.course.dbo.models.User;
import com.luizalabs.course.dbo.repositories.UserRepository;
import com.luizalabs.course.v1.dto.response.UserResponseDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Optional;
@Service
@Transactional
public class UserBusinessImpl implements UserBusiness {
private UserRepository userRepository;
@Autowired
public UserBusinessImpl(final UserRepository userRepository) {
this.userRepository = userRepository;
}
@Override
public Optional<List<UserResponseDto>> findAll() {
List<User> users = userRepository.findAll();
List<UserResponseDto> usersDto = UserResponseDto.usersToUsersDto(users);
return Optional.of(usersDto);
}
@Override
public Optional<UserResponseDto> findById(Long id) {
Optional<User> user = userRepository.findById(id);
UserResponseDto userDto = UserResponseDto.userToUserDto(user.orElse(new User()));
return Optional.of(userDto);
}
}
|
bb087fbb-297e-4342-a1cf-52263ac126d1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-27 13:41:55", "repo_name": "domitea/NavigationUHK", "sub_path": "/app/src/main/java/uhk/kikm/navigationuhk/dataLayer/BleScan.java", "file_name": "BleScan.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "81d33cdc63359483e4c8682c8f77526f939a9779", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/domitea/NavigationUHK
| 277
|
FILENAME: BleScan.java
| 0.235108
|
package uhk.kikm.navigationuhk.dataLayer;
import java.util.Arrays;
/**
* Datova trida obsahujici informace o zaznamenanem BLE zarizeni
* Dominik Matoulek 2015
*/
public class BleScan {
int rssi;
byte[] scanRecord;
String address;
public BleScan() {
}
public BleScan(int rssi, byte[] scanRecord, String address) {
this.rssi = rssi;
this.scanRecord = scanRecord;
this.address = address;
}
@Override
public String toString() {
return "BleScan{" +
"rssi=" + rssi +
", scanRecord=" + Arrays.toString(scanRecord) +
", address='" + address + '\'' +
'}';
}
public int getRssi() {
return rssi;
}
public void setRssi(int rssi) {
this.rssi = rssi;
}
public byte[] getScanRecord() {
return scanRecord;
}
public void setScanRecord(byte[] scanRecord) {
this.scanRecord = scanRecord;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
|
b657ea9f-1d79-436e-8b67-fb915bf93eb3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-27 16:17:37", "repo_name": "MilanUzelac/products-order-kubernetes-test", "sub_path": "/products-service/src/main/java/com/example/productsservice/Controller.java", "file_name": "Controller.java", "file_ext": "java", "file_size_in_byte": 1182, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "adbd6cf67ffa9fe1ec94e6ad9bf36936df05210e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MilanUzelac/products-order-kubernetes-test
| 213
|
FILENAME: Controller.java
| 0.246533
|
package com.example.productsservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List;
@RestController
public class Controller {
@Autowired
ProductRepository productRepository;
public Controller(ProductRepository personRepository) {
this.productRepository = personRepository;
}
@GetMapping
public String test(){
return "Raddiii";
}
@GetMapping("/saveMongo")
public String saveMongo(){
productRepository.saveAll(Arrays.asList(new Product(1,"Samsung S3",200),new Product(2,"Iphone 10",700)));
return "Products have been successfully saved!";
}
@RequestMapping(method = RequestMethod.GET,value = "/getProducts",produces = MediaType.APPLICATION_JSON_VALUE)
public List<Product> getProducts(){
return productRepository.findAll();
}
}
|
7f8c8559-2393-4a4d-b3dd-8b0157d7a4ee
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-28T02:09:47", "repo_name": "yongtaekjun/VendingMachine-CPP", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1100, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "4549717bed86272a3195d5c8a15b7cb81fb5a35e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yongtaekjun/VendingMachine-CPP
| 218
|
FILENAME: README.md
| 0.258326
|
# VendingMachine-CPP
VendingMachine with C++
This is for beginer level programmer who start to programming with C++ or C#
The students must have their own object of the program.
------------------------------------------------------------
What is your image ( requirements ) fo Vending Machine.
How the Vanding Machine works.
The student will learn
------------------------------------------------------------
How to create Windows Form Application with .Net Framework.
How to define class member variable.
How to handle list ( create, find, compare, etc )
for each loop statement with continue, break, return
How to combine programming variable to control object which is predefined
How to assign numeric variable to string variable
I have learned the managed class concept ( I never here before .. March 2021 )
It looks like pointer, but the GC will remove the object instead of de-construct -- h------m
It looks not used to .... but looks cool.
I will re-programming this using WPF ( Windows Presentation Framework? ) and tuple in future.
-- I will re-programming it with C# first.
|
fadfebc4-c853-4970-9597-463231b004da
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-11-17 13:05:45", "repo_name": "lenguyenthanh/Face-Memo", "sub_path": "/FaceMemo/app/src/main/java/lenguyenthanh/facememo/util/StorageUtil.java", "file_name": "StorageUtil.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "e681e2587bd3c223164db6b892bf2ac7c49cf050", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lenguyenthanh/Face-Memo
| 240
|
FILENAME: StorageUtil.java
| 0.272025
|
package lenguyenthanh.facememo.util;
import android.content.Context;
import android.os.Environment;
import java.io.File;
/**
* Created by lenguyenthanh on 11/14/14.
*/
public class StorageUtil {
public static final String PHOTO_FOLDER = "/facememo";
public static final String BLURR_PHOTO_FOLDER = "/facememo_blurr";
private static final String LOCAL_PATH = Environment.getExternalStorageDirectory().getAbsolutePath();
public static String getRootDirectory(Context aContext, String name) {
File file = aContext.getExternalCacheDir();
String folderName;
if(file == null)
folderName = LOCAL_PATH + name;
else folderName = file.toString() + name;
File folder = new File(folderName);
if(!folder.exists()){
folder.mkdir();
}
return folderName + "/";
}
public static String getNormalRootDirectory(Context aContext) {
return getRootDirectory(aContext, PHOTO_FOLDER);
}
public static String getBlurrRootDirectory(Context aContext) {
return getRootDirectory(aContext, BLURR_PHOTO_FOLDER);
}
}
|
1323b352-96b9-44e1-9cdd-2bf744d1878a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-06 10:22:09", "repo_name": "znlccy/oa", "sub_path": "/src/main/java/com/youda/oa/controller/MongoController.java", "file_name": "MongoController.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "02c8bbe07df11431c9263aa1e7d46227f46f6e6a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/znlccy/oa
| 248
|
FILENAME: MongoController.java
| 0.264358
|
package com.youda.oa.controller;
import com.youda.oa.model.Baike;
import org.apache.commons.logging.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
public class MongoController {
private static final Logger logger = LoggerFactory.getLogger(MongoController.class);
@Autowired
MongoTemplate mongoTemplate;
@RequestMapping(value = "/baike/{name}")
public Baike getUser(@PathVariable String name) {
logger.info("--------使用mongodb--------");
Baike baike = mongoTemplate.findById(name, Baike.class);
logger.info(baike.getId());
return baike;
}
@GetMapping("/query/bad/{bad}")
public List<Baike> queryBad(@PathVariable int bad) {
Criteria criteria = Criteria.where("comment.bad").gt(bad);
List<Baike> list = mongoTemplate.find(Query.query(criteria), Baike.class);
return list;
}
}
|
5c9d940a-013f-4712-8982-8dc79dcba1a3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-23 09:11:33", "repo_name": "phoenix-cluster/ph-enhancer-web-service", "sub_path": "/src/main/java/org/ncpsb/phoenixcluster/enhancer/webservice/model/ClusterRowMapper.java", "file_name": "ClusterRowMapper.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 21, "lang": "en", "doc_type": "code", "blob_id": "565f2f898ae332db3e9babcffe56c69623e1b6d8", "star_events_count": 0, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/phoenix-cluster/ph-enhancer-web-service
| 214
|
FILENAME: ClusterRowMapper.java
| 0.286968
|
package org.ncpsb.phoenixcluster.enhancer.webservice.model;
import org.ncpsb.phoenixcluster.enhancer.webservice.utils.ClusterUtils;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ClusterRowMapper implements RowMapper{
public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
Cluster cluster = new Cluster();
cluster.setId(rs.getString("CLUSTER_Id"));
cluster.setSpecCount(rs.getInt("N_SPEC"));
cluster.setRatio(rs.getFloat("CLUSTER_RATIO"));
cluster.setSpectraTitles(ClusterUtils.getStringListFromString(rs.getString("SPECTRA_TITLES"),"\\|\\|"));
cluster.setConsensusMz(ClusterUtils.getFloatListFromString(rs.getString("CONSENSUS_MZ"), ","));
cluster.setConsensusIntens(ClusterUtils.getFloatListFromString(rs.getString("CONSENSUS_INTENS"), ","));
cluster.setSequencesRatios(rs.getString("SEQUENCES_RATIOS"));
return cluster;
}
}
|
9be5f0ff-93f8-4e5b-9c71-64203460b594
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2005-03-10 02:58:09", "repo_name": "BackupTheBerlios/ccaustin", "sub_path": "/calvary-cms/main/src/cms/java/org/calvaryaustin/cms/slide/KillLockCommand.java", "file_name": "KillLockCommand.java", "file_ext": "java", "file_size_in_byte": 1158, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "96c0559fa2887a31b79ef258cdc044e26100778b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/BackupTheBerlios/ccaustin
| 243
|
FILENAME: KillLockCommand.java
| 0.290981
|
package org.calvaryaustin.cms.slide;
import org.apache.slide.common.*;
import org.apache.slide.structure.*;
/**
* Kills an existing lock on a resource
* @author jhigginbotham
*/
public class KillLockCommand extends AbstractSlideCommand
{
/**
* Initialize the command that is to be performed
* @param slideToken the client token to use for the work
* @param namespace the namespace token to perform the work
* @param uriToUnlock the URI to the resource to unlock
*/
public KillLockCommand(SlideToken slideToken, NamespaceAccessToken namespace, String uriToUnlock)
{
super(slideToken, namespace);
this.uriToUnlock = uriToUnlock;
}
public void execute() throws SlideException
{
// Prevent dirty reads
slideToken.setForceStoreEnlistment(true);
NamespaceConfig namespaceConfig = namespace.getNamespaceConfig();
SubjectNode unlockSubject = (SubjectNode) structure.retrieve(slideToken, uriToUnlock);
lock.kill(slideToken, unlockSubject);
}
/**
* Lock subject.
*/
private String uriToUnlock;
}
|
7a8d36eb-9578-4966-81d7-7abdb25e6659
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-05-23 18:48:54", "repo_name": "HW-Lee/AudioWorker", "sub_path": "/app/src/main/java/com/google/audioworker/functions/audio/voip/VoIPEventFunction.java", "file_name": "VoIPEventFunction.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "8a14a5c791163300b25ce9ad7f44c3471f62fc2b", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/HW-Lee/AudioWorker
| 212
|
FILENAME: VoIPEventFunction.java
| 0.239349
|
package com.google.audioworker.functions.audio.voip;
import com.google.audioworker.functions.audio.record.RecordEventFunction;
import com.google.audioworker.utils.Constants;
public class VoIPEventFunction extends VoIPFunction {
private final static String TAG = Constants.packageTag("VoIPEventFunction");
private RecordEventFunction mReference = new RecordEventFunction();
@Override
public String[] getAttributes() {
return mReference.getAttributes();
}
@Override
public Parameter[] getParameters() {
return mReference.getParameters();
}
@Override
public boolean isValueAccepted(String attr, Object value) {
return mReference.isValueAccepted(attr, value);
}
@Override
public void setParameter(String attr, Object value) {
mReference.setParameter(attr, value);
}
public String getDetectEvent() {
return mReference.getDetectEvent();
}
public String getClassHandle() {
return mReference.getClassHandle();
}
}
|
b229ae09-fee0-4680-bfd9-bb093928d1c0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-16 04:53:06", "repo_name": "Phatnguyen27/Locate_Me", "sub_path": "/app/src/main/java/com/example/locateme/ForgotActivity.java", "file_name": "ForgotActivity.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "248ddf08d622caa5ea0259e6a0cb8995a8f42572", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Phatnguyen27/Locate_Me
| 200
|
FILENAME: ForgotActivity.java
| 0.228156
|
package com.example.locateme;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
public class ForgotActivity extends AppCompatActivity {
EditText mEdit_newPassword,mEdit_rePassword;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.change_passsword);
mEdit_newPassword = (EditText) findViewById(R.id.mEdit_Password);
mEdit_rePassword = (EditText) findViewById(R.id.mEdit_rePassword);
}
public void changingOnClick(View v){
String newPassword = mEdit_newPassword.getText().toString();
String reNewPassword = mEdit_rePassword.getText().toString();
if(mEdit_newPassword.equals(reNewPassword)){
Toast.makeText(this,"Your password is changed",Toast.LENGTH_LONG).show();
}
Intent changing = new Intent(this,LoginActivity.class);
this.startActivity(changing);
}
}
|
be80fb68-6d15-4443-814f-fe389495e07a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-10-14T03:10:28", "repo_name": "Personaeyeingthecog/Water-and-Light", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1135, "line_count": 13, "lang": "en", "doc_type": "text", "blob_id": "c288788a5d0a255cad2860ff1cfbccf4011724fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Personaeyeingthecog/Water-and-Light
| 252
|
FILENAME: README.md
| 0.249447
|
# Water-and-Light
Prototype_θ1
Strangely
THere is little light in the chamber of the vertebrate convection hoze. I learnt that wrestling was one of the earliest combat sport in human history ever since developed in 700 bc Greece.
Swimming
Swimming is a beautiful art of movement. through developing the kindred relationship with water, understanding your body, feeling like that their are talking to eachother. Everytime an action is done, there is reaction from the other body. The two are the kindred spirit. The strange paradox is that the action is basicly a series of processes of wrestling against the entity of water. However what water does is more than just backing the force, it seems to help you fight itself. In so creating the propelling current that drive your command yonder. you can take a stride, promanade through the microcosmic molecule, but you can also force apart their inter-quantential gravity and create your own mark. In a way, this is the closest relation, while we are out of air, land. There is still water, water is where we were once born, and we are destined to return to it.
Water is our home.
|
9584e892-d55f-4491-83cb-f23e82a12f97
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-29 13:49:18", "repo_name": "bilel2015/GestionContacts-Back", "sub_path": "/src/main/java/org/sid/GestionContactApplication.java", "file_name": "GestionContactApplication.java", "file_ext": "java", "file_size_in_byte": 1157, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "7e4ca9232da31e85841b4b17e4919694746b2903", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bilel2015/GestionContacts-Back
| 298
|
FILENAME: GestionContactApplication.java
| 0.294215
|
package org.sid;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import org.sid.dao.ContactRepository;
import org.sid.entities.Contact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class GestionContactApplication {
@Autowired
private ContactRepository contactRepository;
public static void main(String[] args) {
SpringApplication.run(GestionContactApplication.class, args);
}
@Autowired
public void run(String... arg0) throws Exception {
DateFormat df= new SimpleDateFormat("dd/MM/yyyy");
contactRepository.save(new Contact("Bilel", "Laifi", df.parse("31/01/1992"), "bilelelaifi@gmail.com", 676981437, "biel.png"));
contactRepository.save(new Contact("Ahmed", "Laifi", df.parse("25/03/1998"), "ahmed@gmail.com", 234545456, "biel.png"));
contactRepository.save(new Contact("aaaa", "bbb", df.parse("02/01/1990"), "bilelelaifi@gmail.com", 676981437, "biel.png"));
contactRepository.findAll().forEach(c->{
System.out.println(c.getNom());
});
}
}
|
8e2a3889-6c0b-4800-9890-cc96775915d2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-14 09:37:30", "repo_name": "lazy-ape/ComponentFramework", "sub_path": "/greedywallet/src/main/java/com/utlife/user/greedywallet/action/SecondActivityAction.java", "file_name": "SecondActivityAction.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "8ac111dd82af6b370e8b5840cb45e35932f288fa", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lazy-ape/ComponentFramework
| 257
|
FILENAME: SecondActivityAction.java
| 0.264358
|
package com.utlife.user.greedywallet.action;
import android.content.Context;
import android.content.Intent;
import com.linked.annotion.Action;
import com.utlife.commonbeanandresource.bean.ProcessConfig;
import com.utlife.routercore.UtlifeAction;
import com.utlife.routercore.router.RouterRequest;
import com.utlife.routercore.router.UtlifeActionResult;
import com.utlife.user.greedywallet.SecondActivity;
/**
* Created by xuqiang on 2017/4/6.
*/
@Action(processName = ProcessConfig.MAIN_PROCESS_NAME,providerName = "greedywallet")
public class SecondActivityAction implements UtlifeAction {
@Override
public boolean isAsync(Context context, RouterRequest routerRequest) {
return false;
}
@Override
public UtlifeActionResult invoke(Context context, RouterRequest routerRequest) {
Intent i = new Intent(context, SecondActivity.class);
context.startActivity(i);
return new UtlifeActionResult.Builder().code(UtlifeActionResult.CODE_SUCCESS).msg("").build();
}
@Override
public String getName() {
return "second";
}
@Override
public Class<?> getParamBean() {
return Object.class;
}
}
|
11232986-3491-402b-ab1d-8348985d1b29
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-19 08:05:25", "repo_name": "sydmobile/studyproject", "sub_path": "/app/src/main/java/com/study/study_module/viewstub/ViewStubActivity.java", "file_name": "ViewStubActivity.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "0e7fc962897bf08c9a633ca6a2b12cd6f29149e1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sydmobile/studyproject
| 206
|
FILENAME: ViewStubActivity.java
| 0.239349
|
package com.study.study_module.viewstub;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.view.ViewStub;
import android.widget.TextView;
import com.study.R;
import com.study.base.BaseActivity;
import androidx.annotation.Nullable;
public class ViewStubActivity extends BaseActivity {
// viewStub 指定内容
private TextView tvViewStubContent;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected int layoutId() {
return R.layout.activity_viewstub;
}
@SuppressLint("SetTextI18n")
public void initView() {
TextView textView = findViewById(R.id.tv);
final ViewStub viewStub = findViewById(R.id.vs);
textView.setOnClickListener(v -> {
View view = viewStub.inflate();
tvViewStubContent = view.findViewById(R.id.tv_common);
tvViewStubContent.setText("ViewStub must have a non-null ViewGroup viewParent");
});
}
}
|
7b33a2cb-4e43-490c-b0c8-e18b23f3f8ce
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-11 13:48:52", "repo_name": "Dongjiafeng/homeku", "sub_path": "/JAVASE/day22/src/com/lanou3g/study/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "242fa48c9922cd6e600bdf4c61ea30dbb87dbc26", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Dongjiafeng/homeku
| 261
|
FILENAME: User.java
| 0.240775
|
package com.lanou3g.study;
public class User {
private String uname;
private String loc;
private int age;
private int uid;
public User() {
}
public User(String uname, String loc, int age, int uid) {
this.uname = uname;
this.loc = loc;
this.age = age;
this.uid = uid;
}
public String getUname() {
return uname;
}
public void setUname(String uname) {
this.uname = uname;
}
public String getLoc() {
return loc;
}
public void setLoc(String loc) {
this.loc = loc;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public int getId() {
return uid;
}
public void setId(int id) {
this.uid = uid;
}
@Override
public String toString() {
return "User{" +
"uname='" + uname + '\'' +
", loc='" + loc + '\'' +
", age=" + age +
", id=" + uid +
'}';
}
}
|
6eed5fb8-f488-44d4-be77-98c14a7a610f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-07 03:21:33", "repo_name": "Emarik/Networking_Project", "sub_path": "/KimmSchedule/KimmSchedule/src/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "14dbb65ba5c4d5df02169573012856228dbadc75", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Emarik/Networking_Project
| 224
|
FILENAME: Main.java
| 0.281406
|
import java.io.*;
import java.util.*;
import java.net.*;
import javax.swing.JFrame;
import javax.swing.JTextField;
public class Main {
public static void main(String[] args) throws IOException {
JTextField textField = new JTextField();
JFrame jframe = new JFrame();
jframe.add(textField);
jframe.setSize(400, 350);
jframe.setVisible(true);
jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ServerSocket server_socket = new ServerSocket(8788);
while(true) {
Socket s = null;
try {
s = server_socket.accept();
DataInputStream dis = new DataInputStream(s.getInputStream());
DataOutputStream dos = new DataOutputStream(s.getOutputStream());
//boolean var = dis.readBoolean();
//DataInputStream dis = null;
//DataOutputStream dos = null;
Thread t = new Gym_Server(s,dis,dos);
t.start();
}
catch (Exception e) {
//s.close();
e.printStackTrace();
}
}
}
}
|
2827576d-0931-4dca-be4f-1e3f9c05ece3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-23 13:37:23", "repo_name": "chuzhonglingyan/springboot-learn", "sub_path": "/web-demo/src/main/java/com/yuntian/webdemo/sys/controller/MainErrorController.java", "file_name": "MainErrorController.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "a724cc73b7cefbabae04bb49c753eae91112a0c9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/chuzhonglingyan/springboot-learn
| 261
|
FILENAME: MainErrorController.java
| 0.23231
|
package com.yuntian.webdemo.sys.controller;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
/**
* @ Author :guangleilei.
* @ Date :Created in 14:10 2018/11/13
* @ Description:${自定义错误页面}
* @author guangleilei
*/
@Controller
public class MainErrorController implements ErrorController {
private static final String PATH = "/error";
@RequestMapping(PATH)
public String handleError(HttpServletRequest request) { //获取statusCode:401,404,500
Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code");
if (statusCode == 401) {
return "error/401";
} else if (statusCode == 404) {
return "error/404";
} else if (statusCode == 403) {
return "error/403";
} else {
return "error/500";
}
}
@Override
public String getErrorPath() {
return PATH;
}
}
|
d717ad0b-380f-4fe1-8854-ace47663b731
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-20 12:53:23", "repo_name": "ott23/agrocalculator-restnode", "sub_path": "/src/main/java/net/tngroup/acrestnode/web/security/filters/AuthenticationEntryPointFilter.java", "file_name": "AuthenticationEntryPointFilter.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "5338989e7a4914b2eeabd4de1af0715fd8156e35", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ott23/agrocalculator-restnode
| 175
|
FILENAME: AuthenticationEntryPointFilter.java
| 0.228156
|
package net.tngroup.acrestnode.web.security.filters;
import io.jsonwebtoken.Jwts;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import static net.tngroup.acrestnode.web.security.TokenData.REQUEST_HEADER_STRING;
@Component
public class AuthenticationEntryPointFilter implements AuthenticationEntryPoint {
@Override
public void commence(HttpServletRequest request,
HttpServletResponse response,
AuthenticationException authException) throws IOException {
try {
String token = request.getHeader(REQUEST_HEADER_STRING);
Jwts.parser().parse(token);
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized");
} catch (Exception e) {
response.sendError(HttpServletResponse.SC_SEE_OTHER, "Token expired");
}
}
}
|
1438403c-9262-4099-868c-c0d1bb793efd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2013-05-20T22:47:59", "repo_name": "haus/releng-preso", "sub_path": "/two/where_we_are.md", "file_name": "where_we_are.md", "file_ext": "md", "file_size_in_byte": 1002, "line_count": 39, "lang": "en", "doc_type": "text", "blob_id": "b1329d3106ddecbbcbd77f44fba449a701792a17", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/haus/releng-preso
| 271
|
FILENAME: where_we_are.md
| 0.250913
|
!SLIDE bullets incremental
# Where we are #
## (Two months ago, circa Q1 2013) ##
* The same tasks between projects
* On commit package builds
* One release workflow
* Self-service packages for developers
!SLIDE bullets incremental
# Uniform Tasks #
* Run `rake package:tar` for a tar.
* Run `rake package:deb` for a deb.
(wraps cowbuilder and pbuilder)
* Run `rake package:rpm` for an rpm.
(wraps mock and rpmbuild)
!SLIDE bullets incremental
# One Workflow #
* Checkout the tag to ship
* Run `rake pl:jenkins:uber_build` (should automatically have happened via jenkins)
* Run `rake pl:jenkins:uber_ship`
* Get a beer
* Send a release announcement
!SLIDE bullets incremental
## Occasionally devs like using real packages ##
# That's awesome! But how do they get them? #
* Checkout the commit they want
* Run `rake pl:jenkins:uber_build` (should automatically have happened via jenkins)
* Run `rake pl:jenkins:retrieve`
!SLIDE bullets incremental
# Did that sound familiar? #
* (it should)
|
31ece166-6ce2-497f-a590-835dd1b33218
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-12 21:09:22", "repo_name": "AnxheloGripshi/library-application-thymeleaf-spring-boot", "sub_path": "/src/main/java/com/library/controllers/CategoryController.java", "file_name": "CategoryController.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "312e0e7c7006e159b00416273aef144a1fa291f7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AnxheloGripshi/library-application-thymeleaf-spring-boot
| 182
|
FILENAME: CategoryController.java
| 0.259826
|
package com.library.controllers;
import com.library.dto.CategoryDTO;
import com.library.services.CategoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Controller
@RequiredArgsConstructor
@RequestMapping("/api")
public class CategoryController {
private final CategoryService categoryService;
@GetMapping("/categories")
public ResponseEntity<List<CategoryDTO>> getAllCategories() {
return ResponseEntity.ok(categoryService.getAllCategories());
}
@PostMapping("/create-category")
public ResponseEntity<CategoryDTO> createCategory(@RequestBody CategoryDTO categoryDTO) {
return ResponseEntity.ok(categoryService.createCategory(categoryDTO));
}
@DeleteMapping("/delete-category/{categoryId}")
public ResponseEntity<Void> deleteBook(@PathVariable("categoryId") final Long bookId) {
this.categoryService.deleteCategory(bookId);
return ResponseEntity.ok().build();
}
}
|
10cca8bb-2471-47ca-9132-bc6c8cb10aa2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-10 06:09:27", "repo_name": "masrypakpahan/AplikasiOnlineTesting", "sub_path": "/app/src/main/java/com/pji/cbt/aplikasionlinetesting/ui/dialog/StartTestDialog.java", "file_name": "StartTestDialog.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "d8b8527f02d23d976f78ef6b4a219acba0cfafa0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/masrypakpahan/AplikasiOnlineTesting
| 231
|
FILENAME: StartTestDialog.java
| 0.246533
|
package com.pji.cbt.aplikasionlinetesting.ui.dialog;
import android.app.Dialog;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.pji.cbt.aplikasionlinetesting.ui.activities.MainActivity;
import butterknife.OnClick;
import cbt.pji.cbt.aplikasionlinetesting.R;
public class StartTestDialog extends AppCompatActivity {
// private ProgressDialog progressDialog;
private static final String TAG = "StartTestDialog";
MainActivity mActivity;
private Dialog dialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start_test_dialog);
}
public StartTestDialog(){}
public StartTestDialog(MainActivity mActivity) {
this.mActivity = mActivity;
show(mActivity.getSupportFragmentManager(), TAG);
}
private void show(FragmentManager supportFragmentManager, String tag) {
}
@OnClick(R.id.btn_start_test_no)
void showDialogAttend()
{
dialog.cancel();
}
@OnClick(R.id.btn_start_test_yes)
void showDialogReason() {
}
}
|
de8e668b-079f-4c95-b34a-0ff41d16f240
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-28 15:42:53", "repo_name": "michainv/inventory", "sub_path": "/src/main/java/internship/inventory/models/Device.java", "file_name": "Device.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "7174fcbc9ea108a2217bbf261e9b4ba1118795b0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/michainv/inventory
| 225
|
FILENAME: Device.java
| 0.250913
|
package internship.inventory.models;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.*;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "device")
public class Device {
@Id
@Column(name ="serial_number",length = 255,nullable = false)
private String serial_number;
@Column(name = "name",length = 255,nullable = false)
private String name;
@Column(name = "type",length = 255,nullable = false)
private String type;
@ManyToOne(fetch=FetchType.LAZY,optional=false)
@JoinColumn(name = "company_id",referencedColumnName = "id",nullable = false)
@JsonBackReference(value="owner_company")
private Company owner_company;
@ManyToOne(fetch=FetchType.LAZY,optional=true)
@JoinColumn(name = "employee_id",referencedColumnName = "id",nullable = true)
@JsonBackReference(value="owner_employee")
private Employee owner_employee;
}
|
c1003ed0-5aea-4e74-a277-41a726fee02a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-13 07:32:56", "repo_name": "569934390/darenbao", "sub_path": "/darenbao/src/main/java/com/club/web/webSocket/WebSocketManager.java", "file_name": "WebSocketManager.java", "file_ext": "java", "file_size_in_byte": 1157, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "8f6b1ee730d5ebe8e4a4be94cf44b87ac68afde5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/569934390/darenbao
| 234
|
FILENAME: WebSocketManager.java
| 0.289372
|
package com.club.web.webSocket;
import java.io.IOException;
import java.util.ArrayList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
@Component
public class WebSocketManager {
private Logger logger = LoggerFactory.getLogger(WebSocketManager.class);
private final ArrayList<WebSocketSession> sessionList = new ArrayList<>();
public void addWebSocketUser(WebSocketSession session) {
sessionList.add(session);
}
public void removeWebSocketUser(WebSocketSession session) {
sessionList.remove(session);
}
public void send(WebSocketSession session, int message) {
send(session, message+"");
}
public void send(WebSocketSession session, String message) {
try {
if (session.isOpen())
session.sendMessage(new TextMessage(message));
} catch (IOException e) {
logger.error("", e);
}
}
public void send(int message) {
send(message+"");
}
public void send(String message) {
for (WebSocketSession session : sessionList)
send(session, message);
}
}
|
25a81e72-0460-4f11-b5fa-7a73a1c8fd59
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-15 10:14:25", "repo_name": "Amonikaa/testing", "sub_path": "/buildingmarket/buildingmarket/buildingmarket-service/src/main/java/com/buildingmarket/serviceImpl/ContactSupportServiceImpl.java", "file_name": "ContactSupportServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1005, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "f5efa516873bd3e4b519a81db45c7c355bc9e459", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Amonikaa/testing
| 195
|
FILENAME: ContactSupportServiceImpl.java
| 0.267408
|
package com.buildingmarket.serviceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.buildingmarket.model.ContactSupport;
import com.buildingmarket.repository.ContactSupportRepository;
import com.buildingmarket.service.ContactSupportService;
@Service
public class ContactSupportServiceImpl implements ContactSupportService {
@Autowired
private ContactSupportRepository contactSupportRepository;
public boolean save(ContactSupport contactSupport) {
ContactSupport oldSupport = contactSupportRepository.save(contactSupport);
if (oldSupport != null) {
return true;
}
return false;
}
public List<ContactSupport> findAll() {
List<ContactSupport> oldList = contactSupportRepository.findAll();
if (oldList != null) {
return oldList;
}
return null;
}
public boolean deleteSupport(int contactsupportId) {
contactSupportRepository.delete(contactsupportId);
return true;
}
}
|
65d83d26-9475-4bfb-b1cf-9234d668111a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-25 09:30:25", "repo_name": "503612012/demo", "sub_path": "/src/main/java/com/oven/demo/common/util/LogQueueUtils.java", "file_name": "LogQueueUtils.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "66cf5add17822175bb8732189d0451963278175a", "star_events_count": 17, "fork_events_count": 4, "src_encoding": "UTF-8"}
|
https://github.com/503612012/demo
| 239
|
FILENAME: LogQueueUtils.java
| 0.276691
|
package com.oven.demo.common.util;
import com.oven.demo.core.log.entity.Log;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
/**
* 消息队列工具类
*
* @author Oven
*/
public class LogQueueUtils {
private static final Integer POP_MAX_COUNT = 1000;
private final BlockingQueue<Log> logQueue = new LinkedBlockingQueue<>();
private LogQueueUtils() {
}
private static class LogQueueUtilsHolder {
static LogQueueUtils instance = new LogQueueUtils();
}
public static LogQueueUtils getInstance() {
return LogQueueUtilsHolder.instance;
}
@SuppressWarnings("ResultOfMethodCallIgnored")
public void offer(Log log) {
this.logQueue.offer(log);
}
public List<Log> drainTo(Integer max) {
List<Log> list = new ArrayList<>();
if (max == null || max <= 0) {
max = POP_MAX_COUNT;
}
this.logQueue.drainTo(list, max);
return list;
}
}
|
35eb851e-9fb3-4bd4-bf15-7aba15bb161c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-22 16:28:45", "repo_name": "dominikk19/bank-microservices-cqrs-events-sourcing", "sub_path": "/user-microservice/user-cmd-api/src/main/java/pl/dkiszka/bank/services/UserService.java", "file_name": "UserService.java", "file_ext": "java", "file_size_in_byte": 2336, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "91640d01e6d38bf007bba3ed53d91806ce8f3a59", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dominikk19/bank-microservices-cqrs-events-sourcing
| 224
|
FILENAME: UserService.java
| 0.250913
|
package pl.dkiszka.bank.services;
import io.vavr.control.Try;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.axonframework.commandhandling.gateway.CommandGateway;
import org.springframework.stereotype.Service;
import pl.dkiszka.bank.commands.RegisterUserCommand;
import pl.dkiszka.bank.dto.RegisterUserResponse;
/**
* @author Dominik Kiszka {dominikk19}
* @project bank-application
* @date 21.04.2021
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class UserService {
private final CommandGateway gateway;
public RegisterUserResponse registerUser(RegisterUserCommand command) {
command.setId(command.getId());
return Try.of(() -> {
gateway.sendAndWait(command);
return new RegisterUserResponse("User successfully registered", command.getId());
}).onFailure(exe -> {
log.error("Error while processing register user fo id " + command.getId());
throw new CommandGatewayException("Error while processing register user fo id " + command.getId());
}).get();
}
}
|
d6acce70-6309-439f-a7c2-1a4e081578f0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-09 20:07:59", "repo_name": "Qwe1999/javaLabs", "sub_path": "/Laba 3/src/com/company/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7ac1605f7c4364386780f8b7f7d5566c674f71fe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Qwe1999/javaLabs
| 197
|
FILENAME: Main.java
| 0.290981
|
package com.company;
public class Main {
public static boolean wait = false;
public static Object lock = new Object();
public static void main(String[] args) {
new Main().logic();
}
synchronized public void logic(){
Conflict conflict1 = new Conflict("Name 1");
Conflict conflict2 = new Conflict("Name 2");
Thread thread1 = new Thread(new Runnable() {
@Override
public synchronized void run() {
synchronized (lock){
try {
lock.wait();
conflict1.bow(conflict2);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
});
Thread thread2 = new Thread(new Runnable() {
@Override
public synchronized void run() {
synchronized (lock){
conflict2.bow(conflict1);
lock.notify();
}
}
});
thread1.start();
thread2.start();
}
}
|
fcb5df82-7359-40d5-8e68-4c6ed3512ce5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-30 23:36:16", "repo_name": "lucaohost/java-codes", "sub_path": "/EJBCHAT/src/java/br/ifrs/ejb/Chat.java", "file_name": "Chat.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "49ebb73e3fee88470281484a5f05f3ba4769dba6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lucaohost/java-codes
| 254
|
FILENAME: Chat.java
| 0.240775
|
/*
* 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 br.ifrs.ejb;
import java.util.ArrayList;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.ejb.Singleton;
/**
*
* @author Neiva
*/
@Singleton
public class Chat implements IChat {
private ArrayList<String> salas;
public Chat(){
this.salas = new ArrayList<>();
}
public ArrayList<String> getSalas() {
return salas;
}
@Override
public void criarSala(String sala) {
this.salas.add(sala);
}
@Override
public String listaSalas() {
String listaSalas = "";
for (String sala : this.salas) {
listaSalas += "Sala: " + sala + "\n";
}
return listaSalas;
}
@PostConstruct
public void postConstruct() {
System.out.println("Post Construct com sucesso.");
}
@PreDestroy
public void preDestroy() {
System.out.println("Pré Destroy com sucesso.");
}
}
|
1f2deb64-11a9-4f6e-9ada-ba4a43e656f8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-07 13:04:54", "repo_name": "nelo81/checker", "sub_path": "/src/main/java/com/checker/util/ClimbUtil.java", "file_name": "ClimbUtil.java", "file_ext": "java", "file_size_in_byte": 1233, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "92ae70af4c1a14ab32cb2b8a660cf967b1a4e81c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nelo81/checker
| 239
|
FILENAME: ClimbUtil.java
| 0.29584
|
package com.checker.util;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.IOException;
import java.lang.reflect.Method;
public class ClimbUtil {
public static final String TAG = "getElementsByTag";
public static final String CLS = "getElementsByClass";
public static final String ID = "getElementById";
public static final String ATTR = "getElementsByAttributeValue";
public static Document climb(String url) throws IOException{
return Jsoup.connect(url)
.timeout(10000) // 设置连接超时时间
.get();
}
public static Elements filter(Element root, String filter, String tag) throws Exception{
Method method = Element.class.getMethod(filter,String.class);
Elements elements = (Elements) method.invoke(root, tag);
return elements;
}
public static Elements filter(Element root, String filter, String tag, String value) throws Exception{
Method method = Element.class.getMethod(filter,String.class,String.class);
Elements elements = (Elements) method.invoke(root, tag, value);
return elements;
}
}
|
5a987b03-a965-4767-9e6d-9194728be549
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-12-29 12:14:10", "repo_name": "asrafumar/selenium-getting-started-examples", "sub_path": "/Selenium/Selenium_Basics.java", "file_name": "Selenium_Basics.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "af085cb980290d62a3de749367dce0ac7904acef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/asrafumar/selenium-getting-started-examples
| 265
|
FILENAME: Selenium_Basics.java
| 0.294215
|
import java.io.File;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class Selenium_Basics {
public static void main(String[] args) {
//Code to include Firefox binary
FirefoxBinary binary = new FirefoxBinary(new File("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"));
FirefoxDriver dr1 = new FirefoxDriver(binary,null);
//Code to launch Firefox
FirefoxDriver dr = new FirefoxDriver();
//Code to work on Chrome
//Code to associated binary for Chrome
System.setProperty("webdriver.chrome.driver", "D:\\Selenium2\\JavaCode\\Library\\chromedriver.exe");
//Code to start Chrome browser
ChromeDriver cr = new ChromeDriver();
//Working on IE
//Code to associate binary for IE
System.setProperty("webdriver.ie.driver","D:\\Selenium2\\JavaCode\\Library\\IEDriverServer.exe");
//Code to launch IE
InternetExplorerDriver ir = new InternetExplorerDriver();
}
}
|
8d6b2d6a-f207-4c2a-8827-8f3f93973d9b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-26 06:59:00", "repo_name": "zpj23/MavenProject", "sub_path": "/姚的ssm框架以及数据库/ragdoll/src/main/java/com/totoro/core/utils/MyController.java", "file_name": "MyController.java", "file_ext": "java", "file_size_in_byte": 1039, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "535475feb1a8f63d73579c8573aa2ea4fcedb5c8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zpj23/MavenProject
| 209
|
FILENAME: MyController.java
| 0.240775
|
package com.totoro.core.utils;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.totoro.core.model.UserInfo;
public class MyController {
//返回的json变量
public String jsonData="";
public UserInfo curuser;
@Autowired
public HttpServletRequest request;
@Autowired
public HttpServletResponse response;
public String toJson(Object object){
Gson gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd HH:mm:ss")
.create();
String str = gson.toJson(object);
return str;
}
public void responseJson(Object o){
try {
request.setCharacterEncoding("utf-8");
response.setContentType("application/json;charset=utf-8");
response.getWriter().write(toJson(o));
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
49f80f5f-6093-42be-bd76-e6acd9577a03
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-16 11:41:11", "repo_name": "joo0z/GoRail", "sub_path": "/src/main/java/kr/or/ddit/member/service/MemberService.java", "file_name": "MemberService.java", "file_ext": "java", "file_size_in_byte": 1170, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "bec0f67e5620796d68cdc8553a2bf0e7d5d4083d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/joo0z/GoRail
| 250
|
FILENAME: MemberService.java
| 0.284576
|
package kr.or.ddit.member.service;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import kr.or.ddit.member.dao.MemberDao;
import kr.or.ddit.member.dao.MemberDaoI;
import kr.or.ddit.member.model.MemberVo;
@Transactional
@Service("memberService")
public class MemberService implements MemberServiceI{
@Resource(name = "memberDao")
private MemberDaoI memberDao;
public MemberService() {
// 주입해 재사용
// memberDao = new MemberDao();
}
@Override
public MemberVo getMemberInfo(String mem_id){
return memberDao.getMemberInfo(mem_id);
}
@Override
public int updatePass(MemberVo memberVo){
return memberDao.updatePass(memberVo);
}
@Override
public int dropMember(MemberVo memberVo){
return memberDao.dropMember(memberVo);
}
@Override
public int insertMember(MemberVo memberVo) {
return memberDao.insertMember(memberVo);
}
}
|
3f572d3d-6c61-4c3b-854f-63de45f6cabb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-23 13:37:18", "repo_name": "jiang1548063745/juc_book1", "sub_path": "/src/main/java/com/rorschach/noticeandwait/JoinExample.java", "file_name": "JoinExample.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "f7e022b8dcc5fa65e249fea05a13f4c712424ebe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jiang1548063745/juc_book1
| 220
|
FILENAME: JoinExample.java
| 0.255344
|
package com.rorschach.noticeandwait;
/**
* Join案例
* @author Rorschach
* @date 2021-3-15 20:30
*/
public class JoinExample {
public static void main(String[] args) {
Thread threadOne = new Thread(new Runnable() {
@Override
public void run() {
System.out.println("threadOne begin run!");
for (;;) {
// System.out.println("threadOne running");
}
}
});
final Thread mainThread = Thread.currentThread();
Thread threadTwo = new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
mainThread.interrupt();
}
});
threadOne.start();
threadTwo.start();
try {
threadOne.join();
} catch (InterruptedException e) {
System.out.println("main thread:" + e);
e.printStackTrace();
}
}
}
|
3d25a72d-dd0d-4c16-9564-c6c0936b510e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-10 08:59:29", "repo_name": "shiver-me-timbers/smt-badges-parent", "sub_path": "/smt-badges/src/main/java/shiver/me/timbers/badge/options/BadgeOptions.java", "file_name": "BadgeOptions.java", "file_ext": "java", "file_size_in_byte": 586, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "69e84468576c994898033a54178e2cbad9a9a198", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/shiver-me-timbers/smt-badges-parent
| 246
|
FILENAME: BadgeOptions.java
| 0.26588
|
/*
* Copyright 2016 Karl Bennett
*
* 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 shiver.me.timbers.badge.options;
/**
* @author Karl Bennett
*/
public class BadgeOptions extends CommonBadgeOptions {
private final String statusColour;
private final String subjectColour;
public BadgeOptions(String subject, String status, String subjectColour, String statusColour) {
super(subject, status);
this.subjectColour = subjectColour;
this.statusColour = statusColour;
}
public String getStatusColour() {
return statusColour;
}
public String getSubjectColour() {
return subjectColour;
}
}
|
5bb2f9cb-3258-4b5c-8eed-c09b259930cc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-31 01:47:33", "repo_name": "zhu-jacky/LearningAndroid", "sub_path": "/Intents/app/src/main/java/com/zhujingjie/intents/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "53315800a397cb02d854955955e3e544ea1f0f64", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zhu-jacky/LearningAndroid
| 267
|
FILENAME: MainActivity.java
| 0.276691
|
package com.zhujingjie.intents;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity {
int requestCode = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void onClickWebBrowser(View view){
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.amazon.com"));
startActivity(i);
}
public void onClickMakeCalls(View view){
Intent i = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:+12345678900"));
startActivity(i);
}
public void onClickShowMap(View view){
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:37.827500, -122.481670"));
startActivity(i);
}
public void onClickLaunchMyBrowser(View view){
Intent i = new Intent("My Browser");
i.setData(Uri.parse("http://www.amazon.com"));
i.addCategory("Category 1");
//i.addCategory("Category 4"); //Unmatched category
startActivity(i);
}
}
|
af8aaafd-8839-43e4-a773-e98b9e00cd53
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-04-14 22:56:20", "repo_name": "Griffins-1884/RobotCode2014", "sub_path": "/NetBeansProject/src/org/usfirst/frc1884/util/parameters/ParameterFile.java", "file_name": "ParameterFile.java", "file_ext": "java", "file_size_in_byte": 1069, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "a33a31eccbddf3d881d67e1a3045959e992215c0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Griffins-1884/RobotCode2014
| 194
|
FILENAME: ParameterFile.java
| 0.295027
|
package org.usfirst.frc1884.util.parameters;
import java.util.Hashtable;
import org.json.me.JSONArray;
import org.json.me.JSONException;
import org.json.me.JSONObject;
public class ParameterFile {
protected static Hashtable existingParameters = new Hashtable();
public static boolean readFile() {
try {
JSONArray fileContents = FileIO.fromJSONFileAsArray("parameters.json");
if (fileContents == null) {
return false;
}
for (int i = 0; i < fileContents.length(); i++) {
JSONObject jsonParameter = fileContents.getJSONObject(i);
String type = jsonParameter.getString("type");
if (type.equals("double")) {
DoubleParameter.set(jsonParameter);
} else if (type.equals("integer")) {
IntegerParameter.set(jsonParameter);
}
}
return true;
} catch (JSONException ex) {
ex.printStackTrace();
}
return false;
}
}
|
0635165a-a9e6-4a71-a19e-155eb87da514
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-16 23:48:07", "repo_name": "smdb21/java-miape-api", "sub_path": "/src/main/java/org/proteored/miapeapi/xml/gi/MatchingImpl.java", "file_name": "MatchingImpl.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "d52d74f2d3f3ecdcc11fff17e0d65220ec51f905", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/smdb21/java-miape-api
| 274
|
FILENAME: MatchingImpl.java
| 0.286169
|
package org.proteored.miapeapi.xml.gi;
import java.util.Map;
import org.proteored.miapeapi.interfaces.gi.ImageGelInformatics;
import org.proteored.miapeapi.interfaces.gi.Matching;
import org.proteored.miapeapi.xml.gi.autogenerated.GIImage;
import org.proteored.miapeapi.xml.gi.autogenerated.GIMatchingType;
public class MatchingImpl extends AlgorithmImpl implements Matching {
private final GIMatchingType matchingXML;
private final Map<String, GIImage> imageMap;
public MatchingImpl(GIMatchingType matchingXML, Map<String, GIImage> imageMap) {
super(matchingXML);
this.matchingXML = matchingXML;
this.imageMap = imageMap;
}
@Override
public String getEditing() {
return matchingXML.getEditing();
}
@Override
public String getLandmarks() {
return matchingXML.getLandmarks();
}
@Override
public ImageGelInformatics getReferenceImage() {
if (imageMap.containsKey(matchingXML.getReferenceImage())) {
return new ImageImpl(imageMap.get(matchingXML.getReferenceImage()));
}
return null;
}
@Override
public String getStepOrder() {
return matchingXML.getStepOrder();
}
}
|
50027533-0210-481c-9d20-9baa54e78f6f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-15 15:17:33", "repo_name": "Davidgjuan/Javashop", "sub_path": "/src/model/auxiliar/AssociationsCategory.java", "file_name": "AssociationsCategory.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "94f41275aad11bc3c3439a35bd7ec8b920366d67", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Davidgjuan/Javashop
| 207
|
FILENAME: AssociationsCategory.java
| 0.242206
|
package model.auxiliar;
import java.util.List;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import model.Category;
import model.Product;
@JacksonXmlRootElement(localName = "associations")
public class AssociationsCategory {
@JacksonXmlElementWrapper(namespace ="categories", localName = "categories")
private List<Category> category;
@JacksonXmlElementWrapper(namespace ="products", localName = "products")
private List<Product> product;
public AssociationsCategory() {
super();
}
public List<Category> getCategory() {
return category;
}
public void setCategory(List<Category> category) {
this.category = category;
}
public List<Product> getProduct() {
return product;
}
public void setProduct(List<Product> product) {
this.product = product;
}
@Override
public String toString() {
return "AssociationsCategory [category=" + category + ", product=" + product + "]";
}
}
|
b12512ee-0f2d-4bed-9d2a-f69fc08c43fe
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-12 11:34:24", "repo_name": "baoge523/mockServerRegister", "sub_path": "/client-dependency/src/main/java/life/server/boot/Start.java", "file_name": "Start.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "4430b02fa4c608b8cb97c89c2a9806af67a04bf6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/baoge523/mockServerRegister
| 206
|
FILENAME: Start.java
| 0.250913
|
package life.server.boot;
import life.server.http.Session;
import life.server.prop.ClientProperties;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Timer;
import java.util.TimerTask;
public class Start {
@Autowired
private ClientProperties properties;
public Start(){
}
/**
* 执行心跳
*/
public void init(){
Session.post(properties.getDefaultZone(),HeartbearData.heartbeatMap(properties.getAppName(),properties.getHostName()+":"+properties.getPort()));
System.out.println("建立连接");
Timer timer = new Timer(true);
timer.schedule(new TimerTask() {
@Override
public void run() {
Session.get(parse());
System.out.println("发送心跳");
}
}, 0L, properties.getCycle());
}
public String parse(){
String url = properties.getDefaultZone();
String[] split = url.split("/");
url = "http://"+split[2]+"/heartbeat?appName="+properties.getAppName();
return url;
}
}
|
0bcb6f2b-2b5a-4944-9b1e-742303671b9e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-09 02:14:42", "repo_name": "simon-test-dev/framework-main", "sub_path": "/src/main/java/com/jy/framework/vo/CommonData.java", "file_name": "CommonData.java", "file_ext": "java", "file_size_in_byte": 1310, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "b5be2b28f4743886c67902fda62fd77d0c09f547", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/simon-test-dev/framework-main
| 381
|
FILENAME: CommonData.java
| 0.221351
|
package com.jy.framework.vo;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "공통부")
public class CommonData
implements
Serializable {
/**
*
*/
private static final long serialVersionUID = -4182467701951374331L;
@NotNull
@Schema(example = "02016101398487146504890949563021", description = "거래 Unique 한 키 (클라이언트에서 생성)")
private String guid;
@NotNull
@Size(min = 17, max = 17, message = "YYYYMMDDHHmmssmmm")
@Schema(example = "20210321122839243", description = "거래일자/시간")
private String trxDatetime;
@NotNull
@Schema(example = "S",
allowableValues = {
"S",
"R"
},
description = "요청 타입 [S:요청 , R:응답]")
private String requestType;
@Schema(example = " ",
allowableValues = {
"NM",
"ER"
},
description = "요청 타입 [NM:정상 , ER:오류]")
private String responseType;
@Schema(example = "bizA", description = "인터페이스 아이디")
private String interfaceId;
}
|
94dec47c-f393-4fcf-a800-4e3cdd626fde
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-04 12:05:51", "repo_name": "GeorgePengZhang/BluetoothPhone", "sub_path": "/src/com/aura/bluetoothphone/utils/ToastUtil.java", "file_name": "ToastUtil.java", "file_ext": "java", "file_size_in_byte": 1146, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "fc62f48248ec5881413a98a3ef78a952980659fd", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/GeorgePengZhang/BluetoothPhone
| 344
|
FILENAME: ToastUtil.java
| 0.287768
|
package com.aura.bluetoothphone.utils;
import android.content.Context;
import android.widget.Toast;
/**
* Toast操作工具类
*
* @author 罗文忠
* @date 2013-03-19
* @version 1.0.0
*
*/
public class ToastUtil {
private static Toast toast;
/**
* 显示提示信息
*
* @author 罗文忠
* @version 1.0
* @date 2013-03-19
* @param text
* 提示内容
*/
public static void showToast(Context context, String text) {
if (toast == null) {
toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
} else {
toast.setText(text);
}
toast.show();
}
/**
* 显示提示信息(时间较长)
*
* @author 罗文忠
* @version 1.0
* @date 2013-04-07
* @param text
* 提示内容
*/
public static void showLongToast(Context context, String text) {
if (toast == null) {
toast = Toast.makeText(context, text, Toast.LENGTH_LONG);
} else {
toast.setText(text);
}
// toast.setGravity(Gravity.CENTER_HORIZONTAL|Gravity.TOP, 0, DisplayUtil.dip2px(Application.context, 150));
toast.show();
}
}
|
51293314-9ae0-4aad-8467-b6d8fe1358cf
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-16 07:00:57", "repo_name": "wcggit/tiegan", "sub_path": "/src/main/java/com/jifenke/lepluslive/lejiauser/service/LeJiaUserService.java", "file_name": "LeJiaUserService.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "119da9506bb5c32d6029976e41cc6ae179cfe2b4", "star_events_count": 0, "fork_events_count": 11, "src_encoding": "UTF-8"}
|
https://github.com/wcggit/tiegan
| 250
|
FILENAME: LeJiaUserService.java
| 0.243642
|
package com.jifenke.lepluslive.lejiauser.service;
import com.jifenke.lepluslive.lejiauser.domain.entities.LeJiaUser;
import com.jifenke.lepluslive.lejiauser.repository.LeJiaUserRepository;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.inject.Inject;
/**
* Created by wcg on 16/4/21.
*/
@Service
@Transactional(readOnly = true)
public class LeJiaUserService {
@Value("${bucket.ossBarCodeReadRoot}")
private String barCodeRootUrl;
@Inject
private LeJiaUserRepository leJiaUserRepository;
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public LeJiaUser findUserByUserSid(String userSid) {
return leJiaUserRepository.findByUserSid(userSid);
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public Long findNumberUserByBindMerchant(Long merchantId) {
return leJiaUserRepository.findNumberUserByBindMerchant(merchantId);
}
}
|
ffd7e129-27bc-480e-a023-e41bba8094c4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-12 21:42:38", "repo_name": "bogdanovmn/tutorialspoint-full-pdf", "sub_path": "/tutorialspoint-full-pdf-lib/src/main/java/com/github/bogdanovmn/tpfp/lib/domain/TutorialsPoint.java", "file_name": "TutorialsPoint.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "7d19f9324a9c00e0abbe4e37458a9ea2a4fcc05c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bogdanovmn/tutorialspoint-full-pdf
| 232
|
FILENAME: TutorialsPoint.java
| 0.27513
|
package com.github.bogdanovmn.tpfp.lib.domain;
import com.github.bogdanovmn.tpfp.lib.common.LinkedHashMapArrayList;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.IOException;
/**
*
*/
public class TutorialsPoint {
private final static String PREFIX = "https://www.tutorialspoint.com";
public Article getArticle(String articlePathName)
throws IOException
{
LinkedHashMapArrayList<String, Page> pages = new LinkedHashMapArrayList<>();
Document document = Jsoup.connect(
String.format("%s/%s/", PREFIX, articlePathName)
).get();
Elements sections = document.select("ul[class^=nav nav-list primary left-menu]");
for (Element section : sections) {
Element sectionHeader = section.select("li[class=heading]").first();
for (Element link : section.select("a[href]")) {
pages.put(
sectionHeader.text(),
new Page(link.text(), PREFIX + link.attr("href"))
);
}
}
return new Article(pages);
}
}
|
fa65f5af-e522-4804-826e-11ecb3f5d1bc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-03-14 16:40:08", "repo_name": "rmeertens/Duolingo-e-mersion-server", "sub_path": "/src/main/java/com/pinchofintelligence/duolingoemersion/server/ScoreMetricSong.java", "file_name": "ScoreMetricSong.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "bf8a4fa83c67efeb0c104a568b7972544e4c7f9d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rmeertens/Duolingo-e-mersion-server
| 253
|
FILENAME: ScoreMetricSong.java
| 0.29584
|
/*
* 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.pinchofintelligence.duolingoemersion.server;
import com.pinchofintelligence.duolingoemersion.crawlers.music.TrackInformation;
import java.util.ArrayList;
/**
*
* @author Roland
*/
public class ScoreMetricSong {
/**
* Get the score of a song, currently only bases on what words a user knows
* and the lyrics of a song
*
* @param lyric
* @param knownWords
* @return
*/
public static int getScore(TrackInformation lyric, ArrayList<String> knownWords) {
double score = 0.0;
double wordsTested = 0.0;
String[] wordsInLyric = lyric.getLyrics_body().split(" ");
for (String word : wordsInLyric) {
wordsTested++;
if (knownWords.contains(word.toLowerCase())) {
score++;
}
}
return (int) ((score / wordsTested) * 100.0);
}
}
|
872b4730-b62c-4d1c-81d1-43703c1a1a02
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2013-08-16T10:22:00", "repo_name": "goodgravy/forge-spikes", "sub_path": "/twitter-oauth/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1158, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "61aeba67322f176b7f8ebade9002ed02c4f296ff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/goodgravy/forge-spikes
| 256
|
FILENAME: README.md
| 0.256832
|
# OAuth for Twitter
Currently (July 2013), there are two main ways to use OAuth with Twitter: [application-only](https://dev.twitter.com/docs/auth/application-only-auth) access or [single-user access](https://dev.twitter.com/docs/auth/oauth/single-user-with-examples).
If possible, use application-only authentication, because it is OAuth 2.0 and therefore generally painless to implement.
This example app shows how to do OAuth 1.0a authentication against Twitter from a Trigger.io app.
## Usage
Update `window.oauth_consumer_key` and `window.consumerSecret` in `main.js` with values from your own app.
There are examples in the code for how to read those values in from the `parameters` module too, which you may prefer.
The core of the OAuth 1.0a authentication flow is the sequence of:
POST https://api.twitter.com/oauth/request_token
GET https://api.twitter.com/oauth/authorize
POST https://api.twitter.com/oauth/access_token
Which you can see towards the end of `main.js`. Once that sequence has successfully completed, a valid OAuth token and token secret have been acquired, and subsequent calls to `makeSignedRequest` should just work.
|
b85e4875-021b-44c9-8ce7-806e338412e1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-18 19:36:29", "repo_name": "Shyrick/CoreBMS2", "sub_path": "/src/main/java/EarthPopulation/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "ca357711eb6afd1226f8642c9b5b736f187fe060", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Shyrick/CoreBMS2
| 247
|
FILENAME: Main.java
| 0.278257
|
package EarthPopulation;
public class Main {
static long firstGeneration = 6;
static int firstChildAge = 25;
static int numberOfChildreninFamaly = 3;
static int deathAge = 75;
static long population;
void ageOfPopulation () {
population = firstGeneration;
long numberOfFamalys = population / 2 ;
int ageOfPopulation = 0;
long secondGeneration = firstGeneration + numberOfFamalys*numberOfChildreninFamaly;
long thirdGeneration = secondGeneration + numberOfFamalys*numberOfChildreninFamaly;
while (population < 7000000000L){
if (ageOfPopulation % firstChildAge == 0){
secondGeneration = firstGeneration + numberOfChildreninFamaly;
}
if (ageOfPopulation % deathAge == 0){
population -= firstGeneration;
firstGeneration = secondGeneration;
secondGeneration = thirdGeneration;
}
population = firstGeneration + secondGeneration + thirdGeneration;
}
}
public static void main(String[] args) {
}
}
|
c805a03f-5134-49ff-a80d-377d34c9ee63
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-04-03 08:06:50", "repo_name": "keesun/spring-social-me2day", "sub_path": "/src/main/java/org/springframework/social/me2day/auth/Me2DayAuthRequestInterceptor.java", "file_name": "Me2DayAuthRequestInterceptor.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "4cf5583523781d7c7fc314a5f8d297aa7646c0d5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/keesun/spring-social-me2day
| 251
|
FILENAME: Me2DayAuthRequestInterceptor.java
| 0.267408
|
package org.springframework.social.me2day.auth;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.*;
import org.springframework.social.support.URIBuilder;
import java.io.IOException;
import java.net.URI;
/**
* @author: Keesun Baik
*/
public class Me2DayAuthRequestInterceptor implements ClientHttpRequestInterceptor {
private final Me2DayCridential me2DayCridential;
private final ClientHttpRequestFactory requestFactory;
public Me2DayAuthRequestInterceptor(Me2DayCridential me2DayCridential1, ClientHttpRequestFactory requestFactory) {
this.me2DayCridential = me2DayCridential1;
this.requestFactory = requestFactory;
}
@Override
public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException {
URI me2dayAuthUri = URIBuilder.fromUri(request.getURI().toString()).queryParam("uid", me2DayCridential.getUid()).queryParam("ukey", me2DayCridential.getUkey()).build();
HttpRequest httpRequest = requestFactory.createRequest(me2dayAuthUri, HttpMethod.GET);
return execution.execute(httpRequest, body);
}
}
|
a664ee9e-528f-481d-9bb8-3e932ed02020
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-14 20:56:02", "repo_name": "jonasromao/sgam_rep", "sub_path": "/sgam-business/src/main/java/br/com/setaprox/sgam/service/impl/SegmentoServiceImpl.java", "file_name": "SegmentoServiceImpl.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "f0e6092eb22e36c84d45ee047e31556762703b2a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jonasromao/sgam_rep
| 252
|
FILENAME: SegmentoServiceImpl.java
| 0.268941
|
package br.com.setaprox.sgam.service.impl;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.PersistenceException;
import br.com.setaprox.sgam.DAO.SegmentoDAO;
import br.com.setaprox.sgam.model.Segmento;
import br.com.setaprox.sgam.service.SegmentoService;
@Stateless
@LocalBean
public class SegmentoServiceImpl implements SegmentoService {
@EJB
private SegmentoDAO segmentoDAO;
@Override
public void persist(Segmento segmento) {
segmentoDAO.persist(segmento);
}
@Override
public void remove(Segmento segmento) {
segmentoDAO.remove(segmento);
}
@Override
public void remove(Long id) throws PersistenceException {
segmentoDAO.remove(id);
}
@Override
public void editar(Segmento segmento) {
segmentoDAO.editar(segmento);
}
@Override
public Segmento find(Long id) {
return segmentoDAO.find(id);
}
@Override
public List<Segmento> findAll() {
return segmentoDAO.findAll();
}
}
|
e6aaf2ed-6e3e-409a-b25c-723120766218
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-26 18:14:10", "repo_name": "saurabhgargit/saurabh-garg", "sub_path": "/Monefy App Automation/src/main/java/pages/ExpensePage.java", "file_name": "ExpensePage.java", "file_ext": "java", "file_size_in_byte": 1032, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "a75e8cebaaaf9cb3fa7127ff5720b225f5fd749f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/saurabhgargit/saurabh-garg
| 202
|
FILENAME: ExpensePage.java
| 0.261331
|
package pages;
import io.appium.java_client.MobileElement;
import io.appium.java_client.pagefactory.AndroidFindBy;
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import utils.Page;
public class ExpensePage extends Page {
@AndroidFindBy(id = idPrefix + "buttonKeyboard5")
private MobileElement btnKeyboard5;
@AndroidFindBy(id = idPrefix + "keyboard_action_button")
private MobileElement categoryBtn;
public ExpensePage() {
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
wait = new WebDriverWait(driver, 30);
}
public ExpensePage enterExpenses(){
wait.until(ExpectedConditions.visibilityOf(btnKeyboard5));
btnKeyboard5.click();
return this;
}
public CategoryPage clickCategoryBtn(){
categoryBtn.click();
return new CategoryPage();
}
}
|
113a3121-70f7-4ef5-8a31-8013b92605ab
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-29 11:19:09", "repo_name": "DaMan02/XMPPTest", "sub_path": "/app/src/main/java/com/dayal/xmpptest2/models/ChatMessage.java", "file_name": "ChatMessage.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "b5d375df2f3de7e32348d30ee4c71ce0a46abf83", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/DaMan02/XMPPTest
| 255
|
FILENAME: ChatMessage.java
| 0.210766
|
package com.dayal.xmpptest2.models;
import android.media.Image;
import android.widget.ImageView;
import java.io.File;
/**
* Created by Manjeet Dayal on 12-07-2018.
*/
public class ChatMessage {
private String message;
private Contact sender;
private long timestamp;
private String MesssageType;
public ChatMessage() {
}
public ChatMessage(String message, Contact sender, long timestamp) {
this.message = message;
this.sender = sender;
this.timestamp = timestamp;
}
public String getMesssageType() {
return MesssageType;
}
public void setMesssageType(String messsageType) {
MesssageType = messsageType;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Contact getSender() {
return sender;
}
public void setSender(Contact sender) {
this.sender = sender;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
}
|
df88b025-64f2-4c3b-9205-fbfe407bb25b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-30T14:08:51", "repo_name": "rubysec/rubysec.github.io", "sub_path": "/advisories/_posts/2015-10-24-OSVDB-129854.md", "file_name": "2015-10-24-OSVDB-129854.md", "file_ext": "md", "file_size_in_byte": 1134, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "422e081c5312a67b54dfc63580586d709303017e", "star_events_count": 24, "fork_events_count": 9, "src_encoding": "UTF-8"}
|
https://github.com/rubysec/rubysec.github.io
| 325
|
FILENAME: 2015-10-24-OSVDB-129854.md
| 0.221351
|
---
layout: advisory
title: 'OSVDB-129854 (mapbox-rails): mapbox-rails Content Injection via TileJSON attribute'
comments: false
categories:
- mapbox-rails
advisory:
gem: mapbox-rails
osvdb: 129854
url: https://nodesecurity.io/advisories/49
title: mapbox-rails Content Injection via TileJSON attribute
date: 2015-10-24
description: |
Mapbox.js versions 1.x prior to 1.6.5 and 2.x prior to 2.1.7 are vulnerable
to a cross-site-scripting attack in certain uncommon usage scenarios.
If you use L.mapbox.map or L.mapbox.tileLayer to load untrusted TileJSON
content from a non-Mapbox URL, it is possible for a malicious user with
control over the TileJSON content to inject script content into the
"attribution" value of the TileJSON which will be executed in the context of
the page using Mapbox.js.
Such usage is uncommon. The following usage scenarios are not vulnerable:
* only trusted TileJSON content is loaded
* TileJSON content comes only from mapbox.com URLs
* a Mapbox map ID is supplied, rather than a TileJSON URL
patched_versions:
- "~> 1.6.5"
- ">= 2.1.7"
---
|
a82ceb93-3c20-408e-a143-85288a1fdf88
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-17 02:22:07", "repo_name": "cesarsegurac/CursoUdemyMiniTwitter", "sub_path": "/app/src/main/java/com/cursoudemy/minitwitter/SignUpActivity.java", "file_name": "SignUpActivity.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "3d88c7f5fb0a6725a63e67f336b652a79a0cf8fb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cesarsegurac/CursoUdemyMiniTwitter
| 203
|
FILENAME: SignUpActivity.java
| 0.225417
|
package com.cursoudemy.minitwitter;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class SignUpActivity extends AppCompatActivity implements View.OnClickListener {
TextView tvLogin;
Button btnSignUp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_up);
getSupportActionBar().hide();
tvLogin = findViewById(R.id.textViewLogin);
btnSignUp = findViewById(R.id.buttonSignUp);
tvLogin.setOnClickListener(this);
btnSignUp.setOnClickListener(this);
}
@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.textViewLogin:
goToLogin();
break;
case R.id.buttonSignUp:
break;
}
}
private void goToLogin() {
Intent intent = new Intent(SignUpActivity.this, MainActivity.class);
startActivity(intent);
finish();
}
}
|
ac5e8b46-a0bb-43b2-a920-77ee14b771a3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-09 15:28:50", "repo_name": "zino1187/ProtectorFinal", "sub_path": "/app/src/main/java/com/solu/daewha/bluetoothclient/MsgFragment.java", "file_name": "MsgFragment.java", "file_ext": "java", "file_size_in_byte": 1215, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "8a6241d45ba43bfef8ca1a8823746412674b458c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zino1187/ProtectorFinal
| 233
|
FILENAME: MsgFragment.java
| 0.272025
|
package com.solu.daewha.bluetoothclient;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
/**
* Created by zino on 2017-11-08.
*/
public class MsgFragment extends Fragment implements View.OnClickListener{
ControlActivity controlActivity;
DataThread dataThread;
EditText edit_input;
Button bt_send;
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view=inflater.inflate(R.layout.fragment_msg,null);
edit_input = (EditText)view.findViewById(R.id.edit_input);
bt_send=(Button)view.findViewById(R.id.bt_send);
bt_send.setOnClickListener(this);
controlActivity = (ControlActivity) getActivity();
dataThread = controlActivity.dataThread;
return view;
}
@Override
public void onClick(View view) {
String msg=edit_input.getText().toString();
dataThread.send("msg:"+msg+"\n");
edit_input.setText("");
}
}
|
93d292ff-e64e-4672-8df0-436d595adc58
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-27 04:42:34", "repo_name": "roburi/CDAA", "sub_path": "/Rodrigram/app/src/main/java/burgos/com/rodrigram/LoginActivity.java", "file_name": "LoginActivity.java", "file_ext": "java", "file_size_in_byte": 1157, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "54ebc672f403707437cf41b74442d21ee41afeea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/roburi/CDAA
| 205
|
FILENAME: LoginActivity.java
| 0.221351
|
package burgos.com.rodrigram;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import burgos.com.rodrigram.view.ContainerActivity;
import burgos.com.rodrigram.view.CreateAccountActivity;
public class LoginActivity extends AppCompatActivity
{
private Intent intent;
private Intent intentContainer;
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
}
public void goCreateAccount(View view)
{
intent = new Intent(getApplicationContext(), CreateAccountActivity.class);
startActivity(intent);
}
public void goContainer(View view)
{
intentContainer = new Intent(getApplicationContext(), ContainerActivity.class);
startActivity(intentContainer);
}
public void goPlatziGram(View view)
{
intentContainer = new Intent(getApplicationContext(), ContainerActivity.class);
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.platzi.com")));
}
}
|
8c7f84de-90f3-4644-8d05-2b986d998a4c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-07-15 00:53:15", "repo_name": "hendisantika/SpringAOP-AspectJ", "sub_path": "/src/main/java/com/hendisantika/springaop/model/Customer.java", "file_name": "Customer.java", "file_ext": "java", "file_size_in_byte": 1182, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "80bed5f2f75d739a4b58378e9239f81237067ee5", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/hendisantika/SpringAOP-AspectJ
| 280
|
FILENAME: Customer.java
| 0.246533
|
package com.hendisantika.springaop.model;
/**
* Created by IntelliJ IDEA.
* Project : SpringAOP-AspectJ
* User: hendisantika
* Email: hendisantika@gmail.com
* Telegram : @hendisantika34
* Date: 09/01/18
* Time: 21.56
* To change this template use File | Settings | File Templates.
*/
public class Customer {
private long id;
private String firstName;
private String lastName;
public Customer() {
}
public Customer(long id, String firstName, String lastName) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
@Override
public String toString() {
return String.format("Customer[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName);
}
}
|
857c87da-33d3-4cae-8a2f-95968572fb19
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-23 09:11:33", "repo_name": "phoenix-cluster/ph-enhancer-web-service", "sub_path": "/src/main/java/org/ncpsb/phoenixcluster/enhancer/webservice/service/StatisticsService.java", "file_name": "StatisticsService.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "ec05065b5e59d00554507aeb50662d30d8444777", "star_events_count": 0, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/phoenix-cluster/ph-enhancer-web-service
| 248
|
FILENAME: StatisticsService.java
| 0.279042
|
package org.ncpsb.phoenixcluster.enhancer.webservice.service;
import org.ncpsb.phoenixcluster.enhancer.webservice.dao.mysql.StatisticsDaoMysqlImpl;
import org.ncpsb.phoenixcluster.enhancer.webservice.model.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by baimi on 2017/10/11.
*/
@Service
public class StatisticsService {
@Autowired
private StatisticsDaoMysqlImpl statisticsDao;
public Integer findTotalSpectrumInCluster(String clusterID) {
return statisticsDao.findTotalSpectrumInCluster(clusterID);
}
public VennData findVennDataByProjectId(String projectId) {
return statisticsDao.findVennDataByProjectId(projectId);
}
public Thresholds findThresholdsByProjectId(String projectId) {
return statisticsDao.findThresholdsByProjectId(projectId);
}
public List<String> findProjects() {
return statisticsDao.findProjects();
}
public List<VennData> getVennDataList() {
return statisticsDao.getVennDataList();
}
}
|
22852993-c02e-46b7-8912-37ab482b4f8e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-09-28T11:59:18", "repo_name": "Skeen/vnc_monitor", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1219, "line_count": 48, "lang": "en", "doc_type": "text", "blob_id": "74ff0a6ccaaec63f3aa0a1a2a9460b3a9d0d25b9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Skeen/vnc_monitor
| 309
|
FILENAME: README.md
| 0.203075
|
VNC Monitor
-----------
# Preparing the host-machine
## Ensuring a VIRTUAL device is present.
Note this section concerns the [xorg.conf](https://xkcd.com/963/) file.
Check whether a `VIRTUAL` framebuffer device is already found, using:
xrandr -q
The expected output if a virtual device is present is:
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
VIRTUAL2 disconnected (normal left inverted right x axis y axis)
...
If this is not the case, a virtual device can be spawned using the `xorg.conf`
file, found within `usr/share/X11/xorg.conf.d/20-intel.conf`. This can simply
be copied to the equivalent system folder:
cp usr/share/X11/xorg.conf.d/20-intel.conf /usr/share/X11/xorg.conf.d/20-intel.conf
After which the Xorg server should be restarted
sudo killall Xorg
## Install VNC server
Install the VNC server package:
sudo apt-get install tightvncserver x11vnc
# Preparing the slave machine
## Setting output mode
The output mode of the *pi should fix the `VIRTUAL1` resolution.
This can be set using the `raspi-config` tool on raspberry pi, and using
similar tools on other hardware.
# Pairing
Run the `setup.sh` script with appropriate parameters.
|
9c8eae00-1bb4-4caa-839b-0d679e029ba5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-20 09:59:14", "repo_name": "Quy520/EDictionary1.0", "sub_path": "/app/src/main/java/com/example/qsd/edictionary/adapter/MypageAdapter.java", "file_name": "MypageAdapter.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "ff526412578cb322b3dcd817af0482274558824e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Quy520/EDictionary1.0
| 222
|
FILENAME: MypageAdapter.java
| 0.267408
|
package com.example.qsd.edictionary.adapter;
import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
import java.util.Objects;
/**
* Created by QSD on 2016/11/22.
*/
public class MypageAdapter extends PagerAdapter {
private Context context;
private List<View> mlist;
public MypageAdapter(Context context,List<View> mlist){
this.context=context;
this.mlist=mlist;
}
@Override
public int getCount() {
return mlist.size();
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view==object;
}
@Override
public Object instantiateItem(ViewGroup container,int position){
View view=mlist.get(position);
container.addView(view);
return view;
}
@Override
public void destroyItem(ViewGroup container,int position,Object object){
container.removeView((View)object);
}
}
|
0d2cbdeb-8009-4d1f-9425-92fba35f9149
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-01 09:36:01", "repo_name": "Immountain/gsis.kwdi.re.kr", "sub_path": "/src/main/java/gsis/com/site/datainfo/jgBtitle/web/SiteJgB01TitleController.java", "file_name": "SiteJgB01TitleController.java", "file_ext": "java", "file_size_in_byte": 1111, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "69768af84a14190e422dc0aa091d63ebd1b338ca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Immountain/gsis.kwdi.re.kr
| 249
|
FILENAME: SiteJgB01TitleController.java
| 0.267408
|
package gsis.com.site.datainfo.jgBtitle.web;
import gsis.com.cms.datainfo.jgBtitle.service.JgB01TitleService;
import gsis.com.cms.datainfo.jgBtitle.vo.JewB01TiileDataVO;
import infomind.com.cmm.web.BaseAjaxController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
@Controller
public class SiteJgB01TitleController extends BaseAjaxController {
@Resource(name="JgB01TitleService")
private JgB01TitleService jgB01TitleService;
/**
* 리스트
* @param searchVO
* @return
* @throws Exception
*/
@RequestMapping(value="/site/gsis/b01/List.do")
public ModelAndView List(@RequestBody JewB01TiileDataVO searchVO) throws Exception{
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
modelAndView.addObject("list",jgB01TitleService.selectList(searchVO));
return modelAndView;
}
}
|
6df0122b-85a6-43f2-ad60-71e4f9488879
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-16 13:35:38", "repo_name": "instedd/ests", "sub_path": "/Mobile App Source Code/app/src/main/java/ug/co/sampletracker/app/components/account/ViewAccountInteractorImpl.java", "file_name": "ViewAccountInteractorImpl.java", "file_ext": "java", "file_size_in_byte": 1098, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "88d730f76739bfe400efb175cf02e76605a178ad", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/instedd/ests
| 223
|
FILENAME: ViewAccountInteractorImpl.java
| 0.292595
|
package ug.co.sampletracker.app.components.account;
import ug.co.sampletracker.app.connections.dataloaders.DTBalanceInquiry;
import ug.co.sampletracker.app.database.DbHandler;
import ug.co.sampletracker.app.models.Balance;
import ug.co.sampletracker.app.models.requests.BalanceRequest;
/**
* Created by Timothy Kasaga for Leontymo Developers on 5/7/2018.
*/
public class ViewAccountInteractorImpl implements ViewAccountInteractor {
@Override
public void loadCreditBalancesFromServer(DbHandler dbHandler, BalanceRequest request,
DTBalanceInquiry.ServerResponseBalanceInquiryListener listener) {
DTBalanceInquiry dataLoader = new DTBalanceInquiry();
dataLoader.setResponseListener(listener);
dataLoader.balanceInquiry(request);
}
@Override
public Balance loadCreditBalancesFromServer(DbHandler dbHandler) {
return dbHandler.creditBalances();
}
@Override
public void saveCreditBalance(DbHandler dbHandler, Balance balance) {
dbHandler.saveCreditBalance(balance);
}
}
|
5063d52e-1648-479f-b030-a378774df568
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-09 04:42:30", "repo_name": "simrandeepna93/java-card", "sub_path": "/JavaApplication2/src/javaapplication2/JavaApplication2.java", "file_name": "JavaApplication2.java", "file_ext": "java", "file_size_in_byte": 1014, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "9f169aca1156c5d3eddef21a40b4468b4c9ec8e5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/simrandeepna93/java-card
| 227
|
FILENAME: JavaApplication2.java
| 0.279042
|
/*
* 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 javaapplication2;
import java.util.Scanner;
/**
* @param args the command line arguments
*/
/**
*
* @author SIMRANDEEP SINGH
*/
public class JavaApplication2 {
public static void main(String args[])
{
card[] deck= new card[4];
Scanner in =new Scanner (System.in);
System.out.println("enter 4 cards:");
for(int i=0;i<deck.length;i++)
{
// card S1=new card;
//deck[i]=S1;
deck [i]=new card(in.next(),in.nextInt());
}
System.out.println("enter 4 cards:");
for(int i=0;i<deck.length;i++)
{
System.out.print(deck[i].getSuit()+" "+deck[i].getValue());
}
}
} /**
* @param args the command line arguments
*/
|
9d9fd9f8-52f2-4fa1-8e07-d64e79157fb4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-07 08:44:01", "repo_name": "sunzequn/SunMySQL", "sub_path": "/Core/src/main/java/com/sunzequn/sunmysql/bean/Property.java", "file_name": "Property.java", "file_ext": "java", "file_size_in_byte": 1073, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "a879984dfea78c5e71d0b0cc176be45034cc711f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sunzequn/SunMySQL
| 234
|
FILENAME: Property.java
| 0.23793
|
package com.sunzequn.sunmysql.bean;
/**
* Created by Sloriac on 15/11/18.
*
* The wrapper class for a property of a entity (a column of a table).
*/
public class Property {
/**
* The name of a property.
*/
private String property;
/**
* The name of the column corresponding to the property above.
*/
private String column;
/**
* The value of the property.
*/
private Object value;
public Property() {
}
public Property(String property, String column, Object value) {
this.property = property;
this.column = column;
this.value = value;
}
public String getProperty() {
return property;
}
public void setProperty(String property) {
this.property = property;
}
public String getColumn() {
return column;
}
public void setColumn(String column) {
this.column = column;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
}
|
df670fef-fe47-4eac-8453-db2afb86f9c1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-28 02:44:22", "repo_name": "angelo0217/SeleniumSample", "sub_path": "/src/main/java/selenium/test/controller/ExceptionController.java", "file_name": "ExceptionController.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "a7a7ca46a3ffb5e25d50bd9d41bab9916d7926b1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/angelo0217/SeleniumSample
| 217
|
FILENAME: ExceptionController.java
| 0.233706
|
package selenium.test.controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import selenium.test.RtnCode;
import selenium.test.exception.SysException;
import selenium.test.vo.Response;
import javax.servlet.http.HttpServletRequest;
/**
* 系統若拋出Exception 都會經過此
* Created on 2018-12-19
*
* @author dean
* @email loveangelo0217@gmail.com
* @since 1.0
*/
@RestController
@ControllerAdvice
//@ControllerAdvice(basePackages ="com.demo.basic")
public class ExceptionController {
@ExceptionHandler(value = Exception.class)
public Response exCenter(HttpServletRequest req, Exception ex) {
if(ex instanceof SysException){
SysException sex = (SysException) ex;
return new Response(sex.getCode(), sex.getMsg());
}else {
ex.printStackTrace();
return new Response(RtnCode.SYSTEM_ERROR, "系統錯誤 : " + ex.getMessage());
}
}
}
|
3c22a21c-b15a-4538-a8ca-854bb4cc370d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-08-09 15:16:10", "repo_name": "daveshepherd/jboss-deployer-plugin", "sub_path": "/src/main/java/uk/co/daveshepherd/maven/plugin/jboss/deployer/jsch/model/DeployableFileSelector.java", "file_name": "DeployableFileSelector.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "485a879ca7145f02aed2732df9f96b3b54e66685", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/daveshepherd/jboss-deployer-plugin
| 231
|
FILENAME: DeployableFileSelector.java
| 0.262842
|
package uk.co.daveshepherd.maven.plugin.jboss.deployer.jsch.model;
import java.util.ArrayList;
import java.util.Collection;
import com.jcraft.jsch.ChannelSftp.LsEntry;
import com.jcraft.jsch.ChannelSftp.LsEntrySelector;
public class DeployableFileSelector implements LsEntrySelector {
private final Collection<LsEntry> matchingEntries = new ArrayList<LsEntry>();
private final String prefix;
private final DeployableType type;
public DeployableFileSelector(final String prefix, final DeployableType type) {
this.prefix = prefix;
this.type = type;
}
public int select(final LsEntry entry) {
final String filename = entry.getFilename();
if (doesFilenameMatch(filename)) {
matchingEntries.add(entry);
}
return CONTINUE;
}
protected boolean doesFilenameMatch(final String filename) {
if (filename == null) {
return false;
}
return filename.endsWith(type.getFileSuffix()) && filename.startsWith(prefix);
}
public Collection<LsEntry> getMatchingEntries() {
return matchingEntries;
}
}
|
81ec2dcd-3681-435e-bc3a-ebbc897439c8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-07 10:54:02", "repo_name": "dlsyaim/EQIMSERVER", "sub_path": "/src/main/java/com/gisinfo/sand/util/docx/model/TableMergeBean.java", "file_name": "TableMergeBean.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "a69ea878f6d8438b1460353c14af848a9fd57420", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dlsyaim/EQIMSERVER
| 295
|
FILENAME: TableMergeBean.java
| 0.267408
|
package com.gisinfo.sand.util.docx.model;
/**
* Created by majun on 2018/3/14.
*/
public class TableMergeBean {
public TableMergeBean() {
}
public TableMergeBean(int startRow, int startCell, int endRow, int endCell) {
this.startRow = startRow;
this.startCell = startCell;
this.endRow = endRow;
this.endCell = endCell;
}
private int startRow;
private int startCell;
private int endRow;
private int endCell;
public int getStartRow() {
return startRow;
}
public TableMergeBean setStartRow(int startRow) {
this.startRow = startRow;
return this;
}
public int getStartCell() {
return startCell;
}
public TableMergeBean setStartCell(int startCell) {
this.startCell = startCell;
return this;
}
public int getEndRow() {
return endRow;
}
public TableMergeBean setEndRow(int endRow) {
this.endRow = endRow;
return this;
}
public int getEndCell() {
return endCell;
}
public TableMergeBean setEndCell(int endCell) {
this.endCell = endCell;
return this;
}
}
|
08c2e74a-c938-4036-ad97-d6e9e1e1d0d3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-28 03:18:12", "repo_name": "MercuryCenfotec/Ponto", "sub_path": "/app/src/main/java/adapter/Carousel_Adapter.java", "file_name": "Carousel_Adapter.java", "file_ext": "java", "file_size_in_byte": 1158, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "0ff5c95195c6c61cc8099a117bfa15e91d8a63d1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MercuryCenfotec/Ponto
| 222
|
FILENAME: Carousel_Adapter.java
| 0.23231
|
package adapter;
import android.content.Context;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import com.cenfotec.ponto.utils.CarouselImage;
import com.cenfotec.ponto.utils.CarouselVideo;
import java.util.List;
public class Carousel_Adapter extends FragmentStatePagerAdapter {
private Context context;
private List<String> carouselFiles;
public Carousel_Adapter(FragmentManager fm, List<String> carouselFiles) {
super(fm);
this.carouselFiles = carouselFiles;
}
@Override
public Fragment getItem(int position) {
if (carouselFiles.get(position).contains("/videos%")) {
return new CarouselVideo(carouselFiles.get(position));
} else {
if (carouselFiles.get(position).contains("/icons%")) {
return new CarouselImage(carouselFiles.get(position), true);
} else {
return new CarouselImage(carouselFiles.get(position));
}
}
}
@Override
public int getCount() {
return carouselFiles.size();
}
}
|
1c1c8548-52d6-46f1-a531-800ee0ec4758
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-07 12:12:29", "repo_name": "niyazkadirov/dadata", "sub_path": "/src/main/java/com/example/dadata/API/DadataApi.java", "file_name": "DadataApi.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "0910f920a674ccc72b63dadaab3fe324ecc89496", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/niyazkadirov/dadata
| 190
|
FILENAME: DadataApi.java
| 0.252384
|
package com.example.dadata.API;
import com.example.dadata.config.AppProperties;
import com.example.dadata.domain.Dadata;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
@Component
public class DadataApi {
@Autowired
private AppProperties appProperties;
public Dadata DadataClient(String location) {
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set(HttpHeaders.AUTHORIZATION, appProperties.getTokenPrefix() + " " + appProperties.getToken());
String requestJson = "{\"query\":\"" + location + "\"}";
HttpEntity<String> entity =
new HttpEntity<>(requestJson, headers);
return restTemplate.postForObject(appProperties.getUrl(), entity, Dadata.class);
}
}
|
2198d0fa-6d49-41f0-8672-713007193ea1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-04-23T04:11:05", "repo_name": "mlx-store/EdfProduct", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1183, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "9f9b55eeae3873212073ba9e6ee723bdda0d8a22", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mlx-store/EdfProduct
| 267
|
FILENAME: README.md
| 0.290176
|
# Export/Import Bulk Product for magento
Export/Import Bulk Product are extension easy used from beginner to expert. The extension could export/import: Configurable Product, Grouped Product, Bundle Product, Downloadable Product, Tier Price, Group Price, Product Tags, Related Products, Up-sells, Cross-sells and Gallery Images. Also, you can use SSH or CRON for export/import.
## Feature
- Support product type:
- Simple Product
- Configurable Product
- Grouped Product
- Bundle Product
- Downloadable Product
- Export/import Tier Price
- Export/import Group Price
- Export/import Product Tags
- Export/import Related Products
- Export/import Up-sells
- Export/import Cross-sells
- Export/import Gallery Images
- Ability use csv for import bulk product to magento 2.x
- Flexible settings for advanced usage.
- W3C XHTML 1.0 Transitional. W3C CSS Valid.
- Fully compatible Chrome, IE, Firefox, Flock, Netscape, Safari, Opera
https://www.mlx-store.com/magento-extensions/import-export/export-import-bulk-product-with-configurable-product-bundle-product-grouped-product-downloadable-product-tier-price-group-price-related-products-up-sells-cross-sells-product-tags-magento.html
|
a4d7261c-1df2-440c-8433-64d263a1df96
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-13 07:45:51", "repo_name": "sapozhnikov-v/sapozhnikov", "sub_path": "/sensorchecker/db/rest/src/main/java/ru/sapozhnikov/sensorschecker/db/rest/sensor/controller/SensorValueController.java", "file_name": "SensorValueController.java", "file_ext": "java", "file_size_in_byte": 1218, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "9a100f68799cbc13e1fa439c011239ee6e1d8444", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/sapozhnikov-v/sapozhnikov
| 257
|
FILENAME: SensorValueController.java
| 0.294215
|
package ru.sapozhnikov.sensorschecker.db.rest.sensor.controller;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import ru.sapozhnikov.sensorschecker.core.sensor.SensorValue;
import ru.sapozhnikov.sensorschecker.db.jdbc.sensor.SensorValueRepository;
import java.util.List;
@RestController
@RequestMapping
public class SensorValueController {
private static Logger logger = LogManager.getLogger(SensorValueController.class);
@Autowired
private SensorValueRepository sensorValueRepository;
@PostMapping(value = "/sensorsvalue", consumes = "application/json")
public void addSensorValue(@RequestBody SensorValue value) {
logger.info("addSensorValue[{}]", value);
sensorValueRepository.addSensorValue(value);
}
@GetMapping(value = "/sensorsvalue/{truckId}", produces = "application/json")
public List<SensorValue> getSensorValueByTruckId(@PathVariable("truckId") int truckId) {
logger.info("getSensorValueByTruckId[{}]", truckId);
return sensorValueRepository.getSensorValueByTruckid(truckId);
}
}
|
35caefbe-70f1-4f18-b653-1a4a82191197
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-03 18:43:26", "repo_name": "userThiagoRamos/frwk", "sub_path": "/blog-gateway/src/main/java/br/com/frwk/gateway/filter/AuthenticatedFilter.java", "file_name": "AuthenticatedFilter.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "9364f577465a34eef3abb80ad6a3b985962b6c82", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/userThiagoRamos/frwk
| 218
|
FILENAME: AuthenticatedFilter.java
| 0.256832
|
package br.com.frwk.gateway.filter;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.User;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
public class AuthenticatedFilter extends ZuulFilter {
@Override
public boolean shouldFilter() {
SecurityContext context = SecurityContextHolder.getContext();
return context.getAuthentication() != null && context.getAuthentication().isAuthenticated();
}
@Override
public Object run() throws ZuulException {
RequestContext requestContext = RequestContext.getCurrentContext();
SecurityContext securityContext = SecurityContextHolder.getContext();
User principal = (User) securityContext.getAuthentication().getPrincipal();
requestContext.addZuulRequestHeader("X-username", principal.getUsername());
return null;
}
@Override
public String filterType() {
return "pre";
}
@Override
public int filterOrder() {
return 6;
}
}
|
bbc16c46-a587-4dc3-aa20-34c80a441a8f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-17 19:16:08", "repo_name": "elefus/epam-practice-2018-06-leti", "sub_path": "/src/com/etu/basic/Example11.java", "file_name": "Example11.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "1fadb19dc1c55645627e6cbd67d0c4ffd215f5fe", "star_events_count": 4, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/elefus/epam-practice-2018-06-leti
| 257
|
FILENAME: Example11.java
| 0.272799
|
package com.etu.basic;
import java.util.*;
import java.util.ArrayList;
public class Example11 {
public static void main(String[] args) {
List<String> list = new ArrayList<>(100);
list.add("ABC");
list.contains("QWERTY");
boolean doesntContain = list.remove("ASD");
list.set(0, "QWERTY");
list.get(0);
List<String> linked = new LinkedList<>();
Set<String> set = new LinkedHashSet<>();
set.add("10");
set.add("asdsa");
System.out.println(set.size());
System.out.println(set.add("10"));
set.add("xzcx");
System.out.println(set.size());
for (String value : set) {
System.out.println(value);
}
Map<Integer, String> map = new HashMap<>();
map.put(10, "abc");
map.put(12, "abc");
Set<Integer> integers = map.keySet();
Collection<String> values = map.values();
System.out.println(map.get(13));
System.out.println(map.get(10));
Queue<Student> students = new LinkedList<>();
Student student = students.peek();
}
}
|
793c2137-a919-491f-acf7-11c91e3e381e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-11 11:09:22", "repo_name": "MyIelts/IeltsSite2.0", "sub_path": "/src/com/tianyi/service/StudentService.java", "file_name": "StudentService.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "76332b9568d65d840984675aa5373546b0ba2ea2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MyIelts/IeltsSite2.0
| 223
|
FILENAME: StudentService.java
| 0.267408
|
package com.tianyi.service;
import com.tianyi.repository.StudentRepository;
public class StudentService {
public String usertype="";
private StudentRepository studentRepository;
public StudentService() {
studentRepository = new StudentRepository();
}
public String save(String userName, String password,
String firstName, String phoneNumber, String accountType,
String emailAddress) {
if (studentRepository != null) {
if (studentRepository.findByUserName(userName)) {
return "SignupFailure-UserNameExists";
}
studentRepository.save(userName, password, firstName, phoneNumber,
accountType, emailAddress);
return "SignupSuccess";
} else {
return "SignupFailure";
}
}
public String findByLogin(String userName, String password) {
String result = "LoginFailure";
if (studentRepository != null) {
boolean status = studentRepository.findByLogin(userName, password);
if (status) {
usertype=studentRepository.RepoUsertype;
result = "LoginSuccess";
}
}
return result;
}
}
|
4396b318-f7b0-4da5-8e81-5686b1ba79e4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-06-02T04:32:10", "repo_name": "Yixf-Education/course_Bioinformatics", "sub_path": "/show/411_content/DNATweezer/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1218, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "376681d4b3516244070a99b1c8f86e35b1e9fcc7", "star_events_count": 28, "fork_events_count": 7, "src_encoding": "UTF-8"}
|
https://github.com/Yixf-Education/course_Bioinformatics
| 307
|
FILENAME: README.md
| 0.252384
|
DNATweezer
==========
DNATweezer is a collection of wrapper scripts for various modules in [BioPerl](http://BioPerl.org).
Tools
-----
The tools in DNATweezer make it easy to access the functionality of some of the BioPerl modules from the command line, without the need to write your own scripts for small tasks. (Even some larger tasks!)
For example, you could remove a sequence with id "E. coli" in a FASTA file, simply by doing:
seq-manipulations.pl -d 'id:E. coli' input_file > new_file
The tools included are:
- **`bioaln`**: A wrapper for Bio::SimpleAlign and Bio::AlignIO.
- **`bioseq`**: A wrapper for Bio::Seq and Bio::SeqIO.
- **`biopop`**: A wrapper for Bio::AlignDNAStatistics, Bio::PopGen::Utilities and other BioPerl population genetics modules.
- **`biotree`**: A wrapper for Bio::Tree::Node, Bio::Tree::Tree and Bio::TreeIO.
A few other minor tools are included as well.
**NOTE** Only `bioaln` and `bioseq` are considered production quality at the moment. The other tools are still under heavy development.
Support
-------
As with any software, these tools can contain bugs and are always going to be works in progress. Thus, feedback such as bug reports and feature requests are welcomed.
|
d24b92b5-825f-4246-871c-1f9e87a7a2b7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-09-22 23:57:51", "repo_name": "dev9com/crash-dummy", "sub_path": "/src/main/java/com/dev9/crash/bad/OpenConnections.java", "file_name": "OpenConnections.java", "file_ext": "java", "file_size_in_byte": 1184, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "a2ff7c47a3eb08573aaa198d01787b524b0af318", "star_events_count": 4, "fork_events_count": 4, "src_encoding": "UTF-8"}
|
https://github.com/dev9com/crash-dummy
| 244
|
FILENAME: OpenConnections.java
| 0.271252
|
package com.dev9.crash.bad;
import com.dev9.crash.AbstractBadThing;
import org.springframework.stereotype.Service;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.InputStream;
import java.net.URL;
@Service
public class OpenConnections extends AbstractBadThing {
static int bytesRead = 0;
static String urlToRead = "http://localhost:8080/";
public String getBadThingDescription() {
return "Attempts to open a network connection to " + urlToRead + ". "
+ bytesRead + " lines read so far.";
}
@Override
public String getBadThingId() {
return "open-network-connection";
}
public String getBadThingName() {
return "Open Network Connection";
}
public String doBadThing() throws Exception {
URL u;
InputStream is = null;
DataInputStream dis;
u = new URL(urlToRead);
is = u.openStream(); // throws an IOException
dis = new DataInputStream(new BufferedInputStream(is));
while (dis.read() != -1) {
bytesRead++;
}
return null;
}
}
|
ca64de2b-1caf-4c83-a9ad-7460cdc507ea
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-05-25 21:29:31", "repo_name": "falkoschumann/uispec4j-issue20", "sub_path": "/src/main/java/de/muspellheim/uispec4j/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "d454fec129b7074433eb67a1ae794b85def42e51", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/falkoschumann/uispec4j-issue20
| 228
|
FILENAME: Main.java
| 0.267408
|
package de.muspellheim.uispec4j;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class Main {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
EntityManagerFactory factory = Persistence
.createEntityManagerFactory("UISpec4J");
EntityManager em = factory.createEntityManager();
final JFrame frame = new JFrame("UISpec4J");
em.createQuery("from Contact", Contact.class).getResultList();
em.close();
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
// XXX set break point to this method to trigger race condition
System.out.println("windowClosed");
em.close();
factory.close();
}
});
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(640, 480);
frame.setVisible(true);
});
}
}
|
33e5f881-3904-438b-baaa-72866ef014ed
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-07 01:50:27", "repo_name": "chaoyaoyc/wework-test", "sub_path": "/src/main/java/com/wework/chao/WebSearcher.java", "file_name": "WebSearcher.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "453d49ef856ff07924429d67099e86291481a6bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/chaoyaoyc/wework-test
| 250
|
FILENAME: WebSearcher.java
| 0.292595
|
package com.wework.chao;
import java.io.IOException;
import java.util.regex.Pattern;
/**
* Supports searching a regex in the web content.
*/
public class WebSearcher {
private final Pattern pattern;
private final HttpRetriever httpRetriever;
/**
* Creates with regex and the default HttpRetriever
* @param pattern regex pattern
*/
public WebSearcher(String pattern) {
this(pattern, new ApacheHttpRetriever());
}
/**
* @param pattern regex pattern
* @param httpRetriever HttpRetriever object that gets web contents into a string
*/
public WebSearcher(String pattern, HttpRetriever httpRetriever) {
this.pattern = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
this.httpRetriever = httpRetriever;
}
/**
* @param url a web url link
* @return whether the web page specified by 'url' contains the regex.
* @throws IOException
*/
public boolean contains(String url) throws IOException {
String content = httpRetriever.get(url);
return pattern.matcher(content).find();
}
}
|
7c0ed37a-4e63-40d9-81ae-4a7dd48ba635
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-05-19 06:32:36", "repo_name": "songsongdahu/PLcompiler", "sub_path": "/src/others/item.java", "file_name": "item.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 70, "lang": "en", "doc_type": "code", "blob_id": "a058b720da24ff3f7257dd9ba35f11b70d36bd2d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "GB18030"}
|
https://github.com/songsongdahu/PLcompiler
| 328
|
FILENAME: item.java
| 0.279828
|
package others;
public class item {
private int tml;//0 终结符 1 非终结符 2空
private String dsb;//描述
private String place;//语义相关
private String sym;//语义相关
public item(int tml){
this.tml = tml;
this.dsb = "";
}
public item(int tml, String dsb){
this.tml = tml;
this.dsb = dsb;
}
public item(String dsb, String place, String sym){
this.tml = 0;
this.dsb = dsb;
this.place = place;
this.sym = sym;
}
public void setTml(int tml){
this.tml = tml;
}
public int getTml(){
return tml;
}
public String getDsb() {
return dsb;
}
public void setDsb(String dsb) {
this.dsb = dsb;
}
public boolean equals(item anit){
if(this.tml==anit.tml&&this.dsb.equals(anit.dsb)){
return true;
} else {
return false;
}
}
public String toString(){
return dsb;
}
public String getPlace() {
return place;
}
public void setPlace(String place) {
this.place = place;
}
public String getSym() {
return sym;
}
public void setSym(String sym) {
this.sym = sym;
}
}
|
12831288-aa58-4f2b-81dd-7c4dbed69891
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-31 02:38:04", "repo_name": "rGiladi/spring-recipes-app", "sub_path": "/src/main/java/com/roy/controllers/ErrorHandlingController.java", "file_name": "ErrorHandlingController.java", "file_ext": "java", "file_size_in_byte": 1158, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "00a6894a12e9f606c67bc98b559327c222e52a45", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rGiladi/spring-recipes-app
| 240
|
FILENAME: ErrorHandlingController.java
| 0.29584
|
package com.roy.controllers;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.roy.models.Search;
@Controller
public class ErrorHandlingController implements ErrorController {
private static final String PATH = "/error";
@RequestMapping(value = PATH)
public String error(Model model) {
model.addAttribute("search", new Search());
try {
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource("static/photos/error_img_slider").getFile());
final String img_folder = "photos/error_img_slider/";
List<String> images = new ArrayList<String>();
for (File img : file.listFiles() ) {
images.add(img_folder + img.getName());
}
if (images.size() != 0) {
model.addAttribute("images", images);
}
}catch(Exception ex){}
return "404";
}
@Override
public String getErrorPath() {
return PATH;
}
}
|
4a0c302b-8145-458c-9750-56c551390331
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-28 14:20:47", "repo_name": "rspseshasai/temp", "sub_path": "/demo/src/main/java/com/example/demo/ServiceImpl/UserServiceImpl.java", "file_name": "UserServiceImpl.java", "file_ext": "java", "file_size_in_byte": 990, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "4680a07891d5821b74687c42ff9bf17af26184c0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rspseshasai/temp
| 177
|
FILENAME: UserServiceImpl.java
| 0.290981
|
package com.example.demo.ServiceImpl;
import java.util.List;
import java.util.Optional;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.demo.Model.User;
import com.example.demo.Repository.UserRepository;
import com.example.demo.Service.UserService;
@Service
@Transactional
public class UserServiceImpl implements UserService {
@Autowired
UserRepository userRepository;
@Override
public void createUser(User user) {
userRepository.save(user);
}
@Override
public User getUserById(long id) {
return userRepository.findOne((int) id);
}
@Override
public List<User> getAllUsers() {
return (List<User>) userRepository.findAll();
}
@Override
public void updateUser(User user) {
userRepository.save(user);
}
@Override
public void deleteUser(int id) {
userRepository.deleteById( id);
}
}
|
af4fb33a-90e6-45ae-ab7e-d9f2f2c44dfa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-25 02:18:29", "repo_name": "miaozhenkai/HaiWangWuLiu", "sub_path": "/src/main/java/com/haiwang/logistics/controller/fore/RouteController.java", "file_name": "RouteController.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "4f3e31b433cf0aa566fd078b50dac3006005dc27", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/miaozhenkai/HaiWangWuLiu
| 195
|
FILENAME: RouteController.java
| 0.295027
|
package com.haiwang.logistics.controller.fore;
import com.haiwang.logistics.service.RouteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
@Controller
@RequestMapping("/route")
public class RouteController {
@Autowired
private RouteService routeService;
@ResponseBody
@RequestMapping("/route1")
private Double price(HttpServletRequest request){
double itemWeight= Double.parseDouble(request.getParameter("itemWeight"));
String senderProvinces=request.getParameter("senderProvinces");
String receiverProvinces=request.getParameter("receiverProvinces");
// double i=routeService.getPriceByPrvoinces("北京市","辽宁省大连市",10);
double i=routeService.getPriceByPrvoinces(senderProvinces,receiverProvinces,itemWeight);
System.out.println("p"+i);
return i;
}
}
|
d6ce2fbb-adef-4d1c-b41c-9d53afc80837
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-05-25T16:42:44", "repo_name": "taipeicameraclub/jasontsai0408.github.io", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1219, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "948830cd1802e2f08ac1fb9d264162ff4073ddbe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/taipeicameraclub/jasontsai0408.github.io
| 427
|
FILENAME: README.md
| 0.225417
|
<h2>jasontsai0408.github.io</h2>
<h4>Some Points of my website:</h4>
<h5>Most part of my website are from bootstrap : https://getbootstrap.com/</h5>
<h5>A. About Me (Home Page)</h5>
<h5> Fontfamily: From Google Font</h5>
<h5> Bootstrap: Navs</h5>
<h5> Bootstrap: Carousels</h5>
<h5> Bootstrap: Card</h5>
<h5> There are "Buttons" for other website</h5>
<h5> I have my own blog(study and photo), which are in the link.</h5>
<h5>B. Photography (Second Page)</h5>
<h5> Bootstrap: Card</h5>
<h5>C. Contact Me (Third Page)</h5>
<h5> Bootstrap: Card</h5>
<h5> At the part of Gmail, I use this method to link my email:https://blog.xuite.net/jason_kuso/kuso/38943441-%E3%80%90html%E3%80%91E-mail%E8%B6%85%E9%80%A3%E7%B5%90</h5>
<h5> The final part - comment area, you can comment on there and it will show yout comment above<br> but there is still one problem , if we reset the page, it will disappear.</h5>
<h5> Method: https://www.itread01.com/content/1549559192.html</h5>
<h3>The most important thing is!!! Those photos and atmospheric diagram are taken and made by myself!!!</h3>
|
16728e90-fb79-4898-9339-1cbe0a2962f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-12 11:22:48", "repo_name": "SoffidIAM/addon-reports", "sub_path": "/meta/src/main/java/com/soffid/iam/addons/report/model/ExecutedReportParameterEntity.java", "file_name": "ExecutedReportParameterEntity.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "dbb80e10b2c961fe38c73600d55fd581631d8f50", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SoffidIAM/addon-reports
| 295
|
FILENAME: ExecutedReportParameterEntity.java
| 0.282196
|
package com.soffid.iam.addons.report.model;
import java.util.Date;
import com.soffid.iam.addons.report.api.ParameterType;
import com.soffid.iam.addons.report.api.ParameterValue;
import com.soffid.mda.annotation.Column;
import com.soffid.mda.annotation.Depends;
import com.soffid.mda.annotation.Description;
import com.soffid.mda.annotation.Entity;
import com.soffid.mda.annotation.Identifier;
import com.soffid.mda.annotation.Nullable;
@Entity(table="SCR_EXREPA")
@Depends({ParameterValue.class})
public class ExecutedReportParameterEntity {
@Identifier
@Nullable
@Column(name = "ERP_ID")
Long id;
@Column(name = "ERP_ERE_ID", reverseAttribute="parameters", composition=true)
ExecutedReportEntity report;
@Column(name = "ERP_NAME")
String name;
@Column(name = "ERP_STRVAL", length=1024)
@Nullable
String stringValue;
@Column(name = "ERP_DATVAL")
@Nullable
Date dateValue;
@Column(name = "ERP_LONVAL")
@Nullable
Long longValue;
@Column(name = "ERP_DOUVAL")
@Nullable
Double doubleValue;
@Column(name = "ERP_BOOVAL")
@Nullable
Boolean booleanValue;
@Column(name= "ERP_TYPE")
ParameterType type;
}
|
934370f9-e458-4859-8e38-25e730b10fe7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-07-15 00:10:49", "repo_name": "mimaraslan/jpa-hibernate", "sub_path": "/_007_jpa-hibernate-many-to-many-xml/src/main/java/com/mimaraslan/model/Customer.java", "file_name": "Customer.java", "file_ext": "java", "file_size_in_byte": 1098, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "8cb4c0a73dd7935f7999a6e091a9e525b10479d0", "star_events_count": 5, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/mimaraslan/jpa-hibernate
| 216
|
FILENAME: Customer.java
| 0.239349
|
package com.mimaraslan.model;
import java.util.HashSet;
import java.util.Set;
public class Customer {
private int customerId;
private String title;
private String name;
private Set<Address> addresses = new HashSet<Address>(0);
public Customer() {
}
public Customer(String title, String name, Set<Address> addresses) {
this.title = title;
this.name = name;
this.addresses = addresses;
}
public int getCustomerId() {
return customerId;
}
public void setCustomerId(int customerId) {
this.customerId = customerId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Set<Address> getAddresses() {
return addresses;
}
public void setAddresses(Set<Address> addresses) {
this.addresses = addresses;
}
}
|
48b64edb-984c-4ed1-a080-a39710130c33
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-04 11:55:37", "repo_name": "blazejnorys/trip-planner", "sub_path": "/src/main/java/com/elkdev/tripPlanner/continent/controller/ContinentController.java", "file_name": "ContinentController.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "9091f00ff5549ceba5ee262ec2772172fb011191", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/blazejnorys/trip-planner
| 193
|
FILENAME: ContinentController.java
| 0.233706
|
package com.elkdev.tripPlanner.continent.controller;
import com.elkdev.tripPlanner.continent.model.Continent;
import com.elkdev.tripPlanner.continent.service.ContinentService;
import com.elkdev.tripPlanner.country.model.Country;
import com.elkdev.tripPlanner.country.service.CountryService;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/continent")
@CrossOrigin
public class ContinentController {
private final ContinentService continentService;
@Autowired
public ContinentController(ContinentService continentService) {
this.continentService = continentService;
}
@GetMapping(value = "/get-all")
public List<Continent> getAllContinents(){
return continentService.findAllContinents();
}
}
|
505c788e-8cb4-4566-a526-43e8d5ce5e27
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-06-06 14:37:00", "repo_name": "nikita-shah/performanceMonitor", "sub_path": "/PerformanceMonitor/src/model/SystemProcessInfo.java", "file_name": "SystemProcessInfo.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 95, "lang": "en", "doc_type": "code", "blob_id": "8671df03b379c22b1818005342db01bf81364f5d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nikita-shah/performanceMonitor
| 321
|
FILENAME: SystemProcessInfo.java
| 0.280616
|
package model;
import org.hyperic.sigar.ProcCpu;
import org.hyperic.sigar.ProcMem;
public class SystemProcessInfo {
String name;
long pid[];
ProcCpu cpu;
ProcMem mem;
public SystemProcessInfo()
{
}
public SystemProcessInfo(String name)
{
this.name = name;
pid=null;
cpu=null;
mem=null;
}
public SystemProcessInfo(String name,long[]pid)
{
this.name = name;
this.pid=pid;
cpu=null;
mem=null;
}
public SystemProcessInfo(String name, long[] pids, ProcCpu cpu, ProcMem mem) {
super();
this.name = name;
this.pid = pids;
this.cpu = cpu;
this.mem = mem;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
* @return the pid
*/
public long[] getPid() {
return pid;
}
/**
* @param pid the pid to set
*/
public void setPid(long[] pid) {
this.pid = pid;
}
/**
* @return the cpu
*/
public ProcCpu getCpu() {
return cpu;
}
/**
* @param cpu the cpu to set
*/
public void setCpu(ProcCpu cpu) {
this.cpu = cpu;
}
/**
* @return the mem
*/
public ProcMem getMem() {
return mem;
}
/**
* @param mem the mem to set
*/
public void setMem(ProcMem mem) {
this.mem = mem;
}
}
|
bab8381a-ef4b-4b30-ac33-05954dafad5e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-21 06:49:33", "repo_name": "GuoLHlive/StopAp", "sub_path": "/app/src/main/java/com/example/administrator/stopapp/fragment/NextFragment.java", "file_name": "NextFragment.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "546dd35ece18b7b56dd6230f0274b2a13b007c7a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/GuoLHlive/StopAp
| 215
|
FILENAME: NextFragment.java
| 0.255344
|
package com.example.administrator.stopapp.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.administrator.stopapp.R;
import com.example.administrator.stopapp.databinding.NextfragmentLayoutBinding;
/**
* Created by Administrator on 2016/12/5.
*/
public class NextFragment extends BaseFragment{
private NextfragmentLayoutBinding binding;
private NextFragment nextFragment;
private FirstFragment firstFragment;
@Override
public int getLayoutId() {
return R.layout.nextfragment_layout;
}
@Override
public void initView() {
binding = (NextfragmentLayoutBinding) view;
binding.setTxt("NextFragment");
firstFragment = new FirstFragment();
nextFragment = this;
binding.setOnClick(new View.OnClickListener() {
@Override
public void onClick(View view) {
switchContent(nextFragment,firstFragment);
}
});
}
}
|
2311acc8-befd-4071-9ef5-bd279c8f773a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-11 10:59:06", "repo_name": "Tukenbayevv/projectsdutechnopark", "sub_path": "/app/src/main/java/nurik/projectsdutechnopark/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "5ee1442aa3189c020224c14a4d352c8a35c00b73", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Tukenbayevv/projectsdutechnopark
| 208
|
FILENAME: MainActivity.java
| 0.235108
|
package nurik.projectsdutechnopark;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.MenuItem;
import com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx;
public class MainActivity extends AppCompatActivity {
private MainFragment mainFragment;
private FragmentTransaction fragmentTransaction;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
BottomNavigationViewEx menu = (BottomNavigationViewEx) findViewById(R.id.menu);
mainFragment = new MainFragment();
fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.frame, mainFragment);
fragmentTransaction.commit();
menu.enableShiftingMode(false);
menu.enableItemShiftingMode(false);
menu.setTextVisibility(false);
menu.setIconSize(25, 25);
menu.setCurrentItem(1);
}
}
|
5cbef624-6e93-4814-a770-f635b1b14698
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-12T01:22:36", "repo_name": "stelagasi/NENR", "sub_path": "/genetic-algorithm/src/main/java/hr/fer/nenr/geneticalgorithm/Individual.java", "file_name": "Individual.java", "file_ext": "java", "file_size_in_byte": 1132, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "7135b33ae9576ba658b7d4ac2cd851e7d8a0f6d0", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/stelagasi/NENR
| 240
|
FILENAME: Individual.java
| 0.293404
|
package hr.fer.nenr.geneticalgorithm;
import java.util.List;
import java.util.Objects;
public class Individual {
private final List<Double> chromosomes;
private double penalty;
public Individual(List<Double> chromosomes) {
this.chromosomes = chromosomes;
}
public List<Double> getChromosomes() {
return chromosomes;
}
public double getPenalty() {
return penalty;
}
public void setPenalty(double penalty) {
this.penalty = penalty;
}
@Override
public String toString() {
return "Individual{" +
"chromosomes=" + chromosomes +
", penalty=" + penalty +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Individual that = (Individual) o;
return Double.compare(that.penalty, penalty) == 0 &&
Objects.equals(chromosomes, that.chromosomes);
}
@Override
public int hashCode() {
return Objects.hash(chromosomes, penalty);
}
}
|
2fe83213-7910-4b69-a3d0-15a179d36f05
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-24 00:55:18", "repo_name": "Amperial/Relics", "sub_path": "/modules/plugin/src/main/java/com/herocraftonline/items/crafting/recipe/result/RelicResult.java", "file_name": "RelicResult.java", "file_ext": "java", "file_size_in_byte": 826, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "c350ca08496d92b46527a4dcaf44e6dd2c7bb151", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Amperial/Relics
| 237
|
FILENAME: RelicResult.java
| 0.284576
|
/*
* This file is part of Relics.
*
* Copyright (c) 2017, Austin Payne <amperialdev@gmail.com - http://github.com/Amperial>
*
* All Rights Reserved.
*
* Unauthorized copying and/or distribution of Relics,
* via any medium is strictly prohibited.
*/
package com.herocraftonline.items.crafting.recipe.result;
import com.herocraftonline.items.api.crafting.Result;
import com.herocraftonline.items.api.item.Item;
import com.herocraftonline.items.api.item.attribute.attributes.crafting.Reagent;
import org.bukkit.inventory.ItemStack;
public class RelicResult implements Result {
private final Item result;
public RelicResult(Item result) {
this.result = result;
}
@Override
public ItemStack getItem() {
return result.getItem();
}
@Override
public String getDisplayIcon() {
return result.getAttribute(Reagent.class).map(reagent -> reagent.getReagentType().getDisplayIcon()).orElse(result.getMaterial().name().toLowerCase());
}
@Override
public String toString() {
return result.getName();
}
}
|
8ae90d5d-54cb-46c7-97ca-f370c38382f0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-21 19:36:30", "repo_name": "bobbyms999/Bgv", "sub_path": "/Bgv/src/main/java/com/accredilink/bgv/controller/LoginController.java", "file_name": "LoginController.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "28e1f4cd97f515d6e8befbf1ce74618770da5b3e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bobbyms999/Bgv
| 204
|
FILENAME: LoginController.java
| 0.235108
|
package com.accredilink.bgv.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.accredilink.bgv.pojo.Login;
import com.accredilink.bgv.service.LoginService;
import com.accredilink.bgv.util.ResponseObject;
@RestController
@RequestMapping("/user")
@CrossOrigin(origins = "*", allowedHeaders = "*")
public class LoginController {
@Autowired
private LoginService loginService;
@PostMapping("/login")
public ResponseObject loginUser(@RequestBody Login login) {
return loginService.login(login);
}
@PostMapping("/forgotpassword")
public ResponseObject forgotPassword(@RequestBody Login login) {
return loginService.forgot(login);
}
@PostMapping("/resetpassword")
public ResponseObject resetPassword(@RequestBody Login login) {
return loginService.reset(login);
}
}
|
5ad77f29-80b9-440a-b36b-082240d5c79b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-31 08:50:19", "repo_name": "WYK845634621/ordinary", "sub_path": "/src/distributedlock/ZkTest.java", "file_name": "ZkTest.java", "file_ext": "java", "file_size_in_byte": 1107, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "e4ba79a5e0b7ff7d9dfe9e7e0cd19c2240b95e4d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/WYK845634621/ordinary
| 250
|
FILENAME: ZkTest.java
| 0.259826
|
package distributedlock;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* @Description
* @Tips
* @Author yikai.wang
* @Date 2020/4/13 10:36
*/
public class ZkTest implements Runnable {
private static int inventory = 1;
private static final int NUM = 10;
private static CountDownLatch cdl = new CountDownLatch(NUM);
private static Lock lock = new ReentrantLock();
public static void main(String[] args) {
for (int i = 0; i < NUM; i++) {
new Thread(new ZkTest()).start();
cdl.countDown();
}
}
@Override
public void run() {
lock.lock();
try {
cdl.await();
if (inventory > 0){
TimeUnit.SECONDS.sleep(5);
inventory--;
}
System.out.println("库存: " + inventory);
} catch (InterruptedException e) {
e.printStackTrace();
}finally {
lock.unlock();
}
}
}
|
3a227fcf-2a94-4a48-93d5-99f5d06ed900
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-06-23 02:20:49", "repo_name": "norven63/drive_android", "sub_path": "/drive-android/src/main/java/com/goodow/drive/android/receiver/DownloadBroadcastReceiver.java", "file_name": "DownloadBroadcastReceiver.java", "file_ext": "java", "file_size_in_byte": 1004, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "2457f50287161dfa0c5cdfb8a3866795f407b858", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/norven63/drive_android
| 198
|
FILENAME: DownloadBroadcastReceiver.java
| 0.235108
|
package com.goodow.drive.android.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.goodow.drive.android.toolutils.OfflineFileObserver;
import com.goodow.realtime.Realtime;
import com.goodow.realtime.channel.constant.MessageType;
import elemental.json.Json;
import elemental.json.JsonObject;
public class DownloadBroadcastReceiver extends BroadcastReceiver {
private final String TAG = this.getClass().getSimpleName();
@Override
public void onReceive(Context context, Intent intent) {
String data = intent.getStringExtra(MessageType.DOWNLOAD.name());
JsonObject json = Json.parse(data);
String userId = json.getString("userId");
String token = json.getString("token");
if (Realtime.getToken() == null) {
Realtime.authorize(userId, token);
}
OfflineFileObserver.OFFLINEFILEOBSERVER.addAttachment(json);
Log.i(TAG, "Download :" + json.toString());
}
}
|
2c9f1c26-2ab0-4f64-bf74-a29e272d84bd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-03-16T23:32:26", "repo_name": "denniseortega/portfolio", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1092, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "c96b89e58106da78666da3bb8c655e34d0b87028", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/denniseortega/portfolio
| 258
|
FILENAME: README.md
| 0.261331
|
# _Portfolio Landing Page_
#### _Portfolio web page using HTML and CSS, 03/16/2018_
#### By _**Dennise Ortega**_
## Description
_This is my first Independent Project at Epicodus. It is a Portfolio Landing Page for my programming projects accomplished throughout my first week of class, as well as for future projects._
## Setup/Installation Requirements
* _Web browser_
* _HTML and CSS_
* _denniseortega.github.io/portfolio_
_This project only uses HTML and CSS._
## Known Bugs
_I had trouble successfully viewing my live GitHub Pages site. I believe I was committing changes in the gh-pages branch instead of the master branch. I thought that deleting my repository in Github would help, but I learned that I had to delete my repository locally by using rm -rf .git in order for that to work. I wonder if there is a more efficient way to do/if there was a different problem._
## Support and contact details
_Feel free to contact me if you have any questions, ideas, or concerns!_
## Technologies Used
_HTML and CSS_
### License
*MIT*
Copyright (c) 2016 **_Dennise Ortega_**
|
8832bdbf-dca7-4795-b66a-40f21cf38636
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-08 01:35:10", "repo_name": "yangjiafus/domain-poi", "sub_path": "/src/main/java/com/ctspcl/poi/rule/NotBlankRowRule.java", "file_name": "NotBlankRowRule.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "3eefc558be881efb5527ca0158e556373900d095", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yangjiafus/domain-poi
| 217
|
FILENAME: NotBlankRowRule.java
| 0.262842
|
package com.ctspcl.poi.rule;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row;
import org.springframework.util.StringUtils;
import java.util.Iterator;
/**
* @author JiaFu.yang
* @description
* @date 2019/6/10
**/
public class NotBlankRowRule extends RowRule{
@Override
public boolean isMatchRule(Row row) {
return isNotBlankRow(row);
}
private boolean isNotBlankRow(Row r){
Iterator<Cell> iterator = r.cellIterator();
boolean isValid = false;
Cell cell;
while (iterator.hasNext()){
cell = iterator.next();
if (cell != null){
if (!cell.getCellTypeEnum().equals(CellType.BLANK)){
if (cell.getCellTypeEnum().equals(CellType.STRING)){
if (StringUtils.isEmpty(cell.getStringCellValue())){
continue;
}
}
isValid = true;
break;
}
}
}
return isValid;
}
}
|
c53409a0-a1fb-4631-8287-370c4300da0a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-22 19:36:17", "repo_name": "DenisRomashov/GoAnyWhere", "sub_path": "/Full/GoAnyWhere/backend/src/main/java/ga/goanywhere/entities/UserEntity.java", "file_name": "UserEntity.java", "file_ext": "java", "file_size_in_byte": 1156, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "2fae943a9235a0ac7f91be44baa68a0322f401c1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/DenisRomashov/GoAnyWhere
| 250
|
FILENAME: UserEntity.java
| 0.259826
|
package ga.goanywhere.entities;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
import javax.persistence.*;
import java.sql.Date;
import java.util.Collection;
@Getter
@Setter
@EqualsAndHashCode
@Entity
@Table(name = "user", schema = "goanywhere", catalog = "")
@NoArgsConstructor
@AllArgsConstructor
public class UserEntity {
@Id
@GeneratedValue
@Column(name = "id")
private Long id;
@Column(name = "username")
private String username;
@JsonIgnore
@Column(name = "password")
private String password;
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Column(name = "sex")
private String sex;
@Column(name = "birthday")
private Date birthday;
@ManyToOne
@JoinColumn(name = "address_id")
private AddressEntity userAddress;
@OneToOne(mappedBy = "user")
private UserContactEntity userContact;
@JsonIgnore
@OneToMany(mappedBy = "userMeetingPK.participant")
private Collection<UserMeetingEntity> meetings;
public UserEntity(Long id) {
this.id = id;
}
}
|
9256fbd0-b7e5-4283-8905-94bf4545af21
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-08 17:07:08", "repo_name": "alexr007/java-web", "sub_path": "/src/main/java/org/alexr/web/entity/Person.java", "file_name": "Person.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "ae35d26bb184eaff8e4542caa8d8ef3092c3346e", "star_events_count": 12, "fork_events_count": 5, "src_encoding": "UTF-8"}
|
https://github.com/alexr007/java-web
| 285
|
FILENAME: Person.java
| 0.282196
|
package org.alexr.web.entity;
import java.util.ArrayList;
import java.util.List;
public class Person {
private int id;
private String name;
private int age;
private List<String> skills;
public Person() { }
public Person(int id, String name, int age) {
this(id, name, age, new ArrayList<>(0));
}
public Person(int id, String name, int age, List<String> skills) {
this.id = id;
this.name = name;
this.age = age;
this.skills = skills;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public int getId() {
return id;
}
public List<String> getSkills() {
return skills;
}
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setAge(int age) {
this.age = age;
}
public void setSkills(List<String> skills) {
this.skills = skills;
}
@Override
public String toString() {
return String.format("Person{id=%d, name='%s', age=%d, skills=%s}", id, name, age, skills);
}
}
|
0f3ff20e-0652-437e-a6a0-d8b272bd2117
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-10 14:14:16", "repo_name": "arpit2425/Assignment1", "sub_path": "/app/src/main/java/com/assignment/arpit/assignment/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "6733608b38e6afe1feaaa76b290d59e2a063cec3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/arpit2425/Assignment1
| 195
|
FILENAME: MainActivity.java
| 0.272025
|
package com.assignment.arpit.assignment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class MainActivity extends AppCompatActivity {
RecyclerView recyclerView;
List<listItem> listItems;
Random r=new Random();
RecyclerView.Adapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
recyclerView=findViewById(R.id.recycle);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
listItems=new ArrayList<>();
for(int i=0;i<10;i++)
{
listItem listItem=new listItem("User "+(i+1),(10+r.nextInt(30)));
listItems.add(listItem);
}
adapter=new MyAdaptor(listItems,this);
recyclerView.setAdapter(adapter);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.