What are you working on, /g/?
Previous:
>>105800235
>>105850854 (OP)>MAID>Medical Assistance In Dying
>>105850884How far will i get with the tax man if i withold till all of this is gone but donate ghe equivalent to food banks, internet archive and the canadian constitution foundation?
>>105850932chat gpt please learn which board you are posting on we are joking about the maid avatarfag who posts here
>>105850884>Mechanically Assisted iToddler Death
>>105850991based sneechia poster
Tohru
md5: 34f33c16d3f09f1bfd195d1dce525456
๐
>>105851004>/g/ - Dra/g/on Maid BoardWhat does this have to do with maids and would anyone like to discuss counting big numbers?
>>105851062Shut up tranny.
>>105851062Continue speaking, real woman.
>>105851091Read the thread title, motherfucker.
>code SHA-1 in C++
>pseudo-code on wiki is broken (took me ages to notice)
>fixed it after consulting RFC
>still doesn't work
>spend another 2 evenings pulling my hair out
>turns out it was a minor endianness error
yes,I spent 3 (three) fucking evenings coding SHA-1, with access to plenty of example implementations. posting this just in case you ever think you are bad at coding.
>>105851188that's normal when you're coding something new
I'm not even the real maidposter. I just posted Tohru because I want her to come back.
Bikeshedding over how I should expose a way to queue up a complex request: an Add method with many arguments, one per configuration field, or an Add method with a single struct/class argument that contains all the configuration fields
>>105852029the latter, make it abstract if you need backwards compatibility
>>105851062>counting big numbersHonestly kinda miss that lil' nigga just because of how retarded/insane he was.
>>105852035That's what I'm thinking, because of what you said and the fact that I can then create an AddMany method that takes in an array of the complex configuration objects
>>105852110>retarded/insaneYou are a numberlet
>>105852378Alright keep counting, I'm sure you'll free the maid mind one of these days with your numbers.
Threadly reminder about maid posters.
For any ML programmers... what's the best way to do feature selection on something with like a couple million features?
>For any ML programmers
OCaml sisters I don't think he means us
>>105852503Yeah, I'm referring to machine learning stuff.
https://files.catbox.moe/rdvnst.mkv
https://github.com/Zizin13/ROLLER
3D CAR 3D CAAAAR 3D CAR 3D CAAR
Does this make sense as a way to use polymorphism in C++ to store implementations of a base class and access them through an interface? (base would have some functions, just none shown here for demonstration)
I'm not a fan of the enum, seems like an easy way to make a programming mistake when adding new derived classes, but I don't know how else to convey the information after inserting the class into the list
#include <vector>
enum class DerivedType {
Derived1,
Derived2
};
class Base {
public:
Base(DerivedType type) : type(type) {}
DerivedType type;
};
class Derived1 : public Base {
public:
Derived1() : Base(DerivedType::Derived1) {}
};
class Derived2 : public Base {
public:
Derived2() : Base(DerivedType::Derived2) {}
};
class BaseList {
private:
std::vector<Base *> bases;
public:
void addBase(Base *base) {
bases.push_back(base);
}
void removeBase(int index) {
bases.erase(bases.begin() + index);
}
};
Been a while since I tried coding anything, what are some good resources to read/watch if I want to make basic GUI apps in Linux?
I'm kinda familiar with C, Lua, and Python.
>>105853553yes that's very normal, including the enum which is often used to implement a faster dynamic cast that avoids RTTI
https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html
llvm has a pretty detailed docs on how their libraries use this, although IMO their approach is very heavy
>>105853612Doesn't get much more straight forward than this
https://docs.gtk.org/gtk4/getting_started.html
Everything you need will already be installed on your system.
The developers of a software my company uses pulled out functionality that I wanted to use and that was accessible via their API into an opaque RPC server
I'm upset, I'm tired of reverse engineering their file formats because they don't give me the tools to properly access their data
>>105853553>>105853733another problem I've been thinking about is how to address a specific object in the list when in a multi-threaded scenario. In my example I used the index, but in the case of like a GUI where a person views the list and then selects the object to act on, the object at that index could change or disappear all together between viewing and acting.
Things I've thought of are:
>base gets created with unique ID value that increments each time, basically file descriptors for objects>I don't necessarily care that the object I interact with is the exact same one as the one I was looking at, but an equivalent object would do. for example if my objects were blocks in a game like minecraft, they 'key' could be their x,y,z + block type. then I search for it in the list and can do stuff with itAlso to go along with that, how do you act on an object in a multithreaded environment like that? I was thinking I could make a function on my BaseList class which accepts a function + object key as argument and then lets the list itself perform the operation, kind of like qsort. That way the list is always in control of the objects and you don't have to worry about external things holding references that could expire or locks just to mess with 1 object. Thoughts on that?
>>105854812I'm OK with not caring. If you still do that's solely a You-problem.
my brain is too small for make files and having different targets plus their tests so i just grabbed meson
at least its easy to use and will tell you where you're fucking up but man, i hate having to fuck with the build file every time i add a dependency to a source file
Is there a cli tool to download all of these asset files in bulk from github pages?
Just wrote and compiled my first Rust program
>>105853449based decomp but I've never heard of this game. Did you play it as a kid or something?
>>105853553undefined behavior
What would it take to get a job in a.i/ machine learning? Is it even possible with a bachelor's in comp sci?
>>105856895Yeah it was the standard by which I judged all racing games as a kid. Nothing quite like it has ever been made. It's got crazy loops, corkscrews, and other stunts like trackmania but it's also a combat endurance race where you are encouraged to wreck other cars. It's got manufacturer teams running two cars each like le mans or f1 and the AI is really funny with player-like behavior I have never seen AI do in other games. They'll do things like drive through the pits at top speed to try and wreck people trying to repair or if one car on a team is doing really poorly they might decide the best thing for the team is to turn around and drive the track backwards to wreck people. It's got 2 player split screen and 16-player network multiplayer in 1995.
Also my mom hated it because when you successfully murder someone the announcer shouts YEAAH FATALITY so it was "too violent" aka extra cool when you're ten years old.
>>105858340>my mom hated itThanks for reminding me why people like Jacob Ind are my unsung heroes.
>>105859833Nah my parents were wonderful. I was lucky enough to experience a two parent household with lots of siblings and parents who obviously love each other to the point of doing gross embarrassing PDAs like high schoolers all their lives. You know how moms can be about violent stuff though. My wife is the same about our kids, it's like becoming a mom flips a switch in your brain. She thought goddamn chitty chitty bang bang would be too scary for them. The child catcher guy is pretty creepy though ngl.
>>105860234Sounds like your parents got lucky. It's up to fate if you guys will share that luck, or prematurely end up beneath a tombstone.
Learning about cache replacement algorithms and planning to implement clock pro+ to see how it performs compared to someone elses ARC implementation. May end up doing CAR too to compare against CP+ but I'm already procrastinating so I might not go that far.
Diving deeper into Go. Just setting a pointer to nil feels so wrong, but holy balls is the whole process comfier than fighting the C link/build systems.
The interface system in pretty nifty too. All a thing has to do is fulfill the interface and it is one of such kind.
Fixed the little issues that caused the model to explode and the shadow to be all fucked up.
https://files.catbox.moe/dp98n3.mkv
>>105861524Even the fucked up z-ordering on the open wheel cheat car works exactly like the real game, and now I know why it's like that.
is there an efficient way to do polymorphism with an object's function depending on the object's state without using a bunch of if statements since each function will be ran 10000+ times? should i make it so the function instead evaluates a lambda function which changes depending on the state before running the function running loop?
does it even matter in the end if its not time critical?
Alright, uber mega ultra /g/, javascript, SQL newfag but not really because of frontend experience almost 2 decades ago working on html, css and mostly former flash/dreamweaver obsessive retard here.
I've been doing a JS class for 2 months now and recently we tapped into JSON and what I found interesting is how the teach showed us an example on how to load a whole site by delaying the load limit precisley using JSON to esentially hide the main web data(as in inspect element doesn't show anything about the site's structure). Why is this not common practice? Asking as someone interested in web security.
>>105862071what? everything will compile down to if statements anyways, so just use if statements
Iโm tired of wasting my time mindlessly doing nothing and am continue learning python again, wish me luck
>>105862169>wasting my time mindlessly doing nothing>continue learning python againYou're repeating yourself.
So last night I helped some kid from my faculty to get a grasp on some graphics programming. I made a video tutorial for him using Raylib and C.
Just some basic shit like drawing rectangles and triangles.
After I sent him the video I got a little entertained and continued by myself. Just a baby recreational project.
I set a circle to bounce around the screen, like the DVD screensaver. That took me a little more than expected. The I went to sleep.
Today I thought I'd add a second ball and have them bounce off each other. So I googled how to find when two circles intersect.
Holy fucking shit the math required only for this little thing is insane.
Game devs are fucking INSANE. I kneel.
Any recommended reading? I kinda want to get into graphics/engine programming but, you can see where I stand now.
>>105856791Nice, it's not that hard to be honest, but congrats anon. Keep going. That language is hard as fuck and honestly kinda shit.
>>105862071You could try using function pointers or delegates depending on the language you're using
On a state transition you override the function pointer with whatever should execute at this point
It sounds like you're building a finite state machine anyways, you should look up how smart people do that in whatever language you're using
>>105862122If you mean dynamically generating the website based on the contents of the JSON, you can inspect the JSON in the Network tab of your browser's developer tools
It's common practice for big companies' modern websites, e.g. Facebook, Instagram where the page dynamically fetches content and then parses/displays it
>>105862190I already started the shit, might as well finish it
>>105862296Isn't it as simple as testing if the distance between the centers is less than the combined radii?
>>105862352Forgot to mention. He also used ajax to order the load delay time for site elements to "cascade" per se.
>>105862385Not afaik
https://math.stackexchange.com/questions/256100/how-can-i-find-the-points-at-which-two-circles-intersect
However I found Raylib has a handy function:
bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles
So I'm getting some traction again
>>105862071Computed goto.
>>105862664Why would you need the points?
>>105862700To decide wheter to invert or switch the direction or "bounce" vertically or horizontally?
Honest question. I'm not entirely sure what I'm doing and I don't want to ask chatgippity just yet
>>105862811You know the wall that the circle intersects.
>>105850991>sars android (and AMD) are very very good valu sars!
>>105862835There are more indians in USA and Canada than there are in the rest of the world excluding India itself.
>>105862848doesnt explain north korea
>>105863399lets heart roru theroies
ive been working on a game in bevy, rust is fun, first time making a real desktop app since work is all boring microservice crap
but the engine is just not ready, i want to make a strategy game and thats obviously going to be very UI/menu intensive and it is just absolutely not ready for that kind of thing but im trudging through it anyway
something like half my repo is purely UI code, and i havent really been able to test the core gameplay like i wouldve wanted to by now
i also looked into some ui abstraction libraries but theyre either out of date for the recent version of bevy or dont have the features to justify me moving over what i already have
i know theyre currently working on a proper editor for the engine but its probably not going to see the light of day till next year if anything, and i want to 1. use rust 2. make game so i am stuck here, suffering
thank u for reading my blog
This is a fucking lie btw, even with [[gnu::always_inline]], you'll still often end up with an extra stack frame somewhere in the code. If your function is trivial, always use macros
https://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Inline.html
>>105863794Yeah, as far as I understand Bevy is incomplete but also heard it is way too different and complex. Too different from a normal graphics library. How has it been?
I've read the book, but only written basic to mid shit in Rust
>>105862296>Holy fucking shit the math required only for this little thing is insane.It's not too bad, except you need to handle what happens when the intersection really happens between simulation steps, and you need much more complex math if you want to handle rotating objects. Damn, do I hate tensors.
>>105853936>Doesn't get much more straight forward than thisYes it does.
>>105864028>>105862296Honestly I do not understand how I keep seeing people on YouTube making Minecraft clones. That seems extremely hard and like it might take one to three years to accomplish.
>>105863986honestly i've barely done any work on the rendering side so far. my game is basically going to be a 2D map so i'm just drawing basic meshes, no animations or anything fancy yet. i don't have a frame of reference to compare the engine to other things because it's first game engine ive used
I will say ECS is a joy to work with, at least for the type of game I'm making. it's so incredibly easy to implement new mechanics and I rarely have to think about performance because of how component querying works alongside how 'systems' (the functions that define all your actual logic) work and are by default run in parallel where possible (so no modifying components while being read somewhere else). coming from a background of java and not doing any c++ since college rust has been a breath of fresh air after learning the borrow checker, the pattern matching is also so incredibly useful
Uuuhhhh
Do any of you guys work with Visual Studio (not VSCode) ?
I might need to start using Windows for all my C++ coding and I was wondering if Visual Studio was an actual option or just MS slop.
>>105864743if youre coding for Windows, visual studio is the best youre gonna get it can do some magical things with debugging and profiling, CLion is also extremely good and you can at least transfer those ide skills for when youre working in linux
>>105864773I've rarely used debuggers and if I were to try to use dbg right now I'd be lost af.
Idk, I'm wondering whether to go drop Linux for a while full Windows productivity mode. Maybe learn all these tools that Visual Studio offers. Maybe I'll actually become productive and get a job inshallah
>>105864828>I've rarely used debuggers and if I were to try to use dbg right now I'd be lost afperfect, visual studio is made for retards like you its impossible to fuck up debugging and barely requires configuration
also no theres no point in dropping linux if you want to get a job being a codemonkey because 99% of jobs will have you interacting with linux in some form whether youre developing something that runs on linux or interacting with cloud services that run on linux, there is no point in dropping linux especially when its the best its ever been from a user desktop experience, and the dev environment will always be 100000x times easier to manage and set up than anything on windows
>>105862071Make the state an enum and use a jump table.
>>105864867I mean it is not like I haven't used dbg before and like I couldn't learn to use it and other tools like Cmake or whatever.
I was just wondering whether to switch for more "comfort" or productivity or both. But I ultimately agree that for a codemonkey job it's kind of the same.
I adding a flashing effect to my gtk timer.
>>105855526Github cli probably has something for that
>>105865814>gboolean>gchar>gpointerThis is cancer
>>105866054I use it to differentiate which c files depend on gtk and which don't.
Like plain c vs glibc
jon blow compiled 300k loc in his new language in 2 seconds without caching builds how is this possible?
>>105866333he literally talks about it for an hour why dont you go find out
>>105866333custom x64 backend that doesn't optimize and doesn't include the same file six billion times per header
>>105866398he said he still uses llvm THO
>>105866333you are only just now finding out how slow compilers have gotten?
>>105866333The better question is how is it possible all other build systems are so slow. After all these years of effort from the entire world, some even considered industry standards that the whole planet depends on.
>>105866485the 2 seconds figure was not including llvm optimization passes
>>105866485Wasn't it:
Debug build - Blow backend
Release build - LLVM
my programming language has no concept of "functions"
>>105866809you vill implement ze monad
The ideal programming language would read just like English.
They add A to B and store the result in C.
Elegant. Beautiful. Self-documenting.
>>105866632>>105866630rust at least has a good excuse for its slow compiler, its doing a lot of extra work other compilers dont, i do wish it could be faster but incremental builds are good enough that i never spend that much time compiling while working on something anyway and i recently found out you can hot reload rust so thats saved me a bunch of time too
>>105866632im flashbacks to working on a java 8 spring monolith that took an hour to do a full compile and the only other option was a hacked together script a coworker wrote that would let you recompile a singular module, but then you still had to wait a minimum of 10-15 minutes to deploy it because it was impossible to set up locally and all development had to be done through a remote vm that was always lacking enough RAM because IT was stingy, so much so that you couldnt even attach vscode and run your lsp without it crashing half the time
i hate corposoftware so much
>>105866919I'm trying to imagine writing anything more complicated than fizzbuzz and it sounds like a nightmare. Even in your example it's 100x harder to read that than
C = A + B
But imagine writing an allocator. For laughs I asked Claude to make one
Create a memory allocator called BlockAllocator.
Define a memory pool of 4096 bytes for BlockAllocator.
Define a bitmap of 64 bits to track block usage.
Set block size to 64 bytes.
Calculate total blocks as 64.
Set all bits in bitmap to 0 meaning available.
Define allocate function:
Loop through each bit in bitmap from 0 to 63.
If current bit equals 0:
Set current bit to 1.
Calculate memory address as block number times 64.
Add memory pool base address to get final pointer.
Return final pointer.
Continue to next bit.
If no available blocks found, return null pointer.
Define deallocate function that takes pointer as input:
Subtract memory pool base address from pointer.
Divide result by 64 to get block number.
If block number is valid:
Set bitmap bit at block number to 0.
Clear the 64 bytes of memory at that block.
Otherwise ignore invalid pointer.
Define get_free_blocks function:
Set counter to 0.
Loop through each bit in bitmap.
If bit equals 0, add 1 to counter.
Return counter.
Initialize BlockAllocator memory pool to all zeros.
Set bitmap to all zeros.
Mark allocator as ready for use.
That's so much Hardee to read than an equivalent C allocator
>>105867020You're thinking too much like a programmer. You need to refactor that to read more like Harry Potter. Every program should tell a story.
>>105867026Bro AI is gonna take our harry potter fanfic writing programming jobs
Conjure a memory allocator called the Enchanted Block Grimoire.
Summon a magical memory vault of 4096 bytes for the Grimoire.
Create a crystal orb with 64 glowing runes to track block enchantments.
Set each memory block size to precisely 64 bytes.
Calculate total magical blocks as 64.
Dim all runes in the crystal orb to show available blocks.
Cast the allocation spell:
Examine each rune in the crystal orb from first to last.
If current rune shows dim light:
Illuminate the rune with bright magic.
Calculate memory location as rune number times 64.
Add the vault's entrance address to find the exact chamber.
Return the chamber's magical address.
Move to the next rune.
If no dim runes remain, the spell fails and returns nothing.
Cast the liberation spell that takes a magical address:
Subtract the vault's entrance from the given address.
Divide by 64 to discover which rune controls this chamber.
If the rune number is within the crystal orb:
Dim the rune to show the block is free.
Cleanse the 64 bytes with purification magic.
Otherwise ignore the invalid magical address.
Cast the counting charm:
Begin with zero available chambers.
Examine each rune in the crystal orb.
If rune shows dim light, add one to the count.
Reveal the total number of free chambers.
Prepare the Enchanted Block Grimoire with empty chambers.
Dim all runes in the crystal orb.
Declare the magical allocator ready to serve wizards.
>>105866919>>105867020nlp is probably the stupidest idea ive ever heard of
and theres fags talking about making languages to interface with llms directly like this
>>105867026Once upon a time there was an Integer named Inty. Inty was an Unsigned Integer. All the other Signed Integers would make fun of Inty, asking him questions like, "Inty, what is 0 minus 1?" to which he would reply "4294967295" and they would all point at him and laugh. But that all changed one day when Inty brought an Exception to school.
>>105867062>they would all point at him and laugh
>>105863941If your function was truly trivial, it would be inlined without being marked inline. You're just a mouthbreather who doesn't know how to use a compiler then gets mad at nothing.
Use case for gtk_widget_set_margin_all?
I need to learn x86-64 assembly for debugging shit on windows. Recommend me some learning resources.
>>105867218daniel kusswurm's latest assembly book, i think it goes up to AVX-512
>>105867218Write basic c code and compile it with zero optimizations and then study it with objdump.
>>105867218use godbolt, learn it, love it its useful even if you never end up writing any assembly by hand
>>105867218gdb is the answer.
The little triple bleep bloop back and forth dance between the 8086 (or really any x86 processor i suppose) and the 8259A is a bit of a fucking pain for a brainlet like me to emulate but I'm getting through it
>>105867343does gdb's tui stuff work on windows yet?
>>105864743VS is fine, I have been using it for decades. still, I moved all my workflows to VSCode last year. I am not saying it's better, but it lets me to work the same way on Linux and Windows. I just got used to it.
>>105853733>"LLVM avoids using C++โs built in RTTI. Instead, it pervasively uses its own hand-rolled form of RTTI which is much more efficient and flexible"lmao, how about they just fix their fucking compiler and make RTTI faster
>>105867571because the standard requires it be shit
there is literally no use case for rtti
>>105867497I don't know anything about windows man. I would expect gdb to be used in WSL.
>>105867666I will not use WSLop, satan.
>>105867673why would you not use the only way to get a sane and manageable dev environment on windows
>>105853553I am not sure if this is a good idea, but some time ago I came up with my own way to do RTTI, without having to manually manage ids. I am just using an address of a static member as an id.
https://godbolt.org/z/1bqoT5z7G
>>105867343>enable tui>program print something>everything is brokenNice meme.
>>105867760>he doesn't know
>>105867752now, that I think about it, it could be just:
#include <cassert>
#include <cstdint>
constexpr auto type_id(auto&& x) noexcept
{
static char dummy = 0;
return reinterpret_cast<std::intptr_t>(&dummy);
}
struct A {};
struct B {};
int main()
{
assert(type_id(A{}) != type_id(B{}));
assert(type_id(B{}) == type_id(B{}));
}
>>105867631how so?
>>105867646mostly true. I needed it once for testing type of native objects coming from a scripting language.
>>105867800I will NOT use a frontend or redirect my stdout/strerr.
>>105867974just Ctrl+L nigger why do you give up so quickly
>>105867837That doesn't make much sense. It only works because you already know it's an A or a B. If you have some form of type erasure it all breaks.
>>105867898i dunno, now that i think about it i never asked
i assume it has something to do with how large it is, and at least on both the windows and itanium ABIs, the way the underlying structures also encode inheritance hierarchies for dynamic cast since iirc it and typeid were always explained away as the problem parts of RTTI
i think? it has to traverse a fairly large tree,
i don't have the vcruntime library source on hand atm
>>105868181yeah, it's mostly about avoiding to manage the enum with type ids yourself. you still need to store the id somewhere.
>>105867673>uses Windows>tries to lecture me about using slop
>>105868296Go fix your graphics stack, Linux tranny.
>>105868081>refresh>all logs goneAbsolute GNU/Meme
>>105867837>reinterpret_casthumiliation ritual
Currently bikeshedding over what serialization I want to use for the object representing an HTTP API, JSON, XML, or something new and exciting
>>105870112>webshit>excitingjust use JSON like a normal person
>>105870130It's amazing how you can make yourself sound incompetent in so few words.
>>105870130Well yes, I could do that, but that would mean I have to actually build the thing instead of endlessly ruminating over a trivial implementation detail
>>105850854 (OP)Why am I still getting an floating point error if cpp automatically does implicit type conversion between ints and floats/doubles?
For example, if I have x and y set as ints and have them equal to 5 and 2. Then I set z as a double and have it equal to 5 /2, it should just result in 2.5 rather than giving me an error, right?
>>105870266no, 5/2 gets evaluated first (as ints) to 2, then assigned to z (double)
>>105870266>He thinks implicit type conversion is real.It's no mere conversion, but pure enshittification. In fact, if you ever try to rely on it, you quickly find out that the case where it would be useful, will do the opposite of what you expect it to do.
>>105870318>>105870495Thanks anons, TIL implicit type conversion is a meme and it's better to just assign data to the right type from the start. Or just explicitly convert at the very least.
>>105870869Assigning isn't enough, literal must be the correct type or explicitly cast to it.
>>105862835Those country shapes are mad, the UK doesn't look like that, and where's Ireland? I assume that island is meant to be Iceland.
>>105871082Non-autists don't care.
>>105851188>pseudo-code on wiki is broken (took me ages to notice)when i was in college i used to change the example code on wikipedia to be subtly wrong a day or two before a homework assignment that involved implementing it was due to fuck with peers who copied from wikipedia.
any .vscode configuration aficionados here? How do I use a .vscode folder that is NOT located inside of the project that I'm working on? I do not want any mention of the editor to appear in my git repo, not as a folder and not as an entry in the .gitignore
I tried to use a multi-root workspace where the first folder in the workspace is the .vscode and the second is the project but the configuration files seem to be unable to cross the folder boundary despite being in the same workspace
I program directly in .net il for maximum performance
>>105873386I've considered doing this seriously, are there performance gains to be had similar to dropping down from C/C++ to x64 assembly?
Not necessarily the same magnitude, just the idea of dropping down to a lower level to improve performance
>>105873607>She doesn't know about the anon who has a melty every thread about this
Thinking you're a subhuman autist who deserves to be turned into fertilizer through torture isn't having a melty. It's the default disposition of normal human beings, which you're not.
>>105872174gitignore can accept
*
**
!src/*
To ignore everything but src. No .vscode and no trace of it.
>>105873694>Thinking you're a subhuman autist who deserves to be turned into fertilizer through torture isn't having a melty
>>105872174you can set up a global gitignore that isn't part of the git project and in it ignore the vscode folder. that will ignore the .vscode folder from any git project you work on from your computer without needing to add it to the projects' individual gitignore files and without anyone ever knowing you're a bitch who can't into vim.
>>105867542So you use VSCode both in Windows and Linux? I suppose that is productive.
let square: AsmFn<i32, i32> = AsmFn::new(|a| {
use iced_x86::code_asm::*;
a.imul_2(edi, edi)?;
a.mov(eax, edi)?;
a.ret()?;
Ok(())
})?;
println!("square(2) = {}", square(2));
println!("{:#?}", square);
square(2) = 4
400000: 0F AF FF imul edi,edi
400003: 89 F8 mov eax,edi
400005: C3 ret
Thoughts?
Windsurf announces it is leaving the developer market and focusing on Enterprise after CEO goes to Google.
i just spent like an hour and a half debugging some stupid javascript shit
"\\[".replace(/\\\[/g, '$$') only gives one $. you need $$$$ to get $$
was fucking with some latex thing which uses $$ for delimiter
i hate this language so much
>>105876389very nice. now let's see the godbolt
>>105876389look what they need to imitate a fraction of our power
Cursor is pretty much like
>How I learned to stop worrying and love the bomb.
and not just that, you can discuss what you want with grok and have it build a prompt for cursor for the entire project.
>>105876389>can the compiler read return from EDI, or does the return value HAVE to be moved to EAX?>can the compiler inline the generic IMUL away? (MOV 16 is faster than 4 << 2 is faster than 4 * 4)>can the compiler avoid CALL/RET and use LEA/JMP R64 instead?Just use a macro, mate.
>>105876876What rule is there that says RegEx has to consist of one-character tokens.
Can anyone tell me if there is a largely adapted version of RegEx that is slightly more verbose than using one character to represent something?
>>105862296It is literally the simplest collision detection in existence. You can describe a circle with one number
The next simplest is AABB and yes it gets very fucking confusing very quickly
>>105879025>You can describe a circle with one numberOnly in an useless edge case.
>>105876389It's like looking into another universe where C doesn't let you blow your computer up and also got more advanced an extensible than something from 1978. It looks like the definition of reasonable.
This continues to be my opinion on Rust and conversely that this board is retarded and good for nothing.
>>105879063Functions are advanced and extensible. Nobody ever needed more.
>>105879075Radius doesn't mean anything without a center point.
>>105879070Have we confirmed or denied that sudo got hacked because of a buffer overflow on C
>>105879086I never used sudo, usecase?
>>105852445Me on the right
>>105879081You mean the location / translation transformation?
That's inherent with any object. The constructor for a circle shape is literally just one number.
Anyways it gets a million times more fucked after that.
Look up polygon decomposition if you want to see what goes into properly figuring out whether a character is clipping into a wall.
>>105879106It isn't, there are platonic objects that do not have position in any world.
imagine an operating system that only transmits data over the internet when you explicitly instruct it to
>>105879153So like Linux?
alright regexsisters lets say i have a string
"+foobar"
where the '+' character can be any character of either +-~? what regex would match this string?
>>105879168https://regex101.com/
>>105879173oh wow, wish i had known about this earlier. thanks!
>>105851062>movq rax, 9>syscallLet me guess. You need more
>>105852445Did you imagine the one on the right the first time you talked to maid poster, or his avatar? Why? Nobody does this. You just make yourself look like a retard.
>>105879153Operating systems don't transmit data over the internet, they are a set of programs, some of which, instruct the computer to send data over the internet.
>>105879153so any operating system with a firewall? fucking revolutionary.
https://pastebin.com/yRWnNaZ3
rate my blackjack discord bot code.
i have no idea what i am doing but it just werks.
>>105879785>card => `\`${card.rank}${card.suit}\``
>>105879785Gemini says its missing the blackjack rule
>>105879838>Conclusion: The line is correct and effectively uses JavaScript features (template literals) and knowledge of the target platform (Discord's Markdown formatting) to produce a nicely formatted output. It's a good piece of code.
>It's a good piece of code.
>fewer instructions
>more cycles
the fuck does this mean
>>105880010What's there to misunderstand?
>>105880083damn
I wasn't expecting that big a difference
>>105879086No one cares, freak.
>>105866150but what of headers?
can't you tell by if gtk header is included?
>>105880310Jazz isn't just made by black people
I'm talking like, Maxis game music (i.e SimCity 3000). It's improvisational, instrumental jazz
>>105880325It's a black mark you cannot scrub off, that permeates everything you touch. Like exceptions.
Are you even writing your own fuckign RISC-V CPU in the very high speed integrated circuit hardware description language, with your own fucking VGA controller in motherfucking Rust????
Well, I do. Just need PS/2 input and non-volatile storage now
>>105880643PS: 640x480, 16 Colors. It's a covenant, like circumcision
>>105880643Pffff. Now do SVGA.
>>105880663That's literally just a matter of adjusting generics inside the vhdl code.... There is nothing to it. All VGAs are equal, but some VGAs are more equal than others (legacy 640x480@Hz is max superior)
>>105880688Less talking, more doing.
>>105880694No i won't waste time on a few more pixels.
Time to make more peripherals and build my own fucking OS
>chickens out
Predictable.
krita
md5: 05e191e106289a3d32fdf81372eec646
๐
>>105880650hawt bunnyayumi
<talks something about KFC
I dont even know
>>105880878>So langsam glaube ich, dass sie keine รคngstliche Persรถnlichkeitsstรถrung haben, sondern eher eine Autismus-Spektrums-Stรถrungt. my psychiatrist on wednesday
>>105880894Thinking in literal terms (a.k.a. assuming that "chickening out" has anything to do with KFC) is a massive red flag.
>>105880914>implying i didn't know what you mean.I am a shitpost professional. The question is only how much is shitpost, how much is autism
>>105880948>I was irooooonicSure thing, autist-kun.
>Use LibTooling to generate a machine readable representation of a C/C++ codebase to automatically generate bindings from or do other stuff with
Why isn't this done more often
Why isn't there like a general CPP2JSON tool out there
>>105880971It's called clangd
AI tools are making the imposter syndrome really hard so the point I feel like all I'm doing is asking ChatGPT inateqd of thinking myself.
How do I fix this?
>>105881609>Reverse engineer this whole ass file format from a random Japanese 3DS gameProbably not gonna happen
>>105881768it's not that much of a huge deal, there's lots of hints that should make it possible
how do I git gud?
>just write stuff
ok but how do I power through the effort of making something that is ultimately useless? should I grind leetcode?
>>105880894what shrink will commit if echo | aplay "meine ehre'
>>105881831>ok but how do I power through the effort of making something that is ultimately useless? should I grind leetcode?just do it. It doesnt matter what you do, just do it and dont do the same shit too often
>>105881867i will force push you're mom. bitch
>>105876876https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_the_replacement
>perl's special variableslol
>>105879168[-+~?]foobar
>>105882261... the sucking contest.
I've refactored my interpreter/compiler over 3 times.
I think 4th is the charm.
I've had 3 iterations of this.
I did the interpreter and the bytecode compiler but never made it to actual completion. I managed to do recursion and that's kind of it. I didn't do structs etc.
This time I'm going straight to x86_64 raw assembly(god's chosen assembly, arm is gay).
>>105879367Everyone who posts on this site is a cute maid with huge boobs who likes advanced Mathematics and Computer Science research. This is a Science Foundation for maids.
>>105883168To be fair, I don't care if they're cute or not - looking at you, Vivian from TTYD, you silly freak.
Cnile bros what the FUCK is going on with Windows?
>do: char string[8]; snprintf(string, sizeof(string), "%.0f", 123456789e300); anywhere
>get "1234567"
>do it on Windows 10 with VS2022
>get "12345678"
auto<auto> x = {1, 2, 3};
i apologize for smugly lauging at people who complained about weird image formats
just wasted 5 hours of my life debugging an error that made zero sense until I realized GDK was refusing to process webp and it was shortcircuiting my entire program logic
fml
>>105876389dogshit compared to
int square(int a) {
asm {
imul2 a, a;
}
return a;
}
>>105884909Rust obviously has inline assembly too, dumbshit. Not the point.
>>105882652>This time I'm going straight to x86_64 raw assembly(god's chosen assembly, arm is gay).t0 = t1 + t2
add r0, r1, r2
add rbx, rcx
mov rax, rbx
>>105885012>he doesn't know aboutlea r0,[r1 + r2]
>>105885083Only appears to work for addition unfortunately
>>105884981>obviouslylmao
>>105885161lea rax,[rcx + rbx * (1,2,4,8)]
Words for me.
>>105885197>unsigned int x = 1 is really -1, but only during particular ops
>>105884530auto x[auto] = {1, 2, 3};
>>105885012dorkness my wife
me
md5: 322b9713125b06dad32de38165b0e981
๐
You obfuscate your assembly for security.
I write Haskell so the assembly is impossible to understand.
We are not the same.
>>105885288I'm too brain addled to read assembly anyway
hexes
md5: 4f7d1e50b88072c1b5ca6c4a170eb6ee
๐
>>105885288Not really a need to obfuscate anything if you don't know which values the registers have.
297
md5: 2a77210ef316a51cdd967864726a58b6
๐
>>105885288It's not that bad
>>105885331why don't you post the version with real register names?
>>105885474https://www.microsoft.com/en-us/research/wp-content/uploads/1987/01/slpj-book-1987.pdf
>>105885488Right, because that's going to help.
>>105885535https://www.youtube.com/watch?v=AZBVgE244cA
Here you go boomer
>>105885507thanks anon, I'd like to understand how Haskell's IR work. There's a stackoverflow that says it has a lot similarities to a new optimizing compiler's IR, RVSDG
https://langdev.stackexchange.com/questions/1823/what-is-the-relationship-between-stg-and-rvsdg
>>105885571thank you to you too, and it might actually. I have some SSE assembly for the first time recently for 4x4 matrix and vector multiplications, for both column and row order.
#? replace(sub = "", by = " ")
prochello(sars:int)=
forsarin0..<sars:
echo"goodmorning,sar!"
hello3
>>105885943why does gookmoot hate sar code?
>>105885925If you do SSE, then keep 'em VEX-encoded.
https://www.agner.org/optimize/optimizing_assembly.pdf
Page 106
>>105885980ty for the tips, I saw that for each instruction there was a "legacy" version that didn't require AVX and I used that. I'm going to try to see if the AVX is really faster.
wow this forum is ded. I should go to mastodon
>>105886047and I even use ifdefs to use different code depending if you have SSE2, SSE3 or SSE4.1 lol. I realized after how old all of this is.
>>105880275Do you even read what you type or do you just shit in your hand and throw it at the keyboard?
The Rust language is fool-proof as a default but one person (read: not standard, not the Rust language) has created a library to simulate these vulnerabilities in an ethical manner.
Explain where in this is supposed to be some kind of complaint about the Rust language or disgrace yourself because of this abhorrently stupid post and never post here again. Jesus christ.
>>105850854 (OP)Made a text editor using Flask and CkEditor using files uploaded by a user, right now im working on converting .docx files to .txt ones :D
>>105886596Cry more, rusty.
>>105886648About what.
What are you trying to say.
I'm more convinced that C users are retarded the longer I'm talking to you.
When I say "retarded", I mean "not quite right".
You put C users in front of a computer and they'll start typing away and simulating runtime polymorphism out of electricity.
The "retarded" part comes in where they lack basic cognitive functions like an ability to articulate their thoughts. Or communicate period.
>>105886730Who cares what you think? if I had it my way we would genocide literally every single Rust dev. No, I won't bother with arguments. Future corpses don't deserve them.
>>105886742And yes, if that means killing a dozen million people, then so be it. And another dozen million. And another dozen million. Until the cancer or the nation is dead.
>>105886647>right now im working on converting .docx files to .txt oneslmao have fun with that cock and ball torture
>>105886742Rust developers are backing one of the largest cryptocurrency projects in the world.
The future is clean, refined and blazingly fast without sacrificing control like a Porsche 911. As much as you insist that the 1978 F-150 "just does the job". As long as the keyfob hasn't been compromised.
Enjoy the contentment that raw pointer management brings you. I don't get it but I don't get Antique Roadshow either.
>>105880971clang has an argument to output a json representation of the code. I use it at work to parse code to find common mistakes
>>105886942Then they're the first to be murdered, alongside you, and no one can do anything about it. The future is full of bloodshed.
>>105887021theyll call it the regicide
trying to find a nice high contrast theme is harder than expected
anyone ever participate in demoscene competitions?
I'd be really interested to hear about your experience.
>>105886943>clang has an argument to output a json representation of the code.Whoa that's neat. I'm a beginner, and I'm just using gcc but how do I do this? I installed clang and googled, but I'm too stupid to understand what I'm reading.
also any reasons or situations I should decide to use clang instead of gcc?
>>105888018better question: are there any reasons or situations to use gcc?
>>105888040As a beginner (but experience with interpreted languages), I welcome answers to either question pretty equally, if you care to elaborate.
>>105888018compiling for multiple targets is easier with clang, but I usually just use gcc
>>105888055clang has native builds for Windows, clang usually produces better code than GCC, while supporting the same extensions as GCC with a few other useful additions, and clang's error messages are better than GCC's as well. There are architectures GCC supports that clang/LLVM doesn't which is useful to know but likely not important.
>>105888074What kind of multiple targets do you mean?
I've only done basic-bitch makefile
I should also look into cmake right?
>>105888088targets as in other architectures, you can select a target without installing some architecture specific version of it
also fuck cmake
>>105888087It looks from a quick search that the relationship between clang and LLVM is that clang is basically a frontend for LLVM, is that right? Any reason to look into LLVM specifically?
>>105888110>also fuck cmakeWhy? And what's better?
>>105888118it's very convoluted, I just write makefiles unless I'm forced to use cmake :P
>>105888112it just does
C -> intermediate representation -> machine code
>>105888112>Any reason to look into LLVM specifically?You want to compile your new language and don't want to target JavaScript, C, QBE or whatever else.
>>105888087>clang usually produces better code than GCCnot really
>>105888132Fair enough, though as a beginner makefiles are a bit convoluted haha. You think it's a matter of being used to one thing, or you think cmake (or anything else) is just pointlessly convoluted?
>>105888143I mean that's gcc too right?
>>105888159Oh ok so more general in a sense. If I wanted to make my own lisp I'd maybe look at LLVM to compile it or something?
>>105888171the difference is typically negligible
>>105888171every time I've bothered to look clang has produced better output
most of the time it doesn't matter
So how do I get clang to output json representation of my code?
Or if you prefer, how do I look into how to find this out myself
>>105888179Lisps are usually interpreted but sure you can go that route.
>>105888211-ast-dump=json should work
>>105886751Surely cant be that bad, I can use os.rename() or docx2txt right?
>>105888259>unknown argument '-ast-dump=json'; did you mean '-Xclang -ast-dump=json'?clang -o clang_test main.c -Xclang -ast-dump=json spits out json but then gives me a 'linker command failed'
Anyhow this is very much beyond anything I'm actually trying to work on, but it's just neat I guess. Not important.
If anyone in the future has input on gcc vs clang vs llvm or make vs cmake vs something else, I'm happy to hear about it.
>>105871082At least they remembered to put in New Zealand for once.
>pointers
what a fucking joke
"That will be $32.43"
"Oh actually I'll just give you a pointer to something that might hold that amount"
Absolute lunacy
>>105888630yeah bro its in my wallet, here, check it
segmentation fault (core dumped)
What's a meme technology you always wanted to try but never really had a reason to do? When i started i was more or less fascinated with the things you could do with ImageJ, namely weird fractals and shit. You could script this library with jRuby, but i never got into it cause i was lazy. Nowadays, there's little point for picking that up. Babashka does the same use case jRuby could do for me but doesn't need a JVM process to run. And i can use that library directly from Clojure or even a jshell script if i ever wanted. Another one i never got around to test was Elm. Everyone was sucking its dick for a couple of years and then just died.
On and off work on a dumb site that I might turn into a free app someday for my own learning ZHONG WEN
The left is hanzi-writer animation to quick show the stroke order, and click to replay. On the list here is coloring the radicals, but hanzi-writer only does one radical by default so it would take more JS sorcery than I care to learn, probably
Middle is from strokeorder.com which lists the stroke order, right is "components" but this is a major fucking hassle due to weird unicode shit and things that almost look identical actually being different and basically a massive can of headache.
Hovering components highlights other characters currently displayed by filter, clicking a component will further filter to characters sharing it.
Also have Zhuyin, but not sure how/why I might utilize. Probably not helpful to search/filter by.
In the red bar is hanzi, pinyin (mark), pinyin (numeric), zhuyin, my own basic-bitch definition, and an HSK level from https://github.com/drkameleon/complete-hsk-vocabulary
A cool thing is there's a whole fetch script that I just feed a list of characters and wa la, so this could potentially be adapted to anyone else's uses.
Next is getting into compounds/words and phrases, but I sort of got burnt out.
But one of the libraries I'm using can look up all words that utilize a character, so the idea would be filtering it down to my own list of words that I've come across as an early learner.
Just a stupid flask thing but it's the only thing I've (started to) made that I feel kind of proud of.
https://www.youtube.com/watch?v=a1_lB65bn9A
This should be the OP image of the next thread.
>>105888834I'm from here. You go back.
A moth landed on my hand.
I thought to myself: "I really like this."
I'm really happy about programming and my new moth friend.
>>105888843Wh-what are you programming with your new moth friend?
>>105888846We're just playing around in C!
>java retard
>no moth will ever land on my hand
fuck this life
>>105888040Register variables. clang still can't provide variables that would violate the ABI.
>>105888802Who are you quoting
who are any of us quoting, really