blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
55f90c3dbf340dd659864b987ad3a67d1d975f09
9289419e7980d2d668fad259cec88317f4696e54
/maven-confluence-core/src/main/java/org/bsc/confluence/ConfluenceServiceFactory.java
f2199e354aa48fb1ae8924abf60f5f75569ca203
[ "NTP", "RSA-MD", "LicenseRef-scancode-pcre", "Apache-2.0", "MIT", "LicenseRef-scancode-rsa-1990", "Beerware", "LicenseRef-scancode-other-permissive", "Spencer-94", "BSD-3-Clause", "LicenseRef-scancode-rsa-md4", "metamail", "HPND-sell-variant", "LicenseRef-scancode-zeusbench" ]
permissive
dmytro-sydorenko/maven-confluence-plugin
084cd5aec41e6ca91c48476be7e41045c6edbc25
79285dd8030766c7cbefd98df7f6159d2030d221
refs/heads/master
2020-08-07T20:03:48.397743
2019-10-01T09:43:29
2019-10-01T09:43:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,689
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package org.bsc.confluence; import static java.lang.String.format; import static org.bsc.confluence.xmlrpc.XMLRPCConfluenceServiceImpl.createInstanceDetectingVersion; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.List; import java.util.Optional; import java.util.concurrent.CompletableFuture; import javax.json.JsonObjectBuilder; import org.bsc.confluence.ConfluenceService.Credentials; import org.bsc.confluence.rest.RESTConfluenceServiceImpl; import org.bsc.confluence.rest.model.Page; import org.bsc.confluence.xmlrpc.XMLRPCConfluenceServiceImpl; import org.bsc.ssl.SSLCertificateInfo; /** * * @author bsorrentino */ public class ConfluenceServiceFactory { private static class MixedConfluenceService implements ConfluenceService { final XMLRPCConfluenceServiceImpl xmlrpcService; final RESTConfluenceServiceImpl restService; public MixedConfluenceService(String endpoint, Credentials credentials, ConfluenceProxy proxyInfo, SSLCertificateInfo sslInfo) throws Exception { this.xmlrpcService = createInstanceDetectingVersion(endpoint, credentials, proxyInfo, sslInfo); final String restEndpoint = new StringBuilder() .append(ConfluenceService.Protocol.XMLRPC.removeFrom(endpoint)) .append(ConfluenceService.Protocol.REST.path()) .toString(); this.restService = new RESTConfluenceServiceImpl(restEndpoint, credentials, sslInfo); } @Override public Credentials getCredentials() { return xmlrpcService.getCredentials(); } @Override public Model.PageSummary findPageByTitle(String parentPageId, String title) throws Exception { return xmlrpcService.findPageByTitle(parentPageId, title); } @Override public CompletableFuture<Boolean> removePage(Model.Page parentPage, String title) { return xmlrpcService.removePage(parentPage, title); } @Override public CompletableFuture<Model.Page> createPage(Model.Page parentPage, String title) { return xmlrpcService.createPage(parentPage, title); } @Override public CompletableFuture<Model.Attachment> addAttachment(Model.Page page, Model.Attachment attachment, InputStream source) { return xmlrpcService.addAttachment(page, attachment, source); } @Override public CompletableFuture<Model.Page> storePage(Model.Page page) { return xmlrpcService.storePage(page); } @Override public CompletableFuture<Model.Page> storePage(Model.Page page, Storage content) { if( Storage.Representation.STORAGE == content.rapresentation ) { if( page.getId()==null ) { final JsonObjectBuilder inputData = restService.jsonForCreatingPage(page.getSpace(), Integer.valueOf(page.getParentId()), page.getTitle()); restService.jsonAddBody(inputData, content); return CompletableFuture.supplyAsync( () -> restService.createPage(inputData.build()).map(Page::new).get() ); } return restService.storePage(page, content); } return xmlrpcService.storePage(page, content); } @Override public boolean addLabelByName(String label, long id) throws Exception { return xmlrpcService.addLabelByName(label, id); } @Override public Model.Attachment createAttachment() { return xmlrpcService.createAttachment(); } @Override public CompletableFuture<Optional<Model.Attachment>> getAttachment(String pageId, String name, String version) { return xmlrpcService.getAttachment(pageId, name, version); } @Override public CompletableFuture<Optional<Model.Page>> getPage(String spaceKey, String pageTitle) { return xmlrpcService.getPage(spaceKey, pageTitle); } @Override public CompletableFuture<Optional<Model.Page>> getPage(String pageId) { return xmlrpcService.getPage(pageId); } @Override public String toString() { return xmlrpcService.toString(); } @Override public List<Model.PageSummary> getDescendents(String pageId) throws Exception { return xmlrpcService.getDescendents(pageId); } @Override public void removePage(String pageId) throws Exception { xmlrpcService.removePage(pageId); } @Override public void exportPage(String url, String spaceKey, String pageTitle, ExportFormat exfmt, File outputFile) throws Exception { xmlrpcService.exportPage(url, spaceKey, pageTitle, exfmt, outputFile); } /* (non-Javadoc) * @see java.io.Closeable#close() */ @Override public void close() throws IOException { xmlrpcService.logout(); } } /** * return XMLRPC based Confluence services * * @param endpoint * @param credentials * @param proxyInfo * @param sslInfo * @return XMLRPC based Confluence services * @throws Exception */ public static ConfluenceService createInstance( String endpoint, Credentials credentials, ConfluenceProxy proxyInfo, SSLCertificateInfo sslInfo) throws Exception { if( ConfluenceService.Protocol.XMLRPC.match(endpoint)) { return new MixedConfluenceService(endpoint, credentials, proxyInfo, sslInfo); } if( ConfluenceService.Protocol.REST.match(endpoint)) { return new RESTConfluenceServiceImpl(endpoint, credentials /*, proxyInfo*/, sslInfo); } throw new IllegalArgumentException( format("endpoint doesn't contain a valid API protocol\nIt must be '%s' or '%s'", ConfluenceService.Protocol.XMLRPC.path(), ConfluenceService.Protocol.REST.path()) ); } }
107bfb78abb4ef90a07ae6c4ce43d9d4c6f429e7
49104ac40fc4b9839a076a28462e6130b3de00c3
/src/main/java/pages/ElementsPage.java
c6bd60f8c2f69eb56163e1c826eb12efe5d963f3
[]
no_license
sholm73/demoqa
b6195bf50f61d290031fe06d67f2d79e7c39ec03
9cafeed28e1d8072bb9c1f111e429534b1eb9cbd
refs/heads/master
2023-07-18T04:51:38.195980
2021-09-06T22:07:12
2021-09-06T22:07:12
401,426,697
0
0
null
2021-09-06T22:07:13
2021-08-30T17:18:03
Java
UTF-8
Java
false
false
655
java
package pages; import org.junit.Assert; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; public class ElementsPage extends ParentPage{ public ElementsPage(WebDriver webDriver) { super(webDriver); } public ElementsPage openElementsPage(){ try { webDriver.get(baseURL); webDriver.findElement(By.xpath(".//*/h5[text()='Elements']")).click(); logger.info("Elements Page was opened"); } catch (Exception e){ logger.error("Can`t work with Elements Page"); Assert.fail("Can`t work with Elements Page"); } return this; } }
8437baaae762c098c8c4b5a8650616c8f58669e1
092d184b84865e942ed0d00779faa1deca0252e8
/app/src/main/java/com/example/chatapp/FriendsActivity.java
d34adce7356535f4a218a8441d89fc4bf94c7337
[]
no_license
KaranParwani1116/ChatApp
9f23c8eb43721e8135353b586f9a73be60a18216
df0e05a6e817817798a572bb6b400652e7524073
refs/heads/master
2020-07-16T03:54:17.295125
2019-12-30T14:58:31
2019-12-30T14:58:31
205,713,007
0
1
null
null
null
null
UTF-8
Java
false
false
3,791
java
package com.example.chatapp; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.appcompat.widget.Toolbar; import com.firebase.ui.database.FirebaseRecyclerAdapter; import com.firebase.ui.database.FirebaseRecyclerOptions; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.squareup.picasso.Picasso; import de.hdodenhof.circleimageview.CircleImageView; public class FriendsActivity extends AppCompatActivity { private RecyclerView recyclerView; private DatabaseReference usersref; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_friends); recyclerView=(RecyclerView)findViewById(R.id.find_friends_recyclerlist); recyclerView.setLayoutManager(new LinearLayoutManager(this)); usersref= FirebaseDatabase.getInstance().getReference().child("User"); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setTitle("Find Friends"); } @Override protected void onStart() { super.onStart(); FirebaseRecyclerOptions<Contacts> options= new FirebaseRecyclerOptions.Builder<Contacts>() .setQuery(usersref,Contacts.class) .build(); FirebaseRecyclerAdapter<Contacts,FindFriendViewHolder>adapter=new FirebaseRecyclerAdapter<Contacts, FindFriendViewHolder>(options) { @Override protected void onBindViewHolder(@NonNull FindFriendViewHolder findFriendViewHolder, final int i, @NonNull Contacts contacts) { findFriendViewHolder.username.setText(contacts.getName()); findFriendViewHolder.userstatus.setText(contacts.getStatus()); Picasso.get().load(contacts.getImage()).placeholder(R.drawable.profile_image).fit().into(findFriendViewHolder.userprofilephoto); findFriendViewHolder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String visit_user_id=getRef(i).getKey(); Intent intent=new Intent(FriendsActivity.this,ProfileActivity.class); intent.putExtra("visit_user_id",visit_user_id); startActivity(intent); } }); } @NonNull @Override public FindFriendViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.users_view,parent,false); FindFriendViewHolder viewHolder=new FindFriendViewHolder(view); return viewHolder; } }; recyclerView.setAdapter(adapter); adapter.startListening(); } public static class FindFriendViewHolder extends RecyclerView.ViewHolder{ TextView username,userstatus; CircleImageView userprofilephoto; public FindFriendViewHolder(@NonNull View itemView) { super(itemView); username=(itemView).findViewById(R.id.user_name); userstatus=(itemView).findViewById(R.id.user_status); userprofilephoto=(itemView).findViewById(R.id.users_profile_image); } } }
a9a2ccd15ed3b3167f20163923173f17888d4f33
63488e907632b2ab39edcf8d1ffc6db9658d6794
/src/com/mercury/flows/Flow_Passengers.java
509ad9795f9644a55ce25470a87b3c4d7000a26b
[]
no_license
Irwog19/Demo2
b6cd7f6111651e7ac8a5e2823c5a539fef0f4999
311215b1e49fa8c49aaf69ced83f32fa9901365b
refs/heads/master
2022-11-08T10:19:41.668519
2020-07-03T10:29:04
2020-07-03T10:29:04
276,871,945
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
package com.mercury.flows; import java.io.IOException; import com.mercury.basedriver.Basedriver; import com.mercury.pages.Page_Passengers; public class Flow_Passengers extends Basedriver { Page_Passengers pp = new Page_Passengers(); public void passengers_flow() throws IOException, InterruptedException { pp.passenger1(); pp.passenger2(); } }
28527d3a24fb9cf9f6d524e0bec0508e31464638
f14d53fc595fb264ff99de428c6db3e25609f677
/src/main/java/com/tidi/restaurant/domain/Table.java
6e751ec1adf0a2419c07803c209b1c59d4e306bf
[]
no_license
daniel-1321/restaurant
efbf0c7b10f8d1b7e8a5777d05fc71ff3a0f572d
84144caabebf4feb41f4a6fe066f85ba7911917e
refs/heads/master
2021-07-21T03:07:58.118068
2019-11-04T11:23:26
2019-11-04T11:23:26
219,399,048
0
0
null
2020-10-13T17:11:26
2019-11-04T02:15:20
Java
UTF-8
Java
false
false
963
java
package com.tidi.restaurant.domain; /** * @author HO_TRONG_DAI * @date Oct 30, 2019 * @tag */ public class Table { private int table_id; private String table_name; private String table_type; public Table(int table_id, String table_name, String table_type) { super(); this.table_id = table_id; this.table_name = table_name; this.table_type = table_type; } public Table() { super(); } public int getTable_id() { return table_id; } public void setTable_id(int table_id) { this.table_id = table_id; } public String getTable_name() { return table_name; } public void setTable_name(String table_name) { this.table_name = table_name; } public String getTable_type() { return table_type; } public void setTable_type(String table_type) { this.table_type = table_type; } @Override public String toString() { return "Table [table_id=" + table_id + ", table_name=" + table_name + ", table_type=" + table_type + "]"; } }
72c614ecae4b1338125f9e7dfca7c168d8b0dada
6e8fd46f50e2ba8a59d8cd1fb8830f1dbeb3e02e
/src/com/kant/design/patterns/state/StateToggle.java
e5b6858171c50fcc7c16b9e57216dfdfc8c4e5dd
[ "MIT" ]
permissive
thekant/myCodeRepo
f41bfa1e0901536714517a831e95148507d882a8
41f53a11a07b0e0eaa849fe8119e5c21960e7593
refs/heads/master
2020-05-21T17:54:53.149716
2017-07-05T16:11:58
2017-07-05T16:11:58
65,477,480
3
1
null
null
null
null
UTF-8
Java
false
false
1,392
java
package com.kant.design.patterns.state; /** * * @author shaskant * */ import java.io.*; class Button { // stores context private State current; public Button() { current = OFF.instance(); } public void setCurrent(State s) { current = s; } public void push() { current.push(this); } } // 4. The "wrappee" hierarchy abstract class State { // 5. Default behavior can go in the base class public abstract void push(Button b); } class ON extends State { private static ON inst = new ON(); private ON() { } public static State instance() { return inst; } /** * Current state is ON , so set state to OFF. */ public void push(Button b) { b.setCurrent(OFF.instance()); System.out.println(" turning OFF"); } } class OFF extends State { private static OFF inst = new OFF(); private OFF() { } public static State instance() { return inst; } /** * Current state is OFF , so set state to ON. */ public void push(Button b) { b.setCurrent(ON.instance()); System.out.println(" turning ON"); } } /** * * @author shaskant * */ public class StateToggle { public static void main(String[] args) throws IOException { InputStreamReader is = new InputStreamReader(System.in); int ch; Button btn = new Button(); while (true) { System.out.print("Press 'Enter'"); ch = is.read(); ch = is.read(); btn.push(); } } }
62b7828c21b9adc82379e91395182bda188c817c
4ea1c43893200c86cc9dbaaa311ae052568e84fa
/src/exAula49/Ex01.java
a330302f3d494d14c8474e3660f7f76acf81598b
[]
no_license
uluizeduardo/exerciciosJava
b0a97c1c133fa5d948de972cedf0135b0b519972
c1dcaa122ed1cb24f8bdb9c47cd41fbe28229614
refs/heads/main
2023-06-02T19:11:27.614983
2021-06-21T18:56:02
2021-06-21T18:56:02
373,830,547
0
0
null
null
null
null
UTF-8
Java
false
false
1,082
java
/*Escreva um programa que repita a leitura de uma senha até que ela seja válida. Para cada leitura de senha incorreta informada, escrever a mensagem "Senha Invalida". Quando a senha for informada corretamente deve ser impressa a mensagem "Acesso Permitido" e o algoritmo encerrado. Considere que a senha correta é o valor 2002. Exemplo: Entrada: Saída 2200 Senha Invalida 1020 Senha Invalida 2022 Senha Invalida 2002 Acesso Permitido */ package exAula49; import java.util.Scanner; public class Ex01 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); //Variável double senha; //Entrada de dados System.out.println("Informe a senha: "); senha = scan.nextInt(); //Condicional while (senha != 2002){ System.out.println("Senha inválida "); System.out.println("Informe a senha: "); senha = scan.nextInt(); } System.out.println("Acesso permitido"); } }
0bdd7c7930bab07890f9df815bd9dcf371d61037
0f0e5747898e74e20274ef5fd5b30a981b18b96c
/JPAOneToOne-Bi/src/com/lti/model/Student.java
946ea0ec7ce36939cf9c4b2a8d1283d7d1bc1f5e
[]
no_license
anerishah1997/JPA_Day3
ac6b6b4c7a82dfc686670a5d2f1197281d731a00
61179e0ab6420b62b92b509e9c8fddd8bba0b1d3
refs/heads/master
2020-09-06T15:29:50.077800
2019-11-08T12:51:34
2019-11-08T12:51:34
220,465,775
0
0
null
null
null
null
UTF-8
Java
false
false
2,644
java
package com.lti.model; import java.io.Serializable; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Transient; @Entity @Table(name="student") @SequenceGenerator(name="seq", sequenceName="seq_student", initialValue=1, allocationSize=1) public class Student implements Serializable{ @Id @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="seq") private int studentId; private int rollNumber; private String studentName; private double avgScore; @Transient private String dob; @OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER) // Bidirectional reln (Owner side) as Student's reference is created in Address. // cascadeType indicates when owner enitty is persisted then automatically child entity is persisted //when type is ALL,which do all things(persist,merge,find,remove) in child auto. @JoinColumn(name="addressId") private Address address; public Student(int rollNumber, String studentName, double avgScore) { super(); this.rollNumber = rollNumber; this.studentName = studentName; this.avgScore = avgScore; } public Student() { super(); } public int getStudentId() { return studentId; } public void setStudentId(int studentId) { this.studentId = studentId; } public int getRollNumber() { return rollNumber; } public void setRollNumber(int rollNumber) { this.rollNumber = rollNumber; } public String getStudentName() { return studentName; } public void setStudentName(String studentName) { this.studentName = studentName; } public double getAvgScore() { return avgScore; } public void setAvgScore(double avgScore) { this.avgScore = avgScore; } public String getDob() { return dob; } public void setDob(String dob) { this.dob = dob; } public Address getAddress() { return address; } /*@Override public String toString() { return "Student [studentId=" + studentId + ", rollNumber=" + rollNumber + ", studentName=" + studentName + ", avgScore=" + avgScore + ", dob=" + dob + ", address=" + address + "]"; }*/ public void setAddress(Address address) { this.address = address; } @Override public String toString() { return "Student [studentId=" + studentId + ", rollNumber=" + rollNumber + ", studentName=" + studentName + ", avgScore=" + avgScore + ", dob=" + dob + "]"; } }
c9e34a1b2bf51ec6e3012444d7720cdcce3d5562
f3c21a8d125f72498687f5ff24af0d7dafe74d5b
/09/src/Test3.java
5d7970b88addf69e1a66ff1c1530d39730900a5d
[]
no_license
Saxphone1/Java_BigData
ccbd89ef4f1922144095eb91160034f4faba26b4
fe560d1de3d5a48d46242f799c452fe60d1e72bc
refs/heads/master
2020-05-24T19:24:54.456678
2019-03-31T03:20:27
2019-03-31T03:20:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,165
java
import java.util.*; //import java.util.function.Consumer; public class Test3 { public static void main(String[] args) { Vector<String> v = new Vector<>(); v.add("Tom"); v.add("jack"); v.add("lose"); v.add("lily"); // iterator(v); // enumeration(v); foreach1(v); } public static void foreach1(Collection<String> c){ // Consumer<String> cc = (String str)->{ // System.out.println(str); // }; // c.forEach(str-> System.out.println(str)); // c.forEach(System.out::println); } public static void foreach(Collection<String> c){ for(String s:c){ System.out.println(s); } } public static void enumeration(Vector<String> v){ Enumeration<String> e = v.elements(); while (e.hasMoreElements()){ System.out.println(e.nextElement()); } } public static void iterator(Collection<String> c){ Iterator<String> it = c.iterator(); while (it.hasNext()){ System.out.println(it.next()); } } }
0b50677a813c14968fd58751171f88d2e363482c
4e643854a9e29ff706536170e8c4ac626eab8d95
/src/main/java/be/Balor/Manager/Commands/Server/ServerCommand.java
ec403d4b1296cc51eccb42b4bc475a4574793f04
[]
no_license
Belphemur/AdminCmd
4fddbd3b43ac84486b691be8202c521bb4cea81a
8e5c0e3af7c226a510e635aea84d1a0136fefd80
refs/heads/master
2021-01-13T02:06:48.308382
2014-05-30T20:11:17
2014-05-30T20:11:17
1,555,007
5
8
null
2014-05-30T20:09:14
2011-04-01T10:08:40
Java
UTF-8
Java
false
false
1,481
java
/************************************************************************ * This file is part of AdminCmd. * * AdminCmd 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. * * AdminCmd 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 AdminCmd. If not, see <http://www.gnu.org/licenses/>. ************************************************************************/ package be.Balor.Manager.Commands.Server; import be.Balor.Manager.Commands.CoreCommand; /** * @author Balor (aka Antoine Aflalo) * */ public abstract class ServerCommand extends CoreCommand { /** * */ public ServerCommand() { super(); this.permParent = plugin.getPermissionLinker().getPermParent( "admincmd.server.*"); } /** * @param string * @param string2 */ public ServerCommand(final String cmd, final String permNode) { super(cmd, permNode); this.permParent = plugin.getPermissionLinker().getPermParent( "admincmd.server.*"); } }
779c4dc8cf802fa4a3ee5b9d8e07f5c9f6d423ef
7cf147fa4269cc3fb5465ebf351a4d5bd24188e6
/app/src/main/java/com/future_melody/net/request/AddFollowRequest.java
7f5608154a20ae3a98516983bdd57569095fe165
[]
no_license
gyingg/music
1528dc08960e50963ee88dafd2899f15e49d122e
547f819fd42d092d10837ed60c4142f34de49edc
refs/heads/master
2020-04-11T21:33:36.696393
2018-12-17T10:06:41
2018-12-17T10:06:41
162,093,105
0
0
null
null
null
null
UTF-8
Java
false
false
367
java
package com.future_melody.net.request; /** * Created by Y on 2018/5/30. */ public class AddFollowRequest { private String bg_userid;// 被关注人的id private String g_userid;// 关注人的id public AddFollowRequest(String bg_userid, String g_userid) { this.bg_userid = bg_userid; this.g_userid = g_userid; } }
[ "gyingg" ]
gyingg
c088da63d1c577ac13b86427601fed2affacdcca
d1826ed222933423cdab83a8a0f5995a6cf3c12a
/Desarrollo/TP4-Grafos/src/test/TestIndice.java
30281c48d7e008b1f3fb1430a94ee38fda0e72bd
[]
no_license
Grupo-de-4/TP4
055676669ce907d809bbdd8a9fd33497d454612b
5299f999450d87ffc369e93e14a5639813e01a25
refs/heads/master
2021-05-08T01:42:04.839166
2017-11-08T03:11:55
2017-11-08T03:11:55
107,900,213
0
0
null
null
null
null
UTF-8
Java
false
false
1,109
java
package test; import org.junit.Assert; import org.junit.jupiter.api.Test; import matrizSimetrica.MatrizSimetrica; /** * Tests para verificar que la creacion de la matriz simetrica funciona correctamente. * Verificamos que las posiciones en el vector correspondan a la de la matriz. * @author avorraim * */ class TestIndice { private MatrizSimetrica matriz; /** * Testeo de la Matriz Simetrica. Evaluamos que el indice interno del vector sea * el correcto para (0,1) */ @Test public void testIndiceCero() { matriz = new MatrizSimetrica(3); Assert.assertEquals(matriz.getIndice(0, 1), 0); } /** * Testeo de la Matriz Simetrica. Evaluamos que el indice interno del vector sea * el correcto para (0,2) */ @Test public void testIndiceUno() { matriz = new MatrizSimetrica(3); Assert.assertEquals(matriz.getIndice(0, 2), 1); } /** * Testeo de la Matriz Simetrica. Evaluamos que el indice interno del vector sea * el correcto para (1,2) */ @Test public void testIndiceDos() { matriz = new MatrizSimetrica(3); Assert.assertEquals(matriz.getIndice(1, 2), 2); } }
f49acb6a309327a8777e7f7e8e902e13c79090d0
32ec32edfe65f192c0886b1de7825d03b60fadec
/DI-XML-Setter/src/test/java/com/bridgeit/DI_XML_Setter/AppTest.java
44859bba67829d9406d15e1ab952d97be74aba8f
[]
no_license
sunil965/Spring
5470d0356160e0c20285f7ab7f3a617e58b7cbf1
d40d3928578a7d8dcd1d04ac22c718d81d8e45fb
refs/heads/master
2021-01-25T09:21:48.998316
2017-06-23T07:48:45
2017-06-23T07:48:45
93,826,525
0
1
null
null
null
null
UTF-8
Java
false
false
654
java
package com.bridgeit.DI_XML_Setter; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
837adef0db6affc780c4c63fe24c6af8bc427577
358588de52a2ad83dc30418b0b022ba121d060db
/src/main/java/com/victormeng/leetcode/analyze_user_website_visit_pattern/Solution2.java
55ab85948e1b996ab263a609af26dac86383496c
[ "MIT" ]
permissive
victormeng24/LeetCode-Java
c53e852ea47049328397e4896319edd0ce0cf48a
16bc2802e89d5c9d6450d598f0f41a7f6261d7b6
refs/heads/master
2023-08-05T02:33:18.990663
2021-02-04T13:31:48
2021-02-04T13:31:48
327,479,246
0
0
null
null
null
null
UTF-8
Java
false
false
638
java
/** * Leetcode - analyze_user_website_visit_pattern */ package com.victormeng.leetcode.analyze_user_website_visit_pattern; import java.util.*; import com.ciaoshen.leetcode.util.*; /** * log instance is defined in Solution interface * this is how slf4j will work in this class: * ============================================= * if (log.isDebugEnabled()) { * log.debug("a + b = {}", sum); * } * ============================================= */ class Solution2 implements Solution { public List<String> mostVisitedPattern(String[] username, int[] timestamp, String[] website) { return null; } }
6fe0d4e0d78ea809e202e34aab15394adfeef41a
97a6b6cfb01861469e3407b45dd8783ea3c190bf
/src/main/java/com/zs/pms/po/TUser.java
3bf89c6a86d7581902dfc536434689fed4ce2d4c
[]
no_license
lishuai1030/code
8d6edb4851471e21eef99328b729c78073c626c5
10760e1573e23c94a0684d2b1c8dfdb7c2c8a845
refs/heads/master
2020-04-24T01:59:36.835713
2019-02-20T07:34:30
2019-02-20T07:34:30
171,620,589
0
0
null
null
null
null
GB18030
Java
false
false
2,772
java
package com.zs.pms.po; import java.io.Serializable; import java.util.Date; import com.zs.pms.utils.DateUtil; public class TUser implements Serializable{ /** * 序列号 */ private static final long serialVersionUID = 5293214558214995122L; private int id; private String loginname; private String password; private String sex; private Date birthday; private String email; private TDep dept; private String realname; private int creator; private Date creatime; private int updator; private Date updatime; private int isenabled; private String pic; private String isenabledTxt; private String birthdayTxt; public String getIsenabledTxt() { if (isenabled==1) { return "可用"; } else { return "不可用"; } } public void setIsenabledTxt(String isenabledTxt) { this.isenabledTxt = isenabledTxt; } public String getBirthdayTxt() { return DateUtil.getStrDate(); } public void setBirthdayTxt(String birthdayTxt) { this.birthdayTxt = birthdayTxt; } public String getPic() { return pic; } public void setPic(String pic) { this.pic = pic; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getLoginname() { return loginname; } public void setLoginname(String loginname) { this.loginname = loginname; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public TDep getDept() { return dept; } public void setDept(TDep dept) { this.dept = dept; } public String getRealname() { return realname; } public void setRealname(String realname) { this.realname = realname; } public Date getCreatime() { return creatime; } public void setCreatime(Date creatime) { this.creatime = creatime; } public Date getUpdatime() { return updatime; } public void setUpdatime(Date updatime) { this.updatime = updatime; } public int getCreator() { return creator; } public void setCreator(int creator) { this.creator = creator; } public int getUpdator() { return updator; } public void setUpdator(int updator) { this.updator = updator; } public int getIsenabled() { return isenabled; } public void setIsenabled(int isenabled) { this.isenabled = isenabled; } }
0faff26191a371147382c2af6e974f8399f906f2
ac2a4aad618b63bfe563b0a1fabda3e3a6a8436b
/src/test/java/com/example/ozymaxx/redisdemo/configuration/RedisConfigurationTestUtilities.java
c836ac0e1462a8f5e3c0a8c2087c0f3c720c1e0e
[]
no_license
animeshpradhan1/spring-redis-demo
d6708a3115b0bc6fef3f913c4e71d6d8debbe607
ec5066a1fa7a4e6d904ec13787eec3619f4c596d
refs/heads/master
2023-03-22T00:58:03.211682
2020-12-05T14:22:56
2020-12-05T14:22:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
755
java
package com.example.ozymaxx.redisdemo.configuration; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.TestConfiguration; import redis.embedded.RedisServer; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; @TestConfiguration public class RedisConfigurationTestUtilities { private RedisServer redisServer; public RedisConfigurationTestUtilities(@Value("${spring.cache.redis.port}") int redisServerPort) { this.redisServer = new RedisServer(redisServerPort); } @PostConstruct public void launchRedisServer() { this.redisServer.start(); } @PreDestroy public void stopRedisServer() { this.redisServer.stop(); } }
89f3a610e95ddda6ad6f216de984bf2bdc426340
b1beedff0ecfe9d5502381650aa8913fd5b81e92
/src/sample/Controller.java
37fd06646eb13fd44c47e6e0d9d8c4a32292807f
[]
no_license
ShaneMaglangit/PathfindingVisualizer
e6e4ddf956493d4989ad4645e6a252bd68cd7507
b0f74e1389874a0db5ae1910e8de63b9e77ef953
refs/heads/master
2021-05-16T19:55:44.333105
2020-09-02T14:16:12
2020-09-02T14:16:12
250,447,372
1
0
null
null
null
null
UTF-8
Java
false
false
2,138
java
package sample; import java.util.List; public class Controller { public void setStartNode(Visualizer visualizer, List<Integer> next) { if(!visualizer.getPathfindingRun().isRunning() && !visualizer.getEnd().equals(next)) { Node[][] nodes = visualizer.getNodes(); List<Integer> start = visualizer.getStart(); nodes[start.get(0)][start.get(1)].changeState(NodeState.DEFAULT); nodes[next.get(0)][next.get(1)].changeState(NodeState.START); visualizer.setStart(next); } } public void setEndNode(Visualizer visualizer, List<Integer> next) { if(!visualizer.getPathfindingRun().isRunning() && !visualizer.getStart().equals(next)) { Node[][] nodes = visualizer.getNodes(); List<Integer> end = visualizer.getEnd(); nodes[end.get(0)][end.get(1)].changeState(NodeState.DEFAULT); nodes[next.get(0)][next.get(1)].changeState(NodeState.END); visualizer.setEnd(next); } } public void setNodeAsBlocked(Visualizer visualizer, List<Integer> next) { Node node = visualizer.getNodes()[next.get(0)][next.get(1)]; if(!visualizer.getPathfindingRun().isRunning() && node.getState().equals(NodeState.DEFAULT)) { node.changeState(NodeState.BLOCKED); } } public void addWeight(Visualizer visualizer, List<Integer> next) { Node node = visualizer.getNodes()[next.get(0)][next.get(1)]; if(!visualizer.getPathfindingRun().isRunning() && node.getState().equals(NodeState.DEFAULT)) { node.addWeight(1); } } public void visualize(Visualizer visualizer, PathfindingRun pathfindingRun) { if(pathfindingRun.isRunning()) { pathfindingRun.setRunning(false); visualizer.resetNodes(); } else { pathfindingRun.setRunning(true); new Thread(pathfindingRun).start(); } } public void clearBoard(Visualizer visualizer, PathfindingRun pathfindingRun) { pathfindingRun.setRunning(false); visualizer.createNodes(); } }
946fdc8ad77b9cdc066d0d07bd713ab33de1f525
323c723bdbdc9bdf5053dd27a11b1976603609f5
/nssicc/nssicc_service/src/main/java/biz/belcorp/ssicc/service/sisicc/impl/InterfazPRYEnviarInformacionVentaProyeccionParcialCentroServiceImpl.java
528f58e4f3492704fc663770dbd72fa754869f8a
[]
no_license
cbazalar/PROYECTOS_PROPIOS
adb0d579639fb72ec7871334163d3fef00123a1c
3ba232d1f775afd07b13c8246d0a8ac892e93167
refs/heads/master
2021-01-11T03:38:06.084970
2016-10-24T01:33:00
2016-10-24T01:33:00
71,429,267
0
0
null
null
null
null
UTF-8
Java
false
false
3,326
java
package biz.belcorp.ssicc.service.sisicc.impl; import java.util.HashMap; import java.util.Map; import javax.annotation.Resource; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import biz.belcorp.ssicc.dao.Constants; import biz.belcorp.ssicc.dao.sisicc.InterfazPRYDAO; import biz.belcorp.ssicc.service.SapConnectorService; import biz.belcorp.ssicc.service.sisicc.framework.beans.InterfazParams; import biz.belcorp.ssicc.service.sisicc.framework.exception.InterfazException; import biz.belcorp.ssicc.service.sisicc.framework.impl.BaseInterfazSalidaStoredProcedureAbstractService; /** * Service del envio de datos para la Proyeccion Parcial de la Interfaz PRY. * * @author <a href="">Jose Luis Rodriguez</a> */ @Service("sisicc.interfazPRYEnviarInformacionVentaProyeccionParcialCentroService") @Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class) public class InterfazPRYEnviarInformacionVentaProyeccionParcialCentroServiceImpl extends BaseInterfazSalidaStoredProcedureAbstractService { @Resource(name="sisicc.sapConnectorService") private SapConnectorService sapConnectorService; @Resource(name="sisicc.interfazPRYDAO") private InterfazPRYDAO interfazPRYDAO; /* (non-Javadoc) * @see biz.belcorp.ssicc.sisicc.service.framework.BaseInterfazSalidaStoredProcedureAbstractService#executeStoreProcedure(java.util.Map) */ protected void executeStoreProcedure(Map params) { interfazPRYDAO.executeEnvioInformacionVentaProyeccionParcialCentro(params); } /* (non-Javadoc) * @see biz.belcorp.ssicc.sisicc.service.framework.BaseInterfazAbstractService#afterProcessInterfaz(biz.belcorp.ssicc.sisicc.service.framework.beans.InterfazParams) */ protected void afterProcessInterfaz(InterfazParams interfazParams) throws InterfazException { Map result = null; Map inputParams = new HashMap(); Map queryParams = interfazParams.getQueryParams(); String invocarFuncionSAP = MapUtils.getString(queryParams, "invocarFuncionSAP", Constants.NO); String funcionSAP = MapUtils.getString(queryParams, "funcionSAP"); String nombreParametro = MapUtils.getString(queryParams, "nombreParametro"); String valorParametro = MapUtils.getString(queryParams, "valorParametro"); // Validamos si el parametro que determina si se invoca o no a SAP esta activo if (StringUtils.equals(invocarFuncionSAP, Constants.SI)) { if (log.isDebugEnabled()) { log.debug("Invocando a la funcion SAP: " + funcionSAP); log.debug(nombreParametro + "=" + valorParametro); } if(StringUtils.isNotBlank(nombreParametro)) { inputParams.put(nombreParametro, valorParametro); } try { result = sapConnectorService.execute(funcionSAP, inputParams, null); } catch (Exception e) { log.warn(e.getMessage()); throw new InterfazException(e.getMessage()); } if (log.isDebugEnabled()) { log.debug("result SAP=" + result); } } else { log.info("La interfaz esta configurada para NO invocar a la funcion SAP"); } } }
df5dd1722f3a6d67c4dddb8962cb14c1f17913f4
cbda6cccdef64d4734c520746b2769b3b45a0d02
/projects/bathulap/final/URLValidatorIncorrect/DomainValidator.java
0dda288ccab67f875405dd3c4106239b04dcf7bd
[]
no_license
priyankb/CS362-001-SP17
c307398af92ed85b8f9e801e651d9e2834b39408
9341aaa4b8436c5c957d22feeb7a56b4c15b1bac
refs/heads/master
2021-01-19T20:57:51.632920
2017-06-13T04:09:30
2017-06-13T04:09:30
88,584,754
0
0
null
2017-04-18T05:18:52
2017-04-18T05:18:52
null
UTF-8
Java
false
false
15,692
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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 finalprojectB; import java.io.Serializable; import java.util.Arrays; import java.util.List; /** * <p><b>Domain name</b> validation routines.</p> * * <p> * This validator provides methods for validating Internet domain names * and top-level domains. * </p> * * <p>Domain names are evaluated according * to the standards <a href="http://www.ietf.org/rfc/rfc1034.txt">RFC1034</a>, * section 3, and <a href="http://www.ietf.org/rfc/rfc1123.txt">RFC1123</a>, * section 2.1. No accomodation is provided for the specialized needs of * other applications; if the domain name has been URL-encoded, for example, * validation will fail even though the equivalent plaintext version of the * same name would have passed. * </p> * * <p> * Validation is also provided for top-level domains (TLDs) as defined and * maintained by the Internet Assigned Numbers Authority (IANA): * </p> * * <ul> * <li>{@link #isValidInfrastructureTld} - validates infrastructure TLDs * (<code>.arpa</code>, etc.)</li> * <li>{@link #isValidGenericTld} - validates generic TLDs * (<code>.com, .org</code>, etc.)</li> * <li>{@link #isValidCountryCodeTld} - validates country code TLDs * (<code>.us, .uk, .cn</code>, etc.)</li> * </ul> * * <p> * (<b>NOTE</b>: This class does not provide IP address lookup for domain names or * methods to ensure that a given domain name matches a specific IP; see * {@link java.net.InetAddress} for that functionality.) * </p> * * @version $Revision: 1227719 $ $Date: 2012-01-05 09:45:51 -0800 (Thu, 05 Jan 2012) $ * @since Validator 1.4 */ public class DomainValidator implements Serializable { private static final long serialVersionUID = -4407125112880174009L; // Regular expression strings for hostnames (derived from RFC2396 and RFC 1123) private static final String DOMAIN_LABEL_REGEX = "\\p{Alnum}(?>[\\p{Alnum}-]*\\p{Alnum})*"; private static final String TOP_LABEL_REGEX = "\\p{Alpha}{2,}"; //christia : bug introduced by arpit //private static final String TOP_LABEL_REGEX = "\\p{A-Z}{2,}"; private static final String DOMAIN_NAME_REGEX = "^(?:" + DOMAIN_LABEL_REGEX + "\\.)+" + "(" + TOP_LABEL_REGEX + ")$"; private final boolean allowLocal; /** * Singleton instance of this validator, which * doesn't consider local addresses as valid. */ private static final DomainValidator DOMAIN_VALIDATOR = new DomainValidator(false); /** * Singleton instance of this validator, which does * consider local addresses valid. */ private static final DomainValidator DOMAIN_VALIDATOR_WITH_LOCAL = new DomainValidator(true); /** * RegexValidator for matching domains. */ private final RegexValidator domainRegex = new RegexValidator(DOMAIN_NAME_REGEX); /** * RegexValidator for matching the a local hostname */ private final RegexValidator hostnameRegex = new RegexValidator(DOMAIN_LABEL_REGEX); /** * Returns the singleton instance of this validator. It * will not consider local addresses as valid. * @return the singleton instance of this validator */ public static DomainValidator getInstance() { return DOMAIN_VALIDATOR; } /** * Returns the singleton instance of this validator, * with local validation as required. * @param allowLocal Should local addresses be considered valid? * @return the singleton instance of this validator */ public static DomainValidator getInstance(boolean allowLocal) { if(allowLocal) { return DOMAIN_VALIDATOR_WITH_LOCAL; } return DOMAIN_VALIDATOR; } /** Private constructor. */ private DomainValidator(boolean allowLocal) { this.allowLocal = allowLocal; } /** * Returns true if the specified <code>String</code> parses * as a valid domain name with a recognized top-level domain. * The parsing is case-sensitive. * @param domain the parameter to check for domain name syntax * @return true if the parameter is a valid domain name */ public boolean isValid(String domain) { String[] groups = domainRegex.match(domain); if (groups != null && groups.length > 0) { return isValidTld(groups[0]); } else if(allowLocal) { if (!hostnameRegex.isValid(domain)) {//BUGGGG return true; } } return false; } /** * Returns true if the specified <code>String</code> matches any * IANA-defined top-level domain. Leading dots are ignored if present. * The search is case-sensitive. * @param tld the parameter to check for TLD status * @return true if the parameter is a TLD */ public boolean isValidTld(String tld) { if(allowLocal && isValidLocalTld(tld)) { return true; } return isValidInfrastructureTld(tld) || isValidGenericTld(tld) || isValidCountryCodeTld(tld); } /** * Returns true if the specified <code>String</code> matches any * IANA-defined infrastructure top-level domain. Leading dots are * ignored if present. The search is case-sensitive. * @param iTld the parameter to check for infrastructure TLD status * @return true if the parameter is an infrastructure TLD */ public boolean isValidInfrastructureTld(String iTld) { return INFRASTRUCTURE_TLD_LIST.contains(chompLeadingDot(iTld.toLowerCase())); } /** * Returns true if the specified <code>String</code> matches any * IANA-defined generic top-level domain. Leading dots are ignored * if present. The search is case-sensitive. * @param gTld the parameter to check for generic TLD status * @return true if the parameter is a generic TLD */ public boolean isValidGenericTld(String gTld) { return GENERIC_TLD_LIST.contains(chompLeadingDot(gTld.toLowerCase())); } /** * Returns true if the specified <code>String</code> matches any * IANA-defined country code top-level domain. Leading dots are * ignored if present. The search is case-sensitive. * @param ccTld the parameter to check for country code TLD status * @return true if the parameter is a country code TLD */ public boolean isValidCountryCodeTld(String ccTld) { return COUNTRY_CODE_TLD_LIST.contains(chompLeadingDot(ccTld.toLowerCase())); } /** * Returns true if the specified <code>String</code> matches any * widely used "local" domains (localhost or localdomain). Leading dots are * ignored if present. The search is case-sensitive. * @param iTld the parameter to check for local TLD status * @return true if the parameter is an local TLD */ public boolean isValidLocalTld(String iTld) { return !LOCAL_TLD_LIST.contains(chompLeadingDot(iTld.toLowerCase())); } private String chompLeadingDot(String str) { if (str.startsWith(".")) { return str.substring(1); } else { return str; } } // --------------------------------------------- // ----- TLDs defined by IANA // ----- Authoritative and comprehensive list at: // ----- http://data.iana.org/TLD/tlds-alpha-by-domain.txt private static final String[] INFRASTRUCTURE_TLDS = new String[] { "arpa", // internet infrastructure "root" // diagnostic marker for non-truncated root zone }; private static final String[] GENERIC_TLDS = new String[] { "aero", // air transport industry "asia", // Pan-Asia/Asia Pacific "biz", // businesses "cat", // Catalan linguistic/cultural community "com", // commercial enterprises "coop", // cooperative associations "info", // informational sites "jobs", // Human Resource managers "mobi", // mobile products and services "museum", // museums, surprisingly enough "name", // individuals' sites "net", // internet support infrastructure/business "org", // noncommercial organizations "pro", // credentialed professionals and entities "tel", // contact data for businesses and individuals "travel", // entities in the travel industry "gov", // United States Government "edu", // accredited postsecondary US education entities "mil", // United States Military "int" // organizations established by international treaty }; private static final String[] COUNTRY_CODE_TLDS = new String[] { "ac", // Ascension Island "ad", // Andorra "ae", // United Arab Emirates "af", // Afghanistan "ag", // Antigua and Barbuda "ai", // Anguilla "al", // Albania "am", // Armenia "an", // Netherlands Antilles "ao", // Angola "aq", // Antarctica "ar", // Argentina "as", // American Samoa "at", // Austria "au", // Australia (includes Ashmore and Cartier Islands and Coral Sea Islands) "aw", // Aruba "ax", // Åland "az", // Azerbaijan "ba", // Bosnia and Herzegovina "bb", // Barbados "bd", // Bangladesh "be", // Belgium "bf", // Burkina Faso "bg", // Bulgaria "bh", // Bahrain "bi", // Burundi "bj", // Benin "bm", // Bermuda "bn", // Brunei Darussalam "bo", // Bolivia "br", // Brazil "bs", // Bahamas "bt", // Bhutan "bv", // Bouvet Island "bw", // Botswana "by", // Belarus "bz", // Belize "ca", // Canada "cc", // Cocos (Keeling) Islands "cd", // Democratic Republic of the Congo (formerly Zaire) "cf", // Central African Republic "cg", // Republic of the Congo "ch", // Switzerland "ci", // Côte d'Ivoire "ck", // Cook Islands "cl", // Chile "cm", // Cameroon "cn", // China, mainland "co", // Colombia "cr", // Costa Rica "cu", // Cuba "cv", // Cape Verde "cx", // Christmas Island "cy", // Cyprus "cz", // Czech Republic "de", // Germany "dj", // Djibouti "dk", // Denmark "dm", // Dominica "do", // Dominican Republic "dz", // Algeria "ec", // Ecuador "ee", // Estonia "eg", // Egypt "er", // Eritrea "es", // Spain "et", // Ethiopia "eu", // European Union "fi", // Finland "fj", // Fiji "fk", // Falkland Islands "fm", // Federated States of Micronesia "fo", // Faroe Islands "fr", // France "ga", // Gabon "gb", // Great Britain (United Kingdom) "gd", // Grenada "ge", // Georgia "gf", // French Guiana "gg", // Guernsey "gh", // Ghana "gi", // Gibraltar "gl", // Greenland "gm", // The Gambia "gn", // Guinea "gp", // Guadeloupe "gq", // Equatorial Guinea "gr", // Greece "gs", // South Georgia and the South Sandwich Islands "gt", // Guatemala "gu", // Guam "gw", // Guinea-Bissau "gy", // Guyana "hk", // Hong Kong "hm", // Heard Island and McDonald Islands "hn", // Honduras "hr", // Croatia (Hrvatska) "ht", // Haiti "hu", // Hungary "id", // Indonesia "ie", // Ireland (Éire) "il", // Israel "im", // Isle of Man "in", // India "io", // British Indian Ocean Territory "iq", // Iraq "ir", // Iran "is", // Iceland "it", // Italy }; private static final String[] LOCAL_TLDS = new String[] { "localhost", // RFC2606 defined "localdomain" // Also widely used as localhost.localdomain }; private static final List INFRASTRUCTURE_TLD_LIST = Arrays.asList(INFRASTRUCTURE_TLDS); private static final List GENERIC_TLD_LIST = Arrays.asList(GENERIC_TLDS); private static final List COUNTRY_CODE_TLD_LIST = Arrays.asList(COUNTRY_CODE_TLDS); private static final List LOCAL_TLD_LIST = Arrays.asList(LOCAL_TLDS); }
9f4d2dc6eafbc612a733a9a5e8c1cac210bc686e
d4f894bdeeea7caf9daddb2e9930d894ce1b0c6d
/gomall-order/src/main/java/online/icode/gomall/order/service/OrderOperateHistoryService.java
497590e9a2e3b2cfbba2cc47b3cd53a6707d6167
[]
no_license
AnonyStar/gomall
29c3a42310c3526fffadaef393d4897d2b76fd43
036ba0199c80a792adfed0035806e44e44163d0a
refs/heads/master
2023-02-19T04:19:52.118830
2021-01-14T08:21:11
2021-01-14T08:21:11
311,891,565
0
0
null
null
null
null
UTF-8
Java
false
false
516
java
package online.icode.gomall.order.service; import com.baomidou.mybatisplus.extension.service.IService; import online.icode.gomall.common.utils.PageUtils; import online.icode.gomall.order.entity.OrderOperateHistoryEntity; import java.util.Map; /** * 订单操作历史记录 * * @author AnonyStar * @email [email protected] * @date 2020-12-23 14:55:46 */ public interface OrderOperateHistoryService extends IService<OrderOperateHistoryEntity> { PageUtils queryPage(Map<String, Object> params); }
[ "zcx950216" ]
zcx950216
d796b007012cf93008f36e643c6379726f807005
92d229534cf099a97ecfc780105c66fcc305fcf6
/src/main/java/org/agilewiki/incdes/PAInteger.java
959721c34e407ed2854a6931f4436b631a4d7d00
[]
no_license
x-jv/JAOsgi
259598cff4626aacb66d37f231311a4824ec0077
11499f4ec62b4b21a867207e7d8d0a835e41e629
refs/heads/master
2021-01-21T03:02:59.681184
2013-04-18T02:35:10
2013-04-18T02:35:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
285
java
package org.agilewiki.incdes; import org.agilewiki.pactor.Request; public interface PAInteger extends IncDes { Request<Integer> getIntegerReq(); Integer getValue(); Request<Void> setIntegerReq(final Integer _v); void setValue(final Integer _v) throws Exception; }
bde8ec802581340f2c0005d6d9f71e076a03fce1
a4362e54260c3bdb6cc38a3e540377a0b5320b1e
/app/src/main/java/com/arhamtechnolabs/homesalonapp/ui/send/SendViewModel.java
84f1cdd8696874bf194b24f8aff6fad2270132cf
[]
no_license
mobileapp2/HomeSalonApp
b7c8e147e1b080b24ad76bf755a9e9b6aef84dda
c6d329b87848f596468612b01af9584ca5eb7822
refs/heads/master
2022-04-05T16:56:28.028590
2020-02-21T14:43:48
2020-02-21T14:43:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
455
java
package com.arhamtechnolabs.homesalonapp.ui.send; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; public class SendViewModel extends ViewModel { private MutableLiveData<String> mText; public SendViewModel() { mText = new MutableLiveData<>(); mText.setValue("This is send fragment"); } public LiveData<String> getText() { return mText; } }
c57bd89a8e40215ed3ebaa340efbb9cac7a7f030
77d4a51dc57c012ad4c4580cad3083a3150d63e8
/src/main/java/com/ilioadriano/Domain/Presidiario.java
9f4dd9980460add7b052ea354358d0daffb777a2
[]
no_license
iliojunior/code-it-test
bb5f56fa915f7513b6728422fd995f371d8cff38
77f9b6abbe7bc5e284164faa39f41209042b04f1
refs/heads/master
2020-11-24T03:58:51.399666
2019-12-14T02:42:21
2019-12-14T02:42:21
227,955,812
0
0
null
null
null
null
UTF-8
Java
false
false
191
java
package com.ilioadriano.Domain; import com.ilioadriano.Abstract.Tripulante; public class Presidiario extends Tripulante { public Presidiario(String nome) { super(nome); } }
9c4229811aa9bc1cad774739fb656af167f2dc3c
8a6d6852d97ae850c7be542e575ed2a2dc53bb20
/Game.java
31afc81777a222877297d93b7d38eef0894c3310
[]
no_license
APioB/OOP20-StickWars
9e2273482635253c72069620290f6ffd11f1191e
8a90a74e673b3d174072b2002f1633bf817049ee
refs/heads/master
2023-07-11T22:07:51.461702
2021-08-18T11:13:08
2021-08-18T11:13:08
370,710,184
0
0
null
null
null
null
UTF-8
Java
false
false
4,602
java
package model; import java.awt.*; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.image.BufferStrategy; import javax.swing.ImageIcon; import entity.Spawn; public class Game extends Canvas implements Runnable, MouseListener{ // private static final long serialVersionUID = -3269829814542667897L; // final static Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); public static final int WIDTH = (int) screen.getWidth() * 3/4; public static final int HEIGHT = WIDTH * 9 / 16; //rapporto 16:9 private static final String NAME = "StickWars"; private boolean running = false; private Image sfondo; public State gameState = State.StartMenu; private Thread thread; private StartMenu startMenu; private Menu menu; private Spawn spawner; private Handler handler; private HUD hud; private int xMouse, yMouse; private int x = 800; private int y = 50; private int width = 100; private int height = 50; public Game() { this.handler = new Handler(); this.hud = new HUD(); resLoader(); new Window( WIDTH, HEIGHT, NAME, this); this.spawner = new Spawn(handler, this); this.startMenu = new StartMenu(this); this.addMouseListener(startMenu); this.menu = new Menu(this.x, this.y, this.width, this.height); } public void start() { this.thread = new Thread(this); //System.out.println("alt: " + height + " largh: " + width); thread.start(); this.running = true; } public void stop() { try { this.running = false; thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } } public void run() { this.requestFocus(); //don't have to click every time to have access to keyboard inputs long lastLoopTime = System.nanoTime(); double amountOFTicks = 60.0; double ns = 1000000000 / amountOFTicks; long timer = System.currentTimeMillis(); int frames = 0; double delta = 0; while(running){ long now = System.nanoTime(); delta += (now - lastLoopTime) / ns; lastLoopTime = now; while (delta >= 1) { tick(); delta--; } if (running) { render(); } frames++; if (System.currentTimeMillis() - timer > 1000) { timer += 1000; System.out.println("FPS: " + frames); frames = 0; } } System.exit(1); } private void tick() { if(this.gameState == State.Game ) { handler.tick(); spawner.tick(); } } public void render() { BufferStrategy bs = this.getBufferStrategy(); if(bs == null) { this.createBufferStrategy(2); return; } Graphics g = bs.getDrawGraphics(); if(this.gameState == State.StartMenu ) { g.setColor(Color.black); g.fillRect(0, 0, WIDTH, HEIGHT); startMenu.render(g); } else { g.clearRect(0,0, WIDTH, HEIGHT); g.drawImage(this.sfondo, 0, 0, WIDTH, HEIGHT, this); this.handler.render(g); this.hud.render(g); this.menu.render(g); } g.dispose(); bs.show(); } private void resLoader() { this.sfondo = new ImageIcon(this.getClass().getResource("/land.jpg")).getImage(); } public float clamp(float value, float min, float max) { if (value >= max) { return max; } if (value <= min) { return min; }else { return value; } } public State setState(State s) { return this.gameState = s; } public State getState() { return this.gameState; } public static void main(String args[]) { new Game(); } @Override public void mouseClicked(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { this.xMouse = e.getX(); this.yMouse = e.getY(); if(check(xMouse, yMouse, this.x, this.y, this.width, this.height)) { this.gameState = State.Menu; } } private boolean check(int xM, int yM, int x, int y, int width, int height) { if(xM > x && xM < x + width) { if(yM > y && yM < y + height) { return true; } } return false; } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } }
4948212d897918b4f500ab149db6f524fc94175d
24c4df69912e1635206611bdc1d109f7153b109b
/benchmarks/src/main/java/io/cloudevents/bench/kafka/KafkaConsumerMessageToCloudEventBenchmark.java
8c9fd7a6916850f210bb020b8f88ef7a08a0d8d9
[ "Apache-2.0" ]
permissive
cloudevents/sdk-java
2e6085c77ff60d3abeb9ec84252b3d8869522000
a135755ec693ac2ce0b6b0f0e78205f7e4215fe0
refs/heads/main
2023-08-05T05:15:22.522830
2023-07-21T07:19:35
2023-07-21T07:19:35
149,663,208
347
159
Apache-2.0
2023-08-23T23:43:06
2018-09-20T19:56:36
Java
UTF-8
Java
false
false
3,333
java
/* * Copyright 2018-Present The CloudEvents Authors * <p> * 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package io.cloudevents.bench.kafka; import io.cloudevents.jackson.JsonFormat; import io.cloudevents.kafka.KafkaMessageFactory; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.common.record.TimestampType; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.Blackhole; import static io.cloudevents.core.test.Data.V1_WITH_JSON_DATA_WITH_EXT; public class KafkaConsumerMessageToCloudEventBenchmark { @State(Scope.Thread) public static class BinaryMessage { public ConsumerRecord<String, byte[]> message; public BinaryMessage() { // Hack to generate a consumer message ProducerRecord<Void, byte[]> inRecord = KafkaMessageFactory .createWriter("aaa") .writeBinary(V1_WITH_JSON_DATA_WITH_EXT); this.message = new ConsumerRecord<>( "aaa", 0, 0, 0, TimestampType.NO_TIMESTAMP_TYPE, -1L, ConsumerRecord.NULL_SIZE, ConsumerRecord.NULL_SIZE, "aaa", inRecord.value(), inRecord.headers() ); } } @Benchmark @BenchmarkMode(Mode.Throughput) public void testBinaryEncoding(BinaryMessage binaryMessage, Blackhole bh) { bh.consume( KafkaMessageFactory .createReader(binaryMessage.message) .toEvent() ); } @State(Scope.Thread) public static class StructuredJsonMessage { public ConsumerRecord<String, byte[]> message; public StructuredJsonMessage() { // Hack to generate a consumer message ProducerRecord<Void, byte[]> inRecord = KafkaMessageFactory .createWriter("aaa") .writeStructured(V1_WITH_JSON_DATA_WITH_EXT, JsonFormat.CONTENT_TYPE); this.message = new ConsumerRecord<>( "aaa", 0, 0, 0, TimestampType.NO_TIMESTAMP_TYPE, -1L, ConsumerRecord.NULL_SIZE, ConsumerRecord.NULL_SIZE, "aaa", inRecord.value(), inRecord.headers() ); } } @Benchmark @BenchmarkMode(Mode.Throughput) public void testStructuredJsonEncoding(StructuredJsonMessage structuredJsonMessage, Blackhole bh) { bh.consume( KafkaMessageFactory .createReader(structuredJsonMessage.message) .toEvent() ); } }
c42801118d62f634473aceb616c287925b6f35c6
ea6fb26b1f99762edeb51c86dde7a853c9b66f17
/src/main/java/driver/Driver.java
2df0989399f53aaf63c52adcdcfc79e69d4504c7
[]
no_license
nurdan-turan/ImageCount
e98443f7603c537f4cd0be3b7a816e4dba228468
f971900a9dcb87b31a99c059c7873d0755b79718
refs/heads/master
2023-07-18T23:28:34.676436
2021-09-17T19:39:19
2021-09-17T19:39:19
382,595,885
1
0
null
null
null
null
UTF-8
Java
false
false
806
java
package driver; import com.thoughtworks.gauge.AfterSuite; import com.thoughtworks.gauge.BeforeSuite; import org.openqa.selenium.WebDriver; //import org.testng.annotations.AfterSuite; //import org.testng.annotations.BeforeSuite; public class Driver { // Holds the WebDriver instance public static WebDriver webDriver; // Initialize a webDriver instance of required browser // Since this does not have a significance in the application's business domain, the BeforeSuite hook is used to instantiate the webDriver @BeforeSuite public void initializeDriver(){ webDriver = DriverFactory.getDriver(); webDriver.manage().window().maximize(); } // Close the webDriver instance @AfterSuite public void closeDriver(){ webDriver.quit(); } }
c32d267ff2b41228f94d9341eaed6b969454820d
7596caa6006b6fdee3531c7ce16f450771012487
/src/test/java/services/BroadcastAdminServiceTest.java
f76d48e6fc3cba3fbf419aab5c75aebea5991784
[]
no_license
DaviidGilB/dp2-fourth-project
354c077f7c5b71e505e5d325970b8fe68f3514c5
0d23f35c13329c43ef4ba991a0ec295b43e8259d
refs/heads/master
2022-08-09T01:07:00.809266
2019-06-30T14:23:59
2019-06-30T14:23:59
194,524,754
0
0
null
2022-07-07T22:53:26
2019-06-30T14:23:20
Java
UTF-8
Java
false
false
4,821
java
package services; import java.util.Date; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; import utilities.AbstractTest; import domain.Actor; import domain.Message; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:spring/junit.xml" }) @Transactional public class BroadcastAdminServiceTest extends AbstractTest { @Autowired private MessageService messageService; @Autowired private AdminService adminService; @Autowired private ActorService actorService; /** * We are going to test Requirement 24.1 * * 24. An actor who is authenticated as an administrator must be able to: * * 1. Broadcast a message to all actors * */ /** * Coverage: In broadcastMessage, we have the positive case and the Assert to * check that you are logged as admin The Message constrains are checked in * SendMessageTest Positive tes + Constratins = 2 Total test = 3 Coverage = 3/2 * = 1.5 = 150% */ /** * Sentence Coverage: * AdminService: 14.4% * */ @Test public void driverUpdateMessage() { Object testingData[][] = { { // Positive test "admin1", "admin1", "subject", "body", null }, { // Negative test, broadcasting with a non admin actor "member1", "member1", "subject", "body", IllegalArgumentException.class }, { // Negative test, not logged actor "", "member1", "subject", "body", IllegalArgumentException.class } }; for (int i = 0; i < testingData.length; i++) this.templateSendMessage((String) testingData[i][0], (String) testingData[i][1], (String) testingData[i][2], (String) testingData[i][3], (Class<?>) testingData[i][4]); } protected void templateSendMessage(String username, String usernameVerification, String subject, String body, Class<?> expected) { Class<?> caught = null; try { // En cada iteracion comenzamos una transaccion, de esta manera, no se toman // valores residuales de otros test this.startTransaction(); super.authenticate(username); Date thisMoment = new Date(); thisMoment.setTime(thisMoment.getTime() - 1000); Message message = this.messageService.create(); Actor sender = this.actorService.getActorByUsername(usernameVerification); Actor receiverActor = this.actorService.getActorByUsername(usernameVerification); message.setMoment(thisMoment); message.setSubject(subject); message.setBody(body); message.setReceiver(receiverActor.getUserAccount().getUsername()); message.setSender(sender.getUserAccount().getUsername()); this.adminService.broadcastMessage(message); this.messageService.flush(); super.authenticate(null); } catch (Throwable oops) { caught = oops.getClass(); } finally { // Se fuerza el rollback para que no de ningun problema la siguiente iteracion this.rollbackTransaction(); } super.checkExceptions(expected, caught); } /** * We are going to test Requirement 4.1 * * 4.An actor who is authenticated as an administrator must be able to: * 1.Run a procedure to notify the existing users of the rebranding. The system must guarantee that the process is run only once. * */ /** * Coverage: BroadcastRebrandingTest Positive test + Constraints = 2 Total test = 2 Coverage = 2/2 = 100% * Data coverage: 92.9% */ @Test public void driverBroadcastRebranding() { Object testingData[][] = { // Positive test { "admin1", null }, // Negative test: Trying to send a broadcast rebranding with a different role { "company1", IllegalArgumentException.class } }; for (int i = 0; i < testingData.length; i++) this.templateBroadcastRebranding((String) testingData[i][0], (Class<?>) testingData[i][1]); } private void templateBroadcastRebranding(String username, Class<?> expected) { Class<?> caught = null; try { this.startTransaction(); this.authenticate(username); Message message = this.messageService.create(); message.setBody( "We inform that we changed our name from 'Acme-Hacker-Rank' to 'Acme-Rookie' for legal reasons/ Se informa que nuestra empresa ha pasado de llamarse 'Acme-Hacker-Rank' a 'Acme-Rookie' por temas legales."); message.setSubject("REBRANDING NOTIFICATION / NOTIFICACION DE CAMBIO DE NOMBRE"); message.setTags("NOTIFICATION, SYSTEM, IMPORTANT"); this.adminService.broadcastMessageRebranding(message); } catch (Throwable oops) { caught = oops.getClass(); } super.checkExceptions(expected, caught); this.unauthenticate(); this.rollbackTransaction(); } }
26a1a51ca0191d4216663a31d0a1326e16dc90eb
3f7149eb1efdbeba1f6ae3665a66cbef06411442
/vbox-app/src/com/kedzie/vbox/app/AccordianPageTransformer.java
c43e2fb275896c9689dbb0830967bf0d086bd8d1
[]
no_license
zeroyou/VBoxManager
7aa96915c85102c94e06a99b065d65475fbce7cf
a291b442f6de9ea1f8b8e14f75fbbee3fe96729f
refs/heads/master
2020-04-16T10:43:43.398965
2013-07-19T16:02:56
2013-07-19T16:02:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
638
java
package com.kedzie.vbox.app; import com.nineoldandroids.view.ViewHelper; import android.support.v4.view.ViewPager.PageTransformer; import android.view.View; /** * Performs an accordian animation. */ public class AccordianPageTransformer implements PageTransformer { @Override public void transformPage(View view, float position) { ViewHelper.setTranslationX(view, -1*view.getWidth()*position); if(position < 0) ViewHelper.setPivotX(view, 0f); else if(position > 0) ViewHelper.setPivotX(view, view.getWidth()); ViewHelper.setScaleX(view, 1-Math.abs(position)); } }
e49b7b1998169115884b21fb84568ceb253f33b6
f8e7cd7d5367bf6fd34985bbb387315783d744b2
/src/test/java/org/jusecase/poe/gateways/ResourceItemGatewayTest.java
b72f9b2879eb2aa32a35562e1c1c4319d65a127b
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
iCodeIN/poe-stash-buddy
eb6a263e8468ae840d9dea6f319e74824fcd67ec
a2ecc1dc773afbd37f1bbd723857ed2b83ba0910
refs/heads/master
2023-03-11T16:10:38.511421
2021-02-19T00:28:09
2021-02-19T00:28:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,595
java
package org.jusecase.poe.gateways; import org.assertj.core.api.SoftAssertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.jusecase.inject.ComponentTest; import org.jusecase.poe.entities.Item; import org.jusecase.poe.entities.ItemType; import org.jusecase.poe.plugins.ImageHashPlugin; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; class ResourceItemGatewayTest implements ComponentTest { ResourceItemGateway gateway; private ImageHashPlugin imageHashPlugin; @BeforeEach void setUp() { givenDependency(imageHashPlugin = new ImageHashPlugin()); gateway = new ResourceItemGateway(); } @Test void currenciesAreLoadedFromResources() { List<Item> currencies = gateway.getAll(); assertThat(currencies.size()).isEqualTo(55 + 1 + 104 + 2 * 156 + 15); assertThat(currencies.get(0).imageHash.features).isNotEmpty(); assertThat(currencies.get(0).imageHash.colors1).isNotEmpty(); assertThat(currencies.get(0).imageHash.colors2).isNotEmpty(); assertThat(currencies.get(0).type).isEqualTo(ItemType.CURRENCY); assertThat(currencies.get(55).type).isEqualTo(ItemType.CARD); assertThat(currencies.get(55 + 1).type).isEqualTo(ItemType.ESSENCE); assertThat(currencies.get(55 + 1 + 104).type).isEqualTo(ItemType.MAP); assertThat(currencies.get(55 + 1 + 104 + 2 * 156).type).isEqualTo(ItemType.FRAGMENT); } @Test void noItemConflicts() { SoftAssertions s = new SoftAssertions(); List<Item> allItems = gateway.getAll(); for (int i = 0; i < allItems.size(); ++i) { Item item = allItems.get(i); for (int j = i + 1; j < allItems.size(); ++j) { Item otherItem = allItems.get(j); if (item.type != otherItem.type) { String assertDescription = ""; boolean similar = imageHashPlugin.isSimilar(item.imageHash, otherItem.imageHash); if (similar) { assertDescription = "expecting " + item + " not to be similar to item " + otherItem + "\n" + imageHashPlugin.describeDistance(item.imageHash, otherItem.imageHash); } s.assertThat(similar).describedAs(assertDescription).isFalse(); } } } s.assertAll(); } @Test void scrollOfWisdom() { Item scrollOfWisdom = gateway.getScrollOfWisdom(); assertThat(scrollOfWisdom).isNotNull(); } }
1089b4c69647bf9a22e6cca186a072cac7889369
b1438ac3bd20ed76f36efa072b7b69fc6a2d4cb9
/Peak Element.java
0c150a223b91ca6915ca83da82543663a92f8977
[]
no_license
Sumesh-H/Binary-Search-2
13d031825efc22445c979c3c800bbd569aa7ad60
4d5b5bbc0ff675f8aecdfc0fc11ecd67307a6700
refs/heads/master
2022-09-28T19:41:44.261160
2020-05-29T03:12:52
2020-05-29T03:12:52
267,346,489
0
0
null
2020-05-27T14:47:42
2020-05-27T14:47:41
null
UTF-8
Java
false
false
893
java
// Time Complexity : O(log n) where n is the size of the input array // Space Complexity : O(1) // Did this code successfully run on Leetcode : Yes // Any problem you faced while coding this : No // Your code here along with comments explaining your approach // Followed the lecture class Solution { public int findPeakElement(int[] nums) { //edge if(nums == null || nums.length == 0) return -1; int low = 0; int high = nums.length - 1; while (low <= high){ int mid = low + (high - low)/2; if((mid == 0 || nums[mid] > nums [mid-1]) && (mid == nums.length - 1 || nums[mid] > nums [mid +1])){ return mid; } else if (mid > 0 && nums[mid - 1] > nums[mid]){ high = mid - 1; }else { low = mid + 1; } } return -1; } }
ae94f03cf0c6ae0d6a63d5625a9b4b54ffb12902
3317b37d7e3493d3dca87720594ef2d6bfbc1fd5
/src/main/java/com/p6/qa/pages/ResourcesPage.java
4f9c546ba6705e447d29aae91840c0dbb08a1de5
[]
no_license
cvaramcse/P6WebTest
124278e19510e6722561f256185d1426afff51e3
52ddc8ec03638b7effedad2c823850b5425d1896
refs/heads/master
2020-12-19T01:50:04.161386
2020-01-22T16:45:53
2020-01-22T16:45:53
235,584,741
0
0
null
null
null
null
UTF-8
Java
false
false
107
java
package com.p6.qa.pages; import com.p6.qa.base.TestBase; public class ResourcesPage extends TestBase{ }
3c0d21853b3e49168c2af5fe9cfa5c78d5c20f0a
56d6fa60f900fb52362d4cce950fa81f949b7f9b
/aws-sdk-java/src/main/java/com/amazonaws/services/identitymanagement/model/GetAccountPasswordPolicyRequest.java
942df4c3f6817408f3a6b979784153f41b7d1eee
[ "JSON", "Apache-2.0" ]
permissive
TarantulaTechnology/aws
5f9d3981646e193c89f1c3fa746ec3db30252913
8ce079f5628334f83786c152c76abd03f37281fe
refs/heads/master
2021-01-19T11:14:53.050332
2013-09-15T02:37:02
2013-09-15T02:37:02
12,839,311
1
0
null
null
null
null
UTF-8
Java
false
false
2,342
java
/* * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.identitymanagement.model; import com.amazonaws.AmazonWebServiceRequest; import java.io.Serializable; /** * Container for the parameters to the {@link com.amazonaws.services.identitymanagement.AmazonIdentityManagement#getAccountPasswordPolicy(GetAccountPasswordPolicyRequest) GetAccountPasswordPolicy operation}. * <p> * Retrieves the password policy for the AWS account. For more information about using a password policy, go to <a * href="http://docs.amazonwebservices.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html"> Managing an IAM Password Policy </a> . * </p> * * @see com.amazonaws.services.identitymanagement.AmazonIdentityManagement#getAccountPasswordPolicy(GetAccountPasswordPolicyRequest) */ public class GetAccountPasswordPolicyRequest extends AmazonWebServiceRequest implements Serializable { /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetAccountPasswordPolicyRequest == false) return false; GetAccountPasswordPolicyRequest other = (GetAccountPasswordPolicyRequest)obj; return true; } }
edb5e34ab2d195fbd0695b8472b00e251a6af813
32ca19ca241bb75292abf08f0b935c26fe07d9c4
/src/main/java/spring/spring_web_service/web/dto/PostsSaveRequestDto.java
015596f04bec58500664027f38742ce70b59ccfc
[]
no_license
JMine97/spring_web_service
dc0bcb100303ac13c82430759a0dd3290c5edc76
f281cb0ddb0a76632a8b75f296f0e4bac62543d4
refs/heads/master
2023-04-27T17:16:23.393239
2021-04-30T10:13:55
2021-04-30T10:13:55
347,047,114
0
0
null
null
null
null
UTF-8
Java
false
false
691
java
package spring.spring_web_service.web.dto; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import spring.spring_web_service.domain.posts.Posts; @Getter @NoArgsConstructor public class PostsSaveRequestDto { private String title; private String content; private String author; @Builder public PostsSaveRequestDto(String title, String content, String author){ this.title=title; this.content=content; this.author=author; } public Posts toEntity(){ return Posts.builder() .title(title) .content(content) .author(author) .build(); } }
3985319dc421c0773980fc3bbbec77fc66d970ae
29f78bfb928fb6f191b08624ac81b54878b80ded
/SPGenerator/lib/ca.uwaterloo.gp_.fmp_0.7.0/src/ca/uwaterloo/gp/fmp/system/NodeIdDictionary.java
1fc8a8ee5faad131247d0effebf12bcc0ed54347
[]
no_license
MSPL4SOA/MSPL4SOA-tool
8a78e73b4ac7123cf1815796a70f26784866f272
9f3419e416c600cba13968390ee89110446d80fb
refs/heads/master
2020-04-17T17:30:27.410359
2018-07-27T14:18:55
2018-07-27T14:18:55
66,304,158
0
1
null
null
null
null
UTF-8
Java
false
false
6,934
java
/************************************************************************************** * Copyright (c) 2005, 2006 Generative Software Development Lab, University of Waterloo * 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 * * Contributors: * 1. Generative Software Development Lab, University of Waterloo, * http://gp.uwaterloo.ca - initial API and implementation **************************************************************************************/ package ca.uwaterloo.gp.fmp.system; import java.util.Dictionary; import java.util.Hashtable; import java.util.Iterator; import ca.uwaterloo.gp.fmp.Feature; import ca.uwaterloo.gp.fmp.Node; /** * Michal: NodeIdDictionary is always recreated when FmpEditor loads the model (regardless if the model * was just created by new model wizard or is an existing model). * * Keeping the model and the NodeIdDictionary synchronized: * 1. create element * compute new id within the context. For feature, from name; for others use reference* and featureGroup* * (with suffixes). Update NodeIdDictionary. * 2. remove element * remove ids of the element, of all its children and of all its configurations from the NodeIdDictionary * 3. move element * a) within the tree of the same root -> do nothing, * b) to other tree -> remove element and than create it in the new location. * 4. clone feature * see. create element * 5. manually change id of element * remove element from dictionary, reinsert with new id. * update id of all 'confs' of element (synchronize change, otherwise rules won't work) * * @author Chang Hwan Peter Kim <[email protected]>, * Michal Antkiewicz <[email protected]> */ public class NodeIdDictionary { public static NodeIdDictionary INSTANCE = new NodeIdDictionary(); // used to append numbers to generate the next id public static final String DELIMITER = "_"; protected long currentId = 0; protected Dictionary dictionary = new Hashtable(); public Dictionary getRootDictionary(Feature rootFeature) { Dictionary rootDictionary = (Dictionary)dictionary.get(rootFeature); if(rootDictionary == null) { rootDictionary = new Hashtable(); dictionary.put(rootFeature, rootDictionary); } return rootDictionary; } public void putRootDictionary(Feature rootFeature, Dictionary rootDictionary) { dictionary.put(rootFeature, rootDictionary); } public Node getNode(Feature rootFeature, String id) { // Get the dictionary associated with the rootFeature (an id belongs to the dictionary of a given root) Dictionary rootFeatureDictionary = getRootDictionary(rootFeature); return (Node)rootFeatureDictionary.get(id); } public void putNode(Feature rootFeature, String id, Node node) { Dictionary rootFeatureDictionary = getRootDictionary(rootFeature); rootFeatureDictionary.put(id, node); } public String getNextAvailableId(String id, Node node) { // Below code doesn't work because _ is not recognized by XPath scanner //StringTokenizer st = new StringTokenizer(id, DELIMITER); //String newId = st.nextToken() + DELIMITER + String.valueOf(currentId++); String newId = null; int indexOfDigit = -1; for(int i = 0; i < id.length(); i++) { if(id.substring(i).matches("\\d{" + String.valueOf(id.length()-i) + "}")) { indexOfDigit = i; break; } } // if integer was found at the end, take it and replace it by adding 1 to it if(indexOfDigit != -1) newId = id.substring(0, indexOfDigit) + String.valueOf(Integer.parseInt(id.substring(indexOfDigit))+1); // otherwise, append a number at the end else newId = id + "0"; return newId; } public void visit(Node node) { visit(null, node); } public void visit(String prefix, Node node) { if (node == null) throw new IllegalArgumentException("NodeIdDictionary.visit(): node must not be null"); Feature rootFeature = ModelNavigation.INSTANCE.navigateToRootFeature(node); // TODO: maybe we should put IDs on features above root features if(rootFeature != null) { Dictionary rootFeatureDictionary = getRootDictionary(rootFeature); // Get an id that can be used in the construction of propositional formula String newId = ModelManipulation.INSTANCE.getValidId((prefix != null? prefix : "") + node.getId()); // there is a node in the dictionary while((Node)rootFeatureDictionary.get(newId) != null) newId = NodeIdDictionary.INSTANCE.getNextAvailableId(newId, node); node.setId(newId); rootFeatureDictionary.put(newId, node); } for(Iterator nodeChildren = node.getChildren().iterator(); nodeChildren.hasNext();) visit(prefix, (Node)nodeChildren.next()); if(node instanceof Feature) { for(Iterator configurationsIterator = ((Feature)node).getConfigurations().iterator(); configurationsIterator.hasNext();) visit(prefix, (Feature)configurationsIterator.next()); } } // /** // * Returns an id generated from a name - removes illegal characters // * @param string // * @return // */ // public String getIdForName(String name) { // String id = ""; // // for(int i = 0; i < name.length(); i++) // { // if(Character.isLetterOrDigit(name.charAt(i))) // id += name.substring(i, i+1); // } // // if(id.length() > 0) // { // // first character cannot be a digit // if(Character.isDigit(id.charAt(0))) // id = "a" + id; // } // else // id = "feature"; // // return id.substring(0,1).toLowerCase() + id.substring(1); // } // /** // * Michal: removes non-alphanumeric characters and // * ensures name doesn't start with a digit // */ // public String getJavaNameForName(String name) { // StringBuffer newName = new StringBuffer(); // // for(int i = 0; i < name.length(); i++) { // char c = name.charAt(i); // if(Character.isLetterOrDigit(c)) // newName.append(c); // else if (Character.isWhitespace(c)) // newName.append('_'); // } // // if(newName.length() > 0) { // // first character cannot be a digit // if(Character.isDigit(newName.charAt(0))) // newName.insert(0, '_'); // } // else // newName.append("feature"); // return newName.toString(); // } /** * Michal: remove existing dictionaries for the root feature and all of its configurations * @param rootFeature */ public void removeDictionaries(Feature rootFeature) { putRootDictionary(rootFeature, new Hashtable()); for (Iterator i = rootFeature.getConfigurations().iterator(); i.hasNext(); ) removeDictionaries((Feature) i.next()); } }
6f5b4e349e5ac0f687ce68d3ba39ceacc87e20eb
a4f182c714397b2097f20498497c9539fa5a527f
/app/src/main/java/com/lzyyd/hsq/transform/BannerTransform.java
fd35c282d0d4833765f8ee8bfd222ef9837a99d5
[]
no_license
lilinkun/lzy
de36d9804603c293ffcb62c64c50afea88679192
80a646a16cf605795940449108fd848c0b0ecd17
refs/heads/master
2023-02-19T06:15:51.089562
2021-01-13T08:52:30
2021-01-13T08:52:30
288,416,310
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package com.lzyyd.hsq.transform; import android.view.View; import com.xw.banner.transformer.ABaseTransformer; /** * Create by liguo on 2020/7/15 * Describe: */ public class BannerTransform extends ABaseTransformer { @Override protected void onTransform(View page, float position) { } @Override protected boolean isPagingEnabled() { return true; } }
80b5584c2414d7af6cab8b83a3750ca9cd107e05
d1adda5fbe3d830d508a31d4701cd1075c82fab7
/task4/src/Task4.java
a5a7dcb12eff356c990f552cdc176b301b12adf8
[]
no_license
Scalpel87/PerformanceLab
b4e24d4a1f943223705f49a99b643be2956e58f9
6597ce46b9692e1c0e6565e32521beae290e28c9
refs/heads/master
2023-07-03T14:07:57.455986
2021-08-12T17:38:11
2021-08-12T17:38:11
394,203,777
0
0
null
null
null
null
UTF-8
Java
false
false
985
java
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; public class Task4 { public static void main(String[] args) throws IOException { if (args.length == 0) args = new String[]{"c://1.txt"}; BufferedReader reader = new BufferedReader(new FileReader(args[0])); ArrayList<Integer> num = new ArrayList<Integer>(); while (reader.ready()){ num.add(Integer.parseInt(reader.readLine()));//Строки файла должны иметь вид: "4" } ArrayList<Integer> count = new ArrayList<Integer>(); for (int i = 0; i < num.size(); i++) { int tempc = 0; for (int j = 0; j < num.size(); j++) { if (i != j) tempc += Math.abs(num.get(i) - num.get(j)); } count.add(tempc); } Collections.sort(count); System.out.println(count.get(0)); } }
6fba9fad70330eb24396cdb052090ca76d85ba8e
8723fbfb119513a1983f4c3e50f870aac59eb374
/src/question49/Study.java
342fc9b676d7b07cdf981b5a2363fbc37ca74759
[]
no_license
engchina/oracle-java-1Z0-808
210484cb8c10533c3414f510f275a7e9464485eb
85d9a78dc6aee59cafa848d2bf446d641a6ecd8a
refs/heads/master
2022-12-05T15:27:10.733108
2020-07-11T01:33:34
2020-07-11T01:33:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
236
java
package question49; public class Study { public static void main(String[] args) { // double discount = 0; int qty = Integer.parseInt(args[0]); // line n1 discount = (qty >= 90) ? 0.5 : (qty > 80) ? 0.2 : 0; } }
5ae42db3f8ef53988605a1b13e3f2f636ab0ac7d
4980c68e46747e1d8d156daaf18390c825d23464
/src/main/java/com/yxz/apps/cms/po/hibernate/Car.java
428284c99744c17dd82d158c70caf64d430d9024
[]
no_license
superproxy/car-maintenance-system
5798eb49b86bddb6589ad8d80805ae7a43053bed
2195b9a7834934d5d989017d421377275374d6f7
refs/heads/master
2021-01-22T02:48:14.592754
2015-09-15T15:09:53
2015-09-15T15:09:53
42,527,112
0
0
null
null
null
null
UTF-8
Java
false
false
3,048
java
package com.yxz.apps.cms.po.hibernate; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import java.sql.Timestamp; /** * Created with IntelliJ IDEA. * User: wmj * Date: 13-8-3 * Time: 下午10:37 * To change this template use File | Settings | File Templates. */ @Entity public class Car { private String carCard; private Integer carOwnerId; private String carType; private Timestamp inputTime; private String carOwnerName; @Column(name = "carCard", nullable = false, insertable = true, updatable = true, length = 10, precision = 0) @Id public String getCarCard() { return carCard; } public void setCarCard(String carCard) { this.carCard = carCard; } @Column(name = "carOwnerId", nullable = true, insertable = true, updatable = true, length = 10, precision = 0) @Basic public Integer getCarOwnerId() { return carOwnerId; } public void setCarOwnerId(Integer carOwnerId) { this.carOwnerId = carOwnerId; } @Column(name = "carType", nullable = true, insertable = true, updatable = true, length = 10, precision = 0) @Basic public String getCarType() { return carType; } public void setCarType(String carType) { this.carType = carType; } @Column(name = "InputTime", nullable = true, insertable = true, updatable = true, length = 19, precision = 0) @Basic public Timestamp getInputTime() { return inputTime; } public void setInputTime(Timestamp inputTime) { this.inputTime = inputTime; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Car car = (Car) o; if (carCard != null ? !carCard.equals(car.carCard) : car.carCard != null) return false; if (carOwnerId != null ? !carOwnerId.equals(car.carOwnerId) : car.carOwnerId != null) return false; if (carType != null ? !carType.equals(car.carType) : car.carType != null) return false; if (inputTime != null ? !inputTime.equals(car.inputTime) : car.inputTime != null) return false; return true; } @Override public int hashCode() { int result = carCard != null ? carCard.hashCode() : 0; result = 31 * result + (carOwnerId != null ? carOwnerId.hashCode() : 0); result = 31 * result + (carType != null ? carType.hashCode() : 0); result = 31 * result + (inputTime != null ? inputTime.hashCode() : 0); return result; } @Column(name = "carOwnerName", nullable = true, insertable = true, updatable = true, length = 255, precision = 0) @Basic public String getCarOwnerName() { return carOwnerName; } public void setCarOwnerName(String carOwnerName) { this.carOwnerName = carOwnerName; } }
16e47ee02f2780afc8322b2134f3fdc63f5ffc68
cfc3cdad47e5de2f525842647f0186c3e6737327
/app/src/main/java/com/ysdc/coffee/exception/WrongEmailException.java
a53441a0d4aced01eafec4b10f2c09bda80c5eda
[]
no_license
djohannot/android-coffee-pf
3cb6c3da06bb0bdac0b2c2b1306145a19ea875b4
9b3a68c5c3acd9bf9220378beeb4199e328a6719
refs/heads/master
2020-03-29T03:48:13.892140
2018-09-23T11:34:29
2018-09-23T11:34:29
149,501,428
0
0
null
2018-09-23T11:34:30
2018-09-19T19:26:01
Java
UTF-8
Java
false
false
91
java
package com.ysdc.coffee.exception; public class WrongEmailException extends Exception { }
f90e8c25f32dc641292a32bb4c783e7d5de58aec
29b8180c1f07558121ec8c326e8ea45ed8161d26
/1904-april1-java-master/Week1Java/1904Week1Examples/src/com/revature/accessmod2/Driver.java
50fbd1b18fdd0869f8cc7999a56fee842e18db33
[]
no_license
renjika19/shiny-carnival
0711331d5b7e6592469730522310f0908267e160
9e4cec694017b595da5f56d36ee9631609a247fd
refs/heads/master
2023-06-04T03:48:40.184331
2021-06-14T17:58:58
2021-06-14T17:58:58
376,877,606
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
package com.revature.accessmod2; import com.revature.accessmod1.Modifiers; public class Driver extends Modifiers{ public static void main(String[] args) { Modifiers mod = new Modifiers(); System.out.println("==ACCESSING FIELDS==="); System.out.println(mod.pub); System.out.println(Modifiers.stat); // System.out.println(mod.def); //different package, not ok // System.out.println(mod.priv);// different class, not ok Driver driver = new Driver(); System.out.println(driver.pub); System.out.println(driver.prot);// child class, so ok } }
b1fb5ade128559498a55c2fa047eb2a2b0e544f3
d215d8ca2fa3ed88946f59ef935df273069df6a0
/src/gz/itcast/biz/admin/type/dao/TypeDaoImpl.java
788e75e7c5ba545bea3a6be927776e25c6bd27e2
[]
no_license
CodeRabbit-G/bookstore
6d4e281329c5d50853e39e421bc6da1761360ddc
572e6eba397e1d7c95beaeea7da984183aa3aea4
refs/heads/master
2023-03-18T02:50:06.741765
2021-03-11T04:06:05
2021-03-11T04:06:05
346,573,529
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
1,187
java
package gz.itcast.biz.admin.type.dao; import gz.itcast.entity.Types; import gz.itcast.util.BaseDao; import gz.itcast.util.JdbcUtil; import java.sql.SQLException; import java.util.List; import java.util.UUID; import org.apache.commons.dbutils.QueryRunner; import org.apache.commons.dbutils.handlers.BeanListHandler; public class TypeDaoImpl extends BaseDao<Types> implements TypeDao { public List<Types> queryTypes(){ try { String sql = "select * from types"; QueryRunner run = new QueryRunner(JdbcUtil.getDataSource()); List<Types> types = (List<Types>)run.query(sql,new BeanListHandler(Types.class)); return types; } catch (SQLException e) { e.printStackTrace(); throw new RuntimeException(e); } } /** * Ìí¼Ó·ÖÀà */ public Types add(Types types){ try { String sql = "insert into types(id,name,descr) values(?,?,?)"; types.setId(UUID.randomUUID().toString().replace("-", "")); QueryRunner run = new QueryRunner(JdbcUtil.getDataSource()); run.update(sql,new Object[]{types.getId(),types.getName(),types.getDescr()}); return types; } catch (SQLException e) { e.printStackTrace(); throw new RuntimeException(e); } } }
353b7c33aa3b3857bce920f827eb16e77d355800
1d7c0fd46baff3ed4b07aee1290a1edda6f04de9
/app/src/main/java/com/lirunlong/storyofdark/HttpUtils.java
50833d5b2100ad2bb9ede32a82f0bec2d856538d
[]
no_license
redTreeOnWall/storyOfDark
4bde789f03e44371c464a0418ccbb25e093e92e9
e03035884ec79656e952bfb790ab4ae73ae02e0b
refs/heads/master
2022-12-06T15:10:39.423816
2020-08-27T09:39:54
2020-08-27T09:39:54
289,403,640
0
0
null
null
null
null
UTF-8
Java
false
false
2,206
java
package com.lirunlong.storyofdark; import android.os.Build; 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.ProtocolException; import java.net.URL; import java.util.concurrent.CompletableFuture; import androidx.appcompat.view.menu.ShowableListMenu; public class HttpUtils { static void AskHttp(String urlStr,OnHttpFinished finished){ Thread askThreed = new Thread(() ->{ HttpURLConnection connection = null; BufferedReader reader = null; try { URL url = new URL(urlStr); connection = (HttpURLConnection) url.openConnection(); //设置请求方法 connection.setRequestMethod("GET"); //设置连接超时时间(毫秒) connection.setConnectTimeout(5000); //设置读取超时时间(毫秒) connection.setReadTimeout(5000); //返回输入流 InputStream in = connection.getInputStream(); //读取输入流 reader = new BufferedReader(new InputStreamReader(in)); StringBuilder result = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { result.append(line); } // show(result.toString()); finished.onOk(true,result.toString()); } catch (Exception e) { finished.onOk(true,e.toString()); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } if (connection != null) {//关闭连接 connection.disconnect(); } } } ); askThreed.start(); } public interface OnHttpFinished{ void onOk( boolean isSuc,String result); } }
1ef19b20c512a3fbde948f0b4c610c8c95a91f6f
2da3812e8ab5535300a8e0318c65687709132f7e
/day19/src/com/atguigu/java1/URLTest1.java
ee2e7a23f4c8a00bb22a3b23b81eb7af5bb7b2b5
[]
no_license
BMDACMER/javase
307385e2d0541293c96a091fbeb7486ba5c6ad15
3f396cfdc83a93894e27bf622086b865d658f10d
refs/heads/master
2021-01-06T13:59:46.136704
2020-03-16T06:29:39
2020-03-16T06:29:39
241,508,025
4
1
null
null
null
null
UTF-8
Java
false
false
1,557
java
package com.atguigu.java1; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; public class URLTest1 { public static void main(String[] args) { HttpURLConnection urlConnection = null; InputStream is = null; FileOutputStream fos = null; try { URL url = new URL("http://localhost:8080/examples/beauty.jpg"); urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.connect(); is = urlConnection.getInputStream(); fos = new FileOutputStream("day19\\beauty3.jpg"); byte[] buffer = new byte[1024]; int len; while((len = is.read(buffer)) != -1){ fos.write(buffer,0,len); } System.out.println("下载完成"); } catch (IOException e) { e.printStackTrace(); } finally { //关闭资源 if(is != null){ try { is.close(); } catch (IOException e) { e.printStackTrace(); } } if(fos != null){ try { fos.close(); } catch (IOException e) { e.printStackTrace(); } } if(urlConnection != null){ urlConnection.disconnect(); } } } }
6f0ececa0cde80c81f9c93be82ceb51b9a93feed
327debc56fc944b1028a0751f6bd4505d8867b6b
/desktop/src/com/koalio/game/desktop/DesktopLauncher.java
5e9a0c27b9ed2a6a4fc4a0661d8a5a2aefb6fcf7
[]
no_license
mitoo95/Examen-2-Lab
e882fafba32a983ab78016ddafd5f93c332b20cb
64e3f5b1cd30e10f55f3bff4ef6af78602fa6931
refs/heads/master
2021-01-20T10:55:13.300310
2016-04-01T20:48:54
2016-04-01T20:48:54
55,261,351
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package com.koalio.game.desktop; import com.badlogic.gdx.backends.lwjgl.LwjglApplication; import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; import com.koalio.game.MyKoalioGame; public class DesktopLauncher { public static void main (String[] arg) { LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); new LwjglApplication(new MyKoalioGame(), config); } }
[ "Mito Santos" ]
Mito Santos
6c8ac5c7261911a616ec755b57047f882f4185e4
c6d4872031fe7f9d20c6a5c01eb07c92aab3a205
/tests/src/test/java/de/quantummaid/mapmaid/specs/examples/serializedobjects/conflicting/asymetric/array_to_map/ARequest.java
654719d287f682df0c8ce3acd72746963f12ff5e
[ "Apache-2.0" ]
permissive
quantummaid/mapmaid
22cae89fa09c7cab1d1f73e20f2b92718f59bd49
348ed54a2dd46ffb66204ae573f242a01acb73c5
refs/heads/master
2022-12-24T06:56:45.809221
2021-08-03T09:56:58
2021-08-03T09:56:58
228,895,012
5
1
Apache-2.0
2022-12-14T20:53:54
2019-12-18T18:01:43
Java
UTF-8
Java
false
false
1,661
java
/* * Copyright (c) 2020 Richard Hauswald - https://quantummaid.de/. * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 de.quantummaid.mapmaid.specs.examples.serializedobjects.conflicting.asymetric.array_to_map; import de.quantummaid.mapmaid.specs.examples.customprimitives.success.normal.example1.Name; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.RequiredArgsConstructor; import lombok.ToString; import java.util.Map; import static java.util.Arrays.stream; import static java.util.stream.Collectors.toMap; @ToString @EqualsAndHashCode @RequiredArgsConstructor(access = AccessLevel.PRIVATE) public final class ARequest { public final Map<Name, Name> names; public static ARequest aRequest(final Name[] names) { final Map<Name, Name> map = stream(names) .collect(toMap(x -> x, x -> x)); return new ARequest(map); } }
50530c324c3f9de0c93afdcd47a3ad85ca406ed6
6143527a45c18cea6ce3d6070ef8580d45a14486
/app/src/main/java/dark/ash/com/soulmusicplayer/utils/TimeUtils.java
1432bbd06154446e56317275c4c96f4740132bec
[]
no_license
Krrish0/SoulMusic_Player
d64b4fd14211133bb88ab82ce7b112c98bacf041
fe6d6f30eb47740e380accedb9c6c812c98b97c4
refs/heads/master
2020-03-17T19:01:36.707210
2018-05-22T10:49:35
2018-05-22T10:49:35
133,843,328
0
0
null
null
null
null
UTF-8
Java
false
false
402
java
package dark.ash.com.soulmusicplayer.utils; import java.util.concurrent.TimeUnit; /** * Created by hp on 24-03-2018. */ public class TimeUtils { public static String longToTime(long time) { long min = TimeUnit.MILLISECONDS.toMinutes(time); long sec = TimeUnit.MILLISECONDS.toSeconds(time) % 60; String dateString = min + ":" + sec; return dateString; } }
b24bc82e84ba6f2a87f0074bf6425260d381ffe8
80576460f983a1ce5e11348e144257d6a2e12a97
/Integracao/ContaCapitalIntegracaoEJB/src/test/java/br/com/sicoob/sisbr/cca/integracao/negocio/servicos/ejb/CapesIntegracaoServicoEJBTest.java
79148645bf0a4316640ba8f2045065e1072a5c52
[]
no_license
pabllo007/cca
8d3812e403deccdca5ba90745b188e10699ff44c
99c24157ff08459ea3e7c2415ff75bcb6a0102e4
refs/heads/master
2022-12-01T05:20:26.998529
2019-10-27T21:33:11
2019-10-27T21:33:11
217,919,304
0
0
null
2022-11-24T06:24:00
2019-10-27T21:31:25
Java
UTF-8
Java
false
false
45,656
java
/* * */ package br.com.sicoob.sisbr.cca.integracao.negocio.servicos.ejb; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; import br.com.bancoob.excecao.BancoobException; import br.com.sicoob.capes.api.negocio.delegates.AnotacaoPessoaDelegate; import br.com.sicoob.capes.api.negocio.delegates.BemPessoaDelegate; import br.com.sicoob.capes.api.negocio.delegates.ClienteDelegate; import br.com.sicoob.capes.api.negocio.delegates.EnderecoPessoaDelegate; import br.com.sicoob.capes.api.negocio.delegates.FonteRendaPessoaDelegate; import br.com.sicoob.capes.api.negocio.delegates.PessoaDelegate; import br.com.sicoob.capes.api.negocio.delegates.PessoaFisicaDelegate; import br.com.sicoob.capes.api.negocio.delegates.PessoaJuridicaDelegate; import br.com.sicoob.capes.api.negocio.delegates.ReferenciaPessoaDelegate; import br.com.sicoob.capes.api.negocio.delegates.RelacionamentoPessoaDelegate; import br.com.sicoob.capes.api.negocio.delegates.TelefonePessoaDelegate; import br.com.sicoob.capes.api.negocio.vo.AnotacaoPessoaVO; import br.com.sicoob.capes.api.negocio.vo.BemPessoaVO; import br.com.sicoob.capes.api.negocio.vo.ClienteVO; import br.com.sicoob.capes.api.negocio.vo.EnderecoPessoaVO; import br.com.sicoob.capes.api.negocio.vo.FonteRendaPessoaVO; import br.com.sicoob.capes.api.negocio.vo.PessoaFisicaVO; import br.com.sicoob.capes.api.negocio.vo.PessoaJuridicaVO; import br.com.sicoob.capes.api.negocio.vo.PessoaVO; import br.com.sicoob.capes.api.negocio.vo.ReferenciaPessoaVO; import br.com.sicoob.capes.api.negocio.vo.RelacionamentoPessoaVO; import br.com.sicoob.capes.api.negocio.vo.TelefonePessoaVO; import br.com.sicoob.sisbr.cca.integracao.negocio.delegates.CapesIntegracaoDelegate; import br.com.sicoob.sisbr.cca.integracao.negocio.dto.AnotacaoPessoaDTO; import br.com.sicoob.sisbr.cca.integracao.negocio.dto.BemPessoaIntegracaoDTO; import br.com.sicoob.sisbr.cca.integracao.negocio.dto.EnderecoPessoaIntegracaoDTO; import br.com.sicoob.sisbr.cca.integracao.negocio.dto.FonteRendaPessoaIntegracaoDTO; import br.com.sicoob.sisbr.cca.integracao.negocio.dto.PessoaFisicaIntegracaoDTO; import br.com.sicoob.sisbr.cca.integracao.negocio.dto.PessoaIntegracaoDTO; import br.com.sicoob.sisbr.cca.integracao.negocio.dto.PessoaJuridicaIntegracaoDTO; import br.com.sicoob.sisbr.cca.integracao.negocio.dto.ReferenciaPessoaIntegracaoDTO; import br.com.sicoob.sisbr.cca.integracao.negocio.dto.RelacionamentoPessoaIntegracaoDTO; import br.com.sicoob.sisbr.cca.integracao.negocio.dto.TelefonePessoaIntegracaoDTO; import br.com.sicoob.sisbr.cca.integracao.negocio.excecao.IntegracaoCapesNegocioException; import br.com.sicoob.sisbr.localidade.api.filtro.LocApiFabricaFiltro; import br.com.sicoob.sisbr.localidade.api.filtro.LocApiFiltroTipoLogradouro; import br.com.sicoob.sisbr.localidade.api.negocio.delegates.LocApiTipoLogradouroDelegate; public class CapesIntegracaoServicoEJBTest { @Test public void testObterPessoaInstituicao() throws BancoobException { Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); PessoaVO pessoaVO = new PessoaVO(); PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class); EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaVO); ejb.setPessoaDelegate(mockPessoaDelegate); EasyMock.replay(mockPessoaDelegate); PessoaIntegracaoDTO pessoa = ejb.obterPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(pessoa); EasyMock.verify(mockPessoaDelegate); } @Ignore public void testObterPessoaInstituicaoError() throws BancoobException { Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); boolean exception = true; try{ ejb.obterPessoaInstituicao(idPessoa, idInstituicao); Assert.fail("Erro"); }catch(Exception e){ exception = false; Assert.assertEquals(IntegracaoCapesNegocioException.class, e.getClass()); } Assert.assertFalse(exception); } @Test public void testObterPessoaInstituicaoNull() throws BancoobException { Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class); EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(null); ejb.setPessoaDelegate(mockPessoaDelegate); EasyMock.replay(mockPessoaDelegate); PessoaIntegracaoDTO pessoa = ejb.obterPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(pessoa); EasyMock.verify(mockPessoaDelegate); } @Test public void testObterPessoaFisicaInstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); PessoaFisicaVO pessoaFisicaVO = new PessoaFisicaVO(); PessoaFisicaDelegate mockPessoaFisicaDelegate = EasyMock.createMock(PessoaFisicaDelegate.class); EasyMock.expect(mockPessoaFisicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaFisicaVO); ejb.setPessoaFisicaDelegate(mockPessoaFisicaDelegate); EasyMock.replay(mockPessoaFisicaDelegate); PessoaFisicaIntegracaoDTO pessoa = ejb.obterPessoaFisicaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(pessoa); EasyMock.verify(mockPessoaFisicaDelegate); } @Ignore public void testObterPessoaFisicaInstituicaoErro() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); boolean exception = true; try{ ejb.obterPessoaFisicaInstituicao(idPessoa, idInstituicao); Assert.fail("Erro"); }catch(Exception e){ exception = false; Assert.assertEquals(IntegracaoCapesNegocioException.class, e.getClass()); } Assert.assertFalse(exception); } @Test public void testObterPessoaFisicaInstituicaoNull() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); PessoaFisicaDelegate mockPessoaFisicaDelegate = EasyMock.createMock(PessoaFisicaDelegate.class); EasyMock.expect(mockPessoaFisicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(null); ejb.setPessoaFisicaDelegate(mockPessoaFisicaDelegate); EasyMock.replay(mockPessoaFisicaDelegate); PessoaFisicaIntegracaoDTO pessoa = ejb.obterPessoaFisicaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(pessoa); EasyMock.verify(mockPessoaFisicaDelegate); } public void testObterEnderecoPessoaInstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); EnderecoPessoaVO enderecoPessoaVO = new EnderecoPessoaVO(); enderecoPessoaVO.setIdTipoLogradouro(Short.valueOf("1")); List<EnderecoPessoaVO> lstEnderecoVO = new ArrayList(); EnderecoPessoaDelegate mockEnderecoPessoaDelegate = EasyMock.createMock(EnderecoPessoaDelegate.class); EasyMock.expect(mockEnderecoPessoaDelegate.obterEnderecoCorrespondenciaPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(enderecoPessoaVO); EasyMock.expect(mockEnderecoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstEnderecoVO); LocApiFiltroTipoLogradouro filtroLog = new LocApiFabricaFiltro().createLocApiFiltroTipoLogradouro(); filtroLog.setId(enderecoPessoaVO.getIdTipoLogradouro().intValue()); String logradouro = "sad"; LocApiTipoLogradouroDelegate mockLocApiTipoLogradouroDelegate = EasyMock.createMock(LocApiTipoLogradouroDelegate.class); EasyMock.expect(mockLocApiTipoLogradouroDelegate.pesquisarTiposLogradouro(filtroLog).get(0).getDescricao()).andReturn(logradouro); ejb.setEnderecoPessoaDelegate(mockEnderecoPessoaDelegate); ejb.setLocApiTipoLogradouroDelegate(mockLocApiTipoLogradouroDelegate); EasyMock.replay(mockEnderecoPessoaDelegate, mockLocApiTipoLogradouroDelegate); EnderecoPessoaIntegracaoDTO endereco = ejb.obterEnderecoPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(endereco); EasyMock.verify(mockEnderecoPessoaDelegate, mockLocApiTipoLogradouroDelegate); } @Test public void testObterTelefonePessoaInstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList(); TelefonePessoaVO tel1 = new TelefonePessoaVO(); tel1.setTelefone("123"); tel1.setRamal("123"); tel1.setIdTelefone(Long.valueOf("1")); tel1.setIdInstituicao(123); tel1.setDescricaoTipoTelefone("casa"); tel1.setDdd("ddd"); tel1.setDataHoraInicio(new Date()); tel1.setCpfCnpj("cpfCnpj"); tel1.setCodigoTipoTelefone(Short.valueOf("0")); TelefonePessoaVO tel2 = new TelefonePessoaVO(); tel2.setTelefone("123"); tel2.setRamal("123"); tel2.setIdTelefone(Long.valueOf("1")); tel2.setIdInstituicao(123); tel2.setDescricaoTipoTelefone("casa"); tel2.setDdd("ddd"); tel2.setDataHoraInicio(new Date()); tel2.setCpfCnpj("cpfCnpj"); tel2.setCodigoTipoTelefone(Short.valueOf("1")); TelefonePessoaVO tel3 = new TelefonePessoaVO(); lstTelefonePessoaVO.add(tel1); lstTelefonePessoaVO.add(tel2); lstTelefonePessoaVO.add(tel3); TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class); EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO); ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate); EasyMock.replay(mockTelefonePessoaDelegate); TelefonePessoaIntegracaoDTO telefone = ejb.obterTelefonePessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(telefone); EasyMock.verify(mockTelefonePessoaDelegate); } @Test public void testObterTelefonePessoaInstituicao2() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList(); TelefonePessoaVO tel1 = new TelefonePessoaVO(); tel1.setTelefone("123"); tel1.setRamal("123"); tel1.setIdTelefone(Long.valueOf("1")); tel1.setIdInstituicao(123); tel1.setDescricaoTipoTelefone("casa"); tel1.setDdd(null); tel1.setDataHoraInicio(new Date()); tel1.setCpfCnpj("cpfCnpj"); tel1.setCodigoTipoTelefone(Short.valueOf("0")); TelefonePessoaVO tel2 = new TelefonePessoaVO(); tel2.setTelefone(null); tel2.setRamal("123"); tel2.setIdTelefone(Long.valueOf("1")); tel2.setIdInstituicao(123); tel2.setDescricaoTipoTelefone("casa"); tel2.setDdd("ddd"); tel2.setDataHoraInicio(new Date()); tel2.setCpfCnpj("cpfCnpj"); tel2.setCodigoTipoTelefone(Short.valueOf("1")); TelefonePessoaVO tel3 = new TelefonePessoaVO(); lstTelefonePessoaVO.add(tel1); lstTelefonePessoaVO.add(tel2); lstTelefonePessoaVO.add(tel3); TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class); EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO); ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate); EasyMock.replay(mockTelefonePessoaDelegate); TelefonePessoaIntegracaoDTO telefone = ejb.obterTelefonePessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(telefone); EasyMock.verify(mockTelefonePessoaDelegate); } @Test public void testObterTelefonePessoaInstituicao3() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList(); TelefonePessoaVO tel1 = new TelefonePessoaVO(); tel1.setTelefone(null); tel1.setRamal("123"); tel1.setIdTelefone(Long.valueOf("1")); tel1.setIdInstituicao(123); tel1.setDescricaoTipoTelefone("casa"); tel1.setDdd("123"); tel1.setDataHoraInicio(new Date()); tel1.setCpfCnpj("cpfCnpj"); tel1.setCodigoTipoTelefone(Short.valueOf("0")); TelefonePessoaVO tel2 = new TelefonePessoaVO(); tel2.setTelefone(null); tel2.setRamal("123"); tel2.setIdTelefone(Long.valueOf("1")); tel2.setIdInstituicao(123); tel2.setDescricaoTipoTelefone("casa"); tel2.setDdd(null); tel2.setDataHoraInicio(new Date()); tel2.setCpfCnpj("cpfCnpj"); tel2.setCodigoTipoTelefone(Short.valueOf("1")); TelefonePessoaVO tel3 = new TelefonePessoaVO(); lstTelefonePessoaVO.add(tel1); lstTelefonePessoaVO.add(tel2); lstTelefonePessoaVO.add(tel3); TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class); EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO); ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate); EasyMock.replay(mockTelefonePessoaDelegate); TelefonePessoaIntegracaoDTO telefone = ejb.obterTelefonePessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(telefone); EasyMock.verify(mockTelefonePessoaDelegate); } @Test public void testObterTelefonePessoaInstituicaoEmpty() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList(); TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class); EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO); ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate); EasyMock.replay(mockTelefonePessoaDelegate); TelefonePessoaIntegracaoDTO telefone = ejb.obterTelefonePessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(telefone); EasyMock.verify(mockTelefonePessoaDelegate); } @Test public void testObterFonteRendaPessoaInstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<FonteRendaPessoaVO> lstfonteRendaVO = new ArrayList(); FonteRendaPessoaVO fonteRendaPessoaVO = new FonteRendaPessoaVO(); lstfonteRendaVO.add(fonteRendaPessoaVO); FonteRendaPessoaDelegate mockFonteRendaPessoaDelegate = EasyMock.createMock(FonteRendaPessoaDelegate.class); EasyMock.expect(mockFonteRendaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstfonteRendaVO); ejb.setFonteRendaPessoaDelegate(mockFonteRendaPessoaDelegate); EasyMock.replay(mockFonteRendaPessoaDelegate); FonteRendaPessoaIntegracaoDTO fonteRendaPessoaIntegracaoDTO = ejb.obterFonteRendaPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(fonteRendaPessoaIntegracaoDTO); EasyMock.verify(mockFonteRendaPessoaDelegate); } @Test public void testObterFonteRendaPessoaInstituicaoEmpty() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<FonteRendaPessoaVO> lstfonteRendaVO = new ArrayList(); FonteRendaPessoaDelegate mockFonteRendaPessoaDelegate = EasyMock.createMock(FonteRendaPessoaDelegate.class); EasyMock.expect(mockFonteRendaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstfonteRendaVO); ejb.setFonteRendaPessoaDelegate(mockFonteRendaPessoaDelegate); EasyMock.replay(mockFonteRendaPessoaDelegate); FonteRendaPessoaIntegracaoDTO fonteRendaPessoaIntegracaoDTO = ejb.obterFonteRendaPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(fonteRendaPessoaIntegracaoDTO); EasyMock.verify(mockFonteRendaPessoaDelegate); } @Test public void testObterBemPessoaInstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<BemPessoaVO> lstBemPessoaVO = new ArrayList(); BemPessoaVO bemPessoaVO = new BemPessoaVO(); bemPessoaVO.setValorAtualMercado(BigDecimal.TEN); bemPessoaVO.setPercentual(BigDecimal.TEN); lstBemPessoaVO.add(bemPessoaVO); BemPessoaDelegate mockBemPessoaDelegate = EasyMock.createMock(BemPessoaDelegate.class); EasyMock.expect(mockBemPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstBemPessoaVO); ejb.setBemPessoaDelegate(mockBemPessoaDelegate); EasyMock.replay(mockBemPessoaDelegate); BemPessoaIntegracaoDTO bemPessoaIntegracaoDTO = ejb.obterBemPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(bemPessoaIntegracaoDTO); EasyMock.verify(mockBemPessoaDelegate); } @Test public void testObterBemPessoaInstituicao2() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<BemPessoaVO> lstBemPessoaVO = new ArrayList(); BemPessoaVO bemPessoaVO = new BemPessoaVO(); bemPessoaVO.setValorAtualMercado(null); bemPessoaVO.setPercentual(BigDecimal.TEN); lstBemPessoaVO.add(bemPessoaVO); BemPessoaDelegate mockBemPessoaDelegate = EasyMock.createMock(BemPessoaDelegate.class); EasyMock.expect(mockBemPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstBemPessoaVO); ejb.setBemPessoaDelegate(mockBemPessoaDelegate); EasyMock.replay(mockBemPessoaDelegate); BemPessoaIntegracaoDTO bemPessoaIntegracaoDTO = ejb.obterBemPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(bemPessoaIntegracaoDTO); EasyMock.verify(mockBemPessoaDelegate); } @Test public void testObterBemPessoaInstituicao3() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<BemPessoaVO> lstBemPessoaVO = new ArrayList(); BemPessoaVO bemPessoaVO = new BemPessoaVO(); BemPessoaVO bemPessoaVO2 = new BemPessoaVO(); bemPessoaVO.setValorAtualMercado(BigDecimal.TEN); bemPessoaVO.setPercentual(null); lstBemPessoaVO.add(bemPessoaVO); lstBemPessoaVO.add(bemPessoaVO2); BemPessoaDelegate mockBemPessoaDelegate = EasyMock.createMock(BemPessoaDelegate.class); EasyMock.expect(mockBemPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstBemPessoaVO); ejb.setBemPessoaDelegate(mockBemPessoaDelegate); EasyMock.replay(mockBemPessoaDelegate); BemPessoaIntegracaoDTO bemPessoaIntegracaoDTO = ejb.obterBemPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(bemPessoaIntegracaoDTO); EasyMock.verify(mockBemPessoaDelegate); } @Test public void testObterBemPessoaInstituicaoEmpty() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<BemPessoaVO> lstBemPessoaVO = new ArrayList(); BemPessoaDelegate mockBemPessoaDelegate = EasyMock.createMock(BemPessoaDelegate.class); EasyMock.expect(mockBemPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstBemPessoaVO); ejb.setBemPessoaDelegate(mockBemPessoaDelegate); EasyMock.replay(mockBemPessoaDelegate); BemPessoaIntegracaoDTO bemPessoaIntegracaoDTO = ejb.obterBemPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(bemPessoaIntegracaoDTO); EasyMock.verify(mockBemPessoaDelegate); } @Test public void testObterReferenciaPessoaInstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<ReferenciaPessoaVO> lstReferenciaPessoaVO = new ArrayList(); List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList(); ReferenciaPessoaVO referenciaPessoaVO1 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO2 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO3 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO4 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO5 = new ReferenciaPessoaVO(); referenciaPessoaVO1.setDdd(Short.valueOf("61")); referenciaPessoaVO1.setTelefone("3215436"); referenciaPessoaVO2.setCodigoTipoReferencia(Short.valueOf("2")); referenciaPessoaVO3.setDdd(Short.valueOf("61")); referenciaPessoaVO3.setTelefone("3215436"); referenciaPessoaVO4.setCodigoTipoReferencia(Short.valueOf("1")); lstReferenciaPessoaVO.add(referenciaPessoaVO1); lstReferenciaPessoaVO.add(referenciaPessoaVO2); lstReferenciaPessoaVO.add(referenciaPessoaVO3); lstReferenciaPessoaVO.add(referenciaPessoaVO4); lstReferenciaPessoaVO.add(referenciaPessoaVO5); ReferenciaPessoaDelegate mockReferenciaPessoaDelegate = EasyMock.createMock(ReferenciaPessoaDelegate.class); EasyMock.expect(mockReferenciaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstReferenciaPessoaVO); TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class); EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO).anyTimes(); ejb.setReferenciaPessoaDelegate(mockReferenciaPessoaDelegate); ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate); EasyMock.replay(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate); ReferenciaPessoaIntegracaoDTO referenciaPessoa = ejb.obterReferenciaPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(referenciaPessoa); EasyMock.verify(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate); } @Test public void testObterReferenciaPessoaInstituicao2() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<ReferenciaPessoaVO> lstReferenciaPessoaVO = new ArrayList(); List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList(); ReferenciaPessoaVO referenciaPessoaVO1 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO2 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO3 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO4 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO5 = new ReferenciaPessoaVO(); referenciaPessoaVO1.setDdd(Short.valueOf("61")); referenciaPessoaVO2.setCodigoTipoReferencia(Short.valueOf("2")); referenciaPessoaVO3.setDdd(Short.valueOf("61")); referenciaPessoaVO4.setCodigoTipoReferencia(Short.valueOf("4")); lstReferenciaPessoaVO.add(referenciaPessoaVO1); lstReferenciaPessoaVO.add(referenciaPessoaVO2); lstReferenciaPessoaVO.add(referenciaPessoaVO3); lstReferenciaPessoaVO.add(referenciaPessoaVO4); lstReferenciaPessoaVO.add(referenciaPessoaVO5); ReferenciaPessoaDelegate mockReferenciaPessoaDelegate = EasyMock.createMock(ReferenciaPessoaDelegate.class); EasyMock.expect(mockReferenciaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstReferenciaPessoaVO); TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class); EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO).anyTimes(); ejb.setReferenciaPessoaDelegate(mockReferenciaPessoaDelegate); ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate); EasyMock.replay(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate); ReferenciaPessoaIntegracaoDTO referenciaPessoa = ejb.obterReferenciaPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(referenciaPessoa); EasyMock.verify(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate); } @Test public void testObterReferenciaPessoaInstituicao3() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<ReferenciaPessoaVO> lstReferenciaPessoaVO = new ArrayList(); List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList(); ReferenciaPessoaVO referenciaPessoaVO1 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO2 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO3 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO4 = new ReferenciaPessoaVO(); ReferenciaPessoaVO referenciaPessoaVO5 = new ReferenciaPessoaVO(); referenciaPessoaVO1.setDdd(Short.valueOf("61")); referenciaPessoaVO1.setTelefone("3215436"); referenciaPessoaVO2.setCodigoTipoReferencia(Short.valueOf("5")); referenciaPessoaVO3.setDdd(Short.valueOf("61")); referenciaPessoaVO3.setTelefone("3215436"); referenciaPessoaVO4.setCodigoTipoReferencia(Short.valueOf("3")); lstReferenciaPessoaVO.add(referenciaPessoaVO1); lstReferenciaPessoaVO.add(referenciaPessoaVO2); lstReferenciaPessoaVO.add(referenciaPessoaVO3); lstReferenciaPessoaVO.add(referenciaPessoaVO4); lstReferenciaPessoaVO.add(referenciaPessoaVO5); ReferenciaPessoaDelegate mockReferenciaPessoaDelegate = EasyMock.createMock(ReferenciaPessoaDelegate.class); EasyMock.expect(mockReferenciaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstReferenciaPessoaVO); TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class); EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO).anyTimes(); ejb.setReferenciaPessoaDelegate(mockReferenciaPessoaDelegate); ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate); EasyMock.replay(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate); ReferenciaPessoaIntegracaoDTO referenciaPessoa = ejb.obterReferenciaPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(referenciaPessoa); EasyMock.verify(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate); } @Test public void testObterReferenciaPessoaInstituicaoEmpty() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<ReferenciaPessoaVO> referenciaPessoaVO = new ArrayList(); ReferenciaPessoaDelegate mockReferenciaPessoaDelegate = EasyMock.createMock(ReferenciaPessoaDelegate.class); EasyMock.expect(mockReferenciaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(referenciaPessoaVO); ejb.setReferenciaPessoaDelegate(mockReferenciaPessoaDelegate); EasyMock.replay(mockReferenciaPessoaDelegate); ReferenciaPessoaIntegracaoDTO referenciaPessoa = ejb.obterReferenciaPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(referenciaPessoa); EasyMock.verify(mockReferenciaPessoaDelegate); } @Test public void testObterPessoaJuridicaInstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); PessoaJuridicaVO pessoaJuridicaVO = new PessoaJuridicaVO(); PessoaJuridicaDelegate mockPessoaJuridicaDelegate = EasyMock.createMock(PessoaJuridicaDelegate.class); EasyMock.expect(mockPessoaJuridicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaJuridicaVO); ejb.setPessoaJuridicaDelegate(mockPessoaJuridicaDelegate); EasyMock.replay(mockPessoaJuridicaDelegate); PessoaJuridicaIntegracaoDTO pessoaJuridica = ejb.obterPessoaJuridicaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(pessoaJuridica); EasyMock.verify(mockPessoaJuridicaDelegate); } @Test public void testObterPessoaJuridicaInstituicaoEmpty() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); PessoaJuridicaDelegate mockPessoaJuridicaDelegate = EasyMock.createMock(PessoaJuridicaDelegate.class); EasyMock.expect(mockPessoaJuridicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(null); ejb.setPessoaJuridicaDelegate(mockPessoaJuridicaDelegate); EasyMock.replay(mockPessoaJuridicaDelegate); PessoaJuridicaIntegracaoDTO pessoaJuridica = ejb.obterPessoaJuridicaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(pessoaJuridica); EasyMock.verify(mockPessoaJuridicaDelegate); } @Test public void testObterConjugePessoaInstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<RelacionamentoPessoaVO> relConjPessoaVOLst = new ArrayList(); RelacionamentoPessoaVO relacionamentoPessoaVO = new RelacionamentoPessoaVO(); relConjPessoaVOLst.add(relacionamentoPessoaVO); RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class); EasyMock.expect(mockRelacionamentoPessoaDelegate.obterConjugesPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(relConjPessoaVOLst); PessoaVO pessoaVO = new PessoaVO(); PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class); EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaVO).anyTimes(); ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate); ejb.setPessoaDelegate(mockPessoaDelegate); EasyMock.replay(mockRelacionamentoPessoaDelegate, mockPessoaDelegate); List<RelacionamentoPessoaIntegracaoDTO> listRelacionamentos = ejb.obterConjugePessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(listRelacionamentos); EasyMock.verify(mockRelacionamentoPessoaDelegate, mockPessoaDelegate); } @Test public void testObterConjugePessoaInstituicaoEmpty() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<RelacionamentoPessoaVO> relConjPessoaVOLst = new ArrayList(); RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class); EasyMock.expect(mockRelacionamentoPessoaDelegate.obterConjugesPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(relConjPessoaVOLst); ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate); EasyMock.replay(mockRelacionamentoPessoaDelegate); List<RelacionamentoPessoaIntegracaoDTO> listRelacionamentos = ejb.obterConjugePessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(listRelacionamentos); EasyMock.verify(mockRelacionamentoPessoaDelegate); } @Test public void testObterRepresentantesLegaisPessoaInstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<RelacionamentoPessoaVO> relReprPessoaVOLst = new ArrayList(); RelacionamentoPessoaVO relacionamentoPessoaVO1 = new RelacionamentoPessoaVO(); relacionamentoPessoaVO1.setCodigoTipoRelacionamento(Short.valueOf("1")); RelacionamentoPessoaVO relacionamentoPessoaVO2 = new RelacionamentoPessoaVO(); relacionamentoPessoaVO2.setCodigoTipoRelacionamento(Short.valueOf("5")); RelacionamentoPessoaVO relacionamentoPessoaVO3 = new RelacionamentoPessoaVO(); relacionamentoPessoaVO3.setCodigoTipoRelacionamento(Short.valueOf("6")); RelacionamentoPessoaVO relacionamentoPessoaVO4 = new RelacionamentoPessoaVO(); relacionamentoPessoaVO4.setCodigoTipoRelacionamento(Short.valueOf("9")); RelacionamentoPessoaVO relacionamentoPessoaVO5 = new RelacionamentoPessoaVO(); relacionamentoPessoaVO5.setCodigoTipoRelacionamento(Short.valueOf("3")); relReprPessoaVOLst.add(relacionamentoPessoaVO1); relReprPessoaVOLst.add(relacionamentoPessoaVO2); relReprPessoaVOLst.add(relacionamentoPessoaVO3); relReprPessoaVOLst.add(relacionamentoPessoaVO4); relReprPessoaVOLst.add(relacionamentoPessoaVO5); RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class); EasyMock.expect(mockRelacionamentoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(relReprPessoaVOLst); PessoaVO pessoaVO = new PessoaVO(); PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class); EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaVO).anyTimes(); ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate); ejb.setPessoaDelegate(mockPessoaDelegate); EasyMock.replay(mockRelacionamentoPessoaDelegate, mockPessoaDelegate); List<RelacionamentoPessoaIntegracaoDTO> listaRelacionamentos = ejb.obterRepresentantesLegaisPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(listaRelacionamentos); EasyMock.verify(mockRelacionamentoPessoaDelegate, mockPessoaDelegate); } @Test public void testObterRepresentantesLegaisPessoaInstituicaoEmpty() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<RelacionamentoPessoaVO> relReprPessoaVOLst = new ArrayList(); RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class); EasyMock.expect(mockRelacionamentoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(relReprPessoaVOLst); ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate); EasyMock.replay(mockRelacionamentoPessoaDelegate); List<RelacionamentoPessoaIntegracaoDTO> listaRelacionamentos = ejb.obterRepresentantesLegaisPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(listaRelacionamentos); EasyMock.verify(mockRelacionamentoPessoaDelegate); } @Test public void testObterRepresentantesLegaisPessoaInstituicaoNull() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<RelacionamentoPessoaVO> relReprPessoaVOLst = new ArrayList(); RelacionamentoPessoaVO relacionamentoPessoaVO = new RelacionamentoPessoaVO(); relReprPessoaVOLst.add(relacionamentoPessoaVO); RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class); EasyMock.expect(mockRelacionamentoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(relReprPessoaVOLst); PessoaVO pessoaVO = new PessoaVO(); PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class); EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaVO).anyTimes(); ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate); ejb.setPessoaDelegate(mockPessoaDelegate); EasyMock.replay(mockRelacionamentoPessoaDelegate, mockPessoaDelegate); List<RelacionamentoPessoaIntegracaoDTO> listaRelacionamentos = ejb.obterRepresentantesLegaisPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(listaRelacionamentos); EasyMock.verify(mockRelacionamentoPessoaDelegate, mockPessoaDelegate); } @Test public void testObterResponsavelLegalPessoaInstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<RelacionamentoPessoaVO> relReprPessoaVOLst = new ArrayList(); RelacionamentoPessoaVO relacionamentoPessoaVO = new RelacionamentoPessoaVO(); relReprPessoaVOLst.add(relacionamentoPessoaVO); RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class); EasyMock.expect(mockRelacionamentoPessoaDelegate.obterPorPessoaInstituicaoTipo(EasyMock.anyInt(), EasyMock.anyInt(), EasyMock.anyShort())).andReturn(relReprPessoaVOLst); PessoaVO pessoaVO = new PessoaVO(); PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class); EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaVO).anyTimes(); ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate); ejb.setPessoaDelegate(mockPessoaDelegate); EasyMock.replay(mockRelacionamentoPessoaDelegate, mockPessoaDelegate); List<RelacionamentoPessoaIntegracaoDTO> listaRelacionamento = ejb.obterResponsavelLegalPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(listaRelacionamento); EasyMock.verify(mockRelacionamentoPessoaDelegate, mockPessoaDelegate); } @Test public void testObterResponsavelLegalPessoaInstituicaoEmpty() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<RelacionamentoPessoaVO> relReprPessoaVOLst = new ArrayList(); RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class); EasyMock.expect(mockRelacionamentoPessoaDelegate.obterPorPessoaInstituicaoTipo(EasyMock.anyInt(), EasyMock.anyInt(), EasyMock.anyShort())).andReturn(relReprPessoaVOLst); ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate); EasyMock.replay(mockRelacionamentoPessoaDelegate); List<RelacionamentoPessoaIntegracaoDTO> listaRelacionamento = ejb.obterResponsavelLegalPessoaInstituicao(idPessoa, idInstituicao); Assert.assertNotNull(listaRelacionamento); EasyMock.verify(mockRelacionamentoPessoaDelegate); } @Test public void testObterPessoaJuridicaFormaConstituicao() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); PessoaJuridicaVO pessoaJuridicaVO = new PessoaJuridicaVO(); ClienteVO clienteVO = new ClienteVO(); PessoaJuridicaDelegate mockPessoaJuridicaDelegate = EasyMock.createMock(PessoaJuridicaDelegate.class); EasyMock.expect(mockPessoaJuridicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaJuridicaVO); ClienteDelegate mockClienteDelegate = EasyMock.createMock(ClienteDelegate.class); EasyMock.expect(mockClienteDelegate.obterPorIdPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(clienteVO); ejb.setPessoaJuridicaDelegate(mockPessoaJuridicaDelegate); ejb.setClienteDelegate(mockClienteDelegate); EasyMock.replay(mockPessoaJuridicaDelegate, mockClienteDelegate); PessoaIntegracaoDTO pessoa = ejb.obterPessoaJuridicaFormaConstituicao(idPessoa, idInstituicao); Assert.assertNotNull(pessoa); EasyMock.verify(mockPessoaJuridicaDelegate, mockClienteDelegate); } @Test public void testObterPessoaJuridicaFormaConstituicaoNull() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); PessoaJuridicaDelegate mockPessoaJuridicaDelegate = EasyMock.createMock(PessoaJuridicaDelegate.class); EasyMock.expect(mockPessoaJuridicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(null); ClienteDelegate mockClienteDelegate = EasyMock.createMock(ClienteDelegate.class); EasyMock.expect(mockClienteDelegate.obterPorIdPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(null); ejb.setPessoaJuridicaDelegate(mockPessoaJuridicaDelegate); ejb.setClienteDelegate(mockClienteDelegate); EasyMock.replay(mockPessoaJuridicaDelegate, mockClienteDelegate); PessoaIntegracaoDTO pessoa = ejb.obterPessoaJuridicaFormaConstituicao(idPessoa, idInstituicao); Assert.assertNotNull(pessoa); EasyMock.verify(mockPessoaJuridicaDelegate, mockClienteDelegate); } @Test public void testIsPessoaJuridica() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); PessoaIntegracaoDTO pessoa = new PessoaIntegracaoDTO(); CapesIntegracaoDelegate mockCapesIntegracaoDelegate = EasyMock.createMock(CapesIntegracaoDelegate.class); EasyMock.expect(mockCapesIntegracaoDelegate.obterPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoa); ejb.setCapesIntegracaoDelegate(mockCapesIntegracaoDelegate); EasyMock.replay(mockCapesIntegracaoDelegate); Boolean bol = ejb.isPessoaJuridica(idPessoa, idInstituicao); Assert.assertNotNull(bol); EasyMock.verify(mockCapesIntegracaoDelegate); } @Test public void testisClienteCadastrado() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); ClienteVO cli = new ClienteVO(); cli.setIdPessoa(1); cli.setCpfCnpj("123321321"); ClienteDelegate mockClienteDelegate = EasyMock.createMock(ClienteDelegate.class); EasyMock.expect(mockClienteDelegate.obterPorIdPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(cli); ejb.setClienteDelegate(mockClienteDelegate); EasyMock.replay(mockClienteDelegate); Boolean bol = ejb.isClienteCadastrado(idPessoa, idInstituicao); Assert.assertNotNull(bol); EasyMock.verify(mockClienteDelegate); } @Test public void testisClienteCadastradoNull() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); ClienteVO cli = new ClienteVO(); ClienteDelegate mockClienteDelegate = EasyMock.createMock(ClienteDelegate.class); EasyMock.expect(mockClienteDelegate.obterPorIdPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(cli); ejb.setClienteDelegate(mockClienteDelegate); EasyMock.replay(mockClienteDelegate); Boolean bol = ejb.isClienteCadastrado(idPessoa, idInstituicao); Assert.assertNotNull(bol); EasyMock.verify(mockClienteDelegate); } @Test public void testObterAnotacoesBaixadas() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<AnotacaoPessoaVO> lstAnotacaoVO = new ArrayList(); AnotacaoPessoaVO anotacaoPessoaVO = new AnotacaoPessoaVO(); lstAnotacaoVO.add(anotacaoPessoaVO); AnotacaoPessoaDelegate mockAnotacaoPessoaDelegate = EasyMock.createMock(AnotacaoPessoaDelegate.class); EasyMock.expect(mockAnotacaoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt(), EasyMock.anyBoolean())).andReturn(lstAnotacaoVO); ejb.setAnotacaoPessoaDelegate(mockAnotacaoPessoaDelegate); EasyMock.replay(mockAnotacaoPessoaDelegate); List<AnotacaoPessoaDTO> lstAnotacoes = ejb.obterAnotacoesBaixadas(idPessoa, idInstituicao); Assert.assertNotNull(lstAnotacoes); EasyMock.verify(mockAnotacaoPessoaDelegate); } @Test public void testObterAnotacoesBaixadasNull() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<AnotacaoPessoaVO> lstAnotacaoVO = new ArrayList(); AnotacaoPessoaVO anotacaoPessoaVO = new AnotacaoPessoaVO(); AnotacaoPessoaDelegate mockAnotacaoPessoaDelegate = EasyMock.createMock(AnotacaoPessoaDelegate.class); EasyMock.expect(mockAnotacaoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt(), EasyMock.anyBoolean())).andReturn(lstAnotacaoVO); ejb.setAnotacaoPessoaDelegate(mockAnotacaoPessoaDelegate); EasyMock.replay(mockAnotacaoPessoaDelegate); List<AnotacaoPessoaDTO> lstAnotacoes = ejb.obterAnotacoesBaixadas(idPessoa, idInstituicao); Assert.assertNotNull(lstAnotacoes); EasyMock.verify(mockAnotacaoPessoaDelegate); } @Test public void testObterAnotacoesVigentes() throws BancoobException{ Integer idPessoa = 1; Integer idInstituicao = 2; CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB(); List<AnotacaoPessoaVO> lstAnotacaoVO = new ArrayList(); AnotacaoPessoaVO anotacaoPessoaVO = new AnotacaoPessoaVO(); lstAnotacaoVO.add(anotacaoPessoaVO); AnotacaoPessoaDelegate mockAnotacaoPessoaDelegate = EasyMock.createMock(AnotacaoPessoaDelegate.class); EasyMock.expect(mockAnotacaoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt(), EasyMock.anyBoolean())).andReturn(lstAnotacaoVO); ejb.setAnotacaoPessoaDelegate(mockAnotacaoPessoaDelegate); EasyMock.replay(mockAnotacaoPessoaDelegate); List<AnotacaoPessoaDTO> lstAnotacoes = ejb.obterAnotacoesVigentes(idPessoa, idInstituicao); Assert.assertNotNull(lstAnotacoes); EasyMock.verify(mockAnotacaoPessoaDelegate); } }
[ "=" ]
=
ccbe303d715ac316c857d26aa84f34616518f455
7d12d290c3cd8b01740e485f55ce63e3dfa8a8cd
/src/main/java/ru/customs/entity/ClaimEntity.java
9ed3aa39699bdf15930798435e96c4d4a7ae5197
[]
no_license
alexni/customs
3ccc513ebf6fda3d6ae2b812e32863f3891d0572
4a875761930f0bdf73718cdaf24ed0fb267581c1
refs/heads/master
2020-05-16T17:59:49.170119
2019-11-24T14:24:06
2019-11-24T14:24:06
183,211,142
0
0
null
null
null
null
UTF-8
Java
false
false
8,838
java
package ru.customs.entity; import ru.customs.dto.NewClaimRequest; import javax.persistence.*; import java.util.*; @Entity @Table(name = "claims") public class ClaimEntity { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String surname; private String name; private String secondName; private String phone; private String birthdate; private String passportPrefix; private String passportNumber; private String passportDate; private OperationType operationType; private String trackNumber; private String trailerNumber; private String checkPoint; private String payer; private String contractNumber; private String carrier; private String comment; @ElementCollection @CollectionTable(name = "documenta", joinColumns = @JoinColumn(name = "claim_id")) @Column(name = "document") private Set<String> documents = new HashSet<>(); @ElementCollection @CollectionTable(name = "operation_types", joinColumns = @JoinColumn(name = "claim_id")) @Column(name = "operation_type") private Set<OperationType> operationTypes = new HashSet<>(); private ClaimState state; private Long timestamp; private Long managerId; private boolean haveNewMessages; public ClaimEntity() { } public ClaimEntity(Long id, String surname, String name, String secondName, String phone, String birthdate, String passportPrefix, String passportNumber, String passportDate, OperationType operationType, String trackNumber, String trailerNumber, String checkPoint, String payer, String carrier, String comment, Set<String> documents, Set<OperationType> operationTypes, String contractNumber, ClaimState state, Long timestamp, Long managerId, boolean haveNewMessages) { this.id = id; this.surname = surname; this.name = name; this.secondName = secondName; this.phone = phone; this.birthdate = birthdate; this.passportPrefix = passportPrefix; this.passportNumber = passportNumber; this.passportDate = passportDate; this.operationType = operationType; this.trackNumber = trackNumber; this.trailerNumber = trailerNumber; this.checkPoint = checkPoint; this.payer = payer; this.carrier = carrier; this.comment = comment; this.documents = documents; this.state = state; this.timestamp = timestamp; this.managerId = managerId; this.haveNewMessages = haveNewMessages; this.operationTypes = operationTypes; this.contractNumber = contractNumber; } public ClaimEntity(NewClaimRequest other){ this.surname = other.getSurname(); this.name = other.getName(); this.secondName = other.getSecondName(); this.phone = other.getPhone(); this.birthdate = other.getBirthdate(); this.passportDate = other.getPassportDate(); this.passportPrefix = other.getPassportPrefix(); this.passportNumber = other.getPassportNumber(); this.operationType = other.getOperationType(); this.trackNumber = other.getTrackNumber(); this.trailerNumber = other.getTrailerNumber(); this.checkPoint = other.getCheckPoint(); this.payer = other.getPayer(); this.carrier = other.getCarrier(); this.comment = other.getComment(); this.documents = other.getDocuments(); this.state = ClaimState.Start; this.timestamp = new Date().getTime(); this.managerId = 0L; this.haveNewMessages = false; this.operationTypes= other.getOperationTypes(); this.contractNumber = other.getContractNumber(); } public ClaimEntity(String surname, String name, String secondName, String phone, String birthdate, String passportPrefix, String passportNumber, String passportDate, OperationType operationType, String trackNumber, String trailerNumber, String checkPoint, String payer, String carrier, String comment, Set<String> documents, ClaimState state, Long timestamp, Long managerId, boolean haveNewMessages, Set<OperationType> operationTypes, String contractNumber) { this.surname = surname; this.name = name; this.secondName = secondName; this.phone = phone; this.birthdate = birthdate; this.passportPrefix = passportPrefix; this.passportNumber = passportNumber; this.passportDate = passportDate; this.operationType = operationType; this.trackNumber = trackNumber; this.trailerNumber = trailerNumber; this.checkPoint = checkPoint; this.payer = payer; this.carrier = carrier; this.comment = comment; this.documents = documents; this.state = state; this.timestamp = timestamp; this.managerId = managerId; this.haveNewMessages = haveNewMessages; this.operationTypes = operationTypes; this.contractNumber = contractNumber; } public Long getId() { return id; } public String getSurname() { return surname; } public String getName() { return name; } public String getSecondName() { return secondName; } public String getPhone() { return phone; } public String getBirthdate() { return birthdate; } public String getPassportPrefix() { return passportPrefix; } public String getPassportNumber() { return passportNumber; } public String getPassportDate() { return passportDate; } public OperationType getOperationType() { return operationType; } public String getTrackNumber() { return trackNumber; } public String getTrailerNumber() { return trailerNumber; } public String getCheckPoint() { return checkPoint; } public String getPayer() { return payer; } public String getCarrier() { return carrier; } public String getComment() { return comment; } public Set<String> getDocuments() { return documents; } public ClaimState getState() { return state; } public Long getTimestamp() { return timestamp; } public Long getManagerId() { return managerId; } public boolean isHaveNewMessages() { return haveNewMessages; } public void setId(Long id) { this.id = id; } public void setSurname(String surname) { this.surname = surname; } public void setName(String name) { this.name = name; } public void setSecondName(String secondName) { this.secondName = secondName; } public void setPhone(String phone) { this.phone = phone; } public void setBirthdate(String birthdate) { this.birthdate = birthdate; } public void setPassportPrefix(String passportPrefix) { this.passportPrefix = passportPrefix; } public void setPassportNumber(String passportNumber) { this.passportNumber = passportNumber; } public void setPassportDate(String passportDate) { this.passportDate = passportDate; } public void setOperationType(OperationType operationType) { this.operationType = operationType; } public void setTrackNumber(String trackNumber) { this.trackNumber = trackNumber; } public void setTrailerNumber(String trailerNumber) { this.trailerNumber = trailerNumber; } public void setCheckPoint(String checkPoint) { this.checkPoint = checkPoint; } public void setPayer(String payer) { this.payer = payer; } public void setCarrier(String carrier) { this.carrier = carrier; } public void setComment(String comment) { this.comment = comment; } public void setDocuments(Set<String> documents) { this.documents = documents; } public void setState(ClaimState state) { this.state = state; } public void setTimestamp(Long timestamp) { this.timestamp = timestamp; } public void setManagerId(Long managerId) { this.managerId = managerId; } public void setHaveNewMessages(boolean haveNewMessages) { this.haveNewMessages = haveNewMessages; } public String getContractNumber() { return contractNumber; } public void setContractNumber(String contractNumber) { this.contractNumber = contractNumber; } public Set<OperationType> getOperationTypes() { return operationTypes; } public void setOperationTypes(Set<OperationType> operationTypes) { this.operationTypes = operationTypes; } }
8353d1cbd2da4ea2918347c7a05237f1941c720b
61775d5ab720aaba9280f8bd3cc327498c10d96e
/src/com.mentor.nucleus.bp.debug.ui/src/com/mentor/nucleus/bp/debug/ui/BPLineBreakpointAdapter.java
6247df5f81deb69fd92457d9aad320f5066b92e5
[ "Apache-2.0" ]
permissive
NDGuthrie/bposs
bf1cbec3d0bd5373edecfbe87906417b5e14d9f1
2c47abf74a3e6fadb174b08e57aa66a209400606
refs/heads/master
2016-09-05T17:26:54.796391
2014-11-17T15:24:00
2014-11-17T15:24:00
28,010,057
1
0
null
null
null
null
UTF-8
Java
false
false
5,192
java
//======================================================================== // //File: $RCSfile$ //Version: $Revision$ //Modified: $Date$ // //(c) Copyright 2006-2014 by Mentor Graphics Corp. All rights reserved. // //======================================================================== // 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.mentor.nucleus.bp.debug.ui; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.ILineBreakpoint; import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.IWorkbenchPart; import com.mentor.nucleus.bp.debug.ui.model.BPLineBreakpoint; import com.mentor.nucleus.bp.ui.text.activity.ActivityEditor; /** * Adapter to create breakpoints. */ public class BPLineBreakpointAdapter implements IToggleBreakpointsTarget { /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException { ActivityEditor textEditor = getEditor(part); if (textEditor != null) { IResource resource = (IResource) textEditor.getEditorInput().getAdapter(IFile.class); ITextSelection textSelection = (ITextSelection) selection; int lineNumber = textSelection.getStartLine(); IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IBPDebugUIPluginConstants.PLUGIN_ID); for (int i = 0; i < breakpoints.length; i++) { IBreakpoint breakpoint = breakpoints[i]; if (resource.equals(breakpoint.getMarker().getResource())) { if (((ILineBreakpoint)breakpoint).getLineNumber() == (lineNumber + 1)) { // remove breakpoint.delete(); return; } } } // create line breakpoint (doc line numbers start at 0) int validLine = BPLineBreakpoint.getValidLine(resource, lineNumber + 1); if ( validLine != -1 ) { BPLineBreakpoint lineBreakpoint = new BPLineBreakpoint(resource, validLine); DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(lineBreakpoint); } } } /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection) { return getEditor(part) != null; } /** * Returns the editor being used to edit an activity, associated with the * given part, or <code>null</code> if none. * * @param part workbench part * @return the editor being used to edit an activity, associated with the * given part, or <code>null</code> if none */ private ActivityEditor getEditor(IWorkbenchPart part) { if (part instanceof ActivityEditor) { ActivityEditor editorPart = (ActivityEditor) part; IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IFile.class); if (resource != null) { return editorPart; } } return null; } /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public void toggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException { } /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) { return false; } /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException { } /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) { return false; } }
16571361fb43eeaff683128a82ad1178781c9a66
0aa3193e1d679ae856f519abdb6ac243797f6c24
/src/servicio/pacienteServicio.java
623945a18e83ed1f54d3ae421243f767a4590ca0
[]
no_license
AndruTellesR/Covid
4c0f6ab269be42c8d45e0ee4e59fa22c976fc02a
876ba677c8dfa0f29c165dd10e5757d736a41126
refs/heads/master
2022-10-09T21:02:54.151341
2020-06-09T20:08:17
2020-06-09T20:08:17
271,099,030
0
0
null
null
null
null
UTF-8
Java
false
false
861
java
package servicio; import java.sql.*; /** * * @author ANDRU */ public class pacienteServicio { public void guardar(Connection conexion, modelo.persona persona) throws SQLException { try { PreparedStatement consulta; consulta = conexion.prepareStatement("SELECT* FROM * persona"); consulta.setString(1, persona.getNombre()); consulta.setString(2, persona.getDireccion()); consulta.setString(3, persona.getGenero()); consulta.setString(4, persona.getTelefono()); consulta.setDate(5, (Date) persona.getFechaNacimiento()); consulta.setString(6, persona.getDocumento()); consulta.executeUpdate(); } catch (SQLException ex) { throw new SQLDataException(ex); } } }
a754216478f73d1f7a65216094cfad4ada3d9538
7f449f276ba74d8bed143e9c41f3d189677075eb
/Java/src/main/java/queue/QueueImp.java
aa9cb6ea633f4ffb10ee429afe002d17c5a04393
[]
no_license
jsphdnl/Algorithms
1c8821d49a5adb0dbeca69d0af5e434495c7089b
dfc669587fffddb93c566848fdfd2c80280ac6af
refs/heads/master
2020-04-06T07:06:15.770675
2016-08-07T06:37:47
2016-08-07T06:37:47
64,687,718
2
2
null
2016-08-27T12:55:36
2016-08-01T17:32:10
Java
UTF-8
Java
false
false
662
java
package queue; import doublylinkedlist.DoublyLinkedList; /** * Created by mamu on 8/4/16. */ public class QueueImp<T> implements Queue<T> { private DoublyLinkedList<T> queue; private int size; public QueueImp() { queue = new DoublyLinkedList<>(); size = 0; } @Override public int size() { return size; } @Override public T dequeue() { T data = null; if (size != 0){ data = queue.removeAtHead(); size --; } return data; } @Override public void enqueue(T data) { queue.addAtHead(data); size++; } @Override public boolean isEmpty() { return size == 0 ? true : false; } }
e8841ab56377b6de95f0d7c8283c688da4f9852b
28e43d16dee2671aa2b74516bc893dbd43d3494a
/app/src/main/java/com/dabudabu/samsatnotif/adapter/EventAdapter.java
4358c15c4af73ead8e99d938bfd8657e90cf8e7e
[]
no_license
muktiwbowo/SamsatNotif
ed4a4e1582d2f0e798d5453b12f3a233ccc86d7c
304f1b6efffaaf84749d6a66093c582fb07fc4bf
refs/heads/master
2020-03-17T06:28:47.299117
2018-05-14T12:29:18
2018-05-14T12:29:18
133,357,508
0
0
null
null
null
null
UTF-8
Java
false
false
1,879
java
package com.dabudabu.samsatnotif.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.dabudabu.samsatnotif.R; import com.dabudabu.samsatnotif.model.ItemEvent; import java.util.List; public class EventAdapter extends RecyclerView.Adapter<EventAdapter.HolderEvent> { private List<ItemEvent> events; private Context context; public EventAdapter(List<ItemEvent> events, Context context) { this.events = events; this.context = context; } @Override public EventAdapter.HolderEvent onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.list_event, parent, false); return new HolderEvent(view); } @Override public void onBindViewHolder(EventAdapter.HolderEvent holder, int position) { ItemEvent itemEvent = events.get(position); holder.titleEvent.setText(itemEvent.getTitle()); holder.contentEvent.setText(itemEvent.getContent()); Glide.with(context) .load(itemEvent.getImageurl()) .into(holder.imgEvent); } @Override public int getItemCount() { return events.size(); } class HolderEvent extends RecyclerView.ViewHolder{ private TextView titleEvent, contentEvent; private ImageView imgEvent; public HolderEvent(View itemView) { super(itemView); titleEvent = itemView.findViewById(R.id.titleevent); contentEvent = itemView.findViewById(R.id.contentevent); imgEvent = itemView.findViewById(R.id.imgevent); } } }
be1852cfc3d659913e08bfe139f68eb970ec58e1
87b03b6b4a838ffa57dd118bbceb58553de23ccd
/WhereaboutTest/src/jp/yattom/android/whereabout/test/MainActivityTest.java
4c1823524ac686dbb0e9d8c26ca09c755a30056c
[ "MIT" ]
permissive
yattom/whereabout
7f622fb7ca1f8e79b6082c4b2055dc4b751f8678
1b66e15974ca5d33c55a8b926cae7e231cce7e32
refs/heads/master
2016-08-05T03:54:39.698993
2013-09-10T05:58:40
2013-09-10T05:58:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
478
java
package jp.yattom.android.whereabout.test; import jp.yattom.android.whereabout.MainActivity; import android.content.Intent; import android.test.ActivityUnitTestCase; public class MainActivityTest extends ActivityUnitTestCase<MainActivity> { public MainActivityTest() { super(MainActivity.class); } public void test起動する() { Intent intent = new Intent(); startActivity(intent, null, null); assertNotNull(getActivity()); assertFalse(isFinishCalled()); } }
90743b318f8e3bc5577bf77a3d7b18e7021b6652
a2156f6ad8ea698a86bfcc1d4ae36e82e0b75070
/src/test/java/algoritms/SortableTest.java
8b1c9b01ec2b973fb3dacd1dcc0b108bdbe6edd9
[]
no_license
OlegMaksimov/algoritms
cf07d5312957ac93ed0e97758d70b17a281bfd41
ac037ebb4f3070a153588849fc858a4d1e963b7b
refs/heads/master
2022-12-06T12:56:13.193490
2020-08-22T15:28:29
2020-08-22T15:28:29
282,472,313
0
0
null
null
null
null
UTF-8
Java
false
false
672
java
package algoritms; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class SortableTest { int[] arr; @Before public void setUp() throws Exception { arr = generate(2); } @Test public void swap() { Shaker shaker = new Shaker(arr); System.out.println(shaker.toString(arr)); shaker.swap(arr, 0, 1); System.out.println(shaker.toString(arr)); } private static int[] generate(int size) { int[] arr = new int[size]; for (int i = 0; i < size; i++) { arr[i] = (int) Math.round(Math.random() * 100); } return arr; } }
6227c352c8f06d2d677109f43b2b6e86f1ef96d0
2a4e23bf58f32d8a76235854e0ef5c33af6a0024
/app/src/main/java/id/co/bale_it/kliksahabat/adapter2/MyHolder2.java
f518cd2c7004b13c4901fa0a86ab3c799e5f47be
[]
no_license
Wahyunirizkianti/Project_klikshbt
fc6fb62bfd17323d924c1fd342f9054987819154
b72bef23ab9c62d024c991642e6571d546cc56af
refs/heads/master
2020-03-18T22:03:49.210984
2018-05-29T16:18:16
2018-05-29T16:18:16
135,322,084
0
0
null
null
null
null
UTF-8
Java
false
false
985
java
package id.co.bale_it.kliksahabat.adapter2; /** * Created by Satria on 9/30/2017. */ import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import id.co.bale_it.kliksahabat.R; import id.co.bale_it.kliksahabat.adapter.ItemClickListener; public class MyHolder2 extends RecyclerView.ViewHolder implements View.OnClickListener { TextView nameTxt; ImageView img; private ItemClickListener itemClickListener; public MyHolder2(View itemView) { super(itemView); nameTxt= (TextView) itemView.findViewById(R.id.nameTxt); img= (ImageView) itemView.findViewById(R.id.playerImage); itemView.setOnClickListener(this); } @Override public void onClick(View v) { this.itemClickListener.onItemClick(v,getLayoutPosition()); } public void setItemClickListener(ItemClickListener ic) { this.itemClickListener=ic; } }
795870158ee0bca8e800b82ead59190379571835
8fd83cd38a3869091f39ccf3e97adf799314adfe
/src/main/java/org/apache/hadoop/hive/solr/SolrStorageHandler.java
9bde11fc6a9ef7884db00245beee58e544beaac8
[ "Apache-2.0" ]
permissive
amitjaspal/solr-storagehandler
15bac5df59c1e7e1952b4cfbc152c164c31c984c
2fc0981ac06eebe41df3afb5f7d44d95c323ea44
refs/heads/master
2021-01-10T19:27:11.455694
2014-08-22T22:59:14
2014-08-22T22:59:14
24,241,657
4
1
null
null
null
null
UTF-8
Java
false
false
4,427
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.apache.hadoop.hive.solr; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hive.metastore.HiveMetaHook; import org.apache.hadoop.hive.ql.index.IndexPredicateAnalyzer; import org.apache.hadoop.hive.ql.index.IndexSearchCondition; import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler; import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler; import org.apache.hadoop.hive.ql.plan.ExprNodeDesc; import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; import org.apache.hadoop.hive.ql.plan.TableDesc; import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider; import org.apache.hadoop.hive.serde2.Deserializer; import org.apache.hadoop.hive.serde2.SerDe; import org.apache.hadoop.mapred.InputFormat; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.OutputFormat; import org.apache.log4j.Logger; /* * SolrStorageHandler implements HiveStorageHandler, HiveStoragePredicateHandler interfaces. * It can be used to plug-in SOLR backed data into HIVE, data can be read from and written * to a SOLR collection using SolrStorageHandler */ public class SolrStorageHandler implements HiveStorageHandler, HiveStoragePredicateHandler{ private static final Logger LOG = Logger.getLogger(ExternalTableProperties.class.getName()); private Configuration conf; @Override public Configuration getConf(){ return this.conf; } @Override public void setConf(Configuration conf){ this.conf = conf; } @Override public Class<? extends InputFormat> getInputFormatClass(){ return SolrInputFormat.class; } @Override public Class<? extends OutputFormat> getOutputFormatClass(){ return SolrOutputFormat.class; } @Override public HiveMetaHook getMetaHook(){ return new SolrMetaHook(); } @Override public Class<? extends SerDe> getSerDeClass(){ return SolrSerDe.class; } @Override public HiveAuthorizationProvider getAuthorizationProvider(){ return null; } @Override public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> jobProperties){ Properties externalTableProperties = tableDesc.getProperties(); new ExternalTableProperties().initialize(externalTableProperties, jobProperties, tableDesc); } @Override public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> jobProperties){ Properties externalTableProperties = tableDesc.getProperties(); new ExternalTableProperties().initialize(externalTableProperties, jobProperties, tableDesc); } @Override public void configureJobConf(TableDesc tableDesc, JobConf jobConf){ // do nothing; } @Override public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> jobProperties){ // do nothing; } @Override public DecomposedPredicate decomposePredicate(JobConf entries, Deserializer deserializer, ExprNodeDesc exprNodeDesc ){ IndexPredicateAnalyzer analyzer = PredicateAnalyzer.getPredicateAnalyzer(); List<IndexSearchCondition> searchConditions = new ArrayList<IndexSearchCondition>(); ExprNodeDesc residualPredicate = analyzer.analyzePredicate(exprNodeDesc, searchConditions); DecomposedPredicate decomposedPredicate = new DecomposedPredicate(); decomposedPredicate.pushedPredicate = analyzer.translateSearchConditions(searchConditions); decomposedPredicate.residualPredicate = (ExprNodeGenericFuncDesc) residualPredicate; return decomposedPredicate; } }
4218086ac64cd529aab727304e2deb93d62dce15
58c4089b2c2d5b20928ca708e92be1df724b115f
/src/main/java/com/k10ud/certs/IItemDumper.java
bff77d07353c3e0927ae1d31129ea037c8237880
[ "MIT" ]
permissive
antik10ud/xray509
a5a944fe342be6cb9084debd9419c0f1bc78dd7b
b10864d47ce772eb2be96e0b8a2fbd92a3c30abf
refs/heads/master
2021-11-28T06:23:05.447677
2021-11-22T11:57:03
2021-11-22T11:57:03
218,955,027
4
0
MIT
2021-11-22T11:35:54
2019-11-01T09:28:08
Java
UTF-8
Java
false
false
1,245
java
/* * Copyright (c) 2019 David Castañón <[email protected]> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package com.k10ud.certs; public interface IItemDumper { String toString(byte[] src,Item item); }
05daed6e835ffa4bbf90d9610373220c28c38a1e
aeba540c9bcd0ceda24e999f547923916a26df92
/GeoModel/app/src/main/java/com/king/geomodel/model/serializable/SUserInfo.java
aeb3f220d4fc126f4be25ff1c86cf3e353d90523
[]
no_license
beyondwxin/geomodel
186fb34785c90f8b3f20f4e6ae524018b4ade16e
eea288f88e44889833efadc896c0b6bbf62ce0df
refs/heads/master
2020-12-30T17:51:20.484271
2017-05-11T06:24:50
2017-05-11T06:24:50
90,933,592
2
0
null
2017-05-11T06:07:46
2017-05-11T03:31:58
Java
UTF-8
Java
false
false
684
java
package com.king.geomodel.model.serializable; import com.king.geomodel.base.BaseApplication; import com.king.geomodel.tinker.SampleApplicationLike; import com.king.geomodel.utils.CommonValues; import com.king.geomodel.utils.SharedPreferencesUtil; import com.king.greenDAO.bean.User; import java.io.Serializable; /** * 序列化用户信息 * Created by king on 2016/10/9. */ public class SUserInfo implements Serializable { private static User userInfo; public static User getUserInfoInstance() { userInfo = (User) SharedPreferencesUtil.readObject(SampleApplicationLike.getInstance().getApplication(), CommonValues.USERINFO); return userInfo; } }
87f722f09cfcddca9796d5e48f9f0be93d32ab54
dba670bfcdf716fbe3627ebf2a32b3aa5e35cb5b
/src/main/java/m3/jstat/data/Corpus.java
1ba7c11a2cc1ce9fd220508f08511f18ea61258b
[ "Apache-2.0" ]
permissive
kamir/WikiExplorer.NG
429cbe1d0b251a0a81667f3f93d28d16d9886c3e
7b56e3d1e638d760fe238dfd66d3775404335ff4
refs/heads/master
2022-07-14T23:14:19.547932
2018-12-21T13:00:31
2018-12-21T13:00:31
55,048,356
0
0
Apache-2.0
2022-07-01T17:39:27
2016-03-30T09:00:26
HTML
UTF-8
Java
false
false
7,371
java
/** * The core data container for textanalysis. */ package m3.jstat.data; import m3.io.CorpusFile2; import m3.io.CorpusFilePlainContentPerPage; import m3.io.CorpusFileXML; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.net.URLEncoder; import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.Text; import org.crunchts.store.TSB; import m3.wikipedia.corpus.extractor.iwl.ExtractIWLinkCorpus; import m3.wikipedia.explorer.data.WikiNode; import org.etosha.core.sc.connector.external.Wiki; /** * @author root */ public class Corpus { private static String studie = "DEFAULT.Studie"; public Corpus() {} public Corpus(String studie) { this.docs = new Vector<Document>(); this.studie = studie; // corpusFilePath = TSB.getAspectFolder( "corpus" , studie ).getAbsolutePath(); } // public Corpus(boolean loadPC) { // this("DEFAULT_ignoreLoadPC"); // // // this.loadPageContent = loadPC; // // System.out.println("##### WARNING ##### IGNORE loadPC PROP in constructor Corpus() !!! "); // } public static final int mode_XML = 0; public static final int mode_SEQ = 1; private static String _listfile_pfad = TSB.getFolderForTimeSeriesMetadata().getAbsolutePath(); private static String corpusFilePath = null; // TSB.getAspectFolder( "corpus.xml" , studie ).getAbsolutePath(); public static String getCorpusFilePath() { return corpusFilePath; } public static String getListfilePath() { return _listfile_pfad; } // public static void setListfile_pfad(String _listfile_pfad) { // Corpus._listfile_pfad = _listfile_pfad; // } public static Corpus loadCorpus(String name, int mode) throws IOException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException { if (mode == mode_SEQ) { return CorpusFile2.loadFromLocalFS(name); } else if (mode == mode_XML) { return CorpusFileXML.loadFromLocalFS(name); } else { return null; } } public static void storeCorpus(Corpus corpus, String name, int mode) throws IOException, URISyntaxException { System.out.println("*** " + name + " *** mode:" + mode + " *** studie:" + studie ); if (mode == mode_SEQ) { CorpusFile2.createCorpusFile(".", name, corpus); } else if (mode == mode_XML) { CorpusFileXML._createCorpusFile(".", name, corpus, studie); } CorpusFilePlainContentPerPage._createCorpusFile(".", name, corpus, studie); } final boolean loadPageContent = true; public void addDocument(Document doc) { docs.add(doc); } public Vector<Document> docs = null; public void _addWikiNodes(Vector<WikiNode> t, String acM) { System.out.println("*** " + t.size() + "=>" + acM + " loadPageContent: " + loadPageContent); long vol = 0; for (WikiNode wn : t) { String html = ""; try { Document doc = new Document(ExtractIWLinkCorpus.getUrl(wn.wiki, wn.page), html); doc.group = acM; doc.wn = wn; if (loadPageContent) { html = ExtractIWLinkCorpus.getHTML(wn); vol = vol + html.length(); doc.wn.pageVolume = html.length(); doc.html = html; } else { System.out.println( "###### SKIP LOAD PAGE #####"); } System.out.println( doc.group + " : " + doc.wn.pageVolume ); addDocument(doc); } catch (IOException ex) { Logger.getLogger(Corpus.class.getName()).log(Level.SEVERE, null, ex); } } System.out.println("***" + t.size() + "=>" + acM + " volume: " + vol ); } public void addWikiNode(WikiNode wn, String b) { String html; try { html = ExtractIWLinkCorpus.getHTML(wn); Document doc = new Document(ExtractIWLinkCorpus.getUrl(wn.wiki, wn.page), html); doc.group = b; doc.wn = wn; addDocument(doc); } catch (IOException ex) { Logger.getLogger(Corpus.class.getName()).log(Level.SEVERE, null, ex); } } public Vector<WikiNode> _getWikiNodes(String cN) { Vector<WikiNode> d = new Vector<WikiNode>(); for (Document doc : docs) { if (doc.group.equals(cN)) { d.add(doc.wn); } } return d; } public void writeWikiNodeKeyFile(WikiNode wn, String sdm_name) throws UnsupportedEncodingException { // String page = wn.page; if (page.contains("/")) { page = page.replaceAll("/", "_"); } if (page.contains("'")) { page = page.replaceAll("'", "_"); } String fnPart = URLEncoder.encode( page, "UTF8"); String listFILE = "listfile_" + sdm_name + "_" + wn.wiki + "_" + fnPart + ".lst"; try { BufferedWriter bw = new BufferedWriter(new FileWriter(_listfile_pfad + "/"+ listFILE)); int i = 0; for (Document doc : docs) { WikiDocumentKey k = new WikiDocumentKey(doc); bw.write(k + "\n"); i++; } System.out.println(i + " Docs gespeichert."); bw.flush(); bw.close(); } catch (IOException ex) { Logger.getLogger(Corpus.class.getName()).log(Level.SEVERE, null, ex); } } private String ENCODE_FN(String wiki, String pn) throws IOException { Wiki wiki1 = new Wiki(wiki + ".wikipedia.org"); String l = pn; try { l = URLEncoder.encode( wiki1.normalize(pn), "UTF-8"); } catch (UnsupportedEncodingException ex) { Logger.getLogger(Corpus.class.getName()).log(Level.SEVERE, null, ex); } return l; } public String getTextStatistikLine() { String hl = "STUDIE LANG Page z.CN z.IWL z.AL z.BL vol.CN vol.IWL vol.A.L vol.B.L volCN / volAL volIWL / volBL ( volCN + volIWL) / (volAL + volBL)"; return hl; } public void exportCorpusToSequenceFile( SequenceFile.Writer writer ) throws IOException, URISyntaxException { int c = 0; for ( Document doc : docs ) { c++; Text key = new Text( new WikiDocumentKey( doc ).toString() ); Text val = new Text( doc.html ); writer.append( key, val ); } } }
cad19b474a838beffd687c06023cca7090fa9981
18a62711edfc7ab0f29f4a64a0db5db4b3e47988
/chori/src/main/java/com/chori/controller/BrandController.java
893fde59ecc64fbc71955aee225abd4c09dbc1ba
[]
no_license
15110081/Chori
ec1d4777158625b4d963db0eca70c0ccc4c42f45
6506b605814912ad8fb1e00f2734767c0764cf2a
refs/heads/master
2020-04-28T08:30:30.309932
2019-03-12T03:48:44
2019-03-12T03:48:44
175,129,917
0
0
null
null
null
null
UTF-8
Java
false
false
2,431
java
package com.chori.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.chori.model.BrandModel; import com.chori.model.PiModel; import com.chori.service.BrandService; @RestController @RequestMapping(value="/") public class BrandController { private static final Log log = LogFactory.getLog(BrandController.class); @Autowired BrandService service; @RequestMapping(value = "/brand/list", produces = "application/json", method = RequestMethod.GET) @ResponseBody public Map<String, Object> getAllStatus() { log.info(String.format("getAllStatus in class %s", getClass())); try { log.debug("getting list of all brand and return json"); Map<String, Object> result = new HashMap<String, Object>(); List<BrandModel> ls = service.getAllBrandModel(); result.put("status", "ok"); result.put("list", ls); log.debug("getAllBrand successful"); return result; } catch (Exception e) { log.error(String.format("getAllBrand in class %s has error: %s", getClass(), e.getMessage())); throw e; } } @RequestMapping(value = "/brand/detail/{brandCode}", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) @ResponseBody public Map<String, Object> getBrandDetail(@PathVariable int brandCode) { log.info(String.format("getBrandDetail with param 'brandCode' in class: %s", getClass())); try { log.debug("getting brand's detail by its brandCode and return json"); Map<String, Object> result = new HashMap<String, Object>(); BrandModel en = service.findBrandById(brandCode); result.put("currentbrand", en); result.put("status", "ok"); log.debug("getbrandDetail successful"); return result; } catch (Exception e) { log.error(String.format("getBrandDetail with param 'lotNumber' in class %s has error: %s", getClass(), e.getMessage())); throw e; } } }
93fab3a6ea0ecbce587f097b4da2d928d986d109
a86df356ef494eab1870ad7fdba2e4e1f4a20f56
/src/main/java/com/guo/j8/Chapter2/Chapter1_1.java
dd9ed685a363f687d16e32fe7892a2ae788b5efd
[]
no_license
lair101/Java8InAction
d8b3862b38af498ae689adda0d7c80d697be8c32
8861be392b8030714b266e92d2d935fbd5616368
refs/heads/master
2020-03-20T06:28:19.262950
2018-08-16T23:06:25
2018-08-16T23:06:25
137,249,928
0
0
null
null
null
null
UTF-8
Java
false
false
1,618
java
package com.guo.j8.Chapter2; import lombok.Data; import org.junit.jupiter.api.Test; import java.util.*; public class Chapter1_1{ List<Apple> inventory = new ArrayList<Apple>(); /*** * old way to sort a list is to implement a Comparator method for sort() * This need more code and Object casting */ public void oldSort(){ Apple a = new Apple(); a.setWeight(1); Apple b = new Apple(); b.setWeight(2); inventory.add(a); inventory.add(b); Collections.sort(inventory, new Comparator<Apple>() { @Override public int compare(Apple o1, Apple o2) { return o1.getWeight()-o2.getWeight(); } }); } /** * First Java 8 way to write sort * use arraylist sort with lambda expression to implement comparator */ public void newSort(){ Apple a = new Apple(); a.setWeight(1); Apple b = new Apple(); b.setWeight(2); inventory.add(a); inventory.add(b); inventory.sort((Apple o1, Apple o2) -> {return o1.getWeight()- o2.getWeight();}); } @Test public void test1(){ long lStartTime = System.nanoTime(); oldSort(); long lEndTime = System.nanoTime(); System.out.println("Old sort time consume :" + (lEndTime - lStartTime)); lStartTime = System.nanoTime(); newSort(); lEndTime = System.nanoTime(); System.out.println("New sort time consume :" + (lEndTime - lStartTime)); } } @Data class Apple{ int weight; }
06878502ad35e8a58428f138851583276811fa6a
1374237fa0c18f6896c81fb331bcc96a558c37f4
/java/com/winnertel/em/standard/snmp/gui/formatter/HundredPercentFormatter.java
50fdc7d8c9d598bb8a28f53f290b8ae4f78ffe83
[]
no_license
fangniude/lct
0ae5bc550820676f05d03f19f7570dc2f442313e
adb490fb8d0c379a8b991c1a22684e910b950796
refs/heads/master
2020-12-02T16:37:32.690589
2017-12-25T01:56:32
2017-12-25T01:56:32
96,560,039
0
0
null
null
null
null
UTF-8
Java
false
false
848
java
package com.winnertel.em.standard.snmp.gui.formatter; import com.winnertel.em.framework.IApplication; import com.winnertel.em.framework.model.snmp.SnmpMibBean; import com.winnertel.em.framework.model.util.MibBeanUtil; public class HundredPercentFormatter extends SnmpFieldFormatter { public HundredPercentFormatter(IApplication anApplication) { super(anApplication); } // BridgeIdFormatter public Object format(SnmpMibBean aMibBean, String aProperty) throws Exception { Integer value = (Integer) MibBeanUtil.getSimpleProperty(aMibBean, aProperty); if (value == null) { return null; } StringBuffer result = new StringBuffer(); result.append((((float) value.intValue()) / 100.0)); result.append("%"); return result.toString(); } } // BridgeIdFormatter
538b49309491708ee557e72135a7b85cde79175b
816d66df43033ab1d9d8f1ae0bc97c0734e74a58
/Programming/day5/Link.java
eaf46a09abaef8987885ad2b1a78b6090a5d8977
[]
no_license
CaseRegan/CP222
3afac55ad8978ea8430cbc4f72823c35d83e73e3
1aac22c2aae52f152a69ecef0e44c94bb67cedf7
refs/heads/master
2021-08-31T00:50:07.698045
2017-12-20T02:11:23
2017-12-20T02:11:23
112,227,739
0
0
null
null
null
null
UTF-8
Java
false
false
318
java
public class Link<T> { private T value; private Link<T> next; public Link(T v, Link<T> n) { value = v; next = n; } public void setValue(T v) { value = v; } public T getValue() { return value; } public void setNext(Link<T> n) { next = n; } public Link<T> getNext() { return next; } }
55c225e780d1db66d45cdc4dda31024d79eaefaf
1bfa1b90d5b99879c1c8df637364767fd8737db0
/app/src/main/java/com/ihsinformatics/korona/model/partners/BasePartners.java
7730670101d4f059295caefa48ef8213e375ddad
[]
no_license
InteractiveHealthSolutions/korona-screening-mobile
c6df309e3ef43db52da5d4725ba8fbc8ceb36885
5450892b07160e50392311aaba827a0f4150b9ef
refs/heads/master
2023-08-30T23:21:06.078035
2020-06-19T09:48:58
2020-06-19T09:48:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,248
java
package com.ihsinformatics.korona.model.partners; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class BasePartners { @SerializedName("uuid") @Expose private String uuid; @SerializedName("isVoided") @Expose private Boolean isVoided; @SerializedName("dateCreated") @Expose private String dateCreated; @SerializedName("reasonVoided") @Expose private Object reasonVoided; @SerializedName("partnerId") @Expose private Integer partnerId; @SerializedName("partnerName") @Expose private String partnerName; @SerializedName("shortName") @Expose private String shortName; @SerializedName("logoUrl") @Expose private String logoUrl; @SerializedName("website") @Expose private String url; public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public Boolean getIsVoided() { return isVoided; } public void setIsVoided(Boolean isVoided) { this.isVoided = isVoided; } public String getDateCreated() { return dateCreated; } public void setDateCreated(String dateCreated) { this.dateCreated = dateCreated; } public Object getReasonVoided() { return reasonVoided; } public void setReasonVoided(Object reasonVoided) { this.reasonVoided = reasonVoided; } public Integer getPartnerId() { return partnerId; } public void setPartnerId(Integer partnerId) { this.partnerId = partnerId; } public String getPartnerName() { return partnerName; } public void setPartnerName(String partnerName) { this.partnerName = partnerName; } public String getShortName() { return shortName; } public void setShortName(String shortName) { this.shortName = shortName; } public String getLogoUrl() { return logoUrl; } public void setLogoUrl(String logoUrl) { this.logoUrl = logoUrl; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } }
d5af1a3dea896eb7df6161a00f83fde2192541f6
4a5f24baf286458ddde8658420faf899eb22634b
/aws-java-sdk-alexaforbusiness/src/main/java/com/amazonaws/services/alexaforbusiness/model/SearchDevicesResult.java
0924bbf217d5f973cdd9c431feef5a056d9e8733
[ "Apache-2.0" ]
permissive
gopinathrsv/aws-sdk-java
c2876eaf019ac00714724002d91d18fadc4b4a60
97b63ab51f2e850d22e545154e40a33601790278
refs/heads/master
2021-05-14T17:18:16.335069
2017-12-29T19:49:30
2017-12-29T19:49:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,048
java
/* * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.alexaforbusiness.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/alexaforbusiness-2017-11-09/SearchDevices" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SearchDevicesResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable { /** * <p> * The devices that meet the specified set of filter criteria, in sort order. * </p> */ private java.util.List<DeviceData> devices; /** * <p> * The token returned to indicate that there is more data available. * </p> */ private String nextToken; /** * <p> * The total number of devices returned. * </p> */ private Integer totalCount; /** * <p> * The devices that meet the specified set of filter criteria, in sort order. * </p> * * @return The devices that meet the specified set of filter criteria, in sort order. */ public java.util.List<DeviceData> getDevices() { return devices; } /** * <p> * The devices that meet the specified set of filter criteria, in sort order. * </p> * * @param devices * The devices that meet the specified set of filter criteria, in sort order. */ public void setDevices(java.util.Collection<DeviceData> devices) { if (devices == null) { this.devices = null; return; } this.devices = new java.util.ArrayList<DeviceData>(devices); } /** * <p> * The devices that meet the specified set of filter criteria, in sort order. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setDevices(java.util.Collection)} or {@link #withDevices(java.util.Collection)} if you want to override * the existing values. * </p> * * @param devices * The devices that meet the specified set of filter criteria, in sort order. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchDevicesResult withDevices(DeviceData... devices) { if (this.devices == null) { setDevices(new java.util.ArrayList<DeviceData>(devices.length)); } for (DeviceData ele : devices) { this.devices.add(ele); } return this; } /** * <p> * The devices that meet the specified set of filter criteria, in sort order. * </p> * * @param devices * The devices that meet the specified set of filter criteria, in sort order. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchDevicesResult withDevices(java.util.Collection<DeviceData> devices) { setDevices(devices); return this; } /** * <p> * The token returned to indicate that there is more data available. * </p> * * @param nextToken * The token returned to indicate that there is more data available. */ public void setNextToken(String nextToken) { this.nextToken = nextToken; } /** * <p> * The token returned to indicate that there is more data available. * </p> * * @return The token returned to indicate that there is more data available. */ public String getNextToken() { return this.nextToken; } /** * <p> * The token returned to indicate that there is more data available. * </p> * * @param nextToken * The token returned to indicate that there is more data available. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchDevicesResult withNextToken(String nextToken) { setNextToken(nextToken); return this; } /** * <p> * The total number of devices returned. * </p> * * @param totalCount * The total number of devices returned. */ public void setTotalCount(Integer totalCount) { this.totalCount = totalCount; } /** * <p> * The total number of devices returned. * </p> * * @return The total number of devices returned. */ public Integer getTotalCount() { return this.totalCount; } /** * <p> * The total number of devices returned. * </p> * * @param totalCount * The total number of devices returned. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchDevicesResult withTotalCount(Integer totalCount) { setTotalCount(totalCount); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDevices() != null) sb.append("Devices: ").append(getDevices()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()).append(","); if (getTotalCount() != null) sb.append("TotalCount: ").append(getTotalCount()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SearchDevicesResult == false) return false; SearchDevicesResult other = (SearchDevicesResult) obj; if (other.getDevices() == null ^ this.getDevices() == null) return false; if (other.getDevices() != null && other.getDevices().equals(this.getDevices()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; if (other.getTotalCount() == null ^ this.getTotalCount() == null) return false; if (other.getTotalCount() != null && other.getTotalCount().equals(this.getTotalCount()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDevices() == null) ? 0 : getDevices().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); hashCode = prime * hashCode + ((getTotalCount() == null) ? 0 : getTotalCount().hashCode()); return hashCode; } @Override public SearchDevicesResult clone() { try { return (SearchDevicesResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
[ "" ]
45ac461494432b1614ed8d7fa11d56fa6b3b2af3
c42f08c1da1564b5e90ceb6853656f71d33bb628
/Helper/src/main/java/com/jiqu/helper/data/RecommendFindingsItemPicInfo.java
7ac336c0e6623c9e865b3d65683f6957dd75617c
[]
no_license
xwhPanda/MyApplication
1901b342a1cf1d4d9d5e9314fbf7ea73ca727e8d
35ad2f974395dab62c7947cd71377770ef4a0f3f
refs/heads/master
2020-04-06T06:58:23.599836
2016-09-02T10:03:28
2016-09-02T10:03:28
64,209,768
0
0
null
null
null
null
UTF-8
Java
false
false
2,287
java
package com.jiqu.helper.data; /** * Created by xiongweihua on 2016/7/27. */ public class RecommendFindingsItemPicInfo { /** * url : http://koi.77gamebox.com/index.php/Art/News/show/id/29.html * id : 29 * rotate_pic : http://koi.77gamebox.com/Upload/Rotate/2016-07-21/579067b57db99.jpg * favorite : 222 * from : 应用内容精选 * rotate_title : 大闹三国 * rotate_intro : 最新最好玩 * type : 3 * siteID : 1 * statisticsID : 10 */ private String url; private String id; private String rotate_pic; private String favorite; private String from; private String rotate_title; private String rotate_intro; private String type; private String siteID; private String statisticsID; public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getRotate_pic() { return rotate_pic; } public void setRotate_pic(String rotate_pic) { this.rotate_pic = rotate_pic; } public String getFavorite() { return favorite; } public void setFavorite(String favorite) { this.favorite = favorite; } public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public String getRotate_title() { return rotate_title; } public void setRotate_title(String rotate_title) { this.rotate_title = rotate_title; } public String getRotate_intro() { return rotate_intro; } public void setRotate_intro(String rotate_intro) { this.rotate_intro = rotate_intro; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getSiteID() { return siteID; } public void setSiteID(String siteID) { this.siteID = siteID; } public String getStatisticsID() { return statisticsID; } public void setStatisticsID(String statisticsID) { this.statisticsID = statisticsID; } }
24047ed08cd38595099f5c20349349954addbf9c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_88fef4455a2cc5cbd136f4b88ef825ce7b98f1fd/Messages/2_88fef4455a2cc5cbd136f4b88ef825ce7b98f1fd_Messages_s.java
49b92c9337bac1e2144da4a866230aae8634c21a
[]
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
3,159
java
package com.ibm.sbt.services.client.connections.profiles.utils; /** * Class used to retrieve translatable message values from the associated properties file. * * @author Swati Singh */ public class Messages { public static String InvalidArgument_1 = "Required input parameter is missing : id"; public static String InvalidArgument_2 = "Required input parameter is missing : connectionId"; public static String InvalidArgument_3 = "Invalid Input : Profile passed is null"; public static String InvalidArgument_4 = "Required input parameter is missing : source id is missing"; public static String InvalidArgument_5 = "Required input parameter is missing : target id is missing"; public static String InvalidArgument_6 = "Invalid Input : Connection passed is null"; public static String ProfileServiceException_1 = "Exception occurred in method"; public static String ProfileException = "Error getting profile with identifier : {0}"; public static String SearchException = "Problem occurred while searching profiles"; public static String ColleaguesException = "Problem occurred while getting colleagues of user with identifier : {0}"; public static String CheckColleaguesException = "Problem occurred in checking if two users are colleagues"; public static String CommonColleaguesException = "Problem occurred in getting common colleagues of users {0} and {1}"; public static String ReportingChainException = "Problem occurred in getting report chain of user with identifier : {0}"; public static String DirectReportsException = "Problem occurred in getting direct reports of user with identifier : {0}"; public static String ConnectionsByStatusException = "Problem occurred while getting connections by status for user with identifier : {0}"; public static String SendInviteException = "Problem occurred in sending Invite to user with identifier : {0}, please check if there is already a pending invite for this user"; public static String SendInvitePayloadException = "Error creating Send Invite Payload"; public static String SendInviteMsg = "Please accept this invitation to be in my network of Connections colleagues."; public static String AcceptInviteException = "Problem occurred in accepting Invite with connection Id : {0}"; public static String AcceptInvitePayloadException = "Error creating Accept Invite Payload"; public static String DeleteInviteException = "Problem occurred in deleting Invite with connection Id : {0}"; public static String UpdateProfilePhotoException = "Problem occurred in Updating Profile Photo"; public static String UpdateProfileException = "Problem occurred in Updating Profile "; public static String DeleteProfileException = "Problem occurred in deleting Profile of user with identifier : {0}"; public static String CreateProfileException = "Problem occurred in creating Profile , please check if profile already and you are logged in as administrator"; public static String CreateProfilePayloadException = "Error in create Profile Payload"; }
9576c7d507fdfa1c503fe3d968a8aa485d515f6b
2f581cc54d31f37e7883197715eb3cb4d9fd81a5
/src/cn/probuing/utils/MD5Utils.java
9e82897359c878d7f622b8fbcd59ada82b72bd33
[]
no_license
neetsan123/ex_mallshop_j2ee
7706bfec0da8cd3b0d25b4cea31b77071a7fa77c
2e2887ec27130dd739eb181c6cea8ee5f3f09883
refs/heads/master
2020-06-07T12:43:16.480024
2018-04-27T07:58:05
2018-04-27T07:58:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
859
java
package cn.probuing.utils; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class MD5Utils { /** * ʹ��md5���㷨���м��� */ public static String md5(String plainText) { byte[] secretBytes = null; try { secretBytes = MessageDigest.getInstance("md5").digest( plainText.getBytes()); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("û��md5����㷨��"); } String md5code = new BigInteger(1, secretBytes).toString(16);// 16�������� // �����������δ��32λ����Ҫǰ�油0 for (int i = 0; i < 32 - md5code.length(); i++) { md5code = "0" + md5code; } return md5code; } public static void main(String[] args) { System.out.println(md5("123")); } }
2fc81db5ddefe8d95db485d57b3448a2db1dd319
ee03a8c09d2c34c73e13f87b63bcaa8cd3f6a337
/Exercicios/Interfaces_2/Interfaces_2/src/interfaces_2/Tributavel.java
1c87725283e80299c6ad86b77ef44db313c4c4e0
[]
no_license
FelipeNascimentods/Programa-o-Orientada-Objetos
c81e5ddb6d7efbc4282b04fc1a5f82713de0908b
a659116a6e18e5835f405afdfcc9b81326a55aa4
refs/heads/master
2020-09-12T21:07:28.865365
2019-11-18T22:30:00
2019-11-18T22:30:00
222,556,660
0
0
null
null
null
null
UTF-8
Java
false
false
85
java
package interfaces_2; public interface Tributavel { double calculaTributos(); }
3407dda94c1aa9a2d44b823a7ef59dad96c3f4da
0b3885c6ab684c34762c48c3cc9da971dbc0962a
/Java/src/Thread/Text3.java
79fd12574ce4f10554286a71e20adfa86b69288d
[]
no_license
y928qx/warehouseYqx
811fb5437c04ae9af7d7f248841a42c332365e3c
0bbd14a8f1d8a55e84905a22dbcbf5128d42f935
refs/heads/master
2021-01-11T10:37:27.269138
2017-02-16T02:24:22
2017-02-16T02:24:22
76,341,631
0
0
null
null
null
null
UTF-8
Java
false
false
899
java
package Thread; public class Text3 { public static void main(String[] args) { for (int i = 0; i < 100; i++) { System.out.println(Thread.currentThread().getName() + " " + i); if (i == 30) { Runnable myRunnable = new MyRunnable(); Thread thread = new MyThread(myRunnable); thread.start(); } } } } class MyRunnable implements Runnable { private int i = 0; @Override public void run() { System.out.println("in MyRunnable run"); for (i = 0; i < 100; i++) { System.out.println(Thread.currentThread().getName() + " " + i); } } } class MyThread extends Thread { private int i = 0; public MyThread(Runnable runnable) { super(runnable); } @Override public void run() { System.out.println("in MyThread run"); for (i = 0; i < 100; i++) { System.out.println(Thread.currentThread().getName() + " " + i); } } }
a777b88ad15b36633dca506421bdc6be5c89e136
b5c485493f675bcc19dcadfecf9e775b7bb700ed
/jee-utility/src/main/java/org/cyk/utility/scope/AbstractScopeImpl.java
1958931f7c7449fca7c6326b7bbe51acd76382c5
[]
no_license
devlopper/org.cyk.utility
148a1aafccfc4af23a941585cae61229630b96ec
14ec3ba5cfe0fa14f0e2b1439ef0f728c52ec775
refs/heads/master
2023-03-05T23:45:40.165701
2021-04-03T16:34:06
2021-04-03T16:34:06
16,252,993
1
0
null
2022-10-12T20:09:48
2014-01-26T12:52:24
Java
UTF-8
Java
false
false
275
java
package org.cyk.utility.scope; import java.io.Serializable; import org.cyk.utility.__kernel__.object.dynamic.AbstractObject; public abstract class AbstractScopeImpl extends AbstractObject implements Scope,Serializable{ private static final long serialVersionUID = 1L; }
84c46c188b8579d81f8371bb8e490fc04dd5bf98
08d3aa021d99753cb8daf707f32e29b8579b667c
/app/src/main/java/com/example/myapplication/sonradan_acilan.java
c8aa63beed7a0739ebc46f5aac66f38c41c080d3
[]
no_license
EnginAltuntas/Android_BEUN_ogrenci_bilgilendirme
ac34a43a6f40f1d8415f43c0732772afe5acd84c
40e675ed120d1d10b06b252d7fee09915b063526
refs/heads/master
2022-12-08T13:56:11.224168
2020-08-23T14:44:31
2020-08-23T14:44:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,075
java
package com.example.myapplication; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import java.util.ArrayList; import java.util.List; public class sonradan_acilan extends AppCompatActivity { List<Broadcast> yazi = new ArrayList<Broadcast>(); List<String> eng = new ArrayList<>(); public int gcc=0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sonradan_acilan); new Thread(new Runnable() { @Override public void run() { String gelen = getIntent().getStringExtra("mesaj"); gelen="https://"+gelen; // textView.setText(gelen); try { Document document = Jsoup.connect(gelen).get(); Elements links = document.select("p"); for (Element link : links) { eng.add(link.text()); gcc++; } } catch (Exception e) { e.printStackTrace(); } runOnUiThread(new Runnable() { @Override public void run() { ListView liste = findViewById(R.id.listView61); ArrayAdapter<String> veriadaptor = new ArrayAdapter<>(sonradan_acilan.this, android.R.layout.simple_list_item_1, android.R.id.text1, eng); liste.setAdapter(veriadaptor); /* textView.setText(eng.get(0)+"\n\n"+ eng.get(1)+"\n\n"+ eng.get(2)+"\n\n"+ eng.get(3));*/ } }); } }).start(); } }
fcea537ba728204cffd810144560bea386787397
54c28a1a5f7fa16b4442f55340abcb4b193e4397
/network-server/src/main/java/com/programyourhome/immerse/network/server/action/PlayScenarioAction.java
5d0fbda7796b62c0b87a4a6c42c87ab4c59865a4
[ "Apache-2.0" ]
permissive
OrangeBaoWang/immerse
cb0e7a26b8ad214fcf329db96f90e14267237451
3b89232b7f6b9e229d1f127cb1135d305c856893
refs/heads/master
2021-10-11T00:27:58.982416
2019-01-19T20:55:46
2019-01-19T20:55:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
777
java
package com.programyourhome.immerse.network.server.action; import java.io.IOException; import java.io.ObjectInput; import java.util.UUID; import com.programyourhome.immerse.domain.Scenario; import com.programyourhome.immerse.network.server.ImmerseServer; /** * Play a scenario on the mixer. */ public class PlayScenarioAction extends Action<UUID> { @Override public UUID perform(ImmerseServer server, ObjectInput objectInput) throws ClassNotFoundException, IOException { Scenario scenario = this.read(objectInput, Scenario.class); if (!server.hasMixer()) { throw new IllegalStateException("Server does not have a mixer, playing a scenario is not possible"); } return server.getMixer().playScenario(scenario); } }
4d27ccb5f3005f0525f22acc1143bd1fbd1a5648
caccd6fd464dab9b33d18d95f87e2114a41b922a
/gen/com/grayhound/CriminalIntent/BuildConfig.java
ca1cf68cc58cc7c3403c78d683f2bab508613c66
[]
no_license
dontsova/CriminalIntent
ef90c31793bbe448b357ec2275b794553bf30d28
89f3627b88283ce85a6c2d5ec0492bb88b87e815
refs/heads/master
2021-01-22T06:03:09.900167
2015-07-21T14:23:12
2015-07-21T14:23:12
32,023,451
0
1
null
null
null
null
UTF-8
Java
false
false
270
java
/*___Generated_by_IDEA___*/ package com.grayhound.CriminalIntent; /* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ public final class BuildConfig { public final static boolean DEBUG = Boolean.parseBoolean(null); }
7bd0d07ac552b2a0566101b5c7dab6ad326b1184
7e69df92710270b037e3576a609eaffd8d51dd6e
/src/main/java/com/codinginterview/hackerrank/array/ArraysLeftRotation.java
023c088678fc77ee514cc2cf757b372756e3dc69
[]
no_license
dogwang94/codinginterview2020
b981cc67e12a4a8d0e4b3993bec17fd1357a9209
a28a2abcb29020cbfc7ca113f3455bc0d0b2cdfe
refs/heads/master
2021-04-14T08:19:58.167959
2020-03-22T23:26:12
2020-03-22T23:26:12
249,218,565
0
0
null
null
null
null
UTF-8
Java
false
false
647
java
package com.codinginterview.hackerrank.array; import java.util.Arrays; public class ArraysLeftRotation { public static void main(String[] args) { int[] a = {1,2,3,4,5}; int n = 5; System.out.println(Arrays.toString(rotleft(a, n))); } static int[] rotleft(int[]a, int d) { int size = a.length; int[] rotated_arr = new int[size]; int i = 0; int rotate_index = d; while (rotate_index < size) { rotated_arr[i] = a[rotate_index]; i++; rotate_index++; } rotate_index = 0; while (rotate_index <d) { rotated_arr[i] = a[rotate_index]; i++; rotate_index++; } return rotated_arr; } }
e9b550e5282f5d3f92e424fb23450cc6000ad0c8
13cf2b591624a7c4baaac61f54e5b81b4b160790
/src/main/java/ilpme/xhail/core/Buildable.java
1fa789c924bcf82d5120c9efb41b73398b1f3bf1
[]
no_license
ari9dam/ILPME
d96ccf94adc204a19fd6b28cbafd8d5bd4e4cd9f
e028744e96d7efcf9c105a0162f765bf63365ce6
refs/heads/master
2021-07-19T14:46:05.896447
2019-08-24T04:29:46
2019-08-24T04:29:46
84,487,374
1
3
null
2021-04-26T17:57:53
2017-03-09T20:49:58
Java
UTF-8
Java
false
false
248
java
/** * */ package ilpme.xhail.core; /** * @author stefano * */ public interface Buildable<T> { /** * Returns the equivalent instance of <code>T</code>. * * @return the equivalent instance of <code>T</code> */ public T build(); }
[ "Anisha [email protected]" ]
df4e24ebf5a5fb00cb8987d22bf45faaf1700b81
f5cb08ec1b56ac4a4bb3081e020db3f05d347212
/TP4-Carnet/src/DAO/CsvDAO.java
3cb0e4411b8b7ea080ae9f4c5f44cca1028dd772
[]
no_license
fornito2u/DP-ACL-TP-2018
565c915191e6163c4292523c2bcfcd7dfad407b5
c9e6cd576b7fe189817cc4060022ba1b506a4a71
refs/heads/master
2020-04-01T13:22:32.070415
2018-11-09T13:55:07
2018-11-09T13:55:07
153,249,966
0
0
null
null
null
null
UTF-8
Java
false
false
2,003
java
package DAO; import Annuaire.Annuaire; import Personne.Personne; import java.io.*; public class CsvDAO implements ContactDAO { private String pathToFile; public CsvDAO(String pathToFile){ config(pathToFile); } public void config(String pathToFile){ this.pathToFile = pathToFile; } @Override public boolean save(Annuaire annuaire) { try { FileWriter writer = new FileWriter(pathToFile); String csvSeparator = ","; for(Personne p : annuaire){ writer.append(p.parse(csvSeparator)); writer.append('\n'); writer.flush(); } writer.close(); return true; } catch(IOException e) { } return false; } @Override public boolean load(Annuaire annuaire) { BufferedReader br = null; String line; //séparateur du CSV String csvSeparator = ","; System.out.println("CSV Loader"); try { br = new BufferedReader(new FileReader(pathToFile)); int i=0; //on boucle sur chaque ligne du fichier while ((line = br.readLine()) != null) { i++; // on récupère la ligne que l'on découpe en fonction du séparateur, on // obtient un tableau de chaînes de caractères (pour chaque ligne) String[] contacts = line.split(csvSeparator); //Affichage dans la foulée pour montrer le résultat System.out.println("Contact #"+i+" : " + contacts[1] + " " + contacts[0] + " (" + contacts[2]+ ")"); annuaire.add(new Personne(contacts[0],contacts[1],contacts[2])); // on aurait pu stocker les informations dans une autre structure de // données un peu plus optimale, bien évidemment (List, Map, etc.) } return true; } catch (FileNotFoundException e) { System.out.println("FILE NOT FOUND CsvDAO."); } catch (IOException e) { System.out.println("IOException CsvDAO"); } finally { if (br != null) { try { br.close(); } catch (IOException e) { } } } return false; } }
42b03abc1cb79ec0568b013425b2f56374f87c71
351d07ae12c4a1331299a9dca90aeb7e25cf258b
/NumberGuess/gen/edu/harding/numberguess/BuildConfig.java
e683e8c31313f525441c2e38f04dfb32d94da234
[]
no_license
tdurey/NumberGuess
74cee9188d6a672a249d3a93d5a31b372ebeead4
70a143dbdd628a5c5258ed38055eaef364c4a6a9
refs/heads/master
2016-09-03T06:31:59.316879
2014-05-05T06:53:55
2014-05-05T06:54:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
/** Automatically generated file. DO NOT MODIFY */ package edu.harding.numberguess; public final class BuildConfig { public final static boolean DEBUG = true; }
9459416f16490ebbdff928b5d4abd9cabae424ae
55876a3fe02485c1d524054ecb2573804f234626
/src/main/java/com/altas/erp/eds/entity/AccountBankStatementImportEntityWithBLOBs.java
7a66932702484915425053572cae6eb9cec286e8
[]
no_license
enjoy0924/sample-tars
b427ceac64b2ec99369d2dc29e7b474f5008632c
e08ef487ea939c492e136e06f19393b6ebd83382
refs/heads/master
2021-09-11T01:22:45.694774
2018-04-05T15:19:30
2018-04-05T15:19:32
119,140,029
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
package com.altas.erp.eds.entity; public class AccountBankStatementImportEntityWithBLOBs extends AccountBankStatementImportEntity { /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column account_bank_statement_import.data_file * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ private byte[] dataFile; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column account_bank_statement_import.filename * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ private String filename; /** * This method was generated by MyBatis Generator. * This method returns the value of the database column account_bank_statement_import.data_file * * @return the value of account_bank_statement_import.data_file * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ public byte[] getDataFile() { return dataFile; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column account_bank_statement_import.data_file * * @param dataFile the value for account_bank_statement_import.data_file * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ public void setDataFile(byte[] dataFile) { this.dataFile = dataFile; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column account_bank_statement_import.filename * * @return the value of account_bank_statement_import.filename * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ public String getFilename() { return filename; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column account_bank_statement_import.filename * * @param filename the value for account_bank_statement_import.filename * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ public void setFilename(String filename) { this.filename = filename == null ? null : filename.trim(); } }
00f254f491d2e43411351684dc4fef11d300dfa7
c298bb6cc956a95ed570624a48d378098ff2e0e1
/achilles-core/src/main/java/info/archinnov/achilles/internals/parser/accessors/Getter.java
0dec9979c4cd5eaefe5feb058fd428f7becac0fc
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
pgbhagat/Achilles
d1280ea296704280e67fd46e102922101c832fce
bba5e456a03e488c5f978cb818d817e5008eab91
refs/heads/master
2023-08-16T04:38:03.362601
2018-02-23T11:42:23
2018-02-23T11:42:23
122,614,004
0
0
Apache-2.0
2023-08-05T18:31:17
2018-02-23T11:40:13
Java
UTF-8
Java
false
false
764
java
/* * Copyright (C) 2012-2017 DuyHai DOAN * * 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 info.archinnov.achilles.internals.parser.accessors; @FunctionalInterface public interface Getter<ENTITY, VALUEFROM> { VALUEFROM get(ENTITY entity); }
1820e1a14570e3d6f1ddf1ae11b722ac43bf9d9f
e6d8ca0907ff165feb22064ca9e1fc81adb09b95
/src/main/java/com/vmware/vim25/ProfileDeferredPolicyOptionParameter.java
30fcffaf256a0de10174b37da96e0906c0aa2965
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
incloudmanager/incloud-vijava
5821ada4226cb472c4e539643793bddeeb408726
f82ea6b5db9f87b118743d18c84256949755093c
refs/heads/inspur
2020-04-23T14:33:53.313358
2019-07-02T05:59:34
2019-07-02T05:59:34
171,236,085
0
1
BSD-3-Clause
2019-02-20T02:08:59
2019-02-18T07:32:26
Java
UTF-8
Java
false
false
2,258
java
/*================================================================================ Copyright (c) 2013 Steve Jin. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the names of copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================================*/ package com.vmware.vim25; /** * @author Steve Jin (http://www.doublecloud.org) * @version 5.1 */ @SuppressWarnings("all") public class ProfileDeferredPolicyOptionParameter extends DynamicData { public ProfilePropertyPath inputPath; public KeyAnyValue[] parameter; public ProfilePropertyPath getInputPath() { return this.inputPath; } public KeyAnyValue[] getParameter() { return this.parameter; } public void setInputPath(ProfilePropertyPath inputPath) { this.inputPath=inputPath; } public void setParameter(KeyAnyValue[] parameter) { this.parameter=parameter; } }
[ "sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1" ]
sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1
be1e53d605349bb7e08c98ec22612c84fdb538dd
c45c05d217ff12403c96e1caa7f27c4e0ebe0528
/src/test/java/tech/blacksource/blacknectar/service/BlackNectarAssertionsTest.java
1c0b5a9e3b36afca59c808ec639e21257d254443
[ "Apache-2.0" ]
permissive
BlackSourceLabs/BlackNectar-Service
2827705aa8f026322f6f0f52ab8b0fb4250d72e6
866a12638a8cca20c2f5dbc49c2d88b403bd88c5
refs/heads/develop
2021-06-18T06:05:39.558041
2017-04-19T15:31:30
2017-04-19T15:31:30
74,163,779
6
1
null
2017-04-18T20:43:40
2016-11-18T20:24:30
Java
UTF-8
Java
false
false
5,613
java
/* * Copyright 2017 BlackSource, 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 tech.blacksource.blacknectar.service; import java.util.Arrays; import com.google.gson.JsonObject; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import sir.wellington.alchemy.collections.sets.Sets; import tech.blacksource.blacknectar.ebt.balance.State; import tech.blacksource.blacknectar.ebt.balance.StateWebsiteFactory; import tech.sirwellington.alchemy.arguments.AlchemyAssertion; import tech.sirwellington.alchemy.arguments.FailedAssertionException; import tech.sirwellington.alchemy.test.junit.runners.*; import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.*; import static tech.sirwellington.alchemy.generator.AlchemyGenerator.one; import static tech.sirwellington.alchemy.test.junit.ThrowableAssertion.*; /** * @author SirWellington */ @Repeat @RunWith(AlchemyTestRunner.class) public class BlackNectarAssertionsTest { @Mock private StateWebsiteFactory websiteFactory; @GenerateString private String normalString; @GenerateString(length = BlackNectarAssertions.MAX_QUERY_PARAMETER_ARGUMENT_LENGTH * 2) private String longString; @GenerateEnum private State state; @Before public void setUp() throws Exception { setupData(); setupMocks(); } private void setupData() throws Exception { } private void setupMocks() throws Exception { when(websiteFactory.getSupportedStates()) .thenReturn(Sets.copyOf(Arrays.asList(State.values()))); } @DontRepeat @Test public void testCannotInstantiate() throws Exception { assertThrows(BlackNectarAssertions.class::newInstance); } @Test public void testArgumentWithSaneLength() throws Exception { AlchemyAssertion<String> assertion = BlackNectarAssertions.argumentWithSaneLength(); assertThat(assertion, notNullValue()); assertion.check(normalString); assertThrows(() -> assertion.check(longString)).isInstanceOf(FailedAssertionException.class); } @DontRepeat @Test public void testArgumentWithSaneLengthWithEmptyArgs() throws Exception { AlchemyAssertion<String> assertion = BlackNectarAssertions.argumentWithSaneLength(); //These checks should not cause an exception. assertion.check(""); assertion.check(null); } @Test public void testSupportedState() throws Exception { AlchemyAssertion<State> assertion = BlackNectarAssertions.supportedState(websiteFactory); assertThat(assertion, notNullValue()); assertion.check(state); } @DontRepeat @Test public void testSupportedStateWithUnsupportedState() throws Exception { when(websiteFactory.getSupportedStates()).thenReturn(Sets.emptySet()); AlchemyAssertion<State> assertion = BlackNectarAssertions.supportedState(websiteFactory); assertThat(assertion, notNullValue()); assertThrows(() -> assertion.check(state)).isInstanceOf(FailedAssertionException.class); } @DontRepeat @Test public void testSupportedStateWithBadArgs() throws Exception { assertThrows(() -> BlackNectarAssertions.supportedState(null)) .isInstanceOf(IllegalArgumentException.class); } @Test public void testObjectWithField() throws Exception { String field = normalString; String value = longString; AlchemyAssertion<JsonObject> assertion = BlackNectarAssertions.objectWithField(field); assertNotNull(assertion); JsonObject object = one(BlackNectarGenerators.jsonObjects()); object.addProperty(field, value); assertion.check(object); } @Test public void testObjectWithFieldWhenDoesNotHaveObject() throws Exception { String field = normalString; AlchemyAssertion<JsonObject> assertion = BlackNectarAssertions.objectWithField(field); assertNotNull(assertion); JsonObject object = one(BlackNectarGenerators.jsonObjects()); assertThrows(() -> assertion.check(object)).isInstanceOf(FailedAssertionException.class); } @DontRepeat @Test public void testObjectWithFieldWithBadObject() throws Exception { String field = normalString; AlchemyAssertion<JsonObject> assertion = BlackNectarAssertions.objectWithField(field); assertNotNull(assertion); assertThrows(() -> assertion.check(null)).isInstanceOf(FailedAssertionException.class); } @DontRepeat @Test public void testObjectWithFieldWithBadArgs() throws Exception { assertThrows(() -> BlackNectarAssertions.objectWithField("")).isInstanceOf(IllegalArgumentException.class); assertThrows(() -> BlackNectarAssertions.objectWithField(null)).isInstanceOf(IllegalArgumentException.class); } }
1d5bc1566d9fa92b4fc0bf1e60590ab9ae07646a
811a6ae32474291f492b97e03251cce935bb2d42
/app/src/main/java/ch/six/sixwallet/backend/six_p2p/callbacks/SendRequestCallback.java
463313bef5a23d9b5ad45aa7f4dcbba58bdc98cc
[]
no_license
paddyzab/sixwallet
226d356a1006f53400f2877e3761097e060156e9
d1a5461924b8bac7a4d5fc7ae29071e8c4f18ea4
refs/heads/master
2016-09-03T07:36:20.380669
2015-03-21T16:48:26
2015-03-21T16:48:26
32,590,162
0
1
null
2015-03-21T15:36:22
2015-03-20T15:02:18
Java
UTF-8
Java
false
false
526
java
package ch.six.sixwallet.backend.six_p2p.callbacks; import android.util.Log; import ch.six.sixwallet.Home; import retrofit.Callback; import retrofit.RetrofitError; import retrofit.client.Response; public class SendRequestCallback implements Callback { @Override public void success(Object o, Response response) { Log.d(Home.class.getSimpleName(), response.toString()); } @Override public void failure(RetrofitError error) { Log.d(Home.class.getSimpleName(), error.toString()); } }
d92565d7bdfc03f75c1eeafe736fc667110e9a3c
0b5964830c0da0608a14311df939001a43091f0c
/tutor-it-services/tutor-it-book/src/main/java/com/lz/read/service/ChildService.java
2e3c73c9d3afad9a2a0b22aa35a4daf876f241a2
[]
no_license
ring2/micro-tutor-it
af337ba860b5d4ca1a5ad778f17b178a3a695a75
a997a0392e2b8de5f1728a0675a5fae55c2521ff
refs/heads/master
2022-12-12T08:19:05.871615
2020-09-08T13:54:06
2020-09-08T13:54:06
293,824,357
0
0
null
null
null
null
UTF-8
Java
false
false
160
java
package com.lz.read.service; /** * @author : lz * @date : 2020/4/1 23:55 * description: **/ public interface ChildService{ }
00c6848767c075064918ca810b84e0827db45f19
e96faaa3164146f8e8a96b459dc05145569b6eb6
/fx-gateway-server/src/main/java/com/fx/cloud/gateway/server/service/IGatewayRouteService.java
5906496fbacbeb2648aa1751a24530197ac4580c
[]
no_license
GX13697255906/fx
55f136bbc866be06e65c6f5b1a30251316dce9a2
f36eadd067b7d74d5b540158c25c25319842e38f
refs/heads/main
2022-01-20T08:32:27.444075
2022-01-20T03:32:55
2022-01-20T03:32:55
253,255,107
0
0
null
2021-04-26T20:08:15
2020-04-05T14:32:28
Java
UTF-8
Java
false
false
469
java
package com.fx.cloud.gateway.server.service; import com.fx.cloud.gateway.server.entity.GatewayRoute; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; /** * <p> * 开放网关-路由 服务类 * </p> * * @author xun.guo * @since 2022-01-12 */ public interface IGatewayRouteService extends IService<GatewayRoute> { /** * 获取所有fx服务 * * @return */ List<GatewayRoute> getAllFxService(); }
1c9bd5d8a484d2870ea45aa043d41ca901c76463
ecf2c40f613588fa95f9c3109554f6a00be97762
/src/main/java/com/byron/base/router/Dispatcher.java
39a59debe41d1e8979d7e2a96ece5c2e8d9a3389
[]
no_license
LengBoCode/base
72b5ac539e2f95c391a80d8ac0eb2c0fae0bba9a
23f2bc68f25dd076e6bde0af808a1e4b5c694b87
refs/heads/master
2022-12-23T15:45:30.111447
2020-09-12T06:55:32
2020-09-12T06:55:32
288,433,133
0
0
null
null
null
null
UTF-8
Java
false
false
672
java
package com.byron.base.router; import java.util.HashMap; /** * 每个需要通信的组件内都有一个receiver * 组件内通信的具体动作都有一个action * Dispatcher负责统一管理receiver和action */ public class Dispatcher { private static HashMap<String, BaseReceiver> receivers = new HashMap<>(); public static void registerReceiver(String receiverName, BaseReceiver receiver) { receivers.put(receiverName, receiver); } public static void request(String receiver, String action, Response response, Object... params) { receivers.get(receiver).invokeAction(action,response, params); } }
4dfda19e41f9479a4c17da1ac2a1dbadefd19d34
39029cfbf2dbf8c7b3578963a526ffee7ff50944
/app/src/main/java/com/omnitech/blooddonationnetwork/MainActivity.java
541b9646966b3aa2961f44846c029d548ab33505
[]
no_license
FawwazFaisal/BloodDotNet
18c61045373fa3e87f1162f91809a0857b6605fd
179994b026dff69073c637cc7805a8c811107e19
refs/heads/master
2022-11-11T01:16:25.347455
2020-06-23T21:57:21
2020-06-23T21:57:21
274,460,531
0
0
null
null
null
null
UTF-8
Java
false
false
11,744
java
package com.omnitech.blooddonationnetwork; import android.Manifest; import android.app.Dialog; import android.app.ProgressDialog; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.location.LocationManager; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.preference.PreferenceManager; import android.provider.Settings; import android.view.View; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.ViewPager; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GoogleApiAvailability; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.android.material.snackbar.Snackbar; import com.google.android.material.tabs.TabLayout; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.firestore.DocumentSnapshot; import com.google.firebase.firestore.FirebaseFirestore; import com.omnitech.blooddonationnetwork.Adapter.LoginViewAdapter; import com.omnitech.blooddonationnetwork.Fragments.Login; import com.omnitech.blooddonationnetwork.Fragments.Register; public class MainActivity extends AppCompatActivity { public static final int REQUEST_CODE = 1; public static final String ID = "ID"; public static final String Age = "Age"; public static final String Gender = "Gender"; public static final String Contact = "Contact"; public static final String FINE_LOCATION = Manifest.permission.ACCESS_FINE_LOCATION; public static final String COARSE_LOCATION = Manifest.permission.ACCESS_COARSE_LOCATION; private static final String Email = "Email"; private static final String Name = "Name"; public static final String isDonator = "isDonator"; public static final String isRequester = "isRequester"; public static final String activeID = "activeID"; private static final int ERROR_DIALOGUE_REQUEST = 102; ViewPager viewPager; TabLayout tabLayout; Toolbar toolbar; ProgressDialog progressDialog; boolean isValid = true; public FirebaseAuth firebaseAuth; public FirebaseAuth.AuthStateListener mAuthStateListener; private boolean mLocationPermissionGranted = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); toolbar = findViewById(R.id.toolbar_main); tabLayout = findViewById(R.id.tablayout_main); viewPager = findViewById(R.id.view_pager_main); getLocationPermissions(); firebaseAuth = FirebaseAuth.getInstance(); mAuthStateListener = new FirebaseAuth.AuthStateListener() { @Override public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { FirebaseUser mfirebaseUser = firebaseAuth.getCurrentUser(); if (mfirebaseUser != null) { if (isServicesOK() && mLocationPermissionGranted) { Intent intent = new Intent(MainActivity.this, Flags.class); startActivity(intent); } else if (!mLocationPermissionGranted) Toast.makeText(getApplicationContext(), "Please Enable Location Permission First", Toast.LENGTH_SHORT).show(); getLocationPermissions(); return; } } }; setSupportActionBar(toolbar); viewPager.setAdapter(setAdapter()); tabLayout.setupWithViewPager(viewPager); } private PagerAdapter setAdapter() { LoginViewAdapter adapter = new LoginViewAdapter(getSupportFragmentManager()); adapter.addFragment(new Login(), "Login"); adapter.addFragment(new Register(), "Register"); return adapter; } public boolean CheckConnectivity(View view) { boolean netState; ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); netState = networkInfo != null && networkInfo.isConnected(); if (!netState) { Snackbar.make(view, "Please connect to the internet", Snackbar.LENGTH_LONG) .setAction("CLOSE", new View.OnClickListener() { @Override public void onClick(View view) { EnableWifi(view); } }) .setActionTextColor(getResources().getColor(android.R.color.holo_red_light)) .show(); return false; } if (!mLocationPermissionGranted) { Toast.makeText(getApplicationContext(), "Please Allow Location Permission First", Toast.LENGTH_SHORT).show(); getLocationPermissions(); return false; } else { return true; } } private void EnableWifi(View view) { Snackbar.make(view, "Please connect to the internet", Snackbar.LENGTH_INDEFINITE) .setAction("ENABLE", new View.OnClickListener() { @Override public void onClick(View view) { startActivityForResult(new Intent(Settings.ACTION_WIFI_SETTINGS), 2); } }) .setActionTextColor(getResources().getColor(android.R.color.holo_red_light)) .show(); } public boolean SignInUser(String email, String pass) { progressDialog = new ProgressDialog(this); progressDialog.setMessage("..Please wait.."); progressDialog.setCanceledOnTouchOutside(false); progressDialog.show(); firebaseAuth.signInWithEmailAndPassword(email, pass).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (!task.isSuccessful()) { progressDialog.dismiss(); isValid = false; } else if(task.isSuccessful() && mLocationPermissionGranted){ FirebaseFirestore.getInstance().collection("Users").document(firebaseAuth.getUid()).get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() { @Override public void onComplete(@NonNull Task<DocumentSnapshot> task) { if (task.isSuccessful()) { DocumentSnapshot doc = task.getResult(); if (doc.exists()) { SharedPreferences sharedPreferences = PreferenceManager .getDefaultSharedPreferences(MainActivity.this); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString(Name, doc.getString("name")); editor.putString(Contact, doc.getString("contact")); editor.putString(Email, doc.getString("email")); editor.putString(Age, doc.getString("age")); editor.putString(Gender, doc.getString("gender")); editor.putString(ID, doc.getId()); editor.putString(isDonator, doc.getString("isDonator")); editor.putString(isRequester, doc.getString("isRequester")); editor.putString(activeID, doc.getString("activeID")); editor.apply(); if (isServicesOK()) { Intent intent = new Intent(MainActivity.this, Flags.class); progressDialog.dismiss(); startActivity(intent); } } } } }); } else if(!mLocationPermissionGranted){ getLocationPermissions(); } } }); return isValid; } public boolean isServicesOK() { int available = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(MainActivity.this); if (available == ConnectionResult.SUCCESS) { //everything is fine and user can make map request return true; } else if (GoogleApiAvailability.getInstance().isUserResolvableError(available)) { Dialog dialog = GoogleApiAvailability.getInstance().getErrorDialog(MainActivity.this, available, ERROR_DIALOGUE_REQUEST); dialog.show(); } else { Toast.makeText(this, "you cant make map request", Toast.LENGTH_SHORT).show(); } return false; } @Override protected void onStart() { super.onStart(); if (isServicesOK() && mLocationPermissionGranted) { firebaseAuth.addAuthStateListener(mAuthStateListener); } } public void getLocationPermissions() { String[] permissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}; if (ContextCompat.checkSelfPermission(this.getApplicationContext(), FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.checkSelfPermission(this.getApplicationContext(), COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) { mLocationPermissionGranted = true; } } else { ActivityCompat.requestPermissions(this, permissions, REQUEST_CODE); } } public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == REQUEST_CODE) { if (grantResults.length > 0) { for (int i = 0; i < grantResults.length; i++) { if (grantResults[i] != PackageManager.PERMISSION_GRANTED) { return; } else mLocationPermissionGranted = true; } } } } @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 2) { ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (networkInfo.isConnected() && networkInfo != null) { startActivity(new Intent(MainActivity.this, MainActivity.class)); } } } }
0b205454ffa163fc970044dfa4af03e27a275746
ba4112172790b1c55a0640ee7c6ae69fc3939098
/src/RadarChartPlatform.java
4266fe51f907f72cc00238bde4766b35c93ae975
[]
no_license
RoloAdriana/TFG_Adriana_Rolo_inchausti
f7ae2756d789d9d899077eec42690668a66a17a0
5c571b1c4469f9d5559736b8eedee75514e14f88
refs/heads/master
2016-09-06T04:37:46.946315
2015-06-21T17:58:31
2015-06-21T17:58:31
37,819,697
0
0
null
null
null
null
UTF-8
Java
false
false
2,976
java
import java.awt.*; import org.jfree.chart.*; import org.jfree.chart.plot.*; import org.jfree.chart.labels.*; import org.jfree.chart.title.*; import org.jfree.data.category.*; import org.jfree.ui.ApplicationFrame; import org.jfree.ui.RefineryUtilities; import org.jfree.util.*; public class RadarChartPlatform extends ApplicationFrame { /** * */ private static final long serialVersionUID = 1L; public DefaultCategoryDataset dataset; public SpiderWebPlot plot; public RadarChartPlatform(String title, String[] features) { super(title); String series1 = "First"; String series2 = "Second"; String series3 = "Third"; String category1 = "puntos"; String category2 = "ObjetosCogidos"; String category3 = "tiempoJuego"; String category4 = "EnemigosAcabados"; String category5 = "flechaDerecha"; String category6 = "flechaIzqda"; String category7 = "saltos"; String category8 = "vidasPerdidasCaidas"; String category9 = "vidasPerdidasEnemigos"; DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(5.0, series1, category1); dataset.addValue(5.0, series1, category2); dataset.addValue(5.0, series1, category3); dataset.addValue(5.0, series1, category4); dataset.addValue(5.0, series1, category5); dataset.addValue(5.0, series1, category6); dataset.addValue(5.0, series1, category7); dataset.addValue(5.0, series1, category8); dataset.addValue(5.0, series1, category9); dataset.addValue(2.0, series2, category1); dataset.addValue(4.0, series2, category2); dataset.addValue(5.0, series2, category3); dataset.addValue(3.0, series2, category4); dataset.addValue(3.9, series2, category5); dataset.addValue(4.3, series2, category6); dataset.addValue(5.0, series2, category7); dataset.addValue(3.5, series2, category8); dataset.addValue(4.0, series2, category9); SpiderWebPlot plot = new SpiderWebPlot(dataset); plot.setStartAngle(90); plot.setInteriorGap(0.20); plot.setToolTipGenerator(new StandardCategoryToolTipGenerator()); JFreeChart chart = new JFreeChart("", TextTitle.DEFAULT_FONT, plot, false); ChartUtilities.applyCurrentTheme(chart); ChartPanel chartPanel = new ChartPanel(chart); this.plot = (SpiderWebPlot) chartPanel.getChart().getPlot(); this.dataset = (DefaultCategoryDataset) plot.getDataset(); chartPanel.setPreferredSize(new Dimension(500, 270)); setContentPane(chartPanel); } public static void main(String[] args) { RadarChartPlatform demo = new RadarChartPlatform("Chart"); demo.pack(); RefineryUtilities.centerFrameOnScreen(demo); demo.setVisible(true); } }
435a137212d844365f5ae06fc51a22d7d339696f
e76b9c328c32f3bc19148ce1b42fd2a2aea182e2
/src/main/java/info/smartkit/eip/obtuse_octo_prune/configs/StaticResourceConfiguration.java
7d3bb4080bf1bb12c5658a8bc01a045669124b60
[ "MIT" ]
permissive
yangboz/spring-boot-elasticsearch-LIRE-docker
8e84a2b4743189c6f766c348a9c524b88f795693
70414fa7555bb00dd055ccb249067f572b3486e1
refs/heads/master
2021-07-22T07:31:23.966678
2017-11-01T15:21:31
2017-11-01T15:21:31
44,301,575
7
5
null
null
null
null
UTF-8
Java
false
false
1,263
java
package info.smartkit.eip.obtuse_octo_prune.configs; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration public class StaticResourceConfiguration extends WebMvcConfigurerAdapter { private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { "classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"}; /** * Add our static resources folder mapping. */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { // registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); // registry.addResourceHandler("/uploads/**").addResourceLocations( "classpath:/uploads/"); // Jasper report registry.addResourceHandler("/static/**").addResourceLocations( "classpath:/static/"); // registry.addResourceHandler("/reports/**").addResourceLocations("classpath:/reports/"); // super.addResourceHandlers(registry); } }
d41bd071a1ccc1c24e33de30e1e68281cbdf3db6
9c27398b8808a59b476ea7f7b82a6faaa50e4027
/src/main/java/br/alura/patterns/memento/Contrato.java
142f6eeafc7e23cfa9c1901bd813ff9b17883085
[]
no_license
gabrielsmartins/design-patterns-II
09605f18708640c729c377d3ac8b6df0779ae126
80b7a22a0c0ca7938dd314f0af772e1123058581
refs/heads/master
2022-01-24T18:16:01.702605
2019-10-20T18:37:26
2019-10-20T18:37:26
216,408,972
0
0
null
2022-01-21T23:32:33
2019-10-20T18:36:02
Java
UTF-8
Java
false
false
1,125
java
package br.alura.patterns.memento; import java.time.LocalDateTime; public class Contrato { private LocalDateTime data; private String cliente; private TipoContrato tipo; public Contrato(LocalDateTime data, String cliente, TipoContrato tipo) { this.data = data; this.cliente = cliente; this.tipo = tipo; } public LocalDateTime getData() { return data; } public String getCliente() { return cliente; } public TipoContrato getTipo() { return tipo; } public void avanca() { if(this.tipo == TipoContrato.NOVO) this.tipo = TipoContrato.EM_ANDAMENTO; else if(this.tipo == TipoContrato.EM_ANDAMENTO) this.tipo = TipoContrato.ACERTADO; else if(this.tipo == TipoContrato.ACERTADO) this.tipo = TipoContrato.CONCLUIDO; } public Estado salvaEstado() { return new Estado(new Contrato(this.data, this.cliente, this.tipo)); } public void restaura(Estado estado) { this.data = estado.getContrato().getData(); this.cliente = estado.getContrato().getCliente(); this.tipo = estado.getContrato().getTipo(); } }
772419905df676d67d98219b8e6aee5b3f17ef7b
2b8c4443062c92ebed1093a979c92a5e38a5d70a
/src/main/java/com/korabelska/demo/repository/impl/DoctorRepositoryImpl.java
511764c10851a0e3e6ec173a204e6382ca415245
[]
no_license
yuliiakorabelska/data-jdbc
cb30d08bb9a56bc45de5c8c985c8a4d38ba34d0a
b8f0d106b6c741837e82af30a48822c94a1d3763
refs/heads/master
2022-06-09T18:31:42.193080
2020-05-05T13:50:13
2020-05-05T13:50:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,854
java
package com.korabelska.demo.repository.impl; import com.google.cloud.spanner.Key; import com.korabelska.demo.exceptions.EntityNotFoundException; import com.korabelska.demo.model.Doctor; import com.korabelska.demo.repository.BaseRepository; import org.springframework.cloud.gcp.data.spanner.core.SpannerTemplate; import org.springframework.stereotype.Repository; import java.util.List; import java.util.Optional; import java.util.UUID; @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Repository public class DoctorRepositoryImpl extends BaseRepository<Doctor, String> { private static final Class<Doctor> REPOSITORY_CLASS = Doctor.class; public DoctorRepositoryImpl(SpannerTemplate spannerTemplate) { super(spannerTemplate); } @Override public Doctor create(Doctor doctor) { doctor.setDoctorId(UUID.randomUUID().toString()); spannerTemplate.insert(doctor); return doctor; } @Override public Doctor updateExisting(Doctor doctor) throws EntityNotFoundException { Key key = Key.of(doctor.getHospitalId(), doctor.getDepartmentId(), doctor.getDoctorId()); if (spannerTemplate.existsById(REPOSITORY_CLASS, key)) { spannerTemplate.update(doctor); return doctor; } throw new EntityNotFoundException(doctor.getDoctorId()); } @Override public List<Doctor> findAll() { List<Doctor> doctors = spannerTemplate.readAll(REPOSITORY_CLASS); return doctors; } @Override public Optional<Doctor> findByKey(String... keys) { Doctor doctor = spannerTemplate.read(REPOSITORY_CLASS, Key.of(keys)); return Optional.ofNullable(doctor); } @Override public void deleteByKey(String... keys) { spannerTemplate.delete(REPOSITORY_CLASS, Key.of(keys)); } }
76accde9069424c364bf7d3793303374545a89a3
a65ef3e98a8218ae774cbf000e6ba408abd5533a
/WebApp18/src/com/test/FriendDTO.java
3c650515a0c7fb2cedb2553796e40307fd84328d
[]
no_license
SaeRomii/WebStudy
b5f510b63622a272bab228ace510ab357abbba21
58a37fb87d8384deeb78905214b7b610c97abaa6
refs/heads/main
2023-05-29T00:00:34.972254
2021-06-09T14:04:09
2021-06-09T14:04:09
362,139,361
0
0
null
null
null
null
UTF-8
Java
false
false
773
java
/*===================== FriendDTO.java =====================*/ package com.test; public class FriendDTO { private String userName; //-- 이름 private String userAge; //-- 나이 private String gender; //-- 성별 private String[] boys; //-- 이상형 // getter / setter public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserAge() { return userAge; } public void setUserAge(String userAge) { this.userAge = userAge; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public String[] getBoys() { return boys; } public void setBoys(String[] boys) { this.boys = boys; } }
d9fc5b99c9f39a229a7ccd195d976aab4ec092b2
3c5a076e323b58cd8cee661200840ed698897484
/JAVA/spring/springfm-di-annotation/springfm-di-annotation/src/main/java/com/liteworm/App.java
8183cc600fa6a4261cfb732307853a8668fcc8e2
[ "Apache-2.0" ]
permissive
LiteWorm/wormlearning
a221f6dd94004aec635ade991f44555497d5e163
64fd89cc53e65f264a5c134d207403c5a2565e92
refs/heads/master
2023-09-01T18:53:12.268838
2023-08-31T01:27:00
2023-08-31T01:27:00
249,720,611
0
1
Apache-2.0
2023-08-23T05:33:53
2020-03-24T13:50:29
Java
UTF-8
Java
false
false
175
java
package com.liteworm; /** * Hello world! * */ public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); } }
b71c28de89732397e11b046ddebf6b2fa4c4cce2
45b77c4898fff71af1604f244fe65b665cfbfb66
/src/main/java/com/example/web/controller/TweetController.java
f7932042964f895ffb10ff2156904c6a9113c39c
[]
no_license
rokuyamad/pictweet_java
945f3a96984515d03c57d50cfa0b0e6265e4b546
874146de71feb231c1dd821972b8380c66f72a37
refs/heads/master
2021-10-10T06:02:37.572372
2019-01-07T13:38:09
2019-01-07T13:38:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,058
java
package com.example.web.controller; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.web.PageableDefault; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import com.example.business.domain.Tweet; import com.example.business.domain.User; import com.example.business.repository.TweetRepository; import com.example.business.repository.UserRepository; import com.example.util.UserCustom; @Controller public class TweetController { @Autowired private TweetRepository tweetRepository; @Autowired private UserRepository userRepository; @ModelAttribute(name = "login_user") public UserDetails setLoginUser(@AuthenticationPrincipal UserDetails userDetails) { return userDetails; } @RequestMapping(value = "/", method = RequestMethod.GET) public ModelAndView index(@PageableDefault(size = 5) Pageable pageable, ModelAndView mav, @AuthenticationPrincipal UserDetails userDetails) { Page<Tweet> tweets = tweetRepository.findAllByOrderByIdDesc(pageable); mav.addObject("tweets", tweets); mav.addObject("login_user", userDetails); mav.setViewName("tweet/index"); return mav; } @RequestMapping(value = "/tweet/new", method = RequestMethod.GET) public ModelAndView newTweet(ModelAndView mav) { mav.setViewName("tweet/new"); return mav; } @RequestMapping(value = "/tweet/new", method = RequestMethod.POST) public ModelAndView createTweet(@ModelAttribute Tweet tweet, @AuthenticationPrincipal UserCustom userCustom , ModelAndView mav) { User user = userRepository.findOne(userCustom.getId()); tweet.setUser(user); tweetRepository.saveAndFlush(tweet); mav.setViewName("tweet/create"); return mav; } @RequestMapping(value = "/tweet/{id}/edit", method = RequestMethod.GET) public ModelAndView editTweet(@PathVariable("id") Long id, ModelAndView mav) { Tweet tweet = tweetRepository.findOne(id); mav.addObject("tweet", tweet); mav.setViewName("tweet/edit"); return mav; } @RequestMapping(value = "/tweet/{id}/edit", method = RequestMethod.POST) public ModelAndView updateTweet(@ModelAttribute Tweet editTweet, @PathVariable("id") Long id, @AuthenticationPrincipal UserCustom userCustom, ModelAndView mav) { Tweet tweet = tweetRepository.findOne(id); if (!tweet.getUser().getId().equals(userCustom.getId())) { mav.setViewName("redirect:/tweet/" + id + "/edit"); return mav; } BeanUtils.copyProperties(editTweet, tweet); tweetRepository.save(tweet); mav.setViewName("tweet/update"); return mav; } @RequestMapping(value = "/tweet/{id}/delete", method = RequestMethod.POST) public ModelAndView deleteTweet(@PathVariable("id") Long id, @AuthenticationPrincipal UserCustom userCustom, ModelAndView mav) { Tweet tweet = tweetRepository.findOne(id); if (!tweet.getUser().getId().equals(userCustom.getId())) { mav.setViewName("redirect:/"); return mav; } tweetRepository.delete(tweet); mav.setViewName("redirect:/"); return mav; } @RequestMapping(value = "/tweet/{id}", method = RequestMethod.GET) ModelAndView show(@PathVariable Long id, ModelAndView mav) { Tweet tweet = tweetRepository.findOne(id); mav.addObject("tweet", tweet); mav.setViewName("tweet/show"); return mav; } }
56ee06f3fc3605d613635d7fe029feabd009e0f7
977bc9c6bcf97364015de2dffa99c42306e422d7
/src/AnnotationTest/AnnotationLogic.java
643e4203d53432373978485c6a3c8144f1ab70b5
[]
no_license
MeiChen26/LeetcodeTest
e6911047d34ee4c1b227d0d503118f76867822ea
85466f48c1ca935a0a21c15a1fbba22243b523a9
refs/heads/master
2021-02-07T20:23:01.427744
2020-03-23T04:31:07
2020-03-23T04:31:07
244,073,074
0
0
null
null
null
null
UTF-8
Java
false
false
657
java
package AnnotationTest; import java.lang.reflect.Method; public class AnnotationLogic { public static void annotationLogic() { Class useAnnotationClass = UseAnnotation.class; for(Method method : useAnnotationClass.getMethods()) { SimpleAnnotation simpleAnnotation = (SimpleAnnotation)method.getAnnotation(SimpleAnnotation.class); if(simpleAnnotation != null) { System.out.println(" Method Name : " + method.getName()); System.out.println(" value : " + simpleAnnotation.value()); System.out.println(" --------------------------- "); } } } }
8e496177009633c6c9e1926f2c8c3eb661a2f358
1dfd0e45975f1cf7ff9f9561ff2cc18559e5c7df
/Projects/中证技术CMS/zzjscms/src/main/java/com/zzjs/cms/entity/vo/ComponentTypeVo.java
58fa367069ab4cfcd577f0b1012237e2515e2975
[ "Apache-2.0" ]
permissive
fengmoboygithub/main_respository
20434a7a676707916a035d4f19f40dba56f26186
c17bc196ae606ce4af503b68af7a926a8e677986
refs/heads/master
2023-01-12T23:43:15.501710
2020-11-18T15:48:48
2020-11-18T15:48:48
313,973,726
0
0
null
null
null
null
UTF-8
Java
false
false
2,185
java
package com.zzjs.cms.entity.vo; import java.util.Date; import java.util.List; import com.zzjs.cms.constant.ComponentTypeConstant; import com.zzjs.cms.entity.Component; /** * 组件类型vo类 * * @author yinlong * */ public class ComponentTypeVo { /** * 组件类型ID */ private long tpCompTypeId; /** * 组件类型名称 */ private String compTypeName; /** * 组件提示 */ private String compTypeTip; /** * 排序 */ private int tpSort; /** * 创建时间 */ private Date tpCreateTime; /** * 更新时间 */ private Date tpUpdateTime; /** * 组件类型描述 */ private ComponentTypeConstant.compTypeDesc compTypeDesc; /** * html页面对应标签id */ private String htmlId; /** * 组件类型下的所有组件 */ private List<Component> components; public List<Component> getComponents() { return components; } public void setComponents(List<Component> components) { this.components = components; } public long getTpCompTypeId() { return tpCompTypeId; } public void setTpCompTypeId(long tpCompTypeId) { this.tpCompTypeId = tpCompTypeId; } public String getCompTypeName() { return compTypeName; } public void setCompTypeName(String compTypeName) { this.compTypeName = compTypeName; } public String getCompTypeTip() { return compTypeTip; } public void setCompTypeTip(String compTypeTip) { this.compTypeTip = compTypeTip; } public int getTpSort() { return tpSort; } public void setTpSort(int tpSort) { this.tpSort = tpSort; } public Date getTpCreateTime() { return tpCreateTime; } public void setTpCreateTime(Date tpCreateTime) { this.tpCreateTime = tpCreateTime; } public Date getTpUpdateTime() { return tpUpdateTime; } public void setTpUpdateTime(Date tpUpdateTime) { this.tpUpdateTime = tpUpdateTime; } public ComponentTypeConstant.compTypeDesc getCompTypeDesc() { return compTypeDesc; } public void setCompTypeDesc(ComponentTypeConstant.compTypeDesc compTypeDesc) { this.compTypeDesc = compTypeDesc; } public String getHtmlId() { return htmlId; } public void setHtmlId(String htmlId) { this.htmlId = htmlId; } }
28586d568fb7f3c837a3f284387318bc8dd79b57
8e61a9658370a6ddb46316c9930d14aa6b37902f
/src/JP420000/bssv/e1/oracle/ShowSalesDetailLinePricing.java
bac21a7d9bcbe0646e30be04b02bcfa446d19be8
[]
no_license
alanOO7/JDE_SOAP
dc1b1c1bfd7063542af8062bd61bcf165d84bcbc
7fc78ee5510a61bd0f7ffe75265b4aac023b372e
refs/heads/master
2020-05-31T14:10:55.762874
2019-06-05T05:34:56
2019-06-05T05:34:56
190,322,382
0
0
null
null
null
null
UTF-8
Java
false
false
17,997
java
/** * ShowSalesDetailLinePricing.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package JP420000.bssv.e1.oracle; public class ShowSalesDetailLinePricing extends JP420000.bssv.e1.oracle.ValueObject implements java.io.Serializable { private java.lang.String adjustmentScheduleCode; private java.util.Calendar datePriceEffective; private java.lang.String itemPriceGroupCode; private java.lang.String priceCode1; private java.lang.String priceCode2; private java.lang.String priceCode3; private java.math.BigDecimal priceExtendedDomestic; private java.math.BigDecimal priceExtendedForeign; private java.math.BigDecimal priceUnitDomestic; private java.math.BigDecimal priceUnitForeign; private java.lang.String unitOfMeasureCodePricing; public ShowSalesDetailLinePricing() { } public ShowSalesDetailLinePricing( java.lang.String adjustmentScheduleCode, java.util.Calendar datePriceEffective, java.lang.String itemPriceGroupCode, java.lang.String priceCode1, java.lang.String priceCode2, java.lang.String priceCode3, java.math.BigDecimal priceExtendedDomestic, java.math.BigDecimal priceExtendedForeign, java.math.BigDecimal priceUnitDomestic, java.math.BigDecimal priceUnitForeign, java.lang.String unitOfMeasureCodePricing) { this.adjustmentScheduleCode = adjustmentScheduleCode; this.datePriceEffective = datePriceEffective; this.itemPriceGroupCode = itemPriceGroupCode; this.priceCode1 = priceCode1; this.priceCode2 = priceCode2; this.priceCode3 = priceCode3; this.priceExtendedDomestic = priceExtendedDomestic; this.priceExtendedForeign = priceExtendedForeign; this.priceUnitDomestic = priceUnitDomestic; this.priceUnitForeign = priceUnitForeign; this.unitOfMeasureCodePricing = unitOfMeasureCodePricing; } /** * Gets the adjustmentScheduleCode value for this ShowSalesDetailLinePricing. * * @return adjustmentScheduleCode */ public java.lang.String getAdjustmentScheduleCode() { return adjustmentScheduleCode; } /** * Sets the adjustmentScheduleCode value for this ShowSalesDetailLinePricing. * * @param adjustmentScheduleCode */ public void setAdjustmentScheduleCode(java.lang.String adjustmentScheduleCode) { this.adjustmentScheduleCode = adjustmentScheduleCode; } /** * Gets the datePriceEffective value for this ShowSalesDetailLinePricing. * * @return datePriceEffective */ public java.util.Calendar getDatePriceEffective() { return datePriceEffective; } /** * Sets the datePriceEffective value for this ShowSalesDetailLinePricing. * * @param datePriceEffective */ public void setDatePriceEffective(java.util.Calendar datePriceEffective) { this.datePriceEffective = datePriceEffective; } /** * Gets the itemPriceGroupCode value for this ShowSalesDetailLinePricing. * * @return itemPriceGroupCode */ public java.lang.String getItemPriceGroupCode() { return itemPriceGroupCode; } /** * Sets the itemPriceGroupCode value for this ShowSalesDetailLinePricing. * * @param itemPriceGroupCode */ public void setItemPriceGroupCode(java.lang.String itemPriceGroupCode) { this.itemPriceGroupCode = itemPriceGroupCode; } /** * Gets the priceCode1 value for this ShowSalesDetailLinePricing. * * @return priceCode1 */ public java.lang.String getPriceCode1() { return priceCode1; } /** * Sets the priceCode1 value for this ShowSalesDetailLinePricing. * * @param priceCode1 */ public void setPriceCode1(java.lang.String priceCode1) { this.priceCode1 = priceCode1; } /** * Gets the priceCode2 value for this ShowSalesDetailLinePricing. * * @return priceCode2 */ public java.lang.String getPriceCode2() { return priceCode2; } /** * Sets the priceCode2 value for this ShowSalesDetailLinePricing. * * @param priceCode2 */ public void setPriceCode2(java.lang.String priceCode2) { this.priceCode2 = priceCode2; } /** * Gets the priceCode3 value for this ShowSalesDetailLinePricing. * * @return priceCode3 */ public java.lang.String getPriceCode3() { return priceCode3; } /** * Sets the priceCode3 value for this ShowSalesDetailLinePricing. * * @param priceCode3 */ public void setPriceCode3(java.lang.String priceCode3) { this.priceCode3 = priceCode3; } /** * Gets the priceExtendedDomestic value for this ShowSalesDetailLinePricing. * * @return priceExtendedDomestic */ public java.math.BigDecimal getPriceExtendedDomestic() { return priceExtendedDomestic; } /** * Sets the priceExtendedDomestic value for this ShowSalesDetailLinePricing. * * @param priceExtendedDomestic */ public void setPriceExtendedDomestic(java.math.BigDecimal priceExtendedDomestic) { this.priceExtendedDomestic = priceExtendedDomestic; } /** * Gets the priceExtendedForeign value for this ShowSalesDetailLinePricing. * * @return priceExtendedForeign */ public java.math.BigDecimal getPriceExtendedForeign() { return priceExtendedForeign; } /** * Sets the priceExtendedForeign value for this ShowSalesDetailLinePricing. * * @param priceExtendedForeign */ public void setPriceExtendedForeign(java.math.BigDecimal priceExtendedForeign) { this.priceExtendedForeign = priceExtendedForeign; } /** * Gets the priceUnitDomestic value for this ShowSalesDetailLinePricing. * * @return priceUnitDomestic */ public java.math.BigDecimal getPriceUnitDomestic() { return priceUnitDomestic; } /** * Sets the priceUnitDomestic value for this ShowSalesDetailLinePricing. * * @param priceUnitDomestic */ public void setPriceUnitDomestic(java.math.BigDecimal priceUnitDomestic) { this.priceUnitDomestic = priceUnitDomestic; } /** * Gets the priceUnitForeign value for this ShowSalesDetailLinePricing. * * @return priceUnitForeign */ public java.math.BigDecimal getPriceUnitForeign() { return priceUnitForeign; } /** * Sets the priceUnitForeign value for this ShowSalesDetailLinePricing. * * @param priceUnitForeign */ public void setPriceUnitForeign(java.math.BigDecimal priceUnitForeign) { this.priceUnitForeign = priceUnitForeign; } /** * Gets the unitOfMeasureCodePricing value for this ShowSalesDetailLinePricing. * * @return unitOfMeasureCodePricing */ public java.lang.String getUnitOfMeasureCodePricing() { return unitOfMeasureCodePricing; } /** * Sets the unitOfMeasureCodePricing value for this ShowSalesDetailLinePricing. * * @param unitOfMeasureCodePricing */ public void setUnitOfMeasureCodePricing(java.lang.String unitOfMeasureCodePricing) { this.unitOfMeasureCodePricing = unitOfMeasureCodePricing; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof ShowSalesDetailLinePricing)) return false; ShowSalesDetailLinePricing other = (ShowSalesDetailLinePricing) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = super.equals(obj) && ((this.adjustmentScheduleCode==null && other.getAdjustmentScheduleCode()==null) || (this.adjustmentScheduleCode!=null && this.adjustmentScheduleCode.equals(other.getAdjustmentScheduleCode()))) && ((this.datePriceEffective==null && other.getDatePriceEffective()==null) || (this.datePriceEffective!=null && this.datePriceEffective.equals(other.getDatePriceEffective()))) && ((this.itemPriceGroupCode==null && other.getItemPriceGroupCode()==null) || (this.itemPriceGroupCode!=null && this.itemPriceGroupCode.equals(other.getItemPriceGroupCode()))) && ((this.priceCode1==null && other.getPriceCode1()==null) || (this.priceCode1!=null && this.priceCode1.equals(other.getPriceCode1()))) && ((this.priceCode2==null && other.getPriceCode2()==null) || (this.priceCode2!=null && this.priceCode2.equals(other.getPriceCode2()))) && ((this.priceCode3==null && other.getPriceCode3()==null) || (this.priceCode3!=null && this.priceCode3.equals(other.getPriceCode3()))) && ((this.priceExtendedDomestic==null && other.getPriceExtendedDomestic()==null) || (this.priceExtendedDomestic!=null && this.priceExtendedDomestic.equals(other.getPriceExtendedDomestic()))) && ((this.priceExtendedForeign==null && other.getPriceExtendedForeign()==null) || (this.priceExtendedForeign!=null && this.priceExtendedForeign.equals(other.getPriceExtendedForeign()))) && ((this.priceUnitDomestic==null && other.getPriceUnitDomestic()==null) || (this.priceUnitDomestic!=null && this.priceUnitDomestic.equals(other.getPriceUnitDomestic()))) && ((this.priceUnitForeign==null && other.getPriceUnitForeign()==null) || (this.priceUnitForeign!=null && this.priceUnitForeign.equals(other.getPriceUnitForeign()))) && ((this.unitOfMeasureCodePricing==null && other.getUnitOfMeasureCodePricing()==null) || (this.unitOfMeasureCodePricing!=null && this.unitOfMeasureCodePricing.equals(other.getUnitOfMeasureCodePricing()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = super.hashCode(); if (getAdjustmentScheduleCode() != null) { _hashCode += getAdjustmentScheduleCode().hashCode(); } if (getDatePriceEffective() != null) { _hashCode += getDatePriceEffective().hashCode(); } if (getItemPriceGroupCode() != null) { _hashCode += getItemPriceGroupCode().hashCode(); } if (getPriceCode1() != null) { _hashCode += getPriceCode1().hashCode(); } if (getPriceCode2() != null) { _hashCode += getPriceCode2().hashCode(); } if (getPriceCode3() != null) { _hashCode += getPriceCode3().hashCode(); } if (getPriceExtendedDomestic() != null) { _hashCode += getPriceExtendedDomestic().hashCode(); } if (getPriceExtendedForeign() != null) { _hashCode += getPriceExtendedForeign().hashCode(); } if (getPriceUnitDomestic() != null) { _hashCode += getPriceUnitDomestic().hashCode(); } if (getPriceUnitForeign() != null) { _hashCode += getPriceUnitForeign().hashCode(); } if (getUnitOfMeasureCodePricing() != null) { _hashCode += getUnitOfMeasureCodePricing().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(ShowSalesDetailLinePricing.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("http://oracle.e1.bssv.JP420000/", "showSalesDetailLinePricing")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("adjustmentScheduleCode"); elemField.setXmlName(new javax.xml.namespace.QName("", "adjustmentScheduleCode")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("datePriceEffective"); elemField.setXmlName(new javax.xml.namespace.QName("", "datePriceEffective")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("itemPriceGroupCode"); elemField.setXmlName(new javax.xml.namespace.QName("", "itemPriceGroupCode")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("priceCode1"); elemField.setXmlName(new javax.xml.namespace.QName("", "priceCode1")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("priceCode2"); elemField.setXmlName(new javax.xml.namespace.QName("", "priceCode2")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("priceCode3"); elemField.setXmlName(new javax.xml.namespace.QName("", "priceCode3")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("priceExtendedDomestic"); elemField.setXmlName(new javax.xml.namespace.QName("", "priceExtendedDomestic")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "decimal")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("priceExtendedForeign"); elemField.setXmlName(new javax.xml.namespace.QName("", "priceExtendedForeign")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "decimal")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("priceUnitDomestic"); elemField.setXmlName(new javax.xml.namespace.QName("", "priceUnitDomestic")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "decimal")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("priceUnitForeign"); elemField.setXmlName(new javax.xml.namespace.QName("", "priceUnitForeign")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "decimal")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("unitOfMeasureCodePricing"); elemField.setXmlName(new javax.xml.namespace.QName("", "unitOfMeasureCodePricing")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
ce94a9017be6206d736d746beb840b33ef5bc3bb
96c161bbc218794a1c7216af301ebcd584265ae6
/src/dbQuery/MySqlImageTest.java
de78c82d3262b7503acf2327097228c3649eff48
[]
no_license
dpmihai/test
b23d57812156d174990e819be7fa878c2957b16a
0eab964edfc13ebd1a7179d806cb2b5e6d2772a4
refs/heads/master
2020-04-15T22:50:03.796014
2017-07-28T12:33:03
2017-07-28T12:33:03
6,610,594
1
1
null
null
null
null
UTF-8
Java
false
false
2,464
java
package dbQuery; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.OutputStream; import java.sql.Blob; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class MySqlImageTest { public static Connection openConnection(String username, String password) throws SQLException { try { Class.forName("com.mysql.jdbc.Driver"); } catch (java.lang.ClassNotFoundException e) { throw new SQLException("Cannot load database driver"); } String url = "jdbc:mysql://vs511.intranet.asf.ro/nextdemo"; return DriverManager.getConnection(url, username, password); } public static void insertImage(Connection conn, String name, String img) { int len; PreparedStatement pstmt; try { String query = "INSERT INTO images VALUES (?, ?)"; File file = new File(img); FileInputStream fis = new FileInputStream(file); len = (int) file.length(); pstmt = conn.prepareStatement(query); pstmt.setString(1, name); pstmt.setBinaryStream(2, fis, len); pstmt.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } } public static void getImageData(Connection conn, String name) { byte[] fileBytes; String query; try { query = "select image from images where name like '" + name + "'"; Statement state = conn.createStatement(); ResultSet rs = state.executeQuery(query); if (rs.next()) { Blob aBlob = rs.getBlob(1); fileBytes = aBlob.getBytes(1, (int) aBlob.length()); OutputStream targetFile = new FileOutputStream("d://new.png"); targetFile.write(fileBytes); targetFile.close(); } } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { Connection con = null; try { con = openConnection("nextuser", "zefcaHet5"); System.out.println("Connected"); insertImage(con, "Mike", "D:\\Public\\nextreports-server-os\\webapp\\images\\alarm.png"); System.out.println("Image inserted"); getImageData(con, "Mike"); System.out.println("Image read"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { if (con != null) { try { con.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } }
d95c87ae2d08c56bd2fb944fb37b057928e61588
4c81abdbfb3d32ca3285ce5ab74c390d63e8ed7d
/app/src/main/java/smart/budget/expense/base/BaseActivity.java
80262ce9c43eef42770017250da112025f38e482
[ "MIT" ]
permissive
dhirajkumarsan/Expense
4cfceab7491511aee4df326c0952ebeae7f7a34f
6ead68a11d1415b83851db40537b1b38c9cc44be
refs/heads/master
2023-02-16T09:48:33.020802
2021-01-06T17:04:36
2021-01-06T17:04:36
325,222,834
0
0
null
null
null
null
UTF-8
Java
false
false
293
java
package smart.budget.expense.base; import androidx.appcompat.app.AppCompatActivity; import com.google.firebase.auth.FirebaseAuth; public class BaseActivity extends AppCompatActivity { public String getUid() { return FirebaseAuth.getInstance().getCurrentUser().getUid(); } }
bd8108c690970b1f487845a92f37fac652154091
e18fc8d3cedf8499df91de319801095f52e11081
/src/main/java/ru/progect/AppMain.java
ba28649747402c64ba27a57fe9b7ab28eab6771b
[]
no_license
SheeRMooN/springF
ae03d5fd94254085b785f5c17f0bbac3d1e5f17f
a8a504ad51c06be2d2bd433094614c41f5af179c
refs/heads/master
2023-03-28T00:27:54.967291
2021-03-30T12:01:10
2021-03-30T12:01:10
352,735,626
0
0
null
null
null
null
UTF-8
Java
false
false
759
java
package ru.progect; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import ru.progect.musicType.MusicPlayers; public class AppMain { public static void main(String[] args) { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( SpringConfig.class ); // SingletonWater singletonWater = context.getBean("singletonWater", SingletonWater.class); // PrototypeWater prototypeWater = context.getBean("prototypeWater", PrototypeWater.class); // // singletonWater.hashOut(); // prototypeWater.hashOut(); MusicPlayers musicPlayers = context.getBean("musicPlayers", MusicPlayers.class); musicPlayers.playMusic(); } }