Skip to content

Instantly share code, notes, and snippets.

class Car {
constructor(outerDi, innerDi, screenHt, screenWd, carDi, obsts) {
this.x =
0.5 * (screenWd - (innerDi + outerDi) / 2) + round(random() * 80) - 40; // Slight variation in starting x
this.y = screenHt / 2 - 5; // Right above the starting line
this.angle = -PI / 2; // Facing upward
//Dimensions for later usage
this.carDi = carDi;
<head>
<!-- Load in Tensorflow, P5, and our Car Class-->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.0.0/dist/tf.min.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.1.9/p5.min.js"
integrity="sha512-WIklPM6qPCIp6d3fSSr90j+1unQHUOoWDS4sdTiR8gxUTnyZ8S2Mr8e10sKKJ/bhJgpAa/qG068RDkg6fIlNFA=="
crossorigin="anonymous"
></script>
<script src="car.js"></script>
<div id="rasa-chat-widget" data-websocket-url="https://your-rasa-url-here/"></div>
<script src="https://unpkg.com/@rasahq/rasa-chat" type="application/javascript"></script>
import { aui } from './helper/jest.setup';
describe('jest with askui', () => {
it('should click on text', async () => {
await aui
.click()
.text()
.exec();
});
});
import speech_recognition as sr
import pyttsx3
import random
from datetime import datetime
import os
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
import random
p = 520
g = 4
class Person:
def __init__(self, name):
self.name = name
self.priv_key = random.randint(500, 4000)
import './App.css';
import {useEffect, useState} from 'react'
function App() {
const [orig, setOrig] = useState("")
const [redact, setRedact] = useState("")
const [guess, setGuess] = useState("")
const [guessCt, setGCt] = useState(0)
const [qa, setQA] = useState({q: "What is foo(3, 4)?", a: "5"})
const [aGuess, setAG] = useState("")
const blurCode = (str) => {
function foo(x, y) {
let xSquared = x * x
let ySquared = y * y
return Math.sqrt( xSquared + ySquared )
}
async function loadSnippyly() {
await Snippyly.init("<Your API Key Goes Here>");
const presenceElement = Snippyly.getPresenceElement();
presenceElement.getOnlineUsersOnCurrentDocument().subscribe((data) => {
console.log('getOnlineUsersOnCurrentDocument in html', data);
});
// To enable text comment feature
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.box-container {
display: flex;
flex-wrap: wrap;
}
.box {