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
c6a91477-83c1-400b-a464-bcbad51df7cd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-18 08:29:23", "repo_name": "VarshiniRaghu/MagazineNews", "sub_path": "/app/src/main/java/com/sliide/news/network/ApiModule.java", "file_name": "ApiModule.java", "file_ext": "java", "file_size_in_byte": 1182, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "0e349cbe74d1666ec4d9efc6475838e26899dd49", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/VarshiniRaghu/MagazineNews
222
FILENAME: ApiModule.java
0.282988
package com.sliide.news.network; import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import dagger.Module; import dagger.Provides; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; @Module public class ApiModule { public static String BASE_URL = "http://bit.ly/"; @Provides public OkHttpClient provideClient() { HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(); interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); return new OkHttpClient.Builder().addInterceptor(interceptor).build(); } @Provides public Retrofit provideRetrofit (OkHttpClient client){ return new Retrofit.Builder() .baseUrl(BASE_URL) .client(client) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create()) .build(); } @Provides public ApiInterface provideApiService(){ return provideRetrofit(provideClient()).create(ApiInterface.class); } }
73c90fed-3fe2-45ea-b6c9-e0f601160a71
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-15 03:44:26", "repo_name": "tchouatchawilly/encrypt-decrypt-service", "sub_path": "/src/main/java/com/handson/encryptdecrypt/service/gcp/GcpEncryptionServiceImpl.java", "file_name": "GcpEncryptionServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "d132c1deb048d1c2164c0094eb5d70f8c34faaab", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tchouatchawilly/encrypt-decrypt-service
240
FILENAME: GcpEncryptionServiceImpl.java
0.276691
package com.handson.encryptdecrypt.service.gcp; import com.google.cloud.kms.v1.CryptoKeyName; import com.google.cloud.kms.v1.EncryptResponse; import com.google.cloud.kms.v1.KeyManagementServiceClient; import com.google.protobuf.ByteString; import com.handson.encryptdecrypt.service.EncryptionService; import lombok.RequiredArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Service; import java.util.Base64; @ConditionalOnProperty(prefix = "encryption.provider.gcp", name = "enabled", havingValue = "true") @Service @RequiredArgsConstructor(onConstructor = @__(@Autowired)) @Log4j2 public class GcpEncryptionServiceImpl implements EncryptionService { private final KeyManagementServiceClient client; private final CryptoKeyName cryptoKeyName; @Override public String encrypt(String plainText) { EncryptResponse response = client.encrypt(cryptoKeyName, ByteString.copyFromUtf8(plainText)); var value = response.getCiphertext().toByteArray(); return Base64.getEncoder().encodeToString(value); } }
cc14680c-ae64-42a7-bc1f-32e78fd8ed97
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-21 11:06:43", "repo_name": "santibayo/java_authserver", "sub_path": "/src/main/java/es/boalis/security/auth/identity/IdentityFactory.java", "file_name": "IdentityFactory.java", "file_ext": "java", "file_size_in_byte": 1011, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "a2e84cffdc83e504f77dfcaa4bdd233067498c9e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/santibayo/java_authserver
184
FILENAME: IdentityFactory.java
0.256832
package es.boalis.security.auth.identity; import es.boalis.security.auth.NotFound; import java.util.HashMap; import java.util.Map; public class IdentityFactory { private Map<String,IdentityContract> services; public void setServices(Map<String, IdentityContract> services) { this.services = services; } public IdentityContract get(String tenant) throws NotFound{ if (tenant==null){ return new IdentityContract() { @Override public Identity getFromUserId(String uid) throws NotFound { Map<String,String> atts = new HashMap<>(); Identity id = new Identity(uid,atts); return id; } }; }else{ IdentityContract contract = services.get(tenant); if (contract==null){ throw new NotFound("IF:00001","IdentityService not found"); } return contract; } } }
5777d9fa-39f5-4972-9f6b-25832b899c67
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-12-06 11:27:01", "repo_name": "Curwer-zz/SpotsMap", "sub_path": "/app/src/main/java/net/eray/ParkourPlayground/ad/AdFragment.java", "file_name": "AdFragment.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "a172945713023a619dbcd0dd1f28bc6750853d5c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Curwer-zz/SpotsMap
231
FILENAME: AdFragment.java
0.255344
package net.eray.ParkourPlayground.ad; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdView; import net.eray.ParkourPlayground.R; /** * Created by Niclas on 2014-10-13. */ public class AdFragment extends Fragment { private AdView mAdView; public AdFragment() { } @Override public void onActivityCreated(Bundle bundle) { super.onActivityCreated(bundle); mAdView = (AdView) getView().findViewById(R.id.adView); AdRequest adRequest = new AdRequest.Builder().build(); mAdView.loadAd(adRequest); } public static class PlaceholderFragment extends Fragment { public PlaceholderFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_ad, container, false); return rootView; } } }
b39ddd11-8283-4f7d-9faa-f6db28a3a25f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-11 19:17:17", "repo_name": "BBK-PiJ-2015-56/Generics", "sub_path": "/GenericList/src/GenericLinkedList.java", "file_name": "GenericLinkedList.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "1c672327bf6c62363c0f6b1e3f5af176f2476853", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/BBK-PiJ-2015-56/Generics
220
FILENAME: GenericLinkedList.java
0.23793
/** * Created by pdomok01 on 11/01/2016. */ public class GenericLinkedList { Object obj <T>; public void insert(Person person) { if (personListStart == null) { personListStart = person; System.out.println(person.getName() + " has joined the queue in position 1."); } else { personListStart.addPerson(person); } } public Person retrieve() { if (personListStart == null) { System.out.println("There are no people in the queue."); return null; } else { Person personLeaving = personListStart; personListStart = personListStart.getNext(); System.out.println(personLeaving.getName() + " has left the queue."); return personLeaving; } } public String toString() { if (personListStart == null) { return "The queue is empty."; } else { return personListStart.getQueueNames(); } } }
ac16ba8d-b166-44c7-a3c9-48b38e911e9b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-12 21:47:18", "repo_name": "varmax2511/GraphOfTrust", "sub_path": "/src/main/java/edu/buffalo/cse/wot/neo4j/Pair.java", "file_name": "Pair.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 67, "lang": "en", "doc_type": "code", "blob_id": "a1588198d0da9e1fdcba353410a96038401906f1", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/varmax2511/GraphOfTrust
296
FILENAME: Pair.java
0.285372
package edu.buffalo.cse.wot.neo4j; /** * * @author varunjai * * @param <K> * @param <V> */ public class Pair<K, V> { private final K key; private final V value; /** * * @param key * @param value */ public Pair(K key, V value) { this.key = key; this.value = value; } /** * * @return */ public K getKey() { return key; } /** * * @return */ public V getValue() { return value; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Pair other = (Pair) obj; if (key == null) { if (other.key != null) return false; } else if (!key.equals(other.key)) return false; return true; } }
04d00e29-b185-4ee2-8e3f-e54fbae4f369
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-28 14:02:17", "repo_name": "CELAR/celar-server", "sub_path": "/slipstream-client/src/test/java/gr/ntua/cslab/celar/slipstreamClient/CassandraApp.java", "file_name": "CassandraApp.java", "file_ext": "java", "file_size_in_byte": 1188, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "d6a5c4e4d589bf54e10c8c06722bb5140563caae", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/CELAR/celar-server
298
FILENAME: CassandraApp.java
0.291787
package gr.ntua.cslab.celar.slipstreamClient; import java.util.HashMap; import com.sixsq.slipstream.exceptions.ValidationException; import com.sixsq.slipstream.persistence.Authz; import com.sixsq.slipstream.persistence.DeploymentModule; import com.sixsq.slipstream.persistence.ImageModule; import com.sixsq.slipstream.persistence.Module; import com.sixsq.slipstream.persistence.Node; import gr.ntua.cslab.celar.slipstreamClient.SlipStreamSSService; public class CassandraApp { public static void putModule(SlipStreamSSService ssservise, ImageModule seedNode, ImageModule node, ImageModule ycsb) throws Exception { //add DeploymentModule String name2 = "examples/CELAR/Cassandra/cassandra"; DeploymentModule deployment = new DeploymentModule(name2); Authz auth = new Authz(ssservise.getUser(), deployment); deployment.setAuthz(auth); HashMap<String, Node> nodes = new HashMap<String, Node>(); nodes.put("cassandraSeedNode", new Node("cassandraSeedNode", seedNode)); nodes.put("cassandraNode", new Node("cassandraNode", node)); nodes.put("ycsbClient", new Node("ycsbClient", ycsb)); deployment.setNodes(nodes ); ssservise.putModule(deployment); } }
650bbbc6-8cca-45fb-9f06-4577b7365dd2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-19 11:59:39", "repo_name": "jpsarapuu/stock-sim", "sub_path": "/src/main/java/com/example/stocksim/controllers/UserController.java", "file_name": "UserController.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "77ebd78af35e5826bc2b064588e00bcbc6148eea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jpsarapuu/stock-sim
173
FILENAME: UserController.java
0.213377
package com.example.stocksim.controllers; import com.example.stocksim.services.UserService; import lombok.AllArgsConstructor; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; @Controller @AllArgsConstructor public class UserController { private UserService userService; @GetMapping("/login") public String login() { SecurityContextHolder.clearContext();; return "foundation/login"; } @GetMapping("/signup") public String signUp() { SecurityContextHolder.clearContext(); return "foundation/signup"; } @PostMapping("/signup") public String signUp(@RequestParam String username, @RequestParam String password, @RequestParam String passwordConfirmation) { SecurityContextHolder.clearContext(); return userService.newUser(username, password, passwordConfirmation); } }
ba20fd58-68cc-4bdb-8e49-4f2253b324cb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-07 09:18:35", "repo_name": "nareshr38/JavaHomeTask", "sub_path": "/src/main/java/com/ranguht/code/javabasics/Sessions/CollectionLinkedList11Sep2019.java", "file_name": "CollectionLinkedList11Sep2019.java", "file_ext": "java", "file_size_in_byte": 1224, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "3bc072b6897ad821b411ae9f7057f645856509c4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nareshr38/JavaHomeTask
259
FILENAME: CollectionLinkedList11Sep2019.java
0.289372
package com.ranguht.code.javabasics.Sessions; import java.util.Iterator; import java.util.LinkedList; public class CollectionLinkedList11Sep2019 { public static void main(String[] args) { LinkedList<String> ll=new LinkedList<String>(); ll.add("Rangu"); ll.add("Naresh"); ll.add("QA"); Iterator<String> itr=ll.iterator(); while (itr.hasNext()) System.out.println(itr.next()); LinkedList<String> des1=new LinkedList<String>(); des1.add("R"); des1.add("s"); des1.add("Q"); //des1.getFirst() Iterator<String>itr1=des1.descendingIterator(); while (itr1.hasNext()) System.out.println(itr1.next()); /* LinkedList<String> met=new LinkedList<String>(); met.add("quick"); met.add("set"); Iterator<String>txt =met.getFirst(); while(txt.hasNext()) System.out.println(txt.next()); */ LinkedList<String> sr=new LinkedList<String>(); sr.add("sr"); sr.add("tx"); sr.getFirst(); Iterator<String> tsr=sr.iterator(); while (tsr.hasNext()) System.out.println(tsr.next()); } }
1b89b6f9-15af-4243-91f1-f0e559dc4770
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-28 08:47:45", "repo_name": "larrychen8276/xuecms", "sub_path": "/src/main/java/com/xuecms/modules/system/domain/DictDetail.java", "file_name": "DictDetail.java", "file_ext": "java", "file_size_in_byte": 1099, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "c089aa660e0b107d4bf7e4488ad60fa29a57e871", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/larrychen8276/xuecms
235
FILENAME: DictDetail.java
0.245085
package com.xuecms.modules.system.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; @NoArgsConstructor @Getter @Setter @TableName("sys_dict_detail") public class DictDetail implements Serializable { private static final long serialVersionUID = -2723965745270532596L; @TableId(value = "detail_id", type = IdType.AUTO) private Long id; // @JoinColumn(name = "dict_id") // @ManyToOne(fetch=FetchType.LAZY) // @ApiModelProperty(value = "字典", hidden = true) @TableField(exist = false) private Dict dict; private Long dictId; @ApiModelProperty(value = "字典标签") private String label; @ApiModelProperty(value = "字典值") private String value; @ApiModelProperty(value = "排序") private Integer dictSort = 999; }
4d8f67fa-f1fd-4af1-a405-5504af58d1ef
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-10 04:25:17", "repo_name": "jovetove/springBoot-template", "sub_path": "/src/main/java/com/example/demo/controller/UserController.java", "file_name": "UserController.java", "file_ext": "java", "file_size_in_byte": 1038, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ff2026495af70d3cc5b5861ad4534edc626d55da", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jovetove/springBoot-template
189
FILENAME: UserController.java
0.203075
package com.example.demo.controller; import com.example.demo.entity.User; import com.example.demo.service.impl.UserServiceImpl; import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; /** * @author zjianfa */ @RestController @Api(value = "用户接口, mybatis-plus使用示例") public class UserController { @Autowired UserServiceImpl userService; @RequestMapping(value = "/user", method = RequestMethod.GET) public String hello(){ User user = userService.selectById(1); System.out.println(user.toString()); return "hello"; } @RequestMapping(value = "/countUser", method = RequestMethod.GET) public String count(){ int n = userService.coutAllUsers(); System.out.println("系统用户数:" + n); return "hello"; } }
686457b3-1d8b-4e63-8ccb-2ecc2cc66a48
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-05 02:11:55", "repo_name": "binbin0617/Test", "sub_path": "/mylibrary/src/main/java/com/bin/mylibrary/faceReg/MatchModel.java", "file_name": "MatchModel.java", "file_ext": "java", "file_size_in_byte": 1098, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "9dc27bbb3f419ab12fc31646cb0cf8e7867b5e72", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/binbin0617/Test
235
FILENAME: MatchModel.java
0.282196
package com.bin.mylibrary.faceReg; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; /** * 构建人脸比较json参数 */ public class MatchModel { public static String getJson(String hp, String data) { JSONObject obj1 = getMatchObj(hp); JSONObject obj2 = getMatchObj(data); return getJson(obj1, obj2); } public static String getJson(JSONObject obj1, JSONObject obj2) { JSONArray array = new JSONArray(); array.put(obj1); array.put(obj2); return array.toString(); } public static JSONObject getMatchObj(String str) { JSONObject obj = new JSONObject(); try { obj.put("image", str); obj.put("image_type", "BASE64"); obj.put("face_type", "LIVE"); // 活体及质量分数可根据自己实际情况设置 obj.put("quality_control", "NORMAL"); // obj.put("liveness_control", "NORMAL"); } catch (JSONException e) { e.printStackTrace(); } return obj; } }
67d7f625-8947-4bec-819a-ac77a81fecee
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-30T19:47:30", "repo_name": "Andrelo9/java-bootcamp-2016", "sub_path": "/Topics/Implementations/src/main/java/com/globant/topicthree/UserOperationsController.java", "file_name": "UserOperationsController.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "108881dbded6c90c269205afe966c9eba70e3361", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Andrelo9/java-bootcamp-2016
246
FILENAME: UserOperationsController.java
0.274351
package com.globant.topicthree; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; /** * API implementation of UserService for virtual Shopping Cart (CRUD). * * @author andres.vaninetti * */ public class UserOperationsController implements UserService { private static final Logger LOGGER = Logger.getLogger(UserOperationsController.class.getName()); private Map<Integer, User> userDAOMap; public UserOperationsController() { this.userDAOMap = new HashMap<Integer, User>(); } public void createUser(Integer id, String name) { this.userDAOMap.put(id, new User(id, name)); } public User readUser(Integer id) { if (this.userDAOMap != null) { return this.userDAOMap.get(id); } return null; } public void updateUser(User userToUpdate) { if (this.userDAOMap != null) { this.userDAOMap.put(userToUpdate.getUserId(), userToUpdate); } } public void deleteUser(Integer id) { if (this.userDAOMap != null) { this.userDAOMap.remove(id); } } }
3e0ae599-36fc-4003-83ee-80bfe2b0e117
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-11 06:05:50", "repo_name": "jiacheshi/ceshione", "sub_path": "/WindSystem/src/main/java/com/yk/ctrl/entity/BindDevice.java", "file_name": "BindDevice.java", "file_ext": "java", "file_size_in_byte": 1157, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "529edc7f31ade112814f01526604372d1c3ae207", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jiacheshi/ceshione
248
FILENAME: BindDevice.java
0.199308
package com.yk.ctrl.entity; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; /** * Created by Ps on 2019/12/16. */ public class BindDevice { @Expose @SerializedName("nickname") private String nickname; @Expose @SerializedName("mac") private String mac; @Expose @SerializedName("DeviceData") private DeviceData deviceData; public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getMac() { return mac; } public void setMac(String mac) { this.mac = mac; } public DeviceData getDeviceData() { return deviceData; } public void setDeviceData(DeviceData deviceData) { this.deviceData = deviceData; } @Override public String toString() { return "BindDevice{" + "nickname='" + nickname + '\'' + ", mac='" + mac + '\''+ ", deviceData=" + deviceData + '}'; } }
e52966b3-d07b-4d2f-bcdc-72be59710dc4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-11-01T12:28:18", "repo_name": "11philip22/docker-mpd", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1191, "line_count": 42, "lang": "en", "doc_type": "text", "blob_id": "305543b7d2ac944c41fe99b8c103e92ea9bd2a8d", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/11philip22/docker-mpd
371
FILENAME: README.md
0.206894
# mpd-docker https://hub.docker.com/r/philipwold/mpd ## An mpd docker container for streaming over http Two outputs over http with a bitrate of 320 or 1411 Http stream will be on port 8000 You can connect on port 6600 ### Example docker create \ --name mpd \ -p 6600:6600 \ -p 8000:8000 \ -v mpdplaylists:/var/lib/mpd/playlists \ -v /mnt/raid/music:/var/lib/mpd/music \ --restart unless-stopped \ philipwold/mpd:latest ### Example Setup. - Setup this container on your NAS/File server. - Setup MPD with regular audio output on your client device. - Use a script like this to tune into the http stream on your client device ````bash #!/bin/bash #written by Philip Woldhek serverip=<MY-SERVER-IP> if [ "[playing]" = "$(mpc | sed -n 2p | awk '{print $1;}')" ] then mpc -h $serverip pause mpc stop mpc clear else mpc clear mpc add http://$serverip:8000 mpc -h $serverip play mpc play fi ```` - Edit the config of a mpd client like ncmpcpp to point it to your File server/NAS so you can remotely controll the stream. - Profit? ### Todo - [ ] Map alsa to the container so i can plug my amp directly into my NAS.
fcc674e2-4118-4ba9-9694-2ba7acdef69a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-10 16:43:39", "repo_name": "xiegaoyang/MyFramework", "sub_path": "/src/main/java/com/xgy/myframework/MyServer.java", "file_name": "MyServer.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "a960e78168fa806d54aa3250c8254181c861ec93", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/xiegaoyang/MyFramework
228
FILENAME: MyServer.java
0.226784
package com.xgy.myframework; import com.xgy.myframework.log.MyLog; import java.net.ServerSocket; /** * Created by gowild.cn on 2017/6/10. */ public class MyServer { private final String ip = "localhost"; private final int port = 12345; private boolean isRunning = false; private ServerSocket serverSocket = null; public boolean init() { return true; } public boolean uninit() { return true; } public boolean start() { while (isRunning) { } return true; } public static void main(String[] args) { MyServer myServer = new MyServer(); if (!myServer.init()) { MyLog.getInstance().info("服务器初始化失败."); return; } if (!myServer.start()) { MyLog.getInstance().info("服务器初始化失败."); return; } if (!myServer.uninit()) { MyLog.getInstance().info("服务器反初始化失败."); } } }
3d3df771-33da-44f9-bb84-171db6a784f0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-16 14:15:38", "repo_name": "oinkcraft/OneInTheChamber", "sub_path": "/src/main/java/com/oitc/dendrobyte/creation/ArenaCreationObject.java", "file_name": "ArenaCreationObject.java", "file_ext": "java", "file_size_in_byte": 991, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "d5d5ff84b7d37602d51bd8d6844db959028ab594", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/oinkcraft/OneInTheChamber
224
FILENAME: ArenaCreationObject.java
0.224055
package com.oitc.dendrobyte.creation; import org.bukkit.Location; import java.util.ArrayList; /** * Created by mobki, aka Dendrobyte, on 8/25/2019 * Written for project OneInTheChamber * Please do not use or edit this code unless permission has been given (or if it's on GitHub...) * Contact me on Twitter, @Mobkinz78, with any questions * § */ public class ArenaCreationObject { private String name; private Location signLoc; private ArrayList<Location> locations = new ArrayList<>(); public ArenaCreationObject(){ } public String getName(){ return name; } public Location getSignLoc() { return signLoc; } public ArrayList<Location> getLocations(){ return locations; } public void setName(String name){ this.name = name; } public void setSignLoc(Location signLoc){ this.signLoc = signLoc; } public void addLocation(Location loc){ locations.add(loc); } }
baa67bca-9607-4cad-ba70-91b816a9733c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-17 11:08:31", "repo_name": "SimbaSAMA/star-mq", "sub_path": "/src/main/java/com/morning/star/star_mq/rk/consumer/MQReceiveCallback.java", "file_name": "MQReceiveCallback.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "8a88d7a844fc6630b1cfcd7cd0394a32c5f146fb", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SimbaSAMA/star-mq
260
FILENAME: MQReceiveCallback.java
0.291787
package com.morning.star.star_mq.rk.consumer; import java.util.ArrayList; import java.util.List; import com.alibaba.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import com.alibaba.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; import com.alibaba.rocketmq.client.consumer.listener.MessageListenerConcurrently; import com.alibaba.rocketmq.common.message.MessageExt; import com.morning.star.star_mq.rk.bean.Response; import com.morning.star.star_mq.utils.SerializeUtils; public abstract class MQReceiveCallback implements MessageListenerConcurrently{ public abstract void callback(List<Response> responses); @Override public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> paramList, ConsumeConcurrentlyContext paramConsumeConcurrentlyContext) { try{ List<Response> respones = new ArrayList<Response>(); for(MessageExt ext : paramList){ Response response = new Response(); response.setMsgId(ext.getMsgId()); response.setObj(SerializeUtils.unSerialObjInBean(ext.getBody(), Object.class)); respones.add(response); } callback(respones); }catch(Exception e){ e.printStackTrace(); } return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; } }
040122e1-5756-4d3b-a9e0-0d6b11af6dba
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-14T20:32:35", "repo_name": "PreemptRaspberry/Realtime-Evaluation", "sub_path": "/GPIO-Latency/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1008, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "b1e2ff8d6d6b475f2f9322cfd3092f9bd7d91644", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/PreemptRaspberry/Realtime-Evaluation
269
FILENAME: readme.md
0.235108
# configure the sourcecode accordingly - configure the baudrate in main.c # compile and flash for Atmega32 - find out your jtag device id: - dmesg -> copy the serial number - export `JTAG_DEVICE=YOUR_SERIAL` - `make all.upload` # compile and flash for Atmega328P (Arduino Uno) - find out the port on which the Arduino is connected: - dmesg -> something like `cdc_acm 1-6:1.0: ttyACM0: USB ACM device` - export `TTY_PORT=/dev/ttyXXXn` - `make all.uploadArduino` # cabling ![cabling](docs/cabling.png) # testrun - the input capture pin of your microcontroller (atmega32 uses D6, Arduino Uno Pin8) has to be connected to the output pin (atmega32 D4, Arduino Uno Pin4) - connect to the serial line with the previous configured baudrate -> you should get an output which is 1/F_CPU # start a measurement - connect the input capture pin of your microcontroller to the output pin of the the device to be tested - the input pin of the test candiate has to be connected to the output pin of the microcontroller
e2ba8733-ece8-482b-b311-98f358e67d51
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-09-30 12:20:40", "repo_name": "endymuhardin/belajar-ws", "sub_path": "/aplikasi-manajemen-peserta-rest-client/src/main/java/aplikasi/peserta/rest/client/DaftarPesertaDemo.java", "file_name": "DaftarPesertaDemo.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "7c0c0b87334338deaf04cd07c23511a9c12b2899", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/endymuhardin/belajar-ws
258
FILENAME: DaftarPesertaDemo.java
0.281406
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package aplikasi.peserta.rest.client; import aplikasi.peserta.domain.Peserta; import aplikasi.peserta.rest.client.service.springmvc.ManajemenPesertaRestClientService; import aplikasi.peserta.service.ManajemenPesertaService; import java.util.List; /** * * @author Student-03 */ public class DaftarPesertaDemo { public static void main(String[] args) { ManajemenPesertaService service = new ManajemenPesertaRestClientService(); Peserta p = service.findPesertaById(0); System.out.println("Nama : "+p.getNama()); List<Peserta> semua = service.findSemuaPeserta(0, 100); for (Peserta peserta : semua) { System.out.println("Id Peserta : "+peserta.getId()); System.out.println("Nomer Peserta : "+peserta.getNomerPeserta()); System.out.println("Nama Peserta : "+peserta.getNama()); System.out.println("Tanggal Lahir : "+peserta.getTanggalLahir()); } } }
38cf1a75-1ed8-4bfc-961d-69db13c2466b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-24 20:10:38", "repo_name": "ru1lezz/CriminalIntent", "sub_path": "/app/src/main/java/serzhan/com/criminalintent/RegularCrimeHolderBinder.java", "file_name": "RegularCrimeHolderBinder.java", "file_ext": "java", "file_size_in_byte": 1110, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "146d9f436876d9521cc0c0d5de4918c72a1ca087", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ru1lezz/CriminalIntent
220
FILENAME: RegularCrimeHolderBinder.java
0.290981
package serzhan.com.criminalintent; import android.content.Intent; import android.view.View; public class RegularCrimeHolderBinder extends CrimeHolderBinder implements View.OnClickListener{ private final Crime mCrime; public RegularCrimeHolderBinder(Crime crime, int viewType) { super(viewType); mCrime = crime; } @Override public void bindViewHolder(CrimeAdapter.CrimeHolder holder) { CrimeAdapter.RegularCrimeHolder regularCrimeHolder = (CrimeAdapter.RegularCrimeHolder) holder; regularCrimeHolder.mTitleTextView.setText(mCrime.getTitle()); regularCrimeHolder.mDateTextView.setText(simpleDateFormat.format(mCrime.getDate())); regularCrimeHolder.mSolvedImageView.setVisibility(mCrime.isSolved() ? View.VISIBLE : View.GONE); holder.itemView.setOnClickListener(this); } @Override public Crime getItem() { return mCrime; } @Override public void onClick(View v) { Intent intent = CrimeActivity.newIntent(v.getContext(), mCrime.getId()); v.getContext().startActivity(intent); } }
95ed755a-d19a-49ce-9694-e4bf5d62310c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-05-14 12:32:02", "repo_name": "spenk/MobSpawn", "sub_path": "/MobSpawn/src/MobSpawn.java", "file_name": "MobSpawn.java", "file_ext": "java", "file_size_in_byte": 1014, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "d50e4de2a2366ceacb63fd86933f540cfa0507f9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/spenk/MobSpawn
232
FILENAME: MobSpawn.java
0.26588
import java.util.logging.Logger; public class MobSpawn extends Plugin { String name = "MobSpawn"; String version = "1.0"; String author = " spenk"; static Logger log = Logger.getLogger("Minecraft"); public void initialize(){ MobSpawnListener listener = new MobSpawnListener(); listener.loadConfiguration(); log.info(this.name +" version "+ this.version + " by " +this.author+(" is initialized!")); etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM); } public void enable(){ log.info(this.name + " version " + this.version + " by " + this.author + " is enabled!"); etc.getInstance().addCommand("/mobspawn", "buy yourself a mob"); etc.getInstance().addCommand("/moblist", "[1|2|3] shows you a list of mobs and prices"); } public void disable(){ log.info(this.name + " version " + this.version + " is disabled!"); etc.getInstance().removeCommand("/mobspawn"); etc.getInstance().removeCommand("/moblist"); } }
b4f4378d-91d8-420b-bebe-21b9e7ee3864
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-13 00:42:04", "repo_name": "jimmyjam100/CS3733Public", "sub_path": "/ScheduleProject/src/main/java/edu/wpi/cs/yidun/model/Timeslot.java", "file_name": "Timeslot.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 72, "lang": "en", "doc_type": "code", "blob_id": "cce818b23368486a34a5045b5ca2c7c5d52924f8", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jimmyjam100/CS3733Public
274
FILENAME: Timeslot.java
0.272025
package edu.wpi.cs.yidun.model; import java.time.LocalTime; import java.util.ArrayList; public class Timeslot { String user = ""; String password = ""; boolean open; LocalTime time; int id = -1; public Timeslot(boolean open, LocalTime time) { this.open = open; this.time = time; } public boolean cancelMeeting(){ open = true; user = ""; password = ""; return true; } public boolean open() { if (open) return false; open = true; return true; } public boolean close() { if (!open) return false; open = false; return true; } //setters public void setTime(LocalTime t) { time = t; } public void setId(int id) { this.id = id; } public void makeMeeting(String user, String password) { this.user = user; this.password = password; } //getters public LocalTime getTime() { return time; } public int getId() { return id; } public String getUser(){ return user; } public String getPassword() { return password; } public boolean isOpen(){ return open; } }
0576f98e-0301-4c2a-a1fa-2bc1d52f8ef7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-05-27 06:59:19", "repo_name": "mcraken/platform", "sub_path": "/security/src/main/java/org/cradle/security/shiro/AccountAuthenticationInfo.java", "file_name": "AccountAuthenticationInfo.java", "file_ext": "java", "file_size_in_byte": 1188, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "ea41e2050483d9b8196130697c0d7a301f7c6c23", "star_events_count": 24, "fork_events_count": 10, "src_encoding": "UTF-8"}
https://github.com/mcraken/platform
249
FILENAME: AccountAuthenticationInfo.java
0.281406
/** * */ package org.cradle.security.shiro; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.subject.PrincipalCollection; import org.apache.shiro.subject.SimplePrincipalCollection; import org.cradle.repository.models.account.Account; /** * @author Sherief Shawky * @email mcrakens@gmail.com * @date Nov 9, 2014 */ public class AccountAuthenticationInfo implements AuthenticationInfo{ /** * */ private static final long serialVersionUID = 1L; private Account userAccount; private PrincipalCollection principalCollection; /* (non-Javadoc) * @see org.apache.shiro.authc.AuthenticationInfo#getPrincipals() */ public AccountAuthenticationInfo(Account userAccount, String realmName) { this.userAccount = userAccount; this.principalCollection = new SimplePrincipalCollection(userAccount, realmName); } @Override public PrincipalCollection getPrincipals() { return principalCollection; } /* (non-Javadoc) * @see org.apache.shiro.authc.AuthenticationInfo#getCredentials() */ @Override public Object getCredentials() { return userAccount.getPassword(); } }
96d44da0-4803-458a-ac29-b0f8e7e588c5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-19 11:33:42", "repo_name": "zhangxl98/spring-family", "sub_path": "/Chapter03/jpa-complex-demo/src/main/java/com/spring/jpacomplexdemo/model/BaseEntity.java", "file_name": "BaseEntity.java", "file_ext": "java", "file_size_in_byte": 1261, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "b20ae864b5f7de208a76134798af59e3948a918a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zhangxl98/spring-family
299
FILENAME: BaseEntity.java
0.26588
package com.spring.jpacomplexdemo.model; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.annotations.CreationTimestamp; import org.hibernate.annotations.UpdateTimestamp; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.MappedSuperclass; import java.io.Serializable; import java.util.Date; /** * Created by IntelliJ IDEA. * * @Author zhangxl98 * @Date 4/11/19 4:37 PM * @OS Ubuntu 18.04 LTS * @Device DELL-Inspiron-15-7559 * @Modified By * @Version V1.0.0 * @Description 抽取通用属性 */ /** * 注意: * <p> * 1.标注为@MappedSuperclass的类将不是一个完整的实体类,他将不会映射到数据库表,但是他的属性都将映射到其子类的数据库字段中。 * <p> * 2.标注为@MappedSuperclass的类不能再标注@Entity或@Table注解,也无需实现序列化接口。 */ @MappedSuperclass @Data @NoArgsConstructor @AllArgsConstructor public class BaseEntity implements Serializable { @Id @GeneratedValue private Long id; @Column(updatable = false) @CreationTimestamp private Date createTime; @UpdateTimestamp private Date updateTime; }
b14561f5-bf72-4ca9-9ec6-1eaafa6b8221
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-11 04:13:00", "repo_name": "sandrabinoy/Preparation", "sub_path": "/src/practice/AddTwoNumbers.java", "file_name": "AddTwoNumbers.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "ab05f63ac909b4c366bdcdb3d34e9a59cd5667bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sandrabinoy/Preparation
251
FILENAME: AddTwoNumbers.java
0.264358
package practice; public class AddTwoNumbers { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode result = new ListNode(); StringBuffer num1 = new StringBuffer(); StringBuffer num2 = new StringBuffer(); while(l1.next != null || l2.next != null) { num1.append(l1.val); l1 = l1.next; num2.append(l2.val); l2 = l2.next; } num1.reverse(); num2.reverse(); int number1 = Integer.parseInt(num1.toString()); int number2 = Integer.parseInt(num2.toString()); int resultant = number1 + number2; int n = num1.length() > num2.length() ? num1.length() : num2.length(); for(int i = 0; i < n; i++) { result.val = resultant; result = result.next; } return result; } } class ListNode { int val; ListNode next; ListNode() { } ListNode(int val) { this.val = val; } ListNode(int val, ListNode next) { this.val = val; this.next = next; } }
4254b58d-71b6-4d42-b680-224f55a6dcc4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-01 13:37:24", "repo_name": "vaadin/security", "sub_path": "/vaadin-security/src/main/java/com/vaadin/security/shiro/LoginHtmlServlet.java", "file_name": "LoginHtmlServlet.java", "file_ext": "java", "file_size_in_byte": 1182, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "1191c135fd1e977431f7d79a4ca7764b04a24d5b", "star_events_count": 4, "fork_events_count": 4, "src_encoding": "UTF-8"}
https://github.com/vaadin/security
186
FILENAME: LoginHtmlServlet.java
0.225417
package com.vaadin.security.shiro; import java.io.IOException; import java.io.InputStream; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(asyncSupported = true, urlPatterns = "/login.html") public class LoginHtmlServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { serveLoginHtml(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { serveLoginHtml(req, resp); } private void serveLoginHtml(HttpServletRequest request, HttpServletResponse response) throws IOException { InputStream loginHtml = request.getServletContext() .getResourceAsStream("/login.html"); response.setCharacterEncoding("utf-8"); org.apache.commons.io.IOUtils.copy(loginHtml, response.getOutputStream()); } }
5aff95e9-c9ce-41f6-83e8-74d135e9d132
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-27 15:40:55", "repo_name": "zhangmengjie46/zhangmengjie", "sub_path": "/src/main/java/com/briup/apps/poll/web/controller/OptionsController.java", "file_name": "OptionsController.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "51a64f0d90a0cb25f0b1882a83aebfbd8467b827", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zhangmengjie46/zhangmengjie
184
FILENAME: OptionsController.java
0.256832
package com.briup.apps.poll.web.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.briup.apps.poll.bean.extend.OptionsVM; import com.briup.apps.poll.service.IOptionsService; import com.briup.apps.poll.util.MsgResponse; import io.swagger.annotations.Api; @Api(description="相关接口") @RestController @RequestMapping("/options") public class OptionsController { @Autowired private IOptionsService optionsService; @GetMapping("findAllOptionsVM") public MsgResponse findAllOptionsVM(){ try { List<OptionsVM> list=optionsService.findAllOptionsVM(); return MsgResponse.success("success", list); } catch (Exception e) { e.printStackTrace(); return MsgResponse.error(e.getMessage()); } } }
684df645-32db-426f-a433-172f7f116089
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-17 08:48:50", "repo_name": "cckmit/mall", "sub_path": "/mall-operation/mall-operation-service/src/main/java/com/suyan/mall/operation/service/impl/AddressServiceImpl.java", "file_name": "AddressServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "64521010d0f50d2bf8c8a2de7612d256d78d996c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cckmit/mall
294
FILENAME: AddressServiceImpl.java
0.253861
/* * Copyright (c) 2020. * 项目名称:素焉商城 * 创建人:素焉 * 开源地址: https://github.com/lixaviers/mall */ package com.suyan.mall.operation.service.impl; import com.suyan.mall.operation.biz.AddressBiz; import com.suyan.mall.operation.convertor.AddressConvertor; import com.suyan.mall.operation.req.c.AddressListDTO; import com.suyan.mall.operation.resp.AddressVO; import com.suyan.mall.operation.service.IAddressService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * @CopyRright (c): <素焉代码生成工具> * @Comments: <Service 地址管理类> * @jdk 1.8 * @Version: <1.0> */ @Slf4j @Service("addressService") public class AddressServiceImpl implements IAddressService { @Autowired private AddressBiz addressBiz; @Override public List<AddressVO> getAddress(Integer id) { return AddressConvertor.toAddressVOList(addressBiz.getAddress(id)); } @Override public List<AddressVO> getAddressByCode(String addressCode) { return AddressConvertor.toAddressVOList(addressBiz.getAddressByCode(addressCode)); } }
3b2b9419-6e71-4538-8f83-cf6341d2584c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-26 01:35:35", "repo_name": "handsight/mall", "sub_path": "/mall-security/src/main/java/com/mall/cloud/config/CustomAccessDeniedHandler.java", "file_name": "CustomAccessDeniedHandler.java", "file_ext": "java", "file_size_in_byte": 1229, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "1decd0400b38ba1f96f23ed4e14ee8e0b067d2d5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/handsight/mall
199
FILENAME: CustomAccessDeniedHandler.java
0.190724
package com.mall.cloud.config; import com.alibaba.fastjson.JSONObject; import com.mall.cloud.common.Result; import com.mall.cloud.common.StatusCode; import org.springframework.http.HttpStatus; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * 权限不足异常类重写 */ @Component public class CustomAccessDeniedHandler implements AccessDeniedHandler { @Override public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException){ //被全局异常处理器拦截了 response.setStatus(HttpStatus.OK.value()); response.setHeader("Content-Type", "application/json;charset=UTF-8"); Result result=new Result(false, StatusCode.ERROR,accessDeniedException.getMessage()); try { response.getWriter().write(JSONObject.toJSONString(result)); } catch (IOException e) { e.printStackTrace(); } } }
54181528-9909-40e3-87c1-3529423bb385
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-06-21 13:27:09", "repo_name": "gitdb2/mbls", "sub_path": "/src/com/datamyne/mobile/dashboard/AboutActivity.java", "file_name": "AboutActivity.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "dec2838466f4af6de2b6e502bb9b31e3ca2db683", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/gitdb2/mbls
214
FILENAME: AboutActivity.java
0.218669
package com.datamyne.mobile.dashboard; import android.app.ActionBar; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.MenuItem; import com.datamyne.mobile.profile.utils.HoneycombCompatibility; import com.datamyne.mobile.xml.R; /* * Activity para mostrar el About de la aplicacion, no esta en uso * en esta version. */ public class AboutActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); ActionBar actionBar = getActionBar(); actionBar.show(); actionBar.setDisplayHomeAsUpEnabled(true); HoneycombCompatibility.actionBarSetLogo(actionBar, R.drawable.title_home_default); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: Intent intent = new Intent(this, HomeActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); return true; default: return super.onOptionsItemSelected(item); } } }
3a21672d-0e2c-4ddb-8b18-7aaa290698de
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-23 23:43:57", "repo_name": "Priscilla201/Exercicio", "sub_path": "/web/src/main/java/br/unipe/web/java/boot/HelloDatabaseServlet.java", "file_name": "HelloDatabaseServlet.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "103e709687ae8ea4cf45f2cbca9fb90081d999e8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Priscilla201/Exercicio
179
FILENAME: HelloDatabaseServlet.java
0.23092
package br.unipe.web.java.boot; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @SuppressWarnings("serial") @WebServlet(name = "DatabaseServlet", urlPatterns = { "/database" }) public class HelloDatabaseServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String parametro = req.getParameter("DataFinalizacao"); if (parametro == null) parametro = req.getAttribute("DataFinalizacao").toString(); String idade = req.getParameter("DataFinalizacao"); ServletOutputStream out = resp.getOutputStream(); String saida = "Hello Database " + parametro + " " + idade; out.write(saida.getBytes()); out.flush(); out.close(); } }
0b101ded-60ac-442e-ab6f-ab45a1c0f2ee
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-30 01:03:08", "repo_name": "imwalrus/finalProject", "sub_path": "/finalProject/src/main/java/co/finalproject/farm/common/PageController.java", "file_name": "PageController.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "c1adc8f0fd865fafd7f0f35270f580101f58abf4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/imwalrus/finalProject
221
FILENAME: PageController.java
0.212069
package co.finalproject.farm.common; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import co.finalproject.farm.app.chat.service.ChatService; @Controller public class PageController { @Autowired ChatService chatService; @GetMapping("/login") public String loginMove() { return "nofooter/login"; } @GetMapping("/myPage") public String myPageMove(Model model,HttpSession session) { String user_id = (String) session.getAttribute("user_id"); model.addAttribute("unreadNum", chatService.getUnreadMessageAll(user_id)); return "mypageTiles/mypage/myPage"; } @GetMapping("/education") public String educationMove() { return "education/education"; } @GetMapping("/intoTheFarm") public String intoTheFarmMove() { return "intoTheFarm"; } @GetMapping("/community") public String communityMove() { return "community/community"; } }
035311a9-062f-46bf-b51b-1f1e74a6d67f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-10 06:15:51", "repo_name": "mlizhenbin/component", "sub_path": "/core/src/main/java/com/lzbruby/core/direct/ConfigLoader.java", "file_name": "ConfigLoader.java", "file_ext": "java", "file_size_in_byte": 1255, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "4588ba744729160b4a726795140920c5bdaab3f3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mlizhenbin/component
245
FILENAME: ConfigLoader.java
0.233706
package com.lzbruby.core.direct; import org.springframework.beans.BeansException; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.stereotype.Service; /** * 功能描述: 获取配置字典加载器 * * @author: lizhenbin * email: lizhenbin08@sina.cn * company: org.lzbruby * Date: 2015/11/30 Time: 11:14:31 */ @Service("configLoader") public class ConfigLoader implements InitializingBean, ApplicationContextAware { /** * 上下文 */ private static ApplicationContext applicationContext; @Override public void afterPropertiesSet() throws Exception { ConfigLoaderContext.getContext(); } @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { ConfigLoader.setApplicationContext(applicationContext, null); } public static Object getBean(String name) { return applicationContext.getBean(name); } public static void setApplicationContext(ApplicationContext applicationContext, Object args) { ConfigLoader.applicationContext = applicationContext; } }
ea265fe6-ed2c-487f-9b7d-40ae52817b1e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-08-20 16:36:08", "repo_name": "jonahseguin/drink", "sub_path": "/src/main/java/com/jonahseguin/drink/provider/spigot/PlayerSenderProvider.java", "file_name": "PlayerSenderProvider.java", "file_ext": "java", "file_size_in_byte": 1182, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "c8a7030e9b440ffc3d7d19802faee3ad920c371b", "star_events_count": 81, "fork_events_count": 32, "src_encoding": "UTF-8"}
https://github.com/jonahseguin/drink
248
FILENAME: PlayerSenderProvider.java
0.262842
package com.jonahseguin.drink.provider.spigot; import com.jonahseguin.drink.argument.CommandArg; import com.jonahseguin.drink.exception.CommandExitMessage; import com.jonahseguin.drink.parametric.DrinkProvider; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.lang.annotation.Annotation; import java.util.Collections; import java.util.List; public class PlayerSenderProvider extends DrinkProvider<Player> { public static final PlayerSenderProvider INSTANCE = new PlayerSenderProvider(); @Override public boolean doesConsumeArgument() { return false; } @Override public boolean isAsync() { return false; } @Override @Nullable public Player provide(@Nonnull CommandArg arg, @Nonnull List<? extends Annotation> annotations) throws CommandExitMessage { if (arg.isSenderPlayer()) { return arg.getSenderAsPlayer(); } throw new CommandExitMessage("This is a player-only command."); } @Override public String argumentDescription() { return "player sender"; } }
2f0a71cb-afec-4ce5-b013-0032c2197607
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-09-28T20:10:42", "repo_name": "shaun2029/DeKockBlock", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1096, "line_count": 40, "lang": "en", "doc_type": "text", "blob_id": "e3daf82bb7b5be241e81c562e9c799d1053a77dc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/shaun2029/DeKockBlock
303
FILENAME: README.md
0.217338
# OpenELEC Raspberry Pi router implimenting a firewall, port forwarding, advert blocking,vpn and hotspot. Based on OpenELEC.tv with HotPi additions including VPN WiFi Hotspot. # OpenELEC - Open Embedded Linux Router The base system has been designed and built from the ground up to be as efficient as possible – consuming only tiny disk and memory footprints. **Features** * Firewall * Port forwarding * WiFi hotspot * VPN via Openvpn * Adaway hosts based advert blocking * System size ~ 60MB * Minimal hardware requirements * Ultra fast boot **Limitations** * Currently supports only one ethernet output port **Hardware Requirements** * Raspberry PI or PI 2 * Raspberry Pi supported usb ethernet adapter * Wifi dongle - TP-Link TL-WN823N OR TP-Link TL-WN725 Version 2 * Power supply - 5V 2A recommended **Tested Hardware** Device ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter Device ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter Device ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
0ea166be-4e3d-45a9-a933-5c81f61c9cda
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-23 08:34:09", "repo_name": "IsAlone/ssm", "sub_path": "/src/main/java/com/zking/ssm/frontDesk/service/impl/TreeNodeServiceImpl.java", "file_name": "TreeNodeServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1085, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "5a6a9f78bee6ca94563331229822147e6325c4ea", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/IsAlone/ssm
215
FILENAME: TreeNodeServiceImpl.java
0.287768
package com.zking.ssm.frontDesk.service.impl; import com.zking.ssm.frontDesk.mapper.TreeNodeMapper; import com.zking.ssm.frontDesk.model.TreeNode; import com.zking.ssm.frontDesk.service.ITreeNodeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class TreeNodeServiceImpl implements ITreeNodeService { @Autowired private TreeNodeMapper treeNodeMapper; @Override public List<TreeNode> listByParentNodeId(TreeNode treeNode) { return treeNodeMapper.listByParentNodeId(treeNode); } @Override public List<TreeNode> listAll() { List<TreeNode> treeNodes = treeNodeMapper.listAll(); for (TreeNode treeNode : treeNodes) { List<TreeNode> childList = treeNodeMapper.listByParentNodeId(treeNode); treeNode.setChildren(childList); } return treeNodes; } @Override public List<TreeNode> listChild(TreeNode treeNode) { return treeNodeMapper.listChild(treeNode); } }
26b76540-c992-47c7-b721-ca3507f82af6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-02 18:21:00", "repo_name": "susimsek/spring-boot-hibernate-hazelcast-cache-example", "sub_path": "/src/main/java/io/susimsek/hazelcastcache/service/dto/CarDto.java", "file_name": "CarDto.java", "file_ext": "java", "file_size_in_byte": 1157, "line_count": 65, "lang": "en", "doc_type": "code", "blob_id": "05b2ab38f1a586cbb444f4e9a707cb041a7921a9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/susimsek/spring-boot-hibernate-hazelcast-cache-example
250
FILENAME: CarDto.java
0.242206
package io.susimsek.hazelcastcache.service.dto; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import lombok.experimental.FieldDefaults; import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Objects; @FieldDefaults(level = AccessLevel.PRIVATE) @Data @NoArgsConstructor @AllArgsConstructor @Builder public class CarDto implements Serializable { @Schema(accessMode = Schema.AccessMode.READ_ONLY) Long id; @NotBlank String serial; @NotBlank String model; @NotBlank String brand; Integer year; @NotBlank String type; int doorCount; @NotBlank String colour; @NotBlank String fuel; @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof CarDto)) { return false; } CarDto productDto = (CarDto) o; if (this.id == null) { return false; } return Objects.equals(this.id, productDto.id); } @Override public int hashCode() { return Objects.hash(this.id); } }
2820d4b2-e6af-428c-a732-b920a666da34
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-26 20:38:53", "repo_name": "Ankit77/QuickBloxChat", "sub_path": "/QBapplibrary/src/main/java/com/indianic/qbchat/utils/KeyboardUtils.java", "file_name": "KeyboardUtils.java", "file_ext": "java", "file_size_in_byte": 1189, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "3e737bd4362d0998832902f6bf381ea31c43639c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Ankit77/QuickBloxChat
221
FILENAME: KeyboardUtils.java
0.262842
package com.indianic.qbchat.utils; import android.app.Activity; import android.content.Context; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import com.indianic.qbchat.QbApp; public class KeyboardUtils { public static void showKeyboard(EditText editText) { InputMethodManager imm = (InputMethodManager) QbApp.getInstance().getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT); } public static void hideKeyboard(EditText editText) { InputMethodManager imm = (InputMethodManager) QbApp.getInstance().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editText.getWindowToken(), 0); } public static void hideSoftKeyboard(Activity activity) { final InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE); if (inputMethodManager.isActive()) { if (activity.getCurrentFocus() != null) { inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0); } } } }
117a6121-f651-4fd8-9a3a-a48d1e152f41
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-10 09:37:09", "repo_name": "jarryji/futu", "sub_path": "/TradeUtils/src/client/model/order/ChangeOrderResult.java", "file_name": "ChangeOrderResult.java", "file_ext": "java", "file_size_in_byte": 1342, "line_count": 54, "lang": "zh", "doc_type": "code", "blob_id": "dd9d7a5acdd491bf613d6b0090b27a15c27d6802", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/jarryji/futu
348
FILENAME: ChangeOrderResult.java
0.290981
package client.model.order; import client.model.base.BaseAccountResult; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** * 修改订单返回信息 * @author jarry * @version 1.0 * @since 2016/9/30 * * 注:OrderID、LocalID只用设一个非0有效值(因PlaceOrder只能返回LocalID), OrderID参数优先处理 */ @JsonInclude(JsonInclude.Include.NON_NULL) public class ChangeOrderResult extends BaseAccountResult { private String LocalID; //PlaceOrder 后给出的本地 ID, 推测是 FUTU 在本地客户端上的识别 ID private String OrderID; //交易 ID 注:OrderID、LocalID只用设一个非0有效值(因PlaceOrder只能返回LocalID), OrderID参数优先处理 private String SvrResult; //Svr的返回结果 @JsonProperty("LocalID") public String getLocalID() { return LocalID; } @JsonProperty("LocalID") public void setLocalID(String localID) { LocalID = localID; } @JsonProperty("OrderID") public String getOrderID() { return OrderID; } @JsonProperty("OrderID") public void setOrderID(String orderID) { OrderID = orderID; } @JsonProperty("SvrResult") public String getSvrResult() { return SvrResult; } @JsonProperty("SvrResult") public void setSvrResult(String svrResult) { SvrResult = svrResult; } }
538226c4-9bdb-440a-bba1-bee904cc116d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-11 15:11:41", "repo_name": "fengg5241/aircon", "sub_path": "/bizproject/src/main/java/com/panasonic/b2bacns/bizportal/stats/vo/EnergyConsumptionResponseVO.java", "file_name": "EnergyConsumptionResponseVO.java", "file_ext": "java", "file_size_in_byte": 1226, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "cdcf0658f37be8511b86fd4163474f7093ba8c58", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fengg5241/aircon
285
FILENAME: EnergyConsumptionResponseVO.java
0.291787
/** * */ package com.panasonic.b2bacns.bizportal.stats.vo; import java.util.List; /** * @author akansha * */ public class EnergyConsumptionResponseVO { private List<String> dates; private List<Double> total_consumption; private List<Double> average_consumption; /** * @return the dates */ public List<String> getDates() { return dates; } /** * @param dates * the dates to set */ public void setDates(List<String> dates) { this.dates = dates; } /** * @return the total_consumption */ public List<Double> getTotal_consumption() { return total_consumption; } /** * @param total_consumption * the total_consumption to set */ public void setTotal_consumption(List<Double> total_consumption) { this.total_consumption = total_consumption; } /** * @return the average_consumption */ public List<Double> getAverage_consumption() { return average_consumption; } /** * @param average_consumption * the average_consumption to set */ public void setAverage_consumption(List<Double> average_consumption) { this.average_consumption = average_consumption; } }
076fcd01-ea70-4740-b7ec-80540f2966bd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-04-02T08:33:18", "repo_name": "FlipWebApps/azure-playground", "sub_path": "/azure-functions/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1155, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "d313686557bc8b50a609ec3c5ddf9f8b0b8f824d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/FlipWebApps/azure-playground
256
FILENAME: README.md
0.229535
# azure-functions A repository for testing Azure Functions Service ## Setup Setup a python environment as discussed in the main README.md and then from this folder run: ```bash cd azure-functions pip install -r requirements.txt ``` ## Running Deploy through VS Code, DevOps or otherwise and see the Azure portal for URL's. If running locally you will need to include a local.settings.json with a pointer to a storage account where an output queue will be accessed / created. Run locally using the command below and then browse the end points. ```bash func host start ``` See [this link](https://docs.microsoft.com/en-us/azure/azure-functions/functions-add-output-binding-storage-queue-python) for more information and accessing queues through the command line. The functions can be accessed through different URL's where hte latter takes a category and optional id in the path http://localhost:7071/api/HttpTrigger?name=Myname http://localhost:7071/api/products/cat/10?name=HiRoute ## Dev Ops (CI/CD) There are build pipeline for archiving the files and a seperate release pipeline for deployment. https://dev.azure.com/mhew/azure-playground
85d3d852-3420-46e4-9816-bce6f016b5df
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2022-02-04T08:12:02", "repo_name": "kranzky/base_whatever", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1188, "line_count": 47, "lang": "en", "doc_type": "text", "blob_id": "c35b33952eb24daf69a401fa1afa70c13016181d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kranzky/base_whatever
287
FILENAME: README.md
0.295027
Secret ====== Create and remember an unguessable secret. Read this blog post for more information, then visit secret.kranzky.com to get started! Overview -------- Your password is hard to remember but easy to guess. That's the wrong way around. You should do this instead: 1. Choose a really, really big random number. 2. Encode that number as a sequence of simple words. 3. Commit the words to memory by creating a funny story. 4. Use these words as the only password you need to remember. Usage ----- Start by visiting secret.kranzky.com You will be asked to select how secure you would like your secret to be. We recommend a six-word secret (which has an entropy of 72 bits), but you are free to select between 2 and 10 words. You will then need to generate a random number. This can be done by using a cryptographically secure pseudo random number generator, or by using random.org, or by flipping coins and rolling dice in the real word. Installation ------------ ``` > nvm use 7.10.0 > yarn global add quasar-cli --global-folder=`yarn global bin` > yarn install > quasar dev ``` Copyright --------- Copyright (c) 2017 Jason Hutchens. See UNLICENSE for further details.
632549c7-5134-4e88-af0c-fb10de0c6ac1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-05-07T02:50:13", "repo_name": "fengjw6/nodejs-websocket", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1091, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "fba8d805f12ef59a6401d14920d6d73b97dced21", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fengjw6/nodejs-websocket
280
FILENAME: README.md
0.26588
# Nodejs web socket server with jwt token validation ## Overview This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. ### Running the server To run the server, run: ``` npm start ``` To view the Swagger UI interface: ``` open http://localhost:8081/docs ``` To run module test: ``` npm test ``` ### Testing the web socket server Run webSocketServer.\*.test.\*.js in another node instance - `webSocketServer.good.test.js` will fetch correct token and receive server time every 5s - `webSocketServer.error.test.noTokenPresent.js` pass no token, will get 401 error - `webSocketServer.error.test.wrongToken.js` pass a invalid token, will get 401 error - `webSocketServer.error.test.tokenExpired.js` pass a expired token, will get 401 error --- This project leverages the mega-awesome [swagger-tools](https://github.com/apigee-127/swagger-tools) middleware which does most all the work.
2fcbffde-b330-47e1-b329-e60285c312ff
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-10-14T14:06:42", "repo_name": "RobertTalbert/calpoly", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 994, "line_count": 13, "lang": "en", "doc_type": "text", "blob_id": "9a404aff0704fd07fe67a7f6cbdf99f992c706f3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/RobertTalbert/calpoly
229
FILENAME: README.md
0.247987
(Re:)Designing Class for Flipped Learning Experiences ======= This repository contains files and information for Robert Talbert's talk, "(Re:)Designing Class for Flipped Learning Experiences " given on October 17, 2014 to faculty at California Polytechnic University in San Luis Obispo, CA. The talk can be viewed by going to http://roberttalbert.github.io/calpoly and then navigating through using the arrows on the screen. The talk was writtein using [reveal.js](http://lab.hakim.se/reveal-js/), a framework for easily creating beautiful presentations using HTML. More information about Robert's professional work can be found at his website, proftalbert.com. For information about hiring Robert for a speaking or workshop engagement, please see his consulting website. For questions or requests, please email Robert at talbertr@gvsu.edu or connect on Twitter at [@RobertTalbert](https://twitter.com/RobertTalbert) or on Google+ at [+RobertTalbert](https://google.com/+RobertTalbert).
a39c07f0-2e94-433a-a191-5792eff430e0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-28 03:25:06", "repo_name": "ChenXiaoW/RabbitMQ-Demo", "sub_path": "/direct-provider/src/main/java/com/chenw/directprovider/Sender/InfoMsgSender.java", "file_name": "InfoMsgSender.java", "file_ext": "java", "file_size_in_byte": 1278, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "988ac41a338e632acb7a0028f94308a0bdcdecd8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ChenXiaoW/RabbitMQ-Demo
270
FILENAME: InfoMsgSender.java
0.261331
package com.chenw.directprovider.Sender; import com.alibaba.fastjson.JSON; import com.chenw.directprovider.model.LogMsg; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.support.CorrelationData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Lookup; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component public class InfoMsgSender { private final Logger log = LoggerFactory.getLogger(this.getClass()); @Autowired private RabbitTemplate rabbitTemplate; /** 交换机名称 */ @Value("${mq.config.exchange}") private String exchange; /** 路由键 */ @Value("${mq.config.queue.msg.routingkey}") private String routingKey; /** * 发送消息 * @param msg */ public void sender(LogMsg msg){ CorrelationData correlationData = new CorrelationData(msg.getMessage()); String json = JSON.toJSONString(msg); System.out.println("[消息发送]>>>"+json); this.rabbitTemplate.convertAndSend( exchange, //交换器 routingKey, //路由key json, //消息 correlationData //消息唯一id ); } }
091bd470-3aed-4f58-b03d-6155ae082718
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-31 03:22:39", "repo_name": "JinYongHyeon/kosta", "sub_path": "/web-workspace1/webstudy22-member/src/org/kosta/controller/UpdateMemberController.java", "file_name": "UpdateMemberController.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "96679b23ccde3bcdd9bb81332b1a5aac3bf98afe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JinYongHyeon/kosta
229
FILENAME: UpdateMemberController.java
0.282988
package org.kosta.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.kosta.model.MemberDAO; import org.kosta.model.MemberVO; public class UpdateMemberController implements Controller { @Override public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception { String id = request.getParameter("id"); String password = request.getParameter("password"); String name = request.getParameter("name"); String address = request.getParameter("address"); HttpSession session = request.getSession(false); if (session != null && session.getAttribute("user") != null) { MemberDAO.getInstance().MemberUpdate(new MemberVO(id, password, name, address)); session.setAttribute("user", new MemberVO(id, password, name, address)); } else { return "redirect:index.jsp"; } return "redirect:update-result.jsp"; } public static void main(String[] args) { String tel2 = "010-1234-4564"; System.out.println(tel2.replaceAll("-","")); } }
1385718b-b558-4656-b316-a17c4bc96609
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-09 08:39:08", "repo_name": "DurgeshAlex/MicroServices", "sub_path": "/SpringFeign/customer/src/main/java/kumar/durgesh/customer/dto/Customer.java", "file_name": "Customer.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "f72b7d857b05274755361e930429e856d3cd1999", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/DurgeshAlex/MicroServices
284
FILENAME: Customer.java
0.29584
package kumar.durgesh.customer.dto; import java.util.List; public class Customer { private String name; private long mobileNo; private List<Order> orders; public String getName() { return name; } public void setName(String name) { this.name = name; } public long getMobileNo() { return mobileNo; } public void setMobileNo(long mobileNo) { this.mobileNo = mobileNo; } public Customer(String name, long mobileNo) { super(); this.name = name; this.mobileNo = mobileNo; } public List<Order> getOrders() { return orders; } public void setOrders(List<Order> orders) { this.orders = orders; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (mobileNo ^ (mobileNo >>> 32)); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Customer other = (Customer) obj; if (mobileNo != other.mobileNo) return false; return true; } }
908594a2-ab09-455e-b741-6872414a924f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-09 10:02:45", "repo_name": "1412kaito/MDP-Semester-5", "sub_path": "/TugasPraktikum03/app/src/main/java/edu/stts/tugaspraktikum03/Movies.java", "file_name": "Movies.java", "file_ext": "java", "file_size_in_byte": 1182, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "0a104866a8368fc9e11d6686266544d11db1edc6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/1412kaito/MDP-Semester-5
257
FILENAME: Movies.java
0.23793
package edu.stts.tugaspraktikum03; import android.os.Parcel; import android.os.Parcelable; public class Movies implements Parcelable { String nama; String tempat; String[] jam; String sinopsis; public Movies(String nama, String tempat, String[] jam, String sinopsis){ this.nama = nama; this.jam = jam; this.sinopsis = sinopsis; this.tempat = tempat; } protected Movies(Parcel in) { nama = in.readString(); tempat = in.readString(); jam = in.createStringArray(); sinopsis = in.readString(); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(nama); dest.writeString(tempat); dest.writeStringArray(jam); dest.writeString(sinopsis); } @Override public int describeContents() { return 0; } public static final Creator<Movies> CREATOR = new Creator<Movies>() { @Override public Movies createFromParcel(Parcel in) { return new Movies(in); } @Override public Movies[] newArray(int size) { return new Movies[size]; } }; }
9cebcf50-a191-448c-acf4-8aecf8156c77
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-22 17:57:27", "repo_name": "NicolasMoreno/birra-app-back", "sub_path": "/src/main/java/com/birraapp/birraappbackend/user/model/dto/CreateUserDTO.java", "file_name": "CreateUserDTO.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "d660346825091d86e2751643f0876585500b2ad4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/NicolasMoreno/birra-app-back
210
FILENAME: CreateUserDTO.java
0.193147
package com.birraapp.birraappbackend.user.model.dto; import com.birraapp.birraappbackend.user.model.UserModel; public class CreateUserDTO { private String username; private String name; private String lastName; private String mail; private String password; public CreateUserDTO(String username, String name, String lastName, String mail, String password) { this.username = username; this.name = name; this.lastName = lastName; this.mail = mail; this.password = password; } public UserModel toModel() { return new UserModel( null, this.username, this.name, this.lastName, this.mail, this.password ); } public String getUsername() { return username; } public String getName() { return name; } public String getLastName() { return lastName; } public String getMail() { return mail; } public String getPassword() { return password; } }
f946a3b0-b224-4d84-b452-9b21aab0f79c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-09 16:48:37", "repo_name": "kalvan2019/noahpay", "sub_path": "/job/src/main/java/com/noahpay/pay/job/trade/ClearAsyncTransHandleJob.java", "file_name": "ClearAsyncTransHandleJob.java", "file_ext": "java", "file_size_in_byte": 1243, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "ad940bb70dc207006024456cd8931f525c39e14b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kalvan2019/noahpay
288
FILENAME: ClearAsyncTransHandleJob.java
0.246533
package com.noahpay.pay.job.trade; import com.noahpay.pay.commons.db.trade.mapper.AsyncTransHandleMapper; import com.kalvan.job.annotation.ElasticJobConf; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import javax.annotation.Resource; /** * 日终清理已完结的异步交易记录 * * @author chenliang */ @Slf4j @ElasticJobConf(cron = "0 55 23 * * ?", shardingItemParameters = "0=0", overwrite = true, description = "日终清理已完结的异步交易记录") public class ClearAsyncTransHandleJob implements SimpleJob { @Resource AsyncTransHandleMapper asyncTransHandleMapper; @Override public void execute(ShardingContext shardingContext) { log.info("清理AsyncTransHandle"); try { while (true) { int row = asyncTransHandleMapper.cleanHistory(); log.info("清理数据{}行", row); if (row == 0) { break; } } } catch (Exception e) { log.error("清理AsyncTransHandle异常", e); } log.info("清理AsyncTransHandle完成"); } }
59c74e7f-762e-4c1c-85e8-a809e35fb7dc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-03-02T23:31:12", "repo_name": "Triippz/cryptobot", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1188, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "ae4286c22c43245bf213c77b903cf586457d839a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Triippz/cryptobot
321
FILENAME: README.md
0.277473
#Discord CryptoBot #### Description This simple bot was designed to display cryptocurrency related information within the Discord Application, via user commands. As of now, it supports a handful of useful commands. All commands must be preceeded by a '$' symbol to activate the bot. - $ping: Used to test to make sure the bot is active and responding - returns "A string" - $asl: Yeah... It's what you think it is - $help: Returns all available commands - $info <X_COIN>: Returns information relevant to that coin. You must use the actual coin's name as a parameter (i.e. "bitcoin", "ethereum", "litecoin", etc.) - $info bitcoin - $info stellar - $info ETHEREUM - info LiTeCoIn - $coins <COIN_1> <COIN_2> <COIN_3> <COIN_4>: Returns multiple coins with relevant information. May use up 4 different parameters. - $coins bitcoin ethereum litecoin stellar - $coins stellar nano - $coins neo gas qtum - $top <NUMBER>: Returns the top x number of coins. - $top 10 : returns top 10 coins - $top 5: returns top 5 coins - $news <String>: Returns 3 news stories via Google RSS feed - $news bitcoin - $news XLM - $news LitePay
d9d9af79-dbb2-4260-baf6-cb36b3bbc5c9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-03-09T07:03:46", "repo_name": "NBGlasser/Train-Scheduler", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1092, "line_count": 17, "lang": "en", "doc_type": "text", "blob_id": "671d02c4cbe29fe256fcca08f76b661213418845", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/NBGlasser/Train-Scheduler
235
FILENAME: README.md
0.255344
# Train-Scheduler ![](screen.png) ## What I was supposed to be doing: I was supposed to replicate the train scheduler shown in class ## Tools Used: HTML CSS/Bootstrap Javascript/JQuery/Moment.js Firebase ## How I did it: After building out my HTML Document, I configured firebase and set empty variables to be used later. I then used a click listener that pushed the values a user input into the input bars to Firebase. Then, whenever Firebase was updated, I used JQuery to append new rows to the table, each one containing a column with a value corresponding to the inputs. For the time until next departure value, I used moment.js to calculate the difference between now and when the train is scheduled for. After that I added some styling to make my page nice and Thomas the Tank Engine-y ## Problems I encountered When using moment.js I had a some trouble getting the formatting syntax right, and even after that, I couldn't get the time differences working 100% properly. Luckily I found a brute force solution to my problem, but I know it wasn't the ideal way of going about things.
70712c26-af64-4113-8e4a-641467ef6cbd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-10-30 19:48:37", "repo_name": "czbalazs/EpsonGlassStockManagement", "sub_path": "/src/sql/DbLoader.java", "file_name": "DbLoader.java", "file_ext": "java", "file_size_in_byte": 986, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "3affd53b49476e10db4ff44337e1cfe0b787d042", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/czbalazs/EpsonGlassStockManagement
197
FILENAME: DbLoader.java
0.284576
package sql; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.util.Log; import model.Model; /** * Created by Balázs on 2014.09.16.. */ public abstract class DbLoader { protected Context ctx; protected DatabaseHelper dbHelper; protected SQLiteDatabase mDb; public abstract int insert(Model model); public abstract void update(Model model); public abstract Cursor findById(int id); public abstract String getTableName(); public static final String TAG = "DbLoader"; public DbLoader(Context ctx){ this.ctx = ctx; } public void open() throws SQLException { dbHelper = new DatabaseHelper (ctx, DbConstants.DATABASE_NAME); mDb = dbHelper.getWritableDatabase(); dbHelper.onCreate(mDb); //fontos, hogy lefusson } public void close(){ dbHelper.close(); } }
dc872981-68f5-4321-9f11-ca30fb48afac
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-05-30T16:06:42", "repo_name": "JonathanFager/pacemaker", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1225, "line_count": 39, "lang": "en", "doc_type": "text", "blob_id": "16d3db1f8829e245af4abc1fabb35282acab706c", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JonathanFager/pacemaker
345
FILENAME: README.md
0.255344
<p align="center"> <img src="https://raw.githubusercontent.com/JonathanFager/pacemaker/master/images/pacemakerlogo@4x.png" align="middle" /> </p> # Pacemaker Pacemaker project aims to create an easy to use, reliable and awesome linefollower robot to use for runners during training. This readme will serve as a placeholder for references, to read articles and others until project start. The robot will be called Pacemaker-21767 ## Scope of project ## Resources ### Software https://github.com/CRM-UAM/VisionRace https://opencv.org/ ### Hardware https://thepihut.com/collections/raspberry-pi-camera/products/raspberry-pi-camera-module https://thepihut.com/collections/raspberry-pi-camera/products/zerocam-nightvision-for-pizero-raspberry-pi-3 ### Articles/Videos https://www.youtube.com/watch?v=ZC4VUt1I5FI https://www.sciencedirect.com/science/article/pii/S0045790615002190 https://www.youtube.com/watch?v=AsoLF6NsqBI http://www.instructables.com/id/Raspberry-Pi-Smartphone-Controlled-Rc-Car/ https://lejosnews.wordpress.com/2015/12/03/line-following-with-opencv/ http://einsteiniumstudios.com/beaglebone-opencv-line-following-robot.html https://makezine.com/projects/build-autonomous-rc-car-raspberry-pi/
53e56ea2-737d-403c-85fc-1fd77398631c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-05 06:30:19", "repo_name": "yezijiang/scmcps", "sub_path": "/tf56-scmCps-api/src/main/java/com/tf56/cps/api/enm/FileTypeEnum.java", "file_name": "FileTypeEnum.java", "file_ext": "java", "file_size_in_byte": 1083, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "50cb64de9ee4a5d79c62cf755351d2456b536d9a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/yezijiang/scmcps
253
FILENAME: FileTypeEnum.java
0.242206
package com.tf56.cps.api.enm; import lombok.Getter; import java.util.HashMap; import java.util.Map; /** * @author : matthew * @description : * @date : 2021/3/1 4:35 下午 **/ @Getter public enum FileTypeEnum { 法人身份证正面("juridicalIdCardPicFront", "法人身份证正面"), 法人身份证反面("juridicalIdCardPicBack", "法人身份证反面"), 营业执照("businessLicencePic", "营业执照"), 道路经营许可证("roadPermitPic", "道路经营许可证"); private String fieldName; private String name; FileTypeEnum(String fieldName, String name) { this.fieldName = fieldName; this.name = name; } private static final Map<String, String> map = new HashMap<>(); static { for (FileTypeEnum fileTypeEnum : FileTypeEnum.values()) { String key = fileTypeEnum.getFieldName(); String value = fileTypeEnum.getName(); map.put(key, value); } } public static String getByFieldName(String fieldName) { return map.get(fieldName); } }
fb2c8d8b-06cf-4414-ac61-2f32a5175ceb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-05 07:56:07", "repo_name": "DavidQF555/GachaBot", "sub_path": "/src/main/java/io/github/davidqf555/gachabot/commands/HelpCommand.java", "file_name": "HelpCommand.java", "file_ext": "java", "file_size_in_byte": 987, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "79f9291754947aaf5bc9d5fba1e304fbb1b3cdd0", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/DavidQF555/GachaBot
204
FILENAME: HelpCommand.java
0.236516
package io.github.davidqf555.gachabot.commands; import net.dv8tion.jda.api.entities.Message; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class HelpCommand extends CommandAbstract { @Override public void onCommand(Message m, String content) { StringBuilder out = new StringBuilder("```"); for (CommandType type : CommandType.values()) { CommandAbstract c = type.getCommand(); out.append("\n").append(c.getFormat()).append(": ").append(c.getDescription()); } m.getChannel().sendMessage(out + "```").queue(); } @Override public List<String> getAlternativeNames() { return new ArrayList<String>(Collections.singletonList("h")); } @Override public String getDescription() { return "Retrieves a list and description of all commands"; } @Override public CommandType getCommandType() { return CommandType.HELP; } }
0b7d9e24-2d53-4879-a3ad-6cb5f4196777
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-30 10:26:48", "repo_name": "green-fox-academy/zuzanastasova", "sub_path": "/week-08/day1/todoconnectingwithmysql/src/main/java/com/greenfoxacademy/todowithmysql/services/AssigneeServiceImpl.java", "file_name": "AssigneeServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f444c44db8c5e6ad2858234e66e9fb2172f408b8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/green-fox-academy/zuzanastasova
219
FILENAME: AssigneeServiceImpl.java
0.26971
package com.greenfoxacademy.todowithmysql.services; import com.greenfoxacademy.todowithmysql.models.Assignee; import com.greenfoxacademy.todowithmysql.models.Todo; import com.greenfoxacademy.todowithmysql.repositories.AssigneeRepository; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; import java.util.Optional; @Service public class AssigneeServiceImpl implements AssigneeService{ private final AssigneeRepository assigneeRepository; public AssigneeServiceImpl(AssigneeRepository assigneeRepository) { this.assigneeRepository = assigneeRepository; } public List<Assignee> findAllAssignees(){ return new ArrayList<>(assigneeRepository.findAll()); } public void addAssignee(Assignee assignee){ assigneeRepository.save(assignee); } public void deleteByIdAssignee(Long id){ assigneeRepository.deleteById(id); } public Optional<Assignee> findByIdAssignee(Long id) { return assigneeRepository.findById(id); } }
c6c12f06-5f29-4968-89ca-87482c9de035
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-27 07:25:22", "repo_name": "pintimes/lifeix-services-aggregation", "sub_path": "/src/main/java/com/lifeix/football/service/aggregation/module/sender/module/sms/dao/ShortMessageTaskLockDao.java", "file_name": "ShortMessageTaskLockDao.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "d9d544618f45121b4a217a76af8cd1a0cb4f8abf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/pintimes/lifeix-services-aggregation
215
FILENAME: ShortMessageTaskLockDao.java
0.277473
package com.lifeix.football.service.aggregation.module.sender.module.sms.dao; import java.util.concurrent.TimeUnit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.BoundValueOperations; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Repository; @Repository public class ShortMessageTaskLockDao { private static final String SHORT_MESSAGE_TASK_LOCK_PREFIX = "shortMessage:task:lock:"; @Autowired private StringRedisTemplate srt; public Long addTaskLock(Long shortMessageId, long expire) { String key = SHORT_MESSAGE_TASK_LOCK_PREFIX + shortMessageId; BoundValueOperations<String, String> ops = srt.boundValueOps(key); boolean flag = ops.setIfAbsent("1"); if (flag) { ops.expire(expire, TimeUnit.SECONDS); return shortMessageId; } return null; } public void releaseTaskLock(Long shortMessageId) { String key = SHORT_MESSAGE_TASK_LOCK_PREFIX + shortMessageId; srt.delete(key); } }
b6b9b10f-bb30-4dc9-9d28-b6741bb836d3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-03 05:23:32", "repo_name": "Tomahawkd/TLS-Tester", "sub_path": "/TLS-Tester/src/main/java/io/tomahawkd/tlstester/tlsattacker/DrownTester.java", "file_name": "DrownTester.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "36359382217036d5aaafc41068a2a2be297bc5c1", "star_events_count": 9, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/Tomahawkd/TLS-Tester
251
FILENAME: DrownTester.java
0.264358
package io.tomahawkd.tlstester.tlsattacker; import de.rub.nds.tlsattacker.attacks.config.GeneralDrownCommandConfig; import de.rub.nds.tlsattacker.attacks.config.delegate.GeneralAttackDelegate; import de.rub.nds.tlsattacker.attacks.impl.drown.GeneralDrownAttacker; import de.rub.nds.tlsattacker.core.config.Config; import de.rub.nds.tlsattacker.core.config.delegate.GeneralDelegate; import io.tomahawkd.tlstester.data.TargetInfo; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class DrownTester extends VulnerabilityTester { private static final Logger logger = LogManager.getLogger(DrownTester.class); @Override public boolean test(TargetInfo host) { logger.info("Starting test DROWN on " + host.getHost()); GeneralDelegate generalDelegate = new GeneralAttackDelegate(); generalDelegate.setQuiet(true); GeneralDrownCommandConfig drown = new GeneralDrownCommandConfig(generalDelegate); Config config = initConfig(host, drown); return new GeneralDrownAttacker(drown, config).isVulnerable(); } }
41651362-f579-42e7-85d6-a42f8f598acd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-05 23:07:58", "repo_name": "Khalil-Khaled/BooklabWeb", "sub_path": "/src/main/java/tn/esprit/spring/controller/ItemController.java", "file_name": "ItemController.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "717a707dff484bc4ca77eb12bfdd2fcfbb5f03bd", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/Khalil-Khaled/BooklabWeb
204
FILENAME: ItemController.java
0.288569
package tn.esprit.spring.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import tn.esprit.spring.DAO.entity.Item; import tn.esprit.spring.services.*; @RestController public class ItemController { @Autowired private ItemService iItemService; @PostMapping("/item/add") public Item addItem(@RequestBody Item itm){ return iItemService.addItem(itm); } @PostMapping("/admin/item/update") public void updateItem(Item itm){ iItemService.updateItem(itm); } @PostMapping("/admin/item/delete/itemId") public void deleteItem(@PathVariable int itemId){ iItemService.deleteItem(itemId); } @GetMapping("/item/id") public List<Item> getItem(@PathVariable int itemId){ return iItemService.getItem(itemId); } }
64980b0c-e4e7-4709-8c46-2b1a576c8afa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-21 12:47:46", "repo_name": "cash2one/fmps", "sub_path": "/trunk/fmps-web/src/main/java/cn/com/fubon/reportform/policy/service/impl/PolicyReportServiceImpl.java", "file_name": "PolicyReportServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1083, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "07f269ae1e7dc9f475b895fa06d606a29eb67172", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cash2one/fmps
230
FILENAME: PolicyReportServiceImpl.java
0.273574
/** * */ package cn.com.fubon.reportform.policy.service.impl; import java.util.List; import org.apache.log4j.Logger; import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery; import org.jeecgframework.core.common.model.json.DataGridReturn; import org.jeecgframework.core.common.service.impl.CommonServiceImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import cn.com.fubon.reportform.policy.service.PolicyReportService; import cn.com.fubon.reportform.user.service.impl.NoticeUserReportServiceImp; /** * @author xiaomei.wu */ @Service("policyReportService") @Transactional public class PolicyReportServiceImpl extends CommonServiceImpl implements PolicyReportService { private static final Logger logger = Logger .getLogger(NoticeUserReportServiceImp.class); @Override public DataGridReturn getDataGridReturn(CriteriaQuery cq, boolean isOffset) { return super.getDataGridReturn(cq, isOffset); } @Override public <T> List<T> getList(Class clas) { return super.getList(clas); } }
b3d8b958-8255-48d3-817b-7a1b20f50ff9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-29 05:37:08", "repo_name": "prasannaanubhav/Java-Web-Services-Part-1", "sub_path": "/PassengerService-Jax-RS/src/main/java/com/passenger/service/PassengerServiceImpl.java", "file_name": "PassengerServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1182, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "4160b6a35d8436db7894faf83be7496a4dfbbe8e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/prasannaanubhav/Java-Web-Services-Part-1
257
FILENAME: PassengerServiceImpl.java
0.273574
package com.passenger.service; import java.util.ArrayList; import java.util.List; import java.util.Set; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MultivaluedMap; import org.springframework.stereotype.Service; import com.passenger.model.Passenger; @Service public class PassengerServiceImpl implements IPassengerService { List<Passenger> passengerList = new ArrayList<>(); int currentId = 0; @Override public List<Passenger> getPassengers(int start, int size) { System.out.println(start); System.out.println(size); return null; } @Override public Passenger addPassenger(Passenger passenger) { passenger.setId(++currentId); passengerList.add(passenger); return passenger; } @Override public void formParam(String firstname, String lastname, String agent, HttpHeaders httpHeaders) { System.out.println(firstname); System.out.println(lastname); System.out.println(agent); MultivaluedMap<String, String> requestHeaders = httpHeaders.getRequestHeaders(); Set<String> keySet = requestHeaders.keySet(); for (String key : keySet) { System.out.println(key); System.out.println(httpHeaders.getHeaderString(key)); } } }
11bff548-6dad-4332-a191-88e9e98082c3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-04-03T16:29:35", "repo_name": "Ekultek/ruby_practice_theOdinProject", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1253, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "2953c6a5b893af1c568638d9f0afa570b73f3932", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/Ekultek/ruby_practice_theOdinProject
314
FILENAME: README.md
0.29584
theOdinProject ============== http://www.theodinproject.com/ assignments <ul> <li> binary_search_trees: binary trees, depth-first search, breadth-first search </li> <li>chess: two-player chess game in ruby </li> <li>connect_four: two-player connect_four game in ruby </li> <li>event_manager: Working with file inputs/outputs, populating templates </li> <li>google_homepage: HTML/CSS exercise: creating google home appearance</li> <li>hangman: Play hangman against the computer, ruby </li> <li>jumpstart_labs_blogger_app: Rails blogger application </li> <li>knights_travails: Finds fastest path from A to B for knight on chessboard </li> <li>mastermind: Play mastermind against the PC </li> <li>microreddit: Small rails app with user, post, and comment models </li> <li>re-former: Forms project </li> <li>recursion: Exercises in recursion: fibonacci and merge-sorting </li> <li>ruby_building_blocks: Exercises in ruby Enumerable methods </li> <li>sample_app "Sample application from Michael Hartl tutorial" <li>sketchpad: Javascript/jQuery sketchpad in browser </li> <li>sockets: Web server/browser from the command line </li> <li>testfirst-ruby: Exercises in rspec </li> <li>tic_tac_toe: Two-player tic-tac-toe in Ruby </li> </ul>
2b190532-1a84-4490-9556-a3349ea5d736
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-02T13:43:36", "repo_name": "shariful-alam/timeclock", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 986, "line_count": 39, "lang": "en", "doc_type": "text", "blob_id": "ec6196d956985372b1d52d055fd30c1e942955d1", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/shariful-alam/timeclock
238
FILENAME: README.md
0.268941
# TimeClock The project description was more clear compared to the other one. And the other project would take more time to complete. That is why I chose this project. ## Prerequisite - Ruby 2.7.0 - Rails 6.1.1 - Bootstrap 4 - jQuery ## Installation Follow these easy steps to run the project locally: ### Clone the repository ``` git clone git@github.com:shariful-alam/timeclock.git ``` ### Create database.yml file Copy the sample database.yml file and edit the database configuration as required: ``` cp config/database.yml.sample config/database.yml ``` After that edit the database configuration as required. ### Install the app Now run the following commands to run the project locally: ``` bundle install rails db:create rails db:migrate yarn rails s ``` And now you can visit the site with the URL http://localhost:3000 ### Live Demo The project is hosted on Heroku Cloud Server. The url to access the live demo is: [TimeClock](http://concept-time-tracker.herokuapp.com/)
e8e98bf2-7c90-49c9-ac8a-bc65a92142c6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-31T16:15:02", "repo_name": "indieweb/indieweb-chat-archive", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1232, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "948619238778ed2d4127b4332abdc4d4ab795685", "star_events_count": 16, "fork_events_count": 10, "src_encoding": "UTF-8"}
https://github.com/indieweb/indieweb-chat-archive
374
FILENAME: README.md
0.23793
# IndieWeb Chat Archive This repo contains the full archive of IndieWeb chat log data files visible at https://chat.indieweb.org Chat logs are added to this repo every 15 minutes. ## File Format Each channel's files can be read using [QuartzDB](https://github.com/aaronpk/QuartzDB). The files follow a simple format: ``` 2017-12-01 23:15:06.218000 {"type":"message","timestamp":1512170106.218,"network":"irc","server":"freenode","channel":{"uid":"#indieweb","name":"#indieweb"},"author":{"uid":"Loqi","nickname":"Loqi","username":"Loqi","name":"Loqi","photo":null,"url":null,"tz":"US\/Pacific"},"content":"[@indiewebcamp] This week in the #indieweb https://indieweb.org/this-week/2017-12-01.html https://pbs.twimg.com/media/DP_z5rCVwAAGdTk.jpg (http://twtr.io/1Yx4r5CHSBC)","modes":[]} ``` * Each line begins with the timestamp. * There will always be 26 characters followed by a space. * The timestamp is UTC and has 6 digits of precision for the seconds. * The rest of the line is a JSON-encoded string representing the IRC message and who sent it. ## Spam removal For a guide on how we deal with spam in these logs, see [How to remove spam](https://indieweb.org/discuss_infrastructure#How-to_remove_spam) on the wiki.
632094df-7221-4ddc-9c42-3939da7b49e2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-06-15 17:51:19", "repo_name": "Corky94/CM2301-Group-1-Software-Project", "sub_path": "/Server/src/Connection/Send.java", "file_name": "Send.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "f74048ebeb856b32cc335fce9cd3b6616552b910", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/Corky94/CM2301-Group-1-Software-Project
217
FILENAME: Send.java
0.272025
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Connection; import Message.NodeList; import java.io.*; import java.util.Stack; import java.util.logging.*; import javax.net.ssl.SSLSocket; /** * * @author Marc */ public class Send { private NodeList n = new NodeList(); public Send(Stack st) { try { ServerSSL ss = new ServerSSL(); String server = n.getNode(); char[] pass = Connection.Server.getPassword(); while (server != null) { SSLSocket s = ss.send(server, 12348, pass); OutputStream os = s.getOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(os); oos.writeObject(st); oos.close(); os.close(); s.close(); server = n.getNode(); } n = null; } catch (IOException ex) { Logger.getLogger(Send.class.getName()).log(Level.SEVERE, null, ex); } n = null; } }
c1eae54b-3fe6-478f-afa7-2c816db67d30
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-04-04T03:34:20", "repo_name": "FizzyGalacticus/steg-go", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1078, "line_count": 16, "lang": "en", "doc_type": "text", "blob_id": "6dad5f780d26f75e3c1e0f7ad8c56aa665c0b062", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/FizzyGalacticus/steg-go
245
FILENAME: README.md
0.276691
# steg-go This project is an (yet another) attempt at recreating an old Digital Forensics project of hiding files in image, and possibly more. [Original Python script here](https://github.com/FizzyGalacticus/Steganography/blob/master/Stegonography.py). ## What is steganography? You can always [read the wiki](https://en.wikipedia.org/wiki/Steganography). But long story short, it's basically the idea of hiding things in plain sight (like files inside of images). ## How does hiding files in images work? Basically, you spread out your input files into the individual bits, and you insert those bits into the pixels of an image. In this particular case, we are using the method of "least significant bit" (LSB) steganography, which means that we put the bits into the bit of the pixel value that will have the least significant impact on the image itself. ## Building I have created a [Makefile](https://en.wikipedia.org/wiki/Makefile) to help with the building process. To build, you only need to run `make build` and it will output the executable binary to `bin/steg`
e44f75e4-0d80-44ed-9969-81b5286346d9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-10 12:30:53", "repo_name": "smitienko96/oop-playgraound", "sub_path": "/src/main/java/com/smitie/parkinglot/ParkingTicket.java", "file_name": "ParkingTicket.java", "file_ext": "java", "file_size_in_byte": 1181, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "d8f2e9ec4e53977deebf12f44c6a32a20eb55389", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/smitienko96/oop-playgraound
239
FILENAME: ParkingTicket.java
0.268941
package com.smitie.parkinglot; import java.time.LocalDateTime; import java.util.List; public final class ParkingTicket { private final Vehicle vehicle; private final LocalDateTime releaseDate; private final List<String> parkingSpotsLabels; private final String floorName; public ParkingTicket(Vehicle vehicle, List<String> parkingSpotsLabels, String floorName) { this.vehicle = vehicle; releaseDate = LocalDateTime.now(); this.parkingSpotsLabels = parkingSpotsLabels; this.floorName = floorName; } protected Vehicle getVehicle() { return vehicle; } protected LocalDateTime getReleaseDate() { return releaseDate; } public List<String> getParkingSpotsLabels() { return parkingSpotsLabels; } public String getFloorName() { return floorName; } @Override public String toString() { return "ParkingTicket{" + "vehicle=" + vehicle + ", releaseDate=" + releaseDate + ", parkingSpotsLabels=" + parkingSpotsLabels + ", floorName='" + floorName + '\'' + '}'; } }
d18f9941-417b-4a40-b0a9-213182087e05
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-15 07:52:54", "repo_name": "qingziguanjun/nettystudy", "sub_path": "/src/main/java/zhanbao/EchoClientHandler.java", "file_name": "EchoClientHandler.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "8ff6a2f9428b3c87237e7bba7cf2c57cb9f997e8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "GB18030"}
https://github.com/qingziguanjun/nettystudy
226
FILENAME: EchoClientHandler.java
0.256832
package zhanbao; import java.io.PushbackInputStream; import java.util.logging.Logger; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; public class EchoClientHandler extends SimpleChannelInboundHandler<Object> { private static final Logger logger = Logger.getLogger(EchoClientHandler.class.getName()); @Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { //获取服务器端返回的数据buf ByteBuf buf = (ByteBuf) msg; byte[] req = new byte[buf.readableBytes()]; buf.readBytes(req); //将服务端返回的byte数组转换成字符串,并打印到控制台 String body = new String(req, "UTF-8"); System.out.println("receive data from server: " + body); } //发生异常,关闭连接 @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception{ logger.warning("Unexpected exception from downstream :" + cause.getMessage()); ctx.close(); } }
8ca5ceaf-0bfd-477e-8779-bdeb050d573f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-16 13:14:03", "repo_name": "405990230/infos", "sub_path": "/boss-infos/src/main/java/com/bmw/boss/infos/exportExcle/bmw/GetFileList.java", "file_name": "GetFileList.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "48517103ef1b12cde69a9ff82a3f3fb9b634bba6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/405990230/infos
249
FILENAME: GetFileList.java
0.274351
package com.bmw.boss.infos.exportExcle.bmw; import java.io.File; import java.util.ArrayList; import java.util.List; /** * Created by qxr4383 on 2018/3/13. */ public class GetFileList { public static List<File> getFileList(String strPath) { List<File> filelist = new ArrayList<>(); File dir = new File(strPath); File[] files = dir.listFiles(); // 该文件目录下文件全部放入数组 if (files != null) { for (int i = 0; i < files.length; i++) { String fileName = files[i].getName(); if (files[i].isDirectory()) { // 判断是文件还是文件夹 getFileList(files[i].getAbsolutePath()); // 获取文件绝对路径 } else if (fileName.endsWith("txt")) { // 判断文件名是否以.avi结尾 //String strFileName = files[i].getAbsolutePath(); //System.out.println("---" + strFileName); filelist.add(files[i]); } else { continue; } } } return filelist; } }
d0001ea2-1ffd-4aee-84bb-fd0aaa78018e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-27 04:28:48", "repo_name": "wuwutai/java-test", "sub_path": "/src/main/java/com/jing/ThreadTest.java", "file_name": "ThreadTest.java", "file_ext": "java", "file_size_in_byte": 1202, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "cb708c0a27a013f2e144259c14de0849b291d76e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wuwutai/java-test
253
FILENAME: ThreadTest.java
0.273574
package com.jing; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * @author JING * @version 2.0 * @Package com.jing * @Description: (这里用一句话描述这个类的作用) * @date 四月 23 2018,9:42 */ public class ThreadTest { public static ExecutorService executorService; static { executorService = Executors.newFixedThreadPool(2); } public static void main(String[] args) { Runtime.getRuntime().addShutdownHook(new Thread( ()-> shutdown() )); System.out.println("主线程执行开始"); System.out.println("executorService start:"+executorService); try { Thread.sleep(2000L); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("主线程执行完毕"); System.out.println("主线程 enddd:"+executorService); } public static void shutdown(){ if (executorService != null){ executorService.shutdown(); System.out.println("线程池在关闭"); } System.out.println("executorService enddd:"+executorService); } }
2c7c83e5-8971-4269-8479-7575f32e6e67
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-12 08:49:25", "repo_name": "AlexZhukovich/TemperatureConverterTDD", "sub_path": "/app/src/androidTest/java/com/alexzh/temperatureconverter/ViewVisibilityIdlingResource.java", "file_name": "ViewVisibilityIdlingResource.java", "file_ext": "java", "file_size_in_byte": 1056, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "49d0198cf3c28ccdd7105e597ecd5d7f1bbb030e", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AlexZhukovich/TemperatureConverterTDD
205
FILENAME: ViewVisibilityIdlingResource.java
0.288569
package com.alexzh.temperatureconverter; import android.support.test.espresso.IdlingResource; import android.view.View; public class ViewVisibilityIdlingResource implements IdlingResource { private final View mView; private final int mExpectedVisibility; private boolean mIdle; private ResourceCallback mResourceCallback; public ViewVisibilityIdlingResource(final View view, final int expectedVisibility) { this.mView = view; this.mExpectedVisibility = expectedVisibility; } @Override public final String getName() { return ViewVisibilityIdlingResource.class.getSimpleName(); } @Override public final boolean isIdleNow() { mIdle = mView.getVisibility() == mExpectedVisibility; if (mIdle && mResourceCallback != null) { mResourceCallback.onTransitionToIdle(); } return mIdle; } @Override public void registerIdleTransitionCallback(ResourceCallback resourceCallback) { mResourceCallback = resourceCallback; } }
d04b7e2a-b60f-4e60-98a1-9eff3ed91b6b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-24 09:56:57", "repo_name": "thmundal/Netbeans", "sub_path": "/CanvasTest/src/canvastest/Cell.java", "file_name": "Cell.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "28c29900fa68491036311c1594745882377f5dae", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/thmundal/Netbeans
206
FILENAME: Cell.java
0.288569
/* * 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 canvastest; import java.awt.Color; import java.awt.Graphics; /** * */ public class Cell { private Transform transform; public Vector2 size; public Color color; public boolean wall; public Cell(Vector2 s, Vector2 p, Color c) { size = s; color = c; transform = new Transform(); transform.position = p; wall = Game.random.nextBoolean(); } public Cell() { color = Color.white; } public void Draw(Graphics g) { if(wall) { g.setColor(Color.black); } else { g.setColor(color); } g.fillRect((int) transform.position.x, (int) transform.position.y, (int) size.x, (int) size.y); } }
15e2dbe7-5371-49bd-b1a7-b7ebd152ad6b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-18 14:42:19", "repo_name": "ZagorskayaMarina/AT_ISSoft_final_task", "sub_path": "/src/test/java/tests/BaseTest.java", "file_name": "BaseTest.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "a454ad2a5f7f39402df6b419304299be1c3b9ff6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ZagorskayaMarina/AT_ISSoft_final_task
189
FILENAME: BaseTest.java
0.261331
package tests; import driver.Config; import driver.DriverSingleton; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.extension.ExtendWith; import org.openqa.selenium.WebDriver; import test_extensions.Watcher; import utils.Utils; import web_pages.Header; import web_pages.LoginPage; @ExtendWith(Watcher.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class BaseTest { @BeforeAll public void init(){ WebDriver driver = DriverSingleton.getInstance().getDriver(Config.CHROME); Utils.setUpAllureEnvironment(driver); } @AfterAll public void closeWebDriver(){ DriverSingleton.getInstance().closeWebDriver(); } protected Header loginToSite(){ Header header = new Header(); LoginPage loginPage = new LoginPage(); header.loginToSite(); loginPage.signIn(); return header; } }
d4b0e574-3b4a-4da7-a81e-1006350ff600
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-01 00:58:20", "repo_name": "Subtelny/JMessenger", "sub_path": "/src/main/java/pl/janda/jmessenger/infrastructure/persistence/repository/EventStoreMessageRepository.java", "file_name": "EventStoreMessageRepository.java", "file_ext": "java", "file_size_in_byte": 1040, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "7935628b56cf20724dac5064d2ffcebf498653ca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Subtelny/JMessenger
201
FILENAME: EventStoreMessageRepository.java
0.252384
package pl.janda.jmessenger.infrastructure.persistence.repository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import pl.janda.jmessenger.domain.model.room.*; import pl.janda.jmessenger.infrastructure.event.EventStream; import pl.janda.jmessenger.infrastructure.event.EventStreamId; import pl.janda.jmessenger.infrastructure.persistence.eventstore.EventStore; @Component @RequiredArgsConstructor public class EventStoreMessageRepository implements Messages { private final EventStore eventStore; @Override public Message withId(MessageId messageId) { EventStreamId streamId = new EventStreamId(messageId, 1); EventStream stream = eventStore.eventStreamFor(streamId); return new Message(stream.getEvents(), stream.getVersion()); } @Override public void save(Message message) { EventStreamId streamId = new EventStreamId(message.getMessageId(), message.getVersion()); eventStore.append(streamId, message.getNewEvents()); } }
4d786f9a-7666-4684-9099-a955dc7b768b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-01 14:41:07", "repo_name": "lalid00/Restautacja", "sub_path": "/src/main/java/pl/restaurant/core/model/Chef.java", "file_name": "Chef.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "896e49f0f1d830f40b070fab7e2f2223be627ea7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lalid00/Restautacja
204
FILENAME: Chef.java
0.267408
package pl.restaurant.core.model; import java.util.ArrayList; public class Chef extends Person{ private final ArrayList<Order> orders; public Chef(PersonalData personalData, ContactData contactData) { super(personalData, contactData); this.orders = new ArrayList<>(); } public ArrayList<Order> getOrders() { return orders; } @Override public String toString() { return this.getPersonalData().getName(); } public static class Builder{ private PersonalData personalData; private ContactData contactData; private Builder(){} public static Builder create(){ return new Builder(); } public Builder withPersonalData(PersonalData personalData){ this.personalData = personalData; return this; } public Builder withContactData(ContactData contactData){ this.contactData = contactData; return this; } public Chef build(){ return new Chef(personalData,contactData); } } }
65c6a68c-8ce3-472e-a2cc-306fcc7d66fc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-01 16:28:37", "repo_name": "olaholstad/shopcase", "sub_path": "/src/main/java/MockStoreMain.java", "file_name": "MockStoreMain.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "55c23fe22e3448d3d4cb8a4eeaa9ea2c88af5b47", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/olaholstad/shopcase
174
FILENAME: MockStoreMain.java
0.267408
import routes.*; import spark.Spark; import storage.CustomerStorage; import storage.CustomerStorageImpl; import storage.OrderStorageImpl; import util.Configuration; import util.ConfigurationImpl; public class MockStoreMain { public static void main(String[] args) { Configuration configuration = ConfigurationImpl.getInstance(); new MockStoreMain().run(configuration); } public void run(Configuration configuration){ CustomerStorage customerStorage = CustomerStorageImpl.getInstance(); OrderStorageImpl orderStorage = OrderStorageImpl.getInstance(); Spark.port(configuration.getPort()); Spark.get("/customer", new GetCustomer(customerStorage)); Spark.post("/customer", new AddCustomer(customerStorage)); Spark.get("/order", new GetOrder(orderStorage)); Spark.post("/order", new PlaceOrder(orderStorage, customerStorage)); Spark.put("/order", new UpdateOrder(orderStorage, customerStorage)); } }
631c959f-ae8d-44fb-8455-80e42cf169f3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-23 17:25:09", "repo_name": "EmreSivri/Spring-Boot", "sub_path": "/spring-boot-one-to-many-relations/src/main/java/com/training/springbootonetomanyrelations/service/BookServiceImpl.java", "file_name": "BookServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "b1e2fa8ace36ef7585ea36a3db1d8226782be7f5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/EmreSivri/Spring-Boot
204
FILENAME: BookServiceImpl.java
0.268941
package com.training.springbootonetomanyrelations.service; import com.training.springbootonetomanyrelations.model.Book; import com.training.springbootonetomanyrelations.repository.BookRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Optional; @Service public class BookServiceImpl implements BookService{ @Autowired private BookRepository bookRepository; @Override public List<Book> listAll() { return bookRepository.findAll(); } @Override public Optional<Book> getById(int bookId) { return bookRepository.findById(bookId); } @Override public Book saveBook(Book book) { return bookRepository.save(book); } @Override public void deleteBook(int bookId) { bookRepository.deleteById(bookId); } @Override public Book updateBook(Book book, int bookId) { book.setBookId(bookId); return bookRepository.save(book); } }
0ec49c82-b632-47a4-bac5-4fc50c9d83ef
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-10 13:55:53", "repo_name": "luckybooy/JavaStudy", "sub_path": "/src/main/java/prop/PropLoad.java", "file_name": "PropLoad.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 37, "lang": "zh", "doc_type": "code", "blob_id": "7ca4976de15f10e31f260a0dfc598fae651c5f91", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/luckybooy/JavaStudy
232
FILENAME: PropLoad.java
0.26588
package prop; import java.io.*; import java.util.Properties; /** * @author xiaoran * @program JavaStudy * @package prop * @description 加载流中的属性值 * @date 2020-05-01 23:22:11 */ public class PropLoad { public static void main(String[] args) { Properties prop = new Properties(); InputStream fins = null; try { fins = new FileInputStream("E:\\exercise\\JavaStudy\\src\\main\\java\\testProp.properties"); //获取项目中的.properties文件 // .properties 文件默认的编码格式是 ISO 8859-1 //此处用InputStreamReader(fins) 是将FileInputStream 转换成 InputStreamReader prop.load(new InputStreamReader(fins)); System.out.println(prop); } catch (Exception e) { e.printStackTrace(); } finally { try { if (fins != null){ fins.close(); } } catch (IOException e) { e.printStackTrace(); } } } }
b920205e-552f-4d89-bfb2-514fa646e2d7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-13 07:31:01", "repo_name": "neotran85/Android-AppyProduct-App", "sub_path": "/app/src/main/java/com/appyhome/appyproduct/mvvm/ui/appyproduct/product/list/sort/SortViewModel.java", "file_name": "SortViewModel.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 22, "lang": "en", "doc_type": "code", "blob_id": "ebc18d6abf278ac3fac3f7c1726ac7ea81ae5371", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/neotran85/Android-AppyProduct-App
204
FILENAME: SortViewModel.java
0.277473
package com.appyhome.appyproduct.mvvm.ui.appyproduct.product.list.sort; import com.appyhome.appyproduct.mvvm.data.DataManager; import com.appyhome.appyproduct.mvvm.ui.base.BaseViewModel; import com.appyhome.appyproduct.mvvm.utils.rx.SchedulerProvider; public class SortViewModel extends BaseViewModel<SortNavigator> { public SortOption[] sortOptions = {SortOption.POPULAR, SortOption.PRICE_HIGHEST, SortOption.PRICE_LOWEST, SortOption.LATEST, SortOption.RATING}; public SortViewModel(DataManager dataManager, SchedulerProvider schedulerProvider) { super(dataManager, schedulerProvider); String sortJson = getDataManager().getProductsSortCurrent(getUserId()); SortOption.UNKNOWN.fromJson(sortJson); for (SortOption item : sortOptions) { if (item.getValue().equals(SortOption.UNKNOWN.getValue())) item.checked.set(true); else item.checked.set(false); } } }
37a5f519-6500-4076-8125-09f6492bed55
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-02-13T18:23:19", "repo_name": "Tahirbhalli/Responsive-Design", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 986, "line_count": 42, "lang": "en", "doc_type": "text", "blob_id": "dd61eb348c3f70e03301f75f04be1ad58a84dd07", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Tahirbhalli/Responsive-Design
279
FILENAME: README.md
0.245085
# Building Responsive Design ![screenshot](./screenshot.png) The page is a mock up of [this](https://thenextweb.com/) page. ## Built With - Html - CSS ## Live Demo [Live Demo Link](https://rawcdn.githack.com/Tahirbhalli/Responsive-Design/95843327ca3ac0994fba6bf7dfa492dc0ba4e421/index.html) ## Authors 👤 **Author1** - Github: [@davisdambis](https://github.com/davisdambis) 👤 **Author2** - Github: [@tahirbhalli](https://github.com/tahirbhalli/) ## 🤝 Contributing Contributions, issues and feature requests are welcome! Start by: * Forking the project * Cloning the project to your local machine * `cd` into the Youtube-Replica project directory * Run `git checkout -b your-branch-name` * Make your contributions * Push your branch up to your forked repository * Open a Pull Request with a detailed description to the development branch of the original project for a review ## 📝 License This project is [MIT](https://opensource.org/licenses/MIT) licensed.
3dc7c0d2-7927-491e-a5fd-1e8452973f81
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-02 15:42:30", "repo_name": "Nathat23/MoreMachines", "sub_path": "/src/main/java/uk/antiperson/moremachines/machines/FuelBlock.java", "file_name": "FuelBlock.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "18b72c434d92e47fbcd208c4fa7a5a61aeadd622", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Nathat23/MoreMachines
238
FILENAME: FuelBlock.java
0.253861
package uk.antiperson.moremachines.machines; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.Furnace; import org.bukkit.inventory.ItemStack; public class FuelBlock extends MachineBlock { public FuelBlock(Machine machine) { super(machine, BlockFace.EAST); } public Furnace getFurnace() { if (getBlock().getType() == Material.FURNACE) { return (Furnace) getBlock().getState(); } return null; } public void doFuel() { if (getFurnace() != null) { Furnace furnace = getFurnace(); if (furnace.getInventory().getFuel() != null) { if (furnace.getBurnTime() == 0) { furnace.getInventory().setSmelting(new ItemStack(Material.OAK_WOOD)); return; } } if (furnace.getBurnTime() != 0) { return; } } getMachine().setRunning(false); getMachine().setState(MachineState.NO_FUEL); } }
2e20c0e4-e7d3-4074-a37a-77f534ca77c5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-30 07:40:48", "repo_name": "roechi/ISys_duplicate_filter", "sub_path": "/src/main/java/isys/duplicatefilter/config/WebConfiguration.java", "file_name": "WebConfiguration.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 24, "lang": "en", "doc_type": "code", "blob_id": "26ee77943a2a06a2cb27f2adc49727cc8abd9dee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/roechi/ISys_duplicate_filter
159
FILENAME: WebConfiguration.java
0.239349
package isys.duplicatefilter.config; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.StringHttpMessageConverter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import java.nio.charset.Charset; import java.util.List; import static java.util.Collections.singletonList; @Configuration public class WebConfiguration extends WebMvcConfigurerAdapter { @Override public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { StringHttpMessageConverter messageConverter = new StringHttpMessageConverter(); messageConverter.setSupportedMediaTypes(singletonList(new MediaType(MediaType.APPLICATION_JSON, Charset.forName("UTF-8")))); converters.add(messageConverter); super.configureMessageConverters(converters); } }
f0958399-c7c8-4927-bcfe-6b2efa31c659
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-19 12:51:44", "repo_name": "gcq9527/gulimall", "sub_path": "/gulimall-search/src/main/java/com/atguigu/gulimall/search/controller/SearchController.java", "file_name": "SearchController.java", "file_ext": "java", "file_size_in_byte": 1093, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "ec6ae881178c4b44de06f6a5eb82355e4f7f7fcf", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/gcq9527/gulimall
234
FILENAME: SearchController.java
0.233706
package com.atguigu.gulimall.search.controller; import com.atguigu.gulimall.search.service.MallSearchService; import com.atguigu.gulimall.search.vo.SearchParam; import com.atguigu.gulimall.search.vo.SearchResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import javax.servlet.http.HttpServletRequest; /** * @author Guo * @Create 2020/7/26 20:18 */ @Controller public class SearchController { @Autowired MallSearchService mallSearchService; /** *在 自动将 * @param param * @return */ @GetMapping("/list.html") public String listPage(SearchParam param, Model model, HttpServletRequest httpServletRequest) { param.set_queryString(httpServletRequest.getQueryString()); //1.根据传递来的页面参数区 es中检索商品 SearchResult result = mallSearchService.search(param); model.addAttribute("result",result); return "list"; } }
b364bd6c-42dc-4bbb-a055-d90a0d620d3b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-11-29T12:57:58", "repo_name": "m6fish/hackMDNote", "sub_path": "/mock.md", "file_name": "mock.md", "file_ext": "md", "file_size_in_byte": 1350, "line_count": 51, "lang": "zh", "doc_type": "text", "blob_id": "f93821327770137a6f19b19fcfdcd2ee6aa7346b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/m6fish/hackMDNote
483
FILENAME: mock.md
0.293404
mock.js系列 學習筆記 === ###### tags: `技術` ## 資源 [github-axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) [Summer-Vue.js: axios 與 axios-mock-adapter](https://cythilya.github.io/2017/11/02/vue-axios/) ## 其他的mock [github-Mock](https://github.com/nuysoft/Mock) [mockjs 官網文件](http://mockjs.com/examples.html) [github-better-mock](https://github.com/lavyun/better-mock) [Better-Mock 官網](https://lavyun.github.io/better-mock/) [掘金-使用Mock.js模拟数据请求](https://juejin.im/post/6844903571381551111) [Medium-使用 Mock 自己產生假資料](https://medium.com/@happyjayxin/%E4%BD%BF%E7%94%A8-mock-%E8%87%AA%E5%B7%B1%E7%94%A2%E7%94%9F%E5%81%87%E8%B3%87%E6%96%99-fc939acfeae2) ## 名詞 axios-mock-adapter: 給axios.js使用的Mock工具 Mock: 拿來攔截Ajax,產生模擬數據 // 已停止維護 better-mock: 其他人接手後,可以相容原Mock.js的新工具 > 讓前端可以自行產生假的後端回應 ### 優點 * 不用等後端API完整開發完成才串接 * 不用改寫原本的Ajax方法 * 可以模擬正常狀況難以觸發的後端回應 --- ## 機制 1. 安裝 ```npm install axios-mock-adapter --save-dev``` 2. 使用 * 在src底下新增 mock資料夾,用來存放相關檔案 & 在main.js引用 * 或者直接在打API的方法裡使用
90b06b71-1cbc-42b6-8f63-aa852ff5a836
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-09 11:58:47", "repo_name": "aftabthedeveloper/dolphin-platform", "sub_path": "/platform/dolphin-platform-server/src/main/java/com/canoo/dp/impl/server/servlet/ServletOutputStreamCopier.java", "file_name": "ServletOutputStreamCopier.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "9370684abbd289315cfc0e615c1d43552f5f0abf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/aftabthedeveloper/dolphin-platform
186
FILENAME: ServletOutputStreamCopier.java
0.240775
package com.canoo.dp.impl.server.servlet; import com.canoo.dp.impl.platform.core.Assert; import javax.servlet.ServletOutputStream; import javax.servlet.WriteListener; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; public class ServletOutputStreamCopier extends ServletOutputStream { private final OutputStream outputStream; private final ByteArrayOutputStream copy; public ServletOutputStreamCopier(OutputStream outputStream) { this.outputStream = Assert.requireNonNull(outputStream, "outputStream"); this.copy = new ByteArrayOutputStream(1024); } @Override public void write(int b) throws IOException { outputStream.write(b); copy.write(b); } public byte[] getCopy() { return copy.toByteArray(); } @Override public boolean isReady() { return true; } @Override public void setWriteListener(final WriteListener writeListener) { } }
bb2a60d5-c13c-4a80-aeaa-bbad08088317
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-30 06:44:11", "repo_name": "paperMountainn/InfoSys1D", "sub_path": "/notigoapplication50001/services/homework/MockHomeworkRepository.java", "file_name": "MockHomeworkRepository.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "fc88661875c5e647cf1be9286f9616f28f160801", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/paperMountainn/InfoSys1D
221
FILENAME: MockHomeworkRepository.java
0.29584
package com.example.notigoapplication50001.services.homework; import com.example.notigoapplication50001.services.user.User; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class MockHomeworkRepository implements HomeworkRepository{ private final HashMap<User, List<Homework>> database; public MockHomeworkRepository(){ database = new HashMap<>(); } @Override public List<Homework> getHomeworkForUser(User user) { List<Homework> homeworks = database.get(user); if(homeworks == null){ return new ArrayList<Homework>(); } return new ArrayList<Homework>(homeworks); } @Override public void addHomeworkForUser(User user, Homework homework) { List<Homework> homeworks = database.get(user); if(homeworks == null){ homeworks = new ArrayList<Homework>(); database.put(user, homeworks); } homeworks.add(homework); } }
246cd5de-8c27-4cc0-a63f-6714728548bd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-16 20:26:21", "repo_name": "joonasviljakainen/ohtu-2019", "sub_path": "/viikko3/tehtavat1-3/src/main/java/ohtu/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ee732348d2ea5e839ea7e32ae9a34bf22abdbb84", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/joonasviljakainen/ohtu-2019
203
FILENAME: Main.java
0.288569
package ohtu; import com.google.gson.Gson; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import org.apache.http.client.fluent.Request; public class Main { public static void main(String[] args) throws IOException { String url = "https://nhlstatisticsforohtu.herokuapp.com/players"; String bodyText = Request.Get(url).execute().returnContent().asString(); //System.out.println("json-muotoinen data:"); //System.out.println( bodyText ); Gson mapper = new Gson(); ArrayList<Player> playerList = new ArrayList<>(); Player[] players = mapper.fromJson(bodyText, Player[].class); for (Player p: players) { playerList.add(p); } //players.sort(); Collections.sort(playerList); System.out.println("Oliot:"); for (Player player : playerList) { System.out.println(player); } } }
a29363c5-a4f3-4427-a7be-b14845cffaec
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-30 04:30:11", "repo_name": "ninh-huynh/ao-remote-client", "sub_path": "/app/src/main/java/com/ninhhk/aoremote/model/RemoteButton.java", "file_name": "RemoteButton.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "843cdef4d3ab6582a9e241e6d0dcdcbce8e80d8d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ninh-huynh/ao-remote-client
241
FILENAME: RemoteButton.java
0.253861
package com.ninhhk.aoremote.model; public class RemoteButton { private long id; private String name; private String code; private long remote; // for retrieve data from Button table public RemoteButton(long id, String name, String code, long remote) { this.id = id; this.name = name; this.code = code; this.remote = remote; } // For insert new Button to Button table public RemoteButton(String name, String code, long remote) { this(-1, name, code, remote); } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public long getRemote() { return remote; } public void setRemote(long remote) { this.remote = remote; } }
3343a71f-e773-4793-9a81-7570db625580
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-02-16T09:22:55", "repo_name": "ngsankha/es6-test", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 974, "line_count": 20, "lang": "en", "doc_type": "text", "blob_id": "12c2afcca306cfef1f0660e9c046201bc16df15d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ngsankha/es6-test
237
FILENAME: README.md
0.258326
# ES6 Test This is a small test suite that is meant to be run on websites as a bookmarklet to check their compatibility with the ECMAScript 6 Draft. The idea behind this is to prevent errors due to conflicting implementation between browsers and their incomplete polyfills by the websites. This can prevent bugs like [this](https://bugzilla.mozilla.org/show_bug.cgi?id=924386#c19), [this](https://bugzilla.mozilla.org/show_bug.cgi?id=883914) and [this](https://bugzilla.mozilla.org/show_bug.cgi?id=881782) from occuring. ## To Use Create a bookmarklet with the following JavaScript code: ```javascript javascript:(function () { var newScript = document.createElement('script'); newScript.type = 'text/javascript'; newScript.src = 'https://raw2.github.com/sankha93/es6-test/master/es6-test.js'; document.getElementsByTagName('body')[0].appendChild(newScript); })(); ``` Just click on the bookmarklet with the Webconsole open. You will see the results coming up!
11f0ef04-4fb0-4092-95cd-2e19430c4df7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-05 15:44:04", "repo_name": "coadtan/Questio", "sub_path": "/app/src/main/java/com/questio/projects/questio/QuestioApplication.java", "file_name": "QuestioApplication.java", "file_ext": "java", "file_size_in_byte": 1232, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "9aa84d9acd1ef3e854e6502d4656f81668deca0c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/coadtan/Questio
234
FILENAME: QuestioApplication.java
0.271252
package com.questio.projects.questio; import android.app.Application; import android.content.res.Configuration; import com.google.android.gms.auth.api.signin.GoogleSignInAccount; import com.google.android.gms.common.api.GoogleApiClient; public class QuestioApplication extends Application { private static final String LOG_TAG = QuestioApplication.class.getSimpleName(); public static GoogleApiClient mGoogleApiClient; public static GoogleSignInAccount mGoogleSignInAccount; private static QuestioApplication singleton; private static boolean login = false; public static boolean isLogin() { return login; } public static void setLogin(boolean login) { QuestioApplication.login = login; } public QuestioApplication getInstance() { return singleton; } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); } @Override public void onCreate() { super.onCreate(); singleton = this; } @Override public void onLowMemory() { super.onLowMemory(); } @Override public void onTerminate() { super.onTerminate(); } }
804a4dbd-ef29-4688-a7ed-cc4555034a67
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-06 04:16:06", "repo_name": "hawtio/hawtio", "sub_path": "/platforms/springboot/src/test/java/io/hawt/springboot/SpringHawtioContextListenerTest.java", "file_name": "SpringHawtioContextListenerTest.java", "file_ext": "java", "file_size_in_byte": 986, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "b84f26df5d558d772d014d6d1bb9465fe6cab6f3", "star_events_count": 989, "fork_events_count": 469, "src_encoding": "UTF-8"}
https://github.com/hawtio/hawtio
189
FILENAME: SpringHawtioContextListenerTest.java
0.261331
package io.hawt.springboot; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import org.junit.Test; import org.mockito.Mockito; import io.hawt.system.ConfigManager; public class SpringHawtioContextListenerTest { @Test public void testContextInitialized() { final ConfigManager configManager = Mockito.mock(ConfigManager.class); final ServletContextEvent event = Mockito.mock(ServletContextEvent.class); final ServletContext ctx = Mockito.mock(ServletContext.class); Mockito.when(event.getServletContext()).thenReturn(ctx); final SpringHawtioContextListener underTest = new SpringHawtioContextListener( configManager, "foobar"); underTest.contextInitialized(event); Mockito.verify(configManager).init(); Mockito.verify(ctx).setAttribute("ConfigManager", configManager); Mockito.verify(ctx).setAttribute("hawtioServletPath", "foobar"); } }
a6f5e812-5016-4e50-867b-4a8d34ac467a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-04-28 10:09:07", "repo_name": "WheatVIVO/datasources", "sub_path": "/datasources/src/main/java/org/wheatinitiative/vivo/datasource/DataSourceUpdateFrequency.java", "file_name": "DataSourceUpdateFrequency.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "cfab23f90fa4d2f24a51411587608644c33b3293", "star_events_count": 1, "fork_events_count": 4, "src_encoding": "UTF-8"}
https://github.com/WheatVIVO/datasources
226
FILENAME: DataSourceUpdateFrequency.java
0.26971
package org.wheatinitiative.vivo.datasource; public enum DataSourceUpdateFrequency { DAILY("http://vivo.wheatinitiative.org/ontology/adminapp/updateFrequencyDaily", "daily"), WEEKLY("http://vivo.wheatinitiative.org/ontology/adminapp/updateFrequencyWeekly", "weekly"), MONTHLY("http://vivo.wheatinitiative.org/ontology/adminapp/updateFrequencyMonthly", "monthly"); private String uri; private String label; private DataSourceUpdateFrequency(String uri, String label) { this.uri = uri; this.label = label; } public String getURI() { return this.uri; } public String getLabel() { return this.label; } public static DataSourceUpdateFrequency valueByURI(String URI) { if(URI == null) { return null; } for (DataSourceUpdateFrequency value : DataSourceUpdateFrequency.values()) { if(URI.equals(value.getURI())) { return value; } } return null; } }
2ee18d33-6908-4d13-8c32-4aa9cdf64099
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-27 15:10:55", "repo_name": "LUVROHIT/LearnGIT", "sub_path": "/newProject/src/newPackage/PractiseWindowHandle.java", "file_name": "PractiseWindowHandle.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "d3f8aa6451617b8745e2d620ffce252d121d8cb0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LUVROHIT/LearnGIT
208
FILENAME: PractiseWindowHandle.java
0.289372
package newPackage; import java.util.Iterator; import java.util.Set; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class PractiseWindowHandle { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver","E:\\Selenium\\Selenium driver\\chromedriver\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("https://accounts.google.com/signup"); driver.findElement(By.linkText("Help")).click(); driver.findElement(By.linkText("Privacy")).click(); driver.findElement(By.linkText("Terms")).click(); String parent= driver.getWindowHandle(); System.out.println(parent); Set<String> allWindow= driver.getWindowHandles(); int count=allWindow.size(); System.out.println(count); for(String child:allWindow) { if(parent.equalsIgnoreCase(child)) { driver.switchTo().window(child); } } } }
46419225-1b97-42c0-9df4-5b169b20fcea
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-23 10:23:05", "repo_name": "rflorian2017/testapi", "sub_path": "/src/main/java/com/rosu/sda/NetworkUtils.java", "file_name": "NetworkUtils.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "8871e88de7d3588b3a2ae218ab656ee24d4a574f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rflorian2017/testapi
177
FILENAME: NetworkUtils.java
0.249447
package com.rosu.sda; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; public class NetworkUtils { public static final String STUDENT_URL = "https://online-school-catalog-ad.herokuapp.com/api/students"; public static String getResponseFromURL() throws IOException { URL url = new URL(STUDENT_URL); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); // urlConnection.setRequestMethod("POST"); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); StringBuilder response = new StringBuilder(); String responseLine = null; while ((responseLine = bufferedReader.readLine()) != null) { response.append(responseLine.trim()); } System.out.println(response.toString()); return response.toString(); } }
b450ed87-9c8f-4b9f-8e6a-80ad22978de1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-01-13T22:02:09", "repo_name": "gmp26/site", "sub_path": "/sources/resources/template/index.md", "file_name": "index.md", "file_ext": "md", "file_size_in_byte": 976, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "7691224ad3d6d8e518bf7519a267eeedabc65b4d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/gmp26/site
234
FILENAME: index.md
0.264358
```` alias: The part alias name that appears in a tab in a multipart resource. e.g. 'Problem', 'Solution' weight: The weight determines the order of this part in a multipart tab bar. Heavier parts come later. id: (optional = can omit if same as filename and url) title: (optional) but may be identified by resource type layout: resource (but some resources will have special layouts) author: (optional. If more than one, make it a yaml list) date: (of first publication - maybe this should be automated) clearance: 0 keywords: a yaml list of words or short phrases resourceType: resourceTypeId highlight: boolean or a list of station Ids stids1: primary list of stations ids as yaml list stids2: secondary list of station ids as yaml list pvids1: primary list of pervasive idea ids as yaml list pvids2: secondary list of pervasive ideas ids as yaml list priors: links back to previous resources (laters get generated) ```` content in markdown (title will be inserted from )
abe58e4a-907e-4d7a-8f34-30b1f835c6d0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-11 08:14:51", "repo_name": "purwaren/springboot-sample", "sub_path": "/src/main/java/com/pusilkom/demo/config/ThymeleafConfig.java", "file_name": "ThymeleafConfig.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "d6e104d4e456930d0d530aa5edea8d47bb4c2142", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/purwaren/springboot-sample
186
FILENAME: ThymeleafConfig.java
0.205615
package com.pusilkom.demo.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.thymeleaf.templateresolver.FileTemplateResolver; import org.thymeleaf.templateresolver.ITemplateResolver; import org.thymeleaf.templateresolver.TemplateResolver; @Configuration public class ThymeleafConfig { @Autowired ThymeleafProperties properties; @Bean public ITemplateResolver defaultTemplateResolver() { TemplateResolver resolver = new FileTemplateResolver(); resolver.setSuffix(properties.getSuffix()); resolver.setPrefix("src/main/resources/templates/"); resolver.setTemplateMode(properties.getMode()); // resolver.setCharacterEncoding(properties.getEncoding()); resolver.setCacheable(properties.isCache()); return resolver; } }
2cfce410-adaa-451f-8c0b-d058c72fca52
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-07 01:37:18", "repo_name": "i1red/oop-5th-sem", "sub_path": "/Problems/Problem1/Client/src/main/java/com/red/app/Client.java", "file_name": "Client.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "3365ee3203609bc02834bb55fe86325ae6488e72", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/i1red/oop-5th-sem
173
FILENAME: Client.java
0.245085
package com.red.app; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.Socket; public class Client implements AutoCloseable { private final Socket socket; private final DataOutputStream writer; private final BufferedReader reader; public Client(String host, int port) throws IOException { this.socket = new Socket(host, port); this.writer = new DataOutputStream(this.socket.getOutputStream()); this.reader = new BufferedReader(new InputStreamReader(this.socket.getInputStream())); } public void sendMessage(String message) throws IOException { this.writer.writeBytes(message + "\n"); } public String getMessage() throws IOException { return this.reader.readLine(); } @Override public void close() throws IOException { this.socket.close(); this.writer.close(); this.reader.close(); } }
20660368-c4b9-4282-bd44-afb38a1d4848
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-02-25 09:57:36", "repo_name": "zerasul/PrestashopDolibarESB", "sub_path": "/src/main/java/es/ual/itsi/dolibar/DolibarClass.java", "file_name": "DolibarClass.java", "file_ext": "java", "file_size_in_byte": 987, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "884adf65356eab63904bea03db51798a3cef5474", "star_events_count": 0, "fork_events_count": 3, "src_encoding": "UTF-8"}
https://github.com/zerasul/PrestashopDolibarESB
245
FILENAME: DolibarClass.java
0.273574
package es.ual.itsi.dolibar; import org.mule.api.annotations.param.Payload; import es.ual.itsi.dolibar.common.Authentication; import es.ual.itsi.prestashopsoap.Response; public abstract class DolibarClass { private String dolibarKey; private String dolibarLogin; private String dolibarPassword; public DolibarClass(){ this.dolibarKey=""; this.dolibarLogin=""; this.dolibarPassword=""; } public DolibarClass(String key,String Login, String Password) { this.dolibarKey=key; this.dolibarLogin=Login; this.dolibarPassword=Password; } protected Authentication getAutentication(){ Authentication autentication; autentication= new Authentication(dolibarKey, "", dolibarLogin, dolibarPassword, ""); return autentication; } protected void setAutenticationKeys(String key,String login, String Password){ this.dolibarKey=key; this.dolibarLogin=login; this.dolibarPassword=Password; } public abstract Response makeOperation(@Payload Response respuesta); }