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


File: 1617156163919.png (912 KB, 818x1030)
912 KB
912 KB PNG
Old thread: >>95994274

What are you working on, /g/?
>>
File: 1694871798018026.png (727 KB, 1024x715)
727 KB
727 KB PNG
>>96035134
These are japanese game developers
>>
>>96035781
Please. I'm reading a programming book that college forced me to buy for a class, and in the preface the author is reminding us that programmers are predominantly male and white and we need to change this.
>>
>>96035821
>Pay for school
>They tell you to pay for a book
>The book tells you to fuck off
>>
>>96035821
Well neither of the girls in the picture are programmers
>>
>>96035821
Sounds like the preface belongs to sociology rather than computer science. Doesn't bode well for the rest of the book desu.
>>
>>96035821
What's stopping girls from seeking a job as programmer?
>>
>>96035982
Me.
>>
>>96035982
Rape.
>>
>>96036015
Jokes on you, male programmers all have tiny penis from sitting all days.

Source: I am a programmer.
>>
Least awful .NET UI framework? Currently using WPF, but thinking of trying Avalonia since WPF is semi-dead.
>>
Bros, any tips for learning programming? Trying to develop my knowledge so that I can at least understand what people write.
>>
>>96036042
Learn what a monad is
>>
properly fixed the clipping system to prepare for adding grid widget to my gui toolkit
>>
>>96036032
Avalonia FuncUI
>>
>>96035134
>What are you working on, /g/?
Nothing, give me ideas
Not shit with math like implement this algorithm or draw this shape
>>
>>96035982
The more important question is, why do so many boys throw their lives away for this shit career? Girls know what's up, why don't we? Who did this to us?
>>
>>96035821
>and we need to change this.
why?
who needs?
>>
Reminding anons to use https://github.com/friendlyanon/cmake-init when creating new C++ and C projects!
>>
File: 1688727027786438.png (97 KB, 580x1010)
97 KB
97 KB PNG
>>96035821
Did Drew finally publish a Hare book?
>>
File: 1694874743032352.png (202 KB, 579x958)
202 KB
202 KB PNG
>>96036086
We're reaching levels of comfy that shouldn't be possible
>>
I just leveraged RVO to return a value constructed in a factory method and the elided move avoided the destructor call on the temporary which would have been UB otherwise since the destructor frees the resources. Am I hackerman or is this a bad thing?
>>
C++ programmers jump through hoops to solve problems that only occur due to the fact that they're using C++ and then feel smart about it.
>>
>>96035982
Santa refuses to give presents to female devs.
>>
File: 1677612789976604.jpg (25 KB, 625x626)
25 KB
25 KB JPG
>>96036705
>>
>>96036705
Yes. The same is true about programmers of an other language.
>>
>>96036032
as far as i've experienced they're all bad
if you're targeting windows the only actually properly maintained official ones are WinUI 3 and MAUI
WinUI isn't as bad now since the WindowsAppSDK freed it from being being completely stuck in UWP's clutches but I still wouldn't call it good
avalonia at least has the benefit of portability

never understood why fossfags make the argument that because .NET on windows has some terrible legacy gui libraries that it's actually secretly still evil
>>
>>96036032
WinForms and WPF will be around forever in maintain mode.

Desktop applications are essentially dead. Long-term Blazor WebAssembly will replace them for RAD/Intranet.
>>
>>96035821
If that really bugs you, you can probably use any other book that teaches the same programming language.
>>
>>96035821
Why are you reading the preface? Skip to the code, ignore the rest.
>>
>>96035821
I'd sue the university for racism at that point.
>>
>>96035884
This is why you pirate such things, there is a TTRPG book that I was hyped for, basically a solo "greek myth" rpg and it has the most lefty, gayest fucking "no nazis allowed" after the cover that filtered me for a while. Glad I pirated and didn't pay for it.
>>
>>96038029
>Steal something
>It's worthless crap you don't want
>>
>>96038042
I read it played it to spite the author, the work is good; the person who made it isn't. Its a lot like Caves of Qud, great mechanics, story (besides the weird lizard waifu part because the head dev is a faggot), and great gameplay but the people who made it are all mentally ill retards.
>>
>>96037260
>Desktop apps dead

ehh yeah for a while probably, but we're still approaching the market that results from not making faster chips constantly. Just add more cores, it'll be the same thing!
kek
>>
>>96038042
>Steal

>Pay something
>It's worthless crap you don't want
>>
File: 1674984499209032.png (169 KB, 447x362)
169 KB
169 KB PNG
>>96038288
We don't even have XML accelerators or SSL/TLS offloading in customer devices yet, we aren't anywhere near approaching the end-game.
>>
File: 713JCMQQrLL._AC_SL1500_.jpg (88 KB, 1500x882)
88 KB
88 KB JPG
>>96038410
>XML accelerator
https://www.researchgate.net/publication/30012769_Pushing_XPath_Accelerator_to_its_Limits
top kek
>>
Any good C#, F# and Razor IDE? Dont recommend VS
>>
>>96038483
>C# and F# IDE that isn't VS
lmao
>>
>>96038455
What's your point? that server-grade hardware and appliances utilize said accelerators?
>>
>>96038490
Im used to the dated SharpDevelop but have to move on in order to use .NET new features
>>
>>96038483
>>96038530
Rider.
>>
>>96038410
sex with vei
>>
>>96036141
Men are more into fantasy shit. The dreamer sex
>>
>>96038518
idk, the very fact that people make, use and optimize to death specialize hardware too process XML
and call them accelertors lol
>>
>>96035821
>programmers are predominantly male and white
this is indeed a fact, in your country at least

>>96035884
>we need to change this
could also mean that there needs to be more female programmers, not that there should be less male programmers

>>96035982
what is stopping them from having normal interests in general? from technology to history and politics, women do not care. it is not even a right or left wing thing, I have never seen a woman read either mises nor kantorovich
>>
>>96036032
GTK#, obviously
>>
>>96036141
Elaborate
>>
>>96038794
over-saturated market, it is a consistent race to the bottom
>>
Whats the actual market for Excel "programming"?
>>
>>96038712
>people
Who? Are you having a pajeet moment.
>>
>>96039022
...and "push it to its limits" like if it was a death machine on 4 wheels with a jet engine up its arse

but why are you triggered faggot? stop wining
>>
File: 1677997392617139.png (62 KB, 641x606)
62 KB
62 KB PNG
>>96039134
I'm really struggling to understand what your even talking about, I'm assuming you believe $50 FPGA's require active-cooling?
>>
>>96039566
>I'm really struggling to understand what your even talking about,
holy shit you're retarded
>>
It's a good idea to learn backend development with typescript?
My stack is react js on front end and python with sanic on backend.
>>
>>96040195
It'll be a improvement over Python, you aren't gaining much 'upgrading' from JavaScript to TypeScript though; It's overrated.
>>
>>96040195
>>>/wdg/
>>
>>96040195
go purescript
>>
>>96038955
people in finance and bookkeeping related positions who are scared of things like relational databases because they're not visual
i think i heard once that some businesses use excel with legacy ActiveX based software for things like HR
i've heard complaints from people in academia where they have boomers producing the datasets
the only time i've actually had to use it was in economics class, really would have preferred it if lambdas were a thing back then, the fact that it took MS so long to introduce usable custom function support is insane
>>
>lost with how to solve this problem
>reduced to scouring the debugger to look for useful variables
>see what appears to be the perfect variable that describes exactly what I want to be described
>no functions seem to let me access it
Well fuck you too.
>>
>>96038747
>what is stopping them from having normal interests in general?
They know what's important. At the end of the day, the only thing that decides your standard of living is how much other people are willing to give you.
Little girls are told this, if they don't automatically pick it up. They spend practically all their life learning how to read and manipulate people. It doesn't always work out, but at least they have a fighting chance.
Little boys are never told this and are mostly too retarded to notice. Instead of setting themselves up for a good life, they pick up worthless trash hobbies like programming or literature or some shit.
They only find out what's up in their 20s or 30s, if they ever do at all, and by then it's too late to do anything about it. You can't just change who you are.
>>
>>96035134
Working on hello world.
What should my next project be?
Should I dive into c#, c++, or figure out python?
>>
How do I get a list of supported screen resolutions in C#?
For clarity I'm working on a game using Raylib and C# bindings. Trying to show a list of resolutions in graphic settings for the player to select.
I've found several options but all are shit in different ways
>use WMI
Only works on windows. It's possible someone might run the game on linux or something
>use System.Windows.Forms.Screen
Do I really to reference winforms just to get a list of screen resolutions? Would rather avoid it if there's another way.
I've also found some c++ libraries (ResList v1.2) specifically for this but apparently it's also windows only
I feel like I'm doing something wrong and there has to be some quick and easy way that I'm not aware of.
>>
>>96041193
>next project
FizzBuzz. You can't really do anything more complex right now.

