This is a (very) simple Flask application that shows how the built-in Python buildpack detection on Cloud Foundry works.
To push to Cloud Foundry, log in and then use
$ cf push myapp-name
| function addGlobalStyle(css) { | |
| var head, style; | |
| head = document.getElementsByTagName('head')[0]; | |
| if (!head) { return; } | |
| style = document.createElement('style'); | |
| style.type = 'text/css'; | |
| style.innerHTML = css; | |
| head.appendChild(style); | |
| } | |
| function replaceSpanContentById(sid, txt) { |
| import java.util.*; | |
| public class TmpMain { | |
| List<One2OneTransfer> makeTransfer(List<AccountBalance> accounts, int baseAmount) { | |
| if (accounts == null || accounts.isEmpty()) { | |
| return Collections.emptyList(); // TODO we treat this case as doing nothing | |
| } | |
| int sum = accounts.stream().mapToInt(a -> a.balance).sum(); // TODO we assume amount sum would not exceed MAX INT | |
| if (sum / accounts.size() < baseAmount) { | |
| return null; // null means unable to do such a transfer |
| cache = dict() | |
| def min_coin_cnt(i, j, k, n): | |
| """ | |
| assert i + j*5 + k * 10 >= n * 8 | |
| """ | |
| if n == 0: | |
| return 0 | |
| elif (i, j, k, n) in cache: | |
| # print("HIT ", (i,j,k,n), '=', cache[(i,j,k,n)]) | |
| return cache[(i,j,k,n)] |
| class DisjointSet(object): | |
| index = list() | |
| depth = list() | |
| def __init__(self, n): | |
| self.index = list(range(n)) | |
| self.depth = [0] * n | |
| def tree_num(self): |
| [9291,9293,9295] |
| # A bit array demo - written for Python 3.0 | |
| import array | |
| def makeBitArray(bitSize, fill = 0): | |
| intSize = bitSize >> 5 # number of 32 bit integers | |
| if (bitSize & 31): # if bitSize != (32 * n) add | |
| intSize += 1 # a record for stragglers | |
| if fill == 1: | |
| fill = 4294967295 # all bits set | |
| else: | |
| fill = 0 # all bits cleared |
| #!/usr/bin/env python3 | |
| """ | |
| Very simple HTTP server in python for logging requests | |
| Usage:: | |
| ./server.py [<port>] | |
| """ | |
| from http.server import BaseHTTPRequestHandler, HTTPServer | |
| import logging | |
| class S(BaseHTTPRequestHandler): |
| #!/usr/bin/env python | |
| import os | |
| from PIL import Image, ExifTags | |
| from shutil import copyfile | |
| orientation = 0x0112 # image exif info for Orientation 274 | |
| device = 0x010f # image exif info for Make 271 | |
| src_dir = 'todo' |
| class Thrift < Formula | |
| desc "Framework for scalable cross-language services development" | |
| homepage "https://thrift.apache.org/" | |
| stable do | |
| url "https://www.apache.org/dyn/closer.cgi?path=/thrift/0.9.3/thrift-0.9.3.tar.gz" | |
| sha256 "b0740a070ac09adde04d43e852ce4c320564a292f26521c46b78e0641564969e" | |
| # Apply any necessary patches (none currently required) | |
| [ |
This is a (very) simple Flask application that shows how the built-in Python buildpack detection on Cloud Foundry works.
To push to Cloud Foundry, log in and then use
$ cf push myapp-name