This file has been truncated, but you can view the full 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
-- Drop existing tables if they exist | |
DROP TABLE IF EXISTS user_profile, inventory, order_detail, payment_details, shipping_details CASCADE; | |
-- User Profile Table | |
CREATE TABLE user_profile ( | |
user_id VARCHAR(100) PRIMARY KEY, | |
name VARCHAR(100), | |
email VARCHAR(100) UNIQUE, |
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.util.ArrayList; | |
import java.util.List; | |
public class ClassicThread { | |
void handleRequest() { |
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 static <T> void recordMemoryUsage(T count,Consumer<T> fn){ | |
Runtime runtime = Runtime.getRuntime(); | |
// Run the garbage collector | |
runtime.gc(); | |
// Calculate the used memory | |
long memory = runtime.totalMemory() - runtime.freeMemory(); | |
long startTime = System.nanoTime(); | |
System.out.println("Used memory before operation is: " + memory + " bytes"); |
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
-- Change the windows which should not be moved | |
set MAXIMUM_X_VALUE to 1900 | |
set positiontobemove to 0 | |
tell application "System Events" | |
set allProcesses to a reference to (every process whose background only is false) | |
set windowList to {} | |
repeat with thisProcess in allProcesses |
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
@echo off | |
set PORT_NUMBER= 8080 | |
netstat -a -n -o | findstr %PORT_NUMBER% > tmpFile | |
set /p input= < tmpFile | |
del tmpFile | |
set PROCESS_ID_INDEX=5 | |
for /F "tokens=%PROCESS_ID_INDEX% delims= " %%a in ("%input%") do set PROCESS_ID=%%a |
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
# deploy-3.sh | |
# deploy-o.sh | |
# deploy-l.sh | |
#To convert deploy to capture | |
rename 'deploy' capture *.sh |
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
function App() { | |
const [data, setData] = useState('Loading...'); | |
useEffect(() => { | |
getCompressedData().then((result) => { | |
setData(result); | |
}).catch((e) => { |
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
(def avengers-data [{:dateofbirth "May 29, 1970", | |
:appearances | |
["Iron Man" | |
"The Incredible Hulk (post-credits scene)" | |
"Iron Man 2" | |
"Thor (mentioned)" | |
"The Avengers" | |
"Iron Man 3" | |
"Captain America: The Winter Soldier (photo & mentioned)" |
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
results= Try.from(()->newsService.downloadFromNyTimes(topic)) | |
.or(()->newsService.downloadFromHerald(topic)) | |
.or(()->newsService.downloadFromSun(topic)) | |
.get(); | |
// since the for the above case it will be null | |
// if you would like to get default value | |
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
results= Try.from(()->newsService.downloadFromNyTimes(topic)) | |
.or(()->newsService.downloadFromHerald(topic)) | |
.or(()->newsService.downloadFromSun(topic)) | |
.get(); |
NewerOlder