Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:
sysctl -a | grep machdep.cpu.features | grep VMX
If there's output, you're good!
| class TemplatesTest(TestCase): | |
| def test_templates(self): | |
| """Templates can compile properly and there's no mismatched tags""" | |
| # get app template dirs | |
| template_dirs = [] | |
| apps = [app for app in settings.INSTALLED_APPS | |
| if app.startswith('rh2')] | |
| for app in apps: | |
| mod = import_module(app) |
| def cycle_key(self): | |
| #TODO: Errors here will tank the system, probably need some better handling... | |
| old_session_key = self.session_key | |
| old_session = Session.objects.get(session_key=old_session_key) | |
| try: | |
| cart = Cart.objects.get(session=old_session) | |
| super(SessionStore, self).cycle_key() | |
| new_session_key = self.session_key | |
| new_session = Session.objects.get(session_key=new_session_key) | |
| cart.session = new_session |
| # See http://pacha.hk/2017-07-12_r_and_python_via_homebrew.html | |
| # XCode CLT | |
| xcode-select --install | |
| # Update Homebrew and add formulae | |
| brew update | |
| # Check for broken dependencies and/or outdated packages | |
| brew doctor |
| <?php | |
| /** | |
| * This is an implementation of the Knuth-Morris-Pratt-Algorithm as in | |
| * Thomas H. Cormen et. al.: "Algorithmen - Eine Einführung" | |
| * (German version by Paul Molitor) 3. Auflage, page 1017 | |
| * | |
| * My changes: | |
| * - Indexes starting with 0 | |
| * - overlapping matches are recognized | |
| */ |
| class KMP: | |
| def partial(self, pattern): | |
| """ Calculate partial match table: String -> [Int]""" | |
| ret = [0] | |
| for i in range(1, len(pattern)): | |
| j = ret[i - 1] | |
| while j > 0 and pattern[j] != pattern[i]: | |
| j = ret[j - 1] | |
| ret.append(j + 1 if pattern[j] == pattern[i] else j) |
| """ | |
| This module contains an implementation of the Knuth-Morris-Pratt algorithm allowing to look for sequence matching. | |
| For example if you want to find the sequence [1, 2, 3] in [2, 3, 1, 2, 3, 5, 6], you could do: | |
| find_sequence([2, 3, 1, 2, 3, 5, 6], [1, 2, 3]) | |
| This algorithm is especially interesting in case of many partial matches. Otherwise, you could simply use a brute | |
| force search with correct performances. | |
| The main function to use here is find_sequence which actually performs the KMP algorithm. |
| <?php | |
| // Referensi : | |
| // https://id.wikipedia.org/wiki/Algoritma_Knuth-Morris-Pratt | |
| // https://stackoverflow.com/questions/44081348/is-it-possible-to-use-knuth-morris-pratt-algorithm-for-string-matching-on-text-t | |
| // http://www.elangsakti.com/2013/03/implementasi-algoritma-string-matching.html | |
| // https://stackoverflow.com/questions/29439930/knuth-morris-pratt-string-search-algorithm | |
| // https://stackoverflow.com/questions/5873935/how-to-optimize-knuth-morris-pratt-string-matching-algorithm | |
| // https://stackoverflow.com/questions/13271856/understanding-knuth-morris-pratt-algorithm | |
| // | |
| // |