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 numpy as np | |
import pulp | |
# create the LP object, set up as a maximization problem | |
prob = pulp.LpProblem('Giapetto', pulp.LpMaximize) | |
# set up decision variables | |
soldiers = pulp.LpVariable('soldiers', lowBound=0, cat='Integer') | |
trains = pulp.LpVariable('trains', lowBound=0, cat='Integer') |
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 numpy as np | |
from scipy.optimize import minimize | |
w0 = 0 | |
w1 = 0 | |
w2 = 0 | |
w3 = 0 | |
ws = np.array([w0, w1, w2, w3]) |
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
from numpy import array, sum as npsum | |
from scipy.optimize import minimize | |
cons = ( | |
{'type': 'ineq', 'fun': lambda x: array([25 - 0.2 * x[0] - 0.4 * x[1] - 0.33 * x[2]])}, | |
{'type': 'ineq', 'fun': lambda x: array([130 - 5 * x[0] - 8.33 * x[2]])}, | |
{'type': 'ineq', 'fun': lambda x: array([16 - 0.6 * x[1] - 0.33 * x[2]])}, | |
{'type': 'ineq', 'fun': lambda x: array([7 - 0.2 * x[0] - 0.1 * x[1] - 0.33 * x[2]])}, | |
{'type': 'ineq', 'fun': lambda x: array([14 - 0.5 * x[1]])}, | |
{'type': 'ineq', 'fun': lambda x: array([x[0]])}, |
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
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from django.contrib.auth import password_validation | |
from django.contrib.auth.forms import UserCreationForm, UserChangeForm | |
from accounts.models import User | |
class CustomUserCreationForm(UserCreationForm): |
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
# Let's move to the proper GIT branch | |
git checkout $BRANCH | |
git pull origin $BRANCH | |
# Let's go to the correct folder | |
cd converter | |
# Install the dependencies | |
npm install |
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
# Let's move to the proper GIT branch | |
git checkout $BRANCH | |
git pull origin $BRANCH | |
# Activate the virtualenv of this job | |
. venv/bin/activate | |
# Install project requirements | |
pip install -Ur requirements.txt |
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
{ | |
"Working Directory" : "\/Users\/matiasherranz", | |
"Prompt Before Closing 2" : 0, | |
"Selected Text Color" : { | |
"Green Component" : 0.8470588, | |
"Blue Component" : 0.4784314, | |
"Red Component" : 0.7607843 | |
}, | |
"Rows" : 25, | |
"Ansi 11 Color" : { |
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
function Car() { | |
} | |
Car.protoype = { | |
} |
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
santex@santex-VirtualBox:~/DevIT/nagios_samanage$ cat nagios.cfg | |
# 'notify-host-by-sam' command definition | |
define command{ | |
command_name notify-host-by-sam | |
command_line <perl path> <script path>/sam_createcase --hostname=$HOSTNAME$ --type="$NOTIFICATIONTYPE$" --state=$HOSTSTATE$ --address=$HOSTADDRESS$ --output="$HOSTOUTPUT$" --date="$LONGDATETIME$" | |
} | |
# 'notify-service-by-sam' command definition | |
define command{ | |
command_name notify-service-by-sam |
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 re | |
def get_extension(filename): | |
regex = re.compile(r'^.*?.(?P<ext>.tar\.gz|.tar\.bz2|.\w+)$') | |
return regex.match(filename).group('ext') |