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 Statements | |
public class ActivityName extends AppCompatActivity { | |
private RecyclerView mRecyclerView; | |
private RecyclerView.Adapter mAdapter; | |
private RecyclerView.LayoutManager mLayoutManager; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
/* | |
* Copyright (c) 2018. Gaurav Sharma, All rights reserved. | |
*/ | |
package practice; | |
public class SortedTriplet { | |
private static boolean hasTriplet(int[] arr) { | |
/** |
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.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; | |
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; | |
@EnableRedisHttpSession | |
@EnableEurekaClient | |
@SpringBootApplication | |
public class UIApplication { |
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
dependencies { | |
compile 'org.springframework.boot:spring-boot-starter-data-redis' | |
compile("org.springframework.boot:spring-boot-starter-cache") | |
implementation('org.springframework.session:spring-session-data-redis') | |
} |
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
spring.cache.type=redis | |
spring.redis.host=<ip-address> | |
spring.redis.port=<Redis port> |
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
/* | |
Header for your request | |
*/ | |
header = { 'content-type': 'application/json'}; | |
/* | |
Converts the Request to a Obejct. | |
*/ |
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 bloomfilter; | |
public interface BloomFilter { | |
void addData(String data); | |
boolean isPresent(String data); | |
String getInfo(); | |
} |
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 bloomfilter; | |
import java.util.Arrays; | |
import java.util.BitSet; | |
public abstract class AbstractBloomFilter implements BloomFilter { | |
protected BitSet bitSet; | |
protected int expectedElements = -1; | |
protected double falsePosProbability = -1; |
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 bloomfilter; | |
import bloomfilter.hash.Murmur3; | |
public class BasicBloomFilter extends AbstractBloomFilter { | |
public BasicBloomFilter(int size) { | |
super(size); | |
} |
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 bloomfilter.test; | |
import bloomfilter.BasicBloomFilter; | |
import bloomfilter.BloomFilter; | |
import java.util.Arrays; | |
import java.util.Random; | |
public class BloomFilterTest { |
OlderNewer