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

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1775604739786667.jpg (181 KB, 2133x1200)
181 KB
181 KB JPG
What are you working on, /g/?

Previous: >>108540878
>>
i++
>>
>>108561847
i = i + 1
>>
pee pee = poo poo +penis.
>>
>>108561940
INC $FB
>>
File: file.png (61 KB, 225x225)
61 KB
61 KB PNG
abandon c, use freepascal
>>
File: 1755949419937218.png (127 KB, 460x312)
127 KB
127 KB PNG
CPP = C Plus Power
>>
>>108562136
Sorry pisswolf, not interested.
>>
>>108561805
I'm learning discrete math since I heard it's used with programming. I have basic programming experience, and so far barely seeing any similarities outside of logic.

Are these stupid fucking digraphs important?
>>
manual coding is boomercoded
>>
File: daddy cool.gif (3 KB, 348x279)
3 KB
3 KB GIF
Honest question, if I use claude code on a codebase that has a lot of slurs in the comments, will I get banned or will claude refuse to work with me? I'm considering showing claude my personal project which is quite large, and there are a lot of politically incorrect comments like for example "// workaround for gay Windows bug, fucking M$ diversity hire niggers..." and so on.
>>
>start a project
>something interesting comes up in the middle of it
>goto 10
>>
>>108561805
I’ve been messing around seeing if I enjoy coding. Now it’s time to make another project but I don’t even have any ideas that strongly attract me. I guess I’ll just make Snake or a Sudoku solver or something.
>>
>>108562379
I have a hard time just achieving the first part
>>
File: superc.png (496 KB, 708x460)
496 KB
496 KB PNG
>>108562142
now I want to invent a new programming language
>>
File: 1771448611664555.png (243 KB, 654x527)
243 KB
243 KB PNG
I just want an ai that can teach me how to program real good not one that programs for me
>>
>>108562789
>teach me how
ngmi
>>
>>108562789
It's called a book. Read a book.
>>
>>108562789
dear diary
today frogposter was based again
also he's kind of cute
>>
#ifndef UNICODE
#define UNICODE
#endif

I mean, is the conditional really necessary?
>>
>>108563032
Safety first.
>>
>>108563032
you're supposed to place code between the defne and endif with the conditional only including that code once
>>
>>108563032
Header guards are a strange concept
>>
>>108563032
Maybe you already included some library that for some reason defined UNICODE as having some specific value and you don't want to just blindly redefine it? I would hope most library authors wouldn't be that retarded, but you never know.
>>
>>108562789
Just learn assembly.

>>108562756
Input sourcing is asking the question *where* your parameters are coming from - which becomes really important the moment you're dealing with NUL-terminated strings because the strings you're feeding to your functions may not be NUL-terminated at all. They may be part of other strings, part of read-only data, part of some network data (say, HTTP) ...

If you want to use such strings without out-of-band data (i.e. string length parameter) you have to do it in-band (i.e terminate them yourself).
To terminate them you first have to allocate memory (or have some scratch memory ready), copy the string from source to target (hope you're not evicting your caches), terminate the string, pass it to the function that only expects terminated strings, and then release the memory again (or keep it around for future use).

... whereas with out-of-band signalling all you need to do is have a pointer point to the data and tell the function how many bytes you want read.
>>
#include <winsdkver.h>
#define _WIN32_WINNT 0x0A00
#include <sdkddkver.h>

>VCR101: Macro can be converted to constexpr
It literally can't though. Is there a way to suppress these 1-off editor warnings in Visual Studio or do you just ignore the squiggly lines? I know you can globally suppress them with a pragma, but that sounds bad.
>>
>>108563229
if the warning doesn't show up when you compile then it's not a real warning
>>
>>108562136
actually BASED
>>
>>108563222
>Just learn assembly.
NTA, got any recs for learning resources? I'm tired of being a high level midwit.
>>
>>108563303
https://uops.info/table.html
https://learn.microsoft.com/en-us/cpp/build/x64-software-conventions?view=msvc-170
https://agner.org/optimize/optimizing_assembly.pdf
Ghidra or IDA or both.
x64dbg.
>>
>>108563288
>>108563229
Yes but the VCR warnings are garbage. I get similar warnings when using gMock macros. The real issue is the 100s of fake warnings mask the few true warnings that you want to see.
>>
>>108561805
image search is completed but it's too powerful to make public or host publicly
>>
>>108562789
Mythos can do it but it's too powerful for you.
>>
>>108563303
Pick a function you're curious about, paste it in Godbolt and try to understand how the compiler optimizes it.
>>
>>108561805
How do you guys inspired yourself to code something?
At this point, I don't code, I just chatGPT it for my work 99% of the time. so like at this point I'm not even a "programmer" anymore. it's suck.
any books?
>>
>>108563222
>Input sourcing is asking the question *where* your parameters are coming from.
The only time I have ever had to deal with non-null terminated strings is when I am parsing strings.
But the thing is that the memory is usually already copied. If I use rapidjson, it has it's own stack buffer for everything. And it supports in-situ parsing (destroys the string), but printing errors is nice, and that's the main reason I don't destroy the string (but if it's a file, I can just read it again).
I don't trust hand parsing because rapidjson has embarrassed me with my own binary parser (I wrote a json/binary wrapper, but rapidjson was so fast, it made the binary parser pointless, my binary parser WAS faster and 1000x smaller, but not fast enough for me to be happy with, I might as well use flatbuffers or zpp::bits, AND I was using rapidjson in a very non-optimal way where every single variable would store it's location for rich debugging info, so it would have probably been even closer in performance if I just used it raw).
So if you use a library for parsing known formats, null termination isn't an issue, since all formats will give you null terminated strings for you (either on a stack, or in-situ).
>>
>>108563566
>But the thing is that the memory is usually already copied.
Cool, so let's just copy it *again*, because, y'know, cache invalidation and locality ain't real!

