Skip to content

Instantly share code, notes, and snippets.

@thezaza101
thezaza101 / DoubleMetaphone.kt
Created June 26, 2019 02:43
Double Metaphone algorithm in kotlin
/*
This is Kotlin port of Anthony Tong Lee's 2008 implementation of the double metaphone algorithm
See http://www.ddj.com/cpp/184401251?pgno=1 for a discussion and original C++ implementation.
Copyright (c) 2008 Anthony Tong Lee
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

name : "Definitions Catalogue" description : "The Definitions Catalogue REST API allows you to search and browse for data definitions used by the Australian Government" logo : "https://api.gov.au/img/catalogue_brand.png" tags:

  • "Security:Open"
  • "Technology:Rest/JSON"
  • "OpenAPISpec:Swagger"
  • "AgencyAcr:ATO"
  • "Status:Published"
import sys
import math
import numpy as np
from numba import jit
from PIL import Image
from itertools import repeat
from multiprocessing import Pool
@jit
import imageio as imio # Reading images
import numpy as np # Matrix operations
import pandas as pd # Matrix operations
import matplotlib.pyplot as plt # for visualisation
from sklearn.cluster import KMeans # Kmeans
import math # For math
import cv2 # Webcam feed
# Get a pointer to the devides
camera = cv2.VideoCapture(0)
import time
import numpy as np
from picamera import PiCamera
camera = PiCamera()
camera.resolution = (320, 240)
camera.framerate = 5
time.sleep(2)
def getFrame():
@thezaza101
thezaza101 / ShowData.cs
Created October 25, 2020 23:27
Medium_ML.NET ShowData.cs
public void ShowData(IDataView data, int colWidth = 15, int numRows = 10)
{
var previewObject = data.Preview(numRows);
int NumberOfColumns = previewObject.ColumnView.Length;
string output ="";
int rowWidth = (NumberOfColumns*(colWidth-1));
for (int i = 0; i < NumberOfColumns; i++)
{
output += ColValue(previewObject.ColumnView[i].Column.Name.ToString()) + '|';
}