blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e0efd2c96ee0cd0f116b51f36aaa3b7c5bfd3113 | 755dc53061801c4acac31bced171ef94cdc2c382 | /src/topInterviewQuestionsEasy/array/Five.java | 8443267f3f2d87fe210c97aed8f6babb8880aae0 | [] | no_license | zhengtianle/leetcode-practice | 3ecca43d8bf302e66fb5ec65e15e1f45e7c39f19 | 02a20f8e5a55fc89d49c3824dfb7d5b25c02d147 | refs/heads/master | 2020-04-03T21:24:17.285091 | 2019-05-23T04:10:18 | 2019-05-23T04:10:18 | 155,573,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 857 | java | package topInterviewQuestionsEasy.array;
import java.util.Arrays;
/**
* Created with IntelliJ IDEA.
*
* @Time 18-11-10
* @Author ZhengTianle
* Description:
* https://leetcode-cn.com/explore/interview/card/top-interview-questions-easy/1/array/25/
*/
public class Five {
public static int singleNumber(int[] nums) {
Arrays.sort(nums);
boolean repeat = false;
int i;
for(i = 1; i < nums.length; i++){
if(nums[i] == nums[i - 1]) {
repeat = true;
} else {
if(repeat == false){
break;
} else {
repeat = false;
}
}
}
return nums[i - 1];
}
public static void main(String[] args) {
System.out.println(singleNumber(new int[]{4,1,2,1,2}));
}
}
| [
"982978764@qq.com"
] | 982978764@qq.com |
697101a03f934bbb10adfc52f665101ccba259db | ab3acac170bb91736e061eea7365de98ecea3c87 | /app/src/main/java/com/irm/nkti/nktimobilebulletin/com/models/PendingFeed.java | 498d6dc3d5705f3b7dbbf88ba8c23f95d1033451 | [] | no_license | monskie88/NKTIMobileBulletin | ceb6f0e1a03567e2d2efc964c801b74f4f663672 | 92f22e0bc094eb3d2d44d7545d3addd4244594ed | refs/heads/master | 2021-01-19T04:56:16.235427 | 2015-03-25T23:05:27 | 2015-03-25T23:05:27 | 32,503,732 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,207 | java | package com.irm.nkti.nktimobilebulletin.com.models;
import com.parse.ParseClassName;
import com.parse.ParseFile;
import com.parse.ParseObject;
/**
* Created by MONSKIE on 3/19/2015.
*/
@ParseClassName("PendingFeed")
public class PendingFeed extends ParseObject {
public PendingFeed(){
}
public String getUsername(){return getString("username"); }
public String getTimePosted(){return getString("timePosted"); }
public String getStrPost(){return getString("content"); }
public void setUsername(String username){put("username",username);}
public void setContent(String content){put("content",content);}
public void setTime(String time){put("timePosted", time);}
public ParseFile getUserPhoto(){return getParseFile("userPhoto");}
public void setUserPhoto(ParseFile photo){put("userPhoto",photo);}
public String getId(){return getObjectId();}
public void setFeedPhoto(ParseFile file){put("feedPhoto",file);}
public ParseFile getFeedPhoto(){return getParseFile("feedPhoto");}
public void setAttachment(int i){put("isAttachment",i);}
public int getAttachment(){return getInt("isAttachment");}
public void setWeek(int i){ put("week",i);}
}
| [
"edmundvhermogino@yahoo.com"
] | edmundvhermogino@yahoo.com |
1465edd9dbb0f7001e42c92d6bf65d025eecb373 | ee731d0acfb6dc9465d6842245ba91a02ef93fcc | /java-enum/src/demo3/ScoreGrade.java | 0c6b7f238cc0fca21f3e776f00aeec779e992489 | [] | no_license | siwolsmu89/J_HTA_java_workspace | 6a668c421c5ada7b792be0ee0a94b3232bd109ca | 43b0bae8e5b7cb68513d8670b136f098d7b8a4e1 | refs/heads/master | 2022-11-18T17:23:29.458359 | 2020-07-20T08:57:02 | 2020-07-20T08:57:02 | 258,408,262 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | package demo3;
public enum ScoreGrade {
A(100, 90), B(89, 80), C(79, 70), D(69, 60), F(59, 0);
private final int high;
private final int low;
ScoreGrade(int high, int low){
this.high = high;
this.low = low;
}
public int getHigh() {
return high;
}
public int getLow() {
return low;
}
}
| [
"siwol_smuire89@naver.com"
] | siwol_smuire89@naver.com |
f249099092d0461e44f451e74a5e41e95fc19a78 | 3309c8655baebd7f5f4cb5b04c9ef5c161f5f0b7 | /coreASIM/org.coreasim.engine/src/org/coreasim/engine/plugins/tree/DFTFunctionElement.java | 9213352f2a704284ea676436ad410c85482c85fb | [
"AFL-3.0"
] | permissive | biomics/icef | 3f7cc4ad6da711262f2e163b0d11486be1a641f8 | d69f9be9b1f773598b47de5736f16c0daaffccea | refs/heads/master | 2021-01-17T09:51:28.442886 | 2017-09-07T05:54:53 | 2017-09-07T05:54:53 | 58,002,569 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,496 | java | /*
* DFTFunctionElement.java
*
* Copyright (C) 2010 Dipartimento di Informatica, Universita` di Pisa, Italy.
*
* Author: Franco Alberto Cardillo (facardillo@gmail.com)
*
* Licensed under the Academic Free License version 3.0
* http://www.opensource.org/licenses/afl-3.0.php
* http://www.coreasm.org/afl-3.0.php
*
*/
package org.coreasim.engine.plugins.tree;
import java.util.List;
import org.coreasim.engine.CoreASIMError;
import org.coreasim.engine.absstorage.Element;
import org.coreasim.engine.absstorage.FunctionElement;
import org.coreasim.engine.absstorage.Signature;
import org.coreasim.engine.plugins.list.ListBackgroundElement;
import org.coreasim.engine.plugins.list.ListElement;
/**
* Function returning an enumeration of the values contained in the tree performing a depth first traversal
*
* @author Franco Alberto Cardillo (facardillo@gmail.com)
*/
public class DFTFunctionElement extends FunctionElement {
public static final String DFT_FUNC_NAME = TreePlugin.TREE_PREFIX + "DFT";
public static final String DFT_NODES_FUNC_NAME = TreePlugin.TREE_PREFIX + "DFTN";
protected Signature signature = null;
/**
* If valuesOnly is set to true, the function returns the values contained
* in the nodes with a BFT. If set to false, the function returns the nodes
* themselves
*/
protected boolean valuesOnly;
public DFTFunctionElement(boolean valuesOnly) {
this.valuesOnly = valuesOnly;
setFClass(FunctionClass.fcMonitored);
} // constructor
/* (non-Javadoc)
* @see org.coreasm.engine.absstorage.FunctionElement#getValue(java.util.List)
*/
@Override
public Element getValue(List<? extends Element> args) {
if (!checkArguments(args))
throw new CoreASIMError("Illegal arguments for " + (valuesOnly ? DFT_FUNC_NAME : DFT_NODES_FUNC_NAME) + ".");
TreeNodeElement node = (TreeNodeElement) args.get(0);
// Enumeration
if(valuesOnly)
return new ListElement(node.DFT());
else
return new ListElement(node.DFTNodes());
}
@Override
public Signature getSignature() {
if (signature == null) {
signature = new Signature();
signature.setDomain(TreeBackgroundElement.TREE_BACKGROUND_NAME);
signature.setRange(ListBackgroundElement.LIST_BACKGROUND_NAME);
}
return signature;
}
/*
* Checks the arguments of the function
*/
protected boolean checkArguments(List<? extends Element> args) {
return (args.size() == 1) && (args.get(0) instanceof TreeNodeElement);
}
} // DFTFunctionElement.java
| [
"ds@sec.uni-passau.de"
] | ds@sec.uni-passau.de |
eefe745bc9a2fdee51075d98889619e78fca66a7 | a455c85330393a8a704bff3c3fed1cbb1dcaae7e | /allure2/src/main/java/io/swagger/petstore/PetActions.java | aabc8ab8c8a673a9334584ae535be0efb76925da | [] | no_license | liyyq007/javaRestAssuredAllure | c91f081605d7ece2ed715d5720926c9de3c0f2e1 | 4c7678f1591c753e3f075265eb324def89ba8fd2 | refs/heads/master | 2020-05-21T05:07:52.425636 | 2017-10-11T08:07:51 | 2017-10-11T08:07:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,350 | java | package io.swagger.petstore;
import io.qameta.allure.restassured.AllureRestAssured;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.filter.log.LogDetail;
import io.restassured.http.ContentType;
import io.restassured.specification.RequestSpecification;
import io.swagger.petstore.entities.MessageResponse;
import io.swagger.petstore.entities.Pet;
import static io.restassured.RestAssured.given;
class PetActions {
private RequestSpecification requestSpecification;
PetActions() {
requestSpecification = new RequestSpecBuilder()
.addHeader("api_key", "1qa2ws3ed4rfvcxz")
.setBaseUri("http://petstore.swagger.io")
.setBasePath("/v2/pet")
.setContentType(ContentType.JSON)
.log(LogDetail.ALL).addFilter(new AllureRestAssured()).build();
}
Pet addNewPet(Pet petRequest) {
return given(requestSpecification)
.body(petRequest)
.post().as(Pet.class);
}
void deletePet(Pet pet) {
given(requestSpecification)
.delete(pet.getId());
}
MessageResponse getAbsentPet(Pet pet) {
return given(requestSpecification)
.get(pet.getId())
.then()
.extract().body().as(MessageResponse.class);
}
}
| [
"bravoaqa@gmail.com"
] | bravoaqa@gmail.com |
e59fa6966b47d41d70bcd2fb68214bab93aa4729 | 82e2312b6eeb4eb7d144e9363ff62ed7a336287a | /src/main/java/io/github/mouadyou/interfaces/Shape.java | 285b95b403b7f89e454a106bf6780b072899a50e | [] | no_license | Ryu72/test | 67ae5f16057c52c5f33fbd50fa183fd173c935f0 | 8fccebfe46c1024833a91367121973b757ac25ac | refs/heads/master | 2020-04-08T16:36:07.103459 | 2018-11-28T15:50:56 | 2018-11-28T15:50:56 | 159,525,849 | 0 | 0 | null | 2018-11-28T15:50:57 | 2018-11-28T15:45:42 | Java | UTF-8 | Java | false | false | 244 | java | package io.github.mouadyou.interfaces;
public interface Shape {
//implicitly public, static and final
public String LABLE = "Shape";
//interface methods are implicitly abstract and public
void draw();
double getArea();
}
| [
"youssef-mouad@github.com"
] | youssef-mouad@github.com |
6c9e2ca24e9ec4000f85adee21b629315e0f3efa | e4df6b2c6dea50501a8a2485887d9fd30c393fff | /app/src/main/java/com/example/alinawiedemann/festivalapplication/MainActivity.java | 1bb502308b7d208a55ace032af7b9e7ef9d3365e | [] | no_license | juleika/FestivalApplication | e8e524b6108e5ef86c7b2ece57065a7eb0a826d4 | 98337a8ed9ee7c87a7c2cfc56eeb39d19419847c | refs/heads/master | 2020-03-25T15:12:09.401926 | 2018-08-07T12:14:14 | 2018-08-07T12:14:14 | 143,871,277 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 359 | java | package com.example.alinawiedemann.festivalapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"alinaw@posteo.de"
] | alinaw@posteo.de |
c1fca50fa50ff0ce74c02ced04328005ca33db14 | f495912cd3d4823e1c23d54336fdc15ebe27b804 | /BackTalkApp/src/com/mt523/backtalk/views/GuessInput.java | b1987c233702f5a9f27da19b5f3a8766f0a50a44 | [] | no_license | mtostenson/SeniorProject | 62c6c37e39b50d00cb48a334b2dc48ad2bbc35c2 | 2adbcc9bd041ac2e4e38dde6e992084c1ac2f840 | refs/heads/master | 2021-01-15T14:18:46.973299 | 2015-05-06T03:58:27 | 2015-05-06T03:58:27 | 29,702,990 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 993 | java | package com.mt523.backtalk.views;
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.widget.EditText;
import com.mt523.backtalk.fragments.GuessFragment;
public class GuessInput extends EditText {
private final String TAG = GuessInput.class.getName();
private GuessFragment guessFragment;
public GuessInput(Context context, AttributeSet attrs) {
super(context, attrs);
}
public GuessInput(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public void setGuessFragment(GuessFragment guessFragment) {
this.guessFragment = guessFragment;
}
@Override
public boolean dispatchKeyEventPreIme(KeyEvent event) {
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
guessFragment.onUserCloseKeyboard();
return true;
} else {
return super.dispatchKeyEventPreIme(event);
}
}
}
| [
"mtostenson@mail.csuchico.edu"
] | mtostenson@mail.csuchico.edu |
28fba2b7c1ba127e663e8ca1818a1ff38f3e71ae | 403236c6d0389d696250c7b038b8a41fbfaae427 | /src/scholar/utils/tor/TestTor.java | 5ee06179f34d4eed30b3c53a2a0b6a1715ba09e8 | [] | no_license | JusteRaimbault/ScholarAPI | 0ce04b45fa0e1dc2510db403efac184c70048cfb | c9f41c8bef9fe0742c6498690b5a88be96f09d45 | refs/heads/master | 2020-04-02T07:30:48.586988 | 2019-04-08T07:37:12 | 2019-04-08T07:37:12 | 60,001,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,038 | java | /**
*
*/
package scholar.utils.tor;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import org.jsoup.nodes.Document;
import scholar.ScholarAPI;
/**
* @author Raimbault Juste <br/> <a href="mailto:juste.raimbault@polytechnique.edu">juste.raimbault@polytechnique.edu</a>
*
*/
public class TestTor {
public static void testTorPool(){
TorPool.initPool(9050, 9100, 25);
/*for(TorThread t:TorThread.torthreads.keySet()){
System.out.println(t.port);
}*/
TorPool.runPool();
TorPool.stopPool();
}
public static void testCircuitsIP(){
TorPool.initPool(9050, 9200, 100);
TorPool.runPool();
System.setProperty("socksProxyHost", "127.0.0.1");
for(Integer p:TorPool.used_ports.keySet()){
try{
System.out.println(p.intValue());
System.setProperty("socksProxyPort",p.toString());
BufferedReader r = new BufferedReader(new InputStreamReader(new URL("http://ipecho.net/plain").openConnection().getInputStream()));
String currentLine=r.readLine();
while(currentLine!= null){System.out.println(currentLine);currentLine=r.readLine();}
}catch(Exception e){e.printStackTrace();}
}
TorPool.stopPool();
}
public static void testScholarAvailability(){
int totalIps = 30;
int successCount = 0;
TorPool.initPool(9050, 9050+totalIps, totalIps);
TorPool.runPool();
System.setProperty("socksProxyHost", "127.0.0.1");
for(Integer p:TorPool.used_ports.keySet()){
try{
System.out.println("Port : "+p.intValue());
System.setProperty("socksProxyPort",p.toString());
// check ip
System.out.println("IP : ");
BufferedReader r = new BufferedReader(new InputStreamReader(new URL("http://ipecho.net/plain").openConnection().getInputStream()));
String currentLine=r.readLine();
while(currentLine!= null){System.out.println(currentLine);currentLine=r.readLine();};
ScholarAPI.init();
Document d = ScholarAPI.request("scholar.google.com","scholar?q=transfer+theorem+probability&lookup=0&start=0");
try{
try{System.out.println(d.getElementsByClass("gs_rt").first().html());}catch(Exception e){}
try{System.out.println(d.getElementsByClass("gs_alrt").first().html());}catch(Exception e){}
System.out.println(d.getElementsByClass("gs_rt").first().text());
successCount++;
}catch(Exception e){e.printStackTrace();System.out.println("Connexion refused by ggl fuckers");}
}catch(Exception e){e.printStackTrace();}
}
//TorThread.stopPool();
System.out.println("Success Ratio : "+successCount*1.0/(totalIps*1.0));
TorPool.stopPool();
}
/**
* Same test as before but using the port switching function.
*/
public static void testScholarAvailibilityPortSwitching(){
int totalIps = 30;
int successCount = 0;
TorPool.initPool(9050, 9050+totalIps, totalIps);
TorPool.runPool();
System.setProperty("socksProxyHost", "127.0.0.1");
while(TorPool.used_ports.size()>0){
System.out.println(TorPool.used_ports.size());
TorPool.switchPort(false);
ScholarAPI.init();
Document d = ScholarAPI.request("scholar.google.com","scholar?q=transfer+theorem+probability&lookup=0&start=0");
try{
try{System.out.println(d.getElementsByClass("gs_rt").first().text());}catch(Exception e){}
try{System.out.println(d.getElementsByClass("gs_alrt").first().text());}catch(Exception e){}
System.out.println(d.getElementsByClass("gs_rt").first().text());
successCount++;
}catch(Exception e){e.printStackTrace();System.out.println("Connexion refused by ggl fuckers");}
}
System.out.println("Success Ratio : "+successCount*1.0/(totalIps*1.0));
TorPool.stopPool();
}
/**
* @param args
*/
public static void main(String[] args) {
//testTorPool();
//testCircuitsIP();
//TorPool.forceStopPID(2117,2213);
//TorPool.forceStop(9050, 9100);
testScholarAvailibilityPortSwitching();
}
}
| [
"raimbaultjwin@gmail.com"
] | raimbaultjwin@gmail.com |
c15912eea0bc85de200bccc57aabdb93d92c7f19 | e84d09ca833d2a0b8276ba5f22e8f7603d5aac7f | /src/main/java/com/richlum/Application.java | e823662389653d754a3a983cd850e70b457b858e | [] | no_license | richlum/sb_restconsume_scheduled | 8af71741caaf7b0059190f2949ad06904ba0b48d | fab6ad2824a7f9fb503b1065648a2b573be52f93 | refs/heads/master | 2020-03-08T02:11:38.792616 | 2018-04-09T05:22:04 | 2018-04-09T05:22:04 | 127,852,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 824 | java | package com.richlum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class Application {
public static final Logger log = LoggerFactory.getLogger(Application.class);
public static void main(String args[]) {
// RestTemplate restTemplate = new RestTemplate();
// Quote quote = restTemplate.getForObject("http://gturnquist-quoters.cfapps.io/api/random", Quote.class);
// log.info(quote.toString());
SpringApplication.run(Application.class,args);
}
}
| [
"richardlum13@gmail.com"
] | richardlum13@gmail.com |
e0fe7783c840b2285310f2c0606ee4776b72dab8 | 695f68a6e3970dc08e235510d5e6003eb8cee875 | /kodilla-patterns/src/main/java/com/kodilla/patterns/prototype/library/Library.java | 9070edf4a7baf9febe39afe3cb92fa6fb690d276 | [] | no_license | Lukasz-code/zad-14.2 | f33966b654a86f91ea758f1d3a61b1bbabd5b4df | 46e3979d69520a816f0729c28c441425dd0cb2c4 | refs/heads/master | 2021-02-12T20:17:15.927324 | 2020-06-13T14:53:08 | 2020-06-13T14:53:08 | 244,626,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,197 | java | package com.kodilla.patterns.prototype.library;
import java.util.HashSet;
import java.util.Set;
public final class Library extends Prototype {
private String name;
private Set<Book> books = new HashSet<>();
public Library(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Set<Book> getBooks() {
return books;
}
@Override
public String toString() {
return "Library{" +
"name='" + name + "\n" +
", books=" + books +
'}';
}
public Library shallowCopy() throws CloneNotSupportedException {
return (Library)super.clone();
}
public Library deepCopy() throws CloneNotSupportedException {
Library clonedLibrary = (Library)super.clone();
clonedLibrary.books = new HashSet<>();
for(Book theBook : books) {
Book clonedBook = new Book(theBook.getTitle(), theBook.getAuthor(), theBook.getPublicationDate());
clonedLibrary.getBooks().add(clonedBook);
}
return clonedLibrary;
}
} | [
"lukaszschweda@gmail.com"
] | lukaszschweda@gmail.com |
45241ca76853525d60eeca714ddc8b4543ecee54 | 09df43a1b3df743e0445d264a3dcf4af7c65fe54 | /Test/src/main/java/com/dao/zf/OpenitemDao.java | 4e437d1fce73d0a4095f6c50b5f5c0c994a94f74 | [] | no_license | whojinbao/Test | 895dac02d2da68ec27f6d8bd5eb11e56cf6284a1 | c14ade16bb0aee52a82b941bda35bdcd4cecb77a | refs/heads/master | 2021-01-21T09:10:55.707660 | 2017-08-31T06:11:31 | 2017-08-31T06:11:31 | 101,965,579 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 744 | java | package com.dao.zf;
import java.util.List;
import com.entity.Openitem;
/**
* @author 作者 E-mail:
* @version 创建时间:2017年8月30日 上午9:08:56
* 类说明
* openitemDao : 对发布的项目的数据库操作
*/
public interface OpenitemDao {
/**
* getOpenitems :查询所有已发布的项目
* @return
*/
public List<Openitem> getOpenitems();
/**
* addOpenitem : 添加一个要发布的项目
* @param openitem :要发布的项目
* @return
*/
public int addOpenitem(Openitem openitem);
/**
* quertOpenitem : 查询指定项目
* @param itemId :要查询项目编号
* @return 该项目
*/
public Openitem quertOpenitem(String itemId);
}
| [
"953632865@qq.com"
] | 953632865@qq.com |
f722eba63c51f8dcca53985c9ee809eec45d0a4d | d7c5121237c705b5847e374974b39f47fae13e10 | /airspan.netspan/src/main/java/Netspan/NBI_15_1/Lte/CellAdvancedProfileConfigClone.java | 3023f265705da36270d07f796933dc83b2cbc536 | [] | no_license | AirspanNetworks/SWITModules | 8ae768e0b864fa57dcb17168d015f6585d4455aa | 7089a4b6456621a3abd601cc4592d4b52a948b57 | refs/heads/master | 2022-11-24T11:20:29.041478 | 2020-08-09T07:20:03 | 2020-08-09T07:20:03 | 184,545,627 | 1 | 0 | null | 2022-11-16T12:35:12 | 2019-05-02T08:21:55 | Java | UTF-8 | Java | false | false | 2,518 | java |
package Netspan.NBI_15_1.Lte;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="CloneFromName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="CellAdvancedProfile" type="{http://Airspan.Netspan.WebServices}EnbCellAdvancedProfile" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"cloneFromName",
"cellAdvancedProfile"
})
@XmlRootElement(name = "CellAdvancedProfileConfigClone")
public class CellAdvancedProfileConfigClone {
@XmlElement(name = "CloneFromName")
protected String cloneFromName;
@XmlElement(name = "CellAdvancedProfile")
protected EnbCellAdvancedProfile cellAdvancedProfile;
/**
* Gets the value of the cloneFromName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCloneFromName() {
return cloneFromName;
}
/**
* Sets the value of the cloneFromName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCloneFromName(String value) {
this.cloneFromName = value;
}
/**
* Gets the value of the cellAdvancedProfile property.
*
* @return
* possible object is
* {@link EnbCellAdvancedProfile }
*
*/
public EnbCellAdvancedProfile getCellAdvancedProfile() {
return cellAdvancedProfile;
}
/**
* Sets the value of the cellAdvancedProfile property.
*
* @param value
* allowed object is
* {@link EnbCellAdvancedProfile }
*
*/
public void setCellAdvancedProfile(EnbCellAdvancedProfile value) {
this.cellAdvancedProfile = value;
}
}
| [
"build.Airspan.com"
] | build.Airspan.com |
91cd431eeb683b704c6d37a1e25e0c68454e557c | b868a1cce5820782ba696981211d93e5caa8f623 | /org.summer.dsl.xbase/src/org/summer/dsl/xbase/scoping/batch/TypeLiteralScope.java | 85afb86a2f7ea68dd87ea2b94be9c78f8796c99b | [] | no_license | zwgirl/summer | 220693d71294f8ccffe1b58e8bc1dea44536c47c | 1da11dfb5c323d805422c9870382fb0a81d5a8f1 | refs/heads/master | 2021-01-22T22:57:46.801255 | 2014-04-29T22:00:21 | 2014-04-29T22:00:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,789 | java | /*******************************************************************************
* Copyright (c) 2013 itemis AG (http://www.itemis.eu) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.summer.dsl.xbase.scoping.batch;
import java.util.Collection;
import java.util.Collections;
import org.eclipse.emf.ecore.EObject;
import org.summer.dsl.model.types.JvmMember;
import org.summer.dsl.model.types.JvmType;
import org.summer.dsl.model.types.TypesPackage;
import org.eclipse.xtext.naming.QualifiedName;
import org.eclipse.xtext.resource.IEObjectDescription;
import org.eclipse.xtext.scoping.IScope;
import org.summer.dsl.model.xbase.XAbstractFeatureCall;
import org.summer.dsl.xbase.typesystem.IResolvedTypes;
/**
* @author Sebastian Zarnekow - Initial contribution and API
*/
public class TypeLiteralScope extends AbstractSessionBasedScope {
private final QualifiedName parentSegments;
private final IResolvedTypes resolvedTypes;
protected TypeLiteralScope(IScope parent, IFeatureScopeSession session, XAbstractFeatureCall featureCall, IResolvedTypes resolvedTypes, QualifiedName parentSegments) {
super(parent, session, featureCall);
this.resolvedTypes = resolvedTypes;
this.parentSegments = parentSegments;
}
@Override
protected Collection<IEObjectDescription> getLocalElementsByName(QualifiedName name) {
XAbstractFeatureCall featureCall = getFeatureCall();
if (featureCall.isExplicitOperationCallOrBuilderSyntax())
return Collections.emptyList();
QualifiedName fqn = parentSegments.append(name);
IScope typeScope = getSession().getScope(getFeatureCall(), TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE, resolvedTypes);
IEObjectDescription typeDescription = typeScope.getSingleElement(fqn);
if (typeDescription != null) {
EObject type = typeDescription.getEObjectOrProxy();
if (type instanceof JvmType)
return Collections.<IEObjectDescription>singletonList(new TypeLiteralDescription(typeDescription, isVisible((JvmType) type)));
}
return Collections.emptyList();
}
@Override
protected boolean isShadowed(IEObjectDescription fromParent) {
if (fromParent.getName() == null)
return true;
return super.isShadowed(fromParent);
}
protected boolean isVisible(JvmType type) {
if (type instanceof JvmMember)
return getSession().isVisible((JvmMember) type);
return true; // primitives et. al
}
@Override
protected Iterable<IEObjectDescription> getAllLocalElements() {
return Collections.emptyList();
}
}
| [
"1141196380@qq.com"
] | 1141196380@qq.com |
e92f92d934e8a70415c0e612166109cdaa919009 | e8c4da20238c11e8585b23cadaa8656d41115411 | /src/main/java/frc/robot/subsystems/Processor.java | 84d848633e3c3ebc5c2f17fa5b4cb9d87093c030 | [] | no_license | FRC-4121/2020-Robot | 0253a13fdd0030f6f0c21732f1a73fe527825d27 | 4c9cf3dfda01ae769bade4882402cca7be262564 | refs/heads/master | 2020-12-06T23:41:02.457472 | 2020-10-27T22:24:44 | 2020-10-27T22:24:44 | 232,581,783 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,080 | java | /*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc.robot.subsystems;
import static frc.robot.Constants.*;
import static frc.robot.Constants.ProcessorConstants.*;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Processor extends SubsystemBase {
private WPI_TalonSRX intake = new WPI_TalonSRX(INTAKE);
private CANSparkMax processorMain = new CANSparkMax(PROCESSOR_MAIN, MotorType.kBrushless);
private WPI_TalonSRX processorLock = new WPI_TalonSRX(PROCESSOR_END);
public Processor() {
}
@Override
public void periodic() {
// This method will be called once per scheduler run
SmartDashboard.putNumber("Processor Current", processorMain.getOutputCurrent());
//boolean logic tree for default setup
}
//invertDirection = false: normal intake->shooter direction
public void runProcessor(boolean invertDirection){
if(!invertDirection)
{
processorMain.set(kProcessorSpeed);
intake.set(kIntakeSpeed);
lockProcessor();
}
else
{
processorMain.set(-kProcessorSpeed);
intake.set(kOuttakeSpeed);
}
}
public void unlockProcessor(){
processorLock.set(kUnlockSpeed);
}
public void lockProcessor(){
processorLock.set(kLockSpeed);
}
public void stopProcessor(){
intake.set(0);
processorMain.set(0);
processorLock.set(0);
}
public void deflectBalls(){}
public void vomitBalls(){}
}
| [
"jonasmuhlenkamp@gmail.com"
] | jonasmuhlenkamp@gmail.com |
f21130f9564e64ef2f9183fb67e511ddfc114eaf | f0d6113cb5a6b272009bb09aa179b35cf06bc0f9 | /app/src/main/java/com/example/oh011798/bams/SignupActivity.java | 65083df6ebd8c9f900a1eb3a1cf44c0bce7437cc | [] | no_license | NakhyunKim/BAMS | c55945f954a1cbdf836173bcb0ef9ddd37c35ddd | 610821811701a151cd4677c3e1b06cbea1a01317 | refs/heads/master | 2021-01-17T10:58:37.649123 | 2015-11-25T09:26:09 | 2015-11-25T09:26:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,772 | java | package com.example.oh011798.bams;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
/**
* Created by oh011 on 2015-11-03.
*/
public class SignupActivity extends Activity{
final Context context = this;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup);
}
public void onClick(View view)
{
switch (view.getId())
{
case R.id.ok:{
Toast.makeText(SignupActivity.this, "회원가입 성공!!", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
finish();
break;
}
case R.id.signup_major: {
final Button btn_major = (Button)findViewById(R.id.signup_major);
final CharSequence[] items = { "기계공학과", "산업공학과", "화학공학과", "신소재공학과", "응용화학생명공학과", "환경공학과", "건설시스템공학과",
"교통시스템공학과", "건축학과", "전자공학과", "정보컴퓨터공학과", "소프트웨어융합학과", "미디어학과", "국방디지털융합학과", "사이버보안학과",
"수학과", "물리학과", "화학과", "생명과학과", "경영학과", "e-비즈니스학과", "금융공학과", "국어국문학과", "영어영문학과", "불어불문학과", "사학과",
"문화콘텐츠학과", "경제학과", "행정학과", "심리학과", "사회학과", "정치외교학과", "스포츠레저학과", "의학과", "간호학과"};
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
// 제목셋팅
alertDialogBuilder.setTitle("학과");
alertDialogBuilder.setItems(items,new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
//Toast.makeText(getApplicationContext(),items[id] + " 선택했습니다.",Toast.LENGTH_SHORT).show();
btn_major.setText(items[id]);
dialog.dismiss();
}
});
// 다이얼로그 생성
AlertDialog alertDialog = alertDialogBuilder.create();
// 다이얼로그 보여주기
alertDialog.show();
}
}
}
}
| [
"oh011798@naver.com"
] | oh011798@naver.com |
6ad8a3a9abc8cfc65765a177728adb926c50e19d | 1aab3576db9d8293be0c4c812dd66abbe737cc75 | /HW8/src/main/java/ru/otus/application/shell/GenreShell.java | 7b49f3a6bcabb86cf5404d32a4eaa9180d80cb73 | [] | no_license | shubnikofff/otus_spring_2019_05_homework | fa33ee45fb2de8515a675291ad7cfdc35dae0244 | acfe4fad5f8fc38273adb5eb5ef652e472523e1b | refs/heads/master | 2022-02-10T21:50:31.287166 | 2020-06-01T11:37:31 | 2020-06-01T11:37:31 | 189,717,719 | 0 | 0 | null | 2022-01-21T23:33:01 | 2019-06-01T10:05:37 | Java | UTF-8 | Java | false | false | 1,441 | java | package ru.otus.application.shell;
import org.springframework.shell.Availability;
import org.springframework.shell.standard.*;
import ru.otus.domain.exception.OperationException;
import ru.otus.domain.model.Genre;
import ru.otus.application.service.stringifier.Stringifier;
import ru.otus.application.service.frontend.GenreFrontend;
@ShellComponent
@ShellCommandGroup("Genres")
public class GenreShell {
private final GenreFrontend frontend;
private final Stringifier<Genre> stringifier;
private Genre currentGenre;
public GenreShell(GenreFrontend frontend, Stringifier<Genre> stringifier) {
this.frontend = frontend;
this.stringifier = stringifier;
}
@ShellMethod(key = "lg", value = "List all genres")
String list() {
return frontend.printAll();
}
@ShellMethod(key = "sg", value = "Specify genre for next operations")
String specify() {
currentGenre = frontend.chooseOne();
return "Current genre " + stringifier.stringify(currentGenre);
}
@ShellMethod(key = "ug", value = "Update genre")
@ShellMethodAvailability("isCurrentGenreSpecified")
String update(@ShellOption(help = "New name of the genre") final String name) throws OperationException {
frontend.update(currentGenre, name);
currentGenre = null;
return "Genre updated";
}
private Availability isCurrentGenreSpecified() {
return currentGenre == null
? Availability.unavailable("genre not specified")
: Availability.available();
}
}
| [
"shubnikov.av@gmail.com"
] | shubnikov.av@gmail.com |
83bf23376007801efc6b98c27a643b655afd25f0 | 1870552c258f154b02058f4342fd60177b95f0d7 | /com.github.eclipse.opm.parent/com.github.eclipse.opm.model/src/com/github/eclipse/opm/model/util/OPMAdapterFactory.java | 8e5d5f0756e9bbcd55c63ce56d3580a76b94f242 | [] | no_license | deveshg/eclipse | d37a9539f40c858cd1e731faa875897ef60679e3 | 76ca5c44cada21c481741392c4df2128ee3790d6 | refs/heads/master | 2016-08-11T11:50:09.503970 | 2015-07-09T14:05:31 | 2015-07-09T14:05:31 | 36,869,630 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,836 | java | /**
*/
package com.github.eclipse.opm.model.util;
import com.github.eclipse.opm.model.*;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* The <b>Adapter Factory</b> for the model.
* It provides an adapter <code>createXXX</code> method for each class of the model.
* <!-- end-user-doc -->
* @see com.github.eclipse.opm.model.OPMPackage
* @generated
*/
public class OPMAdapterFactory extends AdapterFactoryImpl {
/**
* The cached model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static OPMPackage modelPackage;
/**
* Creates an instance of the adapter factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OPMAdapterFactory() {
if (modelPackage == null) {
modelPackage = OPMPackage.eINSTANCE;
}
}
/**
* Returns whether this factory is applicable for the type of the object.
* <!-- begin-user-doc -->
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
* <!-- end-user-doc -->
* @return whether this factory is applicable for the type of the object.
* @generated
*/
@Override
public boolean isFactoryForType(Object object) {
if (object == modelPackage) {
return true;
}
if (object instanceof EObject) {
return ((EObject)object).eClass().getEPackage() == modelPackage;
}
return false;
}
/**
* The switch that delegates to the <code>createXXX</code> methods.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected OPMSwitch<Adapter> modelSwitch =
new OPMSwitch<Adapter>() {
@Override
public Adapter caseOPMObjectProcessDiagram(OPMObjectProcessDiagram object) {
return createOPMObjectProcessDiagramAdapter();
}
@Override
public Adapter caseOPMObject(OPMObject object) {
return createOPMObjectAdapter();
}
@Override
public Adapter caseOPMProcess(OPMProcess object) {
return createOPMProcessAdapter();
}
@Override
public Adapter caseOPMLink(OPMLink object) {
return createOPMLinkAdapter();
}
@Override
public Adapter caseOPMThing(OPMThing object) {
return createOPMThingAdapter();
}
@Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
};
/**
* Creates an adapter for the <code>target</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param target the object to adapt.
* @return the adapter for the <code>target</code>.
* @generated
*/
@Override
public Adapter createAdapter(Notifier target) {
return modelSwitch.doSwitch((EObject)target);
}
/**
* Creates a new adapter for an object of class '{@link com.github.eclipse.opm.model.OPMObjectProcessDiagram <em>Object Process Diagram</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see com.github.eclipse.opm.model.OPMObjectProcessDiagram
* @generated
*/
public Adapter createOPMObjectProcessDiagramAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link com.github.eclipse.opm.model.OPMObject <em>Object</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see com.github.eclipse.opm.model.OPMObject
* @generated
*/
public Adapter createOPMObjectAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link com.github.eclipse.opm.model.OPMProcess <em>Process</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see com.github.eclipse.opm.model.OPMProcess
* @generated
*/
public Adapter createOPMProcessAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link com.github.eclipse.opm.model.OPMLink <em>Link</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see com.github.eclipse.opm.model.OPMLink
* @generated
*/
public Adapter createOPMLinkAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link com.github.eclipse.opm.model.OPMThing <em>Thing</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see com.github.eclipse.opm.model.OPMThing
* @generated
*/
public Adapter createOPMThingAdapter() {
return null;
}
/**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->
* This default implementation returns null.
* <!-- end-user-doc -->
* @return the new adapter.
* @generated
*/
public Adapter createEObjectAdapter() {
return null;
}
} //OPMAdapterFactory
| [
"deveshgupta.it@gmail.com"
] | deveshgupta.it@gmail.com |
62921fc757876fa6398f566da9d59e0a3dc1fcc4 | 4e050a24f0ba5bb7944ab50b0f45a77cd7983ae9 | /pay-gateway/src/main/java/com/unichain/pay/gateway/interceptor/DirectiveInterceptor.java | be17fe9ed97bc69ed10e17950012cf24b74a171b | [] | no_license | geeker-lait/unichain-pay | f7a309fd76ad00fc002ef944e47fcfc28d811dad | d2641bbc32324c6673c7210e3d7ce0835ed35b33 | refs/heads/master | 2022-06-29T01:10:47.452885 | 2020-02-17T10:41:09 | 2020-02-17T10:41:09 | 241,081,300 | 0 | 2 | null | 2022-06-17T03:28:48 | 2020-02-17T10:35:52 | Java | UTF-8 | Java | false | false | 1,077 | java | //package com.unichain.pay.gateway.interceptor;
//
//import com.unichain.pay.core.*;
//import com.unichain.pay.biz.IBizChannelDirectiveRuleService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.stereotype.Service;
//
//@Service
//public class DirectiveInterceptor implements Interceptor {
// @Autowired
// IBizChannelDirectiveRuleService bizChannelDirectiveRuleServicev;
//
// @Autowired
// RedisTemplate redisTemplate;
// // 规则处理器
// //@Autowired
// //RuleHandler ruleHandler;
//
// @Override
// public void afterHandle(PayRequest payRequest, PayResponse payResponse) {
//
// }
//
// @Override
// public void preHandle(PayRequest payRequest) {
//
// // 根据规则选取支付具体的通道指令
// Rules rule = null;
// //Payable payable = ruleHandler.selectPayable(list,rule);
// //payRequest
//
// //List directives = directiveService.getDirective(payDirective);
//
//
// }
//}
| [
"lait.zhang@gmail.com"
] | lait.zhang@gmail.com |
d814451311a81f3e3925d921d4cc44912257b101 | 26286634a7122894c82c848748309f2b42edb601 | /src/controller/collision/TankWithProjectile.java | 74ff7a178b0a3a8f79d558e69255abb8c04a4d1e | [] | no_license | scumatteo/Tank-War | 4b7a1e439adde4df1193c07c228b60d3be5c2c9b | 414b444764ea11dd2420201d7b23ff247837cdec | refs/heads/master | 2023-03-05T19:43:18.942753 | 2021-02-14T17:15:06 | 2021-02-14T17:15:06 | 338,856,097 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,968 | java | package controller.collision;
import controller.utility.CheckIntersection;
import java.util.List;
import java.util.stream.Collectors;
import model.object.Projectile;
import model.object.Tank;
/**
* Concrete implementation of {@link Collision} interface.
*/
public class TankWithProjectile implements Collision {
private static final int DAMAGE = 1;
private final Tank playerTank;
private final Tank enemyTank;
private final List<Projectile> projectiles;
/**
* Constructor.
*
* @param playerTank
* the player {@link Tank}.
* @param enemyTank
* the enemy {@link Tank}.
* @param projectiles
* the list of {@link Projectile}.
*/
public TankWithProjectile(final Tank playerTank, final Tank enemyTank, final List<Projectile> projectiles) {
this.playerTank = playerTank;
this.enemyTank = enemyTank;
this.projectiles = projectiles;
}
@Override
public final void manageCollision() {
updateTankLifeAndProjectiles(this.playerTank,
projectiles.stream()
.filter(p -> CheckIntersection.intersects(p.getPosition(), p.getBounds(),
this.playerTank.getPosition(), Tank.getDimension()))
.collect(Collectors.toList()));
updateTankLifeAndProjectiles(this.enemyTank,
projectiles.stream()
.filter(p -> CheckIntersection.intersects(p.getPosition(), p.getBounds(),
this.enemyTank.getPosition(), Tank.getDimension()))
.collect(Collectors.toList()));
}
private static void updateTankLifeAndProjectiles(final Tank tank, final List<Projectile> hitProjectiles) {
if (!hitProjectiles.isEmpty()) {
tank.damage(DAMAGE * hitProjectiles.size());
hitProjectiles.forEach(p -> p.setDead());
}
}
}
| [
"matteo.scucchia@studio.unibo.it"
] | matteo.scucchia@studio.unibo.it |
c43c6482fc43366bd70ca2a1220fd465b4390f78 | f3bc234451581ff793c47bb2c14dc210e0ddfb63 | /src/main/java/matchers/HasText.java | b8de508eae28bf7c331b5277691942db14895108 | [] | no_license | PislyakovNIX/SeleniumPractice-2 | 69e9b2d1952c3e303a3664fbdaaa5ea7547baa6a | 47f838dfe468fedfc98013a1759a7d8ebb8735fe | refs/heads/master | 2023-01-24T17:01:48.576326 | 2020-12-02T08:05:36 | 2020-12-02T08:05:36 | 275,134,976 | 0 | 0 | null | 2020-10-13T23:06:15 | 2020-06-26T10:58:24 | Java | UTF-8 | Java | false | false | 1,169 | java | package matchers;
import io.qameta.atlas.webdriver.AtlasWebElement;
import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
public class HasText extends TypeSafeMatcher<AtlasWebElement> {
private String expectedSearchText;
private String actualSearchText;
private HasText(String expectedSearchText) {
this.expectedSearchText = expectedSearchText;
}
@Override
public boolean matchesSafely(AtlasWebElement item) {
actualSearchText = item.getText().replaceAll("\"", "");
return expectedSearchText.matches(actualSearchText);
}
@Override
public void describeTo(Description description) {
description.appendText("Expected search text is " + expectedSearchText);
}
@Override
protected void describeMismatchSafely(AtlasWebElement item, Description mismatchDescription) {
mismatchDescription.appendText("Actual search text was " + actualSearchText);
}
@Factory
public static Matcher<AtlasWebElement> hasText(final String actualSearchText) {
return new HasText(actualSearchText);
}
}
| [
"ruslan.pislyakov@nixsolution.com"
] | ruslan.pislyakov@nixsolution.com |
e8e408bdd1efa4ca03b365d41a68fc1fee66023e | e2fceba13a8ed716c4a978d3d88091a90aff0210 | /voteus/project01/VoteOn/src/main/java/com/ssafy/vote/service/IVoterService.java | 0024f5714ca5becc2055c4dde13fef4f87ae1f54 | [] | no_license | Seonhanbit/dev | fff1d597d0db3fb16c9eff2ce23ee70d5ba529fd | e7c56ef9c5c7b2e00c8574e0de099c7ea9356dd3 | refs/heads/master | 2023-01-21T12:32:58.366509 | 2020-10-26T11:14:30 | 2020-10-26T11:14:30 | 205,319,840 | 2 | 0 | null | 2023-01-05T12:43:55 | 2019-08-30T06:33:08 | Java | UTF-8 | Java | false | false | 1,483 | java | package com.ssafy.vote.service;
import java.util.HashMap;
import java.util.List;
import com.ssafy.vote.dto.VoterVO;
public interface IVoterService {
/**
* @author : 선한빛
* 기능 : 모든 투표자를 조회하는 메소드
* @Date : 2020. 1. 23.
*/
public List<VoterVO> getVoterAllList();
/**
* @author : 선한빛
* 기능 : 투표자 코드 입력 시 투표자 정보를 조회하는 기능
* @Date : 2020. 1. 30.
*/
public VoterVO getVotercode(int code);
/**
* @author : 선한빛
* 기능 : 투표자를 등록하는 함수
* @Date : 2020. 1. 23.
*/
public boolean insertVoter(int code, String id_num, String name, String areaCode);
/**
* @author : 선한빛
* 기능 : 투표자를 삭제하는 함수
* @Date : 2020. 1. 23.
*/
public boolean delVoter(int code);
/**
* @author : 선한빛
* 기능 : 투표자를 수정하는 함수
* @Date : 2020. 1. 23.
*/
public boolean updateVoter(int code, String name, String areaCode);
/**
* @author : 선한빛
* 기능 : 투표자 이름/주민번호 입력시 투표자 고유키를 넘겨주는 기능
* @Date : 2020. 2. 4.
*/
public int getOnlyVotercode(String name, String id_num);
/**
* 작성자 : 정준호
* @param voteCode
* @return 해당투표의 투표자 총원 - totalCnt, 투표완료인원 - completeCnt, 투표미완료인원 - incompleteCnt 반환 (map형태)
*/
public HashMap<String,Object> getVoteProgressData(String voteCode);
}
| [
"52940537+Seonhanbit@users.noreply.github.com"
] | 52940537+Seonhanbit@users.noreply.github.com |
80eab40c9b187ff7a6c75ea1bc9e46a3ce9483ff | c5e3f59abd1fff3904cd91e3cd05723e00fc2fff | /ap-comp-sci2/src/main/java/hw/exam/MorseCode.java | a699dc163b121518121540790d57ddb8e31c747a | [
"MIT"
] | permissive | CreativePenguin/stuy-cs | 298eba76a6670e6eaafd273458b4603db3c66fbf | 597a2c3ae477222fa2a0053f91cae781c92ff178 | refs/heads/master | 2020-03-28T22:03:01.766357 | 2020-03-13T18:16:29 | 2020-03-13T18:16:29 | 149,201,755 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,623 | java | package hw.exam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class MorseCode {
private static MorseCode instance;
private String[] morseAToZ;
private String[] englishAToZ;
private Map<String, String> morseToEnglish;
private Map<String, String> englishToMorse;
private MorseCode() {
morseAToZ = ".- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --..".split(" ");
englishAToZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
morseToEnglish = listsToMap(morseAToZ, englishAToZ);
englishToMorse = listsToMap(englishAToZ, morseAToZ);
}
public static MorseCode getInstance() {
if(instance == null) {
instance = new MorseCode();
}
return instance;
}
private <K, V> Map<K, V> listsToMap(K[] keys, V[] values) {
if(keys.length != values.length) throw new IllegalArgumentException("Lists must be the same size");
Map<K, V> ans = new HashMap<>();
for(int i = 0; i < keys.length; i++) {
ans.put(keys[i], values[i]);
}
return ans;
}
public String readFile(File file) throws FileNotFoundException, IOException {
String ans = "";
String line = null;
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
while((line = reader.readLine()) != null) {
ans += readLine(line);
}
}
return ans;
}
public String readLine(String input) {
boolean isMorse = input.substring(0, 1).equals(".") || input.substring(0, 1).equals("-");
String[] splitInput = (isMorse) ? input.split(" ") : input.split("");
String ans = "";
for(int i = 0; i < splitInput.length; i++) {
String tmp = (isMorse) ? morseToEnglish.get(splitInput[i]) : englishToMorse.get(splitInput[i].toUpperCase());
ans += tmp == null ? splitInput[i] : tmp;
}
return ans;
}
public void run() {
System.out.println("Morse Code Translator");
try (Scanner src = new Scanner(System.in)) {
while(true) {
System.out.print(">");
String input = src.nextLine();
System.out.println(readLine(input));
}
}
}
public static void main(String[] args) {
MorseCode.getInstance().run();
}
}
| [
"panda501wp@gmail.com"
] | panda501wp@gmail.com |
86705c3a717ce0fd2a6b14249520471f92d5e3bf | 7e707582e1bd0bdae0b49efbeea62ba75f863556 | /DataStructureAndAlgorithm/src/Vedio51CTOAlgorithms/CheckBrackets.java | ab95d3f15596963c6cd6e18f2d73a697ee79784f | [] | no_license | WenruiShen/JavaPractice2 | 0c6dc507e5c7842565f1dbe7db96837738256dde | a75dec95789d1e1d06d4a72ed07fbde49de420e1 | refs/heads/master | 2020-04-12T04:48:53.382851 | 2019-04-12T09:49:21 | 2019-04-12T09:49:21 | 162,306,492 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,785 | java | package Vedio51CTOAlgorithms;
import bookAlgorithms.examples.Model.AlgorithmModel;
import java.util.Stack;
/*
* Created by shenwenrui on 20190212.
* Description: 验证括号;
* 给你一个包含括号的字符串,判断是否正确。
* 输入1:equation = "([][]{})", 输出1:true
* 输入2:equation = "([)]", 输出2:false
*
* 51CTO视频-高频算法面试题:4;
*/
public class CheckBrackets extends AlgorithmModel {
boolean check3(String equation){
while (equation.contains("()") || equation.contains("[]") || equation.contains("{}")){
equation = equation.replace("()", "")
.replace("[]", "")
.replace("{}", "");
}
return equation.length()==0;
}
boolean check2(String equation){
Stack<Character> stack = new Stack<>();
for (char c: equation.toCharArray()){
switch (c){
case '(':
stack.push(')');
break;
case '[':
stack.push(']');
break;
case '{':
stack.push('}');
break;
default:
if(stack.isEmpty() || stack.pop()!=c){
return false;
}
break;
}
}
return stack.size()==0;
}
//支持字符串中包含其他字符
boolean check1(String equation){
Stack<Character> stack = new Stack<>();
for (char c: equation.toCharArray()){
switch (c){
case '(':
stack.push(c);
break;
case '[':
stack.push(c);
break;
case '{':
stack.push(c);
break;
case ')':
if(stack.isEmpty() || stack.pop()!='('){
return false;
}
break;
case ']':
if(stack.isEmpty() || stack.pop()!='['){
return false;
}
break;
case '}':
if(stack.isEmpty() || stack.pop()!='{'){
return false;
}
break;
}
}
return stack.size()==0;
}
@Override
public void excute() {
String equation = "([ffwq]vf[]e{})";
System.out.println("equation: " + equation);
boolean result = check1(equation);
System.out.println("check result:" + result);
}
}
| [
"shenwenrui@mobike.com"
] | shenwenrui@mobike.com |
62c1aa9d5b9c3c5408b8b35ed96c354b1be3e4dc | bff9f6c8f6261957093da19fc4ef7b44c29ef445 | /demo-cloud-fescar/demo-cloud-fescar-api/src/main/java/tm/eureka/rao/StorageRao.java | ad64b40dd59f9e4b22754e7d4287fb1bd9a5327d | [] | no_license | TroubleM/demo-parent-springboot2- | 67b39e3181bfff53ec2607231bdc49d4c00abd4c | 75c399e374d57c90da7d729ce832fb029de39a7d | refs/heads/master | 2022-07-13T03:22:47.229939 | 2020-04-13T06:06:33 | 2020-04-13T06:06:33 | 175,160,911 | 1 | 0 | null | 2022-06-29T19:50:33 | 2019-03-12T07:51:09 | Java | UTF-8 | Java | false | false | 643 | java | package tm.eureka.rao;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import tm.hystrix.StorageRaoHystrix;
@FeignClient(name = "demo-cloud-fescar-storage-producer",fallback = StorageRaoHystrix.class)
@RequestMapping(value = "storage")
public interface StorageRao {
@RequestMapping(value = "deduct")
Object deduct(@RequestParam(value = "commodityCode") String commodityCode,
@RequestParam(value = "count") int count,
@RequestParam(value = "code") String code);
}
| [
"zhangyi-cd@duia.com"
] | zhangyi-cd@duia.com |
a4918c60ef5565e998bff6e094f20b93b3197ff9 | a0720e95f02fb1731262c9ed764ebfbf4ae140ef | /manager-service/src/main/java/com/atguigu/scw/service/authority/impl/UserServiceImpl.java | 037e3ae7e97876d6feb366bd8224941fcc5963c8 | [] | no_license | panpalala/scw | f00b420a9d0760ad2b72144ee5906222d1ed871d | d9a6e3e3d85555d572ec74f21a9cf7d7729c6683 | refs/heads/master | 2021-01-19T19:02:00.712122 | 2017-09-07T08:30:37 | 2017-09-07T08:30:37 | 101,180,931 | 0 | 1 | null | 2017-08-23T15:51:21 | 2017-08-23T13:05:31 | null | UTF-8 | Java | false | false | 2,212 | java | package com.atguigu.scw.service.authority.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.atguigu.project.MD5Util;
import com.atguigu.project.MyStringUtils;
import com.atguigu.scw.bean.TUser;
import com.atguigu.scw.bean.TUserExample;
import com.atguigu.scw.bean.TUserExample.Criteria;
import com.atguigu.scw.dao.TUserMapper;
import com.atguigu.scw.service.authority.UserService;
/**
* @author panpala
* @date 2017年7月28日
*/
@Service
public class UserServiceImpl implements UserService {
@Autowired
TUserMapper tUserMapper;
/*
* 根据传入的Tuser对象从数据库中查询并返回
* */
@Override
public TUser login(TUser user) {
TUserExample example = new TUserExample();
Criteria criteria = example.createCriteria();
criteria.andLoginacctEqualTo(user.getLoginacct());
criteria.andUserpswdEqualTo(user.getUserpswd());
List<TUser> list = tUserMapper.selectByExample(example);
return list.size() == 1 ? list.get(0) : null;
}
@Override
public boolean regist(TUser user) {
user.setId(null);
if(user.getUsername() == null) {
user.setUsername("未命名");
}
user.setCreatetime(MyStringUtils.formatSimpleDate(new Date()));
user.setUserpswd(MD5Util.digest(user.getUserpswd()));
int rows = tUserMapper.insertSelective(user);
return rows > 0;
}
@Override
public List<TUser> listUsers() {
return tUserMapper.selectByExample(null);
}
@Override
public TUser getUserById(Integer id) {
return tUserMapper.selectByPrimaryKey(id);
}
@Override
public boolean update(TUser user) {
int rows = tUserMapper.updateByPrimaryKeySelective(user);
return rows > 0;
}
@Override
public void deleteUsers(Integer... ids) {
/*for (Integer integer : ids) {
tUserMapper.deleteByPrimaryKey(integer);
}*/
tUserMapper.deleteBatchByPrimaryKey(ids);
}
@Override
public List<TUser> queryUsers(String condition) {
condition = "%" + condition + "%";
List<TUser> list = tUserMapper.selectUsersByCondition(condition);
return list;
}
}
| [
"sdau_lmz@163.com"
] | sdau_lmz@163.com |
255c1ec73cb97383d81b093f115177953c46d709 | fd3b691d4ccdd7caff21fd4ecdf5a2f1b6ed61f2 | /app/src/main/java/com/example/android/booksearch/QueryUtils.java | 002448c5111d3e5d3f6160549020774ccfe87aa7 | [] | no_license | luigiguarnieri/BookHunter | b0e5b28241c8d96d0b10a4a211ef98dffc854a00 | a54ada65f6ea1330d5093fff2f88d675d145632d | refs/heads/master | 2021-01-21T14:33:02.014719 | 2017-06-24T13:40:41 | 2017-06-24T13:40:41 | 95,255,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,001 | java | package com.example.android.booksearch;
import android.text.TextUtils;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
/**
* Helper methods related to requesting and receiving book data from Google
* Books API.
*/
public final class QueryUtils {
/** Tag for the log messages */
private static final String LOG_TAG = QueryUtils.class.getSimpleName();
/**
* Create a private constructor because no one should ever create a {@link QueryUtils} object.
* This class is only meant to hold static variables and methods, which can be accessed
* directly from the class name QueryUtils (and an object instance of QueryUtils is not needed).
*/
private QueryUtils() {
}
/**
* Query Google Books API and return a list of {@link Book} objects.
*/
public static List<Book> fetchBookData(String requestUrl) {
// Create URL object
URL url = createUrl(requestUrl);
// Perform HTTP request to the URL and receive a JSON response back
String jsonResponse = null;
try {
jsonResponse = makeHttpRequest(url);
} catch (IOException e) {
e.printStackTrace();
// If an error is thrown when executing any of the above statements in the "try" block,
// catch the exception here, so the app doesn't crash. Print a log message
// with the message from the exception.
Log.e(LOG_TAG, "Problem making the HTTP request.", e.getCause());
}
// Extract relevant fields from the JSON response and create a list of {@link Book}s
// and return the list of {@link Book}s
return extractFeatureFromJson(jsonResponse);
}
/**
* Returns new URL object from the given string URL.
*/
private static URL createUrl(String stringUrl) {
URL url = null;
try {
url = new URL(stringUrl);
} catch (MalformedURLException e) {
e.printStackTrace();
// If an error is thrown when executing any of the above statements in the "try" block,
// catch the exception here, so the app doesn't crash. Print a log message
// with the message from the exception.
Log.e(LOG_TAG, "Problem building the URL ", e.getCause());
}
return url;
}
/**
* Make an HTTP request to the given URL and return a String as the response.
*/
private static String makeHttpRequest(URL url) throws IOException {
String jsonResponse = "";
// If the URL is null, then return early.
if (url == null) {
return jsonResponse;
}
HttpURLConnection urlConnection = null;
InputStream inputStream = null;
try {
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setReadTimeout(10000 /* milliseconds */);
urlConnection.setConnectTimeout(15000 /* milliseconds */);
urlConnection.setRequestMethod("GET");
urlConnection.connect();
// If the request was successful (response code 200),
// then read the input stream and parse the response.
if (urlConnection.getResponseCode() == 200) {
inputStream = urlConnection.getInputStream();
jsonResponse = readFromStream(inputStream);
} else {
Log.e(LOG_TAG, "Error response code: " + urlConnection.getResponseCode());
}
} catch (IOException e) {
e.printStackTrace();
// If an error is thrown when executing any of the above statements in the "try" block,
// catch the exception here, so the app doesn't crash. Print a log message
// with the message from the exception.
Log.e(LOG_TAG, "Problem retrieving the book JSON results.", e.getCause());
} finally {
if (urlConnection != null) {
urlConnection.disconnect();
}
if (inputStream != null) {
// Closing the input stream could throw an IOException, which is why
// the makeHttpRequest(URL url) method signature specifies than an IOException
// could be thrown.
inputStream.close();
}
}
return jsonResponse;
}
/**
* Convert the {@link InputStream} into a String which contains the
* whole JSON response from the server.
*/
private static String readFromStream(InputStream inputStream) throws IOException {
StringBuilder output = new StringBuilder();
if (inputStream != null) {
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, Charset.forName("UTF-8"));
BufferedReader reader = new BufferedReader(inputStreamReader);
String line = reader.readLine();
while (line != null) {
output.append(line);
line = reader.readLine();
}
}
return output.toString();
}
/**
* Return a list of {@link Book} objects that has been built up from
* parsing the given JSON response.
*/
private static List<Book> extractFeatureFromJson(String bookJSON) {
// If the JSON string is empty or null, then return early.
if (TextUtils.isEmpty(bookJSON)) {
return null;
}
// Create an empty ArrayList that we can start adding books to
List<Book> books = new ArrayList<>();
// Try to parse the JSON response string. If there's a problem with the way the JSON
// is formatted, a JSONException exception object will be thrown.
// Catch the exception so the app doesn't crash, and print the error message to the logs.
try {
// Create a JSONObject from the JSON response string
JSONObject baseJsonResponse = new JSONObject(bookJSON);
// Extract the JSONArray associated with the key called "items",
// which represents a list of items (or books).
JSONArray bookArray = baseJsonResponse.getJSONArray("items");
// For each book in the bookArray, create an {@link Book} object
for (int i = 0; i < bookArray.length(); i++) {
// Get a single book at position i within the list of books
JSONObject currentBook = bookArray.getJSONObject(i);
// For a given book, extract the JSONObject associated with the
// key called "volumeInfo", which represents a list of all properties
// for that book.
JSONObject volumeInfo = currentBook.getJSONObject("volumeInfo");
// Extract the value for the key called "title"
String title = volumeInfo.getString("title");
// Extract the value(s) for the JSONArray called "authors" and format
// its value(s), replacing invalid symbols or spaces
String authorName;
if (volumeInfo.has("authors")) {
JSONArray bookAuthors = volumeInfo.getJSONArray("authors");
authorName = bookAuthors.toString();
authorName = authorName.replaceAll("\\[|\\]", "").replaceAll("\"", "").replace(",", ", ");
} else {
authorName = "";
}
// Extract the JSONObject associated with the key called "imageLinks",
// which contains more links with bookCoverImages with different
// resolutions. Among them extract the value for the key "thumbnail".
String bookCover;
if (volumeInfo.has("imageLinks")) {
JSONObject bookCoverImages = volumeInfo.getJSONObject("imageLinks");
bookCover = bookCoverImages.getString("thumbnail");
} else {
bookCover = "";
}
// Extract the value for the key called "publisher"
String publisher;
if (volumeInfo.has("publisher")) {
publisher = volumeInfo.getString("publisher");
} else {
publisher = "";
}
// Extract the value for the key called "publishedDate"
String publishedDate;
if (volumeInfo.has("publishedDate")) {
publishedDate = volumeInfo.getString("publishedDate");
} else {
publishedDate = "";
}
// Extract the value for the key called "pageCount"
int numberPages;
if (volumeInfo.has("pageCount")) {
numberPages = volumeInfo.getInt("pageCount");
} else {
numberPages = 0;
}
// Extract the value for the key called "averageRating"
double rating;
if (volumeInfo.has("averageRating")) {
rating = volumeInfo.getDouble("averageRating");
} else {
rating = 0;
}
// Extract the value for the key called "description"
String description;
if (volumeInfo.has("description")) {
description = volumeInfo.getString("description");
} else {
description = "";
}
// Extract the value for the key called "infoLink"
String url = volumeInfo.getString("infoLink");
// Create a new {@link Book} object with the title, authorName,
// bookCover, publisher, publishedDate, numberPages, rating,
// description, url from the JSON response.
Book book = new Book(title, authorName, bookCover, publisher, publishedDate,
numberPages, rating, description, url);
// Add the new {@link Book} to the list of books.
books.add(book);
}
} catch (JSONException e) {
e.printStackTrace();
// If an error is thrown when executing any of the above statements in the "try" block,
// catch the exception here, so the app doesn't crash. Print a log message
// with the message from the exception.
Log.e("QueryUtils", "Problem parsing the book JSON results", e.getCause());
}
// Return the list of books
return books;
}
} | [
"luigiguarnieri@gmail.com"
] | luigiguarnieri@gmail.com |
496a816df1ea747cadb1bacb9984ee8767bd967f | 0a80385e7caebfbe7611087ef7fc8c66cf88231c | /IpStringRegex.java | 20b585fac690317897f783a4483062c368720e75 | [] | no_license | Paras-Rastogi-23/HackerRankSolutions | 0b6539e931a9b92238b36e5072d14fea6d947543 | 053383c4edafb2cb5cd6172c6d42e2d4d3e5d5ac | refs/heads/master | 2022-12-10T14:21:03.303188 | 2020-09-01T14:43:17 | 2020-09-01T14:43:17 | 292,023,516 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,235 | java | //program to find whether the input 6 String are valid IP-Address or not
import java.util.Scanner;
import java.util.regex.*;
public class IpStringRegex {
public static boolean Ip(String s){
String str[] = s.split("[.]");
if(str.length != 4)
return false;
else
{
String S ="";
for (int i = 0; i < str.length; i++) {
S = str[i]; char ch = ' '; int num;
for (int j = 0; j < S.length(); j++) {
ch = S.charAt(j);
if((int)ch>57 || (int)ch<48)
return false;
}
num = Integer.parseInt(S);
if(num>255||num<0)
return false;
}
}
return true;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String[] s = new String[6];
Boolean[] b = new Boolean[6];
String[] str = ("11.22.31.121").split("[.]");
for (int i = 0; i < 6; i++) {
s[i] = in.nextLine();
b[i] = Ip(s[i]);
}
for (int j = 0; j < 6; j++) {
System.out.println(b[j]);
}
}
}
| [
"rastogiparas38@gmail.com"
] | rastogiparas38@gmail.com |
382ee7353cd5c055bbe5aabe5a28be059851fce4 | 3a46af094f99fe815f6ffd31148d211617f4de92 | /src/main/java/shopping_list/DetailList.java | 256c3ede67098d86ee957d28577f46b3aee814ff | [] | no_license | azegun/Shopping | aed3074eee5d613332ed1b7e6618d64cfd3f2bd1 | c0db4c180d3fe07083ae1f59044781d03353b76c | refs/heads/master | 2023-04-16T02:25:49.929339 | 2021-04-30T03:30:34 | 2021-04-30T03:30:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,843 | java | package shopping_list;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;
import java.util.List;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import shopping.dto.Customer;
import shopping.dto.Product;
import shopping.dto.Sales;
import shopping.service.CustomerService;
import shopping.service.ProductService;
import shopping.service.SalesService;
import shopping_list.panel.DetailPanel;
import shopping_list.panel.bottompanel.DetailBottom;
@SuppressWarnings("serial")
public class DetailList extends JPanel implements ActionListener {
private JPanel pTop;
private JPanel pRight2;
private JButton btnReset;
private JButton btnC;
private SalesService service;
private CustomerService cService;
private ProductService pService;
private JComboBox<Product> cbPsearch;
private JComboBox<Customer> cbCsearch;
private Product proSelect;
private Customer cuSelect;
private DetailPanel pList;
private DetailBottom pBottom;
private List<Sales> list;
private DecimalFormat df = new DecimalFormat("#,###원");
public DetailList() {
service = new SalesService();
cService = new CustomerService();
pService = new ProductService();
initialize();
List<Customer> cusList = cService.selectByName();
List<Product> proList = pService.selectByPname();
System.out.println(proList);
cbPsearch.setModel(new DefaultComboBoxModel<Product>(new Vector<>(proList)));
cbPsearch.setSelectedIndex(-1);
cbCsearch.setModel(new DefaultComboBoxModel<Customer>(new Vector<>(cusList)));
cbCsearch.setSelectedIndex(-1);
}
private void initialize() {
setLayout(new BorderLayout(0, 0));
pTop = new JPanel();
add(pTop, BorderLayout.NORTH);
pTop.setLayout(new GridLayout(0, 2, 0, 0));
JPanel pLeft1 = new JPanel();
pTop.add(pLeft1);
JLabel lblPsearch = new JLabel("제품별 검색");
lblPsearch.setHorizontalAlignment(SwingConstants.CENTER);
pLeft1.add(lblPsearch);
cbPsearch = new JComboBox<>();
pLeft1.add(cbPsearch);
JPanel pRight1 = new JPanel();
pTop.add(pRight1);
JPanel pLeft2 = new JPanel();
pTop.add(pLeft2);
JLabel lblCsearch = new JLabel("회원별 검색");
lblCsearch.setHorizontalAlignment(SwingConstants.CENTER);
pLeft2.add(lblCsearch);
cbCsearch = new JComboBox<>();
pLeft2.add(cbCsearch);
pRight2 = new JPanel();
pTop.add(pRight2);
btnReset = new JButton("초기화");
pRight2.add(btnReset);
btnReset.addActionListener(this);
btnC = new JButton("검색");
pRight1.add(btnC);
btnC.addActionListener(this);
pBottom = new DetailBottom();
add(pBottom, BorderLayout.SOUTH);
pBottom.setLayout(new GridLayout(1, 0, 0, 0));
pList = new DetailPanel();
pList.setService(service);
pList.loadData();
add(pList, BorderLayout.CENTER);
}
public void actionPerformed(ActionEvent e) {
try {
if (e.getSource() == btnC) {
if (cbPsearch.getSelectedIndex() == -1) {
actionPerformedBtnC(e);
}else if(cbCsearch.getSelectedIndex() == -1) {
actionPerformedBtnP(e);
}else {
actionPerformedBtnPandC(e);
}
}
} catch (NullPointerException e1) {
JOptionPane.showMessageDialog(null, "해당 결과가 없습니다.", "주문여부", JOptionPane.WARNING_MESSAGE);
}
if (e.getSource() == btnReset) {
actionPerformedBtnReset(e);
}
}
private void actionPerformedBtnPandC(ActionEvent e) {
proSelect = (Product) cbPsearch.getSelectedItem();
cuSelect = (Customer) cbCsearch.getSelectedItem();
list = service.selectByPnameAndCname(proSelect.getpName(), cuSelect.getCuName());
pList.selectList(list);
pBottom.setBottomDetail(list);
}
protected void actionPerformedBtnP(ActionEvent e) {
// 제품전용
proSelect = (Product) cbPsearch.getSelectedItem();
list = service.selectByPname(proSelect.getpName());
pList.selectList(list);
pBottom.setBottomDetail(list);
}
protected void actionPerformedBtnC(ActionEvent e) {
// 고객전용
cuSelect = (Customer) cbCsearch.getSelectedItem();
list = service.selectByCname(cuSelect.getCuName());
pList.selectList(list);
pBottom.setBottomDetail(list);
}
protected void actionPerformedBtnReset(ActionEvent e) {
// 모두 리셋
cbPsearch.setSelectedIndex(-1);
cbCsearch.setSelectedIndex(-1);
pList.loadData();
list = service.showDetailList();
pBottom.setBottomDetail(list);
}
}
| [
"tkdrjs7@naver.com"
] | tkdrjs7@naver.com |
e708cf763a0aeedc933044b67e2978f64491b8a2 | 7316462429777bf6d9a67c0bc78a0354aedf1ad5 | /src/common/Service.java | 6deb2904cba5c149bb6c23121d5ac35216c9ba85 | [] | no_license | d1149694026/Jfinal-demo | 1ea5b695197237024a4679cb9e1a6cd3cf70bc52 | 7925c76c0fd4f0b1f654a4215aa71ac7c9a42a17 | refs/heads/master | 2020-05-31T04:50:02.107997 | 2019-06-04T02:53:52 | 2019-06-04T02:53:52 | 190,106,543 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,139 | java | package common;
import java.util.List;
import model.students;
public class Service {
public List<students> StudentList(Integer number)
{
String sql="select * from students limit 0,";
sql+=number;
List<students> dao=students.students.find(sql);
return dao;
}
/**
* 实现增加功能
*/
public void submitMessage(students student)
{
System.out.println(student);
student.save();
}
/**
* 实现删除功能
*/
public void deleteStudent(Integer id)
{
students.students.deleteById(id);
}
public students editMessage(Integer id)
{
students stu=students.students.findById(id);
return stu;
}
/**
* 实现更新数据
*/
public void updateMessage(students stu)
{
stu.update();
}
public List<students> sqlstatement(Integer p,Integer p2)
{
String sql="select * from students limit ";
sql+=p;
sql+=",";
sql+=p2;
List<students> dao=students.students.find(sql);
return dao;
}
public List<students> pageNumber()
{
List<students> dao=students.students.find("select * from students");
return dao;
}
public List<students> pageNumber2(String name){
String sql="select * from students where name=";
sql+="'"+name+"'";
sql+=" or age="+"'"+name+"'";
sql+=" or sex="+"'"+name+"'";
sql+=" or remark="+"'"+name+"'";
List<students> dao=students.students.find(sql);
return dao;
}
public List<students> selectInfo(String name,Integer number){
String sql="select * from students where name=";
sql+="'"+name+"'";
sql+=" or age="+"'"+name+"'";
sql+=" or sex="+"'"+name+"'";
sql+=" or remark="+"'"+name+"'";
sql+=" limit 0,"+number;
List<students> dao=students.students.find(sql);
// Page<Record> dao=Db.paginate(1, 3,"select *", "from students where name=? or age=? or sex=? or remark=?", name);
return dao;
}
}
| [
"1149694026@qq.com"
] | 1149694026@qq.com |
5e9b131f2760ce45e30651e356e8feea894c12b5 | 9df460ebeec80499f315f1adb63b97c83b459ff1 | /PrimitiveTypesChallenge/src/academy/learnprogramming/Expression.java | d2ed648337810b86a3fe2cbf9cc1cd14a8be8a10 | [] | no_license | tonytrinh3/java | 6344f4c996d4c5520f0e8774e480b06544628fc0 | b32c2feff29000926e507370aaa3044d89058c72 | refs/heads/master | 2023-01-06T07:18:41.193931 | 2020-11-05T02:45:03 | 2020-11-05T02:45:03 | 307,903,103 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,124 | java | // package academy.learnprogramming;
// public class Expression {
// public static void expression(String[] args) {
// // write your code here
// byte byteValue = 10;
// short shortValue = 20;
// int intValue = 50;
// // long works well with ints so no need for casting
// long longTotal = 50000L + 10L * (byteValue+shortValue+intValue);
// // System.out.println(longTotal);
// double twenty = 20.00d;
// System.out.println(twenty);
// double eighty = 80.00d;
// System.out.println(eighty);
// double num = (twenty+eighty)*100.00d;
// System.out.println(num);
// double remainder = num% 40.00d;
// System.out.println(remainder);
// boolean isRemainder = remainder == 0 ? true : false;
// System.out.println(isRemainder);
// if (!isRemainder){
// System.out.println("got some remainder");
// }
// }
// }
| [
"tony.w.trinh3@gmail.com"
] | tony.w.trinh3@gmail.com |
af9f3a91cfd06ce429bba896c3325f2498159229 | 18622400c9290b02e1a7b327fb96bb1cc1ecb4e2 | /hrdev/src/test/java/com/example/hrdev/HrDevApplicationTests.java | 55ce04ffeaa8759951c03d1df06181e3bfde6b6f | [] | no_license | zyf-123456/hrdev | 689b849babc9550c9d263eda032fe47286d694c1 | 4d0dacac1c5d264ac86f75a75ae2211ac810147d | refs/heads/master | 2022-02-27T18:41:10.916845 | 2020-01-16T09:25:32 | 2020-01-16T09:25:32 | 234,277,313 | 1 | 0 | null | 2022-02-09T22:21:36 | 2020-01-16T08:59:56 | HTML | UTF-8 | Java | false | false | 217 | java | package com.example.hrdev;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class HrDevApplicationTests {
@Test
void contextLoads() {
}
}
| [
"1718346296@qq.com"
] | 1718346296@qq.com |
a0c041fc867bc9149344dbc86ed5007fa165dccb | 93af669bb5db498a52af6a6814c8d82e3d7076d6 | /src/net/Builder/Learning/FontsTest.java | 4b752ec54d2c9e4079c4f3b3899263c65123b2bd | [] | no_license | pwestling/Builder | bca016ce6ce81bf2cc7fc60f3dc907c53ae4cbc3 | 37607e51b4ac5ee04a928875015e9068ca199b2e | refs/heads/master | 2016-09-05T13:49:43.819708 | 2012-01-19T04:09:17 | 2012-01-19T04:09:17 | 3,021,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,429 | java | package net.Builder.Learning;
import java.awt.Font;
import java.io.InputStream;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color;
import org.newdawn.slick.TrueTypeFont;
import org.newdawn.slick.util.ResourceLoader;
public class FontsTest {
/** The fonts to draw to the screen */
private TrueTypeFont font;
private TrueTypeFont font2;
/** Boolean flag on whether AntiAliasing is enabled or not */
private boolean antiAlias = true;
/**
* Start the test
*/
public void start() {
initGL(800, 600);
init();
while (true) {
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
render();
Display.update();
Display.sync(100);
if (Display.isCloseRequested()) {
Display.destroy();
System.exit(0);
}
}
}
/**
* Initialise the GL display
*
* @param width
* The width of the display
* @param height
* The height of the display
*/
private void initGL(int width, int height) {
try {
Display.setDisplayMode(new DisplayMode(width, height));
Display.create();
Display.setVSyncEnabled(true);
} catch (LWJGLException e) {
e.printStackTrace();
System.exit(0);
}
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GL11.glClearDepth(1);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glViewport(0, 0, width, height);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, width, height, 0, 1, -1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
/**
* Initialise resources
*/
public void init() {
// load a default java font
Font awtFont = new Font("Times New Roman", Font.BOLD, 24);
font = new TrueTypeFont(awtFont, antiAlias);
}
/**
* Game loop render
*/
public void render() {
Color.white.bind();
font.drawString(100, 50, "THE LIGHTWEIGHT JAVA GAMES LIBRARY",
Color.yellow);
}
/**
* Main method
*/
public static void main(String[] argv) {
FontsTest fontExample = new FontsTest();
fontExample.start();
}
}
| [
"pwestling@gmail.com"
] | pwestling@gmail.com |
993a6863b1ded025db3755f69c169a49c27d6b16 | 6c67833905dde99bff8c723796b12c6498f41056 | /backend/src/test/java/com/crud/weather_station/controller/HumidityControllerTestSuite.java | fe653bdc1a23a06545a64196af885002c32f1b0f | [] | no_license | mdziagacz/weather_station | 8e30be018f1addd5d4029c635e6109aeb1580329 | 1a2b77a37cfb1e88d0c94934a78d373f9b62966c | refs/heads/master | 2023-01-24T01:08:24.841928 | 2020-03-19T22:10:41 | 2020-03-19T22:10:41 | 233,284,627 | 0 | 0 | null | 2023-01-05T05:00:57 | 2020-01-11T19:18:46 | JavaScript | UTF-8 | Java | false | false | 4,249 | java | package com.crud.weather_station.controller;
import com.crud.weather_station.domain.Humidity;
import com.crud.weather_station.domain.HumidityDto;
import com.crud.weather_station.mapper.HumidityMapper;
import com.crud.weather_station.service.DbService;
import com.google.gson.Gson;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import java.util.ArrayList;
import java.util.List;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@RunWith(SpringRunner.class)
@WebMvcTest(controllers = HumidityController.class)
public class HumidityControllerTestSuite {
@Autowired
private MockMvc mockMvc;
@MockBean
private HumidityMapper humidityMapper;
@MockBean
private DbService dbService;
@Test
public void shouldGetAllHumidity() throws Exception {
//Given
List<Humidity> humidityList = new ArrayList<>();
humidityList.add(new Humidity(1L, "test", 1.0));
List<HumidityDto> humidityDtoList = new ArrayList<>();
humidityDtoList.add(new HumidityDto(1L, "test", 1.0));
when(humidityMapper.mapToHumidityDto(humidityList)).thenReturn(humidityDtoList);
when(dbService.getAllHumidity()).thenReturn(humidityList);
//When & Then
mockMvc.perform(get("/api/humidity").contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(jsonPath("$", Matchers.hasSize(1)))
.andExpect(jsonPath("$[0].id").value(1L))
.andExpect(jsonPath("$[0].dateTime").value("test"))
.andExpect(jsonPath("$[0].value").value(1.0));
verify(dbService, times(1)).getAllHumidity();
}
@Test
public void shouldCreateHumidity() throws Exception {
//Given
Humidity humidity = new Humidity(1L, "test", 1.0);
when(humidityMapper.mapToHumidity(any(HumidityDto.class))).thenReturn(humidity);
Gson gson = new Gson();
String gsonContent = gson.toJson(humidity);
//When & Then
mockMvc.perform(post("/api/humidity")
.contentType(MediaType.APPLICATION_JSON)
.characterEncoding("UTF-8")
.content(gsonContent))
.andExpect(status().isOk());
verify(dbService, times(1)).saveHumidity(humidity);
}
@Test
public void shouldUpdateHumidity() throws Exception {
//Given
Humidity humidity = new Humidity(1L, "test", 1.0);
HumidityDto humidityDto = new HumidityDto(1L, "test", 1.0);
when(humidityMapper.mapToHumidityDto(any(Humidity.class))).thenReturn(humidityDto);
when(humidityMapper.mapToHumidity(any(HumidityDto.class))).thenReturn(humidity);
when(dbService.saveHumidity(any(Humidity.class))).thenReturn(humidity);
Gson gson = new Gson();
String gsonContent = gson.toJson(humidityDto);
//When & Then
mockMvc.perform(put("/api/humidity")
.contentType(MediaType.APPLICATION_JSON)
.characterEncoding("UTF-8")
.content(gsonContent))
.andExpect(status().isOk())
.andExpect(jsonPath("$.id").value(1L))
.andExpect(jsonPath("$.dateTime").value("test"))
.andExpect(jsonPath("$.value").value(1.0));
verify(dbService, times(1)).saveHumidity(humidity);
}
@Test
public void shouldDeleteHumidity() throws Exception {
//Given & When & Then
mockMvc.perform(delete("/api/humidity/1"))
.andExpect(status().isOk());
verify(dbService, times(1)).deleteHumidity(1L);
}
}
| [
"m.dziagacz@gmail.com"
] | m.dziagacz@gmail.com |
457365db1b2256f812b6fbaf42623fbff19f0848 | 017d84c8a64ed43094246585a450c29f7c34fd9b | /src/com/nastel/jkool/tnt4j/dump/PropertiesDumpProvider.java | e10a95a698095c8801b30764a63a87a3b41e1242 | [
"Apache-2.0"
] | permissive | krraghavan/TNT4J | 51d383e4ead0164ac5341d3d39c922412ca6dbf0 | 860474d6ab088f82f9ae6de65655295043cf9049 | refs/heads/master | 2020-12-30T18:15:21.651952 | 2016-05-12T06:50:46 | 2016-05-12T06:50:46 | 58,615,354 | 0 | 0 | null | 2016-05-12T06:45:41 | 2016-05-12T06:45:41 | null | UTF-8 | Java | false | false | 1,772 | java | /*
* Copyright 2014-2015 JKOOL, LLC.
*
* 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 com.nastel.jkool.tnt4j.dump;
import java.util.Properties;
import java.util.Map.Entry;
/**
* <p>
* This class is a dump provider for dumping java properties using System.getProperties();
*
* </p>
*
* @see DumpCollection
*
* @version $Revision: 2 $
*
*/
public class PropertiesDumpProvider extends DefaultDumpProvider {
Properties props;
/**
* Create a new java properties dump provider with a given name and System.getProperties().
*
*@param name
* provider name
*/
public PropertiesDumpProvider(String name) {
this(name, null);
}
/**
* Create a new java properties dump provider with a given name and user specified properties.
*
*@param name
* provider name
*@param pr
* properties
*/
public PropertiesDumpProvider(String name, Properties pr) {
super(name, "System");
props = pr;
}
@Override
public DumpCollection getDump() {
Dump dump = new Dump("Properties", this);
Properties p = props != null ? props : System.getProperties();
for (Entry<Object, Object> entry : p.entrySet()) {
dump.add(entry.getKey().toString(), entry.getValue());
}
return dump;
}
}
| [
"amavashev@nastel.com"
] | amavashev@nastel.com |
813aaadc2ad13be6db1e77df7a0df306bc566b4a | a83a1ed53bf5c2c4b61fe58b2c6f5e6c1da4b7a5 | /src/test/java/pe/isil/proyectodae2/ProyectoDae2ApplicationTests.java | 7003d89b8ad7ab4ddf548cbbef74de4b8ac2e75b | [] | no_license | jordidiaz04/proyecto-dae2 | 07328abc63aaf80b51eece0d3373be04169f562b | f6e36e1b9c958ed16e979484ae8ffd25db755bbc | refs/heads/master | 2020-08-29T23:42:20.835753 | 2019-12-03T13:45:52 | 2019-12-03T13:45:52 | 218,204,770 | 0 | 1 | null | 2019-12-02T00:16:13 | 2019-10-29T04:33:20 | CSS | UTF-8 | Java | false | false | 227 | java | package pe.isil.proyectodae2;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ProyectoDae2ApplicationTests {
@Test
void contextLoads() {
}
}
| [
"jordi.diaz04@hotmail.com"
] | jordi.diaz04@hotmail.com |
4bf18b00c3b83c36c29e4b759c5586157d862e89 | d2c7d0dbec183c2f0152d3d7ff9905aa197a8bca | /src/views/FrmInventario.java | f8490cb0d92938c2c7a112b35cebef6ab1a53d9f | [] | no_license | melissarocha/refactor-smp | b7f35e4d6d57cd078c9837b7b4b99fc797d9f895 | 725d8a73634218e4441913b41b75d76c30da312e | refs/heads/master | 2021-08-17T10:06:19.826038 | 2017-11-21T03:20:59 | 2017-11-21T03:20:59 | 111,493,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,736 | java | package views;
import controllers.Productos;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import models.Producto;
import oraclegeneral.Conexion;
/**
* JFrame donde se agregan productos a la base de datos.
*
* @author Daniela Santillanes Castro
* @version 1.0
* @since 26/05/2015
*/
public class FrmInventario extends BaseFrame {
private String sql;
List<Producto> productos = (List<Producto>) Productos.select(Conexion.getInstance().getCon(), "select * from productos", Producto.class);
Integer rows = 0;
/**
* Creates new form Login
*/
public FrmInventario() {
initComponents();
setTitle("Inventario");
super.iniciarVentana(panel);
DefaultTableModel model = (DefaultTableModel) tableProductos.getModel();
productos.stream().forEach((producto) -> {
List<String> list = new ArrayList<>();
list.add(producto.getNombre());
list.add("" + producto.getPrecio_unitario());
list.add("" + producto.getCantidad_disponible());
model.addRow(list.toArray());
});
tableProductos.setModel(model);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
panel = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
tableProductos = new javax.swing.JTable();
btnCerrar = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
tableProductos.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Nombre", "Precio Unitario", "Cantidad Disponible"
}
));
jScrollPane1.setViewportView(tableProductos);
btnCerrar.setText("Cerrar");
btnCerrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCerrarActionPerformed(evt);
}
});
javax.swing.GroupLayout panelLayout = new javax.swing.GroupLayout(panel);
panel.setLayout(panelLayout);
panelLayout.setHorizontalGroup(
panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 415, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(panelLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnCerrar)
.addGap(44, 44, 44))
);
panelLayout.setVerticalGroup(
panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 308, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnCerrar)
.addGap(27, 27, 27))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(25, 25, 25)
.addComponent(panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(33, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(panel, javax.swing.GroupLayout.PREFERRED_SIZE, 357, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 42, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarActionPerformed
this.dispose();
}//GEN-LAST:event_btnCerrarActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(FrmInventario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FrmInventario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FrmInventario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FrmInventario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(() -> {
new FrmInventario().setVisible(true);
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCerrar;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JPanel panel;
private javax.swing.JTable tableProductos;
// End of variables declaration//GEN-END:variables
}
| [
"emelissaro97@gmail.com"
] | emelissaro97@gmail.com |
5c043735496004fa2fa06070233add0a081ada1d | 89e1811c3293545c83966995cb000c88fc95fa79 | /MCHH-sms/src/main/java/com/threefiveninetong/mchh/send/vo/devsource/XstreamObjResultByXML.java | e6ef456d016bfa77f5b97b01d02055afb3448c0a | [] | no_license | wxddong/MCHH-parent | 9cafcff20d2f36b5d528fd8dd608fa9547327486 | 2898fdf4e778afc01b850d003899f25005b8e415 | refs/heads/master | 2021-01-01T17:25:29.109072 | 2017-07-23T02:28:59 | 2017-07-23T02:28:59 | 96,751,862 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,249 | java | package com.threefiveninetong.mchh.send.vo.devsource;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.mapper.MapperWrapper;
public class XstreamObjResultByXML {
/**
* 发送短信
* @param sendXML
* @return
*/
public static SendReturnsms getSendReturnsmsByXML(String sendXML){
XStream xStream=CreateXStream();
xStream.alias("returnsms", SendReturnsms.class);
// xStream.alias("Output", Output.class);
// xStream.alias("HeaderOut", HeaderOutType.class);=
// xStream.alias("Result", Result.class);
// xStream.alias("FlightShopResult", FlightShopResult.class);
// xStream.alias("Error", WarningType.class);
// xStream.addImplicitCollection(FlightShopResult.class, "avJourneys", "AvJourneys", AvJourneys.class);
// xStream.addImplicitCollection(AvJourneys.class, "avJourney", "AvJourney", AvailableJourneyType.class);
// xStream.addImplicitCollection(AvailableJourneyType.class, "avOpt", "AvOpt", AvOpt.class);
// xStream.addImplicitCollection(AvOpt.class, "flt", "Flt", FsFlightType.class);
// xStream.alias("codeshare", Codeshare.class);
// xStream.alias("term", Term.class);
// xStream.addImplicitCollection(FsFlightType.class, "clazz", "class", ClassType.class);
// xStream.addImplicitCollection(ClassType.class, "subClass", "subClass", String.class);
// xStream.alias("PS", PricingSolutionType.class);
// xStream.alias("RMK", RMK.class);
// xStream.alias("Tax", TaxType.class);
// xStream.addImplicitCollection(TaxType.class, "taxComponent", "taxComponent", Integer.class);
// xStream.addImplicitCollection(PricingSolutionType.class, "routs", "Routs", Routs.class);
// xStream.addImplicitCollection(Routs.class, "rout", "Rout", RoutType.class);
// xStream.alias("FC", FareComponentType.class);
// xStream.addImplicitCollection(FareComponentType.class, "secInfo", "SecInfo", FcSectorInfoType.class);
// xStream.alias("FareBind", FareBind.class);
// xStream.addImplicitCollection(FareComponentType.class, "refundRuleDetailRPH", "RefundRuleDetailRPH", String.class);
// xStream.addImplicitCollection(FareComponentType.class, "reissueRuleDetailRPH", "ReissueRuleDetailRPH", String.class);
// xStream.alias("YFares", YFares.class);
// xStream.addImplicitCollection(YFares.class, "yFareAmount", "yFareAmount", String.class);
// xStream.alias("offices", Offices.class);
// xStream.addImplicitCollection(Offices.class, "office", "office", String.class);
// xStream.alias("CabinFares", CabinFares.class);
// xStream.addImplicitCollection(CabinFares.class, "cabinFare", "CabinFare", CabinFareType.class);
// xStream.alias("PsAvBind", PsAvBindingType.class);
// xStream.addImplicitCollection(PsAvBindingType.class, "avRPH", "avRPH", String.class);
// xStream.addImplicitCollection(PsAvBindingType.class, "bkClass", "bkClass", Object.class);
// xStream.alias("PsDateBind", PsDateBind.class);
// xStream.addImplicitCollection(PsDateBind.class, "dateBinding", "DateBinding", DateBinding.class);
// xStream.alias("NFare", NetFareType.class);
// xStream.alias("PFare", PubFareType.class);
// xStream.alias("FbrDtl", FbrDtlType.class);
// xStream.alias("Rule", RuleType.class);
// xStream.alias("CombineRule", CombineRule.class);
// xStream.addImplicitCollection(CombineRule.class, "combineRuleDtl", "CombineRuleDtl", CombineRuleDtl.class);
// xStream.alias("RefundRule", RefundRule.class);
// xStream.addImplicitCollection(RefundRule.class, "refundDetail", "RefundDetail", RefundDetail.class);
// xStream.alias("ReissueRule", ReissueRule.class);
// xStream.addImplicitCollection(ReissueRule.class, "reissueRuleDetail", "ReissueRuleDetail", ReissueRuleDetail.class);
// xStream.alias("ReissueRuleRestriction", ReissueRuleRestriction.class);
// xStream.addImplicitCollection(FlightShopResult.class, "journeyPrice", "JourneyPrice", JourneyPrice.class);
//
SendReturnsms sendReturnsms=(SendReturnsms) xStream.fromXML(sendXML);
return sendReturnsms;
}
/**
* 查询余额
* @param overageXML
* @return
*/
public static OverageReturnsms getOverageReturnsmsByXML(String overageXML){
XStream xStream=CreateXStream();
xStream.alias("returnsms", OverageReturnsms.class);
OverageReturnsms overageReturnsms=(OverageReturnsms) xStream.fromXML(overageXML);
return overageReturnsms;
}
private static XStream CreateXStream(){
XStream xStream = new XStream(new DomDriver()) {
@Override
protected MapperWrapper wrapMapper(MapperWrapper next) {
return new MapperWrapper(next) {
@Override
public boolean shouldSerializeMember(Class definedIn, String fieldName) {
if (definedIn == Object.class) {
try {
return this.realClass(fieldName) != null;
} catch(Exception e) {
return false;
}
} else {
return super.shouldSerializeMember(definedIn, fieldName);
}
}
};
}
};
return xStream;
}
}
| [
"wxd_1024@163.com"
] | wxd_1024@163.com |
e5548dce77f6473278d9ddc378cbea7d3283bc82 | 9734f2d2aa166d554201a383e400c463a73a5e4b | /workspace_java80/src/design/duck/MuteQuack.java | fdf40cd5b9b1c9566d85af25e16069adf564cf64 | [] | no_license | jhjh0208/KOSMO80_ljh | 25026cffc11d58a525c65529793eb706d66c3d01 | 8ca89815d5e99773c4c63c0886a0761af4062963 | refs/heads/main | 2023-04-11T05:50:16.484286 | 2021-04-23T13:48:10 | 2021-04-23T13:48:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | package design.duck;
public class MuteQuack implements QuackBehavior {
@Override
public void quack() {
System.out.println("조용.....");
}
}
| [
"as97164@naver.com"
] | as97164@naver.com |
358cd313339acfa6d70c7640980d1a9d84c5cd7c | 7ad6c9574fb687889e7cec726755c5db84a419a6 | /src/main/java/com/kmutt/sit/jpa/entities/LogisticsJobResult.java | 18049d89f4f68342d1d0b2bd7f68ce635ee9cf88 | [] | no_license | pwangsom/multi-objective-logistics | 9cab28100c1f5760428bec0da23bc4a7bf2e434f | 250a95e58361f3fbd2d6c45c654e10e179a20cba | refs/heads/master | 2022-01-27T03:03:23.916450 | 2022-01-10T00:54:39 | 2022-01-10T00:54:39 | 189,690,790 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | package com.kmutt.sit.jpa.entities;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
@Data
@Entity
@Table(schema = "public", name = "logistics_job_result")
public class LogisticsJobResult {
@Id
@Column(name="solution_id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer solutionId;
@Column(name="normalized_objective_1")
private BigDecimal normalizedObjective1;
@Column(name="normalized_objective_2")
private BigDecimal normalizedObjective2;
@Column(name="normalized_objective_3")
private BigDecimal normalizedObjective3;
@Column(name="objective_1")
private BigDecimal objective1;
@Column(name="objective_2")
private BigDecimal objective2;
@Column(name="objective_3")
private BigDecimal objective3;
@Column(name="problem_id")
private Integer problemId;
@Column(name="solution_detail")
private String solutionDetail;
@Column(name="solution_index")
private Integer solutionIndex;
}
| [
"pwangsom@gmail.com"
] | pwangsom@gmail.com |
43a04a1feaa447f843adb6f2abe73330f1e6236d | ef94e09a36bc5ba1b7588ace73e56e0fd04da8fb | /src/main/java/biz/eurosib/lkdkp/kafka/RequestDto.java | 1b351c50aa6815dc66c311bc57d073a93ce53790 | [] | no_license | Olimpian/lkdkp-player | 119897e0d3ba63936f29e42d1a5aec4051b24117 | 964197ae8db753393ac3b538d48bf9271b832543 | refs/heads/master | 2023-05-08T09:17:33.844362 | 2021-05-27T12:20:07 | 2021-05-27T12:20:07 | 366,386,190 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package biz.eurosib.lkdkp.kafka;
import java.util.UUID;
public class RequestDto extends AbstractDto {
private String data;
private UUID taskGuid;
public RequestDto() {}
public RequestDto(String data, UUID taskGuid) {
this.data = data;
this.taskGuid = taskGuid;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public UUID getTaskGuid() {
return taskGuid;
}
public void setTaskGuid(UUID taskGuid) {
this.taskGuid = taskGuid;
}
}
| [
"torry_2902@mail.ru"
] | torry_2902@mail.ru |
691d1ede32fc573814c6a2f8c74a87b443b0ec38 | 78dde17de7e77f8faafcbbd8282a9b2184362f2f | /src/com/javarush/test/level10/lesson11/bonus02/Solution.java | 74d3827004a031a0659f5a7bdc95acf2d64bf9f0 | [] | no_license | Faoxis/JavaRush | 072e6bde509a7ace689f8d88ca94de35470de68f | b2fdf80362173cfea927710f10d607de02825d22 | refs/heads/master | 2021-01-10T17:15:40.673771 | 2017-01-13T12:57:24 | 2017-01-13T12:57:24 | 53,933,174 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,037 | java | package com.javarush.test.level10.lesson11.bonus02;
import java.io.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/* Нужно добавить в программу новую функциональность
Задача: Программа вводит с клавиатуры пару (число и строку) и выводит их на экран.
Новая задача: Программа вводит с клавиатуры пары (число и строку), сохраняет их в HashMap.
Пустая строка – конец ввода данных. Числа могу повторяться. Строки всегда уникальны. Введенные данные не должны потеряться!
Затем программа выводит содержание HashMap на экран.
Пример ввода:
1
Мама
2
Рама
1
Мыла
Пример вывода:
1 Мыла
2 Рама
1 Мама
*/
public class Solution
{
public static void main(String[] args) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
HashMap<String, Integer> map = new HashMap<String, Integer>();
int numb = Integer.valueOf(reader.readLine());
String str = reader.readLine();
while (!str.isEmpty()) {
map.put(str, numb);
try {
numb = Integer.parseInt(reader.readLine());
} catch (Exception e) {
break;
}
str = reader.readLine();
}
Iterator<Map.Entry<String, Integer>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, Integer> pair = iterator.next();
System.out.println(pair.getValue() + " " + pair.getKey());
}
//int id = Integer.parseInt(reader.readLine());
//String name = reader.readLine();
//System.out.println("Id=" + id + " Name=" + name);
}
}
| [
"Faoxis@mail.ru"
] | Faoxis@mail.ru |
bf1b1305db13ac7f6f4bea34ea85693c04c5d34b | 5f6a2db8156557087bab9e46833dbe6517e71169 | /src/test/java/objects/SettingsTest.java | 5393b7e10eaa1fd3681d9c4a0b9c0c3e91c93c70 | [] | no_license | n0c1ip/UserList | e4f6308523a974620e5205371b6b55ee2bf5a869 | 589befa28125c4346e9464f5b687211091fef6c1 | refs/heads/master | 2021-01-21T23:13:29.508880 | 2016-03-29T05:24:53 | 2016-03-29T05:24:53 | 58,956,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 804 | java | package objects;
import org.junit.Assert;
import org.junit.Test;
public class SettingsTest {
@Test
public void shouldGetDatabase() {
Settings.DATABASE expectedDB = Settings.DATABASE.MYSQL;
Settings settings = new Settings();
settings.setDatabase(expectedDB);
Assert.assertEquals(expectedDB, settings.getDatabase());
}
@Test
public void shouldSetServerInnerSettings() {
String prefix = "jdbc:derby:testdb";
String postfix = ";create=true";
String server = "";
Settings settings = new Settings();
settings.setDatabase(Settings.DATABASE.EMBEDDED);
Assert.assertEquals(server, settings.getServer());
Assert.assertEquals(prefix + server + postfix, settings.getServerWithInnerSettings());
}
} | [
"hofls@ya.ru"
] | hofls@ya.ru |
e4622f32581bfea58e78e37599e21b2a67a7dac5 | dba0de5555047a0f6709c47b0174cd549f6d3e42 | /src/main/java/com/zhanghao/service/AsyncTask.java | 27cc229db9422f0e67adb95edc07ffef7c0156de | [] | no_license | BlueSky9806/blog | b0c89f49158b73d723c7050a925edd6ab7cd5f05 | 3d9675f9a0f768d5ac882f2e61c435b2b52cb694 | refs/heads/master | 2023-06-11T07:38:32.632688 | 2021-06-21T14:05:17 | 2021-06-21T14:05:17 | 378,927,767 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,635 | java | package com.zhanghao.service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import java.util.concurrent.TimeUnit;
/**
* @author zhanghao
* @data 2021/06/18
*/
@Slf4j
@Service
public class AsyncTask {
@Value(value = "${spring.mail.username}")
private String from;
@Autowired
private JavaMailSender javaMailSender;
@Autowired
private TemplateEngine templateEngine;
@Async
public void toSendMail(Exception e) throws MessagingException {
MimeMessage message = javaMailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message, true);
helper.setSubject("Blog Exception Info");
helper.setFrom(from);
helper.setTo(from);
Context context = new Context();
context.setVariable("message",e.toString());
String process = templateEngine.process("mail.html", context);
helper.setText(process, true);
javaMailSender.send(message);
}
@Async
public void taskA() throws InterruptedException {
TimeUnit.SECONDS.sleep(5);
log.info("Thread name -> " + Thread.currentThread().getName());
}
} | [
"andy@qq.com"
] | andy@qq.com |
d25c14acf4cd5d9baf792a700e1569a3ac80e00d | eb4d72ae0ba86bf1cefd8e4561ff6ac8712117d6 | /src/main/java/com/nowcoder/community/util/MailClient.java | ca0f4defaceb92f650a996843792c8f32c2a2b11 | [] | no_license | ligougou031/community | 35d7f5fbad05b56629860402e81a1e5b5207dc8a | 56431871d0874ca35c70cdc5e136c610d6243839 | refs/heads/master | 2023-09-05T15:10:50.346027 | 2021-11-26T12:56:29 | 2021-11-26T12:56:29 | 424,496,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,314 | java | package com.nowcoder.community.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMailMessage;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Component;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
@Component
public class MailClient {
private static final Logger logger = LoggerFactory.getLogger(MailClient.class);
@Autowired
private JavaMailSender mailSender;
@Value("${spring.mail.username}")
private String from;
public void sendMail(String to, String subject, String content) {
try {
MimeMessage message = mailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message);
helper.setFrom(from);
helper.setTo(to);
helper.setSubject(subject);
helper.setText(content,true);
mailSender.send(helper.getMimeMessage());
} catch (MessagingException e) {
logger.error("发送邮件失败:" + e.getMessage());
}
}
}
| [
"2473914663@qq.com"
] | 2473914663@qq.com |
9520196734239ac5b6d04fb816050096a6462e15 | 8cc3b1263aa6e88a28503d73ed575d766bf5e120 | /src/test/java/com/robertdailey/reservations/ReservationsApplicationTests.java | ef76cf2705572e74cd77886f74cbeb922caaa011 | [] | no_license | daileyo/reservations | 1e0636b855cded51f626dea7dd9caca2c929beef | 797647cc24f25ef4e53a147a692b34f6159c31b3 | refs/heads/master | 2021-06-28T14:13:27.971593 | 2017-09-10T23:55:54 | 2017-09-10T23:55:54 | 103,072,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package com.robertdailey.reservations;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ReservationsApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"dale13@gmail.com"
] | dale13@gmail.com |
76426ccc4c5786b21cc5f354473a39810dd5a53b | 5602834d6ceb24792fae3e53b8432385ee67c94b | /vuze/com/aelitis/azureus/core/speedmanager/SpeedManagerLimitEstimate.java | 4920dc4d092734cb36fa46dc9b11581c1707f9e4 | [] | no_license | alevy/comet | 6cc7a1a53abe4c9cd27d55ed2a5dad2d28bca62e | e47c7390a757e1892a39b10e45b9188d3934c367 | refs/heads/master | 2021-01-22T05:06:17.157276 | 2010-11-10T19:31:28 | 2010-11-10T19:31:28 | 1,002,581 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,771 | java | /*
* Created on Jul 5, 2007
* Created by Paul Gardner
* Copyright (C) 2007 Aelitis, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* AELITIS, SAS au capital de 63.529,40 euros
* 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
*
*/
package com.aelitis.azureus.core.speedmanager;
public interface
SpeedManagerLimitEstimate
{
public static final float TYPE_UNKNOWN = -0.1f;
public static final float TYPE_ESTIMATED = 0.0f;
public static final float TYPE_CHOKE_ESTIMATED = 0.5f;
public static final float TYPE_MEASURED_MIN = 0.8f;
public static final float TYPE_MEASURED = 0.9f;
public static final float TYPE_MANUAL = 1.0f;
public int
getBytesPerSec();
/**
* One of the above constants
* @return
*/
public float
getEstimateType();
/**
* For estimated limits:
* -1 = estimate derived from bad metrics
* +1 = estimate derived from good metric
* <1 x > -1 = relative goodness of metric
* @return
*/
public float
getMetricRating();
public int[][]
getSegments();
public String
getString();
}
| [
"roxana@f0975dda-a4ee-4f3e-8f18-aa73162a42a9"
] | roxana@f0975dda-a4ee-4f3e-8f18-aa73162a42a9 |
ccc83fdb43d9b210a0d314807c1adec4a5fecae0 | 0c7d1f1698a675a3043aedf962b937867aa0b5e2 | /Rev_Social_Media/SocialNetwork/src/main/java/com/sn/controller/PostController.java | 346e893d6e2c64d0e2fe8f563ed939f2de03c42f | [] | no_license | Bnbingham/Projects | ffd8298ec465ec92783cd3bcdce9b898e18cbbf0 | b2946ca2dad0f1a9dd98650e8a7cbc36922e4471 | refs/heads/master | 2022-12-16T21:55:46.600009 | 2020-09-28T07:47:51 | 2020-09-28T07:47:51 | 291,769,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,099 | java | package com.sn.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
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.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import com.sn.entity.Post;
import com.sn.service.PostService;
@RestController
@RequestMapping("/post")
@CrossOrigin
public class PostController {
@Autowired
PostService postService;
@RequestMapping(value = "/addpost", method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(code = HttpStatus.OK)
@ResponseBody()
public Post addNewPost(@RequestBody Post p) {
return this.postService.addPost(p);
}
@RequestMapping(value = "/all", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(code = HttpStatus.OK)
@ResponseBody()
public List<Post> getAllPost() {
return this.postService.getAllPosts();
}
@RequestMapping(value = "/allordered", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(code = HttpStatus.OK)
@ResponseBody()
public List<Post> getAllPostOrdered() {
return this.postService.getAllPostsOrdered();
}
@RequestMapping(value = "/userordered", method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(code = HttpStatus.OK)
@ResponseBody()
public List<Post> getFirst15PostsByUsernameOrdered(@RequestBody Post p) {
return this.postService.getPostsByUsername(p.getUsername());
}
}
| [
"bnbingham@hotmail.com"
] | bnbingham@hotmail.com |
02123243f801dcaca0003b086b920eac22e7e871 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/google--guava/cfe05dfda3ba79aa1bd3acce6b4e766eb7b9bc00/after/GraphEquivalenceTest.java | b48bc9706d016271d24bce81f02989ab9141f05e | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,846 | java | /*
* Copyright (C) 2014 The Guava Authors
*
* 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 com.google.common.graph;
import static com.google.common.truth.Truth.assertThat;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
@AndroidIncompatible
// TODO(cpovirk): Figure out Android JUnit 4 support. Does it work with Gingerbread? @RunWith?
@RunWith(Parameterized.class)
public final class GraphEquivalenceTest {
private static final Integer N1 = 1;
private static final Integer N2 = 2;
private static final Integer N3 = 3;
enum GraphType {
UNDIRECTED,
DIRECTED
}
private final GraphType graphType;
private final MutableGraph<Integer> graph;
// add parameters: directed/undirected
@Parameters
public static Collection<Object[]> parameters() {
return Arrays.asList(new Object[][] {{GraphType.UNDIRECTED}, {GraphType.DIRECTED}});
}
public GraphEquivalenceTest(GraphType graphType) {
this.graphType = graphType;
this.graph = createGraph(graphType);
}
private static MutableGraph<Integer> createGraph(GraphType graphType) {
switch (graphType) {
case UNDIRECTED:
return GraphBuilder.undirected().allowsSelfLoops(true).build();
case DIRECTED:
return GraphBuilder.directed().allowsSelfLoops(true).build();
default:
throw new IllegalStateException("Unexpected graph type: " + graphType);
}
}
private static GraphType oppositeType(GraphType graphType) {
switch (graphType) {
case UNDIRECTED:
return GraphType.DIRECTED;
case DIRECTED:
return GraphType.UNDIRECTED;
default:
throw new IllegalStateException("Unexpected graph type: " + graphType);
}
}
@Test
public void equivalent_nodeSetsDiffer() {
graph.addNode(N1);
MutableGraph<Integer> g2 = createGraph(graphType);
g2.addNode(N2);
assertThat(Graphs.equivalent(graph, g2)).isFalse();
}
// Node/edge sets are the same, but node/edge connections differ due to graph type.
@Test
public void equivalent_directedVsUndirected() {
graph.putEdge(N1, N2);
MutableGraph<Integer> g2 = createGraph(oppositeType(graphType));
g2.putEdge(N1, N2);
assertThat(Graphs.equivalent(graph, g2)).isFalse();
}
// Node/edge sets and node/edge connections are the same, but directedness differs.
@Test
public void equivalent_selfLoop_directedVsUndirected() {
graph.putEdge(N1, N1);
MutableGraph<Integer> g2 = createGraph(oppositeType(graphType));
g2.putEdge(N1, N1);
assertThat(Graphs.equivalent(graph, g2)).isFalse();
}
// Node/edge sets and node/edge connections are the same, but graph properties differ.
// In this case the graphs are considered equivalent; the property differences are irrelevant.
@Test
public void equivalent_propertiesDiffer() {
graph.putEdge(N1, N2);
MutableGraph<Integer> g2 = GraphBuilder.from(graph)
.allowsSelfLoops(!graph.allowsSelfLoops())
.build();
g2.putEdge(N1, N2);
assertThat(Graphs.equivalent(graph, g2)).isTrue();
}
// Node/edge sets and node/edge connections are the same, but edge order differs.
// In this case the graphs are considered equivalent; the edge add orderings are irrelevant.
@Test
public void equivalent_edgeAddOrdersDiffer() {
GraphBuilder<Integer> builder = GraphBuilder.from(graph);
MutableGraph<Integer> g1 = builder.build();
MutableGraph<Integer> g2 = builder.build();
// for g1, add 1->2 first, then 3->1
g1.putEdge(N1, N2);
g1.putEdge(N3, N1);
// for g2, add 3->1 first, then 1->2
g2.putEdge(N3, N1);
g2.putEdge(N1, N2);
assertThat(Graphs.equivalent(g1, g2)).isTrue();
}
@Test
public void equivalent_edgeDirectionsDiffer() {
graph.putEdge(N1, N2);
MutableGraph<Integer> g2 = createGraph(graphType);
g2.putEdge(N2, N1);
switch (graphType) {
case UNDIRECTED:
assertThat(Graphs.equivalent(graph, g2)).isTrue();
break;
case DIRECTED:
assertThat(Graphs.equivalent(graph, g2)).isFalse();
break;
default:
throw new IllegalStateException("Unexpected graph type: " + graphType);
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
27b99b5fa4620b107baea42ddf8aff5ad371cf00 | 5afc7824979aacf89a96c72126f0c9ecefc6da14 | /Seminar_1/src/seminar1/iterators/MergingIncreasingIterator.java | 52b09bd234d8008194788ca40be2ed429cec23d9 | [] | no_license | vladefr97/Seminar_1_tasks | bd5a322c54a62ca2813833bcafad14ddf2a57ecd | 0b604b0ec23f9ed1162f529733183f38badec58b | refs/heads/master | 2021-07-15T05:20:24.938415 | 2017-10-16T20:48:45 | 2017-10-16T20:48:45 | 107,180,549 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,099 | java | package seminar1.iterators;
import java.util.Iterator;
/**
* Итератор возвращающий последовательность из двух возрастающих итераторов в порядке возрастания
* first = 1,3,4,5,7
* second = 0,2,4,6,8
* result = 0,1,2,3,4,4,5,6,7,8
* <p>
* Time = O(k),
* k — суммарное количество элементов
*/
public class MergingIncreasingIterator implements Iterator<Integer> {
private IncreasingIterator first;
private IncreasingIterator second;
//private int step;
boolean nextA = true, nextB = true, nextC = false;
int size = 2;
int[][] array = new int[size][];
boolean getTwo = true;
public MergingIncreasingIterator(IncreasingIterator first, IncreasingIterator second) {
this.first = first;
this.second = second;
array[0] = new int[first.stepLimit];
array[1] = new int[second.stepLimit];
int index = 0;
while (first.hasNext()) {
array[0][index] = first.next();
index++;
}
index = 0;
while (second.hasNext()) {
array[1][index] = second.next();
index++;
}
/* TODO: implement it */
}
@Override
public boolean hasNext() {
/* TODO: implement it */
return cur1<array[0].length||cur2<array[1].length;
}
int cur1 = 0, cur2 = 0;
@Override
public Integer next() {
if (cur1 < array[0].length && cur2 < array[1].length) {
if (array[0][cur1] <= array[1][cur2]) {
cur1++;
return array[0][cur1-1];
} else if (array[0][cur1] > array[1][cur2]) {
cur2++;
return array[1][cur2-1];
}
}else {
if(cur2>=array[1].length){
if(cur1<array[0].length){cur1++;return array[0][cur1-1]; }
else return null;
}else {cur2++; return array[1][cur2-1];}
}
return null;
}
/* TODO: implement it */
}
| [
"noreply@github.com"
] | noreply@github.com |
8f9d60bff1f6a26d0f949fdbf8a7d8375921c688 | 93625647bca3b394dc5baf14d54a4ace50baf3f1 | /app/src/main/java/com/demos/mvvm/mvvmViewModel/MvvmBindingViewModel.java | 4448ebdb073b22d84b6d43a46a24f67a7a52c9a3 | [] | no_license | DoubleDa/Demos | 9c910573b77ff1a64e6ee9f273bc9ee6871964cc | ce4ad9ab9957c5323b36645e23d13ab62967bdaa | refs/heads/master | 2020-12-26T10:08:36.248969 | 2016-07-13T15:02:03 | 2016-07-13T15:02:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 316 | java | package com.demos.mvvm.mvvmViewModel;
import com.android.volley.Response;
import com.demos.mvvm.mvvmView.MvvmView;
/**
* Created by wangpeng on 16/5/18.
*/
public abstract class MvvmBindingViewModel<M, V extends MvvmView> extends MvvmBaseViewModel<V> implements Response.Listener<M>, Response.ErrorListener {
}
| [
"mrwrong12138@gmail.com"
] | mrwrong12138@gmail.com |
d6e6972887d34e9f88eed7c169a4102b41e871cd | 652d97e0f234b8e7fa63f962e1a1e73e36e936ee | /AutoConfig/AutoConfig.java | a12470d7365465ce0e33ad9efbd736e8576ba142 | [] | no_license | minchjung/Spring | 32b8853e8150d70eeed21a10056ba74d07f5b454 | b909f4b0cae3ab822c26198276d0902bd5cbd282 | refs/heads/master | 2023-06-08T17:00:19.325098 | 2021-06-25T17:29:33 | 2021-06-25T17:29:33 | 367,881,944 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 972 | java | package hello.core;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Component;
import java.lang.annotation.Annotation;
@Configuration
@ComponentScan(
// Spring-Boot 다른 Configuration 수동 bean 등록 과정을 없애 줘야 하므로, Configuration Annotation은 bean
// component 대상에서 제외 시켜주자 (교육 설정상, 자동 등록시 수동 등록 과정을 빼 주는 것 )
excludeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = Configuration.class)
)
public class AutoConfig {
// @Component: bean 등록 대상 Class 에 annotation을 붙여준다. 그리고 DI 는 @Autowired를 붙여주면,
//의존 관계 연결 필요시 주입 Type을 등록된 bean 중에 탐색해 해당 type을 연결 주입 해주게 된다.
}
| [
"jung8508@gmail.com"
] | jung8508@gmail.com |
bc867e9d8a3fe8fcfd0a6cc715f385e813f249f9 | 2580c99c1a11e8832d55cbb5ba68f182d86642c0 | /pinyougou-sellergoods-interface/src/main/java/com/pinyougou/sellergoods/service/GoodsService.java | 51a8be035ad55bab6d5bab3e7e5d44b6a951b3a0 | [] | no_license | Songleen/pinyougou01 | 8f80c9a4b8fe2e9ca19afc9309db7ebabf450abc | de139bdff8d2399b7c7833c8a42e88e237d7d631 | refs/heads/master | 2020-04-17T08:41:45.518215 | 2019-01-19T12:44:41 | 2019-01-19T12:45:11 | 166,422,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 891 | java | package com.pinyougou.sellergoods.service;
import com.pinyougou.grouppojo.PageResult;
import com.pinyougou.pojo.TbGoods;
import java.util.List;
/**
* 服务层接口
* @author Administrator
*
*/
public interface GoodsService {
/**
* 返回全部列表
* @return
*/
public List<TbGoods> findAll();
/**
* 返回分页列表
* @return
*/
public PageResult findPage(int pageNum, int pageSize);
/**
* 增加
*/
public void add(TbGoods goods);
/**
* 修改
*/
public void update(TbGoods goods);
/**
* 根据ID获取实体
* @param id
* @return
*/
public TbGoods findOne(Long id);
/**
* 批量删除
* @param ids
*/
public void delete(Long[] ids);
/**
* 分页
* @param pageNum 当前页 码
* @param pageSize 每页记录数
* @return
*/
public PageResult findPage(TbGoods goods, int pageNum, int pageSize);
}
| [
"sellee7092@163.com"
] | sellee7092@163.com |
9d6083288e6c59d908f8b695ea8b6564719a907d | 63b210e005d1099b53ecf55095b5750b972e91bf | /app/src/main/java/com/example/gaurav/hungergo/non_veg_section/activity/Nonvegsection.java | a0afccbc748fc7b05259b87711cb2cad9ba6fe7a | [] | no_license | Puruchandra/HungerGo | 9c4379ba784a33d982713397bd8995c3de29cb37 | c677026b1656b69467817c4c17ffa81f5f48f24e | refs/heads/master | 2020-12-02T19:17:33.948974 | 2017-07-05T11:43:10 | 2017-07-05T11:43:10 | 96,319,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,240 | java | package com.example.gaurav.hungergo.non_veg_section.activity;
import android.content.Intent;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Toast;
import com.example.gaurav.hungergo.Dashboard_main;
import com.example.gaurav.hungergo.R;
import com.example.gaurav.hungergo.cart_custom_list.activity.Cart_Checkout;
import com.example.gaurav.hungergo.non_veg_section.myadaptar.MyArrayAdapter;
import com.example.gaurav.hungergo.non_veg_section.pojo.ListPojo;
import java.util.ArrayList;
public class Nonvegsection extends AppCompatActivity {
ListView listView;
ImageView goback;
int backButtonCount=0;
com.github.clans.fab.FloatingActionButton cartbutton;
ArrayList<ListPojo> pojoArrayList=new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_nonvegsection);
init();
fillValues();
MyArrayAdapter myArrayAdapter=new MyArrayAdapter(this,R.layout.listview_vegsection,pojoArrayList);
listView.setAdapter(myArrayAdapter);
controllistner();
}
private void init() {
listView= (ListView) findViewById(R.id.listview_nonveg_section);
goback = (ImageView)findViewById(R.id.imagebackclick_nonvegsection);
goback.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i= new Intent(Nonvegsection.this, Dashboard_main.class);
startActivity(i);
}
});
cartbutton= (com.github.clans.fab.FloatingActionButton) findViewById(R.id.goto_cart_nonveg);
}
private void fillValues() {
// for (int i=0;i<10;++i)
//{
ListPojo listPojo1=new ListPojo();
listPojo1.setDiscription("3pcs of fish");
listPojo1.setImage(R.drawable.non_veg1_fish);
listPojo1.setItem_name("Fish cury");
listPojo1.setPrice("₹ 160");
listPojo1.setSymbolImage(R.drawable.symbol_nonveg);
pojoArrayList.add(listPojo1);
//next item ListPojo listPojo=new ListPojo();
ListPojo listPojo2=new ListPojo();
listPojo2.setDiscription("3pcs chicken tikka");
listPojo2.setImage(R.drawable.non_veg2_chicken_tikka);
listPojo2.setItem_name("Chicken Tikka");
listPojo2.setPrice("₹ 170");
listPojo2.setSymbolImage(R.drawable.symbol_nonveg);
pojoArrayList.add(listPojo2);
//next item ListPojo listPojo=new ListPojo();
ListPojo listPojo3=new ListPojo();
listPojo3.setDiscription("4pcs chicken ");
listPojo3.setImage(R.drawable.non_veg3_chicken_masala);
listPojo3.setItem_name("Chicken Masala");
listPojo3.setPrice("₹ 210");
listPojo3.setSymbolImage(R.drawable.vegsymbol);
pojoArrayList.add(listPojo3);
//next item ListPojo listPojo=new ListPojo();
ListPojo listPojo4=new ListPojo();
listPojo4.setDiscription("4pcs chicken");
listPojo4.setImage(R.drawable.non_veg4_chicken_do_payaza);
listPojo4.setItem_name("Chicken Do Payaza");
listPojo4.setPrice("₹ 220");
listPojo4.setSymbolImage(R.drawable.symbol_nonveg);
pojoArrayList.add(listPojo4);
//next item ListPojo listPojo=new ListPojo();
ListPojo listPojo5=new ListPojo();
listPojo5.setDiscription("4pcd of boneless chicken");
listPojo5.setImage(R.drawable.non_veg5_chicken_boneless);
listPojo5.setItem_name("Boneless Chicken");
listPojo5.setPrice("₹ 240");
listPojo5.setSymbolImage(R.drawable.symbol_nonveg);
pojoArrayList.add(listPojo5);
// //next item ListPojo listPojo=new ListPojo();
ListPojo listPojo6=new ListPojo();
listPojo6.setDiscription("250g rice and 2pcs chicken");
listPojo6.setImage(R.drawable.non_veg6_chicken_biriyani);
listPojo6.setItem_name("Chicken Biriyani");
listPojo6.setPrice("₹ 130");
listPojo6.setSymbolImage(R.drawable.symbol_nonveg);
pojoArrayList.add(listPojo6);
//next item ListPojo listPojo=new ListPojo();
ListPojo listPojo7=new ListPojo();
listPojo7.setDiscription("Chicken korma half plate)");
listPojo7.setImage(R.drawable.non_veg7_chicken_kormajpg);
listPojo7.setItem_name("Chicken Korma");
listPojo7.setPrice("₹ 180");
listPojo7.setSymbolImage(R.drawable.symbol_nonveg);
pojoArrayList.add(listPojo7);
//next item ListPojo listPojo=new ListPojo();
ListPojo listPojo8=new ListPojo();
listPojo8.setDiscription("4pcs Mutton");
listPojo8.setImage(R.drawable.non_veg8_mutten);
listPojo8.setItem_name("Mutton");
listPojo8.setPrice("₹ 320");
listPojo8.setSymbolImage(R.drawable.symbol_nonveg);
pojoArrayList.add(listPojo8);
//next item ListPojo listPojo=new ListPojo();
ListPojo listPojo9=new ListPojo();
listPojo9.setDiscription("full plate rice");
listPojo9.setImage(R.drawable.non_veg10_rice);
listPojo9.setItem_name("Rice");
listPojo9.setPrice("₹ 60");
listPojo9.setSymbolImage(R.drawable.vegsymbol);
pojoArrayList.add(listPojo9);
//next item ListPojo listPojo=new ListPojo();
ListPojo listPojo10=new ListPojo();
listPojo10.setDiscription("1pcs Butter roti");
listPojo10.setImage(R.drawable.veg14_butter_roti);
listPojo10.setItem_name("Butter Roti");
listPojo10.setPrice("₹ 21");
listPojo10.setSymbolImage(R.drawable.vegsymbol);
pojoArrayList.add(listPojo10);
// //next item ListPojo listPojo=new ListPojo();
ListPojo listPojo11=new ListPojo();
listPojo11.setDiscription("1pcs Butter nan");
listPojo11.setImage(R.drawable.veg18_butter_nan);
listPojo11.setItem_name("Butter Nan");
listPojo11.setPrice("₹ 27");
listPojo11.setSymbolImage(R.drawable.vegsymbol);
// pojoArrayList.add(listPojo11);
// //next item ListPojo listPojo=new ListPojo();
// ListPojo listPojo12=new ListPojo();
// listPojo12.setDiscription("200gm Poha");
// listPojo12.setImage(R.drawable.veg11_pooha);
// listPojo12.setItem_name("Poha ");
// listPojo12.setPrice("₹ 55");
// listPojo12.setSymbolImage(R.drawable.vegsymbol);
// pojoArrayList.add(listPojo12);
// //next item ListPojo listPojo=new ListPojo();
// ListPojo listPojo13=new ListPojo();
// listPojo13.setDiscription("Palak paneer 200g");
// listPojo13.setImage(R.drawable.veg13_palak_paneer);
// listPojo13.setItem_name("Palak Paneer ");
// listPojo13.setPrice("₹ 126");
// listPojo13.setSymbolImage(R.drawable.vegsymbol);
// pojoArrayList.add(listPojo13);
// //next item ListPojo listPojo=new ListPojo();
// ListPojo listPojo14=new ListPojo();
// listPojo14.setDiscription("1 pcs Butter Roti");
// listPojo14.setImage(R.drawable.veg14_butter_roti);
// listPojo14.setItem_name("Butter Roti");
// listPojo14.setPrice("₹ 22");
// listPojo14.setSymbolImage(R.drawable.vegsymbol);
// pojoArrayList.add(listPojo14);
// //next item ListPojo listPojo=new ListPojo();
// ListPojo listPojo15=new ListPojo();
//
// listPojo15.setDiscription("200gm Kadhai paneer");
// listPojo15.setImage(R.drawable.veg15_kadhi_paneer);
// listPojo15.setItem_name("Kadhai Paneer");
// listPojo15.setPrice("₹ 136");
// listPojo15.setSymbolImage(R.drawable.vegsymbol);
// pojoArrayList.add(listPojo15);
//// //next item ListPojo listPojo=new ListPojo();
// ListPojo listPojo16=new ListPojo();
// listPojo16.setDiscription("200g Sahi paneer");
// listPojo16.setImage(R.drawable.veg16_sahi_paneer);
// listPojo16.setItem_name("Sahi Paneer");
// listPojo16.setPrice("₹ 136");
// listPojo16.setSymbolImage(R.drawable.vegsymbol);
// pojoArrayList.add(listPojo16);
// //next item ListPojo listPojo=new ListPojo();
// ListPojo listPojo17=new ListPojo();
// listPojo17.setDiscription("Paneer butter masala 200g");
// listPojo17.setImage(R.drawable.veg17_paneer_butter_masala);
// listPojo17.setItem_name("Paneer Butter Masala");
// listPojo17.setPrice("₹ 136");
// listPojo17.setSymbolImage(R.drawable.vegsymbol);
// pojoArrayList.add(listPojo17);
// //next item ListPojo listPojo=new ListPojo();
// ListPojo listPojo18=new ListPojo();
// listPojo18.setDiscription("1pcs Butter nan");
// listPojo18.setImage(R.drawable.veg18_butter_nan);
// listPojo18.setItem_name("Butter Nan");
// listPojo18.setPrice("₹ 22");
// listPojo18.setSymbolImage(R.drawable.vegsymbol);
// pojoArrayList.add(listPojo18);
// //next item ListPojo listPojo=new ListPojo();
// ListPojo listPojo19=new ListPojo();
// listPojo19.setDiscription("1 pcs Plain Roti");
// listPojo19.setImage(R.drawable.veg19_plain_roti);
// listPojo19.setItem_name("Plain Roti");
// listPojo19.setPrice("₹ 17");
// pojoArrayList.add(listPojo19);
// listPojo19.setSymbolImage(R.drawable.vegsymbol);
// //next item ListPojo listPojo=new ListPojo();
// ListPojo listPojo20=new ListPojo();
//
// listPojo20.setDiscription("250g fried rice");
// listPojo20.setImage(R.drawable.veg20_fried_rice);
// listPojo20.setItem_name("Fried Rice");
// listPojo20.setPrice("₹ 75");
// listPojo20.setSymbolImage(R.drawable.vegsymbol);
// pojoArrayList.add(listPojo20);
//// //next item ListPojo listPojo=new ListPojo();
//
// ListPojo listPojo21=new ListPojo();
// listPojo21.setDiscription("Fried dal 300gm");
// listPojo21.setImage(R.drawable.veg21_dal_fri);
// listPojo21.setItem_name("Dal fry");
// listPojo21.setPrice("₹ 83");
// listPojo21.setSymbolImage(R.drawable.vegsymbol);
// pojoArrayList.add(listPojo21);
//// //}
}
@Override
public void onBackPressed()
{
if (backButtonCount >= 2)
{
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
} else {
Toast.makeText(this, "Press the back button once again to close the application.", Toast.LENGTH_SHORT).show();
++backButtonCount;
}
}
private void controllistner() {
cartbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i=new Intent(Nonvegsection.this, Cart_Checkout.class);
startActivity(i);
}
});
}
}
| [
"gaurav18.2013@gmail.com"
] | gaurav18.2013@gmail.com |
efe2f7c06076be93842821c66252fb9dbf936601 | b77be0b0e6b3ea59e8208a5980601729a198f4d1 | /app/src/main/java/com/google/android/gms/wallet/o.java | d68fac3478ddc5eac0b39f445791a1cc9cfda497 | [] | no_license | jotaxed/Final | 72bece24fb2e59ee5d604b6aca5d90656d2a7170 | f625eb81e99a23e959c9d0ec6b0419a3b795977a | refs/heads/master | 2020-04-13T11:50:14.498334 | 2018-12-26T13:46:17 | 2018-12-26T13:46:17 | 163,185,048 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,918 | java | package com.google.android.gms.wallet;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.safeparcel.a;
import com.google.android.gms.common.internal.safeparcel.b;
public class o implements Creator<ProxyCard> {
static void a(ProxyCard proxyCard, Parcel parcel, int i) {
int H = b.H(parcel);
b.c(parcel, 1, proxyCard.getVersionCode());
b.a(parcel, 2, proxyCard.avP, false);
b.a(parcel, 3, proxyCard.avQ, false);
b.c(parcel, 4, proxyCard.avR);
b.c(parcel, 5, proxyCard.avS);
b.H(parcel, H);
}
public /* synthetic */ Object createFromParcel(Parcel x0) {
return dW(x0);
}
public ProxyCard dW(Parcel parcel) {
String str = null;
int i = 0;
int G = a.G(parcel);
int i2 = 0;
String str2 = null;
int i3 = 0;
while (parcel.dataPosition() < G) {
int F = a.F(parcel);
switch (a.aH(F)) {
case 1:
i3 = a.g(parcel, F);
break;
case 2:
str2 = a.o(parcel, F);
break;
case 3:
str = a.o(parcel, F);
break;
case 4:
i2 = a.g(parcel, F);
break;
case 5:
i = a.g(parcel, F);
break;
default:
a.b(parcel, F);
break;
}
}
if (parcel.dataPosition() == G) {
return new ProxyCard(i3, str2, str, i2, i);
}
throw new a.a("Overread allowed size end=" + G, parcel);
}
public ProxyCard[] gd(int i) {
return new ProxyCard[i];
}
public /* synthetic */ Object[] newArray(int x0) {
return gd(x0);
}
}
| [
"jotaxed@gmail.com"
] | jotaxed@gmail.com |
e647bc9978532a55164120873265f48db05dd65a | 7118b5e438fe0f81ed2cfbef5ed68f5c0eaadcb3 | /qinyuan-lib-contact/src/test/java/com/qinyuan/lib/contact/qq/QQValidatorTest.java | ec5385a1ba6f69a9a295292df429dde2a56427b2 | [] | no_license | qinyuan/qinyuan-lib | c09a06287f67c9ae94a53a989881cf2c6fa8827b | 7e7b3fe6eb5f46894cd35d9a50f512691b874e6c | refs/heads/master | 2021-01-17T09:09:41.738058 | 2016-03-26T03:36:15 | 2016-03-26T03:36:15 | 41,036,155 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 555 | java | package com.qinyuan.lib.contact.qq;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class QQValidatorTest {
@Test
public void testValidate() throws Exception {
QQValidator validator = new QQValidator();
assertThat(validator.validate("48946556")).isTrue();
assertThat(validator.validate(null)).isFalse();
assertThat(validator.validate("5564a")).isFalse();
assertThat(validator.validate("")).isFalse();
assertThat(validator.validate(" ")).isFalse();
}
}
| [
"qinyuan15@sina.com"
] | qinyuan15@sina.com |
e152810685302c7748d93f3fa0b7bdbea74618eb | 52585492e9b822c7f22c61591b72554de2740511 | /src/main/java/pl/timetable/Category.java | 2e9dbebb98d545a7f21fe855a23cd5ceea3f2469 | [] | no_license | lOdwrot/timetable | a070d5f5ef582cc1f4a55ce98ca7927c37ed797e | 8f6365d8ab690799f3c0c90042d4f16859755782 | refs/heads/master | 2021-01-10T08:00:27.880970 | 2015-10-29T15:46:51 | 2015-10-29T15:46:51 | 45,193,902 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,532 | java | package pl.timetable;
import java.util.ArrayList;
/**
* Created by lodwr on 29.10.2015.
*/
public class Category {
private String categoryName;
private ArrayList<Task> tasks;
int lastIndex=0;
public Category(String name)
{
this.categoryName=name;
tasks = new ArrayList<Task>();
}
public void addTask(String name, Priority priority) throws TaskDuplicateException
{
for(Task t:tasks)
if(t.taskName.equals(name))
throw new TaskDuplicateException();
tasks.add(new Task(lastIndex,name,priority));
}
public void addTask(String name) throws TaskDuplicateException
{
for(Task t:tasks)
if(t.taskName.equals(name))
throw new TaskDuplicateException();
tasks.add(new Task(lastIndex,name));
}
public boolean checkTask(String name)
{
int i=0;
for(Task t: tasks)
{
if(t.taskName.equals(name)) {
tasks.get(i).check();
return true;
}
i++;
}
return false;
}
public boolean deleteTask(String name)
{
int i=0;
for(Task t: tasks)
{
if(t.taskName.equals(name)) {
tasks.remove(i);
return true;
}
i++;
}
return false;
}
public String getCategoryName() {
return categoryName;
}
public ArrayList<Task> getTasks() {
return tasks;
}
}
| [
"l.odwrot@gmail.com"
] | l.odwrot@gmail.com |
f1ca6c1a06c800e138e9f328ff0cd9acd4a4ce31 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2017/12/SessionFactoryImpl.java | c185e65e3794e6131af307dc634752491cc3f8ec | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 3,475 | java | /*
* Copyright (c) 2002-2017 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.server.rest.management.console;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.ServiceLoader;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.neo4j.helpers.collection.Iterables;
import org.neo4j.logging.LogProvider;
import org.neo4j.server.database.CypherExecutor;
import org.neo4j.server.database.Database;
public class SessionFactoryImpl implements ConsoleSessionFactory
{
private static final Collection<ConsoleSessionCreator> creators =
Iterables.asCollection( ServiceLoader.load( ConsoleSessionCreator.class ) );
private final HttpSession httpSession;
private final CypherExecutor cypherExecutor;
private final Map<String, ConsoleSessionCreator> engineCreators = new HashMap<>();
private final HttpServletRequest request;
public SessionFactoryImpl( HttpServletRequest request, List<String> supportedEngines, CypherExecutor cypherExecutor )
{
this.request = request;
this.httpSession = request.getSession(true);
this.cypherExecutor = cypherExecutor;
enableEngines( supportedEngines );
}
@Override
public ScriptSession createSession( String engineName, Database database, LogProvider logProvider )
{
engineName = engineName.toLowerCase();
if ( engineCreators.containsKey( engineName ) )
{
return getOrInstantiateSession( database, engineName + "-console-session", engineCreators.get( engineName ), logProvider );
}
throw new IllegalArgumentException( "Unknown console engine '" + engineName + "'." );
}
@Override
public Iterable<String> supportedEngines()
{
return engineCreators.keySet();
}
private ScriptSession getOrInstantiateSession( Database database, String key, ConsoleSessionCreator creator, LogProvider logProvider )
{
Object session = httpSession.getAttribute( key );
if ( session == null )
{
session = creator.newSession( database, cypherExecutor, request, logProvider );
httpSession.setAttribute( key, session );
}
return (ScriptSession) session;
}
private void enableEngines( List<String> supportedEngines )
{
for ( ConsoleSessionCreator creator : creators )
{
for ( String engineName : supportedEngines )
{
if ( creator.name().equalsIgnoreCase( engineName ) )
{
engineCreators.put( engineName.toLowerCase(), creator );
}
}
}
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
58efcc90d1619a2f7fff00a2ec5367ba08fa3500 | 19b2d2c498b42b5ffdaa3b686226e50ec90d8f6e | /newxinmaokehuduan/app/src/main/java/com/xmrxcaifu/vo/NetworkResponse.java | 630d91bf64e534465381114a1274816847bc51ef | [] | no_license | yuanchongzhang/udzt | 98f89580080c717b1f4b1c75008659031f345a6d | 47ab8773b35d35d263c66eaa932e23f71b672797 | refs/heads/master | 2020-04-29T14:09:25.879061 | 2019-03-15T08:24:19 | 2019-03-15T08:24:26 | 176,188,057 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,998 | java | /*
* Copyright (C) 2011 The Android Open Source Project
*
* 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 com.xmrxcaifu.vo;
import org.apache.http.HttpStatus;
import java.util.Collections;
import java.util.Map;
/**
* Data and headers returned from {@link Network#performRequest(Request)}.
*/
public class NetworkResponse {
/**
* Creates a new network response.
* @param statusCode the HTTP status code
* @param data Response body
* @param headers Headers returned with this response, or null for none
* @param notModified True if the server returned a 304 and the data was already in cache
*/
public NetworkResponse(int statusCode, byte[] data, Map<String, String> headers,
boolean notModified) {
this.statusCode = statusCode;
this.data = data;
this.headers = headers;
this.notModified = notModified;
}
public NetworkResponse(byte[] data) {
this(HttpStatus.SC_OK, data, Collections.<String, String>emptyMap(), false);
}
public NetworkResponse(byte[] data, Map<String, String> headers) {
this(HttpStatus.SC_OK, data, headers, false);
}
/** The HTTP status code. */
public final int statusCode;
/** Raw data from this response. */
public final byte[] data;
/** Response headers. */
public final Map<String, String> headers;
/** True if the server returned a 304 (Not Modified). */
public final boolean notModified;
} | [
"314159zhang"
] | 314159zhang |
1dfe2d4f492bd9228bc1d24ba16c53b13e185224 | eb710587fb38865be5ec5053767ebb03b6370ef0 | /SecurityController.java | 9d513f8cfdc3c8695102a84b363b68df73558174 | [] | no_license | razzesh2403/SpringBootApplication | e995f05896600db26f131987f7277bbe6fba7972 | 0f7b7c0fa3c069e54f5d44d73f4e29320847b004 | refs/heads/master | 2021-01-17T07:27:55.750038 | 2017-03-02T17:55:12 | 2017-03-02T17:55:12 | 83,705,959 | 0 | 0 | null | 2017-03-02T17:55:13 | 2017-03-02T17:29:21 | Java | UTF-8 | Java | false | false | 413 | java | package com.mvc.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.mvc.beans.User;
@Controller
public class SecurityController {
@RequestMapping(value = "/login", method = RequestMethod.GET)
public String userLogin(){
return "login";
}
}
| [
"noreply@github.com"
] | noreply@github.com |
1e07755151c7a58b958204ad1160464d1990a62d | 02f1d370499b2e8b8eb0e22cfd5850eacbfa6468 | /src/main/java/accelerator/cards/Polarize.java | 41f861ed04ca744c09ac6faaba3ee3949cc54b73 | [] | no_license | Villfuk02/The-Accelerator-Mod | 6f9969fc897e1d61a0741e5ee4a52d67c239d395 | f314e03314f7aa1f37ef2281a38a89132446d828 | refs/heads/master | 2020-04-16T11:31:17.344292 | 2019-02-09T09:36:44 | 2019-02-09T09:36:44 | 165,539,513 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,861 | java | package accelerator.cards;
import basemod.helpers.BaseModCardTags;
import com.megacrit.cardcrawl.actions.defect.ChannelAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import accelerator.AcceleratorMod;
import accelerator.actions.PloarizeAction;
import accelerator.orbs.MagneticOrb;
import accelerator.patches.AbstractCardEnum;
import basemod.abstracts.CustomCard;
public class Polarize extends CustomCard{
public static final String ID = "Polarize";
private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(AcceleratorMod.PREFIX + ID);
public static final String NAME = cardStrings.NAME;
public static final String DESCRIPTION = cardStrings.DESCRIPTION;
private static final int COST = 1;
private static final int BLOCK = 10;
private static final int UPGRADE = 3;
public Polarize() {
super(AcceleratorMod.PREFIX + ID, NAME, AcceleratorMod.CARD_IMG_PATH + ID + ".png", COST, DESCRIPTION,
AbstractCard.CardType.SKILL, AbstractCardEnum.ACC,
AbstractCard.CardRarity.COMMON, AbstractCard.CardTarget.SELF);
this.baseBlock = BLOCK;
this.tags.add(BaseModCardTags.BASIC_DEFEND);
}
@Override
public AbstractCard makeCopy() {
return new Polarize();
}
@Override
public void upgrade() {
if (!this.upgraded) {
upgradeName();
this.upgradeBlock(UPGRADE);
}
}
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
AbstractDungeon.actionManager.addToBottom(new PloarizeAction());
AbstractDungeon.actionManager.addToBottom(new ChannelAction(new MagneticOrb(this.block)));
}
}
| [
"vildagut@seznam.cz"
] | vildagut@seznam.cz |
8134bdfe2e257218e37aad7c3050835e8f3f1b79 | d422e6bef4d71b84e6d301f84633d24eca8e6b1f | /lombok-demo/src/main/java/com/adeng/lombok/Log/LogExample.java | f7f389dd4734f7daf2c109025fdcc1620fc09f5e | [] | no_license | adeng-wc/j2ee-demo | f5b90dfd370217fb046f1d9976325bd236634b38 | 09326d9a6e2a8a4d7710e3a26651c76fde30f598 | refs/heads/master | 2023-04-30T08:40:26.015903 | 2023-04-23T08:12:02 | 2023-04-23T08:12:02 | 174,507,762 | 0 | 1 | null | 2022-12-29T12:06:08 | 2019-03-08T09:27:22 | Java | UTF-8 | Java | false | false | 1,172 | java | package com.adeng.lombok.Log;
import lombok.extern.java.Log;
/**
* @author
*
* @CommonsLog
* 创建 private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LogExample.class);
* @JBossLog
* 创建 private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LogExample.class);
* @Log
* 创建 private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LogExample.class.getName());
* @Log4j
* 创建 private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LogExample.class);
* @Log4j2
* 创建 private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(LogExample.class);
* @Slf4j
* 创建 private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExample.class);
* @XSlf4j
* 创建 private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger(LogExample.class);
*
* @create 2018-04-21 23:41
*/
@Log
public class LogExample {
public static void main(String... args) {
log.info("Something's wrong here");
}
}
| [
"343577402@qq.com"
] | 343577402@qq.com |
b2ef67a91756bd60eb0640e4a845bb0775b6c0e0 | 1ffae9248d70be16356360d7606711769c94b526 | /app/src/main/java/com/example/androidweatherapp/Model/City.java | 29640430cea30c708c58149b69a3d0931709c304 | [] | no_license | bkopjar/weather-app-android | 709d1cdcfb8ae86011290ff38b47f2d85ab08ad1 | c9acf5d5586d4150b42272491eb021bcf94b536a | refs/heads/master | 2023-02-28T15:41:23.762464 | 2021-02-11T16:03:32 | 2021-02-11T16:03:32 | 338,080,208 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 163 | java | package com.example.androidweatherapp.Model;
public class City {
public int id;
public String name;
public Coord coord;
public String country;
}
| [
"bernardo.kopjar@gmail.com"
] | bernardo.kopjar@gmail.com |
e70414b2199287c91a7390c65ecd8ccd39e0a18b | 0bc78acfabc384fb813bff8355aa31f4a23766ba | /H2k/src/exercise/EmiCalculation.java | 249ebb15763ca4aa8329226e2164ded863eb8553 | [] | no_license | poritoshmridha/gitdemo | e321584351654f8ad9f186496d98341779efacc5 | 87a91ef6e2217fbe8d52f929fe442bdb8be580a7 | refs/heads/master | 2023-02-24T15:28:39.690177 | 2021-02-04T02:23:25 | 2021-02-04T02:23:25 | 335,797,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 920 | java | package exercise;
import java.util.Scanner;
public class EmiCalculation {
public static void main(String[] args) {
Scanner input= new Scanner(System.in);
double p;
double r;
double n;
System.out.print(" Enter your pricipal loan amount:");
p= input.nextDouble();
System.out.print(" Enter your rate:");
r= input.nextDouble();
System.out.print(" Enter your loan term:");
n= input.nextDouble();
double c= (r/12/100);
double rate= 1+c;
double a= Math.pow(rate, n);
double b= c*(a/(a-1));
double e= b*p;
System.out.println(" Your e is:" +e);
}
}
| [
"porit@DESKTOP-N0NT7O0"
] | porit@DESKTOP-N0NT7O0 |
d6c4808508e05614cde92cd4be45fdb0085da392 | 9343f47db5dc52e6eca3e572d360983348975c31 | /projects/OG-Master/src/main/java/com/opengamma/master/portfolio/PortfolioHistoryRequest.java | d3d0b58b3369677ae8136d618e09cef91a251ba3 | [
"Apache-2.0"
] | permissive | amkimian/OG-Platform | 323784bf3fea8a8af5fb524bcb4318d613eb6d9a | 11e9c34c571bef4a1b515f3704aeedeb2beb15c8 | refs/heads/master | 2021-01-20T20:57:29.978541 | 2013-02-19T19:40:06 | 2013-02-19T19:40:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,940 | java | /**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.master.portfolio;
import java.util.Map;
import javax.time.InstantProvider;
import org.joda.beans.BeanBuilder;
import org.joda.beans.BeanDefinition;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaProperty;
import org.joda.beans.Property;
import org.joda.beans.PropertyDefinition;
import org.joda.beans.impl.direct.DirectBeanBuilder;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;
import com.opengamma.id.ObjectIdentifiable;
import com.opengamma.master.AbstractHistoryRequest;
import com.opengamma.util.PublicSPI;
/**
* Request for the history of a portfolio.
* <p>
* A full portfolio master implements historical storage of data.
* History can be stored in two dimensions and this request provides searching.
* <p>
* The first historic dimension is the classic series of versions.
* Each new version is stored in such a manor that previous versions can be accessed.
* <p>
* The second historic dimension is corrections.
* A correction occurs when it is realized that the original data stored was incorrect.
* A simple portfolio master might simply replace the original version with the corrected value.
* A full implementation will store the correction in such a manner that it is still possible
* to obtain the value before the correction was made.
* <p>
* For example, a portfolio added on Monday and updated on Thursday has two versions.
* If it is realized on Friday that the version stored on Monday was incorrect, then a
* correction may be applied. There are now two versions, the first of which has one correction.
* This may continue, with multiple corrections allowed for each version.
* <p>
* Versions are represented by instants in the search.
*/
@PublicSPI
@BeanDefinition
public class PortfolioHistoryRequest extends AbstractHistoryRequest {
/**
* The depth of nodes to return.
* A value of zero returns the root node, one returns the root node with immediate children, and so on.
* A negative value, such as -1, returns the full tree.
* By default this is -1.
*/
@PropertyDefinition
private int _depth = -1;
/**
* Creates an instance.
* The object identifier must be added before searching.
*/
public PortfolioHistoryRequest() {
super();
}
/**
* Creates an instance with object identifier.
* This will retrieve all versions and corrections unless the relevant fields are set.
*
* @param objectId the object identifier, not null
*/
public PortfolioHistoryRequest(final ObjectIdentifiable objectId) {
super(objectId);
}
/**
* Creates an instance with object identifier and optional version and correction.
*
* @param objectId the object identifier, not null
* @param versionInstantProvider the version instant to retrieve, null for all versions
* @param correctedToInstantProvider the instant that the data should be corrected to, null for all corrections
*/
public PortfolioHistoryRequest(final ObjectIdentifiable objectId, InstantProvider versionInstantProvider, InstantProvider correctedToInstantProvider) {
super(objectId, versionInstantProvider, correctedToInstantProvider);
}
//------------------------- AUTOGENERATED START -------------------------
///CLOVER:OFF
/**
* The meta-bean for {@code PortfolioHistoryRequest}.
* @return the meta-bean, not null
*/
public static PortfolioHistoryRequest.Meta meta() {
return PortfolioHistoryRequest.Meta.INSTANCE;
}
static {
JodaBeanUtils.registerMetaBean(PortfolioHistoryRequest.Meta.INSTANCE);
}
@Override
public PortfolioHistoryRequest.Meta metaBean() {
return PortfolioHistoryRequest.Meta.INSTANCE;
}
@Override
protected Object propertyGet(String propertyName, boolean quiet) {
switch (propertyName.hashCode()) {
case 95472323: // depth
return getDepth();
}
return super.propertyGet(propertyName, quiet);
}
@Override
protected void propertySet(String propertyName, Object newValue, boolean quiet) {
switch (propertyName.hashCode()) {
case 95472323: // depth
setDepth((Integer) newValue);
return;
}
super.propertySet(propertyName, newValue, quiet);
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj != null && obj.getClass() == this.getClass()) {
PortfolioHistoryRequest other = (PortfolioHistoryRequest) obj;
return JodaBeanUtils.equal(getDepth(), other.getDepth()) &&
super.equals(obj);
}
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash += hash * 31 + JodaBeanUtils.hashCode(getDepth());
return hash ^ super.hashCode();
}
//-----------------------------------------------------------------------
/**
* Gets the depth of nodes to return.
* A value of zero returns the root node, one returns the root node with immediate children, and so on.
* A negative value, such as -1, returns the full tree.
* By default this is -1.
* @return the value of the property
*/
public int getDepth() {
return _depth;
}
/**
* Sets the depth of nodes to return.
* A value of zero returns the root node, one returns the root node with immediate children, and so on.
* A negative value, such as -1, returns the full tree.
* By default this is -1.
* @param depth the new value of the property
*/
public void setDepth(int depth) {
this._depth = depth;
}
/**
* Gets the the {@code depth} property.
* A value of zero returns the root node, one returns the root node with immediate children, and so on.
* A negative value, such as -1, returns the full tree.
* By default this is -1.
* @return the property, not null
*/
public final Property<Integer> depth() {
return metaBean().depth().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* The meta-bean for {@code PortfolioHistoryRequest}.
*/
public static class Meta extends AbstractHistoryRequest.Meta {
/**
* The singleton instance of the meta-bean.
*/
static final Meta INSTANCE = new Meta();
/**
* The meta-property for the {@code depth} property.
*/
private final MetaProperty<Integer> _depth = DirectMetaProperty.ofReadWrite(
this, "depth", PortfolioHistoryRequest.class, Integer.TYPE);
/**
* The meta-properties.
*/
private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap(
this, (DirectMetaPropertyMap) super.metaPropertyMap(),
"depth");
/**
* Restricted constructor.
*/
protected Meta() {
}
@Override
protected MetaProperty<?> metaPropertyGet(String propertyName) {
switch (propertyName.hashCode()) {
case 95472323: // depth
return _depth;
}
return super.metaPropertyGet(propertyName);
}
@Override
public BeanBuilder<? extends PortfolioHistoryRequest> builder() {
return new DirectBeanBuilder<PortfolioHistoryRequest>(new PortfolioHistoryRequest());
}
@Override
public Class<? extends PortfolioHistoryRequest> beanType() {
return PortfolioHistoryRequest.class;
}
@Override
public Map<String, MetaProperty<?>> metaPropertyMap() {
return _metaPropertyMap$;
}
//-----------------------------------------------------------------------
/**
* The meta-property for the {@code depth} property.
* @return the meta-property, not null
*/
public final MetaProperty<Integer> depth() {
return _depth;
}
}
///CLOVER:ON
//-------------------------- AUTOGENERATED END --------------------------
}
| [
"stephen@opengamma.com"
] | stephen@opengamma.com |
2550011c4c617f4fc495f59e6eaf864d2be1a725 | 9ffd453fb8c080ffa5a027473b135af7987eb6fb | /src/main/java/web/FileTreeServlet.java | 148e25bf9fe6e74ebcde752dededd14b491f868e | [] | no_license | lyashov/DZ12_2_EJB | edcc0f8091dbe19fc8adba38846d2b0c7f588324 | 9a79ca5740657e4c83447d320e25097d404cbf98 | refs/heads/master | 2021-07-19T05:44:27.466743 | 2019-11-17T09:30:49 | 2019-11-17T09:30:49 | 222,223,799 | 0 | 0 | null | 2020-10-13T17:31:23 | 2019-11-17T09:19:03 | Java | UTF-8 | Java | false | false | 961 | java | package web;
import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Response http page, contains file tree on the specifed path
*/
@WebServlet("/tree")
public class FileTreeServlet extends HttpServlet {
@EJB
private POJOBean pojoBean;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String page = FileTreeService.getHTTPFileTree(System.getProperty("user.dir"));
pojoBean.setHttpPage(page);
System.out.println(pojoBean.getHttpPage());
req.setAttribute("fileTree", pojoBean.getHttpPage());
req.getServletContext().getRequestDispatcher("/fileTree.jsp").forward(req, resp);
//super.doGet(req, resp);
}
}
| [
"lyaev31@gmail.com"
] | lyaev31@gmail.com |
de68f93f9110d5ea7ecf945ba5b18228733fe50f | 97d62b0db8cf020cb28902bffe07075a08eaf535 | /app/src/main/java/com/florian/colorharmony_theory_stragety/color/RGBDistanceProxy.java | 3fa0f301adfb4b84c13a6a31b48475d33290852d | [] | no_license | flohop/ColorHarmony | 150f8f78f0c95751d54bb8edd5cbdbf6b1c87c38 | 95fe7048d29dfc3bc3ed60076f99e2282110504d | refs/heads/master | 2022-11-19T14:13:59.369732 | 2020-07-16T17:24:28 | 2020-07-16T17:24:28 | 200,505,529 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,575 | java | /*
* __ .__ .__ ._____.
* _/ |_ _______ __|__| ____ | | |__\_ |__ ______
* \ __\/ _ \ \/ / |/ ___\| | | || __ \ / ___/
* | | ( <_> > <| \ \___| |_| || \_\ \\___ \
* |__| \____/__/\_ \__|\___ >____/__||___ /____ >
* \/ \/ \/ \/
*
* Copyright (c) 2006-2011 Karsten Schmidt
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* http://creativecommons.org/licenses/LGPL/2.1/
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
package com.florian.colorharmony_theory_stragety.color;
/**
* Implements the {@link DistanceProxy} interface to sort colors by RGB distance
* (used by {@link ColorList#sortByDistance(DistanceProxy, boolean)}).
*/
public class RGBDistanceProxy implements DistanceProxy {
public float distanceBetween(ReadonlyTColor a, ReadonlyTColor b) {
return a.distanceToRGB(b);
}
}
| [
"hoppe.florian02@gmail.com"
] | hoppe.florian02@gmail.com |
1edc858047b36ecf7f389aacc3446a49de604868 | e37ef7ba935453ad1e5e8256e1930a631e761d73 | /src/main/java/com/leishb/leetcode/tree/_1123_Lowest_Common_Ancestor_of_Deepest_Leaves.java | 5a8740a5c44ed41cc2ba9fa1661ad3b95d53dc23 | [] | no_license | arnabs542/leetcode-40 | ac4418e959af8af961a7415af0def52b69b9239b | 6e421b353159e4f7c79033e7ec6ef7313b93a86f | refs/heads/master | 2022-12-28T08:05:13.461240 | 2020-10-16T03:54:31 | 2020-10-16T03:54:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,864 | java | package com.leishb.leetcode.tree;
import org.junit.Test;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
/**
* Created by me on 2019/10/28.
*/
public class _1123_Lowest_Common_Ancestor_of_Deepest_Leaves {
public TreeNode lcaDeepestLeaves(TreeNode root) {
if (root==null) return null;
Queue<TreeNode> queue = new LinkedList<>();
queue.offer(root);
List<TreeNode> leaves = new ArrayList<>();
while (!queue.isEmpty()){
leaves = new ArrayList<>();
int size = queue.size();
while (size-->0){
TreeNode p = queue.poll();
leaves.add(p);
if (p.left!=null){
queue.offer(p.left);
}
if (p.right!=null){
queue.offer(p.right);
}
}
}
TreeNode prev = leaves.get(0);
TreeNode ans = prev;
for (int i=1;i<leaves.size();i++){
ans = lowestCommonAncestor(root, prev, leaves.get(i));
prev = ans;
}
return ans;
}
public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
if (root==null || root==p || root==q) return root;
TreeNode left = lowestCommonAncestor(root.left, p, q);
TreeNode right = lowestCommonAncestor(root.right, p, q);
if (left!=null && right!=null){
return root;
}
if (left!=null){
return left;
}
return right;
}
@Test
public void test(){
TreeNode root = new TreeNode(1);
root.left = new TreeNode(2);
root.right = new TreeNode(3);
root.left.left = new TreeNode(4);
root.left.right = new TreeNode(5);
lcaDeepestLeaves(root);
}
}
| [
"394898568@qq.com"
] | 394898568@qq.com |
d61252197f73579d65aa9473cc47fc0d5cedc5a8 | 265fcc7e04e784f4bb61c97d6695f6448cc9a06d | /app/src/main/java/com/ian/calatour/list/adapters/OffersAdapter.java | 7b7a24ca70853efe8f0099314e5ea143fd66b47b | [] | no_license | ian-chelaru/android_cala_tour | 8af0ebec079daa14c2e27b7a3a6f64fa91d265d2 | f4a5397ecebc3f30b065d58773a59eed3283da8a | refs/heads/master | 2020-09-13T07:21:59.149097 | 2019-12-09T12:13:14 | 2019-12-09T12:13:14 | 222,694,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,593 | java | package com.ian.calatour.list.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.ian.calatour.R;
import com.ian.calatour.model.Offer;
import java.util.List;
public class OffersAdapter extends ArrayAdapter<Offer>
{
public OffersAdapter(Context context, List<Offer> offers)
{
super(context, 0, offers);
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent)
{
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View myRow = (convertView == null) ? inflater.inflate(R.layout.offer_list_element, parent, false)
: convertView;
Offer offer = getItem(position);
TextView refOfferName = myRow.findViewById(R.id.offer_name);
refOfferName.setText(offer.getName());
ImageView refOfferImage = myRow.findViewById(R.id.offer_image);
refOfferImage.setImageResource(offer.getImage());
TextView refOfferPrice = myRow.findViewById(R.id.offer_price);
refOfferPrice.setText(offer.getPrice() + " " + offer.getCurrency());
TextView refOfferDescription = myRow.findViewById(R.id.offer_description);
refOfferDescription.setText(offer.getDescription());
return myRow;
}
}
| [
"ianchelaru@yahoo.com"
] | ianchelaru@yahoo.com |
b78c1210f11a3a786ec08eff3330b4cc9bdd1a0e | 7e5b6b8d7f5b6329e4a888aa7060e993ca243ebe | /app/src/main/java/es/intelygenz/rss/data/net/ConnectionManagerUtils.java | f939272f09ab111ae7697fe820a9de829af126b9 | [
"Apache-2.0"
] | permissive | Sca09/intelygenz_rss | e0068ae51ed50916515669d217e0d390c134d597 | 63add84688bc94bd865788cd8951c9df86f63779 | refs/heads/master | 2021-01-12T10:44:40.463282 | 2016-12-15T08:05:10 | 2016-12-15T08:05:10 | 72,665,198 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package es.intelygenz.rss.data.net;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
/**
* Created by davidtorralbo on 02/11/16.
*/
public class ConnectionManagerUtils {
public boolean isNetworkAvailable(Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
}
}
| [
"davidtorralbo@gmail.com"
] | davidtorralbo@gmail.com |
5bb3ef61d61259fa79829a2edce663013848d186 | bc869a8dc0d845614ca508ceafae085887d8b680 | /src/net/lump/irc/client/commands/CommandName.java | 26c3b65460f9739764b2413b5c4a6bb89f8d8425 | [] | no_license | lump/ircl | bcfdf1d67a725051d2fd8a620a9849f6db1919e5 | 8af1a878e98d995751257fd05c755d85a3784110 | refs/heads/master | 2021-01-18T17:17:59.891619 | 2011-04-28T20:56:13 | 2011-04-28T20:56:13 | 675,802 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,550 | java | package net.lump.irc.client.commands;
import static net.lump.irc.client.State.States;
import static net.lump.irc.client.State.States.*;
/**
* Valid IRC Command Names. These are used in both {@link Command} construction as well as server command parsing.
*
* @author M. Troy Bowman
*/
@SuppressWarnings({"UnusedDeclaration"})
public enum CommandName {
UNKNOWN(NONE),
PASS(CONNECTED),
NICK(CONNECTED),
USER(CONNECTED),
OPER(REGISTERED),
SERVICE(REGISTERED),
QUIT(CONNECTED),
SQUIT(REGISTERED),
JOIN(REGISTERED),
PART(JOINED),
MODE(REGISTERED),
TOPIC(REGISTERED),
NAMES(REGISTERED),
LIST(REGISTERED),
INVITE(JOINED),
KICK(JOINED),
PRIVMSG(JOINED),
NOTICE(REGISTERED),
MOTD(REGISTERED),
LUSERS(REGISTERED),
VERSION(REGISTERED),
STATS(REGISTERED),
LINKS(REGISTERED),
TIME(REGISTERED),
CONNECT(IRC_OPERATOR),
TRACE(REGISTERED),
ADMIN(CONNECTED),
INFO(REGISTERED),
SERVLIST(REGISTERED),
SQUERY(REGISTERED),
WHO(REGISTERED),
WHOIS(REGISTERED),
WHOWAS(REGISTERED),
KILL(IRC_OPERATOR),
PING(REGISTERED),
PONG(REGISTERED),
ERROR(REGISTERED),
AWAY(REGISTERED),
REHASH(IRC_OPERATOR),
DIE(IRC_OPERATOR),
RESTART(IRC_OPERATOR),
SUMMON(REGISTERED),
USERS(REGISTERED),
WALLOPS(REGISTERED),
USERHOST(REGISTERED),
ISON(REGISTERED);
private States requiredState;
private CommandName(States state) {
this.requiredState = state;
}
public States getRequiredState() {
return this.requiredState;
}
}
| [
"troy@lump.net"
] | troy@lump.net |
50011dd38fa3c70c8debaa50efac4d24aa20576a | 8f31f37928c6602ef12a356313135ac95fcfe378 | /ActivityExample/build/generated/source/buildConfig/debug/sdk/everysight/examples/activity/BuildConfig.java | 498735bc1692febfbf6d045423ef8cc898a43ac6 | [] | no_license | ygoddard/GlassesApp | d495b21eefacbaa313c08b46f3d576dd84148693 | 745c8eb631a10a4044708f8d0395a79a50cb06d1 | refs/heads/master | 2021-01-20T03:54:20.805663 | 2017-05-23T20:35:32 | 2017-05-23T20:35:36 | 89,604,517 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 471 | java | /**
* Automatically generated file. DO NOT MODIFY
*/
package sdk.everysight.examples.activity;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "sdk.everysight.examples.activity";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "1.0";
}
| [
"yuval.goddard@gmail.com"
] | yuval.goddard@gmail.com |
619013b454e1edc2ab3d182b74fe13336065b9e5 | 1d8fb9e9d59934ad3d151f6b4966a0d395130b2f | /app/src/main/java/com/example/islav/barcodereaderapp/model/Shop.java | 7abdf716189c21a9d3506dd237f4f12c7d23784d | [] | no_license | islavstan/BarCodeReaderApp | 7f1c1cc929b426ce8ec75ff0191502365c3d4b51 | ecbcef2d2703c8cd5dddfba9c18c174b19c153f6 | refs/heads/master | 2021-04-29T09:59:04.029798 | 2017-01-08T09:57:48 | 2017-01-08T09:57:48 | 77,851,383 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 470 | java | package com.example.islav.barcodereaderapp.model;
public class Shop {
String name;
int image;
public Shop(String name, int image) {
this.name = name;
this.image = image;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getImage() {
return image;
}
public void setImage(int image) {
this.image = image;
}
}
| [
"islavstan@gmail.com"
] | islavstan@gmail.com |
5f646ad2bc2585f33672e2c3db8002de49365bd8 | dc0dd00de3e4a7f5ed3fd6f74b31bf7a9b4ecd1d | /inspector.core/src/main/java/net/mjahn/inspector/core/NotFoundServiceCall.java | cf86087a37ca0178466de6b590f57b6cc3792fe1 | [
"Apache-2.0"
] | permissive | mirkojahn/OSGi-Inspector | bd4cbf583a24fd8f8c4957a62de6cfad84641f81 | 800fdb1373ec7694acc511d6c7678825e94eedce | refs/heads/master | 2016-09-06T03:28:52.730322 | 2011-11-28T21:38:54 | 2011-11-28T21:38:54 | 502,123 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,908 | java | package net.mjahn.inspector.core;
import org.osgi.framework.Bundle;
/**
*
* This interface denotes a not found OSGi service request. This is not a listening request for
* an appearing service, but an actual request to obtain a serviceReference that is tracked here.
* So every instance of this actually means something didn't work as expected or indicates a
* poorly written implementation of OSGi usage, which is always good to avoid.
*
* @author "Mirko Jahn" <mirkojahn@gmail.com>
* @version 1.0
*/
public interface NotFoundServiceCall {
/**
* The bundle performing the failed service request.
*
* @since 1.0
* @return the bundle instance of the failed service request.
*/
Bundle getBundle();
/**
* Obtain the Filter used to define the service in question, if specified by the caller.
*
* @since 1.0
* @return the filter used to obtain the service in question or null if not specified.
*/
String getServiceFilter();
/**
* The class name of the services to find or null to find all services.
*
* @since 1.0
* @return the name of the requested service, if specified by the caller.
*/
String getServiceName();
/**
* Did the caller try to obtain all services that match these specific criteria? If it did,
* this indicates, that the caller didn't care about compatibility of the class space and
* might anticipate that it wouldn't get any service matching at all, but this is just a
* lucky guess. It's still worth investigating, f.i. if this is done without the proper
* knowledge to what this call really means!
*
* @since 1.0
* @return true if all services were requested, if the once not compatible with this bundles
* class space.
*/
boolean isObtainAllServices();
/**
* Provides a JSON valid representation of this object.
* @since 1.0
* @return a valid JSON representation of this object.
*/
String toJSON();
} | [
"mirkojahn@gmail.com"
] | mirkojahn@gmail.com |
f05c04e0296ce5ffcc62424667bda077a59e93eb | dc2425e5e0af45d008ed483e8b3727345352977d | /app/src/main/java/com/olynyk/baking/RecipeContract.java | e7b99d49553282a5351c9c95b7f5145bbf6e5599 | [] | no_license | bolynyk/Baking | b5b894dba6ce4e7c5d509762b4641ca6c25ef660 | d8bdbdcf659f32ee06fc7f264d4f84e4e1a7e9d4 | refs/heads/master | 2020-04-19T08:55:12.251587 | 2019-02-10T19:46:48 | 2019-02-10T19:46:48 | 168,093,571 | 0 | 0 | null | 2019-02-10T19:41:46 | 2019-01-29T05:14:49 | Java | UTF-8 | Java | false | false | 423 | java | package com.olynyk.baking;
import android.content.Context;
import com.olynyk.baking.domain.Recipe;
import java.util.List;
public interface RecipeContract {
interface View {
Context getContext();
void showRecipes(List<Recipe> recipes);
void showRecipeDetailUi(Recipe recipe);
}
interface Presenter {
void loadRecipes();
void loadRecipeDetail(Recipe recipe);
}
}
| [
"blair.olynyk@gmail.com"
] | blair.olynyk@gmail.com |
5747413ad2e05a49c118dce83a32200ec4d68159 | f158e15bd464bc6a046275116001e157d5ddd0c3 | /app/src/main/java/com/devcivil/alarm_app/alarmserver/auth/CredentialsHolder.java | 54d355992977b505e1aa3861c032dc5b29ecfe1b | [
"Apache-2.0"
] | permissive | Kamil-IT/alarm-app | 55dda12375c1d07a87c5b848855d374a85ae9c77 | a1acac26eb28d769b6a246a3f8ae6a00179017cb | refs/heads/master | 2022-12-29T11:40:21.743921 | 2020-10-17T22:55:27 | 2020-10-17T22:55:27 | 283,222,438 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,278 | java | package com.devcivil.alarm_app.alarmserver.auth;
import android.content.Context;
import android.content.SharedPreferences;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.annotation.Nullable;
import androidx.preference.PreferenceManager;
import static com.devcivil.alarm_app.alarmserver.ConnectionToAlarmServer.BASE_SERVER_URL;
import static com.devcivil.alarm_app.alarmserver.ConnectionToAlarmServer.TOKEN_PATH;
import static com.devcivil.alarm_app.alarmserver.ConnectionToAlarmServer.getBasicHeaders;
public class CredentialsHolder {
private static final CredentialsHolder INSTANCE = new CredentialsHolder();
public static final String IS_CONNECT_CODE = "is_connect_successful";
private List<CredentialsChangedListener> credentialsChangedListeners = new ArrayList<>();
public static final String CREDENTIALS_DB = "credentials_db";
public static final String USERNAME_CODE = "username";
public static final String PASSWORD_CODE = "password";
private Context context;
private Credentials credentials;
private CredentialsHolder() {
credentials = new Credentials();
}
public static CredentialsHolder getInstance() {
return INSTANCE;
}
/**
* This method have to be triggered to get username and password
* @param context whit credentials db
*/
public void setShearPreferences(Context context){
this.context = context;
try {
getCredentials();
}
catch (Exception ignored){
}
}
public Credentials getCredentials() {
if (context != null){
SharedPreferences sharedPreferences = context.getSharedPreferences(CREDENTIALS_DB, Context.MODE_PRIVATE);
if (sharedPreferences != null) {
String username = sharedPreferences.getString(USERNAME_CODE, null);
String password = sharedPreferences.getString(PASSWORD_CODE, null);
if (password == null || username == null){
throw new IllegalArgumentException("Password or username not specified");
}
this.credentials.setUsername(username);
this.credentials.setPassword(password);
}
}
return credentials;
}
public void setCredentials(String username, String password, Context context) {
SharedPreferences sharedPreferences = context.getSharedPreferences(CREDENTIALS_DB, Context.MODE_PRIVATE);
if (sharedPreferences != null) {
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(USERNAME_CODE, username);
editor.putString(PASSWORD_CODE, password);
editor.apply();
}
credentials.setUsername(username);
credentials.setPassword(password);
checkIsCredentialsCorrect();
}
public void setCredentials(Credentials credentials, Context context){
setCredentials(credentials.getUsername(), credentials.getPassword(), context);
}
private void checkIsCredentialsCorrect() {
RequestQueue requestQueue = Volley.newRequestQueue(context);
JSONObject jsonToSend = null;
try {
jsonToSend = new JSONObject(CredentialsHolder.getInstance().getJsonUsernamePassword());
} catch (JSONException e) {
e.printStackTrace();
}
JsonObjectRequest objectRequest = new JsonObjectRequest(
Request.Method.POST,
BASE_SERVER_URL + TOKEN_PATH,
jsonToSend,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Toast.makeText(context, "Log on successful", Toast.LENGTH_SHORT).show();
PreferenceManager
.getDefaultSharedPreferences(context)
.edit()
.putBoolean(IS_CONNECT_CODE, true)
.apply();
credentialChanged(context);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(context, "Log on failed", Toast.LENGTH_SHORT).show();
PreferenceManager
.getDefaultSharedPreferences(context)
.edit()
.putBoolean(IS_CONNECT_CODE, false)
.apply();
credentialChanged(context);
}
}
) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
return getBasicHeaders();
}
};
requestQueue.add(objectRequest);
}
@Nullable
public String getUsername(){
return credentials.getUsername();
}
@Nullable
public String getPassword(){
return credentials.getPassword();
}
public String getJsonUsernamePassword(){
return credentials.getJsonUsernamePassword();
}
public boolean isCredentialsGiven(){
return getUsername() != null && getPassword() != null;
}
private void credentialChanged(Context context){
for (CredentialsChangedListener listener :
credentialsChangedListeners) {
listener.OnCredentialChanged(context);
}
}
public void addCredentialsChangedListener(CredentialsChangedListener listener){
credentialsChangedListeners.add(listener);
}
public interface CredentialsChangedListener{
void OnCredentialChanged(Context context);
}
}
| [
"kkwolny@vp.pl"
] | kkwolny@vp.pl |
bfe1ac3bf10ce83eb36d48d9f20e6afe2ec12ad2 | 77e7c7d0103cfcb32c9576655557a911bcc77f0f | /app/build/generated/source/apt/debug/com/anang/gapuramovie/Fragment/SettingFragment_ViewBinding.java | 7e943bde12028333e379bcf512e1fb078d396ba0 | [] | no_license | anangmukeling/gapuramovies | c5204063c75c5fdaea02d484291efa349497c19a | a2fc5cf2031f5fbe0b3f5a61a2b6b23548ec99f1 | refs/heads/master | 2020-04-03T12:54:59.076332 | 2018-10-29T20:43:29 | 2018-10-29T20:43:29 | 155,268,363 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,230 | java | // Generated code from Butter Knife. Do not modify!
package com.anang.gapuramovie.Fragment;
import android.content.Context;
import android.content.res.Resources;
import android.support.annotation.CallSuper;
import android.support.annotation.UiThread;
import android.view.View;
import butterknife.Unbinder;
import com.anang.gapuramovie.R;
import java.lang.Deprecated;
import java.lang.Override;
public class SettingFragment_ViewBinding implements Unbinder {
/**
* @deprecated Use {@link #SettingFragment_ViewBinding(SettingFragment, Context)} for direct creation.
* Only present for runtime invocation through {@code ButterKnife.bind()}.
*/
@Deprecated
@UiThread
public SettingFragment_ViewBinding(SettingFragment target, View source) {
this(target, source.getContext());
}
@UiThread
public SettingFragment_ViewBinding(SettingFragment target, Context context) {
Resources res = context.getResources();
target.keyDailyReminder = res.getString(R.string.key_daily_reminder);
target.keyReleaseReminder = res.getString(R.string.key_release_reminder);
target.keySettingLanguage = res.getString(R.string.key_setting_language);
}
@Override
@CallSuper
public void unbind() {
}
}
| [
"anangmukeling@gmail.com"
] | anangmukeling@gmail.com |
1bad725593404fc4fb480aa72aa9980ed473d1cb | 451cd429c4c597bc5668b070b1c2a3cfa8262e5a | /src/verifyurl.java | 195fa0141060279107d14e99a1a201835cd1fe60 | [] | no_license | dasindranil/Demo | e6ce0eda666bbb68fe8773c332af01dbabbd2070 | da40d7a2159c5f63375d51552ab590f3da237e0d | refs/heads/master | 2021-01-14T18:37:59.378760 | 2019-06-19T14:35:55 | 2019-06-19T14:35:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 461 | java | import org.openqa.selenium.firefox.FirefoxDriver;
public class verifyurl {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.gecko.driver","geckodriver.exe");
FirefoxDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("http://www.facebook.com");
String x = driver.getCurrentUrl();
System.out.println(x);
}
}
| [
"edurekadevops@gmail.com"
] | edurekadevops@gmail.com |
9ece9f38582f830a521cc6aa67e829d73008adc2 | 7d156f3b8eddff28716807aa9a13ca6e4cf59614 | /app/src/test/java/com/smile/kotlinalbum/ExampleUnitTest.java | d9c15350cc86ce4ef20364e8c8ef3faa179e8514 | [] | no_license | EasyToForget/KotlinAlbum | 5dbc717ee29b2a47f11878a5fb963f7297691541 | 85500bf627c5b350c0f44a26a3f990557d6c8d07 | refs/heads/master | 2020-12-03T03:40:35.154288 | 2017-06-29T09:14:26 | 2017-06-29T09:14:26 | 95,760,247 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 399 | java | package com.smile.kotlinalbum;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"zhiye.wei@gmail.com"
] | zhiye.wei@gmail.com |
d2dd6a81a91b6b4a0659a7b0464566f560728b0d | 47bc2a01f4273e9b90a2878fbf4f9f866b07e1ba | /test/TestModel.java | 80f257ec7b08d15aab63961140e3031ad4c9e74c | [] | no_license | Lwallace3/FolioTracker | 067bf071b7d256d3d964db86fe166b94b6d5ec99 | 870edecbf0000e4c9b43ddc345a0427a82b13b5b | refs/heads/master | 2022-04-14T10:20:45.730659 | 2020-04-16T16:05:02 | 2020-04-16T16:05:02 | 256,259,718 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,490 | java | import org.junit.Test;
import org.junit.jupiter.params.provider.EnumSource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import static org.junit.Assert.*;
public class TestModel {
@Test
public void testModelWrite() throws WebsiteDataException, NoSuchTickerException {
Folio f = new Folio("test", "bob");
Stock a = new Stock("adam", "tex", 20);
Stock b = new Stock("aidan", "x", 10);
Stock c = new Stock("bob", "tsl", 30);
Stock d = new Stock("steven", "ezj", 40);
ArrayList<Folio> testList = new ArrayList<>();
testList.add(f);
Model.writeToFile(testList);
}
@Test
public void testModelRead() throws WebsiteDataException, NoSuchTickerException, IOException, ClassNotFoundException {
Folio f = new Folio("test", "bob");
Stock a = new Stock("adam", "tex", 20);
Stock b = new Stock("aidan", "x", 10);
Stock c = new Stock("bob", "tsl", 30);
Stock d = new Stock("steven", "ezj", 40);
ArrayList<Folio> testList = new ArrayList<>();
testList.add(f);
Model.writeToFile(testList);
testList.clear();
HashMap<String, ArrayList<Folio>> testMap = new HashMap<>();
testMap = Model.readFromFile();
testList.add(testMap.get("bob").get(0));
assertEquals("test",testList.get(0).getName());
}
}
| [
"noreply@github.com"
] | noreply@github.com |
9f1972b5f25a6c13bc3656f82adb3019897d1b4e | 222e69ee113f1608d2cd3faea665bc6e233f6dc5 | /src/main/java/gpss/FormatDelimited.java | 3ca90c6c6109fae460b08bbe15b6be4c4e4caecd | [] | no_license | DanielePalaia/gpss-console | 6ff6d9b70f7ee0883bdcc70996f9b357fdb5f736 | 45ed91bbb9dfbb4dd3a3ca726297333b17abc0f0 | refs/heads/master | 2023-04-08T12:08:17.510611 | 2020-08-16T08:13:56 | 2020-08-16T08:13:56 | 281,989,759 | 0 | 0 | null | 2021-04-26T20:32:11 | 2020-07-23T15:32:08 | Java | UTF-8 | Java | false | true | 31,206 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: gpssjob.proto
package gpss;
/**
* Protobuf type {@code gpss.FormatDelimited}
*/
public final class FormatDelimited extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:gpss.FormatDelimited)
FormatDelimitedOrBuilder {
private static final long serialVersionUID = 0L;
// Use FormatDelimited.newBuilder() to construct.
private FormatDelimited(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private FormatDelimited() {
columns_ = java.util.Collections.emptyList();
delimiter_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new FormatDelimited();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private FormatDelimited(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
columns_ = new java.util.ArrayList<gpss.IntermediateColumn>();
mutable_bitField0_ |= 0x00000001;
}
columns_.add(
input.readMessage(gpss.IntermediateColumn.parser(), extensionRegistry));
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
delimiter_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
columns_ = java.util.Collections.unmodifiableList(columns_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gpss.Gpssjob.internal_static_gpss_FormatDelimited_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return gpss.Gpssjob.internal_static_gpss_FormatDelimited_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gpss.FormatDelimited.class, gpss.FormatDelimited.Builder.class);
}
public static final int COLUMNS_FIELD_NUMBER = 1;
private java.util.List<gpss.IntermediateColumn> columns_;
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
@java.lang.Override
public java.util.List<gpss.IntermediateColumn> getColumnsList() {
return columns_;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
@java.lang.Override
public java.util.List<? extends gpss.IntermediateColumnOrBuilder>
getColumnsOrBuilderList() {
return columns_;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
@java.lang.Override
public int getColumnsCount() {
return columns_.size();
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
@java.lang.Override
public gpss.IntermediateColumn getColumns(int index) {
return columns_.get(index);
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
@java.lang.Override
public gpss.IntermediateColumnOrBuilder getColumnsOrBuilder(
int index) {
return columns_.get(index);
}
public static final int DELIMITER_FIELD_NUMBER = 2;
private volatile java.lang.Object delimiter_;
/**
* <code>string delimiter = 2;</code>
* @return The delimiter.
*/
@java.lang.Override
public java.lang.String getDelimiter() {
java.lang.Object ref = delimiter_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
delimiter_ = s;
return s;
}
}
/**
* <code>string delimiter = 2;</code>
* @return The bytes for delimiter.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDelimiterBytes() {
java.lang.Object ref = delimiter_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
delimiter_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < columns_.size(); i++) {
output.writeMessage(1, columns_.get(i));
}
if (!getDelimiterBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, delimiter_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < columns_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, columns_.get(i));
}
if (!getDelimiterBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, delimiter_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof gpss.FormatDelimited)) {
return super.equals(obj);
}
gpss.FormatDelimited other = (gpss.FormatDelimited) obj;
if (!getColumnsList()
.equals(other.getColumnsList())) return false;
if (!getDelimiter()
.equals(other.getDelimiter())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getColumnsCount() > 0) {
hash = (37 * hash) + COLUMNS_FIELD_NUMBER;
hash = (53 * hash) + getColumnsList().hashCode();
}
hash = (37 * hash) + DELIMITER_FIELD_NUMBER;
hash = (53 * hash) + getDelimiter().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static gpss.FormatDelimited parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gpss.FormatDelimited parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gpss.FormatDelimited parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gpss.FormatDelimited parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gpss.FormatDelimited parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gpss.FormatDelimited parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gpss.FormatDelimited parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static gpss.FormatDelimited parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static gpss.FormatDelimited parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static gpss.FormatDelimited parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static gpss.FormatDelimited parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static gpss.FormatDelimited parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(gpss.FormatDelimited prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code gpss.FormatDelimited}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:gpss.FormatDelimited)
gpss.FormatDelimitedOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gpss.Gpssjob.internal_static_gpss_FormatDelimited_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return gpss.Gpssjob.internal_static_gpss_FormatDelimited_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gpss.FormatDelimited.class, gpss.FormatDelimited.Builder.class);
}
// Construct using gpss.FormatDelimited.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getColumnsFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (columnsBuilder_ == null) {
columns_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
columnsBuilder_.clear();
}
delimiter_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return gpss.Gpssjob.internal_static_gpss_FormatDelimited_descriptor;
}
@java.lang.Override
public gpss.FormatDelimited getDefaultInstanceForType() {
return gpss.FormatDelimited.getDefaultInstance();
}
@java.lang.Override
public gpss.FormatDelimited build() {
gpss.FormatDelimited result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public gpss.FormatDelimited buildPartial() {
gpss.FormatDelimited result = new gpss.FormatDelimited(this);
int from_bitField0_ = bitField0_;
if (columnsBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
columns_ = java.util.Collections.unmodifiableList(columns_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.columns_ = columns_;
} else {
result.columns_ = columnsBuilder_.build();
}
result.delimiter_ = delimiter_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof gpss.FormatDelimited) {
return mergeFrom((gpss.FormatDelimited)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(gpss.FormatDelimited other) {
if (other == gpss.FormatDelimited.getDefaultInstance()) return this;
if (columnsBuilder_ == null) {
if (!other.columns_.isEmpty()) {
if (columns_.isEmpty()) {
columns_ = other.columns_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureColumnsIsMutable();
columns_.addAll(other.columns_);
}
onChanged();
}
} else {
if (!other.columns_.isEmpty()) {
if (columnsBuilder_.isEmpty()) {
columnsBuilder_.dispose();
columnsBuilder_ = null;
columns_ = other.columns_;
bitField0_ = (bitField0_ & ~0x00000001);
columnsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getColumnsFieldBuilder() : null;
} else {
columnsBuilder_.addAllMessages(other.columns_);
}
}
}
if (!other.getDelimiter().isEmpty()) {
delimiter_ = other.delimiter_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
gpss.FormatDelimited parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (gpss.FormatDelimited) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List<gpss.IntermediateColumn> columns_ =
java.util.Collections.emptyList();
private void ensureColumnsIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
columns_ = new java.util.ArrayList<gpss.IntermediateColumn>(columns_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
gpss.IntermediateColumn, gpss.IntermediateColumn.Builder, gpss.IntermediateColumnOrBuilder> columnsBuilder_;
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public java.util.List<gpss.IntermediateColumn> getColumnsList() {
if (columnsBuilder_ == null) {
return java.util.Collections.unmodifiableList(columns_);
} else {
return columnsBuilder_.getMessageList();
}
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public int getColumnsCount() {
if (columnsBuilder_ == null) {
return columns_.size();
} else {
return columnsBuilder_.getCount();
}
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public gpss.IntermediateColumn getColumns(int index) {
if (columnsBuilder_ == null) {
return columns_.get(index);
} else {
return columnsBuilder_.getMessage(index);
}
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public Builder setColumns(
int index, gpss.IntermediateColumn value) {
if (columnsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureColumnsIsMutable();
columns_.set(index, value);
onChanged();
} else {
columnsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public Builder setColumns(
int index, gpss.IntermediateColumn.Builder builderForValue) {
if (columnsBuilder_ == null) {
ensureColumnsIsMutable();
columns_.set(index, builderForValue.build());
onChanged();
} else {
columnsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public Builder addColumns(gpss.IntermediateColumn value) {
if (columnsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureColumnsIsMutable();
columns_.add(value);
onChanged();
} else {
columnsBuilder_.addMessage(value);
}
return this;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public Builder addColumns(
int index, gpss.IntermediateColumn value) {
if (columnsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureColumnsIsMutable();
columns_.add(index, value);
onChanged();
} else {
columnsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public Builder addColumns(
gpss.IntermediateColumn.Builder builderForValue) {
if (columnsBuilder_ == null) {
ensureColumnsIsMutable();
columns_.add(builderForValue.build());
onChanged();
} else {
columnsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public Builder addColumns(
int index, gpss.IntermediateColumn.Builder builderForValue) {
if (columnsBuilder_ == null) {
ensureColumnsIsMutable();
columns_.add(index, builderForValue.build());
onChanged();
} else {
columnsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public Builder addAllColumns(
java.lang.Iterable<? extends gpss.IntermediateColumn> values) {
if (columnsBuilder_ == null) {
ensureColumnsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, columns_);
onChanged();
} else {
columnsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public Builder clearColumns() {
if (columnsBuilder_ == null) {
columns_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
columnsBuilder_.clear();
}
return this;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public Builder removeColumns(int index) {
if (columnsBuilder_ == null) {
ensureColumnsIsMutable();
columns_.remove(index);
onChanged();
} else {
columnsBuilder_.remove(index);
}
return this;
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public gpss.IntermediateColumn.Builder getColumnsBuilder(
int index) {
return getColumnsFieldBuilder().getBuilder(index);
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public gpss.IntermediateColumnOrBuilder getColumnsOrBuilder(
int index) {
if (columnsBuilder_ == null) {
return columns_.get(index); } else {
return columnsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public java.util.List<? extends gpss.IntermediateColumnOrBuilder>
getColumnsOrBuilderList() {
if (columnsBuilder_ != null) {
return columnsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(columns_);
}
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public gpss.IntermediateColumn.Builder addColumnsBuilder() {
return getColumnsFieldBuilder().addBuilder(
gpss.IntermediateColumn.getDefaultInstance());
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public gpss.IntermediateColumn.Builder addColumnsBuilder(
int index) {
return getColumnsFieldBuilder().addBuilder(
index, gpss.IntermediateColumn.getDefaultInstance());
}
/**
* <pre>
* the source columns name , may be used in Expression/Mapping node.
* </pre>
*
* <code>repeated .gpss.IntermediateColumn columns = 1;</code>
*/
public java.util.List<gpss.IntermediateColumn.Builder>
getColumnsBuilderList() {
return getColumnsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
gpss.IntermediateColumn, gpss.IntermediateColumn.Builder, gpss.IntermediateColumnOrBuilder>
getColumnsFieldBuilder() {
if (columnsBuilder_ == null) {
columnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
gpss.IntermediateColumn, gpss.IntermediateColumn.Builder, gpss.IntermediateColumnOrBuilder>(
columns_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
columns_ = null;
}
return columnsBuilder_;
}
private java.lang.Object delimiter_ = "";
/**
* <code>string delimiter = 2;</code>
* @return The delimiter.
*/
public java.lang.String getDelimiter() {
java.lang.Object ref = delimiter_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
delimiter_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string delimiter = 2;</code>
* @return The bytes for delimiter.
*/
public com.google.protobuf.ByteString
getDelimiterBytes() {
java.lang.Object ref = delimiter_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
delimiter_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string delimiter = 2;</code>
* @param value The delimiter to set.
* @return This builder for chaining.
*/
public Builder setDelimiter(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
delimiter_ = value;
onChanged();
return this;
}
/**
* <code>string delimiter = 2;</code>
* @return This builder for chaining.
*/
public Builder clearDelimiter() {
delimiter_ = getDefaultInstance().getDelimiter();
onChanged();
return this;
}
/**
* <code>string delimiter = 2;</code>
* @param value The bytes for delimiter to set.
* @return This builder for chaining.
*/
public Builder setDelimiterBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
delimiter_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:gpss.FormatDelimited)
}
// @@protoc_insertion_point(class_scope:gpss.FormatDelimited)
private static final gpss.FormatDelimited DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new gpss.FormatDelimited();
}
public static gpss.FormatDelimited getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<FormatDelimited>
PARSER = new com.google.protobuf.AbstractParser<FormatDelimited>() {
@java.lang.Override
public FormatDelimited parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new FormatDelimited(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<FormatDelimited> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<FormatDelimited> getParserForType() {
return PARSER;
}
@java.lang.Override
public gpss.FormatDelimited getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| [
"dpalaia@pivotal.io"
] | dpalaia@pivotal.io |
624cfabb1ab7f355421b924790bb4976bec78b81 | 97f9af0fd23db1e41e7832e953de2e6309d22dae | /mylibrary/src/test/java/cn/com/vicent/mylibrary/ExampleUnitTest.java | 91708e3f2770cb3ddde78742bb803c83b465c826 | [
"Apache-2.0"
] | permissive | shaoxiangyong/MyMap | fefbecc46eca2fd08a7e9fefd7483d9a94b9b0f4 | c2172cffcbd97edb2356e7d422a280707c2bf876 | refs/heads/master | 2021-09-01T10:20:00.207297 | 2017-12-12T09:59:27 | 2017-12-12T09:59:27 | 115,419,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 401 | java | package cn.com.vicent.mylibrary;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"897354839@qq.com"
] | 897354839@qq.com |
72792626608a03cb6fca1a4793807911b6157d96 | 3300970b588273e2a53a9111d5c19f753d271cdd | /src/main/java/com/idp/common/base/BaseController.java | a9be08829e867c5a63527c4abfda19556fd21849 | [
"Apache-2.0"
] | permissive | GodPoseidon/jeeidp | 0d05e3ed914e9bc5782cbf66d980e1790f01cff3 | 456992c1e513382629ca0f32c87c84740880f065 | refs/heads/master | 2022-12-21T04:48:10.757242 | 2019-10-15T03:40:49 | 2019-10-15T03:40:49 | 215,197,510 | 0 | 0 | Apache-2.0 | 2022-12-16T09:44:39 | 2019-10-15T03:25:40 | CSS | UTF-8 | Java | false | false | 1,554 | java | package com.idp.common.base;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import com.idp.common.constant.SessionAttr;
import com.idp.common.interceptor.DateConvertEditor;
import com.idp.common.util.ContextHolderUtil;
import com.idp.web.system.entity.SysUser;
/**
* 基础controller
*
* @author King
*
*/
public class BaseController {
/**
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
*
* @param binder
*/
@InitBinder
public void initBinder(ServletRequestDataBinder binder) {
binder.registerCustomEditor(Date.class, new DateConvertEditor());
}
/**
* 抽取由逗号分隔的主键列表
*
* @param ids
* @return
*/
protected List<String> extractIdListByComma(String ids) {
List<String> result = new ArrayList<String>();
if (StringUtils.hasText(ids)) {
for (String id : ids.split(",")) {
if (StringUtils.hasLength(id)) {
result.add(id.trim());
}
}
}
return result;
}
/**
* 获取登录的当前用户信息
*
* @return
*/
public SysUser getCurrentUser(){
HttpSession session = ContextHolderUtil.getSession();
SysUser user = (SysUser)session.getAttribute(SessionAttr.USER_LOGIN.getValue());
return user;
}
}
| [
"zhuzhen@olymtech.com"
] | zhuzhen@olymtech.com |
ec5454ab9608c2892365f9e5fe96832477dcdb82 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_5e470424e4b20904619b55f19f439de6a2bdf523/GeneratorMojoTest/3_5e470424e4b20904619b55f19f439de6a2bdf523_GeneratorMojoTest_t.java | 6a490ce906658bace44852e90b90760cba8b944e | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,511 | java | /*
* Copyright 2013 The Sculptor Project Team, including the original
* author or authors.
*
* 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 org.sculptor.maven.plugin;
import static org.mockito.Matchers.anySet;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.spy;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import junit.framework.AssertionFailedError;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
public class GeneratorMojoTest extends AbstractGeneratorMojoTestCase<GeneratorMojo> {
private static final String ONE_SHOT_GENERATED_FILE = "src/main/java/com/acme/test/domain/Foo.java";
private static final String GENERATED_FILE = "src/generated/java/com/acme/test/domain/Bar.java";
public void testChangedFilesNoStatusFile() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test1"));
Set<String> changedFiles = mojo.getChangedFiles();
assertNull(changedFiles);
}
public void testChangedFilesNoUpdatedFiles() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test2"));
mojo.getStatusFile().setLastModified(System.currentTimeMillis() + 1000);
Set<String> changedFiles = mojo.getChangedFiles();
assertNotNull(changedFiles);
assertEquals(0, changedFiles.size());
}
public void testChangedFilesOutdatedStatusFile() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test2"));
mojo.getStatusFile().setLastModified(0);
Set<String> changedFiles = mojo.getChangedFiles();
assertNotNull(changedFiles);
assertEquals(5, changedFiles.size());
}
public void testChangedFilesUpdatedWorkflowDescriptor() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test2"));
mojo.getStatusFile().setLastModified(System.currentTimeMillis() + 1000);
mojo.getModelFile().setLastModified(System.currentTimeMillis() + 2000);
Set<String> changedFiles = mojo.getChangedFiles();
assertNotNull(changedFiles);
assertEquals(1, changedFiles.size());
}
public void testChangedFilesUpdatedGeneratorConfigFiles() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test2"));
mojo.getStatusFile().setLastModified(System.currentTimeMillis() + 1000);
new File(mojo.getProject().getBasedir(),
"/src/main/resources/generator/java-code-formatter.properties")
.setLastModified(System.currentTimeMillis() + 2000);
new File(mojo.getProject().getBasedir(),
"/src/main/resources/generator/sculptor-generator.properties")
.setLastModified(System.currentTimeMillis() + 2000);
Set<String> changedFiles = mojo.getChangedFiles();
assertNotNull(changedFiles);
assertEquals(2, changedFiles.size());
}
public void testUpdateStatusFile() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test2"));
List<File> files = new ArrayList<File>();
files.add(new File(mojo.getProject().getBasedir(),
ONE_SHOT_GENERATED_FILE));
files.add(new File(mojo.getProject().getBasedir(), GENERATED_FILE));
assertTrue(mojo.updateStatusFile(files));
Properties statusFileProps = new Properties();
statusFileProps.load(new FileReader(mojo.getStatusFile()));
assertEquals(2, statusFileProps.size());
assertEquals("e747f800870423a6c554ae2ec80aeeb6",
statusFileProps.getProperty(ONE_SHOT_GENERATED_FILE));
assertEquals("7d436134142a2e69dfc98eb9f22f5907",
statusFileProps.getProperty(GENERATED_FILE));
}
@SuppressWarnings("unchecked")
public void testExecuteSkip() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test1"));
doThrow(AssertionFailedError.class).when(mojo).executeGenerator();
setVariableValueToObject(mojo, "skip", true);
mojo.execute();
}
public void testExecuteForce() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test2"));
doThrow(new RuntimeException("testExecuteForce")).when(mojo).doRunGenerator();
setVariableValueToObject(mojo, "force", true);
try {
mojo.execute();
} catch (MojoExecutionException e) {
return;
}
fail();
}
public void testExecuteWithClean() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test2"));
doThrow(new RuntimeException("testExecuteWithClean")).when(mojo).doRunGenerator();
mojo.getStatusFile().setLastModified(System.currentTimeMillis() + 1000);
mojo.getModelFile().setLastModified(System.currentTimeMillis() + 2000);
setVariableValueToObject(mojo, "clean", true);
try {
mojo.execute();
} catch (MojoExecutionException e) {
assertFalse(new File(mojo.getProject().getBasedir(),
ONE_SHOT_GENERATED_FILE).exists());
assertFalse(new File(mojo.getProject().getBasedir(), GENERATED_FILE)
.exists());
return;
}
fail();
}
public void testExecuteWithoutClean() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test2"));
doThrow(new RuntimeException("testExecuteWithoutClean")).when(mojo).doRunGenerator();
mojo.getStatusFile().setLastModified(System.currentTimeMillis() + 1000);
mojo.getModelFile().setLastModified(System.currentTimeMillis() + 2000);
setVariableValueToObject(mojo, "clean", false);
try {
mojo.execute();
} catch (MojoExecutionException e) {
assertTrue(new File(mojo.getProject().getBasedir(),
ONE_SHOT_GENERATED_FILE).exists());
assertTrue(new File(mojo.getProject().getBasedir(), GENERATED_FILE)
.exists());
return;
}
fail();
}
public void testExecuteWithProperties() throws Exception {
GeneratorMojo mojo = createMojo(createProject("test2"));
Map<String, String> properties = new HashMap<String, String>();
properties.put("testExecuteWithProperties", "testExecuteWithProperties-value");
setVariableValueToObject(mojo, "properties", properties);
setVariableValueToObject(mojo, "force", true);
mojo.execute();
assertEquals("testExecuteWithProperties-value", System.getProperty("testExecuteWithProperties"));
}
/**
* Returns Mojo instance initialized with a {@link MavenProject} created
* from the test projects in <code>"src/test/projects/"</code> by given
* project name.
*/
protected GeneratorMojo createMojo(MavenProject project) throws Exception {
// Create mojo
GeneratorMojo mojo = spy(super.createMojo(project, "generate"));
doReturn(Boolean.TRUE).when(mojo).doRunGenerator();
// Set default values on mojo
setVariableValueToObject(mojo, "model", "src/main/resources/model.btdesign");
setVariableValueToObject(mojo, "clean", true);
// Set defaults for multi-value parameters in mojo
mojo.initMojoMultiValueParameters();
return mojo;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
50ba77bbf6bae07d5fe39086e7abcd227a61e1c0 | 5a5f5124f8a8862259a229196bdf0f710827fd4d | /src/main/java/com/trello/api/models/TrelloList.java | 144556533e5f43f440fd9d6f773bdc733d76aba5 | [] | no_license | AlexLAA/school.com.trello | 645b4ef60dafc437e1c1be52775e31a33d10aa73 | 482ee28c102fcea2261c6e4a9323c7ccc718fbf8 | refs/heads/master | 2023-05-12T02:27:00.922748 | 2019-07-04T16:35:18 | 2019-07-04T16:35:18 | 192,882,001 | 0 | 3 | null | 2023-05-09T18:08:13 | 2019-06-20T08:35:38 | Java | UTF-8 | Java | false | false | 204 | java | package com.trello.api.models;
/**
* Created by lolik on 11.06.2019
*/
public class TrelloList {
public String id;
public String name;
public Boolean closed;
public String idBoard;
}
| [
"lakovych.oleksii@pdffiller.team"
] | lakovych.oleksii@pdffiller.team |
b0363bdf3321a6f73b1370259924cbd5d662ebfb | 2c6492027be3abc08a2378a6008e14e0db1f9cb1 | /src/main/java/tt/model/business/File.java | 38ef55c2a523a5641f4ce0c351a479ea6a749128 | [
"MIT"
] | permissive | luopotaotao/staticLoad | d7b088f7080a8c0ce6a6615799c605aedd4900f8 | 8942cf2276775152f3cc865dda8393e365d4982e | refs/heads/master | 2022-12-21T00:12:03.881689 | 2020-08-16T06:54:04 | 2020-08-16T06:54:04 | 69,000,576 | 0 | 0 | MIT | 2022-12-16T09:45:36 | 2016-09-23T07:27:24 | JavaScript | UTF-8 | Java | false | false | 952 | java | package tt.model.business;
import javax.persistence.*;
import java.util.UUID;
/**
* Created by tt on 2016/11/28.
*/
@Entity
@Table(name="b_file")
public class File {
private String uuid;
private String name;
private Integer dept_id;
public File() {
}
public File(String uuid, String name, Integer dept_id) {
this.uuid = uuid;
this.name = name;
this.dept_id = dept_id;
}
@Id
@Column(name = "uuid")
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
@Basic
@Column(name = "name")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Basic
@Column(name = "dept_id")
public Integer getDept_id() {
return dept_id;
}
public void setDept_id(Integer dept_id) {
this.dept_id = dept_id;
}
}
| [
"69443245@qq.com"
] | 69443245@qq.com |
29a80e22a6a66328399da03983a59410b09ca2ee | 7e8a990e8dafa4fb5fdf5f2431161664a9f5210a | /src/main/java/com/sqa/pfs/helpers/DataHelper.java | 6375a7834a30b85a3728a54c3f7a47a452b8125c | [] | no_license | prifsilvestrin/ebay-project | 87eba9b2196d64524618392ffcd3e04c21f08ee0 | f80cf3db0611c8335944cfffc84d7e90e25523ca | refs/heads/master | 2020-12-02T11:20:54.843826 | 2017-07-08T16:26:34 | 2017-07-08T16:26:34 | 96,630,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,748 | java | package com.sqa.pfs.helpers;
import java.io.*;
import java.sql.*;
import java.util.*;
import java.util.regex.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.*;
import com.sqa.pfs.helpers.enums.*;
import com.sqa.pfs.helpers.exceptions.*;
/**
* DataHelper Class to handle reading data from different sources.
*
* @author Nepton, Jean-francois
* @version 1.0.0
* @since 1.0
*/
public class DataHelper {
public static void clearArray(Object[][] array) {
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array[i].length; j++) {
array[i][j] = " . ";
}
}
}
/**
* Method to return a String representation of data
*
* @param data
* @return
*/
public static String displayData(Object[][] data) {
StringBuilder sb = new StringBuilder();
// TODO Create two loops, one within another to add
// all items to sb.
// sb.append(data[i][0]);
for (int i = 0; i < data.length; i++) {
for (int j = 0; j < data[i].length; j++) {
sb.append(data[i][j] + "\t");
}
sb.append("\n");
}
return sb.toString();
}
/**
* Method to read a database table and get data from it
*
* @param driverClassString
* @param databaseStringUrl
* @param username
* @param password
* @param tableName
* @return
* @throws ClassNotFoundException
* @throws SQLException
* @throws DataTypesMismatchException
* @throws DataTypesCountException
* @throws DataTypesTypeException
*/
public static Object[][] evalDatabaseTable(String driverClassString, String databaseStringUrl, String username,
String password, String tableName) throws ClassNotFoundException, SQLException, DataTypesMismatchException,
DataTypesCountException, DataTypesTypeException {
// Method calls overloaded method which sets no
// offset for col or row in
// the case you wanted to offset your data retrieved
// based on a column
// or row offset
return evalDatabaseTable(driverClassString, databaseStringUrl, username, password, tableName, 0, 0, null);
}
/**
* Method to read database table with implementation for a row and column
* offset.
*
* @param driverClassString
* @param databaseStringUrl
* @param username
* @param password
* @param tableName
* @param rowOffset
* @param colOffset
* @param dataTypes
* @return
* @throws DataTypesMismatchException
* @throws ClassNotFoundException
* @throws SQLException
* @throws DataTypesCountException
* @throws DataTypesTypeException
*/
public static Object[][] evalDatabaseTable(String driverClassString, String databaseStringUrl, String username,
String password, String tableName, int rowOffset, int colOffset, DataType[] dataTypes)
throws DataTypesMismatchException, ClassNotFoundException, SQLException, DataTypesCountException,
DataTypesTypeException {
// 2D Array of Objects to hold data object to be
// returned
Object[][] myData;
// Collection to hold same data
ArrayList<Object> myArrayData = new ArrayList<Object>();
// Driver class check, (requires driver dependency)
Class.forName(driverClassString);
// Create Connection and set value to the static
// method getConnection
// from DriverManager
Connection dbconn = DriverManager.getConnection(databaseStringUrl, username, password);
// Create Statement object and set its value to
// database connection by
// calling createStatement instance method
Statement stmt = dbconn.createStatement();
// Create the ResultSet variable and set its value
// to the Statement
// object's instance method executeQuery with a
// supplied SQL select
// statement
ResultSet rs = stmt.executeQuery("select * from " + tableName);
// Create a int variable and set its value to the
// ResultSet object's
// instance method getColumnCount() from
// getMetaData().
// ResultSetMetaData rsmd = rs.getMetaData();
int numOfColumns = rs.getMetaData().getColumnCount();
// Check if any DataTypes are supplied
if (dataTypes != null) {
// Check that the number of DataTypes passed is
// equal to the number
// columns in the database specified
if (dataTypes.length != numOfColumns) {
throw new DataTypesCountException();
}
}
// Iteration count
int curRow = 1;
// Start and go on first row if it is present
while (rs.next()) {
// Checking for rowOffset
if (curRow > rowOffset) {
// Gather row data based on columns
// collecting
Object[] rowData = new Object[numOfColumns - colOffset];
for (int i = 0, j = colOffset; i < rowData.length; i++) {
try {
// Based on DataType go to correct
// case
switch (dataTypes[i]) {
// Convert to String if data from
// database data
case STRING:
rowData[i] = rs.getString(i + colOffset + 1);
break;
// Convert to int if data from database data
case INT:
rowData[i] = rs.getInt(i + colOffset + 1);
break;
// Convert to float if data from
// database data
case FLOAT:
rowData[i] = rs.getFloat(i + colOffset + 1);
break;
case DOUBLE:
rowData[i] = rs.getDouble(i + colOffset + 1);
break;
case BOOLEAN:
rowData[i] = rs.getBoolean(i + colOffset + 1);
break;
default:
break;
}
} catch (Exception e) {
// Throw exception if error occurs
throw new DataTypesTypeException();
}
}
// Add row data to collection
myArrayData.add(rowData);
}
// Increase row count
curRow++;
}
// Create array for first level based on items
// collected in collection
myData = new Object[myArrayData.size()][];
// Use a loop to iterate through array to add each
// row data as an array
// (Creating the 2D Array needed)
for (int i = 0; i < myData.length; i++) {
// Adding the row data...
myData[i] = (Object[]) myArrayData.get(i);
}
// myArrayData.toArray(myData);
// Close all connections
rs.close();
stmt.close();
dbconn.close();
// Return data as arrays of the rows of arrays of
// columns data
return myData;
}
/**
* Method to read an excel file in both the old format of excel and the
* newer one.
*
* @param fileLocation
* @param fileName
* @param hasLabels
* @return
* @throws InvalidExcelExtensionException
*/
public static Object[][] getExcelFileData(String fileLocation, String fileName, Boolean hasLabels)
throws InvalidExcelExtensionException {
// Use a variable to store the 2D Object;
Object[][] resultsObject;
// Separate the file name from the exchange
String[] fileNameParts = fileName.split("[.]");
// Extension becomes last part of the file after the
// period
String extension = fileNameParts[fileNameParts.length - 1];
// Collection of results which will be set to a
// collection of rows in
// the excel file
ArrayList<Object> results = null;
// Check for the extension to be xlsx or newer Excel
// 2003+
if (extension.equalsIgnoreCase("xlsx")) {
// Call method to get results from a new type
// for excel document
results = getNewExcelFileResults(fileLocation, fileName, hasLabels);
// Check for the extension to be xls or old
// Excel -2003
} else if (extension.equalsIgnoreCase("xls")) {
// Call method to get results from a old type for excel document
results = getOldExcelFileResults(fileLocation, fileName, hasLabels);
// if extension is not one of these, through
// exception
} else {
throw new InvalidExcelExtensionException();
}
// Set the results object to an array of arrays with
// size set to the
// amount of rows collected in results (the
// collection of rows)
resultsObject = new Object[results.size()][];
// Convert the results into the supplied array which
// is resultsObject
results.toArray(resultsObject);
// return the results object
return resultsObject;
}
/**
* Overloaded method to read text file formatted in CSV style.
*
* @param fileName
* @return
*/
public static Object[][] getTextFileData(String fileName) {
return getTextFileData("", fileName, TextFormat.CSV, false, null);
}
/**
* Overloaded method to read text file in various format styles.
*
* @param fileLocation
* @param fileName
* @param textFormat
* @return
*/
public static Object[][] getTextFileData(String fileLocation, String fileName, TextFormat textFormat) {
return getTextFileData(fileLocation, fileName, textFormat, false, null);
}
/**
* Method to read text file in various format styles and also allows
* DataTypes to be specified
*
* @param fileLocation
* @param fileName
* @param textFormat
* @param hasLabels
* @param dataTypes
* @return
*/
public static Object[][] getTextFileData(String fileLocation, String fileName, TextFormat textFormat,
Boolean hasLabels, DataType[] dataTypes) {
Object[][] data;
ArrayList<String> lines = openFileAndCollectData(fileLocation, fileName);
switch (textFormat) {
case CSV:
data = parseCSVData(lines, hasLabels, dataTypes);
break;
case XML:
data = parseXMLData(lines, hasLabels);
break;
case TAB:
data = parseTabData(lines, hasLabels);
break;
case JSON:
data = parseJSONData(lines, hasLabels);
break;
default:
data = null;
break;
}
return data;
}
/**
* Overloaded method to read text file in various format styles and also
* allows DataTypes to be specified and also setting no labels.
*
* @param fileLocation
* @param fileName
* @param textFormat
* @param dataTypes
* @return
*/
public static Object[][] getTextFileData(String fileLocation, String fileName, TextFormat textFormat,
DataType[] dataTypes) {
return getTextFileData(fileLocation, fileName, textFormat, false, dataTypes);
}
public static Object[][] joinData(Object[][]... data) {
Object[][] newData = new Object[][] { {} };
// Object[][] finalData = null;
for (int i = 0; i < data.length; i++) {
newData = DataHelper.joinData(newData, data[i]);
}
return newData;
}
/**
* @param credentials
* @param v
* @return
*/
public static Object[][] joinData(Object[][] primaryArray, Object[][] joinArray) {
// Check for square Matrix and if not through an
// exception0
int totalDimX = primaryArray.length * joinArray.length;
int totalDimY = primaryArray[0].length + joinArray[0].length;
Object[][] data = new Object[totalDimX][totalDimY];
clearArray(data);
for (int i = 0; i < joinArray.length; i++) {
DataHelper.insertArray(data, primaryArray, primaryArray.length * i, 0);
}
for (int i = 0; i < primaryArray.length; i++) {
DataHelper.insertArray(data, joinArray, joinArray.length * i, primaryArray[0].length);
}
return data;
}
/**
* @param hasLabels
* @param newExcelFormatFile
* @param results
* @param workbook
* @param sheet
* @return
*/
private static ArrayList<Object> collectExcelData(Boolean hasLabels, InputStream newExcelFormatFile,
ArrayList<Object> results, Workbook workbook, Sheet sheet) {
try {
Iterator<Row> rowIterator = sheet.iterator();
if (hasLabels) {
rowIterator.next();
}
while (rowIterator.hasNext()) {
ArrayList<Object> rowData = new ArrayList<Object>();
Row row = rowIterator.next();
Iterator<Cell> cellIterator = row.cellIterator();
while (cellIterator.hasNext()) {
Cell cell = cellIterator.next();
switch (cell.getCellType()) {
case Cell.CELL_TYPE_BOOLEAN:
System.out.print(cell.getBooleanCellValue() + "\t\t\t");
rowData.add(cell.getBooleanCellValue());
break;
case Cell.CELL_TYPE_NUMERIC:
System.out.print(cell.getNumericCellValue() + "\t\t\t");
rowData.add(cell.getNumericCellValue());
break;
case Cell.CELL_TYPE_STRING:
System.out.print(cell.getStringCellValue() + "\t\t\t");
rowData.add(cell.getStringCellValue());
break;
}
}
Object[] rowDataObject = new Object[rowData.size()];
rowData.toArray(rowDataObject);
results.add(rowDataObject);
System.out.println("");
}
newExcelFormatFile.close();
FileOutputStream out = new FileOutputStream(new File("src/main/resources/excel-output.xlsx"));
workbook.write(out);
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return results;
}
/**
* @param parameter
* @param dataType
* @return
* @throws BooleanFormatException
* @throws CharacterCountFormatException
*/
private static Object convertDataType(String parameter, DataType dataType)
throws BooleanFormatException, CharacterCountFormatException {
Object data = null;
try {
switch (dataType) {
case STRING:
data = parameter;
break;
case CHAR:
if (parameter.length() > 1) {
throw new CharacterCountFormatException();
}
data = parameter.charAt(0);
break;
case DOUBLE:
data = Double.parseDouble(parameter);
break;
case FLOAT:
data = Float.parseFloat(parameter);
break;
case INT:
data = Integer.parseInt(parameter);
break;
case BOOLEAN:
if (parameter.equalsIgnoreCase("true") | parameter.equalsIgnoreCase("false")) {
data = Boolean.parseBoolean(parameter);
} else {
throw new BooleanFormatException();
}
break;
default:
break;
}
} catch (NumberFormatException | BooleanFormatException | CharacterCountFormatException e) {
System.out.println("Converting data.. to... " + dataType + "(" + parameter + ")");
}
return data;
}
/**
* Private method to get data from a new type of Excel file.
*
* @param fileLocation
* @param fileName
* @param hasLabels
* @return
* @throws IOException
*/
private static ArrayList<Object> getNewExcelFileResults(String fileLocation, String fileName, Boolean hasLabels) {
ArrayList<Object> data = null;
String fullFilePath = fileLocation + fileName;
InputStream newExcelFormatFile;
try {
newExcelFormatFile = new FileInputStream(new File(fullFilePath));
ArrayList<Object> results = new ArrayList<Object>();
Workbook workbook = new XSSFWorkbook(newExcelFormatFile);
Sheet sheet = workbook.getSheetAt(0);
data = collectExcelData(hasLabels, newExcelFormatFile, results, workbook, sheet);
} catch (FileNotFoundException e) {
System.out.println("File Not Found");
} catch (IOException e) {
System.out.println("File Read Error");
e.printStackTrace();
}
return data;
}
/**
* Private method to get data from an old type of Excel file.
*
* @param fileLocation
* @param fileName
* @param hasLabels
* @return
*/
private static ArrayList<Object> getOldExcelFileResults(String fileLocation, String fileName, Boolean hasLabels) {
ArrayList<Object> data = null;
String fullFilePath = fileLocation + fileName;
InputStream newExcelFormatFile;
try {
newExcelFormatFile = new FileInputStream(new File(fullFilePath));
ArrayList<Object> results = new ArrayList<Object>();
Workbook workbook = new HSSFWorkbook(newExcelFormatFile);
Sheet sheet = workbook.getSheetAt(0);
data = collectExcelData(hasLabels, newExcelFormatFile, results, workbook, sheet);
} catch (FileNotFoundException e) {
System.out.println("File Not Found");
} catch (IOException e) {
System.out.println("File Read Error");
e.printStackTrace();
}
return data;
}
private static void insertArray(Object[][] origArray, Object[][] newData, int insertX, int insertY) {
for (int i = insertX, x = 0; i < newData.length + insertX; i++, x++) {
for (int j = insertY, y = 0; j < newData[x].length + insertY; j++, y++) {
origArray[i][j] = newData[x][y];
}
}
}
/**
* Private method to open a text file and collect data lines as an ArrayList
* collection of lines.
*
* @param fileLocation
* @param fileName
* @return
*/
private static ArrayList<String> openFileAndCollectData(String fileLocation, String fileName) {
String fullFilePath = fileLocation + fileName;
ArrayList<String> dataLines = new ArrayList<String>();
try {
FileReader fileReader = new FileReader(fullFilePath);
BufferedReader bufferedReader = new BufferedReader(fileReader);
String line = bufferedReader.readLine();
while (line != null) {
dataLines.add(line);
line = bufferedReader.readLine();
}
bufferedReader.close();
} catch (FileNotFoundException ex) {
System.out.println("Unable to open file '" + fullFilePath + "'");
} catch (IOException ex) {
System.out.println("Error reading file '" + fullFilePath + "'");
}
return dataLines;
}
/**
* Private method to get parse data formatted in CSV style.
*
* @param lines
* @param hasLabels
* @param dataTypes
* @return
*/
private static Object[][] parseCSVData(ArrayList<String> lines, boolean hasLabels, DataType[] dataTypes) {
ArrayList<Object> results = new ArrayList<Object>();
if (hasLabels) {
lines.remove(0);
}
String pattern = "(,*)([a-zA-Z0-9\\s-\\\\\\/\\\"]+)(,*)";
Pattern r = Pattern.compile(pattern);
for (int i = 0; i < lines.size(); i++) {
int curDataType = 0;
ArrayList<Object> curMatches = new ArrayList<Object>();
Matcher m = r.matcher(lines.get(i));
while (m.find()) {
if (dataTypes.length > 0) {
try {
curMatches.add(convertDataType(m.group(2).trim(), dataTypes[curDataType]));
} catch (Exception e) {
// System.out.println("DataTypes
// provided do not match
// parsed data results.");
}
} else {
curMatches.add(m.group(2).trim());
}
curDataType++;
}
Object[] resultsObj = new Object[curMatches.size()];
curMatches.toArray(resultsObj);
results.add(resultsObj);
}
Object[][] resultsObj = new Object[results.size()][];
results.toArray(resultsObj);
return resultsObj;
}
/**
* Private method to get parse data formatted in JSON style.
*
* @param lines
* @param hasLabels
* @return
*/
private static Object[][] parseJSONData(ArrayList<String> lines, Boolean hasLabels) {
// TODO Create an implementation to handle JSON
// formatted documents
return null;
}
/**
* Private method to get parse data formatted in Tab style.
*
* @param lines
* @param hasLabels
* @return
*/
private static Object[][] parseTabData(ArrayList<String> lines, Boolean hasLabels) {
// TODO Create an implementation to handle Tab
// formatted documents
return null;
}
/**
* Private method to get parse data formatted in XML style.
*
* @param lines
* @param hasLabels
* @return
*/
private static Object[][] parseXMLData(ArrayList<String> lines, Boolean hasLabels) {
// TODO Create an implementation to handle XML
// formatted documents
return null;
}
}
| [
"priferreira@gmail.com"
] | priferreira@gmail.com |
b3edd298b38e9830bb500a1187fe6a9225e93592 | 39714d0797f7ab5afe00fa81aa83710dbe14c237 | /technology-share-parent/technology-share-configuration/src/main/java/com/technology/share/configuration/mybatis/plus/MyBatisPlusConfig.java | ca97aa733b890d7347d644a5572f1ed82f48da87 | [] | no_license | GeekCracker/technology-share | 97e40792d82834bb78a01e76e75eba9c900cfe55 | 698429a9e951077f5766ee4c883312d6fefddd78 | refs/heads/master | 2022-06-22T09:46:02.344737 | 2021-05-24T10:25:28 | 2021-05-24T10:25:28 | 224,334,942 | 0 | 0 | null | 2022-06-21T02:19:53 | 2019-11-27T03:20:19 | Vue | UTF-8 | Java | false | false | 450 | java | package com.technology.share.configuration.mybatis.plus;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
@Component
public class MyBatisPlusConfig {
/**
* 分页插件
* @return
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}
| [
"1127766234@qq.com"
] | 1127766234@qq.com |
f47317468a9ca63c0f471239384a3a45bfc653d7 | 926282e0b5fb9766a486717013976539f1535d43 | /Sdaresto/app/src/main/java/com/nbs/app/sdaresto_android/MainActivity.java | d4222738a71190e0f39eee78ed051cdee384ec2b | [] | no_license | Vallenteer/sdaresto | 89c30fb6f3fb106a6285e465a8bc7f9ac023f828 | 81240611fc1f61090173e33a74127408707ff5df | refs/heads/master | 2020-06-14T18:02:19.614691 | 2016-12-06T07:24:46 | 2016-12-06T07:24:46 | 75,348,634 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,746 | java | package com.nbs.app.sdaresto_android;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
ListView list;
String[] web={
"Meja 1",
"Meja 2",
"Meja 3",
"Meja 4",
"Meja 5"
};
public static int table_number;
public static ArrayList<String> id_menu_pesanan = new ArrayList<String>();
public static ArrayList<String> Menu_pesanan = new ArrayList<String>();
public static ArrayList<String> Jumlah_pesanan = new ArrayList<String>();
public static ArrayList<String> pesanan_khusus = new ArrayList<String>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ListViewHandlerTable adapter = new ListViewHandlerTable(MainActivity.this,web);
list=(ListView) findViewById(R.id.lv_table);
list.setAdapter(adapter);
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
table_number=position+1;
//menghilangkan cache
id_menu_pesanan.clear();
Menu_pesanan.clear();
Jumlah_pesanan.clear();
pesanan_khusus.clear();
Intent intent = new Intent(MainActivity.this, Menu.class);
startActivity(intent);
}
});
}
}
| [
"kristiantokelvin@yahoo.co.id"
] | kristiantokelvin@yahoo.co.id |
e9864c675b6f772dd2d6bcdb58d7c65406a2d3bf | 1dc9c0a24a162fa235478d23c4de1f83e302c611 | /src/main/java/com/siva/ThreadExamples/Counselling.java | d3a3a0533d0cb3df805a27254d0a4699db11e791 | [] | no_license | cvakarna/Java | 6f985acefd2144687f21c0d4ac492569942329a1 | 5a4839b3f5b81d391aa1d8df7545f4e83551f941 | refs/heads/master | 2021-09-01T08:52:11.697933 | 2017-12-26T03:24:20 | 2017-12-26T03:24:20 | 115,381,051 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package com.siva.ThreadExamples;
public class Counselling {
public static void doCounsilling() {
College c = new College(1);
Thread t1 = new Thread(c);
Thread t2 = new Thread(c);
t1.setName("student1");
t2.setName("student2");
t1.start();
t2.start();
}
public static void main(String[] args) {
doCounsilling();
}
}
| [
"jothi.pandiyan@bizruntime.com"
] | jothi.pandiyan@bizruntime.com |
3a231e9e76702f78fb19bd33b771617b75add447 | ae4e3e1a3fbdb6453b3cd8514df7b5a22c606598 | /app/src/androidTest/java/isteve/system/myapplication/ExampleInstrumentedTest.java | 28f6ca8654f619d60667b6e324771b927159af14 | [] | no_license | Amar-Yelane/PaymentUsingUPI | 5f8f25f0ff548ed7849b98d73b7b2eda3130346a | 036ec3d9b773a8b3d91b03a214cb61ba949bf17b | refs/heads/master | 2021-03-23T02:12:36.940500 | 2020-03-15T06:36:47 | 2020-03-15T06:36:47 | 247,414,898 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 770 | java | package isteve.system.myapplication;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("isteve.system.myapplication", appContext.getPackageName());
}
}
| [
"52008715+amarsyelane@users.noreply.github.com"
] | 52008715+amarsyelane@users.noreply.github.com |
13d150b054f4a148eec61570ab2972307d26e791 | 90601e1d0d23f2b5f2325881dc0e27ddaa13f803 | /src/test/java/seedu/address/logic/commands/RemarkCommandTest.java | 549547104c6079f21e65aa7774a52ae8eae4a1fb | [
"MIT"
] | permissive | CS2103JAN2018-F12-B1/main | 104053c8c81acc92d44b92336067e6d6fcbca819 | 666120e68b9096661460c5f8a4cc790e3ea38384 | refs/heads/master | 2021-04-26T22:26:01.243985 | 2018-03-16T05:00:51 | 2018-03-16T05:00:51 | 124,091,707 | 0 | 1 | null | 2018-03-16T05:00:52 | 2018-03-06T14:39:04 | Java | UTF-8 | Java | false | false | 10,509 | java | package seedu.address.logic.commands;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static seedu.address.logic.commands.CommandTestUtil.VALID_REMARK_AMY;
import static seedu.address.logic.commands.CommandTestUtil.VALID_REMARK_BOB;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.logic.commands.CommandTestUtil.prepareRedoCommand;
import static seedu.address.logic.commands.CommandTestUtil.prepareUndoCommand;
import static seedu.address.logic.commands.CommandTestUtil.showPersonAtIndex;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_PERSON;
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND_PERSON;
import static seedu.address.testutil.TypicalPersons.getTypicalAddressBook;
import org.junit.Test;
import seedu.address.commons.core.Messages;
import seedu.address.commons.core.index.Index;
import seedu.address.logic.CommandHistory;
import seedu.address.logic.UndoRedoStack;
import seedu.address.model.AddressBook;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
import seedu.address.model.UserPrefs;
import seedu.address.model.person.Person;
import seedu.address.model.person.Remark;
import seedu.address.testutil.PersonBuilder;
public class RemarkCommandTest {
public static final String REMARK_EXAMPLE = "This is a remark";
private Model model = new ModelManager(getTypicalAddressBook(), new UserPrefs());
@Test
public void execute_addRemarkUnfilteredList_success() throws Exception {
Person firstPerson = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased());
Person editedPerson = new PersonBuilder(firstPerson).withRemark(REMARK_EXAMPLE).build();
RemarkCommand remarkCommand = prepareCommand(INDEX_FIRST_PERSON, editedPerson.getRemark().value);
String expectedMessage = String.format(RemarkCommand.MESSAGE_ADD_REMARK_SUCCESS, editedPerson);
Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs());
expectedModel.updatePerson(firstPerson, editedPerson);
assertCommandSuccess(remarkCommand, model, expectedMessage, expectedModel);
}
@Test
public void execute_deleteRemarkUnfilteredList_success() throws Exception {
Person firstPerson = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased());
Person editedPerson = new PersonBuilder(firstPerson).withRemark("").build();
RemarkCommand remarkCommand = prepareCommand(INDEX_FIRST_PERSON, editedPerson.getRemark().toString());
String expectedMessage = String.format(RemarkCommand.MESSAGE_DELETE_REMARK_SUCCESS, editedPerson);
Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs());
expectedModel.updatePerson(firstPerson, editedPerson);
assertCommandSuccess(remarkCommand, model, expectedMessage, expectedModel);
}
@Test
public void execute_filteredList_success() throws Exception {
showPersonAtIndex(model, INDEX_FIRST_PERSON);
Person firstPersonInFilteredList = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased());
Person editedPerson = new PersonBuilder(model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased()))
.withRemark(REMARK_EXAMPLE).build();
RemarkCommand remarkCommand = prepareCommand(INDEX_FIRST_PERSON,
editedPerson.getRemark().value);
String expectedMessage = String.format(RemarkCommand.MESSAGE_ADD_REMARK_SUCCESS, editedPerson);
Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs());
expectedModel.updatePerson(firstPersonInFilteredList, editedPerson);
assertCommandSuccess(remarkCommand, model, expectedMessage, expectedModel);
}
@Test
public void execute_invalidPersonIndexUnfilteredList_failure() throws Exception {
Index invalidIndex = Index.fromOneBased(model.getFilteredPersonList().size() + 1);
RemarkCommand remarkCommand = prepareCommand(invalidIndex, VALID_REMARK_BOB);
assertCommandFailure(remarkCommand, model, Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX);
}
/**
* Edit filtered list where index is larger than size of filtered list,
* but smaller than size of address book
*/
@Test
public void execute_invalidPersonIndexFilteredList_failure() throws Exception {
showPersonAtIndex(model, INDEX_FIRST_PERSON);
Index invalidIndex = INDEX_SECOND_PERSON;
// ensures that invalidIndex is still in bounds of address book list
assertTrue(invalidIndex.getZeroBased() < model.getAddressBook().getPersonList().size());
RemarkCommand remarkCommand = prepareCommand(invalidIndex, VALID_REMARK_BOB);
assertCommandFailure(remarkCommand, model, Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX);
}
@Test
public void executeUndoRedo_validIndexUnfilteredList_success() throws Exception {
UndoRedoStack undoRedoStack = new UndoRedoStack();
UndoCommand undoCommand = prepareUndoCommand(model, undoRedoStack);
RedoCommand redoCommand = prepareRedoCommand(model, undoRedoStack);
Person personToEdit = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased());
Person editedPerson = new PersonBuilder(personToEdit).withRemark(REMARK_EXAMPLE).build();
RemarkCommand remarkCommand = prepareCommand(INDEX_FIRST_PERSON, REMARK_EXAMPLE);
Model expectedModel = new ModelManager(model.getAddressBook(), new UserPrefs());
// remark -> first person remark edited
remarkCommand.execute();
undoRedoStack.push(remarkCommand);
// undo -> reverts addressbook back to previous state and filtered person list to show all persons
assertCommandSuccess(undoCommand, model, UndoCommand.MESSAGE_SUCCESS, expectedModel);
// redo -> same first person edited again
expectedModel.updatePerson(personToEdit, editedPerson);
assertCommandSuccess(redoCommand, model, RedoCommand.MESSAGE_SUCCESS, expectedModel);
}
@Test
public void executeUndoRedo_invalidIndexUnfilteredList_failure() {
UndoRedoStack undoRedoStack = new UndoRedoStack();
UndoCommand undoCommand = prepareUndoCommand(model, undoRedoStack);
RedoCommand redoCommand = prepareRedoCommand(model, undoRedoStack);
Index invalidIndex = Index.fromOneBased(model.getFilteredPersonList().size() + 1);
RemarkCommand remarkCommand = prepareCommand(invalidIndex, "");
// execution failed -> remarkCommand not pushed into undoRedoStack
assertCommandFailure(remarkCommand, model, Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX);
// no commands in undoRedoStack -> undoCommand and redoCommand fail
assertCommandFailure(undoCommand, model, UndoCommand.MESSAGE_FAILURE);
assertCommandFailure(redoCommand, model, RedoCommand.MESSAGE_FAILURE);
}
/**
* 1. Edits a {@code Person#remark} from a filtered list.
* 2. Undo the edit.
* 3. The unfiltered list should be shown now. Verify that the index of the previously edited person in the
* unfiltered list is different from the index at the filtered list.
* 4. Redo the edit. This ensures {@code RedoCommand} edits the person object regardless of indexing.
*/
@Test
public void executeUndoRedo_validIndexFilteredList_samePersonDeleted() throws Exception {
UndoRedoStack undoRedoStack = new UndoRedoStack();
UndoCommand undoCommand = prepareUndoCommand(model, undoRedoStack);
RedoCommand redoCommand = prepareRedoCommand(model, undoRedoStack);
RemarkCommand remarkCommand = prepareCommand(INDEX_FIRST_PERSON, REMARK_EXAMPLE);
Model expectedModel = new ModelManager(model.getAddressBook(), new UserPrefs());
showPersonAtIndex(model, INDEX_SECOND_PERSON);
Person personToEdit = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased());
Person editedPerson = new PersonBuilder(personToEdit).withRemark(REMARK_EXAMPLE).build();
// remark -> edits second person remark in unfiltered person list / first person in filtered person list
remarkCommand.execute();
undoRedoStack.push(remarkCommand);
// undo -> reverts addressbook back to previous state and filtered person list to show all persons
assertCommandSuccess(undoCommand, model, UndoCommand.MESSAGE_SUCCESS, expectedModel);
expectedModel.updatePerson(personToEdit, editedPerson);
assertNotEquals(personToEdit, model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased()));
// redo -> edits same second person in unfiltered person list
assertCommandSuccess(redoCommand, model, RedoCommand.MESSAGE_SUCCESS, expectedModel);
}
@Test
public void equals() throws Exception {
final RemarkCommand standardCommand = new RemarkCommand(INDEX_FIRST_PERSON, new Remark(VALID_REMARK_AMY));
// same values -> returns true
RemarkCommand commandWithSameValues = new RemarkCommand(INDEX_FIRST_PERSON, new Remark(VALID_REMARK_AMY));
assertTrue(standardCommand.equals(commandWithSameValues));
// same object -> returns true
assertTrue(standardCommand.equals(standardCommand));
// null -> returns false
assertFalse(standardCommand.equals(null));
// different types -> returns false
assertFalse(standardCommand.equals(new ClearCommand()));
// different index -> returns false
assertFalse(standardCommand.equals(new RemarkCommand(INDEX_SECOND_PERSON, new Remark(VALID_REMARK_AMY))));
// different remark -> returns false
assertFalse(standardCommand.equals(new RemarkCommand(INDEX_FIRST_PERSON, new Remark(VALID_REMARK_BOB))));
}
/**
* Returns an {@code RemarkCommand} with parameters {@code index} and {@code remark}
*/
private RemarkCommand prepareCommand(Index index, String remark) {
RemarkCommand remarkCommand = new RemarkCommand(index, new Remark(remark));
remarkCommand.setData(model, new CommandHistory(), new UndoRedoStack());
return remarkCommand;
}
}
| [
"1155077028@link.cuhk.edu.hk"
] | 1155077028@link.cuhk.edu.hk |
c4ec6aabd4bdbdb04cbf023e99289bead015d6ee | 3bfe6e0ce64cebced03a32718efa55ede240e8bf | /src/main/java/seedu/address/model/moduleclass/ModuleClass.java | 7749cb9810334609bceaae60352936fad9dbc0bd | [
"MIT"
] | permissive | czhi-bin/tp | c647f404b8733d3b65ab3134aa83edef6c4d8802 | 493426c2ea4ec55b3302a3bf7e013173b5f96920 | refs/heads/master | 2023-08-21T18:34:32.460745 | 2021-10-18T11:22:33 | 2021-10-18T11:22:33 | 405,387,080 | 0 | 0 | NOASSERTION | 2021-10-18T08:46:14 | 2021-09-11T13:30:35 | Java | UTF-8 | Java | false | false | 3,527 | java | package seedu.address.model.moduleclass;
import static seedu.address.commons.util.CollectionUtil.requireAllNonNull;
import java.util.Collections;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import seedu.address.model.person.ModuleCode;
import seedu.address.model.person.Remark;
/**
* Represents a ModuleClass in the address book.
* Guarantees: details are present and not null, field values are validated, immutable.
*/
public class ModuleClass {
// Identity fields
private final Set<ModuleCode> moduleCodes = new HashSet<>();
private final Day day;
private final Time time;
private final Remark remark;
/**
* Every field must be present and not null.
*/
public ModuleClass(Set<ModuleCode> moduleCode, Day day, Time time, Remark remark) {
requireAllNonNull(moduleCode, day, time, remark);
assert(moduleCode.size() == 1) : "Class should only contain 1 module code!";
this.moduleCodes.addAll(moduleCode);
this.day = day;
this.time = time;
this.remark = remark;
}
/**
* Returns an immutable module codes set, which throws {@code UnsupportedOperationException}
* if modification is attempted.
*/
public Set<ModuleCode> getModuleCodes() {
return Collections.unmodifiableSet(moduleCodes);
}
public Day getDay() {
return day;
}
public Time getTime() {
return time;
}
public Remark getRemark() {
return remark;
}
/**
* Returns true if both classes have the same module code, day and time.
* This defines a weaker notion of equality between two classes.
*/
public boolean isSameModuleClass(ModuleClass otherModuleClass) {
if (otherModuleClass == this) {
return true;
}
return otherModuleClass != null
&& otherModuleClass.getModuleCodes().equals(getModuleCodes())
&& otherModuleClass.getDay().equals(getDay())
&& otherModuleClass.getTime().equals(getTime());
}
/**
* Returns true if both classes have the same identity and data fields.
* This defines a stronger notion of equality between two moduleClasses.
*/
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if (!(other instanceof ModuleClass)) {
return false;
}
ModuleClass otherModuleClass = (ModuleClass) other;
return ((ModuleClass) other).getModuleCodes().equals(getModuleCodes())
&& otherModuleClass.getDay().equals(getDay())
&& otherModuleClass.getTime().equals(getTime())
&& otherModuleClass.getRemark().equals(getRemark());
}
@Override
public int hashCode() {
// use this method for custom fields hashing instead of implementing your own
return Objects.hash(moduleCodes, day, time, remark);
}
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append("Module: ")
.append(getModuleCodes())
.append("; Day: ")
.append(getDay().toString())
.append("; Time: ")
.append(getTime().toString());
if (!remark.toString().trim().isEmpty()) {
builder.append("; Remark: ");
builder.append(getRemark());
}
return builder.toString();
}
}
| [
"kua.james30@gmail.com"
] | kua.james30@gmail.com |
37d51a28d8de6499f12ac5305b746fcf96b1fc20 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_4a286829631bd6e69f670ff1ef3e1f22d570b940/ObjectCache/5_4a286829631bd6e69f670ff1ef3e1f22d570b940_ObjectCache_s.java | 42251bcd87a833d0346ea176ffe54312bc691b8e | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,219 | java | /*
* Copyright 2011 gitblit.com.
*
* 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 com.gitblit.models;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* Reusable object cache.
*
* @author James Moger
*
*/
public class ObjectCache<X> implements Serializable {
private static final long serialVersionUID = 1L;
private final Map<String, CachedObject<X>> cache = new ConcurrentHashMap<String, CachedObject<X>>();
private class CachedObject<Y> {
public final String name;
private volatile Date date;
private volatile Y object;
CachedObject(String name) {
this.name = name;
date = new Date(0);
}
@Override
public String toString() {
return getClass().getSimpleName() + ": " + name;
}
}
public boolean hasCurrent(String name, Date date) {
return cache.containsKey(name) && cache.get(name).date.compareTo(date) == 0;
}
public Date getDate(String name) {
return cache.get(name).date;
}
public X getObject(String name) {
return cache.get(name).object;
}
public void updateObject(String name, X object) {
this.updateObject(name, new Date(), object);
}
public void updateObject(String name, Date date, X object) {
CachedObject<X> obj;
if (cache.containsKey(name)) {
obj = cache.get(name);
} else {
obj = new CachedObject<X>(name);
cache.put(name, obj);
}
obj.date = date;
obj.object = object;
}
public Object remove(String name) {
return cache.remove(name).object;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
1ea995df7a742dbd4db3763c7bf97d6939997d8a | 73321d6897338760c4200de649f62c74409ae41d | /src/mypackage1/Increment.java | 3589beb4a239d30aedcdb09f77e18350fbaaedbb | [] | no_license | Deadem55/FirstStep | 1cd59bed0ac9715e0dfc796ae665f240b7f8974b | 57ae789c6874e4383e754eb6ecb586bf4908fb4a | refs/heads/master | 2023-06-15T19:19:55.614522 | 2021-07-17T17:50:37 | 2021-07-17T17:50:37 | 387,004,670 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 234 | java | package mypackage1;
public class Increment {
public static void main(String[] args) {
int i = 0;
int a = i++;
System.out.println(i);
System.out.println(i);
System.out.println(++i);
}
}
| [
"dmitriyvolchenko.work@gmail.com"
] | dmitriyvolchenko.work@gmail.com |
3e57f152144213403896097691bdf469921e6316 | b6c81f1aabdc835bdb0f0997d2aa06287041b6c2 | /app/src/main/java/com/example/well/luochen/net/data/BaseResponse.java | dc12c428a5dc2c47915a2314331c7c856c202766 | [] | no_license | selectgithub/LuoChen | a3f30d1b7efe8ae074c5c4a5d1512f22088d084d | ca5dc15512da53dc57c51154666330e311c36228 | refs/heads/master | 2021-01-09T05:10:09.310515 | 2016-09-14T08:41:04 | 2016-09-14T08:41:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java | package com.example.well.luochen.net.data;
public class BaseResponse {
public int showapi_res_code=0;
public String showapi_res_error="";
}
| [
"835350313@qq.com"
] | 835350313@qq.com |
44e2af02143d549a3cb0515d72706c8aee5e40ab | de0920ea38718791b689858f437cc7cc642a81a5 | /Exercicio10/src/exercicio10/Exercicio10.java | acb542d23da52e86fd9cf0614b102a9abbfad1e1 | [] | no_license | BergSabbath/Java-POO-IFSP-CTD | ce4f09c1f5d14a521a58fb84045bdeb4e0043d8e | 310c8dab08fb48728bf18aeeef9bed7ae9694895 | refs/heads/master | 2020-03-30T07:47:32.007448 | 2018-10-08T19:14:42 | 2018-10-08T19:14:42 | 150,964,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,311 | java | /*
10. Escrever um programa que leia o nome de um aluno e as
notas das três provas que ele obteve no semestre. No final
informar o nome do aluno e a sua média (aritmética).
*/
package exercicio10;
//@author Ludenberg Marques Brito Reis
import java.util.Scanner;
public class Exercicio10 {
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
System.out.println("Escreva o nome do aluno: ");
String aluno = entrada.next();
System.out.println("Digite a 1ª nota do aluno:");
double nota1 = entrada.nextDouble();
System.out.println("Digite a 2ª nota do aluno");
double nota2 = entrada.nextDouble();
System.out.println("Digite a 3ª nota do aluno");
double nota3 = entrada.nextDouble();
double media = (nota1 + nota2 + nota3) / 3;// calculo da media aritmetica
System.out.println("----------------------------------");
System.out.println("Resultado");
System.out.println("----------------------------------");
System.out.println("Nome do Aluno: "+ aluno );
System.out.printf("Sua média é: %.2f \n",media);
System.out.println("----------------------------------\n");
}
}
| [
"bergit7@gmail.com"
] | bergit7@gmail.com |
7ca88bd92356fd82cba0025f2d5044f1ca4b52a6 | 198f92850a718b2d1d386c3a13eb5715a65c91ee | /typhoon-query/src/main/java/com/field/typhoonquery/service/impl/DataFeignClientHystrix.java | 4a6fbcae8725fa07a863eabc250eae6b2d84118f | [] | no_license | bestfield/typhoon | 307391f33e9014447cdd0a08ca86d904f2f18527 | 852c17bfc82ceeefcde70d9bb813a76c2d148c98 | refs/heads/master | 2020-05-15T21:20:40.990454 | 2019-05-07T11:19:25 | 2019-05-07T11:19:25 | 182,481,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 539 | java | package com.field.typhoonquery.service.impl;
import com.field.typhoonquery.service.DataFeignClient;
import org.springframework.stereotype.Component;
/**
* Created by Tian.Ye in 10:22 2019/4/27
*
* 为sync方法提供熔断 —— hystrix
*
*/
@Component
public class DataFeignClientHystrix implements DataFeignClient {
@Override
public String sync() {
return "Sorry, sync job has FAILED !! plz try again ";
}
@Override
public String syncAll() {
return "plz wait and see the console!!";
}
}
| [
"549427031@qq.com"
] | 549427031@qq.com |
5da041b9d0099c70bb648755463d46017d719df4 | 56264945e9352545780640d6a962f2f9a48a24ce | /application/src/main/java/com/emiancang/emiancang/bean/StatusEntity.java | 8d109ff850460242293fbc36d293003b442bd137 | [] | no_license | allenli0413/emc | e662a7adccad204bb9ed592b20248b60fdc7e66c | b663951c19f984ff5fab3d01de0d3df5f117a665 | refs/heads/master | 2021-01-20T00:40:23.664553 | 2017-03-06T12:18:50 | 2017-03-06T12:19:35 | 83,787,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | package com.emiancang.emiancang.bean;
/**
* Created by yuanyueqing on 2017/1/23.
*/
public class StatusEntity {
/**
* 报血警了
* {"resultMsg":"OK","resultCode":"200","resultInfo":{"msg":"采购商资金账户异常","status":"error"}}
*/
private String msg;
private String status;
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
| [
"allenli0413@163.com"
] | allenli0413@163.com |
9e98678e13fcc2e50541ae1436fdb4602967110e | 5ecfb8d652de358bf31315e046a2e810ff65057a | /src/main/java/strategies/HashMapStorageStrategy.java | 3e1c39c37b5c0ac5ada97b27efb483a5faff79cc | [] | no_license | alexzh98/shortener | 0cb27d3b6087a22fa92f070815bf5911ad744d4e | 4661a1c40f984f9dcf66d9150ade20e6ef09debc | refs/heads/main | 2023-07-18T15:47:09.512231 | 2021-09-08T15:09:38 | 2021-09-08T15:09:38 | 404,391,474 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,273 | java | package strategies;
import java.util.HashMap;
import java.util.Map;
public class HashMapStorageStrategy implements StorageStrategy {
private HashMap<Long, String> data = new HashMap<>();
@Override
public boolean containsKey(Long key) {
for (Map.Entry entry : data.entrySet()) {
if (entry.getKey().equals(key)) {
return true;
}
}
return false;
}
@Override
public boolean containsValue(String value) {
for (Map.Entry entry : data.entrySet()) {
if (entry.getValue().equals(value)) {
return true;
}
}
return false;
}
@Override
public void put(Long key, String value) {
data.put(key, value);
}
@Override
public Long getKey(String value) {
for(Map.Entry entry : data.entrySet()) {
if (entry.getValue().equals(value)) {
return (Long) entry.getKey();
}
}
return null;
}
@Override
public String getValue(Long key) {
for(Map.Entry entry : data.entrySet()) {
if (entry.getKey().equals(key)) {
return (String) entry.getValue();
}
}
return null;
}
}
| [
"zhivoderov.aleksej@gmail.com"
] | zhivoderov.aleksej@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.