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 ConvertSeconds { | |
public static void main(String[] args) { | |
ConvertSeconds convertSeconds = new ConvertSeconds(); | |
System.out.println(convertSeconds.convert(129601)); | |
System.out.println(convertSeconds.convert(86410)); | |
} | |
public String convert(long inputSeconds) { | |
long year = inputSeconds / (365 * 24 * 60 * 60); |
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.time.LocalTime; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
/** | |
* Time complexity: O(m * n * log m) | |
* Space complexity: O(m * n) | |
* |
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
var mergeTwoLists = function(l1, l2) { | |
// If the first list is null then return the second list | |
// Because there is nothing to compare with the second list | |
if (!l1) { | |
return l2; | |
} | |
// If the second list is null then return the first list | |
// Because there is nothing to compare with the first list | |
if (!l2) { | |
return l1; |
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 MinimumCost { | |
public static void main(String[] args) { | |
int[][] matrix = new int[][]{{17, 2, 17}, {16, 16, 5}, {14, 3, 19}}; | |
System.out.println(findMinimumCost(matrix)); | |
} | |
private static int findMinimumCost(int[][] matrix) { | |
if (matrix == null || matrix.length == 0) { | |
return 0; |
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
#!/bin/bash | |
java -jar C:/Users/Admin/Desktop/Shell-Testing/aem-author-p4502.jar -unpack | |
mkdir crx-quickstart/install | |
touch crx-quickstart/install/org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.config | |
echo "repository.home=${datastore_home}" > "crx-quickstart/install/org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.config" | |
echo "path=${datastore_home}" >> "crx-quickstart/install/org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.config" | |
echo "minRecordLength=\"16384\"" >> "crx-quickstart/install/org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.config" |
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 org.redquark.help.march19; | |
import java.util.Scanner; | |
/** | |
* | |
* @author Anirudh Sharma | |
* | |
*/ | |
public class BinaryDecimalConversion { |
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 javax.jcr.Node; | |
import javax.jcr.Repository; | |
import javax.jcr.RepositoryException; | |
import javax.jcr.Session; | |
import javax.jcr.SimpleCredentials; | |
import org.apache.jackrabbit.commons.JcrUtils; | |
public class GetCRXRepository { |
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.Scanner; | |
public class SumOfDigits { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.println("Enter a number between 0 and 1000"); |
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 org.redquark.kickstarter.threads; | |
public class DaemonImplementation { | |
public static void main(String[] args) { | |
DaemonThread daemonThread = new DaemonThread(); | |
daemonThread.start(); | |
try{ |
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 org.redquark.kickstarter.threads; | |
public class DeadlockResoultion { | |
public static void main(String[] args) { | |
DeadlockResoultion deadlockImplementation = new DeadlockResoultion(); | |
final A a = deadlockImplementation.new A(); | |
final B b = deadlockImplementation.new B(); |
NewerOlder