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
class DummyTests: XCTestCase { | |
var eventLoopGroup: EventLoopGroup! | |
var serverChannel: Channel? | |
var serverAddress: SocketAddress? | |
override func setUpWithError() throws { | |
eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1) | |
try startTestServer() | |
} |
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
// Define function to compute NDVI | |
function addNDVI(image) { | |
return image.addBands(image.normalizedDifference(['B8', 'B4']).rename('ndvi')); | |
} | |
// Define function to filter and compute NDVI for a given year and region | |
function processYearlyData(year, region) { | |
var startDate = ee.Date.fromYMD(year, 4, 1); | |
var endDate = ee.Date.fromYMD(year, 9, 30); |
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
/// The following algorithm recovers the prime factors of a modulus, given the public and private exponents. | |
/// The algorithm is based on Fact 1 in [Boneh 1999]. | |
static func calculatePrimeFactors(n: BigUInt, e: BigUInt, d: BigUInt) throws -> (p: BigUInt, q: BigUInt) { | |
let k = (d * e) - 1 | |
guard k & 1 == 0 else { | |
throw RSAError.keyInitializationFailure | |
} | |
let t = k.trailingZeroBitCount, r = k >> t |
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 json | |
import base64 | |
from pyspx import sha2_128s | |
import os | |
# 48 bytes seed | |
seed = "0123456789abcdef0123456789abcdef0123456789abcdef".encode('utf-8') | |
public_key, secret_key = sha2_128s.generate_keypair(seed) |
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
docker run --platform linux/x86_64 \ | |
--name resurva-delete-manager-mysql \ | |
-e MYSQL_ROOT_PASSWORD=password \ | |
-e MYSQL_DATABASE=database \ | |
-e MYSQL_USER=username \ | |
-e MYSQL_PASSWORD=password \ | |
-v .../some_dump.sql:/docker-entrypoint-initdb.d/dump.sql \ | |
-p 3306:3306 \ | |
-d mysql:5.7 |
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
replace: XCTAssertNil\((.*)\) | |
with: #expect($1 == nil) | |
replace: XCTAssertNotNil\((.*)\) | |
with: #expect($1 != nil) |