When unsing docker compose you can have a problem with the order of dependent linked containers
The solution is to start a script which tries to access a service and waits until it gets ready before loading your program
| #!/usr/bin/env bash | |
| # first argument of the script is Xapian version (e.g. 1.2.19) | |
| VERSION=$1 | |
| # prepare | |
| mkdir $VIRTUAL_ENV/packages && cd $VIRTUAL_ENV/packages | |
| CORE=xapian-core-$VERSION | |
| BINDINGS=xapian-bindings-$VERSION |
When unsing docker compose you can have a problem with the order of dependent linked containers
The solution is to start a script which tries to access a service and waits until it gets ready before loading your program
A running example of the code from:
This gist creates a working example from blog post, and a alternate example using simple worker pool.
TLDR: if you want simple and controlled concurrency use a worker pool.
Most GStreamer examples found online are either for Linux or for gstreamer 0.10.
This particular release note seems to have covered important changes, such as:
Applying -v will print out useful information. And most importantly the negotiation results.
| """ | |
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. | |
| In jurisdictions that recognize copyright laws, the author or authors | |
| of this software dedicate any and all copyright interest in the |
| from typing import Tuple | |
| class TrieNode(object): | |
| """ | |
| Our trie node implementation. Very basic. but does the job | |
| """ | |
| def __init__(self, char: str): | |
| self.char = char |
| ## Add this to the first block in your note book | |
| import uuid | |
| from IPython.core.display import display, HTML | |
| import json | |
| class RenderJSON(object): | |
| def __init__(self, json_data): | |
| if isinstance(json_data, dict): | |
| self.json_str = json.dumps(json_data) |
| # (c) miraculixx, licensed as by the terms of WTFPL, http://www.wtfpl.net/txt/copying/ | |
| # License: DO WHATEVER YOU WANT TO with this code. | |
| # | |
| # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
| # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
| # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
| # | |
| from io import StringIO | |
| from contextlib import contextmanager |
| import re | |
| def get_tokens_with_entities(raw_text: str): | |
| raw_tokens = re.split(r"\s(?![^\[]*\])", raw_text) | |
| entity_value_pattern = r"\[(?P<value>.+?)\]\((?P<entity>.+?)\)" | |
| entity_value_pattern_compiled = re.compile(entity_value_pattern, flags=re.I|re.M) | |
| tokens_with_entities = [] | |
| for raw_token in raw_tokens: | |
| match = entity_value_pattern_compiled.match(raw_token) |