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
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

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

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
I ended up stealing the algo from https://pepoafonso.github.io/color_converter_wplace/index.html where the source code pointed me towards https://www.compuphase.com/cmetric.htm

And I am getting the same result as there now. Which I am happy with, for now. Now onto actually implementing the dithering. Which shouldn't be too hard, tbh
 
I ended up stealing the algo from https://pepoafonso.github.io/color_converter_wplace/index.html where the source code pointed me towards https://www.compuphase.com/cmetric.htm
what is this algorithm? does it use a better color space than oklab?
Now onto actually implementing the dithering. Which shouldn't be too hard, tbh
in the case of fs dithering, it's basically a loop and a bit of math
try adding other dithering syles too; ordered dithering can be nice
 
what is this algorithm? does it use a better color space than oklab?
It is good enough(tm). And I don't have to bother with implementing conversion to oklab (couldn't for the life of me find any formulas from rgb to oklab online)
in the case of fs dithering, it's basically a loop and a bit of math
try adding other dithering syles too; ordered dithering can be nice
Yeah, gonna go with at least fs, ordered, and randomized dithering. (though not with a threshold but rather with picking a random colour based on a chance calculated by how far away it is from the target colour, don't expect it to look good, but it could be useful for some)
 
IMG_8326.webp
I’m making my own imageboard software.
Since I’ve been told not to double post, here’s a mockup for what posts might look like:
IMG_8327.webp
 
Last edited by a moderator:
I was always interested in making one of those, but never got around due to my acute problem of laziness. (Did you write all the code yourself ?)

What did you use for the frontend ? Is it pure HTML & CSS ?
And for the backend, what type of code you used ? SQL ?
For the templates to automatically generate new threads and answers, do they have any particularity ?

Consider me as someone who doesn't know much, only surface-level knowledge if you don't want to delve too deep into your stuff. Also what features do you want to add on top of it ?
 
I'd like to write an alternative homepage for the Farms, and I have two main questions:
  1. How can you host something like this anonymously?
  2. Is there any proper data source for such a thing? I'd really prefer not to scrape if at all possible.
 
How can you host something like this anonymously?
hidden services are easy to set up on the tor and i2p darknets
you can also rent an ip address and a vps from certain vps providers using monero
to get a clearnet domain name, you do have to dox yourself to icann; certain domain registrars exist that dox themselves to icann for monero but they still do technically own the domain so they can fuck you over (and all the ones i know about have low ranks on the null hosting tier list)

see also:
Is there any proper data source for such a thing? I'd really prefer not to scrape if at all possible.
well i don't see an api anywhere so you might just have to get your favorite html parsing library and go to work (or get your favorite regex library and don't go to work because you're a regex nigger and they don't have jobs)
 
LandChad, in particular i2p/tor hosting.
i2p hosting is so fucking easy. you can literally download and install the java i2p router and it COMES with an integrated jetty web server and it supports static websites and even cgi scripts (although i personally would use something a bit more dedicated for a serious setup. something like nginx in a container)
tor websites can also be easy: see onionshare

host websites instantly from a gui for free with no account: one of the nice things about the dark web
 
I'd like to write an alternative homepage for the Farms, and I have two main questions:
  1. How can you host something like this anonymously?
  2. Is there any proper data source for such a thing? I'd really prefer not to scrape if at all possible.

This may be of interest. It's far from the best approach and sort of hacked together, but it works and may give you some ideas.

I made it as a demo of the Reticulum Network Stack and accessing a text UI frontend of KiwiFarms over HF radio with the NomadNet client for the Ham radio thread:


It uses Selenium and a headless Chrome instance to access the site and do the PoW captcha for KiwiFlare. Then beautifulsoup4 is used to render the HTML content into a markdown format used in NomadNet called Micron. I use different landmarks of Xenforo to parse whats on the DOM into the corresponding Micron tags.

You can run a KiwiNode over any type of medium with Reticulum. I2P, Tor, Ham radio, LoRa, and standard TCP/IP. Reticulum implements PFS (Perfect Forward Secrecy) but you must keep in mind the integrity of whatever transport you use in terms of deanonymization risks.

Unfortunately there is no publicly available API for the Farms and since there is a robots.txt I think that scraping is prohibited, but if it's a 1:1 type of deal where a user accessing your frontend is using it only to access the site then it might be OK, I think.
 
It uses Selenium and a headless Chrome instance to access the site and do the PoW captcha for KiwiFlare.
and if you want to not pull in a whole headless chrome, you can use @y a t s's kiwiflare solving library
Unfortunately there is no publicly available API for the Farms and since there is a robots.txt I think that scraping is prohibited, but if it's a 1:1 type of deal where a user accessing your frontend is using it only to access the site then it might be OK, I think.
i don't think josh would mind if you did a little bit of scraping for a constructive purpose
he deals with way worse unsolicited network traffic than a few forum page requests
 
