This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function cosineSimilarity(a: number[], b: number[]) { | |
| let dotProduct = 0; | |
| let magnitudeA = 0; | |
| let magnitudeB = 0; | |
| for (let i = 0; i < a.length; i++) { | |
| dotProduct += (a[i] * b[i]); | |
| magnitudeA += (a[i] * a[i]); | |
| magnitudeB += (b[i] * b[i]); | |
| } | |
| magnitudeA = Math.sqrt(magnitudeA); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { HttpError as HE } from 'routing-controllers'; | |
| export class HttpError extends HE { | |
| constructor(httpCode: number, message?: string, readonly data?: any) { | |
| super(httpCode, message); | |
| Object.setPrototypeOf(this, HttpError.prototype); | |
| } | |
| toJSON() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| let identifiers = NSLocale.availableLocaleIdentifiers | |
| let locale = NSLocale(localeIdentifier: "en_US") | |
| let currencyFormatter = NumberFormatter() | |
| currencyFormatter.numberStyle = .currency | |
| currencyFormatter.usesGroupingSeparator = true | |
| currencyFormatter.maximumFractionDigits = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example; | |
| import java.lang.reflect.InvocationHandler; | |
| import java.lang.reflect.InvocationTargetException; | |
| import java.lang.reflect.Method; | |
| import java.lang.reflect.Proxy; | |
| import java.util.HashMap; | |
| import java.util.List; | |
| import java.util.Map; |
OlderNewer