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
# brew install --build-from-source ./gradle.rb | |
# All Gradle version - https://gist.github.com/l1x/d8ba66343fceb927d691 | |
# Install Gradle from local Formule - https://github.com/Homebrew/brew/issues/1468 | |
# Or you can download distribution from official site https://services.gradle.org/distributions/ | |
# When you run the above local Formule build and if the build fails with sha mismath, Replace sha256 below with the Actual sha256 returned by your run also don't forget to replace gradle version in url | |
# Below is sample Gradle class | |
class Gradle < Formula | |
desc "Build system based on the Groovy language" | |
homepage "https://www.gradle.org/" | |
url "https://services.gradle.org/distributions/gradle-2.13-all.zip" |
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
build: | |
@docker pull rabbitmq:3.7.4-management | |
run: | |
@docker run -d --hostname localhost --name my-rabbitmq -p 8080:61617 -p 8081:15672 -e RABBITMQ_DEFAULT_USER=user -e RABBITMQ_DEFAULT_PASS=password rabbitmq:3-management | |
start http://localhost:8081 | |
start: | |
@docker start my-rabbitmq | |
stop: | |
@docker stop my-rabbitmq | |
clean: |
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 org.w3c.dom.Document; | |
import org.w3c.dom.Node; | |
import org.w3c.dom.NodeList; | |
import org.xml.sax.InputSource; | |
import org.xml.sax.SAXException; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.parsers.ParserConfigurationException; | |
import java.io.IOException; |
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.logging.Logger; | |
/** | |
* Thread join | |
* <a href="http://www.journaldev.com/1024/java-thread-join-example">Java Thread Join</a> | |
*/ | |
class ThreadJoin { | |
static Logger logger = Logger.getLogger(App.class.getSimpleName()); |
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.example.java; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.InputStream; | |
/** | |
* Exception handling | |
* <a href="http://www.journaldev.com/1696/exception-handling-in-java">Exception Handling in Java</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
int main(){ | |
node * root = NULL; | |
int a[100005],K,i = 0,j = 0, _element, present; | |
scanf("%d",&K); | |
for( j = 0; j < K;j++ ) { | |
scanf("%d",&a[i++]); | |
} | |
for( i = 0; i < K;i++ ){ |
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
#include <vector> | |
#include <list> | |
#include <map> | |
#include <set> | |
#include <queue> | |
#include <deque> | |
#include <stack> | |
#include <bitset> | |
#include <algorithm> | |
#include <functional> |
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
class Summation { | |
public static void main(String[] args) throws IOException { | |
// Read & write data from file. | |
Scanner in = new Scanner(System.in); | |
final String fileName = System.getenv("OUTPUT_PATH"); | |
BufferedWriter bw = new BufferedWriter(new FileWriter(fileName)); | |
int res; | |
int _numbers_size = 0; | |
_numbers_size = Integer.parseInt( in .nextLine().trim()); |
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 App { | |
public static void main(String[] args) { | |
int[] prices = {5, 8, 6, 1, 4, 5}; | |
int count = 0; | |
if (prices.length >= 1 && prices.length <= 5000) { | |
for (int i = 0; i < prices.length; i++) { | |
if (i <= prices.length - 2) { | |
for (int j = i + 1; j < prices.length; j++) { | |
if (j <= prices.length - 1) { | |
if (prices[i] > prices[j]) { |
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 App { | |
public static void main(String[] args) { | |
int x = 8; | |
int[] arr = {-3, -2, 1, 7, 8, 11, 12, 21}; | |
for (int i = 0; i < arr.length; i++) { | |
int a = arr[i]; | |
int b = x - a; | |
if (b <= arr[arr.length - 1]) { | |
int result = divideAndConquer(arr, b, i + 1, arr.length - 1); | |
if (result != -1) { |
NewerOlder