Skip to content

Instantly share code, notes, and snippets.

View beyondlimits's full-sized avatar

beyondlimits

View GitHub Profile
import bpy
empty = bpy.data.objects['Empty']
probe = empty.constraints['Probe']
output = bpy.data.texts['Output']
output.clear()
for i in range(0, 101):
t = i / 100
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
static unsigned short lookup_table[512];
unsigned short mul(unsigned char a, unsigned char b)
{
unsigned short x = a + b, y = (a > b) ? (a - b) : (b - a);
return lookup_table[x] - lookup_table[y];
1
2
3
4
5
6
7
8
9
10
for a in {0..64}
do
for b in {0..40}
do
for c in {0..28}
do
for d in {0..25}
do
dc -e "[p]sp 2 $a ^ 3 $b ^ * 5 $c ^ * 7 $d ^ * d 2 64 ^ >p"
done
This file has been truncated, but you can view the full file.
1
2
3
4
5
6
7
8
9
10
#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()
#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>
#include <string.h>
#define LOW_PRIME_COUNT 6542
int main()
{
puts("2\n3");
@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
package midpcalc;
/**
* <b>Java integer implementation of 63-bit precision floating point.</b>
* <br><i>Version 1.13</i>