It uses Selenium and a headless Chrome instance to access the site and do the PoW captcha for KiwiFlare. Then beautifulsoup4 is used to render the HTML content into a markdown format used in NomadNet called Micron. I use different landmarks of Xenforo to parse whats on the DOM into the corresponding Micron tags.
and if you want to not pull in a whole headless chrome, you can use @y a t s's kiwiflare solving library
Yeah, feel free to steal it and reimplement it in whatever language makes you happiest. It's not very complex.
I wrote it in a very easy to follow way with a bunch of comments in the hopes others would port it.

Unfortunately there is no publicly available API for the Farms and since there is a robots.txt I think that scraping is prohibited, but if it's a 1:1 type of deal where a user accessing your frontend is using it only to access the site then it might be OK, I think.
As long as you're respectful and don't spam the site with hundreds/thousands of requests, you'll probably be fine.

In case it helps at all, I have a Go library that can fetch pages off here too.
 
Yeah, feel free to steal it and reimplement it in whatever language makes you happiest. It's not very complex.
step 1: grab 3 data attributes from the challenge page
step 2: many sha256 hashes
step 3: post request
step 4: get cookie
As long as you're respectful and don't spam the site with hundreds/thousands of requests
yes this is what any ethical scraper does
just make sure your code makes only a few requests per minute or so and stay away from potentially expensive features like the search function
 

This may be of interest. It's far from the best approach and sort of hacked together, but it works and may give you some ideas.

I made it as a demo of the Reticulum Network Stack and accessing a text UI frontend of KiwiFarms over HF radio with the NomadNet client for the Ham radio thread:


It uses Selenium and a headless Chrome instance to access the site and do the PoW captcha for KiwiFlare. Then beautifulsoup4 is used to render the HTML content into a markdown format used in NomadNet called Micron. I use different landmarks of Xenforo to parse whats on the DOM into the corresponding Micron tags.

You can run a KiwiNode over any type of medium with Reticulum. I2P, Tor, Ham radio, LoRa, and standard TCP/IP. Reticulum implements PFS (Perfect Forward Secrecy) but you must keep in mind the integrity of whatever transport you use in terms of deanonymization risks.

Unfortunately there is no publicly available API for the Farms and since there is a robots.txt I think that scraping is prohibited, but if it's a 1:1 type of deal where a user accessing your frontend is using it only to access the site then it might be OK, I think.
Lol, selenium was my approach too, to do the captcha I just had the page wait until the site logo appeared. I had a massive bug with finding post OPs in A&H, because of the different rendering of OPs.
 
I was always interested in making one of those, but never got around due to my acute problem of laziness. (Did you write all the code yourself ?)

What did you use for the frontend ? Is it pure HTML & CSS ?
And for the backend, what type of code you used ? SQL ?
For the templates to automatically generate new threads and answers, do they have any particularity ?

Consider me as someone who doesn't know much, only surface-level knowledge if you don't want to delve too deep into your stuff. Also what features do you want to add on top of it ?
I am currently working on the front-end. Both CSS, JS, and HTML are used. The JS is for loading the boards and the forms for user posting. The HTML is for the “main” parts of the site, like the settings or the index. I have not worked on the back-end much.
 
I'd like to write an alternative homepage for the Farms, and I have two main questions:
  1. How can you host something like this anonymously?
  2. Is there any proper data source for such a thing? I'd really prefer not to scrape if at all possible.
If you're wanting to reformat it and make it so others can enjoy your work you could do it in javascript and share that so others could use it if they wanted. If you were getting fancy then you'd want to be mindful of the requests being made.
 
you should just quit web development now
in all seriousness, it is best practice to avoid using javascript in your web pages whenever possible. fancy client-side shit always sounds great, but it never fucking works
Ah. Thanks for the advice!
Anyways, what is y’all’s opinion on Ruby?
 
you could do it in javascript and share that so others could use it if they wanted.
i'm definitely not using anything that requires npm packages, i will not touch that shit with a 41-foot-long euphoria pole (which reminds me: fuck cargo as well)
Ah. Thanks for the advice!
Anyways, what is y’all’s opinion on Ruby?
ruby is one of the typical server-side dynamic scripting languages, and if i had to describe it in three words it would be something like "python but nicer"
i have heard that it's very easy and comfortable to program in but one of the ruby users here @analrapist has told me that such qualities tend to make him paint himself into corners
you should definitely learn it, if you are at all interested. learning new languages is never a bad thing

at some point you need to check out a language called scheme, and get one of scheme's hundreds of implementations. (racket (slightly different from scheme proper, but still has the same spirit) and gnu guile (if you like gnu shit, do not expect it to work very well on windows if you are unfortunate enough to still be using it) are good ones for beginners.) it might seem to be an ancient and irrelevant language with barely any libraries, but it has certain... qualities... to it that make it an ancient and irrelevant language that is actually very worth looking into at some point in your journey
there are also some very nice books about scheme like "structure and interpretation of computer programs" which teach nice things about how programming works at a fundamental level. have you ever tried recursion?
 
I wrote it in a very easy to follow way with a bunch of comments in the hopes others would port it.
i think you ninja edited this in or maybe i missed it, but i would just like to thank you for your highly exemplary code. i don't really touch go, and it's sort of easy to understand what everything does just by looking at it
 
Back
Top Bottom