The original C file is cblas_example1.c
$cinterop -def liblapack.def -o build/c_interop/liblapack
$kotlinc-native lapack.kt -library build/c_interop/liblapack
$./program.kexe
11.0
14.0
# Required packages: | |
# pip install SpeechRecognition mlx-whisper pyaudio | |
# Note: This script requires Apple Silicon Mac for MLX Whisper | |
import speech_recognition as sr | |
import numpy as np | |
import mlx_whisper | |
r = sr.Recognizer() | |
mic = sr.Microphone(sample_rate=16000) |
""" To use: install LLM studio (or Ollama), clone OpenVoice, run this script in the OpenVoice directory | |
git clone https://github.com/myshell-ai/OpenVoice | |
cd OpenVoice | |
git clone https://huggingface.co/myshell-ai/OpenVoice | |
cp -r OpenVoice/* . | |
pip install whisper pynput pyaudio | |
""" | |
from openai import OpenAI | |
import time |
# Clone llama.cpp | |
git clone https://github.com/ggerganov/llama.cpp.git | |
cd llama.cpp | |
# Build it | |
make clean | |
LLAMA_METAL=1 make | |
# Download model | |
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin |
gg_replace() { | |
if [[ "$#" -lt "2" ]]; then | |
echo " | |
Usage: | |
$0 term replacement file_mask | |
Example: | |
$0 cappuchino cappuccino '*.html' | |
"; | |
else |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"sync" | |
"time" | |
) |
The original C file is cblas_example1.c
$cinterop -def liblapack.def -o build/c_interop/liblapack
$kotlinc-native lapack.kt -library build/c_interop/liblapack
$./program.kexe
11.0
14.0
-- adapted from https://medium.com/@goldrydigital/hex-grid-algorithm-for-postgis-4ac45f61d093 | |
-- usage: select * FROM hexbin(numeric, geometry) | |
-- cover a table with something like: | |
-- select row_number() over () id, geom | |
-- from hexbin(5280, st_transform(st_setsrid(st_expand(ST_EstimatedExtent('table', 'geom'), 0.1), 4269), 2255)); | |
CREATE OR REPLACE FUNCTION hexbin (height numeric, minx numeric, miny numeric, maxx numeric, maxy numeric, srid integer) | |
RETURNS TABLE (geom geometry(polygon)) | |
AS $$ |
""" | |
Train a neural network to implement the discrete Fourier transform | |
""" | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from tensorflow.keras.layers import Dense | |
from tensorflow.keras.models import Sequential | |
N = 32 | |
batch = 10000 |
function struct2csv(s,fn) | |
% STRUCT2CSV(s,fn) | |
% | |
% Output a structure to a comma delimited file with column headers | |
% | |
% s : any structure composed of one or more matrices and cell arrays | |
% fn : file name | |
% | |
% Given s: | |
% |
[ | |
{ | |
"city": "New York", | |
"growth_from_2000_to_2013": "4.8%", | |
"latitude": 40.7127837, | |
"longitude": -74.0059413, | |
"population": "8405837", | |
"rank": "1", | |
"state": "New York" | |
}, |