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.math.BigInteger; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
//Java program to calculate MD5,SHA-1,SHA-256 and SHA-512 hash values | |
public class JavaHash { | |
//Function to calculate the Cryptographic hash value of an input String and the provided Digest algorithm | |
public static String getCryptoHash(String input, String algorithm) { | |
try { | |
//MessageDigest classes Static getInstance method is called with MD5 hashing |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.application.test</groupId> | |
<artifactId>maven-package-source-code-sample</artifactId> | |
<version>1.0</version> |
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
-- Transaction 02 Alternative | |
SET TRANSACTION ISOLATION LEVEL READ COMMITTED | |
SELECT * FROM Inventory (NOLOCK) WHERE ProductId = 10 |
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 CASE transaction_isolation_level | |
WHEN 0 THEN 'Unspecified' | |
WHEN 1 THEN 'ReadUncommitted' | |
WHEN 2 THEN 'ReadCommitted' | |
WHEN 3 THEN 'Repeatable' | |
WHEN 4 THEN 'Serializable' | |
WHEN 5 THEN 'Snapshot' END AS TRANSACTION_ISOLATION_LEVEL | |
FROM sys.dm_exec_sessions | |
where session_id = @@SPID |
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
-- Transaction 02 Modified | |
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED | |
SELECT * FROM Inventory WHERE ProductId = 10 |
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
-- Transaction 02 | |
SELECT * FROM Inventory WHERE ProductId = 10 |
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
-- Transaction 01 | |
SELECT * FROM Inventory; | |
BEGIN TRANSACTION | |
UPDATE Inventory SET QtyInStock = 8 | |
WHERE ProductId = 10 | |
-- Bill the Purchase Order | |
WAITFOR DELAY '00:00:15' |
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
-- Transfer $200 from Bob's account to Alice's Account | |
BEGIN TRY | |
BEGIN TRANSACTION | |
UPDATE Accounts SET Balance = Balance - 200 WHERE Id = B2 | |
UPDATE Accounts SET Balance = Balance + 200 WHERE Id = 'A' | |
COMMIT TRANSACTION | |
PRINT 'Transaction Completed Successfully!' | |
END TRY | |
BEGIN CATCH | |
ROLLBACK TRANSACTION |
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
-- Transfer $200 from Bob's account to Alice's Account | |
BEGIN TRY | |
BEGIN TRANSACTION | |
UPDATE Accounts SET Balance = Balance - 200 WHERE Id = B2 | |
UPDATE Accounts SET Balance = Balance + 200 WHERE Id = B1 | |
COMMIT TRANSACTION | |
PRINT 'Transaction Completed Successfully!' | |
END TRY | |
BEGIN CATCH | |
ROLLBACK TRANSACTION |
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
sudo mkdir /media/usb | |
sudo mount -t exfat /dev/sdc1 /media/usb | |
//sudo unmount /dev/sdc1 |
NewerOlder