Start by initializing the environment
$ docker-compose up broker ksql-cliConnect to the KSQL CLI:
$ docker-compose exec ksql-cli ksql http://ksql-server:8088| #!/bin/sh | |
| # Quick access to the Pod's log based on the name of the app. | |
| # Please, note that this script assumes you have a selector | |
| # called "app" on your pod. If you want to use a different | |
| # selector simply update the script | |
| if [[ -z "$1" || -z "$2" ]]; then | |
| echo "Please, provide an app name and namespace." | |
| echo "Example: ./kubelog.sh name-of-app dev" | |
| exit 1 |
| from random import randint | |
| def quick_sort(arr, start, end): | |
| if start >= end: | |
| return arr | |
| pivot_idx = partition(arr, start, end) | |
| quick_sort(arr, start, pivot_idx - 1) | |
| quick_sort(arr, pivot_idx + 1, end) |
| #!/usr/bin/env python | |
| class TreeNode: | |
| def __init__(self): | |
| self.value = None | |
| self.left = None | |
| self.right = None | |
| self.size = 0 |
| from tweepy import OAuthHandler, API | |
| from nltk.corpus import stopwords | |
| from textblob import TextBlob | |
| import re | |
| import json | |
| class TwitterClient(object): | |
| def __init__(self): |
| class Node: | |
| def __init__(self, value=None): | |
| self.value = value | |
| self.next = None | |
| def __repr__(self): | |
| return "Node(value=%s,next=%s)" % (self.value, self.next) |
| ''' | |
| Numerical methods for ordinary differential equations are | |
| methods used to find numerical approximations to the solutions | |
| of ordinary differential equations (ODEs). Their use is also | |
| known as "numerical integration", although this term is sometimes | |
| taken to mean the computation of integrals. | |
| The Runge–Kutta methods are a family of implicit and explicit | |
| iterative methods used in temporal discretization for the approximate | |
| solutions of ordinary differential equations. |
| package search | |
| func BinarySearch(arr []int, target int) int { | |
| start := 0 | |
| end := len(arr) - 1 | |
| for start <= end { | |
| midPos := (start + end) / 2 | |
| if target < arr[midPos] { | |
| end = midPos - 1 | |
| } else if target > arr[midPos] { |
| package sort | |
| import ( | |
| "errors" | |
| ) | |
| func TopologicalSort(g *Graph) ([]int, error) { | |
| inDegree := make([]int, g.numOfVertices) | |
| for _, l := range g.graph { |
| def recursive_fib(n): | |
| if n <= 1: | |
| return n | |
| return recursive_fib(n - 2) + recursive_fib(n - 1) | |
| def memoized_fib(n): | |
| f = [0] * (n + 1) | |
| f[0] = 0 | |
| f[1] = 1 |