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
"ScalaTest-run-running-GenTest" #1 prio=5 os_prio=31 tid=0x00007f85f780f000 nid=0xe03 waiting on condition [0x0000700004d5d000] | |
java.lang.Thread.State: WAITING (parking) | |
at sun.misc.Unsafe.park(Native Method) | |
- parking to wait for <0x0000000719c7e4e8> (a java.util.concurrent.FutureTask) | |
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) | |
at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429) | |
at java.util.concurrent.FutureTask.get(FutureTask.java:191) | |
at fpinscala.chapt7.Par$.$anonfun$map2$1(Par.scala:97) | |
at fpinscala.chapt7.Par$$$Lambda$216/875016237.apply(Unknown Source) | |
at fpinscala.chapt7.Par$.$anonfun$map2$1(Par.scala:95) |
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
TreeLinkNode leftMost = root; | |
while(leftMost!=null){ | |
TreeLinkNode p = leftMost; | |
while(p!=null && p.left==null && p.right==null){ | |
p = p.next; | |
} | |
if(p==null){ | |
return; | |
} | |
leftMost = p.left!=null ? p.left : p.right; |
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 beginnersbook.com; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.LinkedHashMap; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Set; |
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 beginnersbook.com; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.TreeMap; | |
import java.util.Set; | |
import java.util.Iterator; | |
public class Details { |
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
Comparator<List<Integer>> cp = new Comparator<List<Integer>>(){ | |
public int compare(List<Integer> l1 , List<Integer> l2){ | |
return l1.size()-l2.size(); | |
} | |
} ; | |
Collections.sort(res,cp); | |
//With JDK 8 the syntax is much simpler. | |
List<CustomObject> list = new ArrayList<CustomObject>(); |
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<iostream> | |
#include<cstring> | |
#include<string> | |
#include<stdio.h> | |
#include<algorithm> | |
#include<vector> | |
#include<map> | |
using namespace std; | |
bool used[1000000]; | |
int a[1000000]; |
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 | |
ids=$(aws ec2 describe-volumes --output=json --query 'Volumes[?State!=`in-use`].VolumeId') | |
arr=() | |
read -a arr <<< $(echo "$ids"| jq '.[]') | |
for id in "${arr[@]}"; do | |
#remove the suffix double quotes | |
id="${id%\"}" | |
#remove the prefix double quotes |
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.intuit.sb.dispatcher; | |
import com.intuit.qbn.util.ids.CompanyId; | |
import com.intuit.sb.dispatcher.common.domain.CompanyShardVHost; | |
import com.intuit.sb.dispatcher.common.error.ServiceErrorBean; | |
import com.intuit.sb.dispatcher.error.ServiceException; | |
import org.apache.http.conn.ssl.NoopHostnameVerifier; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
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.intuit.sb.dispatcher; | |
import org.apache.http.client.config.RequestConfig; | |
import org.apache.http.client.methods.CloseableHttpResponse; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.conn.ssl.NoopHostnameVerifier; | |
import org.apache.http.conn.ssl.SSLConnectionSocketFactory; | |
import org.apache.http.conn.ssl.TrustSelfSignedStrategy; | |
import org.apache.http.impl.client.CloseableHttpClient; | |
import org.apache.http.impl.client.HttpClientBuilder; |
NewerOlder