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
8567a819-d8f3-434d-91a0-57142a1c50c4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-27 20:52:13", "repo_name": "MindaugasNavickas/PickTrackerFYP_Server", "sub_path": "/src/main/java/com/picker/server/controller/GetItemController.java", "file_name": "GetItemController.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "bcb7e96a7b42ebf8f31c841667f258d3fe317dc9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MindaugasNavickas/PickTrackerFYP_Server
228
FILENAME: GetItemController.java
0.280616
package com.picker.server.controller; import java.sql.SQLException; import java.util.List; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.google.gson.Gson; import com.picker.server.Item; import com.picker.server.ItemDataAccess; @RestController public class GetItemController { private final String dbURL = "jdbc:mysql://localhost:3306/picksDatabase"; private final String user = "root"; private final String password = "Mindziukas1234"; @RequestMapping(method = RequestMethod.GET, value = "/getItems", produces = "application/json") @ResponseBody public String getItems(@RequestParam(value = "itemID", required = true) String itemID) throws ClassNotFoundException, SQLException { ItemDataAccess itemDataAccess = new ItemDataAccess(dbURL, user, password); List<Item> itemsList = itemDataAccess.getItem(itemID); String json = new Gson().toJson(itemsList); return json; } }
123ba57c-b9e2-477f-a370-8d795688654e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-18 11:08:04", "repo_name": "AuBGa/aubga", "sub_path": "/aubga-jwt/src/main/java/com/aubga/jwt/controller/TokenInterceptor.java", "file_name": "TokenInterceptor.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "15e8b3b859945f2b93516c3f8a880ff3494932e5", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AuBGa/aubga
192
FILENAME: TokenInterceptor.java
0.201813
package com.aubga.jwt.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; import com.aubga.jwt.util.TokenUtil; /** * 自定义token拦截器 */ @Component public class TokenInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (request.getMethod().equals("OPTIONS")){ response.setStatus(HttpServletResponse.SC_OK); return true; } response.setCharacterEncoding("utf-8"); String token = request.getHeader("admin-token"); if (token != null){ boolean result = TokenUtil.verify(token); if(result){ System.out.println("通过拦截器"); return true; } } System.out.println("认证失败"); response.getWriter().write("50000"); return false; } }
29fab482-3883-4a0d-b7cc-1c527facb448
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-22 11:19:59", "repo_name": "Junaid17/Android_Session7_Assignment_7.1", "sub_path": "/app/src/main/java/com/example/jmush/android_session7_assignment_71/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "4ca624759c733287975bb9f9a44047b54efed6a5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Junaid17/Android_Session7_Assignment_7.1
180
FILENAME: MainActivity.java
0.217338
package com.example.jmush.android_session7_assignment_71; import android.app.SearchManager; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; public class MainActivity extends AppCompatActivity { EditText etSearch; Button btnSearch; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); etSearch= (EditText) findViewById(R.id.edTextSearch); btnSearch= (Button) findViewById(R.id.btnSave); btnSearch.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String result=etSearch.getText().toString(); Intent intent=new Intent(Intent.ACTION_WEB_SEARCH); intent.putExtra(SearchManager.QUERY,result); startActivity(intent); } }); } }
d1e601eb-07e9-4ba3-a5c2-e398ea42fcf3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-01 08:24:13", "repo_name": "ivanNzhukov/CbrXmlParser", "sub_path": "/src/main/java/ru/cbr/xml/parser/converters/RecordConverter.java", "file_name": "RecordConverter.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "975b0f73b7e4730e5d41f8c78a41b323fd730a7a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ivanNzhukov/CbrXmlParser
214
FILENAME: RecordConverter.java
0.279828
package ru.cbr.xml.parser.converters; import org.simpleframework.xml.convert.Converter; import org.simpleframework.xml.stream.InputNode; import org.simpleframework.xml.stream.OutputNode; import ru.cbr.xml.parser.courses.Record; import static ru.cbr.xml.parser.courses.Record.*; public class RecordConverter implements Converter<Record> { public Record read(InputNode node) throws Exception { Record record = new Record(); record.setDate(node.getAttribute(DATE).getValue()); record.setId(node.getAttribute(ID).getValue()); InputNode next = node.getNext(); while (next != null) { if (NOMINAL.equals(next.getName())) { record.setNominal(Integer.parseInt(next.getValue())); } else if (VALUE.equals(next.getName())) { String newString = next.getValue().trim().replace(",", "."); record.setValue(Double.valueOf(newString)); } next = node.getNext(); } return record; } public void write(OutputNode node, Record value) { throw new UnsupportedOperationException("Not ready converter yet"); } }
7073d8e9-6222-4b8e-a96a-c6ad8ccd0a20
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-09 09:16:42", "repo_name": "zhanhai/ubankers.android", "sub_path": "/app/src/main/java/com/ubankers/app/base/api/Consumer.java", "file_name": "Consumer.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "b2d5ff5e3dd38548bffefb22a4b177e9f2866ea3", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zhanhai/ubankers.android
219
FILENAME: Consumer.java
0.264358
package com.ubankers.app.base.api; import retrofit.HttpException; import rx.Subscriber; /** * */ public abstract class Consumer<D> extends Subscriber<Response<D>> { @Override public void onCompleted() { } @Override public void onError(Throwable e) { int statusCode = -1; if (e instanceof HttpException) { statusCode = ((HttpException) e).code(); } if (statusCode == 401) { onAuthenticationFailed(); } else { onException(e); } } @Override public void onNext(Response<D> response) { if (response.isSuccess()) { onData(response.getResult().getInfo()); return; } // Handle errors if (response.getResult().getErrorCode().equals("noLogin")) { onAuthenticationFailed(); } else { onException(new Error("处理错误")); } } protected abstract void onAuthenticationFailed(); protected abstract void onException(Throwable t); protected abstract void onData(D data); }
54d1ab1b-7c54-4000-8def-c3694696deec
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-26 14:52:42", "repo_name": "Jassy1994/Akasha", "sub_path": "/src/main/java/com/example/Service/CommentService.java", "file_name": "CommentService.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "c8096a7ba1587ff2d72e86e1e1802fb8d5bf78bf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Jassy1994/Akasha
242
FILENAME: CommentService.java
0.293404
package com.example.Service; import com.example.DAO.CommentDAO; import com.example.Model.Comment; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * Created by Jassy on 2017/2/28. * description: */ @Service public class CommentService { @Autowired CommentDAO commentDAO; public Comment selectCommentById(int id) { return commentDAO.getCommentById(id); } public void deleteCommentById(int id) { commentDAO.updateCommentById(1, id); } public int addComment(Comment comment) { return commentDAO.addComment(comment); } public int getCommentNumByEntity(int entityType, int entityId) { return commentDAO.getCommentCountByEntity(entityType, entityId); } public int getCommentNumByUser(int userId) { return commentDAO.getCommentCountByUser(userId); } public List<Comment> getCommentByEntity(int entityType, int entityId) { return commentDAO.getCommentByEntity(entityType, entityId); } }
c384a53c-8bda-4bd8-96c3-1140009c2e36
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-06 05:57:55", "repo_name": "zhoupengkobe/-JDBC", "sub_path": "/src/com/kobe/jdbc/Demo2.java", "file_name": "Demo2.java", "file_ext": "java", "file_size_in_byte": 1188, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "1eec2115dc5a20821403711c459e89d71a5dd786", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "GB18030"}
https://github.com/zhoupengkobe/-JDBC
326
FILENAME: Demo2.java
0.279042
package com.kobe.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; /** * 测试执行SQL语句以及SQL注入问题 * @author ko * */ public class Demo2 { public static void main(String[] args) { Connection conn = null; Statement stmt = null; try { //加载驱动类 Class.forName("com.mysql.jdbc.Driver"); try { conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/testjdbc","root","123456"); stmt = conn.createStatement(); // String name ="赵六"; // String sql ="INSERT into t_user (username,pwd,regTime) VALUES ('"+name+"',55555,NOW())"; // stmt.execute(sql); //测试SQl注入 String id = "5 or 1=1"; String sql = "delete from t_user where id="+id; stmt.execute(sql); } catch (SQLException e) { e.printStackTrace(); } } catch (ClassNotFoundException e) { e.printStackTrace(); }finally { if (stmt!=null) { try { stmt.close(); } catch (SQLException e) { e.printStackTrace(); } } if (conn!=null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } } }
12213274-d50a-4e15-a044-246c58940987
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-10-19T08:35:54", "repo_name": "dux/tic-tac-toe", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1090, "line_count": 71, "lang": "en", "doc_type": "text", "blob_id": "aada4ec7c94d3db4b0a0c8e063246e5f2ba6e6d1", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dux/tic-tac-toe
302
FILENAME: README.md
0.273574
# Tic tac toe demo ## Server side Sinatra OR mapper -> DataMaper, cleaner to get it working in Sinatra then AR ## Client side ### JS http://mithril.js.org/ Frontend with Mithril. It does very well * two-way data binding * routing * controler-view rendering Simple and extremly efective. ### Pre-processors No usage of any pre-processors as SASS or CoffeeScript or TypeScript. That is the reason JS in public/js ## Install bundle install puma -p 3000 (or whatever that reads config.ru) ## Testing ### Continuous Integration - CI Travis https://travis-ci.org/dux/tic-tac-toe [![Build Status](https://travis-ci.org/dux/tic-tac-toe.svg?branch=master)](https://travis-ci.org/dux/tic-tac-toe) ### ruby rspec spec ### javascript node-jasmine spec // not implemented ## Security There is no security whatsoever * GET insted of POST * no checks for data consistency ## Resources used * http://www.sinatrarb.com/ * http://mithril.js.org/ * http://datamapper.org/ * http://rspec.info/ * https://github.com/mhevery/jasmine-node * https://travis-ci.org/
51b6a89c-5674-4c64-9cd2-8228bd9c5756
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-08-13T12:34:30", "repo_name": "rastislavs/submariner-website", "sub_path": "/src/content/architecture/route-agent/_index.en.md", "file_name": "_index.en.md", "file_ext": "md", "file_size_in_byte": 1107, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "eb7a412d710c80b36e7fdf2ca940b64376c2c15f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rastislavs/submariner-website
231
FILENAME: _index.en.md
0.208179
+++ title = "Route Agent" weight = 3 +++ The Route Agent component runs on every worker node in each participating cluster. It is responsible for setting up VxLAN tunnels and routing the cross cluster traffic from the node to the cluster’s active Gateway Engine which subsequently sends the traffic to the destination cluster. When running on the same node as the active Gateway Engine, the Route Agent creates a VxLAN VTEP interface to which the Route Agent instances running on the other worker nodes in the local cluster connect by establishing a VXLAN tunnel with the VTEP of the active Gateway Engine node. The MTU of VxLAN tunnel is configured based on the MTU of the default interface on the host minus the VxLAN overhead. The Route Agent uses `Endpoint` resources synced from other clusters to configure routes and to program the necessary IP table rules to enable full cross-cluster connectivity. When the active Gateway Engine fails and a new Gateway Engine takes over, the Route Agent will automatically update the route tables on each node to point to the new active Gateway Engine node.
bbb3f46d-2712-40d5-9664-417247baa426
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-09-03 09:21:11", "repo_name": "ToastShaman/training-material", "sub_path": "/java8-training-material/src/test/java/com/github/toastshaman/java8/ExerciseWithLambdas.java", "file_name": "ExerciseWithLambdas.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "9426989f36515c9b9f812ef72cdee985c4646dbc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ToastShaman/training-material
257
FILENAME: ExerciseWithLambdas.java
0.249447
package com.github.toastshaman.java8; import java.util.Arrays; import java.util.List; import static com.github.toastshaman.java8.SampleData.*; import static com.github.toastshaman.java8.SampleData.ringoStarr; public class ExerciseWithLambdas implements Exercise1 { public List<Album> albums = Arrays.asList(aLoveSupreme, manyTrackAlbum, sampleShortAlbum); public List<Artist> artists = Arrays.asList(SampleData.theBeatles, georgeHarrison, johnColtrane, johnLennon, paulMcCartney, ringoStarr); @Override public List<Album> getAlbumsWithAtMostThreeTracks() { return null; } @Override public List<Artist> getArtistsLivingInTheUK() { return null; } @Override public List<Artist> getSoloArtistsLivingInTheUK() { return null; } @Override public double calculateRoyalitiesForTheUK() { return 0; } @Override public double averageTrackLength() { return 0; } @Override public double averageAlbumLength() { return 0; } }
7b290019-d9d3-4572-9597-086e67893999
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-20 16:00:23", "repo_name": "codelirium/qms", "sub_path": "/src/main/java/io/codelirium/unifiedpost/qms/repository/QuoteRepository.java", "file_name": "QuoteRepository.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "51fb2d7f73f05c794d0444c9063941afdf6c3307", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/codelirium/qms
258
FILENAME: QuoteRepository.java
0.281406
package io.codelirium.unifiedpost.qms.repository; import io.codelirium.unifiedpost.qms.domain.entity.QuoteEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import javax.transaction.Transactional; import java.util.List; import java.util.Optional; @Repository @Transactional public interface QuoteRepository extends JpaRepository<QuoteEntity, Long> { String SQL_QUERY_GET_QUOTES_BY_SEARCH_TERM = "SELECT " + "* " + "FROM " + "QUOTES Q " + "WHERE " + "LOWER(Q.TEXT) LIKE CONCAT('%', LOWER(?1), '%')"; @Query(nativeQuery = true, value = SQL_QUERY_GET_QUOTES_BY_SEARCH_TERM) List<QuoteEntity> findBySearchTerm(final String searchTerm); String SQL_QUERY_GET_RANDOM_QUOTE = "SELECT " + "* " + "FROM " + "QUOTES Q " + "ORDER BY " + "RAND() " + "LIMIT 1"; @Query(nativeQuery = true, value = SQL_QUERY_GET_RANDOM_QUOTE) Optional<QuoteEntity> findRandom(); }
bb0d2a52-c172-4ac1-bf3f-ac2d0537fb67
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-23 08:09:28", "repo_name": "luxinfeng/JavaRPC", "sub_path": "/src/main/java/framework/core/remoting/dto/RpcResponse.java", "file_name": "RpcResponse.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "133a98af97447bb3a3ca3d4f735d1e5eee9dfefa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/luxinfeng/JavaRPC
242
FILENAME: RpcResponse.java
0.285372
package framework.core.remoting.dto; import framework.common.enums.RpcResponseCodeEnum; import lombok.Getter; import lombok.Setter; import java.io.Serializable; @Setter @Getter public class RpcResponse<T> implements Serializable { // 整体模仿HTTP报文 private static final long serialVersionUID = 715745410605631233L; private String requestId; private Integer code; private String message; private T data; public static <T> RpcResponse<T> success(T data, String requestId) { RpcResponse<T> response = new RpcResponse<>(); response.setCode(RpcResponseCodeEnum.SUCCESS_CODE.getCode()); response.setMessage(RpcResponseCodeEnum.SUCCESS_CODE.getMessage()); response.setRequestId(requestId); if (null != data) { response.setData(data); } return response; } public static <T> RpcResponse<T> fail(RpcResponseCodeEnum rpcResponseCodeEnum) { RpcResponse<T> response = new RpcResponse<>(); response.setCode(rpcResponseCodeEnum.getCode()); response.setMessage(rpcResponseCodeEnum.getMessage()); return response; } }
2b6a0ef6-a486-4dcc-a020-75e562ac8d1a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-10-02T18:52:13", "repo_name": "vafliik/github_stats", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1090, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "9229fa0ee7b4d8cddc759dfa21453376cc785eb2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/vafliik/github_stats
268
FILENAME: README.md
0.191933
# GitHub PR stats Simple Pull Request statistics It is not done yet. And so far it does not work much :) # # main.py Simple python script - can be run simply by `python3 main.py` The path to repo is hardcoded, needs to be modified in the script The query to fetch the PRs can be modified, see [API reference](https://developer.github.com/v3/pulls/#list-pull-requests) Also, environmental variable `GITHUB_TOKEN` with GitHub token needs to be set # # django web application **Steps to run the app locally** 1. `python3 manage.py makemigrations` - create the migration file based on models in the app 2. `python3 manage.py migrate` - apply the migrations 3. `python3 manage.py runserver` - start the webserwer, by default on localhost:8000 # # Python requirements `pip install Django` `pip install python-dateutil` # # # TODO * Async loading (now only wait and redirect) * Get labels with PRs (now the labels are downloaded only if PR detail is displayed, plus it does not update) * Repo management - get rid of the hardcoded values * Unit tests (ehm) * Refactoring, of course
d2a5c02c-729e-4c2b-aad0-f42fd22db767
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-25 13:52:39", "repo_name": "nico3111/Interface-Messenger", "sub_path": "/src/com/company/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "5a47eeb24fe2d7390500360e2e1406a9300da312", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nico3111/Interface-Messenger
258
FILENAME: Main.java
0.277473
package com.company; public class Main { public static void main(String[] args) { Slack slack = new Slack(10000); slack.sendMessage("Hallo Slack"); slack.sendMessage("Good morning"); WhatsApp whatsdepp = new WhatsApp(10); whatsdepp.sendMessage("Hello Whatsapp"); Hotmail hotmail = new Hotmail(50); hotmail.sendMessage("Was geht hotmail?"); Gmail gmail = new Gmail(50); gmail.sendMessage("Hello gmail"); ISendMessage[] messengers = new ISendMessage[10]; messengers[0] = slack; messengers[1] = whatsdepp; messengers[2] = hotmail; messengers[3] = gmail; for (ISendMessage messenger : messengers) { if (messenger != null) { String[] myMessages = messenger.getMessages(); for (int i = 0; i < myMessages.length; i++) { if (myMessages[i] != null && !myMessages[i].isBlank() && !myMessages[i].isEmpty()) { System.out.println(myMessages[i]); } } } } } }
886f8396-1258-4325-9c10-a9150ca0d65e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-16 22:52:00", "repo_name": "krzysiektom/electronicservice", "sub_path": "/src/main/java/pl/tomala/electronicservice/device/parameter/ParameterController.java", "file_name": "ParameterController.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "49de074c86e4ccb57f42a8643f0c4494669eb05a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/krzysiektom/electronicservice
200
FILENAME: ParameterController.java
0.256832
package pl.tomala.electronicservice.device.parameter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.Arrays; import java.util.List; @Controller @RequestMapping("devices/parameters") public class ParameterController { @Autowired ParameterRepository parameterRepository; @Autowired ParameterService parameterService; @RequestMapping("/") @ResponseBody public String home() { return "parameters"; } @RequestMapping("/all") @ResponseBody public String all() { return Arrays.toString(parameterRepository.findAll().toArray()); } @RequestMapping("/add/{parameterName}/{parametersList}") @ResponseBody public String add(@PathVariable("parameterName") String parameterName, @PathVariable("parametersList") List<String> parametersList) { return parameterService.add(parameterName, parametersList).toString(); } }
3ec4f450-080e-45c7-8d78-9962f09882b0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-13 14:49:34", "repo_name": "luobosi-marvel/java-basis-study", "sub_path": "/juc-example/src/main/java/com.luobosi.study.juc/lock/ReentrantLockDemo.java", "file_name": "ReentrantLockDemo.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "c2103451e467597d7d64e9518fbd3399aef85bfb", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/luobosi-marvel/java-basis-study
242
FILENAME: ReentrantLockDemo.java
0.291787
/* * Copyright (C) 2009-2016 Hangzhou 2Dfire Technology Co., Ltd. All rights reserved */ package com.luobosi.study.juc.lock; import java.util.concurrent.locks.ReentrantLock; /** * ReentrantLock * * @author luobosi@2dfire.com * @since 2017-12-26 */ public class ReentrantLockDemo { public static void main(String[] args) { ReentrantLock reentrantLock = new ReentrantLock(); new Thread(() -> { reentrantLock.lock(); try { System.out.println("a"); try { Thread.sleep(3000L); } catch (InterruptedException e) { e.printStackTrace(); } }finally { reentrantLock.unlock(); } }).start(); for (int i = 0; i< 5; i++) { new Thread(() -> { reentrantLock.lock(); try { System.out.println("a"); }finally { reentrantLock.unlock(); } }).start(); } } }
9587299a-4e78-44ce-b16e-9e6124a13397
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-29 23:47:34", "repo_name": "kerolosFawzy/PopMovie", "sub_path": "/app/src/main/java/com/massive/popmovie/views/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1141, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "8c43cdcb09d676daa58b10742e195f39ccb16250", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kerolosFawzy/PopMovie
205
FILENAME: MainActivity.java
0.249447
package com.massive.popmovie.views; import android.app.FragmentManager; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import com.massive.popmovie.R; import com.massive.popmovie.views.fragments.GridFragment; public class MainActivity extends AppCompatActivity { android.app.Fragment GridFragment; private static final String TAG_RETAINED_FRAGMENT = "RetainedFragment"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); FragmentManager fm = getFragmentManager(); GridFragment = fm.findFragmentByTag(TAG_RETAINED_FRAGMENT); if (GridFragment == null) { GridFragment = new GridFragment(); fm.beginTransaction().replace(R.id.FragmentContainer, GridFragment, TAG_RETAINED_FRAGMENT).commit(); } } @Override public void onPause() { super.onPause(); if (isFinishing()) { FragmentManager fm = getFragmentManager(); fm.beginTransaction().remove(GridFragment).commit(); } } }
0420e5a2-ef8d-49d4-b702-09131e5bc416
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-30 10:56:53", "repo_name": "Firago/jarvis-smart-home-mvp", "sub_path": "/app/src/main/java/com/dfirago/jarvissmarthome/hub/list/model/HubModel.java", "file_name": "HubModel.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "f8cc86d8f1ca24de118e6402938ad06adb0e127d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Firago/jarvis-smart-home-mvp
276
FILENAME: HubModel.java
0.246533
package com.dfirago.jarvissmarthome.hub.list.model; /** * Created by dmfi on 29/05/2017. */ public class HubModel { private String ssid; private Integer signalLevel; public HubModel() { } public HubModel(String ssid, Integer signalLevel) { this.ssid = ssid; this.signalLevel = signalLevel; } public String getSsid() { return ssid; } public void setSsid(String ssid) { this.ssid = ssid; } public Integer getSignalLevel() { return signalLevel; } public void setSignalLevel(Integer signalLevel) { this.signalLevel = signalLevel; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; HubModel hubModel = (HubModel) o; return ssid.equals(hubModel.ssid); } @Override public int hashCode() { return ssid.hashCode(); } @Override public String toString() { return "HubModel{" + "ssid='" + ssid + '\'' + ", signalLevel=" + signalLevel + '}'; } }
738db62d-fcd9-4038-86b0-0dfa3a884967
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-06-13 16:34:45", "repo_name": "reactome-pwp/diagram", "sub_path": "/src/main/java/org/reactome/web/diagram/events/InteractorHoveredEvent.java", "file_name": "InteractorHoveredEvent.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "1584077ab6d6fb2a77aaf223f6590cb080e73403", "star_events_count": 5, "fork_events_count": 6, "src_encoding": "UTF-8"}
https://github.com/reactome-pwp/diagram
241
FILENAME: InteractorHoveredEvent.java
0.273574
package org.reactome.web.diagram.events; import com.google.gwt.event.shared.GwtEvent; import org.reactome.web.diagram.data.interactors.model.DiagramInteractor; import org.reactome.web.diagram.handlers.InteractorHoveredHandler; /** * @author Antonio Fabregat <fabregat@ebi.ac.uk> */ public class InteractorHoveredEvent extends GwtEvent<InteractorHoveredHandler> { public static final Type<InteractorHoveredHandler> TYPE = new Type<>(); DiagramInteractor interactor; public InteractorHoveredEvent(DiagramInteractor interactor) { this.interactor = interactor; } @Override public Type<InteractorHoveredHandler> getAssociatedType() { return TYPE; } @Override protected void dispatch(InteractorHoveredHandler handler) { handler.onInteractorHovered(this); } public DiagramInteractor getInteractor() { return interactor; } @Override public String toString() { return "InteractorHoveredEvent{" + "interactor=" + interactor + '}'; } }
3fc2ab30-72a1-4bfb-9652-a63b52f825e3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-13T16:55:24", "repo_name": "er5bus/questionnaire-front", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1047, "line_count": 48, "lang": "en", "doc_type": "text", "blob_id": "cfcb49dc380016c133d6284009bc40be36d90407", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/er5bus/questionnaire-front
236
FILENAME: README.md
0.271252
# Interactive Questions Simplify your complex processes with easy-to-use interactive decision trees to collect and deliver the right information. ## Project Requirements: In order to get the project running you need to install: * docker #### Install Docker: Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. [Get Docker](https://docs.docker.com/get-docker/). ## Setting the Project Locally: #### Cloning the project: Once you have all the needed requirements installed, clone the project: ``` bash git clone https://sfari@bitbucket.org/predict-a/questionnaire-front.git ``` #### Configure .env file: Before you can run the project you need to set the envirment varibles: ``` bash cp .env.example .env ``` Check the envirment varibles in the .env file #### Run the Project: to run the project type: ``` bash docker-compose up --build -d ``` Check 0.0.0.0:3000 on your browser! That's it.
37e2afbb-eebc-460f-968d-fc857488c698
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-20 20:02:17", "repo_name": "mitesh-pv/trip_management_system", "sub_path": "/src/com/login/UsersClass.java", "file_name": "UsersClass.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 74, "lang": "en", "doc_type": "code", "blob_id": "a6e4e9453d7fa0cf250cb8a7f0cdf1b2f98ab689", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mitesh-pv/trip_management_system
283
FILENAME: UsersClass.java
0.247987
package com.login; public class UsersClass { String users; String passwd; String fName; String lName; String gender; public UsersClass(String users, String passwd, String fName, String lName, String gender) { super(); this.users = users; this.passwd = passwd; this.fName = fName; this.lName = lName; this.gender = gender; } public UsersClass(String users, String passwd) { this.users = users; this.passwd = passwd; this.fName = ""; this.lName = ""; this.gender = ""; } public String getUsers() { return users; } public void setUsers(String users) { this.users = users; } public String getPasswd() { return passwd; } public void setPasswd(String passwd) { this.passwd = passwd; } public String getfName() { return fName; } public void setfName(String fName) { this.fName = fName; } public String getlName() { return lName; } public void setlName(String lName) { this.lName = lName; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } }
12d65337-4ca4-4fb8-9d47-01481dec95ec
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-08-09 06:39:20", "repo_name": "roughdragon/roughdragon.github.io", "sub_path": "/MinigameTokens/src/main/java/io/github/roughdragon/MinigameTokens/Listeners/PlayerKilled.java", "file_name": "PlayerKilled.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "d820b8ab46b28ae718e4d4b8d99297fa52f39047", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/roughdragon/roughdragon.github.io
244
FILENAME: PlayerKilled.java
0.284576
package io.github.roughdragon.MinigameTokens.Listeners; import io.github.roughdragon.MinigameTokens.MinigameTokens; import io.github.roughdragon.MinigameTokens.TokenManager; import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.PlayerDeathEvent; public class PlayerKilled implements Listener { @EventHandler public void playerDeathEvent(PlayerDeathEvent event) { if(MinigameTokens.getInstance().getConfig().getBoolean("playerKillTokens") == false) { return; } Player player = event.getEntity(); Player killer = player.getKiller(); World world = Bukkit.getServer().getWorld(MinigameTokens.getInstance().getConfig().getString("worldName")); if(!(player.getWorld() == world)) { return; } if(!(killer.getWorld() == world)) { return; } int killTokens = MinigameTokens.getInstance().getConfig().getInt("tokensPerKill"); TokenManager.getManager().giveTokens(killer, killTokens); } }
cfe5e6f2-1c99-4992-b888-f12f5a4fb070
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-12 06:22:28", "repo_name": "un-knower/elasticSearch-learn", "sub_path": "/search-service/src/main/java/com/chinaredstar/common/ValidateUtil.java", "file_name": "ValidateUtil.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "8abbe20fb6b22763e1eb7f3043e44a174ffc05f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/un-knower/elasticSearch-learn
221
FILENAME: ValidateUtil.java
0.23793
package com.chinaredstar.common; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.validation.ConstraintViolation; import javax.validation.Validation; import javax.validation.Validator; import javax.validation.ValidatorFactory; import java.util.Set; /** * Created by chinaredstar on 2017/5/24. */ public class ValidateUtil { private static final Logger logger = LoggerFactory.getLogger(ValidateUtil.class); /** * 校验入参 * * @param t * @param <T> * @return boolean */ public static <T> boolean validateParam(T t) { ValidatorFactory vf = Validation.buildDefaultValidatorFactory(); Validator validator = vf.getValidator(); Set<ConstraintViolation<T>> set = validator.validate(t); if (set != null && !set.isEmpty()) { for (ConstraintViolation constraintViolation : set) { String errorMessage = constraintViolation.getMessage(); logger.error(errorMessage); throw new RuntimeException(errorMessage); } } return true; } }
07b892bb-da4b-4ef3-9695-783b05b7cacb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-11 11:59:02", "repo_name": "tjwnstlr3459/oneday1104", "sub_path": "/src/networkServer/ChattingServer.java", "file_name": "ChattingServer.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 81, "lang": "en", "doc_type": "code", "blob_id": "a448da22bee1482fdf697b9eadaa0465cd25e100", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UHC"}
https://github.com/tjwnstlr3459/oneday1104
264
FILENAME: ChattingServer.java
0.27513
package networkServer; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; import java.text.SimpleDateFormat; import java.util.Date; public class ChattingServer { public void chattingServer() { int port = 8888; ServerSocket serverSocket = null; DataInputStream dis = null; DataOutputStream dos = null; try { serverSocket = new ServerSocket(port); Socket clientSocket = serverSocket.accept(); InputStream in = clientSocket.getInputStream(); OutputStream out = clientSocket.getOutputStream(); dis = new DataInputStream(in); dos = new DataOutputStream(out); dos.writeUTF("[서버 연결 성공]"); Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss"); String now = sdf.format(date); dos.writeUTF("[현재시간] : " + now); } catch (IOException e) { e.printStackTrace(); } finally { try { dis.close(); dos.close(); serverSocket.close(); } catch (IOException e) { e.printStackTrace(); } } } }
4ecfd34d-ebfe-41ea-8683-18bd95ea9a04
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-08-25 09:00:29", "repo_name": "karouani/MenuStandardApplication", "sub_path": "/src/com/dolibarrmaroc/com/models/Services.java", "file_name": "Services.java", "file_ext": "java", "file_size_in_byte": 1065, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "6e776d6e4f5d2a66f1a8d6f4b81c2d985c0a4d71", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/karouani/MenuStandardApplication
275
FILENAME: Services.java
0.259826
package com.dolibarrmaroc.com.models; import java.io.Serializable; import java.util.List; public class Services implements Serializable{ private int id; private String service; private int nmb_cmp; private List<LabelService> labels; public Services() { } public Services(String service, int nmb_cmp, List<LabelService> labels) { super(); this.service = service; this.nmb_cmp = nmb_cmp; this.labels = labels; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getService() { return service; } public void setService(String service) { this.service = service; } public int getNmb_cmp() { return nmb_cmp; } public void setNmb_cmp(int nmb_cmp) { this.nmb_cmp = nmb_cmp; } public List<LabelService> getLabels() { return labels; } public void setLabels(List<LabelService> labels) { this.labels = labels; } @Override public String toString() { return "Services [id=" + id + ", service=" + service + ", nmb_cmp=" + nmb_cmp + ", labels=" + labels + "]"; } }
0dae230c-4dab-4e65-8be0-907524e5b657
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-20 11:58:37", "repo_name": "flashoverm/GeofencingLib_Examples", "sub_path": "/AreaCounterAdminApp/app/src/main/java/de/geofencing/area/areacounteradmin/Geofence/SectionsPagerAdapter.java", "file_name": "SectionsPagerAdapter.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "b9b7124cbc86fb2481f5c18f4d829387be13c09d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/flashoverm/GeofencingLib_Examples
227
FILENAME: SectionsPagerAdapter.java
0.256832
package de.geofencing.area.areacounteradmin.Geofence; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; public class SectionsPagerAdapter extends FragmentPagerAdapter { private static GeofenceFragment geofenceFragement; private static BeaconInRangeFragment inRangeFragment; public SectionsPagerAdapter(FragmentManager fm) { super(fm); geofenceFragement = new GeofenceFragment(); inRangeFragment = new BeaconInRangeFragment(); } @Override public Fragment getItem(int position) { switch(position){ case 0: return geofenceFragement; case 1: return inRangeFragment; default: return null; } } @Override public int getCount() { return 2; } @Override public CharSequence getPageTitle(int position) { switch (position) { case 0: return "Geofence"; case 1: return "Beacons in Range"; default: return null; } } }
96003266-3961-46f8-9254-823907e19f4c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-19 06:17:34", "repo_name": "KellyKou/LearningJava", "sub_path": "/src/main/java/com/pkg1/WriteDatatoTxtCsv.java", "file_name": "WriteDatatoTxtCsv.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "8fa33516be9ae6aef62d365bb1115da625a9c1bd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/KellyKou/LearningJava
234
FILENAME: WriteDatatoTxtCsv.java
0.258326
package com.pkg1; import java.io.*; import java.util.Properties; public class WriteDatatoTxtCsv { public static void main(String[] args) throws IOException { File f = new File(System.getProperty("user.dir")+"\\src\\main\\java\\com\\properties\\TestData\\TestDataNew.csv"); //Step1:Creat an object of FileReader Class //Charater files FileWriter fileWriter = new FileWriter(f,true); //read streams of raw byte //FileInputStream fis = new FileInputStream(System.getProperty("user.dir")+"\\src\\main\\java\\com\\properties\\TestData\\TestData.properties"); //FileOutputStream fos= new FileOutputStream(System.getProperty("user.dir")+"\\src\\main\\java\\com\\properties\\TestData\\TestData2.properties"); //Step2:change fileWriter to BufferedWriter BufferedWriter br = new BufferedWriter(fileWriter); //Step3 write data for(int i=1;i<10;i++) { br.write("success" + ","); } //Step4 Close file System.out.println("success"); br.close(); } }
33358509-99dd-4a57-9734-f156a2596a3b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-17 13:18:15", "repo_name": "Yasinaaa/AndroidLab", "sub_path": "/Homework_Teaching_master/Teaching-master/1 course/AndroidChat/app/src/main/java/com/example/ravil/androidchat/ChatActivity.java", "file_name": "ChatActivity.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "126114c80c410a9b1f6e5cadde73b1933d75fb7d", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/Yasinaaa/AndroidLab
193
FILENAME: ChatActivity.java
0.240775
package com.example.ravil.androidchat; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import java.util.ArrayList; import java.util.List; /** * @author ravil */ public class ChatActivity extends AppCompatActivity { public static final String KEY = "username"; private RecyclerView mRecyclerView; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_chat); mRecyclerView = (RecyclerView) findViewById(R.id.message_recycle_view); mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); List<Message> messages = new ArrayList<>(); for (int i = 0; i < 10; i ++) { messages.add(new Message("Саша", "Привет")); } MessageAdapter adapter = new MessageAdapter(messages); mRecyclerView.setAdapter(adapter); } }
55127246-a271-401f-9f9d-b9287306f231
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-09T10:38:14", "repo_name": "RafaelSantosBraz/IHC", "sub_path": "/FaltmetroGPS/app/src/main/java/com/u/faltmetrogps/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "510765912a0e61ca179e0968044c9bdc86739105", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/RafaelSantosBraz/IHC
171
FILENAME: MainActivity.java
0.187133
package com.u.faltmetrogps; import androidx.appcompat.app.AppCompatActivity; import androidx.lifecycle.AndroidViewModel; import android.content.Intent; import android.os.Bundle; import android.widget.EditText; import com.google.android.material.floatingactionbutton.FloatingActionButton; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void abrirMenuLateral(android.view.View view){ EditText email = findViewById(R.id.editEmail); if (email.getText().toString().equals("aluno@uenp.edu.br")){ startActivity(new Intent(getApplicationContext(), DisciplinasAluno.class)); } else if (email.getText().toString().equals("professor@uenp.edu.br")){ startActivity(new Intent(getApplicationContext(), DisciplinasProfessor.class)); } } }
a8bd3c38-2fab-44dd-9a90-192656141a82
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-21 07:39:18", "repo_name": "SangeetaGN/EventLogging", "sub_path": "/src/main/java/com/disha/eventlog/userpropertiesupdate/model/D.java", "file_name": "D.java", "file_ext": "java", "file_size_in_byte": 1074, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "2070401195be5ccd540ecfc2981632d368ccb8be", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SangeetaGN/EventLogging
210
FILENAME: D.java
0.224055
package com.disha.quickride.userpropertiesupdate.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Getter; import lombok.Setter; @JsonIgnoreProperties(ignoreUnknown = true) @Getter @Setter public class D { private String type; private ProfileData profileData; private String objectId; private String identity; public String getType () { return type; } public void setType (String type) { this.type = type; } public ProfileData getProfileData () { return profileData; } public void setProfileData (ProfileData profileData) { this.profileData = profileData; } public String getObjectId () { return objectId; } public void setObjectId (String objectId) { this.objectId = objectId; } @Override public String toString() { return "ClassPojo [type = "+type+", profileData = "+profileData+", objectId = "+objectId+"]"; } }
88051f9c-0f6a-42b4-a33e-3d8c6c2f9ff8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-08 05:59:09", "repo_name": "mindmie/AndroidDemo", "sub_path": "/app/src/main/java/com/example/mindmie/androiddemo/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1073, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "7e4e3d64e53bad757f4689ee4befc2e5f13b7044", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mindmie/AndroidDemo
240
FILENAME: User.java
0.249447
package com.example.mindmie.androiddemo; import com.google.firebase.database.IgnoreExtraProperties; /** * Created by Mindmie on 8/12/2560. */ @IgnoreExtraProperties public class User { public String userEmail; public String userPwad; public String userBirthday; public String usergender; public String userWeight; public String userHeight; public String userActivityLevel; public String userYourGoal; public String userWeightLose; //Constructor public User(String userEmail, String userPwad, String userBirthday, String usergender, String userWeight, String userHeight, String userActivityLevel, String userYourGoal, String userWeightLose) { this.userEmail = userEmail; this.userPwad = userPwad; this.userBirthday = userBirthday; this.usergender = usergender; this.userWeight = userWeight; this.userHeight = userHeight; this.userActivityLevel = userActivityLevel; this.userYourGoal = userYourGoal; this.userWeightLose = userWeightLose; } }
bcaedd0d-4472-4d88-9e66-6b8db6204323
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-19 04:44:15", "repo_name": "ldybob/ac3korea", "sub_path": "/app/src/main/java/com/ldybob/ac3korea/Repo.java", "file_name": "Repo.java", "file_ext": "java", "file_size_in_byte": 1140, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "b7ef124f99a275d6552684cc03e441acd8411080", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ldybob/ac3korea
252
FILENAME: Repo.java
0.261331
package com.ldybob.ac3korea; import android.content.Context; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.DefaultHttpClient; public class Repo { private static Repo sInstance = null; private HttpClient httpclient; private String mBlackList; private Util mUtil; private MyInfo mInfo; private Repo(Context context) { httpclient = new DefaultHttpClient(); mUtil = new Util(context); mBlackList = mUtil.RoadHideList(); mInfo = null; } public static Repo getInstance(Context context) { if (sInstance == null) { sInstance = new Repo(context); } return sInstance; } public void setHttpclient() { httpclient = new DefaultHttpClient(); } public HttpClient getHttpClient() { return httpclient; } public void setBlackList(String list) { mBlackList = list; } public String getBlackList() { return mBlackList; } public void setMyInfo(MyInfo info) { mInfo = info; } public MyInfo getMyInfo() { return mInfo; } }
80c16123-2758-4a17-a18c-284a1c6f2923
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-13 17:29:52", "repo_name": "YetAnotherTeam/jatumba-android", "sub_path": "/app/src/main/java/com/jat/jatumba/presentation/main/bandMembers/BandMembersFragment.java", "file_name": "BandMembersFragment.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "5ef93a3f0b295648470158fa158137ca8a197243", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/YetAnotherTeam/jatumba-android
216
FILENAME: BandMembersFragment.java
0.268941
package com.jat.jatumba.presentation.main.bandMembers; import android.support.annotation.NonNull; import android.util.Log; import com.jat.jatumba.R; import com.jat.jatumba.presentation.common.BasePresenter; import com.jat.jatumba.presentation.main.DrawerActivity; import com.jat.jatumba.presentation.main.common.BaseMainFragment; import javax.inject.Inject; /** * Created by bulat on 22.02.16. */ public class BandMembersFragment extends BaseMainFragment implements BandMembersView { private static final String LOG_TAG = "BandMembersFragment"; @Inject BandMembersPresenter bandMembersPresenter; public BandMembersFragment() { Log.d(LOG_TAG, "Constructor"); } @NonNull @Override protected BasePresenter getPresenter() { return bandMembersPresenter; } @Override protected void inject() { getMainActivityComponent().inject(this); } @Override public String getTitle() { return getString(R.string.band_members); } }
ee7c5a31-5a93-46b3-879b-eb7007664344
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-25 06:44:13", "repo_name": "Miotlink/MAndroidClient", "sub_path": "/app/src/main/java/com/homepaas/sls/ui/merchantservice/CommentListAdapter.java", "file_name": "CommentListAdapter.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "55dcb51591b96314286652c00398d9aaa7dd16d4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Miotlink/MAndroidClient
225
FILENAME: CommentListAdapter.java
0.274351
package com.homepaas.sls.ui.merchantservice; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.homepaas.sls.R; import java.util.List; /** * Created by Administrator on 2016/4/19. */ public class CommentListAdapter extends RecyclerView.Adapter<CommentListAdapter.Holder> { List<Object> datas; LayoutInflater inflater; Context context; public CommentListAdapter(List<Object> datas, Context context) { this.datas = datas; this.context = context; inflater = LayoutInflater.from(context); } @Override public Holder onCreateViewHolder(ViewGroup parent, int viewType) { return new Holder(inflater.inflate(R.layout.item_merchant_comment_layout,parent,false)); } @Override public void onBindViewHolder(Holder holder, int position) { } @Override public int getItemCount() { return datas.size(); } class Holder extends RecyclerView.ViewHolder{ public Holder(View itemView) { super(itemView); } } }
5848eb79-4ccd-4af4-9e2a-d2c0e55dc830
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-23 09:19:38", "repo_name": "Soffietto/Khayrullin_InternetShop", "sub_path": "/src/main/java/ru/kpfu/itis/azat_khayrullin/servlets/ThankYou.java", "file_name": "ThankYou.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "7d1ced0d857571ce42c5558fa133b87ca6c8d165", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Soffietto/Khayrullin_InternetShop
209
FILENAME: ThankYou.java
0.278257
package ru.kpfu.itis.azat_khayrullin.servlets; import ru.kpfu.itis.azat_khayrullin.models.Product; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; import static ru.kpfu.itis.azat_khayrullin.servlets.Bucket.bucket; @WebServlet("/thankyou") public class ThankYou extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { HttpSession session = req.getSession(); if (session.getAttribute("user") != null) { req.getRequestDispatcher("jsp/thankyou.jsp").forward(req, resp); }else { resp.sendRedirect("/main"); } } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { bucket.clear(); doGet(req, resp); } }
96033a3a-b4b6-4247-898d-32ea2aa40f12
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-22 21:19:17", "repo_name": "Arvindo9/MartitesAllen", "sub_path": "/app/src/main/java/com/maritesallen/almanac2020/data/model/db/flag/Flag.java", "file_name": "Flag.java", "file_ext": "java", "file_size_in_byte": 1108, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "7c6f5322dcb5d97247dad58e47806452a239a47f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Arvindo9/MartitesAllen
228
FILENAME: Flag.java
0.208179
package com.maritesallen.almanac2020.data.model.db.flag; import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.Ignore; import androidx.room.PrimaryKey; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import org.jetbrains.annotations.NotNull; @Entity(tableName = "flag") public class Flag { @PrimaryKey @NotNull @ColumnInfo(name = "id") @SerializedName("id") @Expose private String countryCode = ""; @ColumnInfo(name = "country_name") @SerializedName("country_name") @Expose private String countryName; @Ignore public Flag(String countryName){ this.countryName = countryName; } public Flag(){} public String getCountryName() { return countryName; } public void setCountryName(String countryName) { this.countryName = countryName; } @NotNull public String getCountryCode() { return countryCode; } public void setCountryCode(@NotNull String countryCode) { this.countryCode = countryCode; } }
9a61ce2a-164c-4f97-83eb-eb6055ad5798
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-22 09:33:53", "repo_name": "sweet2121/springcloud-demo", "sub_path": "/service-user/src/main/java/com/wrd/controller/UserController.java", "file_name": "UserController.java", "file_ext": "java", "file_size_in_byte": 1209, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "44e1e4d1c966c50fcb6a6bd161e13b5930a34b76", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sweet2121/springcloud-demo
251
FILENAME: UserController.java
0.235108
package com.wrd.controller; import com.wrd.User; import com.wrd.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/user/") public class UserController { @Autowired private UserService userService; @Value("${server.port}") private Integer serverPort; /** * 根据用户Id,查询用户名称 * @param id * @return */ @GetMapping("getUsernameById") public String getUsernameById(@RequestParam("id") Integer id){ System.out.println("===="+serverPort); return userService.getById(id).getUsername(); } /** * 根据用户id,查询用户信息 * @param id * @return */ @GetMapping("getById") public User getById(@RequestParam("id") Integer id){ return userService.getById(id); } /** * 根据用户id,查询用户信息 * @param user * @return */ @PostMapping("getUserById") public User getUserById(@RequestBody User user){ return userService.getById(user.getId()); }; }
a4c9b484-64ae-46ce-89ba-416554bf120e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-02-24T20:09:06", "repo_name": "maaslalani/Codev", "sub_path": "/tutorials/git/posts/using-version-control.md", "file_name": "using-version-control.md", "file_ext": "md", "file_size_in_byte": 1124, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "daab1a966eddd3ce720221a0ea30d2b0deb1e96d", "star_events_count": 5, "fork_events_count": 9, "src_encoding": "UTF-8"}
https://github.com/maaslalani/Codev
257
FILENAME: using-version-control.md
0.259826
Here are some of the most common commands, roughly in the order you will encounter them: ``` git init ``` This will create a hidden `.git` folder inside your current folder — this is the "repository" (or repo) where git stores all of its internal tracking data. Any changes you make to any files within the original folder will now be possible to track. ✨ The original folder is now referred to as your working directory, as opposed to the repository (the `.git` folder) that tracks your changes. You work in the working directory. Simple! **Clone an existing repo:** ``` git clone https://github.com/maaslalani/Codev.git ``` This will download a `.git` repository from the internet (GitHub) to your computer and extract the latest snapshot of the repository (all the files) to your working directory. By default it will all be saved in a folder with the same name as the repo (in this case Codev).<br> ``` git add ``` Adds the files in the local repository and stages them for commit. ``` git commit -m "First commit" ``` Commits the tracked changes and prepares them to be pushed to a remote repository.
e4e48690-57c8-49d6-bdd2-87417f196c52
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-12-21 11:34:36", "repo_name": "PolygonGamesStudio/superessendam", "sub_path": "/src/main/java/resource/SaxEmptyHandler.java", "file_name": "SaxEmptyHandler.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "fe033cddfdd077db9bd9e142cd9b28b9810e6738", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/PolygonGamesStudio/superessendam
231
FILENAME: SaxEmptyHandler.java
0.282196
package resource; import org.xml.sax.Attributes; import org.xml.sax.helpers.DefaultHandler; public class SaxEmptyHandler extends DefaultHandler { private static String CLASSNAME = "class"; private boolean inElement = false; private String element = null; private Object object = null; public Object getObject() { return object; } public void startElement(String uri, String localName, String qName, Attributes attributes) { if (qName != CLASSNAME) { element = qName; } else { String className = attributes.getValue(0); System.out.println("Class name:" + className); object = ReflectionHelper.createInstance(className); } } public void endElement(String uri, String localName, String qName) { element = null; } public void characters(char[] ch, int start, int length) { if (element != null) { String value = new String(ch, start, length); // System.out.println(element + " = " + value); ReflectionHelper.setFieldValue(object, element, value); } } }
8cbeda5a-12b1-4345-86df-141b46c0f7bb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-26 17:51:57", "repo_name": "jeffgbutler/mybatis-generator2", "sub_path": "/mybatis-generator2-parent/mybatis-generator2-core/src/main/java/org/mybatis/generator2/log/log4j2/Log4j2Log.java", "file_name": "Log4j2Log.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "d7f280b55d1a9cc993c03d6f190d72934dd9ebce", "star_events_count": 5, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/jeffgbutler/mybatis-generator2
270
FILENAME: Log4j2Log.java
0.273574
package org.mybatis.generator2.log.log4j2; import org.apache.logging.log4j.Logger; import org.mybatis.generator2.log.Log; import java.util.function.Supplier; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; public class Log4j2Log implements Log { private Logger log; public Log4j2Log(Class<?> clazz) { log = LogManager.getLogger(clazz); } @Override public void error(Supplier<String> s, Throwable e) { if (log.isEnabled(Level.ERROR)) { log.error(s.get(), e); } } @Override public void error(Supplier<String> s) { if (log.isEnabled(Level.ERROR)) { log.error(s.get()); } } @Override public void debug(Supplier<String> s) { if (log.isEnabled(Level.DEBUG)) { log.debug(s.get()); } } @Override public void warn(Supplier<String> s) { if (log.isEnabled(Level.WARN)) { log.warn(s.get()); } } @Override public void trace(Supplier<String> s) { if (log.isEnabled(Level.TRACE)) { log.trace(s.get()); } } }
99c7cb2d-0dea-4a0e-9f65-173603df0d9d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-12-21 15:08:19", "repo_name": "jonosterman/cube", "sub_path": "/cube-client-core/src/main/java/ch/admin/vbs/cube/core/usb/UsbDeviceEntryList.java", "file_name": "UsbDeviceEntryList.java", "file_ext": "java", "file_size_in_byte": 408, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "fb48110b23d39b30799e2d368a32e3899186eaca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jonosterman/cube
237
FILENAME: UsbDeviceEntryList.java
0.279042
/** * Copyright (C) 2011 / cube-team <https://cube.forge.osor.eu> * * Licensed under the Apache License, Version 2.0 (the "License"). * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ch.admin.vbs.cube.core.usb; import java.util.ArrayList; import ch.admin.vbs.cube.core.ISession.IOption; public class UsbDeviceEntryList extends ArrayList<UsbDeviceEntry> implements IOption { private boolean updated; private static final long serialVersionUID = 1L; public void setUpdated(boolean updated) { this.updated = updated; } public boolean isUpdated() { return updated; } }
6da55829-79e0-4728-8181-5883ff8bd303
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-12-18T20:44:32", "repo_name": "DQueiser/DQTravelSpots", "sub_path": "/DesignDocuments/Screens.md", "file_name": "Screens.md", "file_ext": "md", "file_size_in_byte": 1144, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "f7ec27f37275d75385019286d6efa741eae96cef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/DQueiser/DQTravelSpots
259
FILENAME: Screens.md
0.264358
# Screen Design ### 1: Login page This will be the first page displayed. Users can enter their email-address username and password, or can click a button to sign up as a new user. ### 2: New User page If the new user option is chosen from the login page, this page will be displayed. New users can enter their first and last names, email address, and a password which they will need to enter twice in order to confirm it. ### 3: About page Will display information about this application. ### 4: Search page On this page users will enter a country/city combination, with the option of also entering a state. I intend on using an API to provide the list of countries and cities. ### 5: Search Results page This page will list off the results returned by the ViaMichelin API. The user will have the option of saving Points of Interest by city. ### 6: User Trip List This page will list off all of the Cities that the user has saved Points of Interest for, with a count of how many POIs each saved city has. ### 7: User Trip breakdown list This page will list off all Points of Interest that a user has saved for a geographic city.
da3aa413-9fef-4323-beea-67bc97e4d5d7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-28 11:40:53", "repo_name": "mzl1989325/mvc", "sub_path": "/src/main/java/form/ActionListener.java", "file_name": "ActionListener.java", "file_ext": "java", "file_size_in_byte": 1191, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "c70162926499f56c9428dba73f198f838f3ebf56", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mzl1989325/mvc
238
FILENAME: ActionListener.java
0.289372
package form; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import java.net.URL; import java.util.Map; /** * @Author:muzonglin * @Description: * @Date:2017/6/27 */ public class ActionListener implements ServletContextListener { public void contextInitialized(ServletContextEvent servletContextEvent) { ServletContext context = servletContextEvent.getServletContext(); String xmlpath = context.getInitParameter("struts_config"); //String tomcatpath = context.getRealPath("\\"); String url = ActionListener.class.getClassLoader().getResource(xmlpath).getPath(); try { //Map<String,XmlBean> map = StrutsXml.parse(tomcatpath+xmlpath); Map<String,XmlBean> map = StrutsXml.parse(url); context.setAttribute("struts",map); System.out.println("信息:加载完成"); }catch (Exception ex) { ex.printStackTrace(); } } public void contextDestroyed(ServletContextEvent servletContextEvent) { System.out.println("信息:已经注销"); } }
1f1e30bc-43fd-4ff6-a797-f8fab8ea629c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-08-12 13:03:16", "repo_name": "Charlesjean/SQLiteDemoProject", "sub_path": "/app/src/main/java/com/djchen/com/sqlitedemoproject/TestFragment.java", "file_name": "TestFragment.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "6744a79e59df151a8d8c269dd26c69dfb59b88fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Charlesjean/SQLiteDemoProject
206
FILENAME: TestFragment.java
0.247987
package com.djchen.com.sqlitedemoproject; import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; /** * Created by Administrator on 2014/8/11. */ public class TestFragment extends Fragment { private Button mbtn; private TextView mtext; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_query_test, container,false); mbtn = (Button)view.findViewById(R.id.test_btn); mtext = (TextView)view.findViewById(R.id.test_sql); mbtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { TestDatabase(); } }); return view; } private void TestDatabase() { ((MainActivity)getActivity()).getDatabase().Test(); getActivity().deleteDatabase("library"); } }
dfe6702d-cbc4-482b-8766-639e21a430b1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-07-16T02:40:57", "repo_name": "ECOtterstrom/workout_tracker", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1110, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "fdc5e72ffd9763469df64ade82e9bbe0050c95a1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ECOtterstrom/workout_tracker
251
FILENAME: README.md
0.282196
# Week 17 Bootcamp Assignment - Workout Tracker ![badge](https://img.shields.io/badge/Language-JavaScript-brightgreen) ## Description This project enables the user to track their workouts and view their progress in graphs over time. The user can enter any type of Cardio or Resistance type of exercise they like. They can add multiple exercises per workout session, then select the complete button to complete their workout. The application then displays the total information for all of the entered exercises as the Last Workout. Workout graphs are accessed using the Dashboard link on the Workout Tracker main page. ## Table of Contents * Installation * Usage * License * Contributing * Tests * Questions ## Installation ## Usage Deployed application: https://protected-bastion-00970.herokuapp.com/ ## License Licensed by Erin Otterstrom, 2020 ## Contributing Please contact Erin Otterstrom before contributing ## Tests ## Questions If you have any questions please contact me at ecotterstrom@gmail.com, or view my repo at bootcampassign13 (https://github.com/ECOtterstrom/bootcampassign13).
22b3d044-5740-44c2-b0d2-c17652799fee
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-04 10:01:54", "repo_name": "bestrookie/hotel-admin", "sub_path": "/src/com/hotel/util/DBsql.java", "file_name": "DBsql.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "a7a09f51cb1c2d47d1176d07968cd0e535783ea4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/bestrookie/hotel-admin
204
FILENAME: DBsql.java
0.243642
package com.hotel.util; import com.alibaba.druid.pool.DruidDataSource; import java.sql.Connection; import java.sql.SQLException; public class DBsql { private static DruidDataSource dataSource = null; static { try { dataSource = new DruidDataSource(); LoadDbConfig config = new LoadDbConfig(); String url = String.format("jdbc:%s://%s:%s/%s?%s" ,config.getDbClass(),config.getHost(),config.getPort(),config.getDbName(),config.getSetting()); dataSource.setUrl(url); dataSource.setUsername(config.getUserName()); dataSource.setPassword(config.getPasswd()); dataSource.setInitialSize(5); dataSource.setPoolPreparedStatements(false); } catch (Exception e){ e.printStackTrace(); } } public static synchronized Connection getConnection(){ Connection conn = null; try { conn = dataSource.getConnection(); } catch (SQLException e) { e.printStackTrace(); } return conn; } }
74ec763e-2169-4f64-9081-91f807ec25a0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2013-08-16T18:49:38", "repo_name": "gonsie/fishmarks", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1169, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "13134448831b8bd986f55a4f747185436809568d", "star_events_count": 3, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/gonsie/fishmarks
289
FILENAME: README.md
0.233706
### Fishmarks is a set of fish functions which allow you to save and jump to commonly used directories. ## Compatability Fishmarks is based on the awsome project [huyng/bashmarks](http://www.huyng.com/projects/bashmarks/). Fishmarks work with [gonsie/bashmarks](http://github.com/gonsie/bashmarks). There is a slightly different format for the .sdirs file, but this can be used with both bash and fish. ## Install 1. git clone git://github.com/gonsie/fishmarks.git 2. make install ## Shell Commands s <bookmark_name> - Saves the current directory as "bookmark_name" c <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name" c - Go to the $HOME directory (cd ~) p <bookmark_name> - Prints the directory associated with "bookmark_name" d <bookmark_name> - Deletes the bookmark l - Lists all available bookmarks ## Example Usage $ cd /var/www/ $ s webfolder $ cd /usr/local/lib/ $ s locallib $ l $ c web<tab> $ c webfolder ## Where Fishmarks are stored All of your directory bookmarks are saved in a file called ".sdirs" in your HOME directory.
0c80006e-a40a-4d5f-aeb7-f5d9cfc073d7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-30 00:01:11", "repo_name": "andyzhaozhao/front-common", "sub_path": "/driver.door.common/src/main/java/com/iandtop/common/driver/vo/TCPResultVO.java", "file_name": "TCPResultVO.java", "file_ext": "java", "file_size_in_byte": 1039, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "47886f81e12022c3c70c3de5d969fabb23de33a4", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/andyzhaozhao/front-common
261
FILENAME: TCPResultVO.java
0.249447
package com.iandtop.common.driver.vo; import java.util.ArrayList; import java.util.List; public class TCPResultVO { private int currentLength ; private List<DeviceToServerMessageVO> vos = new ArrayList<DeviceToServerMessageVO>(); private List<AuthCardVO> authCardVOs = new ArrayList<AuthCardVO>(); public byte[] tmpBytes = new byte[]{};//存储临时的bytes,用来缓存从硬件读取的bytes public byte[] tmpVoBytes = new byte[]{};//存储临时的bytes,用来拼vo public int getCurrentLength() { return currentLength; } public void setCurrentLength(int currentLength) { this.currentLength = currentLength; } public List<DeviceToServerMessageVO> getVos() { return vos; } public void setVos(List<DeviceToServerMessageVO> vos) { this.vos = vos; } public List<AuthCardVO> getAuthCardVOs() { return authCardVOs; } public void setAuthCardVOs(List<AuthCardVO> authCardVOs) { this.authCardVOs = authCardVOs; } }
836ccadb-cd10-40de-bfca-c6da7a95a9b0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-22 19:45:50", "repo_name": "goblimey/addressbook", "sub_path": "/src/main/java/com/goblimey/addressbook/ContactInMemoryImpl.java", "file_name": "ContactInMemoryImpl.java", "file_ext": "java", "file_size_in_byte": 1143, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "de3fc045b5e42df6d5316b0174efd45a398cfa69", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/goblimey/addressbook
267
FILENAME: ContactInMemoryImpl.java
0.23793
package com.goblimey.addressbook; import java.util.Date; /** * Created by simon on 22/02/18. */ public class ContactInMemoryImpl implements Contact { String name; Gender gender; Date dob; public ContactInMemoryImpl() { super(); } public ContactInMemoryImpl(String name, Gender gender, Date dob) { super(); this.name = name; this.gender = gender; this.dob = dob; } @Override public String getName() { return name; } @Override public void setName(String name) { this.name = name; } @Override public Gender getGender() { return gender; } @Override public void setGender(Gender gender) { this.gender = gender; } @Override public Date getDOB() { return dob; } @Override public void setDOB(Date dob) { this.dob = dob; } @Override public String toString() { return "ContactInMemoryImpl{" + "name='" + name + '\'' + ", gender=" + gender + ", dob=" + dob + '}'; } }
848894dd-4bf3-4113-8a6d-d782ce057b4a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-10 07:12:15", "repo_name": "sunnwind/ohs-general", "sub_path": "/src/main/java/ohs/tree/trie/array/DATrie.java", "file_name": "DATrie.java", "file_ext": "java", "file_size_in_byte": 1091, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "944c846e9cbd6d6416aa39303081e3e014710e40", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/sunnwind/ohs-general
298
FILENAME: DATrie.java
0.276691
package ohs.tree.trie.array; import java.util.List; import ohs.io.FileUtils; import ohs.types.number.IntegerArray; import scala.Char; public class DATrie { public static void main(String[] args) throws Exception { System.out.println("process begins."); List<String> names = FileUtils.readLinesFromText("../../data/dict/pers.txt"); DATrie trie = new DATrie(); trie.test1(names); System.out.println("process ends."); } private IntegerArray base = new IntegerArray(new int[100000]); private IntegerArray check = new IntegerArray(new int[100000]); private IntegerArray next = new IntegerArray(new int[100000]); public void test1(List<String> data) { int b = 0; int s = 0; for (int l = 100; l < data.size(); l++) { String q = data.get(l); for (int u = 0; u < q.length(); u++) { char ch = q.charAt(u); int c = Character.codePointAt(q.toCharArray(), u); check.set(b + c, s); base.set(b + c, base.get(base.get(s) + c)); check.set(base.get(base.get(s) + c) + q, element) } } } }
41618d7c-2c6b-4b08-95cd-01c129084546
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-13T06:02:17", "repo_name": "dhavalocked/redis-dump", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1169, "line_count": 40, "lang": "en", "doc_type": "text", "blob_id": "e317e81d323fe748df03d8b1c9324c083f38238f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dhavalocked/redis-dump
283
FILENAME: README.md
0.27048
# redis-dump - This will help you migrate your data from source to destination redis. Source will always be a single node. Destination can be cluster URL, standalone or twemproxy server. # usage example: > ./main copy source:port destination:port --queryString="*" --scanLimit=1000 --dumpThreads=100 --restoreThreads=100 ## Features - Import data along with TTL - setup parallelism based in config vars - option to override keys if already present in destination - migrate all or specific pattern keys - it wont delete keys from your source ## Installation & usage Please clone the repo. either use exisitng build or build a go binary from source For mac.. ```sh go build main.go ``` For linux.. ```sh env GOOS=linux GOARCH=amd64 go build -v main.go ``` ## supported options | option | description | | ------ | ------ | | queryString | prefix pattern to migrate (EX : "*", "USER_*") | scanLimit | number of keys to be scanned | dumpThreads | number of threads to get the dump of keys scanned | restoreThreads| number of threads to restore the keys scanned | overrideKey | if keys is already present in destination.. override it or not? (defaults to false)
edffb4db-0812-4004-b2ff-9348b910a503
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-18 07:41:33", "repo_name": "GasJacek/TaskListSpring", "sub_path": "/src/main/java/com/task/model/Task.java", "file_name": "Task.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "04c5ee964cebf007394f3ef2ae9e7b2e3850bf50", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/GasJacek/TaskListSpring
205
FILENAME: Task.java
0.281406
package com.task.model; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; @Entity @Getter @Setter @NoArgsConstructor @AllArgsConstructor public class Task { @javax.persistence.Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @Column(name = "task_number", unique = true, nullable = false) private Integer taskNumber; @Column(name = "task_name", nullable = false) private String taskName; @Column(name = "task_description") private String taskDescription; @Column(name = "task_status", nullable = false) private boolean taskStatus; public Task(String taskName, String taskDescription, Integer taskNumber, boolean taskStatus) { this.taskName = taskName; this.taskDescription = taskDescription; this.taskNumber = taskNumber; this.taskStatus = taskStatus; } }
d7f94130-51f9-4472-a8c9-7f0ae0b6f0ec
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-02 06:48:57", "repo_name": "pmoor/swiss-vault", "sub_path": "/src/main/java/ws/moor/swissvault/auth/UserId.java", "file_name": "UserId.java", "file_ext": "java", "file_size_in_byte": 531, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "432b2f2bfa1fea480451d98be080c0f8f20e3737", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/pmoor/swiss-vault
262
FILENAME: UserId.java
0.253861
/* * Copyright 2012 Patrick Moor <patrick@moor.ws> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ws.moor.swissvault.auth; public class UserId { private final String userId; private UserId(String userId) { this.userId = userId; } public static UserId fromString(String userId) { return new UserId(userId); } public String asString() { return userId; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; return userId.equals(((UserId) o).userId); } @Override public int hashCode() { return userId.hashCode(); } }
a5766032-1866-45ce-be10-b96141fb9be2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-19 13:33:47", "repo_name": "MeiyouSunny/Metron", "sub_path": "/app/src/main/java/com/metron/xiaoming/ui/home/TabProfitAdapter.java", "file_name": "TabProfitAdapter.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "79378ba92f0a405dc8e6dfb93aaecaf49cceab4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MeiyouSunny/Metron
221
FILENAME: TabProfitAdapter.java
0.262842
package com.metron.xiaoming.ui.home; import android.content.Context; import com.alaer.lib.util.UserDataUtil; import com.metron.xiaoming.util.CoinConst; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentPagerAdapter; public class TabProfitAdapter extends FragmentPagerAdapter { private final Context mContext; private Fragment[] mTabs; public TabProfitAdapter(Context context, FragmentManager fm) { super(fm); mContext = context; mTabs = new Fragment[2]; } @Override public Fragment getItem(int position) { if (mTabs[position] == null) { String type = (position == 0) ? CoinConst.BTC : CoinConst.ETH; if (!UserDataUtil.isChannelUser()) mTabs[position] = new ProfitTypeFragment(type); else mTabs[position] = new ProfitTypeChannelFragment(type); } return mTabs[position]; } @Override public int getCount() { return 2; } }
a52dbdf3-a2e9-4257-a1bc-edaec8ffd806
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-08-02T17:22:23", "repo_name": "Scott3-0/NWAPW-Project", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1142, "line_count": 13, "lang": "en", "doc_type": "text", "blob_id": "8ec46608610d917628f4d655e4ce9853689698f8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Scott3-0/NWAPW-Project
267
FILENAME: README.md
0.240775
# NWAPW-Project Hello! Welcome to our app--Plant Identifier. The purpose of this app is to allow everyone to know more about the world around them. *The updated version of the app is in "Bronte's Branch", not the master branch!!!* In order to use this app (at this point), open Android Studio. Then open an existing project: "USE_THIS_ONE_FROM_NOW_ON". In the menu, go to "Run" and run the app. It will ask you to select an emulator. If there's already one, select that one. Otherwise, create a new emulator that is API 24 or later. It should run and then open the app in the emulator. *If emulator is already open, you can skip above paragraph. The app is fairly straightforward--go to "identify plants!" and select a photo.** Currently, as this app is not properly connected to the tensorflow model, the "select" button will cause the app to quit. If you would like to see what the results screen will eventually look like, go back to the menu screen (using the arrow in the bottom menu) and select "Results". **you can download another image from chrome in the emulator to select in app Thank you! -Bronte, Elaine, Julissa, and Scott
3510197e-1a6a-40f3-a8e0-e2efba8facf0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-03 05:37:26", "repo_name": "zikri24/pokedex", "sub_path": "/app/src/main/java/com/example/zikri/pokedex/model/Sprites.java", "file_name": "Sprites.java", "file_ext": "java", "file_size_in_byte": 1085, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "4097d335acbbda973c1016078620124239140592", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zikri24/pokedex
246
FILENAME: Sprites.java
0.201813
package com.example.zikri.pokedex.model; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; /** * Created by Zikri on 21/09/2016. */ public class Sprites { @SerializedName("back_default") @Expose private String backDefault; @SerializedName("front_default") @Expose private String frontDefault; @SerializedName("front_shiny") @Expose private String frontShiny; public String getFrontDefault() { return frontDefault; } public void setFrontDefault(String frontDefault) { this.frontDefault = frontDefault; } public String getFrontShiny() { return frontShiny; } public void setFrontShiny(String frontShiny) { this.frontShiny = frontShiny; } public Sprites() { } public Sprites(String backDefault) { this.backDefault = backDefault; } public String getBackDefault() { return backDefault; } public void setBackDefault(String backDefault) { this.backDefault = backDefault; } }
dd396172-b6b9-43d4-aa81-46e0de207e32
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-09 09:15:01", "repo_name": "lakith/type4", "sub_path": "/src/main/java/com/spring/starter/DTO/IdentificationFormDTO.java", "file_name": "IdentificationFormDTO.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "89cf7598f32f90f73cf31811c837b164fc24a033", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lakith/type4
205
FILENAME: IdentificationFormDTO.java
0.228156
package com.spring.starter.DTO; import org.springframework.web.multipart.MultipartFile; import java.io.Serializable; public class IdentificationFormDTO implements Serializable { private String identification; private MultipartFile file; private int customerServiceRequestId; public IdentificationFormDTO() { } public IdentificationFormDTO(String identification, MultipartFile file, int customerServiceRequestId) { this.identification = identification; this.file = file; this.customerServiceRequestId = customerServiceRequestId; } public String getIdentification() { return identification; } public void setIdentification(String identification) { this.identification = identification; } public MultipartFile getFile() { return file; } public void setFile(MultipartFile file) { this.file = file; } public int getCustomerServiceRequestId() { return customerServiceRequestId; } public void setCustomerServiceRequestId(int customerServiceRequestId) { this.customerServiceRequestId = customerServiceRequestId; } }
71aab543-0e03-4cef-87cb-020c579de330
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-05 14:53:36", "repo_name": "ankostyuk/demo-creditnet-comments", "sub_path": "/api/src/main/java/ru/nullpointer/nkbcomment/domain/UserInfo.java", "file_name": "UserInfo.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "1c6498efc5f1a1a22a68f088bc5140478f950db2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ankostyuk/demo-creditnet-comments
222
FILENAME: UserInfo.java
0.20947
package ru.nullpointer.nkbcomment.domain; import java.util.List; import java.util.Set; import javax.xml.bind.annotation.XmlRootElement; import org.apache.commons.lang.builder.ToStringBuilder; import ru.nullpointer.nkbcomment.security.domain.Permission; /** * @author Alexander Yastrebov * @author ankostyuk */ @XmlRootElement public class UserInfo { private String userId; private Set<Permission> permissions; private List<Group> shareGroups; public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public Set<Permission> getPermissions() { return permissions; } public void setPermissions(Set<Permission> permissions) { this.permissions = permissions; } public List<Group> getShareGroups() { return shareGroups; } public void setShareGroups(List<Group> shareGroups) { this.shareGroups = shareGroups; } @Override public String toString() { return ToStringBuilder.reflectionToString(this); } }
2041d63f-8fbe-4c6a-9d1f-630bb8608694
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-19 01:57:50", "repo_name": "sathish-netha/ZeroBank_Automation_with_BDD_Cucumber", "sub_path": "/src/test/java/com/zerobank/step_definitions/LoginStepDefinitions.java", "file_name": "LoginStepDefinitions.java", "file_ext": "java", "file_size_in_byte": 1143, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "20fd190e19e0c0d6d4e731e86f75918dad3fce33", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sathish-netha/ZeroBank_Automation_with_BDD_Cucumber
243
FILENAME: LoginStepDefinitions.java
0.293404
package com.zerobank.step_definitions; import com.zerobank.pages.LoginPage; import com.zerobank.utilities.ConfigurationReader; import com.zerobank.utilities.Driver; import io.cucumber.java.en.Given; import io.cucumber.java.en.Then; import io.cucumber.java.en.When; import org.junit.Assert; public class LoginStepDefinitions { LoginPage loginPage = new LoginPage(); @Given("user is on a landing {string}") public void user_is_on_a_landing(String string) { loginPage.landingPage(string); } @When("user login with {string} and {string}") public void user_login_with_and(String username, String password) throws InterruptedException { loginPage.login(username, password); } @Then("user should see home page") public void user_should_see_home_page() { Assert.assertEquals("Wrong page!!!", ConfigurationReader.getProperty("page_title"), Driver.getDriver().getTitle()); } @Then("user should see error {string}") public void userShouldSeeError(String massage) { Assert.assertEquals("Wrong massage", massage, loginPage.getErrorMessageText().trim()); } }
3a05042b-e367-4fcf-ab79-30c3ed981e7e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-02 13:48:57", "repo_name": "Dimix88/AttendanceSystem", "sub_path": "/src/main/java/com/dimitri/controller/AdminController.java", "file_name": "AdminController.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "911144b40a3591b1e09d9ec9a7ec4afc64a3e12e", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Dimix88/AttendanceSystem
226
FILENAME: AdminController.java
0.277473
package com.dimitri.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.bind.annotation.*; import com.dimitri.service.AdminService; import com.dimitri.domain.Admin; import java.util.List; import java.util.Set; @RestController @RequestMapping("/admin") public class AdminController { @Autowired @Qualifier("AdminServiceImpl") private AdminService service; @PostMapping("/create") @ResponseBody public Admin create(@RequestBody Admin admin){ return service.create(admin); } @PutMapping("/update") @ResponseBody public Admin update(@RequestBody Admin admin){ return service.update(admin); } @GetMapping("/read/{id}") @ResponseBody public Admin read(@PathVariable String id){ return service.read(id); } @GetMapping("/read/all") @ResponseBody public List<Admin> getAll(){ return service.getAll(); } @DeleteMapping("/delete/{id}") @ResponseBody public void delete(@PathVariable String id){ service.delete(id); } }
b653aa2a-91d4-4fc0-b5a3-d4cf55cfb22a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-13 04:37:52", "repo_name": "gandhiamar2/NewsReaderMobileApp", "sub_path": "/Inclass04/app/src/main/java/com/example/gandh/inclass04/third.java", "file_name": "third.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "91c53ec2fe5ef407378e0b539695439a142aa67b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/gandhiamar2/NewsReaderMobileApp
215
FILENAME: third.java
0.281406
package com.example.gandh.inclass04; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; /** * Created by gandh on 2/6/2017. */ public class third { public static ArrayList<newsarticle> parsingjson(String s) throws JSONException { ArrayList<newsarticle> news = new ArrayList<newsarticle>(); JSONObject sonobject = new JSONObject(s); JSONArray sonArray = sonobject.getJSONArray("articles"); newsarticle nw = null; for (int i = 0; i < sonArray.length(); i++) { JSONObject subobject = sonArray.getJSONObject(i); nw = new newsarticle(); nw.setAuthor(subobject.getString("author")); nw.setTitle(subobject.getString("title")); nw.setDescription(subobject.getString("description")); nw.setUrlToImage(subobject.getString("urlToImage")); nw.setPublishedAt(subobject.getString("publishedAt")); news.add(nw); } return news; } }
e8dd81c3-7e86-42fd-b29e-db730fe2447d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-27 03:39:23", "repo_name": "justice-code/star-map", "sub_path": "/core/src/main/java/org/eddy/future/StarFuture.java", "file_name": "StarFuture.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "2336170cb3054cd02a4a6a91cb58563faa48c968", "star_events_count": 9, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/justice-code/star-map
203
FILENAME: StarFuture.java
0.258326
package org.eddy.future; import org.eddy.protocol.Data; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class StarFuture { private final Lock lock = new ReentrantLock(); private final Condition done = lock.newCondition(); private final int timeout = 3; private Data response; public Data get() { Data result = null; try { lock.lock(); if (response != null) { result = response; } else { done.await(timeout, TimeUnit.SECONDS); result = response; } } catch (InterruptedException e) { throw new RuntimeException(e); } finally { lock.unlock(); } return result; } public void receive(Data data) { try { lock.lock(); response = data; done.signal(); } finally { lock.unlock(); } } }
651b20f0-bcc8-4954-b7d4-a3a8277f4b34
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-04-10T09:41:05", "repo_name": "crhg/laravel-config-validator", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1166, "line_count": 51, "lang": "en", "doc_type": "text", "blob_id": "e02e182572212e75e05cac44abfa248b93105efd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/crhg/laravel-config-validator
243
FILENAME: README.md
0.275909
# DESCRIPTION Validate the configuration of the Laravel application. # INSTALL ```console composer require crhg/laravel-config-validator ``` # USAGE ## PREPARE RULES Implement the `Crhg\ConfigValidator\Interfaces\ConfigValidationRuleProvider` interface in the service provider class. Define `getConfigValidationRule()` function. It has no arguments and returns an array of validation rules. Rules are written in the same way as [validation for request](https://laravel.com/docs/master/validation). ### EXAMPLE ```php class AppServiceProvider extends ServiceProvider implements ConfigValidationRuleProvider { public function getConfigValidationRule() { return [ 'app.foo' => 'required', ]; } } ``` ## PERFORM CHECK Validate the current configuraiton using the rules prepared by executing the `config:validate` artisan command. ```console % php artisan config:varidate app.foo: The app.foo field is required. ``` It will display a message if there is a problem. It exists with status `1` if some errors are found. # BUGS * Sometimes the wording of a message is odd because the validator for the request is used.
024dc3e6-a1ab-4436-a384-d53df453a1bf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-31 05:09:12", "repo_name": "zyd16888/NewClock", "sub_path": "/app/src/main/java/com/example/dong/newclock/LinerRecyclerAdapter.java", "file_name": "LinerRecyclerAdapter.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "49a2372744a050f599f0cbe6ae55d1696c844c44", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/zyd16888/NewClock
226
FILENAME: LinerRecyclerAdapter.java
0.278257
package com.example.dong.newclock; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.ViewGroup; import java.util.List; /** * Created by dong on 2017/10/11. */ public class LinerRecyclerAdapter extends RecyclerView.Adapter<LinerRecyclerHolder>{ private Context mContext; private List<String> mDatas; public LinerRecyclerAdapter(Context context,List<String> Datas){ mContext = context; mDatas = Datas; } @Override public LinerRecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) { LinerRecyclerHolder holder = new LinerRecyclerHolder(LayoutInflater.from(mContext).inflate(R.layout.stop_watch_item,parent,false)); return holder; } @Override public void onBindViewHolder(LinerRecyclerHolder holder, int position) { holder.tv.setText(mDatas.get(position)); } @Override public int getItemCount() { return mDatas.size(); } public void clean(){ mDatas.clear(); } }
7ca07e31-2f79-4fad-894d-fba8965fdbe4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-25 08:45:00", "repo_name": "jjtgit/xedierzmn", "sub_path": "/app/src/main/java/com/example/xedierzmn/fragment/BaseFragment.java", "file_name": "BaseFragment.java", "file_ext": "java", "file_size_in_byte": 1143, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "06eeb49aaa07c3479fa26effaf1b04759f3224c8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jjtgit/xedierzmn
209
FILENAME: BaseFragment.java
0.26971
package com.example.xedierzmn.fragment; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import butterknife.ButterKnife; import butterknife.Unbinder; public abstract class BaseFragment extends Fragment { private Unbinder unbinder; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(getlayout(),container,false); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { unbinder=ButterKnife.bind(this,view); initView(view); initData(); } protected abstract int getlayout(); protected abstract void initView(View view); protected abstract void initData(); @Override public void onDestroy() { super.onDestroy(); if (unbinder!=null){ unbinder.unbind(); } } }
a62532dc-7fe0-4595-abc4-dde6ad57e18f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-18 21:40:55", "repo_name": "webster91/hestia", "sub_path": "/app/src/main/java/com/valeev/hestia/security/UserPrincipal.java", "file_name": "UserPrincipal.java", "file_ext": "java", "file_size_in_byte": 1165, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "a52af5b4921905a9afb224c5b9fe6cfa39bc5652", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/webster91/hestia
231
FILENAME: UserPrincipal.java
0.233706
package com.valeev.hestia.security; import com.valeev.hestia.model.User; import lombok.Data; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import java.util.Collection; @Data public class UserPrincipal implements UserDetails { private final User user; private final boolean active = true; @Override public Collection<? extends GrantedAuthority> getAuthorities() { return user.getRoles(); } @Override public String getPassword() { return user.getPassword(); } @Override public String getUsername() { return user.getUsername(); } @Override public boolean isAccountNonExpired() { return active; } @Override public boolean isAccountNonLocked() { return active; } @Override public boolean isCredentialsNonExpired() { return active; } @Override public boolean isEnabled() { return active; } public String getId() { return user.getId(); } public String getAddressId() { return user.getAddressId(); } }
d6faef48-5750-454b-a81a-55bd06967bd8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-22 03:00:19", "repo_name": "liuxiaolong661/demo1", "sub_path": "/src/main/java/com/springboot/demo1/service/impl/UserServiceImpl.java", "file_name": "UserServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1093, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "662c67cd38247ee927cfd4e35ee76f79c0eeaedf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/liuxiaolong661/demo1
215
FILENAME: UserServiceImpl.java
0.258326
package com.springboot.demo1.service.impl; import com.springboot.demo1.dao.UserDao; import com.springboot.demo1.mode.UserDomain; import com.springboot.demo1.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.stereotype.Service; import java.util.List; @Service public class UserServiceImpl implements UserService { @Autowired private UserDao userDao;//这里会爆红,请忽略 @Override public int insert(UserDomain record) { int i=userDao.insert(record); if(i<1){ throw new DataIntegrityViolationException("添加数据失败"); } return 1; } @Override public int deleteUserById(Integer userId) { return userDao.deleteUserById(userId); } @Override public void updateUser(UserDomain userDomain) { userDao.updateUser(userDomain); } @Override public List<UserDomain> selectUsers() { // int i=1/0; return userDao.selectUser(); } }
5b95d979-745c-49ae-b1cf-e7e489e0bc1b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-04 10:17:01", "repo_name": "java404/recode", "sub_path": "/smartmon-injector/src/main/java/smartmon/injector/config/SmartMonBatchConfig.java", "file_name": "SmartMonBatchConfig.java", "file_ext": "java", "file_size_in_byte": 1089, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "07932c9b66449809e6448f070a0659a041d01228", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/java404/recode
230
FILENAME: SmartMonBatchConfig.java
0.26588
package smartmon.injector.config; import java.io.File; import javax.annotation.PostConstruct; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.util.ResourceUtils; @Slf4j @Configuration public class SmartMonBatchConfig { @Value("${smartmon.batch.rootFolder:}") private String rootFolder; @PostConstruct private void init() { if (StringUtils.isEmpty(rootFolder)) { try { rootFolder = new File(ResourceUtils.getURL("classpath:").getPath()) .getParentFile().getParentFile().getParent().replace("file:", ""); } catch (Exception err) { log.error("get root path error", err); return; } } if (!rootFolder.endsWith("/")) { rootFolder += "/"; } log.info(rootFolder); } public String getFileUploadTargetPath() { return rootFolder + "files/"; } public String getScriptsPath() { return rootFolder + "scripts/"; } }
d69ed851-918d-474f-8aa3-09b45701d2dc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-09-01T13:18:09", "repo_name": "pavelsof/racepoint-client", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1169, "line_count": 39, "lang": "en", "doc_type": "text", "blob_id": "218ea77db25713c6ebc46da93349ec0ab4b842c5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/pavelsof/racepoint-client
273
FILENAME: README.md
0.256832
Racepoint ================ Racepoint is a web application to be used by urban race organisers for: * Logging of arrival and departure times of teams at control points. * Registration of teams. * Providing real-time information about team's progress through the race. The web application was (and is being) developed for the purposes of [Shemetna Varna](http://shemetna-varna.org) – an urban race organised in Varna on an annual basis. Racepoint is an open source project and contributions are welcome. Racepoint consists of a [Django server](http://github.com/pavelsof/racepoint-server) and an AngularJS client. This repository contains the latter. Initialisation --- Do something like: ``` git clone && cd npm install bower install grunt build ``` The last one compiles it all into the `build` directory. Workflow --- `grunt serve` does `grunt build` and then starts a connect server on localhost:9000. `karma start test/karma.js` starts the unit test watch. Contributing --- Pull requests are welcome. Stuff we need: * More unit tests. * E2E tests. Licence --- Racepoint is published under the [Apache License](http://www.apache.org/licenses/LICENSE-2.0).
eee95f18-6a0c-43a4-8215-68ea2ffa57a3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-20 09:56:35", "repo_name": "paliwalprateek1/susi_android", "sub_path": "/app/src/main/java/org/fossasia/susi/ai/SnackbarBehavior.java", "file_name": "SnackbarBehavior.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "c69ced62aef4875ed5bb103e88bafb6835bef1ef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/paliwalprateek1/susi_android
206
FILENAME: SnackbarBehavior.java
0.280616
package org.fossasia.susi.ai; import android.content.Context; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.Snackbar; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.LinearLayout; /** * Created by rajdeep1008 on 17/10/16. */ public class SnackbarBehavior extends CoordinatorLayout.Behavior<ViewGroup>{ public SnackbarBehavior(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean layoutDependsOn(CoordinatorLayout parent, ViewGroup child, View dependency) { return dependency instanceof Snackbar.SnackbarLayout; } @Override public boolean onDependentViewChanged(CoordinatorLayout parent, ViewGroup child, View dependency) { float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight()); child.setTranslationY(translationY); return true; } }
3c6479d0-ada9-4c60-94eb-3cc30285baed
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-09-22 08:22:46", "repo_name": "nastashonok/SofttecoCodeSample", "sub_path": "/app/src/main/java/com/softteco/codesample/fragments/FragmentAbstract.java", "file_name": "FragmentAbstract.java", "file_ext": "java", "file_size_in_byte": 1143, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "d2b82d30a13cc5d1171468d54384b01ad11e4538", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/nastashonok/SofttecoCodeSample
199
FILENAME: FragmentAbstract.java
0.228156
package com.softteco.codesample.fragments; import android.content.Context; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public abstract class FragmentAbstract extends Fragment { protected static final String ARGS_CONTENT = "ARGS_CONTENT"; private FragmentListener fragmentListener; @Override public void onAttach(Context context) { super.onAttach(context); try { fragmentListener = (FragmentListener) context; } catch (ClassCastException classCastException) { throw new IllegalAccessError("Activity MUST implement FragmentListener"); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(getFragmentLayoutId(), container, false); } protected abstract int getFragmentLayoutId(); public FragmentListener getFragmentListener() { return fragmentListener; } public boolean onBackPressed() { return false; } }
972b0b2e-d96a-4b42-84ff-c7aa58218e70
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-12 10:15:53", "repo_name": "raktimraihan/university-projects-undergrad", "sub_path": "/raktim_raihan-needy-serve/app/src/main/java/com/needyserve/android/needyserve/Loading.java", "file_name": "Loading.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "a15e44c31de63783b0227a82a0b23124afec94df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/raktimraihan/university-projects-undergrad
206
FILENAME: Loading.java
0.225417
package com.needyserve.android.needyserve; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.needyserve.android.needyserve.com.needyserve.android.instances.LandingNavigationDrawer; public class Loading extends AppCompatActivity { private String id ="", name="", email="", phone="", gender=""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_loading); Intent intent = getIntent(); id=intent.getStringExtra("id"); name=intent.getStringExtra("name"); email=intent.getStringExtra("email"); phone=intent.getStringExtra("phone"); gender=intent.getStringExtra("gender"); Intent intent1 = new Intent(this, LandingNavigationDrawer.class); intent1.putExtra("id",id); intent1.putExtra("email", email); intent1.putExtra("name",name); intent1.putExtra("phone",phone); intent1.putExtra("gender",gender); startActivity(intent1); } }
14649ae1-6808-41ed-8db9-53de8b5595aa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-02-10T15:15:09", "repo_name": "pkyurkchiev/mean-stack", "sub_path": "/documentations/technology-stack.md", "file_name": "technology-stack.md", "file_ext": "md", "file_size_in_byte": 1143, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "c12101ae226253831efce9c46229a87c5ea23e9d", "star_events_count": 8, "fork_events_count": 5, "src_encoding": "UTF-8"}
https://github.com/pkyurkchiev/mean-stack
238
FILENAME: technology-stack.md
0.26971
### Node.js Node.js, is a development platform built on top of Google's V8 JavaScript virtual machine. Node.js is intended to run on a dedicated HTTP server and to employ a single thread with one process at a time. Node.js applications are events-based and run asynchronously. [Download link](https://nodejs.org/en/download/) # ### MongoDB MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. [Download link](https://www.mongodb.com/download-center?jmp=homepage#community/) # ### ExpressJS ExpressJS is a web application framework for Node.js. It is designed for building web applications and APIs. [Link](http://expressjs.com/) # ### Angualr Angular is the next version of Google’s massively popular MV* framework for building complex applications in the browser (and beyond). Angular 2 comes with almost everything you need to build a complicated frontend web or mobile apps, from powerful templates to fast rendering, data management, HTTP services, form handling, and so much more. [Link](https://angular.io)
c2cc6519-6b2a-4a46-b266-002d4762d42d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-05 12:39:19", "repo_name": "jaypratapsingh/Display_Toast", "sub_path": "/src/android/com/jp/plugin/display_toast/Display_Toast.java", "file_name": "Display_Toast.java", "file_ext": "java", "file_size_in_byte": 1005, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "0ddfde6cb3123f15a324623d6d5731ad8a921fb2", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jaypratapsingh/Display_Toast
213
FILENAME: Display_Toast.java
0.284576
package com.jp.plugin.display_toast; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaPlugin; import org.json.JSONArray; import org.json.JSONObject; import android.content.Intent; import android.net.Uri; import android.util.Log; import java.io.File; public class Display_Toast extends CordovaPlugin { @Override public boolean execute(String actionString, String message, CallbackContext callbackContext) { try { String getMessage=message.replace('"', ' '); if(actionString.equalsIgnoreCase("Toast_method_called")){ android.widget.Toast.makeText(cordova.getActivity(), getMessage, android.widget.Toast.LENGTH_LONG).show(); callbackContext.success("success"); return true; } else{ callbackContext.error("Invalid Selection"); return false; } } catch(Exception e){ Log.e(null,"JP:Plugins:ExceptionError"+e); callbackContext.error("JP:Plugins:ExceptionError "+e.getMessage()); return false; } } }
b61a9cf7-093d-45fe-8c85-336e95d436d8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-12-16T21:04:56", "repo_name": "4gus71n/KotlinSample", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1168, "line_count": 40, "lang": "en", "doc_type": "text", "blob_id": "ed17bdd3b59e97921c7df03594c6e6bee7ea750d", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/4gus71n/KotlinSample
354
FILENAME: README.md
0.185947
# KotlinSample Just an small project to test a MVP architecture with Kotlin + RxJava2 + Retrofit2. # Sources //How instatiate fragments with Kotlin https://medium.com/@azjkjensen/using-the-newinstance-pattern-in-kotlin-e40c1b4ba1ef https://www.raywenderlich.com/169885/android-fragments-tutorial-introduction-2 //Cool Kotlin tips https://savvyapps.com/blog/kotlin-tips-android-development https://antonioleiva.com/kotlin-awesome-tricks-for-android/ //Dependency injection https://medium.com/@burakeregar/kotlin-in-android-mvp-dependency-injection-dagger2-clean-architecture-13a47869dba4 http://www.andevcon.com/news/keddit-part-10-kotlin-dagger-2-dependency-injection //Parcelable classes https://medium.com/@BladeCoder/reducing-parcelable-boilerplate-code-using-kotlin-741c3124a49a //Retrofit2 Kotlin implementation https://android.jlelse.eu/kotlin-and-retrofit-2-tutorial-with-working-codes-333a4422a890 https://android.jlelse.eu/keddit-part-6-api-retrofit-kotlin-d309074af0 https://android.jlelse.eu/kotlin-and-retrofit-2-tutorial-with-working-codes-333a4422a890 //Extension functions https://antonioleiva.com/kotlin-android-extension-functions/
d6ed651e-e422-46ed-9b57-35c7561e7791
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-27 13:45:30", "repo_name": "RDAXING/flink_pro", "sub_path": "/src/main/java/com/rdx/demo/PropertiesConstants.java", "file_name": "PropertiesConstants.java", "file_ext": "java", "file_size_in_byte": 1183, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "4d34406719949243ad6c8c00bf31fc8fd0012308", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/RDAXING/flink_pro
247
FILENAME: PropertiesConstants.java
0.26971
package com.rdx.demo; import java.io.InputStream; import java.io.InputStreamReader; import java.text.MessageFormat; import java.util.Properties; /** * 项目:flink_pro * 包名:com.rdx.demo * 作者:rdx * 日期:2021/7/21 16:43 * */ public class PropertiesConstants { public static String PROPERTIES_FILE_NAME = "/application-dev-location.properties"; static { // 读取配置文件 application.properties 中的 ykc.profile getProp(); } private static void getProp(){ Properties prop = new Properties(); InputStream in = PropertiesConstants.class.getClassLoader().getResourceAsStream("application.properties"); try { InputStreamReader isr = new InputStreamReader(in, "UTF-8"); prop.load(isr); in.close(); isr.close(); String type = prop.getProperty("ykc.profile"); PROPERTIES_FILE_NAME = MessageFormat.format("/application_{0}.properties", type); } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { System.out.println(PROPERTIES_FILE_NAME); } }
b6b3c50e-ec35-4e13-8b8c-a0bd6aa05547
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-02 07:28:16", "repo_name": "ssj256x/todo-ms-api", "sub_path": "/src/main/java/com/todoapp/todo/entity/TodoEntity.java", "file_name": "TodoEntity.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "b888a5ae033bffa03d6de8cf6ab1c916afa40daa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ssj256x/todo-ms-api
243
FILENAME: TodoEntity.java
0.271252
package com.todoapp.todo.entity; import lombok.Getter; import lombok.Setter; import lombok.ToString; import org.springframework.data.annotation.LastModifiedDate; import javax.persistence.*; import java.sql.Timestamp; @Getter @Setter @ToString @Table(name = "todo", uniqueConstraints = @UniqueConstraint(columnNames = "id")) @Entity(name = "JoinTableTodoEntity") public class TodoEntity { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") private String id; @Column(name = "name", nullable = false) private String name; @Column(name = "description") private String description; @Column(name = "completed") private Boolean completed; @Column(name = "priority", nullable = false) private Priority priority; @Temporal(TemporalType.TIMESTAMP) @Column(name = "due_date") private Timestamp dueDate; @Temporal(TemporalType.TIMESTAMP) @Column(name = "completion_date", nullable = false) private Timestamp completionDate; @LastModifiedDate @Temporal(TemporalType.TIMESTAMP) @Column(name = "last_update", nullable = false) private Timestamp lastUpdate; }
f52f75df-dea6-46c4-9603-0432b79d0902
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-29 14:56:57", "repo_name": "joannamichalik/DietApp", "sub_path": "/src/main/java/pl/atm/dietapp/dietapp/controller/AdminUserController.java", "file_name": "AdminUserController.java", "file_ext": "java", "file_size_in_byte": 1068, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "6cee3d08da4ecd345c51f3a40a081a2744e7f1e1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/joannamichalik/DietApp
195
FILENAME: AdminUserController.java
0.273574
package pl.atm.dietapp.dietapp.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import pl.atm.dietapp.dietapp.dto.UserDto; import pl.atm.dietapp.dietapp.service.UserService; import javax.validation.Valid; import java.util.List; @Controller public class AdminUserController { private UserService userService; public AdminUserController(UserService userService) { this.userService = userService; } @RequestMapping(value = "/users", method = RequestMethod.GET) public String listUsers(@RequestParam(required = false) Long deleteId, Model model){ if (deleteId != null) { userService.delete(deleteId); return "redirect:users"; } List<UserDto> tasks = userService.findAll(); model.addAttribute("users", tasks); model.addAttribute("user", new UserDto()); return "users"; } }
3d078cb2-82b2-40f1-81f7-2c84e8bc9b8e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-27 10:49:17", "repo_name": "alanismirko/2nd-Semester-Project-Clean4U", "sub_path": "/src/modelLayer/Customer.java", "file_name": "Customer.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "54bd3a916d44f092a86511f5a904947886d84293", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/alanismirko/2nd-Semester-Project-Clean4U
252
FILENAME: Customer.java
0.26971
package modelLayer; public class Customer extends Person{ private String taxNum; private String companyName; public Customer(int id, String taxNum, String companyName, String firstName, String lastName, String phoneNumber, String email, String note) { super(id, firstName,lastName,phoneNumber, email, note); this.taxNum = taxNum; this.companyName = companyName; } public Customer(String taxNum, String companyName, String firstName, String lastName, String phoneNumber, String email, String note) { super(firstName,lastName,phoneNumber, email, note); this.taxNum = taxNum; this.companyName = companyName; } public Customer() { } public Customer(int id) { } public String getTaxNum() { return taxNum; } public void setTaxNum(String taxNum) { this.taxNum = taxNum; } public String getCompanyName() { return companyName; } public void setCompanyName(String companyName) { this.companyName = companyName; } @Override public String toString() { return getCompanyName() + " ; Person's full name: " + getFirstName() + " " + getLastName(); } }
d9c7a5e1-e2c9-4127-b2b9-86644ca4357b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-27 20:21:13", "repo_name": "DURACHMAN1337/HaulmontUnsuccesful", "sub_path": "/src/main/java/ru/dentech/HaulmontProject/Services/Impl/CreditOfferServiceImpl.java", "file_name": "CreditOfferServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "b8f35aae995463eb5ce58f6143007a1eef9db19d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/DURACHMAN1337/HaulmontUnsuccesful
260
FILENAME: CreditOfferServiceImpl.java
0.294215
package ru.dentech.HaulmontProject.Services.Impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import ru.dentech.HaulmontProject.Entities.CreditOffer; import ru.dentech.HaulmontProject.Repo.CreditOfferRepo; import ru.dentech.HaulmontProject.Services.CreditOfferService; import java.util.List; @Service public class CreditOfferServiceImpl implements CreditOfferService { @Autowired private CreditOfferRepo creditOfferRepo; @Override public void delete(CreditOffer creditOffer) { creditOfferRepo.delete(creditOffer); } @Override public void deleteById(Long id) { creditOfferRepo.deleteById(id); } @Override public void addCreditOffer(CreditOffer creditOffer) { creditOfferRepo.saveAndFlush(creditOffer); } @Override public List<CreditOffer> getAll() { return creditOfferRepo.findAll(); } @Override public List<CreditOffer> getALlOffersForClient(Long bankId) { return null; } @Override public List<CreditOffer> deleteALlOffersForClient(Long bankId) { return null; } }
eb9748c0-4885-4aca-afca-addcf037fd36
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-22 02:49:05", "repo_name": "liao93213/codeTools", "sub_path": "/src/main/java/liao/utils/SpringTool.java", "file_name": "SpringTool.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "8823b20eca3d63b4470b095db661c102f6250dd3", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/liao93213/codeTools
168
FILENAME: SpringTool.java
0.278257
package liao.utils; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; import java.util.Map; @Component public class SpringTool implements ApplicationContextAware { private ApplicationContext applicationContext; @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; } public ApplicationContext getApplicationContext(){ return applicationContext; } public <T> List<T> getBeanList(Class<T> clazz){ Map<String, T> beanMap = applicationContext.getBeansOfType(clazz); return new ArrayList<>(beanMap.values()); } public <T> T getBeanByName(String name){ return (T) applicationContext.getBean(name); } }
467ad164-4cef-4684-bbbc-8ced72332697
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-04-09 05:18:27", "repo_name": "duduOliver/Spotify", "sub_path": "/zipfsong/ZipfSong/src/SongBST.java", "file_name": "SongBST.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "08b9c8474017b67cabd3adc02c6c9b39c70cdf21", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/duduOliver/Spotify
282
FILENAME: SongBST.java
0.282988
public class SongBST { private SongNode root; private List maxList; public SongBST(long times, String name) { root = new SongNode(1, times, name); maxList = new List(); } public SongNode getRoot() { return root; } public List getMaxList() { return maxList; } public void insertNode(SongNode newNode) { SongNode cursor = root; long curTimes; long newTimes = newNode.getData().getTimesTorder(); boolean done = false; while(!done) { curTimes = cursor.getData().getTimesTorder(); if(newTimes > curTimes) { if(cursor.getRight() == null) { cursor.setRight(newNode); done = true; } else cursor = cursor.getRight(); } else { if(cursor.getLeft() == null) { cursor.setLeft(newNode); done = true; } else cursor = cursor.getLeft(); } } } public void inorderTraversalArray(SongNode rt){ if(rt.getRight()!= null) {inorderTraversalArray(rt.getRight());} maxList.insertNode(rt.getData().getName()); if(rt.getLeft() != null) {inorderTraversalArray(rt.getLeft());} } }
9a29a8e4-e205-49d3-ac46-4ea63ad10b2e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-12 12:03:48", "repo_name": "User-Experience-Design-SE3050-2021/se3050---uee-2021s2_reg_we_01", "sub_path": "/bank_application/PeoplesBank/app/src/main/java/com/alpha/peoplesbank/RegistrationOtp.java", "file_name": "RegistrationOtp.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "e59f5cb5624fc29b8b1d03e8f1c853813a4c191b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/User-Experience-Design-SE3050-2021/se3050---uee-2021s2_reg_we_01
203
FILENAME: RegistrationOtp.java
0.233706
package com.alpha.peoplesbank; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import com.alpha.peoplesbank.ui.login.LoginActivity; public class RegistrationOtp extends AppCompatActivity { public Button Next; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_registration_otp); initialize(); eventHandler(); } public void initialize() { Next = findViewById(R.id.btn_submit_re); } public void eventHandler() { Next.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { signup2ButtonClickEvent(); } }); } public void signup2ButtonClickEvent() { Intent i = new Intent(RegistrationOtp.this, LoginActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); startActivity(i); finish(); } }
2ec8053c-0739-4f32-9a39-bfef44b1ff9e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-04-05T03:56:36", "repo_name": "taoroalin/logseq-notes", "sub_path": "/pages/TTL New Strategy.md", "file_name": "TTL New Strategy.md", "file_ext": "md", "file_size_in_byte": 1144, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "ae038ec1a2eb997bfbeeac8cac10267cc56c618c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/taoroalin/logseq-notes
268
FILENAME: TTL New Strategy.md
0.262842
--- title: TTL New Strategy --- ## Why do i need a new strategy? [[TTL Mistake]] ## Basic idea: make lists of "colors", "places to put colors", "pseudo-selectors", ect, and combine them using [[LESS]] loops and functions. ## Lets call these things, such as "places to put colors", [[TTL Aspects]] ## We could make a named function, like tw(aspect,aspect...) that takes in a list of aspects and produces css rules. This isn't as elegant as concatenated class strings like "aspect-aspect-aspect", so i'm not doing it. ## What I am doing is looping through combinations of aspects and generating mixins for each one. ## Many [[TTL Aspect]] templates, like {pseudo-selector:}{color-place}-{color} have optional aspects, (here it's pseudo-selector). The way I'm dealing with this is adding a `null` element to each list, and rendering that as an empty string. ### this results in some mixins where every aspect is null. They don't get shipped, and don't really interfere with anything, but could be elmininated in a [[TTL Improvements]] ### You need to add the punctuation between aspects, like - or :, only if the aspect is not null. ##
c7ae7976-d81d-4bd4-908c-fea2f0af82bf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-26 12:23:20", "repo_name": "jpory/jforgame", "sub_path": "/jforgame-net/src/main/java/com/kingston/jforgame/socket/message/Message.java", "file_name": "Message.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "e43c88e479a086563708e029b2a44ee9a0fe2f78", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jpory/jforgame
219
FILENAME: Message.java
0.239349
package com.kingston.jforgame.socket.message; import com.kingston.jforgame.socket.annotation.MessageMeta; import com.kingston.jforgame.socket.actor.MailBox; import org.codehaus.jackson.annotate.JsonIgnoreProperties; @JsonIgnoreProperties(ignoreUnknown = true) public abstract class Message { /** * messageMeta, module of message * * @return */ public short getModule() { MessageMeta annotation = getClass().getAnnotation(MessageMeta.class); if (annotation != null) { return annotation.module(); } return 0; } /** * messageMeta, subType of module * * @return */ public byte getCmd() { MessageMeta annotation = getClass().getAnnotation(MessageMeta.class); if (annotation != null) { return annotation.cmd(); } return 0; } public MailBox mailQueue() { return null; } public String key() { return this.getModule() + "_" + this.getCmd(); } }
fdef53ba-f9a1-48be-aafc-ee542e2c2d61
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-30 19:32:12", "repo_name": "RadoslavEvgeniev/FluffyDuffyMunchkinCatsMVC", "sub_path": "/src/main/entities/Cat.java", "file_name": "Cat.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "5b899c40b8e6ba3e736ec09aadfac6d2160234c6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/RadoslavEvgeniev/FluffyDuffyMunchkinCatsMVC
278
FILENAME: Cat.java
0.249447
package entities; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; @Entity @Table(name = "cats") public class Cat { private String id; private String catName; private String catBreed; private String catColor; public Cat() { } @Id @GeneratedValue(generator = "UUID") @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") @Column(name = "id", nullable = false, unique = true) public String getId() { return this.id; } public void setId(String id) { this.id = id; } @Column(name = "cat_name") public String getCatName() { return this.catName; } public void setCatName(String catName) { this.catName = catName; } @Column(name = "cat_breed") public String getCatBreed() { return this.catBreed; } public void setCatBreed(String catBreed) { this.catBreed = catBreed; } @Column(name = "cat_color") public String getCatColor() { return this.catColor; } public void setCatColor(String catColor) { this.catColor = catColor; } }
8f936e7f-d279-4b3f-b39b-bd267b0754fa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-15 19:48:24", "repo_name": "netnook/repeg", "sub_path": "/src/test/java/net/netnook/repeg/examples/template/model/Text.java", "file_name": "Text.java", "file_ext": "java", "file_size_in_byte": 1141, "line_count": 70, "lang": "en", "doc_type": "code", "blob_id": "d2a20ab96ef272840daf3c0d5df66ad7cbaff4c2", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/netnook/repeg
349
FILENAME: Text.java
0.273574
package net.netnook.repeg.examples.template.model; import java.io.PrintWriter; public class Text extends Node { private String string; public Text(String string) { this.string = string; } @Override public void render(Context ctxt, PrintWriter out) { if (string != null) { out.print(string); } } @Override void preTrim(boolean trimStart, boolean trimEnd) { if (trimStart) { string = trimStart(string); } if (trimEnd) { string = trimEnd(string); } } private String trimStart(String in) { if (in == null) { return null; } int i = 0; for (; i < in.length(); i++) { if (!Character.isWhitespace(in.charAt(i))) { break; } } if (i == 0) { return in; } else if (i == in.length()) { return null; } else { return in.substring(i); } } private String trimEnd(String in) { if (in == null) { return null; } int i = in.length() - 1; for (; i >= 0; i--) { if (!Character.isWhitespace(in.charAt(i))) { break; } } if (i == in.length() - 1) { return in; } else if (i == -1) { return null; } else { return in.substring(0, i + 1); } } }
69a8f488-1a2b-4fb0-8516-bcab25dbe3d7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-08 13:42:26", "repo_name": "TienDungPham/smartfitapi", "sub_path": "/src/main/java/com/smartfit/smartfitapi/controller/MealController.java", "file_name": "MealController.java", "file_ext": "java", "file_size_in_byte": 1089, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "8206583bdc0cb19a858ffa132b536a30247914b8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/TienDungPham/smartfitapi
196
FILENAME: MealController.java
0.259826
package com.smartfit.smartfitapi.controller; import com.smartfit.smartfitapi.model.transfer.MealDTO; import com.smartfit.smartfitapi.service.MealService; import com.smartfit.smartfitapi.utils.ServiceResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import java.util.List; @Controller @RequestMapping(path = "/api/v1/meal") public class MealController { @Autowired private MealService mealService; @GetMapping(path = "/all") public ResponseEntity<List<MealDTO>> findAllCourse() { ServiceResult<List<MealDTO>> result = mealService.findAllMeals(); if (result.getCode() == ServiceResult.ResultCode.SUCCESS) { return new ResponseEntity<>(result.getData(), HttpStatus.OK); } return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } }
09d6299c-210f-4227-a462-f7955592ab9b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-29 09:05:47", "repo_name": "sahaanish26/httpserver", "sub_path": "/src/main/java/com/example/httpserver/http/HeadHttpResponse.java", "file_name": "HeadHttpResponse.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "1603e5057e9ae67f0119e3fc9cbbf08776426e30", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sahaanish26/httpserver
215
FILENAME: HeadHttpResponse.java
0.264358
package com.example.httpserver.http; //import com.example.httpserver.; import java.io.*; /** * HttpResponse extension that only writes headers. */ public class HeadHttpResponse extends FileHttpResponse { /** * File to be sent to the user. */ // private File inputFile; public HeadHttpResponse(int statusCode, File inputFile, String uri) { super(statusCode, inputFile, uri); } /** * This function writes the HTTP response to an output stream. * * @param out the target {@link OutputStream} for writing */ public void write(OutputStream out) { try { BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out)); writer.write(getResponseLine()); writer.write("\r\n"); for (String key: headers.keySet()) { writer.write(key + ":" + headers.get(key)); writer.write("\r\n"); } writer.write("\r\n"); writer.flush(); } catch (IOException e) { //Logger.error(TAG, e.getMessage()); } } }
8e415a71-dc2a-4adc-95f1-5b42ca5de8eb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-08-12 23:31:27", "repo_name": "kefencho/SpringBoot_TestDoubles", "sub_path": "/src/main/java/org/vectoritcgroup/test/model/Result.java", "file_name": "Result.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "96ef7cb954417db2a8c3601c6837031d1a2cb349", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kefencho/SpringBoot_TestDoubles
259
FILENAME: Result.java
0.252384
package org.vectoritcgroup.test.model; import java.io.Serializable; /** * Result domain object. * * @author Vector ITC Group */ public class Result implements Serializable { private static final long serialVersionUID = 415821454982304871L; private String code; private String message; public Result(String code, String message) { super(); this.code = code; this.message = message; } /** * Gets the code. * * @return {@link String} */ public final String getCode(){ return code; } /** * Sets the code * * @param code {@link String} */ public final void setCode( final String code){ this.code = code; } /** * Gets the message. * * @return {@link String} */ public final String getMessage(){ return message; } /** * Sets the message. * * @param message {@link String} */ public final void setMessage( final String message){ this.message = message; } }
41ee71c3-21e1-46f4-9514-1fb9b4427e1e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-01-05T04:40:14", "repo_name": "dream-lmc/resteasy", "sub_path": "/examples/fatjar-swagger/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1144, "line_count": 45, "lang": "en", "doc_type": "text", "blob_id": "d5eff409686f85bba143a35be7985bc3ea26dbd9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dream-lmc/resteasy
272
FILENAME: README.md
0.247987
Getting started with RESTEasy ============================= A step-by-step introduction to the RESTEasy framework. System Requirements: -------------------- - OpenJDK for Java 1.8 - Git - Maven 3.3.9 or higher Building the example project: ----------------------------- To download and unpack Swagger UI: mvn clean package When you run `mvn clean package` on the project, it will first download the Swagger-UI into the 'target' folder. Then, the 'dist' folder of the Swagger-UI project is copied into the /src/main/resources/swagger-ui folder of the project. When compiled, the swagger-ui folder will then appear in target/classes, and be accessible to your compiled and running fat JAR. To build the fat JAR and run some tests: mvn clean install To run: java -jar target/fatjar-swagger-1.0-SNAPSHOT.jar Hello World: http://localhost:8080/api/hello/World Swagger: http://localhost:8080/api/swagger.json Swagger UI: http://localhost:8080 References: ----------- - https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup-1.5
8671ac8f-c64e-44ed-9524-32fe180aacd1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-11 20:51:13", "repo_name": "tedldunn451/java-day-2", "sub_path": "/src/com/cooksys/Plane.java", "file_name": "Plane.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 67, "lang": "en", "doc_type": "code", "blob_id": "3479802265fb185ce36c255e8538bd93f9bd4ca9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tedldunn451/java-day-2
301
FILENAME: Plane.java
0.255344
package com.cooksys; public class Plane extends Vehicle { private String name; public Plane(Person driver, String engine) { super(); this.setDriver(driver); this.setEngine(engine); } @Override public void honk(String sound) { System.out.println(sound); } @Override public void move(Person Driver, int distance) { System.out.println(distance); } @Override public void stop () { System.out.println("Landed!"); } @Override public String toString() { return this.getEngine() + " " + this.getDriver().getName(); } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Plane other = (Plane) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; return true; } }
87dba6cb-3372-47f4-93e5-bf299d6771a8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-05 02:27:57", "repo_name": "wang-shun/transaction", "sub_path": "/background/info-bg/src/main/java/com/sinochem/crude/trade/values/DBValueSetAutoConfiguration.java", "file_name": "DBValueSetAutoConfiguration.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "ed4fc2ff184d3ce6e6a4a9199058aeee24f1036c", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/wang-shun/transaction
242
FILENAME: DBValueSetAutoConfiguration.java
0.274351
package com.sinochem.crude.trade.values; import com.sinochem.crude.trade.common.utils.ValueSetUtils; import com.sinochem.crude.trade.common.values.ValueSetManager; import com.sinochem.crude.trade.values.impl.DBValueSetManager; import javax.sql.DataSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.core.JdbcTemplate; /** * Created by GHuang on 2016/11/25. * 从数据库中载入值集的方法 */ @Configuration public class DBValueSetAutoConfiguration { @Bean(initMethod = "load", destroyMethod = "clean") @SuppressWarnings("SpringJavaAutowiringInspection") public ValueSetManager valueSetManager(JdbcTemplate jdbcTemplate, DBValueSetProperties properties) { DBValueSetManager dbValueSetManager = new DBValueSetManager(jdbcTemplate, properties); ValueSetUtils.init(dbValueSetManager); return dbValueSetManager; } @Bean public JdbcTemplate jdbcTemplate(DataSource dataSource) { JdbcTemplate template = new JdbcTemplate(); template.setDataSource(dataSource); return template; } }
5a36d600-b7fd-43d0-afb8-ab728289478e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-01-01T21:20:08", "repo_name": "matheusAle/iconns-xd-plugin", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1166, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "535e8ae22897a1bc6afab5dc43d051362240ffde", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/matheusAle/iconns-xd-plugin
288
FILENAME: README.md
0.23092
# iconns-xd-plugin Simple Adobe XD Plugin for insert icons in our Artwork. **This plugin stai in pre-beta version**. Increments is are comes. # Issues - The complex icons may end up not getting what you expected. - The color of the placed icon may be lost in the middle of the process. - **All icons is placed in native path element** - Only free icons of https://www.iconfinder.com is placed. - The search can be slow in some times. # How to Install Download the [instalation package](https://github.com/matheusAle/iconns-xd-plugin/blob/master/iconns.xdx) and make a double click over. *or, for developers:* Download repository content and extract in develop folder of your Adobe DX instalation. You cam easely find the in: `Adobe DX > Options > Plugins > Development > Show Develp Folder`. # Screens For search icons only type his name and press `Enter` key. ![menu screean](/menu.PNG "menu") To insert make a double click over the icon and wait the load, and `Voilà` the icon is placed! ![Search results](/results.PNG "menu") # PRs ARE WOLCOMES!!! ## The icons is provides through this webservice: https://github.com/matheusAle/iconns-ws
ec64113d-415b-49d8-a5b5-1dd96a526695
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-11 02:59:26", "repo_name": "firashamila33/Esprit4All_JAVA", "sub_path": "/src/technique/DataSource.java", "file_name": "DataSource.java", "file_ext": "java", "file_size_in_byte": 1144, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "f5e520cd33b81a31f8a6c7437cd9240f5ee5d30d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/firashamila33/Esprit4All_JAVA
252
FILENAME: DataSource.java
0.264358
/* * 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 technique; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; /** * * @author YACINE */ public class DataSource { // String url = "jdbc:mysql://localhost:3306/symfony_espritforal"; // String login = "root"; // String password = ""; String url = "jdbc:mysql://sql3.freemysqlhosting.net:3306/sql3214864"; String login = "sql3214864"; String password = "AsqS46bvbR"; private Connection connection; private static DataSource instance; private DataSource() { try { connection = DriverManager.getConnection(url, login, password); } catch (SQLException ex) { ex.printStackTrace(); } } public static DataSource getInstance() { if (instance == null) { instance = new DataSource(); } return instance; } public Connection getConnection() { return connection; } }
57553eec-7ec6-4f66-bc96-338e58dc72ad
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-17T08:16:50", "repo_name": "SkoogJacob/skoogjacob.github.io", "sub_path": "/_posts/2019-11-11-welcome-to-jekyll.markdown", "file_name": "2019-11-11-welcome-to-jekyll.markdown", "file_ext": "markdown", "file_size_in_byte": 1167, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "b9e23a01a3c7b299b72b64038ab5eea7f1142b05", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/SkoogJacob/skoogjacob.github.io
312
FILENAME: 2019-11-11-welcome-to-jekyll.markdown
0.23092
--- layout: post title: "Welcome to a Blog Thing!" date: 2019-11-11 01:35:06 -0600 categories: jekyll content-type: "post" summary: "My first blog on this jekyll site" --- Here's the first blog post for the site. This website is built using jekyll as a static site generator engine. Jekyll blog post files must be named according to a specific format (that being 'Year-MONTH-DAY-title.MARKUP'). This is my second try at making this stuff about static site generators and css pre-processors work. Last time I couldn't wrap my head around the file structure of the site and what to change and how to change it. I am determined to make that work out better this time though. This blog can also show neat code snippets: {% highlight javascript %} // Here we have some javascript 'use strict' let a = 10 console.log(a) {% endhighlight %} {% highlight java %} // Here we have some java int a = 10; System.out.println(a); {% endhighlight %} Check out the [Jekyll docs][jekyll-docs] for more info on the back-end of all of this. [jekyll-docs]: https://jekyllrb.com/docs/home [jekyll-gh]: https://github.com/jekyll/jekyll [jekyll-talk]: https://talk.jekyllrb.com/
96cba61b-cd53-423a-9d04-3ee53503930a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-06 10:03:10", "repo_name": "oracle-japan/oci-jaxrs-client", "sub_path": "/src/test/java/com/oracle/jp/se/mw/jaxrs/client/JaxRsClientFilterTestLooseSSL.java", "file_name": "JaxRsClientFilterTestLooseSSL.java", "file_ext": "java", "file_size_in_byte": 1108, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "676812aacacbcea7b5d8e5aad7e14107e7b1d0f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/oracle-japan/oci-jaxrs-client
211
FILENAME: JaxRsClientFilterTestLooseSSL.java
0.272799
package com.oracle.jp.se.mw.jaxrs.client; import java.io.FileInputStream; import java.util.Properties; import javax.ws.rs.client.Client; import javax.ws.rs.client.Invocation.Builder; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Response; /** * It's not a JUnit test * */ public class JaxRsClientFilterTestLooseSSL { public static void main(String[] args) throws Exception{ // expecting client.properties in the root folder Properties config = new Properties(); try(FileInputStream in = new FileInputStream("client.properties")){ config.load(in); } Client client = JaxRsClient.getLooseClient(); WebTarget target = client.target("https://localhost:7002/console"); Builder builder = target.request(); Response response = builder.get(); System.out.println("----------------------------------------"); System.out.println(response.getStatus() + " " + response.getStatusInfo()); System.out.println(response.readEntity(String.class)); client.close(); } }
a5b1a815-b357-441f-8b19-686ddf6f0ef1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-27 03:44:36", "repo_name": "weiyang-jiang/java_advance", "sub_path": "/web_02/web2/src/main/java/com/example/web2/ServletCookie2.java", "file_name": "ServletCookie2.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "e3548f33725d8200a6f78477cbf6371484035893", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/weiyang-jiang/java_advance
203
FILENAME: ServletCookie2.java
0.253861
package com.example.web2; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.annotation.*; import java.io.IOException; import java.util.Arrays; /* * @Author: Weiyang Jiang * @Date: 2021-09-20 10:25:12 */ @WebServlet("/cookieDemo2") public class ServletCookie2 extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setContentType("text/html;charset=UTF-8"); Cookie[] cookies = request.getCookies(); if (cookies != null){ for (Cookie cookie : cookies) { if (cookie.getName().equals("username")){ String value = cookie.getValue(); System.out.println(value); } } } } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
b437ed7d-1c97-4be3-9f22-c691d445ada0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-29T15:57:40", "repo_name": "ernestaskardzys/eventmonitor", "sub_path": "/src/main/java/info/ernestas/eventmonitor/service/VersionServiceImpl.java", "file_name": "VersionServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1143, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "5ba303d778cfcdb8821fad762e0c4969e3652b11", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ernestaskardzys/eventmonitor
211
FILENAME: VersionServiceImpl.java
0.256832
package info.ernestas.eventmonitor.service; import info.ernestas.eventmonitor.dao.VersionDao; import info.ernestas.eventmonitor.dao.entity.Version; import info.ernestas.eventmonitor.model.dto.VersionDto; import info.ernestas.eventmonitor.service.mapper.VersionVersionDtoMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service @Transactional public class VersionServiceImpl implements VersionService { private VersionDao versionDao; private VersionVersionDtoMapper versionVersionDtoMapper; @Autowired public VersionServiceImpl(VersionDao versionDao, VersionVersionDtoMapper versionVersionDtoMapper) { this.versionDao = versionDao; this.versionVersionDtoMapper = versionVersionDtoMapper; } @Cacheable("versionCache") @Override public VersionDto getVersionInformation() { Version version = versionDao.findVersion(); return versionVersionDtoMapper.convertEntityToDto(version); } }
f23b9014-bc8a-44b0-af94-6ab13e5c7b38
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-02-11T03:44:40", "repo_name": "andalike/angularstarter", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1098, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "50bfed517fe6779dc0ed9a81b442ae5c051a09a7", "star_events_count": 1, "fork_events_count": 3, "src_encoding": "UTF-8"}
https://github.com/andalike/angularstarter
306
FILENAME: README.md
0.262842
# Angularstarter This automated project was generated by boo. ## Run This Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. ## Code scaffolding Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. ## Build Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. ## Further help To get more help on the Angular CLI use `ng help` or contact Ankit, You know where to find Ankit. ## ## Lazy? Run the below in the same order 1 curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - 2 sudo apt-get install -y nodejs 3 mkdir ~/.npm-global 4 export PATH=~/.npm-global/bin:$PATH 5 source ~/.profile 6 npm config set prefix /usr/local 7 sudo chown -R $USER /usr/local 8 npm install -g @angular/cli 9 npm install -g pm2 10 pm2 start npm — start