Skip to content

Instantly share code, notes, and snippets.

View firemanxbr's full-sized avatar

Marcelo Barbosa firemanxbr

View GitHub Profile
variable "username_arns" {
type = "list"
}
variable "ecr_name" {
description = "Name of the repository."
type = string
default = "topia"
}
@firemanxbr
firemanxbr / gist:78f0b545f80f8e37d323f510915bc076
Created September 16, 2019 20:12
# Recursive Python program to generate all binary strings formed by replacing each wildcard character by 0 or 1
array = []
def _print(string, index):
if index == len(string):
array.append(''.join(string))
if index == len(array):
print(array)
return
Write a function that checks an expression has matching brackets and returns true if it does and false otherwise.
e.g.
'The is a (full) sentence.' -> True
'(x + y)/ 4' -> True
from lfw import lfw_acquisition
from task import face_rec
import numpy
import time
TIME_LOCAL = time.localtime()
URL = 'http://vis-www.cs.umass.edu/lfw/lfw.tgz'
MD5SUM = 'a17d05bd522c52d84eca14327a23d494'
### 1
############################################################
Jul 04 2019 11:02:53:1562238173 - Starting Producer Process...
Jul 04 2019 11:02:53:1562238173 - Starting Creating Tasks...
Jul 04 2019 11:02:53:1562238173 - Total of Tasks Created: ('%s', 13233)
Jul 04 2019 11:02:53:1562238173 - Getting Tasks Done...
Jul 04 2019 11:02:53:1562238173 - Total of Tasks Finished: ('%s', 19483)
Jul 04 2019 11:02:53:1562238173 - Calculating Average Vectors...
Jul 04 2019 11:02:53:1562238173 - Result of calculation the average of values:
[-1.28076958e-01 1.01553618e-01 5.64279974e-02 -3.82464919e-04
import os
import uuid
from flask import Flask
from flask import request
from flask import Response
import json
import numpy
import task
[-0.12110219 0.07778011 0.05862561 -0.06739802 -0.09494878 -0.02356888
0.03665838 -0.14112727 0.13716194 -0.16521029 0.19339843 -0.14413215
-0.30511448 -0.00584946 -0.04346704 0.17418781 -0.05388782 -0.13542999
-0.19144855 -0.07069826 -0.03808417 0.05763069 -0.02426734 0.09835827
-0.04918713 -0.21698229 -0.05045231 -0.05246273 -0.04034742 -0.09073798
-0.00709551 0.19822432 -0.1093476 -0.01838927 0.01872099 0.10972119
-0.09851629 -0.11887749 0.14072435 -0.10864477 -0.1431265 -0.03212778
0.09396286 0.22815582 0.15397763 -0.05741321 0.00585715 -0.09679608
0.11760779 -0.30035311 -0.04734506 0.1183826 0.06383863 0.10817996
0.14121276 -0.19078444 0.04363749 0.18039782 -0.17052619 0.05111434
[-0.12110219 0.07778011 0.05862561 -0.06739802 -0.09494878 -0.02356888
0.03665838 -0.14112727 0.13716194 -0.16521029 0.19339843 -0.14413215
-0.30511448 -0.00584946 -0.04346704 0.17418781 -0.05388782 -0.13542999
-0.19144855 -0.07069826 -0.03808417 0.05763069 -0.02426734 0.09835827
-0.04918713 -0.21698229 -0.05045231 -0.05246273 -0.04034742 -0.09073798
-0.00709551 0.19822432 -0.1093476 -0.01838927 0.01872099 0.10972119
-0.09851629 -0.11887749 0.14072435 -0.10864477 -0.1431265 -0.03212778
0.09396286 0.22815582 0.15397763 -0.05741321 0.00585715 -0.09679608
0.11760779 -0.30035311 -0.04734506 0.1183826 0.06383863 0.10817996
0.14121276 -0.19078444 0.04363749 0.18039782 -0.17052619 0.05111434
version: '2'
services:
rabbit:
hostname: rabbit
image: rabbitmq:3.7.15
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=mypass
ports:
- "5672:5672"
def min_by_key(key, records):
"""
Step 1
Throughout this interview, we'll pretend we're building a new analytical
database. Don't worry about actually building a database though – these will
all be toy problems.
Here's how the database works: all records are represented as maps, with string
keys and integer values. The records are contained in an array, in no