>language
Doesn't matter.
Personally I prefer C#.
I've heard good things from Python as a beginner language.
C++ helps you understand deeper concepts by beating you up until you understand them.

Since you're starting out, I'd suggest reading a good book or a tutorial made by a non-pajeet.
>>
>Have female coding professor
>Tells us we have to get Jupyter Notebook and anaconda
>Remember that I have miniconda3 on my computer
>Ask if I can use that
>"I don't know."
>Assume I can't and download heavy ass anaconda
>iIs fucking miserable to deal with and takes forever to load
>It some how bogs down jupyter notebook too
>fuck.png
>Remember I asked question at the beginning of year
>Google it
>You can use miniconda 3
>install it
>it pops up instantly and runs fine, no slowdown
Well I'll keep anaconda just incase we need something else that I don't have installed on miniconda3 yet just to be safe.
>>
>>96041282
raylib doesn't have an API for that?
doesn't it handle windowing?
SDL which is a library in a similar vein to raylib that almost certainly has c# bindings can do it
https://wiki.libsdl.org/SDL2/SDL_DisplayMode
>>
>>96041371
Tips on where I can find those? Google's not going to help me.
>>
>>96041458
Raylib has an API for setting screen resolution, window mode and a few other things but nothing to get information about the monitor or supported resolutions.
After a bit more googling it seems WMI library is included in wine, so it should work on linux after all.
>>
I honestly don't understand why people find C++ hard. For me it's easier and more readable than python.
>>
>>96041546
For C++ check learncpp.com
>>
Just finished getting XTTS samples to work with a TTS->RVC pipeline that just came out.
>>
>>96041560
i did a bit of looking into WMI a while back since it was the only way to access hypervisor related info on windows and if i remember rightly it's technically meant to be a system independent protocol or something so it's possible linux itself can support it
>>
>>96041546
Book/Tutorial depends on the language. I can't even remember what book I used when I started (probably some O'Reilly java book).

One other option is going the SICP route, though you'll be using lisp.
If you're interested in doing a 40 year old MIT course
https://www.youtube.com/watch?v=-J_xL4IGhJA&list=PLE18841CABEA24090
The description has a link to the full course syllabus including projects.
>>
File: Untitled.png (73 KB, 1358x494)
73 KB
73 KB PNG
>>96041640
Doesn't seem to be the case, VS is giving me warnings about platform compatibility.
Also the fact that wine includes it seems to imply that linux itself doesn't.
>>
>>96041546
the guy who invented C++'s book, bjarne, specifically his most recent one, i think it's called programming principles and practice in c++ but i'm not sure
it's extremely comprehensive compared to most resources, it covers a lot of shit i would have loved to have learned early on, and i believe it actually teaches modern practices
apparently a bit boring

don't use any of the c++ books in the big /g/ library torrent which i made the mistake of doing
more generally avoid c++ books written before or early on in 2011, not only will they teach you outdated methods that don't resemble well written real world code, the language itself prior to 2011 was filled with bugs and errata
the c++ standard released in 2011 is considered the start of what's referred to as "modern" c++

and use libgen to get books
i think they've moved to tor now after a bunch of retarded tiktok faggots started shilling it and it caught the attention of the copyright mafia
>>
>>96041724
huh i had no idea c# had proper APIs for accessing WMI
those are apparently not portable but if i'm remembering rightly and not mixing it up with something else, at its base level WMI is actually some sort of semi-standard (the base is standardized but microsoft extended it) messaging protocol/scripting language and you can just download the definitions for all the data types/apis maybe including the MS extensions?

i vaguely remember trying to write a parser for it/them before giving up after i remembered how much i hate text processing
>>
File: xmis-21-b.jpg (635 KB, 2100x1500)
635 KB
635 KB JPG
>>96035134
The op for /dpt/ needs links to resources.
I'm learning how to draw and program put I made way more progress with art thinks to /ic/ listing some books in it's sticky. I also can't think of projects for a noob like me to learn form. With art, I started make small but noticeable progress when I stooped grinding boxes and made pieces like this in-between exercises. (This one is form a xmiss card I made)
I can't think of a programming equivalent for this. Modding games? A BonziBuddy clone? All I can do right now is simple math in Emacs scratch buffer.
>>
>>96041546
libgen is your answer to any (english) textbook you can imagin
>>
File: challenges.jpg (960 KB, 1920x1080)
960 KB
960 KB JPG
>>96042105
There are entire collages of programming challenges for beginners. I believe there was a time when /dpt had them linked in OP, not sure why that's not a thing anymore.
>>
>>96041595
>>96041709
>>96041827
Thanks lads
>>96042193
I use libgen all the time as an il/lit/erate, I was looking for titles.
>>
>>96042205
>stack overflow
this really shows its age ooff
>>
i compare files with bytes instead of hashes
>>
File: 1594498184550.jpg (24 KB, 480x480)
24 KB
24 KB JPG
>>96042259
Good job anon. It's theoretically possible that two different files can have the same hash. Better safe then sorry.
>>
>>96040703
>Instead of setting themselves up for a good life, they pick up worthless trash hobbies like programming or literature or some shit.
Look, if you think that being a conman and thief is the way to live your best life, go you, and when the police and courts catch up with you, you stop going because the rest of your life will be fucked. That's the way the world really works.
>>
>>96042279
it's actually the size of files (in bytes)
>>
>>96042205
Thinks but I'm looking for challenges even more basic then that. I'm still confused about cdr and car in Lisp. I'm looking for extremely simple challenges like "roll a d20" wish is the only program I have written so far.
Also, we can at lest have this wiki page in the /dpt/ op.
https://wiki.installgentoo.com/wiki/Programming_resources
>>
Can't stand organization systems that most teams use.

