Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

post you are run length encoding in lisp

Name: Anonymous 2014-10-05 3:18

critique mine pl0x:

(defun rle (str) ;run length encoding
(let ((i 0) c count out)
(while (< i (length str))
(if (eq c (elt str i))
(setq count (1+ count))
(when c
(setq out (append out (list (cons c count)))))
(setq c (elt str i))
(setq count 1))
(setq i (1+ i)))
(when c (setq out (append out (list (cons c count)))))
out))

Name: Anonymous 2014-10-05 7:27

Yeah. I remember implementing it to read old graphic formats. Although LZ is a lot better
https://github.com/saniv/gfx/blob/master/pcx.lisp

(defun pcx-rle-line (o s e)
(while (< (cdr s) e)
(let ((v (% s))
(c 1))
(while (and (< (cdr s) e) (= (% 0 s) v) (< c 63))
(% s)
(incf c))
(unless (and (= c 1) (/= (logand #xC0 v) #xC0))
(ser o (Count 1 (logior #xC0 c))))
(ser o (Value 1 v)))))

(defun pcx-derle-line (o s e)
(while (< (cdr o) e)
(let ((c (% s)))
(if (/= (logand c #xC0) #xC0)
(% o c)
(let ((c (logxor c #xC0))
(v (% s)))
(while (plusp c)
(% o v)
(decf c)))))))

Name: Anonymous 2014-10-05 8:59

rle :: (Eq a, Num b) => [a] -> [(b,a)]
rle [] = []
rle (x:xs) = encode' 1 x xs where
encode' n x [] = [(n,x)]
encode' n x (y:ys)
| x == y = encode' (n+1) x ys
| otherwise = (n,x) : encode' 1 y ys

Name: Anonymous 2014-10-05 14:31

>>2
i don't understand your code.

Name: Anonymous 2014-10-05 14:48

>>2
how would you improve my code? for one, it is inefficient because it continually checks the boundary case where there is no previous (character . count).

Name: Anonymous 2014-10-05 14:59

>>4
Nobody understands me. Can't even find a girlfriend.

>>5
how would you improve my code?
You can use arrays and declare types. But that would be a waste of time, unless you write production code, which would be used a lot.

Name: Anonymous 2014-10-05 15:05

>>6
how would you deal with the inefficiency of checking if there is no previous (char . count) to output? doing the test always seems slow.

Name: Anonymous 2014-10-05 15:24

>>7

Your code is horribly inefficient due to lists use and append. Double checking the condition is the least contributor.

Name: Anonymous 2014-10-05 15:26

>>8
oh yes i know that, but that is easier to fix. im more interested in the shape of the algorithm.

Name: Anonymous 2014-10-05 15:30

>>8
oh yes i know that, but that is easier to fix. im more interested in the shape of the algorithm.

Name: Anonymous 2014-10-05 15:35

>>9
you can catch bound check error or ensure that it wont happen, by keeping last two elements different

Name: Anonymous 2014-10-05 15:36

% rle.pro
rle([], []).
rle([H|T], [[X, H]|R]) :- rle(T, [[Y, H]|R]), Y > 0, X is Y + 1.
rle([H|T], [[1, H]|R]) :- rle(T, R).

rld([], []).
rld([H|T], [[X,H]|R]) :- X > 1, Y is X - 1, rld(T, [[Y,H]| R]).
rld([H|T], [[1,H]|R]) :- rld(T, R).


| ?- [rle].
compiling rle.pro for byte code...
yes

| ?- L = [a, a, a, b, c, c], rle(L, E), rld(L, E).
E = [[3,a], [1, b], [2, c]]
L = [a, a, a, b, c, c] ?
yes

Name: >>12 2014-10-05 15:38

Feature request for judeo-admin-sama: put a border around multi-line code blocks, so that you can tell the difference between two adjacent listings.

Name: Anonymous 2014-10-05 16:05

Symta version (based on Prolog one)
rle Xs =
| Ys = []
| while 1: case Xs [Z N%&Z @Zs] | [[N.size+1 Z] @!Ys]; Xs <= Zs
[Z @Zs] | [Z @!Ys]; Xs <= Zs
[] | leave Ys.flip

Name: Anonymous 2014-10-05 16:07

>>14
It does work, if you don't believe me.
http://postimg.org/image/r9uqc04ot/

Name: >>12 2014-10-05 16:09

>>12

I know pretty much no lisp, but here's the first step of translating it:

(defun reverse-rle (l e)
(cond
((eq l '()) e)
((eq (car l) (cdar e))
(rle (cdr l) (cons (cons (+ 1 (caar e)) (cdar e)) (cdr e))))
(t (rle (cdr l) (cons (cons 1 (car l)) e)))
)
)

Name: Anonymous 2014-10-05 16:10

>>15
lol still using emacs, that buggy slow ugly piece of shit?

Name: >>12 2014-10-05 16:11

>>16

Oops, I only changed the first occurrence of rle to reverse-rle.

Name: Anonymous 2014-10-05 16:23

>>17

I've no time writing my own text editor. And it would require Qt bindings.

Name: Anonymous 2014-10-05 16:34

>>15
Shalom!

Name: >>12 2014-10-05 16:49

>>16

(defun rle (l)
(cond ((eq l '()) '())
(t (let (e (rle (cdr l)))
(cond
((eq e '()) (cons (cons 1 (car l)) e))
((eq (car l) (cdar e)) (cons (cons (+ 1 (caar e)) (cdar e)) (cdr e)))
(t (cons (cons 1 (car l)) e)))))))


halp

It seems let doesn't do what I expect.

Name: Anonymous 2014-10-05 17:27

>>21
rle
(rle nil)
nil
(rle '(1))
((1 . 1))
(rle '(1 1))
((1 . 1))
(rle '(1 1 1))
((1 . 1))

nigger, what r u doin?

Name: >>12 2014-10-05 18:26

>>21

(defun rle (l)
(cond ((eq l '()) '())
- (t (let (e (rle (cdr l)))
+ (t (let ((e (rle (cdr l))))
(cond
((eq e '()) (cons (cons 1 (car l)) e))
((eq (car l) (cdar e)) (cons (cons (+ 1 (caar e)) (cdar e)) (cdr e)))
(t (cons (cons 1 (car l)) e)))))))


Fuck, I'm an idiot.

I just deepened the varlist of let, and it worked perfectly!

(rle '(a a a b c c))
((3 . a) (1 . b) (2 . c))

Name: >>12 2014-10-05 18:55

>>23

How should I format my lisp?

(defun rle (l)
(cond ((eq l nil) nil)
(t (let ((e (rle (cdr l))))
(cond
((eq e nil)
(cons (cons 1 (car l)) e))
((eq (car l) (cdar e))
(cons
(cons (+ 1 (caar e)) (cdar e))
(cdr e)))
(t
(cons (cons 1 (car l)) e)))))))

(defun rld (l)
(cond
((eq l nil) nil)
(t (cond
((> (caar l) 1)
(cons
(cdar l)
(rld (cons
(cons (- (caar l) 1)(cdar l))
(cdr l)))))
(t
(cons (cdar l) (rld (cdr l))))))))


Output:
(let ((l '(a a a b c c)))
(print (rle l))
(print (rld (rle l)))
nil
)

((3 . a) (1 . b) (2 . c))
(a a a b c c)
nil

Name: Anonymous 2014-10-05 19:14

>>24
do u guyz think my code is good enugh 4 production quality code?

Name: Anonymous 2014-10-05 19:16

have u read COMMON LISP: THE LANGUAGE by GAY L. STEELE?

Name: >>12 2014-10-05 19:31

>>25

Are you asking about mine ( >>24 ) or yours ( >> 1 )?

lisp
in production

>>1

If you really want to work iteratively, you should maintain a tail pointer so that append doesn't have to walk the whole list.

Name: etaoin !S/UJugsOl. 2014-10-05 20:38

why is lisp so fukken ugly?

Name: Anonymous 2014-10-05 20:45

>>28
Why is your anus so fukken ugly?

Name: etaoin !S/UJugsOl. 2014-10-05 20:46

(I forgot to re-add my name after clicking preview. Admin, please fix!)

>>28
Why is your anus so fukkin ugly?

Name: etaoin !S/UJugsOl. 2014-10-05 20:47

>>30
how did u steal my secret word u nigger

Name: etaoin !S/UJugsOl. 2014-10-05 20:50

Check my 25!

>>31
I shr don't know.

Name: etaoin !S/UJugsOl. 2014-10-05 20:51

>>32
do u have a tripcode cracker

Name: Anonymous 2014-10-05 20:54

(defun doubles? (d)
(if (= 0 (% (% d 100) 11)) t nil))

(doubles? 33)
t

Name: Anonymous 2014-10-05 20:57

>>33
do u have a tripcode, cracka?
No I don't, nigga!

>>34
I missed the doubles and did if(true){true}else{false}.

How embarrassing.

Name: shrdlu !dWVSk2pCPs 2014-10-05 20:59

>>35
dumbass nigger

Name: Anonymous 2014-10-05 21:15

bitstr = []
for(iter = 1:length(inp))
bitstr = [bitstr, bitget(inp(iter), 8:-1:1)];
endfor;
bitflip = bitstr(1:end-1) != bitstr(2:end);
bitind = [1:length(bitflip)]
bif = bitind(bitflip == 1)
bout = bif(1:end-1) .- bif(2:end)

Name: Anonymous 2014-10-06 4:19

>>12
sweet.

Name: etaoin !S/UJugsOl. 2014-10-06 5:39

i have improved my elisp version:

(defun rle (seq)
(let ((i 0) (count 0) char out)
(if (= (length seq) 0)
'()
(setq char (elt seq 0))
(while (< i (length seq))
(if (eq char (elt seq i))
(setq count (1+ count))
(push (cons char count) out)
(setq char (elt seq i)
count 1))
(setq i (1+ i)))
(nreverse (push (cons char count) out)))))
rle
(rle nil)
nil
(rle '(a))
((a . 1))
(rle '(a a))
((a . 2))
(rle '(a b))
((a . 1) (b . 1))
(rle '(a a b))
((a . 2) (b . 1))
(rle '(a a b b b c c c c d))
((a . 2) (b . 3) (c . 4) (d . 1))
(mapcar (lambda (cons) (cons (string (car cons))
(cdr cons)))
(rle "nigger"))
(("n" . 1) ("i" . 1) ("g" . 2) ("e" . 1) ("r" . 1))

Name: etaoin !S/UJugsOl. 2014-10-06 5:42

forgot code tag
(defun rle (str) ;run length encoding
(let ((i 0) c count out)
(while (< i (length str))
(if (eq c (elt str i))
(setq count (1+ count))
(when c
(setq out (append out (list (cons c count)))))
(setq c (elt str i))
(setq count 1))
(setq i (1+ i)))
(when c (setq out (append out (list (cons c count)))))
out))

Name: etaoin !S/UJugsOl. 2014-10-06 5:44

goddamnit!
(defun rle (seq)
(let ((i 0) (count 0) char out)
(if (= (length seq) 0)
'()
(setq char (elt seq 0))
(while (< i (length seq))
(if (eq char (elt seq i))
(setq count (1+ count))
(push (cons char count) out)
(setq char (elt seq i)
count 1))
(setq i (1+ i)))
(nreverse (push (cons char count) out)))))
rle
(rle nil)
nil
(rle '(a))
((a . 1))
(rle '(a a))
((a . 2))
(rle '(a b))
((a . 1) (b . 1))
(rle '(a a b))
((a . 2) (b . 1))
(rle '(a a b b b c c c c d))
((a . 2) (b . 3) (c . 4) (d . 1))
(mapcar (lambda (cons) (cons (string (car cons))
(cdr cons)))
(rle "nigger"))
(("n" . 1) ("i" . 1) ("g" . 2) ("e" . 1) ("r" . 1))

Name: etaoin !S/UJugsOl. 2014-10-06 13:31

push only one element when count = 1

(defun rle (seq)
(let ((i 0) (count 0) char out)
(if (= (length seq) 0)
'()
(setq char (elt seq 0))
(while (< i (length seq))
(if (eq char (elt seq i))
(setq count (1+ count))
(push (if (> count 1)
(cons char count)
char)
out)
(setq char (elt seq i)
count 1))
(setq i (1+ i)))
(nreverse (push (if (> count 1)
(cons char count)
char)
out)))))
rle
(rle nil)
nil
(rle '(a))
(a)
(rle '(a a))
((a . 2))
(rle '(a b))
(a b)
(rle '(a a b))
((a . 2) b)
(rle '(a a b b b c c c c d))
((a . 2) (b . 3) (c . 4) d)
(mapcar (lambda (x) (if (consp x)
(cons (string (car x))
(cdr x))
(string x)))
(rle "nigger"))
("n" "i" ("g" . 2) "e" "r")

Name: Anonymous 2014-10-06 18:13

i think this is the final version, as the other ones were quite retarded:

(defun rle (lst)
(let (elt count out)
(while lst
(setq elt (pop lst)
count 1)
(while (and lst (equal (car lst) elt))
(pop lst)
(setq count (1+ count)))
(if (= count 1)
(push elt out)
(push (cons elt count) out)))
(nreverse out)))

Name: L. A. Calculus !jYCj6s4P.g 2014-10-06 21:37

U RETOIDS R JUST LIKE FUCKIN SUSSMAN

#include <stdio.h>
#include <string.h>

#define MAXLINE (8 << 10)

char *xfrm(const char *s)
{
return (strcmp(s, "\\") == 0) ? "\\\\" : (char *) s;
}

char *compress(char *to, const char *s)
{
char t[] = { '\0', '\0' };
size_t i, j, n;

for (i = 0; (t[0] = *s) != '\0'; s += n)
if ((n = strspn(s, t)) * strlen(xfrm(t)) > strlen(xfrm(t)) + 2)
i += sprintf(to + i, "%s\\%d", xfrm(t), n - 1);
else for (j = 0; j < n; j++)
i += sprintf(to + i, "%s", xfrm(t));
return to;
}

int main(void)
{
char s[MAXLINE], t[MAXLINE];

while (fgets(s, MAXLINE, stdin) != NULL)
printf("%s", compress(t, s));
return 0;
}

Name: L. A. Calculus !jYCj6s4P.g 2014-10-06 21:40

s/%d/%zu/

Name: Anonymous 2014-10-06 23:09

I just found a recursive sine(x) function and it seems really easy =)

Name: Anonymous 2014-10-06 23:17

And i think i found a new structure too =D
Think i'll call it the Binary Mesh =)

Name: Anonymous 2014-10-06 23:47

binary tree search mode
start with 0 / 90 degree vectors at radius 1 (0,1) / (1,0)
find center (0.5, 0.5) and scale to radius 1.. z*(0.5, 0.5) where z = 1 / sqrt(2*0.5^2).. = 45 degree vector

Name: Anonymous 2014-10-07 0:07

mesh because it can start at any two angle vectors / nodes
eg angle 30 + angle 45 -> angle 37.5

Name: Anonymous 2014-10-09 7:43

rle:
#include <stdio.h>

int main(int argc, char **argv) {
int byte, count, temp;
begin:
byte = getchar();
count = 0;
if (byte == EOF) return 0;
is_same:
temp = getchar();
if (temp == EOF) {
putchar(count); putchar(byte);
return 0;
} else if (byte == temp) {
count++;
if (count == 255) {
putchar(count); putchar(byte);
goto begin;
} else goto is_same;
} else {
putchar(count); putchar(byte);
byte = temp; count = 0;
goto is_same;
}
}


unrle:
#include <stdio.h>

int main(int argc, char **argv) {
int count, byte;
for (;;) {
count = getchar();
byte = getchar();
if (count == EOF || byte == EOF) return 0;
for (int i = 0; i <= count; i++) putchar(byte);
}
}

Name: Anonymous 2014-10-09 8:23

function retvec = mysine(thisangle, thres = 0.001)

%%j=0;

anglebin = [0, 90];

vecbin = [0,1; 1,0];

angletemp = 0;

vectemp = [0,1];

while(abs(thisangle - angletemp) > thres)

%%[x,anglex] = max(abs(anglebin .- thisangle));

vectemp = (vecbin(1,:) .+ vecbin(2,:)) ./ 2.0;

z = 1.0 ./ sqrt(sum(vectemp .^ 2));

vectemp = vectemp .* z;

angletemp = sum(anglebin) / 2.0;

anglex = 1 + (angletemp > thisangle);

%% fprintf("%i", anglex-1);

anglebin(anglex) = angletemp;

vecbin(anglex,:) = vectemp;

%% j++;

endwhile;

retvec = vectemp;

%% [j, angletemp]

endfunction;

Name: Anonymous 2014-10-09 8:33

>>51
hey luke, did you know matlab is shit

Name: Anonymous 2014-10-09 9:08

too many types of brackets?

Name: Anonymous 2014-10-09 9:27

>>50
rle in memory:
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
typedef uint8_t u8;

/* Run-length encodes data, returning the malloc-allocated buffer in ebytes
and its size in esize. */
void rle(u8 *ubytes, size_t usize, u8 **ebytes, size_t *esize) {
// rle can double the input size in the worst case
u8 *eb = malloc(usize * 2);
size_t ui = 0;
size_t ei = 0;
u8 byte, count;

begin:
byte = ubytes[ui];
count = 0;
is_same:
ui++;
if (ui == usize) {
eb[ei++] = count;
eb[ei++] = byte;
*esize = ei;
*ebytes = malloc(ei);
memcpy(*ebytes, eb, ei);
free(eb);
return;
} else if (byte == ubytes[ui]) {
count++;
if (count == 255) goto write;
goto is_same;
} else {
write:
eb[ei++] = count;
eb[ei++] = byte;
goto begin;
}
}


unrle in memory:
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
typedef uint8_t u8;

/* Decompresses run-length encoded data, returning the data in ubytes
and its size in usize */
void unrle(u8 *ebytes, size_t esize, u8 **ubytes, size_t *usize) {
// unrle can expand the input 256-fold in the best case
u8 *ub = malloc(esize * 256);
size_t ei, ui;
u8 count, byte;
for (ei = 0, ui = 0; ei < esize;) {
count = ebytes[ei++];
byte = ebytes[ei++];
for (int i = 0; i <= count; i++) ub[ui++] = byte;
}

*ubytes = malloc(ui);
*usize = ui;
memcpy(*ubytes, ub, ui);
free(ub);
return;
}

Name: Anonymous 2014-10-09 10:31

typedef uint8_t u8;
homo

Name: Anonymous 2014-10-09 10:45

>>55
typedef your_anus_t my_personal_onahole;

Name: Anonymous 2014-10-09 11:37

>>56
Yes onegai!

_t
POSIX-sama is going to be upset.

Name: Anonymous 2014-10-09 21:33

>>57
POSIX-sama is going to be upset.
I'm not sure what you mean, but I was trying to mock _t typenames there.

Name: Anonymous 2014-10-09 22:10

>>58
Names that end with '_t' are reserved in POSIX.

Name: L. A. Calculus !jYCj6s4P.g 2014-10-11 20:22

>>50,54
SUM1 TAKE DA TEXT EDITOR OFF DIS STACK BOI RETOID ASA-FUCKIN-P, B4 HE WRITES MORE SHIT.

DID FUCKIN MOSKITO FIND HIS WAY ONTO DIS BORD OR SUMTHIN? ITS DA KIND OF SHIT ID EXPECT HIM 2 WRITE CONSIDERIN DEY'RE BOTH 2 RETOIDED 2 CHEK DA RETOIN VALUE OF malloc.

Name: L. A. Calculus !jYCj6s4P.g 2014-10-11 20:26

N LAST I CHEKKED COMPRESSION ALGORITHMS WERE SUPPOSED 2 MAKE THINGS SMALLER, NOT LARGER. DA OUTPUT OF UR PROGRAM IS NEARLY TWICE DA SIZE OF DA INPUT WEN RUN ON UR SOURCE FILE.

EEEEH EEEEEH EEEEEH EEEEEH!

Name: Anonymous 2014-10-11 21:29

>>60,61
I think I love you~

Name: Anonymous 2014-10-11 21:52

>>60
Why bother checking the return value of malloc? If you're out of virtual memory, you might as well crash anyway, which the proceeding null pointer dereference will do for you. Half the point of UNIX was that it crashed quickly on error instead of trying to handle every silly error condition and bloating the fuck out of the code for little gain.

>>61
No shit, run-length encoding doesn't perform well on text files. Doooo yoouuuuu seeeee annyyyyy runnns offf characterrrrsss in regularrrr text?

You're not the real L.A. Calculus, go away.

Name: Anonymous 2014-10-11 22:14

>>63
Half the point of UNIX was that it crashed quickly on error instead of trying to handle every silly error condition and bloating the fuck out of the code for little gain.
Stupid then, stupid now.

That's why they are called ``hackers'' and not Professional Engineers.

Name: Anonymous 2014-10-11 22:28

>>64
You must prefer Windows.
HALLOC memoryAllocator = CreateAllocator(hInstance, hWnd, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, MAX_INT, 8, ALLOC_HEAP | ALLOC_SHARED, &cmdShow);
if(memoryAllocator == (void*)0) ExitProcess(NULL, NULL, NULL, 1);
HMEMORY mem = AllocateMemory(&memoryAllocator, hInstance, hWnd, 0, 9000, 4, 8, LITTLE_ENDIAN);
if(mem == NULL) ExitProcess(NULL, NULL, NULL, 1);

Name: Anonymous 2014-10-11 22:42

>>65
windows has proven it works, lunix has not, that's why nobody uses it.

Name: L. A. Calculus !jYCj6s4P.g 2014-10-11 22:55

>>63
If you're out of virtual memory, you might as well crash anyway, which the proceeding null pointer dereference will do for you.
WAT DA FUK R U BABBLING ABOUT W/ UR VIRTUAL MEMORY SHIT? IF malloc CANT GIVE U MORE MEMORY IT'LL LET U KNO. HOW FUKIN HARD IS IT TO WRITE A WRAPPER AROUND malloc DAT PRINTS SOMETHING 2 stderr N EXITS PROPERLY?

UR LAZY, YAINT RED DA STANDARD, N IF YA WERENT A FUCKIN STAK BOI RETOID U WUDN'T EVEN NEED malloc IN UR PROGRAM.

No shit, run-length encoding doesn't perform well on text files.

EVEN DA BINARY PRODUCED BY MY COMPILER, FROM UR DISGUSTING SOURCE CODE, IS MORE BLOATED WEN 'COMPRESSED'. UR PROGRAM'S A FUCKIN DISGRACE. THROW UR FUCKIN TEXT EDITOR AWAY N DEAL WITH IT YA IRRESPONSIBLE DEESHBAG

Doooo yoouuuuu seeeee annyyyyy runnns offf characterrrrsss in regularrrr text?
UR SOURCE FILE SURE AS FUK HAS MULTIPLE COUNTS OF ' ' CHARACTERS DAT CUD HAV BEEN COMPRESSED PROPERLY.

IF U MANAGE TO GET UR PROGRAM TO COMPRESS A FILE U'D ACTUALLY WANT TO COMPRESS, LET ME KNO.

Name: Anonymous 2014-10-11 23:00

>>62
I love him more. He is my hero, not even kidding.

>>63
L.A. is one of the best (if not the best) programmers I know, just like R.. from stack overflow, if he does it then it must be right, I know it.
R.. and L.A. are against the silent crashing of your programs, see http://stackoverflow.com/a/17448240
What you are doing is glib-gnome-redhat-dbus ENTERPRISE quality.

Why bother checking the return value of malloc? Because of this: https://lwn.net/Articles/562211/#oom

Half the point of UNIX was that it crashed quickly on error instead of trying to handle every silly error condition
But this is wrong you turd.

>>65
There are much better ways to write it, it's like you fucked it up on purpose also only a retard would exit if the allocation failed on a non-critical operation and without saving the data, anyway, cool seeing windows supporting your own allocators.

Name: Anonymous 2014-10-11 23:10

I remember a encoding that just used some kind of linked lists to show the next possition of compressed data, if it could not compress it good enough it would just ignore it. In the worst case you would have extra bytes equal to the size of the pointer used (no more than 2 bytes usualy, that's how much a DEFLATE chunk would need)

Name: Anonymous 2014-10-12 0:21

>>67
HOW FUKIN HARD IS IT TO WRITE A WRAPPER AROUND malloc DAT PRINTS SOMETHING 2 stderr N EXITS PROPERLY?
What's the point when you can just attach a debugger and see where it segfaults?
UR SOURCE FILE SURE AS FUK HAS MULTIPLE COUNTS OF ' ' CHARACTERS DAT CUD HAV BEEN COMPRESSED PROPERLY.
Please tell me you realize that this is a thread about toy run length encoding implementations. The algorithm is set in stone, no one cares about how efficient it is, we're just writing examples for shits and giggles.

>>68
But this is wrong you turd.
I'm pretty sure you can dig up a Dennis Ritchie quote somewhere about how a big part of why UNIX succeeded was that it just crashed loudly and dumped on serious errors whereas MULTICS had a complicated error handling system that considerably slowed down development and didn't do much in practice.

also only a retard would exit if the allocation failed on a non-critical operation and without saving the data
That is fair but this is not an enterprise Windows desktop line of business visual basic GUI workstation application, it's a fucking toy dozen-liner RLE function for a /prog/ thread. I thought you retards could mentally insert the boilerplate malloc checking bullshit if it really bothers you that much but I guess that was too much to expect.

Name: Anonymous 2014-10-12 0:26

>>70
enterprise Windows desktop line of business visual basic GUI workstation application
This is not a critical operation.

Name: Anonymous 2014-10-12 0:44

Why even call malloc in a critical operation?

Name: Anonymous 2014-10-13 6:48

Name: Anonymous 2014-10-13 11:44

>>73

The CIA kinda misleads OSdev visitors. Some of it is "get these kids to fail fast and give-up, while having their fun". Brendan will tell them how important any real operating system must have a power-down feature. He talks about shit he, himself, hasn't actually done, but it's the right way to do it. You definitely have to plan for multiple display monitors. "Any modern operating system has to support multiple displays." He tells them how to do... NUMA? There's a long boring shallow fluff spec that tells actually multichip systems with multicores each. Brendan likes to set them straight giving them an overview how how to do that. They defineitly want mutli chips, not just mutlicores, for a respectable system.

He is starting to make sense. Independent OS is good due resistance to backdoors and couldn't be easily analyzed by law enforcement and CIA.

So the less there working OSes, the better.

Don't change these.
Name: Email:
Entire Thread Thread List