This file contains 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
from scipy.spatial.distance import euclidean | |
from fastdtw import fastdtw | |
import numpy as np | |
def calculate_similarity_percentage(distance, max_distance): | |
similarity_percentage = (1 - distance / max_distance) * 100 | |
return similarity_percentage | |
def main(): | |
test_sets = [ |
This file contains 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
// logger.ts | |
export function logError(message: string, ...optionalParams: any[]): void { | |
try { | |
// Get the caller function | |
const caller = logError.caller?.name || 'anonymous'; | |
// Extract filename from the stack trace | |
const stack = new Error().stack || ''; | |
const fileMatch = stack.split('\n')[2]?.match(/(?:http:\/\/|https:\/\/|file:\/\/\/).*?\/(.*?)(?:\?|:)/) || []; |
This file contains 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
/** | |
* | |
* Usage | |
* | |
* node getRemote.js [target url] | |
* | |
*/ | |
// import { readSync } from "to-vfile"; |
This file contains 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
// e.g. | |
// node index.js https://googe.com | |
import { readSync } from "to-vfile"; | |
import { toString } from "nlcst-to-string"; | |
import { retext } from "retext"; | |
import retextPos from "retext-pos"; | |
import retextKeywords from "retext-keywords"; | |
import fetch from "node-fetch"; |
This file contains 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 UIKit | |
import FirebaseAuth | |
import Kingfisher | |
class NextVC: UIViewController { | |
@IBOutlet var profileImageView: UIImageView! | |
@IBOutlet var nameLabel: UILabel! | |
This file contains 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
<html> | |
<head> | |
<link | |
href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" | |
rel="stylesheet" | |
/> | |
</head> | |
<body> | |
<div class=""> | |
<img |
This file contains 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
var weatherApiKey = "YOUR API KEY" | |
var destinationUrl = (cityName) => { | |
return `http://api.openweathermap.org/data/2.5/weather?q=${cityName}&appid=${weatherApiKey}` | |
} | |
fetch(destinationUrl(city)) | |
.then((response) => response.json()) | |
.then((data) => { | |
console.log(data) |
This file contains 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
<html> | |
<head> | |
<link | |
href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" | |
rel="stylesheet" | |
/> | |
</head> | |
<body> | |
<div class=""> | |
<img |
This file contains 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
guard let clientID = FirebaseApp.app()?.options.clientID else { return } | |
// Create Google Sign In configuration object. | |
let config = GIDConfiguration(clientID: clientID) | |
// Start the sign in flow! | |
GIDSignIn.sharedInstance.signIn(with: config, presenting: self) { [unowned self] user, error in | |
if let error = error { | |
print(error) |
This file contains 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 Foundation | |
import Glibc | |
import extratypes // this library contains declarations of types from the task | |
public func solution(_ T : Tree?) -> Int { | |
var max = 0 | |
guard let T = T else { return 0 } | |
T.l?.calculate(&max, 1) | |
T.r?.calculate(&max, 1) |
NewerOlder