>rapidjson was so fast
Have you looked at *why*?
>>
>>108563525
ikr you're forced into AI, and if even if you try to get it to teach you or debug things for you it'll just write everything for you. Feels like the parallels that CAM manufacturing had back in the day.
>>
>>108563587
>*why*?
{"test":[0,1,2,3,4]}
was not that slow compared to
(error check) 4bytes (error check) 4 bytes (etc)
I'm not saying that my code was super slow, I think my code was at least 2-10x faster, but that's not acceptable when I wrote RJ to be SUPER SLOW. I don't even want to talk about how much time I wasted trying to make the error messages super pretty and accurate to match the exact line column of the file.
The whole parser was thrown out at the end because the API was too flimsy and not retard-proof enough. I can't store generic arrays of elements, I needed to set the size and do that weird IsReader/IsWriter logic so parsing is done in one function, but it's just not worth it (even if I split the function).
But I know that rapidjson will get 100x slower the second I start using more identifiers / objects instead of one big array. The binary parser would ignore identifiers (the identifier is just a sanity check for json).
>>
working on my chess website

based.mobi
>>
>>108563650
OH, I just remembered that rapidjson does not use null terminated strings, because I was not using the normal API (I need to use callbacks to get the errors in the correct location). If you used it normally you would get null terminated strings. And the normal API uses a hash lookup I think, like a normal json API (You can't actually modify the json files in an editor, it's basically binary with redundant sizes, I wanted to use it as a pretty way of printing the binary data).
But I could have implemented rapidjson as a pseudo binary format, just a big json array, and it would have been fine in terms of performance.
but there are better ways.
>>
>>108562109
>being able to directly increment a memory address
>>
>>108563834
http://6502.org/users/obelisk/6502/reference.html#INC
>>
>AI constantly going back and forth on whether or not CS_OWNDC is beneficial for a DX12 application
absolutely fucking useless slopbots
>>
>>108563407
Clicked the first link and don't know what the fuck I'm looking at
>>
>>108563867
DX12 uses DXGI, not GDI. You only need an HWND, not an HDC - and as such an independent DC is superfluous.

