Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
I like being certain about what the best approach would be
If this is your goal, you're asking the wrong place, because we'll all disagree on what the best approach is. I'd tell you to start with a project you want to make and push through until it works. To me, there's literally no other way.
 
the best approach
pretty much this
1758662506527.webp
 
Hi. What's the best way to learn C at a beginner's level?
I know I can search this all up on Google, but I like being certain about what the best approach would be.
Fuck "best approach[es]". Pick some resource (literally any of them) and get started. My programming journey started >2 decades ago with a random search for "how to program". There has never been a better time to learn; you have way more quality (FREE) resources available at the top of search results than us oldfags ever did (lynda.com anyone?).
Google your problems when you inevitably run into them—there is a 99.99% chance someone already asked the same question many years ago. Ask here for code critiques, if you like. We're not that mean.

Practice—it's the only way to get good.
 
Last edited:
Hi. What's the best way to learn C at a beginner's level?
I know I can search this all up on Google, but I like being certain about what the best approach would be.
here's the best approach to learn c:
  1. get a decent posix environment (if you're retarded and use windows, msys2 or wsl2 will do)
  2. install gcc
  3. cat > nigger.c
    1. #include <stdio.h>
    2. int main(int argc, char** argv) {printf("nigger\n"); return 0;}
    3. press ctrl+d
  4. gcc -o nigger nigger.c
  5. ???
  6. you are now c porgamer
also you can see the stuff posted by the guys above. do take into heart the advice that there is no "best way" as well, because there are many, many ways to start programming. maybe even reconsider learning c as your first language (if this is indeed your first time, as i am sort of assuming here) because it does make certain things really hard (but you still learn quite a lot!)
a good hypertext language reference for c may be found at cppreference.com
I appreciate everyone's reply to the post. I'll definitely pick up the K&R book, and I'll attempt to start a small project. Maybe do a recreation of Defender.
I also did not know Harvard had some courses anyone could take. That's very useful.
mit also has courses anyone can take too
as @y a t s said, there has never been a better time to learn. there are so many excellent resources everywhere that picking which one to use is the only hard part
 
Fuck "best approach[es]". Pick some resource (literally any of them) and get started. My programming journey started >2 decades ago with a random search for "how to program". There has never been a better time to learn; you have way more quality (FREE) resources available at the top of search results than us oldfags ever did (lynda.com anyone?).
freemediaheckyeah
here's the best approach to learn c: [etc.]
Lost it at nigger.c. I wrote a nigger.py very recently.
mit also has courses anyone can take too
I don't know what @John Shedletsky 's financial situation is but Coursera offers financial aid too. And I believe you can "audit" almost anything on there but that may be more or less desirable based on the degree of interactivity. Also look into Exercism, where you can get real human feedback for free.
as @y a t s said, there has never been a better time to learn. there are so many excellent resources everywhere that picking which one to use is the only hard part
We should do a /sp/-style technical book publisher OFFICIAL POWER RANKINGS from (probably) No Starch to Packt, who I believe are now augmenting their mostly very shitty catalog with AI slop in book format.
 
Last edited:
I'd like to see that.
I'd say as a matter of ratio of good to turd, No Starch releases very few turds. Pragmatic Bookshelf is very similar. Manning might just be a little behind. O'Reilly and Apress among others have a decent number of good books but are more uneven. Packt on the other hand I only go for if it looks like I have no other choice, at least as far as published books, and even then only with the one-click discount of 100%. I straight up ignore anything that was published in India with maybe very few exceptions. Of course these are mostly the applied / "for hackers" titles. Including more theoretically oriented publishers such as Addison-Wesley and MIT Press would add another dimension entirely.
 
It took me way too long, but I finally managed to at least get threshholding working on my project to build a highly customizable wplace image converter. :D Next up is getting a basic dither algo working (probably floyd steinberg).

Then expand into other colour spaces, such as CIELAB rather than just rgb.
1758833278191.webp
Left is before, right is after. Also, I definitely need to adjust some values in colour comparison function, as atm, I just use ΔR+ΔG+ΔB.
As I am writing this, it occurs to me I could just use ΔR^2+ΔG^2+ΔB^2 for now.
1758833905048.webp

I think I may have messed up some code
 
Next up is getting a basic dither algo working (probably floyd steinberg).
floyd steinberg is fucking epic. i implemented it in a shitty retarded language once for fun and rendered some bullshit trigonometric graphs with it because i didn't bother to make anything interesting like a raytracer
Left is before, right is after. Also, I definitely need to adjust some values in colour comparison function, as atm, I just use ΔR+ΔG+ΔB.
As I am writing this, it occurs to me I could just use ΔR^2+ΔG^2+ΔB^2 for now.
doing your perceptual color comparisons in a perceptual color space would probably improve things massively
cielab is pretty good for that but you might want to look into oklab as well
 
floyd steinberg is fucking epic. i implemented it in a shitty retarded language once for fun and rendered some bullshit trigonometric graphs with it because i didn't bother to make anything interesting like a raytracer

doing your perceptual color comparisons in a perceptual color space would probably improve things massively
cielab is pretty good for that but you might want to look into oklab as well
Yeah I get that those are better, and the plan is to allow people to choose, eventually. But for now, I am happy to get something semi-working for now, tbh.

The outline for what the page should be able to do eventually:
Allows color converting based on one of a few colour spaces (rgb, cielab, etc)
Allows multiple configurable layers with the following each:
Dithering enabled/not
Which colours are enabled for that layer
Which area of that layer to be used in the final image
Which dithering algo for that layer
Probably more I can't think of atm
How much of the error to diffuse

With the end goal being to essentially make it a multi layer editor specifically for wplace. (because quite frankly, some images have some areas where dithering is necessary while also having some where it looks like crap, or areas where you need to turn off specific colours)

Also the idea to be able to adjust how much error to diffuse is because some areas may be fine with a solid colour for the most part, but where you can't just do threshholding.

All those features are because I've found other online editors to be lacking.

This will definitely take at least 200 hrs of work for me.
 
anime-girl-anime.gif
Colour spaces are making me hate my life atm. I should've stayed in school to grok matrices and such. At least OKLAB is just the eucledian distance for colour differences. But can I just add the quantization error that comes from thresholding to the oklab space? To me, it seems to wrong to just add to the chroma of an oklab value.

According to this footnote I should use srgb to actually process the image? So, just use oklab for the difference, then actually propagate the quantization error in srgb? So oklab would ONLY be for colour comparison?

And that's not even getting into gamma expanded srgb? (I know some of these words). Image processing is, quite frankly, witchcraft, and the more I learn the less I know to know. I really was on mount stupid before starting my work on this.

But I am gonna promise daily updates for now, even if it is just to force myself to not abandon this project. (Just tell me if it is not appreciated, then I'll stop em, don't wanna be annoying).
 
To me, it seems to wrong to just add to the chroma of an oklab value.
yeah it doesn't really make sense which means you should probably switch to an additive color space so you can add and subtract colors
According to this footnote I should use srgb to actually process the image? So, just use oklab for the difference, then actually propagate the quantization error in srgb? So oklab would ONLY be for colour comparison?
yeah that sounds about right, considering the last thing i quoted
also remember that many things involving color are a "does it look right?" kind of thing. your fancy german oklab color space is just a heavily optimized transformation into a coordinate space that is optimized to look right
And that's not even getting into gamma expanded srgb? (I know some of these words). Image processing is, quite frankly, witchcraft, and the more I learn the less I know to know. I really was on mount stupid before starting my work on this.
just undo the srgb response curve to get a linear form of srgb and then propagate errors through that
if you don't undo the response curve it will make the image slightly darker or something, which is not very ideal
of course you might like the look of a floyd steinberg performed on gamma corrected srgb better than you like it on regular srgb! and if it looks better it's not very important how "correct" it is because this is a shitty pixelart converter and it's just supposed to look good
 
Back
Top Bottom