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 { Button, VerticalBox, SpinBox, HorizontalBox, LineEdit} from "std-widgets.slint"; | |
component CharacterStat inherits Rectangle { | |
in property<string> statname: "???"; | |
in property<int> value: 12; | |
HorizontalLayout { | |
alignment: stretch; | |
Text { text: "\{statname}"; } | |
LineEdit { | |
text: "\{value}"; |
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
size_t EmitterNode::_numPartsForRate(float rate, float dt) {// number of parts to emit | |
size_t numParts = 0; | |
float numPartsReal = rate * dt; | |
// Treat fractional particles as a probability -- e.g. .3 particles | |
// means 30% chance to emit | |
float numPartsF = floor(numPartsReal); | |
float partProb = numPartsReal - numPartsF; | |
numParts = (size_t)numPartsF; |
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
Thu Nov 19 07:31:12 UTC 2020 |
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
// c++ -std=c++11 thread.cpp -o thread && ./thread | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <thread> | |
class TraceTile | |
{ | |
public: | |
int tileNum = 0; |
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
#!/usr/bin/env python | |
# CGInclude Watcher | |
# Joel Davis ([email protected], @joeld42 on Twitter) | |
# | |
# Usage: Run this from a directory where you have shaders. | |
# | |
# Use at your own risk (and use an editor that properly handles | |
# open files being modified by another program). | |
# |
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
bool g_isMouseDown; | |
float g_mouseButtonPrevPressTime; | |
float g_mouseButtonLastPressTime; | |
Vector2 g_mouseDownPos; | |
Vector2 g_mousePos; | |
bool g_isDragging = false; | |
// Frame mouse events | |
bool _isDragStarted = false; |
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
# Slow, bad K-Means image quantization. | |
# This code is in the public domain. | |
import os, sys | |
import random | |
from PIL import Image, ImageDraw | |
# Doesn't seem to get much better after this, YMMV... |
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
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/Headers/FSEvents.h | |
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
#ifndef NDEBUG | |
AllocConsole(); | |
SetConsoleTitle( L"console window title" ); | |
freopen("CONOUT$", "w", stdout ); | |
#endif |
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
using UnityEngine; | |
using System; | |
using System.Collections; | |
// This moves a node to follow "stepGoal" in a foot step like manner. stepGoal is | |
// typically an empty parented to your model that sits on the ground and is offset (left | |
// or right) from the center of mass. | |
// This just moves the foot, a separate IK controller is needed to follow wiht the legs |
NewerOlder