blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
8bb200aa2ce56162477f4c1cbe329124a407bb14
063baff3c224463d153e8b6006df62b783afe77f
/src/main/java/com/demo/model/Sudo.java
7081cb3f37ae77cdec8841068441295993969b25
[]
no_license
sravanthi-konreddy/demoapi
8341e4178249ebe50a8dbdf1bb14128d84d39010
9c5b7181fbd5061dd64993697e48831805499fb2
refs/heads/master
2022-12-23T21:54:33.705836
2020-02-25T18:27:42
2020-02-25T18:27:42
237,507,385
0
0
null
2022-12-16T08:36:31
2020-01-31T20:06:05
Java
UTF-8
Java
false
false
354
java
package com.demo.model; public class Sudo { int[][] inputArray=new int[9][9]; public int[][] getInputArray() { return inputArray; } public void setInputArray(int[][] inputArray2) { for(int i=0;i<9;i++) { for(int j=0;j<9;j++) { this.inputArray[i][j]=inputArray2[i][j]; } } // TODO Auto-generated method stub } }
2d96b9209d526e641066bc39eb47e572b5df4bb7
7811ba377c4bb3b7d441a61c4b031f171821e0b3
/dependency/common/uk/ac/ebi/interpro/common/database/Executor.java
628acc133b79fe6b1e2457755c51764d82248656
[]
no_license
wikiselev/GO-ancestor-chart
9426434dbaf2d730ebfb8d423a5004c321cfb994
aaefb7310648f14aed091d985579be6be9780600
refs/heads/master
2021-01-10T20:57:29.458711
2015-01-22T16:44:00
2015-01-22T16:44:00
25,304,983
0
0
null
null
null
null
UTF-8
Java
false
false
3,910
java
package uk.ac.ebi.interpro.common.database; import uk.ac.ebi.interpro.common.performance.*; import javax.sql.*; import java.io.*; import java.sql.*; import java.util.*; public class Executor implements ToHTML { final LinkedList queue=new LinkedList(); boolean shutdown; int waiting=0; class Agent implements Runnable { public void run() { while (!shutdown) { try { Want want; synchronized(queue) { waiting++; //System.out.println("Queue "+queue.size()); if (queue.isEmpty()) {queue.wait();} want=(Want) queue.removeLast(); if (want==null) continue; if (!want.infinitePatience() && want.patience()<=0) continue; waiting--; } //System.out.println("Running "+want); want.run(); } catch (Exception e) { // keep going whatever happens } } } } class Want implements Runnable { Runnable task; boolean done; RuntimeException e; long limit; public void run() { try { task.run(); } catch (RuntimeException e) { this.e=e; } synchronized(this) { done = true; notify(); } } public boolean infinitePatience() { return limit==-1; } public long patience() { return limit-System.currentTimeMillis(); } public Want(Runnable task, long limit) { this.task = task; this.limit = limit; } } public void execute(Runnable runnable,long limit) throws InterruptedException { long end=System.currentTimeMillis()+limit; Want want=new Want(runnable,end); //System.out.println("Entering "+want+" "+limit); synchronized(want) { synchronized(queue) { queue.addFirst(want); queue.notify(); } while (!want.done) { long remaining=want.patience(); if (remaining<=0) { synchronized(queue) {queue.remove(want);} throw new InterruptedException("Timeout"); } want.wait(remaining); } if (want.e!=null) throw want.e; } } public void async(Runnable action,long limit) { long end=System.currentTimeMillis()+limit; Want want=new Want(action,end); synchronized(want) { synchronized(queue) { queue.addFirst(want); queue.notify(); } } } public void async(Runnable action) { Want want=new Want(action,-1); synchronized(want) { synchronized(queue) { queue.addFirst(want); queue.notify(); } } } public void shutdown() { synchronized(queue) { shutdown=true; queue.notifyAll(); } } List threads=new ArrayList(); public Executor(int threadCount) { for (int i=0;i<threadCount;i++) { Thread t=new Thread(new Agent()); t.setDaemon(true); t.start(); threads.add(t); } } public void toHTML(PrintWriter wr) { wr.println("<table>"); wr.println("<tr><td>Threads</td><td>"+threads.size()+"</td></tr>"); wr.println("<tr><td>Queue</td><td>"+queue.size()+"</td></tr>"); wr.println("<tr><td>Threads ready</td><td>"+waiting+"</td></tr>"); wr.println("</table>"); } }
d57a1b8e266f1b18d8c07c580d8ccaca111c68bf
83781f48149ca6ff12934e0cb4c05ded9d4c7ed2
/src/test/java/selenium/SingleClickNVerifyTest.java
6ea4cb53d9cc990269fc24e037abf5a11fa56e20
[]
no_license
Smarita123/SeleniumPractice
1ed9ce2bb0ff26ff9ae93167b9395571189e7aa9
3e41246f8f48c6433ca8c2c05546da7375794b16
refs/heads/master
2021-06-08T16:37:37.608361
2019-06-05T07:25:38
2019-06-05T07:25:38
185,353,329
0
0
null
2021-06-04T01:59:41
2019-05-07T08:08:41
HTML
UTF-8
Java
false
false
3,141
java
package com.mvn.Sample1; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.Assert; import org.testng.annotations.Test; public class SingleClickNVerifyTest { WebDriver driver; @Test public void loadBrowser() throws IOException { InputStream input=SampleTest1.class.getClassLoader().getResourceAsStream("testData.properties"); Properties property=new Properties(); property.load(input); if(property.getProperty("browser").equals("chrome")) { //WebDriverManager.chromedriver().version("73.0.3683.68").setup(); //System.setProperty(property.getProperty("HtmlUnitDriver"), property.getProperty("chromeDriverLocation")); //System.setProperty(property.getProperty("chromedriver"), property.getProperty("chromeDriverLocation")); //System.setProperty("webdriver.chrome.driver", "D:\\Automation\\drivers\\chromedriver.exe"); driver=new ChromeDriver(); //driver=new HtmlUnitDriver(); } else if(property.getProperty("browser").equals("firefox")) { //WebDriverManager.firefoxdriver().setup(); System.setProperty(property.getProperty("firefoxd0river"), property.getProperty("firefoxDriverLocation")); //System.setProperty("webdriver.chrome.driver", "D:\\Automation\\drivers\\chromedriver.exe"); driver=new FirefoxDriver(); } //***Load page*** driver.get(property.getProperty("url")); //**Fill up the form*** driver.findElement(By.xpath("//input[@name='name']")).sendKeys(property.getProperty("name")); driver.findElement(By.xpath("//button[text()='Click here to get profession']")).click(); //Assign values in Name and Profession to Variables String name= driver.findElement(By.xpath("//input[@name='name']")).getAttribute("value") ; System.out.println("***Name ="+name); String profession= driver.findElement(By.xpath("//input[@id='profession']")).getAttribute("value"); System.out.println("***Profession ="+profession); SingleClickNVerifyTest obj = new SingleClickNVerifyTest(); obj.checkProfession(name, profession); } public void checkProfession(String name, String profession) { //Profession for Smarita if (name.matches("Smarita")) { Assert.assertEquals(profession, "Quality Analyst"); System.out.println("***Tested OK : Profession = Quality Analyst"); } //Profession for Lalatendu else if (name.matches("Lalatendu")) { Assert.assertEquals(profession, "Java Programmer"); System.out.println("***Tested OK : Profession = Java Programmer"); } //Profession for Null value in Name else if (name.equals("")) { Assert.assertEquals(profession, "NA"); System.out.println("***Tested OK : Profession = NA"); } //Profession for unknown Name else { Assert.assertEquals(profession, "NA"); System.out.println("***Tested OK : Profession = Unknown"); } } }
872ef75c41e4586481f8469d1a760dfb48f12ce1
7400115347e23e5da7e467360c248f72e572d628
/gomint-api/src/main/java/io/gomint/world/block/BlockWoodenSlab.java
c23ea34941f728834f125e356160decafdeca304
[ "BSD-3-Clause" ]
permissive
hanbule/GoMint
44eaf0ec20ff0eeaaf757de9d6540de786deead9
a5a5b937d145598e59febdb2cca0fe2eb58dd1ee
refs/heads/master
2022-12-15T14:35:23.310316
2020-08-22T13:40:46
2020-08-22T13:40:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
574
java
/* * Copyright (c) 2018 Gomint team * * This code is licensed under the BSD license found in the * LICENSE file in the root directory of this source tree. */ package io.gomint.world.block; import io.gomint.world.block.data.LogType; /** * @author geNAZt * @version 1.0 */ public interface BlockWoodenSlab extends BlockSlab { /** * Get the type of wood * * @return type of wood */ LogType getWoodType(); /** * Set the type of wood * * @param logType for this block */ void setWoodType( LogType logType); }
2f9313272f980fe0e63062dd9d3df594476e4eac
c3257150bcc83c3d6e496343decd46e0e7916948
/src/sqlite3/sqlite3_vfs.java
c9646c8335052a356f23e7800e44f65ab5e38d45
[]
no_license
nathanvander/sqlite3
d20aaaec6499032fee14efec5a454f2522537d97
9e084246575148dca30bac86a7b04a470b4844a4
refs/heads/master
2021-01-10T06:59:15.263706
2016-12-03T04:18:00
2016-12-03T04:18:00
45,151,381
0
0
null
null
null
null
UTF-8
Java
false
false
3,945
java
package sqlite3; import com.sun.jna.Structure; import com.sun.jna.Pointer; import com.sun.jna.ptr.LongByReference; import com.sun.jna.ptr.IntByReference; import com.sun.jna.ptr.DoubleByReference; import com.sun.jna.ptr.PointerByReference; import java.util.List; import java.util.Arrays; public abstract class sqlite3_vfs extends Structure { //typedef struct sqlite3_vfs sqlite3_vfs; //typedef void (*sqlite3_syscall_ptr)(void); //struct sqlite3_vfs { //----------- //fields public int iVersion; /* Structure version number (currently 3) */ public int szOsFile; /* Size of subclassed sqlite3_file */ public int mxPathname; /* Maximum file pathname length */ public Pointer pNext; /* Next registered VFS. sqlite3_vfs */ public String zName; /* Name of this virtual file system */ public Pointer pAppData; /* Pointer to application-specific data */ //------------------ protected List getFieldOrder() { return Arrays.asList(new String[] {"iVersion","szOsFile","mxPathName","pNext","zName","pAppData"}); } //int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, // int flags, int *pOutFlags); //Open a file. The 3rd argument is a pointer to the filehandle public abstract int xOpen(Pointer p_sqlite3_vfs, String zName, Pointer p_sqlite3_file, int flags, IntByReference pOutFlags); //int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); public abstract int xDelete(Pointer p_sqlite3_vfs,String zName, int syncDir); //int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); public abstract int xAccess(Pointer p_sqlite3_vfs,String zName, IntByReference pResOut); //int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); public abstract int xFullPathName(Pointer p_sqlite3_vfs, int nOut, char[] zOut); //void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); public abstract Pointer xDlOpen(Pointer p_sqlite3_vfs, String zFileName); //void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); public abstract void xDlError(Pointer p_sqlite3_vfs,int nByte, String zErrMsg); //void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); public abstract Pointer xDlSym(Pointer p_sqlite3_vfs, String zSymbol); //void (*xDlClose)(sqlite3_vfs*, void*); //note: the second argument is a handle public abstract void xDlClose(Pointer p_sqlite3_vfs, Pointer pH); //int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); public abstract int xRandomness(Pointer p_sqlite3_vfs, int nByte, char[] zOut); //int (*xSleep)(sqlite3_vfs*, int microseconds); public abstract int xSleep(Pointer p_sqlite3_vfs,int microseconds); //int (*xCurrentTime)(sqlite3_vfs*, double*); public abstract int xCurrentTime(Pointer p_sqlite3_vfs,DoubleByReference pCurrentTime); //int (*xGetLastError)(sqlite3_vfs*, int, char *); public abstract int xGetLastError(Pointer p_sqlite3_vfs, char[] zBuf); /* ** The methods above are in version 1 of the sqlite_vfs object ** definition. Those that follow are added in version 2 or later */ //int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); public abstract int xCurrentTimeInt64(Pointer p_sqlite3_vfs,LongByReference pTime); /* ** The methods above are in versions 1 and 2 of the sqlite_vfs object. ** Those below are for version 3 and greater. */ //int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); //Pointer public abstract int xSetSystemCall(Pointer p_sqlite3_vfs,String zName,Pointer sqlite3_syscall_ptr); //sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName); public abstract Pointer xGetSystemCall(Pointer p_sqlite3_vfs, String zName); //const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName); public abstract String xNextSystemCall(Pointer p_sqlite3_vfs, String zName); }
5b930831259e4a478f5793dd37c74b9f0a5e9fd7
a30fda43fd4ace542baa331861efd871231d5238
/labs-curator/src/main/java/com/code/labs/curator/leaderelection/ZkPath.java
db19ce5f1ca6da438f5ee41905059ab387723c6d
[]
no_license
intergret/code-labs
4019c0dc3208a70655c426a02ef407926e70fa0c
5a638a8f169825790b80f5e985e2378d78a2f696
refs/heads/master
2021-01-19T21:59:07.587793
2018-11-12T16:02:50
2018-11-12T16:02:50
88,733,048
1
0
null
null
null
null
UTF-8
Java
false
false
948
java
package com.code.labs.curator.leaderelection; public class ZkPath { public final static String NAMESPACE = "labs-curator"; private final static String MASTER_ROOT = "/leader-election/master"; private final static String WORKER_ROOT = "/leader-election/worker"; public static String allMasterPath() { return MASTER_ROOT + "/all"; } public static String allMasterPrefixPath() { return MASTER_ROOT + "/all/master-"; } public static String masterPath(String masterId) { return MASTER_ROOT + "/all/" + masterId; } public static String leaderMasterPath(String masterId) { return MASTER_ROOT + "/leader" + "/" + masterId; } public static String workerPrefixPath() { return WORKER_ROOT + "/worker-"; } public static String workerRootPath() { return WORKER_ROOT; } public static String createPayload(String ip, int port) { return String.format("{\"ip\":%s,\"port\":%d}", ip, port); } }
a86b4f4b217effd3dee17ef8037fc680a13aa7d6
bf710749c4229210f0a058ab2ef95eb7f6c289f2
/IntScript/src/main/java/ideajoy/intscript/OpLoader.java
17decc6491677824ceecf55ef150a984d391ba4d
[ "MIT" ]
permissive
calgarysoftwarecrafters/extensibleScriptingLanguageSolution
533c75b057515851d805200dbefa5108c43516ca
e9c838c9b97277680c0824ece4599a8ff2eff6b5
refs/heads/master
2020-08-11T09:44:18.200436
2019-10-11T23:10:48
2019-10-11T23:10:48
214,542,797
1
0
null
null
null
null
UTF-8
Java
false
false
86
java
package ideajoy.intscript; public interface OpLoader { Op loadOp(String name); }
b80d565f03dd8c48161a9a0b6ebf853910fcf18d
85b902ab128d60b38a7254a6c4f1237005f93084
/Playground/James/JAVA tests/InterfaceTests/src/interfaces/ExecuteOnImpulse.java
b8e05cbbb28ab04c87e710f8b2f3b61b86d9d17c
[]
no_license
JamesFoxes/DTU-IT
6fbc537a14e8648cc0df40e235bd62a9833899ac
e646bd27d1af7107a14399309f8bb616f342a34c
refs/heads/master
2021-01-13T02:08:47.254532
2014-12-18T07:30:27
2014-12-18T07:30:27
23,639,865
0
4
null
null
null
null
UTF-8
Java
false
false
304
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 interfaces; /** * * @author JamesFoxes */ public interface ExecuteOnImpulse { public void execute(); }
df0332a456b208704d187c63d893d2b2dedea354
c32b3dd17e26d8e2cf9119380aaf7547ac2a9f11
/src/main/java/com/jingguanFiles/copyRight/po/TCopyrightEntity.java
a1ab38cd0a2e7a6b0a1bdf90222dd9fe98150dd5
[]
no_license
jinxinchen/jg_teachers_files
827313393cd63531b927f6e5a099830d71589a36
acca46426e0ab8fe0ea88a7be4f5f56fc16b03b3
refs/heads/master
2020-05-14T08:16:39.791792
2019-04-16T16:09:33
2019-04-16T16:09:33
181,718,655
1
0
null
null
null
null
UTF-8
Java
false
false
5,949
java
package com.jingguanFiles.copyRight.po; import javax.persistence.*; /** * Created by 陈 on 2017/11/18. */ @Entity @Table(name = "t_copyright", schema = "jg_teachers", catalog = "") public class TCopyrightEntity { private Integer id; private String ownerName; private String title; private String type; private String publishName; private String publishId; private String otherParticipator; private String notice; private String status; private Integer user_id; private String publishTime; private String issbn; private String uploadTime; private String fileName; private String copyRightSrc; @Id @Column(name = "id") @GeneratedValue(strategy = GenerationType.IDENTITY) public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @Basic @Column(name = "owner_name") public String getOwnerName() { return ownerName; } public void setOwnerName(String ownerName) { this.ownerName = ownerName; } @Basic @Column(name = "copyRightSrc") public String getCopyRightSrc() { return copyRightSrc; } public void setCopyRightSrc(String copyRightSrc) { this.copyRightSrc = copyRightSrc; } @Basic @Column(name = "upload_time") public String getUploadTime() { return uploadTime; } public void setUploadTime(String uploadTime) { this.uploadTime = uploadTime; } @Basic @Column(name = "file_name") public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } @Basic @Column(name = "title") public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } @Basic @Column(name = "type") public String getType() { return type; } public void setType(String type) { this.type = type; } @Basic @Column(name = "publish_name") public String getPublishName() { return publishName; } public void setPublishName(String publishName) { this.publishName = publishName; } @Basic @Column(name = "publish_id") public String getPublishId() { return publishId; } public void setPublishId(String publishId) { this.publishId = publishId; } @Basic @Column(name = "other_participator") public String getOtherParticipator() { return otherParticipator; } public void setOtherParticipator(String otherParticipator) { this.otherParticipator = otherParticipator; } @Basic @Column(name = "notice") public String getNotice() { return notice; } public void setNotice(String notice) { this.notice = notice; } @Basic @Column(name = "status") public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } @Basic @Column(name = "user_id") public Integer getuser_id() { return user_id; } public void setuser_id(Integer user_id) { this.user_id = user_id; } @Basic @Column(name = "publishTime") public String getPublishTime() { return publishTime; } public void setPublishTime(String publishTime) { this.publishTime = publishTime; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TCopyrightEntity that = (TCopyrightEntity) o; if (id != null ? !id.equals(that.id) : that.id != null) return false; if (ownerName != null ? !ownerName.equals(that.ownerName) : that.ownerName != null) return false; if (title != null ? !title.equals(that.title) : that.title != null) return false; if (type != null ? !type.equals(that.type) : that.type != null) return false; if (publishName != null ? !publishName.equals(that.publishName) : that.publishName != null) return false; if (publishId != null ? !publishId.equals(that.publishId) : that.publishId != null) return false; if (otherParticipator != null ? !otherParticipator.equals(that.otherParticipator) : that.otherParticipator != null) return false; if (notice != null ? !notice.equals(that.notice) : that.notice != null) return false; if (status != null ? !status.equals(that.status) : that.status != null) return false; if (user_id != null ? !user_id.equals(that.user_id) : that.user_id != null) return false; if (publishTime != null ? !publishTime.equals(that.publishTime) : that.publishTime != null) return false; return true; } @Override public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (ownerName != null ? ownerName.hashCode() : 0); result = 31 * result + (title != null ? title.hashCode() : 0); result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (publishName != null ? publishName.hashCode() : 0); result = 31 * result + (publishId != null ? publishId.hashCode() : 0); result = 31 * result + (otherParticipator != null ? otherParticipator.hashCode() : 0); result = 31 * result + (notice != null ? notice.hashCode() : 0); result = 31 * result + (status != null ? status.hashCode() : 0); result = 31 * result + (user_id != null ? user_id.hashCode() : 0); result = 31 * result + (publishTime != null ? publishTime.hashCode() : 0); return result; } @Basic @Column(name = "ISSBN") public String getIssbn() { return issbn; } public void setIssbn(String issbn) { this.issbn = issbn; } }
5e24b34d4de63bb3a2619384ce0df9c080953f16
b77e51acbb3508814c954b8916ac005b1cc3c730
/Exercise-5/src/com/georgegebretensai/Main.java
a3f59026c692aba76710569627d57a57fc6e22a7
[]
no_license
TYG1/Android_Fundamentals
95b94bc8e3f4379365fbacfc44fd221c0c16b763
e9dc59e19b0698afc958f3624271e7810d3877f0
refs/heads/master
2021-01-10T15:09:20.725869
2016-05-14T15:30:00
2016-05-14T15:30:00
50,149,118
0
0
null
null
null
null
UTF-8
Java
false
false
469
java
package com.georgegebretensai; /** * Created by George on 3/15/16. */ public class Main { public static void main(String []args){ AddressBook myBook = new AddressBook(); myBook.newContact("George","[email protected]"); myBook.newContact("Sara", "[email protected]"); myBook.newContact("Tom", "[email protected]"); myBook.searchByName("George"); myBook.searchByName("Sara"); myBook.searchByName("Tom"); } }
b21bdc8c6174bccdc92da2b585f8c24c54602105
6d5a4cdd504ad29c5875aeb8573a41db8edf457c
/app/src/main/java/android/demo/amitrai/staksdk/Modal/Business.java
5b06bbd4a35e2255ddd745e82b3496269fc455f0
[]
no_license
amitrai98/StakSdkPrev
f5d6db0ce1dc555e50590a70715bc82801ee9271
69fd8be071da3c48ed588c46184d4ee72890c941
refs/heads/master
2020-04-13T17:04:17.669975
2016-02-01T07:04:24
2016-02-01T07:04:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,167
java
package android.demo.amitrai.staksdk.Modal; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; import java.util.List; public class Business { @SerializedName("_id") @Expose private String Id; @SerializedName("name") @Expose private String name; @SerializedName("clientId") @Expose private String clientId; @SerializedName("__v") @Expose private Integer V; @SerializedName("logoFilePath") @Expose private String logoFilePath; @SerializedName("businessCategory") @Expose private String businessCategory; @SerializedName("dataChecksum") @Expose private String dataChecksum; @SerializedName("updatedAt") @Expose private String updatedAt; @SerializedName("createdAt") @Expose private String createdAt; @SerializedName("deleted") @Expose private String deleted; @SerializedName("status") @Expose private String status; @SerializedName("contact") @Expose private List<Contact> contact = new ArrayList<Contact>(); @SerializedName("address") @Expose private List<Address> address = new ArrayList<Address>(); @SerializedName("emailAddress") @Expose private String emailAddress; @SerializedName("primaryURL") @Expose private String primaryURL; @SerializedName("primaryPhone") @Expose private String primaryPhone; /** * * @return * The Id */ public String getId() { return Id; } /** * * @param Id * The _id */ public void setId(String Id) { this.Id = Id; } /** * * @return * The name */ public String getName() { return name; } /** * * @param name * The name */ public void setName(String name) { this.name = name; } /** * * @return * The clientId */ public String getClientId() { return clientId; } /** * * @param clientId * The clientId */ public void setClientId(String clientId) { this.clientId = clientId; } /** * * @return * The V */ public Integer getV() { return V; } /** * * @param V * The __v */ public void setV(Integer V) { this.V = V; } /** * * @return * The logoFilePath */ public String getLogoFilePath() { return logoFilePath; } /** * * @param logoFilePath * The logoFilePath */ public void setLogoFilePath(String logoFilePath) { this.logoFilePath = logoFilePath; } /** * * @return * The businessCategory */ public String getBusinessCategory() { return businessCategory; } /** * * @param businessCategory * The businessCategory */ public void setBusinessCategory(String businessCategory) { this.businessCategory = businessCategory; } /** * * @return * The dataChecksum */ public String getDataChecksum() { return dataChecksum; } /** * * @param dataChecksum * The dataChecksum */ public void setDataChecksum(String dataChecksum) { this.dataChecksum = dataChecksum; } /** * * @return * The updatedAt */ public String getUpdatedAt() { return updatedAt; } /** * * @param updatedAt * The updatedAt */ public void setUpdatedAt(String updatedAt) { this.updatedAt = updatedAt; } /** * * @return * The createdAt */ public String getCreatedAt() { return createdAt; } /** * * @param createdAt * The createdAt */ public void setCreatedAt(String createdAt) { this.createdAt = createdAt; } /** * * @return * The deleted */ public String getDeleted() { return deleted; } /** * * @param deleted * The deleted */ public void setDeleted(String deleted) { this.deleted = deleted; } /** * * @return * The status */ public String getStatus() { return status; } /** * * @param status * The status */ public void setStatus(String status) { this.status = status; } /** * * @return * The contact */ public List<Contact> getContact() { return contact; } /** * * @param contact * The contact */ public void setContact(List<Contact> contact) { this.contact = contact; } /** * * @return * The address */ public List<Address> getAddress() { return address; } /** * * @param address * The address */ public void setAddress(List<Address> address) { this.address = address; } /** * * @return * The emailAddress */ public String getEmailAddress() { return emailAddress; } /** * * @param emailAddress * The emailAddress */ public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } /** * * @return * The primaryURL */ public String getPrimaryURL() { return primaryURL; } /** * * @param primaryURL * The primaryURL */ public void setPrimaryURL(String primaryURL) { this.primaryURL = primaryURL; } /** * * @return * The primaryPhone */ public String getPrimaryPhone() { return primaryPhone; } /** * * @param primaryPhone * The primaryPhone */ public void setPrimaryPhone(String primaryPhone) { this.primaryPhone = primaryPhone; } }
845a3597b1b98deb9f147a983d567360a2dfbfdb
f7e403459a83e0177b6a92e2a64d76de3eead4d5
/java_design_web/src/main/java/com/haohao/designpatterns/f_delegate/demo2/OrderController.java
6961ad8fb6890d455b1cd839974f3b72c6507efe
[]
no_license
guanhao20170227/gupao_test_code
19af55e041543ab4ed7b02e4ac64b626d6154102
66a5ccfc3d6a2b5f3b528a2b56ce53247634b7bc
refs/heads/master
2021-07-16T09:34:41.707061
2019-12-12T12:24:08
2019-12-12T12:24:08
218,044,917
0
0
null
2020-10-13T18:10:18
2019-10-28T12:47:08
Java
UTF-8
Java
false
false
238
java
package com.haohao.designpatterns.f_delegate.demo2; public class OrderController { public void getOrderById(String mid) { System.out.println("com.haohao.designpatterns.f_delegate.demo2.OrderController.getOrderById"); } }
e5e5559661f5eb5336e7371810047fe1f0c668aa
4ed237c37b1c59c713240af53856a2f1b4bcddad
/nideshop-server/src/main/java/com/wdk/nideshop/storage/entity/NideshopCommentPicture.java
1c4dbb116e0effb3bb500a8c75330f3d14a6ea14
[]
no_license
wdke/nideshop
d06c951eee0a217fa18e50ddc538b2c382369ab6
bf9cb218692945389c146269c6422931e8bd039c
refs/heads/master
2022-06-23T06:15:25.402432
2019-12-30T11:43:11
2019-12-30T11:43:11
230,905,365
0
0
null
2022-06-21T02:32:41
2019-12-30T11:39:42
Java
UTF-8
Java
false
false
568
java
package com.wdk.nideshop.storage.entity; import lombok.Data; import java.util.Date; import com.fasterxml.jackson.annotation.JsonInclude; import org.springframework.format.annotation.DateTimeFormat;import java.io.Serializable; /** * * @db nideshop * @table nideshop_comment_picture * @author wdke * @date 2019/12/30 19 */ @Data @JsonInclude(JsonInclude.Include.NON_NULL) public class NideshopCommentPicture implements Serializable { // private Integer id; // private Integer comment_id; // private String pic_url; // private Byte sort_order; }
30d0ebb1181dd15e34eb5fd0130a03b1819a76a0
42c49a930fd08a18a329e9ebce39653db00769ad
/src/frames/jDVentas.java
94cd41b3d49c6cf1d02d28cff6440b4814d484e4
[]
no_license
EverAlfonzo/ControlSoft
3f721890f898dffd61f1ad3aa8cb1b3261af8d9c
8b35917c3cac8be659d5935693f0c748042ddca8
refs/heads/master
2021-01-19T03:05:12.691374
2017-03-30T23:08:49
2017-03-30T23:08:49
48,141,598
0
0
null
null
null
null
UTF-8
Java
false
false
25,691
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * jDVentas.java * * Created on 11/08/2012, 03:10:32 PM */ package frames; import clases.DBConnect; import java.awt.Image; import java.awt.event.ActionEvent; import java.sql.ResultSet; import java.sql.SQLException; import java.text.DateFormat; import java.util.Date; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; import java.sql.ResultSet; import java.util.HashMap; import javax.swing.JOptionPane; import java.net.URL; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRResultSetDataSource; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.util.JRLoader; import net.sf.jasperreports.view.JasperViewer; /** * * @author Edgar */ public class jDVentas extends javax.swing.JDialog { private static String vend; Image imagen = getToolkit().getImage(getClass().getResource("/imagenes/global2.png")); DBConnect bd; DefaultTableModel m; ResultSet r; private int i=0; private String hoy1; private String fecha1; Date hoy; Date fecha; DateFormat hola; /** Creates new form jDVentas */ public jDVentas(java.awt.Frame parent, boolean modal, DBConnect con) { super(parent, modal); initComponents(); setIconImage(imagen); this.setLocationRelativeTo(null); this.setTitle("Ventas"); hoy= new Date(); hola = DateFormat.getDateInstance(); hoy1 = hola.format(hoy); fecha = new Date(); jXhasta.setDate(hoy); fecha.setMonth(hoy.getMonth()-1); jXdesde.setDate(fecha); bd = con; jBNueva.requestFocus(); PrepararTabla(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jpmVenta = new javax.swing.JPopupMenu(); jmVisualizarVenta = new javax.swing.JMenuItem(); jScrollPane1 = new javax.swing.JScrollPane(); jTVentas = new javax.swing.JTable(); jPBotones = new javax.swing.JPanel(); jBNueva = new javax.swing.JButton(); jBImpreg = new javax.swing.JButton(); jBSalir = new javax.swing.JButton(); jXhasta = new org.jdesktop.swingx.JXDatePicker(); jXdesde = new org.jdesktop.swingx.JXDatePicker(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jTUtilidad = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jTBusqueda = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jTTotal = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jTDeudaTotal = new javax.swing.JTextField(); jmVisualizarVenta.setText("Visualizar Venta"); jmVisualizarVenta.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jmVisualizarVentaActionPerformed(evt); } }); jpmVenta.add(jmVisualizarVenta); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setIconImage(null); setModal(true); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { formWindowClosed(evt); } }); jTVentas.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } ) { boolean[] canEdit = new boolean [] { false, false, false, false }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); jTVentas.setComponentPopupMenu(jpmVenta); jTVentas.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTVentasMouseClicked(evt); } }); jScrollPane1.setViewportView(jTVentas); jPBotones.setLayout(new java.awt.GridLayout(1, 3)); jBNueva.setText("Nueva Venta"); jBNueva.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jBNuevaActionPerformed(evt); } }); jPBotones.add(jBNueva); jBImpreg.setText("Imprimir el registro"); jBImpreg.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jBImpregActionPerformed(evt); } }); jPBotones.add(jBImpreg); jBSalir.setText("Salir"); jBSalir.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jBSalirActionPerformed(evt); } }); jPBotones.add(jBSalir); jXhasta.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jXhastaActionPerformed(evt); } }); jXdesde.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jXdesdeActionPerformed(evt); } }); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Visualizar las ventas correspondientes al periodo"); jLabel2.setText("de:"); jLabel3.setText("al:"); jTUtilidad.setEditable(false); jTUtilidad.setText("0"); jLabel4.setText("Utilidad Total:"); jLabel5.setText("Gs."); jTBusqueda.addCaretListener(new javax.swing.event.CaretListener() { public void caretUpdate(javax.swing.event.CaretEvent evt) { jTBusquedaCaretUpdate(evt); } }); jTBusqueda.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTBusquedaActionPerformed(evt); } }); jLabel6.setText("Buscar:"); jLabel7.setText("Total de Venta:"); jTTotal.setEditable(false); jTTotal.setText("0"); jLabel8.setText("Gs."); jLabel9.setText("Deuda Credito"); jTDeudaTotal.setEditable(false); jTDeudaTotal.setText("0"); jTDeudaTotal.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTDeudaTotalActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPBotones, javax.swing.GroupLayout.DEFAULT_SIZE, 583, Short.MAX_VALUE))) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jLabel6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jTBusqueda) .addGap(402, 402, 402)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jXdesde, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(73, 73, 73) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jXhasta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(165, 165, 165)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel9) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTDeudaTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel8) .addGap(26, 26, 26) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTUtilidad, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel5)))))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jXhasta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jXdesde, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTBusqueda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTUtilidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4) .addComponent(jLabel7) .addComponent(jTTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8))) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(25, 25, 25) .addComponent(jPBotones, javax.swing.GroupLayout.DEFAULT_SIZE, 31, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel9) .addComponent(jTDeudaTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jBNuevaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBNuevaActionPerformed // TODO add your handling code here: new jDnventa(null, true, bd).setVisible(true); PrepararTabla(); }//GEN-LAST:event_jBNuevaActionPerformed private void jBSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSalirActionPerformed // TODO add your handling code here: this.dispose(); }//GEN-LAST:event_jBSalirActionPerformed private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed // TODO add your handling code here: }//GEN-LAST:event_formWindowClosed private void jXdesdeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jXdesdeActionPerformed // TODO add your handling code here: fecha= jXdesde.getDate(); PrepararTabla(); }//GEN-LAST:event_jXdesdeActionPerformed private void jXhastaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jXhastaActionPerformed // TODO add your handling code here: hoy= jXhasta.getDate(); PrepararTabla(); }//GEN-LAST:event_jXhastaActionPerformed private void jTVentasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTVentasMouseClicked if(evt.getClickCount()==2){ } if(evt.getButton()==evt.BUTTON3){ } }//GEN-LAST:event_jTVentasMouseClicked private void jBImpregActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBImpregActionPerformed try{ r=null; r = bd.Listar("*", "vistaventa", "where `Fecha_venta` >= '"+(fecha.getYear()+1900)+"-"+(fecha.getMonth()+1)+"-"+(fecha.getDate())+"' and Fecha_venta <= '"+(hoy.getYear()+1900)+"-"+(hoy.getMonth()+1)+"-"+(hoy.getDate()) +"'"+"and (Id_venta like \"%"+jTBusqueda.getText()+"%\" or Nom_cliente like \"%"+jTBusqueda.getText()+"%\" or tipo_venta like \"%"+jTBusqueda.getText()+"%\") order by Id_venta ASC"); } catch (Exception ex) { //Logger.getLogger(ciudad.class.getName()).log(Level.SEVERE, null, ex); } JRResultSetDataSource jrRS = new JRResultSetDataSource(r); HashMap parameters = new HashMap(); try{ URL urlMaestro = getClass().getClassLoader().getResource("reportes/report4.jasper"); // Cargamos el reporte JasperReport masterReport = null; masterReport = (JasperReport) JRLoader.loadObject(urlMaestro); JasperPrint masterPrint = null; masterPrint = JasperFillManager.fillReport(masterReport,parameters,jrRS); JasperViewer ventana = new JasperViewer(masterPrint,false); ventana.setTitle("Vista Previa"); ventana.setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE); ventana.setVisible(true); }catch(JRException e){ e.printStackTrace(); JOptionPane.showMessageDialog(null, "Ocurrio un error "+e.toString(),"ATENCION ", JOptionPane.INFORMATION_MESSAGE); } }//GEN-LAST:event_jBImpregActionPerformed private void jmVisualizarVentaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmVisualizarVentaActionPerformed new jDVistaVenta(null, true,this.bd,String.valueOf(jTVentas.getValueAt(jTVentas.getSelectedRow(), 0))).setVisible(true); }//GEN-LAST:event_jmVisualizarVentaActionPerformed private void jTBusquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTBusquedaActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTBusquedaActionPerformed private void jTBusquedaCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_jTBusquedaCaretUpdate PrepararTabla(); }//GEN-LAST:event_jTBusquedaCaretUpdate private void jTDeudaTotalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTDeudaTotalActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTDeudaTotalActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { jDVentas dialog = new jDVentas(null, true,null); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jBImpreg; private javax.swing.JButton jBNueva; private javax.swing.JButton jBSalir; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPBotones; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextField jTBusqueda; private javax.swing.JTextField jTDeudaTotal; private javax.swing.JTextField jTTotal; private javax.swing.JTextField jTUtilidad; private javax.swing.JTable jTVentas; private org.jdesktop.swingx.JXDatePicker jXdesde; private org.jdesktop.swingx.JXDatePicker jXhasta; private javax.swing.JMenuItem jmVisualizarVenta; private javax.swing.JPopupMenu jpmVenta; // End of variables declaration//GEN-END:variables public String quitarPuntos(String campo){ String ahora=""; for(int k =0; k<campo.length();k++){ if(campo.charAt(k)!='.'){ ahora =ahora + campo.charAt(k); } } return (ahora); } private Integer CalcUtilidad(String Cod){ ResultSet rS=null; rS= bd.Listar("*", "vistafactura", "where Id_venta='"+Cod+"'"); Integer utilidad=0; String filas[]= new String[4]; try { while(rS.next()){ ResultSet rCostoProd = bd.Listar("pre_compra", "producto", "where Cod_inter_producto='"+rS.getString("Cod_inter_producto")+"'"); rCostoProd.next(); filas[0]= rS.getString("Cant_vendida"); filas[1]=rS.getString("Pre_n_venta"); filas[2]= String.valueOf(Integer.valueOf(filas[0])*Integer.valueOf(filas[1])); filas[3]= String.valueOf(Integer.valueOf(filas[2])-Integer.valueOf(filas[0])*Integer.valueOf(quitarPuntos(rCostoProd.getString(1)))); utilidad+=Integer.valueOf(filas[3]); } } catch (SQLException ex) { JOptionPane.showMessageDialog(rootPane,ex.getMessage(),"Error 382", JOptionPane.ERROR_MESSAGE); } return utilidad; } private Integer CalcTotal(String Cod){ ResultSet rS=null; rS= bd.Listar("*", "vistafactura", "where Id_venta='"+Cod+"'"); Integer total=0; String filas[]= new String[3]; try { while(rS.next()){ filas[0]= rS.getString("Cant_vendida"); filas[1]=rS.getString("Pre_n_venta"); filas[2]= String.valueOf(Integer.valueOf(filas[0])*Integer.valueOf(filas[1])); total+=Integer.valueOf(filas[2]); } } catch (SQLException ex) { JOptionPane.showMessageDialog(rootPane,ex.getMessage(),"Error 382", JOptionPane.ERROR_MESSAGE); } return total; } private void PrepararTabla() { int utilidadTotal=0; int total=0; int deudaTotal = 0; r= null; r = bd.Listar("*", "vistaventa", "where `Fecha_venta` >= '"+(fecha.getYear()+1900)+"-"+(fecha.getMonth()+1)+"-"+(fecha.getDate())+"' and Fecha_venta <= '"+(hoy.getYear()+1900)+"-"+(hoy.getMonth()+1)+"-"+(hoy.getDate()) +"'"+"and (Id_venta like \"%"+jTBusqueda.getText()+"%\" or Nom_cliente like \"%"+jTBusqueda.getText()+"%\" or tipo_venta like \"%"+jTBusqueda.getText()+"%\") order by Id_venta ASC"); m= (new javax.swing.table.DefaultTableModel( new Object [][] {}, new String [] {"Cod. venta","Cond. de Venta","Fecha","Nom. Cliente","Observaciones","Utilidad","Venta Total"}) { boolean[] canEdit = new boolean [] {false,false, false, false, false,false,false}; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; }}); jTVentas.setModel(m); String Fila[]= new String[7]; try { while(r.next()){ Fila[0]= r.getString("id_venta"); Fila[1]= r.getString("tipo_venta"); Fila[2]= r.getString("fecha_venta"); Fila[3]= r.getString("nom_cliente"); Fila[4]= r.getString("observacion"); Fila[5] = r.getString("utilidad"); Fila[6] = r.getString("total"); m.addRow(Fila); utilidadTotal+=Integer.valueOf(Fila[5]); total+=Integer.valueOf(Fila[6]); if(!Fila[1].equals("Contado")){ deudaTotal += Integer.valueOf(Fila[6])-Integer.valueOf(r.getString("pagado")); } } } catch (SQLException ex) { JOptionPane.showMessageDialog(null, ex.getMessage(),"Error1",JOptionPane.ERROR_MESSAGE); } jTUtilidad.setText(String.valueOf(utilidadTotal)); jTTotal.setText(String.valueOf(total)); jTDeudaTotal.setText(String.valueOf(deudaTotal)); } }
999a85dc4f1f30b111c6b0dded371c1fad8b3758
8d378cbcc81166e0001cfd4eadc5b9b880e60480
/src/Input.java
a259be3b7ff7bc1fb8c046e020c3f1436c9bd8ad
[]
no_license
dimetrix555/java-alishev
47ab2e69d43df045cb7fc38f0899425d850aea88
a613ca743b1989bad5570c1425dd469ceca0f4ec
refs/heads/master
2022-08-04T13:42:18.076033
2020-05-17T19:57:41
2020-05-17T19:57:41
259,318,789
0
0
null
null
null
null
UTF-8
Java
false
false
347
java
import java.util.Scanner; public class Input { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.println("введите какое-нибудь число"); //String string = s.nextLine(); int x = s.nextInt(); System.out.println("Вы ввели " + x); } }
4a37f90ccbbf4ba29b48558caee6007459698a7e
e9f1f287f5d5288bc2636403c476d119822792fd
/src/main/java/cn/java52/FactoryMethod/example/AbstractFactory.java
1adc8b773874a24cbe9016ccd886b1077090d1f8
[]
no_license
1124863805/DesignMode
fa81b4e6ba72dd42e6155318dd6ac53dbc560d20
2ef9165f8722a665672fabffe60d776d9f8b8de6
refs/heads/master
2020-06-12T15:40:56.963486
2019-06-30T10:54:55
2019-06-30T10:54:55
194,349,694
0
0
null
null
null
null
UTF-8
Java
false
false
162
java
package cn.java52.FactoryMethod.example; //抽象工厂:提供了厂品的生成方法 public interface AbstractFactory { public Product newProduct(); }
c9b994642ec47aa518595eb68c5af65c0b9f0371
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/com/tencent/p177mm/protocal/C35972w.java
7f1310a365dd136da58a4ded9d8423fceae03160
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,092
java
package com.tencent.p177mm.protocal; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.p177mm.protocal.C4836l.C4832b; import com.tencent.p177mm.protocal.C4836l.C4833c; import com.tencent.p177mm.protocal.C4836l.C4834d; import com.tencent.p177mm.protocal.C4836l.C4835e; import com.tencent.p177mm.protocal.protobuf.bwd; import com.tencent.p177mm.protocal.protobuf.bwe; import org.xwalk.core.XWalkCoreWrapper; /* renamed from: com.tencent.mm.protocal.w */ public final class C35972w { /* renamed from: com.tencent.mm.protocal.w$a */ public static class C23477a extends C4834d implements C4832b { public bwd vyK = new bwd(); public C23477a() { AppMethodBeat.m2504i(80000); AppMethodBeat.m2505o(80000); } /* renamed from: ZT */ public final byte[] mo5742ZT() { AppMethodBeat.m2504i(XWalkCoreWrapper.INVOKE_RUNTIME_ID_CONTEXT_CHANGED); this.vyK.setBaseRequest(C4836l.m7194a(this)); byte[] toByteArray = this.vyK.toByteArray(); AppMethodBeat.m2505o(XWalkCoreWrapper.INVOKE_RUNTIME_ID_CONTEXT_CHANGED); return toByteArray; } public final int getCmdId() { return 42; } /* renamed from: ZU */ public final int mo5743ZU() { return 131; } } /* renamed from: com.tencent.mm.protocal.w$b */ public static class C30257b extends C4835e implements C4833c { public bwe vyL = new bwe(); public C30257b() { AppMethodBeat.m2504i(80002); AppMethodBeat.m2505o(80002); } /* renamed from: P */ public final int mo5744P(byte[] bArr) { AppMethodBeat.m2504i(XWalkCoreWrapper.INVOKE_RUNTIME_ID_HAS_FEATURE); this.vyL = (bwe) new bwe().parseFrom(bArr); C4836l.m7195a(this, this.vyL.getBaseResponse()); int i = this.vyL.getBaseResponse().Ret; AppMethodBeat.m2505o(XWalkCoreWrapper.INVOKE_RUNTIME_ID_HAS_FEATURE); return i; } } }
ff772962ba917f8cc7a15fac63387167c48550d8
a243f6877ac7c3292a43c58b8fbd32eea05b135f
/src/B2L4_inheritance.java
8c18e5a82b3740ba2712984ae272653ef413bac2
[]
no_license
tasso-tech/PRO2_demos_mg1
43841bb22967f02136cfedaf09183de3ffc71867
84b16aa61ae385ed71548e5c0dbd92b267b96386
refs/heads/master
2020-04-11T03:23:37.367916
2018-12-12T08:53:45
2018-12-12T08:53:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,039
java
public class B2L4_inheritance { public static void main(String[] args){ Student student1 = new Student(); student1.setYear(1); student1.setName("Erwin"); Teacher teacher1 = new Teacher(); teacher1.setSubject("Programmeren 2"); System.out.println(teacher1.getSubject()); /* Person p1 = new Person(); p1.setName("henkhenkhenkhenkhenkhenkhenk"); Person[] people = { new Teacher(), new Student() }; Teacher t = (Teacher)people[0]; t.setName("Erwin"); t.setIq(130); t.addDiploma("HBO gamedesign & Development (HKU)"); Student s = (Student)people[1]; s.setName("Hendrik"); s.setIq(130); s.addCourse("PRO2"); s.addDiploma("VMBO T"); for (Person person : people) { System.out.println(person.getName() + " has an IQ of " + person.getIq() + " and has the following diplomas " + person.getDiplomas()); } */ } }
006c3412bc07f7a265eb988eb6a23df8ea14a49c
374a96225bd50c722376efff962bfb02b65537a6
/app/src/test/java/com/leonardo_soares_santos/chatbotlss/ExampleUnitTest.java
d2dc970399d71dc66e042660b23fe852c87d3034
[]
no_license
leonardo-suarez-santos/ProjetoCHATBOT.final
ecfc779d1bec6b0771cb14c220a1a283ed196b8f
c2ec90feebc4002dfb9754c93ad185a743479353
refs/heads/master
2020-03-20T16:00:07.109785
2018-06-15T20:02:34
2018-06-15T20:02:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
398
java
package com.leonardo_soares_santos.chatbotlss; 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); } }
7c29dc0937ef45e4e1b1a9a6eb4e56625b6ec126
300d13cdee16a9d6d0fa05bd1cbdb459f9f388c0
/CM5/test-module/src/main/java/ru/intertrust/cm/test/extension/AfterSaveTestType14.java
35333b0aff1f753d69014cc1bc29aed43e2012a6
[ "Apache-2.0" ]
permissive
InterTurstCo/ActiveFrame5
c0f3ef01642b6c564bec5fbc92ac64db4f33fd31
a042afd5297be9636656701e502918bdbd63ce80
refs/heads/master
2021-12-14T01:26:12.718188
2021-12-06T16:40:01
2021-12-06T16:40:01
223,143,464
4
3
Apache-2.0
2021-12-06T16:49:49
2019-11-21T10:01:48
Java
UTF-8
Java
false
false
2,047
java
package ru.intertrust.cm.test.extension; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.springframework.beans.factory.annotation.Autowired; import ru.intertrust.cm.core.business.api.CollectionsService; import ru.intertrust.cm.core.business.api.CrudService; import ru.intertrust.cm.core.business.api.PersonManagementService; import ru.intertrust.cm.core.business.api.dto.DomainObject; import ru.intertrust.cm.core.business.api.dto.FieldModification; import ru.intertrust.cm.core.business.api.dto.Id; import ru.intertrust.cm.core.business.api.dto.IdentifiableObjectCollection; import ru.intertrust.cm.core.dao.api.extension.AfterSaveExtensionHandler; import ru.intertrust.cm.core.dao.api.extension.ExtensionPoint; @ExtensionPoint(filter="test_type_14") public class AfterSaveTestType14 implements AfterSaveExtensionHandler{ @Autowired private CollectionsService collectionsService; @Autowired private CrudService crudService; @Override public void onAfterSave(DomainObject domainObject, List<FieldModification> changedFields) { //Поиск персоны IdentifiableObjectCollection collection = collectionsService.findCollectionByQuery("select id from test_type_13"); //Получаем с блокировкой, Меняем поле и сохраняем DomainObject testType13 = crudService.findAndLock(collection.get(0).getId()); String lastName = testType13.getString("description"); Pattern p = Pattern.compile("[^\\d]*(\\d+)"); Matcher m = p.matcher(lastName); long num = 0; if (m.find()) { num = Long.parseLong(m.group(1)); num++; } testType13.setString("description", "description-" + num); testType13.setString("description2", "description-" + num); System.out.println("person1 last name = " + testType13.getString("description")); crudService.save(testType13); } }
3b11fad71c724e659a10710bc683e8b9003a972f
9a7e206bb951ad93cf3fa4c95998af9c0fbd0557
/service_3rd/src/main/java/com/sdxm/service3rd/dao/DictMapper.java
981c3983753030248c6403b5141379291342082b
[]
no_license
vtne/spring-cloud
cfdeb556f9da343c97587fed6e5c4a3353fc5ec6
f4f2b0054e1a4d9988331e365601f7fbd0434b05
refs/heads/master
2022-06-21T05:25:12.501373
2019-10-21T05:24:47
2019-10-21T05:24:47
216,482,707
0
0
null
2022-06-17T02:37:44
2019-10-21T05:14:12
Java
UTF-8
Java
false
false
812
java
package com.sdxm.service3rd.dao; import com.sdxm.service3rd.entity.Dict; import com.sdxm.service3rd.entity.DictExample; import org.apache.ibatis.annotations.Param; import java.util.List; public interface DictMapper { long countByExample(DictExample example); int deleteByExample(DictExample example); int deleteByPrimaryKey(Integer id); int insert(Dict record); int insertSelective(Dict record); List<Dict> selectByExample(DictExample example); Dict selectByPrimaryKey(Integer id); int updateByExampleSelective(@Param("record") Dict record, @Param("example") DictExample example); int updateByExample(@Param("record") Dict record, @Param("example") DictExample example); int updateByPrimaryKeySelective(Dict record); int updateByPrimaryKey(Dict record); }
69b7afb4b4b6f5d5693efc3810851445ac07cd6f
949bfdb25752857abe8e919915d305b1bc936d44
/haox-kerb/kerb-client/src/main/java/org/apache/kerberos/kerb/client/preauth/token/TokenContext.java
cb3f3d4190f1b441223ec6d749d5ebd0e31f6a95
[ "Apache-2.0" ]
permissive
deepika087/haox
91293c8917629f860b7af4981b937d76131cf6a4
a8d6b62142e169d23d0c308ce2728e614d3258c1
refs/heads/master
2021-07-20T21:13:13.873458
2017-10-28T23:34:30
2017-10-28T23:34:30
108,691,180
0
0
null
2017-10-28T23:21:36
2017-10-28T23:21:36
null
UTF-8
Java
false
false
196
java
package org.apache.kerberos.kerb.client.preauth.token; import org.haox.token.KerbToken; public class TokenContext { public boolean usingIdToken = true; public KerbToken token = null; }
3aa8656bb732d1f2e706f581536f8341b9992db5
7830ee06fa8e81c2c95f47a30766cc7a07324843
/ProjectFIFA/src/selenium/testpackage/RightClickDemo.java
e5775e7facaa97b23775cec87cd34935f6f45ac8
[]
no_license
naveenshivapuji/ProjectFIFA
f7160594d8ddefb302e3441d3602113f4d15e380
f9b9f58ab97b92f395203dd94f3855d99f6815e7
refs/heads/master
2020-03-27T03:33:04.719955
2018-08-23T15:18:46
2018-08-23T15:18:46
145,871,103
0
0
null
null
null
null
UTF-8
Java
false
false
674
java
package selenium.testpackage; import java.awt.AWTException; import java.awt.Robot; import java.awt.event.KeyEvent; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; public class RightClickDemo extends BaseClass { public static void main(String[] args) throws AWTException { driver.get("http://localhost:8080/login.do"); WebElement actiTIMEInc = driver.findElement(By.linkText("actiTIME Inc.")); Actions action = new Actions(driver); action.contextClick(actiTIMEInc).perform(); Robot r = new Robot(); r.keyPress(KeyEvent.VK_W); driver.close(); driver.quit(); } }
e66094401328ce283a056575603002feb347f195
badea8681853b9acaa6439e969362e8f6ed7f0aa
/src/main/java/com/example/base/to/BaseTO.java
89aa30f97deaa048f0039e7d6bb20a6ec9c66051
[]
no_license
gyu-bin/Mybatis
3215e1721be63e19d5edee5ecab6bc159f98470f
46572425e350c1a345f3b0367213ce576832ef43
refs/heads/master
2023-07-03T03:57:33.781808
2021-08-05T11:52:00
2021-08-05T11:52:00
393,016,630
0
0
null
null
null
null
UTF-8
Java
false
false
151
java
package com.example.base.to; import lombok.Getter; import lombok.Setter; @Setter @Getter public class BaseTO { protected String status = "NORMAL"; }
5a2f0593b02b6d2c91953a94e1f24e6e1d4bc2c5
562689f6b88951b0b0c929256070fc39c4eddce3
/mobile/src/main/java/com/zkjinshi/superservice/test/JWTTest.java
86ca886afaef448b66ee3dcdd49ad040245550bd
[]
no_license
zkjs/SuperService-Android
0fb54c87f623bf07bd07b2b31538175d44982b53
d10529bf9532241b97e4f458d08501645818f08b
refs/heads/master
2021-01-19T17:36:40.355715
2016-09-07T02:52:47
2016-09-07T02:52:47
42,839,092
0
0
null
null
null
null
UTF-8
Java
false
false
897
java
package com.zkjinshi.superservice.test; import android.test.AndroidTestCase; import android.util.Log; import android.widget.Toast; import com.zkjinshi.base.util.Constants; import com.zkjinshi.base.util.DialogUtil; import com.zkjinshi.superservice.utils.AESUtil; import java.security.GeneralSecurityException; /** * 开发者:JimmyZhang * 日期:2016/2/26 * Copyright (C) 2016 深圳中科金石科技有限公司 * 版权所有 */ public class JWTTest extends AndroidTestCase { public void testJWT(){ Log.i("info","JWT"); try { String mobile = "15815507102"; String encryptData = AESUtil.encrypt(mobile,AESUtil.PAVO_KEY); //nrEqYHd3Px7JmFbcI2Aiig== Log.i(Constants.ZKJINSHI_BASE_TAG,"encryptData:"+encryptData); } catch (GeneralSecurityException e) { e.printStackTrace(); } } }
a024e6bdb508b1c0e16b948b8af6902fc8feedff
cfcfd5ff13a102148c56cd050d93e6cc04000bea
/src/test/java/khlh/pipipou/FirstTest.java
d6b9168bd271eabf024d39002749021a61ad8257
[]
no_license
codification/pipipou
990e14b196cc72c409b30311c5968cad35db186a
1b0e252336daa86b88c19159b9c213babb570c9c
refs/heads/master
2021-09-06T07:02:45.022026
2018-02-03T14:16:33
2018-02-03T14:16:33
120,096,925
0
0
null
null
null
null
UTF-8
Java
false
false
401
java
package khlh.pipipou; import org.junit.jupiter.api.Assertions; public class FirstTest extends FuncTest { {{ describe("A test", () -> { Assertions.assertTrue(() -> true); }); describe("Another test", () -> { Assertions.assertAll( () -> {}, () -> {} ); }); }} }
04a4fdc39f72606906916bed964d047770e3a0cd
78a448b1e43d302d24dc9d096eb98c3d10b485b9
/java/flight/src/test/java/org/apache/arrow/flight/example/TestExampleServer.java
0f971209a763d69dd3b09cc149dcf0f332fb0e29
[ "Apache-2.0", "CC0-1.0", "MIT", "BSD-3-Clause", "BSL-1.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause" ]
permissive
rikima/arrow
e5c6df60dbaec928dba6b55d4227068e99d1b495
54634dd6745dccad393c1461f11a787047dbc41a
refs/heads/master
2020-03-26T19:35:07.321874
2018-10-13T21:41:45
2018-10-13T21:41:45
145,273,327
0
0
Apache-2.0
2018-08-19T04:36:56
2018-08-19T04:36:55
null
UTF-8
Java
false
false
3,447
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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.arrow.flight.example; import java.io.IOException; import org.apache.arrow.flight.FlightClient; import org.apache.arrow.flight.FlightClient.ClientStreamListener; import org.apache.arrow.flight.FlightDescriptor; import org.apache.arrow.flight.FlightInfo; import org.apache.arrow.flight.FlightStream; import org.apache.arrow.flight.Location; import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.util.AutoCloseables; import org.apache.arrow.vector.IntVector; import org.apache.arrow.vector.VectorSchemaRoot; import org.junit.After; import org.junit.Before; import org.junit.Test; /** * Ensure that example server supports get and put. */ @org.junit.Ignore public class TestExampleServer { private BufferAllocator allocator; private BufferAllocator caseAllocator; private ExampleFlightServer server; private FlightClient client; @Before public void start() throws IOException { allocator = new RootAllocator(Long.MAX_VALUE); Location l = new Location("localhost", 12233); if (!Boolean.getBoolean("disableServer")) { System.out.println("Starting server."); server = new ExampleFlightServer(allocator, l); server.start(); } else { System.out.println("Skipping server startup."); } client = new FlightClient(allocator, l); caseAllocator = allocator.newChildAllocator("test-case", 0, Long.MAX_VALUE); } @After public void after() throws Exception { AutoCloseables.close(server, client, caseAllocator, allocator); } @Test public void putStream() throws Exception { BufferAllocator a = caseAllocator; final int size = 10; IntVector iv = new IntVector("c1", a); VectorSchemaRoot root = VectorSchemaRoot.of(iv); ClientStreamListener listener = client.startPut(FlightDescriptor.path("hello"), root); //batch 1 root.allocateNew(); for (int i = 0; i < size; i++) { iv.set(i, i); } iv.setValueCount(size); root.setRowCount(size); listener.putNext(); // batch 2 root.allocateNew(); for (int i = 0; i < size; i++) { iv.set(i, i + size); } iv.setValueCount(size); root.setRowCount(size); listener.putNext(); root.clear(); listener.completed(); // wait for ack to avoid memory leaks. listener.getResult(); FlightInfo info = client.getInfo(FlightDescriptor.path("hello")); FlightStream stream = client.getStream(info.getEndpoints().get(0).getTicket()); VectorSchemaRoot newRoot = stream.getRoot(); while (stream.next()) { newRoot.clear(); } } }
d37aebc689e7fbeffb0a6e3246d0dd0c32abc8bf
bf7c4e613f4dcac6a09863fa33cb9027879eb3b2
/old-projects/JAVABasico/src/AppsBasicos/TestArray01.java
fd5719e837cb78bfbb4f951d9a1ec3f5bcea5819
[]
no_license
Arix2019/myJavaRepo
64bf0de191994c2ccbed10ef67f9ff71972a0198
a8deaad30560d1cb22bfffd3d86c847af6d3a3cb
refs/heads/master
2020-06-03T12:56:04.211238
2019-06-12T13:26:31
2019-06-12T13:26:31
191,575,474
0
0
null
null
null
null
UTF-8
Java
false
false
537
java
package AppsBasicos; import java.util.ArrayList; /** * * @author Arix */ public class TestArray01 { private static boolean Object; public static void main(String[] args){ ArrayList <String> nomes = new ArrayList <String> (); //String result; nomes.add("Patinha"); nomes.add("Bartô"); nomes.add("Mel"); nomes.add("Grande"); nomes.add("Branco"); for (String result:nomes) { System.out.println(result); } } }
77d62bb250b2427d8e304d9484afd55bda60df44
11562714c5f8e63ecf2e6c66a740fa933d5dde94
/app/src/main/java/com/bwie/MoNiJingDong/adapter/MutilAdapter.java
1b39dda11d199f9754d5982d4c9d97b1c660298b
[]
no_license
HaoRongJi/Suprise
76eeb1c416b38696cd71c6c53b3cd997e6b3df6b
540548ca0ceb744b18af2fbc7a05d6e796309699
refs/heads/master
2020-03-28T07:36:52.242318
2018-09-21T03:20:24
2018-09-21T03:20:24
147,913,072
0
0
null
null
null
null
UTF-8
Java
false
false
2,686
java
package com.bwie.MoNiJingDong.adapter; import android.support.v4.view.ViewPager; import android.view.View; import android.view.ViewGroup; import android.widget.GridView; import com.bwie.MoNiJingDong.R; import com.bwie.MoNiJingDong.entity.ClassesEntity; import com.chad.library.adapter.base.BaseMultiItemQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; import java.util.ArrayList; import java.util.List; public class MutilAdapter extends BaseMultiItemQuickAdapter<ClassesEntity,BaseViewHolder> { private int totalPage; private int mPageSize = 8; private ArrayList<View> viewPagerList; public MutilAdapter(List<ClassesEntity> data) { super(data); addItemType(ClassesEntity.ClASSES_TYPE, R.layout.product_item_layout); addItemType(ClassesEntity.SHOWLIST_TYPT, R.layout.classes_layout); } @Override protected void convert(BaseViewHolder helper, ClassesEntity item) { switch (helper.getItemViewType()){ case ClassesEntity.ClASSES_TYPE: break; case ClassesEntity.SHOWLIST_TYPT: /*totalPage = (int) Math.ceil(homeBean.getData().getFenlei().size() * 1.0 / mPageSize); viewPagerList = new ArrayList<>(); for(int i=0;i<totalPage;i++){ //每个页面都是inflate出一个新实例 View classes = getLayoutInflater().inflate(R.layout.classes_layout, (ViewGroup) recyclerView.getParent(), false); classes.findViewById(R.id.) classes. GridView gridView = (GridView) inflater.inflate(R.layout.home_viewpager_grid,((TextHolder2) holder).home_viewPager,false); gridView.setAdapter(new MyGridViewAdapter(context,i,mPageSize,data.getFenlei())); viewPagerList.add(gridView); } ((TextHolder2) holder).home_viewPager.setAdapter(new MyViewPagerAdapter(viewPagerList)); ((TextHolder2) holder).home_viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { currentPage = position; } @Override public void onPageScrollStateChanged(int state) { } });*/ break; default: break; } } }
27e98ce129c0c7ad87d6077a41c2a4245af0d045
2d7702312f32a11724e565bde59b85f29b531ee6
/app/src/test/java/com/asquarestudios/makeitrain/ExampleUnitTest.java
59b3ab97128032a66be1441174527b27802a4e70
[]
no_license
AdityaArunSharma/MakeItRain
30663e67ac81f574bf051687d6f8e05236cba917
2846a49084550b7b4807eaf850c746b0203d3a56
refs/heads/master
2021-04-21T16:23:24.243422
2020-08-18T13:27:57
2020-08-18T13:27:57
249,795,876
1
0
null
null
null
null
UTF-8
Java
false
false
390
java
package com.asquarestudios.makeitrain; 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); } }
c1e955ec39dbd5e008ebce44bb29d7a81c7be890
30186b69785f897adfcd049ff9b20ff57d95d1c0
/study/src/main/java/com/chinamall21/mobile/study/bean/TestBean.java
8344c824e69830fcd1de9fc2b4c4d86f551598de
[]
no_license
msdgwzhy6/recycleview-study
b02358685809aba353666d2294514de8724f86a5
6f681fb5168164e92a135536388feb14f0fedc3d
refs/heads/master
2020-04-25T03:53:33.238259
2019-01-28T10:50:46
2019-01-28T10:50:46
172,492,054
1
0
null
2019-02-25T11:18:53
2019-02-25T11:18:53
null
UTF-8
Java
false
false
648
java
package com.chinamall21.mobile.study.bean; /** * desc: * author:Created by xusong on 2018/10/15 18:05. */ public class TestBean { private String title; private int status; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } @Override public String toString() { return "TestBean{" + "title='" + title + '\'' + ", status=" + status + '}'; } }
1ef214d16bc5d6c485694ed44c488004f53c1825
86d6364080c613d3360a7115f7e191d62a27164f
/JavaApplication3/src/retopokemon/Pokemon.java
54da50c06d2acde966bb894704e56e871daf8475
[]
no_license
pauanoic/proyecto-pokemon
963f645c3e97594e0592671201040ce187c3325e
23c93e0a9100d8d2646fdf70db25a39798f3a6d2
refs/heads/master
2020-03-21T23:20:31.544885
2018-07-05T18:12:10
2018-07-05T18:12:10
138,924,473
0
0
null
null
null
null
UTF-8
Java
false
false
31,660
java
/* * Clase para modelar un Pokemon */ package retopokemon; /** * * @author hca */ public class Pokemon { private String nombre; private char tipo; private String especie; private int valorDeAtaque; private int valorDeDefensa; private int numeroDeAtaques; private static int folio=000; private int clave; private String evolucion1; private String evolucion2; //Constructor public Pokemon(String unNombre, char unTipo, String unaEspecie, int unValorDeAtaque, int unValorDeDefensa, int unNumeroDeAtaques, String unaEvolucion1, String unaEvolucion2){ folio++; clave=folio; nombre=unNombre; tipo=unTipo; especie=unaEspecie; valorDeAtaque=unValorDeAtaque; valorDeDefensa=unValorDeDefensa; numeroDeAtaques=unNumeroDeAtaques; evolucion1=unaEvolucion1; evolucion2=unaEvolucion2; System.out.println("------------- \nA wild " + this.nombre.toUpperCase() + " has appeared!\n----------------------\n"); } //get´s y set´s public String getNombre(){ return nombre; } public char getTipo(){ return tipo; } public String getEspecie(){ return especie; } public int getvalorDeAtaque(){ return valorDeAtaque; } public int getvalorDeDefensa(){ return valorDeDefensa; } public int getNumeroDeAtaques(){ return numeroDeAtaques; } public int getClave(){ return clave; } public String getEvolucion1(){ return evolucion1; } public String getEvolucion2(){ return evolucion2; } public void setNumeroDeAtaques(int otroNumeroDeAtaques){ numeroDeAtaques=otroNumeroDeAtaques; } public void setValorDeAtaque(int valorDeAtaque) { this.valorDeAtaque = valorDeAtaque; } public void setValorDeDefensa(int valorDeDefensa) { this.valorDeDefensa = valorDeDefensa; } public void setNombre(String nombre) { this.nombre = nombre; } public void setEspecie(String especie) { this.especie = especie; } //EQUALS public boolean equals(Pokemon otro){ boolean resp; if(clave==otro.getClave()) resp=true; else resp=false; return resp; } //COMPARE TO public int compareTo(Pokemon otro){ int resp; if(clave==otro.getClave()) resp=0; else if(clave<otro.getClave()) resp=-1; else resp=1; return resp; } //TO STRING public String toString(){ StringBuilder sb; sb=new StringBuilder(); sb.append(" Pokemon \n"); sb.append("Nombre: "+nombre+" \n"); sb.append("Tipo: "+tipo+" \n"); sb.append("especie: "+especie+" \n"); sb.append("Ataque: "+valorDeAtaque+" \n"); sb.append("Defensa: "+valorDeDefensa+" \n"); sb.append("#Ataques: "+numeroDeAtaques+" \n"); sb.append("Clave: "+clave+" \n"); return sb.toString(); } public String imagen(){ StringBuilder sb; sb=new StringBuilder(); if(nombre.equals("Charmander")) sb.append(" _.--\"\"`-..\n"+ " ,' `.\n" + " ,' __ `.\n" + " /| \" __ \\\n" + " , | / |. .\n" + " |,' !_.'| |\n" + " ,' ' | |\n" + " / |`--'| |\n" + " | `---' |\n" + " . , | ,\".\n" + " ._ ' _' | , ' \\ `\n" + " `.. `.`-...___,...---\"\" | __,. ,`\" L,|\n" + " |, `- .`._ _,-,.' . __.-'-. / . , \\\n" + "-:.. `. `-..--_.,.< `\" / `. `-/ | .\n" + " `, \"\"\"\"' `. ,' | | ',,\n" + " `. ' ' / ' |'. |/\n" + " `. | \\ _,-' | ''\n" + " `._' \\ '\"\\ . |\n" + " | ' \\ `._ ,'\n" + " | ' \\ .'|\n" + " | . \\ | |\n" + " | | L ,' |\n" + " ` | | / '\n" + " \\ | | ,' /\n" + " ,' \\ | _.._ ,-..___,..-' ,'\n" + " / . . `! ,j'\n" + " / `. / . .'/\n" + " . `. / | _.'.'\n" + " `. 7`'---' |------\"'_.'\n" + " _,.`,_ _' ,''-----\"'\n" + " _,-_ ' `. .' ,\\\n" + " -\" /`. _,' | _ _ _.|\n" + " \"\"--'---\"\"\"\"\"' `' '! |! /\n" + " `\" \" -' "); else if(nombre.equals("Bulbasour")) sb.append(" /\n" + " _,.------....___,.' ',.-.\n" + " ,-' _,.--\" |\n" + " ,' _.-' .\n" + " / , ,' `\n" + " . / / ``.\n" + " | | . \\.\\\n" + " ____ |___._. | __ \\ `.\n" + " .' `---\"\" ``\"-.--\"'` \\ . \\\n" + " . , __ ` | .\n" + " `,' ,-\"' . \\ | L\n" + " ,' ' _.' -._ / |\n" + " ,`-. ,\". `--' >. ,' |\n" + " . .'\\' `-' __ , ,-. / `.__.- ,'\n" + " ||:, . ,' ; / / \\ ` `. . .'/\n" + " j|:D \\ `--' ' ,'_ . . `.__, \\ , /\n" + "/ L:_ | . \"' :_; `.'.'\n" + ". \"\"' \"\"\"\"\"' V\n" + " `. . `. _,.. `\n" + " `,_ . . _,-'/ .. `,' __ `\n" + " ) \\`._ ___....----\"' ,' .' \\ | ' \\ .\n" + " / `. \"`-.--\"' _,' ,' `---' | `./ |\n" + " . _ `\"\"'--.._____..--\" , ' |\n" + " | .\" `. `-. /-. / ,\n" + " | `._.' `,_ ; / ,' .\n" + " .' /| `-. . ,' , ,\n" + " '-.__ __ _,',' '`-..___;-...__ ,.'\\ ____.___.'\n" + " `\"^--'..' '-`-^-'\"-- `-^-'`.''\"\"\"\"\"`.,^.`.--' "); else if(nombre.equals("Squirtle")) sb.append(" ,........__\n" + " ,-' \"`-.\n" + " ,' `-.\n" + " ,' \\\n" + " ,' .\n" + " .'\\ ,\"\". `\n" + " ._.'| / | ` \\\n" + " | | `-.' || `.\n" + " | | '-._,'|| | \\\n" + " .`.,' `..,'.' , |`-.\n" + " l .'`. _/ | `.\n" + " `-.._'- , _ _' -\" \\ . `\n" + "`.\"\"\"\"\"'-.`-...,---------',' `. `....__.\n" + ".' `\"-..___ __,'\\ \\ \\ \\\n" + "\\_ . | `\"\"\"\"' `. . \\ \\\n" + " `. | `. | . L\n" + " `. |`--...________.'. j | |\n" + " `._ .' | `. .| , |\n" + " `--,\\ . `7\"\"' | , |\n" + " ` ` ` / | | | _,-'\"\"\"`-.\n" + " \\ `. . / | ' | ,' `.\n" + " \\ v.__ . ' . \\ /| / \\\n" + " \\/ `\"\"\\\"\"\"\"\"\"\"`. \\ \\ /.'' |\n" + " ` . `._ ___,j. `/ .- ,---. |\n" + " ,`-. \\ .\" `. |/ j ` |\n" + " / `. \\ / \\ / | / j\n" + " | `-. 7-.._ . |\" ' /\n" + " | `./_ `| | . _,'\n" + " `. / `----| |-............`---'\n" + " \\ \\ | |\n" + " ,' ) `. |\n" + " 7____,,..--' / |\n" + " `---.__,--.'"); else if(nombre.equals("Wartortle")) sb.append(" __ _.--'\"7\n" + " `. `--._ ,-'_,- ,'\n" + " ,' `-.`-. /' .' ,|\n" + " `. `. `- __...___ / / - j\n" + " `. ` `.-\"\" \" . / /\n" + " \\ / ` / /\n" + " \\ / ,'\n" + " '._'_ ,-' |\n" + " | \\ ,| | ...-'\n" + " || ` ,|_| | | ` _..__\n" + " /|| | | | | | \\ _,_ .-\" `-.\n" + " | '.-' |_|_,' __! | /| | / \\\n" + " ,-...___ .= ._..' /`.| ,`,. _,.._ |\n" + " | |,.. \\ ' `' ____, ,' `--',' | / |\n" + " ,`-..' _) .`-..___,---'_...._/ .' '-...' | /\n" + "'.__' \"\"' `.,------'\"' ,/ , `.._.' `.\n" + " `. | `--........,-'. . \\ \\\n" + " `-. . '.,--\"\" | ,'\\ | .\n" + " `. / | L ,\\ . | .,---.\n" + " `._ ' | \\ / . L | / __ `.\n" + " `-. | `._ , l . j | ' `. .\n" + " | | `\"' | . | / ' .' |\n" + " | | j | | / , `.__,' |\n" + " `. L _. ` j ,'-' |\n" + " |`\"---..\\._______,...,--' | | /|' / j\n" + " ' | | . / | ' /\n" + " . . ____L \\' j -', /\n" + " / `. . _,\" \\ | / ,-',' ,'\n" + " / `. ,'`-._ / \\ i'.,'_,' .'\n" + " . `. `-..' |_,-' _.'\n" + " | `._ | ''/ _,-'\n" + " | '-..._\\ `__,.--'\n" + " ,' ,' `-.._`. .\n" + " `. __ | \"'`. |\n" + " `-\"' `\"\"\"\"' 7 `.\n" + " `---'--.,'\"`' "); else if(nombre.equals("Blastoise")) sb.append(" _\n" + " _,..-\"\"\"--' `,.-\".\n" + " ,' __.. --', |\n" + " _/ _.-\"' | .' | | ____\n" + " ,.-\"\"' `-\"+.._| `.' | `-..,',--.`.\n" + " | ,. ' j 7 l \\__\n" + " |.-' /| | j|| .\n" + " `. | / L`.`\"\"','|\\ \\\n" + " `.,----..._ ,'`\"'-. ,' \\ `\"\"' | | l\n" + " Y `-----' v' ,'`,.__..' | .\n" + " `. / / / `.| |\n" + " `. / l j ,^. |L\n" + " `._ L +. |._ .' \\| | \\\n" + " .`--...__,..-'\"\"'-._ l L \"\"\" | | \\\n" + " .' ,`-......L_ \\ \\ \\ _.' ,'. l\n" + " ,-\"`. / ,-.---.' `. \\ L..--\"' _.-^.| l\n" + " .-\"\".'\"`. Y `._' ' `. | | _,.--'\" | |\n" + " `._' | |,-'| l `. | |\".. | l\n" + " ,'. | |`._' | `. | |_,...---\"\"\"\"\"` L\n" + " / | j _|-' `. L | j ,| | |\n" + "`--,\"._,-+' /`---^..../._____,.L',' `. |\\ |\n" + " |,' L | `-. | \\j\n" + " . \\ `, | |\n" + " \\ __`.Y._ -. j |\n" + " \\ _.,' `._ \\ | j\n" + " ,-\"`-----\"\"\"\"' |`. \\ 7 |\n" + " / `. ' | \\ \\ / |\n" + " | ` / | \\ Y |\n" + " | \\ . ,' | L_.-')\n" + " L `. | / ] _.-^._\n" + " \\ ,' `-7 ,-' / | ,' `-._\n" + " _,`._ `. _,-' ,',^.- `.\n" + " ,-' v.... _.`\"', _:'--....._______,.-'\n" + " ._______./ /',,-'\"'`'--. ,-' `.\n" + " \"\"\"\"\"`.,' _\\`----...'"); else if(nombre.equals("Charmeleon")) sb.append(" ,-'`\\\n" + " _,\"' j\n" + " __....+ / .\n" + " ,-'\" / ; `-._.'.\n" + " / ( ,' .'\n" + " | _. \\ \\ ---._ `-.\n" + " ,| , _.' Y \\ `- ,' \\ `.`.\n" + " l' \\ ,'._,\\ `. . / ,--. l\n" + " .,- `._ | | | \\ _ l .\n" + " / `\"--' / .' ``. | )\n" + ".\\ , | . \\ `. '\n" + "`. . | '._ __ ;. \\'\n" + " `-..--------...' \\ `' `-\"'. \\\n" + " `......___ `._ | \\\n" + " /` `.. | .\n" + " /| `-. | L\n" + " / | \\ `._ . |\n" + " ,' |,-\"-. . . `. / |\n" + " ,' | ' \\ | `. / |\n" + " ,' /| \\ . | . / |\n" + " ,' / | \\ . + \\ ,' .'\n" + " . . | \\ | \\ \\_,' / j\n" + " | | L `| . ` ,' '\n" + " | _. | \\ / | . .' ,'\n" + " | / `| \\ . | / | ,' .'\n" + " | ,-..\\ -. , | / |,.' ,'\n" + " `. |___,` / `. /`. ' | .'\n" + " '-`-' j ` /.\"7-..../| ,`-'\n" + " | .' / _/_| .\n" + " `, `\"'/\"' \\ `.\n" + " `, '. `. |\n" + " __,.-' `. \\' |\n" + " /_,-'\\ ,' | _.\n" + " |___.---. ,-' .-':,-\"`\\,' .\n" + " L,.--\"' '-' | ,' `-.\\\n" + " `.' "); else if(nombre.equals("Charizard")) sb.append(" .\"-,.__\n" + " `. `. ,\n" + " .--' .._,'\"-' `.\n" + " . .' `'\n" + " `. / ,'\n" + " ` '--. ,-\"'\n" + " `\"` | \\\n" + " -. \\, |\n" + " `--Y.' ___.\n" + " \\ L._, \\\n" + " _., `. < <\\ _\n" + " ,' ' `, `. | \\ ( `\n" + " ../, `. ` | .\\`. \\ \\_\n" + " ,' ,.. . _.,' ||\\l ) '\".\n" + " , ,' \\ ,'.-.`-._,' | . _._`.\n" + " ,' / \\ \\ `' ' `--/ | \\ / / ..\\\n" + " .' / \\ . |\\__ - _ ,'` ` / / `.`.\n" + " | ' .. `-...-\" | `-' / / . `.\n" + " | / |L__ | | / / `. `.\n" + " , / . . | | / / ` `\n" + " / / ,. ,`._ `-_ | | _ ,-' / ` \\\n" + " / . \\\"`_/. `-_ \\_,. ,' +-' `-' _, ..,-. \\`.\n" + ". ' .-f ,' ` '. \\__.---' _ .' ' \\ \\\n" + "' / `.' l .' / \\.. ,_|/ `. ,'` L`\n" + "|' _.-\"\"` `. \\ _,' ` \\ `.___`.'\"`-. , | | | \\\n" + "|| ,' `. `. ' _,...._ ` | `/ ' | ' .|\n" + "|| ,' `. ;.,.---' ,' `. `.. `-' .-' /_ .' ;_ ||\n" + "|| ' V / / ` | ` ,' ,' '. ! `. ||\n" + "||/ _,-------7 ' . | `-' l / `||\n" + ". | ,' .- ,' || | .-. `. .' ||\n" + " `' ,' `\".' | | `. '. -.' `'\n" + " / ,' | |,' \\-.._,.'/'\n" + " . / . . \\ .''\n" + " .`. | `. / :_,'.'\n" + " \\ `...\\ _ ,'-. .' /_.-'\n" + " `-.__ `, `' . _.>----''. _ __ /\n" + " .' /\"' | \"' '_\n" + " /_|.-'\\ ,\". '.'`__'-( \\\n" + " / ,\"'\"\\,' `/ `-.|\""); else if(nombre.equals("Ivysaur")) sb.append(" ,'\"`.,./.\n" + " ,' Y',\"..\n" + " ,' \\ | \\\n" + " / . | `\n" + " / | | \\\n" + " __ . | | .\n" + " _ \\ `. ---. | | j |\n" + " / `-._\\ `Y \\ | |. |\n" + " _`. `` \\ \\ |.. ' |,-'\"\"7,....\n" + " l '-. . , `| | , |`. , , /, ,' '/ ,'_,.-.\n" + " `-.. `-. : : |/ ` ' \"\\,' | _ / '-' /___\n" + " \\\"\"' __.,.-`.: : / /._ l'.,'\n" + " `--, _.-' `\". /__ `'-.' ' .\n" + " ,---..._,.--\"\"\"\"\"\"\"--.__..----,-.' . / .' ,.--\n" + " | ,':| / | / ;.,-'-- ,.-\n" + " | .---. .' :|' |/ ,.-='\"-.`\"`' _ -.'\n" + " / \\ / `. :|--. _L,\"---.._ \"----'\n" + " ,' `. \\ ,' _, `'' ``.-' `- -..___,'\n" + " . ,. . ` __ .-' _.- `. .__ \\\n" + " |. |` \" ; ! ,. | `. `.`'---'\n" + " ,| |C\\ ` / | ,' |(]| -. |-..--`\n" + " / \"'--' ' /___|__] `. `- |`.\n" + " . ,' , / . `. \\\n" + " \\ .,-' ,' . `-.\n" + " x---..`. -' __..--'\"/\"\"\"\"\" ,-. | | |\n" + " / \\--._'-.,.--' _`- _. ' / | -.|\n" + " , . `-..__ ...--' _,.-' | ` ,.-. ; / '|\n" + " . _,' '\"-----\"\" | ` | / ,' ;\n" + " |-' .-. `._ | `._// ,' /\n" + " _| `-' _,' \"`--.._________| `,' _ /.\n" + "//\\ ,-._.'\"/\\__,. _,\" /_\\__/`. /'.-.'.-/_,`-' mh\n" + "`-\"`\"' v' `\" `-`-\" `-'`-` `'"); else if(nombre.equals("Venusaur")) sb.append(" _._ _,._\n" + " _.' `. ' .' _`.\n" + " ,\"\"\"/`\"\"-.-.,/. ` V'\\-,`.,--/\"\"\".\"-..\n" + " ,' `...,' . ,\\-----._| `. / \\\n" + " `. .` -'`\"\" .._ :> `-' `.\n" + " ,' ,-. _,.-'| `..___ ,' |'-..__ .._ L\n" + " . \\_ -' `-' .. `.-' `.`-.'_ .|\n" + " | ,',-,--.. ,--../ `. .-. , `-. ``.\n" + " `.,' , | | `. /'/,,.\\/ | \\| |\n" + " ` `---' `j . \\ . ' j\n" + " ,__`\" ,'|`'\\_/`.'\\' |\\-'-, _,.\n" + " .--...`-. `-`. / '- .. _, /\\ ,' .--\"' ,'\".\n" + " _'-\"\"- -- _`'-.../ __ '.'`-^,_`-\"\"\"\"---....__ ' _,-`\n" + " _.----` _..--.' | \"`-..-\" __|'\"' .\"\"-. \"\"'--.._\n" + " / ' / , _.+-.' ||._' \"\"\"\". . ` .__\\\n" + " `--- / / / j' _/|..` -. `-`\\ \\ \\ \\ `. \\ `-..\n" + ",\" _.-' / /` ./ /`_|_,-\" ','| `. | -'`._, L \\ . `. |\n" + "`\"' / / / ,__...-----| _., ,' `|----.._`-.|' |. .` .. .\n" + " / '| /.,/ \\--.._ `-,' , . '`.' __,., ' ''``._ \\ \\`,'\n" + " /_,'--- , \\`._,-` \\ // / . \\ `._, -`, / / _ | `-L -\n" + " / `. , ..._ ' `_/ '| |\\ `._' '-.' `.,' |\n" + " ' / / .. `. `./ | ; `.' ,\"\" ,. `. \\ |\n" + " `. ,' ,' | |\\ | \" | ,'\\ | \\ ` ,L\n" + " /|`. / ' | `-| ' /`-' | L `._/ \\\n" + " / | .`| | . `._.' `.__,' . | | (`\n" + " '-\"\"-'_| `. `.__,._____ . _, ____ ,- j \".-'\"'\n" + " \\ `-. \\/. `\"--.._ _,.---'\"\"\\/ \"_,.' /-'\n" + " ) `-._ '-. `--\" _.-'.-\"\" `.\n" + " ./ `,. `\".._________...\"\"_.-\"`. _j\n" + " /_\\.__,\"\". ,.' \"`-...________.---\" .\". ,. / \\\n" + " \\_/\"\"\"-' `-'--(_,`\"`-` mh"); return sb.toString(); } }
5e7d5bbdd58ea0ec373865c73dd3d51bcf8d8ce0
7636e33a07a38002296475be03bf02ccb4ee3ceb
/v17-web/v17-sso/src/test/java/com/hgz/v17sso/V17SsoApplicationTests.java
35363783fdd0f91fb4f67802c16bc303277279da
[]
no_license
DialogD/v17
3777b220acbe875a9dd19df8c2ac2f84901cfc93
edd86444dc4595e7fdea2b0adc9ca7d08431286a
refs/heads/master
2023-03-03T19:37:06.118354
2021-02-20T09:02:06
2021-02-20T09:06:29
340,552,708
0
0
null
null
null
null
UTF-8
Java
false
false
269
java
package com.hgz.v17sso; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @SpringBootTest @RunWith(SpringRunner.class) public class V17SsoApplicationTests { }
3915298fd779de7107de123f97225dc7e2dbfc48
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_7444ab7fab5f0a8ec33a7c6b4730d3274acfe6b2/DebugInfo/2_7444ab7fab5f0a8ec33a7c6b4730d3274acfe6b2_DebugInfo_t.java
c6047e0af3f0427be5c9db97d6e431394e322f6d
[]
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
580
java
package edu.wpi.first.wpilibj.templates.debugging; /** * This is an abstract DebugInfo class, use various other classes in the * debugging package if you want to create one of these. * * @author daboross */ public abstract class DebugInfo extends DebugOutput { protected abstract String key(); protected abstract String message(); protected abstract boolean isConsole(); protected abstract boolean isDashboard(); protected abstract int debugLevel(); protected void debug() { RobotDebugger.pushInfo(this); } }
868536b662b737a8641a1a632e01dbeaf5eb84f6
df12e209dc6126cf95b8a25fa1d4b37a8fb63fe5
/bom/src/main/java/org/dbp/bom/contabilidad/enums/TipoMovimientoContable.java
f9237370695d79e699bb1072f2ce01216a7a60f1
[]
no_license
blancoparis-tfc/tfcContabilidad
e3335ef7da3ad9ba5269094dabdca358e899db9d
f62bcac6681d75d367e4508d6ed7ab0e6fac3e54
refs/heads/master
2021-01-21T04:42:30.176675
2016-07-06T18:04:28
2016-07-06T18:04:28
52,206,958
0
0
null
null
null
null
UTF-8
Java
false
false
85
java
package org.dbp.bom.contabilidad.enums; public enum TipoMovimientoContable { H,D }
5a4cc0b41ce9d02dd1d82ed89ed39b816ffc9f86
9e4e2ac952231ab0cbf00fbb00621e9233af14b4
/multiplayer/ghost-in-the-cell/src/main/java/org/ndx/codingame/ghostinthecell/actions/Message.java
2ce09781a226434bd26eaab793a9c32ec4795ed8
[]
no_license
Riduidel/codingame
2c438a87882f6255ea68d9754ddc2750f275b2c3
d52e3e8c4aa231f1834d3cfd71c83e1b3a1a741c
refs/heads/master
2023-06-11T06:25:23.103385
2023-05-30T18:48:25
2023-05-30T18:48:25
69,814,150
3
3
null
null
null
null
UTF-8
Java
false
false
422
java
package org.ndx.codingame.ghostinthecell.actions; import org.ndx.codingame.gaming.actions.Action; public class Message implements Action { private final int enemy; private final int my; public Message(final int myProduction, final int enemyProduction) { my = myProduction; enemy = enemyProduction; } @Override public String toCommandString() { return String.format("MSG my %d/enemy %d", my, enemy); } }
7184a8dfd2d053877535490b771eca4727719ad5
a81a4a3d513591793cfe3083e4fa9f7d007a622d
/src/main/java/com/huole/music/dao/CollectMapper.java
e8bbb0dbadc0bfa5a92080f715294fe4d5157514
[]
no_license
HuoLe0/music-server
939ecc5f261aa74dcecb5d5c0edb62959965f2c7
960dabde1fa3eb221ee65ec0905988b7cb6241ee
refs/heads/master
2023-08-19T03:55:34.121604
2021-09-30T08:44:23
2021-09-30T08:44:23
322,466,669
0
0
null
null
null
null
UTF-8
Java
false
false
935
java
package com.huole.music.dao; import com.huole.music.model.Collect; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; /** * 收藏Dao */ @Repository public interface CollectMapper { /** * 增加 */ public int insert(Collect collect); /** * 修改 */ public int update(Collect collect); /** * 删除 */ public int delete(Integer id); public int deleteByUserIdSongId(@Param("userId") Integer userId, @Param("songId") Integer songId); /** * 查询所有收藏 */ public List<Collect> selectAll(); /** * 查询某个用户下的所有收藏 */ public List<Collect> selectByUserId(Integer userId); /** * 查询某个用户下的是否收藏某个歌曲 */ public int existSongId(@Param("userId") Integer userId, @Param("songId") Integer songId); }
[ "Vae+2500" ]
Vae+2500
d69a384069a0b1afe5bda92387fb2a8b6964ea75
a28e617ffcf07a384ea65d5c64575ad2f28c593b
/extensions/proxy/src/main/java/uk/co/tfd/sm/proxy/InputStreamHolder.java
217088f8f641bc805181a38e4552807d6529d19e
[ "Apache-2.0" ]
permissive
danjung/sparsemapcontent
63938f9027bf5fb6c57b11bb95e1ffa22deeee20
ef66f954e19bee75754192961b93b2a9163dbf54
refs/heads/master
2021-01-16T17:02:24.599630
2012-06-21T21:47:07
2012-06-21T21:47:07
4,388,989
1
0
null
null
null
null
UTF-8
Java
false
false
173
java
package uk.co.tfd.sm.proxy; import java.io.InputStream; public interface InputStreamHolder { InputStream getStream(); String getMimeType(); String getFileName(); }
844356cd9e60cf5c59d3052d5030b77a1113f2c3
16226d004be3769a68cec02da4fb8761864bd264
/pay-dal/src/main/java/com/ewfresh/pay/dao/ShopCheckDao.java
73af448fb36891e79df3e40c59471c42ac437873
[]
no_license
Blake-Griffin/ewfresh-pay
e0beac47a2b3b460e2bfbf32138b97da26f0e5af
f26b3c32ae28b3088e093c5d0cb9a004b2f0d749
refs/heads/master
2022-12-24T05:47:55.488287
2019-08-18T03:59:11
2019-08-18T03:59:11
202,677,847
1
2
null
2022-12-16T08:04:42
2019-08-16T07:13:00
Java
UTF-8
Java
false
false
373
java
package com.ewfresh.pay.dao; import com.ewfresh.pay.model.ShopCheck; public interface ShopCheckDao { int deleteByPrimaryKey(Integer id); int insert(ShopCheck record); int insertSelective(ShopCheck record); ShopCheck selectByPrimaryKey(Integer id); int updateByPrimaryKeySelective(ShopCheck record); int updateByPrimaryKey(ShopCheck record); }
[ "dedede" ]
dedede
7ca9fc7de1a90d6024358ae184022073a9bd20b1
1f0cfc063c66701fbe17bcccb9b61406abfb3474
/gmall-ums/src/main/java/com/atguigu/gmall/ums/service/IntegrationHistoryService.java
f754b4921f75b97bcd7ff9b893b237c8192bf66b
[ "Apache-2.0" ]
permissive
GuRenYiBei/gmall
c4a56b9a8d5818b3a74e328a782f7e6c797b8f6e
951391461dbf61a81f0481ebc1625a09ce17e2c8
refs/heads/main
2023-04-03T02:24:16.641928
2021-03-23T13:24:28
2021-03-23T13:24:28
344,791,511
0
0
null
null
null
null
UTF-8
Java
false
false
536
java
package com.atguigu.gmall.ums.service; import com.baomidou.mybatisplus.extension.service.IService; import com.atguigu.gmall.common.bean.PageResultVo; import com.atguigu.gmall.common.bean.PageParamVo; import com.atguigu.gmall.ums.entity.IntegrationHistoryEntity; import java.util.Map; /** * 购物积分记录表 * * @author Gryb * @email [email protected] * @date 2021-03-06 00:03:02 */ public interface IntegrationHistoryService extends IService<IntegrationHistoryEntity> { PageResultVo queryPage(PageParamVo paramVo); }
2de0ed7a6276a58a161f2ff1b362edefd5c3dff5
d7e071a8e9f59e4323f819274e1a7c97b1085fef
/src/main/java/com/disney/disneywaittimes/DisneyWaitTimesApplication.java
e39bfeaeee4acfed1d8e6b45f56d0fdbdb303db7
[]
no_license
mitch-warrenburg/disney-wait-times
249374e5efbf4800e573b9773076d1de5bb1da83
89e43f3890e83fa61af2fd85dcf448147f15c952
refs/heads/main
2023-06-19T13:00:17.143899
2021-07-22T19:06:05
2021-07-22T19:09:03
380,613,705
1
0
null
null
null
null
UTF-8
Java
false
false
643
java
package com.disney.disneywaittimes; import java.util.TimeZone; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.scheduling.annotation.EnableScheduling; import static java.util.TimeZone.getTimeZone; @EnableScheduling @EnableFeignClients @SpringBootApplication public class DisneyWaitTimesApplication { public static void main(String[] args) { TimeZone.setDefault(getTimeZone("America/Los_Angeles")); SpringApplication.run(DisneyWaitTimesApplication.class, args); } }
407958bd7fdb88fdf97d3168ac71c73f4862f38d
334b1b6c2a7961962545a387586be020be970b4b
/Test0906/Demo.java
c936801b45270a2463d62eb0349b8c095c456392
[]
no_license
jacketzhang2000/javaTest
5e67dba1767146eeb265f59af11ebb411342ac53
2db28b9ed4cd328a023ca1fbc47cd58f7e53f625
refs/heads/master
2020-07-12T18:10:29.824696
2019-10-16T07:34:43
2019-10-16T07:34:43
204,867,227
0
0
null
null
null
null
UTF-8
Java
false
false
1,119
java
package Test0906; import java.util.*; public class Demo { public static List<String> subdomainVisits(String[] cpdomains){ Map<String, Integer> count=new HashMap<>(); for(String cp:cpdomains) { String[] t = cp.split(" "); int n = Integer.valueOf(t[0]); String domain = t[1]; String[] s = domain.split("\\."); for (int i = 0; i < s.length; i++) { String[] sub = Arrays.copyOfRange(s, i, s.length); String d = String.join(".", sub); int oldCount=count.getOrDefault(d,0); count.put(d,oldCount+n); } } List<String> result=new ArrayList<>(); for(Map.Entry<String,Integer> map:count.entrySet()){ String a=map.getKey(); Integer b=map.getValue(); result.add(a+" "+b); } return result; } public static void main(String[] args) { String[] s={"900 google.mali.com","50 baidu.com","1 intel.com"}; List<String>a=subdomainVisits(s); System.out.println(a); } }
07846ae1c713de98be9b775d7d83a3ff4111f9d0
6b1bd439c4146dc2545cb53e0ee612f7393b7c89
/RenuGit/CardShuffler/src/main/java/com/shuffler/service/ShufflerImplementation1.java
2c84aa4cdc9cd2c4df8adebde9e893d4c6c75d2a
[]
no_license
krishh13/CustomerPortal
939caeb886f6829508d190a744b4448d69d88c7e
acfc465dd3eaef22b9af24fef92f917ce000bb76
refs/heads/master
2020-04-04T06:53:06.424976
2018-11-01T18:55:29
2018-11-01T18:55:29
155,760,390
0
0
null
null
null
null
UTF-8
Java
false
false
317
java
package com.shuffler.service; import java.util.Collections; import java.util.List; import org.springframework.stereotype.Component; @Component public class ShufflerImplementation1 implements Shuffler { @Override public List<String> shuffle(List<String> list) { Collections.shuffle(list); return list; } }
b3721069c9b71beea6b0e2257b2bd4514093e047
6786cbbb696ef1f39cc439a26dcbd345b3071084
/jvmti/src/main/java/com/longwen/instrumentation/premain/TestAgent.java
037bbfefdc0e0638f3a370ebcc550b1e474c17b0
[]
no_license
longwen8/sandbox-demo
283143c7976d1d966dfb29059352bf18597fff79
fac06ea7d32deb43943fc4e21884cfa7d1d51eba
refs/heads/master
2022-08-04T00:28:50.833574
2019-11-29T10:04:18
2019-11-29T10:04:18
219,898,585
0
0
null
2022-07-07T22:11:06
2019-11-06T02:51:52
Java
UTF-8
Java
false
false
262
java
package com.longwen.instrumentation.premain; public class TestAgent { public static void main(String[] args) { TestAgent ta = new TestAgent(); ta.test(); } public void test() { System.out.println("I'm TestAgent"); } }
b53fd0b6da4568174ed9c4c3ba565fabfa6de57b
69daddae6ebb18635adbf7dd5a240654e9abc42f
/Gateway/Agents/UniversalGatewayAgent/com.predic8.membrane.core/src/com/predic8/membrane/core/io/ConfigurationStore.java
f80f56a044790d82a2fe47e4f0be37de8519996e
[]
no_license
Developer-Integration-Lab/InterOp-SOA
01c5f73dfa366f25e9a61c675a42bfbdcb697cf1
7661b3d8c1bdf9260e908b52235962bed37a8bd8
refs/heads/master
2021-01-17T11:56:07.998097
2012-09-20T20:10:35
2012-09-20T20:10:35
5,890,626
1
1
null
null
null
null
UTF-8
Java
false
false
871
java
/* Copyright 2009 predic8 GmbH, www.predic8.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.predic8.membrane.core.io; import com.predic8.membrane.core.Configuration; import com.predic8.membrane.core.Router; public interface ConfigurationStore { public Configuration read(String path) throws Exception; public void setRouter(Router router); }
875bcda0e88cb85ed596d346dea834398ba15a2e
c6c1a124eb1ff2fc561213d43d093f84d1ab2c43
/mxz-ttafs-server/ai/cn/mxz/task/achieve/tasks/T13115.java
3609de57ef7a4255b22320c00a5abd0d52191821
[]
no_license
fantasylincen/javaplus
69201dba21af0973dfb224c53b749a3c0440317e
36fc370b03afe952a96776927452b6d430b55efd
refs/heads/master
2016-09-06T01:55:33.244591
2015-08-15T12:15:51
2015-08-15T12:15:51
15,601,930
3
1
null
null
null
null
UTF-8
Java
false
false
431
java
/** * 累積進行360次元神逆轉 */ package cn.mxz.task.achieve.tasks; import cn.mxz.base.task.TaskAccumulatedAll; import cn.mxz.task.achieve.AchieveTaskPlayer; import mongo.gen.MongoGen.AchieveTaskDto; public class T13115 extends TaskAccumulatedAll<AchieveTaskDto> { @Override protected int getFinishTimesNow() { AchieveTaskPlayer player = user.getAchieveTaskPlayer(); return player.getYuanShenResetTimes() ; } }
[ "12-2" ]
12-2
d9c03aa1acadf9ff3d248a538bd7baa82f66e722
7c588e2c0580263ed0250a1bf1a48da5da9284b9
/app/src/main/java/com/example/jh/testmvpplugin/register/RegisterActivity.java
667fbee85d15e3a9c5ba036f54befb7a91648cb7
[]
no_license
jinhuizxc/TestMVPPlugin
25fabe830722202121500624081de8162e367f61
892dc3c2394f778cd91468a30560baffbef56f16
refs/heads/master
2021-01-20T03:35:01.605804
2017-04-27T05:48:23
2017-04-27T05:48:23
89,560,409
0
0
null
null
null
null
UTF-8
Java
false
false
292
java
package com.example.jh.testmvpplugin.register; import com.example.jh.testmvpplugin.mvp.MVPBaseActivity; /** * MVPPlugin * 邮箱 [email protected] */ public class RegisterActivity extends MVPBaseActivity<RegisterContract.View, RegisterPresenter> implements RegisterContract.View { }
d8d420f1912e7b9b0b4a626a0be39fbcdeb536f8
4379adb1c7489d53c67ed43e457def646899ce5a
/src/classe/exo5/point_mutable_polygone_mutable/Polygone.java
086af1a07684af231e930bc0c17d31bc2843abaf
[]
no_license
aimene/Java-revision
602318d0c40dd8a46c70d3a1d6ce16ed10c86d50
c69a4cb2c32d147d1bbe06d37a3a3b5d1599fb13
refs/heads/master
2020-04-28T19:29:08.647611
2019-03-17T18:37:11
2019-03-17T18:37:11
175,512,450
0
0
null
null
null
null
UTF-8
Java
false
false
1,503
java
/* Une classe Polygone qui possède 1. un tableau de points en attributs. 2. La possibilité de le construire à partir d’une liste d’au moins trois points 3. Les getters et setters 4. Une méthode pour lui appliquer une translation. 5. Une méthode pour lui appliquer une rotation par rapport à l’origine. 6. Une méthode pour l’afficher sur la sortie standard. */ package classe.exo5.point_mutable_polygone_mutable; /** * * @author yvan */ public class Polygone { private final Point[] sommets; public Polygone(Point a, Point b, Point c, Point... lp) { sommets = new Point[3 + lp.length]; sommets[0] = a; sommets[1] = b; sommets[2] = c; int k = 3; for (Point p : lp) { sommets[k++] = p; } } public Point getSommet(int i) { return sommets[i]; } public void setSommet(int i, Point p) { sommets[i] = p; } public int nbSommets() { return sommets.length; } public void translation(double dx, double dy) { for (Point p : sommets) { p.translation(dx, dy); } } public void rotation(double dtheta) { for (Point p : sommets) { p.rotation(dtheta); } } public void afficher(boolean polaire) { for (Point p : sommets) { p.afficher(polaire); } System.out.println(); } public void afficher() { afficher(false); } }
7279143e63735aedc36a6c80f601e11e4a42f906
bf40dbc2f4f983c9be3b526927577d7b3196dcc9
/app/src/main/java/com/bilibili/opd/javasisttrace/MainActivity.java
11a0798f4a40eca9360238a468db996e2743be88
[]
no_license
29995270/JavasistTrace
d7b69643b634c7b177b64d8ba1e7fbe90c533f63
96525a5daed042d8fc711e3c9bb6b7693539b0c1
refs/heads/master
2020-03-07T10:38:35.553997
2018-12-29T03:23:41
2018-12-29T03:23:41
127,436,438
0
0
null
null
null
null
UTF-8
Java
false
false
2,704
java
package com.bilibili.opd.javasisttrace; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.os.TraceCompat; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.WindowManager; import com.bilibili.opd.tracer.core.annotation.TraceField; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Random; /** * Created by wq on 2018/3/8. */ public class MainActivity extends AppCompatActivity { private Random random = new Random(); @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.root) .setOnClickListener((view) -> { TraceCompat.beginSection("onClick"); publicMethod(new OutBean(random.nextInt(100), random.nextInt(100))); TraceCompat.endSection(); }); findViewById(R.id.root) .setOnDragListener((v, event) -> false); staticMethod(getWindowManager()); publicMethod(new Bean()); publicMethod(new OutBean(12, 21)); long start = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { // publicMethod(new OutBean(random.nextInt(100), random.nextInt(100))); // publicMethod(); publicMethod(new OutBean(123, 2314)); } Log.e("AAA", "duration: " + (System.currentTimeMillis() - start)); listMethod(Collections.emptyList()); } @Override protected void onResume() { super.onResume(); publicMethod(new Bean()); listMethod(Collections.emptyList()); } private static void staticMethod(WindowManager windowManager) { System.out.println("AAA"); } public void publicMethod(Bean b) { System.out.println(1); System.out.println(1); } public void publicMethod() { System.out.println(1); System.out.println(1); } public void publicMethod(OutBean b) { System.out.println(b.getFieldA()); System.out.println(b.getFieldB()); } public void listMethod(List<OutBean> list) { System.out.println(list.size()); System.out.println(list.size()); } public void donotTrace(String a) { System.out.println(a); } public static class Bean { public int getAnInt() { return anInt; } public void setAnInt(int anInt) { this.anInt = anInt; } @TraceField private int anInt; } }
dcefc7a89559b5628955854e66cc522127c5bec4
e68f3b76701d1e60407b6f6ba597608240218660
/Basic java/src/Min.java
4fca4e222b89a7c07ebd202e09b2a0d6d0c26a81
[]
no_license
shubhamdmore/java
0111ff385b81fdd53c3d6069885bdc1b33a184b4
53be07abe8c3208edb84d55d0e222e45c51c61ab
refs/heads/master
2022-08-31T13:08:34.947713
2019-09-29T06:04:29
2019-09-29T06:04:29
211,611,723
0
0
null
2022-06-21T01:58:01
2019-09-29T06:02:53
Java
UTF-8
Java
false
false
414
java
public class Min { /** * @param args * @return */ static int min(int arr[]) { int min=arr[0]; for(int i=1;i<arr.length;i++) if(min>arr[i]) min=arr[i]; System.out.println(min); return 1; } public static void main(String[] args) { // TODO Auto-generated method stub int a[]={20,50,60,30,40,10}; int m = min(a); System.out.println("min value = "+m); } }
43700deba7f3175c319361d7fae329d9904c88d8
3d1352f95a4907b59582783946a7711eb3d2f6f1
/app/src/main/java/com/sunday/imoocmusicdemo/adapters/MusicListAdapter.java
2b1f55fabce86f7ff55de9a93ffb4a7f12ef9e06
[]
no_license
CaoGang110/Music
fe1294ea8faa6e9be2fa4cc888938b7941a8c266
4a98b33d58ef6298c0d9845c330c80eead960c69
refs/heads/master
2022-10-07T01:41:51.645026
2020-06-09T15:27:17
2020-06-09T15:27:17
271,028,076
0
0
null
null
null
null
UTF-8
Java
false
false
3,536
java
package com.sunday.imoocmusicdemo.adapters; import android.content.Context; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.bumptech.glide.Glide; import com.sunday.imoocmusicdemo.R; import com.sunday.imoocmusicdemo.activitys.PlayMusicActivity; import com.sunday.imoocmusicdemo.models.MusicModel; import java.util.List; public class MusicListAdapter extends RecyclerView.Adapter<MusicListAdapter.ViewHolder> { private Context mContext; private View mItemView; private RecyclerView mRv; private boolean isCalcaulationRvHeight; private List<MusicModel> mDataSource; public MusicListAdapter (Context context, RecyclerView recyclerView, List<MusicModel> dataSource) { mContext = context; mRv = recyclerView; this.mDataSource = dataSource; } @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { mItemView = LayoutInflater.from(mContext).inflate(R.layout.item_list_music, viewGroup, false); return new ViewHolder(mItemView); } @Override public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) { setRecyclerViewHeight(); final MusicModel musicModel = mDataSource.get(i); Glide.with(mContext) .load(musicModel.getPoster()) .into(viewHolder.ivIcon); viewHolder.tvName.setText(musicModel.getName()); viewHolder.tvAuthor.setText(musicModel.getAuthor()); viewHolder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(mContext, PlayMusicActivity.class); intent.putExtra(PlayMusicActivity.MUSIC_ID, musicModel.getMusicId()); mContext.startActivity(intent); } }); } @Override public int getItemCount() { return mDataSource.size(); } /** * 1、获取ItemView的高度 * 2、itemView的数量 * 3、使用 itemViewHeight * itemViewNum = RecyclerView的高度 */ private void setRecyclerViewHeight () { if (isCalcaulationRvHeight || mRv == null) return; isCalcaulationRvHeight = true; // 获取ItemView的高度 RecyclerView.LayoutParams itemViewLp = (RecyclerView.LayoutParams) mItemView.getLayoutParams(); // itemView的数量 int itemCount = getItemCount(); // 使用 itemViewHeight * itemViewNum = RecyclerView的高度 int recyclerViewHeight = itemViewLp.height * itemCount; // 设置RecyclerView高度 LinearLayout.LayoutParams rvLp = (LinearLayout.LayoutParams) mRv.getLayoutParams(); rvLp.height = recyclerViewHeight; mRv.setLayoutParams(rvLp); } static class ViewHolder extends RecyclerView.ViewHolder { View itemView; ImageView ivIcon; TextView tvName, tvAuthor; public ViewHolder(@NonNull View itemView) { super(itemView); this.itemView = itemView; ivIcon = itemView.findViewById(R.id.iv_icon); tvName = itemView.findViewById(R.id.tv_name); tvAuthor = itemView.findViewById(R.id.tv_author); } } }
3e38adbd04ae7e73ad61a95b68007a6704fff1ab
1364294a0a8f68df99ed24a961afd28285d28fee
/Framework_EcommerceApplication/src/com/NopCommerce/Practise/Practise.java
e4ae3deebd63e34e2a2bc0ca8e1b9008df90ac32
[]
no_license
Raghavendakudal/EcommerceProject
c0eea1abb73e5cce7e5eabaf7981877499008002
9ed32d45b6b5610d8c510a767ba051920d455fe1
refs/heads/master
2021-07-23T14:33:19.626089
2017-11-01T16:11:12
2017-11-01T16:11:12
109,141,119
0
0
null
null
null
null
UTF-8
Java
false
false
3,091
java
package com.NopCommerce.Practise; import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.Select; import org.openqa.selenium.support.ui.WebDriverWait; public class Practise { public static void main(String[] args) throws IOException, Exception { System.setProperty("webdriver.chrome.driver","D:\\Selenium\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("http://admin-demo.nopcommerce.com/"); driver.manage().window().maximize(); driver.findElement(By.id("Email")).sendKeys("[email protected]"); driver.findElement(By.id("Password")).sendKeys("admin"); driver.findElement(By.xpath("//input[@value='Log in']")).click(); /*driver.findElement(By.xpath("(//span[text()='Customers'])[1]")).click(); WebDriverWait wait =new WebDriverWait(driver,20); WebElement CustomerRole=wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[text()='Customer roles']"))); CustomerRole.click(); driver.findElement(By.xpath("//a[@href='/Admin/CustomerRole/Create']")).click(); driver.findElement(By.id("Name")).sendKeys("A"); driver.findElement(By.xpath("//button[@name='save']")).click(); driver.findElement(By.xpath("//a[Contains(text(),'Logout')]")).click();*/ driver.findElement(By.xpath("//*[text()='Catalog']")).click(); WebDriverWait Wait= new WebDriverWait(driver,200); WebElement Category=Wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[text()='Categories']"))); //WebDriverWait wait= new WebDriverWait(driver,200); //WebElement close=wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(".//*[@id='userDataLightBox_accountCreatedSection']/div[5]/span[text()='Close']"))); Category.click(); driver.findElement(By.xpath("//a[@href='/Admin/Category/Create']")).click(); driver.findElement(By.id("Name")).sendKeys("Laptop Bags"); WebElement Frame=driver.findElement(By.xpath("//*[@id='Description_ifr']")); driver.switchTo().frame(Frame); WebElement CFrame=driver.switchTo().activeElement(); CFrame.sendKeys("This is about Laptop Bags"); driver.switchTo().defaultContent(); WebElement Selbyval=driver.findElement(By.name("ParentCategoryId")); Select Sel=new Select(Selbyval); Sel.selectByVisibleText("Computers"); driver.findElement(By.id("DisplayOrder")).sendKeys("1"); WebElement save=driver.findElement(By.xpath("//button[@name='save']")); Actions act= new Actions(driver); act.moveToElement(save).build().perform(); List<WebElement> tbody=driver.findElements(By.xpath("//tbody[@role='rowgroup']/tr/td[1]")); for (WebElement items : tbody) { if (items.getText().equals("Computers >> A")); { break; } } } }
627b3e48dbc6e1364300811850d88b2657818aed
d4ad023a810d31edc739fbcb081461a6ea1ae5ca
/blog-example/src/main/java/com/example/ThreadPoolDemo.java
e92cb2bdb3c45012f7919e44adb38ed5c74a7429
[]
no_license
vipstone/blog-example
bdea8ab07390d5e40e841d7a8bdb5ec05e1a8c51
9512ccedc4df14c33bb41f1446bd99a98644eaae
refs/heads/master
2022-11-22T04:59:50.344202
2021-01-30T09:24:11
2021-01-30T09:24:11
248,130,104
0
0
null
2022-11-16T02:46:47
2020-03-18T03:31:11
Java
UTF-8
Java
false
false
1,365
java
package com.example; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * 线程池拒绝策略模拟触发 Demo */ public class ThreadPoolDemo { public static void main(String[] args) { ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 1L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(1)); executor.execute(() -> { System.out.println("开始执行任务1"); try { Thread.sleep(1000 * 2); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("任务1执行结束1"); }); executor.execute(() -> { System.out.println("开始执行任务2"); try { Thread.sleep(1000 * 2); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("任务2执行结束"); }); executor.execute(() -> { System.out.println("开始执行任务3"); try { Thread.sleep(1000 * 2); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("任务3执行结束"); }); } }
ef07a9af3bf2514a0342d78301bc9eb5716b25e9
0ccf5aede655fa10099118f9494d7492e715b1d6
/qyt_om/src/main/java/com/qyt/om/activity/MessageAlarmDetailActivity.java
5535fa61d118cf46697a7bb420afdff89a1841bd
[]
no_license
wuxiflowing/operationmanager_android
4a1560217eb0096f3b0712fbd3c5ca941154acf6
ca488085ac83a65b181646162dec8793f3abf3fd
refs/heads/master
2020-06-19T01:41:22.700198
2020-04-22T14:26:30
2020-04-22T14:26:30
196,521,472
0
0
null
2020-04-22T14:26:31
2019-07-12T06:26:32
Java
UTF-8
Java
false
false
2,173
java
package com.qyt.om.activity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.TextView; import com.bangqu.lib.widget.UnScrollListView; import com.qyt.om.R; import com.qyt.om.adapter.OrderItemAdapter; import com.qyt.om.base.BaseActivity; import java.util.ArrayList; import butterknife.BindView; import butterknife.OnClick; public class MessageAlarmDetailActivity extends BaseActivity { @BindView(R.id.toolbar) Toolbar toolbar; @BindView(R.id.title) TextView title; @BindView(R.id.install_customer_name) TextView installCustomerName; @BindView(R.id.install_customer_adress) TextView installCustomerAdress; @BindView(R.id.install_order_info) UnScrollListView installOrderInfo; private ArrayList<String> orderItems = new ArrayList<>(); private OrderItemAdapter orderItemAdapter; @Override protected void setLayoutView(Bundle savedInstanceState) { super.setLayoutView(savedInstanceState); setContentView(R.layout.activity_messagealarmdetail); } @Override protected void initView() { super.initView(); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setTitle(""); title.setText("告警消息"); orderItemAdapter = new OrderItemAdapter(this, orderItems); installOrderInfo.setAdapter(orderItemAdapter); } @Override protected void addViewListener() { super.addViewListener(); } @Override protected void requestData() { super.requestData(); orderItems.add("安装工单:3个"); orderItems.add("安装位置:无锡市滨湖区"); orderItems.add("运维人员:小小"); orderItems.add("代收服务费:2300元"); orderItems.add("代收押金费:2300元"); orderItemAdapter.notifyDataSetChanged(); } @OnClick({R.id.install_customer_call}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.install_customer_call: break; } } }
54419139d0772b31c57aa00cc059d582794f38be
f2a651b8d5aa4f254ee189fd2f6f7c474a8184c5
/spring-security-jpa-master2/src/main/java/com/javatechie/spring/security/api/config/SecurityConfig.java
5beae3ec17ee7a5f73a9b713356c96ee1eed3892
[]
no_license
Sharnendra/Wipro-Projects-phase-5
295a07d37547b1bd5615b9e6e1db18679dc89a0b
60c0fbf2fa792a9e4ced818e738ef8cab07c5ea0
refs/heads/master
2022-12-20T17:59:00.099735
2019-09-27T21:47:13
2019-09-27T21:47:13
211,406,190
0
0
null
2022-12-16T02:42:01
2019-09-27T21:43:55
Java
UTF-8
Java
false
false
1,915
java
package com.javatechie.spring.security.api.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.NoOpPasswordEncoder; @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private UserDetailsService userDetailsService; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder()); } @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatchers("/rest/**").authenticated().anyRequest().permitAll().and() .authorizeRequests().antMatchers("/secure/**").authenticated().anyRequest().hasAnyRole("ADMIN").and() .formLogin().permitAll(); } @Bean public BCryptPasswordEncoder encodePWD() { return new BCryptPasswordEncoder(); } @Bean public static NoOpPasswordEncoder passwordEncoder() { return (NoOpPasswordEncoder) NoOpPasswordEncoder.getInstance(); } }
af3e346424341261e7e75ae03e77f9a5769d7fca
6f24289261902a52ddfd2dad317c592b87fe0877
/src/jp/sakumon/moridai/MyProgressDialogFragment.java
c6ca2ca699ea1d09787b4a85585b025a32b147cf
[]
no_license
Furu222/Moridai-Android
70ac772d6748a2885774fcdc1c60a50efc32ecf4
b048cabe7c7666a8073ced744c1b0ae493967a86
refs/heads/master
2021-01-09T06:39:39.878302
2014-02-01T11:24:32
2014-02-01T11:24:32
15,221,377
0
0
null
null
null
null
UTF-8
Java
false
false
1,932
java
package jp.sakumon.moridai; import android.app.Dialog; import android.app.DialogFragment; import android.app.ProgressDialog; import android.os.Bundle; public class MyProgressDialogFragment extends DialogFragment{ private static ProgressDialog progressDialog = null; // インスタンス生成はこれを使う public static MyProgressDialogFragment newInstance(String title, String message){ MyProgressDialogFragment instance = new MyProgressDialogFragment(); // ダイアログにパラメータを渡す Bundle arguments = new Bundle(); arguments.putString("title", title); arguments.putString("message", message); instance.setArguments(arguments); return instance; } // ProgressDialog作成 @Override public Dialog onCreateDialog(Bundle savedInstanceState){ if (progressDialog != null) return progressDialog; // パラメータを取得 String title = getArguments().getString("title"); String message = getArguments().getString("message"); progressDialog = new ProgressDialog(getActivity()); progressDialog.setTitle(title); progressDialog.setMessage(message); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); // プログレスダイアログのスタイルを円スタイルに設定 // プログレスダイアログのキャンセルが可能かどうかを設定(バックボタンでダイアログをキャンセルできないようにする) setCancelable(false); return progressDialog; } // progressDialog取得 @Override public Dialog getDialog(){ return progressDialog; } // ProgressDialog破棄 @Override public void onDestroy(){ super.onDestroy(); progressDialog = null; } }
f82bfe9971c8f950b893af934ff2e346a3e67a55
3b64171aac3099ace432b44f975a1f00abef26dc
/src/piyushPJun20/MaxValueAtDifferedIndex.java
34cc13cc81133225d608aa542580823adb3afe63
[]
no_license
KrishnaKTechnocredits/JAVATechnoJun20
a80b97c0c80f3a70bd5205bcf1de0db76e1d7b25
197e81594254cd05cb42d576720f473edb446b72
refs/heads/master
2022-12-22T23:48:51.680861
2020-09-24T04:45:23
2020-09-24T04:45:23
272,046,021
0
0
null
2020-09-24T09:02:14
2020-06-13T16:31:43
Java
UTF-8
Java
false
false
1,226
java
/* Find max value at differed index. i/p:- arr1: {10,2,9,14,3} arr2: {10,2,18,14,3} o/p :- Values are not matching at index -> 2, From (9,18) max value is 18 */ package piyushPJun20; public class MaxValueAtDifferedIndex { void displayMaxIndex(int[] arr1, int[] arr2) { boolean flag = true; if (arr1.length == arr2.length) { for (int index = 0; index < arr1.length; index++) { if (arr1[index] != arr2[index]) { if (arr1[index] > arr2[index]) { System.out.println(" Values are not matching at index -> " + index + " , From (" + arr1[index] + "," + arr2[index] + ") max value is " + arr1[index]); } else { System.out.println(" Values are not matching at index -> " + index + " , From (" + arr1[index] + "," + arr2[index] + ") max value is " + arr2[index]); } flag = false; } } if (flag) System.out.println("Values of all Elements in both Array are equal"); } else { System.out.println("Length is 2 Array is not matching"); } } public static void main(String[] args) { MaxValueAtDifferedIndex max = new MaxValueAtDifferedIndex(); int[] arr1 = { 10, 2, 9, 14, 3 }; int[] arr2 = { 10, 2, 18, 14, 3 }; max.displayMaxIndex(arr1, arr2); } }
6455e2387d389ff4086e87726553d2af6b736f23
c677c3d1db02c57dd98f2dd5c74f82587727851b
/LinkedList.java
20a9febad8de688896f0fb17b74092c78bb65542
[]
no_license
shahjuhi1108/practice-programs
c007645bfe1307a7f53546783f8adfcb50738e09
eb53b4ef8a2b33ff59fbcd796a7fdd3b394c3401
refs/heads/master
2020-07-26T13:35:29.221783
2019-09-15T21:44:55
2019-09-15T21:44:55
208,661,230
0
0
null
null
null
null
UTF-8
Java
false
false
8,122
java
import java.util.Scanner; class Node { private Node next; private int value; Node(int k){ this.value = k; } public Node getNext() { return next; } public void setNext(Node next) { this.next = next; } public int getValue() { return value; } public void setValue(int value) { this.value = value; } @Override public String toString() { return "Node{" + "value=" + value + '}'; } } class DoublyNode extends Node{ DoublyNode previous; DoublyNode(int j){ super (j); } public DoublyNode getPrevious() { return previous; } public void setPrevious(DoublyNode previous) { this.previous = previous; } } class DoublyLinkedList{ private DoublyNode head; private DoublyNode tail; @Override public String toString(){ DoublyNode temp = head; StringBuilder sb = new StringBuilder(); while(temp != null){ sb.append(temp); sb.append(","); temp = (DoublyNode) temp.getNext(); } return sb.toString(); } public String toReverseString(){ DoublyNode temp = tail; StringBuilder sb = new StringBuilder(); while(temp != null){ sb.append(temp); sb.append(","); temp = (DoublyNode) temp.getPrevious(); } return sb.toString(); } public void insert(DoublyNode value){ if(head == null){ head = value; tail = value; // System.out.println("The head value is inserted. - " + head); // System.out.println("The tail value is inserted. - " + tail); } else{ tail.setNext(value); value.setPrevious(tail); tail = (DoublyNode) tail.getNext(); // System.out.println("The head value is inserted. - " + head); // System.out.println("The tail value is inserted. - " + tail); } } public void insertAtHead(DoublyNode value){ if(head == null){ head = value; tail = value; } else{ head.setPrevious(value); value.setNext(head); head = head.getPrevious(); } } public void delete(int value){ if(head == null){ System.out.println("The doubly linked list is empty."); } else if(head.getValue() == value){ ((DoublyNode)head.getNext()).setPrevious(head.getPrevious()); head = (DoublyNode) head.getNext(); } else if(tail.getValue() == value){ ((DoublyNode)tail.getPrevious()).setNext(tail.getNext()); tail = tail.getPrevious(); } else{ DoublyNode temp = head; while(temp != null){ if(temp.getValue() == value){ temp.getPrevious().setNext(temp.getNext()); ((DoublyNode)temp.getNext()).setPrevious(temp.getPrevious()); } temp = (DoublyNode) temp.getNext(); } } } public void removeFirst(){ ((DoublyNode)head.getNext()).setPrevious(head.getPrevious()); head = (DoublyNode) head.getNext(); } public void removeLast(){ tail.getPrevious().setNext(tail.getNext()); tail = tail.getPrevious(); } public DoublyNode peekAtHead(){ return head; } public DoublyNode peekAtTail(){ return tail; } } class LinkedList{ private Node head; @Override public String toString(){ return display(); } public String display(){ Node temp = this.head; StringBuilder sb = new StringBuilder(); while(temp != null){ //System.out.println(temp); sb.append(temp); sb.append(","); temp = temp.getNext(); } return sb.toString(); } public void insertionI(Node value){ Node temp = this.head; if(this.head == null){ this.head = value; return; } while(temp.getNext() != null){ temp = temp.getNext(); } temp.setNext(value); } public void insert(Node value){ if(this.head == null){ this.head = value; System.out.println("Setting the head key: " + value); } else insertion(value, this.head); } private void insertion(Node value, Node currentHead){ System.out.println("Currenthead is: " + currentHead); System.out.println("Second value is: " + currentHead.getNext()); if(currentHead.getNext() == null){ currentHead.setNext(value); } else insertion(value, currentHead.getNext()); } public void delete(int value){ if(this.head == null){ System.out.println("The linked list is empty."); } else if(this.head.getValue() == value){ head = head.getNext(); } else deletion(value, this.head); } private void deletion(int value, Node currentHead){ Node temp = currentHead; while(temp.getNext() != null){ if(temp.getNext().getValue() == value){ temp.setNext(temp.getNext().getNext()); } else{ temp = temp.getNext(); } } } } public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); // LinkedList l = new LinkedList(); // int n = s.nextInt(); // while (n-- > 0) { // int x = s.nextInt(); // l.insert(new Node(x)); // System.out.println("--------------------------------------"); // } // System.out.println(l); // // System.out.println("------Using Iteration method.------"); // // LinkedList l1 = new LinkedList(); // int input = s.nextInt(); // while (input-- > 0) { // int x = s.nextInt(); // l1.insertionI(new Node(x)); // } // System.out.println(l1); // // int y = s.nextInt(); // l.delete(y); // System.out.println("The node has been deleted successfully."); // System.out.println(l); DoublyLinkedList dl = new DoublyLinkedList(); int z = s.nextInt(); while(z-- >0){ int x = s.nextInt(); dl.insert(new DoublyNode(x)); } System.out.println(dl); System.out.println(dl.toReverseString()); DoublyLinkedList dl2 = new DoublyLinkedList(); DoublyLinkedList dl3 = new DoublyLinkedList(); int z1 = s.nextInt(); while(z1-- >0){ int x = s.nextInt(); dl2.insert(new DoublyNode(x)); dl3.insertAtHead(new DoublyNode(x)); } System.out.println(dl2); System.out.println(dl3); int q = s.nextInt(); dl3.delete(q); System.out.println("The node has been deleted successfully."); System.out.println(dl3); System.out.println("--------------------------------------"); dl3.removeFirst(); System.out.println(dl3); System.out.println("--------------------------------------"); dl3.removeLast(); System.out.println(dl3); System.out.println("--------------------------------------"); System.out.println(dl3.peekAtHead()); System.out.println("--------------------------------------"); System.out.println(dl3.peekAtTail()); System.out.println("--------------------------------------"); } } /* 10 16 4 10 14 7 9 3 2 8 1 6 6 5 7 2 5 8 7 5 8 2 4 0 3 7 7 */
8420bd61dcce3f0300264f5539165926fc14444b
5797ef85890835ffff66edd0fba5f4955860f0a2
/vendornew/vendor/src/main/java/com/ust/vendor/util/ReportUtilImp.java
585eac455965c5e9ecb95278803d37b355185971
[]
no_license
sreejith98/UST-TRAINING
df90606ef7388301c4850273042bebdaccb0c896
11fcffea41927ec96fa25edbaa80912a77a6264b
refs/heads/master
2023-02-05T03:32:51.250252
2020-12-29T18:53:13
2020-12-29T18:53:13
321,100,787
0
0
null
null
null
null
UTF-8
Java
false
false
914
java
package com.ust.vendor.util; import java.io.File; import java.io.IOException; import java.util.List; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartUtilities; import org.jfree.chart.JFreeChart; import org.jfree.data.general.DefaultPieDataset; import org.springframework.stereotype.Repository; @Repository public class ReportUtilImp implements ReportUtil { @Override public void generatePieChart(String path, List<Object[]> data) { // TODO Auto-generated method stub DefaultPieDataset dataset = new DefaultPieDataset(); for (Object[] objects : data) { dataset.setValue(objects[0].toString(), Double.parseDouble(objects[1].toString())); } JFreeChart chart = ChartFactory.createPieChart3D("Vendor Type Report", dataset); try { ChartUtilities.saveChartAsJPEG(new File(path + "/pieChart.jpeg"), chart, 300, 300); } catch (IOException e) { e.printStackTrace(); } } }
63451c60d6078b66d4eec5bece17a55e1c2c889d
2dbb80e435d73e915a9beac3f8f0c9d4dc7bb472
/cmpp/demo/src/com/huawei/insa2/comm/cmpp/message/CMPPActiveRepMessage.java
8254a058f251dbea11a6eb3fc490adb8c834d369
[]
no_license
peidachang/openwisdom
c426967046f0e7a19095848d7f62770284470958
5b81aaf3f0cf3ba6b11bb662976323ce5967f857
refs/heads/master
2021-01-10T05:34:06.755806
2009-08-21T03:21:34
2009-08-21T03:21:34
49,044,642
0
2
null
null
null
null
UTF-8
Java
false
false
2,057
java
// FrontEnd Plus GUI for JAD // DeCompiled : CMPPActiveRepMessage.class package com.huawei.insa2.comm.cmpp.message; import com.huawei.insa2.comm.cmpp.CMPPConstant; import com.huawei.insa2.util.TypeConvert; // Referenced classes of package com.huawei.insa2.comm.cmpp.message: // CMPPMessage public class CMPPActiveRepMessage extends CMPPMessage { public CMPPActiveRepMessage(int success_Id) throws IllegalArgumentException { if(success_Id <= 0 || success_Id > 255) { throw new IllegalArgumentException(String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(CMPPConstant.ACTIVE_REPINPUT_ERROR)))).append(":success_Id").append(CMPPConstant.INT_SCOPE_ERROR)))); } else { int len = 13; buf = new byte[len]; TypeConvert.int2byte(len, buf, 0); TypeConvert.int2byte(0x80000008, buf, 4); buf[12] = (byte)success_Id; return; } } public CMPPActiveRepMessage(byte buf[]) throws IllegalArgumentException { super.buf = new byte[5]; if(buf.length != 5) { throw new IllegalArgumentException(CMPPConstant.SMC_MESSAGE_ERROR); } else { System.arraycopy(buf, 0, super.buf, 0, 5); sequence_Id = TypeConvert.byte2int(super.buf, 0); return; } } public int getSuccessId() { return buf[4]; } public String toString() { String tmpStr = "CMPP_Active_Test_REP: "; tmpStr = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(tmpStr)))).append("Sequence_Id=").append(getSequenceId()))); tmpStr = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(tmpStr)))).append(",SuccessId=").append(String.valueOf(buf[4])))); return tmpStr; } public int getCommandId() { return 0x80000008; } }
ecd0ea610c710b12c3c395d88ddb5ce7c7ab1ba5
6163a6172ae9a17f123a795a25a6dd3f5dff2253
/src/main/java/UserServlets/UploadServlet.java
3cb5fc0a9bc41afa512fd298231bbf382e83b224
[]
no_license
mahdzn13/PracticaServlet
062a4ac70f56654efca3d9758605549f3680eb50
976e6f2559911b137de282b4e85ea97ecf7d94c4
refs/heads/master
2020-06-19T01:07:08.287749
2016-12-04T19:58:15
2016-12-04T19:58:15
74,929,105
0
0
null
null
null
null
UTF-8
Java
false
false
4,819
java
package UserServlets;// Import required java libraries import java.io.*; import java.util.*; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; import org.apache.commons.io.output.*; public class UploadServlet extends HttpServlet { private boolean isMultipart; private String filePath; private int maxFileSize = 100 * 1024; private int maxMemSize = 4 * 1024; private File file ; private boolean cont = false; public void init( ){ // Get the file location where it would be stored. filePath = getServletContext().getInitParameter("file-upload"); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException { HttpSession ses = request.getSession(); String userdir = (String) ses.getAttribute("email"); int arrobaPos = 0; for (int i = 0; i < userdir.length(); i++) { if (userdir.charAt(i) == '@'){ arrobaPos = i; } } userdir = userdir.substring(0,arrobaPos); File f = new File (getServletContext().getInitParameter("file-upload") + userdir); if (!cont){ //Si es windows? if (filePath.charAt(0) == 'C'){ filePath += userdir + "\\"; } else { filePath += userdir + "/"; } cont = true; } // Check that we have a file upload request isMultipart = ServletFileUpload.isMultipartContent(request); response.setContentType("text/html"); java.io.PrintWriter out = response.getWriter( ); if( !isMultipart ){ out.println("<html>"); out.println("<head>"); out.println("<title>Servlet upload</title>"); out.println("</head>"); out.println("<body>"); out.println("<p>No file uploaded</p>"); out.println("</body>"); out.println("</html>"); return; } DiskFileItemFactory factory = new DiskFileItemFactory(); // maximum size that will be stored in memory factory.setSizeThreshold(maxMemSize); // Location to save data that is larger than maxMemSize. factory.setRepository(new File("c:\\temp")); // Create a new file upload handler ServletFileUpload upload = new ServletFileUpload(factory); // maximum file size to be uploaded. upload.setSizeMax( maxFileSize ); try{ // Parse the request to get file items. List fileItems = upload.parseRequest(request); // Process the uploaded file items Iterator i = fileItems.iterator(); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet upload</title>"); out.println("</head>"); out.println("<body>"); while ( i.hasNext () ) { FileItem fi = (FileItem)i.next(); if ( !fi.isFormField () ) { // Get the uploaded file parameters String fieldName = fi.getFieldName(); String fileName = fi.getName(); String contentType = fi.getContentType(); boolean isInMemory = fi.isInMemory(); long sizeInBytes = fi.getSize(); // Write the file if( fileName.lastIndexOf("\\") >= 0 ){ file = new File( filePath + fileName.substring( fileName.lastIndexOf("\\"))) ; }else{ file = new File( filePath + fileName.substring(fileName.lastIndexOf("\\")+1)) ; } fi.write( file ) ; out.println("Uploaded Filename: " + fileName + "<br>"); } } out.println("</body>"); out.println("</html>"); }catch(Exception ex) { System.out.println(ex); } } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException { throw new ServletException("GET method used with " + getClass( ).getName( )+": POST method required."); } }
5763aa3d3a35a7cf9860aaa9303c9518552d949a
b52457b2675707febb6104e57d88cdaf65281b5b
/41.Boot-SpringSecurityUsingJWT/src/main/java/com/example/demo/security/JwtGenerator.java
206e6e9f61de7b4b51fd67708d5fbf35b98b7cdf
[]
no_license
princedj07/SpringBoot1.1
03a6d6850b82abd596374ca0af0c7e74ffa89e1a
efd7d12e211b2b567098f5862474c2e15d782d8e
refs/heads/master
2022-11-21T20:59:40.098189
2020-07-18T03:21:30
2020-07-18T03:21:30
280,401,394
0
0
null
null
null
null
UTF-8
Java
false
false
654
java
package com.example.demo.security; import org.springframework.stereotype.Component; import com.example.demo.model.JwtUser; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; @Component public class JwtGenerator { public String generate(JwtUser jwtUser) { System.err.println("JwtGenerator.generate()"); Claims claims = Jwts.claims().setSubject(jwtUser.getUserName()); claims.put("userId", String.valueOf(jwtUser.getId())); claims.put("role", jwtUser.getRole()); return Jwts.builder().setClaims(claims).signWith(SignatureAlgorithm.HS512, "youtube").compact(); } }
[ "Prince@LAPTOP-KFIKPE1S" ]
Prince@LAPTOP-KFIKPE1S
1f760836da25a096ebc0f269051c83f449ae986c
904da62383127686eff2238fd43441021d183974
/src/main/java/edu/unbosque/FourPawsCitizens_LazarusAES_25/services/CaseService.java
968865b659cb47058a02861db305529def504e47
[]
no_license
AndresGB1/FourPawsCitizens-LazarusAES-256
812ee3893fff3083df40239f2c1c2e29f2eb751d
fbcb6be13fbacb9c6a257da0945f12727b337c61
refs/heads/master
2023-05-30T01:26:16.713023
2021-06-18T17:28:07
2021-06-18T17:28:07
375,477,261
1
0
null
null
null
null
UTF-8
Java
false
false
4,199
java
package edu.unbosque.FourPawsCitizens_LazarusAES_25.services; import edu.unbosque.FourPawsCitizens_LazarusAES_25.jpa.entities.Case; import edu.unbosque.FourPawsCitizens_LazarusAES_25.jpa.entities.Pet; import edu.unbosque.FourPawsCitizens_LazarusAES_25.jpa.repositories.CaseRepository; import edu.unbosque.FourPawsCitizens_LazarusAES_25.jpa.repositories.CaseRepositoryImpl; import edu.unbosque.FourPawsCitizens_LazarusAES_25.jpa.repositories.PetRepository; import edu.unbosque.FourPawsCitizens_LazarusAES_25.jpa.repositories.PetRepositoryImpl; import edu.unbosque.FourPawsCitizens_LazarusAES_25.resources.pojos.CasePOJO; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import java.util.ArrayList; import java.util.List; import java.util.Optional; @Stateless public class CaseService { PetRepository petRepository; CaseRepository caseRepository; public String createCase(CasePOJO casePOJO){ EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("LazarusAES-256"); EntityManager entityManager = entityManagerFactory.createEntityManager(); petRepository = new PetRepositoryImpl(entityManager); Optional<Pet> pet = petRepository.findById(casePOJO.getPet_id()); if (!pet.isPresent()) return "The pet does not exist"; Case aCase = new Case( casePOJO.getCreated_at(), casePOJO.getType(), casePOJO.getDescription()); pet.get().addCases(aCase); petRepository.save(pet.get()); entityManager.close(); entityManagerFactory.close(); return "The caase was successfully created"; } public Optional<CasePOJO> findCase(Integer id){ EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("LazarusAES-256"); EntityManager entityManager = entityManagerFactory.createEntityManager(); caseRepository = new CaseRepositoryImpl(entityManager); Optional<Case> aCase = caseRepository.findById(id); System.out.println("case find id -- > " + aCase); entityManager.close(); entityManagerFactory.close(); if(aCase.isPresent()){ return Optional.of(new CasePOJO(aCase.get().getCase_id(),aCase.get().getCreated_at(),aCase.get().getType(),aCase.get().getDescription(),aCase.get().getPet_id().getPet_id())); } return Optional.empty(); } public List<CasePOJO> ListCases(){ EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("LazarusAES-256"); EntityManager entityManager = entityManagerFactory.createEntityManager(); caseRepository = new CaseRepositoryImpl(entityManager); List<Case> cases = caseRepository.findAll(); entityManager.close(); entityManagerFactory.close(); List<CasePOJO> casePOJOS = new ArrayList<>(); for(Case cas : cases){ casePOJOS.add(new CasePOJO(cas.getCase_id(),cas.getCreated_at(),cas.getType(),cas.getDescription(),cas.getPet_id().getPet_id())); } return casePOJOS; } public String editCase(Integer id, String created_at, String type, String description){ EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("LazarusAES-256"); EntityManager entityManager = entityManagerFactory.createEntityManager(); caseRepository = new CaseRepositoryImpl(entityManager); String reply = caseRepository.editCase(id,created_at,type,description); entityManager.close(); entityManagerFactory.close(); return reply; } public String deleteCase(Integer id){ EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("LazarusAES-256"); EntityManager entityManager = entityManagerFactory.createEntityManager(); caseRepository = new CaseRepositoryImpl(entityManager); String reply = caseRepository.deleteById(id); entityManager.close(); entityManagerFactory.close(); return reply; } }
d929f5f415a4776c65d739374ede7ee2537ef1fb
91297ffb10fb4a601cf1d261e32886e7c746c201
/html.editor/test/unit/src/org/netbeans/modules/html/editor/indent/HtmlIndenterTest.java
3fa726aefd9de6ea3b1672661c7b9c17e1b3991b
[]
no_license
JavaQualitasCorpus/netbeans-7.3
0b0a49d8191393ef848241a4d0aa0ecc2a71ceba
60018fd982f9b0c9fa81702c49980db5a47f241e
refs/heads/master
2023-08-12T09:29:23.549956
2019-03-16T17:06:32
2019-03-16T17:06:32
167,005,013
0
0
null
null
null
null
UTF-8
Java
false
false
15,937
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 2010 Oracle and/or its affiliates. All rights reserved. * * Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of their respective owners. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common * Development and Distribution License("CDDL") (collectively, the * "License"). You may not use this file except in compliance with the * License. You can obtain a copy of the License at * http://www.netbeans.org/cddl-gplv2.html * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the * specific language governing permissions and limitations under the * License. When distributing the software, include this License Header * Notice in each file and include the License file at * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the * License Header, with the fields enclosed by brackets [] replaced by * your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * If you wish your version of this file to be governed by only the CDDL * or only the GPL Version 2, indicate your decision by adding * "[Contributor] elects to include this software in this distribution * under the [CDDL or GPL Version 2] license." If you do not indicate a * single choice of license, a recipient has the option to distribute * your version of this file under either the CDDL, the GPL Version 2 or * to extend the choice of license to its licensees as provided above. * However, if you add GPL Version 2 code and therefore, elected the GPL * Version 2 license, then the option applies only if the new code is * made subject to such option by the copyright holder. * * Contributor(s): * * Portions Copyrighted 2008 Sun Microsystems, Inc. */ package org.netbeans.modules.html.editor.indent; import javax.swing.text.Document; import junit.framework.Test; import junit.framework.TestSuite; import org.netbeans.api.editor.mimelookup.MimePath; import org.netbeans.api.editor.mimelookup.test.MockMimeLookup; import org.netbeans.api.html.lexer.HTMLTokenId; import org.netbeans.api.lexer.Language; import org.netbeans.editor.BaseDocument; import org.netbeans.modules.html.editor.lib.api.HtmlVersion; import org.netbeans.modules.csl.api.Formatter; import org.netbeans.modules.css.editor.indent.CssIndentTaskFactory; import org.netbeans.modules.css.lib.api.CssTokenId; import org.netbeans.modules.web.indent.api.support.AbstractIndenter; import org.netbeans.modules.html.editor.api.HtmlKit; import org.netbeans.modules.html.editor.test.TestBase2; import org.openide.cookies.EditorCookie; import org.openide.filesystems.FileObject; import org.openide.loaders.DataObject; public class HtmlIndenterTest extends TestBase2 { public HtmlIndenterTest(String name) { super(name); } @Override protected void setUp() throws Exception { super.setUp(); HtmlVersion.DEFAULT_VERSION_UNIT_TESTS_OVERRIDE = HtmlVersion.HTML41_TRANSATIONAL; AbstractIndenter.inUnitTestRun = true; CssIndentTaskFactory cssFactory = new CssIndentTaskFactory(); MockMimeLookup.setInstances(MimePath.parse("text/css"), cssFactory, CssTokenId.language()); HtmlIndentTaskFactory htmlReformatFactory = new HtmlIndentTaskFactory(); MockMimeLookup.setInstances(MimePath.parse("text/html"), htmlReformatFactory, new HtmlKit("text/html"), HTMLTokenId.language()); } public static Test xsuite() { TestSuite suite = new TestSuite(); suite.addTest(new HtmlIndenterTest("testFormattingHTML04_HTML5")); return suite; } @Override protected BaseDocument getDocument(FileObject fo, String mimeType, Language language) { // for some reason GsfTestBase is not using DataObjects for BaseDocument construction // which means that for example Java formatter which does call EditorCookie to retrieve // document will get difference instance of BaseDocument for indentation try { DataObject dobj = DataObject.find(fo); assertNotNull(dobj); EditorCookie ec = dobj.getLookup().lookup(EditorCookie.class); assertNotNull(ec); return (BaseDocument)ec.openDocument(); } catch (Exception ex){ fail(ex.toString()); return null; } } @Override protected void configureIndenters(Document document, Formatter formatter, boolean indentOnly, String mimeType) { // override it because I've already done in setUp() } @Override protected boolean runInEQ() { return true; } public void testFormatting() throws Exception { // misc broken HTML: format( "<html>\n<xbody>\n<h1>Hello World!</h1>\n<p>text\n</body>", "<html>\n <xbody>\n <h1>Hello World!</h1>\n <p>text\n </body>", null); format("<html>\n<body>\n<div>\nSome text\n<!--\n Some comment\n * bullet\n * bullet2\n-->\n</div>\n</body>\n</html>\n", "<html>\n <body>\n <div>\n Some text\n <!--\n Some comment\n * bullet\n * bullet2\n -->\n </div>\n </body>\n</html>\n", null); format("<html>\n<body>\n<pre>Some\ntext which\n should not be formatted.\n \n </pre>\n</body>\n</html>\n", "<html>\n <body>\n <pre>Some\ntext which\n should not be formatted.\n \n </pre>\n </body>\n</html>\n", null); format("<html>\n<head id=someid\nclass=class/>\n<body>", "<html>\n <head id=someid\n class=class/>\n <body>",null); // there was assertion failure discovered by this test: format("<html>\n <head>\n<title>Localized Dates</title></head>", "<html>\n <head>\n <title>Localized Dates</title></head>", null); // TODO: impl this: // format("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\"http://www.w3.org/TR/html4/loose.dtd\">\n<table>", // "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n \"http://www.w3.org/TR/html4/loose.dtd\">\n<table>",null); // test tab character replacement: format( "<html>\n <body>\n\t<table>", "<html>\n <body>\n <table>", null); // new line at the end used to cause NPE: format( "<a href=\"a\"><code>Validator</code></a>\n", "<a href=\"a\"><code>Validator</code></a>\n", null); // textarea is unformattable but within single line it should have no impact: format( "<p>\nA <a href=\"b\"><textarea>c</textarea></a>d\ne<textarea>f</textarea>g\nh\n</p>", "<p>\n A <a href=\"b\"><textarea>c</textarea></a>d\n e<textarea>f</textarea>g\n h\n</p>", null); // unformattable content may contains other tags which should not be formatted: format( "<pre>\n text\n &quot;text2\n <b>smth</b>\n</pre>", "<pre>\n text\n &quot;text2\n <b>smth</b>\n</pre>", null); // unformattable content may contains other tags which should not be formatted: format( "<pre>\n text\n <textarea>text2\n smth\n </textarea>\n text3\n </pre>", "<pre>\n text\n <textarea>text2\n smth\n </textarea>\n text3\n</pre>", null); // #161341 format( "<!doctype html public \"unknown\">", "<!doctype html public \"unknown\">", null); // #161606 format( "<div style=\"\"", "<div style=\"\"", null); // #162199 format( "</body>", "</body>", null); // #164326 format( "<!DOCTYP html>", "<!DOCTYP html>", null); } public void testFormattingHTML() throws Exception { reformatFileContents("testfiles/simple.html",new IndentPrefs(4,4)); } public void testFormattingHTML01() throws Exception { reformatFileContents("testfiles/simple01.html",new IndentPrefs(4,4)); } public void testFormattingHTML02() throws Exception { reformatFileContents("testfiles/simple02.html",new IndentPrefs(4,4)); } public void testFormattingHTML03() throws Exception { reformatFileContents("testfiles/simple03.html",new IndentPrefs(4,4)); } public void testFormattingHTML04() throws Exception { reformatFileContents("testfiles/simple04.html",new IndentPrefs(4,4)); } public void testFormattingHTML05() throws Exception { reformatFileContents("testfiles/simple05.html",new IndentPrefs(4,4)); } public void testFormattingHTML06() throws Exception { reformatFileContents("testfiles/simple06.html",new IndentPrefs(4,4)); } public void testFormattingHTML07() throws Exception { // #198659 reformatFileContents("testfiles/simple07.html",new IndentPrefs(4,4)); } public void testIndentation() throws Exception { insertNewline("<html>^</html>", "<html>\n ^\n</html>", null); insertNewline(" <table>\n <tr>\n <td>^</td>\n </tr>\n</table>", " <table>\n <tr>\n <td>\n ^\n </td>\n </tr>\n</table>", null); insertNewline(" <html><table color=aaa^", " <html><table color=aaa\n ^", null); // property tag indentation: insertNewline("<html>^<table>", "<html>\n ^<table>", null); insertNewline("<html>^<table>\n<p>", "<html>\n ^<table>\n<p>", null); insertNewline("<html>\n <head>^", "<html>\n <head>\n ^", null); insertNewline("<html>\n <body>^<table>", "<html>\n <body>\n ^<table>", null); insertNewline("<html><div/>^<table>", "<html><div/>\n ^<table>", null); // tab attriutes indentation: insertNewline("<html><table^>", "<html><table\n ^>", null); insertNewline("<html>^\n <table>\n", "<html>\n ^\n <table>\n", null); //test that returning </body> tag matches opening one: insertNewline( "<html>\n <body>\n <h1>Hello World!</h1>\n <p>text^</body>", "<html>\n <body>\n <h1>Hello World!</h1>\n <p>text\n ^</body>", null); insertNewline( "<html><body><table><tr> <td>aa^</td></tr></table>", "<html><body><table><tr> <td>aa\n ^</td></tr></table>", null); insertNewline( " <html><body><table><tr> <td>aa^</td></tr></table>", " <html><body><table><tr> <td>aa\n ^</td></tr></table>", null); insertNewline( " <html><body><table><tr> <td\n style=\"xx\">aa^</td></tr></table>", " <html><body><table><tr> <td\n style=\"xx\">aa\n ^</td></tr></table>", null); insertNewline( " <html><body><table><tr> <td\n style=\"xx\">aa^</td></tr></table>", " <html><body><table><tr> <td\n style=\"xx\">aa\n ^</td></tr></table>", null); insertNewline( "<html>\n <body><table><tr> <td>a\n ^</td></tr></table>", "<html>\n <body><table><tr> <td>a\n \n ^</td></tr></table>", null); // misc invalid HTML doc formatting: insertNewline( "<html>\n <xbody>\n <h1>Hello World!</h1>\n <p>text\n^</body>", "<html>\n <xbody>\n <h1>Hello World!</h1>\n <p>text\n\n ^</body>", null); // #149719 insertNewline( "<tr>some text^\n</tr>", "<tr>some text\n ^\n</tr>", null); // #120136 insertNewline( "<meta ^http-equiv=\"Content-Type\" content=\"text/html; charset=US-ASCII\">", "<meta \n ^http-equiv=\"Content-Type\" content=\"text/html; charset=US-ASCII\">", null); // those two tests are for particular condition in AI.calculateLineIndent(): insertNewline( " <table><tr><td>a^</td>", " <table><tr><td>a\n ^</td>", null); insertNewline( " <table><tr><td>a\n ^</td>", " <table><tr><td>a\n \n ^</td>", null); insertNewline( " <p>\n <table>\n <tbody>^</table>", " <p>\n <table>\n <tbody>\n ^</table>", null); insertNewline( "<html> <!--^comment", "<html> <!--\n ^comment", null); insertNewline( "<html> <!--\n ^comment", "<html> <!--\n \n ^comment", null); insertNewline( "<html>\n <!--\n comment\n -->\n^", "<html>\n <!--\n comment\n -->\n\n ^", null); insertNewline( " <html\n a=b\n c=d^", " <html\n a=b\n c=d\n ^", null); insertNewline( " <html\n a=b\n c=d>^", " <html\n a=b\n c=d>\n ^", null); // #160646 - check that unneeded tags are eliminated but // used to close tag with optional end: insertNewline( " <p>\n <table>\n </table>^", " <p>\n <table>\n </table>\n ^", null); // #160651 insertNewline( "<html>^<style>", "<html>\n ^<style>", null); // #161105 insertNewline( "<html><head><title>aa</title></head>\n <body>\n <table>\n <tr>\n <td><b>bold</b></td><td>^</td>", "<html><head><title>aa</title></head>\n <body>\n <table>\n <tr>\n <td><b>bold</b></td><td>\n ^\n </td>", null); // test that table within p does not get eliminated and if it does it is handled properly; // there was a problem that eliminated p would try to close p tag at the end insertNewline( "<html>\n <body>\n <table>\n <tr>\n <td><table></table><p>text^", "<html>\n <body>\n <table>\n <tr>\n <td><table></table><p>text\n ^", null); //#162945 insertNewline( "<style>^</style>", "<style>\n ^\n</style>", null); //#162913 insertNewline( "<Table>\n <tr><td></td></tr>\n</table>^", "<Table>\n <tr><td></td></tr>\n</table>\n^", null); //#163238 insertNewline( "<table width = '100%'><tr><td id='picture'>^</a></td></tr></table>", "<table width = '100%'><tr><td id='picture'>\n ^</a></td></tr></table>", null); } public void testFormattingHTML04_HTML5() throws Exception { reformatFileContents("testfiles/simple04_html5.html",new IndentPrefs(4,4)); } }
101ab1daa866dee042d8faa0cea516a1d97ef979
9a515a2e2073641e4b5b106423d0ebda74061c27
/src/ch5/ArrayEx9.java
4b7909460c7aebf6e926368e98a199865668f6a7
[]
no_license
jjy3385/StandardOfJava
42c0c5d91dc6fc83021349cfb995cd45d0026421
fdca8ab2b878a84a4efa1f42c425dd367948b662
refs/heads/main
2023-04-28T07:42:24.027313
2021-05-18T12:59:30
2021-05-18T12:59:30
359,648,304
1
0
null
null
null
null
UTF-8
Java
false
false
395
java
package ch5; import java.util.Arrays; public class ArrayEx9 { public static void main(String[] args) { int[] code = {-4,-1,3,6,11}; int[] arr = new int[10]; for (int i = 0; i < arr.length; i++) { int tmp = (int)(Math.random() * code.length); arr[i] = code[tmp]; } System.out.println(Arrays.toString(arr)); } }
5a2fedf91fa00873a5af7905bb06b0fab5803900
4186d356128a583eb0608815fd83642ad58b3c69
/10.5.fragment5/src/main/java/com/example/a105fragment5/AllFragment.java
e9ebebdb7e110b05845ddacdefffbedf83c78087
[]
no_license
14masterblaster14/MyTesting
1eb1fa06bb82dfe8d8ca01981a61c459de7418d7
c3d15dc47004836864cd65498807ffa63ee2f9ad
refs/heads/master
2021-01-19T10:53:39.332563
2017-09-20T19:03:50
2017-09-20T19:03:50
64,594,736
1
0
null
null
null
null
UTF-8
Java
false
false
1,820
java
package com.example.a105fragment5; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; /** * A simple {@link Fragment} subclass. */ public class AllFragment extends Fragment { public static final String KEY_IMAGE = "image"; public static final String KEY_MY_DATA = "myData"; public AllFragment() { // Required empty public constructor } public static AllFragment getInstance(int image, String message) { AllFragment fragment = new AllFragment(); Bundle bundle = new Bundle(); bundle.putInt(KEY_IMAGE, image); bundle.putString(KEY_MY_DATA, message); fragment.setArguments(bundle); return fragment; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment // return inflater.inflate(R.layout.fragment_all, container, false); View rootView = inflater.inflate(R.layout.fragment_all, container, false); ((ImageView) rootView.findViewById(R.id.imageView)).setImageResource(getArguments().getInt(KEY_IMAGE)); setText(rootView); return rootView; } private void setText(View rootView) { Bundle bundle = getArguments(); if (bundle != null) { // TextView textView = (TextView) rootView.findViewById(R.id.All_Txt); // textView.setText(bundle.getString("myData")); // Inline code for above 2 lines ((TextView) rootView.findViewById(R.id.All_Txt)).setText(bundle.getString(KEY_MY_DATA)); } } }
5d22e6f607263baca475be671eeb95ea86b11a7d
673525098c0c72b0e8512e6d8eb45fdac7ba476b
/src/designpattern/decorator/PlainBeverage.java
287a0e2e232da8b0ac0e683bf1fb5b599e71058e
[]
no_license
archanarai2211/Algo
73abdf0bfadb6f3fedd274a699545ea45d90bb79
085cce04dd30144df734d71762499ccd305d604c
refs/heads/master
2023-04-08T02:48:40.895850
2021-04-19T11:16:34
2021-04-19T11:16:34
311,869,966
0
0
null
2021-04-19T11:16:34
2020-11-11T05:16:01
null
UTF-8
Java
false
false
237
java
package designpattern.decorator; public class PlainBeverage implements Beverage{ @Override public String getDescription() { return "Plain"; } @Override public Integer getCost() { return 5; } }
d42d54c91d63d36bd2e63c3ead38af7cb98df401
95091380a1271516ef5758768a15e1345de75ef1
/src/org/omg/PortableServer/POAPackage/InvalidPolicy.java
81626e58b20b69e4766f9d17656c0449ea5d5cfc
[]
no_license
auun/jdk-source-learning
575c52b5b2fddb2451eea7b26356513d3e6adf0e
0a48a0ce87d08835bd9c93c0e957a3f3e354ef1c
refs/heads/master
2020-07-20T21:55:15.886061
2019-09-06T06:06:56
2019-09-06T06:06:56
206,714,837
0
0
null
null
null
null
UTF-8
Java
false
false
792
java
package org.omg.PortableServer.POAPackage; /** * org/omg/PortableServer/POAPackage/InvalidPolicy.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /build/java8-openjdk/src/jdk8u-jdk8u222-b05/corba/src/share/classes/org/omg/PortableServer/poa.idl * Tuesday, June 18, 2019 10:26:12 AM CEST */ public final class InvalidPolicy extends org.omg.CORBA.UserException { public short index = (short)0; public InvalidPolicy () { super(InvalidPolicyHelper.id()); } // ctor public InvalidPolicy (short _index) { super(InvalidPolicyHelper.id()); index = _index; } // ctor public InvalidPolicy (String $reason, short _index) { super(InvalidPolicyHelper.id() + " " + $reason); index = _index; } // ctor } // class InvalidPolicy
5e778acda469a6d566c4dc9bab81656c9c3e0a6d
7791973ca350994b734557803f91a3fd47ea1c02
/Strings/smallestwindowinastring.java
b0b753bf26ae8f34bc20663fe9480ea72f4e84ea
[]
no_license
gupta29470/Practice
4713ae02a5ab84c6783d711d53df227d9060604a
81676b21fbf0191f8ded836d19f0c280b4bda1cd
refs/heads/master
2023-07-03T15:52:49.832892
2021-08-17T08:49:05
2021-08-17T08:49:05
357,317,997
0
0
null
null
null
null
UTF-8
Java
false
false
3,113
java
public class smallestwindowinastring { static final int no_of_chars = 256; // Function to find smallest window containing // all characters of 'pat' static String findSubString(String str, String pat) { int len1 = str.length(); int len2 = pat.length(); // check if string's length is less than pattern's // length. If yes then no such window can exist if (len1 < len2) { System.out.println("No such window exists"); return ""; } int hash_pat[] = new int[no_of_chars]; int hash_str[] = new int[no_of_chars]; // store occurrence ofs characters of pattern for (int i = 0; i < len2; i++) hash_pat[pat.charAt(i)]++; int start = 0, start_index = -1, min_len = Integer.MAX_VALUE; // start traversing the string int count = 0; // count of characters for (int j = 0; j < len1 ; j++) { // count occurrence of characters of string hash_str[str.charAt(j)]++; // If string's char matches with pattern's char // then increment count if (hash_pat[str.charAt(j)] != 0 && hash_str[str.charAt(j)] <= hash_pat[str.charAt(j)] ) count++; // if all the characters are matched if (count == len2) { // Try to minimize the window i.e., check if // any character is occurring more no. of times // than its occurrence in pattern, if yes // then remove it from starting and also remove // the useless characters. while ( hash_str[str.charAt(start)] > hash_pat[str.charAt(start)] || hash_pat[str.charAt(start)] == 0) { if (hash_str[str.charAt(start)] > hash_pat[str.charAt(start)]) hash_str[str.charAt(start)]--; start++; } // update window size int len_window = j - start + 1; if (min_len > len_window) { min_len = len_window; start_index = start; } } } // If no window found if (start_index == -1) { System.out.println("No such window exists"); return ""; } // Return substring starting from start_index // and length min_len return str.substring(start_index, start_index + min_len); } // Driver Method public static void main(String[] args) { String str = "this is a test string"; String pat = "tist"; System.out.print("Smallest window is :\n " + findSubString(str, pat)); } }
d86cc45a85ed4edff1d107085f6fac4d850ce308
1ecd3e4fddec6143b35dbed78be2fb8dbd7f2ca6
/springboot/14.SpringBoot-Email/src/main/java/com/yangonion/email/EmailApplication.java
812b42712fb3c84f1dac75f9f766d6a20e903eeb
[ "Apache-2.0" ]
permissive
Yang-Onion/JavaWorkSpace
2326ec270f2ec54d31cd1da5eaeef0cc1aa7012a
23a4fdd964b456c9fdd787017ae5707fd92620bc
refs/heads/master
2020-03-25T13:26:01.897743
2018-11-22T09:58:10
2018-11-22T09:58:10
143,824,614
0
0
null
null
null
null
UTF-8
Java
false
false
309
java
package com.yangonion.email; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class EmailApplication { public static void main(String[] args) { SpringApplication.run(EmailApplication.class, args); } }
7cc775becde632be92998fa62ac3c63afcca826b
4950d63358a563ada9617b897320898f3a3602b6
/app/src/main/java/com/effone/viewpageholder/model/Sample.java
df8ee251b7f19b393bd6cc41ae6f9c47b0ac49f0
[]
no_license
sumanthkumarps/ViewPageHolder
a16bc5e97f5a4877422ba13acafcfe4aea39d554
87e91570c85cd91f15f64184697dda1dd8226362
refs/heads/master
2021-06-16T16:22:25.967217
2017-05-23T09:24:25
2017-05-23T09:24:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
281
java
package com.effone.viewpageholder.model; /** * Created by sumanth.peddinti on 5/10/2017. */ public class Sample { private Menu Menu; public Menu getMenu () { return Menu; } public void setMenu (Menu Menu) { this.Menu = Menu; } }
0c1701cd4511b5feb9525dd01cc27a56bd75f5a9
f38284e3548a8ba7ed84eb3f08acf28db076bd75
/src/patterns/observer/core/Observer.java
bc70205b840e3e99ae1039b14a18993d07582e49
[]
no_license
PabloCedenoCR/DesignPatterns
f7d04a5cf08a8b0cd6a506934bb7aca12f8a1f96
519d91086ca4b27d1c0ceb8cd87993aa5bf679fc
refs/heads/master
2020-04-23T23:23:29.501530
2019-03-07T18:11:38
2019-03-07T18:11:38
171,528,532
0
0
null
null
null
null
UTF-8
Java
false
false
290
java
package patterns.observer.core; import java.util.Observable; public class Observer implements java.util.Observer { @Override public void update(Observable subject, Object arg) { System.out.println("**** " + this.hashCode() + " - Subject: " + subject + " - Value: " + arg); } }
32d3050fe311788af55c85011a717103a9fca886
d6ff89ae061592fee66873a62834409b9b096bcc
/mini-pms-24-b-client/app/src/main/java/com/eomcs/pms/dao/mariadb/ProjectDaoImpl.java
bfc192cc23f885ddc6fd70c3745942727bc5cc6c
[]
no_license
eomcs/eomcs-java-project-2021
a2f7dbffc78b2112769a2c8a0a29eccf6184a040
5a592d4e95c302b2a0da98ef10f3cb6c70511464
refs/heads/master
2023-06-12T20:13:09.070353
2021-07-08T07:01:06
2021-07-08T07:01:06
314,989,117
3
4
null
null
null
null
UTF-8
Java
false
false
3,336
java
package com.eomcs.pms.dao.mariadb; import java.util.HashMap; import java.util.List; import org.apache.ibatis.session.SqlSession; import com.eomcs.pms.dao.ProjectDao; import com.eomcs.pms.domain.Member; import com.eomcs.pms.domain.Project; public class ProjectDaoImpl implements ProjectDao { SqlSession sqlSession; public ProjectDaoImpl(SqlSession sqlSession) throws Exception { this.sqlSession = sqlSession; } @Override public int insert(Project project) throws Exception { // 1) 프로젝트 정보를 입력한다. int count = sqlSession.insert("ProjectMapper.insert", project); // 2) 프로젝트의 팀원 정보를 입력한다. // for (Member member : project.getMembers()) { // insertMember(project.getNo(), member.getNo()); // } insertMembers(project.getNo(), project.getMembers()); return count; } @Override public List<Project> findByKeyword(String item, String keyword) throws Exception { HashMap<String,Object> params = new HashMap<>(); params.put("item", item); params.put("keyword", keyword); return sqlSession.selectList("ProjectMapper.findByKeyword", params); } @Override public List<Project> findByKeywords(String title, String owner, String member) throws Exception { HashMap<String,Object> params = new HashMap<>(); params.put("title", title); params.put("owner", owner); params.put("member", member); return sqlSession.selectList("ProjectMapper.findByKeywords", params); } @Override public Project findByNo(int no) throws Exception { return sqlSession.selectOne("ProjectMapper.findByNo", no); } @Override public int update(Project project) throws Exception { // 1) 프로젝트 정보를 변경한다. int count = sqlSession.update("ProjectMapper.update", project); // 2) 프로젝트의 기존 멤버를 모두 삭제한다. deleteMembers(project.getNo()); // 3) 프로젝트 멤버를 추가한다. // for (Member member : project.getMembers()) { // insertMember(project.getNo(), member.getNo()); // } insertMembers(project.getNo(), project.getMembers()); return count; } @Override public int delete(int no) throws Exception { // 1) 프로젝트에 소속된 팀원 정보 삭제 deleteMembers(no); // 2) 프로젝트 삭제 return sqlSession.delete("ProjectMapper.delete", no); } @Override public int insertMember(int projectNo, int memberNo) throws Exception { HashMap<String,Object> params = new HashMap<>(); params.put("projectNo", projectNo); params.put("memberNo", memberNo); return sqlSession.insert("ProjectMapper.insertMember", params); } @Override public int insertMembers(int projectNo, List<Member> members) throws Exception { HashMap<String,Object> params = new HashMap<>(); params.put("projectNo", projectNo); params.put("members", members); return sqlSession.insert("ProjectMapper.insertMembers", params); } @Override public List<Member> findAllMembers(int projectNo) throws Exception { return sqlSession.selectList("ProjectMapper.findAllMembers", projectNo); } @Override public int deleteMembers(int projectNo) throws Exception { return sqlSession.delete("ProjectMapper.deleteMembers", projectNo); } }
785f270fe182734a1d22434770ddb2a363af9a54
c8c9523fada3abd62c900d326b4d114f88cd46d4
/02_Source/DIASORIN_OA_SYSTEM/src/main/java/com/diasorin/oa/dao/impl/AuthorityManagementDaoImpl.java
3fb05067d8b6db8fb8d5825a43f604b2baeeda53
[]
no_license
Richard1112/DiaSorin-2016
1695f2e64e450d1464154da6388d5602339dba31
4bc3eeb4589ee8e8a823745ed172eefcc39b50e5
refs/heads/master
2021-01-10T15:27:25.793940
2016-01-05T03:26:12
2016-01-05T03:26:12
48,982,713
0
0
null
null
null
null
UTF-8
Java
false
false
3,974
java
package com.diasorin.oa.dao.impl; import java.util.ArrayList; import java.util.List; import javax.persistence.Query; import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; import com.diasorin.oa.common.QueryResult; import com.diasorin.oa.dao.AuthorityManagementDao; import com.diasorin.oa.model.SysEmployeeAuthority; import com.diasorin.oa.model.SysEmployeeRole; @Component public class AuthorityManagementDaoImpl extends BaseDaoImpl implements AuthorityManagementDao { @Override public QueryResult<SysEmployeeRole> roleListQuery(String roleName, int first, int count) throws Exception { try { String sql = " "; List<String> param = new ArrayList<String>(); if (StringUtils.hasText(roleName)) { sql += " and o.roleName like ? "; param.add("%"+roleName+"%"); } QueryResult<SysEmployeeRole> qs = getScrollData( SysEmployeeRole.class, first, count, sql, param.toArray()); return qs; } catch(Exception e) { throw e; } } @Override public SysEmployeeRole getRoleInfo(String roleId) throws Exception { try { String sql = " "; List<String> param = new ArrayList<String>(); sql += " and o.roleCode = ? "; param.add(roleId); QueryResult<SysEmployeeRole> qs = getScrollData(SysEmployeeRole.class, sql, param.toArray()); if (qs.getResultlist().size() > 0) { return qs.getResultlist().get(0); } return null; } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") @Override public String getMaxRoleCode() throws Exception { try { String sqlString = "select max(roleCode) as maxCode from t_sys_employee_role "; Query query = em.createNativeQuery(sqlString); List list = query.getResultList(); if (list == null || list.size() == 0) { return null; } else { return list.get(0).toString(); } } catch (Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List<SysEmployeeAuthority> getAuthorityList(int start, int result) throws Exception { try { String sqlString = "select " + "deptCode, " + "roleCode " + "from t_sys_employee_authority " + "group by deptCode,roleCode "; Query query = em.createNativeQuery(sqlString); query.setFirstResult(start).setMaxResults(result); List list = query.getResultList(); String[] fields = { "deptCode", "roleCode" }; List resultList = bindDataToDTO(list, new SysEmployeeAuthority(), fields); return resultList; } catch (Exception e) { throw e; } } @Override public Long getAuthorityListCount() throws Exception { try { String sqlString = "select count(*) from (select " + "deptCode, " + "roleCode " + "from t_sys_employee_authority " + "group by deptCode,roleCode) a "; Query query = em.createNativeQuery(sqlString); return Long.valueOf(query.getSingleResult().toString()); } catch (Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List<SysEmployeeAuthority> getAuthorityListByCondition( String deptId, String roleId) throws Exception { try { List<String> param = new ArrayList<String>(); String sqlString = "select " + "? as deptCode, " + "? as roleCode, " + "b.controlId, " + "IFNULL(a.authority, '') as authority " + "from t_sys_module_info b " + "left join t_sys_employee_authority a on a.controlId = b.controlId and a.deptCode = ? and a.roleCode = ?" +""; Query query = em.createNativeQuery(sqlString); param.add(deptId); param.add(roleId); param.add(deptId); param.add(roleId); setQueryParams(query, param.toArray()); List list = query.getResultList(); String[] fields = { "deptCode", "roleCode","controlId","authority" }; List resultList = bindDataToDTO(list, new SysEmployeeAuthority(), fields); return resultList; } catch (Exception e) { throw e; } } }
a00e6303e4358028d50d429a50ee065608d3d9a2
75b97565c290fb26bafdafb055f9d93bd6ecdba9
/src/main/java/com/example/foreigncurrencyexchange/model/LoadedModel.java
800861f667dba130c5cb2f9a329b01fefe9ee71b
[]
no_license
ivaka4/foreigncurrencyexchange
ace156e8b02be29dd033e62694cef7e5807976b1
9bb94fb4693526ad76efd9993657ce44d070e745
refs/heads/main
2023-07-13T11:12:29.031481
2021-08-11T08:16:58
2021-08-11T08:16:58
394,915,547
0
0
null
null
null
null
UTF-8
Java
false
false
1,308
java
package com.example.foreigncurrencyexchange.model; import com.example.foreigncurrencyexchange.util.Currency; import java.math.BigDecimal; import java.time.LocalDate; public class LoadedModel { private Currency fromCurrency; private Currency toCurrency; private BigDecimal exchangeRate; private LocalDate date; public LoadedModel() { } public LoadedModel(Currency fromCurrency, Currency toCurrency, BigDecimal exchangeRate, LocalDate date) { this.fromCurrency = fromCurrency; this.toCurrency = toCurrency; this.exchangeRate = exchangeRate; this.date = date; } public Currency getFromCurrency() { return fromCurrency; } public void setFromCurrency(Currency fromCurrency) { this.fromCurrency = fromCurrency; } public Currency getToCurrency() { return toCurrency; } public void setToCurrency(Currency toCurrency) { this.toCurrency = toCurrency; } public BigDecimal getExchangeRate() { return exchangeRate; } public void setExchangeRate(BigDecimal exchangeRate) { this.exchangeRate = exchangeRate; } public LocalDate getDate() { return date; } public void setDate(LocalDate date) { this.date = date; } }
c531dd8b4b3555e1cc35a15ed1be4b8d865e3901
e77ae6642255bb08b338e0a0c52dccfa133bc497
/20170328/day22-20170409/src/setDemo/TreeSetDemo02.java
101cbd4fddfc14c096c4c2f6e37b119f4b246944
[]
no_license
gujiacun/Homework
a20bc47a89738c85e978af26b32cc8c8df0ff276
e263434724219fb35c3745474b1971758d874fdc
refs/heads/master
2021-01-19T20:06:02.161355
2017-05-22T18:02:52
2017-05-22T18:02:52
88,486,667
0
0
null
null
null
null
UTF-8
Java
false
false
2,837
java
package setDemo; //需求:在另一个类TreeSetDemo的基础上,按照人名的长度来排序,即自定义排序 //步骤:(1)新建三个类,测试类,自定义对象类BigStudent,实现比较器类judge //(2)在BigStudent类建姓名,年龄字段。在judge实现comparator类,重写compare方法 //(3)在测试类建TreeSet对象时通过构造器传入比较器类的对象 //(4)往TreeSet对象添加对象类的对象(即集合的元素) //(5)打印 import java.util.Comparator; import java.util.Set; import java.util.TreeSet; //由于要实现对象的定制排序,先把传入TreeSet集合的对象的类实现Comparator接口,再重写comapre方法 //对象类(学生及其信息) class BigStudent { // 学生信息 String name; int age; // 根据信息(字段)创建带参构造器,在创建对象时直接传入参数 public BigStudent(String name, int age) { this.name = name; this.age = age; } // 注意要重写toString方法,否则会输出内存地址 @Override public String toString() { return "name:" + this.name + " age:" + this.age; } } // 比较器类judge,实现comparator接口 class Judge implements Comparator<BigStudent> { // 重写comapre方法 @Override public int compare(BigStudent o1, BigStudent o2) { if (o1.name.length() > o2.name.length()) { return -1; } else if (o1.name.length() < o2.name.length()) { return 1; } else { return 0; } } } // 测试类 public class TreeSetDemo02 { // 主方法 public static void main(String[] args) { // 创建judge类(比较器类)的对象 Judge judge = new Judge(); // 建TreeSet对象,TreeSet(Comparator<? super E> comparator) // 此构造方法表示构造一个新的空 TreeSet,它根据指定比较器进行排序 Set<BigStudent> tree = new TreeSet<>(judge); // 建BigStudent的对象 BigStudent jack = new BigStudent("西方记者Wallace", 20); BigStudent mary = new BigStudent("香港记者张宝华", 21); BigStudent frog = new BigStudent("上海书记", 999); BigStudent girl = new BigStudent("苗族辣妹", 50); // 传入tree中 tree.add(jack); tree.add(girl); tree.add(frog); tree.add(mary); // TreeSet判断两个对象是否为同一个的规则是看compareTo/compare的返回值是不是0 // 由于上海书记 和 苗族辣妹 长度一样,返回0,判定为同一个对象,后来者覆盖了前者 System.out.println(tree); } } /** * 小结:仔细掌握TreeSet的自然排序和定制排序的步骤和过程,和HashSet判定是否为相同对象作比较 */
6dada0c6921a21f8496dde2e040011f1a93b7d54
36b7d94e1e5844ed5c9f603c04aafaca57b17746
/Week4/reverseLinkedList.java
bb43b5f0668cae26f3c0b5a5e974337cfb30ff7f
[]
no_license
DamionMcKenzie/Wallbreakers
2bb1a68bb34810cebce93ad7c1ad9d3ff2eb388e
41f1e7f504b3b62579390c00b765b18ef99f981e
refs/heads/master
2020-06-30T19:34:34.663791
2019-08-06T23:34:23
2019-08-06T23:34:23
194,485,089
0
0
null
null
null
null
UTF-8
Java
false
false
577
java
package Week4; /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ class Solution { public ListNode reverseList(ListNode head) { ListNode reverse = reversed(head); return reverse; } ListNode reversed(ListNode node){ ListNode head = null; while(node != null){ ListNode n = new ListNode(node.val); n.next = head; head = n; node = node.next; } return head; } }
362c829b8459c039265f64d4374d65f29c30b73f
7968e030e63c2c64c47967aab3c250c720b8e870
/jdbc2020720/src/jdbc_test.java
de8d8c2e11b0d1a120b9c1a016ff829ee71797c4
[]
no_license
00yang/leetcodedaily
3bff6552035916b8f1a34de970f937553f85a969
7da7e7fe81fd9f19d2a73b90b9f386fcb97c6105
refs/heads/master
2023-01-23T07:32:41.626480
2020-11-13T05:51:14
2020-11-13T05:51:14
309,957,650
0
0
null
null
null
null
UTF-8
Java
false
false
894
java
import java.sql.*; public class jdbc_test { public static void main(String[] args) { boolean loginflag =new jdbc_test().login("li","111"); System.out.println(loginflag); } public boolean login(String username,String password){ if(username == null||password == null){ return false; } Connection conn = null; Statement stmt = null; ResultSet rs = null; try{ conn = JDBCUtils.getConnection(); String sql = "select * from userinfo where name = '"+username+"' and password = '"+password+"'"; stmt = conn.createStatement(); rs = stmt.executeQuery(sql); return rs.next(); }catch (SQLException e){ e.printStackTrace(); }finally { JDBCUtils.close(rs,stmt,conn); } return false; } }
589158a00f25c1e14ee5a6424542ee793b523fb5
307dfcff753cb98a1cc2c1a6032301299e70e1e9
/src/main/java/org/jnaalisv/bookstore/web/interfaces/BookstoreWebResources.java
0283ae6a2ebcb2eea981f716466631cb13f057df
[]
no_license
jnaalisv/bookstore
3fb69d57aadc2bf7697c6cb0e0ed4678b94d533c
c041023aed4e83f0d138b5eec2aa327553832ea1
refs/heads/master
2020-09-21T17:28:05.346368
2016-08-26T12:59:10
2016-08-26T12:59:10
66,623,531
0
0
null
null
null
null
UTF-8
Java
false
false
120
java
package org.jnaalisv.bookstore.web.interfaces; public interface BookstoreWebResources { String BOOKS = "/books"; }
928da6e7339407f9c3e5fd749be7a848cdc77b2f
f98c7769a49f2daa95261782062f53f22321da47
/src/test/java/com/mmall/service/test/ProductServiceTest.java
2584ddfe385d8e84940d8d1d1d87613b3c916235
[ "Apache-2.0" ]
permissive
lidingkui0313/mmall
86476ed8a7a5581ea13c5437938fad5b19c83ee2
d3619b5d0ca01f821598f9545e4dd48c7534dda9
refs/heads/master
2020-03-26T01:22:35.229836
2018-08-13T13:05:58
2018-08-13T13:05:58
144,364,344
0
0
null
null
null
null
UTF-8
Java
false
false
1,017
java
package com.mmall.service.test; import com.github.pagehelper.PageInfo; import com.google.common.collect.Lists; import com.mmall.common.ServerResponse; import com.mmall.test.TestBase; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; /** * Created by geely */ public class ProductServiceTest extends TestBase { @Autowired private IProductService iProductService; @Test public void testIProductService(){ ServerResponse<PageInfo> result = iProductService.getProductByKeywordCategory("iphone",2,1,5,"price_desc"); System.out.println(result); } public static void main(String[] args) { List<String> images = Lists.newArrayList(); images.add("mmall/aa.jpg"); images.add("mmall/bb.jpg"); images.add("mmall/cc.jpg"); images.add("mmall/dd.jpg"); images.add("mmall/ee.jpg"); // ["mmall/aa.jpg","mmall/bb.jpg","mmall/cc.jpg","mmall/dd.jpg","mmall/ee.jpg"] } }
845061a7696991d928b12bcab25ebe7151a04e60
51c3050325d2584824915efba70f003dd943ffa6
/app/src/androidTest/java/com/yywf/ExampleInstrumentedTest.java
daf19b46385703508cb164c070d00c96a3324c81
[]
no_license
beyond-snail/xywf
2fff68e7e47238b8bae2256968adae52261844c2
87888ba76d1a8b3d86276a55aff625eeea406042
refs/heads/master
2021-05-06T07:04:48.164434
2018-10-29T08:23:16
2018-10-29T08:23:16
113,928,842
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package com.yywf; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation 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() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.yywf", appContext.getPackageName()); } }
[ "wu15979937502" ]
wu15979937502
00b9395acee84e530264ddacaad0f0415e28ffa6
9a3703972469a5a650750e50a249b150853a65f1
/app/src/main/java/com/example/blue/iamceo/Adapter/CeoAdapter.java
19c3c09a9338984ac1a0178ef32131b7c80c998e
[]
no_license
bluebamboo11/IAMCEO
5831c02e29d98c9852babc690212be53625a6376
b860e23d6df21cc9d3d39caaaf205016472ebe70
refs/heads/master
2021-01-23T05:19:12.327047
2017-03-27T03:57:22
2017-03-27T03:57:22
86,288,439
0
0
null
null
null
null
UTF-8
Java
false
false
5,192
java
package com.example.blue.iamceo.Adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import com.example.blue.iamceo.R; import com.example.blue.iamceo.SaveLoadPreferences; /** * Created by blue on 17/03/2017. */ public class CeoAdapter extends RecyclerView.Adapter<CeoAdapter.ViewHolder> { Context context; public CeoAdapter(Context context) { this.context = context; } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View itemView = inflater.inflate(R.layout.item_ceo, parent, false); return new ViewHolder(itemView); } @Override public void onBindViewHolder(ViewHolder holder, int position) { SaveLoadPreferences saveLoadPreferences=new SaveLoadPreferences(context); holder.txtTongNguoi.setText("Nhan su "+saveLoadPreferences.loadInteger(SaveLoadPreferences.TONG_NGUOI,8)); holder.txtTongTien.setText("Von "+saveLoadPreferences.loadInteger(SaveLoadPreferences.TONG_TIEN,100000)); holder.txtTongNgay.setText("Day "+saveLoadPreferences.loadInteger(SaveLoadPreferences.TONG_NGAY,1)); holder.txtTongLV.setText("Lv "+saveLoadPreferences.loadInteger(SaveLoadPreferences.TONG_LV,1)); holder.txtTongNextLV.setText("Next lv "+saveLoadPreferences.loadInteger(SaveLoadPreferences.TONG_LV,1)*100000); holder.txtKyThuatNguoi.setText("Nhan su "+saveLoadPreferences.loadInteger(SaveLoadPreferences.KY_THUAT_NGUOI,6)); holder.txtKyThuatLV.setText("Lv "+saveLoadPreferences.loadInteger(SaveLoadPreferences.KY_THUAT_LV,1)); holder.txtKyThuatNextLV.setText("Next lv "+saveLoadPreferences.loadInteger(SaveLoadPreferences.TONG_LV,1)*10000); holder.txtNhanSuNguoi.setText("Nhan su "+saveLoadPreferences.loadInteger(SaveLoadPreferences.NHAN_SU_NGUOI,2)); holder.txtNhanSuLV.setText("Lv "+saveLoadPreferences.loadInteger(SaveLoadPreferences.NHAN_SU_LV,1)); holder.txtNhanSuNextLv.setText("Next lv "+saveLoadPreferences.loadInteger(SaveLoadPreferences.TONG_LV,1)*1000); holder.txtNghienCuuNguoi.setText("Nhan su "+saveLoadPreferences.loadInteger(SaveLoadPreferences.NGHIEN_CUU_NGUOI,1)); holder.txtNghienCuuLV.setText("Lv "+saveLoadPreferences.loadInteger(SaveLoadPreferences.NGHIEN_CUU_LV,1)); holder.txtNghienCuuNextLV.setText("Next lv "+saveLoadPreferences.loadInteger(SaveLoadPreferences.TONG_LV,1)*1000); holder.txtTenCongTY.setText("Cong ty "+saveLoadPreferences.loadString(SaveLoadPreferences.TEN_CONG_TY,"Apple")); } @Override public int getItemCount() { return 1; } public class ViewHolder extends RecyclerView.ViewHolder { TextView txtTongNguoi; TextView txtTongTien; TextView txtTongNgay; TextView txtTongLV; TextView txtTongNextLV; TextView txtKyThuatNguoi; TextView txtKyThuatLV; TextView txtKyThuatNextLV; TextView txtNhanSuNguoi; TextView txtNhanSuLV; TextView txtNhanSuNextLv; TextView txtNghienCuuNguoi; TextView txtNghienCuuLV; TextView txtNghienCuuNextLV; TextView txtTenCongTY; Button btnUpTong; Button btnUpKYThuat; Button btnUpNhanSu; Button btnUpNghienCuu; public ViewHolder(View itemView) { super(itemView); txtTongTien = (TextView) itemView.findViewById(R.id.txt_tongtien); txtTongNguoi = (TextView) itemView.findViewById(R.id.txt_tongNhanSu); txtTongLV = (TextView) itemView.findViewById(R.id.txt_Tonglv); txtTongNextLV = (TextView) itemView.findViewById(R.id.txt_nextLvTong); txtKyThuatNguoi = (TextView) itemView.findViewById(R.id.txt_nhansuKT); txtKyThuatLV = (TextView) itemView.findViewById(R.id.txt_lvKyThuat); txtTongNgay = (TextView) itemView.findViewById(R.id.txt_tongNgay); txtKyThuatNextLV = (TextView) itemView.findViewById(R.id.txt_nextlvKT); txtNhanSuNguoi = (TextView) itemView.findViewById(R.id.txt_nhansuNS); txtNhanSuLV = (TextView) itemView.findViewById(R.id.txt_lvNHansu); txtNhanSuNextLv = (TextView) itemView.findViewById(R.id.txt_nextLVNS); txtNghienCuuNguoi = (TextView) itemView.findViewById(R.id.txt_nhansuST); txtNghienCuuLV = (TextView) itemView.findViewById(R.id.txt_lvSangTao); txtNghienCuuNextLV = (TextView) itemView.findViewById(R.id.txt_nextLvST); txtTenCongTY = (TextView) itemView.findViewById(R.id.txt_tencongty); btnUpTong = (Button) itemView.findViewById(R.id.btn_nextLvTong); btnUpKYThuat = (Button) itemView.findViewById(R.id.btn_nextLvKT); btnUpNhanSu = (Button) itemView.findViewById(R.id.btn_nextLvNS); btnUpNghienCuu = (Button) itemView.findViewById(R.id.btn_nextLvSt); } } }
818760f55e3511a8fc845fc4746d0077fec643ce
b66d8fe1a1968794660d8721a9c8021cd681f4cc
/sponsor-management/src/main/java/whz/pti/swt/sponsormanagement/sponsor/queries/FindSponsorQuery.java
885048cbf25a907b791a7d0a4e9b55ccd5b08b1b
[]
no_license
mendigulovan/masterProject
481b87b3b15b7dfe1572fdb6e3883a6ef04e6f10
68a248ec3c68321656bb5ca8019809fbabbfcf31
refs/heads/master
2023-07-13T22:46:39.802493
2021-08-18T15:38:30
2021-08-18T15:38:30
397,650,861
0
0
null
null
null
null
UTF-8
Java
false
false
248
java
package whz.pti.swt.sponsormanagement.sponsor.queries; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor public class FindSponsorQuery { private String id; }
1bbd67ec38813a78c93729b5bc417a0c2dfd205a
4959dcaf240badfcde1bb3de484dad7bf6dd88c6
/Java/CS_115/23.java
5f34bbc4f03931b8d0b0fcb0f07a121f866c37bf
[]
no_license
awoltman/Computer_Science
1025540f5cd087b8e5188e84557b9b276549a8de
412de1d7519edea2e5ee0759ab3033d6ddfc81f5
refs/heads/master
2020-06-17T07:48:21.603061
2019-08-12T13:02:18
2019-08-12T13:02:18
195,849,350
0
0
null
2019-07-17T20:10:16
2019-07-08T16:27:34
C++
UTF-8
Java
false
false
72
java
public 23 { {public static void main(String[]args) float a; a=34.2; } }
80ae833a3f1a7ef31745ac3f90a4e0c337772c5b
8022511ad71cf4b1eccbc4ce6ce6af1dd7c88bec
/oim-swing/src/main/java/com/oim/common/annotation/Parameter.java
086f844abe2f2117243f4118567c37c600934a36
[]
no_license
softfn/im-for-pc
f5411d88c172adbda75099582ae70dcd18e08958
e34a62c337e1b7f0c0fd39286353a8c71d5864ad
refs/heads/master
2020-07-16T23:53:31.585700
2016-11-17T01:59:15
2016-11-17T01:59:15
73,938,576
1
1
null
null
null
null
UTF-8
Java
false
false
506
java
package com.oim.common.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Documented @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface Parameter { String value() default ""; String type() default "json"; public static final String TYPE_JSON="json"; public static final String TYPE_BEAN="bean"; }
71c982cc33df60018605d1842fcd796ca25d3b42
d9ea3ab118ad2177e4f7b9a2a7dda4427a9cd8f1
/library/build/generated/source/buildConfig/debug/com/kuanlian/library/BuildConfig.java
2b4bb7d85c46937df9fc26e26506dc32fbb1e61d
[]
no_license
gitlipeng/AndroidStudy
77420c2a021b67b3c597a3bf956e88d6b0213db0
eed6feb4732142e0e6888c465253725d684eead2
refs/heads/master
2016-09-06T08:04:25.939738
2015-12-10T11:18:31
2015-12-10T11:18:31
41,348,565
1
4
null
2015-08-28T05:31:25
2015-08-25T07:05:38
Java
UTF-8
Java
false
false
445
java
/** * Automatically generated file. DO NOT MODIFY */ package com.kuanlian.library; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "com.kuanlian.library"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = -1; public static final String VERSION_NAME = ""; }
ab61c3b32f2659fe559ffb942b5d8bd65b881de3
265e9e363630197f71c8ea8059d5cb175f0c4be2
/ExercicioRepita/src/exerciciorepita/ExercicioRepita.java
d19ac9c921b3ac8d63d8e4b2423d8e32252a4fd2
[]
no_license
nbthales/cev-java
c6943d82a605caea7c7bce657f09405cec0ba745
125774e39bfe71760eadbd389278747ed0a426a6
refs/heads/master
2020-04-02T15:39:15.286790
2018-10-25T01:34:31
2018-10-25T01:34:31
154,577,054
0
0
null
null
null
null
UTF-8
Java
false
false
1,281
java
package exerciciorepita; import javax.swing.JOptionPane; public class ExercicioRepita { public static void main(String[] args) { // TODO code application logic here //JOptionPane.showMessageDialog(null, "Ola Mundo!", "Boas vindas", JOptionPane.INFORMATION_MESSAGE); int n, s=0, totPar=0, totImpar=0, mCem=0 , tot=0; double m; do{ tot++; n = Integer.parseInt(JOptionPane.showInputDialog(null, "<html>Informe um número: <br><em>(Valor 0 interrompe)</em></html>")); s += n; if(n >= 100){ mCem++; } if (n%2 == 0){ totPar++; } else{ totImpar++; } } while (n != 0); m = s / tot; // JOptionPane.showMessageDialog(null, "Você digitou o valor: " + n); JOptionPane.showMessageDialog(null, "<html>Resultado final <hr>" + "<br>Total dos Valores: "+s+ "<br>Total de Pares: "+totPar+ "<br>Total de Impares: "+totImpar+ "<br>Acima de 100: "+mCem+ "<br>Média dos valores: "+m+ "</html>"); } }
[ "nbthales@nbthales-Inspiron-3543" ]
nbthales@nbthales-Inspiron-3543
324aec26312a179a23ab0071bad3d6ad5d0e0016
2411e7c7db06755da1f4d43525e971f65a28b1d9
/problem-solving-algorithms/src/com/leetcode/tree/MinimumDepthOfBinaryTree.java
1f4f3998652fadb20fe4ebc9dbc7808b5ef02153
[]
no_license
anandraghunathan/dsalgorithm-practice
22cabe67fdd575c1e9a441348c1da94bfd55ebba
00f617e4cbb8e59d3f06193687038cabaaad81f7
refs/heads/master
2021-07-17T13:28:27.794124
2020-06-16T00:06:57
2020-06-16T00:06:57
173,141,822
1
3
null
null
null
null
UTF-8
Java
false
false
1,112
java
package com.leetcode.tree; public class MinimumDepthOfBinaryTree { public static int minDepth(TreeNode root) { if(root == null) return 0; if(root.left != null && root.right != null) return Math.min(minDepth(root.left), minDepth(root.right)) + 1; else return Math.max(minDepth(root.left), minDepth(root.right)) + 1; } public static void main(String[] args) { TreeNode t1 = new TreeNode(3); t1.left = new TreeNode(9); t1.right = new TreeNode(20); t1.right.left = new TreeNode(15); t1.right.right = new TreeNode(7); // System.out.print(t1 != null ? t1.val + ", " : null + " , "); // // System.out.print(t1.left != null ? t1.left.val + ", " : null + ", "); // // System.out.print(t1.right != null ? t1.right.val + ", " : null + ", "); // // System.out.print(t1.right.left != null ? t1.right.left.val + ", " : null + ", "); // // System.out.print(t1.right.right != null ? t1.right.right.val + ", " : null + ", "); System.out.println(minDepth(t1)); } }
48e2ad9203f7629f1f1abfcd844f484188f09c47
a61686bdaf47a92a386fece4cbcc74f5c57c0e55
/src/main/java/org/apache/flink/graph/streaming/partitioner/edgepartitioners/batchapp/CommunityDetectionITCase.java
1acf5cb40ec3c6261767b3d06ad79c80649c6999
[ "Apache-2.0" ]
permissive
MBtech/gpa-flink
41c9b28775aa4f602186f8f29acf81e65a59fd32
f281bb2353ce08954f7eaecdc20959ec4bd418d4
refs/heads/master
2020-04-26T11:13:29.367015
2019-03-12T23:15:53
2019-03-12T23:15:53
173,509,575
0
0
null
null
null
null
UTF-8
Java
false
false
2,588
java
package org.apache.flink.graph.streaming.partitioner.edgepartitioners.batchapp; /** * Created by zainababbas on 18/04/2017. */ import org.apache.flink.api.common.functions.MapFunction; import org.apache.flink.api.common.functions.Partitioner; import org.apache.flink.api.java.DataSet; import org.apache.flink.api.java.ExecutionEnvironment; import org.apache.flink.graph.Edge; import org.apache.flink.graph.Graph; import org.apache.flink.graph.Vertex; import org.apache.flink.graph.library.CommunityDetection; import org.apache.flink.graph.streaming.partitioner.edgepartitioners.keyselector.CustomKeySelector; import java.util.List; import java.util.Random; public class CommunityDetectionITCase { public static void main(String[] args) throws Exception { ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); DataSet<Edge<Long, Double>> data = env.readTextFile("/Users/zainababbas/working/gelly-streaming/BIGGGGGG/app/appmovf").map(new MapFunction<String, Edge<Long, Double>>() { @Override public Edge<Long, Double> map(String s) { String[] fields = s.split("\\,"); long src = Long.parseLong(fields[0]); long trg = Long.parseLong(fields[1]); return new Edge<>(src, trg, 1.0); } }); Graph<Long, Long, Double> inputGraph = Graph.fromDataSet( data.partitionCustom(new HashPartitioner<>(new CustomKeySelector(0)), new CustomKeySelector<>(0)), new InitLabels(), env); List<Vertex<Long, Long>> result = inputGraph.run(new CommunityDetection<Long>(1, 0.5)) .getVertices().collect(); Object[] arr =result.toArray(); for(int i=0; i<arr.length;i++) { Object v= arr[i]; System.out.println(v.toString()); } } private static class HashPartitioner<T> implements Partitioner<T> { private static final long serialVersionUID = 1L; CustomKeySelector keySelector; private static final int MAX_SHRINK = 100; private double seed; private int shrink; public HashPartitioner(CustomKeySelector keySelector) { this.keySelector = keySelector; System.out.println("createdsfsdfsdfsdf"); this.seed = Math.random(); Random r = new Random(); shrink = r.nextInt(MAX_SHRINK); } @Override public int partition(Object key, int numPartitions) { //return MathUtils.murmurHash(key.hashCode()) % numPartitions; return Math.abs((int) ( (int) Integer.parseInt(key.toString())*seed*shrink) % numPartitions); } } @SuppressWarnings("serial") private static final class InitLabels implements MapFunction<Long, Long> { public Long map(Long id) { return id; } } }
f71037c641986eb02f81ec90d9ef3a98fa61b1c3
b308232b5f9a1acd400fe15b45780e348048fccd
/Billing/src/main/java/com/param/billing/unit/controller/UnitServiceTariffMasterController.java
8079f1cdf1cfd85f7d59356c918b278e9b092841
[]
no_license
PravatKumarPradhan/his
2aae12f730b7d652b9590ef976b12443fc2c2afb
afb2b3df65c0bc1b1864afc1f958ca36a2562e3f
refs/heads/master
2022-12-22T20:43:44.895342
2018-07-31T17:04:26
2018-07-31T17:04:26
143,041,254
1
0
null
2022-12-16T03:59:53
2018-07-31T16:43:36
HTML
UTF-8
Java
false
false
2,499
java
package com.param.billing.unit.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; 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.ResponseBody; import com.param.billing.unit.service.IUnitServiceTariffMasterService; import com.param.global.common.ICommonConstants; import com.param.global.common.Response; import com.param.global.dto.UnitServiceTariffMasterDto; @Controller @RequestMapping(value="api/unit") @SuppressWarnings({"rawtypes","unchecked"}) public class UnitServiceTariffMasterController implements ICommonConstants{ @Autowired IUnitServiceTariffMasterService iUnitServiceTariffMasterService; @RequestMapping(value="/getMasterServiceListByMultipleParameters", method = RequestMethod.POST , consumes = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Response getMasterServiceListByMultipleParameters(@RequestBody UnitServiceTariffMasterDto unitServiceTariffMasterDto){ try{ return iUnitServiceTariffMasterService.getMasterServiceListByMultipleParameters(unitServiceTariffMasterDto); }catch(Exception e){ e.printStackTrace(); } return new Response(ERROR, null, null, null,null); } @RequestMapping(value="/saveUnitServiceTariffMaster", method = RequestMethod.POST , consumes = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Response saveUnitServiceTariffMaster(@RequestBody UnitServiceTariffMasterDto unitServiceTariffMasterDto){ try{ return iUnitServiceTariffMasterService.saveUnitServiceTariffMaster(unitServiceTariffMasterDto); }catch(Exception e){ e.printStackTrace(); } return new Response(ERROR, null, null, null,null); } @RequestMapping(value="/getBasePriceOfServicesFromTariffMasterByServiceList", method = RequestMethod.POST , consumes = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Response getBasePriceOfServicesFromTariffMasterByServiceList(@RequestBody UnitServiceTariffMasterDto unitServiceTariffMasterDto){ try{ return iUnitServiceTariffMasterService.getBasePriceOfServicesFromTariffMasterByServiceList(unitServiceTariffMasterDto); }catch(Exception e){ e.printStackTrace(); } return new Response(ERROR, null, null, null,null); } }
d594f390f816a1afc8b67090949b1e5bca2f1f2f
70af634452c58499e3ea8e9bc6a343732ffb5619
/app/src/main/java/com/practica02/design/fragment/Music.java
f6207b886b203afff0ba657ea69848cde306ba4c
[]
no_license
BraulioJose18/DesignIDNP
9b38bb52775fd6816e8e47afc954acf5871e7680
b402b7929ae33f94ba4d07cee420354cf9132d52
refs/heads/master
2023-01-28T01:49:39.441898
2020-11-30T03:02:03
2020-11-30T03:02:03
304,788,976
0
0
null
null
null
null
UTF-8
Java
false
false
2,018
java
package com.practica02.design.fragment; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.practica02.design.R; /** * A simple {@link Fragment} subclass. * Use the {@link Music#newInstance} factory method to * create an instance of this fragment. */ public class Music extends Fragment { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; // TODO: Rename and change types of parameters private String mParam1; private String mParam2; public Music() { // Required empty public constructor } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param param1 Parameter 1. * @param param2 Parameter 2. * @return A new instance of fragment Music. */ // TODO: Rename and change types and number of parameters public static Music newInstance(String param1, String param2) { Music fragment = new Music(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_music, container, false); } }
da3ba975d7a733307cc1d88f7eeaaff55b93468f
cf8bcdfeb3e4f7c73ffe62c37eb1ca84cbecc0dc
/socialMedia/src/main/java/com/example/socialMedia/model/AuditModel.java
aa2267cc1650a41fa5642eb7c88ea42c33cd07e3
[]
no_license
nilam-code/workspace
9fd9c5b5d725c588f92ba3dd2fb93236b041c91c
1096f83729aa895d8317a66fc957ddc1fc310f7c
refs/heads/main
2023-04-09T06:43:36.200914
2021-04-28T04:49:45
2021-04-28T04:49:45
362,338,329
0
0
null
null
null
null
UTF-8
Java
false
false
1,525
java
package com.example.socialMedia.model; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.EntityListeners; import javax.persistence.MappedSuperclass; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.hibernate.annotations.CreationTimestamp; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @MappedSuperclass @EntityListeners(AuditingEntityListener.class) @JsonIgnoreProperties( value = {"createdAt", "updatedAt"}, allowGetters = true ) public abstract class AuditModel implements Serializable { @Temporal(TemporalType.TIMESTAMP) @Column(name = "created_at", nullable = false, updatable = false) @CreationTimestamp @CreatedDate private Date createdAt; @Temporal(TemporalType.TIMESTAMP) @Column(name = "updated_at", nullable = false) @CreationTimestamp @LastModifiedDate private Date updatedAt; public Date getCreatedAt() { return createdAt; } public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; } public Date getUpdatedAt() { return updatedAt; } public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; } }
4ba74dc00efa85d3de85339ced04b3bc518fac7f
b30114609ac9bf325969a1b8cbf7d24df53c3897
/microprofile/fault-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/ExceptionUtil.java
ce104b731536a771d2a18eaffe4a27ac7c07811e
[ "Apache-2.0" ]
permissive
imineev/helidon
1a130da3de834f3e32316c4c4df45623fd2a75e5
1afc3acc7372e54a439a6a17c474ec68a05d7bdc
refs/heads/master
2023-08-08T01:28:19.958419
2020-01-14T13:17:26
2020-01-14T13:17:26
240,717,314
0
0
Apache-2.0
2023-07-23T05:43:51
2020-02-15T13:28:19
Java
UTF-8
Java
false
false
1,727
java
/* * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.helidon.microprofile.faulttolerance; /** * Class ExceptionUtil. */ public class ExceptionUtil { /** * Exception used internally to propagate other exceptions. */ static class WrappedException extends RuntimeException { WrappedException(Throwable t) { super(t); } } /** * Wrap throwable into {@code Exception}. * * @param throwable The throwable. * @return A {@code RuntimeException}. */ public static Exception toException(Throwable throwable) { return throwable instanceof Exception ? (Exception) throwable : new RuntimeException(throwable); } /** * Wrap throwable into {@code RuntimeException}. * * @param throwable The throwable. * @return A {@code RuntimeException}. */ public static WrappedException toWrappedException(Throwable throwable) { return throwable instanceof WrappedException ? (WrappedException) throwable : new WrappedException(throwable); } private ExceptionUtil() { } }
8430f73e7d2702395ea3546517231bf96a7a74ba
cf165b2e21902c98755f6ebc2ac74d43c96d65a6
/src/bupt/lengji/qoe/server/VideoServlet.java
a896868cc590d23b2aa9043013c19edc8c607e31
[]
no_license
Lengji/QoEServer
f889eaea2f3e579e1ce9d1d31a6de855e9c92dcb
8e43987d190ae450b96510d5f3d3c747c4fefcb3
refs/heads/master
2016-09-13T08:59:58.322035
2016-05-30T09:02:21
2016-05-30T09:02:21
59,677,470
0
0
null
null
null
null
UTF-8
Java
false
false
1,073
java
package bupt.lengji.qoe.server; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.Servlet; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import org.json.JSONArray; public class VideoServlet implements Servlet { @Override public void init(ServletConfig arg0) throws ServletException { } @Override public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException { System.out.println(request); JSONArray jsonArray = new VideoListManager().getVideoList(Integer.parseInt(request.getParameter("type"))); response.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=utf-8"); PrintWriter pw = response.getWriter(); pw.write(jsonArray.toString()); pw.flush(); pw.close(); } @Override public void destroy() { } @Override public ServletConfig getServletConfig() { return null; } @Override public String getServletInfo() { return null; } }
285b45cecf511eb4b01d32bc4a252d087efd8804
da50b462f59fb3d3db851d0b443c8ac71a259469
/lesson9/src/main/java/ru/otus/lesson9/myorm/Executor.java
bf96a7e2db86fe7fc2acfd9cd51af3bf1aed86b1
[]
no_license
piphonom/otus-java-2017-04
173e92d67c6d5ecaad676d6a596f2a6073dbe14b
4348948f0bb7daeca79783db57801a3fdc0aa764
refs/heads/master
2021-01-19T09:10:55.874551
2017-08-10T10:16:57
2017-08-10T10:16:57
87,734,991
0
0
null
null
null
null
UTF-8
Java
false
false
1,295
java
package ru.otus.lesson9.myorm; import ru.otus.lesson9.base.datasets.DataSet; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.List; import java.util.function.Function; /** * Created by piphonom */ public class Executor { Connection connection; public Executor(Connection connection) { this.connection = connection; } public int executeUpdate(String query) { try { Statement statement = connection.createStatement(); int count = statement.executeUpdate(query); statement.close(); return count; } catch (SQLException e) { e.printStackTrace(); return 0; } } public <T extends DataSet> List<T> executeSelect(String query, Function<ResultSet, List<T>> dataSetConstructor) { try { Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(query); List<T> result = dataSetConstructor.apply(resultSet); resultSet.close(); statement.close(); return result; } catch (SQLException e) { e.printStackTrace(); return null; } } }
b54a86905983572ee25d6f55776fe3d080bc84d7
985258d56d86734df9025c508b51ceb7582ec3ca
/spring-cloud-server-application/src/main/java/org/lpl/server/application/aop/ServerControllerAspect.java
337d9bdeef33893bea3cf189217c139622cda344
[]
no_license
pengleiLiu/spring-cloud-learn
406883393671c7b82717c9e837958ca6ab61f244
cd5fd844cc4f68ea7ab14ada4b87fd847dfbfb20
refs/heads/master
2022-12-23T17:30:55.250220
2020-04-17T06:34:22
2020-04-17T06:34:22
204,882,883
1
0
null
2022-12-16T00:39:59
2019-08-28T08:20:45
Java
UTF-8
Java
false
false
3,498
java
package org.lpl.server.application.aop; import java.lang.reflect.Method; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.reflect.MethodSignature; import org.lpl.server.application.annotation.SemaphoreCircuitBreaker; import org.lpl.server.application.annotation.TimeOutCircuitBreaker; import org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint; import org.springframework.stereotype.Component; /** * @author penglei.liu * @version 1.0 * @date 2019-08-30 17:11 **/ @Aspect @Component public class ServerControllerAspect { private static final ExecutorService executorService = Executors.newSingleThreadExecutor(); private volatile Semaphore semaphore = null; /** * 高级版熔断切面处理 */ @Around("execution(* org.lpl.server.application.controller.ServerController.advanceSay(..)) && args(message)") public Object advanceSayInTimeout(ProceedingJoinPoint point, String message) throws Throwable { return doInvoke(point, message, 100L); } @Around("execution(* org.lpl.server.application.controller.ServerController.annotationSay(..)) && args(message)") public Object advanceSayTimeOut(ProceedingJoinPoint point, String message) throws Throwable { Long timeout = 100L; if (point instanceof MethodInvocationProceedingJoinPoint) { MethodInvocationProceedingJoinPoint methodJoinPoint = (MethodInvocationProceedingJoinPoint) point; MethodSignature methodSignature = (MethodSignature) methodJoinPoint.getSignature(); Method method = methodSignature.getMethod(); TimeOutCircuitBreaker circuitBreaker = method.getAnnotation(TimeOutCircuitBreaker.class); timeout = circuitBreaker.timeout(); } return doInvoke(point, message, timeout); } @Around("execution(* org.lpl.server.application.controller.ServerController." + "advancedSay3InSemaphore(..)) && args(message) && @annotation(semaphoreCircuitBreaker)") public Object semaphoreAdvanceSay(ProceedingJoinPoint point, String message, SemaphoreCircuitBreaker semaphoreCircuitBreaker) throws Throwable { int value = semaphoreCircuitBreaker.value(); if (semaphore == null) { semaphore = new Semaphore(value); } Object returnValue = null; try { if (semaphore.tryAcquire()) { returnValue = point.proceed(new Object[]{message}); Thread.sleep(1000); } else { returnValue = errorContent(message); } } finally { semaphore.release(); } return returnValue; } public String errorContent(String message) { return "Fault"; } private Object doInvoke(ProceedingJoinPoint point, String message, Long timeOut) throws Throwable { Future<Object> future = executorService.submit(() -> { try { return point.proceed(new Object[]{message}); } catch (Throwable throwable) { return errorContent(message); } }); Object returnValue = null; try { returnValue = future.get(100, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { future.cancel(true); returnValue = errorContent(message); } return returnValue; } }
3a32e1c0082769de1633c5fa60fac25434a96b50
fe6dd6c6e47164f8b16d584ab3e42c99b608555e
/app/src/main/java/com/tokayoapp/Adapter/PurchaseHistoryAdapter.java
3473cef9ea2106bb6b846dd393058421f003278c
[]
no_license
abhilashasharma2021/Tokayoo
e8684b39bdac7865600a82bf27a1a011339feecb
7bea414df0e92aa927564777fa61c47c1787002d
refs/heads/master
2023-04-02T19:54:04.050902
2021-04-03T03:58:15
2021-04-03T03:58:15
335,620,548
0
0
null
null
null
null
UTF-8
Java
false
false
7,637
java
package com.tokayoapp.Adapter; import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Color; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.squareup.picasso.Picasso; import com.tokayoapp.Activities.OrderDetailsActivity; import com.tokayoapp.Modal.HistoryModal; import com.tokayoapp.R; import com.tokayoapp.Utils.AppConstant; import java.util.List; public class PurchaseHistoryAdapter extends RecyclerView.Adapter<PurchaseHistoryAdapter.ViewHolder> { Context context; List<HistoryModal>historyModalList; public PurchaseHistoryAdapter(Context context, List<HistoryModal>getDataAdpter){ this.context=context; this.historyModalList=getDataAdpter; } @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.rec_purchasedhistory_layout,parent,false); ViewHolder viewHolder=new ViewHolder(view); return viewHolder; } @SuppressLint("ResourceAsColor") @Override public void onBindViewHolder(@NonNull final ViewHolder holder, int position) { final HistoryModal historyModal=historyModalList.get(position); Log.e("yefgfd",historyModal.getCount()); // holder.txt_name.setText(historyModal.getName()); holder.txt_name.setText("Date"+" "+historyModal.getDate()); holder.txt_qty.setText(historyModal.getQuantity()); holder.txt_orderNo.setText(historyModal.getOrderId()); holder.txt_price.setText(historyModal.getPrice()); holder.txt_color.setText(historyModal.getColor()); holder.txt_model.setText(historyModal.getModel()); String tracking_status=historyModal.getOrder_deliver_status(); Log.e("sdgtfhb", historyModal.getOrder_deliver_status()+""); /* try { Picasso.with(context).load(historyModal.getPath()+historyModal.getImage()).into(holder.img_product); } catch (Exception e){ }*/ if (tracking_status.equals("0")){ holder.txt_progress.setText("In Process"); holder.txt_progress.setTextColor(context.getResources().getColor(R.color.pink)); /* holder.txt_name.setText(historyModal.getName()); holder.txt_qty.setText(historyModal.getQuantity()); holder.txt_orderNo.setText(historyModal.getOrderId()); holder.txt_price.setText(historyModal.getPrice()); holder.txt_model.setText(historyModal.getModel());*/ /* try { Picasso.with(context).load(historyModal.getPath()+historyModal.getImage()).into(holder.img_product); } catch (Exception e){ }*/ /*if (position==0){ holder.txt_progress.setText("In Progress"); holder.txt_progress.setTextColor(context.getResources().getColor(R.color.pink)); holder.txt_name.setText(historyModal.getName()); holder.txt_qty.setText(historyModal.getQuantity()); holder.txt_orderNo.setText(historyModal.getOrderId()); holder.txt_price.setText(historyModal.getPrice()); holder.txt_model.setText(historyModal.getModel()); try { Picasso.with(context).load(historyModal.getPath()+historyModal.getImage()).into(holder.img_product); } catch (Exception e){ } }else { holder.txt_progress.setText("Ship out"); holder.txt_progress.setTextColor(context.getResources().getColor(R.color.blue)); holder.rl_count.setVisibility(View.GONE); holder.txt_name.setText(historyModal.getName()); holder.txt_qty.setText(historyModal.getQuantity()); holder.txt_orderNo.setText(historyModal.getOrderId()); holder.txt_price.setText(historyModal.getPrice()); holder.txt_model.setText(historyModal.getModel()); try { Picasso.with(context).load(historyModal.getPath()+historyModal.getImage()).into(holder.img_product); } catch (Exception e){ } */ } else { holder.txt_progress.setText("Ship out"); holder.txt_progress.setTextColor(context.getResources().getColor(R.color.blue)); /* holder.txt_name.setText(historyModal.getName()); holder.txt_qty.setText(historyModal.getQuantity()); holder.txt_orderNo.setText(historyModal.getOrderId()); holder.txt_price.setText(historyModal.getPrice()); holder.txt_model.setText(historyModal.getModel()); */ /* try { Picasso.with(context).load(historyModal.getPath()+historyModal.getImage()).into(holder.img_product); } catch (Exception e){ }*/ } holder.rl_count.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { } }); holder.ll_history.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.e("rrgf", historyModal.getId()+""); Log.e("rrgf", historyModal.getOrderId()+""); AppConstant.sharedpreferences =context.getSharedPreferences(AppConstant.MyPREFERENCES, Context.MODE_PRIVATE); SharedPreferences.Editor editor =AppConstant.sharedpreferences.edit(); editor.putString(AppConstant.ORDERID, historyModal.getOrderId()); editor.putString(AppConstant.ProdutId,historyModal.getId()); editor.commit(); context.startActivity(new Intent(context,OrderDetailsActivity.class)); } }); } @Override public int getItemCount() { return historyModalList.size(); } public class ViewHolder extends RecyclerView.ViewHolder { ImageView img_product; LinearLayout ll_history; RelativeLayout rl_count; TextView txt_count,txt_sym,txt_model; TextView txt_name,txt_color,txt_price,txt_qty,txt_orderNo,txt_progress; public ViewHolder(@NonNull View itemView) { super(itemView); img_product = itemView.findViewById(R.id.img_product); txt_name = itemView.findViewById(R.id.txt_name); txt_color = itemView.findViewById(R.id.txt_color); txt_price = itemView.findViewById(R.id.txt_price); txt_qty = itemView.findViewById(R.id.txt_qty); ll_history = itemView.findViewById(R.id.ll_history); txt_orderNo = itemView.findViewById(R.id.txt_orderNo); txt_progress = itemView.findViewById(R.id.txt_progress); rl_count = itemView.findViewById(R.id.rl_count); txt_count = itemView.findViewById(R.id.txt_count); txt_sym = itemView.findViewById(R.id.txt_sym); txt_model = itemView.findViewById(R.id.txt_model); } } }
7d9db7286419c5afc879fd225603fd9fd3ca4b57
8dc23922e16bdd6a5b14b7625931d9341b8c6505
/src/main/java/blazedemo/data/UserDetails.java
9b8d351b8e1cb5640b7877b4d9c6908cea4c1fde
[]
no_license
mariza1991/jdi
30632ea8c4c6c7dcb8fa626f476007742367fb7f
c17f3854b02164efbaa4a4b550fede898b633b39
refs/heads/master
2020-03-19T05:25:23.684899
2018-06-17T20:24:41
2018-06-17T20:24:41
135,929,027
0
0
null
null
null
null
UTF-8
Java
false
false
421
java
package blazedemo.data; public class UserDetails { public String name = "TestName", address = "TestAddress", city = "TestCity", state = "Alabama", zip = "123BE", cardType = "American Express", cardNumber = "0000111122223333", //expected [5] month = "12", //expected [6] year = "2020", //expected [7] cardName = "Marina Zaitseva"; }
0fd617882ba2bdc723b29e7ccd0d2b46cfbf60f2
dddf622dfc1f669b1b08d78d8be91610b71a3fe9
/src/edu/nd/sarec/railwaycrossingnew/model/vehicles/CarFactory.java
e061ea5251a8fbbd5d516c4fe63d367e4ce3ae91
[]
no_license
klutz1/SoftwareEngineering2018
5ca27127f7071c717135e4a8762bb700ba8d4754
1198911d2ccd6093ff4141807aae1815571f22b7
refs/heads/master
2021-08-08T03:45:49.947019
2018-11-29T20:14:36
2018-11-29T20:14:36
146,906,365
0
0
null
2018-11-29T20:14:37
2018-08-31T15:00:23
Java
UTF-8
Java
false
false
2,767
java
package edu.nd.sarec.railwaycrossingnew.model.vehicles; import java.awt.Point; import java.util.ArrayList; import java.util.Collection; import edu.nd.sarec.railwaycrossingnew.model.infrastructure.Direction; import edu.nd.sarec.railwaycrossingnew.model.infrastructure.gate.CrossingGate; import edu.nd.sarec.railwaycrossingnew.view.CarView; /** * Very basic car factory. Creates the car and registers it with the crossing gate and the car infront of it. * @author jane * */ public class CarFactory { private Collection<CrossingGate> gates = null; private Car previousCar = null; private ArrayList<Car> cars = new ArrayList<Car>(); private Direction direction; private Point location; private int carNumber; private String factoryName; public CarFactory(){} public CarFactory(Direction direction, Point location, Collection<CrossingGate> gates, String factoryName, boolean gui){ this.direction = direction; this.location = location; this.gates = gates; carNumber = 1; this.factoryName = factoryName; } // Most code here is to create random speeds public Car buildCar(boolean gui){ if (previousCar == null || location.y < previousCar.getVehicleY()-100){ String newLicense = factoryName + ":" + Integer.toString(carNumber); Car car = new Car(location.x,location.y,newLicense); if (gui) { CarView carView = new CarView(car); car.attachCarView(carView); } carNumber++; double speedVariable = (Math.random() * 10)/10; car.setSpeed((2-speedVariable)*2); // All cars created by this factory must be aware of crossing gates in the road for(CrossingGate gate: gates){ gate.addObserver(car); if(gate != null && gate.getTrafficCommand()=="STOP") car.setGateDownFlag(true); } // Each car must observe the car infront of it so it doesn't collide with it. if (previousCar != null) previousCar.addObserver(car); previousCar = car; cars.add(car); return car; } else return null; } // We will get a concurrency error if we try to delete cars whilst iterating through the array list // so we perform this in two stages. // 1. Loop through the list and identify which cars are off the screen. Add them to 'toDelete' array. // 2. Iterate through toDelete and remove the cars from the original arrayList. public ArrayList<Car> driveCars() { // Removing cars from the array list. ArrayList<Car> toDelete = new ArrayList<Car>(); for(Car car: cars){ car.move(); if (car.offScreen()) toDelete.add(car); } for (Car car: toDelete) cars.remove(car); return toDelete; } public ArrayList<Car> getCars(){ return cars; } }
9e3372bfcb49bfb249b2a3afe3106563278328f6
217d96db536ff284fc1b168bf640104f00ba1ad5
/rifidi/trunk/org.rifidi.prototyper.items/src/org/rifidi/prototyper/items/service/DuplicateItemException.java
185203b80c6d39978329eb3309784611ee57df9b
[]
no_license
TranscendsLLC/emulator
d5b94965b8ebd894707c093334c51aabf30d0075
a46c42cd2e86aafc213df7585dc923895a589446
refs/heads/master
2021-01-14T12:31:10.876450
2010-10-01T21:28:07
2010-10-01T21:28:07
43,608,652
1
1
null
null
null
null
UTF-8
Java
false
false
883
java
/** * */ package org.rifidi.prototyper.items.service; /** * Thrown if two instances of an item are registered * * @author Kyle Neumeier - [email protected] * */ public class DuplicateItemException extends Exception { /** * */ private static final long serialVersionUID = 1L; /** * */ public DuplicateItemException() { // TODO Auto-generated constructor stub } /** * @param arg0 */ public DuplicateItemException(String arg0) { super(arg0); // TODO Auto-generated constructor stub } /** * @param arg0 */ public DuplicateItemException(Throwable arg0) { super(arg0); // TODO Auto-generated constructor stub } /** * @param arg0 * @param arg1 */ public DuplicateItemException(String arg0, Throwable arg1) { super(arg0, arg1); // TODO Auto-generated constructor stub } }
[ "kyle@70ba6d20-ffbb-44b8-b480-e27427137dba" ]
kyle@70ba6d20-ffbb-44b8-b480-e27427137dba