Skip to content

Instantly share code, notes, and snippets.

@Recoskie
Recoskie / Relocate_User_Folders.sh
Last active December 31, 2023 12:49
A simple fast easy to use shell script to relocate the user folders to a flash drive or a interal system drive. Works on any linux os.
echo "This script requires administrative privilege to run!"
sudo echo
if ! echo "$password1" | sudo -Sv -p ''; then
exit 1
fi
#
step=0;l=1;DiskN=null;Disk=null;UUID=null;Format=null
#
function Drive-Select
{
@Recoskie
Recoskie / Bitwise Log2.js
Last active August 3, 2023 17:42
Super Fast Bitwise Log2, for faster bit lookup algorithams.
//Note method 6 is an single line using only logical and, and or it is the fastest method.
//This document is the steps to creating the singular translation.
//Super Fast log 2 calculation over 32 bit integer in right shift each right shift is an division of 2 in binary.
function Log2_Int32_V1(V)
{
for( var n = 31; n > 0; V >>> n ? ( V = n, n = 0 ) : n-- );
return(V);
}
@Recoskie
Recoskie / (0)Readme.md
Last active May 23, 2023 14:54
Modern artificial intelligence, data algorithms, and the limits of computation.

Modern artificial intelligence systems and data algorithms that are great for modern applications but are still not fully applied to software and our daily lives.

The smallest list of instructions we can program with is "AND", "OR", "NOT", and "Shift".

We can also exclude "shift" If we want to only reposition the digits using logical operations.

I built this small code a long time ago to demonstrate it as simply as possible for fun.

The basic logic operations are enough to build all operations and even comparisons.

@Recoskie
Recoskie / Huffman.js
Last active August 23, 2021 07:07
Huffman table expansion
//Huffman table expansion.
var bits = [ 0, 2, 3, 1, 1, 1, 1 ];
var codes = [ 3, 4, 1, 2, 5, 0, 6, 7, 8 ];
//The html table output.
var html = "<table border=\\\"1\\\">";
html += "<tr><td>Bits</td><td>Code</td><td>Length</td></tr>";
@Recoskie
Recoskie / Format.java
Last active January 18, 2022 07:48
Template for JDisassembly plugins.
package Format;
import swingIO.*;
import swingIO.tree.*;
import javax.swing.tree.*;
public class Format extends Window.Window implements JDEventListener
{
private JDNode root;
private Descriptor header; //note this can be made into an array for more complex formats.
@Recoskie
Recoskie / ir-solve.js
Last active June 22, 2022 18:21
Solve irrational numbers.
//Matrix used to solve sets of numbers in x^n.
//This matrix can be enlarged to higher dimensional numbers past root of 5.
var SMat = [
[01,0,0,0,0,0],
[05,1,0,0,0,0],
[10,4,1,0,0,0],
[10,6,3,1,0,0],
[05,4,3,2,1,0],
[01,1,1,1,1,1]
@Recoskie
Recoskie / CF.js
Last active June 30, 2022 09:44
Geometric Number data type.
function cf( a, b )
{
this.a = []; this.b = []; this.length = 0;
//Data type methods.
this.valueOf = function()
{
for( var i = this.length - 1, v = 0; i >= 0; i-- )
{
@Recoskie
Recoskie / WPA.md
Last active April 21, 2023 07:38
The limits of web applications.

Graphics performance. Graphics before HTML5 canvas existed.

At one point in time, writing web applications ware stupid as to do any graphics at all involved using div elements one pixel in size with an absolute x, y position and color.

The other method I developed was a graphics engine that let you set the width and height of a bit map. Each pixel color was stored and referenced to the bytes in the bitmap for each pixel color. I implemented basic text and 2D graphics drawing functions as I built basically a bitmap codec that wrote directly to the web page from javascript memory.

Both methods gave poor performance but allowed me to do some 3D graphics using sine and cosine rotation transformations and line drawing functions. The bitmap method was faster, but the performance was still poor and would only give me the ability to render basic 3D shapes.

@Recoskie
Recoskie / Compilers.md
Last active June 1, 2024 00:03
Building your own programming language, or compilers.

Introduction

This introductory text lets you fully understand what assembly is and the design process that went into designing modern compilers and programming languages, including a basic understanding of application container formats on different operating systems, such as relocations, loading, and linking.

Central processing unit (CPU)

The most important part of any system is the central processing unit, which actually runs your program's instructions.

A central processing unit is defined by core type for which kind of instructions it understands.

@Recoskie
Recoskie / GenCF.md
Last active August 16, 2023 12:46
Find the pattern to calculate a random number and classify it.

This fast algorithm can rationalize numbers as (a+√b)÷m. I'm putting this online mainly because I can't find it anywhere except for a lot of junk. I will show how to construct it so you can solve the computational number patterns to things like PI, base e, and even angles of sine and cosine.

Analizing finite numbers.

First, we will begin by dividing two numbers.

56÷25=2.24

If we ask how many times 25 goes into 56, the answer is 2 since the value before the decimal point is 2 after the division.