/ot/ /np/ /cr/ /st/ /mu/ /fb/ home


/st/ - STEM


Return Catalog


Hi, friends. Let's have a thread for share our personal projects and get reviews.

> URL
> Language / Framework
> Description

Well, it's just an idea so far, but I'm thinking about training a neural network to detect photographs, so they can be auto-deleted. Thinking about writing it in C++ cause I want to learn that.

>>2
You deleted my picture without the neural network. With the neural network you will be unstoppable.


>>3
I think it'd also be useful for anybody who wants to keep cheese pizza off their site.

>>4
Idk how you plan on getting training material lol.

>>5
The idea is that I wouldn't need that in my training data since I'm not looking for it specifically. Cheese pizza falls into photography.

>>4
Is this oc?


>>7
No. I wish I was that good at drawing. Don't remember where I got it from.

>>1
>url
https://rentry.co/k9d3q8f3
>language
python / *nix
>description
i made a "pet program" that is a json file with a shebang.
the interpreter is a py script that reads the json and decides whether the pet is dead. if it's not dead, running the program feeds it.
users can modify the json to make the pets have different hunger speeds or tolerate being hungry for longer.

>>9
A bit of code golfing
class ChanogachiData:
    ...
    alive = lambda self: self.max_hunger > self.hunger
def process_chanogachi(data: ChanogachiData):
    ...
    data.hunger += hunger_gained
    if data.alive():
        data.hunger = max(0, data.hunger - 10)
        print("fed them")
    else:
        print("it's dead bro")

>>10
jesus christ anon, you can do function defines inside of classes why the fuck is it a named lambda????
also it wouldn't work. every member of the dataclass must be serializable otherwise the code will crash trying to dump it to json.

>>11
>why the fuck is it a named lambda
Brevity. But yeah, it's ugly. If I could, I'd write it like this
alive: self.max_hunger > self.hunger
...
...
data.alive

>every member of the dataclass must be serializable otherwise the code will crash trying to dump it to json
You can omit the alive member from the json and it will work.
#!./chanogachi.py
{
  "hunger_speed": 0.18333333333333332,
  "max_hunger": 25,
  "hunger": 7.794536099999998,
  "last_interaction": 1709928440.36794
}

>>12
I tried this and I was amazed it actually worked. I would've assumed that dataclass would've interpreted it as an argument with a callable type and a default value instead of being a class member.
The downside to your golf is, if the chanogachi is dead, every time you run the code it will add more hunger forever.
it's simple to fix though, just check if it's alive before doing anything.

by the recommendation of some anons on lainchan IRC I'm thinking about re-writing it in smalltalk so that it's an image-based program.
Or figure out how to make python image-based (dear god forgive me for even thinking about this)


>>13
If you want a mind-bender, you could try writing it in Red. It's a very odd, esoteric language.

https://red.github.io/
http://redprogramming.com/Getting%20Started.html
https://www.red-by-example.org/

Post edited on 9 Mar 2024, 7:22am

>>14
this only works for 32bit systems and right now Debian is in the middle of a time64 transition, so the i386 arch repositories are going to abandoned soon in favor of the new i686 arch, which provides 64 bit time_t.
It won't impact my ability to use it right now, but I hope this project doesn't go kaput in 2038 when time_t rolls over, or goes kaput trying to make it compile on i686.
Will still give it a look like everything else, thanks!

Message
File
Password (for post editing)
Submit

Delete Post: [File Only]