User
np.hamming as a floatarray in Kotlin.
ChatGPT
You can implement the Hamming window function in Kotlin as a FloatArray like this:
fun hammingWindow(length: Int): FloatArray {
val window = FloatArray(length)
val alpha = 0.54f
User
np.hamming as a floatarray in Kotlin.
ChatGPT
You can implement the Hamming window function in Kotlin as a FloatArray like this:
fun hammingWindow(length: Int): FloatArray {
val window = FloatArray(length)
val alpha = 0.54f
import multiprocessing | |
import os | |
import time | |
from confluent_kafka import Consumer, TopicPartition | |
import ccloud_lib | |
def get_partition_lag(partition: int): |
import os | |
from datetime import datetime as dt | |
from pathlib import Path | |
yy = str(dt.now().year) | |
mm = str(dt.now().month) | |
dd = str(dt.now().day) | |
a = yy+mm+dd | |
work_dir_root = Path('<set your working directory/TIL local folder here>') |
def caesarCipher(s, k): | |
""" | |
s -- input string | |
k -- rotate by k | |
""" | |
rotate = k | |
original_language = {} | |
rotated = {} | |
leng = len(string.ascii_lowercase)-1 | |
if rotate>leng: |
import numpy as np | |
from tensorflow.keras.preprocessing import image | |
from tensorflow.keras.utils import get_file | |
img_url = 'paste-url-here' | |
random_string_for_file_name = 'test_image' | |
img = image.load_img(get_file(random_string_for_file_name,img_url),target_size=(150,150)) | |
img_arr = image.img_to_array(img) | |
img_arr = np.expand_dims(img_arr, axis=0) |
plugins: | |
- kind: KfAwsPlugin | |
metadata: | |
name: aws | |
spec: | |
auth: | |
oidc: | |
certArn: arn:aws:acm:us-west-2:########:certificate/#######-#####-###-# | |
oAuthClientId: Your Auth0 App Client Id | |
oAuthClientSecret: Your Auth0 App Client Secret |
#!/bin/bash | |
while [[ $(kubectl get pods $pod_name -o json | jq -r .status.containerStatuses[0].state.terminated.reason) != "Completed" ]]; do | |
echo "waiting for pod to finish docker build and push" && sleep 5 | |
done |
$ kubectl get svc --all-namespaces | grep LoadBalancer | |
ingress-nginx random-services-nginx-ingress-controller LoadBalancer 125.65.52.145 a2smioi173y7912bs6a-195942069.us-east-2.elb.amazonaws.com 80:30223/TCP,443:31030/TCP 19d |
kubectl apply -f my-release-name/ |
kubectl apply -f my-release-name/ |