This file contains hidden or 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
def bits_converter(x): | |
index = 0 | |
bits = "" | |
while x is not 0: | |
bits += str(x & 1) | |
x = x >> 1 | |
index+=1 | |
return bits[::-1] |
This file contains hidden or 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.mockito.Mock; | |
import static org.mockito.Mockito.when; | |
@Mock | |
private Context mockApplicationContext; | |
@Mock | |
private Resources mockContextResources; | |
@Mock | |
private SharedPreferences mockSharedPreferences; |
This file contains hidden or 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
android { | |
applicationVariants.all { variant -> | |
def versionCode = android.defaultConfig.versionCode | |
def versionName = android.defaultConfig.versionName | |
def appendToFileName = versionName + "-build-" + versionCode | |
// copy and rename mapping.txt file if in minify is enable | |
if (variant.getBuildType().isMinifyEnabled()) { | |
variant.assemble.doLast{ | |
copy { |
This file contains hidden or 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
/* | |
Our function f(x) | |
*/ | |
function f(x) { | |
return x*x +5; | |
} | |
/* | |
The derivative df/dx of our function f(x) | |
*/ |
This file contains hidden or 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
public class BinaryOperationsAndBitmasks { | |
public static void main(String[] args) { | |
new BinaryOperationsAndBitmasks().bitsOperations(); | |
} | |
/** | |
* Basic bitmap operations | |
*/ | |
private void bitsOperations() { |
This file contains hidden or 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 kotlinx.coroutines.* | |
import kotlinx.coroutines.flow.* | |
import kotlinx.coroutines.channels.* | |
fun main() = runBlocking<Unit> { | |
// create a Channel with a buffer of size 20 | |
// this means that until 20 the send() are not suspending waiting for a receive() | |
val channel = Channel<String>(20) | |
This file contains hidden or 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.junit.rules.TestWatcher | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.test.* | |
import org.junit.runner.Description | |
@ExperimentalCoroutinesApi | |
class CoroutineTestRule(val dispatcher: TestCoroutineDispatcher = TestCoroutineDispatcher()) : TestWatcher() { | |
override fun starting(description: Description?) { |
This file contains hidden or 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 javax.crypto.Cipher; | |
import java.security.spec.KeySpec; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.SecretKey; | |
import javax.crypto.spec.SecretKeySpec; | |
import javax.crypto.SecretKeyFactory; | |
import java.security.AlgorithmParameters; | |
import javax.crypto.spec.IvParameterSpec; | |
public class Decrypter { |
This file contains hidden or 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
Accept-Encoding: gzip | |
Accept-Language: en-US;q=1.0 | |
Authorization: Bearer 541f51af2878529f692094b222827e53bf83a0f61553932b2c91bc9ff959c514 | |
Connection: Keep-Alive | |
Content-Length: 109813 | |
Content-Type: application/json; charset=UTF-8 | |
Host: api.staging.dec-poc1.immuni.org | |
Immuni-Dummy-Data: 0 | |
User-Agent: Immuni |
OlderNewer