Useless Scripts/Programs

If you're going to try and BS me that the autism prevalence was actually 1 in 50 back in 1970 too, but only 1 in 200 was diagnosed at the time... well, you're just making stuff up, with no factual evidence to support your argument.
 
idk how to explain to you that social construction of mental health is not something you can empirically put on a data chart so i guess we're just going to link this and go somewhere else

 
I will go with the science, which is what guys like Lustig have been researching and reporting on, and those papers I gave you links to. There is lots of published research on this area now, Lustig's team is not the only one working on it.
 
what they're trying to say is that the sudden spurt in autism diagnoses might not be entirely related to the rise of UPFs because that condition has existed for FAR longer than half a decade ago, a LOT of stuff happened in parallel from the 60's onwards so it's difficult to be so precise about what caused what

i don't deny the possibility of what you're saying being true about our diets causing these developmental defects, but i wouldn't put all the blame on that, and that's why i agree with atax1a here
 
Sure, we don't know that diet is the whole story. But we do have some actual experimental studies, some real evidence with published, peer-reviewed papers, that suggests it may be a factor. And a good understanding of the physiological mechanisms of sugar metabolism that further supports the theory. There has to be a real explanation for the huge increase in the incidence of autism and ADHD over the last 50 years. I don't buy the story that it was always there at the same prevalence as today and simply wasn't diagnosed in the past, there is no evidence to support that. No-one would try to make a similar argument about obesity, for example, you only have to look at photos of people from 50 years ago to see the change that has occurred.

Anyway, we'd better get back to talking about useless programs, this has been a bit of an offshoot into a different area.
 
i should work with ncurses more often, so here's a program that'll just print "penis" on a random spot of your screen every second

C:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <curses.h>

int main() {
    fcntl(0, F_SETFL, O_NONBLOCK);

    initscr();
    noecho();
    curs_set(0);

    int y = 0;
    int x = 0;
    int ymax = 0;
    int xmax = 0;

    char key;

    getmaxyx(stdscr, ymax, xmax);

    xmax -= 5;
    
    while ((key = getch()) != 'q') {
        y = rand() % ymax;
        x = rand() % xmax;

        mvprintw(y, x, "penis");
        refresh();

        sleep(1);
    }

    endwin();

    return 0;
}

i guess this could be good for testing screen burn-in, at least : )
 
i should work with ncurses more often, so here's a program that'll just print "penis" on a random spot of your screen every second

C:
        y = rand() % ymax;
        x = rand() % xmax;

i guess this could be good for testing screen burn-in, at least : )
this unfortunately suffers from modulo bias. you need to either retry the rand() call until it's below the threshold or do a change of radix on the RNG bytestream
 
i didn't even know that was a "bias", this is probably the 2nd time i ever use that operator lol

why's that bad tho', my first attempt was to do that retrying but it'd always end up at the corner of the screen, also what the hell is a "change of radix"
 
specifically, quoting from a Stack Overflow post,
rand()%3 does not produce the numbers between 0 and 2 with equal probability!

When rand() returns 0, 3, 6, or 9, rand()%3 == 0. Therefore, P(0) = 4/11

When rand() returns 1, 4, 7, or 10, rand()%3 == 1. Therefore, P(1) = 4/11

When rand() returns 2, 5, or 8, rand()%3 == 2. Therefore, P(2) = 3/11
it isn't a problem with the % operator specifically, it's only in combination with an RNG.

a change-of-radix would be to recognize that what you want out of rand() % 5 is not "a bytestream modulo 5" but more of "an infinite sequence of numbers in base 5". (because mathematicians love terminology, "base" and "radix" mean the same thing)
 
it isn't a problem with the % operator specifically, it's only in combination with an RNG.
fuck, i guess that explains why it actually produces the same pattern every time i launch the program, my RNG isn't R

a change-of-radix would be to recognize that what you want out of rand() % 5 is not "a bytestream modulo 5" but more of "an infinite sequence of numbers in base 5". (because mathematicians love terminology, "base" and "radix" mean the same thing)
oh wow, not sure if i did that before when learning about randomness in programming
 
fuck, i guess that explains why it actually produces the same pattern every time i launch the program, my RNG isn't R


oh wow, not sure if i did that before when learning about randomness in programming
nah thats because youre not seeding rand(). the modulo bias means it won't evenly cover the screen.
 
FULLY offtopic (pls no kill me!)

But this whole thread does start to remind me about my old C64 days... oh dear...

Code:
10 print "This computer is hacked!"
20 goto 20
 
amazing, i got a little excited and evolved the curses program to act as some sort of screensaver/background animation, i guess it's starting to become somewhat useful now
C:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <curses.h>

int main() {
    // make getch() non-blocking
    fcntl(0, F_SETFL, O_NONBLOCK);

    // initialize our screen:
    // do not show keypresses,
    // and hide the cursor
    initscr();
    noecho();
    curs_set(0);

    int y = 0; // vertical position
    int x = 0; // horizontal position
    int ymax = 0; // vertical boundary
    int xmax = 0; // horizontal boundary

    // get how far we can print our "stars"
    getmaxyx(stdscr, ymax, xmax);
  
    // register the keypresses
    char key;

    // but for now, all we can do is
    // quit the thing
    while ((key = getch()) != 'q') {
        y = random() % ymax;
        x = random() % xmax;

        mvprintw(y, x, "."); // <- "star"

        // gotta do this twice so
        // it eventually clears a
        // spot that's been marked
        y = random() % ymax;
        x = random() % xmax;

        // make the "clear" block
        // 4x as big tho', so that
        // it doesn't look too dense
        mvprintw(y, x, "  ");
        mvprintw(y + 1, x, "  ");

        refresh();

        // should this be configurable?
        usleep(2000);
    }

    // and we're done
    endwin();
    return 0;
}
 
I think that a program in a useless state is simply an unfinished program. I saw a post regarding temperature conversion and i have to say that it is wrong to suggest that we should be using someone elses code, especially when someone elses code carries some ridiculous terms of use or a licensing fee. Sometimes it is better to roll your own code.

I do not know if all of you are as limited as i am in my processor cage. I do not want to be caged. My Intel and AMD processors limit my math to what they deem acceptable for the price of my system, apparently. For example, i cannot calculate a googol plus a googol. why not? so i suppose that this thread means that my current project is useless. However, i see it differently: when i have completed my algorithms, i will be able to break out of my processor, c/c++ cage and calculate extremely high numbers. I could care less if a library exists to do this already because it is not my code. I will not allow my intellectual capacity to be limited by others. So useless code is just unfinished code or purposely useless by design.
 
For example, i cannot calculate a googol plus a googol.
To quote a famous American Nobel Prize Winner, yes, we can. We've had arbitrary precision calculators for a long time.
sh:
$ bc
1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000+1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
20000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000
 
Back
Top