Skip to content

Instantly share code, notes, and snippets.

import matplotlib.pyplot as plt
import numpy as np
def rastrigin(x, y, A=10):
"""
Rastrigin function definition.
"""
return A * 2 + (x**2 - A * np.cos(2 * np.pi * x)) + (y**2 - A * np.cos(2 * np.pi * y))
def generate_randomized_rastrigin_landscape(x_range, y_range, num_points,
@VatsaDev
VatsaDev / plagcheck.js
Created October 18, 2024 04:01
plag check JS version
import { pipeline } from '@xenova/transformers';
const clipThresh = 0.7; // Threshold for overall similarity
const ssrchThresh = 0.8; // Threshold for sentence-level similarity
// Initialize the feature extraction pipeline
let extractor;
async function initializeExtractor() {
extractor = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');
@VatsaDev
VatsaDev / plagcheck.py
Created October 18, 2024 03:09
Simplistic plagarism checker, use ai model for similarity score, then checks for exact strings
from sentence_transformers import SentenceTransformer
import re
# Initialize the sentence transformer model
smod = SentenceTransformer("all-MiniLM-L6-v2")
clip_thresh = 0.7 # Threshold for overall similarity
ssrch_thresh = 0.8 # Threshold for sentence-level similarity
def clip_sim(text1, text2):
(*
Ocaml text dungeon game
easy way to make something fun and learn the ropes of the language
srsly though whoever made this language was really just quirky
*)
let room_sizes_arr = [|
"a couple planck lengths wide"; "miniscule"; "kinda tiny"; "miniature"; "normal"; "large"; "unexpectedly large";
"unnatural"; "gigantic"; "immense"; "titanic"; "massive"; "measurable in AU"; "spanning the cosmos";
|];;
//UI
var tabs = this.rexUI.add
.tabs({
x: 400,
y: 1600,
panel: this.rexUI.add.gridTable({
background: this.rexUI.add.roundRectangle(
0,
0,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Markdown to html</title>
<script src="https://cdn.jsdelivr.net/remarkable/1.7.1/remarkable.min.js"></script>
</head>
<body>
<p>Enter markdown for conversion</p>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Html Only</title>
</head>
<body>
<center><h1>Making A website with HTML 5 & 4</h1></center>
<center>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Spinny pencil</title>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>stripnav</title>
<link rel="stylesheet" href="styles.css" />
<style>
.dropbtn {
background-color: #4caf50;