This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.care.connection.careconnection; | |
import static org.junit.jupiter.api.Assertions.assertNotEquals; | |
import static org.mockito.Mockito.when; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.junit.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.Test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.nio.file.DirectoryStream; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.UUID; | |
import javax.imageio.ImageIO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test.overriding; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.nio.file.DirectoryStream; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.UUID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RowCopy { | |
public static void main(String[] args) throws Exception { | |
HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream("E:/budget-1.xls")); | |
HSSFSheet sheet = workbook.getSheet("Budget"); | |
copyRow(workbook, sheet, 5, 8); | |
copyRow(workbook, sheet, 6, 9); | |
FileOutputStream out = new FileOutputStream("E:/output.xls"); | |
workbook.write(out); | |
out.close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t1.name user_name, dep.name department, t1.created_on | |
FROM employee t1 JOIN department dep ON t1.department_id =dep.id | |
WHERE t1.created_on = (SELECT MAX(t2.created_on) | |
FROM employee t2 | |
WHERE t2.department_id = t1.department_id); | |
-- If not exists in the child table | |
SELECT p.id | |
FROM project p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.st.fileUplaod; | |
import java.io.File; | |
import com.amazonaws.auth.AWSStaticCredentialsProvider; | |
import com.amazonaws.auth.BasicAWSCredentials; | |
import com.amazonaws.regions.Regions; | |
import com.amazonaws.services.s3.AmazonS3; | |
import com.amazonaws.services.s3.AmazonS3ClientBuilder; | |
/*Add this Jar File |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.ByteArrayInputStream; | |
import java.io.InputStream; | |
import java.util.UUID; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Component; | |
import com.amazonaws.services.s3.AmazonS3; | |
import com.amazonaws.services.s3.model.CreateBucketRequest; | |
import com.amazonaws.services.s3.model.GetBucketLocationRequest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.OutputStream; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipOutputStream; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mapToAoO = m => { | |
return Array.from(m).map( ([k,v]) => {return {[k]:v}} ); | |
}; | |
JSON.stringify(mapToAoO(map)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Properties hibernateProperties() { | |
Properties properties = new Properties(); | |
properties.put(CommonConstants.HIBERNATE_DIALECT, | |
propertyReader.getProperty(CommonConstants.HIBERNATE_DIALECT)); | |
properties.put(CommonConstants.HIBERNATE_SHOW_SQL, | |
propertyReader.getProperty(CommonConstants.HIBERNATE_SHOW_SQL)); | |
properties.put(CommonConstants.HIBERNATE_FORMAT_SQL, | |
propertyReader.getProperty(CommonConstants.HIBERNATE_FORMAT_SQL)); |
NewerOlder