Skip to content

Instantly share code, notes, and snippets.

@yonatanm
yonatanm / 14-Sep-2017.java
Last active September 14, 2017 15:15
Explain why (r1 == true) and (r2==false) ?
Set<URL> mySet = new HashSet<>();
mySet.add(new URL("https://my.outbrain.com"));
boolean r1 = mySet.contains(new URL("https://my.outbrain.com")); // Returns true
System.out.println("r1 = " + r1);
Thread.sleep(60 * 1000); // sleeping for 1 minute
boolean r2 = mySet.contains(new URL("https://my.outbrain.com")); // Return false
System.out.println("r2 = " + r2);
@ststeiger
ststeiger / SevenZipHelper.cs
Created November 18, 2014 10:22
LZMA-Compression with SevenZip SDK
// http://www.nullskull.com/a/768/7zip-lzma-inmemory-compression-with-c.aspx
// http://www.7-zip.org/sdk.html
namespace SevenZip.Compression.LZMA
{
public static class SevenZipHelper
{