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 main | |
import ( | |
"fmt" | |
"time" | |
) | |
func worker(done chan int) { | |
time.Sleep(time.Second) | |
done <- 2000 |
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
#include <stdio.h> | |
int main() | |
{ | |
int arr[5] = {1, 2, 3, 4, 5}; | |
arr; // int[5]; array | |
&arr; // int (*)[5]; pointer to an array (note that (int *)[5] would be an array of pointers) | |
&arr[0]; // int *; pointer to an int | |
*arr; // int; arr decays it to its initial pointer (&arr[0]) then dereferencing gives arr[0] |
Note
Highlights information that users should take into account, even when skimming.
Important
Crucial information necessary for users to succeed.
Warning
Critical content demanding immediate user attention due to potential risks.
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 { SlashCommandBuilder } from "discord.js"; | |
import { gameInfo } from "./startgame.js"; | |
export const data = new SlashCommandBuilder() | |
.setName("guess") | |
.setDescription("Guess a number between 1 and 100") | |
.addIntegerOption((option) => | |
option.setName("number").setDescription("Your guess").setRequired(true) | |
); |
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
// Coding Train Video Linker: converts youtube links into Coding train website relative paths, on thecodingtrain.com | |
// (add file to node-scripts/) | |
import fs, { copyFileSync } from 'fs'; | |
import path from 'path'; | |
import { globSync } from 'glob'; | |
import clipboard from 'clipboardy'; | |
const videos = []; |
This guide will walk you through the process of setting up autocompletion and documentation for p5.js, right inside of VSCode.
In this section, we will guide you through the process of setting up autocompletion and documentation for p5.js in VSCode when using p5.js in Global Mode without a bundler.
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
// Why do we need to create copies of state in react? | |
// =================================================================== | |
// Mock state and setState functions | |
let items = [{ name: "item 1", id: "1" }, { name: "item 2", id: "2" }]; | |
const setItems = (newVal) => { | |
// React first checks if the new state passed in has changed or not, from the current state. | |
if (newVal === items) { // only checks for reference, not value! |
- Challenges: (Goal: 10 challenges)
- Wave Function Collapse Overlapping model
- Pi Day (??)
- 'Signed Distance Functions'
- Secord's Algorithm (Dithering/Voronoi Stippling); info
- Falling Sand
- Ikeda Map (short?)
- PID Controller
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
p5.prototype._initVals = function () { | |
this.int_zoom = 1; | |
this.int_offset = this.createVector(0, 0); | |
this.mouseWheel = mouseWheel1.bind(this) | |
this.mouseDragged = mouseDragged1.bind(this) | |
}; | |
p5.prototype.registerMethod('init', p5.prototype._initVals) |
NewerOlder