Skip to content

Instantly share code, notes, and snippets.

View ridv's full-sized avatar

Renán I. Del Valle ridv

View GitHub Profile
@ridv
ridv / error0.log
Created May 12, 2021 23:57
Mesos 1.10 Compilation issues
Using:../configure --enable-ssl
make[5]: Entering directory '/x/home/rdelvalle/mesos-1.10.0/build/3rdparty/libprocess'
/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DPACKAGE_NAME=\"mesos\" -DPACKAGE_TARNAME=\"mesos\" -DPACKAGE_VERSION=\"1.10.0\" -DPACKAGE_STRING=\"mesos\ 1.10.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"mesos\" -DVERSION=\"1.10.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_CXX11=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DHAVE_OPENSSL_SSL_H=1 -DUSE_SSL_SOCKET=1 -DHAVE_FTS_H=1 -DHAVE_APR_POOLS_H=1 -DHAVE_LIBAPR_1=1 -DHAVE_LIBCURL=1 -DMESOS_HAS_JAVA=1 -DENABLE_NVML=1 -DHAVE_LIBSASL2=1 -DHAVE_SVN_VERSION_H=1 -DHAVE_LIBSVN_SUBR_1=1 -DHAVE_SVN_DELTA_H=1 -DHAVE_LIBSVN_DELTA_1=1 -DHAVE_ZLIB_H=1 -DHAVE_LIBZ=1 -DHAVE_PYTHON=\"2.7\" -DMESOS_HAS_PYTHON=1 -I. -I../../../3rdparty/lib
use std::collections::HashMap;
impl Solution {
pub fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> {
let mut lookup = HashMap::new();
for i in 0..nums.len() {
let key = &(target- nums[i]);
if lookup.contains_key(key) {
return vec![*lookup.get(key).unwrap(), (i as i32)];
}
lookup.insert(nums[i], (i as i32));
#!/usr/bin/python3
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,

Draining

In order to use gorealis to perform maintenance calls to the Aurora scheduler, a client must be created and then used to send a list of hosts to place into DRAINING mode.

First create the client and create a monitor:

    r, err = realis.NewRealisClient(realis.ZKUrl(zkUrl),
        realis.BasicAuth(username, password),
        realis.ThriftJSON(),
{
"executor": {
"name": "thermos",
"command": {
"value": "thermos_executor.pex",
"arguments": [
"--announcer-enable",
"--announcer-ensemble",
"localhost:2181"
],
@ridv
ridv / C.py
Created April 12, 2016 07:53
Da solution
#!/bin/python3
import itertools
import math
PRIMES = [3,5,7,11,13]
def memoizePrimes():
#limit = math.ceil(math.sqrt(1000000000000001))