Skip to content

Instantly share code, notes, and snippets.

View stoensin's full-sized avatar
🎯
Focusing

Joe Stone stoensin

🎯
Focusing
  • shenzhen university
  • shenzhen
View GitHub Profile
@stoensin
stoensin / cosine_similarity.js
Created December 26, 2023 05:15 — forked from tomericco/cosine_similarity.js
Cosine similarity implementation in JS
const str1 = 'This is an example to test cosine similarity between two strings';
const str2 = 'This example is testing cosine similatiry for given two strings';
//
// Preprocess strings and combine words to a unique collection
//
const str1Words = str1.trim().split(' ').map(omitPunctuations).map(toLowercase);
const str2Words = str2.trim().split(' ').map(omitPunctuations).map(toLowercase);
const allWordsUnique = Array.from(new Set(str1Words.concat(str2Words)));
@stoensin
stoensin / sha256-hmac.md
Created December 14, 2022 10:25 — forked from jasny/sha256-hmac.md
Hashing examples in different languages

Example inputs:

Variable Value
key the shared secret key here
message the message to hash here

Reference outputs for example inputs above:

| Type | Hash |

# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer
@stoensin
stoensin / mnist_gan_keras.ipynb
Created April 8, 2019 23:28 — forked from ceceshao1/mnist_gan_keras.ipynb
Generative Adversarial Networks using Keras and MNIST
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.