>>108563883
Instruction table telling you how many cycles certain instructions take on different CPUs. Makes you appreciate certain optimizations more (like using LEAs instead of MULs).
>>
>>108563932
>DX12 uses DXGI, not GDI. You only need an HWND, not an HDC - and as such an independent DC is superfluous.
yet google results is full of people saying it's still relevant in dx12 regardless of whether you're using gdi or not
>>
>>108563980
What's the rationale supposed to be? It only helps speeding up GetDC and ReleaseDC calls (by not doing anything). If you're that worried, hook these two functions, then see how many times they're actually called.
>>
boy, I sure am glad that we got rid of those hideous = signs in c++ and replaced them for more braces!
>>
>>108563525
Shiiiiiet, I dunno, like employment and shiet.
>>
>>108563834
I like my code beautiful. If you get out of ring 0, it's not beautiful anymore. Don't get greedy
https://www.youtube.com/watch?v=mWNd2EubXVk
>>
>trying to understand a project on github
>not sure where it's getting access to a function
>literally 14 layers deep header included into a header included into a header etc...
is this normal?
>>
>>108564424
Yes, 95% of all code is shit.
>>
>>108564424
If it's included then it's included. Why do you care where it's included? If you want to see the function you can just grep it or use your IDE's search features.
>>
>>108563525
How much do you *actually* know what's executed on the machine? What the actual processor instructions are?
>>
>>108563525
>inspired
Your thoughts might inspire you or spark interest. But the act of starting to code can only be done by pure force. You have to force yourself to do it. Doesn't matter if you want to or not.
If you don't force yourself, it's not happening. Joy comes from the act of doing it. Not from the thought of the act
>>
>>108563525
I like making things myself.
No point using LLMs to do what you like.
>>
File: bluray.jpg (31 KB, 1000x424)
31 KB
31 KB JPG
It's the same shit every fucking day.
> Start to kode happily
> Hit a not obvious bug
> Get lazy and spiral around
> Get annoyed by AI and search for the bug myself
> AI was on the wrong fucking path all the time.

last prooompt:
> I found the bug and it was really easy to solve. Very easy. The easiest bug. Tremendous bug. Great bug.
> Now it's your time to shine and prove me that AI ain't trash. Can you find the bug or can't you?
> Here is the original source with the bug still included. It's very easy to solve. Where is the bug?
> If you can find it, then i will like share and subscribe again. Otherwise I won't. Go.

>it still couldn't find the bug.
Unsubscribed and trashed. It just costs way too much time. Tfw fell for the Ads way too long
>>
>>108564876
    process(clk, rstn)
variable tmp_sio_out : std_logic_vector(7 downto 0);
variable idx_v : integer;
begin
if rstn = '0' then

elsif rising_edge(clk) then
ack <= '0';

case curr_state is
when ST_IDLE =>
sio_oe <= '0';
csn_i <= '1';
[...]
if req = '1' then
[...]
if we = '1' then
wdata_reg <= wdata;
cmd_data_reg <= SPI_QUAD_WRITE;
else
cmd_data_reg <= SPI_QUAD_READ;
end if;
curr_state <= ST_CMD;
end if;
when ST_CMD =>
csn_i <= '0';
sio_oe <= '1';
[...]
when ST_ADDR =>
[...]
if bit_cnt = 0 then
if we_reg = '1' then
bit_cnt <= 3;
sio_oe <= '1';
curr_state <= ST_WRITE;
else
bit_cnt <= RD_WAIT_CYCLES-1;
-- sio_oe <= '0'; WRONG!
curr_state <= ST_WAIT;
end if;
end if;
when ST_WAIT =>
sio_oe <= '0'; -- based
[...]
when ST_WRITE => [...]
when ST_READ =>
when ST_ACK => [...]
end case;
end if;
end process;


If anyone wants to know:
The sio_oe signal going low had to be moved from ST_ADDR to ST_WAIT such that the last addr nibble will still get output on the next clock cycle.
>>
why is it that I write a program that allocates no dynamic memory and just sits there doing nothing and if I watch it in task manager the memory usage continuously fluctuates up and down?
>>
>>108565865
>task manager
Your thread is not the only one doing stuff. There's like three or four threads for other shit that run parallel to yours.
>>
>>108565926
? I'm not talking system wide memory usage, task manager breaks it down by process
>>
>>108565940
Yes.
>>
>>108565865
My guesses would be
>runtime fuckery
>reserved memory being shuffled around
>>
>>108561805
I made an Iterator for Lists in MAIDS, to see if I could do it, but I am not sure it is actually useful, because everything I can do with the iterator, I can also do with recursion and I think the recursive code looks nicer and is easier to understand, and MAIDS has TCO anyways. I also wrote a random number generator in MAIDS which is nicer than the one from my last example and works for arbitrary ranges of integers passed to it as arguments.

I would upload a screenshot of the IDE to show the Iterator, but I appear to be currently blocked from uploading images? Hopefully that stops soon.
>>
>>108565865
What OS?
Are you using standard io, network or files?
>>
>>108565979
>What OS?
He said "task manager".
>>
>>108565999
My xfce DE comes with a task manager as well.
>>
File: 1754953050325654.png (161 KB, 1280x706)
161 KB
161 KB PNG
finally added thumbnails to my filemanager
>>
>>108565999
>she thinks only one OS has a task manager
>>
>>108566337
Only one OS has tasks worth managing.



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