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
42d8a244-7c59-421e-a493-33a5034fd243
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-01 17:09:45", "repo_name": "AlexHarlamov/icg_wireframe", "sub_path": "/fit.nsu.ru.g17209.kharlamov/java/app/ApplicationDescription.java", "file_name": "ApplicationDescription.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "e4bdf7dae6d4e98d8aed4cdec0513fad2a7c0752", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AlexHarlamov/icg_wireframe
201
FILENAME: ApplicationDescription.java
0.278257
package app; import javax.swing.*; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; /** * Class ApplicationDescription provides all the necessary elements to organize simple description */ public class ApplicationDescription { /** * Path to the description file */ private String descriptionFilePath = "src/files/about.txt"; /** * Description text */ private String description; /** * Menu item for the menu bar */ private JMenuItem menuItem; /** * Frame for the popup window */ private JFrame parentFrame = new JFrame(); public ApplicationDescription(){ try{ description = new String (Files.readAllBytes(Paths.get(descriptionFilePath))); }catch (IOException e){ description = "Description file not available"; } menuItem = new JMenuItem("About app"); menuItem.addActionListener(e -> JOptionPane.showMessageDialog(parentFrame, description)); } public JMenuItem getMenuItem() { return menuItem; } }
16f2d591-7eff-4e22-93a4-9401057c88f6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-01-23T13:38:06", "repo_name": "smylar/sky-bet", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1181, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "6cf202fc230d7acd6ffb99029d6ae2af9432a771", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/smylar/sky-bet
255
FILENAME: README.md
0.285372
# sky-bet Response to exercise This is a fully functioning API utilizing Spring Boot JPA, compiled on Java 11. When started (com.skyb.Application is the main class) it will start on localhost:3050. Note, endpoints in the /control/** path a protected by Basic Auth - see application.properties, hopefully you have something like postman to test the endpoints. The database behind it is h2, so you shouldn't need to install anything. The database is created from the init.sql script in resources, though the structure is fairly flat at the moment to expedite things. The demo deals solely with placing a bet and controlling the game, it doesn't try to check if someone has enough funds etc. The setup should allow for any number of bets to be made by a customer against a game. The com.skyb.entity.Bet enumeration should in theory be the only thing that needs adjusting to add more bets etc. Hopefully by looking at the controllers (RouletteController and RouletteAdminController) it should be clear what endpoints are available. I did also include the swagger UI for the endpoints on the /public/** path. This can be found at http://localhost:3050/sky-bet/swagger-ui.html
a22d64f8-7276-40a0-936d-6d3a7eb8c5fa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-24 16:31:51", "repo_name": "jsgalaska/HaikuFinder", "sub_path": "/src/Word.java", "file_name": "Word.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "8f950e0979965f7e6857eea161280cbdb8a4782f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jsgalaska/HaikuFinder
324
FILENAME: Word.java
0.295027
public class Word { private String word; private int syllables; private char previousVowel; private int currentPOS; private boolean vowelFound; public Word(String _word){ word = _word; calcSyllables(); } public int getSyllables(){ return syllables; } public String toString(){ return word+" "; } //calculates number of syllables in word based on vowels private void calcSyllables(){ vowelFound=false; for(int i=0; i<word.length(); i++){ currentPOS = i; if(isVowel(word.charAt(i))&&vowelFound==false){ if(i==(word.length()-1)&&word.charAt(i)=='e'){ vowelFound = false; }else{ vowelFound = true; syllables++; } }else{ vowelFound=false; } } } //checks to see if string ends with e. returns true if it does, false if not private boolean endsWithE(String word){ if(word.charAt(word.length()-1)=='e'){ return true; } return false; } //checks if char is a vowel private boolean isVowel(char c){ if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y'){ previousVowel = c; return true; } return false; } }
d1367c6e-adb4-476a-a5fc-70e977415dbb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-07 17:45:51", "repo_name": "mike2flee/takeHomeService", "sub_path": "/src/main/java/com/gm/takeHomeService/model/ClientInstancePojo.java", "file_name": "ClientInstancePojo.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "008a52b6d69a772d1b05c826cd34003d8363dc61", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mike2flee/takeHomeService
295
FILENAME: ClientInstancePojo.java
0.262842
package com.gm.takeHomeService.model; import com.opencsv.bean.CsvBindByPosition; import lombok.*; import javax.persistence.*; @Data @NoArgsConstructor @AllArgsConstructor @Entity @Table(name = "clients") @ToString public class ClientInstancePojo { @Id @GeneratedValue(strategy = GenerationType.AUTO) private String id; @Column(name = "Date") @CsvBindByPosition(position = 0) private String date; @Column(name = "Client") @CsvBindByPosition(position = 1) private String client; @Column(name = "Project") @CsvBindByPosition(position = 2) private String project; @Column(name = "Project Code") @CsvBindByPosition(position = 3) private String projectCode; @Column(name = "Hours") @CsvBindByPosition(position = 4) private String hours; @Column(name = "Billable?") @CsvBindByPosition(position = 5) private String isBillable; @Column(name = "First Name") @CsvBindByPosition(position = 6) private String firstName; @Column(name = "Last Name") @CsvBindByPosition(position = 7) private String lastName; @Column(name = "Billing Rate") @CsvBindByPosition(position = 8) private String billingRate; }
15a63813-9205-4d21-9497-c4ea72434003
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-19 11:55:56", "repo_name": "GHLJH/HelpChild", "sub_path": "/app/src/main/java/com/le/help_child/activity/OpenLocalMapUtil.java", "file_name": "OpenLocalMapUtil.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "5647359037118cea96a43728854119592a48a05a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/GHLJH/HelpChild
428
FILENAME: OpenLocalMapUtil.java
0.259826
package com.le.help_child.activity; /** * 描述:打开手机已安装地图相关工具类 */ public class OpenLocalMapUtil { //from=&to=116.3246,39.966577,endpoint&via=&mode=car public static String getWebGaoDeMapUri( String sLon, String sLat,String dLon, String dLat) { // http://m.amap.com/navi/?start=116.403124,39.940693&dest=116.481488,39.990464&destName=阜通西&naviBy=car&key=您的Key // String uri = "http://m.amap.com/navi/?start="+sLon+","+sLat // + "&dest=" + dLon + "," + dLat + "&destName=孩子位置&naviBy=car&key=3f37e6f1e695c5d718dd3619e19cf25a"; // 此方式的公共交通不友好 放弃 // http://uri.amap.com/navigation?from=116.478346,39.997361,我的位置&to=116.3246,39.966577 // ,孩子位置&via=&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=1 // String uri ="http://uri.amap.com/navigation?from=" + sLon + "," + sLat + ",我的位置&to=" + dLon + "," + dLat + ",孩子位置&via=&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=1"; return String.format(uri); } }
1891c332-356e-4d03-b2e9-0d2291cd5d4f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-04 20:37:09", "repo_name": "wibawabangkit/Aplikasi-Penyewaan-Sqooter-Listrik", "sub_path": "/app/src/main/java/com/bangkit/go_pedwheels/Activities/user/KonfirmasiActivity.java", "file_name": "KonfirmasiActivity.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "32ebb3b8184875e33cbbcb7c9ef82f73b631fc03", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wibawabangkit/Aplikasi-Penyewaan-Sqooter-Listrik
192
FILENAME: KonfirmasiActivity.java
0.185947
package com.bangkit.go_pedwheels.Activities.user; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import com.bangkit.go_pedwheels.R; public class KonfirmasiActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_konfirmasi); Button back = findViewById(R.id.backhome); Button upload = findViewById(R.id.upload); back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(getApplicationContext(), MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)); } }); upload.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(getApplicationContext(), WA_Activity.class).setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)); } }); } }
d21c86b9-355e-4201-aafe-247c9c4235b0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-27T16:18:41", "repo_name": "Thanoskaloudis/travel-app", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1233, "line_count": 46, "lang": "en", "doc_type": "text", "blob_id": "1d3ab9f1305b652873d0dd728c52301f0affc66b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Thanoskaloudis/travel-app
323
FILENAME: README.md
0.290981
# Travel App This project aims to build a web app that allows users to create trip plans. When a user submit a city name with trip date, the web page then dispalys destination with its photo and 3-day weather forecast returned from external APIs. ([GeoNames API](http://www.geonames.org/), [OpenWeather](https://openweathermap.org/), [pixabay](https://pixabay.com/api/docs/#)) ## Installation 1. Install npm packages ``` npm install ``` 2. Sign up for API keys at: * [GeoNames API](http://www.geonames.org/) * [OpenWeather](https://openweathermap.org/) * [pixabay](https://pixabay.com/api/docs/#) 3. Configure environment variables using dotenv package: 1. Install the dotenv package ``` npm install dotenv ``` 2. Create a new `.env` file in the root of your project 3. Fill the `.env` file with your API keys like this: ``` GUSERNAME=************************** WAPIKEY=************************** PAPIKEY=************************** ``` 4. Start project Command | Action :------------: | :-------------: `npm run build-prod` | Build project `npm start` | Run project 5. Open browser at http://localhost:8081/ ## Building Tools * HTML * CSS (SCSS) * JavaScript * Node * Express * Webpack * Jest (Unit test) * Workbox
af79e37b-02e0-4b2d-913b-edf5cbb49f4e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-13 09:01:25", "repo_name": "lcword/order", "sub_path": "/src/main/java/com/hxzy/order/controller/KindController.java", "file_name": "KindController.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "1ba156f0271b124d85eb50943266662719edd16a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lcword/order
202
FILENAME: KindController.java
0.250913
package com.hxzy.order.controller; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.hxzy.order.model.Kind; import com.hxzy.order.service.intf.KindService; @Controller public class KindController { @Autowired private KindService kindService; @RequestMapping("pre_add_kind") public String pre_add() { return "update_kind"; } @RequestMapping("pre_update_kind") public String pre_update(Kind kind,Map<String,Object> map) { map.put("kind", kindService.queryById(kind.getId())); return "update_kind"; } @RequestMapping("update_kind") public String update(Kind kind,String functionId) { kindService.update(kind); return "redirect:query_kind"; } @RequestMapping("delete_kind") public String delete(String id) { kindService.delete(id); return "redirect:query_kind"; } }
befcc9e2-9ca0-4642-ba2d-b1668212470f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-29 07:09:07", "repo_name": "CarloMicieli/spring-trains", "sub_path": "/webapi/src/main/java/io/github/carlomicieli/web/representation/CatalogItemRepresentation.java", "file_name": "CatalogItemRepresentation.java", "file_ext": "java", "file_size_in_byte": 585, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "3c23000106e6eadc626d660c192940b5b0034244", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/CarloMicieli/spring-trains
250
FILENAME: CatalogItemRepresentation.java
0.245085
/* Copyright 2020 (C) Carlo Micieli 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 io.github.carlomicieli.web.representation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import io.github.carlomicieli.catalogItems.CatalogItem; import org.springframework.hateoas.RepresentationModel; public class CatalogItemRepresentation extends RepresentationModel<CatalogItemRepresentation> { private final CatalogItem data; @JsonCreator public CatalogItemRepresentation(@JsonProperty("data") CatalogItem data) { this.data = data; } public CatalogItem getCatalogItem() { return data; } }
04ad9bf9-7f35-4ac9-b2de-9e9e6f186953
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-01-21T07:02:20", "repo_name": "DoubleDoorDevelopment/ForgeSubWhitelist", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1019, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "d33fc0d08e1dbeed6d9633b3ac7325ea3add7dd3", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/DoubleDoorDevelopment/ForgeSubWhitelist
254
FILENAME: README.md
0.210766
# THIS PROJECT HAS BEEN REPLACED BY https://github.com/MCLink-Modding/MCLink # DO NOT USE THIS! <details><summary>Old Info</summary> <p> ForgeSubWhitelist ================= Forge Whitelist mod for Twitch, GameWisp, Beam, Patreon, ... Currently stable: Twitch <br/> Currently in beta: GameWisp & Beam. <br/> If you want to use beta services, please tell us! <br/> For players ----------- [Go to this website and follow the instructions.](http://doubledoordev.net/?p=linking) For (future) server owners -------------------------- 1. Install the mod on the server. Its useless on the client, but you can put it in packs safely. 2. Follow the instructions for players. 3. Get the API token by typing `apitoken` into the auth server, copy the token. (You can click it, then copy it out of the chat box) 4. Put the token in your config, along with the configuration of what service to use. For developers -------------- If you want to make a plugin for other server software, please message us! </p> </details>
7c6674aa-2616-486e-b8ab-010a34a4a38e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-15 04:22:06", "repo_name": "East196/playground", "sub_path": "/spring/cloud/consul-consumer/src/main/java/com/github/east196/playground/springcloud/consulconsumer/FeignConfig.java", "file_name": "FeignConfig.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "5cbe1de1dc1a2aacccef170eb7e4ff3c8aed851c", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/East196/playground
262
FILENAME: FeignConfig.java
0.273574
package com.github.east196.playground.springcloud.consulconsumer; import io.github.resilience4j.circuitbreaker.CircuitBreaker; import io.github.resilience4j.feign.FeignDecorators; import io.github.resilience4j.feign.Resilience4jFeign; import io.github.resilience4j.ratelimiter.RateLimiter; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Scope; @Configuration public class FeignConfig { @Bean @Scope("prototype") @ConditionalOnMissingBean public Resilience4jFeign.Builder feignResilience4jBuilder() { CircuitBreaker circuitBreaker = CircuitBreaker.ofDefaults("backendName"); RateLimiter rateLimiter = RateLimiter.ofDefaults("backendName"); FeignDecorators decorators = FeignDecorators.builder() .withRateLimiter(rateLimiter) .withCircuitBreaker(circuitBreaker) .withFallback(new CallClientBack(), Exception.class) .build(); return Resilience4jFeign.builder(decorators); } }
79740f14-0cd4-4f2e-9297-1a1af8ef9ca6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-17 11:36:05", "repo_name": "MinNanR/rental", "sub_path": "/rental-tenant/src/test/java/InitCityTest.java", "file_name": "InitCityTest.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "17c2bcdbbe74965fd3ca1fc530268d5dd14929ac", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MinNanR/rental
226
FILENAME: InitCityTest.java
0.228156
import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import site.minnan.rental.TenantApplication; import site.minnan.rental.infrastructure.utils.RedisUtil; @SpringBootTest(classes = TenantApplication.class) public class InitCityTest { @Autowired private RedisUtil redisUtil; @Test public void initCity() { // CsvReader reader = CsvUtil.getReader(); // CsvData data = reader.read(FileUtil.file("result.csv")); // Iterator<CsvRow> iterator = data.iterator(); // iterator.next(); // while (iterator.hasNext()) { // CsvRow row = iterator.next(); // String code = row.get(0); // String province = row.get(1); // String sub = row.get(2); // if("".equals(sub)){ // sub = row.get(3); // } // ArrayList<String> value = CollectionUtil.newArrayList(province, sub); // redisUtil.hashPut("region", code, value); // } } }
e3ae3094-bb49-4e74-b091-b761675a2653
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-28 00:29:17", "repo_name": "assisjrs/crud-basico-java", "sub_path": "/src/test/java/com/assisjrs/crudjava/configuration/SqlEmbeddedTest.java", "file_name": "SqlEmbeddedTest.java", "file_ext": "java", "file_size_in_byte": 1013, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "6a94822a170dfadf9ed5237be06570a573f3c95d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/assisjrs/crud-basico-java
188
FILENAME: SqlEmbeddedTest.java
0.255344
package com.assisjrs.crudjava.configuration; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.jdbc.core.JdbcTemplate; import javax.persistence.EntityManager; import javax.persistence.Query; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @SpringBootTest public class SqlEmbeddedTest { @Autowired private EntityManager entityManager; @Autowired private JdbcTemplate template; @Test void deve_iniciar_o_sql_embedded() { final Query query = entityManager.createNativeQuery("SELECT count(*) FROM INFORMATION_SCHEMA.SYSTEM_TABLES;"); assertThat(query.getSingleResult()).isNotNull(); } @Test public void deve_carregar_flyway() { assertThat(template.queryForObject("select count(*) > -1 from \"flyway_schema_history\";", Boolean.class), is(true)); } }
90a2d59c-5fff-41fc-837a-12812d0d6dbb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-23 14:23:10", "repo_name": "soghao/zgyh", "sub_path": "/bocbiiclient/src/main/java/com/boc/bocsoft/mobile/bii/bus/global/model/PsnGetSecurityFactor/PsnGetSecurityFactorResult.java", "file_name": "PsnGetSecurityFactorResult.java", "file_ext": "java", "file_size_in_byte": 1416, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "6404843c21d80ebb721b89494df1b02f15940195", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/soghao/zgyh
402
FILENAME: PsnGetSecurityFactorResult.java
0.242206
package com.boc.bocsoft.mobile.bii.bus.global.model.PsnGetSecurityFactor; import java.util.List; /** * Created by feibin on 2016/6/16. * 安全因子结果Model */ public class PsnGetSecurityFactorResult { /** * 客户默认的安全因子组合 name:安全因子名称 id: 安全因子id * 0:虚拟 4:USBKey证书 8:动态口令令牌 32:短信认证码 40:动态口令令牌+短信认证码 96:短信认证码+硬件绑定 */ private CombinListBean _defaultCombin; /** * 客户默认的安全因子组合 name:安全因子名称 id: 安全因子id * 0:虚拟 4:USBKey证书 8:动态口令令牌 32:短信认证码 40:动态口令令牌+短信认证码 96:短信认证码+硬件绑定 */ private List<CombinListBean> _combinList; public List<CombinListBean> get_combinList() { return _combinList; } public void set_combinList(List<CombinListBean> _combinList) { this._combinList = _combinList; } public CombinListBean get_defaultCombin() { return _defaultCombin; } public void set_defaultCombin(CombinListBean _defaultCombin) { this._defaultCombin = _defaultCombin; } @Override public String toString() { return "PsnGetSecurityFactorResult{" + "_defaultCombin=" + _defaultCombin + ", _combinList=" + _combinList + '}'; } }
38137d17-f106-492d-a050-1379cde457ec
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-21 09:23:46", "repo_name": "cilys/Lottery", "sub_path": "/src/main/java/com/cilys/lottery/web/interceptor/LogInterceptor.java", "file_name": "LogInterceptor.java", "file_ext": "java", "file_size_in_byte": 1103, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "920c10a22ac879b0859d6f6d2e7df2fe49659655", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cilys/Lottery
239
FILENAME: LogInterceptor.java
0.264358
package com.cilys.lottery.web.interceptor; import com.cily.utils.base.StrUtils; import com.cilys.lottery.web.log.LogUtils; import com.cilys.lottery.web.utils.ParamUtils; import com.jfinal.aop.Invocation; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.logging.Logger; /** * Created by admin on 2018/2/6. */ public class LogInterceptor extends BaseInterceptor { @Override public void intercept(Invocation inv) { Map<String, Object> map = new HashMap<>(); Enumeration<String> names = inv.getController().getParaNames(); while (names.hasMoreElements()){ String name = names.nextElement(); map.put(name, inv.getController().getPara(name)); } String actionUrl = inv.getActionKey(); System.err.println("请求路径:" + actionUrl); if (StrUtils.isEmpty(actionUrl) || actionUrl.equals("/")){ }else { LogUtils.info(this.getClass().getSimpleName(), null, actionUrl, ParamUtils.string(map), getUserId(inv)); } inv.invoke(); } }
9fb3f524-e240-4a49-81d9-2b010c8c4c87
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-14 16:33:33", "repo_name": "AlexGT/SimpleSeleniumTest", "sub_path": "/src/simpleseleniumtest/SimpleSeleniumTest.java", "file_name": "SimpleSeleniumTest.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "23ea550689cbb4997592151a83ac93585ad7401b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/AlexGT/SimpleSeleniumTest
230
FILENAME: SimpleSeleniumTest.java
0.273574
/* * 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 simpleseleniumtest; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; /** * * @author alexb */ public class SimpleSeleniumTest { public static void main(String[] args) throws InterruptedException { WebDriver driver; driver = new FirefoxDriver(); driver.manage().timeouts().implicitlyWait(4, TimeUnit.SECONDS); driver.get("http://google.com.ua"); driver.findElement(By.name("q")) .sendKeys("Simple Selenium Test"); driver.findElement(By.name("btnG")) .click(); String link = driver.findElement(By.partialLinkText("Creating and running a simple")) .getAttribute("href"); driver.get(link); String header = driver.findElement(By.cssSelector("h1")) .getText(); driver.close(); System.out.println(link); System.out.println(header); } }
9c206feb-68e0-4fb8-bedf-9342123c01a4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-16 01:42:03", "repo_name": "DaeAkin/HomeDoc", "sub_path": "/HomeDoc/src/main/java/com/www/homedoc/test/TempTest.java", "file_name": "TempTest.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "2eb052eeffadfe14f6111171873e383c9030f466", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/DaeAkin/HomeDoc
269
FILENAME: TempTest.java
0.290981
package com.www.homedoc.test; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import org.apache.commons.codec.Decoder; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Hex; import org.apache.commons.codec.digest.DigestUtils; import org.junit.Test; public class TempTest { @Test public void sHATest() throws DecoderException { String testString = "1q2w3e4r"; String pw = "1q2w3e4r"; System.out.println("testString : " + testString); System.out.println("pw : " + pw); String encodedString = DigestUtils.sha256Hex(testString); String encodedPw = DigestUtils.sha256Hex(pw); System.out.println("sha256Hex : " + encodedString); System.out.println("pw : " + encodedPw); Hex hex = new Hex(); // String edcodedString = (Strinhex.decode(encodedString); Decoder decoder = new Hex(); System.out.println(decoder.decode(encodedString).toString()); assertThat(encodedString, is(encodedPw)); } }
8bdfd737-6c10-4452-9586-b10a3f3c1d04
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-30 13:12:48", "repo_name": "eikhyeonchoi/bitcamp-java-2018-12", "sub_path": "/java-basic/src/main/java/ch23/c/pClient.java", "file_name": "pClient.java", "file_ext": "java", "file_size_in_byte": 1102, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "aa9935126b273237f1ba7323d327c2eb7e890c1b", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"}
https://github.com/eikhyeonchoi/bitcamp-java-2018-12
224
FILENAME: pClient.java
0.250913
package ch23.c; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintStream; import java.net.Socket; import java.util.Scanner; public class pClient { public static void main(String[] args) { try (Socket socket = new Socket("localhost", 8558); PrintStream out = new PrintStream(socket.getOutputStream()); BufferedReader in = new BufferedReader( new InputStreamReader(socket.getInputStream())); Scanner keyboard = new Scanner(System.in); ){ System.out.println("client : 서버에 연결 완료 ..."); while(true) { String input = in.readLine(); System.out.println(input); if(input.length() == 0 ) break; // 빈줄 받기 } while (true) { System.out.print("> "); String input = keyboard.nextLine(); out.println(input); out.flush(); String response = in.readLine(); System.out.println(response); if(input.equalsIgnoreCase("quit")) break; } } catch (Exception e) { e.printStackTrace(); } } }
b7bce80f-dce4-4e17-8c18-73b827dc68dd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-11 15:23:00", "repo_name": "anktjsh/Chess", "sub_path": "/src/main/java/app/chess/core/Move.java", "file_name": "Move.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 69, "lang": "en", "doc_type": "code", "blob_id": "6e4b0c6b473a19c1fa67bc3b763c5873d0bc39cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/anktjsh/Chess
301
FILENAME: Move.java
0.268941
/* * 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 app.chess.core; /** * * @author aniket */ public class Move { private final Piece piece; private final int prevx, prevy, finx, finy; private final Piece capture; public Move(Piece pi, int a, int b, int c, int d, Piece pe) { piece = pi; prevx = a; prevy = b; finx = c; finy = d; capture = pe; } /** * @return the piece */ public Piece getPiece() { return piece; } /** * @return the prevx */ public int getPrevx() { return prevx; } /** * @return the prevy */ public int getPrevy() { return prevy; } /** * @return the finx */ public int getFinx() { return finx; } /** * @return the finy */ public int getFiny() { return finy; } /** * @return the capture */ public Piece getCapture() { return capture; } }
d6bcc474-d546-4ebe-ad0e-3ef20eabaab8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-02 10:06:20", "repo_name": "haenyilee/springStudy", "sub_path": "/20201113-JSONProject/src/main/java/com/haeni/web/MusicController.java", "file_name": "MusicController.java", "file_ext": "java", "file_size_in_byte": 975, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "61ee1215df5f0e86f58d999cfcb5c8b44ac89443", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/haenyilee/springStudy
241
FILENAME: MusicController.java
0.295027
package com.haeni.web; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import com.haeni.dao.MusicDAO; import com.haeni.dao.MusicVO; import java.util.*; @Controller public class MusicController { @Autowired private MusicDAO dao; // get방식 => @GetMapping("music/list.do") public String music_list(String page,Model model) { if(page==null) page="1"; int curpage=Integer.parseInt(page); Map map = new HashMap(); int rowSize=10; int start=rowSize*(curpage-1)+1; int end=rowSize*curpage; map.put("start", start); map.put("end", end); List<MusicVO> list = dao.musicListData(map); int totalpage= dao.musicTotalPage(); // 전송 model.addAttribute("list",list); model.addAttribute("curpage",curpage); model.addAttribute("totalpage",totalpage); return "music/list"; } }
31b245ae-29cd-451a-b08b-ab0368e16c16
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-04 00:07:25", "repo_name": "lucashabreu22/base_project_selenium", "sub_path": "/src/test/java/page/GooglePage.java", "file_name": "GooglePage.java", "file_ext": "java", "file_size_in_byte": 1085, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "f83acb1ab7df0002bcea15e83ac84587ae9ee7c8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lucashabreu22/base_project_selenium
246
FILENAME: GooglePage.java
0.281406
package page; import core.BasePage; import io.cucumber.java.en.And; import io.cucumber.java.en.Given; import io.cucumber.java.en.When; import maps.GooglePageMaps; import util.EvidenceManager; import static util.EvidenceManager.EvidenceGenerate; public class GooglePage extends BasePage { public GooglePageMaps googlePageMaps; public GooglePage(){ googlePageMaps = new GooglePageMaps(); } @Given("go to Google") public void acessarGoogle() throws Exception { navigate("https://www.google.com/"); EvidenceGenerate("Tela inicial google"); } @When("search {string}") public void buscarNoGoogle(String valorBusca) throws Exception { sendKeys(googlePageMaps.buscaGoogle, valorBusca); Thread.sleep(500); click(googlePageMaps.pesquisaGoogle); EvidenceManager.EvidenceGenerate("Busca realizada"); } @And("click on first link") public void acessarItemBusca() throws Exception { waitElement(googlePageMaps.primeiroLink, SMALL); click(googlePageMaps.primeiroLink); } }
203c4ec9-a5e7-47a7-b6ee-9c78cb28c82d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-24 01:22:45", "repo_name": "Sanya912/MyOwnPractice", "sub_path": "/FromGit/selenium-page-object-model-example-master/src/java/com/ernesttech/example/selenium/test/HomePageTest.java", "file_name": "HomePageTest.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "c632a9b6d9d208afded44a5214f4d994f299d93b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Sanya912/MyOwnPractice
235
FILENAME: HomePageTest.java
0.261331
package com.ernesttech.example.selenium.test; import com.ernesttech.example.selenium.page.HomePage; import org.openqa.selenium.WebDriver; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; public class HomePageTest extends AbstractPageTest { private HomePage homePage; public HomePageTest(final WebDriver webDriver, HomePage pageModel) { super(webDriver, pageModel); this.homePage = pageModel; } @Override public void executeTests() { checkDeveloperJobsTitle(); checkQuestionsTabTitle(); checkTagsTabTitle(); checkUsersTabTitle(); } private void checkDeveloperJobsTitle() { assertThat(homePage.getNavBarDeveloperJobsButton().getText(), is("Developer Jobs")); } private void checkQuestionsTabTitle() { assertThat(homePage.getNavBarQuestionsButton().getText(), is("Questions")); } private void checkTagsTabTitle() { assertThat(homePage.getNavBarTagsButton().getText(), is("Tags")); } private void checkUsersTabTitle() { assertThat(homePage.getNavBarUsersButton().getText(), is("Users")); } }
2988a2c8-358b-4194-94a1-2b4bccd6fbbd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-26 05:28:14", "repo_name": "trantan97/ViewPagerEx", "sub_path": "/app/src/main/java/com/trantan/viewpagerex/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "d97cfba452cb00d4ced7306134206e8191e724da", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/trantan97/ViewPagerEx
176
FILENAME: MainActivity.java
0.258326
package com.trantan.viewpagerex; import android.os.Bundle; import android.support.design.widget.TabLayout; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import com.trantan.viewpagerex.adapter.ViewPagerAdapter; public class MainActivity extends AppCompatActivity { private TabLayout mTabLayout; private ViewPager mViewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTabLayout = findViewById(R.id.tabs); mViewPager = findViewById(R.id.view_pager); ViewPagerAdapter viewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager()); mViewPager.setAdapter(viewPagerAdapter); mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(mTabLayout)); mTabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager)); } }
1353cd44-198f-4e08-bc32-7a7e64bf5ebd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-29 12:22:59", "repo_name": "wafiyR/java-tcp-programming", "sub_path": "/DateClient.java", "file_name": "DateClient.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "9efdff1be3bc414146468929cdb42ffd546d5eb3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/wafiyR/java-tcp-programming
254
FILENAME: DateClient.java
0.281406
import java.io.IOException; import java.net.Socket; import java.net.UnknownHostException; import java.util.Scanner; /** * This program demonstrate the TCP client * * @author emalianakasmuri * */ public class DateClient { public static void main(String[] args) { Socket socket = null; try { // Create object and connect to the server that runs on local host socket = new Socket("127.0.0.1", 59091); // Read response from the server Scanner in = new Scanner(socket.getInputStream()); // Display response from the server System.out.println("Server response: " + in.nextLine()); } catch (Exception e) { System.out.println("Durian Tunggal... we got problem"); e.printStackTrace(); } finally { try { if (socket != null) socket.close(); } catch (Exception e) { System.out.println("Durian Tunggal... we got problem"); e.printStackTrace(); } System.out.println("End of request"); } } }
03a157ad-f33c-4fdd-8ecb-add610eee19a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-21 08:47:13", "repo_name": "duggankimani/IConserv", "sub_path": "/src/com/wira/pmgt/client/ui/programs/tree/ProgramItem.java", "file_name": "ProgramItem.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "a4b39726b7fc6c83425a5c8910f16a625284950e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/duggankimani/IConserv
249
FILENAME: ProgramItem.java
0.282988
package com.wira.pmgt.client.ui.programs.tree; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.user.client.ui.TreeItem; import com.wira.pmgt.client.ui.events.MoveTargetSelectedEvent; import com.wira.pmgt.client.util.AppContext; import com.wira.pmgt.shared.model.ProgramDetailType; import com.wira.pmgt.shared.model.program.ProgramTreeModel; public class ProgramItem extends TreeItem{ private ProgramTreeModel model; ProgramItemView item; public ProgramItem(ProgramTreeModel model) { this.model = model; item = new ProgramItemView(model); setWidget(item); item.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { AppContext.fireEvent(new MoveTargetSelectedEvent(ProgramItem.this,event.getValue())); } }); } public void enableMoveFor(ProgramDetailType typeToMove) { item.enableMoveFor(typeToMove); } public void setItemSelected(boolean selected) { item.setSelected(selected); } public ProgramTreeModel getModel() { return model; } }
ee659d7a-347b-4147-a330-0b03ed55c5ae
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-02-12 05:34:24", "repo_name": "makhongazimbi/kalahari", "sub_path": "/src/java/com/code83/utils/messages/GoodBye.java", "file_name": "GoodBye.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "cf53736a730122f4f24e44fedd4a658ec7ca5169", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/makhongazimbi/kalahari
294
FILENAME: GoodBye.java
0.27513
package com.code83.utils.messages; /** * GoodBye message that is sent by a nomad intending to leave * the network. * * @author Makho Ngazimbi <makho.ngazimbi@gmail.com> * @version $Id: GoodBye.java 883 2012-09-11 22:31:48Z mngazimb $ * @since 0.1 * @see Message, {@link DefaultMessage} * */ public class GoodBye extends Message<String> { /** * Serial version UID. */ private static final long serialVersionUID = 6663226655538161691L; /** * Messgae payload. */ private static final String payload = "GOOD_BYE"; /** * Get the payload. * @return Goodbye message. */ @Override public String getPayload () { return GoodBye.payload; } /** * Set the payload. This method does nothing. * @param load Payload */ @Override public void setPayload (String load) { } /** * Get the string representation of this message. * @return Goodbye message */ public String toString () { return GoodBye.payload; } }
93ea672a-1be7-4818-8260-bc7309370579
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-02-15T18:43:01", "repo_name": "jonesca/Development", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1180, "line_count": 43, "lang": "en", "doc_type": "text", "blob_id": "41388816af2f026718861624ae7dbb0c217859c9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jonesca/Development
325
FILENAME: README.md
0.281406
# ASP.NET - Ctrl-K Ctrl-D this key combination in Visual Studio will do some formatting for you <b><i><u>Strongly Typed</u></i></b> means the type of object is known and available. For example a string is strongly typed when you declare it like so: ```javascript string someString = "abc"; ``` For e.g you cannot Multiply or Divide two different types i.e String vs Integer ```javascript var answer = 1 * "1"; // you cannot do this ``` You have to explicity cast it, this is known as strongly typed ```html <img src="images/CJones_Avatar.png" width=100> ``` ## PS Ripper 1. Create folder 2. git clone http://github.com/hmqcnoesy/psripper 3. Open PSRipper.sln in Visual Studio 4. Build the solution a. Must have Fiddler installed b. Must have the Plural Sight Offline player installed c. Download The course you want in offline Plural Sight player d. Install Handbrake 5. Open Fiddler 6. Open the Offline Player 7. Download the course in the Offline Player 8. Select the PS Ripper tab 9. Click Reload 10. Select the course you want 11. Choose your location and click Save 12. Open the location 13. Run the PowerShell script to convert to MP4 14. Delete WMV files
09c7a409-fea8-42e7-b564-bd63a34bd073
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-28 08:33:38", "repo_name": "429300625/MyFirst", "sub_path": "/app/src/main/java/com/example/administrator/myfirstapp/adapter/MyPagerAdapter.java", "file_name": "MyPagerAdapter.java", "file_ext": "java", "file_size_in_byte": 1236, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "9d06b1e42efb6e8fd914b226876d4acd5ba84cfc", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/429300625/MyFirst
258
FILENAME: MyPagerAdapter.java
0.279042
package com.example.administrator.myfirstapp.adapter; import android.content.Context; import android.support.v4.view.PagerAdapter; import android.view.View; import android.view.ViewGroup; import java.util.ArrayList; /** * Created by Administrator on 2016/9/2 0002. */ public class MyPagerAdapter extends PagerAdapter { private Context context; private ArrayList<View> arrList = new ArrayList<View>();//存储类型为view public MyPagerAdapter(Context context) { super(); this.context = context; } //添加页面 public void addToMyadapterView(View view) { arrList.add(view); } @Override public int getCount() { return arrList.size();//返回页面的数量 } @Override public boolean isViewFromObject(View view, Object object) { return view == object; } @Override public void destroyItem(ViewGroup container, int position, Object object) { container.removeView(arrList.get(position));//销毁超出viewpager的缓存的页面 } @Override public Object instantiateItem(ViewGroup container, int position) { container.addView(arrList.get(position)); return arrList.get(position); } }
7819ef71-3011-4811-a1ad-6d971ddc3cc5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-14 06:36:17", "repo_name": "Piyaporn539/Project-OOP-6104062630379", "sub_path": "/src/monkey/grape.java", "file_name": "grape.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "e70cf0cc52f3634a9aee791de4376d85cf485b13", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Piyaporn539/Project-OOP-6104062630379
222
FILENAME: grape.java
0.292595
package monkey; import java.awt.Image; import java.awt.Toolkit; import java.awt.geom.Rectangle2D; import java.net.URL; import javax.swing.ImageIcon; public class grape extends apple{ Image img; grape(){ String imageLocation = "grape.png"; URL imageURL1 = this.getClass().getResource(imageLocation); img = Toolkit.getDefaultToolkit().getImage(imageURL1); runner.start(); } Thread runner = new Thread(new Runnable() { public void run() { while(true){ y += 1; //เลขมากผลไม้ตกลงมาเร้ว if(y >= 1000){ img = null; runner = null; x = -200; y = 500; } try{ runner.sleep(15); }catch(InterruptedException e){} } } }); public Image getImage(){ return img; } public Rectangle2D getbound(){ return (new Rectangle2D.Double(x,y,45,45)); } }
fbe17eb5-49fe-4383-bceb-ceb187d56fe9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-05-02T00:40:21", "repo_name": "msan622/spring-2014-template", "sub_path": "/project-prototype/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1222, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "584afa2ab2dd81990c233bf436b74585bfb34261", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/msan622/spring-2014-template
238
FILENAME: README.md
0.27048
Project Prototype ============================== For this assignment, you must: - **Produce one static visualization prototype.** You will receive detailed feedback from your classmates on this prototype, so choose wisely. - **Develop a `shiny` interface prototype for your desired interaction.** The controls do not need to actually work yet, just focus on which UI elements you want to use. Ideally, these would be based on your project sketch. ## Discussion ################ Please include a `README.md` with a brief description of your dataset, an image of your static prototype and description of that prototype, and a screenshot of your interface and a description of that interface. ## Submission ################ Submit your R source code (and any required images) in a `project-prototype` directory within your `msan622` repository on GitHub. Make sure to include a `README.md` file with your name, email, and discussion. After all of the necessary files are pushed to your repository, submit a link to your `project-prototype` directory on Canvas. ## Exercise ################## We will have small-group exercises to evaluate your prototypes during class. Please check the announcements for details.
ec96f698-0096-4377-bc77-d4859e2f6355
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-19 00:32:58", "repo_name": "marcoasjunior/wep-back", "sub_path": "/app/src/main/java/br/com/wep/app/config/TokenService.java", "file_name": "TokenService.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "c14cab96155d3a9e23474a84bb9a04246299bfaa", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/marcoasjunior/wep-back
236
FILENAME: TokenService.java
0.274351
package br.com.wep.app.config; import br.com.wep.app.model.Entities.User; import br.com.wep.app.model.Repos.UserRepo; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; @Service public class TokenService { private static final long expirationTime = 660000000; private static final String key = "secretKey"; //tranformar em variavel de ambiente @Autowired private static UserRepo repo; public static String generateToken(User user){ return Jwts.builder() .setIssuedAt(new Date(System.currentTimeMillis())) .setSubject(user.getEmail()) .setExpiration(new Date(System.currentTimeMillis() + expirationTime)) .signWith(SignatureAlgorithm.HS256, key) .compact(); } public static Claims decodeToken(String token){ return Jwts.parser() .setSigningKey(key) .parseClaimsJws(token) .getBody(); } }
5059c6c0-b111-4c8b-8437-c628587c8b94
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-31 22:45:53", "repo_name": "clariceabreu/spark-data-analysis", "sub_path": "/src/main/java/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "734d65abd3afa6bd9e8f22434cd8c77a060f8fe8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/clariceabreu/spark-data-analysis
258
FILENAME: Main.java
0.271252
import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.spark.SparkConf; import org.apache.spark.api.java.JavaRDD; import org.apache.spark.api.java.JavaSparkContext; public class Main { private static JavaSparkContext sparkContext; public static void main(String[] args) { config(); enterAltTermBuffer(); JavaRDD<String> data = Dataset.loadData(sparkContext); DataAnalysis analysis = new DataAnalysis(data); Commands commands = new Commands(analysis); leaveAltTermBuffer(); } private static void config() { Logger.getLogger("org").setLevel(Level.ERROR); SparkConf sparkConf = new SparkConf().setMaster("local[*]") .setAppName("NCDCdataAnalysis") .set("spark.ui.showConsoleProgress", "true"); sparkContext = new JavaSparkContext(sparkConf); } private static void enterAltTermBuffer() { System.out.print("\033[?1049h\033[?25l"); } private static void leaveAltTermBuffer() { System.out.print("\033[?1049l"); System.exit(0); } }
a405262a-c1d0-435d-883b-8c792932dae3
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-09-12T02:41:04", "repo_name": "lizgw/womenInTechNTX", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1005, "line_count": 15, "lang": "en", "doc_type": "text", "blob_id": "6ac251a1c496cb7911b30404156b08c841a5cfff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/lizgw/womenInTechNTX
215
FILENAME: README.md
0.188324
# womenInTechNTX This repository is a website/information hub for young women in North Texas who are interested in the technology industry. **At the moment, this website is a work in progress! Content will be coming soon.** ## Goals of this Project - **To act as a central resource** for young women who are seeking out opportunities in technology - **To foster collaboration and community** - it's easier to find opportunities when everyone is looking for them together ## Why? Initially, I just wanted to keep track of the tech camps for young women that I had attended so I could share them with my friends. However, I realized that other women could benefit from this, so I knew I had to do something bigger. A collaborative website through GitHub Pages is the solution! ## Contribute! If you know of an opportunity that isn't listed, please add it in! Collaborating and sharing is a big part of what makes this project work. For a step-by-step contribution guide, [click here](/CONTRIBUTING.md)!
a5f50cdf-f5ce-4f19-81b3-66124efea2eb
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-26 02:31:23", "repo_name": "InnoFang/PartyBuildingStudies", "sub_path": "/library/src/main/java/cn/edu/nuc/library/base/BaseFragment.java", "file_name": "BaseFragment.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "ce916f7457c9c68be3ce7ce4f97015920f352ffd", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/InnoFang/PartyBuildingStudies
212
FILENAME: BaseFragment.java
0.236516
package cn.edu.nuc.library.base; import android.os.Bundle; import android.support.annotation.IdRes; import android.support.annotation.LayoutRes; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * Author: Inno Fang * Time: 2017/8/19 12:15 * Description: */ public abstract class BaseFragment extends Fragment { protected View mView; @LayoutRes protected abstract int getLayoutResId(); protected abstract void createView(View view, Bundle savedInstanceState); protected abstract void initEvent(); @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { mView = inflater.inflate(getLayoutResId(), container, false); createView(mView, savedInstanceState); initEvent(); return mView; } public View find(@IdRes int id) { return mView.findViewById(id); } }
08f1279b-2857-4854-a1e5-4fe172ba0c63
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-12 19:01:58", "repo_name": "dartandrevinsky/event-sourcing-examples", "sub_path": "/java-spring/accounts-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/accounts/AccountController.java", "file_name": "AccountController.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "9ebdb954042c32bcb316b869158032c668818d3c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dartandrevinsky/event-sourcing-examples
203
FILENAME: AccountController.java
0.261331
package net.chrisrichardson.eventstore.javaexamples.banking.web.commandside.accounts; import net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts.AccountService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import rx.Observable; @RestController @RequestMapping("/accounts") public class AccountController { private AccountService accountService; @Autowired public AccountController(AccountService accountService) { this.accountService = accountService; } @RequestMapping(method = RequestMethod.POST) public Observable<CreateAccountResponse> createAccount(@Validated @RequestBody CreateAccountRequest request) { return accountService.openAccount(request.getCustomerId(), request.getTitle(), request.getInitialBalance()) .map(entityAndEventInfo -> new CreateAccountResponse(entityAndEventInfo.getEntityIdentifier().getId())); } }
0d47a14c-3c5b-4a42-aa04-2c3b1ce38750
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-25 15:57:41", "repo_name": "tck8888/shenghe", "sub_path": "/shenghe-java/src/test/java/com/tck/shenghe/repository/ProductCategoryRepositoryTest.java", "file_name": "ProductCategoryRepositoryTest.java", "file_ext": "java", "file_size_in_byte": 986, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "b45c4259168cfaf10c31d8964ce31712a188e04e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tck8888/shenghe
192
FILENAME: ProductCategoryRepositoryTest.java
0.220007
package com.tck.shenghe.repository; import com.tck.shenghe.dataobject.ProductCategory; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; import static org.junit.Assert.*; /** * @Author:tck * @Description: * @Date:2018/11/20 **/ @RunWith(SpringRunner.class) @SpringBootTest public class ProductCategoryRepositoryTest { @Autowired private ProductCategoryRepository repository; @Test public void saveTest() { ProductCategory productCategory = new ProductCategory(); productCategory.setCategoryName("男生最爱"); productCategory.setCategoryType(3); repository.save(productCategory); } @Test public void findByCategoryTypeIn() { } }
0c0b397c-e8bf-45c3-8a4c-d05b33696f72
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-28 17:29:05", "repo_name": "Anjuka/LAYOUTindex_Demo", "sub_path": "/app/src/main/java/com/anjukakoralage/layoutindexdemo/model/UserAllDetails.java", "file_name": "UserAllDetails.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "7cf488df4e181c73cf80fa2e73971c999f4877e9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Anjuka/LAYOUTindex_Demo
256
FILENAME: UserAllDetails.java
0.240775
package com.anjukakoralage.layoutindexdemo.model; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; import javax.inject.Inject; /** * Created by anjukakoralage on 27,September,2019 */ public class UserAllDetails { @SerializedName("page") private String page; @SerializedName("per_page") private String per_page; @SerializedName("total") private String total; @SerializedName("total_pages") private String total_pages; @SerializedName("data") private ArrayList<UserDetails> data; @Inject public UserAllDetails(String page, String per_page, String total, String total_pages, ArrayList<UserDetails> data) { this.page = page; this.per_page = per_page; this.total = total; this.total_pages = total_pages; this.data = data; } public String getPage() { return page; } public String getPer_page() { return per_page; } public String getTotal() { return total; } public String getTotal_pages() { return total_pages; } public ArrayList<UserDetails> getData() { return data; } }
5a420723-5ac9-491a-8b81-af891272f7b6
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-02-13 20:13:18", "repo_name": "mutsuda/HackU", "sub_path": "/yql/uses/Weather.java", "file_name": "Weather.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "f8545e4e856359d1a12db91ea15788527ac09ade", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mutsuda/HackU
259
FILENAME: Weather.java
0.292595
package yql.uses; import java.util.HashMap; import java.util.Map; import yql.uses.dto.WeatherInfo; import yql.utils.JSONHelper; import yql.utils.YQLExecutor; import com.google.gson.JsonElement; public class Weather { public static WeatherInfo getWeatherInfo() { // Get JSON JsonElement jsonRoot = YQLExecutor .execute( "SELECT * FROM weather.forecast WHERE location=\"SPXX0015\" and u=\"c\"", true); // Get Degrees and text String degrees = JSONHelper.navigate(jsonRoot, "query,results,channel,item,condition,temp").getAsString(); String text = JSONHelper.navigate(jsonRoot, "query,results,channel,item,condition,text").getAsString(); // Translate text jsonRoot = YQLExecutor.execute( "select * from google.translate where q=\"" + text + "\" and target=\"ca\"", true); text = JSONHelper.navigate(jsonRoot, "query,results,translatedText") .getAsString(); // Enveloper WeatherInfo weatherInfo = new WeatherInfo(degrees, text); return weatherInfo; } }
696fdd2b-947a-4012-930f-7506eabb55dc
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-19 17:36:24", "repo_name": "LukaszP12/HqlDemo1", "sub_path": "/src/main/java/pl/strefakursow/hibernatedemo/saveEntityApp.java", "file_name": "saveEntityApp.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "40544c5229a033da200a66c52e3d90d07bb5e433", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LukaszP12/HqlDemo1
197
FILENAME: saveEntityApp.java
0.282196
package pl.strefakursow.hibernatedemo; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import pl.strefakursow.hibernatedemo1.entity.Employee; public class saveEntityApp { public static void main(String[] args) { // configuration object Configuration configuration = new Configuration().configure("hibernate.cfg.xml"); // adding the annotated class configuration.addAnnotatedClass(Employee.class); // starting the session factory SessionFactory sessionFactory = configuration.buildSessionFactory(); // starting the session Session currentSession = sessionFactory.getCurrentSession(); // begining the transaction currentSession.beginTransaction(); Employee employee = new Employee(); employee.setIdEmployee(119); employee.setFirstName("Lukas"); employee.setLastName("Kowalski"); employee.setSalary(4000); currentSession.save(employee); sessionFactory.close(); } }
b096582b-9c92-41ed-8500-1c0f43b25eec
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-15 13:03:32", "repo_name": "cRoptin/TP-VV", "sub_path": "/VV-TP7/processors/TestWriter.java", "file_name": "TestWriter.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "4a23374f2cfc6db7f6dbb4d6971ae22d6c034f20", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/cRoptin/TP-VV
185
FILENAME: TestWriter.java
0.283781
package org.apache.commons.math4.processors; import java.io.FileNotFoundException; import java.io.PrintWriter; public class TestWriter { private static PrintWriter fileWriter; public static void writeLog() { fileWriter.close(); } public static void count(String string, int count) { try { PrintWriter writer = getWriter(); /*if(error) { writer.write("ERROR: "); } else { writer.write("INFO: "); }*/ writer.write(string + " : " + count + "\n"); } catch (FileNotFoundException e) { e.printStackTrace(); } } protected static PrintWriter getWriter() throws FileNotFoundException { if(fileWriter == null) { ShutdownHookLog shutdownHook = new ShutdownHookLog(); Runtime.getRuntime().addShutdownHook(shutdownHook); fileWriter = new PrintWriter("log"); } return fileWriter; } }
7ad7c249-4703-433a-84e1-d8842565ee1c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-31 07:57:22", "repo_name": "kazisrabon/Survivability", "sub_path": "/src/main/java/JavaApplicationPath.java", "file_name": "JavaApplicationPath.java", "file_ext": "java", "file_size_in_byte": 1040, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "e102ec83f39c1fefa9f1e6827d67bdac3897e2f1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kazisrabon/Survivability
205
FILENAME: JavaApplicationPath.java
0.224055
import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class JavaApplicationPath { public static void main(String[] args) { // String s = System.getProperty("user.dir")+ "\\ADM.csv"; // System.out.println("ADM.csv Directory = " + s); JPanel jPanel = new JPanel(); //jPanel.setBorder(BorderFactory.createEmptyBorder()); jPanel.setLayout(new GridLayout(1,2)); JButton jInputButton= new JButton("Input"); JButton jSaveButton= new JButton("Save"); jPanel.add(jInputButton); jPanel.add(jSaveButton); JFrame jFrame = new JFrame("Test"); jFrame.setSize(800,500); jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jFrame.add(jPanel, BorderLayout.CENTER); jFrame.setVisible(true); jInputButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { } }); } }
7859bbb2-2559-44d1-b1a0-ab0351e24d1b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-26 10:47:25", "repo_name": "quantech-bristol/electronic-handover-v2", "sub_path": "/src/main/java/com/quantech/Configurations/CustomLogoutSuccessHandler.java", "file_name": "CustomLogoutSuccessHandler.java", "file_ext": "java", "file_size_in_byte": 1179, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "34f307f71831caf51af89f09a55bcdd44287ad0b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/quantech-bristol/electronic-handover-v2
184
FILENAME: CustomLogoutSuccessHandler.java
0.239349
package com.quantech.Configurations; import java.io.File; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; import org.springframework.stereotype.Component; @Component public class CustomLogoutSuccessHandler implements LogoutSuccessHandler { private Logger logger = LoggerFactory.getLogger(this.getClass()); @Override public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { // delete the sensitive patient data when user logs out File pdf = new File("pdfout.pdf"); pdf.delete(); logger.info("Logout Successful: " + authentication.getName()); response.setStatus(HttpServletResponse.SC_OK); //redirect to login response.sendRedirect("/login"); } }
00ef5413-a182-40e7-bac5-a79176533c7b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-18 11:14:32", "repo_name": "RaduFurnea/sda-remote-04-spring", "sub_path": "/boot-playground/src/main/java/ro/sda/spring/boot/service/PatientService.java", "file_name": "PatientService.java", "file_ext": "java", "file_size_in_byte": 1184, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "ac7744a95eb9548c3dc0f1658b97194cd49b794d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/RaduFurnea/sda-remote-04-spring
213
FILENAME: PatientService.java
0.278257
package ro.sda.spring.boot.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import ro.sda.spring.boot.entity.Patient; import ro.sda.spring.boot.repository.PatientRepository; import java.time.LocalDate; import java.util.List; import java.util.Optional; @Service public class PatientService { private final PatientRepository patientRepository; @Autowired public PatientService(PatientRepository patientRepository) { this.patientRepository = patientRepository; } public Patient savePatient(Patient patient) { return patientRepository.save(patient); } public Patient findPatientById(Long id) { Optional<Patient> optPatient = patientRepository.findById(id); if (optPatient.isPresent()) { return optPatient.get(); } else { throw new RuntimeException(); } } public void deletePatientById(Long id) { patientRepository.deleteById(id); } public List<Patient> findPatientsWithBirthdayBefore(LocalDate dateBefore) { return patientRepository.findByDateOfBirthBefore(dateBefore); } }
ed096739-73b1-47c4-9f15-b0ad2be9716e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-03-18T20:36:44", "repo_name": "WilliamRodriguez42/MachEngine", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1222, "line_count": 17, "lang": "en", "doc_type": "text", "blob_id": "ec6a34e69f9a882605982f8882a27cc241f0767b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/WilliamRodriguez42/MachEngine
253
FILENAME: README.md
0.252384
# MachEngine Simple 3D Engine based on OpenGL Automates the usage of basic OpenGL structures such as shaders, attributes, textures, buffers, etc. Mach Engine runs in a OpenGL 4.4 and uses GLSL 440 core for the graphics language. The engine runs in a Qt5 widget and can be fully compiled into an executable using the included version of pyinstaller. Currently the engine is only fully tested with Windows, however all of the dependencies should work with OSX or most Linux distributions with a bit of work. Includes simple classes to handle common inconveniences such as cameras, animation, 3D audio, and texture atlases. Right now the engine is mainly aided towards developing 2D games, however very basic support for 3D games is included. The current goal is to fully document the engine and make example programs/games that emphasize the functionality of each component of Mach Engine. Additionally, futher support for more complicated shader data is necessary (for instance: arrays of uniform structs with non-standard packing formats). Future goals: * *Fix the installer for OSX* * *Change the window handling to remove the one pixel width of black space at the top of the screen* * *Improve full screen support*
a5a3c8ec-0af3-44e2-9786-b6efdff4f0c8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-27 03:59:52", "repo_name": "pcchin-android/ui-playground", "sub_path": "/app/src/main/java/com/pcchin/uiplayground/tetris/BlockDownThread.java", "file_name": "BlockDownThread.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "4eda887f32d95f1ef9099ecd39fa0dd7c10051f6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/pcchin-android/ui-playground
231
FILENAME: BlockDownThread.java
0.285372
package com.pcchin.uiplayground.tetris; class BlockDownThread extends Thread { // Thread to deal with moving the block down private boolean running; private TetrisSurfaceView tetrisSurfaceView; BlockDownThread(TetrisSurfaceView tetrisSurfaceView) { this.tetrisSurfaceView = tetrisSurfaceView; } @Override public void run() { while (this.running) { try { // Variable set to allow for easy editing in future int WAIT_DURATION = 1000; if (WAIT_DURATION - (tetrisSurfaceView.blocksAdded * 2) < 50) { sleep(50); } else { sleep(WAIT_DURATION - (tetrisSurfaceView.blocksAdded * 5)); } } catch (InterruptedException e) { e.printStackTrace(); } if (tetrisSurfaceView.targetBlock != null) { tetrisSurfaceView.targetBlock.moveDown(); } } } void setRunning(boolean running) { this.running= running; } }
f8e0d363-54f0-48c4-93df-83713142ce2c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-04 11:53:31", "repo_name": "verginiaa/Leetcode", "sub_path": "/Leetcode12/src/FindBottomLeftTreeValue.java", "file_name": "FindBottomLeftTreeValue.java", "file_ext": "java", "file_size_in_byte": 1071, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "3ca53c5a89bad7ac4dc99149772ffd4e960eef2e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/verginiaa/Leetcode
212
FILENAME: FindBottomLeftTreeValue.java
0.282196
import java.util.LinkedList; import java.util.Queue; public class FindBottomLeftTreeValue { public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode() {} TreeNode(int val) { this.val = val; } TreeNode(int val,TreeNode left,TreeNode right) { this.val = val; this.left = left; this.right = right; } } public int findBottomLeftValue(TreeNode root) { if(root==null) return 0; int ans=root.val; Queue<TreeNode> queue=new LinkedList<>(); queue.add(root); while(!queue.isEmpty()){ int size=queue.size(); for(int i=0;i<size;i++){ TreeNode r=queue.poll(); if(r.right!=null) { queue.add(r.right); ans = r.right.val; } if(r.left!=null) { queue.add(r.left); ans = r.left.val; } } } return ans; } }
7f340909-4ae4-4fc2-b8e6-f6d894e79bb0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-10 15:28:40", "repo_name": "ChenYuno/czyBlogSystemBack", "sub_path": "/src/main/java/net/sjw/blog/entity/DailyViewCount.java", "file_name": "DailyViewCount.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "e5fda9cb3f6a2d65c70289f3a16a7b70d57cf27f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ChenYuno/czyBlogSystemBack
253
FILENAME: DailyViewCount.java
0.233706
package net.sjw.blog.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import java.util.Date; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; /** * <p> * * </p> * * @author czy * @since 2020-10-13 */ @Data @EqualsAndHashCode(callSuper = false) @TableName("tb_daily_view_count") @ApiModel(value="DailyViewCount对象", description="") public class DailyViewCount implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "ID") @TableId(value = "id", type = IdType.ASSIGN_ID) private String id; @ApiModelProperty(value = "每天浏览量") @TableField("view_count") private Integer viewCount; @ApiModelProperty(value = "创建时间") @TableField("create_time") private Date createTime; @ApiModelProperty(value = "更新时间") @TableField("update_time") private Date updateTime; }
d43fe1cd-811e-4a7c-8317-8ea9a359c5a1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-11 06:50:53", "repo_name": "fiona-pet/business", "sub_path": "/fionapet-business-service-provider/src/main/java/com/fionapet/business/event/PayEvent.java", "file_name": "PayEvent.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "203935fe429ad44791966e1073a8d18e4705481d", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/fiona-pet/business
237
FILENAME: PayEvent.java
0.23231
package com.fionapet.business.event; import com.fionapet.business.entity.SettleAccountsView; import org.springframework.context.ApplicationEvent; /** * Created by tom on 2017/6/4. */ public class PayEvent extends ApplicationEvent { private String type; private String id; private String operateAction; public PayEvent(Object source, String type, String id) { super(source); this.type = type; this.id = id; } public PayEvent(Object source, String operateAction, String businessType, String token) { this(source, businessType, token); this.operateAction = operateAction; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getOperateAction() { return operateAction; } public void setOperateAction(String operateAction) { this.operateAction = operateAction; } }
f8331eca-a5f1-49ad-9420-60f97bb7c44b
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-07 22:59:10", "repo_name": "kotelkonrad/Charm", "sub_path": "/src/main/java/svenhjol/charm/automation/feature/VariableRedstoneLamp.java", "file_name": "VariableRedstoneLamp.java", "file_ext": "java", "file_size_in_byte": 979, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "56f0f03f78cc4320874c6153694c0fa8005558a5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/kotelkonrad/Charm
226
FILENAME: VariableRedstoneLamp.java
0.281406
package svenhjol.charm.automation.feature; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import svenhjol.charm.automation.block.BlockVariableRedstoneLight; import svenhjol.meson.Feature; import svenhjol.meson.handler.RecipeHandler; import svenhjol.meson.registry.ProxyRegistry; public class VariableRedstoneLamp extends Feature { public BlockVariableRedstoneLight block; @Override public String getDescription() { return "Block that emits light according to the strength of the input redstone signal."; } @Override public void preInit(FMLPreInitializationEvent event) { super.preInit(event); block = new BlockVariableRedstoneLight(); RecipeHandler.addShapedRecipe(ProxyRegistry.newStack(block, 1), " Q ", "QRQ", " Q ", 'R', Blocks.REDSTONE_LAMP, 'Q', Items.QUARTZ ); } }
e2844e99-44dc-4210-9dfe-fe497dd21621
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-11-20T19:21:44", "repo_name": "eschenfeldt/stroke-multi", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1015, "line_count": 16, "lang": "en", "doc_type": "text", "blob_id": "5b70bd8076984cd0b993c16fa3b846d39a0c5bec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/eschenfeldt/stroke-multi
196
FILENAME: README.md
0.286169
# StrokeMulti Command line tool to run [a stroke triage model](https://github.com/eschenfeldt/stroke-swift) on randomly generated patients at a set of provided locations. Locations and adjacent hospitals must be provided, with appropriate pre-calculated travel times. Runs model using both generic hospital performance characteristics and provided specific characteristics for each hospital to allow analysis of the impact of including hospital performance in the model. **Included demo input and results files use random hospital performance characteristics and do not reflect the performance of any real hospitals.** ### Usage Build the tool by calling `swift build` in the project root. This creates an executable `StrokeMulti`. Use it as ``` StrokeMulti <hospital_file> <times_file> <options> ``` where `<hospital_file>` and `<times_file>` are paths to correctly formatted hospital and location files relative to the current working directory. Use `StrokeMulti --help` for more information on options.
81e9d246-e7f0-412e-ae8d-b58be378b92e
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-15 17:23:56", "repo_name": "GregoryLambrecht1/OpdrachtenLists", "sub_path": "/OpdrachtenLists/Q13Class.java", "file_name": "Q13Class.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "193fee88f7e131b7fa09436395ce7eaf7175e7ed", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/GregoryLambrecht1/OpdrachtenLists
243
FILENAME: Q13Class.java
0.264358
package opdrachtLists; import java.util.Objects; public class Q13Class { private String name; private boolean niceColour; public Q13Class(String name, boolean niceColour) { this.name = name; this.niceColour = niceColour; } public String getName() { return name; } public void setName(String name) { this.name = name; } public boolean isNiceColour() { return niceColour; } public void setNiceColour(boolean niceColour) { this.niceColour = niceColour; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Q13Class)) return false; Q13Class q13Class = (Q13Class) o; return Objects.equals(getName(), q13Class.getName()); } @Override public int hashCode() { return Objects.hash(getName()); } @Override public String toString() { return "name = " + name + ", niceColour = " + niceColour; } }
a7d80962-373f-4046-8450-d1e9dee10b1a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-19 09:09:05", "repo_name": "woutbr/sosit18", "sub_path": "/Sosit18/src/java/controller/TicketpriorityController.java", "file_name": "TicketpriorityController.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "1eff3f073db33eded4e15b12485d27e35336baf2", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/woutbr/sosit18
226
FILENAME: TicketpriorityController.java
0.277473
/* * 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 controller; import dao.TicketpriorityFacade; import entity.Ticketpriority; import javax.inject.Named; import javax.enterprise.context.SessionScoped; import java.io.Serializable; import java.util.List; import javax.ejb.EJB; /** * * @author c1041184 */ @Named(value = "ticketpriorityController") @SessionScoped public class TicketpriorityController implements Serializable { @EJB TicketpriorityFacade ticketpriorityFacade; Ticketpriority ticketpriority = new Ticketpriority(); public TicketpriorityController() { } public Ticketpriority getTicketpriority() { return ticketpriority; } public void setTicketpriority(Ticketpriority ticketpriority) { this.ticketpriority = ticketpriority; } public List<Ticketpriority> ListTicketpriority(){ List<Ticketpriority> ltp = this.ticketpriorityFacade.findAll(); return ltp; } }
5b33ce1f-d54a-425f-adb1-f90599e87a84
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-22 02:42:34", "repo_name": "seangogo/CSIC", "sub_path": "/udp_server/src/main/java/com/server/netty/udp/handler/DecoderUdp.java", "file_name": "DecoderUdp.java", "file_ext": "java", "file_size_in_byte": 1271, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "fedd940f8b3168422ced3c32f544d5cb8edb9f14", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/seangogo/CSIC
298
FILENAME: DecoderUdp.java
0.290176
package com.server.netty.udp.handler; import com.server.netty.udp.pojo.UdpRequest; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.socket.DatagramPacket; import io.netty.handler.codec.MessageToMessageDecoder; import java.util.List; /** * 解码器将原始网络序变为小端机本地序 */ public class DecoderUdp extends MessageToMessageDecoder<DatagramPacket> { @Override protected void decode(ChannelHandlerContext ctx, DatagramPacket datagramPacket, List<Object> out) throws Exception { ByteBuf in = datagramPacket.content(); ByteBuf bf = Unpooled.copyShort(in.readShortLE(), in.readShortLE());//起始符 报文属性 4 bf.writeInt(in.readIntLE());//报文类型 4 bf.writeShort(in.readShortLE());//长度 2 bf.writeInt(in.readIntLE());//时戳 4 final byte[] sums = new byte[8];//数字量 in.readBytes(sums); bf.writeBytes(sums); while (in.readableBytes() > 4) {//模拟量 bf.writeFloat(in.readIntLE()); } bf.writeShort(in.readShortLE());//效验 bf.writeShort(in.readShortLE());//结束符 out.add(new UdpRequest(bf, datagramPacket)); } }
7267f5b0-3821-4dbe-99e4-79fab4f90e4f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-16 09:02:53", "repo_name": "jcy215058673/shop-backstage", "sub_path": "/shop-backstage-consumer/src/main/java/com/jk/controller/ProductCateguryController.java", "file_name": "ProductCateguryController.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ffd8e28a48ac3c6b04316b471199869cf906a20b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jcy215058673/shop-backstage
220
FILENAME: ProductCateguryController.java
0.221351
package com.jk.controller; import com.jk.model.ProductCategory; import com.jk.service.ProductCateguryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import java.util.List; /** * Created by admin on 2018/4/15. */ @Controller @RequestMapping("/productCateguryController") public class ProductCateguryController extends BaseController{ @Autowired private ProductCateguryService productCateguryService; //查询商品分类列表 @RequestMapping("/queryProductCategury") public ModelAndView queryProductCategury(){ List<ProductCategory> category=productCateguryService.queryProductCategury(); ModelAndView mav = new ModelAndView(); mav.addObject("category",category); mav.setViewName("grr/categoryList"); return mav; } //新增商品分类 @RequestMapping("/addCategory") public String addCategory(){ return "grr/addCategory"; } }
dd8e5f0c-2514-408e-acf8-2f782f677f33
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-08 04:43:43", "repo_name": "dev-dro/dextra-challenge", "sub_path": "/backend/src/main/java/com/devdro/dextra_challenge/backend/services/jpa/ItemMenuJpaService.java", "file_name": "ItemMenuJpaService.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "367c00fa874504b344bb4fa3f8d3b4e304deec28", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/dev-dro/dextra-challenge
196
FILENAME: ItemMenuJpaService.java
0.252384
package com.devdro.dextra_challenge.backend.services.jpa; import com.devdro.dextra_challenge.backend.model.ItemMenu; import com.devdro.dextra_challenge.backend.repositories.ItemMenuRepository; import com.devdro.dextra_challenge.backend.services.ItemMenuService; import org.springframework.stereotype.Service; import java.util.Optional; @Service public class ItemMenuJpaService extends NamedEntityJpaService<ItemMenu> implements ItemMenuService { private final ItemMenuRepository itemMenuRepository; public ItemMenuJpaService(ItemMenuRepository itemMenuRepository) { this.itemMenuRepository = itemMenuRepository; } @Override protected ItemMenuRepository getRepository() { return itemMenuRepository; } @Override public Optional<ItemMenu> find(String name) { Optional<ItemMenu> optionalItemMenu = super.find(name); optionalItemMenu.ifPresent(itemMenu -> itemMenu.setIngredients(itemMenu.getIngredients())); return optionalItemMenu; } }
13e26c42-7294-4e88-91e9-d301dc3812d1
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-13 06:38:06", "repo_name": "minj0117/TeamMaker", "sub_path": "/TeamMaker/src/main/java/com/kh/prj/common/mail/MailController.java", "file_name": "MailController.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "2178359bbc4f6217c62e303b0610048ed84f459f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/minj0117/TeamMaker
195
FILENAME: MailController.java
0.189521
package com.kh.prj.common.mail; import java.io.PrintWriter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller public class MailController { @Autowired private MailService mailService; @RequestMapping(value = "/sendMail.do", method = RequestMethod.GET) public void sendSimpleMail(HttpServletRequest request, HttpServletResponse response, String email ,String tmp) throws Exception { request.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); PrintWriter out = response.getWriter(); mailService.sendMail("ms1994s@naver.com", "임시 비밀번호 입니다.", tmp); //mailService.sendPreConfiguredMail("테스트 메일입니다."); out.print("메일을 보냈습니다!!"); } }
fe77eec1-d26f-4d47-a811-2304cfa8fedd
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-09 15:43:03", "repo_name": "ChenKangQiang/javaSE", "sub_path": "/javaSE-core/src/main/java/edu/tongji/comm/example/multithread/Counter.java", "file_name": "Counter.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "f4fb5ff5a190eec4afccab0465c3293f3af270e4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ChenKangQiang/javaSE
206
FILENAME: Counter.java
0.284576
package edu.tongji.comm.example.multithread; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; /** * @Author chenkangqiang * @Data 2017/9/23 */ public class Counter implements Runnable { private static int count = 0; public static void main(String[] args) { ExecutorService executorService = Executors.newFixedThreadPool(3); executorService.submit(new Counter()); executorService.submit(new Counter()); executorService.submit(new Counter()); executorService.shutdown(); } @Override public void run() { try { while (count < 500) { if (!Thread.currentThread().isInterrupted()) { TimeUnit.MILLISECONDS.sleep(200); count++; System.out.println(Thread.currentThread().getName() + " : " + count); } } } catch (InterruptedException ex) { ex.printStackTrace(); } } }
afefa8e0-f005-4a13-9b58-124fa0a2702c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-05-29T07:35:57", "repo_name": "rafalmiler77/autocompletion", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1180, "line_count": 20, "lang": "en", "doc_type": "text", "blob_id": "0878224cb48188d540b1537347c858e9fe8cb4c7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/rafalmiler77/autocompletion
260
FILENAME: README.md
0.293404
The project contains an implementation of an autocompletion feature. The project will fetch data from a mock json of people by their names and complete the rest of matching people after having typed a character. Settings and features: - mock list in json format consists of 1000 people, including f.ex their id, name, surname, email etc. - while typing, the list of people is filtered in order to match the typed characters - searching is case-insensitive - the displayed number of propositions is limited to 8 - there can be multiple names, that's why when hovered over, a surname is added to display AutoCompleter has following props: - searchData - an array of objects. The object must contain the following keys: id - searchFor - a key, type string, which will be a search string - inputValue - the typed characters (usually from components state) - handleItemSelect - a function taking id as an argument - searchForMore - another key, type string, which will be a additionally displayed - displayMoreInfo - a function taking id as an argument - moreInfo - a string value to be displayed (usually from components state) Demo: https://rafalmiler77.github.io/autocompletion/
aa70e180-c012-42f6-b4de-3b4a90430dba
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-21 16:33:37", "repo_name": "J-Fi/collection-manager-backend", "sub_path": "/src/main/java/com/kodilla/collectionmanagerbackend/service/BooksCollectionDbService.java", "file_name": "BooksCollectionDbService.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "63ba3872ff41e6fb5bb678b91f497125c9b26672", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/J-Fi/collection-manager-backend
185
FILENAME: BooksCollectionDbService.java
0.273574
package com.kodilla.collectionmanagerbackend.service; import com.kodilla.collectionmanagerbackend.domain.Book; import com.kodilla.collectionmanagerbackend.domain.BooksCollection; import com.kodilla.collectionmanagerbackend.repository.BooksCollectionRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class BooksCollectionDbService { @Autowired private BooksCollectionRepository booksCollectionRepo; public BooksCollection saveBooksCollection (BooksCollection booksCollection) { return booksCollectionRepo.save(booksCollection); } public void deleteBooksCollection(final Long id) { booksCollectionRepo.deleteById(id); } public BooksCollection findById(final Long id) { return booksCollectionRepo.findById(id).orElse(new BooksCollection()); } public BooksCollection findBooksCollectionIdByUserId(final Long userId) { return booksCollectionRepo.getBooksCollectionByUserId(userId); } }
76ffda83-9048-4338-8d12-20754fad0ef7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-09 07:05:42", "repo_name": "LiuWk/nepenthe", "sub_path": "/src/main/java/com/nepenthe/demo/service/impl/FilmServiceImpl.java", "file_name": "FilmServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1099, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "d891163a77c25adc43606c4d064a3a711648c200", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/LiuWk/nepenthe
239
FILENAME: FilmServiceImpl.java
0.272799
package com.nepenthe.demo.service.impl; import com.nepenthe.demo.entity.Film; import com.nepenthe.demo.service.FilmService; import com.nepenthe.demo.service.repository.FilmRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; /** * @author lwk * @date 2019-07-05 15:56 */ @Service("filmService") public class FilmServiceImpl implements FilmService { @Autowired private FilmRepository filmRepository; @Transactional(readOnly = true) @Override public Page<Film> getFilmsListPage(Integer page, Integer size) { return filmRepository.findAll(PageRequest.of(page, size)); } @Transactional(readOnly = true) @Override public List<Film> getFilms(Integer page, Integer size) { Page<Film> list = filmRepository.findAll(null, PageRequest.of(page, size)); return list.getContent(); } }
382d617d-fd17-4db0-81f8-777223463649
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-15 19:38:20", "repo_name": "TheoBaptista/Alura", "sub_path": "/projeto-jdbc/src/TestaInsercaoComParametro.java", "file_name": "TestaInsercaoComParametro.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "3482541289f8d080f066e316053a0b34f4bd9c11", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/TheoBaptista/Alura
305
FILENAME: TestaInsercaoComParametro.java
0.26971
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class TestaInsercaoComParametro { public static void main(String[] args) throws SQLException { CriaConexao conexao = new CriaConexao(); try(Connection connection = conexao.recuperarConexa()){ connection.setAutoCommit(false); try (PreparedStatement stm = connection.prepareStatement("INSERT INTO PRODUTO (nome, descricao) VALUES (?,?)", Statement.RETURN_GENERATED_KEYS)) { adicionarVariavel("VAI PRA PUTA QUE TE PARIU", "SEU MERDINHA", stm); adicionarVariavel("BOLSONARO VAI TOMAR NO TEU CU", "ARROMBADO DE MERDA", stm); connection.commit(); } catch (Exception e) { e.printStackTrace(); connection.rollback(); System.out.println("ROLLBACK EXECUTADO"); } } } private static void adicionarVariavel(String nome, String descricao, PreparedStatement stm) throws SQLException { stm.setString(1, nome); stm.setString(2, descricao); stm.execute(); try (ResultSet rst = stm.getGeneratedKeys();) { while (rst.next()) { Integer id = rst.getInt(1); System.out.println("O id criado foi " + id); } } } }
242ecaa1-9efe-4c28-9c71-f762459411d0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-04-06T18:13:13", "repo_name": "NeilMadden/wit-lang", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1154, "line_count": 20, "lang": "en", "doc_type": "text", "blob_id": "6192e9131dbe4f8487fd41fe2fe4036d9c98ef61", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/NeilMadden/wit-lang
237
FILENAME: README.md
0.226784
The Wit Programming Language ============================ This is the reference implementation of the Wit Programming Language by Neil Madden. Wit is an experimental programming language (i.e., don't use it!) exploring agent-oriented programming (yet another "AOP") within the context of large-scale software development. The long term goal is to displace Java EE as the primary choice for server-side "enterprise" application development. Briefly, Wit can be described as a cross pollination of the following heritage: - a core statically typed functional programming language, based on ML and Haskell; - a statically typed relational/logical database language based on Datalog; - a BDI (belief-desire-intention) agent model based on the Procedural Reasoning System and AgentSpeak(L); - an goal-based programming model integrated with the above based on STRIPS planning; - a process model similar to Erlang, and a condition system similar to Common Lisp or Dylan; - a (hopefully) pleasing and clean syntax based on Python and ML. As you can see, Wit owes a huge intellectual debt to many ancestors. Warning: Wit is currently vapourware.
6e0f3047-a775-4d8a-a9f4-f4e323074b9a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-02 13:25:29", "repo_name": "DimitarChikalanov/currencyConvertor", "sub_path": "/src/main/java/com/currency/convertor/controllers/HistoryController.java", "file_name": "HistoryController.java", "file_ext": "java", "file_size_in_byte": 1173, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "9b3c6377df814f7343535ef472bbe1ec0254a813", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/DimitarChikalanov/currencyConvertor
198
FILENAME: HistoryController.java
0.291787
package com.currency.convertor.controllers; import com.currency.convertor.domain.entity.User; import com.currency.convertor.service.history.HistoryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @CrossOrigin(origins = "*") @RequestMapping("/api/history") public class HistoryController { private final HistoryService historyService; @Autowired public HistoryController(HistoryService historyService) { this.historyService = historyService; } @GetMapping("/all") public List getAllHistory (@AuthenticationPrincipal User user){ return this.historyService.getAllHistory(user); } @PostMapping("/fromdata") public ResponseEntity getAllHistoryFromData(@RequestBody String time, @AuthenticationPrincipal User user){ return new ResponseEntity(this.historyService.getAllHistoryByFromData(user,time), HttpStatus.ACCEPTED); } }
2b53b8e2-160d-4eaf-8de5-40e58995ec30
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-03 10:16:50", "repo_name": "guptaprakhariitr/NotiFi", "sub_path": "/app/src/main/java/com/example/notifi/NotificationReceiver.java", "file_name": "NotificationReceiver.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 22, "lang": "en", "doc_type": "code", "blob_id": "20209d17d5b4359813a7d087b28796072470f2a8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/guptaprakhariitr/NotiFi
185
FILENAME: NotificationReceiver.java
0.229535
package com.example.notifi; import android.app.Notification; import android.content.Intent; import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; public class NotificationReceiver extends NotificationListenerService { @Override public void onNotificationPosted(StatusBarNotification sbn) { super.onNotificationPosted(sbn);String s,title; if(sbn.getNotification().extras.getCharSequence(Notification.EXTRA_TEXT)!=null){ s=sbn.getNotification().extras.getCharSequence(Notification.EXTRA_TEXT).toString(); title = sbn.getNotification().extras.getCharSequence(Notification.EXTRA_TITLE).toString()+"\n"+s;} else {s=""; title="";} Intent intent = new Intent("/home/prakhar/AndroidStudioProjects/NotiFi/app/src/main/java/com/example/notifi/NotificationReceiver.java"); intent.putExtra("title",title); sendBroadcast(intent); } }
913f4145-0159-46df-88d2-d2c3e961c0b4
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-11-17 20:02:17", "repo_name": "EmmanuelAbajo/stock-api", "sub_path": "/src/main/java/com/solution/stockapi/dto/StockDTO.java", "file_name": "StockDTO.java", "file_ext": "java", "file_size_in_byte": 1220, "line_count": 69, "lang": "en", "doc_type": "code", "blob_id": "7890e532a87c08f7bcfec82e7c02892515daafeb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/EmmanuelAbajo/stock-api
289
FILENAME: StockDTO.java
0.267408
package com.solution.stockapi.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.solution.stockapi.entity.Stock; @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public class StockDTO { private Integer id; private String name; private String price; public StockDTO() { super(); } public StockDTO(String name, String price) { super(); this.name = name; this.price = price; } public StockDTO(Integer id, String name, String price) { super(); this.id = id; this.name = name; this.price = price; } public StockDTO(Stock stock) { super(); this.id = stock.getId(); this.name = stock.getName(); this.price = stock.getPrice(); } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } @Override public String toString() { return "StockDTO [id=" + id + ", name=" + name + ", price=" + price + "]"; } }
7515ffa3-c817-49f3-a145-38e281b35422
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-30 12:52:14", "repo_name": "tourfade/ecosante", "sub_path": "/app/src/main/java/com/kamitsoft/ecosante/model/viewmodels/DocumentsViewModel.java", "file_name": "DocumentsViewModel.java", "file_ext": "java", "file_size_in_byte": 1188, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "7455118c4995f7a4f104460c451e54cb0a1a2514", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/tourfade/ecosante
207
FILENAME: DocumentsViewModel.java
0.283781
package com.kamitsoft.ecosante.model.viewmodels; import android.app.Application; import com.kamitsoft.ecosante.model.DocumentInfo; import com.kamitsoft.ecosante.model.repositories.DocumentsRepository; import java.sql.Timestamp; import java.util.List; import androidx.lifecycle.AndroidViewModel; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; public class DocumentsViewModel extends AndroidViewModel { private DocumentsRepository repository; private LiveData<List<DocumentInfo>> document; public DocumentsViewModel(Application app){ super(app); repository = new DocumentsRepository(app); document = repository.getPatientDocs(); } public LiveData<List<DocumentInfo>> getDocuments() { if (document == null) { document = new MutableLiveData<>(); } return document; } public void insert(DocumentInfo doc){ doc.setUpdatedAt(new Timestamp(System.currentTimeMillis())); repository.insert(doc); } public void update(DocumentInfo doc){ doc.setUpdatedAt(new Timestamp(System.currentTimeMillis())); repository.update(doc); } }
ded17288-ef0a-4dc5-922a-5ba81f52a333
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-16 08:39:23", "repo_name": "LuaAndroid/LuaAndroid", "sub_path": "/app/src/dev/bnna/androlua/BDNDLSource.java", "file_name": "BDNDLSource.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "9d9d3a26b778cc4ed77339e040ad559769beebcd", "star_events_count": 5, "fork_events_count": 4, "src_encoding": "UTF-8"}
https://github.com/LuaAndroid/LuaAndroid
240
FILENAME: BDNDLSource.java
0.229535
package dev.bnna.androlua; import java.io.Serializable; import java.util.ArrayList; /** * Created by wenshengping on 16/5/3. */ public class BDNDLSource implements Serializable{ private static final long serialVersionUID = 6538973755153669738L; private String path; private String version; private ArrayList<String> includeFiles; private ArrayList<String> excludeFiles; public String getPath() { return path; } public void setPath(String path) { this.path = path; } public String getVersion() { return version; } public void setVersion(String version) { this.version = version; } public ArrayList<String> getIncludeFiles() { return includeFiles; } public void setIncludeFiles(ArrayList<String> includeFiles) { this.includeFiles = includeFiles; } public ArrayList<String> getExcludeFiles() { return excludeFiles; } public void setExcludeFiles(ArrayList<String> excludeFiles) { this.excludeFiles = excludeFiles; } }
ea702d40-bfba-4587-a13a-54da20bb7183
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-30 07:22:06", "repo_name": "PiotrLawniczek/survey-app-backend", "sub_path": "/src/main/java/pl/lawniczek/entity/Survey.java", "file_name": "Survey.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "c393c56c3c2467d502038d3a378749d1c85f31bd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/PiotrLawniczek/survey-app-backend
253
FILENAME: Survey.java
0.253861
package pl.lawniczek.entity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import javax.persistence.*; import java.util.ArrayList; import java.util.List; /** * Created by elawpio on 2017-07-20. */ @Entity @Table(name = "SURVEY") public class Survey { @Id @GeneratedValue private long id; private String title; @JsonIgnoreProperties("answers") @OneToMany(cascade = CascadeType.ALL, mappedBy = "survey") private List<Question> questions = new ArrayList<>(); public long getId() { return id; } public void setId(long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String name) { this.title = name; } public List<Question> getQuestions() { return questions; } public void setQuestions(List<Question> questions) { this.questions = questions; } @Override public String toString() { return "Survey{" + "id=" + id + ", title='" + title + '\'' + ", questionId=" + questions + '}'; } }
93e85f7c-ce9e-45c7-8b98-f33f329f4f9d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-17 08:02:45", "repo_name": "Peachex/Composite", "sub_path": "/src/main/java/com/epam/composite/parser/SentenceParser.java", "file_name": "SentenceParser.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "b2def869f293e590eb5408834aec53c5a8dd7bc6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Peachex/Composite
198
FILENAME: SentenceParser.java
0.287768
package com.epam.composite.parser; import com.epam.composite.component.TextComponent; import com.epam.composite.component.Layer; import com.epam.composite.component.TextComposite; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class SentenceParser implements Parser { private static final String SENTENCE_DELIMITER = "(?<=[.!?…]\\s)"; private Parser nextParser = new WordParser(); @Override public TextComponent parse(String text) { TextComponent result = new TextComposite(Layer.PARAGRAPH); List<String> sentences = parseText(text); for (String sentence : sentences) { TextComponent word = nextParser.parse(sentence); result.add(word); } return result; } private List<String> parseText(String text) { List<String> sentences = Arrays.stream(text .split(SENTENCE_DELIMITER)) .collect(Collectors.toList()); return sentences; } }
95d71708-e2ce-47c5-8607-78d20581dd64
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-12 16:20:36", "repo_name": "brunocoelho1997/AirplaneAgencyTestsApproach", "sub_path": "/Agency/Agency-ejb/src/java/logic/TripsManagement/TPlaceFacade.java", "file_name": "TPlaceFacade.java", "file_ext": "java", "file_size_in_byte": 1180, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "c1be5a8fbc4c8c8d0b48f4f3bd56e23ca9839334", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/brunocoelho1997/AirplaneAgencyTestsApproach
226
FILENAME: TPlaceFacade.java
0.293404
/* * 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 logic.TripsManagement; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Root; /** * * @author bruno */ @Stateless public class TPlaceFacade extends AbstractFacade<TPlace> implements TPlaceFacadeLocal { @PersistenceContext(unitName = "Agency-ejbPU") private EntityManager em; @Override protected EntityManager getEntityManager() { return em; } public TPlaceFacade() { super(TPlace.class); } @Override public boolean deleteAll(){ try { Query qu = this.em.createNamedQuery("delete from TPlace"); qu.executeUpdate(); return true; } catch (Exception e) { return false; } } }
38769182-cced-4238-bdbc-93cd3d03c080
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-01 16:05:10", "repo_name": "viniciusufop/provider-mock", "sub_path": "/src/main/java/br/com/vfs/providermock/config/ProductConfig.java", "file_name": "ProductConfig.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "e479fc6d8a3802f36eb8bdfa903ffb2ddb4c1cfe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/viniciusufop/provider-mock
217
FILENAME: ProductConfig.java
0.246533
package br.com.vfs.providermock.config; import br.com.vfs.providermock.soa.client.ProductWSClient; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.oxm.jaxb.Jaxb2Marshaller; @Configuration public class ProductConfig { @Value("${marketplace.host}") private String host; @Value("${marketplace.port}") private Integer port; @Bean public Jaxb2Marshaller marshaller() { Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); marshaller.setContextPath("products.wsdl"); return marshaller; } @Bean public ProductWSClient productWSClient(Jaxb2Marshaller marshaller) { ProductWSClient client = new ProductWSClient(); client.setDefaultUri(String.format("http://%s:%d/ws",host,port)); client.setMarshaller(marshaller); client.setUnmarshaller(marshaller); return client; } }
7e3c6a25-5031-4436-a4d6-a94530dc0fe7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-12 13:22:50", "repo_name": "liangtao3838/sysmgr", "sub_path": "/src/main/java/com/sys/mgr/service/Impl/SysServiceServiceImpl.java", "file_name": "SysServiceServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "5497caa46ed6a17a5daf6a2cf38eeb63ad0fd01a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/liangtao3838/sysmgr
263
FILENAME: SysServiceServiceImpl.java
0.292595
package com.sys.mgr.service.Impl; import com.sys.mgr.dao.SysServiceDao; import com.sys.mgr.model.SysService; import com.sys.mgr.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * Created by liangtao on 2018/3/18. */ @Service public class SysServiceServiceImpl implements SysServiceService { @Autowired SysServiceDao sysServiceDao; @Override public List<SysService> getList(long tid,Integer offset,Integer rows) { return sysServiceDao.getList(offset,rows); } @Override public long getCount(long tid) { return sysServiceDao.getCount(); } @Override public boolean add(SysService info) { return sysServiceDao.add(info)>0; } @Override public boolean update(SysService info) { return sysServiceDao.update(info)>0; } @Override public SysService query(long tid, long id) { return sysServiceDao.query(id); } @Override public boolean delete(List<Long> ids,String updatePin) { return sysServiceDao.delete(ids,updatePin)>0; } }
d4129681-d063-454b-b2ea-24e2460100a9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-08 03:00:33", "repo_name": "arche4/socketVentaApple", "sub_path": "/src/ventasappleClienteTCP/cliente.java", "file_name": "cliente.java", "file_ext": "java", "file_size_in_byte": 1181, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "fb2e3910849d8a123b6772aab06aee2b067800f8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/arche4/socketVentaApple
219
FILENAME: cliente.java
0.23793
package ventasappleClienteTCP; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; import java.util.Scanner; import java.util.logging.Level; import java.util.logging.Logger; public class cliente { private final static int PUERTO = 12345; private final static String IP = "localhost"; public static void main(String[] args) { Socket conexion; DataInputStream datosEntrada; DataOutputStream datosSalida; Scanner teclado = new Scanner(System.in); while (true) { try { conexion = new Socket(IP, PUERTO); datosSalida = new DataOutputStream(conexion.getOutputStream()); datosSalida.writeUTF(teclado.nextLine()); datosEntrada = new DataInputStream(conexion.getInputStream()); System.out.println("Server>>" + datosEntrada.readUTF()); conexion.close(); } catch (IOException ex) { Logger.getLogger(cliente.class.getName()).log(Level.SEVERE, null, ex); } } } }
17b80163-8db0-4403-8637-9f0b0d22d411
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-12 20:52:32", "repo_name": "MotazAlbiruni/My-Notes", "sub_path": "/app/src/main/java/com/motazalbiruni/mynotes/database_room/NoteEntity.java", "file_name": "NoteEntity.java", "file_ext": "java", "file_size_in_byte": 1187, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "945d2927a470d95b3870d33eb87e573d4df68bb1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/MotazAlbiruni/My-Notes
265
FILENAME: NoteEntity.java
0.295027
package com.motazalbiruni.mynotes.database_room; import androidx.room.Entity; import androidx.room.Ignore; import androidx.room.PrimaryKey; @Entity(tableName = "notes_table") public class NoteEntity { @PrimaryKey(autoGenerate = true) private int id; private final String title; private final String body; private final int type; private final String date; //constructor public NoteEntity(String title, String body, int type, String date) { this.title = title; this.body = body; this.type = type; this.date = date; } //ignore @Ignore public NoteEntity(int id, String title, String body, int type, String date) { this.id = id; this.title = title; this.body = body; this.type = type; this.date = date; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getTitle() { return title; } public String getBody() { return body; } public int getType() { return type; } public String getDate() { return date; } }//end class
3cfc0fa6-1989-47c2-a480-f926e6aecbdf
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-15 16:19:10", "repo_name": "ksmail13/simple-reactive", "sub_path": "/src/main/java/io/github/ksmail13/schedule/PooledScheduler.java", "file_name": "PooledScheduler.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "956b19e825d93d103e85635c6e239941f6012fa7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ksmail13/simple-reactive
210
FILENAME: PooledScheduler.java
0.294215
package io.github.ksmail13.schedule; import java.util.LinkedList; class PooledScheduler implements Scheduler { private LinkedList<Worker> workers; private int curr; public PooledScheduler() { this(Runtime.getRuntime().availableProcessors()); } public PooledScheduler(int cnt) { this("Pooled", cnt); } public PooledScheduler(String name, int parallelism) { WorkerFactory factory = new WorkerFactory(name); workers = new LinkedList<>(); while(parallelism-- > 0) { Worker worker = factory.newWorker(); workers.add(worker); worker.start(); } } @Override public Worker worker() { Worker worker = workers.get(curr++); curr %= workers.size(); System.out.printf("return worker(%s)\n", worker.getName()); return worker; } @Override public void work(Runnable runnable) { workers.get(curr++).push(runnable); curr %= workers.size(); } }
77590999-9870-41c9-a599-cfae026f8be5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-21 06:12:32", "repo_name": "EswarVarma91/BP_Check_Point", "sub_path": "/app/src/main/java/ohd/apps/bpcheckpoint/ResultActivityMain.java", "file_name": "ResultActivityMain.java", "file_ext": "java", "file_size_in_byte": 1222, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "498280223c8211c359df6627cdc5916d99725d0d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/EswarVarma91/BP_Check_Point
218
FILENAME: ResultActivityMain.java
0.276691
package ohd.apps.bpcheckpoint; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import java.util.Random; public class ResultActivityMain extends AppCompatActivity { ImageView ig; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_result); ig=(ImageView)findViewById(R.id.Home); int[] cards={R.drawable.rone,R.drawable.rtwo,R.drawable.rthree,R.drawable.rfour}; Random r1 = new Random(); int n = r1.nextInt(4); ImageView imageView = (ImageView)findViewById(R.id.imageView11); imageView.setImageResource(cards[n]); ig.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i=new Intent(ResultActivityMain.this,HomeActivity.class); startActivity(i); } }); } @Override public void onBackPressed() { Intent i=new Intent(ResultActivityMain.this,MainActivity.class); startActivity(i); } }
08e66254-baa1-4b06-878a-25411c62cbf7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-11 01:00:24", "repo_name": "relish-wang/TP", "sub_path": "/TP-Android/app/src/main/java/cn/studyjamscn/s1/sj120/r3lish/networks/ModifyRealNameRequest.java", "file_name": "ModifyRealNameRequest.java", "file_ext": "java", "file_size_in_byte": 1000, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7b2cc27e8b60cce01070a2dccfa39e04c490babe", "star_events_count": 1, "fork_events_count": 3, "src_encoding": "UTF-8"}
https://github.com/relish-wang/TP
238
FILENAME: ModifyRealNameRequest.java
0.293404
package cn.studyjamscn.s1.sj120.r3lish.networks; import android.support.annotation.NonNull; import org.json.JSONException; import org.json.JSONObject; import cn.studyjamscn.s1.sj120.r3lish.base.BaseJsonRequest; import cn.studyjamscn.s1.sj120.r3lish.entity.UserEntity; /** * Created by r3lis on 2016/4/4. */ public class ModifyRealNameRequest extends BaseJsonRequest<Void> { String realName; public ModifyRealNameRequest(final String realName) { this.realName = realName; } @NonNull @Override protected JSONObject json() throws JSONException { JSONObject json = new JSONObject(); json.put("uid", UserEntity.getUid()); json.put("realName", realName); return json; } @NonNull @Override protected String methodName() { return "index.php/PersonalCenter/RealNameUpdate"; } @Override protected Void parseResponse(@NonNull JSONObject response) throws JSONException { return null; } }
4c95c5cf-27e1-4ed7-b682-560d2705c45d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-03T04:16:39", "repo_name": "jackson-oscar/weather-app", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1088, "line_count": 32, "lang": "en", "doc_type": "text", "blob_id": "e729b150e27c9cc9e8ddd2b2b43fe5228b162362", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/jackson-oscar/weather-app
256
FILENAME: README.md
0.199308
# Weather Application A weather application to show current and forecasted weather. URL: https://ojdeveloper-weatherapp.netlify.app/ ## Table of Contents * [Why?](#why?) * [Description](#Description) * [Technologies](#Technologies) ## Why? * Learn something new * Get Familiar with React and web development * Get more experience with APIs * Gain experience outside of OOP ## Description The weather app returns current weather and a five day forecast for the location entered. The more specific the search the better the results. For example, searching "Seattle WA" instead of "Seattle," or ZIP code, helps get the location desired. The weather data shown is temperature in fahrenheit, description of weather, weather picture, and the day's high and low temperatures. ## Technologies * React - useState - useEffect - Custom hook (/src/hooks/useWeather.js) * [Geocodio](https://www.geocod.io/) API * [OpenWeather](https://openweathermap.org/) API * [Semantic-ui](https://semantic-ui.com/) for styling * [Netlify](https://www.netlify.com/) for deployment * Visual Studio Code
90f125c8-921b-4818-a036-1eaff0e6a728
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-19 15:08:41", "repo_name": "GoySak25/My_Projects", "sub_path": "/AED_Final_Project/src/Business/DeviceCategory/Device.java", "file_name": "Device.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "b07e808f9db90dd75f6922433c0117b9ae263779", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/GoySak25/My_Projects
223
FILENAME: Device.java
0.246533
/* * 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 Business.DeviceCategory; import Business.Enterprise.Enterprise; import java.util.concurrent.ThreadLocalRandom; /** * * @author divinity */ public class Device { private String deviceId; private String deviceName; private Enterprise enterprise; public Device( String name) { this.deviceId = deviceIdGenerator(); this.deviceName = name; } private String deviceIdGenerator() { int rand_int1 = ThreadLocalRandom.current().nextInt(); String deviceRefId = "DEVICE_" + rand_int1; return deviceRefId; } public String getDeviceId() { return deviceId; } public String getDeviceName() { return deviceName; } public void setDeviceName(String deviceName) { this.deviceName = deviceName; } @Override public String toString(){ return getDeviceName(); } }
c17134e7-cc2c-4a60-a60f-6e5e08b4d5d2
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-01-13 06:14:58", "repo_name": "chuandongjiewen/InternetClass", "sub_path": "/src/socketUdp/EchoUDPClient.java", "file_name": "EchoUDPClient.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "d4823fc690cbad4b6c19805bdd3f500368f5fdb9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "GB18030"}
https://github.com/chuandongjiewen/InternetClass
254
FILENAME: EchoUDPClient.java
0.278257
package socketUdp; /** * * @author Administrator */ import java.net.*; import java.io.*; import javax.swing.*; import Score.*; public class EchoUDPClient { private String remoteHost="222.201.101.15";// or localhost"222.201.101.15 private int remotePort=8880;//对方(服务器)端口号 private DatagramSocket socket; private InetAddress remoteIP; public EchoUDPClient() throws SocketException, UnknownHostException{ socket = new DatagramSocket(); remoteIP = InetAddress.getByName(remoteHost); } public void send(String msg) throws IOException { byte[] buff = msg.getBytes("GBK"); DatagramPacket packet = new DatagramPacket(buff, buff.length, remoteIP, remotePort); socket.send(packet); } public String receive() throws IOException{ byte[] buff = new byte[1024]; DatagramPacket packet = new DatagramPacket(buff, buff.length); socket.receive(packet); return new String(packet.getData(),0,packet.getLength(), "GBK"); } public void close(){ socket.close(); } }
9de18ff9-8f96-47eb-9697-0c1e5571f12a
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-29 04:02:59", "repo_name": "TeamYouthChina/backend", "sub_path": "/src/main/java/com/youthchina/dto/community/answer/SimpleAnswerRequestDTO.java", "file_name": "SimpleAnswerRequestDTO.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "11dc938dd5874a1ac4e6fcf4664a2e5aa181c06f", "star_events_count": 5, "fork_events_count": 9, "src_encoding": "UTF-8"}
https://github.com/TeamYouthChina/backend
250
FILENAME: SimpleAnswerRequestDTO.java
0.264358
package com.youthchina.dto.community.answer; import com.youthchina.domain.jinhao.Answer; import com.youthchina.dto.RequestDTO; import com.youthchina.dto.util.RichTextRequestDTO; /** * Created by zhongyangwu on 1/2/19. */ public class SimpleAnswerRequestDTO implements RequestDTO<Answer> { private RichTextRequestDTO body; private Boolean is_anonymous; public SimpleAnswerRequestDTO(Answer answer) { RichTextRequestDTO richt = new RichTextRequestDTO(answer.getBody()); this.body = richt; this.is_anonymous = (answer.getIsAnony() == 0) ? false : true; } public SimpleAnswerRequestDTO(){} public RichTextRequestDTO getBody() { return body; } public void setBody(RichTextRequestDTO body) { this.body = body; } public Boolean getIs_anonymous() { return is_anonymous; } public void setIs_anonymous(Boolean is_anonymous) { this.is_anonymous = is_anonymous; } @Override public Answer convertToDomain() { return new Answer(this); } }
bcd0ccc8-f5df-4533-93e6-89e3491c49f0
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-15 21:08:23", "repo_name": "Iruora/ec2-games", "sub_path": "/web-exercice/src/main/java/com/atn/demo/mvc/module/user/dto/ConnectedHome.java", "file_name": "ConnectedHome.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "d414c97c4075d7cce98913b907a7cc6302a69833", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Iruora/ec2-games
208
FILENAME: ConnectedHome.java
0.214691
package com.atn.demo.mvc.module.user.dto; import com.atn.demo.mvc.module.user.entity.Role; import com.atn.demo.mvc.module.user.entity.User; import java.util.Iterator; public class ConnectedHome { String fullName; String roleName; String title; public void setUser(User user){ setFullName(user.getUserEmail()); String roleName = "NoRole"; Iterator<Role> roles = user.getRoles().iterator(); while(roles.hasNext()){ roleName = roles.next().getRole().name(); } setRoleName(roleName); } public String getFullName() { return fullName; } public void setFullName(String fullName) { this.fullName = fullName; } public String getRoleName() { return roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } }
3c84359b-cc18-4b01-a41d-e31c1a6a2ac5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-28 05:06:45", "repo_name": "ToruNagao/team1", "sub_path": "/app/src/main/java/com/example/ninjung/testgooglemapver2/SplashActivity.java", "file_name": "SplashActivity.java", "file_ext": "java", "file_size_in_byte": 2266, "line_count": 78, "lang": "en", "doc_type": "code", "blob_id": "b6402cfd3b7c2849a326b44e696c35e13fd4b39d", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/ToruNagao/team1
218
FILENAME: SplashActivity.java
0.26588
package com.example.ninjung.testgooglemapver2; /** * Created by Toru on 2015/04/26. */ import android.app.Activity; import android.os.Handler; import android.os.Bundle; import android.view.Window; import android.content.Intent; import android.widget.ProgressBar; import android.widget.TextView; public class SplashActivity extends Activity { //ProgressBar progressBar; //int progress = 100; //Handler handler = new Handler(); //TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.splash); int delay = 1000; Handler hdl = new Handler(); //x ms delay before runs splashHandler hdl.postDelayed(new splashHandler(), delay); } class splashHandler implements Runnable { public void run() { Intent intent = new Intent(getApplication(), MainActivity.class); startActivity(intent); SplashActivity.this.finish(); } } }
6473697f-d213-43ac-a082-37721aa31010
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-30 03:40:07", "repo_name": "BrychanOdlum/TMNM", "sub_path": "/TMNM/src/main/java/net/totalmine/other/weather/weatherCommand.java", "file_name": "weatherCommand.java", "file_ext": "java", "file_size_in_byte": 1179, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "449d412e8575fc8ced801cdc0fd10dd3347761da", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/BrychanOdlum/TMNM
269
FILENAME: weatherCommand.java
0.292595
package net.totalmine.other.weather; import net.totalmine.core.TMNM; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.CommandExecutor; import org.bukkit.entity.Player; public class weatherCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command cmd1, String commandLabel, String[] args) { if (!(sender instanceof Player)) { sender.sendMessage("Only in-game players can use this command"); return true; } Player player = (Player) sender; if (!player.hasPermission("tmnm.other.weather")) { player.sendMessage(TMNM.prefixManager + "You do not have the required permission to perform this command"); return true; } //if (cmd1.getName().equalsIgnoreCase("verify")) { if (args == null || args.length < 1) { player.sendMessage(TMNM.prefixManager + "Usage: /weather [storm/sun]"); return true; } boolean isStorm = false; if (args[0].equalsIgnoreCase("storm")) isStorm = true; player.getWorld().setStorm(isStorm); player.sendMessage(TMNM.prefixManager + "Weather value set"); //} return true; } }
39cbf5b0-bde0-4efa-8b30-c25176204c3f
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-02-13T19:44:59", "repo_name": "clintjason/flask_tutorial_series", "sub_path": "/10_redirect_and_errors/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1015, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "afe2765f375f36a28e988e8facea90f5d309fa3a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/clintjason/flask_tutorial_series
260
FILENAME: readme.md
0.285372
# Working with Redirect and Errors in Flask ## Description This is a simple program to show how to use the redirect method and to show how errors can be rendered in flask. ## Usage - Navigate to the 10_redirect_and_errors sub directory - Browse the directory - Read and understand the app.py file. - Open the terminal and export the flask application environment variable $ export FLASK_APP=app.py - Run the flask application $ flask run - Click the link in the terminal to view the application running in the browser - The output you see which is the result of serving the 401 error page is the customized 401 error page. - Change the url in the brower to 127.0.0.1:5000/g in order to obtain a 404 error and to be served the 404 error page by the server. - See the output (the output is the customized 404 page) - You could comment the areas in the app.py file where we loaded the error pages to be loaded and then run the application again to view the default error pages served to the browser.
ef05c724-0b42-400d-92c9-3a1335bd6da5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-20 10:33:12", "repo_name": "ilyasziyaoglu/query-service", "sub_path": "/src/main/java/tr/com/abc/credit/query/Controller.java", "file_name": "Controller.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "2351360fa569b0644fcfb1a81032c181d4340aa9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/ilyasziyaoglu/query-service
236
FILENAME: Controller.java
0.259826
package tr.com.abc.credit.query; import org.springframework.context.annotation.Primary; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RestController public class Controller { @GetMapping(path = "/query") public String fetchQuery( @RequestParam(name = "tckn", required = false) Integer tckn, @RequestParam(name = "bankaAdi", required = false) String bankaAdi, @RequestParam(name = "krediTuru", required = false) String krediTuru, @RequestParam(name = "dosyaTarihi", required = false) String dosyaTarihi, @RequestParam(name = "krediNumarasi", required = false) Integer krediNumarasi){ // Sorgu objeso tanimlama QueryObject queryObject = new QueryObject(tckn, krediNumarasi, bankaAdi, krediTuru, dosyaTarihi); return new QueryService().doQuery(queryObject).toString(); } }
20b60740-93fe-4daa-995d-9e1737554972
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-07 18:53:23", "repo_name": "edkmstuff/Offside", "sub_path": "/app/src/main/java/com/offsidegame/offside/adapters/CustomTabsFragmentPagerAdapter.java", "file_name": "CustomTabsFragmentPagerAdapter.java", "file_ext": "java", "file_size_in_byte": 1155, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "204fd3fbfe9e7d9a78b0e0128a12ca1997e05e0c", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/edkmstuff/Offside
228
FILENAME: CustomTabsFragmentPagerAdapter.java
0.282196
package com.offsidegame.offside.adapters; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import org.acra.ACRA; import java.util.ArrayList; /** * Created by user on 7/20/2017. */ public class CustomTabsFragmentPagerAdapter extends FragmentPagerAdapter { private ArrayList<Fragment> fragments = new ArrayList<>(); public CustomTabsFragmentPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { return fragments.get(position); } @Override public int getCount() { return fragments.size(); } //add page public void addFragment(Fragment fragment) { fragments.add(fragment); } //set title @Override public CharSequence getPageTitle(int position) { try { String title = fragments.get(position).toString(); return title; } catch (Exception ex) { ACRA.getErrorReporter().handleSilentException(ex); return null; } } }
cd8378e5-85ee-400e-9b0d-80a9023ccdfe
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-06 02:29:27", "repo_name": "yetote/TravelBook", "sub_path": "/app/src/main/java/com/example/tf/travelbook/WelcomePagerActivity.java", "file_name": "WelcomePagerActivity.java", "file_ext": "java", "file_size_in_byte": 1187, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "4be4e59a59d9d8b1cc0e4e9ed0778ffdc045dc80", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/yetote/TravelBook
194
FILENAME: WelcomePagerActivity.java
0.229535
package com.example.tf.travelbook; import android.content.Intent; import android.content.SharedPreferences; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.WindowManager; import android.widget.Button; public class WelcomePagerActivity extends AppCompatActivity { private Button enter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_welcome_pager); getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); enter = (Button) findViewById(R.id.welcome_enter); enter.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { SharedPreferences.Editor sp = getSharedPreferences("first", MODE_PRIVATE).edit(); sp.putBoolean("first", true); sp.commit(); Intent i = new Intent(); i.setClass(WelcomePagerActivity.this, MainActivity.class); startActivity(i); finish(); } }); } }
32ea3168-308b-41ab-9786-f4d62a273a58
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-24 21:43:21", "repo_name": "sugrrk/SeleniumMaven", "sub_path": "/src/test/java/TestNGSelenium/ParametersExample.java", "file_name": "ParametersExample.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "cb7f1e7f12da6b9a55ffbd000440bcdac29be9ae", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sugrrk/SeleniumMaven
248
FILENAME: ParametersExample.java
0.282988
package TestNGSelenium; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Parameters; import org.testng.annotations.Test; public class ParametersExample { WebDriver driver; @BeforeClass @Parameters({"browser","url"}) void setup(String browser,String app) { if (browser.equalsIgnoreCase("chrome")) { System.setProperty("webdriver.chrome.driver", "C:\\Users\\suganya\\IdeaProjects\\httpclient\\untitled\\SeleniumMaven\\src\\main\\NewResources\\chromedriver.exe"); driver = new ChromeDriver(); driver.get(app); } } @Test(priority = 1) void logotest(){ WebElement logo = driver.findElement(By.id("logo")); Assert.assertTrue(logo.isDisplayed()); } @Test(priority=2) void homepageTitle(){ String title = driver.getTitle(); Assert.assertEquals("QA/QE/SDET Training.",title); } @AfterClass void tearDown(){ driver.quit(); } }
e99f7eee-d658-46c5-968a-7f441284a73d
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-06 04:59:44", "repo_name": "Selo4J/e-commerce_Site", "sub_path": "/src/java/session/OrderedProductFacade.java", "file_name": "OrderedProductFacade.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "fbbbb61637668d5edde53c4b3edb80080aa1274d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Selo4J/e-commerce_Site
193
FILENAME: OrderedProductFacade.java
0.29584
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package session; import entity.OrderedProduct; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; /** * * @author selomongoitom */ @Stateless public class OrderedProductFacade extends AbstractFacade<OrderedProduct> { @PersistenceContext(unitName = "e-commerce_SitePU") private EntityManager em; @Override protected EntityManager getEntityManager() { return em; } public OrderedProductFacade() { super(OrderedProduct.class); } // manually created public List<OrderedProduct> findByOrderId(Object id) { return em.createNamedQuery("OrderedProduct.findByCustomerOrderId").setParameter("customerOrderId", id).getResultList(); } }
48ebf1e9-5b82-4288-96bb-b2478081df95
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-30 07:20:24", "repo_name": "kamkie/demo-spring-jsf", "sub_path": "/src/test/java/com/example/pageobjects/SessionMessagesPanel.java", "file_name": "SessionMessagesPanel.java", "file_ext": "java", "file_size_in_byte": 1185, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "92c280aecece2da618545b026fcc2a2bcde6b0ea", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"}
https://github.com/kamkie/demo-spring-jsf
239
FILENAME: SessionMessagesPanel.java
0.294215
package com.example.pageobjects; import com.example.util.JsfUtil; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.WebDriverWait; import java.time.Duration; public class SessionMessagesPanel { private final WebDriver webDriver; public SessionMessagesPanel(WebDriver webDriver) { this.webDriver = webDriver; } public void showInfo() { webDriver.findElement(By.id("messages-form:show-info")).click(); } public void showWarn() { webDriver.findElement(By.id("messages-form:show-warn")).click(); } public void showError() { webDriver.findElement(By.id("messages-form:show-error")).click(); } public void showFatal() { webDriver.findElement(By.id("messages-form:show-fatal")).click(); } public WebElement findSessionMessage() { return webDriver.findElement(By.cssSelector(".ui-messages.ui-widget")); } public void waitForAjax() { WebDriverWait wait = new WebDriverWait(webDriver, Duration.ofSeconds(30)); wait.until(JsfUtil.waitForJQueryAndPrimeFaces()); } }
d9735f86-2dce-4263-ae17-7151e2f9dea5
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-18 21:54:03", "repo_name": "srevilla999/car-pooling", "sub_path": "/src/main/java/dev/carpooling/rest/CarPoolingControllerAdvice.java", "file_name": "CarPoolingControllerAdvice.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "847a7bb36585f853436b26d7e2947fa468259cb7", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/srevilla999/car-pooling
222
FILENAME: CarPoolingControllerAdvice.java
0.253861
package dev.carpooling.rest; import dev.carpooling.service.JourneyNotFoundException; import lombok.Builder; import lombok.Value; import org.springframework.http.ResponseEntity; import org.springframework.web.HttpMediaTypeNotSupportedException; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; import static org.springframework.http.ResponseEntity.badRequest; import static org.springframework.http.ResponseEntity.notFound; @RestControllerAdvice public class CarPoolingControllerAdvice { /** * We can argue whether we need this or not, but the exercise explicitly said that a missing header * should lead to a 400 instead of a 415 */ @ExceptionHandler({HttpMediaTypeNotSupportedException.class}) public ResponseEntity<HttpError> badContentTypeHeader() { return badRequest() .body(HttpError.builder().message("Bad header").build()); } @ExceptionHandler({JourneyNotFoundException.class}) public ResponseEntity<Void> journeyNotFound() { return notFound().build(); } @Value @Builder private static class HttpError { String message; } }
03cc2e29-99ea-46a4-bcdf-da25100e59aa
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-28 02:31:24", "repo_name": "liuxver/springcloud", "sub_path": "/test/eureka-client-order/src/main/java/com/example/eurekaclientorder/controller/ShopCarController.java", "file_name": "ShopCarController.java", "file_ext": "java", "file_size_in_byte": 1226, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "e9ba32f9a71960f21b2dd20e922f9f31694bcef6", "star_events_count": 1, "fork_events_count": 3, "src_encoding": "UTF-8"}
https://github.com/liuxver/springcloud
289
FILENAME: ShopCarController.java
0.27513
package com.example.eurekaclientorder.controller; import com.example.eurekaclientorder.entites.ShopCar; import com.example.eurekaclientorder.service.ShopCarServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController public class ShopCarController { @Autowired ShopCarServiceImpl shopCarService; //获取购物车列表 @GetMapping("/cars/{id}") public List<ShopCar> findAll(@PathVariable("id") Integer id){ List<ShopCar> cars = shopCarService.findAllByUserid(id); return cars; } //购物车添加书 @PostMapping("/car/{id}") public ShopCar add(@PathVariable("id") Integer goodsid, @RequestParam("userid") Integer userid){ System.out.println( goodsid +": "+userid+" 1111111111111111111111111"); ShopCar shopCar = new ShopCar(); shopCar.setUserid(userid); shopCar.setGoodsid(goodsid); return shopCarService.save(shopCar); } //删除一本书本信息 @DeleteMapping("/car/{id}") public String deleteOne(@PathVariable("id") Integer id){ shopCarService.delete(id); return "success"; } }
61b31a05-3b52-4f77-974c-50d49f1602b8
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-11-01T14:06:51", "repo_name": "mstheguru/Interview-API-Django", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 976, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "6898e62b819061a311560e0d285ad6c10f54006f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/mstheguru/Interview-API-Django
218
FILENAME: README.md
0.250913
# Interview-API-Django API for candidates/interviewers to register their available time slots &amp; API which will return interview schedulable time slots as a list which will take candidate id and interviewer id as input. ##### Installation - Clone this repository: `git clone https://github.com/mstheguru/Interview-API-Django.git` - Create a virtual environment outside the cloned project using python 3.7 `virtualenv -p python3.7 <environment_name>` - Activate the virtual environment: `source <path_to_virtual_env>/bin/activate` - `cd` to the folder `Interview-API-Django` - Install the dependencies using `pip intsall -r requirements.txt` - Database used: `sqlite3` ##### Setting up the application - Migrate using command `python manage.py migrate` before running the application - Create super user for django admin access: `python manage.py createsuperuser` ##### Run the application - Run the application using command: `python manage.py runserver <host>:<port>`
ca2267b7-4916-44f5-b773-62c075d73ae9
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-13T19:09:04", "repo_name": "sebastienduchenne/Boggle", "sub_path": "/client/src/gui/View_resultat_controller.java", "file_name": "View_resultat_controller.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "0a61f6452c6fd377b6894bdac09cdfc70cae0fd4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/sebastienduchenne/Boggle
194
FILENAME: View_resultat_controller.java
0.250913
package gui; import java.io.IOException; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.BorderPane; public class View_resultat_controller { private App mainApp; @FXML private void initialize() { } public void showResTour() { try { FXMLLoader loader = new FXMLLoader(); loader.setLocation(App.class.getResource("../gui/resultats.fxml")); AnchorPane battle = (AnchorPane) loader.load(); BorderPane rootLayout = mainApp.getRootLayout(); rootLayout.setCenter(battle); rootLayout.setStyle("-fx-background: #FFFFFF;"); View_jouer_controller controller = loader.getController(); controller.setMainApp(mainApp); } catch (IOException e) { e.printStackTrace(); } } public void setMainApp(App mainApp) { this.mainApp = mainApp; } }
64a22f01-064e-49b5-aeb5-c6886df8c503
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-04-03T21:42:23", "repo_name": "canadahousing/quebec-realtors", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1184, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "0b7859c568822246cbec398a7265207c84b8e969", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/canadahousing/quebec-realtors
281
FILENAME: README.md
0.255344
# quebec-realtors Data on Quebec realtors and disciplinary measures from [The Organisme d’autoréglementation du courtage immobilier du Québec](https://www.oaciq.com/en#find-broker) Up to date as of March 9, 2021. ## Source The [OACIQ](https://www.oaciq.com/en#find-broker) is the Authority of Real Estate Brokerages in Quebec. They host a database of realtors along with disciplinary measures. It is not possible to see or analyze the entire dataset and they make searching it difficult and slow. ## Data The JSON and CSV files in this document contain 15,865 records. Brokerages are included but do not contain disciplinary mesaures. ## Structure | Field | Description | | ------------- |:-------------| | text | Text of the disciplinary measures section. Filter out fields that say "No administrative statement or disciplinary measure" to remove realtors with no issues. | | html | Enter HTML contains of the disciplinary measures field. | | name | Realtors name | | dateCreated | Date scraped | | url | Original URL | | id | Realtor's ID | | agencyId | ID of their real estate brokerage | | agency | Brokerage name | | status | Realtor's satus, either valid or invalid |
6334046a-cb8f-44b8-ac5e-c5ac3ddcf527
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-05-11T14:34:01", "repo_name": "sterpe/japanese-name-generator", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1001, "line_count": 47, "lang": "en", "doc_type": "text", "blob_id": "2bbbf2d9d9c7e544aaa0bd26dc30d729995cef2a", "star_events_count": 10, "fork_events_count": 3, "src_encoding": "UTF-8"}
https://github.com/sterpe/japanese-name-generator
273
FILENAME: README.md
0.284576
# japanese-name-generator ![Japanese Name Generator](http://nd06.jxs.cz/033/857/642dda4c84_95676290_o2.jpg) [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) ## installation ``` npm install --save japanese-name-generator ``` ## usage ```javascript var generate = require('japanese-name-generator') var japanesePerson = generate() japanesePerson.gender // 'female' japanesePerson.name // 'Matsushima Rinako' japanesePerson.surname // 'Matsushima' japanesePerson.firstName // 'Rinako' // Gender is random but you may, alternately, generate names of a // specific gender by passing `options.gender' as either // `male' or `female': var japaneseMale = generate({ gender: 'male' }) var japaneseFemale = generate({ gender: 'female' }) ``` ### cli ```bash $ npm install -g japanese-name-generator $ japanese-name-generator -g female Matsushima Rinako ``` ## tests Run the unit tests with `make`. ``` make test ``` ## license MIT
6bff5f69-882f-4261-8d15-1b648773905c
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-08 18:31:59", "repo_name": "Feavy/Pokemon", "sub_path": "/src/fr/feavy/pokemon/ui/scenes/world/WorldScene.java", "file_name": "WorldScene.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "76f7869ade7f5f97169dd9be84197564969c565b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Feavy/Pokemon
234
FILENAME: WorldScene.java
0.272799
package fr.feavy.pokemon.ui.scenes.world; import fr.feavy.pokemon.map.Map; import fr.feavy.pokemon.ui.scenes.Scene; import java.awt.*; import java.awt.image.ImageObserver; import static fr.feavy.pokemon.ui.GamePanel.TILE_WIDTH; public class WorldScene extends Scene { private final Camera camera; private Map map; public WorldScene(Map map, Camera camera) { this.map = map; this.camera = camera; } @Override public void draw(Graphics2D g, ImageObserver observer) { drawMap(g, observer); drawEntities(g, observer); } private void drawMap(Graphics2D g, ImageObserver observer) { for(int line = 0; line < 9; line++) { for(int column = 0; column < 10; column++) { map.getTile(column, line).drawTo(createSubGraphics(g, column*TILE_WIDTH, line*TILE_WIDTH, TILE_WIDTH, TILE_WIDTH)); } } } private void drawEntities(Graphics2D g, ImageObserver observer) { } }
a0e9b921-040e-43e1-9054-6c671a5ccba7
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-01-03T07:59:24", "repo_name": "Jackieriel/TodoApp", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1157, "line_count": 58, "lang": "en", "doc_type": "text", "blob_id": "79e92388e3256d9471e87c98e5541353b1a37038", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/Jackieriel/TodoApp
284
FILENAME: README.md
0.272799
# TodoApp A simple todo app written with Laravel 7.0 to demonstrate CRUD operation. ## Installation Clone the repository- ``` git clone https://github.com/Jackieriel/TodoApp.git ``` Then cd into the folder with this command- ``` cd TodoApp ``` Then initialize a composer install ``` composer install ``` Next create a environment file using this command- ``` cp .env.example .env ``` Then edit `.env` file with appropriate credential for your database server. Just edit these two parameter(`DB_USERNAME`, `DB_PASSWORD`). Then create a database named `toDoApp` and then do a database migration using this command- ``` php artisan migrate ``` Finally generate application key, which will be used for password hashing, session and cookie encryption etc. ``` php artisan key:generate ``` ## Run server Run server using this command- ``` php artisan serve ``` Then go to `http://localhost:8000` from your browser and see the app. ## Having problem running the app? If you have any problem running the App please contact me +2348131327382 Follow me up on twitter https://twitter.com/jackieriel1 ## Screenshot ![Landing Page](/screenshots/1.png)
797081a0-8abe-48eb-b82a-32b644f6aa01
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-07 07:59:26", "repo_name": "luqingrun/framework", "sub_path": "/framework-base/src/main/java/com/jiuxian/framework/monitor/AopInterceptor.java", "file_name": "AopInterceptor.java", "file_ext": "java", "file_size_in_byte": 1208, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "f7ebe46b3f7464477c993c03514a61e167e8a408", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
https://github.com/luqingrun/framework
223
FILENAME: AopInterceptor.java
0.292595
package com.jiuxian.framework.monitor; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class AopInterceptor implements MethodInterceptor { private static Log log = LogFactory.getLog(AopInterceptor.class); @Override public Object invoke(MethodInvocation invocation) throws Throwable { long start = System.currentTimeMillis(); // 开始时间 String className = invocation.getThis().getClass().getName() + "." + invocation.getMethod().getName(); MonitorExecute.getConcurrent(className).incrementAndGet(); boolean error = false; try { Object result = invocation.proceed(); error =false; return result; }catch (Exception e){ error =true; throw e; }finally { long elapsed = System.currentTimeMillis() - start; // 计算调用耗时 MonitorExecute.collect(className, "aop", elapsed, error); MonitorExecute.getConcurrent(className).decrementAndGet(); } } }