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
def split_header_footer(filetext, header_re, footer_re): | |
import re | |
import os | |
text = filetext | |
header_start = None | |
for h in header_re: | |
s = h.search(text) | |
if s is not None: | |
header_start = s.start() | |
break |
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
def split_list(l): | |
results = [] | |
for i in range(1, len(l)): | |
results.append((l[:i], l[i:])) | |
return results | |
def abs_diff(a): | |
l, r = a | |
return abs((sum(l)) - sum(r)) | |
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
{'scenario_info': [{'objective_value': 180000000, 'objective_type': 'hit_revenue_target', 'scenario_start_date': '2018-01-01', 'scenario_id': 164, 'scenario_end_date': '2018-12-01'}, {'objective_value': 30000001, 'objective_type': 'optimize_fixed_budget', 'scenario_start_date': '2018-01-01', 'scenario_id': 165, 'scenario_end_date': '2018-12-01'}, {'objective_value': '', 'objective_type': 'maximize_npv', 'scenario_start_date': '2018-01-01', 'scenario_id': 166, 'scenario_end_date': '2018-12-01'}], 'simulation_number': 1000, 'model_start_date': '2015-01-01', 'model_end_date': '2017-05-31', 'estimate_path': '/estimate/brand/77/model/226', 'model_path': '/definition/brand/77/model/226/timeline/9', 'observation_path': '/definition/brand/77/timeline/9', 'frequency': 'MS', 'benchmarks': {'variance covariance': [[20, 15, 7.39e-05], [8, 10, 2.11e-05], [23, 6, 3.16e-06], [9, 24, 3.6e-05], [24, 19, 0.000466782], [12, 15, 5.37e-05], [27, 10, 2.11e-06], [14, 6, 1.68e-05], [28, 24, 0.0], [15, 19, 0.000416076], [17, 10, 9.82 |
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
2017-07-27 09:21:33,664 - main - INFO - Running essentials with parameters {'timeline': '9', 'estimate_path': '/estimate/brand/77/model/226', 'benchmarks': {'estimates': [[6, 6, 0.009848285], [18, 18, 0.016949509], [7, 7, 0.004245447], [19, 19, 0.13425278], [8, 8, 0.028720361], [20, 20, 0.02309901], [9, 9, 0.011348068], [21, 21, 0.005742104], [10, 10, 0.004423368], [23, 23, 0.002164184], [12, 12, 0.017197318], [24, 24, 0.02240653], [13, 13, 0.006360481], [26, 26, 0.073298568], [14, 14, 0.011947603], [27, 27, 0.003117344], [15, 15, 0.021893639], [28, 28, 0.011947603], [16, 16, 0.004279949], [17, 17, 0.014925952]], 'variance covariance': [[20, 15, 7.39e-05], [8, 10, 2.11e-05], [23, 6, 3.16e-06], [9, 24, 3.6e-05], [24, 19, 0.000466782], [12, 15, 5.37e-05], [27, 10, 2.11e-06], [14, 6, 1.68e-05], [28, 24, 0.0], [15, 19, 0.000416076], [17, 10, 9.82e-06], [18, 24, 5.44e-05], [6, 19, 0.000191502], [20, 28, 0.0], [8, 23, 9.86e-06], [23, 18, 5.63e-06], [10, 14, 7.58e-06], [26, 9, 0.000120606], [12, 28, 0.0], [27, 23, 1 |
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
data = {} | |
dmin = {'min': 1500} | |
def get_coins(coins, total, current_sum, acc): | |
if len(coins) == 0 and total > 0: | |
return | |
if total in data and total > 0: | |
acc.extend(data[total]) | |
total -= sum(data[total]) |
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
package bitset | |
import "fmt" | |
const ( | |
chunkSize uint = 8 | |
allSet uint64 = 1<<8 - 1 | |
allReset uint64 = 0 | |
) |
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
package main | |
import ( | |
"fmt" | |
"github.com/go-redis/redis" | |
"time" | |
) | |
func main() { | |
cli_set_del := redis.NewClient(&redis.Options{ |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Import | |
from pyomo.environ import * | |
# Creation of a Concrete Model | |
model = ConcreteModel() | |
## Define sets ## |
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 mpmath | |
import sympy as sp | |
lambda_exp = sp.lambdify(symbols, expr_string, modules=['mpmath']) | |
values = extract_values(model, symbols) | |
for i, k in enumerate(symbols): | |
for j, v in enumerate(symbols): | |
degrees = [0] * len(symbols) | |
degrees[i] = 1 | |
degrees[j] = 1 |
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
[0mHash: [1m[37m4d17d39a3394cf7d3f6d[39m[22m[0m | |
[0mTime: [1m[37m5135[39m[22mms[0m | |
[0mchunk {[1m[33minline[39m[22m} [1m[32minline.bundle.js, inline.bundle.js.map[39m[22m (inline) 5.83 kB [1m[33m[entry][39m[22m[1m[32m [rendered][39m[22m[0m | |
[0mchunk {[1m[33mmain[39m[22m} [1m[32mmain.bundle.js, main.bundle.js.map[39m[22m (main) 303 bytes [1m[33m[initial][39m[22m[1m[32m [rendered][39m[22m[0m | |
[0mchunk {[1m[33mpolyfills[39m[22m} [1m[32mpolyfills.bundle.js, polyfills.bundle.js.map[39m[22m (polyfills) 323 bytes {[1m[33minline[39m[22m} [1m[33m[initial][39m[22m[1m[32m [rendered][39m[22m[0m | |
[0mchunk {[1m[33mstyles[39m[22m} [1m[32mstyles.bundle.js, styles.bundle.js.map[39m[22m (styles) 31.3 kB {[1m[33minline[39m[22m} [1m[33m[initial][39m[22m[1m[32m [rendered][39m[22m[0m | |
[0m[0m | |
[0m[1m[31mERROR in /opt/jenkins/workspace/test-vorsia/webapp/src/app/app.module.ts (92,31): Cannot find module './main/tags/tags.component'.[39m[22m[ |
OlderNewer