View Apache Security
<ifModule mod_headers.c>
Header set Connection keep-alive
Header set Strict-Transport-Security "max-age=31536000;"
Header set Content-Security-Policy "script-src 'self'"
Header set X-Frame-Options "Deny"
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"
Header set Referrer-Policy ""
Header set Content-Security-Policy "default-src 'self';"
</ifModule>
View 317-counting-elements.py
# from https://www.reddit.com/r/dailyprogrammer/comments/6eerfk/20170531_challenge_317_intermediate_counting/
import re
challenges = """CCl2F2
NaHCO3
C4H8(OH)2
PbCl(NH3)2(COOH)2"""
stack = [{
'elements': {},
View 311.py
# from https://www.reddit.com/r/dailyprogrammer/comments/65vgkh/20170417_challenge_311_easy_jolly_jumper/
challenges = """4 1 4 2 3
5 1 4 2 -1 6
4 19 22 24 21
4 19 22 24 25
4 2 -1 0 2"""
def solve(challenge):
View concatenated_integers.py
# so definiert man eine Funktion
def permutations(numbers):
# wenn die Liste nur eine Zahl enthält,
# können wir sie direkt zurückgeben
if len(numbers) == 1:
return [numbers]
# die leere Liste hier benutzen wir
# um die Ergebnisse zwischenzuspeichern
result = []
View codys_jams.py
prices = [9, 9, 12, 12, 12, 15, 16, 20]
new_prices = []
# The lowest price has to be a reduces price
# Then calculate the original price from that
# remove both from the prices list and do it again
def solve (prices, new_prices):
if len(prices) == 0:
return new_prices
View rolling-average.py
import itertools
import math
items = [10, 3, 4, 10]
steps = 10
def make(a, b):
print(a, b)
result = []
View transitivity.js
'use strict'
var tags = {
'a': ['b', 'c', 'd'],
'b': ['c', 'd'],
'c': ['d'],
'd': [],
'e': [],
'f': ['a']
}
View tarjan.js
'use strict'
const tags = {
'1': ['2'],
'2': ['1', '5'],
'3': ['4'],
'4': ['3', '5'],
'5': ['6'],
'6': ['7'],
'7': ['8'],
View threesteep.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Animation</title>
<meta name="description" content="FDSAnimation">
<meta name="author" content="katze">