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
template <typename KeyType, typename ValueType> | |
bool SmartArray<KeyType, ValueType>::add(KeyType key, ValueType value) { | |
if(has(key)) return false; | |
// Init a bigger pointer array | |
Pair<KeyType, ValueType>** newData = new Pair<KeyType, ValueType>*[size+1]; | |
if(size == 0) { | |
newData[0] = new Pair<KeyType, ValueType>(key, value); | |
} else { |
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 okhttp3.OkHttpClient; | |
public class OkHttpUtil { | |
public static OkHttpClient getOkHttpClient() { | |
return new OkHttpClient.Builder() | |
.socketFactory(new TCPKeepaliveSocketFactory(60, 60, 5)) | |
.build(); | |
} | |
public static OkHttpClient getSSLOkHttpClient() { |