##In Brief
You may need to configure a proxy server if you're having trouble cloning
or fetching from a remote repository or getting an error
like unable to access '...' Couldn't resolve host '...'
.
Consider something like:
import org.apache.commons.math3.analysis.interpolation.NevilleInterpolator; | |
public class WtfCreator { | |
public static void main(String[] args) { | |
var text = "Hello, world!\n"; | |
double[] x = new double[text.length() + 1]; | |
double[] y = new double[text.length() + 1]; | |
for(var i = 0; i < text.length(); i++) { | |
x[i] = i; |
import bisect | |
class NFA(object): | |
EPSILON = object() | |
ANY = object() | |
def __init__(self, start_state): | |
self.transitions = {} | |
self.final_states = set() | |
self._start_state = start_state |
public class DhondtMethod { | |
public int[] partition(int totalSeats, int[] votes) { | |
int[] seats = new int[votes.length]; | |
if (totalSeats == 0) { | |
return seats; | |
} | |
if (votes.length == 0) { | |
return seats; | |
} |
public class Strings { | |
// From https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Java | |
public int levenshteinDistance (CharSequence lhs, CharSequence rhs) { | |
int len0 = lhs.length() + 1; | |
int len1 = rhs.length() + 1; | |
// the array of distances | |
int[] cost = new int[len0]; | |
int[] newcost = new int[len0]; | |
OkHttpClient client = new OkHttpClient.Builder() | |
// Logging | |
.addInterceptor(new HttpLoggingInterceptor(System.err::println).setLevel(HttpLoggingInterceptor.Level.BODY)) | |
// Timeout | |
.connectTimeout(60, TimeUnit.SECONDS) | |
.writeTimeout(60, TimeUnit.SECONDS) | |
.readTimeout(60, TimeUnit.SECONDS) | |
// Proxy | |
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort)) | |
.proxyAuthenticator(($, response) -> response.request().newBuilder() |
I hereby claim:
To claim this, I am signing this object:
Not empty content |
package replacer; | |
import static com.google.common.base.Preconditions.checkArgument; | |
import static com.google.common.base.Preconditions.checkNotNull; | |
import com.google.common.base.Function; | |
import com.google.common.base.Functions; | |
import com.google.common.collect.ImmutableMap; | |
import com.google.common.collect.ImmutableSet; | |
import com.google.common.collect.Iterables; |
import java.math.BigDecimal; | |
import java.math.RoundingMode; | |
public class Pi { | |
private static final BigDecimal TWO = new BigDecimal("2"); | |
private static final BigDecimal FOUR = new BigDecimal("4"); | |
private static final BigDecimal FIVE = new BigDecimal("5"); | |
private static final BigDecimal TWO_THIRTY_NINE = new BigDecimal("239"); |