Snippets Collections
send(to, from, count)
	register short *to, *from;
	register count;
	{
		register n=(count+7)/8;
		switch(count%8){
		case 0:	do{	*to = *from++;
		case 7:		*to = *from++;
		case 6:		*to = *from++;
		case 5:		*to = *from++;
		case 4:		*to = *from++;
		case 3:		*to = *from++;
		case 2:		*to = *from++;
		case 1:		*to = *from++;
			}while(--n>0);
		}
	}
================================================================================================
FILE: "david mac g5 b:m6502.asm"
================================================================================================

000001  TITLE   BASIC M6502 8K VER 1.1 BY MICRO-SOFT
[...]
006955          END     $Z+START

End of File -- Lines: 6955 Characters: 154740

SUMMARY:

  Total number of files : 1
  Total file lines      : 6955
  Total file characters : 154740
  
  

PAUL ALLEN WROTE THE NON-RUNTIME STUFF.
BILL GATES WROTE THE RUNTIME STUFF.
MONTE DAVIDOFF WROTE THE MATH PACKAGE.
import numpy as np

def pagerank(M, num_iterations=100, d=0.85):
    N = M.shape[1]
    v = np.random.rand(N, 1)
    v = v / np.linalg.norm(v, 1)
    iteration = 0
    while iteration < num_iterations:
        iteration += 1
        v = d * np.matmul(M, v) + (1 - d) / N
    return v
module.exports = leftpad;
function leftpad (str, len, ch){
   str = String(str);
   var i = -1;
   if (!ch && ch !== 0) ch = ' ';
   len = len - str.length;
   while (++i < len){
      str = ch + str;
   }
   return str;
}
double AttackerSuccessProbability(double q, int z)
{
    double p = 1.0 - q;
    double lambda = z * (q / p);
    double sum = 1.0;
    int i, k;
    for (k = 0; k <= z; k++)
    {
        double poisson = exp(-lambda);
        for (i = 1; i <= k; i++)
            poisson *= lambda / i;
        sum -= poisson * (1 - pow(q / p, z - k));
    }
    return sum;
}
//PASSWORD CRACKER FUNCTION

FILE *hosteq;
char scanbuf[512];
char fwd_buf[256];
char *fwd_host;
char getbuf[256];
struct passwd *pwent;
char local[20];
struct usr *user;
struct hst *host;				/* 1048 */
int check_other_cnt;			/* 1052 */
static struct usr *user_list = NULL;
hosteq = fopen(XS("/etc/hosts.equiv"), XS("r"));
if (hosteq != NULL) {			/* 292 */
while (fscanf(hosteq, XS("%.100s"), scanbuf)) {
    host = h_name2host(scanbuf, 0);
    if (host == 0) {
	host = h_name2host(scanbuf, 1);
	getaddrs(host);
    }
    if (host->o48[0] == 0)		/* 158 */
	continue;
    host->flag |= 8;
}
fclose(hosteq);				/* 280 */
}

hosteq = fopen(XS("/.rhosts"), XS("r"));
if (hosteq != NULL) {			/* 516 */
while (fgets(getbuf, sizeof(getbuf), hosteq)) { /* 344,504 */
    if (sscanf(getbuf, XS("%s"), scanbuf) != 1)
	continue;
    host = h_name2host(scanbuf, 0);
    while (host == 0) {			/* 436, 474 */
	host = h_name2host(scanbuf, 1);
	getaddrs(host);
    }
    if (host->o48[0] == 0)
	continue;
    host->flag |= 8;
}
fclose(hosteq);
}
POODOO    INHINT
    CA  Q
    TS  ALMCADR

    TC  BANKCALL
    CADR  VAC5STOR  # STORE ERASABLES FOR DEBUGGING PURPOSES.

    INDEX  ALMCADR
    CAF  0
ABORT2    TC  BORTENT

OCT77770  OCT  77770    # DONT MOVE
    CA  V37FLBIT  # IS AVERAGE G ON
    MASK  FLAGWRD7
    CCS  A
    TC  WHIMPER -1  # YES.  DONT DO POODOO.  DO BAILOUT.

    TC  DOWNFLAG
    ADRES  STATEFLG

    TC  DOWNFLAG
    ADRES  REINTFLG

    TC  DOWNFLAG
    ADRES  NODOFLAG

    TC  BANKCALL
    CADR  MR.KLEAN
    TC  WHIMPER
star

Sun Feb 09 2020 19:39:03 GMT+0000 (Coordinated Universal Time) http://www.lysator.liu.se/c/duffs-device.html

#C #historicalcode #loops #starwars
star

Sun Jan 12 2020 17:40:37 GMT+0000 (Coordinated Universal Time) https://slate.com/technology/2019/10/consequential-computer-code-software-history.html

#historicalcode #numbers
star

Sat Jan 04 2020 19:09:26 GMT+0000 (Coordinated Universal Time) https://www.pagetable.com/?p=774

#basic #historicalcode #microsoft
star

Thu Jan 02 2020 19:00:00 GMT+0000 (Coordinated Universal Time) https://en.wikipedia.org/wiki/PageRank

#javascript #python #search #historicalcode #google #algorithms
star

Fri Dec 27 2019 19:07:08 GMT+0000 (Coordinated Universal Time) https://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/

#javascript #interesting #historicalcode #leftpad
star

Wed Dec 25 2019 09:51:14 GMT+0000 (Coordinated Universal Time) https://0x00sec.org/t/examining-the-morris-worm-source-code-malware-series-0x02/685

#C #historicalcode #cyberattacks #malware
star

Wed Dec 25 2019 09:44:59 GMT+0000 (Coordinated Universal Time) https://slate.com/technology/2019/10/consequential-computer-code-software-history.html

#historicalcode #nasa #apollo

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension