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
find_package(Threads REQUIRED) | |
ExternalProject_Add( | |
googletest | |
GIT_REPOSITORY https://github.com/google/googletest.git | |
UPDATE_COMMAND "" | |
INSTALL_COMMAND "" | |
LOG_DOWNLOAD ON | |
LOG_CONFIGURE ON | |
LOG_BUILD ON) |
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 sys | |
import random | |
import time | |
from threading import * | |
class Producer(Thread): | |
def __init__(self, items, can_produce, can_consume): | |
Thread.__init__(self) | |
self.items = items | |
self.can_produce = can_produce |
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
#!flask/bin/python | |
from flask import Flask, jsonify, abort, request, make_response, url_for | |
from flask_httpauth import HTTPBasicAuth | |
app = Flask(__name__, static_url_path = "") | |
auth = HTTPBasicAuth() | |
@auth.get_password | |
def get_password(username): | |
if username == 'miguel': |
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
<?php | |
/** | |
* Checks if an email is a valid RFC 2822 email address | |
* | |
* Examples: | |
* <code> | |
* <?php | |
* validate_email('[email protected]'); // returns true | |
* validate_email('Felds Liscia <[email protected]>'); // returns false |