blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
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
684M
โŒ€
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
132 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
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
bcbb2e6565ba2af556e464f2d8e97b038bea6c9a
e75461eec5614d258c028a324ece2e8a7670f4d6
/sem6/podstawy_jezyka_java/java-crud-homework/src/main/java/crud/crud/ContactManager.java
772d3c1d631f155fb31aa4e25909e555209d539b
[]
no_license
d33tah/studies
ac864e252a870d4e5e64aa3ba1c6fceca5e0fa2a
85809aec5ae5e3d87fd00af7844c7ba630c373e1
refs/heads/master
2021-01-01T19:24:50.872885
2013-12-20T19:34:38
2013-12-20T19:34:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
945
java
package crud.crud; import java.util.List; import org.hibernate.Session; import org.hibernate.Transaction; public class ContactManager { Session session; public ContactManager(Session session) { this.session = session; } public void create(String name, String email) { Transaction tx = session.beginTransaction(); Contact myContact = new Contact(name, email); session.save(myContact); session.flush(); tx.commit(); } @SuppressWarnings("unchecked") public List<Contact> read() { return session.createQuery("from Contact").list(); } public void delete(Contact contact) { Transaction tx = session.beginTransaction(); session.delete(contact); session.flush(); tx.commit(); } public void update(Contact contact, String name, String email) { Transaction tx = session.beginTransaction(); contact.setName(name); contact.setEmail(email); session.save(contact); session.flush(); tx.commit(); } }
[ "d33tah@gmail.com" ]
d33tah@gmail.com
f85711e1a18cda644e1545a923a7b6b0433d6293
397e7a5c6f973f17b0a81ae4edeea02fcc437c11
/android/app/src/main/java/com/karangandhi/stackoverflowclone/Firebase/FirebaseAuthService.java
33e3e276611f5519b5685010b2d3bda7beda8cbe
[]
no_license
Karan-Gandhi/StackOverflow-Clone
b6fbd648cf23d1426157dea1312f565f7ecc8ca5
260295857f4eb0b01348a345c7d8f7d2626075fc
refs/heads/master
2023-01-02T01:09:20.525398
2020-10-16T18:47:29
2020-10-16T18:47:29
294,978,421
0
0
null
null
null
null
UTF-8
Java
false
false
6,220
java
package com.karangandhi.stackoverflowclone.Firebase; import com.google.cloud.firestore.QueryDocumentSnapshot; import com.google.cloud.firestore.WriteResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseAuthException; import com.google.firebase.auth.FirebaseToken; import com.google.firebase.auth.UserRecord; import com.google.firebase.database.utilities.Pair; import com.karangandhi.stackoverflowclone.Components.User; import java.util.ArrayList; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; import static com.karangandhi.stackoverflowclone.Firebase.FirebaseService.app; public class FirebaseAuthService { public static FirebaseAuth auth; public static ArrayList<User> users; // initialize the service public static void Init() throws ExecutionException, InterruptedException { auth = FirebaseAuth.getInstance(app); // just populate the users in the local storage so it minimise the checks to the online database List<QueryDocumentSnapshot> users = FirestoreService.getCollectionSnapshot("users"); for (QueryDocumentSnapshot user : users) { FirebaseAuthService.users.add(user.toObject(User.class)); } } public static Pair<UserRecord, WriteResult> createUser(User user) throws FirebaseAuthException, ExecutionException, InterruptedException { UserRecord.CreateRequest request = new UserRecord.CreateRequest() .setEmail(user.email) .setUid(user.id.toString()) .setDisplayName(user.displayName) .setPassword(user.password) .setEmailVerified(false) .setPhotoUrl(user.profilePic); UserRecord record = auth.createUser(request); WriteResult result = FirestoreService.addData("users", user.id.toString(), user); users.add(user); return new Pair<>(record, result); } public static String signInWithEmailAndPassword(String email, String password) throws FirebaseAuthException { User found = null; try { for (User user : FirebaseAuthService.users) { if (user.email.equalsIgnoreCase(email) && user.password.equals(password) && user.password.equals(password)) { found = user; break; } } if (found == null) { List<QueryDocumentSnapshot> users = FirestoreService.getCollectionSnapshot("users"); for (QueryDocumentSnapshot userDocumentSnapshot : users) { User user = userDocumentSnapshot.toObject(User.class); if (user.email.equalsIgnoreCase(email) && user.password.equals(password) && user.password.equals(password)) { found = user; break; } } } } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } return found == null ? null : auth.createCustomToken(found.id.toString()); } public static String signInWithUsernameAndPassword(String username, String password) throws FirebaseAuthException { User found = null; try { for (User user : FirebaseAuthService.users) { if (user.username.equalsIgnoreCase(username) && user.password.equals(password)) { found = user; break; } } // check the database for the user in case it is not updated in the local storage if (found == null) { List<QueryDocumentSnapshot> users = FirestoreService.getCollectionSnapshot("users"); for (QueryDocumentSnapshot userDocumentSnapshot : users) { User user = userDocumentSnapshot.toObject(User.class); if (user.username.equalsIgnoreCase(username) && user.password.equals(password)) { found = user; break; } } } } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } return found == null ? null : auth.createCustomToken(found.id.toString()); } public static Pair<UserRecord, WriteResult> updateUser(User user) throws FirebaseAuthException { UserRecord.UpdateRequest request = new UserRecord.UpdateRequest(user.id.toString()) .setEmail(user.email) .setPassword(user.password) .setDisplayName(user.displayName) .setPhotoUrl(user.profilePic); WriteResult result = null; try { result = FirestoreService.addData("users", user.id.toString(), user); } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } for (User u : FirebaseAuthService.users) { if (u.id.toString().equals(user.id.toString())) { FirebaseAuthService.users.remove(u); } } FirebaseAuthService.users.add(user); return new Pair<>(auth.updateUser(request), result); } public static Pair<FirebaseToken, User> verifyToken(String token) throws FirebaseAuthException, ExecutionException, InterruptedException { FirebaseToken firebaseToken = auth.verifyIdToken(token); User user = getUser(UUID.fromString(firebaseToken.getUid())); return new Pair(firebaseToken, user); } public static void deleteUser(User user) throws FirebaseAuthException, ExecutionException, InterruptedException { auth.deleteUser(user.id.toString()); FirebaseAuthService.users.remove(user); FirestoreService.deleteData("users", user.id.toString()); } public static User getUser(UUID id) throws ExecutionException, InterruptedException { return FirestoreService.readData("users", id.toString()).toObject(User.class); } }
[ "karangandhi.programming@gmail.com" ]
karangandhi.programming@gmail.com
b03794578d870d32e59feae30a8b4c42cd289be1
fc91d1f5af7836ce26c6641673072fe3f8f6237a
/src/main/java/org/bitmarte/architecture/utils/testingframework/selenium/service/evaluator/I_ContentEvaluator.java
25c20e0c52fa9ab4cdab6efac55679d4f4fe29de
[]
no_license
bitmarte/selenium-rfc-client
b0efad8c795a506e7e406eab2fc5d12685d0a7c0
9733a94dde8dc26f12532e1b38b378684e49b645
refs/heads/master
2022-02-08T03:39:34.998806
2020-01-16T14:39:36
2020-01-16T14:39:36
48,165,976
3
1
null
2022-02-01T00:57:54
2015-12-17T09:46:24
Java
UTF-8
Java
false
false
409
java
package org.bitmarte.architecture.utils.testingframework.selenium.service.evaluator; import org.bitmarte.architecture.utils.testingframework.selenium.service.evaluator.exceptions.ContentEvaluatorException; /** * This is the content evaluator interface * * @author bitmarte */ public interface I_ContentEvaluator { public boolean evaluate(String str1, String str2) throws ContentEvaluatorException; }
[ "mauro.martellenghi@chebanca.it" ]
mauro.martellenghi@chebanca.it
2bc2dfa26d3ab83614466ae0c34f95b4eebf0dc0
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13288-13-9-FEMO-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/hibernate/query/HqlQueryExecutor_ESTest.java
293b0299609d8724c93f8b0fba099d64e85a82c1
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
574
java
/* * This file was automatically generated by EvoSuite * Sun Apr 05 10:04:57 UTC 2020 */ package com.xpn.xwiki.store.hibernate.query; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class HqlQueryExecutor_ESTest extends HqlQueryExecutor_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
26fa275e8cca939294a09a7eec12641efeeb6d97
23bcf8dbee07b800585df29c5237db74600c4931
/dripop-dao/src/main/java/com/dripop/entity/TWarehouseYk.java
c37cf3a653f2fe974d9e734de4e36890b21c5360
[]
no_license
chaolm/myWeb
cdb5ce3f28ff97104f487b4e1f1b736129d04b34
366ded1e0ef04dedc872e7cd26d0c5bef817878b
refs/heads/master
2022-07-25T19:09:05.065025
2019-04-30T06:09:17
2019-04-30T06:09:17
184,199,647
0
0
null
2022-06-29T17:20:49
2019-04-30T05:49:59
Java
UTF-8
Java
false
false
2,016
java
package com.dripop.entity; import javax.persistence.*; import java.io.Serializable; import java.util.Date; /** * Created by liyou on 2018/3/8. */ @Entity @Table(name = "t_warehouse_yk") public class TWarehouseYk implements Serializable { @Id @GeneratedValue private Long id; @Column(name = "yc_org_id") private Long ycOrgId; @Column(name = "yr_org_id") private Long yrOrgId; @Column(name = "status") private Integer status; public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } @Column(name = "img_urls") private String imgUrls; @Column(name = "goods_names") private String goodsNames; private String imeis; private Long creator; @Column(name = "create_time") private Date createTime; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getYcOrgId() { return ycOrgId; } public void setYcOrgId(Long ycOrgId) { this.ycOrgId = ycOrgId; } public Long getYrOrgId() { return yrOrgId; } public void setYrOrgId(Long yrOrgId) { this.yrOrgId = yrOrgId; } public String getImgUrls() { return imgUrls; } public void setImgUrls(String imgUrls) { this.imgUrls = imgUrls; } public String getGoodsNames() { return goodsNames; } public void setGoodsNames(String goodsNames) { this.goodsNames = goodsNames; } public String getImeis() { return imeis; } public void setImeis(String imeis) { this.imeis = imeis; } public Long getCreator() { return creator; } public void setCreator(Long creator) { this.creator = creator; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } }
[ "1054490510@qq.com" ]
1054490510@qq.com
7f144d5a7a5fbe15628743bd4b311b3ee3b04272
eb66c7ad741fbabd5b45d935a036cabad18ded54
/src/javainterview/NonRepeated.java
c4b72c8820b7c0df89dc397d698877bf0e7b6172
[]
no_license
ashokreddy1994/webdriver
cbfb30431256501c6532727394cde212af9dab79
dc98b4fefeb525441e956d2d49f3af842d04f084
refs/heads/master
2020-03-28T10:54:57.925542
2019-02-03T10:26:00
2019-02-03T10:26:00
148,158,717
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package javainterview; public class NonRepeated { public static void main(String[] args) { String s="helloh" ; int len=s.length(); for(int i=0;i<len;i++) { for(int j=i+1;j<len;j++) { if(!(s.charAt(i)==s.charAt(j))) { System.out.print(s.charAt(i)); } } } } }
[ "sareddy789@gmail.com" ]
sareddy789@gmail.com
8a643f908a795ea09a8c6a6323815e7d8ae62116
bbc6370dfc0fa847d2f9cc830ef471dd4b27e5d4
/src/main/java/org/vinh/tdd/leetcode/slidingwindow/NumberOfInsland.java
8c18d45ff1be389407d65909251c1e2821465be7
[ "Apache-2.0" ]
permissive
viinhpham/tdd-algorithms
092c4be4aec8dcca78867167e361e2fc28dd28d8
ec2dfbab5868f786c81689f18005ae98d8e96e5b
refs/heads/master
2023-01-08T01:02:39.750602
2022-12-25T05:02:10
2022-12-25T05:02:10
231,548,598
0
0
Apache-2.0
2022-11-11T04:54:49
2020-01-03T08:50:29
Java
UTF-8
Java
false
false
623
java
package org.vinh.tdd.leetcode.slidingwindow; /** * Author : Vinh Pham. * Date: 7/6/21. * Time : 4:28 PM. */ public class NumberOfInsland { public int numIslands(char[][] grid) { int count = 0; for (int i = 0; i < grid.length; i++) { for (int j = 0; j < grid[i].length; j++) { dfs(grid, i, j); count++; } } return count; } private void dfs(char[][] grid, int i, int j) { if (i < 0 || j < 0 || j >= grid[0].length || i >= grid.length || grid[i][j] == '0') { return; } grid[i][j] = '0'; dfs(grid, i, j - 1); dfs(grid, i, j + 1); dfs(grid, i - 1, j); dfs(grid, i + 1, j); } }
[ "viinh.pq@gmail.com" ]
viinh.pq@gmail.com
1cf752e13b136b3822b590eae461c494c688d4b5
580cca5d24c8933aad3b3747a5156bc0842bcd9e
/sample/src/main/java/com/cc/bean/PieData.java
36b7e470c0679008d186308c3b2febab557630a1
[ "Apache-2.0" ]
permissive
lichengcai/GoodView
9571db8b7d3fed1bb277998948597c3ea3401691
161e260c25fe49dfd114ca91d124bfc920636ccb
refs/heads/master
2021-01-19T21:41:36.818770
2017-12-25T10:08:47
2017-12-25T10:08:47
88,689,334
0
0
null
null
null
null
UTF-8
Java
false
false
95
java
package com.cc.bean; /** * Created by lichengcai on 2017/4/19. */ public class PieData { }
[ "lichengcai@koolearn.com" ]
lichengcai@koolearn.com
157eec36045b18737975785e099b9e4870a2a698
d7386d61c61a5d4873eea525c78fc2e60c8808d9
/springcoresandbox/src/main/java/by/epam/rosspekh/springcoresandbox/exercise1/Client.java
446213381ec6c6e40444ace240290fb4ad607f4b
[]
no_license
peekhovsky/java-templates-2019
e57f30eb3b7b0155fbb6e08cda61774081c13783
314fb3ab00b019428c1554cf5a4ad87c62afa7dc
refs/heads/master
2021-07-12T22:53:03.825243
2019-08-19T13:39:19
2019-08-19T13:39:19
163,118,802
0
0
null
2020-07-01T18:41:48
2018-12-26T00:08:57
Java
UTF-8
Java
false
false
306
java
package by.epam.rosspekh.springcoresandbox.exercise1; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; @Data @AllArgsConstructor @NoArgsConstructor @Slf4j public class Client { private String id; private String fullName; }
[ "peekhovsky@gmail.com" ]
peekhovsky@gmail.com
d61419791ac9ea695820498464e175feb607bc17
e45779e5f07da4e737d0e20cb26a1b0db3785652
/wlst-naked/src/wlst/WLSTInterpreterWrapper.java
958289c06bf9fc46bbbcd150119855e3b2e75730
[]
no_license
brunacastelo/wlst-naked
2b52310a5fafa67696178bd574b28a9fba433109
5e064f1a7b67264ee1c5faf4cdfcbd94a7ba573d
refs/heads/master
2021-01-01T16:41:11.526079
2017-07-21T01:33:32
2017-07-21T01:33:32
97,887,633
0
0
null
null
null
null
UTF-8
Java
false
false
3,142
java
package wlst; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import weblogic.management.scripting.utils.WLSTInterpreter; public class WLSTInterpreterWrapper extends WLSTInterpreter { // For interpreter stdErr and stdOut private ByteArrayOutputStream baosErr = new ByteArrayOutputStream(); private ByteArrayOutputStream baosOut = new ByteArrayOutputStream(); private PrintStream stdErr = new PrintStream(baosErr); private PrintStream stdOut = new PrintStream(baosOut); // For redirecting JVM stderr/stdout when calling dumpStack() static PrintStream errSaveStream = System.err; static PrintStream outSaveStream = System.out; public WLSTInterpreterWrapper() { setErr(stdErr); setOut(stdOut); } // Wrapper function for the WLSTInterpreter.exec() // This will throw an Exception if a failure or exception occurs in // The WLST command or if the response contains the dumpStack() command public String exec1(String command) throws Exception { String output = null; try { output = exec2(command); } catch (Exception e) { throw e; // try { // synchronized (this) { // stdErr.flush(); // baosErr.reset(); // e.printStackTrace(stdErr); // output = baosErr.toString(); // baosErr.reset(); // } // } catch (Exception ex) { // output = null; // } // if (output == null) { // throw new WLSTException(e); // } // // if (!output.contains(" dumpStack() ")) { // // A real exception any way // throw new WLSTException(output); // } } if (output.length() != 0) { if (output.contains(" dumpStack() ")) { // redirect the JVM stderr for the duration of this next call synchronized (this) { System.setErr(stdErr); System.setOut(stdOut); String _return = exec2("dumpStack()"); System.setErr(errSaveStream); System.setOut(outSaveStream); throw new WLSTException(_return); } } } System.out.println(stripCRLF(output)); return stripCRLF(output); } private String exec2(String command) { // Call down to the interpreter exec method exec(command); String err = baosErr.toString(); String out = baosOut.toString(); if (err.length() == 0 && out.length() == 0) { return ""; } baosErr.reset(); baosOut.reset(); StringBuffer buf = new StringBuffer(""); if (err.length() != 0) { buf.append(err); } if (out.length() != 0) { buf.append(out); } return buf.toString(); } // Utility to remove the end of line sequences from the result if any. // Many of the response are terminated with either \r or \n or both and // some responses can contain more than one of them i.e. \n\r\n private String stripCRLF(String line) { if (line == null || line.length() == 0) { return line; } int offset = line.length(); while (true && offset > 0) { char c = line.charAt(offset - 1); // Check other EOL terminators here if (c == '\r' || c == '\n') { offset--; } else { break; } } return line.substring(0, offset); } }
[ "Bruna@DESKTOP-I3L7NV0" ]
Bruna@DESKTOP-I3L7NV0
30993dd7b6c62a9f2b74b0a706196833af25dac4
f5c76939a348907be051f148a513300ebe73e995
/JavaBook/src/p296/P296.java
16194e7b2a5e369f5af8df7575f9977db5acf4c9
[]
no_license
parksuoh/Java
c5820fe5f8ce3acfbe756034693edd83c10b49ba
f27c295f8aedd24ae7479868f6efcc3f114ef1ba
refs/heads/master
2023-01-02T03:48:31.207408
2020-10-27T00:39:05
2020-10-27T00:39:05
259,795,658
0
0
null
null
null
null
UHC
Java
false
false
335
java
package p296; public class P296 { public static void main(String[] args) { int r = 10; Calculator calculator = new Calculator(); System.out.println("์›๋ฉด์  : " +calculator.arearCircle(r)); System.out.println(); Computer computer = new Computer(); System.out.println("์›๋ฉด์  : "+computer.arearCircle(r)); } }
[ "sooho0163@naver.com" ]
sooho0163@naver.com
0ee1c209f6c94c30e26deefa1e7eb91b0fa39269
1a67284e9e84ca7c96312208f54a1ec5cf76039f
/src/main/java/model/command/LessThanCommand.java
37d2c1f881e90b206c711742e6db563564badb8c
[]
no_license
Stigmag/Brainfuck-Compiler
f7a8fc6d67b3254a671da7b6661ef33994669a6c
5a06461528df5e761ba9acbb4a2b3d1e53b28909
refs/heads/master
2022-12-07T13:30:26.340518
2020-08-20T10:27:47
2020-08-20T10:27:47
282,603,275
0
0
null
null
null
null
UTF-8
Java
false
false
249
java
package model.command; import model.compiler.Memory; public class LessThanCommand extends Command { @Override public void execute(Memory memory) { int pointer = memory.getPointer() - 1; memory.setPointer(pointer); } }
[ "katekarpenko75@gmail.com" ]
katekarpenko75@gmail.com
1f1e42a5dc0b6f1f86f6fe55b72eac2e75b7dc84
d46b64fa976eef5389e198203bc896d2521be7dd
/app/src/main/java/de/koelle/christian/trickytripper/ui/model/ParticipantRow.java
662c215320a3ae4d68655776bb5f99f1faeec3d1
[ "Apache-2.0" ]
permissive
koelleChristian/trickytripper
5dbdbea7e61250ac4b9a00ed05c139c867c901ee
287b843ebf6aea4f4276551511535a966109df73
refs/heads/master
2021-11-26T01:07:09.083418
2020-01-20T22:18:23
2020-01-20T22:18:23
3,173,086
46
22
Apache-2.0
2022-12-30T09:42:07
2012-01-13T18:03:45
Java
UTF-8
Java
false
false
1,093
java
package de.koelle.christian.trickytripper.ui.model; import de.koelle.christian.trickytripper.model.Amount; import de.koelle.christian.trickytripper.model.Participant; public class ParticipantRow { private Participant participant; private int amountOfPaymentLines; private Amount sumPaid; private Amount sumSpent; private Amount balance; public int getAmountOfPaymentLines() { return amountOfPaymentLines; } public void setAmountOfPaymentLines(int amountOfPaymentLines) { this.amountOfPaymentLines = amountOfPaymentLines; } public Amount getSumPaid() { return sumPaid; } public void setSumPaid(Amount moneyPaid) { this.sumPaid = moneyPaid; } public Amount getSumSpent() { return sumSpent; } public void setSumSpent(Amount moneySpent) { this.sumSpent = moneySpent; } public Participant getParticipant() { return participant; } public void setParticipant(Participant participant) { this.participant = participant; } public Amount getBalance() { return balance; } public void setBalance(Amount balance) { this.balance = balance; } }
[ "christian.koelle.android@googlemail.com" ]
christian.koelle.android@googlemail.com
e81296fcc1d695e1f6c701327d182e009dffafda
a3671ab5489b469f687f5ea4d0e30109cc4d5516
/day22demo_account/src/com/itheima/service/AccountService.java
486fde7b92b68ffedcbafc957fcac0941c38054e
[]
no_license
liujianbo2017/zuoye
deb87db7cf1f00d5eeccfc9d7e742ed3fc21fd20
b98291090c78379b8ed63acfc9c7699e3f3684f3
refs/heads/master
2021-07-20T06:38:57.732566
2017-10-30T15:51:18
2017-10-30T15:51:18
102,965,939
2
0
null
null
null
null
GB18030
Java
false
false
903
java
package com.itheima.service; import java.sql.Connection; import java.sql.SQLException; import com.itheima.c3p0utils.C3P0Utils; import com.itheima.dao.AccountDao; /* * ไธšๅŠกๅฑ‚,่ฝฌๆˆทๆ•ฐๆฎไธšๅŠกๅฑ‚ * ่ฐƒ็”จdaoๅฑ‚out in ๅฎž็Žฐ่ฝฌ่ดฆ * ่ขซwep่ฐƒ็”จ,ไผ ้€’่ดฆๆˆทๅๅ’Œ้‡‘้ข */ public class AccountService { /* * ๅฎšไน‰ๆ–นๆณ•,ๅฎž็Žฐ่ฝฌ่ดฆ web่ฐƒ็”จ,ไผ ๅ…ฅ่ดฆๆˆทๅๅ’Œ้‡‘้ข ่ฐƒ็”จdao */ public void transfer(String outaname, String inaname, double menoy) { AccountDao dao = new AccountDao(); Connection conn = null; try { conn = C3P0Utils.getConnection(); conn.setAutoCommit(false); dao.in(conn, inaname, menoy); dao.out(conn, outaname, menoy); conn.commit(); } catch (Exception ex) { ex.printStackTrace(); try { conn.rollback(); } catch (SQLException e) { e.printStackTrace(); } } finally { C3P0Utils.relase(null, null, conn); } } }
[ "1023638368@qq.com" ]
1023638368@qq.com
f938f70625b6bd4e316d5f52dd09e1d1a18f0bfb
a2472eb27dfb197fb6c0ddeb1ff3f22b5cdea066
/src/main/java/eu/trentorise/smartcampus/roveretoexplorer/controller/SyncController.java
da00b3b462c4789645eb2efec31053e85453a6df
[]
no_license
smartcommunitylab/smartcampus.vas.roveretoexplorer.web
5c66e6acc336d4727348cff796414890772ce726
16bec8efb068b94c3973773d86eb13ebcc0ce708
refs/heads/master
2021-01-17T13:13:13.645681
2016-06-27T11:33:16
2016-06-27T11:33:16
15,761,650
0
0
null
null
null
null
UTF-8
Java
false
false
3,933
java
/******************************************************************************* * Copyright 2012-2013 Trento RISE * * 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 eu.trentorise.smartcampus.roveretoexplorer.controller; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import eu.iescities.pilot.rovereto.roveretoexplorer.custom.data.model.BaseDTObject; import eu.iescities.pilot.rovereto.roveretoexplorer.custom.data.model.ExplorerObject; import eu.trentorise.smartcampus.presentation.common.util.Util; import eu.trentorise.smartcampus.presentation.data.BasicObject; import eu.trentorise.smartcampus.presentation.data.SyncData; import eu.trentorise.smartcampus.presentation.data.SyncDataRequest; @Controller public class SyncController extends AbstractObjectController { @RequestMapping(method = RequestMethod.POST, value = "/sync") public ResponseEntity<SyncData> synchronize(HttpServletRequest request, @RequestParam long since, @RequestBody Map<String,Object> obj) throws Exception{ try { String userId = null; try { userId = getUserId(); } catch (SecurityException e) { } // no change through sync is supported! obj.put("updated",Collections.<String,Object>emptyMap()); obj.put("deleted",Collections.<String,Object>emptyMap()); SyncDataRequest syncReq = Util.convertRequest(obj, since); Map<String, Object> exclude = new HashMap<String, Object>(); if (syncReq.getSyncData().getExclude() != null) { exclude.putAll(syncReq.getSyncData().getExclude()); } // don't write anymore // SyncData result = storage.getSyncData(syncReq.getSince(), userId, syncReq.getSyncData().getInclude(), exclude); SyncData result = storage.getSyncData(syncReq.getSince(), userId); filterResult(result, userId); // storage.cleanSyncData(syncReq.getSyncData(), userId); return new ResponseEntity<SyncData>(result,HttpStatus.OK); } catch (Exception e) { e.printStackTrace(); throw e; } } private void filterResult(SyncData result, String userId) { if (result.getUpdated() != null) { List<BasicObject> list; list = result.getUpdated().get(ExplorerObject.class.getName()); if (list != null && !list.isEmpty()) { for (Iterator<BasicObject> iterator = list.iterator(); iterator.hasNext();) { ExplorerObject obj = (ExplorerObject) iterator.next(); if (!checkDate(obj)) { iterator.remove(); continue; } obj.filterUserData(userId); } } } } private boolean checkDate(BaseDTObject obj) { long ref = System.currentTimeMillis()-24*60*60*1000; if (obj.getFromTime() == null || obj.getFromTime() == 0) { return true; } if (obj.getToTime() == null || obj.getToTime() == 0) { return true; } return (obj.getFromTime() > ref || obj.getToTime() > ref); } }
[ "giordano.adami@gmail.com" ]
giordano.adami@gmail.com
ba1addd5b7b030723bcb5b4507cf3c3ab4f0929b
b092ea5176896a93ba3c016fa4b1ad1d9a67233b
/Java/Unidad4_Hilos/src/ServidorTelnet/HiloCliente.java
d045fe7b1a7a93f17946a6db1d7d5552567d78bf
[]
no_license
Wolfteinter/Analisis-De-Imagenes-Onder
8b03d0da36001c5132719cfb9a702cc663e1e183
b6408f085ae1777ad0e93285ee79bb71f87cddac
refs/heads/master
2020-04-18T09:34:49.029322
2020-03-05T05:44:29
2020-03-05T05:44:29
167,439,189
0
0
null
null
null
null
UTF-8
Java
false
false
1,354
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 ServidorTelnet; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author wolfteinter */ class HiloCliente extends Thread{ private Socket cliente; private PrintWriter salida; private BufferedReader entrada; public HiloCliente(Socket s){ cliente=s; } public void run(){ while(true){ try { entrada = new BufferedReader(new InputStreamReader(cliente.getInputStream())); String respuesta = entrada.readLine(); System.out.println("Respuesta: "+respuesta); } catch (IOException ex) { ex.printStackTrace(); } } /* try { salida = new PrintWriter(cliente.getOutputStream()); System.out.println("Cliente: "+cliente.getInetAddress().getHostName() +" Puerto: "+cliente.getPort()); salida.print("Hola cliente"); } catch (IOException ex) { ex.printStackTrace(); }*/ } }
[ "onderfra@gmail.com" ]
onderfra@gmail.com
4be8e9ce946d02317af8b5a5c0a82b6e619de4a5
3bd6322ca11cfadf32b5d71d07414af053191a12
/subprojects/base-services/src/main/java/org/gradle/internal/jvm/GroovyJpmsWorkarounds.java
e8a5f43bece46a513005650774bcafb05bdc413d
[ "BSD-3-Clause", "LGPL-2.1-or-later", "MIT", "CPL-1.0", "Apache-2.0", "LGPL-2.1-only", "LicenseRef-scancode-mit-old-style" ]
permissive
marcphilipp/gradle
e706e7ea71db777aa7bd32407c84ddf55f822a1c
23dc56a658b7c6216f34232615c36712b6fe47e6
refs/heads/master
2020-04-01T20:48:43.434773
2018-10-18T13:24:20
2018-10-19T08:32:13
153,621,663
0
0
Apache-2.0
2018-10-22T08:34:44
2018-10-18T12:40:07
Groovy
UTF-8
Java
false
false
1,204
java
/* * Copyright 2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gradle.internal.jvm; import java.util.Arrays; import java.util.Collections; import java.util.List; public class GroovyJpmsWorkarounds { /** * These JVM arguments should be passed to any process that will be using Groovy on Java 9+ to avoid noisy illegal access warnings that the user can't do anything about. */ public static final List<String> SUPPRESS_COMMON_GROOVY_WARNINGS = Collections.unmodifiableList(Arrays.asList( "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED" )); }
[ "stefan@gradle.com" ]
stefan@gradle.com
9d400cb119715a9faf7e1ef5e221259c220d6e50
3268e3f40e9d80f55bc6f660286904ede9fa6bb2
/src/main/java/com/example/mybatis/generator/demo/controller/ArticleController.java
b8d49868253a7416a5dec46c83cbbb41e9963ffb
[]
no_license
bys-eric-he/springboot-mybatis-generator-cache-demo
70c6751251a8a2e2c6620e2cc9a58589321775db
4e4f34bc7ed8764f13e4fcb5041a10957a2716b6
refs/heads/master
2022-06-27T13:57:48.949486
2020-05-13T09:33:45
2020-05-13T09:33:45
224,630,029
1
2
null
2022-06-21T02:20:09
2019-11-28T10:39:04
Java
UTF-8
Java
false
false
2,543
java
package com.example.mybatis.generator.demo.controller; import com.example.mybatis.generator.demo.pojo.Article; import com.example.mybatis.generator.demo.pojo.ArticleExample; import com.example.mybatis.generator.demo.service.ArticleService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @Api(tags = "ArticleController", description = "ๆ–‡็ซ ็ฎก็†ๆŽฅๅฃ") @RestController @RequestMapping("/api/v1") public class ArticleController { @Autowired private ArticleService articleService; @GetMapping("/list") @ApiOperation(value = "่Žทๅ–ๆ–‡็ซ ๅˆ—่กจ") public List<Article> articleList(){ ArticleExample articleExample = new ArticleExample(); return articleService.selectByExample(articleExample); } @GetMapping("/list/all") @ApiOperation(value = "่Žทๅ–ๆ–‡็ซ ๅˆ—่กจๅŒ…ๅซๆ–‡็ซ ๅ†…ๅฎน") public List<Article> selectByExampleWithBLOBs(){ ArticleExample articleExample = new ArticleExample(); articleExample.createCriteria() .andIdIsNotNull() .andAuthorIsNotNull(); return articleService.selectByExampleWithBLOBs(articleExample); } @PostMapping("/add") @ApiOperation(value = "ๆทปๅŠ ๆ–‡็ซ ") public Integer addArticle(@RequestBody Article article) { System.out.println(article.toString()); return articleService.addArticle(article); } @GetMapping("/get") @ApiOperation(value = "ๆ นๆฎID่Žทๅ–ๆ–‡็ซ ") public Article getArticle(@RequestParam("id") Integer id) { Long start = System.currentTimeMillis(); Article article = articleService.getArticle(id); Long end = System.currentTimeMillis(); System.out.println("่€—ๆ—ถ๏ผš"+(end-start)); return article; } /** * ๆ›ดๆ–ฐไธ€็ฏ‡ๆ–‡็ซ  * * @param contetnt * @param id * @return */ @GetMapping("/refresh") @ApiOperation(value = "ๆ›ดๆ–ฐๆ–‡็ซ ") public Integer update(@RequestParam("content") String contetnt, @RequestParam("id") Integer id) { return articleService.updateContentById(contetnt, id); } /** * ๅˆ ้™คไธ€็ฏ‡ๆ–‡็ซ  * * @param id * @return */ @GetMapping("/remove") @ApiOperation(value = "ๅˆ ้™คๆ–‡็ซ ") public Integer remove(@RequestParam("id") Integer id) { return articleService.removeArticleById(id); } }
[ "heyong_1988@126.com" ]
heyong_1988@126.com
31bfff5f0d3e53e4d45011d4a13945b2287c334a
ef59f22001e9de67bc555c0929ad9d8adf5f98de
/src/lab/sortpackage/BubbleSort.java
49c78a3bf1df7091e06ba9f74149385f3dd305b5
[]
no_license
voleynik/lab-java
b846aac2bafb82d8d841c1ef0645a6767bd005ae
f055bd19f61a807d2d1dec9b01ea1787b99e18aa
refs/heads/master
2021-01-21T17:45:58.823354
2018-04-06T12:53:04
2018-04-06T12:53:04
91,983,985
0
0
null
null
null
null
UTF-8
Java
false
false
1,334
java
package lab.sortpackage; public class BubbleSort { public static void sort(int array[]) { printNumbers(array, 0);// print original unsorted array int n = array.length;// array length for (int i = 0; i < n - 1; i++) {// outer loop i <----- n - 1 int next = 0;// next element int numberOfSwaps = 0; for (int prev = 0; prev < n - 1; prev++) {// inner loop j <----- n - 1 next = prev + 1; if (array[prev] > array[next]) { swapNumbers(prev, next, array); numberOfSwaps++; } } if(numberOfSwaps < 1) break; printNumbers(array, i + 1); } } private static void swapNumbers(int prev, int next, int[] array) { int temp; temp = array[prev];// move current to temp array[prev] = array[next];// move next to previous array[next] = temp; } private static void printNumbers(int[] input, int swapNumber) { for (int i = 0; i < input.length; i++) { if(i != 0) System.out.print(", "); System.out.print(input[i]); } if(swapNumber < 1){ System.out.println(" - unsorted array ~~~~~~~~~~~"); }else{ System.out.println(" - swapNumber # " + swapNumber); } } public static void main(String[] args) { int[] input1 = { 9, 8, 7, 6, 5, 4, 3, 2, 1 }; sort(input1); int[] input2 = { 1, 2, 9, 8, 7, 6, 5, 4, 3 }; sort(input2); System.out.println("The end"); } }
[ "vo@10.10.1.23" ]
vo@10.10.1.23
3a54c62d9d74ea39700c2b83797cb4f6a18f44f3
39eb39c6543fffe2248f55b33f11177ffcd169e3
/src/main/java/com/google/gson/emul/com/google/gson/JsonParseException.java
7e9c8b66307aace7e2f5096d233168c4f4ebf8f3
[ "Apache-2.0" ]
permissive
akbertram/gson-gwt
becb0cbc96a1004c43414cd7d66e6e9c62997241
eb79a39ed180dbfb01927a0bcd68b9bccacdfb20
refs/heads/master
2021-01-18T23:14:20.482653
2016-07-12T10:33:55
2016-07-12T10:33:55
1,640,086
1
0
null
2013-07-10T22:53:49
2011-04-20T11:41:26
Java
UTF-8
Java
false
false
1,678
java
/* * Copyright (C) 2011 bedatadriven * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.gson; public final class JsonParseException extends RuntimeException { /** * Creates exception with the specified message. If you are wrapping another exception, consider * using {@link #JsonParseException(String, Throwable)} instead. * * @param msg error message describing a possible cause of this exception. */ public JsonParseException(String msg) { super(msg); } /** * Creates exception with the specified message and cause. * * @param msg error message describing what happened. * @param cause root exception that caused this exception to be thrown. */ public JsonParseException(String msg, Throwable cause) { super(msg, cause); } /** * Creates exception with the specified cause. Consider using * {@link #JsonParseException(String, Throwable)} instead if you can describe what happened. * * @param cause root exception that caused this exception to be thrown. */ public JsonParseException(Throwable cause) { super(cause); } }
[ "alex@bedatadriven.com" ]
alex@bedatadriven.com
00c3662a69321479b838c789e304cb287d488bc9
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/JetBrains--intellij-community/1e937add5f846a026373c06f978efdf6cff2dada/before/StartStopMacroRecordingAction.java
ecfa422e8e79992ebf3487349d66f044616cda54
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,989
java
/* * Copyright 2000-2009 JetBrains s.r.o. * * 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.intellij.ide.actionMacro.actions; import com.intellij.ide.IdeBundle; import com.intellij.ide.actionMacro.ActionMacroManager; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.DataConstants; import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.project.DumbAware; /** * @author max */ public class StartStopMacroRecordingAction extends AnAction implements DumbAware { public void update(AnActionEvent e) { boolean editorAvailable = e.getDataContext().getData(DataConstants.EDITOR) != null; boolean isRecording = ActionMacroManager.getInstance().isRecording(); e.getPresentation().setEnabled(editorAvailable || isRecording); e.getPresentation().setText(isRecording ? IdeBundle.message("action.stop.macro.recording") : IdeBundle.message("action.start.macro.recording")); } public void actionPerformed(AnActionEvent e) { if (!ActionMacroManager.getInstance().isRecording() ) { final ActionMacroManager manager = ActionMacroManager.getInstance(); manager.startRecording(IdeBundle.message("macro.noname")); } else { ActionMacroManager.getInstance().stopRecording(PlatformDataKeys.PROJECT.getData(e.getDataContext())); } } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
660e043288291478f51875f266d523ddcc8925d1
4af63f589a13bfe66872dc86861ffff231025b9d
/code/iaas/model/src/main/java/io/cattle/platform/core/constants/LabelConstants.java
375bc9c9059b5db5db135a79bcbfeb45f0915cbf
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
cglewis/cattle
0601f3bdb1d6cda97bcecc7d64637437637959b3
b0eddd38e1a2fb6f7b00174277e7d52488259cff
refs/heads/master
2023-04-08T02:57:18.805367
2015-05-27T22:54:16
2015-05-27T22:54:16
36,400,338
0
0
Apache-2.0
2023-04-04T00:23:07
2015-05-27T22:45:02
Java
UTF-8
Java
false
false
418
java
package io.cattle.platform.core.constants; public class LabelConstants { public static final String HOST_TYPE = "host"; public static final String CONTAINER_TYPE = "container"; public static final String INPUT_LABEL_KEY = "key"; public static final String INPUT_LABEL_VALUE = "value"; public static final String INPUT_LABEL = "label"; public static final String INPUT_LABELS = "labels"; }
[ "son@rancher.com" ]
son@rancher.com
284de03bad36b37e534660c38a490d2a47ff9992
130f06f9910f8d650736d3a23a32398200396bea
/Purdue Robot Code/src/org/usfirst/frc/team5822/robot/commands/AutoBlueRetrievalZoneGear.java
a5eaf29d109ca694bf3b23d9b38278d081245d70
[]
no_license
SICPRobotics/2017-Robot-Code
740621bc545ca19e51cd70d954c1c6cb90f499c4
71a451f7b0feee591802608f8139ab6616360376
refs/heads/master
2021-01-09T05:28:50.123122
2017-12-14T22:29:36
2017-12-14T22:29:36
80,773,694
0
1
null
null
null
null
UTF-8
Java
false
false
657
java
package org.usfirst.frc.team5822.robot.commands; import edu.wpi.first.wpilibj.command.CommandGroup; public class AutoBlueRetrievalZoneGear extends CommandGroup { //turn angle close but not quite right public AutoBlueRetrievalZoneGear() { addSequential(new DriveForward(60)); addSequential(new TurnLeftFast(-60)); addSequential(new TurnRightSlow(-60)); addSequential(new ResetEncoder()); addSequential(new ResetGyro()); addSequential(new DriveForward(63)); addSequential(new WaitForPilot()); addSequential(new DriveSlow(4)); //Need the stuff that lets the human player take up gear } }
[ "sicp@sicp-PC.ignatius.org" ]
sicp@sicp-PC.ignatius.org
b29370d0abd559cd835b172e247a4825e25be6bd
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/tencentmap/mapsdk/maps/a/gh$6.java
8dff54e7ee89eefd5bd6461343c013685d4a4fde
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
1,103
java
package com.tencent.tencentmap.mapsdk.maps.a; import com.tencent.map.lib.gl.JNI; import com.tencent.matrix.trace.core.AppMethodBeat; import javax.microedition.khronos.opengles.GL10; class gh$6 implements gm.a { gh$6(gh paramgh, int paramInt1, String paramString, double paramDouble1, double paramDouble2, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, boolean paramBoolean4, int paramInt2, int paramInt3) { } public void a(GL10 paramGL10) { AppMethodBeat.i(99045); if (gh.a(this.q) != 0L) gh.b(this.q).nativeUpdateMarkerInfo(gh.a(this.q), this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.h, this.i, this.j, this.k, this.l, this.m, this.n, this.o, this.p); AppMethodBeat.o(99045); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes8-dex2jar.jar * Qualified Name: com.tencent.tencentmap.mapsdk.maps.a.gh.6 * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
a0bc23c582a5e3ca9ba38ed58ab673a7929d6a20
1038cdbc4ad63c775674593b29cf6dfe29442265
/src/br/com/hugotiyoda/calc/inteface/Display.java
db6066c584667df5f938762aef746c22eb0eeb7d
[]
no_license
HugoTiyoda/CalculadoraJAVA
896b7690fc340277d61f786ab2b41656487d7308
fcfac710cecb921dc3ebfcb58ca72ed530307908
refs/heads/master
2023-07-12T12:54:15.091590
2021-08-11T14:56:25
2021-08-11T14:56:25
395,022,911
0
0
null
null
null
null
UTF-8
Java
false
false
747
java
package br.com.hugotiyoda.calc.inteface; import br.com.hugotiyoda.calc.memory.Memory; import br.com.hugotiyoda.calc.memory.MemoryListener; import javax.swing.*; import java.awt.*; public class Display extends JPanel implements MemoryListener { private final JLabel label; public Display(){ Memory.getInstance().addListener(this); setBackground(Color.darkGray); label = new JLabel(Memory.getInstance().getTextoAtual()); label.setForeground(Color.white); label.setFont(new Font("Arial",Font.PLAIN,30)); setLayout(new FlowLayout(FlowLayout.RIGHT,10,20)); add(label); } @Override public void valorAlterado(String novoValor) { label.setText(novoValor); } }
[ "hugotiyoda@gmail.com" ]
hugotiyoda@gmail.com
3978f3ce6d504a70478930858475c2750a47f204
fb18b9c0f81a9883845ec93c0acd15b2fa4a0d9e
/breakfast/src/main/java/zjut/jianlu/breakfast/widget/AbstractWheelAdapter.java
476659261b5769180e8c64855c1e4ddcf4c3b3e4
[]
no_license
lucky5237/FinalDesign
afe9ad996c1e7b4fc9308275db03a1b4eee4125c
543d95d9e7cad95f6602628f1e513e677c6f7b6a
refs/heads/master
2021-01-21T13:44:13.989810
2016-04-25T15:47:00
2016-04-25T15:47:00
53,399,642
3
0
null
null
null
null
UTF-8
Java
false
false
2,090
java
/* * Copyright 2011 Yuri Kanivets * * 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 zjut.jianlu.breakfast.widget; import android.database.DataSetObserver; import android.view.View; import android.view.ViewGroup; import java.util.LinkedList; import java.util.List; /** * Abstract Wheel adapter. */ public abstract class AbstractWheelAdapter implements WheelViewAdapter { // Observers private List<DataSetObserver> datasetObservers; @Override public View getEmptyItem(View convertView, ViewGroup parent) { return null; } @Override public void registerDataSetObserver(DataSetObserver observer) { if (datasetObservers == null) { datasetObservers = new LinkedList<DataSetObserver>(); } datasetObservers.add(observer); } @Override public void unregisterDataSetObserver(DataSetObserver observer) { if (datasetObservers != null) { datasetObservers.remove(observer); } } /** * Notifies observers about data changing */ protected void notifyDataChangedEvent() { if (datasetObservers != null) { for (DataSetObserver observer : datasetObservers) { observer.onChanged(); } } } /** * Notifies observers about invalidating data */ protected void notifyDataInvalidatedEvent() { if (datasetObservers != null) { for (DataSetObserver observer : datasetObservers) { observer.onInvalidated(); } } } }
[ "jianlu@hengtiansoft.com" ]
jianlu@hengtiansoft.com
684e8af7213ffd2ad40b982f4d26f773e542b7df
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/commons-lang/learning/7268/AbstractCircuitBreaker.java
b2e5ed3852902492a5e2d0a622db2ef4fc8eb1a6
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,983
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.commons.lang3.concurrent; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.concurrent.atomic.AtomicReference; /** * Base class for circuit breakers. * * @param <T> the type of the value monitored by this circuit breaker * @since 3.5 */ public abstract class AbstractCircuitBreaker<T> implements CircuitBreaker<T> { /** * The name of the <em>open</em> property as it is passed to registered * change listeners. */ public static final String PROPERTY_NAME = "open"; /** The current state of this circuit breaker. */ protected final AtomicReference<State> state = new AtomicReference<>(State.CLOSED); /** An object for managing change listeners registered at this instance. */ private final PropertyChangeSupport changeSupport; /** * Creates an {@code AbstractCircuitBreaker}. It also creates an internal {@code PropertyChangeSupport}. */ public AbstractCircuitBreaker() { changeSupport = new PropertyChangeSupport (this); } /** * {@inheritDoc} */ @Override public boolean isOpen() { return isOpen(state.get()); } /** * {@inheritDoc} */ @Override public boolean isClosed() { return !isOpen(); } /** * {@inheritDoc} */ @Override public abstract boolean checkState(); /** * {@inheritDoc} */ @Override public abstract boolean incrementAndCheckState(T increment); /** * {@inheritDoc} */ @Override public void close() { changeState(State.CLOSED); } /** * {@inheritDoc} */ @Override public void open() { changeState(State.OPEN); } /** * Converts the given state value to a boolean <em>open</em> property. * * @param state the state to be converted * @return the boolean open flag */ protected static boolean isOpen(final State state) { return state == State.OPEN; } /** * Changes the internal state of this circuit breaker. If there is actually a change * of the state value, all registered change listeners are notified. * * @param newState the new state to be set */ protected void changeState(final State newState) { if (state.compareAndSet(newState.oppositeState(), newState)) { changeSupport.firePropertyChange(PROPERTY_NAME, !isOpen(newState), isOpen(newState)); } } /** * Adds a change listener to this circuit breaker. This listener is notified whenever * the state of this circuit breaker changes. If the listener is * <strong>null</strong>, it is silently ignored. * * @param listener the listener to be added */ public void addChangeListener(final PropertyChangeListener listener) { changeSupport.addPropertyChangeListener(listener); } /** * Removes the specified change listener from this circuit breaker. * * @param listener the listener to be removed */ public void removeChangeListener(final PropertyChangeListener listener) { changeSupport.removePropertyChangeListener(listener); } /** * An internal enumeration representing the different states of a circuit * breaker. This class also contains some logic for performing state * transitions. This is done to avoid complex if-conditions in the code of * {@code CircuitBreaker}. */ protected enum State { CLOSED { /** * {@inheritDoc} */ @Override public State oppositeState() { return OPEN; } }, OPEN { /** * {@inheritDoc} */ @Override public State oppositeState() { return CLOSED; } }; /** * Returns the opposite state to the represented state. This is useful * for flipping the current state. * * @return the opposite state */ public abstract State oppositeState(); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
49fca432e1e3fc2ca91edf514e6f4c41efe54ecf
4d6c1170033a4c9289da786ccb9b920e6da55a58
/objectLesson/Main3.java
07ca73fe8d5af8a9849782e6aabc92e5d0d8bb86
[]
no_license
sfniwrunvms/javalessons
7d6edac41f8eecac240c17efa46a16f5d182ca80
ab54ca2286e7ebbaecde11b650c1cdd41678f837
refs/heads/master
2020-06-24T10:17:06.835887
2019-08-21T03:36:32
2019-08-21T03:36:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
655
java
import java.util.*; public class Main3{ public static void main(String[] args){ Empty e=new Empty(); e.name="ใ•ใถ"; System.out.println(e); List<Empty> list=new ArrayList<>(); Empty e2=new Empty(); e2.name="ใƒ’ใƒญ"; list.add(e); list.add(e2); System.out.println(list); if(e.equals(e2)){ System.out.println("ๅŒใ˜ใงใ™"); }else{ System.out.println("ไบŒใคใฏๅŒใ˜ใงใฏใ‚ใ‚Šใพใ›ใ‚“"); } Empty e3=new Empty(); e3.name="ใƒ’ใƒญ"; list.add(e); list.add(e2); list.add(e3); if(e.equals(e3)){ System.out.println("ๅŒใ˜ใงใ™"); }else{ System.out.println("ไบŒใคใฏๅŒใ˜ใงใฏใ‚ใ‚Šใพใ›ใ‚“"); } } }
[ "1000naoyuki1021@gmail.com" ]
1000naoyuki1021@gmail.com
4d96be00fa0e97becfc35ec3ebdd804efdde8059
b117564b5f75e0aea556d0f266ddc1915e8be97f
/prac_admin_pos/app/src/main/java/com/example/prac_admin_pos/model/JobApp.java
a658988b438592629b61bc3f73fcfcf0c9c47f68
[]
no_license
BryanGarro25/lab_05-06
0fd922174d0aa6bc3df5d31704bd31061537c33f
2602ac4d0e87835b14be16b81966743efbeafdb0
refs/heads/master
2022-06-20T11:45:33.602133
2020-05-13T02:13:56
2020-05-13T02:13:56
258,636,625
0
0
null
null
null
null
UTF-8
Java
false
false
5,553
java
package com.example.prac_admin_pos.model; import java.io.Serializable; import java.util.Calendar; import java.util.Date; import java.util.Objects; public class JobApp implements Serializable { private String name; private String lastName; private String address1; private String address2; private String city; private String state; private int postalCode; private String country; private String emailAddress; private int areaCode; private String phoneNumber; private String position; private String date; public JobApp(String name, String lastName, String address1, String address2, String city, String state, int postalCode, String country, String emailAddress, int areaCode, String phoneNumber, String position, String date){ this.name = name; this.lastName = lastName; this.address1 = address1; this.address2 = address2; this.city = city; this.state= state; this.postalCode = postalCode; this.country = country; this.emailAddress = emailAddress; this.areaCode = areaCode; this.phoneNumber = phoneNumber; this.position = position; this.date = date; } public JobApp(){ this.name = ""; this.lastName = ""; this.address1 = ""; this.address2 = ""; this.city = ""; this.state= ""; this.postalCode = 0; this.country = ""; this.emailAddress = ""; this.areaCode = 0; this.phoneNumber = ""; this.position = ""; this.date = ""; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getAddress1() { return address1; } public void setAddress1(String address1) { this.address1 = address1; } public String getAddress2() { return address2; } public void setAddress2(String address2) { this.address2 = address2; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getState() { return state; } public void setState(String state) { this.state = state; } public int getPostalCode() { return postalCode; } public void setPostalCode(int postalCode) { this.postalCode = postalCode; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getEmailAddress() { return emailAddress; } public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } public int getAreaCode() { return areaCode; } public void setAreaCode(int areaCode) { this.areaCode = areaCode; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String getPosition() { return position; } public void setPosition(String position) { this.position = position; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } @Override public String toString() { return "JobApp{" + "name='" + name + '\'' + ", lastName='" + lastName + '\'' + ", address1='" + address1 + '\'' + ", address2='" + address2 + '\'' + ", city='" + city + '\'' + ", state='" + state + '\'' + ", postalCode=" + postalCode + ", country='" + country + '\'' + ", emailAddress='" + emailAddress + '\'' + ", areaCode=" + areaCode + ", phoneNumber='" + phoneNumber + '\'' + ", position='" + position + '\'' + ", date=" + date + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JobApp)) return false; JobApp jobApp = (JobApp) o; return getPostalCode() == jobApp.getPostalCode() && getAreaCode() == jobApp.getAreaCode() && getName().equals(jobApp.getName()) && getLastName().equals(jobApp.getLastName()) && getAddress1().equals(jobApp.getAddress1()) && Objects.equals(getAddress2(), jobApp.getAddress2()) && getCity().equals(jobApp.getCity()) && Objects.equals(getState(), jobApp.getState()) && getCountry().equals(jobApp.getCountry()) && getEmailAddress().equals(jobApp.getEmailAddress()) && getPhoneNumber().equals(jobApp.getPhoneNumber()) && getPosition().equals(jobApp.getPosition()) && getDate().equals(jobApp.getDate()); } @Override public int hashCode() { return Objects.hash(getName(), getLastName(), getAddress1(), getAddress2(), getCity(), getState(), getPostalCode(), getCountry(), getEmailAddress(), getAreaCode(), getPhoneNumber(), getPosition(), getDate()); } }
[ "josue.cespedes19@gmail.com" ]
josue.cespedes19@gmail.com
3ec4e795eb2305b0889cd52e56550485eb8d7418
5e038d0fb8f43ff998aa6f8bf4dbc66ddbccd4b1
/src/main/java/ria/lang/compiler/code/NewExpr.java
aa947269740948c7332377cba3d8164c1a0622e2
[ "BSD-3-Clause" ]
permissive
rialang/ria
b5bc773942729ab8d25df05f0f60a7c85264f034
565f7fc29d860e12e6cbd5db2ee7542be6ef73f6
refs/heads/master
2023-08-16T23:09:10.410025
2023-08-15T18:12:43
2023-08-15T18:12:43
129,551,104
7
0
NOASSERTION
2023-09-14T17:32:53
2018-04-14T20:13:50
Java
UTF-8
Java
false
false
743
java
package ria.lang.compiler.code; import ria.lang.compiler.Context; import ria.lang.compiler.JavaType; import ria.lang.compiler.RiaType; public final class NewExpr extends JavaExpr { private RiaType.ClassBinding extraArgs; public NewExpr(JavaType.Method init, Code[] args, RiaType.ClassBinding extraArgs, int line) { super(null, init, args, line); type = init.classType; this.extraArgs = extraArgs; } @Override public void gen(Context context) { String name = method.classType.javaType.className(); context.typeInsn(NEW, name); context.insn(DUP); genCall(context, extraArgs.getCaptures(), INVOKESPECIAL); context.forceType(name); } }
[ "pete.arthur@gmail.com" ]
pete.arthur@gmail.com
627cd6e0399044e381742f0890ba56a31826bc59
2ea0745f0cc7df36326a9bf9e8fdd0f35181cb45
/app/src/main/java/com/example/heads_up/services/CategoryService.java
87746288a760556fb528aced0cb830ab32e47b98
[]
no_license
JoseRFelix/heads-up-clone
a023010171431c9ee04218363c5851739be707a2
a5ce65e50b93cce649887025230644f03b059b50
refs/heads/master
2022-02-21T07:50:58.917141
2019-08-07T06:29:24
2019-08-07T06:29:24
198,276,540
1
0
null
null
null
null
UTF-8
Java
false
false
329
java
package com.example.heads_up.services; import com.example.heads_up.models.Category; import java.util.List; import retrofit2.Call; import retrofit2.http.GET; public interface CategoryService { String API_ROUTE = "/Jfelix61/heads-up-json-server/categories"; @GET(API_ROUTE) Call<List<Category>> getCategories(); }
[ "rtfire456@hotmail.com" ]
rtfire456@hotmail.com
9fc9bddf038ffc94cc6dbc157e5b9d4fed6b5e8a
6d1ddb37e1ee9af2cf7c5e3d60212eb55796f974
/WuyiProject/commonapi/src/main/java/com/danmo/commonapi/base/cache/ACache.java
b7af515ef40ed02fa50a17908537914e2cb351b3
[]
no_license
zhuyu3126/WuyiProject
4519bf80dca310a6943b7aba530c8f47a66e62bc
ca2783e7833a41a92888081adc56d9da2ec1da33
refs/heads/master
2020-08-02T18:42:07.551582
2019-09-28T08:13:42
2019-09-28T08:13:42
211,467,030
1
0
null
null
null
null
UTF-8
Java
false
false
25,113
java
package com.danmo.commonapi.base.cache; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.PixelFormat; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import org.json.JSONArray; import org.json.JSONObject; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.RandomAccessFile; import java.io.Serializable; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; /* * ่ฝป้‡็บง็ผ“ๅญ˜ๆก†ๆžถ ๅ†…ๅญ˜็ผ“ๅญ˜็š„ * */ public class ACache { public static final int TIME_MINUTE = 60; public static final int TIME_HOUR = 60 * 60; public static final int TIME_DAY = TIME_HOUR * 24; public static final int TIME_WEEK = TIME_DAY * 7; private static final int MAX_SIZE = 1000 * 1000 * 50; // 50 mb private static final int MAX_COUNT = Integer.MAX_VALUE; // ไธ้™ๅˆถๅญ˜ๆ”พๆ•ฐๆฎ็š„ๆ•ฐ้‡ private static Map<String, ACache> mInstanceMap = new HashMap<String, ACache>(); private ACacheManager mCache; private ACache(File cacheDir, long max_size, int max_count) { if (!cacheDir.exists() && !cacheDir.mkdirs()) { throw new RuntimeException("can't make dirs in " + cacheDir.getAbsolutePath()); } mCache = new ACacheManager(cacheDir, max_size, max_count); } public static ACache get(Context ctx) { return get(ctx, "ACache"); } public static ACache get(Context ctx, String cacheName) { File f = new File(ctx.getCacheDir(), cacheName); return get(f, MAX_SIZE, MAX_COUNT); } public static ACache get(File cacheDir) { return get(cacheDir, MAX_SIZE, MAX_COUNT); } public static ACache get(Context ctx, long max_zise, int max_count) { File f = new File(ctx.getCacheDir(), "ACache"); return get(f, max_zise, max_count); } public static ACache get(File cacheDir, long max_zise, int max_count) { ACache manager = mInstanceMap.get(cacheDir.getAbsoluteFile() + myPid()); if (manager == null) { manager = new ACache(cacheDir, max_zise, max_count); mInstanceMap.put(cacheDir.getAbsolutePath() + myPid(), manager); } return manager; } private static String myPid() { return "_" + android.os.Process.myPid(); } // ======================================= // ============ Stringๆ•ฐๆฎ ่ฏปๅ†™ ============== // ======================================= /** * ไฟๅญ˜ Stringๆ•ฐๆฎ ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„Stringๆ•ฐๆฎ */ public void put(String key, String value) { File file = mCache.newFile(key); BufferedWriter out = null; try { out = new BufferedWriter(new FileWriter(file), 1024); out.write(value); } catch (IOException e) { e.printStackTrace(); } finally { if (out != null) { try { out.flush(); out.close(); } catch (IOException e) { e.printStackTrace(); } } mCache.put(file); } } /** * ไฟๅญ˜ Stringๆ•ฐๆฎ ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„Stringๆ•ฐๆฎ * @param saveTime ไฟๅญ˜็š„ๆ—ถ้—ด๏ผŒๅ•ไฝ๏ผš็ง’ */ public void put(String key, String value, int saveTime) { put(key, Utils.newStringWithDateInfo(saveTime, value)); } /** * ่ฏปๅ– Stringๆ•ฐๆฎ * * @param key * @return String ๆ•ฐๆฎ */ public String getAsString(String key) { File file = mCache.get(key); if (!file.exists()) return null; boolean removeFile = false; BufferedReader in = null; try { in = new BufferedReader(new FileReader(file)); String readString = ""; String currentLine; while ((currentLine = in.readLine()) != null) { readString += currentLine; } if (!Utils.isDue(readString)) { return Utils.clearDateInfo(readString); } else { removeFile = true; return null; } } catch (IOException e) { e.printStackTrace(); return null; } finally { if (in != null) { try { in.close(); } catch (IOException e) { e.printStackTrace(); } } if (removeFile) remove(key); } } // ======================================= // ============= JSONObject ๆ•ฐๆฎ ่ฏปๅ†™ ============== // ======================================= /** * ไฟๅญ˜ JSONObjectๆ•ฐๆฎ ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„JSONๆ•ฐๆฎ */ public void put(String key, JSONObject value) { put(key, value.toString()); } /** * ไฟๅญ˜ JSONObjectๆ•ฐๆฎ ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„JSONObjectๆ•ฐๆฎ * @param saveTime ไฟๅญ˜็š„ๆ—ถ้—ด๏ผŒๅ•ไฝ๏ผš็ง’ */ public void put(String key, JSONObject value, int saveTime) { put(key, value.toString(), saveTime); } /** * ่ฏปๅ–JSONObjectๆ•ฐๆฎ * * @param key * @return JSONObjectๆ•ฐๆฎ */ public JSONObject getAsJSONObject(String key) { String JSONString = getAsString(key); try { JSONObject obj = new JSONObject(JSONString); return obj; } catch (Exception e) { e.printStackTrace(); return null; } } // ======================================= // ============ JSONArray ๆ•ฐๆฎ ่ฏปๅ†™ ============= // ======================================= /** * ไฟๅญ˜ JSONArrayๆ•ฐๆฎ ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„JSONArrayๆ•ฐๆฎ */ public void put(String key, JSONArray value) { put(key, value.toString()); } /** * ไฟๅญ˜ JSONArrayๆ•ฐๆฎ ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„JSONArrayๆ•ฐๆฎ * @param saveTime ไฟๅญ˜็š„ๆ—ถ้—ด๏ผŒๅ•ไฝ๏ผš็ง’ */ public void put(String key, JSONArray value, int saveTime) { put(key, value.toString(), saveTime); } /** * ่ฏปๅ–JSONArrayๆ•ฐๆฎ * * @param key * @return JSONArrayๆ•ฐๆฎ */ public JSONArray getAsJSONArray(String key) { String JSONString = getAsString(key); try { JSONArray obj = new JSONArray(JSONString); return obj; } catch (Exception e) { e.printStackTrace(); return null; } } // ======================================= // ============== byte ๆ•ฐๆฎ ่ฏปๅ†™ ============= // ======================================= /** * ไฟๅญ˜ byteๆ•ฐๆฎ ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„ๆ•ฐๆฎ */ public void put(String key, byte[] value) { File file = mCache.newFile(key); FileOutputStream out = null; try { out = new FileOutputStream(file); out.write(value); } catch (Exception e) { e.printStackTrace(); } finally { if (out != null) { try { out.flush(); out.close(); } catch (IOException e) { e.printStackTrace(); } } mCache.put(file); } } /** * ไฟๅญ˜ byteๆ•ฐๆฎ ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„ๆ•ฐๆฎ * @param saveTime ไฟๅญ˜็š„ๆ—ถ้—ด๏ผŒๅ•ไฝ๏ผš็ง’ */ public void put(String key, byte[] value, int saveTime) { put(key, Utils.newByteArrayWithDateInfo(saveTime, value)); } /** * ่Žทๅ– byte ๆ•ฐๆฎ * * @param key * @return byte ๆ•ฐๆฎ */ public byte[] getAsBinary(String key) { RandomAccessFile RAFile = null; boolean removeFile = false; try { File file = mCache.get(key); if (!file.exists()) return null; RAFile = new RandomAccessFile(file, "r"); byte[] byteArray = new byte[(int) RAFile.length()]; RAFile.read(byteArray); if (!Utils.isDue(byteArray)) { return Utils.clearDateInfo(byteArray); } else { removeFile = true; return null; } } catch (Exception e) { e.printStackTrace(); return null; } finally { if (RAFile != null) { try { RAFile.close(); } catch (IOException e) { e.printStackTrace(); } } if (removeFile) remove(key); } } // ======================================= // ============= ๅบๅˆ—ๅŒ– ๆ•ฐๆฎ ่ฏปๅ†™ =============== // ======================================= /** * ไฟๅญ˜ Serializableๆ•ฐๆฎ ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„value */ public void put(String key, Serializable value) { put(key, value, -1); } /** * ไฟๅญ˜ Serializableๆ•ฐๆฎๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„value * @param saveTime ไฟๅญ˜็š„ๆ—ถ้—ด๏ผŒๅ•ไฝ๏ผš็ง’ */ public void put(String key, Serializable value, int saveTime) { ByteArrayOutputStream baos = null; ObjectOutputStream oos = null; try { baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(value); byte[] data = baos.toByteArray(); if (saveTime != -1) { put(key, data, saveTime); } else { put(key, data); } } catch (Exception e) { e.printStackTrace(); } finally { try { oos.close(); } catch (IOException e) { } } } /** * ่ฏปๅ– Serializableๆ•ฐๆฎ * * @param key * @return Serializable ๆ•ฐๆฎ */ public Object getAsObject(String key) { byte[] data = getAsBinary(key); if (data != null) { ByteArrayInputStream bais = null; ObjectInputStream ois = null; try { bais = new ByteArrayInputStream(data); ois = new ObjectInputStream(bais); Object reObject = ois.readObject(); return reObject; } catch (Exception e) { e.printStackTrace(); return null; } finally { try { if (bais != null) bais.close(); } catch (IOException e) { e.printStackTrace(); } try { if (ois != null) ois.close(); } catch (IOException e) { e.printStackTrace(); } } } return null; } // ======================================= // ============== bitmap ๆ•ฐๆฎ ่ฏปๅ†™ ============= // ======================================= /** * ไฟๅญ˜ bitmap ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„bitmapๆ•ฐๆฎ */ public void put(String key, Bitmap value) { put(key, Utils.Bitmap2Bytes(value)); } /** * ไฟๅญ˜ bitmap ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„ bitmap ๆ•ฐๆฎ * @param saveTime ไฟๅญ˜็š„ๆ—ถ้—ด๏ผŒๅ•ไฝ๏ผš็ง’ */ public void put(String key, Bitmap value, int saveTime) { put(key, Utils.Bitmap2Bytes(value), saveTime); } /** * ่ฏปๅ– bitmap ๆ•ฐๆฎ * * @param key * @return bitmap ๆ•ฐๆฎ */ public Bitmap getAsBitmap(String key) { if (getAsBinary(key) == null) { return null; } return Utils.Bytes2Bimap(getAsBinary(key)); } // ======================================= // ============= drawable ๆ•ฐๆฎ ่ฏปๅ†™ ============= // ======================================= /** * ไฟๅญ˜ drawable ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„drawableๆ•ฐๆฎ */ public void put(String key, Drawable value) { put(key, Utils.drawable2Bitmap(value)); } /** * ไฟๅญ˜ drawable ๅˆฐ ็ผ“ๅญ˜ไธญ * * @param key ไฟๅญ˜็š„key * @param value ไฟๅญ˜็š„ drawable ๆ•ฐๆฎ * @param saveTime ไฟๅญ˜็š„ๆ—ถ้—ด๏ผŒๅ•ไฝ๏ผš็ง’ */ public void put(String key, Drawable value, int saveTime) { put(key, Utils.drawable2Bitmap(value), saveTime); } /** * ่ฏปๅ– Drawable ๆ•ฐๆฎ * * @param key * @return Drawable ๆ•ฐๆฎ */ public Drawable getAsDrawable(String key) { if (getAsBinary(key) == null) { return null; } return Utils.bitmap2Drawable(Utils.Bytes2Bimap(getAsBinary(key))); } /** * ่Žทๅ–็ผ“ๅญ˜ๆ–‡ไปถ * * @param key * @return value ็ผ“ๅญ˜็š„ๆ–‡ไปถ */ public File file(String key) { File f = mCache.newFile(key); if (f.exists()) return f; return null; } /** * ็งป้™คๆŸไธชkey * * @param key * @return ๆ˜ฏๅฆ็งป้™คๆˆๅŠŸ */ public boolean remove(String key) { return mCache.remove(key); } /** * ๆธ…้™คๆ‰€ๆœ‰ๆ•ฐๆฎ */ public void clear() { mCache.clear(); } /** * @author ๆจ็ฆๆตท๏ผˆmichael๏ผ‰ www.yangfuhai.com * @version 1.0 * @title ๆ—ถ้—ด่ฎก็ฎ—ๅทฅๅ…ท็ฑป */ private static class Utils { private static final char mSeparator = ' '; /** * ๅˆคๆ–ญ็ผ“ๅญ˜็š„Stringๆ•ฐๆฎๆ˜ฏๅฆๅˆฐๆœŸ * * @param str * @return true๏ผšๅˆฐๆœŸไบ† false๏ผš่ฟ˜ๆฒกๆœ‰ๅˆฐๆœŸ */ private static boolean isDue(String str) { return isDue(str.getBytes()); } /** * ๅˆคๆ–ญ็ผ“ๅญ˜็š„byteๆ•ฐๆฎๆ˜ฏๅฆๅˆฐๆœŸ * * @param data * @return true๏ผšๅˆฐๆœŸไบ† false๏ผš่ฟ˜ๆฒกๆœ‰ๅˆฐๆœŸ */ private static boolean isDue(byte[] data) { String[] strs = getDateInfoFromDate(data); if (strs != null && strs.length == 2) { String saveTimeStr = strs[0]; while (saveTimeStr.startsWith("0")) { saveTimeStr = saveTimeStr .substring(1, saveTimeStr.length()); } long saveTime = Long.valueOf(saveTimeStr); long deleteAfter = Long.valueOf(strs[1]); if (System.currentTimeMillis() > saveTime + deleteAfter * 1000) { return true; } } return false; } private static String newStringWithDateInfo(int second, String strInfo) { return createDateInfo(second) + strInfo; } private static byte[] newByteArrayWithDateInfo(int second, byte[] data2) { byte[] data1 = createDateInfo(second).getBytes(); byte[] retdata = new byte[data1.length + data2.length]; System.arraycopy(data1, 0, retdata, 0, data1.length); System.arraycopy(data2, 0, retdata, data1.length, data2.length); return retdata; } private static String clearDateInfo(String strInfo) { if (strInfo != null && hasDateInfo(strInfo.getBytes())) { strInfo = strInfo.substring(strInfo.indexOf(mSeparator) + 1, strInfo.length()); } return strInfo; } private static byte[] clearDateInfo(byte[] data) { if (hasDateInfo(data)) { return copyOfRange(data, indexOf(data, mSeparator) + 1, data.length); } return data; } private static boolean hasDateInfo(byte[] data) { return data != null && data.length > 15 && data[13] == '-' && indexOf(data, mSeparator) > 14; } private static String[] getDateInfoFromDate(byte[] data) { if (hasDateInfo(data)) { String saveDate = new String(copyOfRange(data, 0, 13)); String deleteAfter = new String(copyOfRange(data, 14, indexOf(data, mSeparator))); return new String[]{saveDate, deleteAfter}; } return null; } private static int indexOf(byte[] data, char c) { for (int i = 0; i < data.length; i++) { if (data[i] == c) { return i; } } return -1; } private static byte[] copyOfRange(byte[] original, int from, int to) { int newLength = to - from; if (newLength < 0) throw new IllegalArgumentException(from + " > " + to); byte[] copy = new byte[newLength]; System.arraycopy(original, from, copy, 0, Math.min(original.length - from, newLength)); return copy; } private static String createDateInfo(int second) { String currentTime = System.currentTimeMillis() + ""; while (currentTime.length() < 13) { currentTime = "0" + currentTime; } return currentTime + "-" + second + mSeparator; } /* * Bitmap โ†’ byte[] */ private static byte[] Bitmap2Bytes(Bitmap bm) { if (bm == null) { return null; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); } /* * byte[] โ†’ Bitmap */ private static Bitmap Bytes2Bimap(byte[] b) { if (b.length == 0) { return null; } return BitmapFactory.decodeByteArray(b, 0, b.length); } /* * Drawable โ†’ Bitmap */ private static Bitmap drawable2Bitmap(Drawable drawable) { if (drawable == null) { return null; } // ๅ– drawable ็š„้•ฟๅฎฝ int w = drawable.getIntrinsicWidth(); int h = drawable.getIntrinsicHeight(); // ๅ– drawable ็š„้ขœ่‰ฒๆ ผๅผ Bitmap.Config config = drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565; // ๅปบ็ซ‹ๅฏนๅบ” bitmap Bitmap bitmap = Bitmap.createBitmap(w, h, config); // ๅปบ็ซ‹ๅฏนๅบ” bitmap ็š„็”ปๅธƒ Canvas canvas = new Canvas(bitmap); drawable.setBounds(0, 0, w, h); // ๆŠŠ drawable ๅ†…ๅฎน็”ปๅˆฐ็”ปๅธƒไธญ drawable.draw(canvas); return bitmap; } /* * Bitmap โ†’ Drawable */ @SuppressWarnings("deprecation") private static Drawable bitmap2Drawable(Bitmap bm) { if (bm == null) { return null; } return new BitmapDrawable(bm); } } /** * @author ๆจ็ฆๆตท๏ผˆmichael๏ผ‰ www.yangfuhai.com * @version 1.0 * @title ็ผ“ๅญ˜็ฎก็†ๅ™จ */ public class ACacheManager { private final AtomicLong cacheSize; private final AtomicInteger cacheCount; private final long sizeLimit; private final int countLimit; private final Map<File, Long> lastUsageDates = Collections .synchronizedMap(new HashMap<File, Long>()); protected File cacheDir; private ACacheManager(File cacheDir, long sizeLimit, int countLimit) { this.cacheDir = cacheDir; this.sizeLimit = sizeLimit; this.countLimit = countLimit; cacheSize = new AtomicLong(); cacheCount = new AtomicInteger(); calculateCacheSizeAndCacheCount(); } /** * ่ฎก็ฎ— cacheSizeๅ’ŒcacheCount */ private void calculateCacheSizeAndCacheCount() { new Thread(new Runnable() { @Override public void run() { int size = 0; int count = 0; File[] cachedFiles = cacheDir.listFiles(); if (cachedFiles != null) { for (File cachedFile : cachedFiles) { size += calculateSize(cachedFile); count += 1; lastUsageDates.put(cachedFile, cachedFile.lastModified()); } cacheSize.set(size); cacheCount.set(count); } } }).start(); } private void put(File file) { int curCacheCount = cacheCount.get(); while (curCacheCount + 1 > countLimit) { long freedSize = removeNext(); cacheSize.addAndGet(-freedSize); curCacheCount = cacheCount.addAndGet(-1); } cacheCount.addAndGet(1); long valueSize = calculateSize(file); long curCacheSize = cacheSize.get(); while (curCacheSize + valueSize > sizeLimit) { long freedSize = removeNext(); curCacheSize = cacheSize.addAndGet(-freedSize); } cacheSize.addAndGet(valueSize); Long currentTime = System.currentTimeMillis(); file.setLastModified(currentTime); lastUsageDates.put(file, currentTime); } private File get(String key) { File file = newFile(key); Long currentTime = System.currentTimeMillis(); file.setLastModified(currentTime); lastUsageDates.put(file, currentTime); return file; } private File newFile(String key) { return new File(cacheDir, key.hashCode() + ""); } private boolean remove(String key) { File image = get(key); return image.delete(); } private void clear() { lastUsageDates.clear(); cacheSize.set(0); File[] files = cacheDir.listFiles(); if (files != null) { for (File f : files) { f.delete(); } } } /** * ็งป้™คๆ—ง็š„ๆ–‡ไปถ * * @return */ private long removeNext() { if (lastUsageDates.isEmpty()) { return 0; } Long oldestUsage = null; File mostLongUsedFile = null; Set<Entry<File, Long>> entries = lastUsageDates.entrySet(); synchronized (lastUsageDates) { for (Entry<File, Long> entry : entries) { if (mostLongUsedFile == null) { mostLongUsedFile = entry.getKey(); oldestUsage = entry.getValue(); } else { Long lastValueUsage = entry.getValue(); if (lastValueUsage < oldestUsage) { oldestUsage = lastValueUsage; mostLongUsedFile = entry.getKey(); } } } } long fileSize = calculateSize(mostLongUsedFile); if (mostLongUsedFile.delete()) { lastUsageDates.remove(mostLongUsedFile); } return fileSize; } private long calculateSize(File file) { return file.length(); } } }
[ "1139790882@qq.com" ]
1139790882@qq.com
b8592fd75451ad8065de688b948804342d031de7
98d313cf373073d65f14b4870032e16e7d5466f0
/gradle-open-labs/example/src/main/java/se/molybden/Class26467.java
c385029cfa738251023d5587b4fbdcb75ff02ba0
[]
no_license
Molybden/gradle-in-practice
30ac1477cc248a90c50949791028bc1cb7104b28
d7dcdecbb6d13d5b8f0ff4488740b64c3bbed5f3
refs/heads/master
2021-06-26T16:45:54.018388
2016-03-06T20:19:43
2016-03-06T20:19:43
24,554,562
0
0
null
null
null
null
UTF-8
Java
false
false
110
java
public class Class26467{ public void callMe(){ System.out.println("called"); } }
[ "jocce.nilsson@gmail.com" ]
jocce.nilsson@gmail.com
6a1c08e3fe91b6c386f542b39375bd2b15f840d3
363fb43e223efdf2b0c86988332f64dff71105ef
/src/main/java/com/warmcompany/udong/document/model/Document.java
b3827aedf691c13372802cca5ce6c0abf941b618
[]
no_license
udong/server
c5dd5d9ec90d895591f9465e7696866b0cd52969
c390176af12346ff877b65a1f11f857bd6eb1a0c
refs/heads/master
2021-01-10T02:03:56.618057
2015-12-26T05:51:59
2015-12-26T05:51:59
45,329,194
0
0
null
null
null
null
UTF-8
Java
false
false
2,344
java
package com.warmcompany.udong.document.model; import java.util.Date; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.springframework.format.annotation.DateTimeFormat; import com.warmcompany.udong.board.model.Board; /** * 2015. 12. 18. * Copyright by joyhan / HUFS * Document */ @Entity @Table(name = "Document") public class Document { @Id @GeneratedValue @Column(name="id") private int id; @Column(name="board_id") private int boardId; @Column(name="author_id") private int authorId; private String title; private String contents; @Column(name="reg_date") private Date regDate; @Column(name="mod_date") private Date modDate; private int hits; @Column(name="comment_count") private int commentCount; private int type; @ManyToOne @JoinColumn(name = "boardId") private Board board; public int getId() { return id; } public void setId(int id) { this.id = id; } public int getBoardId() { return boardId; } public void setBoardId(int boardId) { this.boardId = boardId; } public int getAuthorId() { return authorId; } public void setAuthorId(int authorId) { this.authorId = authorId; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContents() { return contents; } public void setContents(String contents) { this.contents = contents; } public Date getRegDate() { return regDate; } public void setRegDate(Date regDate) { this.regDate = regDate; } public Date getModDate() { return modDate; } public void setModDate(Date modDate) { this.modDate = modDate; } public int getHits() { return hits; } public void setHits(int hits) { this.hits = hits; } public int getCommentCount() { return commentCount; } public void setCommentCount(int commentCount) { this.commentCount = commentCount; } public int getType() { return type; } public void setType(int type) { this.type = type; } public Board getBoard() { return board; } public void setBoard(Board board) { this.board = board; } }
[ "yyh910214@gmail.com" ]
yyh910214@gmail.com
3d006946672c39f4163039f24a0ea8ab89094ba5
dea04aa4c94afd38796e395b3707d7e98b05b609
/Participant results/P7/Interaction-7/ArrayIntList_ES_2_AlreadyValued_Test.java
e2962e65da7298d6c34adeb43caa948f215d9583
[]
no_license
PdedP/InterEvo-TR
aaa44ef0a4606061ba4263239bafdf0134bb11a1
77878f3e74ee5de510e37f211e907547674ee602
refs/heads/master
2023-04-11T11:51:37.222629
2023-01-09T17:37:02
2023-01-09T17:37:02
486,658,497
0
0
null
null
null
null
UTF-8
Java
false
false
1,259
java
/* * This file was automatically generated by EvoSuite * Tue Dec 14 12:20:46 GMT 2021 */ package com.org.apache.commons.collections.primitives; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import com.org.apache.commons.collections.primitives.ArrayIntList; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class ArrayIntList_ES_2_AlreadyValued_Test extends ArrayIntList_ES_2_AlreadyValued_Test_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { ArrayIntList arrayIntList0 = new ArrayIntList(); // Undeclared exception! try { arrayIntList0.set(192, 1283); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Should be at least 0 and less than 0, found 192 // verifyException("com.org.apache.commons.collections.primitives.ArrayIntList", e); } } }
[ "pedro@uca.es" ]
pedro@uca.es
667d3456a4b211c5cda86c23cf664a29d646394e
0ae199a25f8e0959734f11071a282ee7a0169e2d
/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Mutate.java
fc488d901fceeb7c64bdde08c42e1e72e12436c2
[ "Apache-2.0" ]
permissive
lishuai12/onosfw-L3
314d2bc79424d09dcd8f46a4c467bd36cfa9bf1b
e60902ba8da7de3816f6b999492bec2d51dd677d
refs/heads/master
2021-01-10T08:09:56.279267
2015-11-06T02:49:00
2015-11-06T02:49:00
45,652,234
0
1
null
2016-03-10T22:30:45
2015-11-06T01:49:10
Java
UTF-8
Java
false
false
2,850
java
/* * Copyright 2015 Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.onosproject.ovsdb.rfc.operations; import static com.google.common.base.Preconditions.checkNotNull; import java.util.List; import org.onosproject.ovsdb.rfc.notation.Condition; import org.onosproject.ovsdb.rfc.notation.Mutation; import org.onosproject.ovsdb.rfc.schema.TableSchema; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** * mutate operation.Refer to RFC 7047 Section 5.2. */ public final class Mutate implements Operation { @JsonIgnore private final TableSchema tableSchema; private final String op; private final List<Condition> where; private final List<Mutation> mutations; /** * Constructs a Mutate object. * @param schema TableSchema entity * @param where the List of Condition entity * @param mutations the List of Mutation entity */ public Mutate(TableSchema schema, List<Condition> where, List<Mutation> mutations) { checkNotNull(schema, "TableSchema cannot be null"); checkNotNull(mutations, "mutations cannot be null"); checkNotNull(where, "where cannot be null"); this.tableSchema = schema; this.op = Operations.MUTATE.op(); this.where = where; this.mutations = mutations; } /** * Returns the mutations member of mutate operation. * @return the mutations member of mutate operation */ public List<Mutation> getMutations() { return mutations; } /** * Returns the where member of mutate operation. * @return the where member of mutate operation */ public List<Condition> getWhere() { return where; } @Override public String getOp() { return op; } @Override public TableSchema getTableSchema() { return tableSchema; } /** * For the use of serialization. * @return the table member of update operation */ @JsonProperty public String getTable() { return tableSchema.name(); } }
[ "lishuai12@huawei.com" ]
lishuai12@huawei.com
31320a72c553466be218ab2544c4d382bbba8177
cee4fd78b2eae85036e94dbae2daa4653a5426e5
/src/main/java/com/openx/audience/xdi/lucene/LoadGroupHandler.java
ed70cbfa85fae2625c8e96187ffca642fc615d44
[]
no_license
henryzhao81/Lucene-MapReduce
6cb26b8fdca8f3c6f48a680e04b65e17389af86e
114047c1ff141848cb406f96f9545c250233948c
refs/heads/master
2022-05-27T18:07:49.416836
2019-07-17T21:45:07
2019-07-17T21:45:07
197,461,475
0
0
null
2022-05-20T21:03:10
2019-07-17T20:55:01
Java
UTF-8
Java
false
false
1,211
java
package com.openx.audience.xdi.lucene; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; public class LoadGroupHandler { FileSystem remoteFileSystem = null; int loadNum = -1; String localPath = null; LoadHandler[] handlers; public LoadGroupHandler(FileSystem remoteFileSystem, int loadNum, String localPath) { handlers = new LoadHandler[loadNum]; for(int i = 0; i < loadNum; i++) { handlers[i] = new LoadHandler(remoteFileSystem, this, localPath, i); } } private ConcurrentLinkedQueue<Path> queue = new ConcurrentLinkedQueue<Path>(); public void execute() { if(handlers != null && handlers.length > 0) { CountDownLatch latch = new CountDownLatch(handlers.length); for(LoadHandler handler : handlers) { handler.setLatch(latch); handler.start(); } try { latch.await(); }catch(InterruptedException ex) { ex.printStackTrace(); } } } public void addPath(Path path) { this.queue.offer(path); } public Path getPath() { return this.queue.poll(); } }
[ "hzhao@donghengs-MacBook-Pro.local" ]
hzhao@donghengs-MacBook-Pro.local
a707384af3bca0174ab490cadf0394fc95c6117b
d8791c43308faddb381b64cd82c3ffba3d2f937e
/src/test/java/com/nurkiewicz/rxjava/Contenedor.java
bee5e477e15940e77b2d103cb7cb1d61a0277532
[]
no_license
alcastelo/rxjava-workshop
45365c614230aacf1a686db5e7560c2b34541473
728f9f3397838d307c847323c63a15fd0e610558
refs/heads/master
2021-01-19T22:16:40.837240
2017-04-21T19:12:59
2017-04-21T19:12:59
88,784,606
0
0
null
2017-04-19T19:48:24
2017-04-19T19:48:23
null
UTF-8
Java
false
false
683
java
package com.nurkiewicz.rxjava; import io.reactivex.Flowable; import org.reactivestreams.Subscriber; /** * Created by angel on 20/04/17. */ public class Contenedor extends Flowable<Contenedor> { String Uri; String Html; public Contenedor(String uri, String html) { Uri = uri; Html = html; } public String getUri() { return Uri; } public void setUri(String uri) { Uri = uri; } public String getHtml() { return String.valueOf(Html); } public void setHtml(String html) { Html = html; } @Override protected void subscribeActual(Subscriber<? super Contenedor> s) { } }
[ "alcastelo@gmail.com" ]
alcastelo@gmail.com
9e42801f3e2900a95e37569c317eda79d99586fa
15a7cb66fc9b5904a9720c0ef357c86b78dc11f6
/v2429/Objects/src/xevolution/vrcg/devdemov2400/designerscripts/LS_cla_task_v2_execution.java
5a3022cdb24b6c64d4631299496c4dc3b03221e1
[]
no_license
VB6Hobbyst7/vrcg
2c09bb52a0d11c573feb7c64bdb62f9c610646f6
c61acf00fc2a6a464fdd538470a276bd15a3f802
refs/heads/main
2023-04-17T19:03:03.611634
2021-05-11T17:36:07
2021-05-11T17:36:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
624
java
package xevolution.vrcg.devdemov2400.designerscripts; import anywheresoftware.b4a.objects.TextViewWrapper; import anywheresoftware.b4a.objects.ImageViewWrapper; import anywheresoftware.b4a.BA; public class LS_cla_task_v2_execution{ public static void LS_general(java.util.LinkedHashMap<String, anywheresoftware.b4a.keywords.LayoutBuilder.ViewWrapperAndAnchor> views, int width, int height, float scale) { anywheresoftware.b4a.keywords.LayoutBuilder.setScaleRate(0.3); //BA.debugLineNum = 2;BA.debugLine="AutoScaleAll"[CLA_TASK_V2_Execution/General script] anywheresoftware.b4a.keywords.LayoutBuilder.scaleAll(views); } }
[ "felipemrvieira@gmail.com" ]
felipemrvieira@gmail.com
19756f9129a157c8a39ea1cf9b251b4de87a4c29
a96b426f37c2aa8e021a61ec26369fc9deb7c138
/src/main/java/org/lu/designpattern/abstractFactory/WheelerFactory.java
648da0ecc1a4e3f0c6f3edda5455769e27fc09fd
[]
no_license
popwar/CoreJava
dc8e70a9639a136f48338529e2d52d6b4a5b2c4a
5c31f2312e1ddfb6015feada3dc947c70557f78b
refs/heads/master
2020-05-18T08:57:39.496714
2015-11-13T01:48:10
2015-11-13T01:48:10
33,644,095
0
0
null
null
null
null
UTF-8
Java
false
false
438
java
package org.lu.designpattern.abstractFactory; public class WheelerFactory extends AbstractFactory<Wheeler> { @Override public Wheeler createObject(Wheeler wheeler) { Wheeler returnWheeler = null; try { returnWheeler = wheeler.getClass().newInstance(); } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); throw new RuntimeException("get instance failed"); } return returnWheeler; } }
[ "popwar.lue@gmail.com" ]
popwar.lue@gmail.com
815d0ff7595694024d55282cfd09d6f6c26099ff
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_f00aadd83d6d0751e8961fd2acb926993529e964/ForumRssPage/2_f00aadd83d6d0751e8961fd2acb926993529e964_ForumRssPage_t.java
68277fa738a4da7ef3bd7600ebd7fc5c9b39e136
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,324
java
package com.mick88.convoytrucking.forum; import java.util.List; import android.os.AsyncTask; import android.os.Bundle; import android.widget.ListView; import com.mick88.convoytrucking.ConvoyTruckingApp; import com.mick88.convoytrucking.R; import com.mick88.convoytrucking.base.BaseFragment; import com.mick88.convoytrucking.forum.rss.RssItem; import com.mick88.convoytrucking.forum.rss.RssPostAdapter; import com.mick88.convoytrucking.forum.rss.RssReader; import com.mick88.convoytrucking.interfaces.OnDownloadListener; import com.mick88.convoytrucking.interfaces.RefreshListener; import com.mick88.util.FontApplicator; import com.mick88.util.HttpUtils; public class ForumRssPage extends BaseFragment { private static final String RSS_FEED_URL = "http://www.forum.convoytrucking.net/index.php?action=.xml;type=rss"; AsyncTask<?, ?, ?> downloadTask=null; @Override public void onCreate(Bundle arg0) { super.onCreate(arg0); downloadData(null); } @Override protected int selectLayout() { return R.layout.list; } @Override public boolean refresh(final RefreshListener listener) { if (downloadTask != null) return false; downloadData(new OnDownloadListener() { @Override public void onDownloadFinished() { listener.onRefreshFinished(); } }); return true; } @Override protected void downloadData(final OnDownloadListener listener) { downloadTask = new AsyncTask<Void, Void, List<RssItem>>() { @Override protected List<RssItem> doInBackground(Void... params) { try { return new RssReader(RSS_FEED_URL).read(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return null; } } protected void onPostExecute(List<RssItem> result) { downloadTask = null; ListView listView = (ListView) findViewById(R.id.listView); HttpUtils webHandler = new HttpUtils(); listView.setAdapter(new RssPostAdapter(activity, result, new FontApplicator(activity.getAssets(), ConvoyTruckingApp.FONT_ROBOTO_LIGHT), webHandler, webHandler)); if (listener != null) listener.onDownloadFinished(); }; protected void onCancelled() { downloadTask = null; }; }.execute(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
42968b56d241ab5ecfe34572411f0014a3548ff8
4ad5b64226a10a72b5b5d21bb58156666cff408e
/starting-point/src/main/java/bezier/curves/pkg3d/camera/Point4.java
d3e721147be7909da77907d8cffde8c586c5d6e4
[]
no_license
angrajales/Computer-Graphics-2020-1
5a59eaa737893b4c5441af73a04f4b860a672cf4
ae0a03272e5079790ae2d2a54c15b9298b7a8f1e
refs/heads/master
2020-12-20T21:05:43.720248
2020-05-25T16:44:43
2020-05-25T16:44:43
236,210,084
3
2
null
2020-05-25T16:44:45
2020-01-25T18:17:02
Java
UTF-8
Java
false
false
1,027
java
package bezier.curves.pkg3d.camera; public class Point4 { double x, y, z,w; public Point4(double x, double y, double z, double w){ this.x=x; this.y=y; this.z=z; this.w=w; } public double magnitude(){ return Math.sqrt( Math.pow(x,2) + Math.pow(y,2) + Math.pow(z,2) + Math.pow(w,2)); } public void normalize(){ x = x/w; y = y/w; z = z/w; w = 1; } public void normalize2(){ double m= magnitude(); x = x/m; y= y/m; z= z/m; } public static Point4 crossProduct(Point4 v1, Point4 v2){ double x1, y1,z1; x1 = ((v1.y*v2.z)-(v2.y*v1.z)); y1 =-((v1.x*v2.z)-(v2.x*v1.z)); z1 =((v1.x*v2.y)-(v2.x*v1.y)); Point4 vector = new Point4(x1, y1, z1,1); return vector; } public static double dotProduct(Point4 v1, Point4 v2){ return ((v1.x*v2.x)+(v1.y*v2.y)+(v1.z*v2.z)); } }
[ "stivenramireza@gmail.com" ]
stivenramireza@gmail.com
47f0c1f0ac0546b20957c637889bbd7cd5e723f4
d27d705c91a17545e07d448b36801444a9a286da
/app/src/main/java/com/example/justeat/ShowFoodItemFragment.java
8317832fa713f9cb2c9d96cf4e2332e97fcba4e6
[]
no_license
SharmaPrateek196/online-food-ordering-android-app
682761231ee72a20f8e51ce2ba35a8e4add7fcfd
9c41d4e0e644a78d836d1a915557c05c2a96c87a
refs/heads/master
2020-08-02T23:40:50.266226
2019-09-28T19:31:38
2019-09-28T19:31:38
211,548,716
1
0
null
null
null
null
UTF-8
Java
false
false
4,692
java
package com.example.justeat; import android.app.ProgressDialog; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.android.volley.DefaultRetryPolicy; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.dto.Customer; import com.dto.FoodItem; import org.json.JSONArray; import org.json.JSONObject; import java.util.ArrayList; public class ShowFoodItemFragment extends Fragment { View v; // TextView tvFoodName,tvFoodCat,tvFoodPrice; // Button btnFoodUpdate,btnFoodDelete; // ImageView ivFoodItem; RecyclerView rcv; RecyclerView.Adapter adapter; RecyclerView.LayoutManager mgr; ArrayList<FoodItem> flist; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { v = inflater.inflate(R.layout.show_food_item_fragment,container,false); return v; } @Override public void onResume() { super.onResume(); loadData(); } public void loadData() { // tvFoodName = v.findViewById(R.id.txtFoodName); // tvFoodCat = v.findViewById(R.id.txtFoodCat); // tvFoodPrice = v.findViewById(R.id.txtFoodPrice); // btnFoodDelete = v.findViewById(R.id.btnFoodDelete); // btnFoodUpdate = v.findViewById(R.id.btnFoodUpdate); // ivFoodItem = v.findViewById(R.id.imgFoodItem); rcv = v.findViewById(R.id.show_food_recycle); flist = new ArrayList<>(); mgr = new LinearLayoutManager(getActivity()); rcv.setLayoutManager(mgr); final ProgressDialog pd = new ProgressDialog(getActivity()); pd.setTitle("CONNECTING TO SERVER"); pd.setMessage("Downloading Food Items"); pd.setProgressStyle(ProgressDialog.STYLE_SPINNER); pd.show(); StringRequest srq = new StringRequest(Request.Method.GET, ServerAddress.MYSERVER + "/GetAllFoodItems.jsp", new Response.Listener<String>() { @Override public void onResponse(String response) { if(response.trim().equals("no")) { pd.dismiss(); Toast.makeText(getActivity(), "No food Items to display", Toast.LENGTH_SHORT).show(); } else { try { pd.dismiss(); JSONArray arr = new JSONArray(response.trim()); for (int i = 0; i < arr.length(); i++) { JSONObject obj = arr.getJSONObject(i); FoodItem f = new FoodItem(); f.setId(obj.getInt("id")); f.setItemName(obj.getString("itemName")); f.setItemPrice(obj.getInt("itemPrice")); f.setImg_path(obj.getString("img_path")); f.setCategoryID(obj.getInt("categoryID")); flist.add(f); } adapter = new ShowFoodItemAdapter(flist, getActivity()); rcv.setAdapter(adapter); } catch (Exception ex) { ex.printStackTrace(); } } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Toast.makeText(getActivity(), "Volley Error : "+error.getMessage(), Toast.LENGTH_SHORT).show(); } }); srq.setRetryPolicy(new DefaultRetryPolicy( 0, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); AppController.getInstance().addToRequestQueue(srq,"Get_Food_Items"); } }
[ "sharmaprateek196@gmail.com" ]
sharmaprateek196@gmail.com
4a5d771049a93334b385aac2898ff79f72714d84
7313922fba5cbeacdf12a2b6571439e644c8a8b7
/linkis-public-enhancements/linkis-jobhistory/src/test/java/org/apache/linkis/jobhistory/Scan.java
bd4cfac5d0cb4356cb58248646269819b4b06e1c
[ "Apache-2.0", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
wyx94/Linkis
5a6cfce100a5074f575dcbca680e1355088b4b45
503f72d927c700c248239d22188641eb7ffb78fb
refs/heads/master
2023-03-05T07:29:39.034649
2023-02-25T13:50:26
2023-02-25T13:50:26
216,470,125
0
0
Apache-2.0
2019-10-21T03:28:42
2019-10-21T03:28:42
null
UTF-8
Java
false
false
1,057
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.linkis.jobhistory; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.mybatis.spring.annotation.MapperScan; @EnableAutoConfiguration @MapperScan("org.apache.linkis.jobhistory.dao") public class Scan {}
[ "peacewong@apache.org" ]
peacewong@apache.org
ebf2907e9de127c05c58bd1f29b44739356ab3f1
29a6693b6ad4eb1244d39f26bb1ab3e3eef6be62
/src/ro/uvt/Main.java
dc0f20da3e834cdcfeaac43f145b0ebdb195a571
[]
no_license
Kwolok/SPLab1
ea4e732e61d75ae8e25febc41ed2d76f11ddb031
73b7690db13e974232ac0e887dbb91b29028daa5
refs/heads/master
2023-01-02T02:21:53.092432
2020-10-27T07:46:22
2020-10-27T07:46:22
301,991,917
0
0
null
null
null
null
UTF-8
Java
false
false
478
java
package ro.uvt; import java.util.Arrays; import java.util.List; public class Main { public static void main(String[] args) { // System.out.println("Hi!"); Cuprins cuprins = new Cuprins(); List<Autor> autori = Arrays.asList(new Autor("Ion Barbu")); Carte c = new Carte(autori, cuprins, "CarteX"); c.createCapitol("Introducere", Arrays.asList(new Paragraf(), new Imagine(), new Tabel(), new Tabel())); c.render(); } }
[ "daniel.borita@yahoo.com" ]
daniel.borita@yahoo.com
542b39f7fa87ccd8443657891a59500e8c83dee0
e72d1f146161a1e6e973fc3d5543a87424555726
/app/src/androidTest/java/com/book/android/android_book/ApplicationTest.java
33f0729037b5c9833828ee564bd2acb92f3d8e56
[]
no_license
NCharvy/android-book
1acebe5f1d38a9e7c665efc1fd3580295cc0e4a9
752322751e2b4612ed91e52bd173232aadf61c26
refs/heads/master
2021-08-23T22:14:19.892560
2016-06-05T14:46:34
2016-06-05T14:46:34
113,363,468
0
0
null
null
null
null
UTF-8
Java
false
false
360
java
package com.book.android.android_book; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "imbert.kevin94@gmail.com" ]
imbert.kevin94@gmail.com
9e43556216074fd82d45af818c04e7939f342ca0
e57bb383435097f67173b49854dd5bea482f1c6b
/cse12final/src/AList.java
ba451287590032eb6744974b555757f17b1ca905
[]
no_license
CSE12-SP21-Assignments/cse12-sp21-final-coding
2973a311e9280d5d3f7261e32dc526a41911229d
a85fb10c3a437e2f04d073e747a7dc53b922e531
refs/heads/master
2023-05-12T07:50:32.348623
2021-06-07T04:58:09
2021-06-07T04:58:09
374,509,179
0
0
null
null
null
null
UTF-8
Java
false
false
1,337
java
public class AList<E> implements GenList<E> { E[] elements; int size; @SuppressWarnings("unchecked") public AList() { this.elements = (E[]) new Object[2]; this.size = 0; } public void add(E s) { expandCapacity(); this.elements[this.size] = s; this.size += 1; } public E get(int index) { if (index >= this.size) { throw new IndexOutOfBoundsException(); } return this.elements[index]; } public int size() { return this.size; } @SuppressWarnings("unchecked") private void expandCapacity() { int currentCapacity = this.elements.length; if (this.size < currentCapacity) { return; } E[] expanded = (E[]) new Object[currentCapacity * 2]; for (int i = 0; i < this.size; i += 1) { expanded[i] = this.elements[i]; } this.elements = expanded; } // Assumes a valid index is given public void remove(int index) { for (int i = index; i < this.size - 1; i++) { this.elements[i] = this.elements[i + 1]; } this.elements[size] = null; this.size -= 1; return; } // Assumes a valid index is given public void insert(int index, E s) { expandCapacity(); for (int i = this.size; i > index; i--) { this.elements[i] = this.elements[i - 1]; } this.elements[index] = s; this.size += 1; return; } public void prepend(E s) { this.insert(0, s); return; } }
[ "cheeryone821@gmail.com" ]
cheeryone821@gmail.com
4c42cc637735c617460dafa944fd6ebcb06600af
b6ce561710a885cbad633c123623849e5fadc606
/GroceryList.java
15e4d1baeff3a0e905be354b323607be4d97e236
[]
no_license
edpedron/training
33bdd8141f64f5a7bd22256f5cada4d16778b110
27e99e3ff5448cb9865e0b602a8f9172e6151ca4
refs/heads/master
2021-07-14T02:23:30.545972
2017-10-16T18:08:48
2017-10-16T18:08:48
106,284,093
0
0
null
null
null
null
UTF-8
Java
false
false
559
java
import java.util.Scanner; public class GroceryList { public static void main(String[] args) { // declare array of 5 double [] prices = new double[5]; Scanner in = new Scanner(System.in); System.out.println("Enter 5 prices: "); prices[0] = in.nextDouble(); prices[1] = in.nextDouble(); prices[2] = in.nextDouble(); prices[4] = in.nextDouble(); prices[5] = in.nextDouble(); double total = prices[0]+prices[1]+prices[2]+prices[3]+prices[4]; System.out.println("The total for all 5 items is: $%5.2f", total); System.out.println(); } }
[ "sf.hlp.wozs@gmail.com" ]
sf.hlp.wozs@gmail.com
45809e7f564fa388cdd0bd2c61102cc3b539069d
bae29405842e2662b8dfc8909ee38fe5c71469a2
/base-parent/base-security-app/src/main/java/com/base/security/app/exception/AuthExceptionEntryPoint.java
df30b4a21b660116a26a0240392bb1ab1d28eae7
[]
no_license
BISSKKP/Springsecurity-oauth2.0
26c8c05df4c99769038b1d0349141e884fd1f663
6ee36ab7745153c7e534431e6d06781448392d21
refs/heads/master
2023-02-03T03:12:32.896158
2020-12-22T09:45:33
2020-12-22T09:45:33
279,559,935
0
2
null
2020-07-14T11:14:39
2020-07-14T10:56:26
Java
UTF-8
Java
false
false
1,581
java
package com.base.security.app.exception; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.core.AuthenticationException; import org.springframework.security.oauth2.common.exceptions.InvalidTokenException; import org.springframework.security.web.AuthenticationEntryPoint; import com.base.common.ajax.AjaxJson; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; /** * ๆŽˆๆƒ็  ๅคฑๆ•ˆ ๆ—ถ ่ฟ”ๅ›ž่‡ชๅฎšไน‰ๆถˆๆฏ * @author lqq * */ @Slf4j public class AuthExceptionEntryPoint implements AuthenticationEntryPoint { @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { log.info("่ฎฟ้—ฎๆญค่ต„ๆบ้œ€่ฆๅฎŒๅ…จ็š„่บซไปฝ้ชŒ่ฏ"); Throwable cause = authException.getCause(); AjaxJson j=new AjaxJson(); j.setSuccess(false); if(cause instanceof InvalidTokenException) { j.setErrorCode("401"); j.setMsg("ๆ— ๆ•ˆ็š„token"); }else{ j.setErrorCode("401"); j.setMsg("่ฎฟ้—ฎๆญค่ต„ๆบ้œ€่ฆๅฎŒๅ…จ็š„่บซไปฝ้ชŒ่ฏ"); } j.put("path", request.getServletPath()); j.put("data", authException.getMessage()); response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); response.setContentType("application/json;charset=UTF-8"); response.getWriter().write(new ObjectMapper().writeValueAsString(j)); } }
[ "928776712@qq.com" ]
928776712@qq.com
4773ccdb55db1221027db189c106fed5602fba02
18221be1271d97d1c8453b6684788ad265d848c8
/src/nl/strohalm/cyclos/entities/accounts/guarantees/Guarantee.java
a1704577621e579c5df01e756616961226f7dca6
[]
no_license
zemuldo/Cyclos_3.7
0a4cfd5630007ba15d22d43c204949f1baa1a10d
b10a5c3eb0263079cead93491db1acaead9452e5
refs/heads/master
2021-06-16T09:55:00.426309
2017-03-16T07:47:02
2017-03-16T07:47:02
85,166,722
4
4
null
null
null
null
UTF-8
Java
false
false
9,118
java
/* This file is part of Cyclos (www.cyclos.org). A project of the Social Trade Organisation (www.socialtrade.org). Cyclos is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Cyclos 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 Cyclos; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package nl.strohalm.cyclos.entities.accounts.guarantees; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; import java.util.Map; import nl.strohalm.cyclos.entities.Entity; import nl.strohalm.cyclos.entities.Relationship; import nl.strohalm.cyclos.entities.accounts.loans.Loan; import nl.strohalm.cyclos.entities.customization.fields.PaymentCustomField; import nl.strohalm.cyclos.entities.customization.fields.PaymentCustomFieldValue; import nl.strohalm.cyclos.entities.members.Element; import nl.strohalm.cyclos.entities.members.Member; import nl.strohalm.cyclos.entities.settings.LocalSettings; import nl.strohalm.cyclos.services.accounts.guarantees.GuaranteeFeeVO; import nl.strohalm.cyclos.utils.CustomFieldsContainer; import nl.strohalm.cyclos.utils.Period; import nl.strohalm.cyclos.utils.StringValuedEnum; import nl.strohalm.cyclos.utils.guarantees.GuaranteesHelper; public class Guarantee extends Entity implements CustomFieldsContainer<PaymentCustomField, PaymentCustomFieldValue> { public static enum Relationships implements Relationship { CERTIFICATION("certification"), GUARANTEE_TYPE("guaranteeType"), LOAN("loan"), PAYMENT_OBLIGATIONS("paymentObligations"), LOGS("logs"), BUYER("buyer"), SELLER("seller"), ISSUER("issuer"), CUSTOM_VALUES("customValues"); private final String name; private Relationships(final String name) { this.name = name; } public String getName() { return name; } } public static enum Status implements StringValuedEnum { PENDING_ISSUER("PI"), PENDING_ADMIN("PA"), ACCEPTED("A"), REJECTED("R"), WITHOUT_ACTION("WA"), CANCELLED("C"); private final String value; private Status(final String value) { this.value = value; } public String getValue() { return value; } } private static final long serialVersionUID = 3906916142405683801L; private Status status; private BigDecimal amount; private GuaranteeFeeVO creditFeeSpec; private GuaranteeFeeVO issueFeeSpec; private Period validity; private Calendar registrationDate; private Certification certification; private GuaranteeType guaranteeType; private Loan loan; private Collection<PaymentObligation> paymentObligations; private Collection<GuaranteeLog> logs; private Member buyer; private Member seller; /** * If the guarantee type's model is 'with payment obligation' this issuer must be equals to the issuer of the certification. */ private Member issuer; private Collection<PaymentCustomFieldValue> customValues; /** * Change the guarantee's status and adds a new guarantee log to it * @param status the new guarantee's status * @param by the author of the change * @return the new GuaranteeLog added to this Guarantee */ public GuaranteeLog changeStatus(final Status status, final Element by) { setStatus(status); if (logs == null) { logs = new ArrayList<GuaranteeLog>(); } final GuaranteeLog log = getNewLog(status, by); logs.add(log); return log; } public BigDecimal getAmount() { return amount; } public Member getBuyer() { return buyer; } public Certification getCertification() { return certification; } public BigDecimal getCreditFee() { return isNullFee(creditFeeSpec) ? null : GuaranteesHelper.calculateFee(validity, amount, creditFeeSpec); } public GuaranteeFeeVO getCreditFeeSpec() { return creditFeeSpec; } public Class<PaymentCustomField> getCustomFieldClass() { return PaymentCustomField.class; } public Class<PaymentCustomFieldValue> getCustomFieldValueClass() { return PaymentCustomFieldValue.class; } public Collection<PaymentCustomFieldValue> getCustomValues() { return customValues; } public GuaranteeType getGuaranteeType() { return guaranteeType; } public BigDecimal getIssueFee() { return isNullFee(issueFeeSpec) ? null : GuaranteesHelper.calculateFee(validity, amount, issueFeeSpec); } public GuaranteeFeeVO getIssueFeeSpec() { return issueFeeSpec; } public Member getIssuer() { return issuer; } public Loan getLoan() { return loan; } public Collection<GuaranteeLog> getLogs() { return logs; } public GuaranteeLog getNewLog(final Status status, final Element by) { final GuaranteeLog log = new GuaranteeLog(); log.setGuarantee(this); log.setDate(Calendar.getInstance()); log.setStatus(status); log.setBy(by); // TODO: should I add the created log to the logs' collection? return log; } public Collection<PaymentObligation> getPaymentObligations() { return paymentObligations; } public Calendar getRegistrationDate() { return registrationDate; } public Member getSeller() { return seller; } public Status getStatus() { return status; } public Period getValidity() { return validity; } public void setAmount(final BigDecimal amount) { this.amount = amount; } public void setBuyer(final Member buyer) { this.buyer = buyer; } public void setCertification(final Certification certification) { this.certification = certification; } public void setCreditFeeSpec(final GuaranteeFeeVO creditFeeSpec) { this.creditFeeSpec = creditFeeSpec; } public void setCustomValues(final Collection<PaymentCustomFieldValue> customValues) { this.customValues = customValues; } public void setGuaranteeType(final GuaranteeType guaranteeType) { this.guaranteeType = guaranteeType; } public void setIssueFeeSpec(final GuaranteeFeeVO issueFeeSpec) { this.issueFeeSpec = issueFeeSpec; } public void setIssuer(final Member issuer) { this.issuer = issuer; } public void setLoan(final Loan loan) { this.loan = loan; } public void setLogs(final Collection<GuaranteeLog> logs) { this.logs = logs; } public void setPaymentObligations(final Collection<PaymentObligation> paymentObligations) { this.paymentObligations = paymentObligations; } public void setRegistrationDate(final Calendar issueDate) { registrationDate = issueDate; } public void setSeller(final Member seller) { this.seller = seller; } public void setStatus(final Status status) { this.status = status; } public void setValidity(final Period validity) { this.validity = validity; } @Override public String toString() { return "G: " + getId() + " - " + status; } @Override protected void appendVariableValues(final Map<String, Object> variables, final LocalSettings localSettings) { final String pattern = getGuaranteeType().getCurrency().getPattern(); variables.put("amount", localSettings.getUnitsConverter(pattern).toString(getAmount())); variables.put("buyer_member", getBuyer().getName()); variables.put("buyer_login", getBuyer().getUsername()); if (getSeller() != null) { variables.put("seller_member", getSeller().getName()); variables.put("seller_login", getSeller().getUsername()); } if (getIssuer() != null) { variables.put("issuer_member", getIssuer().getName()); variables.put("issuer_login", getIssuer().getUsername()); } } private boolean isNullFee(final GuaranteeFeeVO feeSpec) { return feeSpec == null || feeSpec.getType() == null || feeSpec.getFee() == null; } }
[ "otis.eng.555@gmail.com" ]
otis.eng.555@gmail.com
ba895cb477466dd44c4dac9ba31a5d64ed03b113
99a8722d0d16e123b69e345df7aadad409649f6c
/jpa/deferred/src/main/java/example/repo/Customer717Repository.java
01f9935a1915e5ebcf8c0dbdb8e8beb0f153465c
[ "Apache-2.0" ]
permissive
spring-projects/spring-data-examples
9c69a0e9f3e2e73c4533dbbab00deae77b2aacd7
c4d1ca270fcf32a93c2a5e9d7e91a5592b7720ff
refs/heads/main
2023-09-01T14:17:56.622729
2023-08-22T16:51:10
2023-08-24T19:48:04
16,381,571
5,331
3,985
Apache-2.0
2023-08-25T09:02:19
2014-01-30T15:42:43
Java
UTF-8
Java
false
false
280
java
package example.repo; import example.model.Customer717; import java.util.List; import org.springframework.data.repository.CrudRepository; public interface Customer717Repository extends CrudRepository<Customer717, Long> { List<Customer717> findByLastName(String lastName); }
[ "ogierke@pivotal.io" ]
ogierke@pivotal.io
dd56197ad6a2bdb9d6168e1d10b5a5756749a100
3b4d5e2746cfc1dfa4ae14a1e3d363b96f038f83
/connectedCars/src/main/java/connectedCars/carSimulator/carSimulator10/CarSimulator10.java
ad3dff1fe2e1e7dd31684f7fa66171694229c307
[]
no_license
salmadoma/IoT-ConnectedCar
2777c107c4a31ce8791c69aa99f73027bba3e356
630060b0307cc1879ce64f409d10a6f599fb0547
refs/heads/master
2020-05-03T10:28:46.362934
2019-03-30T15:53:40
2019-03-30T15:53:40
178,579,010
0
0
null
null
null
null
UTF-8
Java
false
false
804
java
package connectedCars.carSimulator.carSimulator10; import java.net.URISyntaxException; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @SpringBootApplication public class CarSimulator10 { public static void main(String[] args) { SpringApplication.run(CarSimulator10.class); } @Bean public CarSimulator carSimulator() throws InterruptedException, URISyntaxException { String journeysFile = "src/main/java/connectedCars/carSimulator/carSimulator10/file.csv"; int VIN = 10; CarSimulator carSimulator = new CarSimulator(journeysFile,VIN); carSimulator.processInputFile(); return carSimulator; } }
[ "salmadoma@fci.helwan.edu.eg" ]
salmadoma@fci.helwan.edu.eg
2d880a1da99127308664a30d6efec590ca3b99d4
94bebceb987c7bd1b7902644ef92539a0f6aec89
/app/src/main/java/com/example/llcgs/android_kotlin/utils/ClickableMovementMethod.java
a19f26eb7b3c4c863d73e5e70ae2d699783e64c7
[]
no_license
AppleNet/Android_Kotlin_MVP
281ca99ae568f6b80df2c321f6addee0188fa0bf
decc276ec1089bae9f3ecf87a0a0412ad15e9896
refs/heads/master
2021-06-14T21:25:43.712588
2020-06-24T02:59:48
2020-06-24T02:59:48
91,753,755
3
1
null
null
null
null
UTF-8
Java
false
false
2,353
java
/* * Copyright (c) 2016 Zhang Hai <Dreaming.in.Code.ZH@Gmail.com> * All Rights Reserved. */ package com.example.llcgs.android_kotlin.utils; import android.text.Layout; import android.text.Selection; import android.text.Spannable; import android.text.method.BaseMovementMethod; import android.text.method.LinkMovementMethod; import android.text.style.ClickableSpan; import android.view.MotionEvent; import android.widget.TextView; /** * A movement method that traverses links in the text buffer and fires clicks. Unlike * {@link LinkMovementMethod}, this will not consume touch events outside {@link ClickableSpan}s. */ public class ClickableMovementMethod extends BaseMovementMethod { private static ClickableMovementMethod sInstance; public static ClickableMovementMethod getInstance() { if (sInstance == null) { sInstance = new ClickableMovementMethod(); } return sInstance; } @Override public boolean canSelectArbitrarily() { return false; } @Override public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) { int action = event.getActionMasked(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_DOWN) { int x = (int) event.getX(); int y = (int) event.getY(); x -= widget.getTotalPaddingLeft(); y -= widget.getTotalPaddingTop(); x += widget.getScrollX(); y += widget.getScrollY(); Layout layout = widget.getLayout(); int line = layout.getLineForVertical(y); int off = layout.getOffsetForHorizontal(line, x); ClickableSpan[] link = buffer.getSpans(off, off, ClickableSpan.class); if (link.length > 0) { if (action == MotionEvent.ACTION_UP) { link[0].onClick(widget); } else { Selection.setSelection(buffer, buffer.getSpanStart(link[0]), buffer.getSpanEnd(link[0])); } return true; } else { Selection.removeSelection(buffer); } } return false; } @Override public void initialize(TextView widget, Spannable text) { Selection.removeSelection(text); } }
[ "liulongchao@gomeholdings.com" ]
liulongchao@gomeholdings.com
15579c919f12cc78b565ca13b9253f8b18bc55b6
c38815f32153fa1701d4747089f899777e96ca28
/viewgroup1/src/main/java/com/konvy/viewgroup1/view/Viewgroup1.java
78197f9f0bab5af86830ff664f0b5bffe4f679a0
[]
no_license
weijiechenlun/first-app
8f3a396ee247a7af85f713dce46c8fa48a9286d9
737ce1871dd81739593bb177939823875f64fa9f
refs/heads/master
2021-01-10T02:14:26.955332
2015-10-13T06:54:18
2015-10-13T06:54:18
44,157,375
0
0
null
null
null
null
UTF-8
Java
false
false
4,077
java
package com.konvy.viewgroup1.view; import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; /** * Created by Administrator on 2015/10/8. */ public class Viewgroup1 extends ViewGroup { public Viewgroup1(Context context, AttributeSet attrs) { super(context, attrs); } @Override public LayoutParams generateLayoutParams(AttributeSet attrs) { return new MarginLayoutParams(getContext(), attrs); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { //measureChildren(widthMeasureSpec, heightMeasureSpec); int widthMode = MeasureSpec.getMode(widthMeasureSpec); int widthSize = MeasureSpec.getSize(widthMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); int heightSize = MeasureSpec.getSize(heightMeasureSpec); //็”จไบŽ่ฎก็ฎ—ๅทฆ่พนไธคไธชchild็š„้ซ˜ๅบฆ int lHeight = 0; //็”จไบŽ่ฎก็ฎ—ๅณ่พนไธคไธชchild็š„้ซ˜ๅบฆ๏ผŒๅ–ๅทฆๅณไธค่พน้ซ˜ๅบฆ็š„ๆœ€ๅคงๅ€ผ int rHeight = 0; //็”จไบŽ่ฎก็ฎ—ไธŠ่พนไธคไธชchild็š„ๅฎฝๅบฆ int tWidth = 0; //็”จไบŽ่ฎก็ฎ—ไธ‹่พนไธคไธชchild็š„ๅฎฝๅบฆ๏ผŒๅ–ไธŠไธ‹ไธค่พนๅฎฝๅบฆ็š„ๆœ€ๅคงๅ€ผ int bWidth = 0; int count = getChildCount(); int cWidth = 0; int cHeight = 0; MarginLayoutParams cParams = null; for(int i = 0; i < count; i++){ View child = getChildAt(i); measureChildWithMargins(child, widthMeasureSpec, 0, heightMeasureSpec, 0); cWidth = child.getMeasuredWidth(); cHeight = child.getMeasuredHeight(); cParams = (MarginLayoutParams) child.getLayoutParams(); if(i == 0 || i == 1){ tWidth += cWidth + cParams.leftMargin + cParams.rightMargin; } if(i == 2 || i == 3){ bWidth += cWidth + cParams.leftMargin + cParams.rightMargin; } if(i == 0 || i == 2){ lHeight += cHeight + cParams.topMargin + cParams.bottomMargin; } if(i == 1 || i == 3){ rHeight += cHeight + cParams.topMargin + cParams.bottomMargin; } } int width = Math.max(tWidth,bWidth); int height = Math.max(lHeight,rHeight); //ๅฆ‚ๆžœๆ˜ฏwrap_content่ฎพ็ฝฎไธบๆˆ‘ไปฌ่ฎก็ฎ—็š„ๅ€ผ,ๅฆๅˆ™๏ผš็›ดๆŽฅ่ฎพ็ฝฎไธบ็ˆถๅฎนๅ™จ่ฎก็ฎ—็š„ๅ€ผ setMeasuredDimension(widthMode == MeasureSpec.EXACTLY ? widthSize : width, heightMode == MeasureSpec.EXACTLY ? heightSize : height); } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { if(changed){ int count = getChildCount(); int cWidth = 0; int cHeight = 0; MarginLayoutParams cParams = null; for(int i = 0; i < count; i++){ View child = getChildAt(i); cWidth = child.getMeasuredWidth(); cHeight = child.getMeasuredHeight(); cParams = (MarginLayoutParams) child.getLayoutParams(); int cl = 0, ct = 0, cr = 0, cb = 0; switch (i){ case 0: cl = cParams.leftMargin; ct = cParams.topMargin; break; case 1: cl = getMeasuredWidth() - cWidth - cParams.rightMargin; ct = cParams.topMargin; break; case 2: cl = cParams.leftMargin; ct = getMeasuredHeight() - cHeight - cParams.bottomMargin; break; case 3: cl = getMeasuredWidth() - cWidth - cParams.rightMargin; ct = getMeasuredHeight() - cHeight - cParams.bottomMargin; break; } child.layout(cl, ct, cl + cWidth, ct + cHeight); } } } }
[ "583540005@qq.com" ]
583540005@qq.com
dd35084daa3a7131ea12f4ec2bc67704db575e07
d2d50026e72ba633995351a7e2466052d1027e32
/src/test/java/command/DeleteCommandTest.java
111d0ae5f31822b09e806643adfcfa0c4fd6621c
[]
no_license
Cary-Xx/duke
d2b3fddd2f3d4bb6dc59ac27ba84e5bb33571470
f97c95fa6499813ebaeff90fd976b6bfaf943b3c
refs/heads/master
2020-07-15T08:03:50.661683
2019-09-30T12:17:46
2019-09-30T13:56:21
205,518,049
0
0
null
2019-09-26T10:19:01
2019-08-31T08:32:35
Java
UTF-8
Java
false
false
1,526
java
package command; import org.junit.jupiter.api.Test; import task.Task; import task.TaskList; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; public class DeleteCommandTest { @Test public void testDelete_succesfullyDelete() { TaskList taskList = new TaskList(); taskList.addTask(new Task("todo borrow book")); DeleteCommand deleteCommand = new DeleteCommand("delete 1"); deleteCommand.executeCommand(taskList, null); assertEquals(taskList.getTasks().size(), 0); } @Test public void testDelete_EmptyEntry_returnEmptyMessage() { ByteArrayOutputStream outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent)); TaskList taskList = new TaskList(); DeleteCommand deleteCommand = new DeleteCommand("delete"); String result = deleteCommand.executeCommand(taskList, null); assertEquals(result, "โ˜น OOPS!!! You cannot delete an empty entry.\n"); } @Test public void testDelete_Outofbound_outofboundMessage() { TaskList taskList = new TaskList(); taskList.addTask(new Task("todo borrow book")); DeleteCommand deleteCommand = new DeleteCommand("delete 2"); String result = deleteCommand.executeCommand(taskList, null); assertEquals(result, "โ˜น OOPS!!! Out of range, the task does not exist.\n"); } }
[ "e0140856@u.nus.edu" ]
e0140856@u.nus.edu
ac00002da3f819912b557deddc625f0370478591
ea5a965df058eaec721f2bd609505bf5ac3b7611
/src/test/java/keywords/WatchList.java
3af716c2ed32bef216121510ed2f4aa47cf6de40
[]
no_license
scerios/IMDB
3e1e28622dabe2aa830e04a1caec67da1159f8bc
273da323af75b72698c7e6e228bb77cdc7417a5c
refs/heads/master
2020-04-16T23:43:02.770547
2019-01-30T09:53:19
2019-01-30T09:53:19
166,022,911
0
0
null
null
null
null
UTF-8
Java
false
false
1,881
java
package keywords; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; public class WatchList { private static long sumOfMoviesAdded = 1; private static String convertedSum; private static WebDriverWait waitDriver; private static WebElement button; private static WebElement added; public static void addToWatchlist(WebDriver driver) { waitDriver = new WebDriverWait(driver, Log.WAIT_TIMEOUT); waitDriver.until(ExpectedConditions.presenceOfElementLocated(By.className("ribbonize"))); try { added = driver.findElement(By.className("wl-ribbon standalone retina inWL")); } catch (NoSuchElementException e) { System.out.println("There is no element like that."); } button = driver.findElement(By.className("ribbonize")); if (added == null) { setSumOfMoviesAdded(); button.click(); } } public static void getWatchlistPage(WebDriver driver) { waitDriver = new WebDriverWait(driver, Log.WAIT_TIMEOUT); waitDriver.until(ExpectedConditions.presenceOfElementLocated(By.linkText("Watchlist"))); button = driver.findElement(By.linkText("Watchlist")); button.click(); } private static void setSumOfMoviesAdded() { sumOfMoviesAdded++; } public static String convertSumOfMoviesAddedToString() { return convertedSum = String.valueOf(sumOfMoviesAdded); } public static String getActualSumOfMoviesAdded(WebDriver driver) { waitDriver = new WebDriverWait(driver, Log.WAIT_TIMEOUT); waitDriver.until(ExpectedConditions.elementToBeClickable(By.className("count"))); button = driver.findElement(By.className("count")); return button.getText(); } }
[ "89.t.robert@gmail.com" ]
89.t.robert@gmail.com
fc39e93d98fc22cddc3e4a17071bb4961ac49d98
12306986dbfbaba8ecbc7f8a20503dfe6af4a1c1
/src/test/java/dev/huh/commonutils/CommonUtilsApplicationTests.java
84b3b2f93514c43dd340102fdcd1387d497de506
[]
no_license
junhuhdev/common-utils
63b648b3efa8c3fe622a6417593c0c1690ee9607
dda989577ac7b8d1d20980a3905acf310d1ef503
refs/heads/master
2023-07-08T16:38:05.009813
2021-08-13T10:21:02
2021-08-13T10:21:02
395,607,392
0
0
null
null
null
null
UTF-8
Java
false
false
216
java
package dev.huh.commonutils; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class CommonUtilsApplicationTests { @Test void contextLoads() { } }
[ "jun.huh@tele2.com" ]
jun.huh@tele2.com
6e5aeaf4f634823507a59f20abe9ff338c0a46e0
a1f048ba51689a1b73de0db04a4b4b0197038ff8
/src/com/web/array/MoveAllZeroAtEnd.java
f0765f1057f3271da174a475365f583e98cae5e9
[]
no_license
avinash8142/core-java-practice
83d549a352ffa7c34f717216688aa6c526a00ec7
abc4e8da3d537ba277d8e439e86e9f4e95af7a72
refs/heads/master
2022-12-15T20:32:54.618232
2020-09-13T04:14:49
2020-09-13T04:14:49
295,075,849
0
0
null
null
null
null
UTF-8
Java
false
false
1,262
java
package com.web.array; import java.util.Arrays; public class MoveAllZeroAtEnd { public static void main(String[] args) { // Input : arr[] = {1, 2, 0, 4, 3, 0, 5, 0}; // Output : arr[] = {1, 2, 4, 3, 5, 0, 0}; int arr[]= {1, 2, 0, 4, 3, 0, 5, 0}; System.out.println("input "+Arrays.toString(arr)); // moveAllZeroAtEnd(arr); // moveAllZeroAtEndMaintainOrder(arr); moveAllZeroAtEndSingleTraversal(arr); System.out.println(Arrays.toString(arr)); } //input order is not maintaining private static void moveAllZeroAtEnd(int arr[]) { int i=0; int j=arr.length-1; while(i<j) { if(arr[i]!=0) { i++; }else if(arr[j]==0) { j--; }else { int temp=arr[i]; arr[i]=arr[j]; arr[j]=temp; i++; j--; } } System.out.println(Arrays.toString(arr)); } //move all zeroes at the end of array in two traversal private static void moveAllZeroAtEndMaintainOrder(int arr[]) { int i=0; int count=0; while(i<arr.length) { if(arr[i]!=0) { arr[count++]=arr[i]; } i++; } while(count<arr.length) { arr[count++]=0; } } private static void moveAllZeroAtEndSingleTraversal(int arr[]) { int count=0; for(int i=0;i<arr.length;i++) { if(arr[i]!=0) { int temp=arr[count]; arr[count]=arr[i]; arr[i]=temp; count++; } } } }
[ "avinash8142@gmail.com" ]
avinash8142@gmail.com
bbc31f197ba3990bed7b9c756a6ce10b62adb1dc
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/haifengl--smile/5a41c8abc9b1045ef354081220d08f28da44414c/before/MultivariateGaussianDistribution.java
765ef9dc71fd00936115a80f81138a3012a1d71b
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
11,372
java
/******************************************************************************* * Copyright (c) 2010 Haifeng Li * * 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 smile.stat.distribution; import smile.math.matrix.CholeskyDecomposition; import smile.math.Math; /** * Multivariate Gaussian distribution. * * @see GaussianDistribution * * @author Haifeng Li */ public class MultivariateGaussianDistribution extends AbstractMultivariateDistribution implements MultivariateExponentialFamily { private static final double LOG2PIE = Math.log(2 * Math.PI * Math.E); double[] mu; double[][] sigma; boolean diagonal; private int dim; private double[][] sigmaInv; private double[][] sigmaL; private double sigmaDet; private double pdfConstant; private int numParameters; /** * Constructor. The distribution will have a diagonal covariance matrix of * the same variance. * * @param mean mean vector. * @param var variance. */ public MultivariateGaussianDistribution(double[] mean, double var) { if (var <= 0) { throw new IllegalArgumentException("Variance is not positive: " + var); } mu = new double[mean.length]; sigma = new double[mu.length][mu.length]; for (int i = 0; i < mu.length; i++) { mu[i] = mean[i]; sigma[i][i] = var; } diagonal = true; numParameters = mu.length + 1; init(); } /** * Constructor. The distribution will have a diagonal covariance matrix. * Each element has different variance. * * @param mean mean vector. * @param var variance vector. */ public MultivariateGaussianDistribution(double[] mean, double[] var) { if (mean.length != var.length) { throw new IllegalArgumentException("Mean vector and covariance matrix have different dimension"); } mu = new double[mean.length]; sigma = new double[mu.length][mu.length]; for (int i = 0; i < mu.length; i++) { if (var[i] <= 0) { throw new IllegalArgumentException("Variance is not positive: " + var[i]); } mu[i] = mean[i]; sigma[i][i] = var[i]; } diagonal = true; numParameters = 2 * mu.length; init(); } /** * Constructor. * * @param mean mean vector. * @param cov covariance matrix. */ public MultivariateGaussianDistribution(double[] mean, double[][] cov) { if (mean.length != cov.length) { throw new IllegalArgumentException("Mean vector and covariance matrix have different dimension"); } mu = new double[mean.length]; sigma = new double[mean.length][mean.length]; for (int i = 0; i < mu.length; i++) { mu[i] = mean[i]; System.arraycopy(cov[i], 0, sigma[i], 0, mu.length); } diagonal = false; numParameters = mu.length + mu.length * (mu.length + 1) / 2; init(); } /** * Constructor. Mean and covariance will be estimated from the data by MLE. * @param data the training data. */ public MultivariateGaussianDistribution(double[][] data) { this(data, false); } /** * Constructor. Mean and covariance will be estimated from the data by MLE. * @param data the training data. * @param diagonal true if covariance matrix is diagonal. */ public MultivariateGaussianDistribution(double[][] data, boolean diagonal) { this.diagonal = diagonal; mu = Math.colMeans(data); if (diagonal) { sigma = new double[data[0].length][data[0].length]; for (int i = 0; i < data.length; i++) { for (int j = 0; j < mu.length; j++) { sigma[j][j] += (data[i][j] - mu[j]) * (data[i][j] - mu[j]); } } for (int j = 0; j < mu.length; j++) { sigma[j][j] /= (data.length - 1); } } else { sigma = Math.cov(data, mu); } numParameters = mu.length + mu.length * (mu.length + 1) / 2; init(); } /** * Initialize the object. */ private void init() { dim = mu.length; CholeskyDecomposition cholesky = new CholeskyDecomposition(sigma); sigmaInv = cholesky.inverse().array(); sigmaDet = cholesky.det(); sigmaL = cholesky.getL(); pdfConstant = (dim * Math.log(2 * Math.PI) + Math.log(sigmaDet)) / 2.0; } /** * Returns true if the covariance matrix is diagonal. * @return true if the covariance matrix is diagonal */ public boolean isDiagonal() { return diagonal; } @Override public int npara() { return numParameters; } @Override public double entropy() { return (dim * LOG2PIE + Math.log(sigmaDet)) / 2; } @Override public double[] mean() { return mu; } @Override public double[][] cov() { return sigma; } /** * Returns the scatter of distribution, which is defined as |&Sigma;|. */ public double scatter() { return sigmaDet; } @Override public double logp(double[] x) { if (x.length != dim) { throw new IllegalArgumentException("Sample has different dimension."); } double[] v = x.clone(); Math.minus(v, mu); double result = Math.xax(sigmaInv, v) / -2.0; return result - pdfConstant; } @Override public double p(double[] x) { return Math.exp(logp(x)); } /** * Algorithm from Alan Genz (1992) Numerical Computation of * Multivariate Normal Probabilities, Journal of Computational and * Graphical Statistics, pp. 141-149. * * The difference between returned value and the true value of the * CDF is less than 0.001 in 99.9% time. The maximum number of iterations * is set to 10000. */ @Override public double cdf(double[] x) { if (x.length != dim) { throw new IllegalArgumentException("Sample has different dimension."); } int Nmax = 10000; double alph = GaussianDistribution.getInstance().quantile(0.999); double errMax = 0.001; double[] v = x.clone(); Math.minus(v, mu); double p = 0.0; double varSum = 0.0; // d is always zero double[] f = new double[dim]; f[0] = GaussianDistribution.getInstance().cdf(v[0] / sigmaL[0][0]); double[] y = new double[dim]; double err = 2 * errMax; int N; for (N = 1; err > errMax && N <= Nmax; N++) { double[] w = Math.random(dim - 1); for (int i = 1; i < dim; i++) { y[i - 1] = GaussianDistribution.getInstance().quantile(w[i - 1] * f[i - 1]); double q = 0.0; for (int j = 0; j < i; j++) { q += sigmaL[i][j] * y[j]; } f[i] = GaussianDistribution.getInstance().cdf((v[i] - q) / sigmaL[i][i]) * f[i - 1]; } double del = (f[dim - 1] - p) / N; p += del; varSum = (N - 2) * varSum / N + del * del; err = alph * Math.sqrt(varSum); } return p; } /** * Generate a random multivariate Gaussian sample. */ public double[] rand() { double[] spt = new double[mu.length]; for (int i = 0; i < mu.length; i++) { double u, v, q; do { u = Math.random(); v = 1.7156 * (Math.random() - 0.5); double x = u - 0.449871; double y = Math.abs(v) + 0.386595; q = x * x + y * (0.19600 * y - 0.25472 * x); } while (q > 0.27597 && (q > 0.27846 || v * v > -4 * Math.log(u) * u * u)); spt[i] = v / u; } double[] pt = new double[sigmaL.length]; // pt = sigmaL * spt for (int i = 0; i < pt.length; i++) { for (int j = 0; j <= i; j++) { pt[i] += sigmaL[i][j] * spt[j]; } } Math.plus(pt, mu); return pt; } @Override public MultivariateMixture.Component M(double[][] x, double[] posteriori) { int n = x[0].length; double alpha = 0.0; double[] mean = new double[n]; double[][] cov = new double[n][n]; for (int k = 0; k < x.length; k++) { alpha += posteriori[k]; for (int i = 0; i < n; i++) { mean[i] += x[k][i] * posteriori[k]; } } for (int i = 0; i < mean.length; i++) { mean[i] /= alpha; } if (diagonal) { for (int k = 0; k < x.length; k++) { for (int i = 0; i < n; i++) { cov[i][i] += (x[k][i] - mean[i]) * (x[k][i] - mean[i]) * posteriori[k]; } } for (int i = 0; i < cov.length; i++) { cov[i][i] /= alpha; } } else { for (int k = 0; k < x.length; k++) { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cov[i][j] += (x[k][i] - mean[i]) * (x[k][j] - mean[j]) * posteriori[k]; } } } for (int i = 0; i < cov.length; i++) { for (int j = 0; j < cov[i].length; j++) { cov[i][j] /= alpha; } // make sure the covariance matrix is positive definite. cov[i][i] *= 1.00001; } } MultivariateMixture.Component c = new MultivariateMixture.Component(); c.priori = alpha; MultivariateGaussianDistribution g = new MultivariateGaussianDistribution(mean, cov); g.diagonal = diagonal; c.distribution = g; return c; } @Override public String toString() { StringBuilder builder = new StringBuilder("Multivariate Gaussian Distribution:\nmu = ["); for (int i = 0; i < mu.length; i++) { builder.append(mu[i]).append(" "); } builder.setCharAt(builder.length() - 1, ']'); builder.append("\nSigma = [\n"); for (int i = 0; i < sigma.length; i++) { builder.append('\t'); for (int j = 0; j < sigma[i].length; j++) { builder.append(sigma[i][j]).append(" "); } builder.append('\n'); } builder.append("\t]"); return builder.toString(); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
d3e41a23ee375cb6967901d7837a255dfe408a1f
c6e76418dc68bbd852b450ea9eca7880cbf6c9d3
/src/main/java/com/example/blogpost/payload/CommentRequest.java
55f7075c15365313e33431cf64d6e313af802a3f
[]
no_license
agbolade92/BlogAPI
2544e5bcfec47b65a2481594b321b4aaedddf035
29306602a99a7989eb75668954fd3cdcafdba09f
refs/heads/master
2023-08-01T16:56:58.441578
2021-09-26T16:51:02
2021-09-26T16:51:02
410,014,198
0
0
null
2021-09-26T16:51:03
2021-09-24T15:29:09
Java
UTF-8
Java
false
false
126
java
package com.example.blogpost.payload; import lombok.Data; @Data public class CommentRequest { private String content; }
[ "agbolade92" ]
agbolade92
aeb6195d23fef3dd8a294e53bebbb5512b7ed215
d573776e82ab81f2cc82d6d5ccb570a70bd5c538
/Java/src/main/java/Misc/LastStoneWeight/LastStoneWeight.java
7f99772c4f5daa7a0903e05ee836e129163a321a
[]
no_license
timManas/Practice
9497447beadfe21f668a7f5a9f01970f391b13c2
fc87bd14d1124109faa58df5ad72ced4e2e7e5b3
refs/heads/master
2023-08-17T20:10:49.172995
2023-08-16T12:51:01
2023-08-16T12:51:01
229,855,631
1
0
null
null
null
null
UTF-8
Java
false
false
1,055
java
package Misc.LastStoneWeight; import java.util.*; public class LastStoneWeight { public static void main(String [] args) { int [] input = {2,7,4,1,8,1}; System.out.println("Last Stone Weight: " + lastStoneWeight(input)); } public static int lastStoneWeight(int[] stones) { // Step1 - Create list and populate List<Integer> list = new ArrayList<>(); for (int i : stones) list.add(i); // Step2 - Loop by smashing the two heaviest rocks until 1 or none remains while (list.size() > 1) { // Step3 - Sort the list Collections.sort(list); // Get the two heaviest stones int y = list.remove(list.size()-1); int x = list.remove(list.size()-1); System.out.println("x: " + x + " y: " + y); // We add the difference back to the list if (x != y) { list.add(y-x); } } if (list.isEmpty()) return 0; return list.get(0); } }
[ "timothy.romero.manas@gmail.com" ]
timothy.romero.manas@gmail.com
226ae2d394588f9d539b0f2f0c3ef426303fe045
79da31368dd81ee236798487cdc4fdeb39f0545f
/MiniOpdrachtenWeek2/opdracht3.java
809e9eaa6265c1cb6f9c9ff973e09862196ad65c
[]
no_license
tessievh/TraineeshipOefeningen
765f83952f9c0a1070573826e984b803b3d36746
02784cd13c818b9f895439e3b64484a7b7212045
refs/heads/master
2022-11-29T22:23:32.350843
2020-07-31T08:07:23
2020-07-31T08:07:23
280,388,397
0
0
null
null
null
null
UTF-8
Java
false
false
452
java
package MiniOpdrachtenWeek2; import java.util.Scanner; public class opdracht3 { public static void main(String[] args) { // Opdracht 3 Scanner sc = new Scanner(System.in); int i = sc.nextInt(); // Vergelijk cijfer met 6 if (i > 6) { System.out.println("Getal hoger dan 6"); } if (i == 6) { System.out.println("Getal gelijk aan 6"); } if (i < 6) { System.out.println("Getal lager dan 6"); } } }
[ "tessievanhintum@gmail.com" ]
tessievanhintum@gmail.com
196f2eaad197bedf9d13daf264768e516ddf9927
5148293c98b0a27aa223ea157441ac7fa9b5e7a3
/Method_Scraping/xml_scraping/NicadOutputFile_t1_beam/Nicad_t1_beam3531.java
b27671876d3804398d2a1f04fa794f206a700df9
[]
no_license
ryosuke-ku/TestCodeSeacherPlus
cfd03a2858b67a05ecf17194213b7c02c5f2caff
d002a52251f5461598c7af73925b85a05cea85c6
refs/heads/master
2020-05-24T01:25:27.000821
2019-08-17T06:23:42
2019-08-17T06:23:42
187,005,399
0
0
null
null
null
null
UTF-8
Java
false
false
453
java
// clone pairs:13266:80% // 19426:beam/sdks/java/core/src/main/java/org/apache/beam/sdk/io/range/ByteKeyRange.java public class Nicad_t1_beam3531 { public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof ByteKeyRange)) { return false; } ByteKeyRange other = (ByteKeyRange) o; return Objects.equals(startKey, other.startKey) && Objects.equals(endKey, other.endKey); } }
[ "naist1020@gmail.com" ]
naist1020@gmail.com
02a49c99740aff86a1e24110228eefac4d62cc0f
4992205d4a487b7e3cf7f0b47e1fe73c56ea8f47
/src/main/java/com/somnus/designPatterns/simpleFactory/ChartFactory.java
2272762be472efef0b8eea88627f0547e73c682e
[]
no_license
love-sang/J2SE
bb4f8299bd3971bf3182d6fa544e87c6aafcd532
1beb3982311b8fd74ac4354aaac9c4d340ffbb69
refs/heads/master
2020-12-24T05:23:53.791188
2016-06-08T09:26:21
2016-06-08T09:26:21
60,252,274
0
0
null
null
null
null
UTF-8
Java
false
false
959
java
package com.somnus.designPatterns.simpleFactory; /** * @Title: ChartFactory.java * @Package com.somnus.designPatterns.simpleFactory * @Description: TODO * @author Somnus * @date 2015ๅนด6ๆœˆ25ๆ—ฅ ไธŠๅˆ11:19:25 * @version V1.0 */ public class ChartFactory { //้™ๆ€ๅทฅๅŽ‚ๆ–นๆณ• public static Chart getChart(String type) { Chart chart = null; if (type.equalsIgnoreCase("histogram")) { chart = new HistogramChart(); System.out.println("ๅˆๅง‹ๅŒ–่ฎพ็ฝฎๆŸฑ็Šถๅ›พ๏ผ"); } else if (type.equalsIgnoreCase("pie")) { chart = new PieChart(); System.out.println("ๅˆๅง‹ๅŒ–่ฎพ็ฝฎ้ฅผ็Šถๅ›พ๏ผ"); } else if (type.equalsIgnoreCase("line")) { chart = new LineChart(); System.out.println("ๅˆๅง‹ๅŒ–่ฎพ็ฝฎๆŠ˜็บฟๅ›พ๏ผ"); } return chart; } }
[ "1522580013@qq.com" ]
1522580013@qq.com
1fefefda4961d578ac24a5f4f267e2ace2e95232
8d8992f389a9e8345cbcfc5c5b8dd64dcca9159a
/app/src/main/java/com/example/lx/listfragment/DataOptimizeLvActivity.java
c9bf21785650a58ec9937eac597ab76b6e5a700b
[]
no_license
lxg2012/ListFragment
7bc33041c05463de6024e1df1fd6a6f36e776d6a
d29ada68c671f57b97c9ea9cea1d7de0ac57d743
refs/heads/master
2020-04-11T03:18:44.041098
2018-03-08T01:58:37
2018-03-08T01:58:37
124,323,081
0
0
null
null
null
null
UTF-8
Java
false
false
1,902
java
package com.example.lx.listfragment; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.ListView; import com.plattysoft.leonids.ParticleSystem; import com.plattysoft.leonids.modifiers.ScaleModifier; /** * @author LX * ๅคๆ‚ๆ•ฐๆฎๆตๅœจListViewไธญ็š„ๅบ”็”จ */ public class DataOptimizeLvActivity extends AppCompatActivity { private ListView listView; private ListAdapter listAdapter; private ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_data_optimize_lv); imageView = (ImageView) findViewById(R.id.imageView); // listView = (ListView) findViewById(R.id.listview); imageView.postDelayed(new Runnable() { @Override public void run() { new ParticleSystem(DataOptimizeLvActivity.this, 500, R.mipmap.bg_demo, 5000) .setAcceleration(0.00003f, 270) .addModifier(new ScaleModifier(0, 1.2f, 1000, 4000)) .setFadeOut(5000) .setRotationSpeedRange(0, 180) .emit(imageView, 50); } }, 2000); } private class ListAdapter extends BaseAdapter { @Override public int getCount() { return 0; } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { return null; } } }
[ "lixiangang20090501@gmail.com" ]
lixiangang20090501@gmail.com
7e873d92ce5d6fbc7ff246d38a85791aa0664ed5
61919600f624f17a625b8ca34a2d42c1e3b674cd
/Introduction/src/Alerts.java
b933bfb03501e0f7bfb27aa016222676476792ac
[]
no_license
ajithkallur/selenium-training
74ccbc08aa7f1f372e31d30c47c3a24bf051d8c8
77e93557dcb681f9a73ca5cd76a2e59d2cf4fe59
refs/heads/master
2023-05-05T19:10:48.707913
2021-05-27T15:58:22
2021-05-27T15:58:22
371,428,844
0
0
null
null
null
null
UTF-8
Java
false
false
956
java
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class Alerts { public static void main(String[] args) throws InterruptedException { // TODO Auto-generated method stub System.setProperty("webdriver.chrome.driver", "C:\\Users\\ajith.kumarreddy\\Desktop\\Selenium\\chromedriver.exe"); WebDriver driver =new ChromeDriver(); driver.get("https://rahulshettyacademy.com/AutomationPractice/"); String text="Rahul"; driver.findElement(By.id("name")).sendKeys(text); driver.findElement(By.cssSelector("[id='alertbtn']")).click(); System.out.println(driver.switchTo().alert().getText()); // click on alert ok driver.switchTo().alert().accept(); driver.findElement(By.id("confirmbtn")).click(); System.out.println(driver.switchTo().alert().getText()); // click on alert cancel driver.switchTo().alert().dismiss(); } }
[ "ajith.gitam@gmail.com" ]
ajith.gitam@gmail.com
cd35f512a59fdf57f4d18b45ae15bb984b0487ab
b1e893c53101766f7705f85571cf7bf9f30e82dc
/glen-system/src/main/java/com/glen/glensystem/dao/SysUserDao.java
beb2345713f7b8abde9b390ab08d4e858107c988
[]
no_license
gjen1996/microservice
c8d737f9b28243dffa1b9c51d44a46b46210025e
1c5f037e08ea641fa65bc39c7276b80beaf8d7d6
refs/heads/master
2022-09-21T16:17:18.762361
2020-12-03T01:32:04
2020-12-03T01:32:04
192,289,308
1
4
null
2022-09-01T23:35:49
2019-06-17T06:40:20
Java
UTF-8
Java
false
false
320
java
package com.glen.glensystem.dao; import com.baomidou.mybatisplus.mapper.BaseMapper; import com.glen.glensystem.entity.SysUserEntity; /** * @author Glen * @create 2019/6/28 10:32 * @Description */ public interface SysUserDao extends BaseMapper<SysUserEntity> { SysUserEntity findByUsername(String username); }
[ "gaiyc@chinaunicom.cn" ]
gaiyc@chinaunicom.cn
fc63f33aab41ffc1c029441492c315ff8945c5b5
1c2e1dd5b7a2392f2d3a89013b45faf4e02156fe
/src/main/java/dev/semo/npgen/utils/UtilBase64File.java
be1dd6a66ab3401c71cb9abadd46bc32a79c51af
[ "MIT" ]
permissive
Semo/npgen
0802aa87f785747027006c6b9c65bcda5a492660
5a5e8c04cbb4a111585163121a5b26a4b86fa05c
refs/heads/master
2020-06-26T13:20:41.152998
2019-07-31T14:54:29
2019-07-31T14:54:29
199,643,232
0
0
null
null
null
null
UTF-8
Java
false
false
789
java
package dev.semo.npgen.utils; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Base64; public class UtilBase64File { public static String encodeFromFile(String imagePath) { File file = new File(imagePath); try (FileInputStream imageInFile = new FileInputStream(file)) { String base64ImageString = ""; byte imageData[] = new byte[(int) file.length()]; imageInFile.read(imageData); base64ImageString = Base64.getEncoder().encodeToString(imageData); return base64ImageString; } catch (FileNotFoundException e) { System.out.println("Image not found" + e); } catch (IOException ioe) { System.out.println("Exception while reading the Image " + ioe); } return null; } }
[ "semox78@gmail.com" ]
semox78@gmail.com
a91631f66aa6ffa16a74f28d3b59b07366fff13c
9d51fe82c754fb1b9ac2b1003b586fc42f05f578
/Project/MyCosts2/app/src/main/java/com/example/mycosts/api/request/JacksonPostRequest.java
c6735a4b3fb53a2d14ee5e9f51e21196b000f2ac
[]
no_license
liza-dobrynina/MyCosts
15749cbcd5f8a0659d63274286d7fd16edd028b6
979d49483a6e221efd232a9fa4162448822081ff
refs/heads/master
2020-04-28T11:31:39.102834
2020-02-27T10:42:36
2020-02-27T10:42:36
175,244,165
3
1
null
null
null
null
UTF-8
Java
false
false
487
java
package com.example.mycosts.api.request; import com.android.volley.Response; public class JacksonPostRequest<T> extends JacksonRequestWithBody<T> { public JacksonPostRequest(String url, Class<T> clazz, T data, Response.Listener<T> listener, Response.ErrorListener errorListener) { super(Method.POST, url, clazz, data, listener, errorListener); } }
[ "dea998@gmail.com" ]
dea998@gmail.com
85a77774933b915e13868f737148d9350a99b9bb
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/tencentmap/mapsdk/maps/model/UrlTileProvider.java
eed04d2f3305087f5218d021ec74f47da7f21621
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
2,219
java
package com.tencent.tencentmap.mapsdk.maps.model; import com.tencent.map.tools.net.NetManager; import com.tencent.map.tools.net.NetRequest.NetRequestBuilder; import com.tencent.map.tools.net.NetResponse; import com.tencent.map.tools.net.exception.NetErrorException; import java.net.URL; public abstract class UrlTileProvider implements TileProvider { private final int mHeight; private final int mWidth; public UrlTileProvider() { this(256, 256); } public UrlTileProvider(int paramInt1, int paramInt2) { this.mWidth = paramInt1; this.mHeight = paramInt2; } public final Tile getTile(int paramInt1, int paramInt2, int paramInt3) { Object localObject2 = null; Object localObject1 = getTileUrl(paramInt1, paramInt2, paramInt3); Tile localTile = NO_TILE; if (localObject1 == null) {} NetResponse localNetResponse; do { while ((localObject1 == null) || (localObject1.length == 0)) { return localTile; localNetResponse = requestTileData(((URL)localObject1).toString()); localObject1 = localObject2; if (localNetResponse != null) { if (!localNetResponse.available()) { break; } localObject1 = localNetResponse.data; } } return new Tile(this.mWidth, this.mHeight, (byte[])localObject1); localObject1 = localObject2; } while (!(localNetResponse.exception instanceof NetErrorException)); if (localNetResponse.statusCode == 404) { return NO_TILE; } return new Tile(this.mWidth, this.mHeight, null); } public abstract URL getTileUrl(int paramInt1, int paramInt2, int paramInt3); protected NetResponse requestTileData(String paramString) { try { paramString = NetManager.getInstance().builder().url(paramString).doGet(); return paramString; } catch (Exception paramString) {} return null; } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes11.jar * Qualified Name: com.tencent.tencentmap.mapsdk.maps.model.UrlTileProvider * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
52f175bbd5a05e98be673f3a44bd79f5bba21a9d
200db88702071873d7629460e4f9ad2086568f72
/src/main/java/com/epam/bench/web/rest/dto/ProposedPositionsDto.java
b737ba31f1c6df4ec59a84cce5921df4fa7d71b8
[]
no_license
masikbelka/bench-core
e1c021c7ca86b6787b072fcd16ef34e6e06bf79d
51994ddf985db7366e32e6ba3ed9d9e975e9c5da
refs/heads/master
2021-01-01T18:16:50.521718
2017-07-25T11:32:55
2017-07-25T11:32:55
98,295,894
0
0
null
null
null
null
UTF-8
Java
false
false
740
java
package com.epam.bench.web.rest.dto; public class ProposedPositionsDto { private String status; private String name; private String type; private String id; public ProposedPositionsDto() { } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getId() { return id; } public void setId(String id) { this.id = id; } }
[ "tetiana.antonenko@sap.com" ]
tetiana.antonenko@sap.com
75ee15eb097566a108a4f351dcd98b8a3fc3dfd9
abe8257bbd6816dc499d62ab50d4c8ec5fbd608b
/model/MooGameLogic.java
61ace2ae4af5c82babdd7b13a6877bbafd0dd8e2
[]
no_license
PatrikFreij/Clean-Code-Examination
cfca5eda6c0ffbc29f51f38d4f3b96bc9d4f9cd7
b4d0f41554f0e38b66207169a1190ca3c6f4b8a8
refs/heads/main
2023-01-24T15:18:32.998671
2020-12-01T16:02:13
2020-12-01T16:02:13
317,585,373
0
0
null
null
null
null
UTF-8
Java
false
false
913
java
package model; public class MooGameLogic implements GameLogicService { @Override public String generateGoal() { String goal = ""; for (int i = 0; i < 4; i++) { int random = (int) (Math.random() * 10); String randomDigit = "" + random; while (goal.contains(randomDigit)) { random = (int) (Math.random() * 10); randomDigit = "" + random; } goal = goal + randomDigit; } return goal; } @Override public String checkCorrectGoal(String goal, String guess) { int cows = 0, bulls = 0; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { if (goal.charAt(i) == guess.charAt(j)) { if (i == j) { bulls++; } else { cows++; } } } } String result = ""; for (int i = 0; i < bulls; i++) { result = result + "B"; } result = result + ","; for (int i = 0; i < cows; i++) { result = result + "C"; } return result; } }
[ "pat.freij@gmail.com" ]
pat.freij@gmail.com
f68872cb7fc36aefe1ade2068f2ef7f1957f78f3
e384651fd3f7f36be1360d83c75aa12566a7416f
/app/src/test/java/com/xiyun/aidlcall/ExampleUnitTest.java
6535675cc677bbba9d7dce31768cc57641e7e880
[]
no_license
258188170/AidlCall
0a87e596fc5b908711af431dc1b755c0b7abeee1
f570f8cbeefea3185a0bf0243f9d8b30798103da
refs/heads/master
2022-06-11T00:36:46.032370
2020-05-01T14:50:29
2020-05-01T14:50:29
260,484,152
0
0
null
null
null
null
UTF-8
Java
false
false
379
java
package com.xiyun.aidlcall; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "wangpeng@xiyun.com.cn" ]
wangpeng@xiyun.com.cn
a5bce1c25390463ac65da78c8bff12d6b492a708
3dfdb5d20aad275e4fe7be2ce9a4d883b2d28e65
/FormatFontText/app/src/main/java/Model/Align.java
c9bb0f81c69bfdac87f2a1e9986d9b7171d4294a
[]
no_license
NhanVo97/Android-Nhom4-Baitap-tuan2
1287add2eaa0c9dc7a60a6966e9475723b7b7092
94e436670a1a9a8e7bc6a646cb3a1631001a57cf
refs/heads/master
2020-04-28T23:23:05.936240
2019-03-16T06:20:24
2019-03-16T06:20:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
561
java
package Model; import android.view.Gravity; public class Align { private int keyAlign; private String ValueAlign; public Align(int keyAlign, String valueAlign) { this.keyAlign = keyAlign; ValueAlign = valueAlign; } public int getKeyAlign() { return keyAlign; } public void setKeyAlign(int keyAlign) { this.keyAlign = keyAlign; } public String getValueAlign() { return ValueAlign; } public void setValueAlign(String valueAlign) { ValueAlign = valueAlign; } }
[ "vdnhan@689cloud.asia" ]
vdnhan@689cloud.asia
9d3d88020dc4287df853ccb46374f0cb01f86207
f6a6e017dc71c350963c9b134134ba025644ce1b
/app/src/main/java/com/flurry/sdk/C0136f2.java
5b6a6b04a773d6507a138ccc91b816f69f2d7830
[]
no_license
alissonlauffer/via-browser-dump
0f42f924612785cf1e030edbb3d51da8a30829b0
719120ccaff73f65f93c4f43dbfa9654bc6a667d
refs/heads/master
2023-02-23T06:37:03.730470
2021-01-30T18:36:58
2021-01-30T18:36:58
271,610,980
0
2
null
null
null
null
UTF-8
Java
false
false
15,615
java
package com.flurry.sdk; import com.flurry.sdk.C0147g2; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; /* renamed from: com.flurry.sdk.f2 */ public class C0136f2 { /* renamed from: c */ public static final Integer f422c = 50; /* renamed from: d */ private static final String f423d = C0136f2.class.getSimpleName(); /* renamed from: a */ String f424a; /* renamed from: b */ LinkedHashMap<String, List<String>> f425b; /* access modifiers changed from: package-private */ /* renamed from: com.flurry.sdk.f2$a */ public class C0137a implements AbstractC0201n2<List<C0147g2>> { C0137a(C0136f2 f2Var) { } @Override // com.flurry.sdk.AbstractC0201n2 /* renamed from: a */ public final AbstractC0185l2<List<C0147g2>> mo100a(int i) { return new C0175k2(new C0147g2.C0148a()); } } /* access modifiers changed from: package-private */ /* renamed from: com.flurry.sdk.f2$b */ public class C0138b implements AbstractC0201n2<List<C0147g2>> { C0138b(C0136f2 f2Var) { } @Override // com.flurry.sdk.AbstractC0201n2 /* renamed from: a */ public final AbstractC0185l2<List<C0147g2>> mo100a(int i) { return new C0175k2(new C0147g2.C0148a()); } } /* access modifiers changed from: package-private */ /* renamed from: com.flurry.sdk.f2$c */ public class C0139c implements AbstractC0201n2<List<C0147g2>> { C0139c(C0136f2 f2Var) { } @Override // com.flurry.sdk.AbstractC0201n2 /* renamed from: a */ public final AbstractC0185l2<List<C0147g2>> mo100a(int i) { return new C0175k2(new C0147g2.C0148a()); } } /* access modifiers changed from: package-private */ /* renamed from: com.flurry.sdk.f2$d */ public class C0140d implements AbstractC0201n2<List<C0147g2>> { C0140d(C0136f2 f2Var) { } @Override // com.flurry.sdk.AbstractC0201n2 /* renamed from: a */ public final AbstractC0185l2<List<C0147g2>> mo100a(int i) { return new C0175k2(new C0147g2.C0148a()); } } /* access modifiers changed from: package-private */ /* renamed from: com.flurry.sdk.f2$e */ public class C0141e implements AbstractC0201n2<List<C0147g2>> { C0141e(C0136f2 f2Var) { } @Override // com.flurry.sdk.AbstractC0201n2 /* renamed from: a */ public final AbstractC0185l2<List<C0147g2>> mo100a(int i) { return new C0175k2(new C0147g2.C0148a()); } } public C0136f2(String str) { String str2 = str + "Main"; this.f424a = str2; m420g(str2); } /* renamed from: b */ private synchronized void m417b() { LinkedList linkedList = new LinkedList(this.f425b.keySet()); new C0174k1(C0118e1.m386a().f361a.getFileStreamPath(m425l(this.f424a)), ".YFlurrySenderIndex.info.", 1, new C0140d(this)).mo254c(); if (!linkedList.isEmpty()) { String str = this.f424a; m418d(str, linkedList, str); } } /* renamed from: d */ private synchronized void m418d(String str, List<String> list, String str2) { C0328z2.m889d(); String str3 = f423d; C0260s1.m686c(5, str3, "Saving Index File for " + str + " file name:" + C0118e1.m386a().f361a.getFileStreamPath(m425l(str))); C0174k1 k1Var = new C0174k1(C0118e1.m386a().f361a.getFileStreamPath(m425l(str)), str2, 1, new C0139c(this)); ArrayList arrayList = new ArrayList(); for (String str4 : list) { arrayList.add(new C0147g2(str4)); } k1Var.mo253b(arrayList); } /* renamed from: e */ private synchronized void m419e(String str, byte[] bArr) { C0328z2.m889d(); String str2 = f423d; C0260s1.m686c(5, str2, "Saving Block File for " + str + " file name:" + C0118e1.m386a().f361a.getFileStreamPath(C0119e2.m394a(str))); C0119e2.m395b(str).mo253b(new C0119e2(bArr)); } /* renamed from: g */ private void m420g(String str) { this.f425b = new LinkedHashMap<>(); ArrayList<String> arrayList = new ArrayList(); if (m421h(str)) { List<String> i = m422i(str); if (i != null && i.size() > 0) { arrayList.addAll(i); for (String str2 : arrayList) { m423j(str2); } } m424k(str); } else { List<C0147g2> list = (List) new C0174k1(C0118e1.m386a().f361a.getFileStreamPath(m425l(this.f424a)), str, 1, new C0137a(this)).mo252a(); if (list == null) { C0260s1.m697n(f423d, "New main file also not found. returning.."); return; } for (C0147g2 g2Var : list) { arrayList.add(g2Var.f452a); } } for (String str3 : arrayList) { this.f425b.put(str3, m426m(str3)); } } /* renamed from: h */ private synchronized boolean m421h(String str) { File fileStreamPath; fileStreamPath = C0118e1.m386a().f361a.getFileStreamPath(".FlurrySenderIndex.info.".concat(String.valueOf(str))); String str2 = f423d; C0260s1.m686c(5, str2, "isOldIndexFilePresent: for " + str + fileStreamPath.exists()); return fileStreamPath.exists(); } /* renamed from: i */ private synchronized List<String> m422i(String str) { ArrayList arrayList; Throwable th; C0328z2.m889d(); String str2 = f423d; C0260s1.m686c(5, str2, "Reading Index File for " + str + " file name:" + C0118e1.m386a().f361a.getFileStreamPath(".FlurrySenderIndex.info.".concat(String.valueOf(str)))); File fileStreamPath = C0118e1.m386a().f361a.getFileStreamPath(".FlurrySenderIndex.info.".concat(String.valueOf(str))); ArrayList arrayList2 = null; DataInputStream dataInputStream = null; if (fileStreamPath.exists()) { C0260s1.m686c(5, str2, "Reading Index File for " + str + " Found file."); try { DataInputStream dataInputStream2 = new DataInputStream(new FileInputStream(fileStreamPath)); try { int readUnsignedShort = dataInputStream2.readUnsignedShort(); if (readUnsignedShort == 0) { C0328z2.m890e(dataInputStream2); return null; } arrayList = new ArrayList(readUnsignedShort); for (int i = 0; i < readUnsignedShort; i++) { try { int readUnsignedShort2 = dataInputStream2.readUnsignedShort(); C0260s1.m686c(4, f423d, "read iter " + i + " dataLength = " + readUnsignedShort2); byte[] bArr = new byte[readUnsignedShort2]; dataInputStream2.readFully(bArr); arrayList.add(new String(bArr)); } catch (Throwable th2) { th = th2; dataInputStream = dataInputStream2; try { C0260s1.m687d(6, f423d, "Error when loading persistent file", th); arrayList2 = arrayList; return arrayList2; } finally { C0328z2.m890e(dataInputStream); } } } dataInputStream2.readUnsignedShort(); C0328z2.m890e(dataInputStream2); arrayList2 = arrayList; } catch (Throwable th3) { th = th3; arrayList = null; dataInputStream = dataInputStream2; C0260s1.m687d(6, f423d, "Error when loading persistent file", th); arrayList2 = arrayList; return arrayList2; } } catch (Throwable th4) { th = th4; arrayList = null; C0260s1.m687d(6, f423d, "Error when loading persistent file", th); arrayList2 = arrayList; return arrayList2; } } else { C0260s1.m686c(5, str2, "Agent cache file doesn't exist."); } return arrayList2; } /* renamed from: j */ private void m423j(String str) { List<String> i = m422i(str); if (i == null) { C0260s1.m697n(f423d, "No old file to replace"); return; } for (String str2 : i) { byte[] n = m427n(str2); if (n == null) { C0260s1.m686c(6, f423d, "File does not exist"); } else { m419e(str2, n); C0328z2.m889d(); String str3 = f423d; C0260s1.m686c(5, str3, "Deleting block File for " + str2 + " file name:" + C0118e1.m386a().f361a.getFileStreamPath(".flurrydatasenderblock.".concat(String.valueOf(str2)))); File fileStreamPath = C0118e1.m386a().f361a.getFileStreamPath(".flurrydatasenderblock.".concat(String.valueOf(str2))); if (fileStreamPath.exists()) { boolean delete = fileStreamPath.delete(); C0260s1.m686c(5, str3, "Found file for " + str2 + ". Deleted - " + delete); } } } m418d(str, i, ".YFlurrySenderIndex.info."); m424k(str); } /* renamed from: k */ private static void m424k(String str) { C0328z2.m889d(); String str2 = f423d; C0260s1.m686c(5, str2, "Deleting Index File for " + str + " file name:" + C0118e1.m386a().f361a.getFileStreamPath(".FlurrySenderIndex.info.".concat(String.valueOf(str)))); File fileStreamPath = C0118e1.m386a().f361a.getFileStreamPath(".FlurrySenderIndex.info.".concat(String.valueOf(str))); if (fileStreamPath.exists()) { boolean delete = fileStreamPath.delete(); C0260s1.m686c(5, str2, "Found file for " + str + ". Deleted - " + delete); } } /* renamed from: l */ private static String m425l(String str) { return ".YFlurrySenderIndex.info.".concat(String.valueOf(str)); } /* renamed from: m */ private synchronized List<String> m426m(String str) { ArrayList arrayList; C0328z2.m889d(); String str2 = f423d; C0260s1.m686c(5, str2, "Reading Index File for " + str + " file name:" + C0118e1.m386a().f361a.getFileStreamPath(m425l(str))); arrayList = new ArrayList(); for (C0147g2 g2Var : (List) new C0174k1(C0118e1.m386a().f361a.getFileStreamPath(m425l(str)), ".YFlurrySenderIndex.info.", 1, new C0138b(this)).mo252a()) { arrayList.add(g2Var.f452a); } return arrayList; } /* renamed from: n */ private static byte[] m427n(String str) { Throwable th; byte[] bArr; C0328z2.m889d(); String str2 = f423d; C0260s1.m686c(5, str2, "Reading block File for " + str + " file name:" + C0118e1.m386a().f361a.getFileStreamPath(".flurrydatasenderblock.".concat(String.valueOf(str)))); File fileStreamPath = C0118e1.m386a().f361a.getFileStreamPath(".flurrydatasenderblock.".concat(String.valueOf(str))); DataInputStream dataInputStream = null; if (fileStreamPath.exists()) { C0260s1.m686c(5, str2, "Reading Index File for " + str + " Found file."); try { DataInputStream dataInputStream2 = new DataInputStream(new FileInputStream(fileStreamPath)); try { int readUnsignedShort = dataInputStream2.readUnsignedShort(); if (readUnsignedShort == 0) { C0328z2.m890e(dataInputStream2); return null; } byte[] bArr2 = new byte[readUnsignedShort]; dataInputStream2.readFully(bArr2); dataInputStream2.readUnsignedShort(); C0328z2.m890e(dataInputStream2); return bArr2; } catch (Throwable th2) { th = th2; dataInputStream = dataInputStream2; bArr = null; try { C0260s1.m687d(6, f423d, "Error when loading persistent file", th); return bArr; } finally { C0328z2.m890e(dataInputStream); } } } catch (Throwable th3) { th = th3; bArr = null; C0260s1.m687d(6, f423d, "Error when loading persistent file", th); return bArr; } } else { C0260s1.m686c(4, str2, "Agent cache file doesn't exist."); return null; } } /* renamed from: o */ private synchronized boolean m428o(String str) { boolean c; C0328z2.m889d(); C0174k1 k1Var = new C0174k1(C0118e1.m386a().f361a.getFileStreamPath(m425l(str)), ".YFlurrySenderIndex.info.", 1, new C0141e(this)); List<String> a = mo203a(str); if (a != null) { String str2 = f423d; C0260s1.m686c(4, str2, "discardOutdatedBlocksForDataKey: notSentBlocks = " + a.size()); for (String str3 : a) { C0119e2.m395b(str3).mo254c(); C0260s1.m686c(4, f423d, "discardOutdatedBlocksForDataKey: removed block = ".concat(String.valueOf(str3))); } } this.f425b.remove(str); c = k1Var.mo254c(); m417b(); return c; } /* renamed from: a */ public final List<String> mo203a(String str) { return this.f425b.get(str); } /* renamed from: c */ public final synchronized void mo204c(C0119e2 e2Var, String str) { boolean z; String str2 = f423d; C0260s1.m686c(4, str2, "addBlockInfo".concat(String.valueOf(str))); String str3 = e2Var.f367a; List<String> list = this.f425b.get(str); if (list == null) { C0260s1.m686c(4, str2, "New Data Key"); list = new LinkedList<>(); z = true; } else { z = false; } list.add(str3); if (list.size() > f422c.intValue()) { C0119e2.m395b(list.get(0)).mo254c(); list.remove(0); } this.f425b.put(str, list); m418d(str, list, ".YFlurrySenderIndex.info."); if (z) { m417b(); } } /* renamed from: f */ public final boolean mo205f(String str, String str2) { boolean z; List<String> list = this.f425b.get(str2); if (list != null) { C0119e2.m395b(str).mo254c(); z = list.remove(str); } else { z = false; } if (list == null || list.isEmpty()) { m428o(str2); } else { this.f425b.put(str2, list); m418d(str2, list, ".YFlurrySenderIndex.info."); } return z; } }
[ "alissonvitortc@gmail.com" ]
alissonvitortc@gmail.com
50506bcdaac5fd6a913814a98e15d32c8c22a04e
c19b1c410f68d49f8058ec596866c8dc8db0767e
/app/src/main/java/com/wondersgroup/padgrade/MarkChartActivity.java
5d69ec1b141288788be7bd0a120f9d89de11397a
[]
no_license
kevingekun/PadGrade
e74f4b32ffd104c9f78ddd3a8978b469c1120584
094c2a89f54cc083dee1e941e787f4ddf01bc4e9
refs/heads/master
2021-01-20T14:25:33.347581
2017-05-10T13:42:24
2017-05-10T13:42:24
90,610,011
1
0
null
null
null
null
UTF-8
Java
false
false
1,351
java
package com.wondersgroup.padgrade; import android.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.Layout; import android.widget.Button; import android.widget.GridLayout; import android.widget.LinearLayout; import android.widget.TextView; import org.xutils.view.annotation.ContentView; import org.xutils.view.annotation.ViewInject; import org.xutils.x; public class MarkChartActivity extends AppCompatActivity { @ViewInject(R.id.mtv) private TextView tv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle(R.string.app_mark); GridLayout gridLayout = new GridLayout(this); TextView textView1 = new TextView(this); textView1.setWidth(200); textView1.setText("hello"); textView1.setBackgroundColor(Color.RED); gridLayout.addView(textView1); setContentView(gridLayout); /* LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); ll.setPadding(5,5,5,5); Button btn1=new Button(this); Button btn2=new Button(this); btn1.setText("Button1"); btn2.setText("Button2"); ll.addView(btn1); ll.addView(btn2); setContentView(ll);*/ } }
[ "1021813835@qq.com" ]
1021813835@qq.com
9e9fffbc95b5fe360a2221c589075352cea8b392
ebbce176025ce54885d640bfac182946535eddee
/src/main/java/com/zzxhdzj/ej/item03/ReflectionSingletonRegistry.java
50ac20a785a460c683766c5be184721813c75836
[]
no_license
ampm/effective-java-practice
1a46e08b8f0da965c42694d0ca20d74ae1bf072f
3e15de4c7c2aa78673211bf11e13ef7fe67e04f9
refs/heads/master
2021-01-01T18:42:21.868163
2013-12-08T14:25:37
2013-12-08T14:25:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,254
java
package com.zzxhdzj.ej.item03; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.HashMap; /** * Created with IntelliJ IDEA. * User: yangning.roy * Date: 12/8/13 * Time: 9:37 PM * To change this template use File | Settings | File Templates. */ public class ReflectionSingletonRegistry { public static ReflectionSingletonRegistry REGISTRY = new ReflectionSingletonRegistry(); private static HashMap map = new HashMap(); private static Logger logger = LoggerFactory.getLogger(ReflectionSingletonRegistry.class); protected ReflectionSingletonRegistry() { } public static synchronized Object getInstance(String className) { Object singleton = map.get(className); if (singleton != null) { return singleton; } try { singleton = Class.forName(className).newInstance(); logger.info("created singleton:" + singleton); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } map.put(className, singleton); return singleton; } }
[ "hellooooy@gmail.com" ]
hellooooy@gmail.com
9aee1a37a4697c21db049a343a319b0f93c728ae
dc93be9449e5785f84bf3d4a1f662276495823bf
/QueueUsingArray.java
c17017ce253cc3bb9fa9531e3d9837e5f668d574
[]
no_license
mallickrohan08/DS-Queue
574482a79697cf35cc7dc2cddcd8bf1270cd16a4
d519674c1c1681d177ebc2a41b812e373622ae75
refs/heads/master
2020-06-11T02:25:51.495133
2016-12-09T18:40:29
2016-12-09T18:40:29
76,022,892
0
0
null
null
null
null
UTF-8
Java
false
false
2,271
java
class Queue { int size = 0; //No of item in Queue; int front = -1; //front index or head index, from where we can dequeue item; int rear = -1; //Rear index or tail index where we can enqueue items; int capacity = 0; // Maximum size of Queue; int queArr[]; Queue(int cap) { this.capacity = cap; queArr = new int[cap]; } //Enque public void enqueue(int data) { if(full()) { //We can call full method also. System.out.println("Queue is full."); return; } if(empty()) { rear = front = 0; } else { rear = (++rear) % queArr.length; } queArr[rear] = data; size++; } //DeQueue public int dequeue() { if(empty()) { System.out.println("Queue is Empty."); return 0; } //First get the element. int item = queArr[front]; //if Queue is having one element if(rear == front) { rear = front = -1; } else { front = (++front) % queArr.length; } size--; return item; } //Rear; public int rear() { if(empty()) { System.out.println("Queue is Empty."); return 0; } return queArr[rear]; } //Front public int front() { if(empty()) { System.out.println("Queue is Empty."); return 0; } return queArr[front]; } //empty public boolean empty() { if(rear == -1 && front == -1) { return true; } else { return false; } } //Full public boolean full() { return ((rear +1) % queArr.length == front); } public void printQueue() { if(empty()) { System.out.println("Queue is empty."); return; } for(int i=0; i < size; i++) { System.out.println(queArr[i]); } } } class QueueUsingArray { public static void main(String args[]) { //Code goes here; Queue que = new Queue(3); que.enqueue(4); que.enqueue(5); que.enqueue(6); que.enqueue(7); que.printQueue(); System.out.println("-------"); System.out.println("Rear Item : " + que.rear()); System.out.println("Front Item : " + que.front()); System.out.println("-------"); System.out.println("Poped Item : " + que.dequeue()); System.out.println("Poped Item : " + que.dequeue()); que.enqueue(7); System.out.println("Poped Item : " + que.dequeue()); System.out.println("Poped Item : " + que.dequeue()); System.out.println("Poped Item : " + que.dequeue()); } }
[ "mallickrohan08@gmail.com" ]
mallickrohan08@gmail.com
c13cc3324b5433b0292b621c0f2de332da57f0b5
2849271885dd620d2452fef4f74984b316ccffec
/src/main/java/br/com/samsung/security/jwt/JwtTokenProvider.java
d7ed30d80d38cc322acedee23150ee87dc0f948a
[]
no_license
alexsandrodeveloper/samsung-backend
452dc3647339b2d644c42509c30004a29f32bb0f
c38df11ed87d4e550da7420b9b9a5c40191eeac7
refs/heads/master
2022-12-16T09:58:05.318887
2020-09-16T00:36:03
2020-09-16T00:36:03
293,910,467
0
0
null
null
null
null
UTF-8
Java
false
false
2,792
java
package br.com.samsung.security.jwt; import java.util.Date; import java.util.Set; import javax.annotation.PostConstruct; import javax.servlet.http.HttpServletRequest; import org.apache.tomcat.util.codec.binary.Base64; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.stereotype.Service; import br.com.samsung.exception.InvalidJwtAuthenticationException; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jws; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; @Service public class JwtTokenProvider { @Value("${security.jwt.token.secret-key:secret}") private String secretKey = "secret"; @Value("${security.jwt.token.expire-lenght:3600000}") private long validityInMilliseconts = 3600000; // 1hr @Autowired private UserDetailsService userDetailsService; @PostConstruct public void init() { this.secretKey = Base64.encodeBase64String(secretKey.getBytes()); } public String createToken(String username, Set<String> roles) { Claims claims = Jwts.claims().setSubject(username); claims.put("roles", roles); Date now = new Date(); Date validity = new Date(now.getTime() + validityInMilliseconts); return Jwts.builder().setClaims(claims) .setIssuedAt(now). setExpiration(validity). signWith(SignatureAlgorithm.HS256, secretKey).compact(); } public Authentication getAuthentication(String token) { UserDetails userDetails = this.userDetailsService.loadUserByUsername(getUsername(token)); return new UsernamePasswordAuthenticationToken(userDetails, "" , userDetails.getAuthorities()); } private String getUsername(String token) { return Jwts.parser() .setSigningKey(secretKey) .parseClaimsJws(token) .getBody() .getSubject(); } public String resolveToken(HttpServletRequest req) { String bearerToken = req.getHeader("Authorization"); if(bearerToken != null && bearerToken.startsWith("Bearer")) { return bearerToken.substring(7 , bearerToken.length()); } return null; } public boolean validateToken(String token) { try { Jws<Claims> claims = Jwts.parser() .setSigningKey(secretKey) .parseClaimsJws(token); if(claims.getBody().getExpiration().before(new Date())) { return false; } return true; } catch (Exception e) { throw new InvalidJwtAuthenticationException("Token expired or invalid"); } } }
[ "alex_sandrosoares@hotmail.com" ]
alex_sandrosoares@hotmail.com
bc17d6455cbb8eeb9951f0e4a6afa70af3f48bf2
8779cfb1f763759969accd9bab8cb2b3382758d9
/src/fishjoy/model/numberinformation/Number0Information.java
34750fece598cfa16f29b4776a145bc033c3e033
[]
no_license
zhangphil/Android-BuYuDaRenGame
b559cc3104ccd7f719f204af7734eb05a84639a4
e8f4b829ca398dcc982e6173c66d974cf868d279
refs/heads/master
2016-08-08T18:19:49.468414
2015-12-13T04:24:14
2015-12-13T04:24:14
47,905,770
40
13
null
null
null
null
UTF-8
Java
false
false
202
java
package fishjoy.model.numberinformation; public class Number0Information extends INumberInformation { public Number0Information() { super("N0.png"); // TODO Auto-generated constructor stub } }
[ "zhang.fei@msn.com" ]
zhang.fei@msn.com
c0f941968508dc19d8cf17d6be39799892ccf9a7
674fbf5239c24b3aa819dc8f0ddb1a888d7ec606
/LibraryManagement/src/main/java/com/Library/LibraryManagement/MyResource.java
97dc635f67faa544fce6588ba18d1aafa1f4e2b6
[]
no_license
bharathraman/JavaTraining199
8d1a35ccb064e576840b2fdce322a02fff6dda72
67a6d66f26bcc0c0ff50d2c2f8cad5a03965b580
refs/heads/master
2023-08-23T00:59:57.891222
2021-10-27T03:40:14
2021-10-27T03:40:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
589
java
package com.Library.LibraryManagement; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; /** * Root resource (exposed at "myresource" path) */ @Path("myresource") public class MyResource { /** * Method handling HTTP GET requests. The returned object will be sent * to the client as "text/plain" media type. * * @return String that will be returned as a text/plain response. */ @GET @Produces(MediaType.TEXT_PLAIN) public String getIt() { return "Got it!"; } }
[ "bharathraman135@gmail.com" ]
bharathraman135@gmail.com
29ea44364a877c0dc5c91d701cf5d3e99214485c
e75be673baeeddee986ece49ef6e1c718a8e7a5d
/submissions/blizzard/Corpus/eclipse.jdt.ui/9887.java
a64bbdec0c9f03cd4868376f424260d8aa248d8c
[ "MIT" ]
permissive
zhendong2050/fse18
edbea132be9122b57e272a20c20fae2bb949e63e
f0f016140489961c9e3c2e837577f698c2d4cf44
refs/heads/master
2020-12-21T11:31:53.800358
2018-07-23T10:10:57
2018-07-23T10:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
60
java
package p; class A { private class I { } }
[ "tim.menzies@gmail.com" ]
tim.menzies@gmail.com
da1d7e3f74347efd8b009c0af63630e86cd0f4f1
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/33/33_9d556bb155b90787a532ff5f8246d892165619a8/RackMetaData/33_9d556bb155b90787a532ff5f8246d892165619a8_RackMetaData_t.java
f5a414833c990b2f6b444d13e59f80f4338e416f
[]
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,813
java
/* * Copyright 2008-2013 Red Hat, Inc, and individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.torquebox.web.rack; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import org.jboss.as.server.deployment.AttachmentKey; import org.jboss.as.server.deployment.DeploymentUnit; import org.projectodd.polyglot.web.WebApplicationMetaData; public class RackMetaData extends WebApplicationMetaData { public static final AttachmentKey<RackMetaData> ATTACHMENT_KEY = AttachmentKey.create(RackMetaData.class); public RackMetaData() { } @Override public void attachTo(DeploymentUnit unit) { super.attachTo( unit ); unit.putAttachment( ATTACHMENT_KEY, this ); } public void setRackUpScript(String rackUpScript) { this.rackUpScript = rackUpScript; } public String getRackUpScript(File root) throws IOException { return this.rackUpScript; } public void setRackUpScriptLocation(String rackUpScriptLocation) { this.rackUpScriptLocation = rackUpScriptLocation; } public String getRackUpScriptLocation() { return this.rackUpScriptLocation; } public File getRackUpScriptFile(File root) { if (this.rackUpScriptLocation == null) { return null; } if (this.rackUpScriptLocation.startsWith( "/" ) || rackUpScriptLocation.matches( "^[A-Za-z]:.*" )) { return new File( rackUpScriptLocation ); } else { return new File( root, rackUpScriptLocation ); } } public void setRubyRuntimePoolName(String rubyRuntimePoolName) { this.rubyRuntimePoolName = rubyRuntimePoolName; } public String getRubyRuntimePoolName() { return this.rubyRuntimePoolName; } public void setRackApplicationFactoryName(String rackApplicationFactoryName) { this.rackApplicationFactoryName = rackApplicationFactoryName; } public String getRackApplicationFactoryName() { return this.rackApplicationFactoryName; } public void setRackApplicationPoolName(String rackApplicationPoolName) { this.rackApplicationPoolName = rackApplicationPoolName; } public String getRackApplicationPoolName() { return this.rackApplicationPoolName; } public String toString() { return "[RackApplicationMetaData:" + System.identityHashCode( this ) + "\n rackupScriptLocation=" + this.rackUpScriptLocation + "\n rackUpScript=" + this.rackUpScript + "\n host=" + getHosts() + "\n context=" + getContextPath() + "\n static=" + getStaticPathPrefix() + "]"; } private String rackUpScript; private String rackUpScriptLocation = "config.ru"; private String rubyRuntimePoolName; private String rackApplicationFactoryName; private String rackApplicationPoolName; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
7fce2609229cc5d0800caf1d21af0d8fd5a7268c
7fdc14a9fdb773298c95e3781afa5e2aff2d2288
/app/src/main/java/com/github/colaalex/cbox/di/modules/NetworkModule.java
d95102d40d1749f6391fa3f36b32ef2de36102d8
[]
no_license
colaalex/CBox
4e5d6bcc11edfdd5855deb0cc9343f473f99c0b3
c19f80c395587bb288f8091e9e97ff0a4c9b0725
refs/heads/master
2020-04-16T07:03:43.499799
2019-01-20T18:24:03
2019-01-20T18:24:03
165,372,168
0
0
null
null
null
null
UTF-8
Java
false
false
949
java
package com.github.colaalex.cbox.di.modules; import com.github.colaalex.cbox.data.api.PostApi; import com.github.colaalex.cbox.data.repository.Repository; import com.github.colaalex.cbox.domain.repository.IPostRepository; import dagger.Module; import dagger.Provides; import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; @Module public class NetworkModule { private static final String URL = "https://jsonplaceholder.typicode.com/"; @Provides Retrofit retrofit() { return new Retrofit.Builder() .baseUrl(URL) .addConverterFactory(GsonConverterFactory.create()) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .build(); } @Provides IPostRepository provideIPostRepository() { return new Repository(retrofit().create(PostApi.class)); } }
[ "colaalex4r@mail.ru" ]
colaalex4r@mail.ru
296a06ae312cf3af546d343b9aa9a156658af0aa
b8f6974f12b106a832555c17eb9d30cc072095db
/ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค/Solution_prog_๊ฒŒ์ž„๋งต์ตœ๋‹จ๊ฑฐ๋ฆฌ.java
f8bcc5a4cbb26fdb1c52955325ffc8a66f26b888
[]
no_license
m0vehyeon/Algorithm
2ffd5623cf764716390d16248300361e192248a9
8b291a09249667a768f82d4b30094caafe5c9298
refs/heads/master
2023-06-05T01:30:06.013666
2021-06-21T04:16:24
2021-06-21T04:16:24
271,178,958
0
0
null
null
null
null
UTF-8
Java
false
false
1,339
java
package me.donghyeon.prog; import java.util.*; import java.io.*; public class Solution_prog_๊ฒŒ์ž„๋งต์ตœ๋‹จ๊ฑฐ๋ฆฌ { static int N, M, answer = -1; static boolean[][] visited; static int[] dx = {-1,1,0,0}; static int[] dy = {0,0,-1,1}; public static int solution(int[][] maps) { N = maps.length; M = maps[0].length; visited = new boolean[N][M]; bfs(maps); return answer; } static void bfs(int[][] maps) { Queue<int[]> q = new LinkedList<>(); q.add(new int[]{0,0,1}); visited[0][0] = true; while (!q.isEmpty()) { int[] cur = q.poll(); for (int d = 0; d < 4; d++) { int nx = cur[0] + dx[d]; int ny = cur[1] + dy[d]; if (0 <= nx && nx < N && 0 <= ny && ny < M && !visited[nx][ny] && maps[nx][ny] == 1) { if (nx == N-1 && ny == M-1) { answer = cur[2] + 1; return; } visited[nx][ny] = true; q.offer(new int[]{nx,ny,cur[2] + 1}); } } } } public static void main(String[] args) { System.out.println(solution(new int[][]{{1,0,1,1,1},{1,0,1,0,1},{1,0,1,1,1},{1,1,1,0,1},{0,0,0,0,1}})); } }
[ "ehdgus4166@gmail.com" ]
ehdgus4166@gmail.com
75bce49684cb50dedbe130ca3e648e27772b2778
8d0037cb394de7c973e81a5f0f597b81f452e4ec
/state-flow-faces-api/src/main/java/javax/faces/state/scxml/Evaluator.java
c69ed7a22d209396a91062f8e4682a3a22c04f86
[ "MIT" ]
permissive
wklaczynski/state-flow-faces
985998b94eeed52fb96ae8b14dd912d8dc2ba726
9fde6b2fc1a68374c87744355219684beadb8b9f
refs/heads/master
2022-11-27T21:40:02.127667
2021-06-16T23:21:13
2021-06-16T23:21:13
125,044,501
4
2
MIT
2022-11-16T09:30:11
2018-03-13T11:58:08
Java
UTF-8
Java
false
false
5,616
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 javax.faces.state.scxml; import javax.el.ELContext; import javax.el.MethodExpression; import javax.el.ValueExpression; import javax.faces.state.scxml.invoke.Invoker; import javax.faces.state.scxml.invoke.InvokerException; /** * Interface for a component that may be used by the SCXML engines to * evaluate the expressions within the SCXML document. * */ public interface Evaluator { /** SCXML 1.0 Null Data Model name **/ String NULL_DATA_MODEL = "null"; /** SCXML 1.0 ECMAScript Data Model name **/ String ECMASCRIPT_DATA_MODEL = "ecmascript"; /** Default Data Model name **/ String DEFAULT_DATA_MODEL = ""; /** * Get the datamodel type supported by this Evaluator * @return The supported datamodel type */ String getSupportedDatamodel(); /** * If this Evaluator only supports a global context. * @return true if this Evaluator only support a global context */ boolean requiresGlobalContext(); /** * @param data data to be cloned * @return A deep clone of the data */ Object cloneData(Object data); /** * Evaluate an expression returning a data value * * @param ctx variable context * @param expr expression * @return the result of the evaluation * @throws SCXMLExpressionException A malformed expression exception */ Object eval(Context ctx, String expr) throws SCXMLExpressionException; /** * Evaluate an expression returning a data value * * @param ctx variable context * @param expr expression * @return the result of the evaluation * @throws SCXMLExpressionException A malformed expression exception */ Object eval(Context ctx, ValueExpression expr) throws SCXMLExpressionException; /** * Evaluate a condition. * Manifests as "cond" attributes of &lt;transition&gt;, * &lt;if&gt; and &lt;elseif&gt; elements. * * @param ctx variable context * @param expr expression * @return true/false * @throws SCXMLExpressionException A malformed expression exception */ Boolean evalCond(Context ctx, ValueExpression expr) throws SCXMLExpressionException; /** * Evaluate a method * * @param ctx variable context * @param expr expression * @param param method params * @return the result of the evaluation * @throws SCXMLExpressionException A malformed expression exception */ Object evalMethod(Context ctx, MethodExpression expr, Object[] param) throws SCXMLExpressionException; /** * Assigns data to a location * * @param ctx variable context * @param location location expression * @param data the data to assign. * @throws SCXMLExpressionException A malformed expression exception */ void evalAssign(Context ctx, ValueExpression location, Object data) throws SCXMLExpressionException; /** * Assign a ValueExpression to an EL variable, replacing * any previously assignment to the same variable. * The assignment for the variable is removed if * the expression is <code>null</code>. * * @param ctx variable context * @param variable The variable name * @param expression The ValueExpression to be assigned * to the variable. * @return The previous ValueExpression assigned to this variable, * null if there is no previous assignment to this variable. * @throws SCXMLExpressionException A malformed expression exception */ ValueExpression setVariable( Context ctx, String variable, ValueExpression expression) throws SCXMLExpressionException ; /** * Evaluate a script. * Manifests as &lt;script&gt; element. * * @param ctx variable context * @param script The script * @return The result of the script execution. * @throws SCXMLExpressionException A malformed script */ Object evalScript(Context ctx, String script) throws SCXMLExpressionException; /** * Create a new child context. * * @param parent parent context * @return new child context */ Context newContext(Context parent); /** * Create a new {@link Invoker} * * @param type The type of the target being invoked. * @return An {@link Invoker} for the specified type, if an invoker class is * registered against that type, <code>null</code> otherwise. * @throws InvokerException When a suitable {@link Invoker} cannot be * instantiated. */ Invoker newInvoker(final String type) throws InvokerException; ELContext getELContext(); void setELContext(ELContext elContext); }
[ "wklaczynski@sabaservice.pl" ]
wklaczynski@sabaservice.pl
5b16998866a651bbd71824e18bbdf390ebaa69f5
248616ff827c9cb823f185ed342c55f7e5564779
/parking-gateway/src/main/java/com/protops/gateway/constants/PlaceHolder.java
3ea642783f2c2eb2662f2b6b68926fa0005f03a2
[]
no_license
Jinx009/jingan_1.0
8591358363c6c40c9a47cb56e70650498a2bee7b
3374d47be289bdb2c6992c54f747c482d9e32c66
refs/heads/master
2022-12-21T04:54:06.793968
2019-12-25T05:30:50
2019-12-25T05:30:50
148,450,816
1
0
null
2022-12-16T02:40:16
2018-09-12T08:54:08
Java
UTF-8
Java
false
false
513
java
package com.protops.gateway.constants; import java.util.ResourceBundle; public enum PlaceHolder { PLATENUMBER, INTIME, OUTTIME, MEMBERNUMBER, PARKIP, MOBILE, NAME, ADDRESS; public String display() { return getPlaceHolder(this.name()); } private String getPlaceHolder(String key) { return ResourceBundle.getBundle("placeholder").getString(key); } public static String display(String key) { return ResourceBundle.getBundle("placeholder").getString(key); } }
[ "jinxlovejinx@vip.qq.com" ]
jinxlovejinx@vip.qq.com
0faa16b17b15b8994b07c815586b824e610b079f
8c0e290da3820e83273a80c2f190247596d19c1f
/app/src/test/java/com/example/rachiket/calendar/ExampleUnitTest.java
1266abbc716662181772604ba8bbef0082047cad
[]
no_license
RachiketArya/Calendar
386c57343347088032781a6addb47e319d86e9ff
d736be63eaaa35896a77d9d70d69894b868f2280
refs/heads/master
2021-01-01T20:45:06.074649
2017-07-31T20:08:14
2017-07-31T20:08:14
98,925,386
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package com.example.rachiket.calendar; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "rachiketarya@gmail.com" ]
rachiketarya@gmail.com
d0ad6a3aa57e1603cd3b41b3e8ee6baf5cd60c01
5b536108101001ab84828caee3f0c19b58661089
/commitfinal/src/main/java/unal/edu/co/entities/ConcreteDiff.java
3440d9b53afa7dad83ee63238474b49a02897fee
[]
no_license
lfcortes12/commitanalysis
a8d09c87932f3abb5981faa32143387c0e0e0848
47b1c34641ac41188023d37f0001b5f43a977d47
refs/heads/master
2021-01-25T05:10:52.944437
2012-10-07T22:45:56
2012-10-07T22:45:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
945
java
package unal.edu.co.entities; import java.io.Serializable; import javax.persistence.*; /** * The persistent class for the concrete_diff database table. * */ @Entity @Table(name="concrete_diff") public class ConcreteDiff implements Serializable { private static final long serialVersionUID = 1L; /*@Id @GeneratedValue(strategy=GenerationType.IDENTITY) private String changeset;*/ @Id @Column(columnDefinition = "BINARY(32)", length = 32) private String changeset; @Lob() @Column(name="processed_diff") private byte[] processedDiff; public ConcreteDiff() { } public String getChangeset() { return this.changeset; } public void setChangeset(String changeset) { this.changeset = changeset; } public byte[] getProcessedDiff() { return this.processedDiff; } public void setProcessedDiff(byte[] processedDiff) { this.processedDiff = processedDiff; } }
[ "fernando@fernandoDellVostro" ]
fernando@fernandoDellVostro
01b993b3e86a04e45ade10e1212a7acafbc941fe
389092694a0bcc269eea049273fb54959222ffe2
/app/src/main/java/com/nemo/flagquiz/MainActivity.java
d40958e77a86c6799fde8dc30125a5b6e3013724
[]
no_license
Java2019/FlagQuiz
5d8058addd2cc49374dfc0081e0da7e36117fe6f
fda013270827cc1f9a6319654635a045b7108d8d
refs/heads/master
2020-06-28T10:32:06.323911
2017-07-20T19:33:15
2017-07-20T19:33:15
97,092,700
0
0
null
null
null
null
UTF-8
Java
false
false
3,144
java
package com.nemo.flagquiz; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends AppCompatActivity { // ะšะปัŽั‡ะธ ะดะปั ั‡ั‚ะตะฝะธั ะดะฐะฝะฝั‹ั… ะธะท SharedPreferences public static final String CHOICES = "pref_numberOfChoices"; public static final String REGIONS = "pref_regionsToInclude"; // private boolean phoneDevice = true; // ะ’ะบะปัŽั‡ะตะฝะธะต ะฟะพั€ั‚ั€ะตั‚ะฝะพะณะพ ั€ะตะถะธะผะฐ private boolean preferencesChanged = true; // ะะฐัั‚ั€ะพะนะบะธ ะธะทะผะตะฝะธะปะธััŒ? // @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); // // ะ—ะฐะดะฐะฝะธะต ะทะฝะฐั‡ะตะฝะธะน ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะฒ ั„ะฐะนะปะต SharedPreferences PreferenceManager.setDefaultValues(this, R.xml.preferences, false); // ะ ะตะณะธัั‚ั€ะฐั†ะธั ัะปัƒัˆะฐั‚ะตะปั ะดะปั ะธะทะผะตะฝะตะฝะธะน SharedPreferences PreferenceManager.getDefaultSharedPreferences(this). registerOnSharedPreferenceChangeListener( preferencesChangeListener); // ะžะฟั€ะตะดะตะปะตะฝะธะต ั€ะฐะทะผะตั€ะฐ ัะบั€ะฐะฝะฐ int screenSize = getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK; // ะ”ะปั ะฟะปะฐะฝัˆะตั‚ะฝะพะณะพ ัƒัั‚ั€ะพะนัั‚ะฒะฐ phoneDevice ะฟั€ะธัะฒะฐะธะฒะฐะตั‚ัั false210 if (screenSize == Configuration.SCREENLAYOUT_SIZE_LARGE || screenSize == Configuration.SCREENLAYOUT_SIZE_XLARGE) phoneDevice = false; // ะะต ัะพะพั‚ะฒะตั‚ัั‚ะฒัƒะตั‚ ั€ะฐะทะผะตั€ะฐะผ ั‚ะตะปะตั„ะพะฝะฐ } // ะะฐ ั‚ะตะปะตั„ะพะฝะต ั€ะฐะทั€ะตัˆะตะฝะฐ ั‚ะพะปัŒะบะพ ะฟะพั€ั‚ั€ะตั‚ะฝะฐั ะพั€ะธะตะฝั‚ะฐั†ะธั if (phoneDevice) setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "java_2019@mail.ru" ]
java_2019@mail.ru
dbf4730d3de3d79c69fd81ef793002760ed8d760
26bdfb73dd96e73f9372ddc32b88fb2ad38f1bc8
/src/main/java/com/adel/batch/processordemo/batch/BatchApplication.java
60b3320e22d00e87b78255bf29a1173ba1db9297
[]
no_license
adelamodwala/batch-processor-demo
8cd143c27ba597014e31a328cf26a769f0d1a4f9
09c621cde8aefc548d3808b0dbbeab243e8ffdeb
refs/heads/main
2023-06-22T03:07:36.947717
2020-08-05T12:02:47
2020-08-05T12:02:47
283,491,662
0
0
null
null
null
null
UTF-8
Java
false
false
336
java
package com.adel.batch.processordemo.batch; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class BatchApplication { public static void main(String[] args) { SpringApplication.run(BatchApplication.class, args); } }
[ "adel.amodwala@gmail.com" ]
adel.amodwala@gmail.com
2ae5009e597b2c81c7f559d2181ac642b98a50ed
defd765fe98d1b99fe61077ef3bf169b92243a59
/4.JavaCollections/src/com/javarush/task/task38/task3811/Ticket.java
ecdda7bbd437a9a91f33b6db5871ddbd43ebc9a9
[]
no_license
yevhentabachynskyi/JavaRushTasks
cd7b2f029943e843847b4b12c0ce321da6010b7b
8297dc60197462e1a344cc723c821748cbeb88bb
refs/heads/master
2022-04-01T04:09:15.936266
2020-01-08T09:40:37
2020-01-08T09:40:37
232,529,260
0
0
null
null
null
null
UTF-8
Java
false
false
492
java
package com.javarush.task.task38.task3811; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(value= RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface Ticket { enum Priority{ LOW, MEDIUM, HIGH } Priority priority() default Priority.MEDIUM; String[] tags() default {}; String createdBy() default "Amigo"; }
[ "tayeiv92@gmail.com" ]
tayeiv92@gmail.com
9712545ca3882853bbdc02bfdde5e9d40421e263
8824eca5f1219697c13af33be464e58db236dac7
/workspace/2021_02_19/src/้ป’ๆœฌ9_21/Service.java
69d5dc632351a8a83f9425d43077a49562aa4750
[]
no_license
KudoYumi/test
774d019e6c38c28627823be7f3d5e404199f6315
3cb03a25ad5f591b5f832618468259922a5e4d5e
refs/heads/main
2023-04-02T04:41:42.467743
2021-03-29T15:08:21
2021-03-29T15:08:21
319,495,604
0
0
null
null
null
null
UTF-8
Java
false
false
294
java
package ้ป’ๆœฌ9_21; public class Service { private Algorithm logic; public void setLogic(Algorithm logic) { this.logic = logic; } public void doProcess(String name) { System.out.println("start"); logic.perform(name); //ใพใ ๅฎŸ่ฃ…ใ•ใ‚Œใฆใชใ„ System.out.println("end"); } }
[ "lady30romance1986@gmail.com" ]
lady30romance1986@gmail.com
c725d6dcb48cc58bef216ec640af4d949a13fa20
875a8563e8dcacace2dae9c7ca3272d581207292
/app/src/main/java/com/anxa/hapilabs/controllers/registration/CoachProgramController.java
4c26083af9e661bb03045e11e3cc34384d81fc1b
[]
no_license
AnxaRHQ/HAPIlabs_Android
d40f0010a4fd221c2b644f0857dbf3558ce90302
40dff9c23abb4b861bb7cace9bade5d7f5d16e52
refs/heads/master
2021-01-23T01:25:29.267263
2018-01-24T02:53:52
2018-01-24T02:53:52
102,430,971
0
4
null
2017-09-27T11:45:34
2017-09-05T03:43:19
Java
UTF-8
Java
false
false
945
java
package com.anxa.hapilabs.controllers.registration; import android.content.Context; import com.anxa.hapilabs.common.connection.listener.GetCoachProgramListener; import com.anxa.hapilabs.common.connection.listener.ProgressChangeListener; /** * Created by aprilanxa on 18/08/2016. */ public class CoachProgramController { Context context; CoachProgramImplementer coachProgramImplementer; protected ProgressChangeListener progressChangeListener; GetCoachProgramListener listener; public CoachProgramController(Context context, ProgressChangeListener progressChangeListener, GetCoachProgramListener listener) { this.context = context; this.progressChangeListener = progressChangeListener; this.listener =listener; } public void getPaymentOptions(String coachId){ coachProgramImplementer = new CoachProgramImplementer(context, coachId, progressChangeListener, listener); } }
[ "april@anxateam.com" ]
april@anxateam.com
5cd14b99fb398662ac65af1cac02b3e9be6b5737
fcef9fb065efed921c26866896004b138d9d92cd
/neembuu-android/srcs/output_jar.src/com/google/ads/ao.java
e5a0b910a14208ee919cb2b35a8e0ef2184974cc
[]
no_license
Neembuu/neembuunow
46e92148fbea68d31688a64452d9934e619cc1b2
b73c46465ab05c28ae6aa3f1e04a35a57d9b1d96
refs/heads/master
2016-09-05T10:02:01.613898
2014-07-10T18:30:28
2014-07-10T18:30:28
22,336,524
2
2
null
null
null
null
UTF-8
Java
false
false
5,559
java
package com.google.ads; public class ao { public static String a() { return "ARuhFl7nBw/97YxsDjOCIqF0d9D2SpkzcWN42U/KR6Q="; } public static String b() { return "SuhNEgGjhJl/XS1FVuhqPkUehkYsZY0198PVH9C0Cw5x9EieFCFu6iHHnZLZew76zBxCq6FRINgtsEEa0ATP2+zN5/igCOQ3XANDxiclOwZ7/MG97nfPKvEHqgjVzPTsNXna2G4ZK9Sx121hOn3bjV5b0RORDl4Do/R5V9G94plAbpf1rvS5VQCYR0cOwrO+ncrGCeaBiUgPwwUqeX13QBQW8cQXeZDBNPFrnjf2UPtj5NPZkekuTj9gObHW3sujhi/Vc5UthFxcFMQZ9JOxYKBMsVvAudscK6iqo32o9TEr5zA7RtBP25nF9F7Pd+Nto5GF1UUwCKQrrqkixOnqrpfe/uWr3DIqs1XXGJlQ0XgW8tcJR3rNudNrJkdnfpbIihQHfvEWlZV+Yda4LrS85F8Jx58PXgi3fmiOalRxH1PjX9bKVKmh83KlIg1yvnG8Lk+WiH7XV5fXg+actqPS3aSdiBdLnaiZEplaVRzO7Y8HjjM4BJI/qNkN6qmlOQ7nFIaJZKXhnFzlVgzxLzK+jlw3jCcSwsr+rmqxtgS4Nl1AJSJPhZaKdMKo83chyaKA9IpMerllOqIDumcViFZW/f+uuhN/tnj7KyUvoG0dztEb9iilNJRL59zkSiaqG/mjeFq5ujO6eiD2NMgOkg29An5Ku6TLWhZqCEbRqCqwASb8MghG6oL+roxafEVLnmiSflEB1UUJ4oGrq/2exiKxU82DJpxNWE3i8WBQNp/QZU4KqDUbAvTE1Ep4kM2SU0H3fXLAcbsSy6lEt/Tny35MfeiDEmhTNXBIPLY16QKo2L1Uql1RB7QC5So4vCExi0QjPycJO8FXgUtiXugveOMp7oRCOzMe4jVTR3tqmEKPq4n3rx5V67Pys4ITLJLz1iDPNTLc4zV+6K92RB+8x2+NKAzCQn6WqfkarEnnN/fBJNhIVmlN4OIoowBx1GeV5C/acuUtlVtQdC9tlm4uyDnMQDvqwZyHsPLE/o8tAAkHaYjpghf58My0UB/EbXFjQTor727hFI5h2kpSMqDMvCQNRE6goS0ArXSHTbZuRlC9BcOpepvmhaTRPRz6M1uBodl3vly1pRWzNGDeeoXe7ct/x19+crWnrbWx2TTl6UNVA+itnyoBJ094nBuaUIL/vUc4u7K0hBK4/wo6beWapsF8otoPsK4nBRiXIZAtD22i/qSaOb/HO0I/Jdo2vdKYUYslLgnruoI2o5xCUQRl5j3ywU1Tw1eo8KlNTFZMrc/DtZAXT39rwtiF71I7LeolcnjM8G2rUDyeIr0HcrW8DpX14MLPw4Ac62y+YCQexRk4NxytNvT2MgXYRcQ7Gmqg34665bRQSVqMFGftbDGyor2xFyCsChUW2AbPtwqNQ9CaUviWeg0TOno7vl5ZJ7QoNJM2gxd0ryvG9UovFJ17+FI5aToFya9yNC+CYI2aT0xuO6j49vPnV/UUXoKU9acelKKin//RZtgdVoEqzlFvzF388veFWl/dIw+5s1o37KURBbHWppTmOJRyVh5Nef26d2oHOtBKLA0rcuMSn/xRD8c8jlpsbkmlLMU5OnNYDf/tjTxfuiFBAUJu9aTV2YvHeOh4w/BUrecXth1+CeO/UV5J9Y4dSBwhyaOWzdYPLxX/P+CR+22yf3AcOheDkq3S5CdbqLOeNg8Hwjuxw7GIMBXOLdZGcC+Vr5UfopjRlBDobhr64aSj8OM3RgLVTmCkNXEzZv5GNiKm2aYJdtXreQqmhWu1kVjmHZEGDZitS1vshZd/DSpQCgOei9pBpcAzo2tHx2Y5HHBeahCtSWuuAi7OyYyD57b+9xIMQ8baHgCMfBNf+hXZWmrF2rThenHy6pPCcGcvwjeiWIk6HIpadsRhE9ME0A5xFV1fMIUevAmRjBqMev/ZkZZwpQoBh1m2+QJxizin3eH6a5WfYWayPtBbzyz+q/Rs+kvmHFDYwi3hx3gK5xoxax0MD4AFJ8poVSMhgW6Nv378we9hw+2PKRZM93NOgxlN0MmOPhayv2a0NiTZjOyXtfJkXtmHj3rhdQFXQFFkRlj2tMovk/QDjSoKsV88piKEimQK1ESkVAx2Q0mlvT46G2JBckcEtIe7hWWGXC93qzxwTrtV0oIhvE5L1KzRmLnfYP8qGcsEUOgseDpzE0P+UQmF34EtPpXgm342+uSUxX3vzbTLgT8kfBSa7LMu1QriYx00dT+nVwcx+Y2mq1yEqtDaRaGJS58XYnCwsv5AcPRIxgp4WicxpQ4V8zXPoQKT3OmPVr0CCVatGubfTDCW3tm3mwj2oAFvcjo5M6ARgMq8RL0vuXpUNJBhaBrtv/0cgxjMbDrhHmEH9xCVCAIJPRkChacriblRZ712zRiYe6+2zxgUCZAEnT6ppA12m1gDByiis9Jtoq6DL3zgnjIl++aFC8eVxPry95x4/A13KviR7si52WSgNsetG3M9CI6qarLrW/x9oUlTIytAONhNjYnc2O3bURhY81QahLHnzNQt6Sw2zaDhHL/YHvtc11H9U4cgNnkHoUqkqvqLE7XmiqgrL7hdBBlHF4zOrr2sIb+d0C3b1+B71/cow20f0foQVVto7ZqEQUPiyPzW7Hv/kk26C+AewxLVFVl3yeC25C0os6UoJTmFsxLTKIFSnFmjPMyC/UFzdmxcCZeO6feIy5QMVcj0fH5mn97gQmFr0hKwdi3QkXCMc8SofoSdljAHz9IsIGPZuIFDSxKI+p5X+vXCNVz77DSGpktJ2AWUD4R4MjLV3dPrdsbYNQNDrmK4Z+oDmMKztdftfTJ2ii1OY2Ady1OxTrLA+zMg3lX7CJpuVQsXfuhBjpjnr/hGrp+WSDNkpYnNObW7FmdPTUW5LSz3ifZVc24pskVkneEIRRMmW4r7M3L2uNYY97hNbDt3xQyzhNbPEt87WPUu4B3uHZD3MIlJctTQxqgtLw38syTa3qN/T/JZqBY6YLOJV4T70YUrcxC4reYWrpwiERfhuFMt3DUlYPKH4lZV4OkBLN39TCGffZ8e0ROenlOplJlzrTKxwXTSAzeE9nADMGUhhfqZPqY5Z6GyrQ0IlsFzQm9dSb5BXgnyhYETTun/2t6sFQ5fCg91LMsj/2u/C4Sd5Lb2EbwAYWWDeZ1wyaYqPSKJe2y7vW/TCYxCLue6hXie7d65AifMW5CVaSpuIWhNdOGtE1hYCzN3seHRZ6IVjZeZORu3gbsP6WymhEVfC84TZaLDHmTEIdrbFRCRk1F6XiX7XQZTbGJC7zC3lAaCndBGor9IVJlkOgowHRoIWT25PHmf8ooa11ebiHMrgjNNSxfDBbP6HGHiUFPVgszXyLukeKgWiT3tp2lzFUA/6az7HZxOjRtDBUANQqpC8UlD0KWQfDcIClj0+CCFTQBSKro7WUyltVIKJQZ3JXbIQScv5212y1x1YikLWGt4fVm3hRg8evVN7KVEhJp21Ab5pws28Yqihj9O/QPxdpmJ+PCjlTUtox9tIiuDv27UhEdgrbz0XPvuLoBJemzFmFcE06mZmB3gBDOvbgzB6Op7A+uTdWA9THjbQmChtYjtCIhcAvDfDEe42670xVlPL8jJmKI2Qd0Z1bmcXcTH/Kc8gFMomd8QMJuZiiiNRCgsLffoUWEgq4NICrq9oKikLf3vwntVxeRsaU8PS6U4TEaJX/g5Upxg52ZF2BY62iYKO0YZfmS8iol4ci5B96urdy1v4BL6U6I0iytkUFtCbmlhTbS4wJD6OxOPkvtufeYWAMRNwWCRVn6olaIpbNJgtlPlvoG6FyZj2MjGhfhBTPO2rg4Tue6o0eq2qReYOt/rtt1j7zv+3EgZ0QKam5bNBPqy6pOKeOCD6xc1XuLJfiAh9G6b2twPfXR42wLfpL3UkAvq00ZBZg6yA2SA0mYO8o3Qni8GG25ATlm2sBexn5WOqga3QAtyVkuTqs5BBOjT9flnYxcdcwRWCWxXB2W5GNDd9DUtaEcTjoG21lnQiRUI7ZS3Eit0g8z28REXAeRq6vZNsLJXGEwZ/s7oQCnScviWclFVEIHxHv3AO9dUrjbv3LYoEbcfiFLf8J+aYOU="; } public static String c() { return "KXbn1K9Cz2ZgeOTJa+Veo9TtqgqFQ49etShsU9z+UAP37syBIxS/qy9gK8yB2kKw"; } public static String d() { return "cbSAmn5ZqTUlLC/bgOZkEzXGEOY21uWifgdKJs9yk7A="; } public static String e() { return "XONjIhr7f5+v7VYE2sRnrybwgpe9YIOqpcEHDUiel7EzNqAyI0RSFuWdEz2ratN+"; } public static String f() { return "LbZjxcpsz6RheqLbO48YwKTUVh9wQrFoY7gJK2jAZFI="; } public static String g() { return "/XHxH5XHwv8SxKlJV4XyYOIB7MuqmSwqMacPj1bbgbS8IA8tETEArriXswHCehFP"; } public static String h() { return "Jil+B/2MHKx+6dpy/2xm493DojzmiB3wB5+eGz7hPDU="; } public static String i() { return "XRMsX/JQwPQGX7sOWjvg2nQVjUMO7xUcwxz6xwHRTKyo/tTIVco9OqenUPNGgQDi"; } public static String j() { return "m02zlU+rWIGC8/SRFpMtHvda14INo+uzPhZo7qXgVHk="; } public static String k() { return "H7bkbmrRKL7RuC3umfv5Gfu9Jh+fRNmOXlqAhgMuKVVZSJvQgYyRy7HjcKaVodcc"; } public static String l() { return "o/Z2yPrC7bUJNorc5zvYvC8KtIwAULd35yQfACbwNXc="; } } /* Location: F:\neembuu\Research\android_apps\output_jar.jar * Qualified Name: com.google.ads.ao * JD-Core Version: 0.7.0.1 */
[ "pasdavide@gmail.com" ]
pasdavide@gmail.com
76a6670f0e2758657bcf37ca185af0815ccd87ec
cbc61ffb33570a1bc55bb1e754510192b0366de2
/ole-app/olefs/src/main/java/org/kuali/ole/module/purap/document/service/impl/PrintServiceImpl.java
54b9f83c0666c41aef8ada55628f1344ef2a5213
[ "ECL-2.0" ]
permissive
VU-libtech/OLE-INST
42b3656d145a50deeb22f496f6f430f1d55283cb
9f5efae4dfaf810fa671c6ac6670a6051303b43d
refs/heads/master
2021-07-08T11:01:19.692655
2015-05-15T14:40:50
2015-05-15T14:40:50
24,459,494
1
0
ECL-2.0
2021-04-26T17:01:11
2014-09-25T13:40:33
Java
UTF-8
Java
false
false
28,707
java
/* * Copyright 2007 The Kuali Foundation * * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php * * 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.kuali.ole.module.purap.document.service.impl; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.kuali.ole.module.purap.PurapConstants; import org.kuali.ole.module.purap.businessobject.PurchaseOrderItem; import org.kuali.ole.module.purap.businessobject.PurchaseOrderVendorQuote; import org.kuali.ole.module.purap.document.BulkReceivingDocument; import org.kuali.ole.module.purap.document.PurchaseOrderDocument; import org.kuali.ole.module.purap.document.service.PrintService; import org.kuali.ole.module.purap.exception.PurError; import org.kuali.ole.module.purap.exception.PurapConfigurationException; import org.kuali.ole.module.purap.pdf.*; import org.kuali.ole.module.purap.service.ImageService; import org.kuali.ole.sys.OLEConstants; import org.kuali.ole.sys.context.SpringContext; import org.kuali.ole.sys.service.impl.OleParameterConstants; import org.kuali.rice.core.api.config.property.ConfigurationService; import org.kuali.rice.coreservice.framework.parameter.ParameterService; import org.kuali.rice.krad.service.BusinessObjectService; import org.springframework.transaction.annotation.Transactional; import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.Collection; import java.util.List; @Transactional public class PrintServiceImpl implements PrintService { private static Log LOG = LogFactory.getLog(PrintServiceImpl.class); protected static final boolean TRANSMISSION_IS_RETRANSMIT = true; protected static final boolean TRANSMISSION_IS_NOT_RETRANSMIT = !TRANSMISSION_IS_RETRANSMIT; private ImageService imageService; private ParameterService parameterService; private BusinessObjectService businessObjectService; private ConfigurationService kualiConfigurationService; private PurchaseOrderParameters purchaseOrderParameters; /** * @see org.kuali.ole.module.purap.document.service.PrintService#generatePurchaseOrderQuoteRequestsListPdf(org.kuali.ole.module.purap.document.PurchaseOrderDocument, java.io.ByteArrayOutputStream) */ @Override public Collection generatePurchaseOrderQuoteRequestsListPdf(PurchaseOrderDocument po, ByteArrayOutputStream byteArrayOutputStream) { LOG.debug("generatePurchaseOrderQuoteRequestsListPdf() started"); Collection errors = new ArrayList(); PurchaseOrderQuoteRequestsPdf poQuoteRequestsPdf = new PurchaseOrderQuoteRequestsPdf(); try { PurchaseOrderTransmitParameters pdfParameters = getPurchaseOrderQuoteRequestsListPdfParameters(po); String deliveryCampusName = pdfParameters.getCampusParameter().getCampus().getName(); poQuoteRequestsPdf.generatePOQuoteRequestsListPdf(po, byteArrayOutputStream, pdfParameters.getCampusParameter().getPurchasingInstitutionName()); } catch (PurError pe) { LOG.error("Caught exception ", pe); errors.add(pe.getMessage()); } catch (PurapConfigurationException pce) { LOG.error("Caught exception ", pce); errors.add(pce.getMessage()); } catch (Exception e) { LOG.error("Caught exception ", e); errors.add(e.getMessage()); } LOG.debug("generatePurchaseOrderQuoteRequestsListPdf() ended"); return errors; } /** * @see org.kuali.ole.module.purap.document.service.PrintService#savePurchaseOrderQuoteRequestsListPdf(org.kuali.ole.module.purap.document.PurchaseOrderDocument) */ @Override public Collection savePurchaseOrderQuoteRequestsListPdf(PurchaseOrderDocument po) { return null; } /** * Returns the PurchaseOrderPdfParameters given the PurchaseOrderDocument. * * @param po The PurchaseOrderDocument object to be used to obtain the PurchaseOrderPdfParameters. * @return The PurchaseOrderPdfParameters given the PurchaseOrderDocument. */ /*protected PurchaseOrderPdfFaxParameters getPurchaseOrderQuotePdfParameters(PurchaseOrderDocument po) { String key = po.getPurapDocumentIdentifier().toString(); // key can be any string; chose to use the PO number. String campusCode = po.getDeliveryCampusCode().toLowerCase(); String imageTempLocation = ""; String logoImage = ""; boolean useImage = true; if (parameterService.parameterExists(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_IMAGES_AVAILABLE_INDICATOR)) { useImage = parameterService.getParameterValueAsBoolean(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_IMAGES_AVAILABLE_INDICATOR); } // We'll get the imageTempLocation and the actual images only if the useImage is true. If useImage is false, we'll leave the // images as blank space if (useImage) { imageTempLocation = kualiConfigurationService.getPropertyValueAsString(OLEConstants.TEMP_DIRECTORY_KEY) + "/"; if (imageTempLocation == null) { LOG.debug("generatePurchaseOrderQuotePdf() ended"); throw new PurapConfigurationException("Application Setting IMAGE_TEMP_PATH is missing"); } // Get logo image. logoImage = imageService.getLogo(key, campusCode, imageTempLocation); } Map<String, Object> criteria = new HashMap<String, Object>(); criteria.put(OLEPropertyConstants.CAMPUS_CODE, po.getDeliveryCampusCode()); CampusParameter campusParameter = (CampusParameter) ((List) businessObjectService.findMatching(CampusParameter.class, criteria)).get(0); // Get the contract manager's campus ContractManager contractManager = po.getContractManager(); String contractManagerCampusCode = "N/A"; if (contractManager != null && contractManager.getContractManagerUserIdentifier() != null) { Person contractManagerUser = SpringContext.getBean(PersonService.class).getPerson(contractManager.getContractManagerUserIdentifier()); contractManagerCampusCode = contractManagerUser.getCampusCode(); } String pdfFileLocation = parameterService.getParameterValueAsString(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_DIRECTORY); if (pdfFileLocation == null) { LOG.debug("savePurchaseOrderPdf() ended"); throw new PurapConfigurationException("Application Setting PDF_DIRECTORY is missing."); } PurchaseOrderPdfFaxParameters pdfParameters = new PurchaseOrderPdfFaxParameters(); pdfParameters.setImageTempLocation(imageTempLocation); pdfParameters.setKey(key); pdfParameters.setLogoImage(logoImage); pdfParameters.setCampusParameter(campusParameter); pdfParameters.setContractManagerCampusCode(contractManagerCampusCode); pdfParameters.setPdfFileLocation(pdfFileLocation); pdfParameters.setUseImage(useImage); return pdfParameters; }*/ /** * Returns the PurchaseOrderPdfParameters given the PurchaseOrderDocument. * * @param po The PurchaseOrderDocument object to be used to obtain the PurchaseOrderPdfParameters. * @return The PurchaseOrderPdfParameters given the PurchaseOrderDocument. */ protected PurchaseOrderTransmitParameters getPurchaseOrderQuoteRequestsListPdfParameters(PurchaseOrderDocument po) { PurchaseOrderParameters purchaseOrderParameters = getPurchaseOrderParameters(); purchaseOrderParameters.setPurchaseOrderPdfParameters(po); return (PurchaseOrderTransmitParameters) purchaseOrderParameters; /*String key = po.getPurapDocumentIdentifier().toString(); // key can be any string; chose to use the PO number. String campusCode = po.getDeliveryCampusCode().toLowerCase(); String imageTempLocation = ""; String logoImage = ""; boolean useImage = true; if (parameterService.parameterExists(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_IMAGES_AVAILABLE_INDICATOR)) { useImage = parameterService.getParameterValueAsBoolean(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_IMAGES_AVAILABLE_INDICATOR); } // We'll get the imageTempLocation and the actual images only if the useImage is true. If useImage is false, we'll leave the // images as blank space if (useImage) { imageTempLocation = kualiConfigurationService.getPropertyValueAsString(OLEConstants.TEMP_DIRECTORY_KEY) + "/"; if (imageTempLocation == null) { LOG.debug("generatePurchaseOrderQuotePdf() ended"); throw new PurapConfigurationException("Application Setting IMAGE_TEMP_PATH is missing"); } // Get logo image. logoImage = imageService.getLogo(key, campusCode, imageTempLocation); } Map<String, Object> criteria = new HashMap<String, Object>(); criteria.put(OLEPropertyConstants.CAMPUS_CODE, po.getDeliveryCampusCode()); CampusParameter campusParameter = (CampusParameter) ((List) businessObjectService.findMatching(CampusParameter.class, criteria)).get(0); // Get the contract manager's campus ContractManager contractManager = po.getContractManager(); String contractManagerCampusCode = ""; if (contractManager.getContractManagerUserIdentifier() != null) { Person contractManagerUser = SpringContext.getBean(PersonService.class).getPerson(contractManager.getContractManagerUserIdentifier()); contractManagerCampusCode = contractManagerUser.getCampusCode(); } String pdfFileLocation = parameterService.getParameterValueAsString(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_DIRECTORY); if (pdfFileLocation == null) { LOG.debug("savePurchaseOrderPdf() ended"); throw new PurapConfigurationException("Application Setting PDF_DIRECTORY is missing."); } PurchaseOrderPdfFaxParameters pdfParameters = new PurchaseOrderPdfFaxParameters(); pdfParameters.setImageTempLocation(imageTempLocation); pdfParameters.setKey(key); pdfParameters.setLogoImage(logoImage); pdfParameters.setCampusParameter(campusParameter); pdfParameters.setContractManagerCampusCode(contractManagerCampusCode); pdfParameters.setPdfFileLocation(pdfFileLocation); pdfParameters.setUseImage(useImage); return pdfParameters;*/ } /** * @see org.kuali.ole.module.purap.document.service.PrintService#generatePurchaseOrderQuotePdf(org.kuali.ole.module.purap.document.PurchaseOrderDocument, org.kuali.ole.module.purap.businessobject.PurchaseOrderVendorQuote, java.io.ByteArrayOutputStream, java.lang.String) */ @Override public Collection generatePurchaseOrderQuotePdf(PurchaseOrderDocument po, PurchaseOrderVendorQuote povq, ByteArrayOutputStream byteArrayOutputStream, String environment) { LOG.debug("generatePurchaseOrderQuotePdf() started"); PurchaseOrderQuotePdf poQuotePdf = new PurchaseOrderQuotePdf(); Collection errors = new ArrayList(); try { PurchaseOrderParameters purchaseOrderParameters = getPurchaseOrderParameters(); purchaseOrderParameters.setPurchaseOrderPdfParameters(po, povq); PurchaseOrderTransmitParameters pdfParameters = (PurchaseOrderTransmitParameters) purchaseOrderParameters; String deliveryCampusName = pdfParameters.getCampusParameter().getCampus().getName(); poQuotePdf.generatePOQuotePDF(po, povq, deliveryCampusName, pdfParameters.getContractManagerCampusCode(), pdfParameters.getLogoImage(), byteArrayOutputStream, environment); } catch (PurError pe) { LOG.error("Caught exception ", pe); errors.add(pe.getMessage()); } catch (PurapConfigurationException pce) { LOG.error("Caught exception ", pce); errors.add(pce.getMessage()); } LOG.debug("generatePurchaseOrderQuotePdf() ended"); return errors; } /** * @see org.kuali.ole.module.purap.document.service.PrintService#savePurchaseOrderQuotePdf(org.kuali.ole.module.purap.document.PurchaseOrderDocument, org.kuali.ole.module.purap.businessobject.PurchaseOrderVendorQuote, java.lang.String) */ @Override public Collection savePurchaseOrderQuotePdf(PurchaseOrderDocument po, PurchaseOrderVendorQuote povq, String environment) { LOG.debug("savePurchaseOrderQuotePdf() started"); String pdfQuoteFilename = "PURAP_PO_" + po.getPurapDocumentIdentifier().toString() + "_Quote_" + povq.getPurchaseOrderVendorQuoteIdentifier().toString() + "_" + System.currentTimeMillis() + ".pdf"; PurchaseOrderQuotePdf poQuotePdf = new PurchaseOrderQuotePdf(); Collection errors = new ArrayList(); PurchaseOrderTransmitParameters pdfParameters = null; try { PurchaseOrderParameters purchaseOrderParameters = getPurchaseOrderParameters(); purchaseOrderParameters.setPurchaseOrderPdfParameters(po, povq); pdfParameters = (PurchaseOrderTransmitParameters) purchaseOrderParameters; String deliveryCampusName = pdfParameters.getCampusParameter().getCampus().getName(); poQuotePdf.savePOQuotePDF(po, povq, pdfParameters, environment); } catch (PurError e) { LOG.error("Caught exception ", e); errors.add(e.getMessage()); } catch (PurapConfigurationException pce) { LOG.error("Caught exception ", pce); errors.add(pce.getMessage()); } finally { try { poQuotePdf.deletePdf(pdfParameters.getPdfFileLocation(), pdfQuoteFilename); } catch (Throwable e) { LOG.error("savePurchaseOrderQuotePdf() Error deleting Quote PDF" + pdfQuoteFilename + " - Exception was " + e.getMessage(), e); errors.add(e.getMessage()); } } LOG.debug("savePurchaseOrderQuotePdf() ended"); return errors; } /** * Returns the PurchaseOrderPdfParameters given the PurchaseOrderDocument. * * @param po The PurchaseOrderDocument object to be used to obtain the PurchaseOrderPdfParameters. * @return The PurchaseOrderPdfParameters given the PurchaseOrderDocument. */ /* protected PurchaseOrderPdfFaxParameters getPurchaseOrderPdfParameters(PurchaseOrderDocument po) { String key = po.getPurapDocumentIdentifier().toString(); // key can be any string; chose to use the PO number. String campusCode = po.getDeliveryCampusCode().toLowerCase(); String imageTempLocation = ""; String logoImage = ""; String directorSignatureImage = ""; String contractManagerSignatureImage = ""; boolean useImage = true; if (parameterService.parameterExists(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_IMAGES_AVAILABLE_INDICATOR)) { useImage = parameterService.getParameterValueAsBoolean(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_IMAGES_AVAILABLE_INDICATOR); } // We'll get the imageTempLocation and the actual images only if the useImage is true. If useImage is false, we'll leave the // images as blank space if (useImage) { imageTempLocation = kualiConfigurationService.getPropertyValueAsString(OLEConstants.TEMP_DIRECTORY_KEY) + "/"; if (imageTempLocation == null) { throw new PurapConfigurationException("IMAGE_TEMP_PATH is missing"); } // Get images if ((logoImage = imageService.getLogo(key, campusCode, imageTempLocation)) == null) { throw new PurapConfigurationException("logoImage is null."); } if ((directorSignatureImage = imageService.getPurchasingDirectorImage(key, campusCode, imageTempLocation)) == null) { throw new PurapConfigurationException("directorSignatureImage is null."); } if ((contractManagerSignatureImage = imageService.getContractManagerImage(key, po.getContractManagerCode(), imageTempLocation)) == null) { throw new PurapConfigurationException("contractManagerSignatureImage is null."); } } Map<String, Object> criteria = new HashMap<String, Object>(); criteria.put(OLEPropertyConstants.CAMPUS_CODE, po.getDeliveryCampusCode()); CampusParameter campusParameter = (CampusParameter) ((List) businessObjectService.findMatching(CampusParameter.class, criteria)).get(0); String statusInquiryUrl = parameterService.getParameterValueAsString(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.STATUS_INQUIRY_URL); if (statusInquiryUrl == null) { LOG.debug("generatePurchaseOrderPdf() ended"); throw new PurapConfigurationException("Application Setting INVOICE_STATUS_INQUIRY_URL is missing."); } StringBuffer contractLanguage = new StringBuffer(); criteria.put(OLEPropertyConstants.ACTIVE, true); List<PurchaseOrderContractLanguage> contractLanguageList = (List<PurchaseOrderContractLanguage>) (businessObjectService.findMatching(PurchaseOrderContractLanguage.class, criteria)); if (!contractLanguageList.isEmpty()) { int lineNumber = 1; for (PurchaseOrderContractLanguage row : contractLanguageList) { if (row.getCampusCode().equals(po.getDeliveryCampusCode())) { contractLanguage.append(lineNumber + " " + row.getPurchaseOrderContractLanguageDescription() + "\n"); ++lineNumber; } } } String pdfFileLocation = parameterService.getParameterValueAsString(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_DIRECTORY); if (pdfFileLocation == null) { LOG.debug("savePurchaseOrderPdf() ended"); throw new PurapConfigurationException("Application Setting PDF_DIRECTORY is missing."); } String pdfFileName = "PURAP_PO_" + po.getPurapDocumentIdentifier().toString() + "_" + System.currentTimeMillis() + ".pdf"; PurchaseOrderPdfFaxParameters pdfParameters = new PurchaseOrderPdfFaxParameters(); pdfParameters.setCampusParameter(campusParameter); pdfParameters.setContractLanguage(contractLanguage.toString()); pdfParameters.setContractManagerSignatureImage(contractManagerSignatureImage); pdfParameters.setDirectorSignatureImage(directorSignatureImage); pdfParameters.setImageTempLocation(imageTempLocation); pdfParameters.setKey(key); pdfParameters.setLogoImage(logoImage); pdfParameters.setStatusInquiryUrl(statusInquiryUrl); pdfParameters.setPdfFileLocation(pdfFileLocation); pdfParameters.setPdfFileName(pdfFileName); pdfParameters.setUseImage(useImage); return pdfParameters; }*/ /** * Creates purchase order pdf document given the input parameters. * * @param po The PurchaseOrderDocument. * @param byteArrayOutputStream ByteArrayOutputStream that the action is using, where the pdf will be printed to. * @param isRetransmit boolean true if this is a retransmit purchase order document. * @param environment The current environment used (e.g. DEV if it is a development environment). * @param retransmitItems The items selected by the user to be retransmitted. * @return Collection of error strings. */ protected Collection generatePurchaseOrderPdf(PurchaseOrderDocument po, ByteArrayOutputStream byteArrayOutputStream, boolean isRetransmit, String environment, List<PurchaseOrderItem> retransmitItems) { LOG.debug("generatePurchaseOrderPdf() started"); PurchaseOrderPdf poPdf = new PurchaseOrderPdf(); Collection errors = new ArrayList(); try { PurchaseOrderParameters purchaseOrderParameters = getPurchaseOrderParameters(); purchaseOrderParameters.setPurchaseOrderPdfParameters(po); PurchaseOrderTransmitParameters pdfParameters = (PurchaseOrderTransmitParameters) purchaseOrderParameters; if (LOG.isInfoEnabled()) { LOG.info("PDF Parameters in PrintServiceImpl" + "pdfParameters:" + pdfParameters + "isRetransmit:" + isRetransmit + "retransmitItems:" + retransmitItems); } poPdf.generatePdf(po, pdfParameters, byteArrayOutputStream, isRetransmit, environment, retransmitItems); } catch (PurError e) { LOG.error("Caught exception ", e); errors.add(e.getMessage()); } catch (PurapConfigurationException pce) { LOG.error("Caught exception ", pce); errors.add(pce.getMessage()); } LOG.debug("generatePurchaseOrderPdf() ended"); return errors; } /** * @see org.kuali.ole.module.purap.document.service.PrintService#generatePurchaseOrderPdf(org.kuali.ole.module.purap.document.PurchaseOrderDocument, * java.io.ByteArrayOutputStream, java.lang.String) */ @Override public Collection generatePurchaseOrderPdf(PurchaseOrderDocument po, ByteArrayOutputStream byteArrayOutputStream, String environment, List<PurchaseOrderItem> retransmitItems) { if (LOG.isInfoEnabled()) { LOG.info("Inside the PrintServiceImpl class" + "PO:" + po + "ByteArrayOutputStream:" + byteArrayOutputStream + "environment:" + environment + "retransmitItems:" + retransmitItems); } return generatePurchaseOrderPdf(po, byteArrayOutputStream, TRANSMISSION_IS_NOT_RETRANSMIT, environment, retransmitItems); } /** * @see org.kuali.ole.module.purap.document.service.PrintService#generatePurchaseOrderPdfForRetransmission(org.kuali.ole.module.purap.document.PurchaseOrderDocument, * java.io.ByteArrayOutputStream, java.lang.String) */ @Override public Collection generatePurchaseOrderPdfForRetransmission(PurchaseOrderDocument po, ByteArrayOutputStream byteArrayOutputStream, String environment, List<PurchaseOrderItem> retransmitItems) { return generatePurchaseOrderPdf(po, byteArrayOutputStream, TRANSMISSION_IS_RETRANSMIT, environment, retransmitItems); } /** * Saves the purchase order pdf document. * * @param po The PurchaseOrderDocument. * @param isRetransmit boolean true if this is a retransmit purchase order document. * @param environment The current environment used (e.g. DEV if it is a development environment). * @return Collection of error strings. */ protected Collection savePurchaseOrderPdf(PurchaseOrderDocument po, boolean isRetransmit, String environment) { LOG.debug("savePurchaseOrderPdf() started"); PurchaseOrderPdf poPdf = new PurchaseOrderPdf(); Collection errors = new ArrayList(); PurchaseOrderTransmitParameters pdfParameters = null; try { PurchaseOrderParameters purchaseOrderParameters = getPurchaseOrderParameters(); purchaseOrderParameters.setPurchaseOrderPdfParameters(po); pdfParameters = (PurchaseOrderTransmitParameters) purchaseOrderParameters; poPdf.savePdf(po, pdfParameters, isRetransmit, environment); } catch (PurError e) { LOG.error("Caught exception ", e); errors.add(e.getMessage()); } catch (PurapConfigurationException pce) { LOG.error("Caught exception ", pce); errors.add(pce.getMessage()); } finally { try { poPdf.deletePdf(pdfParameters.getPdfFileLocation(), pdfParameters.getPdfFileName()); } catch (Throwable e) { LOG.error("savePurchaseOrderPdf() Error deleting PDF" + pdfParameters.getPdfFileName() + " - Exception was " + e.getMessage(), e); errors.add("Error while deleting the pdf after savePurchaseOrderPdf" + e.getMessage()); } } LOG.debug("savePurchaseOrderPdf() ended"); return errors; } /** * @see org.kuali.ole.module.purap.document.service.PrintService#savePurchaseOrderPdf(org.kuali.ole.module.purap.document.PurchaseOrderDocument, * java.lang.String) */ @Override public Collection savePurchaseOrderPdf(PurchaseOrderDocument po, String environment) { return savePurchaseOrderPdf(po, TRANSMISSION_IS_NOT_RETRANSMIT, environment); } /** * @see org.kuali.ole.module.purap.document.service.PrintService#savePurchaseOrderPdfForRetransmission(org.kuali.ole.module.purap.document.PurchaseOrderDocument, * java.lang.String) */ @Override public Collection savePurchaseOrderPdfForRetransmission(PurchaseOrderDocument po, String environment) { return savePurchaseOrderPdf(po, TRANSMISSION_IS_RETRANSMIT, environment); } @Override public Collection generateBulkReceivingPDF(BulkReceivingDocument blkRecDoc, ByteArrayOutputStream baosPDF) { LOG.debug("generateBulkReceivingPDF() started"); BulkReceivingPdf recBlkTicketPDF = new BulkReceivingPdf(); Collection errors = new ArrayList(); String imageTempLocation = StringUtils.EMPTY; String logoImage = StringUtils.EMPTY; String key = blkRecDoc.getDocumentNumber().toString(); // key can be any string; String campusCode = blkRecDoc.getDeliveryCampusCode().toLowerCase(); String environment = kualiConfigurationService.getPropertyValueAsString(OLEConstants.ENVIRONMENT_KEY); boolean useImage = true; if (parameterService.parameterExists(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_IMAGES_AVAILABLE_INDICATOR)) { useImage = parameterService.getParameterValueAsBoolean(OleParameterConstants.PURCHASING_DOCUMENT.class, PurapConstants.PDF_IMAGES_AVAILABLE_INDICATOR); } if (useImage) { imageTempLocation = kualiConfigurationService.getPropertyValueAsString(OLEConstants.TEMP_DIRECTORY_KEY) + "/"; if (imageTempLocation == null) { throw new PurapConfigurationException("IMAGE_TEMP_PATH is missing"); } // Get images logoImage = imageService.getLogo(key, campusCode, imageTempLocation); if (StringUtils.isEmpty(logoImage)) { throw new PurapConfigurationException("logoImage is null."); } } try { recBlkTicketPDF.generatePdf(blkRecDoc, baosPDF, logoImage, environment); } catch (PurapConfigurationException pce) { LOG.error("Caught exception ", pce); errors.add(pce.getMessage()); } LOG.debug("generateBulkReceivingPDF() ended"); return errors; } public void setParameterService(ParameterService parameterService) { this.parameterService = parameterService; } public void setImageService(ImageService imageService) { this.imageService = imageService; } public void setBusinessObjectService(BusinessObjectService businessObjectService) { this.businessObjectService = businessObjectService; } public void setConfigurationService(ConfigurationService kualiConfigurationService) { this.kualiConfigurationService = kualiConfigurationService; } public void setPurchaseOrderParameters(PurchaseOrderParameters purchaseOrderParameters) { this.purchaseOrderParameters = purchaseOrderParameters; } public PurchaseOrderParameters getPurchaseOrderParameters() { return SpringContext.getBean(PurchaseOrderParameters.class); } }
[ "david.lacy@villanova.edu" ]
david.lacy@villanova.edu
74f34ab22c8d90a4a119b96dbc140fe55ef96f37
d5194b4a840b2a29633ae3c5c706b77f631efbf0
/src/xiang/yi/wang/simpleframework/Screen.java
1dfdd3c09d9834c291452786f7b89625c6c7a2e6
[]
no_license
wangyixiang/my2048
3a1eb453a4e2af42275c24dae705ebd8c0012509
dff40588131e03f127937c87ac0f72951ca0f44f
refs/heads/master
2016-09-06T17:30:00.339838
2014-04-24T09:14:03
2014-04-24T09:14:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
350
java
package xiang.yi.wang.simpleframework; public abstract class Screen { protected final Game game; public Screen(Game game){ this.game = game; } public abstract void update(float deltaTime); public abstract void present(float deltaTime); public abstract void pause(); public abstract void resume(); public abstract void dispose(); }
[ "wangyixiang.linux@qq.com" ]
wangyixiang.linux@qq.com
c67f4630c49709ecd508ecddaa3eb9623d00d220
f7f5d1414802eb19313911e4432136ec4d504668
/app/src/androidTest/java/com/steven/xviewutils/ExampleInstrumentedTest.java
aad9f85674f4998808acf670af58bc0858011109
[]
no_license
Zhao187/XViewUtils
847208d402a90275dc12af3f32658a0f8cedf58d
a99f0cbc5f3086245747d7665936dcc66cfdaca6
refs/heads/master
2022-09-11T06:39:51.276831
2020-05-31T14:29:45
2020-05-31T14:29:45
266,660,157
1
0
null
null
null
null
UTF-8
Java
false
false
758
java
package com.steven.xviewutils; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.steven.xviewutils", appContext.getPackageName()); } }
[ "865691337@qq.com" ]
865691337@qq.com
c442591ae3e9a550752941283d7d3f589d4532ce
ffe16a90d84fc0fa911261b3ba3a80f64b342ea1
/src/com/codewithphencharaud/Car.java
66b03dd56f7af5065505340f1415ac711f0a2ed2
[]
no_license
phencharaudthach/Car.java
817b45e5664aac98a0a02f0006d4de1e964803f3
a168fab9a74b418716083dcd75294199b383a7e9
refs/heads/master
2022-12-10T09:56:45.398387
2020-09-01T22:02:34
2020-09-01T22:02:34
291,854,354
0
0
null
null
null
null
UTF-8
Java
false
false
990
java
package com.codewithphencharaud; public class Car { private String make; private String model; private int year; public Car(String make, String model, int year) { this.make = make; this.model = model; this.year = year; } public void honk(){ System.out.println("Honk! Honk!"); } public void seatBeltAlert(){ System.out.println("Beep! Beep! Beep! Beep!"); } public String getCarInfo() { return ("My car model is "+model+", make is "+make+", year is "+year); } } class GasPriceForMyCar extends Car { private double gasPrice; private int tankGallon; public GasPriceForMyCar (double gasPrice, int tankGallon, String make, String model, int year){ super(make, model, year); this.gasPrice = gasPrice; this.tankGallon = tankGallon; } public double setTotalCostForGas(){ return gasPrice*tankGallon; } }
[ "pshannonthach@gmail.com" ]
pshannonthach@gmail.com
51f7ccf4e0609f7d3cd9d726beca7a793942186e
77d7625952e7889f8767cbb35f9c805803cfa73c
/src/main/java/com/indie/controller/action/music/KorPopMusicAction.java
e60cabdb8890a4f0f52b9f7fce98250c2799d7c1
[]
no_license
IndieMusicProj/IndieMusic
ee8ead2d2ef0e1493ec3ac7d5ec5927f5dfb8a9d
d4796072b499db2451c6a01895f23cbde93cec3b
refs/heads/main
2023-08-22T02:05:53.571067
2021-10-23T12:46:52
2021-10-23T12:46:52
403,210,788
0
0
null
null
null
null
UTF-8
Java
false
false
1,094
java
package com.indie.controller.action.music; import java.io.IOException; import java.util.ArrayList; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.indie.controller.action.Action; import com.indie.dao.MusicDAO; import com.indie.dto.MusicVO; public class KorPopMusicAction implements Action { @Override public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO ์ž๋™ ์ƒ์„ฑ๋œ ๋ฉ”์†Œ๋“œ ์Šคํ… String url = "/music/korPopChart.jsp"; String id = request.getParameter("id"); System.out.println(id); MusicDAO musicDAO = MusicDAO.getInstance(); musicDAO.updateCnt(id); ArrayList<MusicVO> getKorPopular = (ArrayList<MusicVO>) musicDAO.getKorPopular(); request.setAttribute("getKorPopular", getKorPopular); RequestDispatcher dispatcher = request.getRequestDispatcher(url); dispatcher.forward(request, response); } }
[ "v_donguk@naver.com" ]
v_donguk@naver.com