Skip to content

Instantly share code, notes, and snippets.

"""Glop simple example."""
from google.apputils import app
from ortools.linear_solver import pywraplp
def main(_):
# Instantiate a Glop solver, naming it SolveSimpleSystem.
solver = pywraplp.Solver('SolveSimpleSystem',
"""Glop example: the Stigler diet."""
from google.apputils import app
from ortools.linear_solver import pywraplp
def main(_):
# Commodity, Unit, 1939 price (cents), Calories, Protein (g), Calcium (g), Iron (mg), Vitamin A (IU), Thiamine (mg), Riboflavin (mg), Niacin (mg), Ascorbic Acid (mg)
data = [
['Wheat Flour (Enriched)', '10 lb.', 36, 44.7, 1411, 2, 365, 0, 55.4, 33.3, 441, 0],
# Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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,
@spatzle
spatzle / OpennlpServlet.java
Created July 25, 2011 17:52
Opennlp-servlet
package com.example.opennlp;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.TreeSet;
import javax.servlet.*;
import javax.servlet.http.*;
mkdir free_monkey
cd free_monkey
git init
git remote add origin git@YOUR_SERVER_HOSTNAME:free_monkey.git
# do some work, git add and commit files
git push origin master:refs/heads/master
mkdir free_monkey
cd free_monkey
git init
git remote add origin git@YOUR_SERVER_HOSTNAME:free_monkey.git
# do some work, git add and commit files
# need the allow empty flag
git commit -a -m "added files" --allow-empty
git push origin master:refs/heads/master
@spatzle
spatzle / install-graphite-ubuntu-11.10.sh
Created October 21, 2011 20:05
Install Graphite 0.9.9 (works on Ubuntu 11.04)
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# Forked from: http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Ubuntu 11.04
# Last tested & updated 10/14/2011
####################################
#sudo apt-get update
#sudo apt-get dist-upgrade
@spatzle
spatzle / install_es.sh
Created October 24, 2011 17:32 — forked from aaronshaf/es.sh
Install ElasticSearch on Ubuntu 11.04
cd ~
sudo apt-get install unzip
sudo apt-get install python-software-properties -y
# before this step make sure /etc/hostname is same as /etc/hosts
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.6.tar.gz -O elasticsearch.tar.gz
@spatzle
spatzle / setup-statsd.sh
Created November 2, 2011 20:48 — forked from collegeman/setup-statsd.sh
Turn an Ubuntu 10.04 linode into a StatsD/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
#git clone git://github.com/joyent/node.git
wget http://nodejs.org/dist/latest/node-v0.5.10.tar.gz
tar xvfz node-v0.5.10.tar.gz
mv node-v0.5.10 node
cd node
./configure
@spatzle
spatzle / graphite-centos6-install.txt
Created May 31, 2012 22:56 — forked from dillera/graphite-centos6-install.txt
Install Graphite 0.9.9 and Statsd on Centos 6
# FOR CENTOS 6
# Andrew Diller Jan 2012
# Get EPEL Repo installed
rpm --httpproxy proxy --httpport 3128 --import https://fedoraproject.org/static/0608B895.txt
rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
vi /etc/yum.repos.d/epel.repo