I hate all established preferences, I hate all established culture.
>>
>>96040703
>Little girls are told this, if they don't automatically pick it up. They spend practically all their life learning how to read and manipulate people. It doesn't always work out, but at least they have a fighting chance.
Little girls aren't told this, it's literally just how being a woman works. Women only cultivate interests in things when they are too socially inept to coast on being female, which is why the few women in history who actually achieved anything of note usually had un-womanlike personalities.
>>
>>96017415
Alright, well, that doesn't help.
If this is done not from the database itself(and assuming the database is MySQL,) considering using limit 3 order by desc?
>>
File: 1677822518646853.jpg (72 KB, 1000x982)
72 KB
72 KB JPG
wat happens when u turn 40 and realize you've been a mid programmer ur entire life
>>
>>96043329
it doesn't really matter
>>
>>96035134
Frens do you know info/manuals of Wayland and C? I want to program a image gallery without qt/gtk dependencies. Theres a wayland-client library, right?
>>
File: 1679408944592877.jpg (49 KB, 1125x376)
49 KB
49 KB JPG
>>96043345
>>96043329
>>
>>96035982
Distinct lack of 'tism
>>
>>96035982
Don't want to hang out around a bunch of nerds all day
>>
>>96036130
Programming is math. If you don't want to face math, go do assembly. You will be so stuck up in just making something, you won't need math for a while.
>>
>>96042259
You could try to compare using compression, aka you compress the two files together and see how much it is different than the individual files being compressed. Since common compression uses patterns, if the same patterns are present it will compress with a higher ratio the more similar in content the files are. Interesting stuff.
>>
>>96041827
>>Me who read the 1997 book
>>
>>96035982
The patriarchy.
>>
>>96040632
Wouldn't it be a global variable ?
>>96040195
Eww no get a real backend in Go or C++
>>
File: 1pjq3jtjnnob1.jpg (141 KB, 1290x653)
141 KB
141 KB JPG
>>96035134
How long did it take for you guys to feel like you "know how to code?" I'm learning C++ right now with Data Structures and Algorithms, I got into a prestigious university for CS because I'm a good generalist but my coding skill is actually pretty shit. I'm constantly going on StackOverFlow and struggle to figure out algorithms to solve problems organically. All I do is memorize solutions, but I get filtered on Exams with no internet. How did you build your problem solving brain. Just struggle for 30 minutes on a LEETcode question then google the solution?
>>
>>96043329
dumb frogposter
>>
>>96042205
I'm 24 and i've been programming on and off for 12 years without actually mastering anything. Are these going to help me fix the holes in my learning?
>>
>>96043729
>Wouldn't it be a global variable ?
No, I'm pretty sure it's a private/protected variable.
the tl;dr of my problem
>animated image with an alpha layer goes in
>it's cropped to cut as many empty pixels as possible
>I can't find a way to restore the original image, or prevent it from cropping, so if I re-animate it it's messed up (either stretched or miss-positioned (e.g. original image is 110x100, frame 1 is 90x60 frame 2 is 80x70))
The original offset isn't in the imagereader.
It isn't in the imagereader's individual images.
It isn't in the image the imagereader creates.
It isn't in the metadata (for this one anyway, I believe I solved it for another format).
Changing read parameters doesn't seem to do anything to prevent cropping. Hell, I just realized it may be cropped in the image itself if the image includes offsets I don't have access to.
>>
>>96043792
build things instead of being in the homework mindset
>>
>>96043792
how old are you? it is like music, if you weren't a brilliant pianist when you were 15, you are not going to become a brilliant pianist in your mid 20s. however, you don't need to be good at programming to get a job and earn a living
learn cs, basic math, understand common data structures like linked arrays, lists, trees, maps and graphs, program something real (don't waste your time with leetcode), in other words, go to college. get a degree, cover the basics, and eventually you will land and pass an interview
or better yet, do something else. talented or not, spending 8 hours in an open office floor staring at visual studio, pretending to be doing something and reading random stackoverflow questions to pass time is worse than manual labor (I have done both)
>>
>>96043432
https://wayland-book.com/introduction.html
>>
>>96043329
what gives?
>>
File: 1393203971183.png (136 KB, 340x370)
136 KB
136 KB PNG
>>96042105
>The op for /dpt/ needs links to resources.
We've been over this many many times in the past. No, we don't need that shit.
Programming is too wide and people have strong enough opinions on everything that nobody is going to agree about literally anything that goes into some OP list.
Then it's just going to turn into a shitposting war about whatever the OP's favourite language/resources are, and people making threads way too early in order to go on about their awful meme languages or whatever.
>>
>>96044007
When and why is it being cropped? Honestly, this is kind of a stupid problem and it sounds like you are using a shitty tool incorrectly.
>>
>>96044185
i coulda been a contender
>>
>>96044090
Thanks.
>>
>>96044575
>When and why is it being cropped?
When? Could be when it's read, could be cropped from the start. If I had to guess it's when it's being read as ImageReadParam does reference clipping, though none of the "we clip based on X" methods solve this.
Why? Muh optimisation I guess. As I said, it's only cropping "unused" space at the edges.

>Honestly, this is kind of a stupid problem and it sounds like you are using a shitty tool incorrectly.
I don't think you understand how retarded ImageIO is, for some reason their main image container (BufferedImage) explicitly supports single image images, meaning not animated images. In fact the suggested fix for that is to use an ImageIcon to hold animated gifs.
Works well for gifs, what it doesn't work for are webps (they can animate by the way). It doesn't use ImageIO, it uses an older system, so ImageIO plugins don't affect it.
So what do you do? You create a slideshow of BufferedImages and update it with a timer. You can get all the images with ImageReader.read(index) easily enough, it's the sizing and orientation that's an issue.
It is a stupid problem, it is a shitty tool. The fact I have to access metadata to get a gif's offsets is disgusting.
>>
Certified retard here, how the fuck I install go-sendxmpp into Ubuntu 20.04?

Running this
$ go install salsa.debian.org/mdosch/go-sendxmpp@latest
did fucking nothing bar downloading some files. Go itself works fine, though.

>inb4 just run newest release and shit
Sorry, due to extremely constrained hardware situation I'm forced to dev, test and run prod at the same machine.
>>
>>96038747
>what is stopping them from having normal interests in general?
I recently saw a video about this, most women, infact the majority of women report having "no hobbies". Because they all default to watching tv or "going out with friends". The conclusion was that women don't really develop interests early in life if they are attractive on any level.
>>96040703
>They know what's important.
They don't, its why they can't understand or get over the fact that their boyfriends and husbands spend so much time thinking about the Roman Empire. Culture is ultimately handed down man to man, the only large impact women have on the culture is via what they buy.
>>
I've had this script for a while that downloads all the images from a thread. I pretty much only ever used it for wallpapers. Today i went back and changed it to download every single image on whatever board. I thought it was clever to also take md5 hash of each image to avoid having ten thousand copies of commonPePe.jpg, but it runs really really slow. It probably will take an hour or more to finish every thread. Maybe even longer. So far i haven't been able to get it to run all the way through before something goes wrong. Is there a smarter way to do this? Also how would you guys sort the images? For now im keeping them separated by board and date, but then i guess it would be hard to find specific images later because it will only be in the 1 folder for the first time that specific image was saved and nowhere else.
>>
>>96045098
>Is there a smarter way to do this?
stop using python
>>
File: presses.gif (234 KB, 355x594)
234 KB
234 KB GIF
>>96035134
new on screen keyboard
it's for my phone
>>
>>96045112
Ok. What language should i use instead?
>>
>>96045200
C++
>>
>>96045200
Try Nim, since it is very python-familiar.
It also has an implicit main, so you can write very script-like things.
https://nim-lang.org/
>>
>>96045112
Remind me why we hate python again asides from the fact that it is Pajeet central?
>>
>>96045260
>>>>>>>>>but it runs really really slow.
>>
>>96045214
No thanks, i hear horrible things about c++
>>96045227
Sounds cool i will check it out anon
>>
>>96044088
>if you weren't a brilliant pianist when you were 15, you are not going to become a brilliant pianist in your mid 20s
That's only if you're just starting out. If you get exposed to reading and understanding syntax but not exactly making your own, there's still a capacity to put your prior knowledge to good use with new material that can help you fill in the gaps.
>>
>>96040195
>>>/g/wdg
>>
>>96045270
To be fair part of that is being rate limited. I could probably make it faster with multithreading too. But yeah... it's maybe 1 imahe per second with occasional boosts here and there. And frequent long pauses. Also never realized just how much the same images get reposted until now, i think within a few days of running this every so often, probably will only be storing a small handful of unique images and skipping over endless duplicates
>>
>>96045227
Based. That's what i'm using too. You should tell the other anon that he might hit a few big bumps in the road because a lot of the language documentation for nim isn't exactly finished.
>>
>>96045098
>but it runs really really slow
If it only started running slow after the MD5 addition, you did it wrong. MD5 as far as hashing algorithms go is intended to be fast, there is no way an hour per thread could ever make sense because I can manually download all of the images in that time, get the hashes, put that in a text file, print them out, and copy them down by hand.

> Is there a smarter way to do this
We don't know what you are doing and neither do you. Clarify when the slowdown occurs, temporarily comment out the MD5 bits, and instead just compare file names. If you did what I think you did, it will still be slow.

Post some code so we can actually give you a useful response.

>how would you guys sort the images? For now im keeping them separated by board and date
Sort them how you use them in such a way that minimizes the time taken to find them. If that means introducing tags, then you may require the services of a database.
>>
>>96045288
weak
>>
File: ceo doge.png (130 KB, 346x346)
130 KB
130 KB PNG
>>96045382
>weak
The nigger just doesn't wanna have to use '::' to access class members all the fucking time, that's all. Sheesh.
>>
>>96045288
anon a program like that is literally intro to programming tier
regardless any other language would be better, i wrote something very similar in powershell for pirated patreon galleries before i found out about gallery-dl except i was using sha256 hashes, it ran fine
>>
>>96043991
>>96043991
U never master anything sport. You just build the skills to find what you need when you need it
>>
>>96045462
Okay, well in reality i just need to figure out how i can write coherent algorithms without quitting and hating myself. I realized that learning syntax and looking at wikipedia math pages isn't enough at all. I need supplementary information (books) to help me pick apart and understand how to make my own algos. Luckily i found them in this thread from that one guy who posted the infographic. I'll be getting to work on reading it soon.
>>
>>96045333
>a lot of the language documentation for nim isn't exactly finished.
What things did you run into?
For me it has been more obscure but important semantics that i find in forum posts, or issue discussions, or occasional downgrades from D. (Like Nim's standard lib)
Most recently, trying to get a string of an identifier name.
In D, every variable has various "properties", so you can just do:
int theThing = 1;
theThing.stringof.writeln; // "theThing"

https://dlang.org/spec/property.html
But in Nim, AFAIK, you are forced to use a macro, which i guess was probably due to nim's AST macro focus.
import macros

macro stringof( x: typed) string = x.toStrLit

var theThing = 1

echo stringof theThing # "theThing"
>>
>>96045443
im not a creative guy idk what else to do please give me ideas
>>96045378
Well first i download the image then
 
hash = getattr(img,algo='md5')
hash.update(img)
return hash.hexdigest()


It's pretty barebones, literally just get list of threads, go to them one by one and download/check hash. For storing the md5s its in a SQLite db but i load them all into a set at the start so i dont have to keep reading it
>>
ive learned languages like go haskell and elixir but I only get hired when I look for javascript or php jobs...
>>
>>96045510
>What things did you run into?
Unexplained user defined procs in standard library modules named '%[]=' or some shit like that, a fuckload of other procs that share the same symbology with others in other modules (it'll be a fucking nightmare to use either of them in the same project but i guess you can tell which is which by the arguments accepted), generics are a hassle, pragmas are another thing to watch out for as well. Nothing serious, i just find it to be quirky as hell. Still useful, but its very easy to get mixed up.
>>
>>96042811
99 problems
https://www.ic.unicamp.br/~meidanis/courses/mc336/problemas-lisp/L-99_Ninety-Nine_Lisp_Problems.html
>>
>>96045581
>no haskell jobs
impossible... /g/ told me the truth? haskell sisters...
>>
>>96045675
yes i feel like half of my jobs have been in php but i still dont even consider myself a 'php programmer'
>>
>>96045675
Finding an actual Haskell job is a nightmare, beyond the regular nightmare.
>"Haskell Programming"
>Nice To Have: Haskell Experience
>What You'll Do: Front-End in Javascript
>>
>>96036042
Learn a normal language like Java. It's shitty but will give you a solid foundational understanding of how programming works. Learn the super basic of basic shit like primitive data types, variables ect. Then work on the ifs, else n shit, which will also teach you basic loops. Then once you understand that rudimentary shit start on classes. Then polymorphism. If you can get that far, then you'll have basic knowledge of programming. It's not hard, just need to put the work in. If Java seems daunting then programming is not for you. It's an old school language that sadly most of the world uses so may as well start with it.
>>
>>96045937
How are you supposed to learn java without pajeets?
>>
>>96045969
learn forth
>>
>>96045754
Why are they like this?
>>
File: 1654604042974.jpg (86 KB, 540x720)
86 KB
86 KB JPG
>>96044477
That makes sense.
>awful meme languages
That reminds me that LOLCODE exists.
>>96045671
This is closer to what I'm looking for, ty Anon. I also found simple starter challenges on a site called Edabit. Searching "Programming Challenges" gets my so meany sites that want to sign up to keep score or somthing. I just want solve little puzzles in Emacs, I don't care about this Facebook shit.
>>
>>96045969
>How are you supposed to learn java without pajeets?
You simply embrace the bandicam screen recorder, shitty video quality, shitty mic, loud ass air conditioning, and thick incomprehensible accent
>>
>>96046212
It's actually easier for me to handle those than the well presented videos of white professors rambling on about fucking nothing
for better or worse pajeets tend to skip to the point
>>
>>96036042
what this anon said >>96045937
as well as once you learn how to code and spit out some very basic projects (hint: you should be looking for things in your life you will use or for projects to do at your level of learning, I would say more than half of learning programming is slamming your head against errors until you learn.) you should also read other people's code if you can. People will say "programming is flexible" which it is, but you won't really know how flexible it is until you see how vastly different your code is from someone else's.
Other than that once you feel comfortable with the foundations you should start to read books or go out of your way to learn tips, tricks, techniques, and shortcuts to trim down your code of as much fat as you possible can, get into the habit of annotating everything but the most painfully obvious, if you are in doubt if you should annotate it, just annotate it. If your willing to look at this thing as "I want to learn at least 1 new thing about this language everyday." You'll be extremely competent with the language by the end of the year. Its litearlly just word legos, simple concepts just build up to bigger, more complex programs. Its awesome.
>>
>>96046269
>how vastly different your code is from someone else's
But all I do is copy and paste what I found on Google, same as everyone else?
>>
>>96046282
>same as everyone else?
I guess I'm showing my age then? I almost always do everything by hand, from scratch.
>>
>>96046287
I'm about your age but with less than half the experience and then some, I don't have time to learn things the old fashioned way. Shortcuts today, shortcuts tomorrow, shortcuts forever!
>>
>>96035134
Dashi aoba
>>
>>96046316
Anon, why do I have the feeling that you do have time, but you would rather just play video games, jerk off, and watch anime than be productive? Your hobbies will still be there after you learn to code.
>>
>>96046349
Because you're trying to fit me into a specific stereotype?
>learn to code
Googling the answer is learning. It isn't what you had, but you had, what, 20+ years of experience including time spent screwing around as a kid? Why would you suggest someone spend that much time when it's so horribly inefficient?
>>
>>96046436
meh, if it works it works. If you have a job and you have money you can always just take a course at your community college. I forget what its called, but there is a special status you can request just for the information so you don't have to worry about grades and shit.
>>
>>96046483
I did take a course at my college. That's how I learned to Google.
>>
File: 1686084263402134.jpg (44 KB, 320x401)
44 KB
44 KB JPG
>>96046525
>That's how I learned to Google.
>>
>>96046316
How old are you anon?
>>
>>96046532
Old enough to drink a Monster Zero.
>>
>>96046547
>Old enough to drink a Monster Zero.
Damn, you're fucking old. I bet you're one of the last living COBOL programmers.
>>
>>96046532
About your age. Can't you read?
>>
>>96046557
>>96046547
This board needs IDs, holy shit.
Also
>About your age
Okay, but how old? I'm 24. idk about the other anon
>>
>>96046555
Too bad it never went anywhere and now I have to cheat like crazy huh
>>
>>96046575
>other anon
He's (You). I am (You). We're anonymous, that's the fucking point of 4chan.
>>
>>96046587
>We're anonymous
Pseudo-anonymous, yes.
>>
>>96045167
why is it like that
>>
>>96046452
Funny note. In Japan, gays are still super shunned and disliked in most facets of society, so they do a job that requires the least interactions with people. Guess what jobs most jap fags have? I wonder if that's one reason that draws fags and tranners to the trade.
>>
>>96046452
>makes me want to fuck him so badly
fuck him, then. shower with him, clean his butthole, dry up, put him in a maid dress and fill his booty up like a boston creme donut
>>
>>96046658
>untouchables do X
>so all/most people that do X are untouchables
Don't you retards realize you're being useful pawns to the untouchables by perpetuating this nonsense?
>>
>>96046658
I honestly think its men who don't feel manly (as in they never did a sport, they aren't phsyically imposing, they don't like to exercise) so instead they gravitate to technology and sedentary pursuits because they mistakenly think that they will never be good at doing physically active stuff. Staring at screens all day indoors, pulling long hours and sleepless nights deving code, eating fast food that is filled with plastic and other estrogen-mimicking chemicals, put drinking (if they drink) on top of that, as well as coffee (cheap coffee is estrogonic due to the chemicals they use to treat it) and their growing waist line that also reduces testosterone and promotes estrogen. Mix that with mental illness, anxiety, or just general mental vulnerability of any sort and you have the perfect cocktail for someone to be groomed into being transgender. A lot of the times the reason they don't "feel like themselves" is due to the fact that they just aren't taking care of themselves. Passivity is known to breed mental illness.
You know why the Victorians were weird and inhibited but they weren't all dressing up like women? Because jerking off was seen as something shameful for men and a lot of them had to exercise via sports, walking, working and they were eating pretty healthy food compared to what we eat now.
>>
>>96045536
Ok, does it take an hour whether you hash them or not? If you download them all then go back and hash them after the thread is archived or deleted, does it take an hour to hash offline?
>>
>>96035134
I am getting filtered by COP 1220, it's over for me
>>
>>96046452
>taking estrogen ironically
>>
File: 2023-09-16 20-26-11.webm (1.1 MB, 1920x1080)
1.1 MB
1.1 MB WEBM
>>96035134
I wrote a Conway's Game of Life sim. I thought it would take me most of the weekend, but it was shockingly easy. I used raylib to render the window and the graphics. The entire thing came in at just over 100 lines of C++.
>>
>>96048718
looks cool but I don't know what "Conway's Game of Life sim" is. I'm assuming it runs on linxu?
>>
>>96048759
https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
>>
>>96048788
its too late to read it and i'm tired but this just makes me want to ask more questions.
>>
>>96048759
>>96048838
I wrote it and it's running under WSL, but none of the code is vendor specific. You can just take a look at the pretty pictures in >>96048788
>>
>>96048718
make a slider bar for the sim speed

also, consider using some color for the old vs new
>>
>>96048939
>make a slider bar for the sim speed
Yea, that was the next step. After that I'm either going to make the grid wrap around or zoom out.
>>
>>96035821
Book/ISBN?
>>
>>96048718
The classics are nice and easy to implement if you're not going full autismo optimization.
>>
alright, I'm like.. maybe 5 minutes from learning something useful about using the monadic operations included with optional and expected....

https://youtu.be/cE_YaFMhTK8?t=1629
>>
newfag here.
Is
int array[5][2];
it 2 arrays of 5 ints or is it 5 arrays of 2 ints?
>>
>>96050183
5 arrays of 2 ints

you have one array that you make into an array of arrays to 2 ints with the second [number]
>>
>you need to git commit or stash modified files before you switch branch
dumbest design of all time
>>
File: new.gif (87 KB, 391x653)
87 KB
87 KB GIF
>>96046630
work in progress
>>
>>96050465
thanks Linus
>>
>>96050465
If you think about it for 5 seconds, you'd see why it doesn't support that.
>>
I was reading this https://people.freebsd.org/~lstewart/articles/cpumemory.pdf and was thinking about a post I made a week ago >>95768535
Turns out you can get a ~25% speed improvement just by switching the load/stores to stream_load/stream which avoids the caching protocol overhead since we know the data is only operated on once (in this benchmark at least)
               | cycles       | speedup
---------------+--------------+--------
naive | 9964904692 | 1.00x
naive_lut | 1578250200 | 6.31x
naive_bp | 11058806930 | 0.90x
anon_asm | 2208684412 | 4.51x
simd | 487999457 | 20.42x
simd_streaming | 407442992 | 24.46x


Also, if you manually unroll to the size of a cache line (2x __m256i) using the same technique you can get a ~1-2% improvement over that (might just be measurement noise, but it should be better for write combining).
>>
>>96035821
Well email the author the image and show him he's wrong.
>>
>>96050920
>what is git worktree
>>
>>96051039
Something completely different.
>>
>>96050957
Great article, anon. I wish I had circuit engineering degree to understand that
>>
>>96051057
elaborate why git doesn't support switching branch without commiting/stashing and why git worktree doesn't allow you do that
>he won't
>>
>>96051123
Skip to section 6 for programming advice. Most of it is just discussing how memory works in hardware and the various optimizations they employ

Main points are
>DRAM is slow but cheap
>SRAM is fast (caches) but expensive
>Memory bottlenecked workloads won't improve with more cores unless its a NUMA architecture due to the FSB being the bottleneck
>Hyper Threading is good if the working set (the data in memory being operated on) overlaps between the hyperthreads, otherwise each hyperthread has basically half the L1$ space available to it
>Cache misses are expensive, avoid them by maximizing temporal and spatial locality of memory accesses, and by using hardware/software prefetching
>The hardware prefetcher cannot cross page boundaries because it could incur a page fault, strided (0 .. 512) memory access patterns are recognized by the hardware prefetcher, but requires two or more accesses to trigger it
>Maintaining cache coherency on multi core systems is expensive, but the MESI protocol used is optimized for sharing reads between cores, writes however become a bottleneck
>Critical word loading is where the CPU can request the particular word it needs during a main memory access first, e.g. the CPU might need 1 uint64 from the middle of the cache line, it can technically fetch that first, then the rest of the cache line to reduce the latency. As soon as the word is available it can continue execution
>Virtual address translation is too expensive for some caching scenarios, hence L1$ uses virtual addresses directly, where L2$/L3$ use physical addresses which are more robust if the same physical memory is mapped to multiple virtual locations (less cache use for the same data)
>TLB cache misses are really expensive since you might have to do several lookups in main memory and go through the OS if there is a cache miss
>L1i$ actually caches the decoded instructions (so the CPU can skip the decoding step) so self-modifying code is expensive, as is L1i$ misses
>>
>>96035134
I have no idea what to do. I want to make a game but I also want to figure out a project in ruby so I can have one under my belt.
>>
>>96043792
Hard to say. I already dabbled in a bit of PHP before I started my professional journey, not sure if that counts. I'd say after a year I was pretty comfortable. After two years I was a very productive code monkey.
But nontheless there is always more to learn, there is always a deeper hole to get into. I have over 10 years of experience now and there is still lots of possibility of expanding my horizon.
>>
>>96051725
I'll add that knowing the theory basics like control flow, data structures and such is certainly important, but what matters more is experience. Seeing lots of code bases, trying out different ways to do the same thing, developing an understanding of what is the best way to solve a problem. Cultivating intuition.
>>
>>96045754
>search for remote
>"We do NOT allow remote"
>>
>>96051440
Ruby is great for making video games!
I mean, it could be. I can't think of any examples. But that just means you'll be a pioneer!
>>
Any nim fans around?
>>

/*
* W A R N I N G
*
* If you think you know what all of this code is doing, you are
* probably very mistaken. There be serious and nasty dragons here.
*/
>>
I'm new to C++. I'm storing an object as the value in a map that has two items inside, an int and a char* pointer.

In the destructor, I free the char* buffer to avoid doing it myself when the item is removed from the map.

However, when I insert a new object into the map, the destructor is getting called before I erase() the item myself. Can someone point me to what's going on here?

Is there some way I can save the buffer being freed until the object itself is deleted from the map because I called erase? Shared pointers maybe?
>>
>>96052356
Use RAII types like std::string instead of naked new/delete. It will save you pain.
>>
>>96052380
Cheers. Replaced the char*s with strings and there's no headaches. Should have done that from the start.
>>
>>96052017
I originally posed this as two conflicting ideas, a crossroads at which I am continually stepping in one direction and running to the other.
>>
>>96052309
What do they call themselves?
nimggers?
>>
Bros I'm considering moving from C++ to Rust please stop me
>>
>>96055324
rust is an unholy mix go purely functional like haskell instead
>>
>>96055402
Shill me Haskell
>>
File: 1691637000763078.png (900 KB, 383x600)
900 KB
900 KB PNG
>>96055415
I'ts pure, It's functional and at times it will make you want to blow your brains out.
>>
>>96055415
rust is haskell: the good parts
>>
>>96050183
In fortran and linear algebra it is 2 arrays of 5 ints, in C 5 arrays of 2 ints
>>
>currying
>algebreic data types
>monads
>type systems
>lambda calculus
>parametric polymorphism
>category theory
>laziness
>functors
>immutability
>higher order functions
>computer science

mfw
>>
>>96056093
i guess faces are a side effect
>>
>>96035134
trying to decide if i should learn VBA or pandas.
I have about 10000 entries i'm updating monthly with webscraping. I just hate making a bunch of random excel tabs with shitty analytics scribbled everywhere. Is pandas going to pay off dividends later?
>>
Started to rewrite the core of my json lib to make it more modular https://gitlab.com/Meithal/cisson/-/merge_requests/3/diffs
>>
>>96052356
you need to understand the rule of 3 (more like the rule of ~5 on c++11).
generally you should follow the rule of 0 which you can accomplish by using std::unique_ptr<char[]>, or by using std::vector<char> or std::string (strings are great because of small string optimization, but does not apply for strings longer than 15 bytes).
>>
>>96055324
good call, did that after c++17 came out and haven't looked back
>>
File: F6Jl5HHWgAAnCtW.jpeg.jpg (629 KB, 1792x1792)
629 KB
629 KB JPG
>>96035134
I'm learning x86 ISA. I'd like to be able to decode any given instruction just by looking at bytes and looking them up in a resource like some intel reference manual. How do I do this? I know there's r/m and SiB bytes at play that change the final instruction bytes but I can't find any resources that would explain actually making sense of a whole example instruction taking all the mods into account.
>>
>>96058394
The early chapter on the instruction forms and the later chapters on opcode definition should be all you need. There's a few big tables that you would have to look at. It's pretty complex to do by hand, not easy like RISC at all. If you just want a tool to do this I would recommend using a library like Zydis and writing a simple C program that takes bytes as hex as input and prints the decoded opcode. I'm sure there's a Python library as well that could be used for the same purpose.
>>
>>96058449
>The early chapter on the instruction forms and the later chapters on opcode definition
I've been through these via Intel mans and I can map some 16bit instructions on a SiB table, but there's still something I'm missing when it comes to the whole picture. I know it's complex, I really want to do this anyway and I'm looking for good resources
>>
File: string_types.jpg (191 KB, 1920x1080)
191 KB
191 KB JPG
>hey C, how many layers of string types are you on?
>maybe 2 or 3, why?
>hah, you're like a little baby. watch THIS
>>
>>96059715
your char*? there's no such thing as PathBuff. the u8 containers aren't string types
>>
i want to try and learn more about communication between computers. i haven't done anything like this. i want to make like, a super basic commandline messaging tool. like i run the program on two computers, and if i type text into the first one, it appears on the second one.
i'm just starting this but this is pretty daunting, im not even sure what is the best way to do this. i'm reading about websocket right now which is my current plan, but i'm wondering if you guys have any direction you could point me in.
>>
>>96043792
>All I do is memorize solutions
you're in college this is fine. you probably have other classes too, right? your brain is getting pummeled. just do what you have to do to get your degree and practice building useful stuff outside of class
>>
>>96059715
Great examples of too many and too few types
Both a re a pain in the ass on the long run
>>
>>96060043
some of those aren't even string types.

owned string types: String, CString, OsString
borrowed: &str, CStr, OsStr
>>
Im doing a game where items has different prices depending certain conditions (store, date, offers, etc..)
Whats the best way to set their price(s)?
>>
>>96059715
What did you expect from Rust if it's created by people with a lot of genres?
>>
File: 1694803647874570.gif (87 KB, 170x170)
87 KB
87 KB GIF
>>96059715
>string is just an array that can't have 0 in it
>>
>>96052355
sounds like someone needed an abstraction, but didn't have the language tools to create one.

Cniles, kek.
>>
>>96059715
Looks like one of them is lacking. Let's hope it won't result in bå¥Segmentation fault (core dumped)
>>
>>96060418
>The basis of thousands of essential irreplacable libraries
>Zeroless arrays
They have played us for complete fools
>>
>>96059715
>Real genders
char*
>Made up genders
&str, String, &[u8], CStr, OsStr, Path
>>
>>96060790
yeah C strings were always stupid
>>
Is it possible to make numpy give exact answers instead of approximating constants to floats and solving?
for example make arcsin(1) give pi/2 instead of 1.57...
>>
Makefiles and shell are both garbage.
I wanted to compile and run a program with "make test arg1 arg2 arg3 .." and have the rule test looking like this maybe "test: all" "./program $(ARGV)" but of course the make creator didn't thought we would need to do this so there is a potential workaround but it's too ugly to even try.
https://stackoverflow.com/questions/2214575/passing-arguments-to-make-run/14061796#14061796
Decide to make a shell script "./make_test" instead.
make
./compiled_program "$@"

but there is this annoying message appearing every 2nd, 3rd, ... run
>make: Nothing to be done for 'all'.
Simple solution is to run make, capture stdout and stderr into separate variables, prints them only if $stdout != "make: Nothing to be done for 'all'." Of course it's an unreadable mess.
https://stackoverflow.com/questions/11027679/capture-stdout-and-stderr-into-different-variables
>>
>>96062361
>numpy
probably not
>>
>>96062361
Dunno about numpy but with how floats generally work the answer is no. Just multiply by some factor of 10 then cast to an int.
>>
auto main(int argc, char *argv[]) -> int {
return 0;
}

vs
int main(int argc, char *argv[]) {
return 0;
}
>>
>>96062784
you forgot [[nodiscard]] constexpr and noexcept plus all the consts
>>
>>96060441
If you think only cniles slap that warning you should see my prolog code.
>>
>>96062784
https://blog.petrzemek.net/2017/01/17/pros-and-cons-of-alternative-function-syntax-in-cpp/
>>
>>96062361
numpy is for floats. You're looking for sympy, or a proper CAS.
>>
>>96062985
>pros: it offers a shorter syntax for commiting horrific crimes against humanity
>cons: fucking look at it
that's a no thanks from me, dawg.
>>
>>96063066
I like it. It's pretty and filters boomers.
>>
>>96035134
Making robots, or rather trying to get the government to give me money to make more robots
>>96035884
Holy shit the book isn't telling you to fuck off
>>96035982
Supposedly, the ~1-2% of males who commit various forms of sexual assault, and the ~97% of people who are aware of it happening but do nothing about it.
>>
File: devenv_pWgyN5rxMe.png (112 KB, 1155x629)
112 KB
112 KB PNG
I'm writing a fantasy console in C++ which uses an virtual machine as its runtime. That VM runs a superset of 8080 machine code (added a few instructions to support ROM banking). I just debugging symbol generation to the Assembler so that I can set breakpoints within the original assembly source and then trigger those breakpoints when the PC is equal to the associated memory location.

It will be a 250x250 pixel screen, and will have multiple video modes (either 2 bit rasterized vram or memory mapped sprite attributes).

The gameboy is the inspiration for the architecture, but I want to try to expand on gameboy's features and also make it a bit simpler to program the games (not having to worry about jamming a bunch of instructions into the vblank period, input state can be queried at any time, or custom interrupt handlers can be written).

I'm thinking of requiring programs to be distributed in full source rather than as compiled binaries because it's easier than disassembling, but I might write the disassembler anyways and also add a hex editor.

Here's a screenshot of the debugger working. I've already got mapped sprites rendering but will end up refactoring that. I still need to define what all the different memory regions will be for each video mode as well as what areas will be bankable ROM vs working RAM, bios, interrupts, etc.
>>
>>96035982
It's just not that interesting to them
>>
>>96035982
>>96063164
It's complicated. Something about women's brains make them very well suited for academic environments. Men are more likely to graduate with a bachelor's degree and get a job in software engineering, but women are more likely to continue in academia and get a masters or PhD end up teaching or researching. The majority of college students and post grads in the US are now women. Men, on the other hand, don't seem to be well suited for the academic environment (men are behind women in academic performance at basically every level, especially college and postgrad)

Some women say they were harassed in the workplace and decided to go back to the safety of the university, while others never had an interest in the private sector in the first place. I believe there are just biological differences in how men and women think and operate under different systems of rules (e.g: the workplace vs the university) that makes us better suited for different environments. Men excel at work, women excel at school. We should build society around these inherent genetic differences so that both men and women can live our lives to the fullest
>>
>>96063297
back in the kitchen you go
>>
>>96063297
>Men, on the other hand, don't seem to be well suited for the academic environment
Men invented the academy.
>women excel at school
lol
>We should build society around these inherent genetic differences so that both men and women can live our lives to the fullest
There is nothing to build. The one we had was like that, the one we have now wasn't built, it's the result of the desctruciton of the previous one.
>men vs women behavior blah blah blah without mentioning how everything is bent out of shape now
literally fuck off reddit
>>
>>96063502
My guy, I may sound like a raving leftist, but what I say is for the good of men. Men are being left behind by society, and universities are the arbiters of the white collar workforce. Women now make up most students in universities and men are increasingly dying deaths of despair. The academic system we built *just so happens* to be one that women are exceptionally good at, while men tend to drop out at higher rates. You cannot override biological fact, no matter how much you want to change your gender: you are not a woman and you never will be
>>
>>96063653
divine authority is given to man in the form of logos, women are pretty much just animals
>>
>>96063696
Oh are you doing that Isaac Newton thing where you stay a virgin your entire life so you can be good at math?
>>
>>96063749
dangerously female line of reasoning
>>
>>96063653
Right, it was confusing written like that.
>The academic system we built *just so happens* to be one that women are exceptionally good at
Yes but only because it has become complete BS.
>>
>>96063297
you know ze rulez
>>
>>96063066
>shorter
But you're adding an extra word and an extra symbol, how is it shorter?
>>
>>96063861
template <typename T>
auto LinkedList<T>::begin() -> Iterator {
return Iterator{head};
}

vs
template <typename T>
typename LinkedList<T>::Iterator LinkedList<T>::begin() {
return Iterator{head};
}


It also keeps function names on the same alignment so that's nice
>>
assert(0)
>>
>>96063297
>The majority of college students and post grads in the US are now women
see what happens to that statistic if you remove all the meme degrees like sociology and psychology
>>
>>96059760
wasn't there an old unix utility 'talk' that did this? Basically, open up at least a pair of connections (probably a trio for a listen/announce port, but you don't have to. Basically, take one's transmit and send it to the other's receive, and vice versa. I recommend the whole listen port thing and a simple handshake before opening the paired ports.

If you want to start simple, try to get your program correct locally, possibly using named pipes or even sets of text files to simulate the network aspect to help you separate the core functionality.

>>96062812
also
[[maybe_unused]]
>>
duo-lang kinda cool
>>
>>96063153
cool
>>
>>96063911
You didn’t need the trailing type here at all, just auto suffices.
>>
>>96063153
Neat. I didn't know that the gameboy had the 8080 architecture.
>>
>>96059715
Show me one, concrete definition of a string is and I will show you a fool
>>
>>96064658
yeah I agree. I'm totally on rust's side on that one (and everything else). each of rust's types has a good reason to exist, rust doesn't try to run away from the complexity of the modern world.
>>
>>96064325
Sure, but I want to specify the return type
>>
Working on a hobby OS to show off in my upcoming Google interview.
>>
>>96063297
>Something about women's brains make them very well suited for academic environments
retard take. The academic environment is something built by Humans. There was a time before women in academies and there was a definite shift that made academies suited for women - this was actually done by conscious decision.

It's like saying
>There is something about the weight of bicycles that makes them very well suited for the load capacity of the bridges around us.

>I believe there are just biological differences in how men and women think and operate under different systems of rules (e.g: the workplace vs the university) that makes us better suited for different environments
Again, these are constructed environments. We made them that way.

>We should build society around these inherent genetic differences so that both men and women can live our lives to the fullest
Shit, you can't even mention genetics these days and lots of people are afraid to even try to define a woman. Frankly, I agree with >>96063502
The death of the multi-generational middle class family was been a disaster, and the people that believe the family should be torn down are not shy about it, they'll tell you.

They are fools, of course - middle class families as a power structure were the only real hedge against institutional power. Naturally, institutions were happy to help them destroy the family unit.

>girls do better in a school environment than boys!
If you build bridges for pedestrians and bicycles, you should not be surprised that not many trains pass over them.
>>
Search-and-replace with regex is non-destructive in all cases, or am I missing something obvious? It's always reversable by merely switching the query and replacement, correct?
>>
>>96066694
Of course it's destructive. What if you search for /[0-9]+/ and replace it with "NUMBER"? How would you reverse that? The mapping can only be reversible if you preserve all of the information from the old string in the new string.
>>
I'm noticing signs of a keylogger fucking up my keyboard input.

What do?
>>
>>96066694
>It's always reversable by merely switching the query and replacement, correct?
First thing coming to my mind is overlapping issues.
There are also things like this:
s/\d+/0/

# how do recover the deleted number? what if the string already contained a zero?
s/\d+//

Same issue, how do you recover the number, and if you stored it where would you put it back again?
The thing is that you map if there is any quantifier, alternation or character class, you map several or an infinite number of substrings to only one (the replacement string).
Even if the regex was a fixed strings there would still be problems.
>>96067533
What signs?
>>
How should I store a message encoded as bytes in a struct? I have a document with a table telling me the message format and it looks something like this:
field            byte #
message signature 1
message length 2
value 1 (high byte) 3
value 1 (low byte) 4
value 2 (high byte) 5
value 2 (low byte) 6
value 3 (high byte) 7
value 3 (low byte) 8
checksum 9


so I'm going to take the input, parse it byte by byte and push those bytes into my struct. my questions are what types should I use for the struct members? should I combine the high/low bytes or leave them as pieces? does how you lay out the struct change if you plan to also write the message back later on?
struct hi_lo {
char hi;
char lo;
};

struct message {
char message_signature; //?
uint8_t message_signature; //?
...
uint16_t value1; //which
char value1[2]; //one
struct hi_lo value1; //should
char value1_hi; //I
char value1_lo; //use?
};
>>
>>96067892
__attribute__((packed))
struct {
uint8_t signature;
uint8_t length;
uint16_t value[3];
uint8_t checksum;
};

What about endianness?
>>
>>96067892
As an union?
>>
>>96068109
each field in my byte stream has a table telling me exactly what bit is what so endianness shouldn't matter. for example, a 16 bit value is actually 3 separate components (12,3,1) that you need to use together with some math function to get a number
>>
>>96067809
>What signs?

keys I type in are instantly deleted and then re-pressed, which is fucking odd
I don't have any custom keyboard software installed, mouse software yes though.
Like you start typing a sentence and while you're typing you see the character you just pressed deleted as if you pressed backspace and then re-appear.

Could be a software bug somewhere else, but my immediate suspicion is keyboard hook keylogger. Like the window procedure for the browser interprets it and then a keyboard hook does something weird with it?
>>
>>96041379
>femoid diversity hire doesn't know shit about what she's teaching
ahahahh
>>
>>96045112
the problem is between the screen and the chair
>>
I'm 29, is it too late to learn to code? I don't like my shitty job and I'm willing to learn.
>>
>>96048718
>>96049944
I got filtered by game of life
>>
>>96060096
you niggers are insane
what the fuck
>>
>>96069540
why, are you scared of types? it makes complete sense.

alloc::ffi::CString
>A type representing an owned, C-compatible, nul-terminated string with no nul bytes in the middle.
>This type serves the purpose of being able to safely generate a C-compatible string from a Rust byte slice or vector. An instance of this type is a static guarantee that the underlying bytes contain no interior 0 bytes (“nul characters”) and that the final byte is 0 (“nul terminator”).
alloc::string::String
>A UTF-8–encoded, growable string.
std::ffi::OsString
>A type that can represent owned, mutable platform-native strings, but is cheaply inter-convertible with Rust strings.
>The need for this type arises from the fact that:
>>On Unix systems, strings are often arbitrary sequences of non-zero bytes, in many cases interpreted as UTF-8.
>>On Windows, strings are often arbitrary sequences of non-zero 16-bit values, interpreted as UTF-16 when it is valid to do so.
>>In Rust, strings are always valid UTF-8, which may contain zeros.
>OsString and OsStr bridge this gap by simultaneously representing Rust and platform-native string values, and in particular allowing a Rust string to be converted into an “OS” string with no cost if possible. A consequence of this is that OsString instances are not NUL terminated; in order to pass to e.g., Unix system call, you should create a CStr.
>>
>>96059715
babyduck NEET cnile post
>>
>>96062378
Why do you want to manually specify test variables
If you really want to do that, why do you do it through make instead of running make and then the program directly?
>>
>>96069601
>why, are you scared of types?
Because he's a retard who doesn't know how to do anything more complex than hello world.
>>
>>96063004
This
>>
Holy shit channels is go are just a REALLY shitty copy of BEAM processes. Why the fuck do people basedface over it and not erlang? Because the gay c style syntax?
>>
>>96069601
>all this is trivial to implement manually if you're not retarded
I'd rather read 50 lines of code than 50 pages of tranny docs
KISS
>>
>>96069663
>>b-because anon is nocoder!
>needs language to hold his hand
ahahaha zoomies btfo
>>
File: 9gwumjr5x5831.jpg (82 KB, 1080x1041)
82 KB
82 KB JPG
>>96035134
Where would i start for creating a GUI, but my own and not something like GTK, WinUI, SwiftUI, etc., similar to the infamous Photoshop? Some pinpoint would be appreciated as any front result on Google/DDG seems to devolve into "Just use electron, it's the future". I assume getting into OpenGL should be one of the first steps.
>>
I've been working on some multi-platform stuff lately instead of sticking to just wangblows or mobile but I've hit a small roadblock with linux.
What's the proper way to distribute software with a whole bunch of dependencies without waiting for someone to start maintaining it for their distro, containerizing the whole thing or giving users a tar.gz with build instructions and wishing them good luck?
I'm guessing doing it like on windows by vendoring your deps should be enough but I do remember reading about things like libc biting you in the ass because of version mismatch.
>>
>>96069752
>Why the fuck do people basedface over it and not erlang?
Erlang wasn't designed to be foisted onto webshits. Ironic, given how it's a better web backend language.
>>
>>96069944
Erlang is better than some daemon to keep that nodejs script running for sure.
>>
>>96069759
It's not simple to have to mentally track the lifetime and memory layout of every string. In the C codebase I used to work on, they have hand-rolled types for things like resizable strings. There are actually multiple hand-rolled types. C forces programmers to write garbage code. If you want to see some truly shitty code, go peruse the Linux scheduler (probably the rest of the kernel too, but that's the part that I spent a lot of time studying). I'm so glad that Google and Microsoft are increasingly migrating C projects to Rust.
>>
>>96069759
because it's not just 50 lines of code, you're retarded. everyone handrolls and rewrites their own string containers that aren't compatible with one another and are full of bugs. KISS is the exact opposite of what you're saying
>>
I finished up working on a bot for my small gaming community. It manages reminders and has rcon control of the dedicated servers we host for the community. Also sends activity notices when the servers are active.
It's cross integrated to talk to a Steam bot, has FTP, and SQL hooks as well for managing files and databases. Was a lot of fun. I wish I knew how I could this for others for money, but I hate marketing myself and I hate any website that's a race to the bottom against pajeets like Fiverr.
>>
>>96069651
test variables?
I wanted to run the compiled program with argv/cli parameters, like file paths, options, etc... but yes the make && ./compile arg1 arg2 is the easy way and I'm already doing it, it's just that I was improving my Makefile template. I ended up writing a neat little script that uses pipe, fork, close, open/dup2, exec and waitpid to capture the stdout and stderr of make into separate variables.
>>
>>96069752
Agreed in spirit but there are differences between channels and actors and I don't think channels are worse.
>>
>>96069898
Yeah, I'd use OpenGL these days. Maybe OpenGL ES 2 specifically if you still want to target old shit, but not the incredibly ancient.
>>
>>96068109
Why are people so quick to just slap __attribute__((packed)) onto anything?
That struct isn't going to have any padding.
>>
>>96070685
if you're packing, you're packing
if you know what I mean
>>
>>96070745
you're packin fudge
>>
>>96070685
I just manually add padding and static_assert the size.
>>
You did write tests for your code today, right?
... anon?
>>
File: Untitled.png (181 KB, 500x517)
181 KB
181 KB PNG
>>96070773
users are testers
>>
New thread:
>>96070851
>>96070851
>>96070851
>>
>>96035134
aoba-chan looks like THIS?!



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