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 { | |
createBrowserRouter, | |
Outlet, | |
Link, | |
RouterProvider, | |
useLoaderData, | |
useNavigate | |
} from 'react-router-dom'; | |
function recordLoaderInvocation(routeName) { |
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 numpy | |
import numpy.random | |
# Befolkningen (100 stk) med telefoner | |
telefoner = numpy.array(["android"] * 45 + ["iphone"] * 35 + ["diverse"] * 20) | |
simuleringer = 1000000 | |
minst_7_av_10 = {"android": 0, "iphone": 0, "diverse": 0} | |
for _ in range(simuleringer): | |
# Trekk ut ti tilfeldige telefoner |
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 random | |
# Befolkningen (100 stk) med telefoner | |
telefoner = ["android"] * 45 + ["iphone"] * 35 + ["diverse"] * 20 | |
simuleringer = 1000000 | |
minst_7_av_10 = {"android": 0, "iphone": 0, "diverse": 0} | |
for _ in range(simuleringer): | |
# Trekk ut ti tilfeldige telefoner | |
tilfeldige = random.sample(telefoner, 10) |
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
from suds.cache import NoCache | |
from suds.sax.parser import Parser | |
class StaticSudsCache(NoCache): | |
def get(self, id): | |
STATIC = {"http://www.w3.org/2001/xml.xsd": XML_XSD, | |
"http://www.w3.org/2001/XMLSchema.xsd": XMLSCHEMA_XSD } | |
xml_string = STATIC.get(id.name) | |
if xml_string: | |
p = Parser() |
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
============= | |
example | |
============= | |
>>> a = 3 | |
>>> a - 1 | |
2 |