Skip to content

Instantly share code, notes, and snippets.

View beyondlimits's full-sized avatar

beyondlimits

View GitHub Profile
'use strict';
Object.defineProperty(this, 'TheWild', {value: function(){
var TheWild = {
x: [150, 50, 250, 250, 200, 350, 350, 200],
y: [300, 250, 250, 200, 150, 50, 300, 350],
w: [ 1, 1, 1, 1, 1, 1, 1, 1],
originalKnots: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
knots: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
//knots: [0, 0.9, 1.3, 1.9, 2.5, 6.1, 8.1, 8.9, 10],
@beyondlimits
beyondlimits / meshupdate.py
Last active January 24, 2021 21:57
An approach for Blender 2.91 to track geometry changes of an object and update geometry of another object in edit mode. This could be used as a crude way to implement custom modifiers.
import bmesh
from bpy import app, data, types
from traceback import format_exc
handlers = app.handlers.depsgraph_update_post
handlers.clear()
# data.texts{'Output'] - stdout
# data.meshes['Source'] - source mesh (cage)
#!/bin/bash
set -e
shopt -s nullglob extglob
cd "`git rev-parse --git-path objects`"
# packed objects
for p in pack/pack-*([0-9a-f]).idx ; do
git show-index < $p | cut -f 2 -d ' '
done
package midpcalc;
/**
* <b>Java integer implementation of 63-bit precision floating point.</b>
* <br><i>Version 1.13</i>
@beyondlimits
beyondlimits / binomial.py
Created August 8, 2019 12:30
The binomial coefficients can be arranged in rows to form Pascal’s Triangle (where row n is (n 0),(n 1),...(n n). In which row of Pascal’s Triangle do three consecutive entries occur that are in the ratio 3:4:5?
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
from __future__ import print_function
def binomial(n, k):
if n < 0 or k < 0 or k > n:
return 0
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LOW_PRIME_COUNT 6542
int main()
{
puts("2\n3");
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#define LOG_2 0x02000000
#define LOG_3 0x032B8034
#define LOG_5 0x04A4D3C2
#define LOG_7 0x059D5D9F
#define LOG_LIMIT 0x80000000
#define COUNT 85348
#include <stdio.h>
#include <stdlib.h>
#define LOG_2 0x02000000
#define LOG_3 0x032B8034
#define LOG_5 0x04A4D3C2
#define LOG_7 0x059D5D9F
#define LOG_LIMIT 0x80000000
int main()
This file has been truncated, but you can view the full file.
1
2
3
4
5
6
7
8
9
10