this code does what you'd expect and useful for avoiding unnecessary arrays (although a standard for-loop is usually fine...)
export class IterableInt {
point = 0;
start: number = 0;
end: number = 0;this code does what you'd expect and useful for avoiding unnecessary arrays (although a standard for-loop is usually fine...)
export class IterableInt {
point = 0;
start: number = 0;
end: number = 0;alex % test-sorted-numbers.js
0.003323905232836868516479445007663787423935061838055536238211856706
0.000003216665525946364975501189134992011094173428027265407092765945105
5.534929650272012720523268501945480556023094872405241335283017818e-8
9.145908272177229543705210160445544872490908442048180454092217671e-10
1.075675955494191912803286754291997208373252535492843752459149305e-11
This is an algorithm (function) that accepts two numeric JS/TS arrays and returns a boolean value representing whether the two arrays are linearly independent. This would be for a linear library or linear optimization - in my case - checking constraints for redundancy or contradictions.
Assumptions:
1. Same size arrays
2. If size is less than 2, undefined results
3. None of the arrays are the zero-vector [0,0,0,0,0,...,0]
4. For any given pair, if the numerator or denominator is zero and the other non-zero,
/*
Assignment #1. Matrix Generation and Solving Simultaneous Equations; Due Tuesday, September 13
Part 1. Write a random matrix generator for an n m matrix A = (aij) that has a prespecified density.
Input should include n, m, a general lower bound (L) for each element, an upper bound (U) for each
element (that is, L aij U), and density factor where 0 < 1. Note that if = 0.4, this means that
there is a 0.4 probability that any element aij will not be zero or that on average, 4 out of 10 elements will| // begin | |
| const findAllSquares = (n: number) :Array<[number,number]> => { | |
| let squares : Array<[number,number]> = [[0,0], [1,1]]; | |
| let diff = 1; | |
| for(let i = 2; i <= n; i++){ | |
| const prev = squares[squares.length-1][1]; |
| function first(){ | |
| second(); | |
| } | |
| first(); | |
| function second(){ |
| const list = ['a', 'b', 'c', 'c', 'd', 'a', 'b', 'a', 'a', 'd', 'b']; | |
| const findMin = (char1: string, char2: string, arr: Array<string>) : Number => { | |
| let char1Index = -1; | |
| let char2Index = -1; | |
| let min = Number.MAX_SAFE_INTEGER; | |
| for (let i = 0; i < arr.length; i++) { |
Loop to create partitions does not work b/c a "CREATE TABLE" statement cannot be a prepared statement (laaaame).
do $$
declare
counter integer := 0;
begin
while counter <= 500 loop
PREPARE create_table(int) AS
CREATE TABLE mbk_auth_method_$1 PARTITION OF mbk_auth_method FOR VALUES WITH (modulus 500, remainder $1);how do I create partition based on modulus of an id? something like this:
create table my_table(id bigint)
partition by value (modulus(id,1000));
create table my_table_0
partition of my_table
for values in (0);| client | |
| nobind | |
| dev tun | |
| remote-cert-tls server | |
| remote 35.209.20.300 1194 udp | |
| <key> | |
| -----BEGIN PRIVATE KEY----- |