[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


What are you working on, /g/?

previous >>100179479
>>
I fucking hate regex so much it's unreal, I will use it with grep once if I remember how to use it, but I will never write one meant to be part of a shell or a bigger program.
>>
>>100189059
me too and it sucks
>>
>>100189059
>What are you working on, /g/?
Writing the regex parser of the lexer of the operator precedence parser of the parser that need to be compiled to the VM that still need to be written of my language.
>>100189104
you're missing out
>>
>>100189122
>missing out on suboptimal state machine scripting language performing worse than naive handwritten parser
>>
>>100189059
>pic
me after being forced to build a parser for 3 months at work
>>
>>100189138
it's fast to write and the poor runtime is technically an implementation issue, regex being only a poor DSL and all
>>
>>100189059
I learned regex by making syntax highlighting files for nano.
>>
>>100189180
poor runtime is caused by regex being a meme language, just use parser generator for anything more complex than oneliner if you're afraid of writing your own parser, many people do this and it works for them.
>>
>>100189059
C, Rust, Haskell!
>>
>>100189198
I'm certainly not afraid of them but I rarely if ever saw parser generators for anthing else than yacc-like parsers.
>>
>>100189253
Because parser generators also basically are a meme and not useful in the real world, they're like regex, only good for quick temporary solutions until you have real thing to replace them.
>>
>use SIMD for searching in strings
>SSE movemask must be unintuitively read from the lowest bits
little endian niggers I swear
>>
>>100189059
Who was the schizophrenic who thought regex was a good idea?
>>
>>100189059
How can i learn MySQL, any tips or tutorial that helped you
>>
>>100189253
>>100189287
Maybe look into PEG (not pegging, you pervert). Parsing expression grammar. More logical than regex and good enough for Python. And no, parsing is not Python's weak side.
>>
File: 1649427165896.jpg (52 KB, 618x618)
52 KB
52 KB JPG
>>100191009
translation:
>I am projecting my schiophrenia on others and have skill issues
>>
File: cfd_grid.jpg (338 KB, 688x601)
338 KB
338 KB JPG
>>100189059
What's a good book to learn C++?
>>
>>100189059
I finished finished C Modern Approach which was recommended here 2 years ago by someone. I had never coded before it but had fun going through it and doing exercises in my free time. I was thinking what to learn next.
Some harder C book or another language/framework? I need something with exercises or otherwise I get overconfident about my knowledge
>>
>>100189287
You don't need to refined parsing solutions, what the fuck are you doing where the largest cost in converting a set of shitty text data into structured data for your system is anything other than human capital. Real data flows come in real data formats. Parsing's just for getting daily sets of garbage files from the Bank or scraping an internet page. The quick and dirty way is the correct way.
>>
>>100191009
what do you propose for the recognition of regular languages, faggot?
>>
>>100189059
>What are you working on, /g/?
Fib-anon got me thinking and I threw together a recursion-free algorithm for calculating fib numbers in C#, it's been running for like 5 minutes and is currently at 5,000,000/10,000,000
>>
Is this bad pratice in Go? I feel like it makes it easier to read

package ta

type FloatArray []float64
type FloatMap map[float64][]float64
----
Then I can just do
myCoolArray := ta.FloatArray{0,1,2,3}
in other files
>>
>>100191303
Update: It finished but my console overflowed
I doubt I could post it in one comment, but yeah, that guy was fucking retarded. 500GB? Really? This shit needed less than 20MB for most of its execution and half of that was probably due to the VM
>>
File: 59033741128.gif (2.95 MB, 500x500)
2.95 MB
2.95 MB GIF
>>100191152
Start with C++ Primer
>>
https://monkeylang.org/
I pirated this book and making that shit scripting language along with it
>>
>>100191187
hand-rolled parsers written in a turing complete language
>>
>>100189104
Just use AI to make a regex for you
>>
I've got an arena allocator and I'm wondering if I should add a function to "clear" the arena and be able to reuse it and its memory as if it were empty except that all the previously allocated blocks are still present, linked up and available, with all the allocations pointers reset to the start of the block. The use case for this is when you need storage only for the duration of a loop iteration.
>>
>>100192065
Bloat. Just put the allocation outside the loop and reuse it
>>
File: whyotter.jpg (96 KB, 600x662)
96 KB
96 KB JPG
>>100191881
i am totally gonna do that in a GUI field that recognizes numbers
retard
>>
>>100189059
>What are you working on, /g/?
Starting a project with cmake-init
>>
This is the result of 3 days of work:
@@ -152,7 +152,7 @@ bool block_data_parser_next(struct block_data_parser* ctx,
}
for (i = 0; i < _CMD_COUNT; ++i) {
struct regex* re = &cmd_reg[i];
- if (regexec(&re->preg, line, re->preg.re_nsub, re->pmatch, 0)) {
+ if (regexec(&re->preg, line, re->preg.re_nsub + 1, re->pmatch, 0)) {
continue;
}
switch (i) {
>>
>>100192151
>he doesn't know that capture 0 is the entire match
you pleb
>>
File: r_to_python.png (78 KB, 671x530)
78 KB
78 KB PNG
Baby ducking so hard right now.
>>
What's the best way to get my bachelor thesis done?

A:
8 - 17 = code the project
19 - 22 = paperwork

Or this one
B:
Monday - Wednesday: code the project
Thursday - friday: paperwork
>>
>>100192183
That's the best part, I did fucking know. I wrote it right like 8 fucking times in the same file. Just a forgotten typo
>>
Working on a dating site/app exclusively for racists. Will I be able to use any of the big advertising platforms? Will the app stores turn it down? Any risk of webhosts revoking my domain name?
>>
I have this array where each item corresponds to a gear ratio. I would need to find the "optimal" shifting pattern from top left all the way to bottom right. Example below
2.24    1.91    1.59    1.26    0.94    0.62    0.56  
1.69 1.44 1.20 0.96 0.71 0.47 0.42
1.36 1.16 0.96 0.77 0.57 0.38 0.34

If it's allowed to move diagonally, one solution might be
2.24 -> 1.91 -> 1.59 -> 1.26 -> 0.96 -> 0.94 -> 0.71 -> 0.62 -> 0.56 -> 0.42 -> 0.34

even though it would have unrealistic number of shifts. Any hints how to approach this problem?
>>
>>100192240
B, continuous flow state is important
>>100192414
What is optimal? Smallest deltas? It's a graph traversal problem.
>>
>>100192414
>optimal way to traverse a graph
just use A*, this is a well understood problem
of course to get optimal anything first you must devise a problem specific cost function so you know what you're actually optimising FOR
>>
>>100191504
how is array easier to read than []?
this is just stupid. it won't seriously harm anything but it doesn't really bring benefits either
>>
>explaining extremely simple concept
>make it hard to follow with deflections
normies are so tiresome
>>
Did Fibonacci anon ever obtain his numbers? Did he discover the secret to the universe?
>>
>>100192240
Write everything in web/noweb so that properly organized code leads to a properly organized paper.
>>
Starting a new job soon that is mainly C++ and Debian for the production environment. I've worked with C++ and Linux before but only personally. Any advice for production environments?
>>
>>100192125
why are you being so dramatic? that's literally trivial, why the fuck are you using regex in the first place? retards like you who abuse shit by throwing extremely heavy kitchen sinks at problems that are way below their weight class are the reason software today is grossly inefficient dogshit that requires a supercomputer to run
>>
>>100193295
find as many keys as possible and let no one know you have them so you can fix issues on the spot. don't worry, it's expected. plausible deniability
>>
File: neo.jpg (22 KB, 250x358)
22 KB
22 KB JPG
>>100191104
i look like this and say this
>>
>>100193266
No but I computed a 2mb file containing the 10 millionth fib number in 20 minutes on my computer
>>
how the fuck do I get this artifact (https://mvnrepository.com/artifact/org.webrtc/google-webrtc/) in android studio using gradle

in the gradle.settings I added
maven { url 'https://mvnrepository.com/artifact' }


in my build.gradle I added to the deps:
implementation 'org.webrtc:google-webrtc:1.0.+'


I get:
Could not GET 'https://mvnrepository.com/artifact/org/webrtc/google-webrtc/maven-metadata.xml'. Received status code 403 from server: Forbidden


which of course doesn't work because it's doing
artifact/org/webrtc
instead of
artifact/org.webrtc


help me out I'm fucktarded and first time trying android dev
>>
How do I call a REST API like a profishinal proGAMER? I will only be calling a single endpoint and I will provide a single parameter at the end of the URL (a simple ID for the entity I want to obtain).
A profishinal would want a client class that actually makes the HTTP call. Then the same (?) client will take the JSON and create an object (one-to-one with the JSON?) from the JSON. Then I will have a service class that provides the abstraction over the client that others can use to make the calls to the API. The server will also translate the JSON-object to a domain object that the rest of the system can understand. Am I on the right track?
>>
>>100193929
$Response = Invoke-WebRequest -URI https://www.bing.com/search?q=how+many+feet+in+a+mile
$Response.InputFields | Where-Object {
$_.name -like "* Value*"
} | Select-Object Name, Value
>>
>>100193929
This sounds like an AB problem. What you're really asking is how to achieve less in the same amount of time while maximising the business' dependency on you
>>
>>100193947
Get away from me, freak
>>100193950
Wrong. What I am asking is how I can get through code review as a junior when I will be reviewed by design pattern freaks that want 8 layers of abstractions, 13 files and 5000 lines of code instead of doing something in 200 lines of code in one file with a single layer of abstraction.
>>
>>100193927
Looks like that artifact is on a different repo:
<url>https://repo.spring.io/libs-release</url>
>>
>>100193929
The service and api client should be the same class, but object mapping can happen where it's consumed.
>>
>>100193980
Maybe your code reviewer is trying to help you stay employed and well paid? Try explaining to him you are autistic and want to actually complete the task assigned, this might bewilder and confuse him
>>
>>100193983
1. where did you pull that one from, how do you know
2. didn't work either, changed it to:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://repo.spring.io/libs-release' }
}
}


got once again the same problem:
Could not GET 'https://repo.spring.io/libs-release/org/webrtc/google-webrtc/maven-metadata.xml'. Received status code 401 from server: 
>>
>>100194013
See the repo column it says Spring Lib not maven central.
>>
>>100194030
oh yeah, ok thanks that helps
however I still don't know the proper way to add it to the settings.gradle
>>
>>100193295
Add subtle bugs and fix them when a bug ticket for them are made
>>
>>100194111
manufacturing bugs is not easy.
>>
>have to include default instances like constructor, copy constructor, move constructor, destructor, and some stor that I'm sure I've forgotten to every fucking type to not stumble over explicit behaviour
>memory management is an unmitigated mess with internal copies galore
>which directly affects the template system, which is about the only thing the language has going for it
>exceptions (and don't give me shit about muh branch prediction, a good compiler allows you to provide hints to make error branches cost nothing except the normal throughput and latency costs)
>people actively discourage the use of STL, hammering another nail into the coffin

Sooooo ... couldn't we just have improved C compiler optimisers, added a very simple template system, and called it a day? Why are people still using C++? Is it literally just deathly fear of memory?
>>
>Afraid to rewrite something I made 6 years ago because I might make it worse
welp
>>
>>100192462
>>100192525
Thank you Anons, time to study what this A* stuff is about
>>
>https://www.youtube.com/watch?v=yE5Tpp2BSGw&t=2000s
>"There are things I won't name that do telemetry at a level that would terrify you if you knew what was going on."

Any ideas what is it he doesn't name? TikTok et al?
>>
>>100194952
he's talking about languages innit
so probably something else
>>
File: fibonacci2M.jpg (100 KB, 678x466)
100 KB
100 KB JPG
>>100193477
2 million is the highest my computer can do within one minute, at least in Clojure.
>>
>>100194836
>Sooooo ... couldn't we just have improved C compiler optimisers, added a very simple template system, and called it a day? Why are people still using C++? Is it literally just deathly fear of memory?
Sunk cost.
That's literally it.
>>
>>100194836
Add non-destructive move being worse for performance and maintaining type invariants to that list.
>>
File: 1714160655390282.gif (1.1 MB, 378x396)
1.1 MB
1.1 MB GIF
Does anyone have a collection of imgui themes? Im looking for one that resembles the look of Newport cigs.
>>
How do I fix this?
time.Sleep(3 * time.Second)
>>
>>100195462
Giving up.
>>
>>100195462
i dont know much about memlangs but time Second sesms like a method...
time.sleep(time.Second(3))

where time.Secons probaboy returns the nanoseconds you want to sleep
>>
>>100191530
Thanks for this little distraction. Here's my time:
$ time ./fib
10047910021417012027

real 0m0.138s
user 0m0.134s
sys 0m0.001s

code:
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

#define len(arr) (sizeof(arr) / sizeof(arr[0]))

uint64_t fib(uint64_t n);
int ring_map(int index, int n);

int main(void) {
printf("%lu\n", fib(10000000));
return 0;
}

uint64_t fib(uint64_t n) {
uint64_t history[3] = {0, 1};
int i = 2, prev_1, prev_2;

if (n == 0)
return history[0];
if (n == 1)
return history[1];

while (n--) {
i = ring_map(i + 1, len(history));
prev_1 = ring_map(i - 1, (int)len(history));
prev_2 = ring_map(i - 2, (int)len(history));
history[i] = history[prev_1] + history[prev_2];
}

return history[i];
}

int ring_map(int index, int n) {
return ((index % n) + n) % n;
}


check my math
>>
>gcc (Debian 12.2.0-14) 12.2.0
let me guess...you need more?
>>
>>100193317
writing a clusterfuck BNF grammar is easier than typing -?\d+ to you? ok retard
>>
>>100195741
>He doesn't use GCC 4
NGMI
>>
>>100194952
>sometimes it's like keystroke level stuff
maybe Chromium?
>>
>>100195712
#include <stdint.h>
#include <stdio.h>

uint64_t fib(uint64_t n) {
uint64_t a = 0;
uint64_t b = 1;
uint64_t c = n;
while (n-- > 1) {
c = a + b;
a = b;
b = c;
}
return c;
}

int main() {
printf("%lu\n", fib(10000000));
return 0;
}

checks out
>>
>>100195934
while (n --> 1)
>>
>>100195971
damn I forgot about the going-to operator
>>
>>100195712
>>100195934
>uint64_t
how many times does this overflow?
>>
Hello,

I've been working on a file system browser and visualiser that's intended to give you an intuitive sense of what the usage of your space is, what's using the most space, etc, written in Tcl/Tk.

You can find it by looking up "folder size analysis" on the Tcler's wiki.

Kind regards,
dhr
>>
>>100196077
That's what I'm asking you
>>
File: fib10M.jpg (109 KB, 572x551)
109 KB
109 KB JPG
>>100196223
here's the actual number in case you want to do anything with it:
https://0x0.st/XHpk.txt

and here's my program, you can run it either in Babashka (slow) or regular clojure, but not clojurescript unless you get mfikes' branch with BigInt support:
(loop [x-1 1N, x-2 0N, n 10000000]
(if (zero? n)
(println (+ x-1 x-2))
(recur (+ x-1 x-2) x-1 (dec n))))
>>
If you anons had read your SICP, you would know that the nth fibonacci number can be computed in logarithmic time
#include <gmp.h>
#include <stdio.h>

mpz_t scratch1, scratch2;

void iter(mpz_t fib[3], unsigned long i) {
if (i == 1) return;
if (i % 2 == 0) {
mpz_mul(scratch1, fib[1], fib[1]);
mpz_add(scratch2, fib[0], fib[2]);
mpz_mul(fib[1], fib[1], scratch2);
mpz_mul(fib[0], fib[0], fib[0]);
mpz_add(fib[0], fib[0], scratch1);
mpz_mul(fib[2], fib[2], fib[2]);
mpz_add(fib[2], fib[2], scratch1);
iter(fib, i / 2);
} else {
iter(fib, i - 1);
mpz_add(scratch1, fib[0], fib[1]);
mpz_set(fib[2], fib[1]);
mpz_set(fib[1], fib[0]);
mpz_set(fib[0], scratch1);
}
}

int main() {
mpz_t fib[3];
mpz_init_set_ui(fib[0], 1);
mpz_init_set_ui(fib[1], 1);
mpz_init_set_ui(fib[2], 0);
mpz_init(scratch1);
mpz_init(scratch2);

iter(fib, 100000000);

printf("%s\n", mpz_get_str(NULL, 10, fib[0]));
return 0;
}

computes the 100 millionth fibonacci number (and prints it) in 4 seconds.
>>
>>100196742
whoops, the iter should be at the top of the first if. Actually takes 7 seconds lol
>>
>>100196742
Now do it in AVX.
>>
>>100196848
looks like you are seething
>>
File: vperm2i128_or_vpermq.png (15 KB, 622x856)
15 KB
15 KB PNG
>>100196893
Quite the contrary, I'm exhausted.
>>
>>100196742
nice. Yes, I should finally get around to reading SICP.
>>
>>100196083
Jurassic park
>>
>>100196585
>https://0x0.st/XHpk.txt
So we are now posting browser crashing links for fun huh? This isn't reddit bro
>>
>>100197149
Works for me, but my PC isn't shit. I'm not even running a pagefile!
>>
>>100196083
imagine being this smart, yet lacking common sense to see how prehistoric it looks
>>
>>100197149
>clicking on "0x0.st"
bruh, check dmesg and run for a fork right now.
>>
File: brave chads keep winning.jpg (1.56 MB, 1080x2143)
1.56 MB
1.56 MB JPG
>>100197149
get a better browser
>>
Somehow GO creators found a way to design a language in which you can neither write elegant functional code nor elegant object oriented code

And obviously you cannot write elegant procedural code either because the whole point of this language is to generate race conditions...
>>
>>100197232
>phoneposter thinks he is a chad
lol, lmao even
>>
>>100196585
966s in hasklel (16 min)
module Main (main) where

import Data.Time.Clock

fib n
| n <= 0 = 0
| n == 1 = 1
| otherwise = fib' n 0 1
where
fib' 1 _ !b = b
fib' n a !b = fib' (n - 1) b (a + b)

main :: IO ()
main = do
start <- getCurrentTime
writeFile "fibo.txt" $ show $ fib 10000000
end <- getCurrentTime
print $ diffUTCTime end start
>>
>people will engage in fibonacci contests
>a registry dumper is too much for them
The absolute state of /dpt.
>>
>>100197393
we need to help anon solve the mystery to stop him from spending 1 million dollars in cluster computing
>>
>>100197393
how do i write a registry dumper for linux?
>>
>>100197475
xxd ~/.config/dconf/user

make sure to post screenshots of it every 30 minutes
>>
>>100197409
In the golden days we would've convinced him to spend those 1 million dollars in cluster computing in the first place. You are beyond newfag.

>>100197475
Doesn't Wine come with its own registry?
>>
https://projecteuler.net/problem=44

Am I missing something, or is this badly phrased? The correct answer is the first number that matches their criteria, but the only way I can see to prove this is to run the program until two successive pentagonal numbers have a greater difference than the current min difference - which means checking over 1.8 million numbers, when you only need 2166 to find the answer.
>>
>>100197537
Envious?
>>
>>100197622
The sum of two consecutive pentagonal numbers is never a pentagonal number. There's probably some more math you can do to narrow the possibilities
>>
>>100197749
nvm this isnt true lol
>>
>>100191530
You could fix the console overflow by parsing the output into scientific notation.
>>
>>100189059
what is the point of python threading if the threads are blocking and dont actually run concurrently?
why not just use asyncio?
>>
>>100197880
Ease of implementation. Kernel-scheduled threads simplify the code because you no longer need asynchronicity to have parts of your program continue, but it's being bought in context switches.
>>
why would i bother freeing up any allocations if the operating system is just going to wipe my ass for me?
>>
>>100197844
the fibonacci schizo needs all the digits to enter pleroma
>>
>>100197933
Do you know if there's always a kernel that's going to wipe your ass for you? If so, go ahead.
>>
>>100197963
not my problem
>>
Im in the early stages of writing a python program that will be receiving a constant stream of data from a websocket connection and constantly update a table based on the newly received data

my question is: should I run the websocket connection and table updating sections of the program as seperate processes? I dont want the websocket connection to be blocked by the calculations performed to update the table
>>
>>100197972
Mine neither.
>>
>>100197984
That's what multiprocessing and ProcessPoolExecutor do.
Or use Go or whatever.
>>
What do people generally use on Windows for C projects? VS? VS Code?
>>
>>100198111
msys2 and mingw.
>>
>>100198111
visual studio unless you want a meme answer
>>
>>100198196
You are the meme answer.
>>
>>100198048
are you telling me I finally have an excuse to use Go?
>>
>>100198519
Anything with easy concurrency and a websocket package to import.
>>
>>100198519
you have an excuse to use any language that isn't shit at multithreading
>>
>>100197933
why bother with the OS when you could just have your runtime do it for you?
>>
>>100198196
How do Linux people compile it?
>>
File: 1702605499468764.png (11 KB, 596x101)
11 KB
11 KB PNG
HAHAHAHAHAHAHAHAH
>>
>>100198662
How do Linux people compile a C project for Windows? They write a CMakeLists.txt and hope for the best.
>>
>>100198983
>CMakeLists.txt
Why would I shoot myself in the head?
>>
>>100197393
What is a registry dumper?
>>
File: dump.png (89 KB, 1894x989)
89 KB
89 KB PNG
>>100199366
Something that dumps the Windows registry into a file - human-readable, alphanumerically sorted, with timestamps about the last write, containing all data present, and in less than 10 seconds.
>>
I'm currently debugging a matrix dfs bug.
>>100199397
Ah ok cool. I don't personally use windows.
>>
>>100192151
>he uses os-provided regex functions
>>
Those who say Rust compile time is the worst thing in the world have clearly never worked with a JVM/dotnet project.
>>
>>100199702
good morning sir
>>
>>100199709
Hello NEET
>>
>>100197622
this site have AIDS?
>>
>>100191174
tell that to people who had to create simdjson because entire world uses json and not a real data format
>>
>>100192097
the function called inside the loop requires lots of smaller allocations, not just one or two bigs ones, hence the arena allocator and my question. I'm precisely wondering how best to reuse the memory allocated to the arena. It feel wrongs to free/munmap every blocks of the arena at the end of an iteration just to reinitialize a new arena struct at the next iteration and requesting again blocks of memory
I think I'm gonna do it, there is only an extra conditional to do in the path where a new block is required.
>>
>>100200366
just use mmap and mremap, imagine unironically having linked list of memory lmao
>>
>>100200385
Idk it looks like a lazy solution and maybe expensive for the OS idk, my arena allocator is backed by a "page allocator" which (will) reuse OS pages. Besides it's a bit less thinking to reuse the arena allocator all over the place than to worry about how many gigabytes a piece of code needs in the worst case.
And is mmap/mremap is really that faster? If it's trumped out by the cost of the algorithm it seems useless.
>>
>>100200571
>writing something retarded is less thinking than letting OS do what it already does best
what
>>
File: syscalls.png (137 KB, 1670x730)
137 KB
137 KB PNG
>>100200571
mremap avoids having to perform a copy of the data in the mapping as the function can move the paging information onto other slot, but doing so requires kernel privileges, which require a mode switch, which is slow. On top of that mremap has to acquire a bunch of locks into the page table to perform the action, which can take quite some time.

There is a reason why userspace allocators like malloc don't like to trap into the kernel.
>>
>>100200729
>this low IQ post again
mmap 1GB of memory, double it if it's not enough, those 5 syscalls over runtime of your program won't kill performance, faggot
>>
>>100200777
No one cares about your brain damage, Zoomer.
>>
>>100200729
>mremap avoids having to copy shit over
so does the kernel have overhead in page translation or are you retarded?
>>
>>100200875
What?
>>
>>100200875
stop responding to the fake benchmark hex dumping schizo, you will never get anything faster than OS MMU if what you need is memory allocation, stop being fucking retarded, syscalls are a nothingburger, don't fucking allocate constantly in a hot loop and it won't ever be an issue, holy shit what's wrong with you fucking fizzbuzzers do you even have a brain?
>>
>>100200983
>fake benchmark
Lol
Lmao
>>
>benchmarks page faults and calls it memset
based retard
>>
>>100201028
And?
>>
>>100200588
>>100200729
mmm, on top of that if you're doing lots of small allocations, as is my case, the overhead of growing a single data structure by reallocating it doesn't exist, so that's a win for the arena allocator
>>
>>100201147
>doing lots of small allocations (that are fixed size and don't grow)
*as opposed to growing and reallocating a single data structure
>>
>>100201147
>>100201160
it's still better to mmap memory for your memory allocator and if you ever need to grow, it will still be more efficient to mremap that one arena than anything else you do
>>
>>100189059
No one can ever master regex https://www.youtube.com/watch?v=7nsE4MyqQf4
>>
^n[o|i]g+[u?|e+]rs?$
>>
>>100201181
Oh, *now* I understand your mad ravings. Sure, there's no real alternative to mremap, but it's still preferable to make sure that the function isn't called in the first place.
>>
>>100200978
it took me a while to get what i had meant but basically if the kernel could have a layer of abstraction over the pages it passes to the TLB then you could have page 1001 be seen as page 1004 and write to page 1005 where page 1002 and 1003 are occupied by other processes
>>
>>100201281
you fucking retarded nigger, you braindamaged gorilla, you worthless ape, there's no way to allocate memory without a syscall, it will be called anyway, no matter what allocator you use, you may aswell bypass shitty allocators like malloc and call mmap manually, you stupid worthless chimpanzee. You shouldn't program at all, kill yourself.
>>
>>100201317
yes there is, use the fuckings segments you have been given.
>>
>>100192013
This is one of the things LLM's actually manage to get right. The other thing I find they're good or
at least good enough at is SQL queries
>>
>>100201301
>if the kernel could have a layer of abstraction over the pages it passes to the TLB
The kernel is subject to address translations and the TLB just as much as userspace is. The best the kernel can do is flush the entire sucker: https://stackoverflow.com/questions/28384234/when-to-do-or-not-do-invlpg-mov-to-cr3-to-minimize-tlb-flushing
>>
>>100201181
oh I understand, you can also grow the backing buffer of a bump allocator with mremap, not only reallocating a big array, but that's the same exact thing from mremap's POV
alright, this could be an interesting alternative implementation at the very least
>>
>>100201224
>blue hair
>>
>>100201344
You can, but you shouldn't. Virtual address space is cheap, relocations are not.
>>
>>100201390
stop larping you retarded faggot, you don't write realtime code and never will in your pathetic worthless larper life
>>100201344
yeah what a revelation indeed, you fucking retard, that's literally what malloc does
>>
>>100201442
No one cares, zoomer.
>>
>>100189059
Regex is the bane of my existence.
>>
>>100201442
You seem mad over being terrible at communication.
>>
>>100201583
>hurr ur terrible at communication
shut the fuck up mindbroken tranny, go on github and copy generic arena implementation because you're too fucking retarded to implement your own
>>
>>100201592
You are the only mindbroken one here.
>>
>no u
I accept your concession, one day you will grow up and syscalls won't scare you.
>>
>mindbroken zoomer makes up his own narrative
And that's why no one cares.
>>
I miss times when trannies such as ITT were simply BTFO by Torvalds himself, now he's just a cuck like the rest.

https://lkml.org/lkml/2000/8/25/80
>>
>the zoomer is mad
>again
>>
daily humiliation ritual thread
>>
>>100201771
Too ambiguous. The zoomer might think he isn't meant.
>>
this is what lack of internal monologue looks like, this thread is shit
>>
>>100201224
>No one can ever master regex
stupid take and we talked about this same issue a year or so ago but it was for stackoverflow
the regex was intended to do mostly lexing logic, but of course the idiot who wrote it didn't get that (the regex was such a mess that he clearly incrementally adjusted it all over the place many times and didn't understand it) so the regex is doing backtracking all over the place for nothing while the pattern could be executed in basically linear time if wrote properly even on a backtracking regex engine

>be Primegean
>doesn't what a non-capturing group is
>gives advice about when to use regexes
>>
>>100189104
>>100192013
10000% this.
>t. used chatgpt to generate a regex expression and regex101 to validate it
>>
>>100192013
>>100201819
>just use AI to write logic rules, bro
niggerlicious
>>
>>100201844
seethe regextard, chatgpt made you lose your job and now you're mad, LOL
>hurr I'm a professional regex engineer
HAHAHAHAHAHAHA
>>
File: comfortable.png (24 KB, 1280x576)
24 KB
24 KB PNG
>>100201807
Yeah, this is what it's like for us.
>>
>>100201812
>when to use regex
never
>>
File: 915.png (1008 KB, 640x864)
1008 KB
1008 KB PNG
>>100201844
>used AI as god intended (as a tool to make my dev life easier)
>hurr niggerlicious
Enjoy pretending to be smart, I guess.
>>
>wonder about the Fibonacci from the previous thread
>have ChatGPT implement in Dlang
>think "Huh, neat. Now what if I asked it to do so on CUDA"?
>actually am a mathtard and have no idea about the concepts OR parallelism
>as suspected it did not work out with CUDA, but now I know how to compile CUDA kernels (don't have any idea what to use that for though, as said, mathtard)

Here's the dlang code for CPU:
import std.stdio;

// Function to compute Fibonacci numbers using memoization
ulong fib(ulong n, ulong[] memo) {
if (n <= 1) {
return n;
}
if (memo[n] != 0) {
return memo[n];
}
memo[n] = fib(n - 1, memo) + fib(n - 2, memo);
return memo[n];
}

void writeFibonacciToFile(string filename, ulong n) {
ulong[] memo = new ulong[n + 1]; // Memoization table
ulong[] fibonacciSequence;

// Precompute Fibonacci numbers using memoization
for (ulong i = 0; i <= n; ++i) {
fibonacciSequence ~= fib(i, memo);
}

// Write Fibonacci numbers to file with four columns
auto file = File(filename, "w");
foreach (i, value; fibonacciSequence) {
if (i % 4 == 0 && i != 0) {
file.writeln(); // Start new line after every four numbers
}
file.writefln("%20s", value); // Write each number with 20 character width
}
}

void main() {
const ulong n = 10000000;
writeFibonacciToFile("fibonacci.txt", n);
}


I wonder if it would even be possible to implement this on CUDA. From the little I understand it does not seem easy to parallelize.
>>
>>100201862
you think GPT won't generate regexes doing catastrophic backtracking? you can't know for sure, especially if you don't understand them and if the training data set contain billions of jeet-written regexes
if anything, all this incompetency will privilege the few competent guys left
>>100201896
cope, enjoy your shitty software
>>
>>100201983
if I am forced to write regex I'm going to deliberately make it suck for everyone and then leave my workplace without elaborating
>>
#include <iostream>

int main() {
int *p = new int(5);

delete p;

std::cout << *p << '\n';
}


>*deadnames memory*
>*compiles*
>*refuses to elaborate*
>*ships*
>>
File: 1710902656839475.jpg (173 KB, 1024x1024)
173 KB
173 KB JPG
>>100201991
Let's hope none of your coworkers is a stabby Jim who knows where you live.
>>
>>100202059
there's a landmine at my front door, climb through the third window on the eastern side to get in safely
>>
>>100202096
Nice try, but I'd simply use the most walked path.
>>
>>100201991
no worry, I'll just rewrite them from scratch
>>
>>100202124
I wrote a custom regex engine and it uses custom regex that doesn't work in any other engine, sorry little man
>>
>>100202146
then I'll use my (soon to be) parser engine or any "parser generator" and it'll work (because generally you can use a proper parser instead of a regex, unless maybe if the regex is dirty, parsing-wise, and use weird lookarounds and stuff like that)
but please tell me everything you'd like to share about your custom regex engine, that's very good stuff anon
>>
>>100201991
based
>>
>>100189059
Should I learn C++ or Rust for quick system prototyping?
>>
>>100202513
Python
>>
>>100202522
I am not a pajeet like you.
>>
>learning a new library
>following tutorial
>example code throws an error
why is this so common
>>
>>100202003
Would it be delete p; or delete[] p; ?
>>
>>100189059
Regex is just lambda calculus with syntactic crutches.
>>
>>100202658
... why is there even a difference between the two? Did Stroustrup have yet another conniption and decided that delete needed to be more complicated than free so that people would take C++ more seriously?
>>
>>100195934
Your code is invalid. You assume that long unsigned is uint64_t. That's not always true. You won't pass my code review.

TLTR: learn to code kiddo
>>
Oh no.
Anyway.
>>
>>100203027
>C is so shit it's somehow a problem to even print a number without causing a memory bug
>>
>>100203027
the problem is that he is using printf
>>
>>100203027
>You assume that long unsigned is uint64_t
what fucking format are you supposed to use then? it's not like here this %d8 %d16 %d32 %d64 and %u8, %u16, %u32, %u64
>>
>>100203234
*there is
>>
>>100203234
>>100203247
printf("%" PRIu64 "\n", x);


Cniles will defend this.
>>
>>100203269
fucking useless
$ cat test.c
#include <inttypes.h>
int main() {
PRIu64
}
$ gcc -E test.c | tail
# 2 "test.c" 2

# 2 "test.c"
int main() {

# 3 "test.c" 3 4
"l" "u"

# 4 "test.c"
}
>>
>>100203234
Welcome to hell.
>>
>>100203310
retard
>>
>>100189059
>tfw finally getting confident with vulkan again
feels kinda nice lads, ngl
>>
>>100203269
Proudly so, and there's nothing you can do about it.
>>
>>100201973
a recursive algo like that don't really work on the GPU no
you can't really do a normal reduction
>don't have any idea what to use that for though
bulk data or bulk compute
heavily pipelined shit
lots of small problems or problems that can be broken down into smaller problems
large matrix multiplication is the classical thing
>>
File: e47.jpg (38 KB, 1014x405)
38 KB
38 KB JPG
Are these retards aware that 2 and 2 are actually the same number?
>>
>>100197173
faggot nigger retard
>>
>>100203736
anon...
>>
>zoomer is mindbroken again
>>
>>100203770
644 and 646 objectively DO NOT have 3 distinct prime factors
>>
>>100203830
You don't understand the problem, but for your defense it's poorly formulated.
A number is said to have K distinct factors if the cardinal of the set of its prime factors is K.
set_of_prime_factors(644)={2,7,23}. It's a set of cardinal 3.
set_of_prime_factors(646)={2,17,19}. It's a set of cardinal 3.
>>
>>100195712
>>100197844
I fixed it by just writing the entire number into a text file
Say, how do I embed code on 4chan? I'm down to post my code
>>
>>100195712
>lowercase macro
Directly into the trash. You failed kiddo.
>>
File: anything.png (589 KB, 541x677)
589 KB
589 KB PNG
>implying anyone cares about his overinflated opinion
>>
How the hell do I get a std::future<std::string> out of this function?

afaik you need a promise type to begin with, and the promise type must outlive or have the same lifetime as the future type, right?

I just want to use this boost.process (really boost.asio) async_read_some() code to retrieve a future string value.

auto ReadSomeProcess(sds::Proc::ProcInfo& proc, std::promise<std::string>& aFutureString)
{
proc.ErrInStream.async_read_some(
asio::buffer(proc.ErrInStreamBuffer.data(), proc.ErrInStreamBuffer.size() - 1),
[&](boost::system::error_code ec, std::size_t length)
{
const bool isEof = ec == asio::error::eof;
const bool isError = !ec;
const bool doErrorMessage = isError ^ (!isEof && isError);
std::promise<std::string> prom;

if (doErrorMessage)
{
std::cerr << ec.message() << '\n';
}

assert(length > 0);

prom.set_value(std::string(proc.ErrInStreamBuffer.data(), length));
});
}
>>
>>100204073
But of course, calling the function must be async still, no blocking waits to retrieve the value.
>>
>>100204073
As a cnile this looks so fucking painful.
>>
>>100204073
I would point out, the lambda function code there is done AFTER the read is completed and the ErrInStreamBuffer has the data.

But I don't know when that will be, so I can't just return a string.
>>
>>100204129
yeah I'm pretty sure that XOR is unnecessary, but asio is fucking complicated.

I have a semi-synchronous server working, it uses around 786kb of memory in release build, closer to 1mb in debug. It would probably serve a billion retards image-board stuff if required to--but still has the functionality of asio.
>>
>>100204164
>it uses around 786kb of memory in release build
So you're not using memory pools? Yikes.
>>
>>100204190
It's going to be running locally and serving to interact with other local servers, but will provide me some external control, just a way to combine their IO all together for a result.

>feed voice message to home server
>speech to text server
>sent to LLM server
>result sent to text to speech server
>audio file sent back over the internet to me dicking around at work
>>
File: paredit_assert.webm (107 KB, 648x364)
107 KB
107 KB WEBM
>>100199702
Clojure has interactive REPL integration and hot reload, so JVM compilation time is almost irrelevant to me
>>
>>100204215
the real time recording and evaluation of if it should respond would be the annoying part, I will probably just make it transactional, like press a button to record a message and send it.
>>
>>100204215
>It's going to be running locally and serving to interact with other local servers
Which has nothing to do with the previous statement, which is that for a supposedly "billion retards image-board" it doesn't preallocate a memory pool. How many connections do you support per kernel thread?
>>
>>100204259
I don't give a fuck what stupid bullshit you're talking about, I have a real question up above.
>>
>>100203924
Anyone? Does it automatically format my post when I slam the code in here?
>>
>>100204286
{code} and {/code} but with [ ]
>>
>>100204279
And I don't care about your question. Your entire design sounds like a gargantuan clusterfuck, and you deserve every braincell you're losing over not throwing it all away.
>>
>>100204296
Love you man

internal class Program
{
static void Main(string[] args)
{
//Test run
for (int i = 1; i < 10; i++)
{
Console.WriteLine($"{i}th fib number is {Fib(i)}");
}

File.WriteAllText("Fib10000000.txt", Fib(10000000).ToString());
Console.WriteLine("Done!");
}

//Perhaps inlining the entire method into the Main function improves the speed, but who gives a fuck
public static BigInteger Fib(int n)
{
if (n < 2) return n;
BigInteger bottom = BigInteger.Zero;
BigInteger top = BigInteger.One;
for (int i = 2; i <= n; i++)
{
//One could make an argument for efficiency here, but the time required for modulo operations pales in comparison to the BigInt operations
if (i % 10000 == 0) Console.WriteLine($"Currently at {i}/{n}");
BigInteger intermediate = top; //Make a copy of Fib(n-1)
top += bottom; //Fib(n) = Fib(n-1) + Fib(n-2)
bottom = intermediate; //Fib(n-1) is Fib(n-2) in the next step
}
return top;
}
}


I can also upload the file somewhere (it's too big for pastebin), but all the filesharing sites I found auto-delete it after a few hours, it's actually not the same number that >>100196585 got
>>
>>100204332
>One could make an argument for efficiency here, but the time required for modulo operations pales in comparison to the BigInt operations
you could do something like "if (i &1023 == 0)" to sidestep the performance issue, bitwise ops are fast.
>it's actually not the same number that >>100196585 # got
might be an off-by-one thing, check if the 9,999,999th or 10,000,001th is the same
>>
>>100204073
The promise only needs to exist for as long as the promise is unfulfilled, once it has been fulfilled it can be destroyed, and the future will still be able to access the value. Use a shared_ptr captured by value by the lambda to create a promise which can stay alive until the callback has been completed:

auto ReadSomeProcess(sds::Proc::ProcInfo& proc, std::promise<std::string>& aFutureString)
{
auto promise = std::make_shared<std::promise<std::string>>();
proc.ErrInStream.async_read_some(
asio::buffer(proc.ErrInStreamBuffer.data(), proc.ErrInStreamBuffer.size() - 1),
[&, promise](boost::system::error_code ec, std::size_t length)
{
const bool isEof = ec == asio::error::eof;
const bool isError = !ec;
const bool doErrorMessage = isError ^ (!isEof && isError);

if (doErrorMessage)
{
std::cerr << ec.message() << '\n';
}

assert(length > 0);

promise.set_value(std::string(proc.ErrInStreamBuffer.data(), length));
});
return promise->get_future();
}
>>
>>100204482
>you could do something like "if (i &1023 == 0)" to sidestep the performance issue, bitwise ops are fast.
Yeah, there's probably room to optimize it, but when I checked it with VS' built-in profiler, it was like 0.03% of the program's execution time, so not really worth optimizing

>might be an off-by-one thing, check if the 9,999,999th or 10,000,001th is the same
Probably, but then I'd have to rerun the whole thing again...
But based off the test run up to 10 and another test run I did (comparing my 500th number with https://www.calculatorsoup.com/calculators/discretemathematics/fibonacci-calculator.php), I'd say mine is accurate
>>
>>100204533
I meant promise->set_value not promise.set_value
>>
>>100204533
>>100204576
11/10 effort, thanks anon
>>
>>100204533
What abomination is this?
>>
>>100204482
>might be an off-by-one thing
off-by-two actually. If you change the code in >>100196585 to start at n=12 then it will generate what https://www.calculatorsoup.com/calculators/discretemathematics/fibonacci-calculator.php says is the 10th fibonacci number
>>
>>100202544
stop being an arrogant fag and use the right tool for the job
>>
>>100204670
highly performant and flexible networking stuff in most cases, but this one is just interacting with local processes via boos.process pipes instead of over sockets.

using IPs = bp::async_pipe;

// Spawns a child process and redirects the IO streams to the data members.
struct ProcInfo
{
static constexpr std::size_t PipeBufferSize{ 1024 };
std::array<char, PipeBufferSize> InStreamBuffer{};
std::array<char, PipeBufferSize> OutStreamBuffer{};
std::array<char, PipeBufferSize> ErrInStreamBuffer{};

IPs InStream;
IPs OutStream;
IPs ErrInStream;
bp::child ProcHandle;

// Opens a process, with args, and subverts stdin, stdout, stderr to async_pipe streams.
ProcInfo(asio::io_context& ios, const auto& filename, const auto& args)
: InStream(ios),
OutStream(ios),
ErrInStream(ios),
ProcHandle(bp::child(filename, args, bp::std_out > InStream, bp::std_in < OutStream, bp::std_err > ErrInStream))
{
}
};


Note there are different ways to spawn a process with the stdio streams subverted, this approach is the child process approach so it dies with your exe when necessary.
>>
>>100204783
>highly performant
Fucking lie.
>>
File: x_marks_the_spot.jpg (69 KB, 527x360)
69 KB
69 KB JPG
Hey guys, I have a noob question. How would I be able to interpret a text file into a "grid" in order to implement graph algorithms like Dijkstra and A* on it? Or is there a better way to perform this task. This is the text file if you are curious: https://pastebin.com/T65rrnUV . I am trying to find the shortest valid path from the circle("0") to the goal("X").
>>
>>100204814
name a better one, and link benchmarks

nigger
>>
>>100204828
You have to write what is known in programming parlance as a "parser".
>>
>>100204865
I see, so would parsing the text file into a 2d array be sufficient? Or is that too dumb?
>>
>>100204856
>my program is doing all sorts of BS
>but that literally doesn't matter if you can't name a better alternative
No, not gonna feed your mental illness, retard. If you need to spawn processes or allocate memory it's not high-performance, end of story.
>>
>>100204886
are you too autistic to even read my post?

>in most cases
>but this one is just
>local processes via ... pipes instead of over sockets
>>
>>100204884
You should parse it into whatever is most easily operated on by your algorithms.
>>
>>100204908
Are you too autistic to read my post? Your qualifiers do not matter unless your "other networking stuff" doesn't spawn processes for new connections, doesn't (re)allocate (old as) new memory, and uses shared mappings (or threads in the same address space, for improved TLB usage) instead of pipes or sockets for communication. No amount of "in most cases" or "this one is just" is going to save your "other networking stuff" from such broken architectures.
>>
>>100204948
Sounds good, thanks anon.
>>
Should I learn Scala? I already know some Haskell.
>>
>>100205131
No. Learn OCaml.
>>
>>100192462
>B, continuous flow state is important
right. i'm retarded for overthinking about this for the last few months.
i had 5 months to work but now i only have 45 days left, and i've yet to actually code the app, and i've wrote only 29 pages so far. my target is somewhere 70-80
>>
>>100194836
the exception construct and its consequences have been a disaster for programming
>>
>>100205170
I had to learn SML for uni and it sucked ass.
>>
>>100204783
The ProcInfo constructor is not handling errors. If the child process fails to start, bp::child will throw an exception, which is not caught in the constructor. You should add error handling code to the constructor to handle this case. You are retarded and should stay away from programming.
>>
I want to support both an immediate mode graphics API (OpenGL 1.x) and a modern shader/vbo-based one (OpenGL 3.x/4.x). I know I should just support the latter, but screw that -- I want to support OpenGL 1.1 for shits and giggles.
I also want to develop a low level graphics api abstraction to make thing easier. Problem is, I can't decide how I should structure the abstraction. Should it be immediate mode like classic GL (thus meaning no shaders for modern retained mode implementations), retained/shader-based mode like modern GL (thus meaning possible overhead for the GL1 backend on old platforms or w/e), or should I have a separate immediate mode api and retained mode api that my high level renderer will have to pick and choose support for its various features in either api type?
Basically these are the options tl;dr:
>Immediate mode api that wraps around GL1 like a breeze but limits GL3
>Retained mode api that will allow shaders and stuff for GL3 but be ass to implement on GL1 and possibly introduce overhead
>Split API into immediate and retained apis
>>
>>100205715
Actually, now that I think about it, an abstraction split into an "immediate mode" frontend for immediate mode graphics apis and a "retained mode" frontend for modern apis might be the best option. And like I said, the high level renderer/scenegraph will handle the detecting and usage of those low level abstractions anyways.
>>
>>100205715
>modern APIs
>OpenGL
just slam opengl in legacy compat mode if you want to support that trash
an abstraction over opengl and actually modern APIs like vulkan and/or an hand-rolled rasterizer in some kind of compute language/SIMD for GPU-less platforms would make more sense than supporting the execution model and interface of black box cards that literally don't exist anymore
>>
>>100204697
>off-by-two
nope, just off by one. Here's a version that spits out the same numbers as that website:
(defn fib
([n] (fib (dec n) 1N 0N))
([n a b] (if (zero? n) a (recur (dec n) (+ a b) a))))

(println (fib 100))
>>
>>100205999
>that trash
whoops that came off wrong, i specifically meant opengl 1.1/pre-shader opengl there
nothing wrong with using 3.x+ mind, it's important for learning graphics programming

but pre-shader opengl hardware literally does not exist anymore
GPU-less or extremely low performance GPU hardware uses the bare minimum vulkan compute model
>>
>>100206067
But what if I hypothetically want to port to old platforms (again, just for fun) that use gpus that require a GL version of 1.x? Like say, the wii or dreamcast or some shit? Should I instead just try using such a platform's SDK's own graphics api that OpenGL usually wraps around?
>>
redpill me on Effective Modern C++ by meyers.
I'm applying to modern C++ positions and trying not to embarrass myself during interviews, I have a couple years experience as a python/C++ dev but mainly I work in scientific computing.
>>
>>100206089
yea probably weren't they expected to back in the day anyways? i thought console graphics hardware was normally fucking weird, wasn't it? my only reference for consoles is some bits in a book by one of the old naughty dog devs i think
i can't imagine that mapping that well though especially early versions of opengl which were not meant for games

also, i think even the wii had some form of shaders, i tried looking and it seems like it might've only had pixel shaders
>>
>>100201973
The naive fibonacci recursion is not parallelizable.
https://www.nayuki.io/page/fast-fibonacci-algorithms
You can do the matrix exponentiation in CUDA.
The actual problem is that what you need to parallelize is not the matrix operations but the bignum library you use.
>>
>>100196083
Pretty cool.

>>100197173
Tk supports theming.
He wants it to look like that.
>>
>>100206145
I would say that it's probably about 30% of what every C++ programmer should know about the language, remember it doesn't teach you anything about algorithms or data structures. And I wouldn't consider somebody proficient in C++ if they couldn't recite the main points of every chapter given just the table of contents. The book is 10 years old and 99% of it is still relevant, there is absolutely no excuse to not basically have the book memorized by this point.
>>
File: leaks.jpg (149 KB, 1468x778)
149 KB
149 KB JPG
I'm doing Vulkan Tutorial on loonix. Something seems to be leaking, probably in the driver. Is this fine?
>>
>>100205634
throwing constructors is the right answer, you don't want partially constructed objects...

you don't know C++
>>
File: clowniumg.png (1.29 MB, 1920x1200)
1.29 MB
1.29 MB PNG
Working on my LLM client
It can describe images but this model is not very accurate
Although there's better heavier models for this available
But I mostly just use text mode models to ask questions.
>>
>>100196083
#    o--------------------------------o
# | The 'Boxes' view display mode. |
# o--------------------------------o
...
# o------------------------------------o
# | The 'Pie chart' view display mode. |
# o------------------------------------o

It's not "boxes" it's a treemap.
>>
>>100207219
#include <stdio.h>

int main(){

printf("Hello World!");

return 0;
}


Now what...
>>
>>100207128
nice anon, is the backend usable via stdio pipes/streams or a REST server?
>>
File: whatusigluith.png (726 KB, 1920x1200)
726 KB
726 KB PNG
>>100207315
There are multiple ways to communicate with it.
1) Through the interface
2) Through the console on the terminal where it is launched
3) By enabling a listener that checks a file every 500ms to read from
4) By piping to it at startup
5) By using an argument at startup

Pic related shows the console/terminal which allows input and commands, with autocomplete capabilities.
>>
I'm bored. Installed Guile and setup vim for moar bells and whistles. Gonna start going through guile manual, wish me luck.
>>
>>100204073
c++ is not even programming lmao
>>
It's time for me to not suck at programming.
Now, I am going to learn C++ proper.

I've written javascript, python, go, java, c#, and tried dozens more.
The languages I like the most are the ones with great standard tools for building and including dependencies. Ease of development.

What package manager/build system to use?
>>
>>100208761
>tried dozens
recognize that you wasted a bunch of you time, move on to C and then write C in C++ but with some libraries in bigger projects (you dont need to do that, it is just common)
>>
My bf recently lost his electrician job, what is a good language for him to learn and get a good job?
>>
>>100209370
Spanish probably. Seen a lot of jobs require that now in the US
>>
>>100209370
I dont like women so i hope he does not get a job and you are forced to go and get fucked by strangers to put food on the table.
>>
>>100189059
>>
>>100209533
k neet
>>
File: IYKYK.jpg (89 KB, 1200x675)
89 KB
89 KB JPG
>>100189059
>>100209538
Forgot pic
>>
File: fast fibonacci.jpg (122 KB, 567x828)
122 KB
122 KB JPG
>>100206385
interesting site. I've implemented one of the algorithms and it's obviously a lot faster now.

Here's Fibonacci number 100 million btw in case the schizo or anyone else still wants to look at it:
https://0x0.st/XHvd.txt
>>
>those clients are still waiting for their 10gig drive to be backed up
what the hell do they even need that big of a drive for?
>>
File: 1711791250109248.gif (1.93 MB, 350x350)
1.93 MB
1.93 MB GIF
is there an IDE I can use with C# that isn't fucking Visual Studio?
>>
>>100210359
visual studio code
>>
>>100204969
>broken architecture because it can only handle 1 million connections instead of 1.5 million
who cares, just spawn another process and put it behind a load balancer
>>
>>100210359
I think your only options are jetbrains rider (which is prob the best), then monodevlop or vscode
>>
Realistically how long can I get away with plain text passwords? My website is very tiny, I only have 97 users.
>>
>>100210359
you could try emacs with https://www.spacemacs.org/layers/+lang/csharp/README.html but I wouldn't get my hopes up for it being a better experience than VS

>>100210723
just encrypt it already, it's not hard
>>
>>100210526
Try more like 10000 vs 60000.
>>
This question stems from a disagreement I had with my tech lead. Let's say I have a Person class in c#:
public class Person {
public string firstName;
public string lastName;
List<Address> addresses;
}

where the Address class is just:
public class Address {
public string city;
public string country;
}


These Person objects are persisted in a mongo collection called 'people', and there are no other collections. I then create a PersonController with an endpoint to add a new address to a Person. Should that endpoint be a HTTP PATCH, because i'm updating a Person, or POST because I'm creating a new Address object? I'm assuming the answer is PATCH because the resource is the type 'person'.

But does the answer change if I was using SQL and had two tables - a Person table and Address table? Then adding a new address would be creating a new entity in a table and linking it to a person entity. Does that now make it a POST? If yes, does it not seem wrong that my REST API should change if I switch database technologies? Shouldn't something like that be invisible to a consumer of my API?
>>
>>100210811
>patch or post
put
>>
>>100210756
>just encrypt it already, it's not hard

any tips then? can I do that with HTML?
>>
>>100210811
The answer is simple, Person should be a struct that embeds the Address struct.
>>
>>100210880
You encrypt them when you store them. That has nothing to do with HTML.
>>
>>100210847
but the endpoint only adds an address, it doesn't replace an entire person resource. or are you saying that's what the endpoint should do? is it right to expect a client to have to have to include all the other crap in the request body when all they want to do is simply add an address? i've simplified my example, our 'person' is actually quite a large object
>>
why are front end devs allergic to ordered arrays?
>>
>>100210995
POST /person with { firstName : x, lastName : y, addresses : [{ city : c, country : cc }] }
GET /person for all persons with all info
GET /person?firstName=x&lastName=y for a specific person
PUT /person?firstName=x&lastName=y to update it, if you send { firstName : newx } you only update that, and yes, this implies the client needs to resend the full address list, this is good if the client wants to do multiple address changes

If you want granular access:
POST /person;firstName=x&lastName=y/address with { city : c, country : cc }
DELETE /person;firstName=x&lastName=y/address with { city : c, country : cc }
>>
>>100210811
>But does the answer change if I was using SQL and had two tables - a Person table and Address table?
Also, REST resources are not OOP objects or database entities, the concept is implementation agnostic.
>>
>tfw can write software to run on my SteamDeck because it's just a linux laptop with a controller and touch pads built in
>>
>2024
>C++ still doesn't let you do the most basic of things
std::array<int, 2> arr = {
[0] = 1,
[1] = 55
};
>>
>>100211921
And that's a good thing, just to make you mad.
>>
File: sicp snake.png (27 KB, 666x768)
27 KB
27 KB PNG
>>
>unions existing
>instead of byte indexing in arrays
Look, why is it that we do this
int ar[3];
ar[2] = INTEGER;

instead of this
int ar[int*3];
ar[int*3] = INTEGER;

when the latter allows you do unaligned stuff?
But forget the unaligned stuff, that is stupid and slow, what about doing the upper 4 bytes of a uint64_t array entry as a uint32_t?
unions are cancer.
>>
oopsie seggie
>>
>>100212287
>>100212287
>>100212287



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.