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
60c5afcc-5e54-4a9a-840a-013c0e858972
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-01 03:34:49", "repo_name": "programmerziv/springcloud_project_demo", "sub_path": "/springcloud_customer/src/main/java/com/feelingtech/controller/CustomerController.java", "file_name": "CustomerController.java", "file_ext": "java", "file_size_in_byte": 1196, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "76b8e88f13c6a338130d04c27361d5fc3d9a7f5c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/programmerziv/springcloud_project_demo
228
FILENAME: CustomerController.java
0.261331
package com.feelingtech.controller; import com.feelingtech.base.pojo.User; import com.feelingtech.entity.Result; import com.feelingtech.entity.StateCode; import com.feelingtech.service.CustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/customer") public class CustomerController { @Autowired private CustomerService customerService; @RequestMapping(value = "findAll",method = RequestMethod.GET) public Result findAll(){ List<User> users = customerService.findAll(); return new Result(true, StateCode.OK,"查询成功",users); } @RequestMapping(value = "findById/{id}",method = RequestMethod.GET) public Result findById(@PathVariable("id") Integer id){ User user = customerService.findById(id); return new Result(true, StateCode.OK,"查询成功",user); } @RequestMapping(value = "save",method = RequestMethod.POST) public Result saveCustomer(@RequestBody User user){ customerService.saveCustomer(user); return new Result(true, StateCode.OK,"保存成功"); } }
f54e4e85-891c-4252-b797-a3d6f46669c4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-10 04:09:45", "repo_name": "CaioFGCU/OOP-Class-Project", "sub_path": "/src/sample/MoviePlayer.java", "file_name": "MoviePlayer.java", "file_ext": "java", "file_size_in_byte": 1124, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "7183ad1dda91fefc58c73092be62074470db8ce6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/CaioFGCU/OOP-Class-Project
243
FILENAME: MoviePlayer.java
0.272025
package sample; /** * inherits Product class to get parameters to be used in constructor * Itemtype used for type * implements MultimediaControl interface to play, stop, go to previous, or go to next */ public class MoviePlayer extends Product implements MultimediaControl{ Screen screen; MonitorType monitorType; MoviePlayer(String name, String manufacturer, Screen screen, MonitorType monitorType){ super(name, manufacturer, ItemType.VISUAL ); this.monitorType = monitorType; this.screen = screen; } @Override public int getID() { return 0; } @Override public void play() { System.out.println("Playing"); } @Override public void stop() { System.out.println("Stopping"); } @Override public void previous() { System.out.println("Going back to previous"); } @Override public void next() { System.out.println("Going to next"); } @Override public String toString(){ return super.toString() + "\nScreen: " + screen + "\nMonitor Type: " + monitorType; } }
8b2aa6f2-ee1c-474a-a3b4-290c52be47f4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-19 08:27:58", "repo_name": "milindnarethe909/PaymentGetway", "sub_path": "/app/src/main/java/com/example/android/paymentget/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "32c0e1ae10202806d74e608adb1621e13ab647b2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/milindnarethe909/PaymentGetway
201
FILENAME: MainActivity.java
0.2227
package com.example.android.paymentget; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity { private Button bt_pay; // private PayUmoneySdkInitializer.PaymentParam mPaymentParams; // int MY_SOCKET_TIMEOUT_MS = 30000; // 30 seconds. You can change it @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); bt_pay=(Button)findViewById(R.id.bt_pay); //Payment gateway // PPConfig.getInstance().disableSavedCards(false); // PPConfig.getInstance().disableNetBanking(false); // PPConfig.getInstance().disableWallet(false); bt_pay.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(getApplicationContext(),pAYActivity.class)); finish(); } }); } }
6698a3b4-5b0b-4382-90c3-206d5eede4f2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-17 01:38:47", "repo_name": "danieeelfr/aceleradev-java-2020-challenges", "sub_path": "/projeto-final/backend/publisher-api/src/main/java/core/ApiController.java", "file_name": "ApiController.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "6de2fc9e897c69cae7d79fd36e386753d6fcb8e8", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/danieeelfr/aceleradev-java-2020-challenges
224
FILENAME: ApiController.java
0.291787
package core; import core.PublisherApplication.PubsubOutboundGateway; import models.LogInputDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.view.RedirectView; @RestController public class ApiController { @Autowired private PubsubOutboundGateway messagingGateway; @PostMapping(path = "/create") public String create(@RequestBody LogInputDTO input) { try { messagingGateway.sendToPubsub(input); return "Log sent to PubSub!"; } catch (Exception ex) { return ex.getMessage(); } } @PostMapping("/add") public RedirectView add(@RequestParam("title") String title, @RequestParam("message") String message, @RequestParam("times") int times) { for (int x=1; x<=times; x++) { LogInputDTO dto = new LogInputDTO(x + "-" + title, x + "-" + message); messagingGateway.sendToPubsub(dto); } return new RedirectView("/"); } }
bb822ba0-fd27-4653-9d53-1e73e15d46d1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-08 18:33:13", "repo_name": "Sysobas/backfalcon", "sub_path": "/src/main/java/br/com/bertino/backend/service/ArchiveService.java", "file_name": "ArchiveService.java", "file_ext": "java", "file_size_in_byte": 1099, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "064b1bc8d17a8ad358e88ee437aa835e8e71a9cd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Sysobas/backfalcon
193
FILENAME: ArchiveService.java
0.210766
package br.com.bertino.backend.service; import br.com.bertino.backend.repository.ArchiveRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.PathVariable; import java.util.List; @Service public class ArchiveService { @Autowired ArchiveRepository archiveRepository; public ArchiveService(ArchiveRepository archiveRepository) { this.archiveRepository = archiveRepository; } public List findAll() { return archiveRepository.findAll(); } public List findByIp(@PathVariable String ip) { return archiveRepository.findByIp(ip); } public List findByRequisicao(@PathVariable String requisicao) { return archiveRepository.findByRequisicao(requisicao); } public List findByStatus(@PathVariable String status) { return archiveRepository.findByStatus(status); } public List findByUserAgent(@PathVariable String userAgent) { return archiveRepository.findByUserAgent(userAgent); } }
5260c439-a927-4c2a-9e84-169ff1218fef
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-18 06:21:16", "repo_name": "PrinceAnduin/Simple-Project", "sub_path": "/simple-project/src/main/java/com/six/controller/loginController.java", "file_name": "loginController.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "6ed8959e7cc407f3994ac79df64ea45335551e9b", "star_events_count": 5, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/PrinceAnduin/Simple-Project
231
FILENAME: loginController.java
0.288569
package com.six.controller; import java.util.Map; 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.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import com.six.entities.User; import com.six.mapper.UserMapper; @Controller @RequestMapping("/login") public class loginController { @Autowired UserMapper userMapper; @PostMapping public String login(@RequestParam("userId") String userId, @RequestParam("password") String password, Map<String, Object> map, HttpSession session, Model model) { User loginUser = userMapper.getOne(userId); if (userId.equals("admin") && password.equals("123456")) { session.setAttribute("loginUser", "admin"); return "redirect:manager"; } else if (loginUser != null && loginUser.getPassword().equals(password)){ session.setAttribute("loginUser", loginUser.getId()); return "redirect:home"; } else { return "index"; } } }
ed142ca5-3740-4bb7-8a03-099ae773246b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-23 21:36:39", "repo_name": "crimson-lake/trash-alert", "sub_path": "/domain/src/test/java/pl/zielinska/model/repository/TagRepositoryTest.java", "file_name": "TagRepositoryTest.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "f3edfa1219adab3ec300160e9944ea540fb61897", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/crimson-lake/trash-alert
211
FILENAME: TagRepositoryTest.java
0.276691
package pl.zielinska.model.repository; import org.junit.Test; import org.junit.jupiter.api.Assertions; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager; import org.springframework.test.context.junit4.SpringRunner; import pl.zielinska.model.TestVal; import pl.zielinska.model.domain.Tag; import static org.junit.jupiter.api.Assertions.assertNotNull; @RunWith(SpringRunner.class) @DataJpaTest public class TagRepositoryTest { @Autowired private TestEntityManager entityManager; @Autowired private TagRepository tagRepository; @Test public void canFindTagByNameTest() { Tag testTag = Tag.builder() .name(TestVal.TEST_TAG_NAME) .build(); entityManager.persistAndFlush(testTag); Tag tag = tagRepository.findByName(TestVal.TEST_TAG_NAME); assertNotNull(tag); Assertions.assertEquals(TestVal.TEST_TAG_NAME, tag.getName()); } }
355c334b-8119-4627-a2a4-de18b0b013e1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-07-27T07:03:17", "repo_name": "microsoft/MLOps", "sub_path": "/examples/MLOps_GitHubActions/Code/docs/build.md", "file_name": "build.md", "file_ext": "md", "file_size_in_byte": 1107, "line_count": 14, "lang": "en", "doc_type": "text", "blob_id": "2330b6d7f559c3bcb3f29fd54ea82ef747742bac", "star_events_count": 1455, "fork_events_count": 474, "src_encoding": "UTF-8"}
https://github.com/microsoft/MLOps
221
FILENAME: build.md
0.250913
# Set up your Continuous Integration pipeline This repo contains sample training code and GitHub actions code (workflows file). The goal of this exercise is to rebuild and run a Machine Learning pipeline (aka your training pipeline) every time code is changed in the repo. You can use the training files in the repo or add your own. Go through the files and fill inThe build.yml file in the workflows folder contains the logic and conditions for running the actions. # Steps 1. Go into pipeline.py and fill in the variables to connect to your Azure Machine Learning resources under the **manage endpoint** section. 2. Move the the workflows folder to the root of the repository or create your own workflow through the **Actions** tab. 3. This build.yml will only trigger GitHub Actions when on the python files changes. To learn more about setting conditions on workflow refer [GitHub Actions documentation](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions) 4. Try it out! Go in and change on of the python files and check out the Actions tab to see the workflow run.
ad678b17-6b88-4c82-9a71-905d37262684
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-13 17:31:22", "repo_name": "JehandadK/OrionTestApp", "sub_path": "/app/src/main/java/com/jehandadk/oriontest/data/api/LoadingSubscriber.java", "file_name": "LoadingSubscriber.java", "file_ext": "java", "file_size_in_byte": 1108, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "e20ef63c50511c775daba32274e23b5c96f6cb3c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/JehandadK/OrionTestApp
228
FILENAME: LoadingSubscriber.java
0.253861
package com.jehandadk.oriontest.data.api; import rx.Subscriber; /** * Created by jehandad.kamal on 6/24/2016. */ public abstract class LoadingSubscriber<T> extends Subscriber<T> { protected LoadingListener listener; public LoadingSubscriber(LoadingListener listener) { this.listener = listener; } public LoadingSubscriber(Subscriber<?> subscriber, LoadingListener listener) { super(subscriber); this.listener = listener; } public LoadingSubscriber(Subscriber<?> subscriber, boolean shareSubscriptions, LoadingListener listener) { super(subscriber, shareSubscriptions); this.listener = listener; } @Override public void onStart() { super.onStart(); if (listener != null) listener.onLoadingStarted(); } @Override public void onCompleted() { if (listener != null) listener.onLoadingFinished(); } @Override public void onError(Throwable e) { e.printStackTrace(); if (listener != null) listener.onLoadingFinished(); } }
99a2c579-91a0-4223-b988-8b1bfebb42f8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-21 14:32:54", "repo_name": "sirin05137/CSE364_Project", "sub_path": "/src/main/java/group11/restservice/exception/ApiError.java", "file_name": "ApiError.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "2c0902894298d1429e7038c3aed561d8c867fe80", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sirin05137/CSE364_Project
218
FILENAME: ApiError.java
0.267408
package group11.restservice.exception; import java.util.Arrays; import java.util.List; @SuppressWarnings("ALL") public class ApiError { private String error; private List<String> message; public ApiError(String error, List<String> message) { super(); this.error = error; this.message = message; } public ApiError(String error, String message) { super(); this.error = error; // this can make an error later on - e.g. message containing comma splited when unwanted message = message.replace("[", ""); message = message.replace("]", ""); this.message = Arrays.asList(message.split(",")); } public String getError() { return error; } public void setError(String error) { this.error = error; } public List<String> getMessage() { return message; } public void setMessage(List<String> message) { this.message = message; } public void setMessage(String message) { this.message = Arrays.asList(message); } }
7243f204-dd24-4156-a3f8-75a7585bdb42
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-04T13:09:25", "repo_name": "milano95j/FirebaseTest", "sub_path": "/app/src/main/java/com/example/aliy/realtimedb/Signup_fragment.java", "file_name": "Signup_fragment.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "dfc2e70e422fd2133c4c832fe0f31fa4801ca93c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/milano95j/FirebaseTest
195
FILENAME: Signup_fragment.java
0.206894
package com.example.aliy.realtimedb; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.Toast; /** * A simple {@link Fragment} subclass. */ public class Signup_fragment extends Fragment { private Button btn_signup_submit; public Signup_fragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_signup, container, false); btn_signup_submit = (Button) view.findViewById(R.id.btn_sign_up_submit); btn_signup_submit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getActivity(), "Submitted", Toast.LENGTH_SHORT).show(); } }); return view; } }
a2125a41-2e97-4d74-8686-afd0bc220f36
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-30 22:23:59", "repo_name": "reddypidugu/spring-hello-client", "sub_path": "/src/main/java/com/javaclix/microservices/helloclient/HelloResource.java", "file_name": "HelloResource.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "33fb40e5bdd4f0b71f453347b3612290481cb575", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/reddypidugu/spring-hello-client
205
FILENAME: HelloResource.java
0.249447
package com.javaclix.microservices.helloclient; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; 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 org.springframework.web.client.RestTemplate; @RestController @RequestMapping("/rest/hello/client") public class HelloResource { @Autowired private RestTemplate restTemplate; @HystrixCommand(fallbackMethod = "fallback", groupKey = "Hello", commandKey = "hello", threadPoolKey = "helloThread" ) @GetMapping public String getHello(){ String url = "http://hello-server/rest/hello/server"; return restTemplate.getForObject(url, String.class); } //The return type of this method must be the same as the getHello() method. public String fallback(Throwable hystrixCommand) { return "Fall Back Hello world"; } }
58080cb4-6678-49c8-85f8-220e1844f2aa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-08-22 20:26:22", "repo_name": "mariuszs/spring-transactions-battlefield", "sub_path": "/src/main/java/com/devskiller/spring/CustomerCreator.java", "file_name": "CustomerCreator.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "3b2d7f37cdab5064cebf587222eedd5b3cff0d33", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/mariuszs/spring-transactions-battlefield
201
FILENAME: CustomerCreator.java
0.243642
package com.devskiller.spring; import com.devskiller.spring.model.Customer; import com.devskiller.spring.repository.CustomerRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service public class CustomerCreator { private final CustomerRepository customerRepository; private final BarService bar; @Autowired public CustomerCreator(CustomerRepository customerRepository, BarService bar) { this.customerRepository = customerRepository; this.bar = bar; } @Transactional(rollbackFor = SomethingBadException.class) public void createCustomer(String firstName, String lastName) { System.out.println(""); System.out.println("Creating customer " + lastName); customerRepository.save(new Customer(lastName)); try { System.out.println(" update customer name to " + firstName); bar.updateName(firstName, lastName); } catch (SomethingBadException e) { System.err.println("Something wrong happened!"); } } }
b24b4f37-9a3f-42d3-ba74-3a5eac3b5988
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-09 09:02:59", "repo_name": "youlongxifeng/DoorDuProjectSDK", "sub_path": "/doordusdklibrary/src/main/java/com/dd/sdk/common/TokenPrefer.java", "file_name": "TokenPrefer.java", "file_ext": "java", "file_size_in_byte": 1193, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "6352e84e6a5bda7cf5f444ad331ea2b925a9c7a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/youlongxifeng/DoorDuProjectSDK
261
FILENAME: TokenPrefer.java
0.256832
package com.dd.sdk.common; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import com.dd.sdk.bean.AccessToken; /** Token信息 * @author Administrator * @name DoorDuProjectSDK * @class name:com.dd.sdk.common * @class describe * @time 2018/6/7 18:05 * @change * @class describe * */ public class TokenPrefer { /** * 读取配置 * @param context * @param info */ public static void loadConfig(Context context, AccessToken info) { SharedPreferences share = context.getSharedPreferences("token_prefer", 0); info.token = share.getString("access_token", ""); info.expires_in = share.getString("access_token", ""); } /** * 保存配置 * @param context * @param info */ public static void saveConfig(Context context, final AccessToken info) { SharedPreferences share = context.getSharedPreferences("token_prefer", 0); Editor editor = share.edit(); editor.putString("access_token", info.getToken()); editor.putString("expires_in", info.getExpires_in()); editor.commit(); } }
a206bfbd-134e-406b-aa82-42169d1a582a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-08 15:55:56", "repo_name": "wylc/blade", "sub_path": "/src/main/java/com/blade/kit/BladeCache.java", "file_name": "BladeCache.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "d1810d34fdafbf3beb2f0a5d90ef99244c5ff197", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wylc/blade
234
FILENAME: BladeCache.java
0.290176
package com.blade.kit; import java.lang.invoke.SerializedLambda; import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; import static com.blade.kit.BladeKit.methodToFieldName; /** * @author biezhi * @date 2018/4/22 */ public class BladeCache { private static final Map<SerializedLambda, String> CACHE_LAMBDA_NAME = new HashMap<>(8); public static String getLambdaFieldName(SerializedLambda serializedLambda) { String name = CACHE_LAMBDA_NAME.get(serializedLambda); if (null != name) { return name; } String className = serializedLambda.getImplClass().replace("/", "."); String methodName = serializedLambda.getImplMethodName(); String fieldName = methodToFieldName(methodName); try { Field field = Class.forName(className).getDeclaredField(fieldName); name = field.getName(); CACHE_LAMBDA_NAME.put(serializedLambda, name); return name; } catch (NoSuchFieldException | ClassNotFoundException e) { throw new RuntimeException(e); } } }
eab004ed-4308-4d4e-8a60-b9d455b49f6c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-06 17:49:59", "repo_name": "dhchung317/Simple-Chat-App", "sub_path": "/app/src/main/java/android/pursuit/org/chat/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "ad9d95ca3fd30af058af651373ad4462f549e13c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dhchung317/Simple-Chat-App
216
FILENAME: User.java
0.23793
package android.pursuit.org.chat; import android.os.Parcel; import android.os.Parcelable; public class User implements Parcelable { String uid; String username; String imageUrl; public User(String uid, String username, String imageUrl) { this.uid = uid; this.username = username; this.imageUrl = imageUrl; } public User() { } protected User(Parcel in) { uid = in.readString(); username = in.readString(); imageUrl = in.readString(); } public static final Creator<User> CREATOR = new Creator<User>() { @Override public User createFromParcel(Parcel in) { return new User(in); } @Override public User[] newArray(int size) { return new User[size]; } }; @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(uid); dest.writeString(username); dest.writeString(imageUrl); } }
288bb7d3-2e08-4f38-bdaa-a49548f60991
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-22 18:41:36", "repo_name": "DMSDEVELOPMENT/Lunaris", "sub_path": "/src/main/java/org/lunaris/api/event/player/PlayerMoveEvent.java", "file_name": "PlayerMoveEvent.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "8b1c402eef34187c6a72430bc8cec6ae308b2782", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/DMSDEVELOPMENT/Lunaris
278
FILENAME: PlayerMoveEvent.java
0.290981
package org.lunaris.api.event.player; import org.lunaris.api.event.Cancellable; import org.lunaris.api.event.Event; import org.lunaris.entity.LPlayer; /** * Created by RINES on 15.09.17. */ public class PlayerMoveEvent extends Event implements Cancellable { private final LPlayer player; private final double x, y, z; private final double yaw, pitch; private boolean cancelled; public PlayerMoveEvent(LPlayer player, double x, double y, double z, double yaw, double pitch) { this.player = player; this.x = x; this.y = y; this.z = z; this.yaw = yaw; this.pitch = pitch; } public LPlayer getPlayer() { return player; } public double getX() { return x; } public double getY() { return y; } public double getZ() { return z; } public double getYaw() { return yaw; } public double getPitch() { return pitch; } @Override public void setCancelled(boolean value) { this.cancelled = value; } @Override public boolean isCancelled() { return this.cancelled; } }
2a4eda38-6027-4f53-9231-14478228a429
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-17 09:43:57", "repo_name": "ShivaaKg000/ConsigliaVIaggiDesktop", "sub_path": "/consiglia-viaggi-desktop/src/main/java/consigliaViaggiDesktop/model/Status.java", "file_name": "Status.java", "file_ext": "java", "file_size_in_byte": 1107, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "d0b59e36deb01620a9af7e42185b80618b992cb3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ShivaaKg000/ConsigliaVIaggiDesktop
213
FILENAME: Status.java
0.293404
package consigliaViaggiDesktop.model; import java.util.ArrayList; import java.util.List; public enum Status { PENDING("Pending"), APPROVED("Approved"), REJECTED("Rejected"); public final String label; Status(final String label){ this.label=label; } public static boolean is(String category){ return (category.equals(PENDING.toString())|| category.equals(APPROVED.toString())|| category.equals(REJECTED.toString())); } public static String getStatusByLabel(String label){ if(label!=null) { if (label.equals(PENDING.label)) return PENDING.toString(); if (label.equals(APPROVED.label)) return APPROVED.toString(); if (label.equals(REJECTED.label)) return REJECTED.toString(); } return ""; } public static List<String> getStatusList(){ ArrayList<String> result= new ArrayList<>(); result.add(""); result.add(PENDING.label); result.add(APPROVED.label); result.add(REJECTED.label); return result; } }
3b299341-2a64-4113-b87b-7a73aefeaf0d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-05 18:09:51", "repo_name": "Hareesh12/hare", "sub_path": "/Bikeshow/src/main/java/com/niit/Bikeshow/Model/SignupModel.java", "file_name": "SignupModel.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "5b125807a744cdcace9fac64a3741691f0753ecf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Hareesh12/hare
208
FILENAME: SignupModel.java
0.240775
package com.niit.Bikeshow.Model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; //import org.hibernate.annotations.Entity; //import org.hibernate.annotations.Table; @Entity @Table(name="Customer") public class SignupModel { @Id @Column private String FullName; @Column private String EmailId; @Column private String UserName; @Column private String Password; public String getFullName() { return FullName; } public void setFullName(String fullName) { FullName = fullName; } public String getEmailId() { return EmailId; } public void setEmailId(String emailId) { EmailId = emailId; } public String getUserName() { return UserName; } public void setUserName(String userName) { UserName = userName; } public String getPassword() { return Password; } public void setPassword(String password) { Password = password; } }
8e249c0b-6082-4715-ae47-3fd0fcd62cdf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-12-15 03:23:53", "repo_name": "EstherLacan/basis", "sub_path": "/src/test/java/linux/ProcessUtil.java", "file_name": "ProcessUtil.java", "file_ext": "java", "file_size_in_byte": 1179, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "eb37bfe4ee62d37735917af69dce70de465262ee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/EstherLacan/basis
287
FILENAME: ProcessUtil.java
0.267408
package linux; /** * @author xdwang * @ceate 2012-7-20 下午22:22:44 * @email xdwangiflytek@gmail.com * @description process工具类 */ public class ProcessUtil { /** * @param cmdStr 命令字符串 * @descrption 执行外部exe公用方法 * @author xdwang * @create 2012-7-20下午22:24:32 */ public static void execProcess(String cmdStr) { Process process = null; try { System.out.println(cmdStr); process = Runtime.getRuntime().exec(cmdStr); new ProcessClearStream(process.getInputStream(), "INFO").start(); new ProcessClearStream(process.getErrorStream(), "ERROR").start(); int status = process.waitFor(); System.out.println("Process exitValue:" + status); } catch (Exception e) { System.out.println("执行" + cmdStr + "出现错误," + e.toString()); } finally { if (process != null) { process.destroy(); } process = null; } } public static void main(String[] args) { execProcess("python D:\\Script\\python\\primary\\for.py"); } }
f5837436-ea85-408b-959c-a66bb62d7c6e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-03-28 07:30:56", "repo_name": "hashrock-sandbox/Trashbin", "sub_path": "/NamiParse/src/NamiMain.java", "file_name": "NamiMain.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "dc0d45a78cd8ed5231e8ff056209029084f43262", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/hashrock-sandbox/Trashbin
263
FILENAME: NamiMain.java
0.290176
import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTextArea; import javax.swing.UIManager; import javax.swing.WindowConstants; public class NamiMain extends JPanel { public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @Override public void run() { createAndShowGUI(); } }); } public static void createAndShowGUI() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); } JFrame frame = new JFrame("JNami"); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.getContentPane().add(new NamiMain()); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } JTextArea j1 = new JTextArea(); JTextArea j2 = new JTextArea(); public NamiMain() { super(new BorderLayout()); add(new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(j1), new JScrollPane(j2))); setPreferredSize(new Dimension(320, 240)); } }
a69c944c-c57b-4941-8e6d-ea661591f191
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-08-29 21:33:22", "repo_name": "vauvenal5/pieShare", "sub_path": "/pieShareServerOLDImpl/pieShareServer/src/main/java/org/pieShare/pieShareServer/services/Server.java", "file_name": "Server.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "024533c742dae18fcff480bb3c53b4867ed53ea6", "star_events_count": 4, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/vauvenal5/pieShare
246
FILENAME: Server.java
0.283781
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package org.pieShare.pieShareServer.services; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.pieShare.pieShareServer.services.api.IServer; import org.pieShare.pieShareServer.services.api.IUserPersistenceService; import org.pieShare.pieTools.pieUtilities.service.beanService.IBeanService; import org.pieShare.pieTools.pieUtilities.service.pieLogger.PieLogger; /** * * @author Richard */ public class Server implements IServer { private IBeanService beanService; private InputTask task; private final ExecutorService executor; public Server() { executor = Executors.newCachedThreadPool(); } public void setBeanService(IBeanService beanService) { this.beanService = beanService; } public void setInputTask(InputTask task) { this.task = task; } @Override public void start() { PieLogger.info(this.getClass(), "Server Started"); executor.execute(task); } }
ae955199-fd73-4e8c-ade7-b4781499ae1a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-09 11:47:49", "repo_name": "igoodful/hubu-masterdegree-code", "sub_path": "/src/com/xkpt/Expert.java", "file_name": "Expert.java", "file_ext": "java", "file_size_in_byte": 1171, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "be53cf0ea9747c1f7a09be8c9526c2a4118c029d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/igoodful/hubu-masterdegree-code
239
FILENAME: Expert.java
0.259826
package com.xkpt; public class Expert { public int expertNumber; public String subjectCategory; public String firstSubject; public String grade; public int compactness; public Expert() { } public Expert(int expertNumber, String subjectCategory, String firstSubject, String grade) { this.expertNumber = expertNumber; this.subjectCategory = subjectCategory; this.firstSubject = firstSubject; this.grade = grade; } public int getExpertNumber() { return expertNumber; } public void setExpertNumber(int expertNumber) { this.expertNumber = expertNumber; } public String getSubjectCategory() { return subjectCategory; } public void setSubjectCategory(String subjectCategory) { this.subjectCategory = subjectCategory; } public String getFirstSubject() { return firstSubject; } public void setFirstSubject(String firstSubject) { this.firstSubject = firstSubject; } public String getGrade() { return grade; } public void setGrade(String grade) { this.grade = grade; } }
5e4c548f-74a7-423f-84cd-e52719081e91
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-25 15:47:53", "repo_name": "matiasreinoso/Template_conections", "sub_path": "/app/src/main/java/com/example/template_conections/utils/MessageData.java", "file_name": "MessageData.java", "file_ext": "java", "file_size_in_byte": 1124, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "faeaa68735cc182fb01ee851bb4832027737936d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/matiasreinoso/Template_conections
268
FILENAME: MessageData.java
0.277473
package com.example.template_conections.utils; import java.util.ArrayList; public class MessageData { private ArrayList<String[]> mData; public MessageData(String id) { mData = new ArrayList<String[]>(); String[] data = new String[2]; data[0] = id; data[1] = ""; mData.add(data); } public MessageData(String id, String value) { mData = new ArrayList<String[]>(); String[] data = new String[2]; data[0] = id; data[1] = value; mData.add(data); } public String getId() { return mData.get(0)[0]; } public String getValue() { return mData.get(0)[1]; } public String getValue(String id) { String value = ""; for (int i = 0; i < mData.size(); i++) { if (mData.get(i)[0].equalsIgnoreCase(id)) { value = mData.get(i)[1]; } } return value; } public void addValue(String id, String value) { String[] data = new String[2]; data[0] = id; data[1] = value; mData.add(data); } }
8c16cad3-fcc2-4a36-9263-f049a1bc5d6f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-02-06T21:12:44", "repo_name": "pablo-johnson/LimaGo", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1042, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "164b4382f00646e03ccd64cf1ce39873f1701871", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/pablo-johnson/LimaGo
237
FILENAME: README.md
0.26588
#Lima-Go This is a personal project where I can apply new technologies, concepts and good practices. The idea is to list common entities from Lima like police stations, firefighter stations, schools, ministries or any other kind of entity of public interest. The main approach in order to develop this app is to build thinking in an offline app but making it to work online (read references to know more about this). For this, I am in the process of implementing a **Clean Architecture** using patterns like **MVP** (already applied) for the design layer or **Repository** (TODO) in the data layer. These are some of the common libraries used: - Dagger: Used to inject dependencies (in progress). - Butterknife: Automatically bind views and cast to the respective View in the layout. - gSon: Used to parse json from data sources. - Retrofit: To communicate with web services (TODO). - RXAndroid: To manage data flow (TODO) References: - https://hackernoon.com/so-you-want-to-develop-for-the-next-billion-9eb072c26bc8#.s9xt21u8b
c8a0aaee-ff46-45be-9459-93444f542c03
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-07 06:58:45", "repo_name": "zgdkik/aili", "sub_path": "/code-maven-plugin/trunk/aili/aili-client/client-login/src/main/java/org/hbhk/aili/client/login/util/BeanToJsonUtil.java", "file_name": "BeanToJsonUtil.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "5c6a61402b80c33170b9f4932b7f1be5fd903af1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zgdkik/aili
246
FILENAME: BeanToJsonUtil.java
0.277473
package org.hbhk.aili.client.login.util; import java.io.InputStream; import java.io.OutputStream; import org.codehaus.jackson.JsonEncoding; import org.codehaus.jackson.JsonGenerator; import org.codehaus.jackson.map.DeserializationConfig; import org.codehaus.jackson.map.ObjectMapper; /** * 基于json工具对象到json字符串之间的互相转换 */ public class BeanToJsonUtil { /** * * 对象转换为JSON */ public static void beanToJson(OutputStream out, Object obj) throws Exception { ObjectMapper mapper = new ObjectMapper(); JsonGenerator jsonGenerator = mapper.getJsonFactory() .createJsonGenerator(out, JsonEncoding.UTF8); if (jsonGenerator != null) { jsonGenerator.writeObject(obj); jsonGenerator.flush(); if (!jsonGenerator.isClosed()) { jsonGenerator.close(); } } } /** * 转换为对象 */ public static Object jsonToBean(InputStream in, Class clz) throws Exception { ObjectMapper mapper = new ObjectMapper(); mapper.configure( DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); return mapper.readValue(in, clz); } }
5c6ca5a9-1f01-41dd-9e5f-6d4a463df11a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-16 14:50:02", "repo_name": "liuyueyi/spring-boot-demo", "sub_path": "/spring-boot/100-transaction-manager/src/main/java/com/git/hui/boot/trans/Application.java", "file_name": "Application.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "15c1b3d3880458b83b0de1e13c5619605d73f23a", "star_events_count": 584, "fork_events_count": 328, "src_encoding": "UTF-8"}
https://github.com/liuyueyi/spring-boot-demo
219
FILENAME: Application.java
0.214691
package com.git.hui.boot.trans; import com.git.hui.boot.trans.service.DemoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** * @author YiHui * @date 2023/6/14 */ @RestController @SpringBootApplication public class Application { @Autowired private DemoService demoService; @GetMapping(path = "/") public String preExecute() { try { demoService.transExecute(true); } catch (Exception e) { e.printStackTrace(); return e.getMessage(); } return "ok"; } @GetMapping(path = "/out") public String outExecute() { try { demoService.outTransExecute(); } catch (Exception e) { e.printStackTrace(); return e.getMessage(); } return "ok"; } public static void main(String[] args) { SpringApplication.run(Application.class); } }
e9c8cfc4-93c3-4435-9425-1a6275c20baa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-09 07:06:40", "repo_name": "NetShis/Cartridges", "sub_path": "/src/main/java/ru/komiufps/cartridges/entity/Cartridge.java", "file_name": "Cartridge.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "68ea0f649e00f7524bb2541923d20a1b60fc8fc3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/NetShis/Cartridges
207
FILENAME: Cartridge.java
0.262842
package ru.komiufps.cartridges.entity; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Getter; import lombok.Setter; import lombok.ToString; import ru.komiufps.cartridges.utils.StateCartridge; import javax.persistence.*; import java.time.LocalDate; @Getter @Setter @ToString @Entity public class Cartridge { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @OneToOne() @JsonProperty(value = "cartridgeModel") private CartridgeModel cartridgeModel; @Column(unique = true) @JsonProperty(value = "serialNumber") private String serialNumber; @JsonProperty(value = "registrationDate") private LocalDate registrationDate; @JsonProperty(value = "deregistrationDate") private LocalDate deregistrationDate; @JsonProperty(value = "stateCartridge") private StateCartridge stateCartridge; public Cartridge() { this.registrationDate = LocalDate.now(); stateCartridge = StateCartridge.NotDefine; } }
8873e716-89d1-4a50-b24e-acbecb1ec8e8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-15 01:03:12", "repo_name": "wuming0624/Cell-Society-Simulation", "sub_path": "/src/cellsociety_team17/SugarPatchCell.java", "file_name": "SugarPatchCell.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "2777d00aced64ea816834477aee69f43b3ebd1d8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wuming0624/Cell-Society-Simulation
264
FILENAME: SugarPatchCell.java
0.294215
package cellsociety_team17; public class SugarPatchCell extends Cell{ private int currentSugar; private final int maximumSugar; private int sugarGrowBackRate; private int sugarGrowBackInterval; private int ticks = 0; public SugarPatchCell(Coordinate coord, int initMax, int rate, int interval) { super(coord); this.currentSugar = initMax; this.maximumSugar = initMax; this.sugarGrowBackRate = rate; this.sugarGrowBackInterval = interval; this.setMyState(0); } public int returnSugarAmount(){ return this.currentSugar; } public void depleteSugar(){ this.currentSugar = 0; } public void growSugar(){ if(ticks > this.sugarGrowBackInterval){ if(this.currentSugar < this.maximumSugar){ if(this.maximumSugar - this.currentSugar < this.sugarGrowBackRate) this.currentSugar = this.maximumSugar; this.ticks = 0; } else{ this.currentSugar += this.sugarGrowBackRate; this.ticks = 0; } } else this.ticks ++; } }
4814b1b5-99bd-4afc-b9af-bc388f46c38b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-05-12 22:50:47", "repo_name": "fboschiero/franco-trazabilidad", "sub_path": "/trazabilidad/src/trazabilidad/common/filters/AuthenticationFilter.java", "file_name": "AuthenticationFilter.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "f04de504ff1f328d762fbbeba19803b9b9814a62", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fboschiero/franco-trazabilidad
206
FILENAME: AuthenticationFilter.java
0.267408
package trazabilidad.common.filters; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class AuthenticationFilter implements Filter { public void init(FilterConfig arg0) throws ServletException { } public void destroy() { } public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; //AgentToInvokeInfo agentToInvokeInfo = (AgentToInvokeInfo) ((HttpSession)httpRequest.getSession(true)).getAttribute("agentToInvokeInfo"); //if (agentToInvokeInfo != null) chain.doFilter(request, response); //else // httpResponse.sendRedirect(httpRequest.getContextPath()); } }
f55da71d-cc36-4d16-8cd6-18552bb33493
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-12 18:43:30", "repo_name": "wynro/UrlShortener2015", "sub_path": "/candy-pink/src/main/java/urlshortener2015/candypink/checker/web/ws/CheckerEndpoint.java", "file_name": "CheckerEndpoint.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "efa10a32167ed88a8bd0705126bf796ed2030bf1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wynro/UrlShortener2015
255
FILENAME: CheckerEndpoint.java
0.290176
package urlshortener2015.candypink.checker.web.ws; import urlshortener2015.candypink.checker.service.CheckerService; import urlshortener2015.candypink.checker.web.ws.schema.GetCheckerRequest; import urlshortener2015.candypink.checker.web.ws.schema.GetCheckerResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ws.server.endpoint.annotation.Endpoint; import org.springframework.ws.server.endpoint.annotation.PayloadRoot; import org.springframework.ws.server.endpoint.annotation.RequestPayload; import org.springframework.ws.server.endpoint.annotation.ResponsePayload; @Endpoint public class CheckerEndpoint { @Autowired protected CheckerService checker; @PayloadRoot(namespace = "http://urlshortener2015/candypink/checker/web/ws/schema", localPart = "getCheckerRequest") @ResponsePayload public GetCheckerResponse translator(@RequestPayload GetCheckerRequest request) { GetCheckerResponse response = new GetCheckerResponse(); boolean result = checker.queueUrl(request.getUrl()); String code; if(result){ code = "ok"; }else{ code = "error"; } response.setResultCode(code); return response; } }
60a39ee2-d8f5-4e44-b070-37bfe1655ba4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-28 04:02:07", "repo_name": "nguyenhongngoc52/Spring_Core", "sub_path": "/Common_Anotation/src/main/java/com/example/common_anotation/DaiHoc.java", "file_name": "DaiHoc.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "a8e3e8e0b7d4fbe86e44aa0c5f8a0e8c3aff3632", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nguyenhongngoc52/Spring_Core
273
FILENAME: DaiHoc.java
0.26588
package com.example.common_anotation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component public class DaiHoc { @Value("${DaiHoc.name}") private String tenTruong ; @Autowired private HieuTruong hieuTruong; @Autowired @Qualifier("giaoVienVan") private GiaoVien giaoVien; // public DaiHoc(HieuTruong hieuTruong) { // this.hieuTruong = hieuTruong; // } // @Autowired // @Qualifier("giaoVienVan") // public void setGiaoVien(GiaoVien giaoVien) { // this.giaoVien = giaoVien; // } // @Autowired // public void setHieuTruong(HieuTruong hieuTruong) { // this.hieuTruong = hieuTruong; // System.out.println("setter dang duoc su dung"); // } public void test(){ System.out.println(tenTruong); hieuTruong.thongTin(); giaoVien.info(); System.out.println("Test Anotation Spring"); } }
72c30673-3cb7-4ca7-8e95-e5c8e853e04c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-05 02:13:45", "repo_name": "WeigaoS/Zork", "sub_path": "/src/com/maze/role/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1061, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "1871e25df757e31d15643815b1b50352b79980d7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/WeigaoS/Zork
255
FILENAME: User.java
0.291787
package com.maze.role; import com.maze.Content; public class User { private Content[] contents = new Content[0]; private Integer x; private Integer y; public User(Integer x, Integer y) { this.x = x; this.y = y; } public Content[] getContents() { return contents; } public void addContents(Content content) { Content[] tmp = new Content[contents.length + 1]; for (int i = 0; i < contents.length; i++) { tmp[i] = contents[i]; } tmp[contents.length] = content; contents = tmp; } public void setXY(Integer x, Integer y) { this.x = x; this.y = y; } public Integer getX() { return x; } public Integer getY() { return y; } public void showGoods() { if (contents.length == 0) { System.out.println("You have nothing in the bag!"); } for (Content c : contents) { System.out.println("name:" + c.getGetName() + ",type:" + c.getGetType()); } } }
3f64b52d-7076-4df9-a877-66f40c6438c8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-27 03:09:27", "repo_name": "wpk1121/wpk.github.io", "sub_path": "/vso-top/vso-mq-client/src/main/java/com/landhightech/receive/UserModifyReceiver.java", "file_name": "UserModifyReceiver.java", "file_ext": "java", "file_size_in_byte": 1131, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "e3934491ab8935dcce534153ba107c0dd454d563", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wpk1121/wpk.github.io
254
FILENAME: UserModifyReceiver.java
0.239349
package com.landhightech.receive; //无用文件,可以在一个合适的时候把这个功能给去了 import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.amqp.core.Message; import org.springframework.amqp.core.MessageListener; public class UserModifyReceiver implements MessageListener { // 测试统计用 public int num; Lock lock = new ReentrantLock(); public final Logger logger = LoggerFactory.getLogger(this.getClass()); public void addNum() { lock.lock(); num++; lock.unlock(); } // 接收用户信息 public void onMessage(Message message) { // try { // logger.info("registerUser2;{}", // new String(new String(message.getBody(), "utf-8"))); // addNum(); // logger.info("receive:{}", num); // CommonThreadPool.execute(new UserInfoCallable(new String(message // .getBody(), "utf-8"))); // System.out.println(new Date()); // } catch (UnsupportedEncodingException e) { // logger.error(e.getMessage()); // } logger.info("MR"+message.getBody()); } }
7919713d-7b16-438d-a709-4d8d54f73df3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-16 11:08:22", "repo_name": "pixlmint/Jungschar_Protokoll", "sub_path": "/JungscharProtokoll/src/jungscharprotokoll/java/model/Model.java", "file_name": "Model.java", "file_ext": "java", "file_size_in_byte": 1696, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "8da94fd2dcb09467edd25cb00661a7bb3a8d82ae", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/pixlmint/Jungschar_Protokoll
229
FILENAME: Model.java
0.279828
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package jungscharprotokoll.java.model; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; /** * * @author chris */ public class Model { private final Protokoll protokoll = Protokoll.getInstance(); public void openNewWindow(String file, String title) throws IOException { Stage stage = Starter.getStage(); Parent root = FXMLLoader.load(getClass().getResource("/jungscharprotokoll/fxml/view/" + file)); Scene scene = new Scene(root); stage.setTitle(title); stage.setScene(scene); stage.show(); } public ArrayList<String> toArray(String text) { ArrayList<String> ret; String[] arr = text.split(protokoll.getNewLine()); ret = new ArrayList<>(Arrays.asList(arr)); return ret; } }
9fa9d3fa-8584-4dbf-a3c8-3950e2b8c8dc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-12 16:23:43", "repo_name": "alx77/jrogen", "sub_path": "/src/main/java/net/ugolok/generation/providers/PhoneNumberProvider.java", "file_name": "PhoneNumberProvider.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "6e66715055952e2e4b5ecf64344bb6dd07685dec", "star_events_count": 7, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/alx77/jrogen
227
FILENAME: PhoneNumberProvider.java
0.284576
package net.ugolok.generation.providers; import net.ugolok.generation.RandomArrayStreamer; import net.ugolok.generation.providers.api.AbstractRandomProvider; import java.util.Iterator; public class PhoneNumberProvider extends AbstractRandomProvider<String> { static private String[] codes = {"050", "052", "053", "054", "057", "058"}; static private Iterator<String> codeIterator = RandomArrayStreamer.streamify(codes, 0, codes.length, false) .iterator(); public PhoneNumberProvider() { super(); } public void setCodes(String[] codes) { PhoneNumberProvider.codes = codes; } @Override public Iterator<String> iterator() { return new Iterator<>() { @Override public boolean hasNext() { return true; } @Override public String next() { return String.format("%s-%07d", codeIterator.next(), randomGenerator.nextInt(9999999)); } }; } }
b638f7e9-5b7a-4529-bb09-3f833afb71c3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-03 02:50:52", "repo_name": "Lumine95/EasyContact", "sub_path": "/app/src/main/java/com/yigotone/app/user/UserManager.java", "file_name": "UserManager.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "8bc221208907344541e5eaf8c47834b65ed4499f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Lumine95/EasyContact
250
FILENAME: UserManager.java
0.261331
package com.yigotone.app.user; import android.content.Context; import com.android.library.utils.U; import com.yigotone.app.bean.ContactBean; import com.yigotone.app.bean.UserBean; import java.util.ArrayList; import java.util.List; /** * Created by ZMM on 2018/10/31 11:08. */ public class UserManager { private static UserManager mUserManager; public UserBean.DataBean userData; public List<ContactBean> contactList = new ArrayList<>(); public List<ContactBean> selectedList = new ArrayList<>(); // 存放选中的通讯录联系人 public static UserManager getInstance() { if (mUserManager == null) { mUserManager = new UserManager(); } return mUserManager; } /** * 存储用户数据 * * @param context * @param user */ public void save(Context context, UserBean.DataBean user) { U.savePreferences("uid", user.getUid()); U.savePreferences("token", U.MD5(user.getToken() + "_" + Constant.API_KEY)); userData = user; } }
88b91da2-57bb-4721-99b0-c78ce265aa62
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-18 13:35:52", "repo_name": "2YSP/statics", "sub_path": "/src/cn/sp/t10/ShutdownThreadPool.java", "file_name": "ShutdownThreadPool.java", "file_ext": "java", "file_size_in_byte": 1138, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "ae9812d13e0f2082986da10b50df6d0e6cc31f67", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/2YSP/statics
227
FILENAME: ShutdownThreadPool.java
0.267408
package cn.sp.t10; import java.util.concurrent.*; /** * Created by 2YSP on 2019/3/18. */ public class ShutdownThreadPool { private static void executorService()throws InterruptedException{ BlockingQueue<Runnable> queue = new LinkedBlockingDeque<>(10); ExecutorService service = new ThreadPoolExecutor(5,5,1, TimeUnit.SECONDS,queue); service.execute(()->{ System.out.println("running"); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } }); service.execute(()->{ System.out.println("running2"); try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } }); service.shutdown(); while (!service.awaitTermination(1,TimeUnit.SECONDS)){ System.out.println("线程还在执行"); } System.out.println ("Main Over!"); } public static void main(String[] args)throws Exception { executorService(); } }
05dfefa7-4b32-45d9-a9b6-36385a17b203
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-09 05:17:54", "repo_name": "fab-project/FabrentoPartner", "sub_path": "/app/src/main/java/com/app/fabrentopartner/Bean/BeanUserLogin.java", "file_name": "BeanUserLogin.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "fdc460fb9ea49fd130ca0899138b53071ace6b0e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/fab-project/FabrentoPartner
237
FILENAME: BeanUserLogin.java
0.228156
package com.app.fabrentopartner.Bean; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.List; public class BeanUserLogin { @SerializedName("success") @Expose private Boolean success; @SerializedName("message") @Expose private String message; @SerializedName("user_details") @Expose private List<UserLoginDetail> userDetails = null; @SerializedName("user_token") @Expose private String userToken; public Boolean getSuccess() { return success; } public void setSuccess(Boolean success) { this.success = success; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public List<UserLoginDetail> getUserDetails() { return userDetails; } public void setUserDetails(List<UserLoginDetail> userDetails) { this.userDetails = userDetails; } public String getUserToken() { return userToken; } public void setUserToken(String userToken) { this.userToken = userToken; } }
3ab66e51-87b3-45bf-a5c2-ccb11aefb463
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-07 12:52:35", "repo_name": "akinlabimh/space_invaders", "sub_path": "/MajorProgram3/src/majorprogram3/StatusPane.java", "file_name": "StatusPane.java", "file_ext": "java", "file_size_in_byte": 1011, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "eff274b1fe31c8340e9d9c629a3e0bf1b5717786", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/akinlabimh/space_invaders
214
FILENAME: StatusPane.java
0.26588
/* * 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 majorprogram3; import java.io.FileInputStream; import java.io.FileNotFoundException; import javafx.scene.image.Image; import javafx.scene.layout.Pane; /** * * @author akin */ public class StatusPane extends Pane { private int points; Image zero; public StatusPane() { points = 0; try { zero = new Image(new FileInputStream("100.png")); } catch (FileNotFoundException lmao) { System.err.println("This shouldnt be happening"); System.exit(-1); } this.setWidth(270); this.setHeight(200); } public void setPoints(int pts) { this.points = pts; } public int getPoints() { return points; } public void displayPoints() { System.out.println(points); } }
7102a30c-79b4-43cf-8213-f9b6620f4df7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-04 10:54:28", "repo_name": "ankitbots/Hybridframework", "sub_path": "/src/test/java/leverton/bdd/NavigationActionStep.java", "file_name": "NavigationActionStep.java", "file_ext": "java", "file_size_in_byte": 1125, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "3027d113bf818986b353e9c98c1e7bf63c265160", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ankitbots/Hybridframework
221
FILENAME: NavigationActionStep.java
0.277473
package leverton.bdd; import leverton.common.action.NavigateAction; import cucumber.api.java.en.Given; import org.apache.commons.lang3.StringUtils; import org.junit.Assert; import org.springframework.beans.factory.annotation.Autowired; /** * Created by AnkitNigam on 07/04/2018. */ public class NavigationActionStep extends SpringCukesIntegration { @Autowired private NavigateAction navigateAction; @Given("^User navigate to the application home$") public void userNavigateToTheApplicationHome() throws Exception { boolean flag = false; try{ String url = System.getProperty("applicationURL"); if (!StringUtils.isEmpty(url)){ flag = navigateAction.navigateToPage(url); }else { flag = false; } Assert.assertTrue("Unable to navigate to URL: " + url, flag); }catch (AssertionError assertionError){ throw new Exception("Navigation to url failed", assertionError); }catch (Exception ex){ throw new Exception("Error in navigating to url", ex); } } }
8d979095-10cb-415b-8b0c-05ef21fbffd0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-22 09:44:01", "repo_name": "suitianshuang/reviewer", "sub_path": "/reviewer/src/main/java/com/ebusiness/reviewer/service/CompetitionService.java", "file_name": "CompetitionService.java", "file_ext": "java", "file_size_in_byte": 1103, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "cd42b67c839a968ee310db8b1dfe7ed54b4ab2c4", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/suitianshuang/reviewer
204
FILENAME: CompetitionService.java
0.290176
package com.ebusiness.reviewer.service; import com.ebusiness.reviewer.mapper.CompetitionMapper; import com.ebusiness.reviewer.mapper.ScoringMapper; import com.ebusiness.reviewer.model.Competition; import com.ebusiness.reviewer.model.Scoring; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class CompetitionService { @Autowired CompetitionMapper competitionMapper; @Autowired ScoringMapper scoringMapper; public int createCompetition(Competition competition) { System.out.println(competition.getId()); return competitionMapper.createCompetition(competition); } public List<Competition> getCompetitionList() { return competitionMapper.getCompetitionList(); } public List<Scoring> getScoringRecords() { return scoringMapper.getScoringRecords(); } public int closeCompetitionById(Integer competitionId) { return competitionMapper.closeCompetitionById(competitionId); } }
94f4bca5-bb21-4070-a420-745fb65939ed
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-09 03:14:38", "repo_name": "ljmomo/learn-pattern", "sub_path": "/decorator-pattern/src/test/java/com/junli/AppTest.java", "file_name": "AppTest.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "b142cd16f641d3ceeafaaf4dd25b76c7e689027d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ljmomo/learn-pattern
271
FILENAME: AppTest.java
0.293404
package com.junli; import com.junli.examples.login.old.LoginService; import com.junli.examples.login.upgrede.IThridLoginService; import com.junli.examples.login.upgrede.ThridLoginService; import com.junli.examples.person.*; import org.junit.Test; /** * Unit test for simple App. */ public class AppTest{ @Test public void test(){ IThridLoginService thridLoginService = new ThridLoginService(new LoginService()); thridLoginService.loginForQQ("XXXMMMM"); ThridLoginService thridLoginService2 = new ThridLoginService(thridLoginService); thridLoginService2.loginForWechat("WX-MMM--TTT"); } @Test public void testPerson(){ System.out.println("一般人吃饭"); Person person = new ConcretePerson(); person.eat(); System.out.println("\t"); System.out.println("稍微讲究点的人吃饭"); Decorator decoratorA = new DecoratorPersonA(person); decoratorA.eat(); System.out.println("\t"); System.out.println("比较稍微讲究点的人吃饭"); Decorator decoratorB = new DecoratorPersonB(decoratorA); decoratorB.eat(); } }
8f52d16f-30ae-438f-bad5-c2f1cd74fb86
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-03 23:04:41", "repo_name": "luuj/Android-Projects", "sub_path": "/ProfileApp/app/src/main/java/itp341/luu/jonathan/a5luujonathan/DetailActivity.java", "file_name": "DetailActivity.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "033d264589827234849bb67ea6c8d115b784089c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/luuj/Android-Projects
224
FILENAME: DetailActivity.java
0.253861
package itp341.luu.jonathan.a5luujonathan; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.EditText; import android.widget.ImageView; import android.widget.Toast; public class DetailActivity extends Activity { public static final String saveDF = "itp341.saveDetailedFragment"; DetailFragment dF; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); //Send data up to the detailFragment if (savedInstanceState == null) dF = (DetailFragment) getFragmentManager().findFragmentById(R.id.detailFragment); else dF = (DetailFragment) getFragmentManager().getFragment(savedInstanceState, saveDF); dF.updateFields(getIntent()); } //Account for screen rotation @Override public void onSaveInstanceState(Bundle savedInstanceState){ super.onSaveInstanceState(savedInstanceState); getFragmentManager().putFragment(savedInstanceState, saveDF, dF); } }
2dd78c20-beb2-49ca-a56c-ae4445de3df3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-27 01:43:25", "repo_name": "cristiannietodev/SongStock2", "sub_path": "/SongStock2-ejb/src/java/co/songstock/uni/dao/DiscoDao.java", "file_name": "DiscoDao.java", "file_ext": "java", "file_size_in_byte": 1037, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "0cd35c8b3f51da2664dc799f3c6205b884dcb582", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cristiannietodev/SongStock2
217
FILENAME: DiscoDao.java
0.27048
/* * 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 co.songstock.uni.dao; import co.songstock.uni.entity.Disco; import co.songstock.uni.entity.Disco; import java.util.List; import javax.ejb.Stateless; import javax.ejb.LocalBean; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; /** * * @author Cristian */ @Stateless @LocalBean public class DiscoDao { @PersistenceContext EntityManager em; public void crear(Disco disco) { em.persist(disco); } public void actualizar(Disco disco) { em.merge(disco); } public void borrar(Disco disco) { em.remove(disco); } public List<Disco> findAll() { Query query=em.createNamedQuery("Disco.findAll"); return query.getResultList(); } }
5453c4bc-76d2-4cc4-9028-36531e440597
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-23T09:19:06", "repo_name": "wugengdeliuxi/vite-vue3-starter", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1321, "line_count": 32, "lang": "zh", "doc_type": "text", "blob_id": "d22996e096490794af55e23436be980468d10022", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wugengdeliuxi/vite-vue3-starter
319
FILENAME: README.md
0.253861
# Vue 3 + Typescript + Vite This template should help get you started developing with Vue 3 and Typescript in Vite. ### 前置知识 1.ts (https://www.typescriptlang.org/zh/) 2.vue3.0 (https://v3.cn.vuejs.org/) 3.vite配置 (https://cn.vitejs.dev/) 4.Airbnb JavaScript 风格指南 - 中文版 (https://github.com/lin-123/javascript) 5.Prettier (https://prettier.io/) 6.ESLint (https://eslint.org/) 7.Element Plus (https://element-plus.org/#/zh-CN) ### 目录结构规范 ├── publish/ └── src/ ├── assets/ // 静态资源目录 ├── common/ // 通用类库目录 ├── components/ // 公共组件目录 ├── router/ // 路由配置目录 ├── store/ // 状态管理目录 ├── style/ // 通用 CSS 目录 ├── utils/ // 工具函数目录 ├── views/ // 页面组件目录 ├── App.vue ├── main.ts ├── shims-vue.d.ts ├── tests/ // 单元测试目录 ├── index.html ├── tsconfig.json // TypeScript 配置文件 ├── vite.config.ts // Vite 配置文件 └── package.json
07997b74-8702-41c2-97d0-9fa4da4af8f6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-24 12:50:51", "repo_name": "leizton/learnjava", "sub_path": "/common/src/main/java/com/whiker/learn/common/NetUtil.java", "file_name": "NetUtil.java", "file_ext": "java", "file_size_in_byte": 1060, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "351cd619112fded04229ca126ab5f578f8bd833d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/leizton/learnjava
213
FILENAME: NetUtil.java
0.242206
package com.whiker.learn.common; import java.net.Inet4Address; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.util.Enumeration; import java.util.Optional; /** * @author leizton create on 17-3-9. */ public class NetUtil { public static Optional<String> localIp() { try { NetworkInterface ni; InetAddress inet; Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces(); while (nis.hasMoreElements() && (ni = nis.nextElement()) != null) { Enumeration<InetAddress> inets = ni.getInetAddresses(); while (inets.hasMoreElements() && (inet = inets.nextElement()) != null) { if (inet instanceof Inet4Address && !inet.isLoopbackAddress()) { return Optional.of(inet.getHostAddress()); } } } } catch (SocketException e) { // ignore } return Optional.empty(); } }
af0d2faf-71f9-4629-b03d-b0230cece08d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-15 10:09:45", "repo_name": "Naouf3l/jwtTestImplementation", "sub_path": "/src/main/java/org/myproject/test/authent/AuthentService.java", "file_name": "AuthentService.java", "file_ext": "java", "file_size_in_byte": 1111, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "14578d23716557f8b71a1b069eed753508b6d017", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Naouf3l/jwtTestImplementation
193
FILENAME: AuthentService.java
0.250913
package org.myproject.test.authent; import org.myproject.test.common.entity.User; import org.myproject.test.common.repo.UserRepository; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; import java.util.Optional; @Service public class AuthentService { private final UserRepository repository; private final BCryptPasswordEncoder bCryptPasswordEncoder; public AuthentService(UserRepository repository, BCryptPasswordEncoder bCryptPasswordEncoder) { this.repository = repository; this.bCryptPasswordEncoder = bCryptPasswordEncoder; } User getAnUser(final String login, final String password) { Optional<User> optionalUser = repository.findByLoginAndPassword(login, password); if(!optionalUser.isPresent()){ throw new RuntimeException("This user does not exist."); } return optionalUser.get(); } public void saveAnUser(User user) { user.setPassword(bCryptPasswordEncoder.encode(user.getPassword())); repository.save(user); } }
93ef1cbf-651a-43df-8334-9b1f1ec6380d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-21 15:30:05", "repo_name": "Erork/Better-Foliage", "sub_path": "/src/main/java/com/eerussianguy/betterfoliage/model/GrassLoader.java", "file_name": "GrassLoader.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "3240da6bc0d0e973335374e0fd77862bd08452b5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Erork/Better-Foliage
225
FILENAME: GrassLoader.java
0.242206
package com.eerussianguy.betterfoliage.model; import javax.annotation.ParametersAreNonnullByDefault; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; import net.minecraft.resources.IResourceManager; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.IModelLoader; import mcp.MethodsReturnNonnullByDefault; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault public class GrassLoader implements IModelLoader<GrassModel> { @Override public void onResourceManagerReload(IResourceManager resourceManager) { // do nothing } @Override public GrassModel read(JsonDeserializationContext deserializationContext, JsonObject json) { ResourceLocation dirt = new ResourceLocation(json.get("dirt").getAsString()); ResourceLocation top = new ResourceLocation(json.get("top").getAsString()); ResourceLocation overlay = new ResourceLocation(json.get("overlay").getAsString()); boolean tint = json.get("tint").getAsBoolean(); return new GrassModel(dirt, top, overlay, tint); } }
f1adf308-81d4-4d66-839b-b3b906e0e0d4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-14 11:51:49", "repo_name": "yuekaizong/Qingtian", "sub_path": "/Boot10MapStruct/src/main/java/kaizone/songmaya/qingtian/bean/GoodInfoBean.java", "file_name": "GoodInfoBean.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "c71d4c79a24abb71ef5521c9544b206cf751ef65", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/yuekaizong/Qingtian
270
FILENAME: GoodInfoBean.java
0.253861
package kaizone.songmaya.qingtian.bean; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "good_infos") public class GoodInfoBean { @Id @Column(name = "tg_id") private Long id; @Column(name = "tg_title") private String table; @Column(name = "tg_price") private double price; @Column(name = "tg_order") private int order; @Column(name = "tg_type_id") private Long typeId; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTable() { return table; } public void setTable(String table) { this.table = table; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public int getOrder() { return order; } public void setOrder(int order) { this.order = order; } public Long getTypeId() { return typeId; } public void setTypeId(Long typeId) { this.typeId = typeId; } }
49c0847e-9ae7-42d2-8624-b89b1aa2e149
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-20 15:17:47", "repo_name": "imgaryyang/netty_lecture", "sub_path": "/src/main/java/com/shengsiyuan/netty/nio/NioTest9.java", "file_name": "NioTest9.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "e4fb1f398b6cc80942296bd97bcc7ecaca6ab497", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/imgaryyang/netty_lecture
207
FILENAME: NioTest9.java
0.250913
package com.shengsiyuan.netty.nio; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; /** * @author bogle * @version 1.0 2019/3/17 下午10:34 */ public class NioTest9 { public static void main(String[] args) throws IOException { FileInputStream inputStream = new FileInputStream("input.txt"); FileOutputStream outputStream = new FileOutputStream("output.txt"); FileChannel inputChannel = inputStream.getChannel(); FileChannel outputChannel = outputStream.getChannel(); ByteBuffer buffer = ByteBuffer.allocateDirect(512); while (true) { buffer.clear(); int read = inputChannel.read(buffer); System.out.println("read:" + read); if (read == -1) { break; } buffer.flip(); outputChannel.write(buffer); } inputChannel.close(); outputChannel.close(); } }
5d8065f8-ccd0-48be-acb1-e28d415fae83
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-27 11:31:37", "repo_name": "vhavryk/videostore", "sub_path": "/src/main/java/com/test/service/dto/MovieTypeDTO.java", "file_name": "MovieTypeDTO.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "19c34acf34b66162b6cd46733e6c9f8a4f60fc77", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/vhavryk/videostore
265
FILENAME: MovieTypeDTO.java
0.268941
package com.test.service.dto; import java.io.Serializable; /** * A DTO for the {@link com.test.domain.MovieType} entity. */ public class MovieTypeDTO implements Serializable { private Long id; private String name; private Integer bonus; public Integer getBonus() { return bonus; } public void setBonus(Integer bonus) { this.bonus = bonus; } 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; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof MovieTypeDTO)) { return false; } return id != null && id.equals(((MovieTypeDTO) o).id); } @Override public int hashCode() { return 31; } // prettier-ignore @Override public String toString() { return "MovieTypeDTO{" + "id=" + getId() + ", name='" + getName() + "'" + "}"; } }
b5b26de1-33d6-4e19-9d46-38946e791417
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-24 14:49:17", "repo_name": "bdlgdlb/lianxi", "sub_path": "/16.22/Exercise16_22.java", "file_name": "Exercise16_22.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "26510bbfb1c88cdafb17fc252f95f69383244d24", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/bdlgdlb/lianxi
270
FILENAME: Exercise16_22.java
0.288569
import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.layout.HBox; import javafx.scene.control.Button; import javafx.geometry.Pos; import javafx.geometry.Insets; import javafx.scene.media.AudioClip; import javafx.util.Duration; public class Exercise16_22 extends Application { @Override public void start(Stage primaryStage) { Button play = new Button("Play"); Button loop = new Button("Loop"); Button stop = new Button("Stop"); HBox pane = new HBox(5); pane.setAlignment(Pos.CENTER); pane.setPadding(new Insets(10, 10, 10, 10)); pane.getChildren().addAll(play, loop, stop); AudioClip audio = new AudioClip( "http://cs.armstrong.edu/liang/common/audio/anthem/anthem3.mp3"); play.setOnAction(e -> { audio.play(); }); stop.setOnAction(e -> { audio.stop(); }); loop.setOnAction(e -> { audio.setCycleCount(AudioClip.INDEFINITE); }); Scene scene = new Scene(pane); primaryStage.setTitle("Exercise16_22"); primaryStage.setScene(scene); primaryStage.show(); } }
d5da2c45-aec4-4f69-8f0a-2ac4236a6110
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-18 06:43:45", "repo_name": "vicoqi/myproject", "sub_path": "/mytest-project/src/main/java/com/vic/chain/CustomResult.java", "file_name": "CustomResult.java", "file_ext": "java", "file_size_in_byte": 1152, "line_count": 65, "lang": "en", "doc_type": "code", "blob_id": "9ef9c7519e38a98b50b19108bc1a5bb8b64e14be", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/vicoqi/myproject
275
FILENAME: CustomResult.java
0.264358
package com.vic.chain; import java.io.Serializable; public class CustomResult<T> implements Serializable { private static final long serialVersionUID = -7003210754311840835L; /** * 返回结果 */ private T data; /** * 错误code,code为0表示成功 */ private int code; /** * 错误message */ private String message; public CustomResult() { this(null, 0, null); } public CustomResult(T data, int code, String message) { this.data = data; this.code = code; this.message = message; } public CustomResult(T resultContent) { this(resultContent, 0, null); } public T getData() { return data; } public void setData(T data) { this.data = data; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public boolean isSuccess() { return this.code == 0; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
b4c5f305-9183-4d18-ac5f-479b8b6e9adf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-07-09 15:23:02", "repo_name": "jeffrpowell/jeffpowell-api", "sub_path": "/src/main/java/dev/jeffpowell/api/model/KnownTech.java", "file_name": "KnownTech.java", "file_ext": "java", "file_size_in_byte": 1054, "line_count": 71, "lang": "en", "doc_type": "code", "blob_id": "33812c4e013b373de995c0fb5757609d27d81082", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jeffrpowell/jeffpowell-api
277
FILENAME: KnownTech.java
0.271252
package dev.jeffpowell.api.model; import java.util.Objects; public class KnownTech { private String name; private String category; public KnownTech() { } public KnownTech(String name, String category) { this.name = name; this.category = category; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } @Override public int hashCode() { int hash = 3; hash = 71 * hash + Objects.hashCode(this.name); hash = 71 * hash + Objects.hashCode(this.category); return hash; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KnownTech other = (KnownTech) obj; if (!Objects.equals(this.name, other.name)) { return false; } return Objects.equals(this.category, other.category); } }
6ba117fd-734b-4243-80c8-60b5cd0b1f5c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-19 13:20:26", "repo_name": "letter-messaging/letter-core", "sub_path": "/src/main/java/com/github/ivanjermakov/lettercore/mail/service/MailService.java", "file_name": "MailService.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "c9d4e6ef316dac1dc65ae996c970621a0b159347", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/letter-messaging/letter-core
215
FILENAME: MailService.java
0.255344
package com.github.ivanjermakov.lettercore.mail.service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Service; @Service public class MailService { private final static Logger LOG = LoggerFactory.getLogger(MailService.class); @Value("${spring.mail.username}") private String from; private final JavaMailSender javaMailSender; @Autowired public MailService(JavaMailSender javaMailSender) { this.javaMailSender = javaMailSender; } public void send(String to, String subject, String content) { LOG.info("Sending message to @", to); SimpleMailMessage message = new SimpleMailMessage(); message.setFrom(from); message.setTo(to); message.setSubject(subject); message.setText(content); javaMailSender.send(message); LOG.info("Sent message to @", to); } }
81139dc0-f827-4e94-ac79-87ae32197214
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-19 20:57:50", "repo_name": "ProPra16/programmierpraktikum-abschlussprojekt-unicorndefenders", "sub_path": "/src/de/hhu/propra16/unicorndefenders/tddt/files/Source.java", "file_name": "Source.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "61d33d48a6da2fd3c517d65476132a6db48fca91", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ProPra16/programmierpraktikum-abschlussprojekt-unicorndefenders
265
FILENAME: Source.java
0.264358
package de.hhu.propra16.unicorndefenders.tddt.files; import vk.core.api.CompilationUnit; import vk.core.api.CompileError; import vk.core.api.CompilerResult; import java.util.Collection; /** * Quellcode-Datei * * @author Pascal */ public class Source extends File { /** * Liste von Compilerfehlern */ protected Collection<CompileError> compilerErrors; /** * Uebersetzungseinheit fuer die Quellcode-Datei */ protected CompilationUnit compilationUnit; /** * Konstruktor. * * @param file */ public Source(File file) { content = file.content; logicalName = file.logicalName; compilationUnit = new CompilationUnit(logicalName, content, false); } /** * Liste der Kompilierungsfehler setzen. * * @param result */ public void setCompilerErrors(CompilerResult result) { compilerErrors = result.getCompilerErrorsForCompilationUnit(compilationUnit); } public Collection<CompileError> getCompilerErrors() { return compilerErrors; } CompilationUnit getCompilationUnit() { return compilationUnit; } }
cef3f965-ec3b-4c3c-a051-6bc73d34db94
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-20 20:15:59", "repo_name": "Kojack8/caseStudy", "sub_path": "/caseStudySpringBootv2/src/main/java/com/entitymodels/ShoppingCartEntity.java", "file_name": "ShoppingCartEntity.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "06aa5c08de89612895d82e1218512fb8e1d93fc8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Kojack8/caseStudy
238
FILENAME: ShoppingCartEntity.java
0.26971
package com.entitymodels; import com.fasterxml.jackson.annotation.JsonBackReference; import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; import javax.persistence.*; import java.sql.Timestamp; @Entity @Table(name = "shopping_cart") public class ShoppingCartEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false) private Integer id; @Column(name = "updated_date", columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP") private Timestamp updatedDate; @ManyToOne @JoinColumn(name = "user_id") @OnDelete(action = OnDeleteAction.CASCADE) private UserEntity userEntity; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Timestamp getUpdatedDate() { return updatedDate; } public void setUpdatedDate(Timestamp updatedDate) { this.updatedDate = updatedDate; } public UserEntity getUserEntity() { return userEntity; } public void setUserEntity(UserEntity userEntity) { this.userEntity = userEntity; } }
c7530a1d-674e-4d24-a6e3-b5ce176e56f9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-13 11:58:53", "repo_name": "zhaojiaxing/study", "sub_path": "/study/src/main/study/src/main/java/com/zjx/util/graph/NodePath.java", "file_name": "NodePath.java", "file_ext": "java", "file_size_in_byte": 1151, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "e029ac656651a84ec207ca30e0a5611cf3ce2c44", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zhaojiaxing/study
248
FILENAME: NodePath.java
0.286169
package com.zjx.util.graph; import lombok.Data; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** * 所有搜索路径的集合 * */ @Data public class NodePath<T extends GraphEdge> { /** * 顺序存放搜索访问的节点 */ public List<T> edgeList = new ArrayList<>(); @Override public String toString() { StringBuilder str = new StringBuilder(); for (GraphEdge graphEdge : edgeList) { if (str.length()==0){ str.append("NodePath{ edgeList="); str.append(graphEdge.getSource()); } str.append("->"); str.append(graphEdge.getTarget()); } return str.toString() + '}'; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NodePath nodePath = (NodePath) o; return Objects.equals(edgeList, nodePath.edgeList); } @Override public int hashCode() { return Objects.hash(edgeList); } }
791f1a85-9d72-46a4-838f-8cb7d36a8d6c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-29 10:34:25", "repo_name": "lincstyle/pds0727", "sub_path": "/pds0727/src/test/java/com/ctdcn/weixin/WeixinTest.java", "file_name": "WeixinTest.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "5da1f6299e393f22fddb5f7d61e8d006f10e0e0a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lincstyle/pds0727
251
FILENAME: WeixinTest.java
0.220007
package com.ctdcn.weixin; import com.ctdcn.pds.sys.service.ValidateWxMessageService; import com.ctdcn.pds.weixin.service.WxMessageService; import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.cp.api.WxCpServiceImpl; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author 张靖 * 2015-06-19 16:04. */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "classpath:spring/applicationContext.xml") public class WeixinTest { @Autowired private WxMessageService wxMessageService; @Autowired @Qualifier("wxCpService") private WxCpServiceImpl wxCpService; @Autowired private ValidateWxMessageService validateWxMessageService; public void sendProjectLogTest() throws WxErrorException { validateWxMessageService.ValidateWxMessageUser(); } }
5d3de484-52cd-4a4c-a995-11a89ce2789f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-06-30T18:01:20", "repo_name": "INKA10/Password-Generator", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1023, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "8d87b5175570d349ce89ae33058b23a02a9871d1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/INKA10/Password-Generator
216
FILENAME: README.md
0.289372
# Password-Generator In order for the user to generate a random password, they must select from the input requests of: -length of password -special characters and, -numeric characters Knowing that the user will need a password generated with alphabet characters - this input will be default to both upper and lower case letters. In this case, the user is ensured that at least one character is selected without them actually having to 'select' an input. # Criteria When the user clicks on 'Generate Password', the user will be prompted to select on password criterias. Once the user clicks on submit, they can then 'copy to clipboard' the password and use the PW of their choosing. # Installation 1. Open the GitHub Repo to the Password Generator link 2. Click on Password Generator 3. Select from characters and length and click submit, or exit out the modal through the 'x' button 4. Copy to Clipboard 5. Generate a new password at your pleasing as needed. ![Password Generator](ScreenShotPass.png)
2ed49b65-1241-49bc-8abb-a38e321c2d02
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-11 14:37:26", "repo_name": "alexi-s/TourManager", "sub_path": "/src/main/java/domain/Client.java", "file_name": "Client.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "feab2a28e597be679ad801a784228105d2ac777d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/alexi-s/TourManager
192
FILENAME: Client.java
0.272025
package domain; import lombok.*; @Data @AllArgsConstructor @NoArgsConstructor public class Client { private int id; private String firstName; private String lastName; private ClientSex sex; private int age; private String phone; public Builder toBuilder() { return this.new Builder(); } public class Builder { public Builder setId(int id) { Client.this.id = id; return this; } public Builder setFirstName(String firstName) { Client.this.firstName = firstName; return this; } public Builder setLastName(String lastName) { Client.this.lastName = lastName; return this; } public Builder setAge(int age) { Client.this.age = age; return this; } public Builder setPhone(String phone) { Client.this.phone = phone; return this; } public Client build() { return Client.this; } } }
2ab45ddc-1b32-4e56-936f-bf0edf20f514
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-24 21:06:51", "repo_name": "csnow99/Softeng-YAML", "sub_path": "/src/main/java/edu/wpi/cs/yaml/demo/http/GetChoiceResponse.java", "file_name": "GetChoiceResponse.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "baddb41f9ab9d70ac63d5cab5727835754d55dd6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/csnow99/Softeng-YAML
256
FILENAME: GetChoiceResponse.java
0.272799
package edu.wpi.cs.yaml.demo.http; import edu.wpi.cs.yaml.demo.model.Choice; public class GetChoiceResponse extends GenericResponse{ Choice choice; String participantName; public Choice getChoice() {return this.choice;} public String getParticipantName() {return this.participantName;} public void setChoice(Choice choice) {this.choice = choice;} public void setParticipantName(String participantName) {this.participantName = participantName;} //when code 200 public GetChoiceResponse(String response, Choice c, String name) { super(response); this.choice = c; this.participantName = name; } public GetChoiceResponse(String response, Choice c) { super(response); this.choice = c; this.participantName = ""; } //when code not 200 null is returned as the choice public GetChoiceResponse(int code, String response) { super(response, code); this.choice = null; this.participantName = ""; } public GetChoiceResponse(int code, String response, Choice c) { super(response,code); this.choice = c; this.participantName = ""; } }
898602c6-c1fc-4c3a-a136-26d03a76dc5a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-22 12:58:59", "repo_name": "yuanpeili/springBoot", "sub_path": "/src/main/java/com/lpy/marks/service/impl/CompanyServiceImpl.java", "file_name": "CompanyServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "2ea6850042fac331e69997000f1c6a934d6553dd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/yuanpeili/springBoot
216
FILENAME: CompanyServiceImpl.java
0.264358
package com.lpy.marks.service.impl; import com.lpy.marks.dao.CompanyDao; import com.lpy.marks.model.Company; import com.lpy.marks.service.CompanyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class CompanyServiceImpl implements CompanyService { @Autowired private CompanyDao companyDao; @Override public int deleteByPrimaryKey(Integer id) { return companyDao.deleteByPrimaryKey(id); } @Override public int insert(Company record) { return companyDao.insert(record); } @Override public int insertSelective(Company record) { return companyDao.insertSelective(record); } @Override public Company selectByPrimaryKey(Integer id) { return companyDao.selectByPrimaryKey(id); } @Override public int updateByPrimaryKeySelective(Company record) { return companyDao.updateByPrimaryKeySelective(record); } @Override public int updateByPrimaryKey(Company record) { return companyDao.updateByPrimaryKey(record); } }
c6696138-af8f-4e0c-ad6d-0f8fdc3af53f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-01 01:49:50", "repo_name": "lincan2017/learn", "sub_path": "/src/main/java/pattern/builder/UserPlus.java", "file_name": "UserPlus.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "5cf26daf5bcf215899a179f60f93cf0949d76408", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lincan2017/learn
284
FILENAME: UserPlus.java
0.277473
package pattern.builder; /** * @author : Lin Can * @description : 构造者模式 * @modified :By * @date : 2018/5/29 8:32 */ public class UserPlus { private String firstName; // 必传参数 private String lastName; // 必传参数 private int age; // 可选参数 private String phone; // 可选参数 private String address; // 可选参数 public UserPlus(UserBuilder userBuilder) { this.firstName = userBuilder.getFirstName(); this.lastName = userBuilder.getLastName(); this.address = userBuilder.getAddress(); this.age = userBuilder.getAge(); this.phone = userBuilder.getPhone(); } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public int getAge() { return age; } public String getPhone() { return phone; } public String getAddress() { return address; } @Override public String toString() { return "User [firstName=" + firstName + ", lastName=" + lastName + ", age=" + age + ", phone=" + phone + ", address=" + address + "]"; } }
da734ec2-c8bb-4da2-a7d6-c94934c34ef6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-24 18:53:02", "repo_name": "mchocilowicz/HadoopIgnite", "sub_path": "/cache/ignite-login-app/src/main/java/com/ignite/loginapp/controller/HomeController.java", "file_name": "HomeController.java", "file_ext": "java", "file_size_in_byte": 1059, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "fa2c1928368b00493d5175eccb3657ef461200fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mchocilowicz/HadoopIgnite
193
FILENAME: HomeController.java
0.239349
package com.ignite.loginapp.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.ignite.loginapp.constants.Constants; @Controller public class HomeController implements Constants { @RequestMapping(method = RequestMethod.GET, value = { "/home" }) public String home(ModelMap modelMap, HttpServletRequest httpServletRequest) { HttpSession httpSession = httpServletRequest.getSession(false); if (httpSession != null) { modelMap.addAttribute(LOGIN_SESSION_DATA_ATTRIBUTE, httpSession.getAttribute(LOGIN_SESSION_DATA_ATTRIBUTE) == null ? "Sorry,Your session has expired" : httpSession.getAttribute(LOGIN_SESSION_DATA_ATTRIBUTE)); } else { modelMap.addAttribute(LOGIN_SESSION_DATA_ATTRIBUTE, "Sorry,Your session has expired"); } return "welcome"; } }
56598782-99f0-418d-8b52-f41d38145870
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-11-14 05:00:32", "repo_name": "selvarmanee/betaService", "sub_path": "/src/main/java/com/langda/ws/twitterOAuth.java", "file_name": "twitterOAuth.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "4f91dff3072f8dd37033f8f9a0212aedc60198f5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/selvarmanee/betaService
259
FILENAME: twitterOAuth.java
0.247987
package com.langda.ws; import java.io.IOException; import twitter4j.TwitterException; import com.langda.util.VerifyTwitterCredentials; public class twitterOAuth { public static void main(String[] args) { // Properties prop = new Properties(); // String consumerKey = "lMuuwuhqK0eRcqwhSySA"; String consumerSecret = "fGqw1GKapQW6dtPGrz6zXuzbI4QtozRTnnYYORlI"; // prop.setProperty("oauth.consumerKey", consumerKey); // prop.setProperty("oauth.consumerSecret", consumerSecret); try { VerifyTwitterCredentials verifyTwitterCred = new VerifyTwitterCredentials(consumerKey, consumerSecret); verifyTwitterCred.setPin(); verifyTwitterCred.setAccessToken(); verifyTwitterCred.getTimeline(); } catch (TwitterException te) { te.printStackTrace(); System.out.println("Failed to get accessToken: " + te.getMessage()); System.exit(-1); } catch (IOException ioe) { ioe.printStackTrace(); System.out.println("Failed to read the system input."); System.exit(-1); } } }
2851fcac-86ee-459b-8f68-87cfc049e7cc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-02-07T05:17:31", "repo_name": "Dsharris85/My-C-NTH", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1175, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "a0f618ae0da2ec359c72841a79c8ddd1b7fafa44", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Dsharris85/My-C-NTH
327
FILENAME: README.md
0.26588
# My C#NTH Audio Synthesizer written in C# ![alt text](https://github.com/Dsharris85/My-C-NTH/blob/master/Demo.View/Views/Images/logoSplash.png "My C#NTH") My C#NTH is a sound synthesizer written in C# using the [NAudio](https://github.com/naudio/NAudio) library. It includes a main polyphonic synthesizer with various effects, and a 3x Osc monophonic synthesizer ![alt text](https://github.com/Dsharris85/My-C-NTH/blob/master/Demo.View/Views/Images/MainScreen.png "Main Screen/Polyphonic Synth") ![alt text](https://github.com/Dsharris85/My-C-NTH/blob/master/Demo.View/Views/Images/MonoSynth.png "Monophonic 3x Osc Synth") Each module has it's own effects and the user may save/load presets made. **Included Features:** **_- Octave multiplier_** **_- ADSR Filter_** **_- High/Low Pass Filters_** **_- Overdrive Effect_** **_- Bitcrusher_** **_- Tremelo Effect_** **_- Live, visual keyboard feedback_** Additionally, song playback can be played through the included [song player](https://github.com/Dsharris85/My-C-NTH/blob/master/Demo.View/Views/Images/Player.png), pre-loaded with nursery rhymes and chord progressions to play along to Made to have fun!
3a950627-8eff-454f-b2c0-6661aef66c6a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-06-30 18:48:08", "repo_name": "prakashnsm/myweb", "sub_path": "/src/com/moogu/myweb/client/feature/reserve/ReserveTabItem.java", "file_name": "ReserveTabItem.java", "file_ext": "java", "file_size_in_byte": 1172, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "dd75188801acdea730d2698496b6a3e93779f86a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/prakashnsm/myweb
255
FILENAME: ReserveTabItem.java
0.274351
package com.moogu.myweb.client.feature.reserve; import com.extjs.gxt.ui.client.widget.TabPanel; import com.google.gwt.user.client.Element; import com.moogu.myweb.client.MyWebEntryPoint; import com.moogu.myweb.client.common.widget.misc.TabItem; import com.moogu.myweb.client.feature.reserve.management.ManagementTabItem; import com.moogu.myweb.client.feature.reserve.overview.OverviewTabItem; public class ReserveTabItem extends TabItem { private final TabPanel tp = new TabPanel(); private final OverviewTabItem overview = new OverviewTabItem(); public ReserveTabItem() { super("Reserve EUR"); } @Override protected void onRender(Element parent, int index) { super.onRender(parent, index); tp.setAutoHeight(true); this.add(tp); // everybody can see it tp.add(overview); // ILMS01 can't see it if (MyWebEntryPoint.isUserRole(MyWebEntryPoint.ROLE_2) || MyWebEntryPoint.isUserRole(MyWebEntryPoint.ROLE_3)) { final ManagementTabItem managementTabItem = new ManagementTabItem(); tp.add(managementTabItem); } } }
31e772af-2d0a-4846-81ce-52edd8faf3a4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-21 18:08:28", "repo_name": "vetas775/AILPCS10", "sub_path": "/src/com/ailpcs/util/NetworkUtil.java", "file_name": "NetworkUtil.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "f6ba74976ea321836cc4ca3c7008b48f39dce8a7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/vetas775/AILPCS10
318
FILENAME: NetworkUtil.java
0.272799
package com.ailpcs.util; import javax.servlet.http.HttpServletRequest; /** * 网络工具类 * @author chenzhiheng * */ public class NetworkUtil { /** *获取请求主机IP地址 * @param request * @return */ public final static String getIpAddress(HttpServletRequest request){ String ip = request.getHeader("x-forwarded-for"); if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_CLIENT_IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_X_FORWARDED_FOR"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } return ip.equals("0:0:0:0:0:0:0:1")?"127.0.0.1":ip; } }
73908a46-5bb0-4f48-97dd-3e4b9c049524
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-02-07 01:15:19", "repo_name": "Bowbaq/webdesign-port-authority", "sub_path": "/app/models/gtfs/csv/CalendarDateAdapter.java", "file_name": "CalendarDateAdapter.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "259f05ec0a6756a6e45ff9d01beed4a665ce549a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Bowbaq/webdesign-port-authority
206
FILENAME: CalendarDateAdapter.java
0.290176
package models.gtfs.csv; import com.googlecode.jcsv.reader.CSVEntryParser; import models.gtfs.Calendar; import models.gtfs.CalendarDate; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Map; public class CalendarDateAdapter extends BaseAdapter implements CSVEntryParser<CalendarDate> { private static SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); private Map<String, Calendar> calendars; @Override public CalendarDate parseEntry(String... data) { CalendarDate date = new CalendarDate(); date.calendar = calendars.get(data[mapping.get("service_id")]); try { date.date = formatter.parse(data[mapping.get("date")]); } catch (ParseException e) {} date.exception_type = data[mapping.get("exception_type")].equals("1") ? CalendarDate.ADDED : CalendarDate.REMOVED; return date; } public void setCalendars(Map<String, Calendar> calendars) { this.calendars = calendars; } }
1ae14b20-986c-480c-8407-ed868ed324ac
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-18 14:34:09", "repo_name": "jlumietu/eej-security-handlers", "sub_path": "/eej-security-handlers/src/main/java/com/eej/security/service/ThirdPartyUserDetailsService.java", "file_name": "ThirdPartyUserDetailsService.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "45e3ad8bf60f3ef59db0d15a8381d074adbb4058", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jlumietu/eej-security-handlers
221
FILENAME: ThirdPartyUserDetailsService.java
0.264358
/** * */ package com.eej.security.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; /** * @author jlumietu - Mikel Ibiricu Alfaro * */ public class ThirdPartyUserDetailsService implements ThirdPartyLoginService { @Autowired private LoginServiceDao loginServiceDao; //private /* (non-Javadoc) * @see com.eej.security.service.ThirdPartyLoginService#login(java.lang.String, java.lang.String) */ @Override public UserDetails login(String userName, String password) { UserDetails details = this.loginServiceDao.login(userName, password); return details; } /** * @return the loginServiceDao */ public LoginServiceDao getLoginServiceDao() { return loginServiceDao; } /** * @param loginServiceDao the loginServiceDao to set */ public void setLoginServiceDao(LoginServiceDao loginServiceDao) { this.loginServiceDao = loginServiceDao; } }
13afa6a5-b363-4472-ba44-24bfb152c981
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-09 02:46:32", "repo_name": "xixiyuguang/voteSystem", "sub_path": "/src/com/zqq/file/DownServlet.java", "file_name": "DownServlet.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "4d539e66b35bb38bf9450a7891efd48373240761", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/xixiyuguang/voteSystem
211
FILENAME: DownServlet.java
0.26588
package com.zqq.file; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URLEncoder; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class DownServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String filename = request.getParameter("file"); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "utf-8")); response.setContentType(this.getServletContext().getMimeType(filename));// MIME String path = this.getServletContext().getRealPath("files/images"); InputStream in = new FileInputStream(new File(path, filename)); OutputStream out = response.getOutputStream(); IOUtils.In2Out(in, out); IOUtils.close(in, null); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
409ade74-423f-48cc-8f99-422bdae85417
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-12 22:01:59", "repo_name": "AndreyChapkin/project-db", "sub_path": "/ProjectDB/src/entities/TimeNorm.java", "file_name": "TimeNorm.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "64de11e69ba7b440ef039e25d0a776c40fa35e53", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AndreyChapkin/project-db
247
FILENAME: TimeNorm.java
0.290176
package entities; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.NamedQuery; import javax.persistence.Table; @Entity @Table(name = "Time_Norm") @NamedQuery(name = "AllTimeNorms", query = "select tn from TimeNorm tn") public class TimeNorm implements Serializable { private static final long serialVersionUID = 1L; public TimeNorm() { } public TimeNorm(String normSign, String normDescrip) { this.normSign = normSign; this.normDescrip = normDescrip; } @Column(name = "NORM_SIGN") @Id private String normSign; @Column(name = "NORM_DESCRIPTION") private String normDescrip; public String getNormDescrip() { return normDescrip; } public void setNormDescrip(String param) { this.normDescrip = param; } public String getNormSign() { return normSign; } public void setNormSign(String param) { this.normSign = param; } public void refresh(TimeNorm tn) { this.normDescrip = tn.getNormDescrip(); } }
7e5a091d-9d3c-4518-aeac-b260b3903b0b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-07-04T17:34:28", "repo_name": "jonathanholt/mean_bean_machine", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1051, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "e8df0c2cf08402de2418eda149c5c39a47694a4e", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/jonathanholt/mean_bean_machine
239
FILENAME: README.md
0.250913
![alt text](http://img2.game-oldies.com/sites/default/files/titles/sega-genesis/dr-robotnik-s-mean-bean-machine-usa.png) # Dr. Robotnik's Mean Bean Machine A popular puzzle game researched for the Sega Mega Drive in Europe and the Sega Genesis in the USA. The mechanics of the game (one in a long line of 'Puyo Puyo' games) are explained here: https://en.wikipedia.org/wiki/Puyo_Puyo#Gameplay ## About ## The game is being built in Unity 2D from scratch. All code has been developed by me completely individually. Other assets used in the project, as well as copyright information, will follow shortly. ## History ## ### Pre-Alpha Build 0.1 - 20th February ### The game is in semi-working order. The logic of the game works from a single player perspective and most animations, UI elements and events are all in place. Virtually every feature requires some tweaks and improvements and some features are completely missing. Two particular features are missing; any form of AI behaviour and also nuissance bean functionality. ## Credits ##
c0895b16-eb16-476d-8c2f-44adb543affb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-03 10:06:47", "repo_name": "4bd4ll4h/Hackerrank-Solutions", "sub_path": "/src/com/abd4ll4h/decode_problem.java", "file_name": "decode_problem.java", "file_ext": "java", "file_size_in_byte": 1172, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "142646e90c8a40683145c2387acaf8e369f0a126", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/4bd4ll4h/Hackerrank-Solutions
260
FILENAME: decode_problem.java
0.290176
package com.abd4ll4h; import java.util.*; public class decode_problem { static HashSet hashSet; public static void main(String[] args) { Scanner in = new Scanner(System.in); Deque deque = new ArrayDeque<Integer>(); int n = in.nextInt(); int m = in.nextInt(); int res=0; for (int i = 0; i < n; i++) { int num = in.nextInt(); deque.addLast((Integer)num); if(deque.size()>=m){ int first= (int) deque.getFirst(); if(deque.size()>m) { first= (int) deque.removeFirst(); } int r=unique_count((ArrayDeque) deque,first); if(r>res)res=r; } if(res>=m)break; } System.out.println(res); } public static int unique_count(ArrayDeque list ,int first){ if (hashSet==null) { hashSet= new HashSet<>(list); return hashSet.size(); } else { if (!list.contains(first)) hashSet.remove(first); hashSet.add(list.getLast()); return hashSet.size(); } } }
a562d6db-eb36-4d7d-801b-a8586119c6fe
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-06 12:16:03", "repo_name": "songquanhe-gitstudy/pet-androidAndServer", "sub_path": "/pet/petClient/petClient/app/src/main/java/com/song/petLeague/fragment/chatFragment/ConversationFragmentEx.java", "file_name": "ConversationFragmentEx.java", "file_ext": "java", "file_size_in_byte": 1280, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "84c248507fadd0342fed72a8cd524c7456648428", "star_events_count": 4, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/songquanhe-gitstudy/pet-androidAndServer
296
FILENAME: ConversationFragmentEx.java
0.259826
package com.song.petLeague.fragment.chatFragment; import io.rong.imkit.fragment.ConversationFragment; import io.rong.imlib.model.Conversation; /** * 会话 Fragment 继承自ConversationFragment * onResendItemClick: 重发按钮点击事件. 如果返回 false,走默认流程,如果返回 true,走自定义流程 * onReadReceiptStateClick: 已读回执详情的点击事件. * 如果不需要重写 onResendItemClick 和 onReadReceiptStateClick ,可以不必定义此类,直接集成 ConversationFragment 就可以了 * Created by Yuejunhong on 2016/10/10. */ public class ConversationFragmentEx extends ConversationFragment { @Override public boolean onResendItemClick(io.rong.imlib.model.Message message) { return false; } @Override public void onReadReceiptStateClick(io.rong.imlib.model.Message message) { if (message.getConversationType() == Conversation.ConversationType.GROUP) { //目前只适配了群组会话 // Intent intent = new Intent(getActivity(), ReadReceiptDetailActivity.class); } } public void onWarningDialog(String msg) { String typeStr = getUri().getLastPathSegment(); if (!typeStr.equals("chatroom")) { super.onWarningDialog(msg); } } }
5ed41c92-1a44-4743-88b3-31f5daaf836f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-12-27T09:17:39", "repo_name": "jasvilladarez/telegram-resistance-bot", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1110, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "4bd6411346604d8ae51563b15c23019f0287b109", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jasvilladarez/telegram-resistance-bot
263
FILENAME: README.md
0.188324
# Telegram Resistance Bot A Resistance bot for Telegram. This is currently incomplete and I'm still unsure if I would still finish it. # Usage Add this to your telegram group. Create a key.js file with the following code: ``` 'use strict'; module.exports.key = function() { return <KEY>; } ``` where `KEY` is the one provided by `BotFather` Run ```node index.js``` # Commands * /newgame - to create a new game * /startgame - to start a game * /join - to join a game * /stopgame - to stop a game * /players - to check the list of players # License Copyright 2016 Jasmine Villadarez Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
17475e6b-c189-431f-b760-8c7765ee1f6d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-31 10:36:52", "repo_name": "konradvonkirchbach/Music_Advisor", "sub_path": "/Music Advisor/task/src/advisor/request/newrealeases/NewDto.java", "file_name": "NewDto.java", "file_ext": "java", "file_size_in_byte": 1172, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "91e156dc15407caf5b1a7c0e79a6143398f81230", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/konradvonkirchbach/Music_Advisor
236
FILENAME: NewDto.java
0.293404
package advisor.request.newrealeases; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import java.util.*; public class NewDto { private String name; private List<String> artists = new ArrayList<>(); private String href; @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append(name).append("\n"); builder.append(artists.toString()).append("\n"); builder.append(href).append("\n"); return builder.toString(); } public static NewDto NewDtoBuilder(JsonObject jsonObject) { NewDto newDto = new NewDto(); newDto.name = jsonObject.get("name").getAsString(); JsonArray artistsArray = jsonObject.get("artists").getAsJsonArray(); for (int i = 0; i < artistsArray.size(); i++) { JsonObject artist = artistsArray.get(i).getAsJsonObject(); newDto.artists.add(artist.get("name").getAsString()); } newDto.href = jsonObject.get("external_urls") .getAsJsonObject() .get("spotify") .getAsString(); return newDto; } }
59e1f81e-eee0-4996-b74d-3854614f9833
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-31 09:25:16", "repo_name": "HemaSundarPenugonda/PersonalUse", "sub_path": "/src/test/java/com/hs/poc/StreamsPOC.java", "file_name": "StreamsPOC.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "27510304fd39ffb175fcd37c373a740ab83ffc6f", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/HemaSundarPenugonda/PersonalUse
239
FILENAME: StreamsPOC.java
0.267408
package com.hs.poc; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; public class StreamsPOC { public static void main(String[] args) throws IOException { Stream<String> stream = Files.lines(Paths.get("/Users/hemasundar/Downloads/iservice_testautomation/src/main/resources/pageObjects/Mobile/IOS/Login Page.spec")); String[] currentLocator = stream.filter((str) -> !str.startsWith("==")) .filter((str) -> !str.startsWith("#")) .filter((str) -> !str.trim().equalsIgnoreCase("")) .filter((str) -> !str.startsWith("Page Title:")) .map(str -> str.replaceAll("[\\s]+", " ")) .map(str -> str.split(" ", 3)) .filter(str -> str[0].equalsIgnoreCase("text_accountMissingError")) .findFirst() .get(); System.out.println(currentLocator[0] + "\n" + currentLocator[1] + "\n" + currentLocator[2]); } }
46b5105e-33fc-4479-be1d-5c9703c7e0cc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-16 06:08:33", "repo_name": "zuoni1018/RiYueCun", "sub_path": "/app/src/main/java/com/zuoni/riyuecun/MainApplication.java", "file_name": "MainApplication.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "0bb7b0fc7c53657ad81922549dc21533c0e40723", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zuoni1018/RiYueCun
230
FILENAME: MainApplication.java
0.235108
package com.zuoni.riyuecun; import android.app.Application; import com.baidu.mapapi.SDKInitializer; import com.umeng.message.IUmengRegisterCallback; import com.umeng.message.PushAgent; import com.yanzhenjie.nohttp.NoHttp; import com.zuoni.common.utils.LogUtil; /** * Created by zangyi_shuai_ge on 2017/9/27 */ public class MainApplication extends Application { @Override public void onCreate() { super.onCreate(); NoHttp.initialize(getApplicationContext()); SDKInitializer.initialize(getApplicationContext()); PushAgent mPushAgent = PushAgent.getInstance(this); //注册推送服务,每次调用register方法都会回调该接口 mPushAgent.register(new IUmengRegisterCallback() { @Override public void onSuccess(String deviceToken) { //注册成功会返回device token LogUtil.i("deviceToken"+deviceToken); } @Override public void onFailure(String s, String s1) { LogUtil.i("deviceToken onFailure"); } }); } }
ef6b6479-ed99-4165-a9af-b66381bc6c52
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-07T22:38:53", "repo_name": "tuliooassis/react-chat", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1039, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "fd4feb71fb500f93aa5c35ff3189c91be2804f12", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tuliooassis/react-chat
262
FILENAME: README.md
0.218669
# React Chat with XMPP ### Features You can do: - Login and logout: useful to identify who is going to interact with the system - See who is online: useful to identify for who you want to send a message - Send 'Hi' to someone: the first step to communicate with someone - Rooms - See the available rooms and the number of users there - Create a new room with random name - Join to a specific room - Send 'Hello' to everyone in a specific room - Delete a room - User Management - Add a user with random username and default password `123456` - Delete a specific user (in progress) ### Next Steps - Login validation - Store the XMPP client session - Send messages with any texts Tip: you can update the available data by clicking on the update button ### Running the application You should add a `.env` file based on the `.env.example` with correct credentials. For development proposals, you can run: `./run-app-deploy.sh dev` or `docker-compose up -d --build` Open [http://localhost:3001](http://localhost:3001).
69465106-fda6-4465-aad5-617490fe36c5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-03 22:22:12", "repo_name": "bcfay/HW5", "sub_path": "/src/Reading.java", "file_name": "Reading.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "f525fd232555d7f7bb12c0bda953fea7ef76e07f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/bcfay/HW5
217
FILENAME: Reading.java
0.27048
public class Reading { private Time time; private double temperature; private double rainfall; public Reading(Time time, double temperature, double rainfall) { this.time = time; this.temperature = temperature; this.rainfall = rainfall; } /** * getter method for the time * @return time */ public Time getTime() { return time; } /** * getter method for temperature * @return temperature */ public double getTemperature() { return temperature; } /** * setter method for temperature * @param temperature */ public void setTemperature(double temperature) { this.temperature = temperature; } /** * Getter method for rainfall * @return rainfall */ public double getRainfall() { return rainfall; } /** * setter method for rainfall * @param rainfall */ public void setRainfall(double rainfall) { this.rainfall = rainfall; } }
8c18e2aa-48da-40d0-a104-54e5274ea968
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-07-30 01:44:59", "repo_name": "tildeio/moneta", "sub_path": "/src/main/java/io/tilde/moneta/CompositeKeyMapping.java", "file_name": "CompositeKeyMapping.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "45607c1616ded57828ed00d6a7feda7388a013d9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tildeio/moneta
257
FILENAME: CompositeKeyMapping.java
0.290981
package io.tilde.moneta; import com.datastax.driver.core.querybuilder.Clause; import java.util.ArrayList; import java.util.List; import static com.datastax.driver.core.querybuilder.QueryBuilder.eq; /** * @author Carl Lerche */ public class CompositeKeyMapping extends KeyMapping { final List<FieldMapping> primaryFields; public CompositeKeyMapping(List<FieldMapping> primaryFields) { this.primaryFields = primaryFields; } public List<Clause> predicateForGet(Object key) { if (key instanceof CompositeKey) { return predicateForGet((CompositeKey) key); } throw new IllegalArgumentException("key is not composite"); } public List<Clause> predicateForGet(CompositeKey key) { if (key.size() != primaryFields.size()) { throw new IllegalArgumentException( "key arity (" + key.size() + ") does not match model (" + primaryFields .size() + ")"); } List<Clause> ret = new ArrayList<>(primaryFields.size()); for (int i = 0; i < primaryFields.size(); ++i) { ret.add(eq(primaryFields.get(i).getName(), key.get(i))); } return ret; } }
4b490560-17dc-4ac0-8189-bb24d202cd70
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-18 00:03:45", "repo_name": "KamilSusek/book-reservation-manager", "sub_path": "/src/main/java/com/library/libraryapi/controller/AuthorController.java", "file_name": "AuthorController.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "66d4668b8374630fbff392a0b51e0a57efbf0822", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/KamilSusek/book-reservation-manager
214
FILENAME: AuthorController.java
0.262842
package com.library.libraryapi.controller; import com.library.libraryapi.model.dao.dtos.AuthorDTO; import com.library.libraryapi.model.dao.entities.Author; import com.library.libraryapi.model.services.AuthorService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @CrossOrigin public class AuthorController { private final AuthorService authorService; @Autowired public AuthorController(AuthorService authorService) { this.authorService = authorService; } @GetMapping("/author/{name}") public Author getAuthorByName(@PathVariable String name) { return authorService.getAuthorByName(name); } @GetMapping("/authors") public List<AuthorDTO> getAllAuthors() { return authorService.getAllAuthors(); } @PostMapping("/author") public ResponseEntity createAuthor(AuthorDTO authorDTO) { final String authorName = authorDTO.getAuthorName(); authorService.createAuthor(authorName); return ResponseEntity.ok().build(); } }
bd94f8c4-ba9c-45fc-b90b-78d0ec23e84e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-02-28T10:31:18", "repo_name": "NewGr8Player/ElasticSearch-Demo", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1639, "line_count": 51, "lang": "zh", "doc_type": "text", "blob_id": "2d0fcd0c438c28597bc644765f8fa366330bf771", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/NewGr8Player/ElasticSearch-Demo
467
FILENAME: README.md
0.286169
# ElasticSearch-Demo 基于canal同步mysql增量到ElasticSearch,并提供查询支持 # 配置说明 ```yaml # canal部分 canal: client: instances: example: # 实例名,可配置多个该节点 String host: 127.0.0.1 # ip或域名 String port: 11111 # 端口 Integer batch-size: 1000 # 最大并发消息数量 Integer cluster-enabled: false # 集群模式 boolean zookeeper-address: # 当集群模式开启时,需要填写该地址,多个使用逗号分隔 # 自定义配置 sync: elasticsearch: # Elasticsearch配置 host: 127.0.0.1 #ES地址 port: 9200 # ES端口 schema: http # ES使用协议(使用Rest-client使用http) config: mapping: # 下面包含第一层List,是单表的配置 - enabled: true # 是否启用 boolean table-name: pt_petition_case # 表名 String fields: # 下面包含第二层list - field-name: id # 表字段 String mapping-name: idMappingName # 映射为字段 String show: true # 是否显示 boolean enable: false # 是否启用该映射 boolean ``` # 依赖中间件 - 依赖Canal,版本:1.1.2 - 依赖ElasticSearch,版本:6.5.2 # 现有功能 - 使用canal解析MySQL的binlog并存入ElasticSearch - 定制化字段名称与是否显示(TODO) - 提供简单查询接口 # sql文件夹 日志支持存入数据库,sql文件夹下为结构初始化脚本 参数值参考JDBC # TODO [ ] 后期有计划将各部分解耦,使用消息队列(Kafka/RabbitMQ等)进行通信。 [ ] 将分页改为scroll Api [ ] 表字段名映射
61069d49-15b2-4233-adab-54d42d602df1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-30 10:01:16", "repo_name": "yangtie34/workspace", "sub_path": "/android/ModulesDev/eyun_db_lib/src/main/java/com/yiyun/chengyi/eyun_db_lib/configure/ServerConfig.java", "file_name": "ServerConfig.java", "file_ext": "java", "file_size_in_byte": 1263, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "652686b33764ca63db2cb9843209874d35d28163", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/yangtie34/workspace
354
FILENAME: ServerConfig.java
0.255344
package com.yiyun.chengyi.eyun_db_lib.configure; /** * Created by Administrator on 2017/2/20. */ public final class ServerConfig { //---------数据源相关驱动------------ public static class JDBC { public static final String driverName = "net.sourceforge.jtds.jdbc.Driver";//"com.microsoft.sqlserver.jdbc.SQLServerDriver";//"oracle.jdbc.driver.OracleDriver"; public static String ipAndPort="192.168.56.248:1533"; public static String orcl="JYun_Bang_Storage_Test"; public static String url = "jdbc:jtds:sqlserver://"+ipAndPort+"/"+orcl;//"jdbc:sqlserver://192.168.56.248:1533;DatabaseName=HuaChi_Test";//"jdbc:oracle:thin:@ 202.196.0.180:1521:DM"; public static String user = "jyun_bang_storage"; public static String password = "jyun_bang_storage_20170215"; //验证数据库连接是否健康 public static final String validationQuery = "select getdate()";//"select sysdate from dual"; //最小连接数 public static final int minPool = 1; //单次增加连接数的数量 public static final int upPool = 5; //最大连接数 public static final int maxPool = 100; } //---------数据源相关驱动------------ }
22f91f7f-9bfd-40ae-911b-05e34cf3ee44
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-03 03:53:43", "repo_name": "onelee85/knowme", "sub_path": "/src/main/java/com/crawl/entity/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "ec4e26cb2dc1f193b63d04f9d4b79903531923d2", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/onelee85/knowme
266
FILENAME: User.java
0.242206
package com.crawl.entity; import javax.persistence.*; import java.util.Date; /** * @author: jiao.li@ttpod.com * Date: 2018/11/12 15:29 */ @Entity @Table(name = "users") public class User { //ID主键 @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private Long id; @Column(name = "name") private String name; @Column(name = "pref_list") private String prefList; @Column(name = "latest_log_time") private Date latestTime; 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 getPrefList() { return prefList; } public void setPrefList(String prefList) { this.prefList = prefList; } public Date getLatestTime() { return latestTime; } public void setLatestTime(Date latestTime) { this.latestTime = latestTime; } }
3eeb62b4-bde4-419d-a590-8c3c60e7b114
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-19 08:04:02", "repo_name": "LiufengNetwork/HTTPServer", "sub_path": "/src/main/java/nju/edu/utils/LogInvoHandler.java", "file_name": "LogInvoHandler.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "a923cd77cd7d26a9d2b4e6bbf37970defc8dbf98", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LiufengNetwork/HTTPServer
245
FILENAME: LogInvoHandler.java
0.295027
package nju.edu.utils; import nju.edu.server.impl.HttpResponseImpl; import java.lang.reflect.*; /** * Created by SuperSY on 2017/12/10. */ public class LogInvoHandler implements InvocationHandler { private Object target; //目标 private LogInvoHandler() { } @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object result = method.invoke(target, args); //处理完response,添加日志记录 afterHandle(); return result; } public static <T> T getProxyInstance(T target) { LogInvoHandler invoHandler = new LogInvoHandler(); invoHandler.setTarget(target); return (T) Proxy.newProxyInstance(invoHandler.getClass().getClassLoader(), target.getClass().getInterfaces(), invoHandler); } public void setTarget(Object target) { this.target = target; } private void afterHandle() { String log = ((HttpResponseImpl) target).fromLog(); if (log != null && !log.equals("")) { LogUtils.writeLog(log); } } }
24112c28-3f3a-4bbf-93db-dea7eb093c2b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-29 20:25:45", "repo_name": "MarioGonzalezRamirez/Restaurant", "sub_path": "/src/Table.java", "file_name": "Table.java", "file_ext": "java", "file_size_in_byte": 1111, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "3cc1e4fbbf0c7fbad6ca468954fb49c7f1dc2c9d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MarioGonzalezRamirez/Restaurant
268
FILENAME: Table.java
0.259826
public class Table { private String name; private MenuItem[] order = new MenuItem[10]; private int itemCount; public Table(String name){ this.name = name; } public String getName() { return name; } public void setName(String name){ this.name = name; } public void addItem(MenuItem zoinks) { order[itemCount] = zoinks; itemCount++; } public MenuItem[] getItems() { return order; } public double getTotalPrice() { double cacita = 0; for( int i = 0; i < itemCount; i++){ cacita = cacita + itemCount; } return cacita; } public int determinePrepTime(){ int chungus = 0; for(int i = 0; i < itemCount; i++){ if(order[i].getPrepTime() > chungus){ chungus = order[i].getPrepTime(); } } return chungus; } public String toString(){ return("Table:" + name + " Items: " + itemCount + " Total Price: " + getTotalPrice() + " Prep Time: " + determinePrepTime()); } }
3580a6e9-77a1-44f6-a2a3-82f786b73d33
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-02 14:24:01", "repo_name": "s20151/jaz-java", "sub_path": "/app/src/main/java/pl/edu/pjwstk/jaz/controllers/SectionController.java", "file_name": "SectionController.java", "file_ext": "java", "file_size_in_byte": 1126, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "0bea3bcb99bab2eabb4f6433b6181dc38c7f0a07", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/s20151/jaz-java
209
FILENAME: SectionController.java
0.277473
package pl.edu.pjwstk.jaz.controllers; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import pl.edu.pjwstk.jaz.requests.SectionRequest; import pl.edu.pjwstk.jaz.services.SectionService; import javax.servlet.http.HttpServletResponse; import javax.transaction.Transactional; @RestController public class SectionController { SectionService sectionService; public SectionController(SectionService sectionService) { this.sectionService = sectionService; } @PreAuthorize("hasAuthority('admin')") @PostMapping("/section") @Transactional public void createSection(@RequestBody SectionRequest sectionRequest, HttpServletResponse response){ sectionService.createSection(sectionRequest, response); } @PreAuthorize("hasAuthority('admin')") @PutMapping("/section/{sectionID}") @Transactional public void createSection(@PathVariable("sectionID") Long id, @RequestBody SectionRequest sectionRequest, HttpServletResponse response){ sectionService.editSection(id,sectionRequest, response); } }
6463ed9c-09d8-4922-a2f8-7109c35e6aa9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-17 12:09:13", "repo_name": "kevin4oct/HSC", "sub_path": "/app/src/main/java/com/hbth/hsc/bean/EightPaperReaderBean.java", "file_name": "EightPaperReaderBean.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "676be60104c1ffade4e399ccbc71e30551ad690e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kevin4oct/HSC
265
FILENAME: EightPaperReaderBean.java
0.23092
package com.hbth.hsc.bean; import java.util.List; /** * Created by Administrator on 2018/3/5. * 8点报详情实体类 */ public class EightPaperReaderBean { private String paperName; private String paperIsSc; private List<EightPaperPicBean> picList; public EightPaperReaderBean() { } public String getPaperName() { return paperName; } public void setPaperName(String paperName) { this.paperName = paperName; } public String getPaperIsSc() { return paperIsSc; } public void setPaperIsSc(String paperIsSc) { this.paperIsSc = paperIsSc; } public List<EightPaperPicBean> getPicList() { return picList; } public void setPicList(List<EightPaperPicBean> picList) { this.picList = picList; } @Override public String toString() { return "EightPaperReaderBean{" + "paperName='" + paperName + '\'' + ", paperIsSc='" + paperIsSc + '\'' + ", picList=" + picList + '}'; } }
e5676b90-9ffa-4f15-b070-92fbe5357d35
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-17 08:50:14", "repo_name": "zagsuccess/rl-app-messageSent", "sub_path": "/rl-app-duban/src/main/java/com/uhope/duban/dto/DubanFeedbackDTO.java", "file_name": "DubanFeedbackDTO.java", "file_ext": "java", "file_size_in_byte": 1193, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "339528027fbb019c60307de8491f30977b12a5d0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zagsuccess/rl-app-messageSent
277
FILENAME: DubanFeedbackDTO.java
0.261331
package com.uhope.duban.dto; import com.uhope.duban.domain.ScDubanFeedback; import com.uhope.template.domain.Template; import java.util.Date; /** * 模版表-DTO数据传输对象类 * @author ChenBin on 2018/09/04 */ public class DubanFeedbackDTO extends ScDubanFeedback { private String objectname; public DubanFeedbackDTO() { } public DubanFeedbackDTO(String objectname) { this.objectname = objectname; } public DubanFeedbackDTO(Date feedbacktime, String objectid, String whetherlocale, String whether, String description, String assessoryyuan, String assessory, String supervisionid, String status, Date createtime, String objectname) { super(feedbacktime, objectid, whetherlocale, whether, description, assessoryyuan, assessory, supervisionid, status, createtime); this.objectname = objectname; } public String getObjectname() { return objectname; } public void setObjectname(String objectname) { this.objectname = objectname; } @Override public String toString() { return "DubanFeedbackDTO{" + "objectname='" + objectname + '\'' + '}'; } }
8fb88f45-dde9-4bd6-be90-00e0c23bc1f1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-18 02:48:53", "repo_name": "puguhTri/expMicroservice", "sub_path": "/emailservice/src/main/java/com/puguh/service/emailservice/services/EmailServiceImpl.java", "file_name": "EmailServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "ee6e5fef2fdbf1e95726f7d07496c0d2c22da732", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/puguhTri/expMicroservice
178
FILENAME: EmailServiceImpl.java
0.218669
package com.puguh.service.emailservice.services; import com.puguh.service.emailservice.entities.dto.UserDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.MailException; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Service; @Service public class EmailServiceImpl implements EmailService { @Autowired JavaMailSender javaMailSender; @Override public void sendSimpleMessage(UserDto input) { try { SimpleMailMessage message = new SimpleMailMessage(); message.setTo(input.getUsername()); message.setSubject("test microservices"); message.setText("Microservices consume kafka from topic"); System.out.println("Mail TO ::: " + input.getUsername()); javaMailSender.send(message); } catch (MailException exception) { exception.printStackTrace(); } } }
862b6694-2a24-4ff1-9987-b53129f0e4a2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-12-27T09:57:02", "repo_name": "CamronLDNF/rock_paper_scissors_2", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1170, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "baa143a3ba863fd0861d36ce0fc430de07c9cb03", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/CamronLDNF/rock_paper_scissors_2
299
FILENAME: README.md
0.287768
# **Rock Paper Scissors game** ------- View it [live here](https://camronldnf.github.io/rock_paper_scissors_2/). This is a simple rock paper scissors game, built in node.js. Click any button to play. Some of the features: * Animated buttons * No need to refresh browser: play repeat games by continuing to click buttons ## Tech stack ------- Languages & frameworks & tools used: * Javascript and Node.js * Node package manager (npm) * HTML and CSS Testing environment: * Feature testing: Cucumber, Puppeteer, Chai * Unit testing: Mocha, Chai ## How to install & use ------- 1. Download the app folder 2. Open the app folder in your terminal / CLI 3. Make sure you have Node.js and npm installed ([installation info here](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)) 4. Run `npm init` to initiate a node project, then `npm install` to install all the packages of the project 5. Run `npm server` then visit `localhost:3000` in your browser to view the app To test the app: * In your terminal / CLI: * To test features: run `npm run features` * To test unit specs: run `npm run specs` * To test both in one go: run `npm run test`
f03949df-aec8-4dd6-814f-58fa0513d5d1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-13 14:32:20", "repo_name": "huangfei-123/two", "sub_path": "/dongyimai-service/dongyimai-file-service/src/main/java/com/offcn/controller/FileUploadController.java", "file_name": "FileUploadController.java", "file_ext": "java", "file_size_in_byte": 1278, "line_count": 34, "lang": "zh", "doc_type": "code", "blob_id": "83b0ac870dd6960f2f1d2ba7772beb14e8e0b919", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/huangfei-123/two
291
FILENAME: FileUploadController.java
0.288569
package com.offcn.controller; import com.offcn.entity.Result; import com.offcn.entity.StatusCode; import com.offcn.file.FastDFSFile; import com.offcn.util.FastDFSUtil; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @RestController @CrossOrigin//解决跨域 public class FileUploadController { /**** * 文件上传 */ @PostMapping("/upload") public Result upload(@RequestParam(value = "file") MultipartFile file) throws Exception{ //封装文件信息 FastDFSFile fastDFSFile = new FastDFSFile( file.getOriginalFilename(),//文件名 file.getBytes(), //文件字节数组 StringUtils.getFilenameExtension(file.getOriginalFilename())// 文件扩展名 ); //调用FastDFSUtil工具类将文件传入到FastDFS中 String[] path = FastDFSUtil.upload(fastDFSFile);//此处因为tracker或虚拟机的内存问题 可能已经满了 无法存了 返回空 String url = "http://192.168.232.128:8080/"+path[0]+"/"+path[1]; System.out.println("文件存储的url:"+url); return new Result(true, StatusCode.OK,"上传成功!",url); } }
f440b4e7-d817-4e1f-a8a5-cecc6c7de52a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-17 16:26:01", "repo_name": "kalai6095/c9_io_backup_may_3", "sub_path": "/src/main/java/com/kalai/work_rep/web/controllers/JController.java", "file_name": "JController.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "eec0a259e61f4cc71ce7222e2258db0b0d20e89b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kalai6095/c9_io_backup_may_3
200
FILENAME: JController.java
0.273574
package com.kalai.work_rep.web.controllers; import com.kalai.work_rep.persistence.models.Jform; import com.kalai.work_rep.web.service.JService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController public class JController { @Autowired private JService jService; @CrossOrigin @PostMapping("/insert/addj") public ResponseEntity<String> postJformInsert(@RequestBody Jform jform) { System.out.println("----------------------"); System.out.println(jform.toString()); jService.insertJ(jform); return new ResponseEntity<String>(HttpStatus.OK); } @CrossOrigin @GetMapping("/page/getj") public ResponseEntity<List<Jform>> getJformReport() { System.out.println("----------------------"); return new ResponseEntity<List<Jform>>(jService.getPageJ(), HttpStatus.OK); } }
61e9b148-2e5d-4fd7-9ca4-ad9feb6936eb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-21 01:20:50", "repo_name": "LiamLuUW/ShopifyChallenge", "sub_path": "/app/src/main/java/com/liam/shopifychallenge/ProductListViewHolder.java", "file_name": "ProductListViewHolder.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "e387b1a8f9655ed740b6f50ad12ded0af98ebf4a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LiamLuUW/ShopifyChallenge
198
FILENAME: ProductListViewHolder.java
0.239349
package com.liam.shopifychallenge; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.View; import android.widget.ImageView; import android.widget.TextView; /** * ViewHolder for productList RecyclerView */ public class ProductListViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private OnProductClickListener onProductClickListener; public ImageView productImage; public TextView productTitle; public TextView productQuantity; public TextView productDesc; public ProductListViewHolder(View view, OnProductClickListener onProductClickListener) { super(view); this.onProductClickListener = onProductClickListener; productImage = view.findViewById(R.id.product_image); productTitle = view.findViewById(R.id.product_title); productDesc = view.findViewById(R.id.product_description); productQuantity = view.findViewById(R.id.product_total_quantity); view.setOnClickListener(this); } @Override public void onClick(View view) { onProductClickListener.onItemClick(view, getAdapterPosition()); } }
70f8c3bd-ec9f-4008-b602-28734b716509
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-03-02T02:48:12", "repo_name": "aws-samples/amazon-forecast-samples", "sub_path": "/library/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1127, "line_count": 26, "lang": "en", "doc_type": "text", "blob_id": "170790b0936f1318c3648b8c8a3f724bf789f12f", "star_events_count": 503, "fork_events_count": 412, "src_encoding": "UTF-8"}
https://github.com/aws-samples/amazon-forecast-samples
264
FILENAME: README.md
0.267408
# Library of Guides, Best Practices, and Cheat Sheets This guide establishes a library of content by topical areas which is indexed and easy to discover. **Table of Contents** - [Amazon Forecast Introduction](./content/Introduction.md) - [Mapping your data into Amazon Forecast](./content/Datasets.md) - [Target Time Series](./content/TargetTimeSeries.md) - [Related Time Series](./content/RelatedTimeSeries.md) - [Item Metadata](./content/ItemMetadata.md) - [Weather Index](./content/WeatherIndex.md) - [Holidays](./content/HolidaysFeaturization.md) - [Data Preparation](./content/DataPrep.md) - [Building a Strong Time-Series ML Model: AutoPredictor](./content/AutoPredictor.md) - [Predictor Explainability](./content/PredictorExplainability.md) <br><br> **Update June 15, 2022** This library is intended to replace the [Getting Started Guide and Best Practices Cheat Sheet Tutorial](https://github.com/aws-samples/amazon-forecast-samples/blob/master/ForecastCheatSheet.md) which has served as a long-standing guide to help customers with onboarding and Amazon Forecast Best Practices.
6c8aa333-ab32-4244-b262-e227b85b55fc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-06-02T21:47:52", "repo_name": "johnpallag/MashedPotatoRacoons", "sub_path": "/milestone7.md", "file_name": "milestone7.md", "file_ext": "md", "file_size_in_byte": 1174, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "8992fb52a467e6282da32db3f1eb4a9028b35ed3", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/johnpallag/MashedPotatoRacoons
270
FILENAME: milestone7.md
0.267408
# Milestone 7 ## Team Member Contributions Alex - Create basic HTML/CSS for landing page. Virus design and UI design for whole page. John - Heat map (view core functionality). Multiple player visualization. Tracking multiple players on the server. Better navigation saving. Sophia - Worked on the choose virus page, switched from boostrap to materialize, created viruses with Illustrator and made it so that clicking on the images of the virsus also opens their individiual modals. Page: https://epidemic-go.herokuapp.com/choose_virus/index_notbootstrap.html Xu - Worked on Main page and How to play page, added profile and levels showing up in the sidenav and a new page to how to play. ## Core Functionality: The map now has heat maps of each person that has longed on. Each person getting a different color. The map als covers a smaller area when you open it (more zoomed in). Zoomed in image: ![ScreenGrab](https://raw.githubusercontent.com/johnpallag/MashedPotatoRacoons/master/milestone7_zoom.png) Heat map feature: ![ScreenGrab](https://raw.githubusercontent.com/johnpallag/MashedPotatoRacoons/master/milestone7_heatmap.png)