Any users of clojure around here? Apparently, it requires the fewest lines of code to write programs of any general-purpose language and has performance on par with Java. It utilizes the JVM and thus is multiplatform in the same manner as Java. It sounds very good on paper.
reddit has a json request thing. pretty convenient once you know. i was wondering how the fuck you scrape reddit or any other modern dynamic webpage bullshit.
i made something to scrape reddit porn videos so i can upload them to bitporno as an experiment. i do a json request for each subreddit and regex the particular video ids, check if its been downloaded before, then if not download them and log it. i added 30 subreddits. they were found on a redditlist website or something that shows nsfw reddits. i just went through the top ones and ctrl-f 'redgif' to see if they use it or not. some reddits dont, others are flooded with it, pretty weird. i ended up with some 12gb of 600 videos downloaded
i was wondering whether deliberate and accurately named videos matter. ill do a crude ab test with 100 vids i personally name, and then 100 vids that i try to scrape a name or maybe generate something. probably the time saved by auto naming and sheer bulk of uploads will more than make up for the decrease in individual views. but i will see
it's some kind of lisp with awful error messages, you pretty much need to know java to make use of it
It's been over a decade since I last ran a jvm/java program.
Android notwithstanding, which is Dalvik and not JVM and I am not aware of a clojure->dalvik compiler.
Ended up going with Haskell instead. Decided I wanted to try a pure functional language instead. Clojure "cheats" by being multi-paradigm. Haskell certainly is different from anything else I have used. The lack of loops is jarring, but the compiler magically makes recursion work somehow. Fewer lines of code are needed compared to using an imperative language. It's well suited to something like Project Euler. Some problems can be solved with a single line. Very little or no time is spent debugging (so far). I will have to try making something serious and see how painful of an experience it is.
look into tail call optimization for performant recursion (compiles into a normal loop)
Still debating whether or not to learn Haskell. The language most likely isn't going to land me a job ever (not that I could get one even if I did all the right things) nor am I convinced of its usefulness (if it were any good, home come nobody uses it?).
I've moved on to trying to create a utility to convert a directory of files into a .d64 (commodore 1541 drive) disk image. I'm certain tools already exist for this but I just want to see if I can do it. I'm trying out a c cross compiler for 6502-based systems and I want to see stdio.h file IO in action but I need a way to get text/binary files into a disk image. I will try to write my utility in C. I'm more and more drawn to languages with minimal syntax and small libraries that I could potentially memorize so I don't have to be googling answers or reading reference all the time. I don't think what I intend to write at any point in the near future would be complex enough to necessitate the use of something like C++.
Definitely don't bother.
Ended up using an existing d64 editor. I then spent several hours trying to figure out why my program wasn't loading a text file properly. Turns out, you have to edit the text in an editor designed specifically for C64 SEQ files. Using a standard editor in Windows causes byte-order information to be prepended to the file and zeros to be injected between letters and no amount of fiddling with vim or xxd seemed to remedy this.
The library code needed to do a simple fopen is almost 7K. Such is the cost of convenience.
Just starting learning C, also curses (library for terminal graphics).https://pastebin.com/APQgLRA6
compiled on linux with gcc -l cursesw [file]
Nice. Might want to declare the return type of your functions. You're dividing by zero at both ends of your i loop. And do you really need the second string.h?
Are you the wizard that makes money by salvaging electronics and reselling the parts online?
>>57279>Basic's diskette load routine is at e168-e1bd, 85 bytes
This is precisely why I have already given up on trying to use C. I could always just include data right into my prg file and not even bother with loading anything from disk. I feel silly programming the c64 anyway. It's like the furthest thing from being practical that I could have chosen. I need to eat.
I don't know the technical answer, but engineering a decentralized IB with a single point of failure doesn't seem wise. If you don't want a decentralized system taken over by those who would ban or censor, then don't give them that power to begin with.
I might be out of my depth here, but have you considered using something like a blockchain?
You can treat the database as a chain of consecutive changes (transactions) on an imageboard. An imageboard is just a public-private key pair that an admin/owner can generate and use to sign and verify his ban/delete transactions.
(1) User posted 34 chars on imageboard with public key #123871237
(2) User posted 12 chars on imageboard with public key #123871237
(3) User posted 54 chars on imageboard with public key #123871237
(4) Admin removed transaction (2) on imageboard with public key #123871237 (signed with private key of imageboard)
(5) Admin banned IP hash #1987231 on imageboard with public key #123871237 (signed with private key of imageboard)
(6) User posted 127 chars on imageboard with public key #123871237
Nodes can receive transactions and relay it to other nodes. If it's an ADD transaction, they check the ban list before accepting and relaying. If it's a REMOVE or BAN transaction, they verify the message with the imageboard public key (which serves as its ID as well) and then relay it to other nodes. Clients can ask a node to send transactions from the beginning or from a certain version number and then build the current version of the imageboard database by stacking transactions (initially takes a while, but then relatively fast).
The problem is that removed transactions aren't really removed, but are simply hidden (the client can still choose to see deleted posts by ignoring REMOVE trans. and dishonest nodes could still relay messages from banned users). I guess it doesn't really solve your problem, but I think it's somewhat in the right direction as a solution.
>>57317>engineering a decentralized IB with a single point of failure doesn't seem wise
Yes, I know, wizard. The purpuse of that decentralization is a little specific, I want to make it possible to anyone to copy the entire imageboard and host it by himself or just help the server by hosting an instance but not having administrative rights over it. Decentralization is not the purpose, but a feature. So even if the imageboard goes down someone with a copy could host it somewhere, he could host a new version and be it's administrator inheriting all the content from the previsious IB.
I thought: if I added a "decentralization layer" upon Vichan, how that would be? I want to know what I can achieve with that goal. However, I am not programming on Vichan, instead I am making the software from scratch.>>57318
Yes, I considered using a blockchain, the problem I faced at first was that I do not knew how to determine the genuine chain out of each one, because anyone could remake the entire blockchain from scratch. Also, later I found that blockchains are slow and tend to be slower as the network grows, so I really don't know if I want to use a blockchain approach. What I am considering now is a database synchronization protocol approach.
Your solution is good and you gave me a direction, I think private-public key pair could solve the permissions problem, I just do not know how can I implement it. I need to learn more about asymmetric encryption.
found out facebook has a streaming service so i made a way to download vods
the audio and video mp4s and are split however which is gay but this will download them
ffmpeg -i "audio.mp4" -i "video.mp4" "combined.mp4"
…but in 40 minutes it's only encoded 998MB, not even the full video, i ended up just terminating it lol
im retrying with this
ffmpeg -i "video.mp4" -i "audio.mp4" -c copy -map 0:v -map 1:a "combined.mp4"
…and holy mother it finished before i even finished copying and pasting that shit above
less than a minute to do 1300MB
very important lesson learned i guess
Hey wizzie, how's that going for you so far? May I ask how are you learning C, I started with c++ a couple of months ago using Bjarne's PPP book, but I'm moving very slow.
not the guy you're asking but i'm learning C by reading the C programming language book and doing competitive programming problems.
Now what kind of streams from Facebook would a wizard want to download?
Hey buddy, do you mind sharing where you find these competitive problems? I am doing most of the end of the chapter questions, but i'm unsure whether doing them will eventually help me write semi-decent scripts.
I'm also thinking of looking at some programs I use that are written in C(vim, lynx, etc) and playing with the source code.
It's going quite well, I feel like I can make computers do anything now. I've learned pointers and arrays now I'm working on using keyboard input while a program is doing other things (using keyboard buffer). Right now I'm making game of life with keyboard input, menus, saving/loading, mouse controls. I am using code of the previous program to have a heat map display of it.
I'm reading The C Programming Language and also the manuals for curses and everything else I use. I never really RTFM before this. I've also learned git, some comp sci and some other things from an android program called enki, it's good.
I'm going to do some little projects like these, please rec any cool ones if you know of em:http://buildyourownlisp.com/https://viewsourcecode.org/snaptoken/kilo/
I used to know of a cool site that explained how compositors or display servers work, anyone know it?>>57439>I'm also thinking of looking at some programs I use that are written in C(vim, lynx, etc) and playing with the source code.
I've been thinking about that lately too, I want to know how big projects work. Wiz hacker renaissance now.
That one about the text editor is nice. Have this one https://craftinginterpreters.com/contents.html
, it uses java first, bu the secund part uses C.
Who else is a brainlet trying to learn to program here? Things don't just come to me naturally or quickly and I lose motivation at any roadblock.
We're on the same page then. I live in the US which is pretty third world if you're poor, so I too need to gain some kind of skill to make a living for myself.
every now and then i do programming problems on codeabbey. you can use whatever language you want which is why i like that site
i remember reading in the past that people used to do math for fun, and it wasn't uncommon. like bored housewives would pick up a mathematics book and solve the problems. all this technology and entertainment and stuff to consume and yet people are still doing that
I can see the value of the Maybe monad in Haskell. Maybe I will learn to appreciate the other types monads as well.
The first thing I chose to do for a research project was to make a chat client/server. The entire program so far is just imperative-style lists of instructions, IO operations and even mutation of state shared between threads (I'm not aware of any non-blocking versions of socket operations, so I used threads). It all just kind of looks like a C program. No use of monads, mapping, filtering or anything vaguely functional.
i submitted a report to twitter's bug bounty program. for twitter it says the minimum reward is $140 and the average is $560. very cool but maybe i did it wrong or something. will post updates about it i guess
Hmm. If you ignore the feature bloat in C++, it really is a nice language especially coming back to it from Haskell. Pure functional program forces you into these painful, unintuitive anti-patterns that are difficult to formulate, difficult to read and inelegant. In theory, pure functional programming reduces errors but it does not seem to reduce overall development time or even lines of code. It's astounding what a chore it is to make a simple Connect Four game in Haskell.
I think I have been filtered by Haskell (pun intended). Maybe I would get further with Scheme.
well i'll be damned, i discovered a real problem, but someone else beat me to it so my report was simply closed for being a duplicate. that sucks, but at the same time it's encouraging for a few reasons. i might try intentionally looking for stuff now
that's what they want you to do. Do work for less wage (140$ would maybe be 2 developer hours).
i am not, nor ever will be a developer or normaljobber, so you have to look at the money through the eyes of a neet
Anybody finding that they no longer find programming rewarding? As a hobby, I liken it to cooking. It's just the application of algorithms. Any time you need to solve a problem, you just look up the answer in the recipe book (Google).
I should have just studied literature or something in college. I don't think I have anything to gain intellectually or financially from programming. I don't have the aptitude to be a reliable employee nor do I have the creativity to employee myself. The indie game scene is now experiencing the equivalent of the video game crash of the 80's only this time there are heaps of gay furry dating simulators. The game and programming industries in general just sort of sicken me.
I can program, I just never see myself being in a position where programming actually makes me any money. The software industry seems like an unnavigable sea of information. I don't know what to focus on to make programming worth my time and nobody will tell me. The path to success is kept secret from the forever-alone autists to make sure they never escape their forever-alone status. It's a conspiracy.
Are you Australian?
No, a mentally-ill, middle-class American suburbanite.
started learning intel 4004 assembly today
it is weir most instructions use the acc as like a super register and you are juggling shit around constantly. i found it fun making spaghetti juns and jcn loops
it seems there are a lot more instructions than what i found in the introduction and some double instructions (whatever they are called) require another instruction that i basically have to keep looking up what it means
i can now see why a single chip being able to do all this shit is so impresive, esoecially since it s now 50 years old
That's what you get with loonix and C!
This shit stops me in my tracks every time. I fantasize about C64 programming because dependencies are basically non-existent. Code size is small because you are limited to a very small amount of memory. The downside, of course, is having to program everything from scratch including operating system functions in assembly language with essentially zero debugging capability.
I made a small web app for watching multiple porn videos at once in a grid layout. You can embed up to 25 videos at once on a single monitor. This is much more convenient than switching tabs or having to manually resize multiple windows into a grid. Currently supports a bunch of normie porn sites, but it's fairly trivial to add support for new ones if you know how to match the video URL with regex and transform it into an embed link. For some sites, you can't use the normal link but have to copy the embed link itself, because the normal link doesn't have a proper ID or key param, which is slightly more inconvenient. Can't think of a solution other than having to scrape the embed link from the page.https://voidxtech.github.io/coom-viewer/
redtube (normal link)
pornhub (normal link)
xvideos (normal link)
ashemaletube (embed link)
xhamster (embed link)
I should probably add this info on the actual app.
>>57810>watching multiple porn videos at once in a grid layout. You can embed up to 25 videos at once on a single monitor
What's wrong with dick succubi, my dude?
Anyway, you could easily watch up to 25 cartoon videos if that's what floats your boat. The technology is completely agnostic to your particular fetishes.>>57812
The future is here. The 2x2 and 3x3 are more than enough for the average connoisseur, but the higher levels are available for those that can handle it.
im weird so i just play it in vlc, set looping a-b points, crop it to the exact area im interested in, and then i either repeat to fill the rest of the space on my screen, or i look for images to display there
Imo, the job of a wizard is to slowly stifle the nature of his own sexuality through sheer willpower. Simulating sexual experiences would be against this. I can imagine it being an extremely popular thing amongst the majority of humans, though.
You don't need to be a advanced AI to do that. Just get into lucid dreaming. I summoned and then wizfucked so many succubi, both real and not real. That was in the past though, i am over this beastly impulses and only use lucid dreaming for spiritual purposes.But that is a fact - you can recreate reality down to the feeling of wind on your face. Takes a while though
is CLRS algorithms or Sedgewick algorithms a better read if I did a course on it years ago but didn’t learn much?
Upgrade to Kite Pro
Has anyone here read through Algorithms by Cormen et. al.? I bought this book thinking that it will teach me how to write algorithms but I'm in chapter 4 and so far all it's talking about is theories about optimizing the running time. I understand the importance of this, but it should not be the first topic to be discussed in such a book. also, should i bother to do the exercises from this book?
i know how to use curl pretty well now, for making requests and such. i still dont know jack shit about how the receiving end works
my understanding is that servers are just regular computers that have a program running that is listening to a certain port for correctly formatted requests coming from other computers. i dont understand how you can make a program that listens for these kinds of requests though. basically, i think i want to know specifically how server programs are listening for requests. in a windows environment also
i tried looking for info but all the knowledge is above me
Well in Unix it is quite simple, I am sure in Windows it is much the same thing, too, because they all use the same underlying sockets technology, afaik.
The server process is run as what we call a daemon, that is a process that is detached from a terminal (so it's just the process with no front-end like a command line, gui, or anything), it opens a new socket, which is the standard implementation of all network operations. It is really, just like pipes and other IPC mechanisms, an object (ie. datastructure) in kernel space. Sockets are just that: a tool for IPC which is persistent, and provides a two-way communication channel, possibly reading and writing to a network device (it too a datastructure in the kernel).
Back to the server software, in order to service several requests concurrently, whenever it receives a request, it forks a child process in order to service that request, so it can keep on listening and servicing other requests. The functionality here is just as with any other process, the kernel has some chunk of data available for the program to read as input, process it and return some output. Sometimes the connection is persistent, sometimes it is readily dropped (I'm not sure how http does this, it is in principle a tcp connection, which would have to be explicitly terminated by either end, but it also can just serve a page and terminate, I guess implementations decide how long to keep a process listening for aditional requests, which is often the case (consider loading a page with several files, and having the user navigate the site.))
As for the rest of the process, it all happens on the network logic of the kernel, which encapsulates the details so as to run more or less as I just described. The server does not need to know about how the kernel multiplexes the network device into ports, or how tcp manages to keep data integrity, etc.
Finally getting the native c64 version of Turbo Macro Pro to cooperate with me. Using the 512k RAM expansion version cleared up issues where I couldn't get code to assemble if it included macros. I then struggled through the process of figuring out how to include files. They apparently have to exported to SEQ files before being included. Wrote some basic I/O routines like a print routine, a clear-screen routine, one that outputs a newline character, etc. Going to gradually make a connect 4 game. I even have 16-color text and a various petscii symbols so I can make a proper board with red and blue pieces if I so choose.
so the million dollar keyword is sockets. not understanding sockets seems like my problem as of now
If you can read C code you might want to read this one: http://beej.us/guide/bgnet/
using that as a guide i made something, though it's not in c. i think i understand it somewhat now. was able to start up tcp on both server/client, make a listening socket and wait for client to connect and then receive the message it sends
to get it to working beyond my local network though and to use my public ip i think it will require port forwarding, and then i need to reserve my local ip to stop it changing since dhcp is enabled
this is very cool
Learning c64 programming makes me feel like I am insane or retarded (which I am). To be able call a machine language subroutine from BASIC that I wrote in an assembler, I have to assemble to disk, reboot the system, go into a machine language monitor, load the routine into memory, exit to BASIC and then load and/or write the BASIC program that calls the routine. If you try to load more than program into memory directly from BASIC, programs clobber each other. They don't load neatly into the memory locations you would expect them to load into.
load more than one program into memory directly*
i get the fun/puzzle aspect in building low level stuff, but that just seems kinda annoying
I think there's actually a "load-to" command in the assembler that can be used to put a routine/data in a specific location without rebooting. I learn something new all the time. There's also multiple banks of memory inside of the RAM expansion unit also but I don't know if they can be accessed from BASIC. One step at a time.
>>58052>is CLRS algorithms or Sedgewick algorithms a better read if I did a course on it years ago but didn’t learn much?
CLRS is more academic, Sedgewick is more informal. If you've already done a course on it then CLRS will be the better read. You can preview both on libgen.>>58105>Learning c64 programming makes me feel like I am insane or retarded (which I am). To be able call a machine language subroutine from BASIC that I wrote in an assembler, I have to assemble to disk, reboot the system, go into a machine language monitor, load the routine into memory, exit to BASIC and then load and/or write the BASIC program that calls the routine. If you try to load more than program into memory directly from BASIC, programs clobber each other. They don't load neatly into the memory locations you would expect them to load into.
You're thinking too hard about this. Remember that the basic load function is itself just an assembly routine, which is built on top of kernel routines from the c64 rom. The basic load function likely maintains its own pointer to where it thinks free memory is, like how malloc/sbrk does, which is where the ambiguity is being introduced. You can read the load disassembly here https://www.pagetable.com/c64ref/c64disasm/
How can you break out of this? If the basic load function calls your own load routine then you can do what you want. Alternatively, you could use the kernel routines like basic does. If you can get bytes into memory you don't need to reboot the machine, they can be immediately executed. Now, because you're dealing with a machine with expanded memory there's an additional annoyance, but all that means is you must flip some bits in the memory controller to access the page from banked memory you want. As far as the CPU is concerned there's only one address space limited by the physical width of the address bus.
are markov chains just a way to, for example when dealing with strings of characters, to select the next char based on the previous char according to the pair frequency
I'm realizing that the problem isn't the LOAD routine, it's the fact that BASIC frees memory the moment it thinks it is no longer needed such as when you modify the program stored at Start Of BASIC. To get a ml program to run at all from BASIC, the bare minimum requirement is to assemble a header of bytes at *=$801 which translates to
10 SYS 4096 (or wherever the ml program actually starts)
At this point, you can actually start it with a RUN or a SYS call. The moment you try to modify the one-line BASIC program to something like
10 FOR I=0 TO 10
20 SYS 4096
30 NEXT I
the routine stored at 4096 disappears. I think the magic may lie in moving various pointers around and/or changing the header to contain a different line number.
None of this really matters unless I want to write BASIC programs that call machine language routines. The C64 Programmer's Reference Guide might explain it.
Hmm. Without the BASIC header, LOAD puts an assembly language program at $801 regardless of whether or not it belongs there. With the header, the actual assembly code gets put in the correct location. However, once you make any modifications to the BASIC program, the machine code gets displaced. BASIC thinks everything between $801 and the end of the machine language is one big BASIC program. Moving the top-of-memory pointer does nothing to prevent code from getting moved.
It does seem like writing a short assembly program to load the real code into memory is necessary, possibly in conjunction with using the top-of-memory pointer to protect the code from being eaten by BASIC.
Learned many things about BASIC today such as how to create and delete files and write data to SEQ files. Made a short script that creates a table of pre-computed random bytes that can be included into an assembly program and a sprite editor. The table generator could be modified to generate tables of trig functions for instance. The sprite editor works by editing DATA statements in a BASIC listing. A nested FOR loop can be incredibly slow in a scripted language running on a CPU from the mid-seventies. I could maybe optimize by making the inner loop machine code. Going to make a screensaver by making differently-colored circles bounce around the screen randomly. Maybe I will try sprite multiplexing. Or try loading the sprite data from disk in machine language instead of just building it into the code.
I think I killed this thread but I will continue to blog. Have tried multiple C compilers for the c64 and they don't work. Files always end up getting corrupted somehow. Even with accurate disk emulation enabled. I'm using the c64 "maxi" btw which is pretty neat and generally works as intended but not the C compilers. Forth, on the other hand, works pretty well. The binaries that it builds are huge because it builds the compiler, forth kernel, assembler, text editor and various libraries into the binary by default. I will have to figure out how to trim things down. Durex forth is, according to its creator "50 times faster than BASIC" which puts it on the same level as C (about half as fast as assembly). It's nice to have a "high-level" language that doesn't poke along (pun intended) like a horse and buggy.
It's not you who killed the thread. Wizchan is dead. Simple as.
Bracing for sage-wizzie to scold me with his usual grumpy snark.
c64 programming is rewarding but also maddening. I got the C compiler to work by switching to PAL mode but it only works with accurate disk emulation which is painfully. To compile and link a program, you must insert the compiler disk, then the source disk, then the compiler disk again, then the object disk, then the compiler disk again, then the object disk, then the library disk then the binary disk. I might be able to eliminate a few steps by using the RAM Expansion unit and a single disk for souce/object/binary but I think it will fuck it up somehow. All this for a program that in the end will run at half the speed of an assembly program or slower because the computer doesn't have enough memory to optimize code.
Forth is interesting but also kind of stupid. A function that evaluates the expression "9a^2 - ba" is written "over 9 * swap - *" and it is essentially a sequence of operations on a stack. I can't figure out how to make my programs launch automatically which means that they have to be invoked through the interpreter which means I can't strip the interpreter out of the binary which means that my program has a debug console built into it that can't be removed.
Hmm, I think I will put the c64 in the closet and use the table it sits on to draw or something instead. Better use of space and time. Antiquated technology is one thing but shit emulation is something else entirely. Poor investment of money. I get what I deserve buying an emulator box.
Does anyone here work as a programmer and do things outside of work, or are you doing it solely as a hobby?
I went to college to learn programming but I do not work. I squander my limited abilities on pet projects that rarely get completed.
I used to like programming for it's own sake, but now I see it as a tool to get a job done, that job is to automate some task. It might be fun to model some scenario, but ultimately it's a means to and end.
Welp. Turns out you can load machine language routines into their correct memory locations with LOAD "<program name>",8,1 as opposed to LOAD "<program name>",8. If you omit the 1, the program always begins at start of BASIC and ends at the end of the range it was assembled into.
I finished a masters degree about 3 years ago then did nothing