/dpt/ - Daily Programming Thread

Previous thread: What are you working on, Any Forums?

Attached: dpt.png (934x1000, 388.68K)

Other urls found in this thread:

en.m.wikipedia.org/wiki/Special:Random,
twitter.com/AnonBabble

whats the difference between a library, a package and a program?

Like, if I use bash to invoke an imagemagick command how is that different than using the python imagemagick library?

How do I get rich quick using programming?

A library exists in the same address space as your program. You can trivially and efficiently pass data between your program and a library.
Another program is separate, and requires some form of IPC to pass data around, which means a copy most of the time. Although sometimes the separation of a different process can be useful.

Anyone here with some basic knowledge have any ideas for my program?

I want a text to speech voice that reads off random wikipedia articles, or popular wikipedia articles, or a list of articles i choose.

ideally the random read would go on non stop without halting

Attached: 2eff1377d7960e5e4cc24e1e3ef7e21e.gif (125x125, 16K)

Maybe this is a dumb question, but how "real" are the stack and heap? My impression is that they are both just memory, but exe / elf or whatever just kind of abstracts away, but they are all just locations in memory. Or is there a bigger difference between them?

A program takes inputs from another program and/or produces outputs. A library works inside another program as a part of it. Package is kind of an ambiguous term but usually to me just means the same as library.

Yeah, memory is just memory. It's all a matter of how you choose to treat it.
Maybe your OS would mark the stack as nonexecutable (to be fair it probably does that to the heap too), but that's not really special about the stack, you can do that to any region of memory.

That's like 10 lines of bash script. Use curl to grab en.m.wikipedia.org/wiki/Special:Random, run through html2text, pass output to espeak.

implemented the "fill" display mode for my booru client so thumbnails are filled to a square
a special mode sets the anchoring to the top edge so that faces display better for portrait images
will make a "row tile" mode later

Attached: 220813-131825.png (1366x768, 922.06K)

I'm writing a Lisp interpreter in pure Lisp.
So far I wrote one line.

Yes, they're just locations in the same (virtual) address space. The OS provides a function for allocating memory in large chunks, and malloc/whatever allocator you use will call this function to get a big chunk and divvy it out to you as you request. That's the "heap". The "stack" is just another chunk of memory that's provided per thread. The OS allocates space for main's stack before calling main. Other thread stacks are either allocated by the OS upon thread creation (Windows), or allocated by the userland runtime (Linux/pthreads). You can allocate a chunk of memory from the "heap" with malloc and use assembly to point the stack register at it, and now all your local variables and call stack will go there.

write that code if you're so great

Attached: 2398047238.jpg (985x739, 85.65K)

is there any reason to use pytorch lightning when huggingface already has a trainer? I read through features that lightning has and it doesnt seem to justify using another high level framework

Ok

>What are you working on
Gay shit

Develop some virtual kneepads

The questions in this thread are strangely generic

it's ai user

Attached: 213498723149087231498.png (1272x961, 604.92K)

curl $(curl -Ls -o /dev/null -w '%{url_effective}' 'en.m.wikipedia.org/wiki/Special:Random')"?action=edit" | xmllint /dev/stdin --xpath "//textarea/node()" --recover --nowarning 2>/dev/null | espeak
This command first gets a random Wikipedia URL, then appends "?action=edit" to it and requests it, xmllint then extracts the MediaWiki page source and feeds it into espeak.
It's not perfect, espeak is asked to read a Markdown-esque format but it's definitely better than html2text or the raw HTML.
You could write a Python script that goes in the middle of xmllint and espeak which parses or filters it but I leave that as an exercise to you.

Attached: scraper.jpg (1809x2048, 498.28K)

>tfw you will never write a utility like curl and retire early from the billions of dollars you make