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


Thread archived.
You cannot reply anymore.



File: 1555936849419.jpg (194 KB, 850x1096)
194 KB
194 KB JPG
Old thread: >>71819814

What are you working on, /g/?
>>
I'm working on POUNDING your fragile, tender, trembling boy pussi like I'm beating chicken into schnitzel
>>
>>71826391
>you fucking nazi autist
Vorher war ich noch so nett und habe dich zurückbeleidigt. Inzwischen nehme ich den Punkt aber gerne an - ich liege in Führung.

If anything it's Yiddish, which ironically was quite influenced by German. But if anything it's a malapropism of the original "Dummkopf". The double "m" is important, by the way, because vowels have two different pronunciations in German, long and short. "Dumkopf" would suggest the long pronunciation (like "r[oo]m"), but it needs to be the short one for which I cannot find an equivalent from the top of my head - the closest I can think of is "d[u]nce".

>>71826416
>Modern C++ memory usage patterns don't result in much different assembly from older C++.
That's not what I said, however. What I said was that the older C++ standards had features that I can defend. I'm not a big fan of C memory allocations either, but with C++ things are getting out of hand.

>>71826357 (You)
>have you ever heard of types?
I'm afraid I can't follow. Yes, I've heard of types. But what does that have to do with anything?
>>
shut up nazi
it's the Chosen People's century
>>
>>71826487
I'm not sure what your point wrt memory allocation is, then. I don't see how RAII focus is any worse than malloc/free or new/delete.
>>
File: 1557219885539.jpg (537 KB, 800x1131)
537 KB
537 KB JPG
>>71826479
gay

>>71826466
thanks for posting a programming related picture, OP

>>71826487
stop embarrassing yourself, you claimed memory management wasn't possible at compile time, types let you do just that, i.e. memory management at compile time.
Not that your damaged c_brain could ever understand I guess...
>>
File: 1499155082880.png (504 KB, 533x525)
504 KB
504 KB PNG
>>71826505
>tfw semantics
wtf is compile time memory managment. just dont compile now you use no memory. wtf
>>
>>71826517
https://en.wikipedia.org/wiki/Substructural_type_system
>>
File: 1491284636673.jpg (39 KB, 640x360)
39 KB
39 KB JPG
>>71826536
unique_ptr's gotcha. Continue the academic mastubation.
>>
>>71826569
unique_ptr has bad semantics. particularly in the fact that is is required to have a null state
>>
>>71826579
My balls have bad semantics, your mom doesn't seem to mind.
>>
>>71826579
You could write a smart pointer that can only be constructed with a reference if you want.
>>
>>71826649
There must be a null state which is inhabited when an object is moved-from. This isn't the case in real substructural type systems.
>>
>>71826659
Oh, true, I guess you have a point.
>>
File: assign.png (20 KB, 796x198)
20 KB
20 KB PNG
I never worked with APIs before. How can I learn to do this? Any tips or tutorial you recommend idk good practices?
For GUI i can just use something simple drag and drop like C# winforms or Java jframe since its not meant to be pretty should just work.
Would working with the API be easier with one or the other of these options or is it pretty much the same for both?
>>
raymoo
>>
Why and how does it happen that someone gets stuck?
I was doing fine coding each part of the problem into a solution, knew what I wanted it to do.

One, two days later, I just don't know what I should do..
I am at my wits end on solving that problem, hindering me to solve problems..
>>
https://www.techempower.com/benchmarks/#section=data-r18
The new Techempower benchmark is out, Rust is the best in 5 out of 6 categories.
>>
>>71826569
oh the fuck can you be this dumb, did you even read what it said about unique_ptr?
>>
I'd really like to know why this dude who makes programming tutorials

https://www.youtube.com/user/derekbanas

has a million subscribers.

Literally all he does is explain the basic syntax. You could read a "getting started" page in 5 minutes, or watch one of his hour long videos in which he reads it out to you.

I believe the reason why he has a tutorial on every single language and framework on the planet is that he literally just finds doc pages and reads them out.

Look at this shit "Learn C++ in one video"

https://www.youtube.com/watch?v=Rub-JsjMhWY

Why do people watch videos of things that could much more easily be read?
>>
>>71826729
>Techempower
literally who
>>
>>71826771
people are dumb
>>
>>71826771
>tutorial introduces basic programming concepts like if statements and loops
>then moves onto polymorphism, pointers, recursion
>... all in the space of an hour
>>
>>71826771
something something loo something something poo
>>
>>71826771
Because they are stupid and/or just pretending they want to learn stuff.
>>
>>71826771
Learning from Derek Banas is shit, like thenewboston.
>>
>>71826691
Contribute to open source projects.
>>
I want to make a (toy) multiplatform music player. I've spent hours reading documentation but I'm not sure if I should be using MPD or BASS or something else, as my audio library of choice. Any suggestions?
>>
>>71826888
libstdc++ is all you need
>>
what is a bloated database giving me that a lean simple ass array can't?
>>
>>71826922
indexes
>>
>>71826922
relational algebra?
>>
>>71826887
why?
don't they want people who already have profound experiences beyond some projects and classes?
>>
54
but I can get that with a simple structure like a goddamn array?

67
is it so hard to write if else yourself?
>>
>>71826977
Hard, no. Inelegant, verbose, hard to maintain and time-consuming, yes.
>>
>>71826680
winforms is easier
>>
>>71826466
Lisp is the most powerful programming language.
>>
File: 1562825808729.png (705 KB, 1296x1657)
705 KB
705 KB PNG
I can't program anymore
I become too autistic and thats all I do
as a result self-sustaining becomes incredibly frustrating and makes me suicidal
i rather be a "jack of all trades" stable human being
>>
Halp. Contrived example:
(defn foo
[a b c]
(def bar c)
(+ a b))


If I do
(foo 1 2 "hi")
it works fine (gives 3) plus sets bar to "hi".

Now I want to map this function to two arrays [1 2 3] and [4 5 6] while setting the third parameter to "hi".

(foo 1 4 "hi")
(foo 2 5 "hi")
(foo 3 6 "hi")


How do I do the above with map? Something like this... (wrong)
(map foo [1 2 3] [4 5 6] "hi")
>>
>>71827254
(map foo [1 2 3] [4 5 6] (repeat "hi"))
perhaps? I don't use clojure
>>
>>71827254
in haskell this is just
traverse (uncurry foo) (zip [1 2 3] [4 5 6]) "hi"
>>
so like ... why don't we just have a processor that automatically reads C sources and generates headers for all the symbols that aren't static
>>
>>71827289
That's correct but for my case I'm actually looking for something more like

(map #(foo % % "hi") [1 2 3] [4 5 6]))
>>
>>71827300
no it's not
>>
File: 1562620250981.png (1.41 MB, 939x1378)
1.41 MB
1.41 MB PNG
>>71827356
Because I want to be able to read the headers without having to run something through the build process.
Headers are usually where a lot of your documentation goes.

I don't know why people complain about them so much. They're pretty easy to deal with.
>>
>>71827381
you can put documentation in the source file then, just like any other language

I don't see the reason to manually maintain a separate file, particularly where it can be programmatically determined it seems like a waste of effort and a violation of dry
>>
>>71827381
With a skirt so short, does (s)he sit on the chair with her bare butt? This is an important programming question.
>>
>>71827375
ah, my bad - forgot to add commas
traverse (uncurry foo) (zip [1, 2, 3] [4, 5, 6]) "hi"
>>
>>71827381
Headers are absolutely unnecessary except when you want to provide an external interface.
>>
>>71827400
>bare
panties is a thing
>>
>>71827254
>>71827300
>>71827402
Currying is dumb shit. The fact that you are incapable of figuring out how it works for even the most trivial examples is a testament to this.
>>
>>71827398
You could, but it's just not worth the effort.

>>71827412
Most programs ARE interested in that, though. The amount of library code you'll find in C is vast.
>>
>>71827422
But what if she wears thongs? Her bare buttocks would touch the cold surface of the char. Can I at least smell it afterward?
>>
>>71827429
>t. rahaj durgamahal
>>
>>71827429
I don't know what currying is I just posted the question. Could you please help me and tell me how you'd write something like this >>71827357
>>
>>71827400
>(s)he
Cocoa is a girl. It's greatly insulting that you'd write this, both to her, and to me for thinking I would post the lowest tier of fag shit.
>>
>>71827447
currying is a haskeller thing, it gives you partial application "for free"

that said, what's wrong with what you posted? isn't that what you want?
>>
>>71827454
Oh, I'm sorry, I didn't mean to insult anyone, it's just she wears these programming socks so I wasn't sure if she's a girl or a programmer at work.
>>
>>71827254
Why are you using def like that? I don't understand.
>>
>>71827254
Did you solve your problem?
>>
>>71827436
>All the symbols in a library are part of API
Imagine being this retarded.

>>71827439
Sure thing, bud. You can even lick it.
>>
>>71827461
Oh it doesn't work (wrong number of arguments).

>>71827493
I'm not it's just a contrived example.

>>71827499
No. The simplified problem is how do I get the following to print "Hi John and Mary", "Hi Tom and Susan"?

(map #(str "Hi " % " and " %) ["John" "Tom"] ["Mary" "Susan"])
>>
File: 1379244503469.png (657 KB, 716x586)
657 KB
657 KB PNG
>>71827509
>>All the symbols in a library are part of API
I didn't say that or even slightly imply that.
>>
how would I start out with basic low level programming?
>>
>>71827538
how low are we talking?
>>
How do I make a property tree that works in O(1) in c++? Property trees in boost use strings as input, i want to be able to do something like
g_root.category.item2

but still be able to iterate over g_root.category and g_root

Please respond
>>
>>71827524
(map #(str "Hi " %1 " and " %2) ["John" "Tom"] ["Mary" "Susan"])
>>
>>71827552
oh my god. fucking kill me.
>>
>>71827524
Like this?
(run! println
(map #(str "Hi " %1 " and " %2)
["John" "Tom"] ["Mary" "Susan"]))
>>
>>71827529
Why do you want header files for every symbol then? Just have one or two for the API. Keep that cancer out of other 99% of a library.
>>
>>71827543
I meant to get into a high level programming language, since I have already programmed before in the past three years just haven't really stuck with it. I need to get into languages like Javascript/Python.
>>
>>71827562
If you don't like the percent signs then you can write it as
(fn [x y] (str "Hi " x " and " y))
>>
>>71827196
If I enjoy Haskell, will I enjoy Clojure?
I like functional programming, and Clojure seems cool, but I also like static types.

In what scenarios is Clojure a better choice than Haskell if you want to build something?
>>
>>71827575
They're not really the same. Yes they're high level but they're used for different things.
If you want javascript then this is the absolute best source: https://fullstackopen.com/en/

For Python idk where to start really. The language is pretty simple so if you have programming experience it's no worse than just getting started building something - everything you need to know you probably already know.
>>
>>71827381
They're pretty easy to deal with but not as easy as not dealing with them.
>>
>>71827582
That looks a lot better.
>>
>>71827586
You may find this article to be of interest:
https://lispcast.com/clojure-and-types/
>>
>>71827666
Thank you my friend, this seems exactly what I'm looking ofr.
>>
>>71827546
Maybe hash maps ? They're O(1) access and O (N*ln(N)) if I remember well
>>
>>71827650
Yeah, pointers are just ints with some special details attached.
>>
>>71827436
>>71827509
or you know, just use modules and export the desired symbols
>>
File: 1560312447857.png (16 KB, 274x301)
16 KB
16 KB PNG
>>71827569
Where the fuck did I say anything about any of that? What the fuck are you on about?

>>71827921
Symbols don't have any type information associated with them, so you need additional information.
You can't say "mangle the names" or "include it in the executable too" because object formats aren't exclusively used for C and languages with C-like types and semantics.
>>
Are you supposed to feel out of place and useless on your first job after getting your degree? Does it get better?
>>
>>71827980
Yeah, it's normal: https://en.wikipedia.org/wiki/Impostor_syndrome .
>>
>>71827977
You can put any kind of data you like in special binary sections. Debuggers do it all the time.
>>
>>71827977
I don't see how this contradicts with modules
>>
>>71826922
data integrity
transactions
>>
Winforms are so comfy bros...
>>
File: 1158591859984489.jpg (84 KB, 1191x670)
84 KB
84 KB JPG
Can someone please explain in simple terms why c seems to he considered better than c++ and can you also give me some examples of when you would use c over c++ and vice versa?
>>
>>71828048
it's less complicated and therefore less easy to fuck shit up in bizarre and difficult to comprehend ways
>>
>>71828048
> why c seems to he considered better than c++
By whom? It's primitive so, yeah, some mentally challenged people like it better, but that's all.
>>
>>71828048
C++ is a giant clusterfuck and an extremely poorly "designed" language. "Designed" isn't even a good word: "shat-out" is more fitting. Anyone with even the slightest hint of good taste will be disgusted by it.

C is actually a pretty solid and focused language.
>>
>>71828086
if C++ was shat out, then C was ejected from an exploding sewer.
>>
>>71828086
It may not be pretty -- sometimes it may be the opposite -- but you gotta admit it's amazing all the stuff they managed to pack into C++.
>>
>>71828048
c++ not only has a massive feature creep, but most of those features are also overly complicated.
c is more conservative, has fewer features and the ones it has are not as stupidly designed. It's still not a great language, but at least it isn't a clusterfuck like c++.
>>
>>71828113
not really, C++ isn't actually all that feature rich, it's just that the features it does have interact in complicated ways
>>
>>71828086
you are a retard
>>
>>71828113
No. Bloating a language with disparate features does not impress me.
In fact, that does the oppose of impressing me.
>>
>>71828048
only underaged suckmeme fanatics and old senile senior devs claim these
>>
File: 1562681580236.jpg (27 KB, 480x509)
27 KB
27 KB JPG
Just learning Clojure. I feel at home.
>>
File: 1550917502826.png (1.75 MB, 1289x1211)
1.75 MB
1.75 MB PNG
>>71828056
>>71828076
>>71828086
>>71828111
>>71828113
>>71828115
>>71828119
>>71828131
Hmm. Well than I will stop with c++ and start focusing on c which is what my friend said to do because I am kind of struggling with c++ and it is confusing to me. Which seems to be the consensus here.

>>71828164
This reminds me of how it was suggested I get a copy of sicp and read it before learning a language, then when I posted here for help you guys said sicp was just a meme book :x. What language do you recommend for a newbie? I do a couple hours per day and am hoping to eventually change career. I'm getting tired of patients giving me weird looks for being a male nurse :m.
>>
>>71828262
My opinion overrides /dpt/ consensus.
Learn C++, and if you fail to do that, quit programming forever.
>>
>>71828262
sicp is fine, it's a little dated (nobody uses scheme any more) but the concepts you'll learn are universally applicable
c is also fine, it's a little lower level
>>
>>71828262
If C++ is confusing you then C is going to do much of the same. Go learn something modern, Python if you want something simple but "powerful" enough. C# if you want to stay within the "C ecosystem" or Java if you want to be a pajeet street shitter.
>>
>>71828292
>c# is close to c but java isn't
wut?
>>
>>71828262
>This reminds me of how it was suggested I get a copy of sicp and read it before learning a language, then when I posted here for help you guys said sicp was just a meme book :x.
/dpt/ is made up of many people with wildly different opinions.

>What language do you recommend for a newbie?
Whatever you find interesting. Personally I think C is a bit too low level to start with, it forces you to focus on things that isn't relevant in most languages today.
The biggest problem is that it's hard to find *really* good sources for learning. I started with the java course here a few years ago, java is a garbage language but the course content is super good: https://mooc.fi/en/

I don't know if there exists any, but if you can find any good content for functional programming languages I would look into those. It's again not important that you start there, the important thing is that you start somewhere. (but then look into functional programming when you get bored with java)
>>
>>71828292
Isn't Java a lot more of a clusterfuck than C++ because of how verbose it is?
>>
>>71828338
It's verbose but not as hard to understand.
>>
>>71828338
If verbosity is an aspect of clusterfuckness then sure, however it is more "simply structured" than C++ and is a bit more "rigid". Everything has it's place in Java, unlike C++ in which you have the freedom to build modules however you like.
>>
>>71828338
Java code is very verbose, but that also means it's difficult to get confused by it. C++ code is ambiguous and very context dependent, a given line of java code can only really mean one thing.
>>
File: 1538631068840.jpg (122 KB, 967x1497)
122 KB
122 KB JPG
>>71828262
if you're a beginner, just stick with whatever you're using. Once you got more experience you'll be able to make up your opinion (well, at least you won't take every claim at face value).
Really, if you're just starting out, tools and languages really really don't matter at all, you just want to focus on programming, anything is good. The differences between programming languages they just don't matter if you can't program at all...
Also, stop asking for advice here, this thread is just for flamewars and memes, nothing else here.
>>
>>71827254
Use a lambda
i.e.
(map (fn [x y] (foo x y "hi")) [1 2 3] [4 5 6])
>>
File: jvm languages.png (3.62 MB, 768x4245)
3.62 MB
3.62 MB PNG
>>71828338
Learning Java can also help you in learning other JVM languages. Pic related.
>>
>>71828262
SICP isn't a meme book, but it's not a good fit for a beginner, unless you have a really good math foundation.
Don't go with C or C++, as both have a lot of pitfalls for beginners. Otherwise it doesn't really matter. You can start learning with something like Python and then eventually transition relatively easy to something else.
>I'm getting tired of patients giving me weird looks for being a male nurse
become a cute trap nurse, problem solved
>>
File: 1.png (6 KB, 177x155)
6 KB
6 KB PNG
reading people's code is fun
>>
>>71828451
> it's not a good fit for a beginner
I have no idea why people pretend SICP is some kind of rocket science, it's literally a freshman course, it's designed for complete novices, there's no reason to waste time on it once you're past FizzBuzz.
>>
File: 8e6.png (149 KB, 828x801)
149 KB
149 KB PNG
>>71828482
>>
>>71828451
>but it's not a good fit for a beginner, unless you have a really good math foundation.
t. never read SICP
>>
File: 1562261986663.png (202 KB, 1016x944)
202 KB
202 KB PNG
I'm making a gui toolkit
what's the sanest architecture (*) /dpt/ collectively agrees on?
(*) not imgui
>>
>>71828515
what is "agrees"?
>>
>>71828515
haskelline, without a doubt
>>
>>71828515
It should be a retained-mode renderer.
>>
>take a month off
>forget everything
fuck
>>
>>71828515
like wpf but with a better storyboard and styling.
>>
>>71828566
I hate this, I wish I could retain information better.
>>
>>71828566
If you forget anything else than the syntax you didn't know how to program in the first place, just saying
>>
>>71828566
You didn't know shit if you can forget that in a month. Consider flipping burgers.
>>
>>71828634
>>71828670
whoa, rude.
>>
>>71828486
The book goes well beyond a freshman course, even though it's still a good introduction. The latter topics aren't all that advanced, but claiming that it's anywhere even near fizzbuzz level just shows you know absolutely nothing about it.
The video lecture series was also held to an audience of professional programmers btw and even they didn't cover everything (obviously)
>>71828495
Right back at you. A lot of the exercises and examples are motivated by math and some EE. It's by far the most math focused approach of all introductions I know.
>>
>>71828566
you'll relearn it faster than you learned it the first time around
>>
>>71828566
what are you learning?
>>
>>71828697
Are you such a brainlet you can't see past the EE and "math" stuff? Like it's not even required to understand any of it to complete the exercise.
God I can't believe how retarded you are. Also we're speaking of less than 10 exercises in the first half of the book...
Seriously consider quitting programming, there are enough imbeciles in the industry, do the world a favor.
>>
>>71828695
I wasn't really rude, just realistic. It's okay to forget the syntax of a language, everyone does at some point, but programming concepts are like riding a bike, you never forget it once you get it.
>>
>>71828697
>but claiming that it's anywhere even near fizzbuzz level just shows you know absolutely nothing about it.
lol
imagine being able to write more than a fizzbuzz at the end of an introductory course
too hard for /dpt/ maybe?

>The book goes well beyond a freshman course
good thing it's still taught to freshmen in my uni
>>
Newfag here. I have read that inheritance is the main point of OOP because it lets you re-use code. I have also read that inheritance causes issues, namely classes that want to inherit from two different subclasses of a class.
Can you help me understand what OOP is good for? Or would you rather just meme about Lisp and C?
>>
>>71828810
The latter.
>>
how to not be a webshit?
jobs opening are all
>backend
>fullstack
>frontend
>backend
>fullstack
>backend
>frontend
>software developer => click => its webshit
>backend
etc..
>>
>>71828794
you don't know how much time he may have spent learning a month ago. maybe he was just starting and only studied for 2 days.
>>
>>71828826
Leave cali. Look at DoD contractors.
>>
>>71828844
That doesn't matter for what I said though. He forgot programming concepts because he didn't get it in the first place.
>>
>>71828810
Inheritance is largely agreed to be a poor basis for abstraction. It promotes tight coupling, particularly when deep hierarchies are used (prefer breadth over depth). On the other hand, it's at least pretty efficient to implement.

Plenty of modern languages do away with inheritance.
>>
>>71828810
OOP is a poorly defined word that depending upon the one who utters can mean one collection of ideas or another. And on their own, each of those ideas can be easily determined to be *bad* or *good*, or *it depends*. But stuff them under one umbrella and say that collection of shit is *good* or *bad* and you'll have people losing their minds. It's just one of those things that people are arguing over words, because what it represents doesnt really exist.
>>
>>71828844
>Study for two days
>Take a month off

God, I already forgot everything ! This sucks!
>>
>>71828857
retard
>>
>>71828767
Holy shit, the issue isn't that it's incredibly hard, it's that it is has a focus on something that a lot of beginners who aren't in school don't have a lot of contact with. It's not impossible to deal with that, but it makes it a lot less accessible. If you've never programmed before it's a lot harder to learn when you also have to struggle with not really understand what the exercises and examples are about.
>Also we're speaking of less than 10 exercises in the first half of the book...
Alright, fuck off. Go actually read the first chapter before you talk shit. It's constantly referring to (basic) numerical analysis. No, just read the exercises. Don't pull numbers out of your ass when you don't have a clue, that's a dead giveaway. Parroting shit about a book you've never read while trying to insult others intelligence is just beyond laughable.
>>71828807
Ah, now I understand. You're some retard who took a course based on SICP and now thinks he read the book.
Let me give you a piece of advice: courses never cover entire books. Even a relatively basic book like CLRS often only gets covered about halfway. If you come away from something like a compiler class and think you've basically read the dragon book, you're in for an unpleasant surprise
>>
So I've noticed that the char arrays I create always have one more element than what's present, for instance
char str[] = "Test";
has a length of 5 instead of 4. Is there a reason for that?
>>
>>71829064
Null terminator.
>>
>>71828897
>>71828900
Fair enough. Maybe I should be more specific then: I'm learning Python. What aspects of OOP should I care about? What is the advantage of class functions like object.fun() over plain functions like fun(object)?
>>
>>71829064
Implicit null terminator. So it really looks like
char str[] = {'T', 'e', 's', 't', '\0'};
.
It's an important part of how C strings work.
>>
>>71829076
Polymorphism.
object.fun()
can mean different things depending on what object is, and that's a good thing sometimes.
Though in Python you can do that just as well without inheritance using duck typed interfaces.
>>
>>71829069
>>71829088
Oh, is there a way to prevent it from affecting my results? Should I just explicitly limit the length of my strings?
>>
>>71829129
What results are you talking about? It's there for a good reason.
>>
>>71829092
python also has libraries for multimethods
https://github.com/weissjeffm/multimethods
>>
>>71829129
The null terminator is there because otherwise C doesn't know where to stop reading/writing your string.
>>
>>71829088
sizeof and strlen shouldn't count it though?
>>
>>71829076
The only difference is that methods on objects have unmangled access to __members. If you are using that to implement private variables it implies methods have private access and may mutate the object. Free-functions imply that they will only use the public interfaces and probably wont mutate the object. But, it all comes down to convention because you can do whatever the fuck you want. In terms of polymorphism, there is no benefit to one over the other.
>>
>>71829049
Yeah, like I said, if you can't get over the basic shit to just focus on the programming problems at hand you're just not cutoff for programming, sorry, it might be harsh, but it's the truth you're just too dumb and finding yourself excuses.
Also you clearly don't know what numerical analysis is.
>>
>>71829092
>>71829205
Okay, thanks.
>>
File: 1540462410270.png (352 KB, 731x720)
352 KB
352 KB PNG
>>71829049
>don't read this book of statistics because most of the exercises are motivated by meteorology, poker and economics, it's really not a good fit for beginners unless you have really good economic and geography foundations
>>
>>71829156
>>71829180
Well, I was messing around with fprintf and fwrite and trying to figure out how to get fwrite not to add that bit of extra data at the end which messes up textfiles. But I just learned I could use strlen() to properly limit the count while still keeping it sorta dynamic.
>>
>>71829204
strlen excludes the null terminator.
sizeof won't tell you the length of a string.
>>
>>71829297
sizeof will tell you the size of a char array.
>>
>>71829339
really? the size of the array or the size of the pointer to it?
>>
>>71829297
>sizeof won't tell you the length of a string
Never implied that.
OP was using a char array and complaining about the length so I mentioned both and how they ignore \0 at the end. Also, sizeof will tell you the (accurate) length of a string if it is a stack array like OP case unlike strlen which terminates at the first \0 even if string happens to have one midway
>>
>>71829385
The size of the array, if the identifier is indeed an array and not a pointer. The Linux kernel's ARRAY_SIZE macro takes advantage of this.
>>
>>71829386
#if defined(__GNUC__)
#define array_size_constant(string) ((sizeof(string) / sizeof((string)[0])) + \
sizeof(typeof(int[1 - 2 * !! __builtin_types_compatible_p(typeof(string),typeof(&string[0]))])) * 0)
#else
#define array_size_constant(string) ((sizeof(string) / sizeof((string)[0])))
#endif


... unfortunately this only works on proper compilers like GCC.
>>
OK, seriously, is nobody here cryptologicly savvy enough to answer to this thing here?
>>71824259
>>
>>71829522
>using an audited TLS library is too complicated
>so I'll roll my own crypto
nigga u dumb
>>
>>71829565
>so I'll roll my own crypto
Better than crypto I don't understand and will thus not handle properly. From your responsive I can tell you've never checked in code that people relied on working.
>>
>>71829386
>>71829406
thanks for explaining
>>
>>71829217
Because you're on that retarded "y-y-y-ou're just too dumb bro" train of thought, I had absolutely no problems with SICP.
>Also you clearly don't know what numerical analysis is.
Yeah, newton's method and simpson's rule definitely aren't some of the most well known examples of numerical analysis.
Are you capable of opening a book? Or is that too hard for you?
>>71829292
You strawmanning fucks are the worst part of this thread.
A statistics book will literally just use those things as flavor. If you think this applies to SICP, go actually read it.
>>
>>71829522
Usually just a backend server with some encrypted passwords like Bcrypt are enough with SSL.
To verify the user demanding it and the controller handeling it in JSON.

Or you need some blacksite server or something fortified kek.
>>
>>71829608
>Better than crypto I don't understand and will thus not handle properly.
No, it's absolutely not. If you were capable of designing a cryptographic protocol you wouldn't be asking /g/ for input. Look at example code for openssl and copy that or use something simpler like libtls
>>
>>71829608
>responsive
Wow, what a brainfart. And that's exactly why I shouldn't be trusted with X.509 certificates and what have you. Just a nice, small API and a little bit of key exchange is all you should put into my incompetent hands.
>>
>>71826683
>raymoo
>>
>>71829686
>in JSON.
Too complicated already. This is in C, after all.

>>71829688
>If you were capable of designing a cryptographic protocol you wouldn't be asking /g/ for input
Good to know that I'm already better than most of you. Thanks for the input; I'm gonna keep it then.
>>
>>71829721
Just use c++ on top of it it has dozzens of libs to do that.
>>
>>71829721
I look forward to the CVE, master cryptographer.
>>
>>71829676
newton's method and simpson's rule aren't studied at all in SICP, they're fucking explain the algorithm to you so you can use it. That's no numerical analysis, that's just code monkeying.
God forbid you'd actually learn something useful while you're grinding exercises.
Yes, you're clearly too fucking dumb.
Why aren't you claiming you need foundations in information theory because of that one huffman encoding exercise?
>>
>>71829721
I don't know what you're doing but good luck
>>
>>71829756
>add more complexity; that is BOUND to do the trick
You are literally everything that is wrong with software development nowadays.

>>71829757
How often does djb crypto receive those, anyway?
>>
File: jigle billy.jpg (9 KB, 200x200)
9 KB
9 KB JPG
>>71829794
Hey i have no idea why you use C for that only.
You might as well use assembly.
>>
>>71829794
>You are literally everything that is wrong with software development nowadays.
He said while reinventing the wheel for the millionth time in C.
>>
>>71829522
libsodium already comes with a set of functions for key exchange and encrypted streams using secret-key cryptography, use those.
>>
>>71829829
>Hey i have no idea why you use C for that only.
Because C is still reasonably abstract; I don't need to know the ABI in order to write code, but complexity remains low enough.

>>71829832
The other wheels are literal garbage. I had a look at OpenSSL sources, actually, and that gave me nightmares for two days.

>>71829837
If you're referring to these:
>https://libsodium.gitbook.io/doc/key_exchange

... what's with authentication?
>>
File: 1530607611071.jpg (40 KB, 600x532)
40 KB
40 KB JPG
>>71829794
>add more complexity; that is BOUND to do the trick
>Uses C for encrypting data transfer/comm

Dude you pulling our legs here kek
>>
>>71829954
Congrats; your post is the *embodiment* of FUD.
>>
>>71829904
don't forget to use after free and peek in your buffers without bound checking for extra performance gains and code simplicity
>>
>>71829998
No you are using the wrong tools for the wrong job.
The only way you can say you need C for this is that you have a microcontroller chip directly plugged in to the net.

And then doing some encryption algo's to process the data.
>>
>>71830016
>use after free
Dude, I'm not using malloc/free. Keep it simple, stupid.
>inb4 what are you using then
Raw mmap/munmap.
>>
>>71830058
Unless I have no idea what my successors are gonna do with this code, and it has to survive their stupidity through scalability.

Thinking further than lunch is a thing, y'know.
>>
>>71830144
Okay, you're just an extremely high level bait
>>
>>71830184
>literally no arguments
Why are you even wasting your time?
>>
File: lunch.jpg (177 KB, 1100x1513)
177 KB
177 KB JPG
>>71830144
but muh lunch

so tasty
>>
>>71830220
Where is meato~?
>>
>>71829775
Ah, now I know the issue. You're an illiterate ESL. Let me help out a bit:
"It's constantly referring to (basic) numerical analysis" isn't saying that you need to know numerical analysis, it means that they are talking about examples relating to numerical analysis, which they do throughout the entire chapter. They explain them, but in a way that for a guy that's been out of school or was never that great at math, they'll likely struggle with trying to understand it. A lot of people (yes, even programmers), don't know much beyond basic algebra. So they'll waste time on that instead of on what they're actually trying to learn.
Especially because even if you do understand the explanation, the exercises aren't trivial. For those people, insular exercises that don't try to teach you about another topic at the same time, but instead focus on simply explaining the topic at hand, are a way better fit.
>Why aren't you claiming you need foundations in information theory because of that one huffman encoding exercise?
wow, you finally managed to open that table of contents, huh? I'm real proud of you, but again, I never said that you'd need to have a experience with numerical analysis, just a solid mathematical foundation. And that example of yours is hilariously weak. Huffman encoding is so simple, requires absolutely no prior knowledge and could be understood by a literal child.
>>
They could have included literally any sane SSL library that provides TLS-PSK cipher suites and be done with it by now.
>>
>>71830184
>C
>high level
>>
>>71830257
Who says I'm not done with it by now? That's in the fucking post as well, if you had bothered to read it ...
>>
header only with static functions or just library
>>
>>71830351
Shared library. This way you only have to fix the code, compile it once, and thus patch all applications that depend on it.
>>
good place to hire some code monkey to write a little ntCreateFile application in C or C++?
>>
>>71830384
>ntCreateFile application
What the hell is that?
>>
File: 1558537813325 (1).jpg (34 KB, 540x540)
34 KB
34 KB JPG
I wrote a simple C++ code generator for my UI design tool, so now I can finally start using it to implement some application UI's.
After I have some dinner, I'm gonna try converting one of my apps over to the new tool :)
>>
>>71826466
Learning C++ in my free time.
>>
>>71830395
poor wording. basically just a lil c/c++ .dll that I hooks ntCreateFile for a specific file/app and simulates a keypress when this happens
>>
File: 1543471743641.jpg (72 KB, 1280x720)
72 KB
72 KB JPG
>but in a way that for a guy that's been out of school or was never that great at math, they'll likely struggle with trying to understand it.
Fuck off, not everyone has a room temperature IQ like you. And fucking stop it with your out of school excuses. You don't need anything higher than high school math to easily breeze through it. If you can't do that, I keep saying it, quit programming, seriously. If you struggle on newton's method, you really are not fit for this, why is this so hard to accept? If programming is really what you want to do, sure go ahead and make cute websites, no one would recommend SICP for that anyways.
>they'll waste time on that
what the fuck, if really you have the will to learn programming despite your natural inability; that's not wasting time, that's called catching up. We're talking about applying Newton's method not Zygohistomorphic prepromorphisms. >solid mathematical foundations
what next? You need solid foundations in formal systems because programming makes heavy use of boolean logic!

Do you really believe that anyone who disagrees with your webtoddlers opinions hasn't possible read SICP? It's funny how you admit how simple huffman encoding is, but then make a big deal out of Simpsons rule..
Do this thread a favor
>>>/g/wdg
>>
Sell me on Scala.
Sell me on Kotlin.
Yes I'm going balls deep in the JVM.
>>
>>71830384
>>71830542
please put it all together into a complete sentence folks can understand.
>>
>>71830591
I've used neither but:
scala is an attempt to combine haskell with java.
kotlin is an attempt to patch up the nasty parts of java.
>>
>>71830591
JVM is shit. Change my mind.
>>
>>71830621
a note on scala:
if you want more haskell and less java, look at Eta or Frege
>>
>>71830692
the JVM is a computer program
>>
>>71830566
Learn English you fruit.
>>
>>71830750
hwat
>>
File: bananaman.png (641 KB, 719x903)
641 KB
641 KB PNG
>>71830750
Who you callin' a fruit?!
>>
File: 1536729992334.png (341 KB, 900x1525)
341 KB
341 KB PNG
>>71830750
I'm the cutest fruit around
>>
>>71830351
>with static functions
C really is gross
>>
>>71830909
Yeah, because you cannot shoot yourself in the foot in other languages, right?
>>
Posted this in wdg, but posting this here aswell because wdg is slow and you guys are more fun.

Given that I'm not allowed to rewrite the functions, am I doing this last line right?
It looks ugly and feels like there should be a more elegant way to do, without having to create an intermediary variable

//this function takes two arguments
function foo(a, b) { console.log("A:", a, "B:", b) }

//this function returns an object
function bar() { return {x: 3, y: 5} }

//this passes the result values from bar() to foo()
foo(...(({x: x, y: y}) => [x, y])(bar()))
>>
File: 1560209209917.png (278 KB, 454x600)
278 KB
278 KB PNG
>>71830928
this, but unironically
>>
>>71830374
You mean break all applications that depend on it when you make an improvment to the library.
>>
>>71830940
like this?
let b = bar();
foo(b.x, b.y);

idk if javascript has something like object splicing
>>
>>71830957
Yeah, because there's absolutely no differences between major and minor version increments ... if you're a Pajeet.

If you're not, however, then you keep ABI-breaking changes in its own major version, like everybody else with a working brain in their heads.
>>
>>71830984
I wanted to avoid having to create an intermediary temporary variable.
>>
applied to an individual course in mathematics and computer science.
there were 30 spots and I got into reserve list at 19th spot - that makes me the 49th.
there's probably a bunch of people who got the max score for winning some dumb regional contests.
basically what I'm asking is - do you guys think I'll get in or not?
>>
>>71831043
well bar() is a pure function here so you could do
foo(bar().x, bar().y); I guess

({x:x, y:y}) => [x,y] also creates temporary variables if you think about it
>>
>>71830996
There's no point in making a shared library until version 2.0.
>>
>>71831058
maybe
>>
>>71831088
Since you clearly have no clue how real-world applications tend to work, why do you post bullshit as if you do?
>>
>>71831084
Consider if bar were not a pure function, or just expensive to call.

>>({x:x, y:y}) => [x,y] also creates temporary variables if you think about it
True i guess, but I don't have to name them tmp or something, and I get to route bar to foo in a one line.

Mostly i'm wondering if I've understood destructuring correctly or if I missed something.
>>
>>71831163
does it work when you run it?
>>
>>71831139
I know enough to know that you never get it right the first or second time.
>>
>>71831188
It works. It's just unreadable.
>>
>>71831224
it's also shit, needless overhead
>>
>>71831209
Define "right".
I know someone who keeps deleting their code after a while because they're unhappy with it. Needless to say that they don't learn a ton.

If you're unhappy with the old code, write something new while maintaining the old code. The old code will be an imperfect, but at least somewhat working base, and since your new code's unpublished it cannot break older versions.
>>
>>71830940
foo(...Object.values(bar()))
or as a general function
 const fuckyApply(fn1, fn2, args) => fn1(...Object.values(fn2(..args))

this only works if your arguments are alphabetical though. You'll need something more complex otherwise

but javascript is and always will be ugly.
>>
>>71831342
or wait, is it insert order? Fuck JS
>>
File: Folder.jpg (17 KB, 200x200)
17 KB
17 KB JPG
>>71826466
I want to make a carbon copy of Final Fight, what language should I learn?
>>
>>71831392
Depends on the why. Anything works theoretically.
If you just want to make game => unity or even something like game maker
>>
>>71831411
game maker tools a shit
>>
File: woman big brain.png (196 KB, 371x447)
196 KB
196 KB PNG
Got my A+ certification, studying for my Networking+ certification on Udemy right now

Just signed up for a Javascript course on udemy as well, should i do that before or after doing Security+? or should i study a simpler language first?

My plan is to have A+ Net+ and Sec+ and then several programming languages on a basic level, and one language on a high level, of which java-script seems the post popular followed by python
>>
>>71831392
C with Vulkan.

>>71831530
Certs are usually not worth the paper they're printed on.
>>
>>71831530
>>>/g/wdg
>>
>>71831556
Nah
>>
>>71831563
Yeah
>>
>>71831544
>C with Vulkan.
Its not gonna fly anon, that's more like 3d shit
>>
>>71831645
>implying you can't do 2D rendering with Vulkan
>>
File: IMG_321.jpg (155 KB, 610x343)
155 KB
155 KB JPG
Should I start work on a toy OS or my own custom web browser?
>>
>>71831664
Custom web browser. At least that one is gonna have a chance of succeeding.
>>
>>71831679
What should it feature?
>>
>>71831694
Not crashing if google.com is loaded would be a good milestone. Not crashing while parsing their JS would be the next.
>>
>>71831708
Is it a devs fault if Google doesn't follow the HTML standard?
>>
>>71831748
No, but it's a dev's fault if their software crashes regardless.
>>
File: jew.png (281 KB, 900x900)
281 KB
281 KB PNG
>>71831773
Well then don't complain if the page is rendered wrong.
>>
>>71826466
How do I into AI learning programms? I want to teach an AI to do handjobs after several hours of porn
>>
>>71831097
thanks anone
>>
File: Newcte4.png (142 KB, 1182x291)
142 KB
142 KB PNG
Still working on a neural network that decensors hentai:
https://imgur.com/a/7Wfzt6F
>>
Amazon Pledges $700 Million To Teach Its Workers to Code

who needs a job anyway?
>>
>>71828113
wow look at all the algol 68 features they managed to pack in!!! feature creep is great!!!
>>
>>71831530
that's the most boomer post I've read on here
>>
>>71832015
the censorship only makes it better
>>
File: 1527122410985.png (624 KB, 1920x1080)
624 KB
624 KB PNG
What would be the best way to hand a large amount of incoming messages in Reactjs?
For displaying them I mean.
>>
>>71826771
A lot of people (read: shitters) learn better from having the material explained to them, rather than reading. It depends on your level of experience, too. Back in middle school I couldn't wrap my head around documentation but listening to someone talk about it made it easier to understand.
>>
>>71832035
I have a job. Allows me to get an RTX 2080 Ti this month.

On which I'll play Stardew Valley and Splinter Cell Chaos Theory.

>>71832274
You could throw them away. Nobody's gonna read that shit anyways.
>>
File: 1526946719763.png (284 KB, 501x421)
284 KB
284 KB PNG
>>71832333
kek
But its for a job project. and some of them will be important.
>>
I hate writing unit tests fuck
>>
>>71832383
Put them in log files where they can stay until someone actually ready them?
>>
>>71828048
Mostly syntax. C's syntax while using all its features is simple and elegant but with c++ it just looks messy.
>>
My teacher seems to think that shell pipes stop executing if the command on the sending end of the pipe exits with a nonzero.

Am I fucking something up here or are they wrong?
>>
File: tab.png (4 KB, 353x176)
4 KB
4 KB PNG
hi /dpt/
im trying to write a postprocessor to work with 3d printing program, wich consist of txt file with thousand of lines
im trying to save the content of the file into a 2 dimentional array so i can modify/remove certain lines, but im very limited with the size of the array i can create
pic related if i exceed 3462 the program will freeze
any trick to get around that limitation ?
yesss i know its bad to do it that way i should use dynamic allocation but its just for one test and im not a programmer.. and dynamic allocation with 2 dimentional array sound like a nightmare
also how do you post code here ?
>>
>>71832436
Use Python.
>>
>>71832436
increase your stack size, eventually realize malloc isn't all that evil.
>>
There's no way to capture return from C function right?
For example if I have macro such as
int main(void)
{
with_stuff(variable_name) {
printf("%d\n", variable_name);
}
return 0;
}

Where with_stuff declares variable_name, allocates and then frees it.
The only problem is when user calls macro with_stuff and returns from inside it, then variable_name will never be freed.

As far as I know not even longjmp can help here, I could override return with macro but that does not seems like good idea.
>>
why are there a gorillion types of casts in c++ reeeee
>>
>>71832476
all you're doing is remaking an ugly version of malloc an free.
>>
>>71832476
what the hell are you even talking about?
>>
>>71832436
>but its just for one test
So?

>and im not a programmer
That is no excuse in any way, shape or form. Use the heap or perish.

>and dynamic allocation with 2 dimentional array sound like a nightmare

You DO know that you can calculate your indices in such a way that you can simulate it being a 2D array, if it's really just one continuous chunk of memory? Dude, fuck that 3D printing program, go learn the fucking basics of C programming first.
>>
>>71832476
You seem to be challenged by basic English - I'd first work on that before having another go at programming.
>>
>>71832531
implementing gcc's __attribute__ cleanup with macro
>>
>>71831368
object doesn't have any order defined when retrieving keys/values, Map does

>>71830940
Introduce an additional helper function:
const collectKeys = (object, keys) => keys.map(key => object[key]);

const foo = (a, b) => console.log("A:", a, "B:", b);

const bar = () => ({ x: 3, y: 5 });

foo(
...collectKeys(bar(), ["x", "y"]),
);
>>
>>71832427
afaik your teacher is wrong. they may be conflating it with short circuiting evaluation of || and &&
>>
>>71832436
you could also just mmap the file
>>
>>71832552
Why do Cniles criticise C++ so much if they just reinvent it?

anyway, how afraid of compiler extensions are you
>>
>>71832682
tcc doesn't support cleanup
>>
>>71832476
cringe
just use c++
>>
>>71832476
bullshit code considered harmful
>>
File: 1528674048618.jpg (118 KB, 604x604)
118 KB
118 KB JPG
>>71832403
I planned on doing that either way, but I need to show them in my app too.
>>
>>71832901
Tell them some bullshit about signal-to-noise ratio that would make it disadvantageous to show them.
>>
>>71832455
>increase your stack size
THAT'S PERFECT thx a lot !!

>>71832655
>mmap
look like alien code for me
https://www.lemoda.net/c/mmap-example/

>>71832533
why should i invest more than minimum time and energy into something that is for single use ?
>>
>>71833029
>THAT'S PERFECT
No it's not. But since you have no idea what you're doing you're too incompetent to understand why.

>why should i invest more than minimum time and energy into something that is for single use ?
Firstly: "single use" is a nice hypothesis, but what happens if it's not?
Secondly: Because you'll remain to be an incompetent leech who has to ask others for help.
>>
>>71833074
>No it's not.
it suits my need

>what happens if it's not?
i would rather re-write that program ten times than learning C (not that i hate programming or something, its just not my field at all)

>Because you'll remain to be an incompetent leech who has to ask others for help.
yeah well everyone do that to a certain point isnt it ? you cant just master every technical subject in existence
>>
>>71831664
go help OS anon and take over the world together
>>
>>71833246
Why in the fuck are you using C for this?
>>
>>71828826
Literally all programming jobs are in some shape or form web-dev related unless you're doing embedded stuff.
>>
>>71833246
>it suits my need
For now. Again, what happens if it's not single use? Rely on the kindness of strangers again? That sounds pathetic.

>its just not my field at all
Then why are you dealing with it in the first place, instead of someone who actually knows what they're doing?

And you may very well end up rewriting that program again because more data is gonna be thrown at it. Different files may be thrown at it.

>yeah well everyone do that to a certain point isnt it
Actually, no. Funnily enough I'm always being asked for help, but I don't ask others.
>>
>>71833308
well its only programming language i know (a little)
>>71833356
>do not rely on the kindness of strangers
>ask someone who actually knows what they're doing
>>
>>71833433
>well its only programming language i know (a little)
It doesn't seem that you know it very well.
I'd wager you'll get it done faster (and probably better) in less time if you pick up some scripting language instead of doing it in C.
>>
>>71833433
To put it in the words of John Bercow: "I'm not asking him - I'm TELLING him". If it's not your forte you shouldn't be doing it in the first place. This is not a stack of wood that everybody can saw into fitting pieces; this is software where a single bit flip can have major impact.

And if your management or whatever is unable to acknowledge this it's an incompetent management, and I'd think about quitting. But unlike you I probably can afford that, because I learnt to not be a leech.
>>
>>71832015
you need help or what?
>>
>>71833342
>what is IoT
>>
File: postpro.png (15 KB, 669x332)
15 KB
15 KB PNG
>>71833478
well not sure about that, it took me two day and its almost done, again there is nothing tricky its just about replacing/removing string of text under certain conditions and re-write the modification into a new txt file
it would took me longer to learn another language thats for sure
>>71833520
>If it's not your forte you shouldn't be doing it in the first place.
wrong, just learn what is usefull to you at a given time
>major impact.
well its my own computer i do what the fuck i want on it, it wont impact others beside me

btw this is not job related this is a for a hobby project
and im not a wage slave i run my own business
>>
>>71833737
>and im not a wage slave i run my own business
Sure thing, bud. That's why you're here.
>>
Reminder that C is faster than C++ because one uses structs and the other uses classes and these are entirely different things. Aka language features make your language slow, except for C features which are equivalent to ASM and perfect.
>>
new thread when? :3
>>
File: 1562795884627.jpg (58 KB, 456x578)
58 KB
58 KB JPG
>>71833822
>>
>working on massive legacy application yesterday
>going fine, running fine
>come back this morning
>it doesn't run anymore
what the FUCK _nothing_ has changed, did I not do the right incantation this morning to have this piece of shit codebase run properly?
>>
>>71833737
ah I was under the impression that you were just starting out
>>
>>71833822
I'm actually still waiting for someone to do what I suggested in the previous thread:

>Then why don't you go ahead and run some C++ program with an overloaded malloc implementation that counts how many 64-Bytes-or-less allocations have been performed? And with a corresponding free overload you can see how long they survived. I also don't care about your synthetic benchmarks for a simple program, all right? I want real-world applications.

Now I'd never assume that people don't want to see naked facts that would chatter their world view. No, they've just been oh so busy, that's all.
>>
File: images.jpg (4 KB, 225x225)
4 KB
4 KB JPG
>>71833862
>what the FUCK _nothing_ has changed
The time changed
>>
File: pepe.jpg (40 KB, 512x512)
40 KB
40 KB JPG
>>71826466
Currently working on telegram bot to fetch interesting \pol\ threads
you can check it out: https://t.me/TrendPol
Would like to know hat else can I add \ change in the bot.
Planing on hosting it eventually on my raspberry
>>
>>71833897
ahhhhhhhhhh code should not be time dependent, my job is a meme
>>
Everyone shits on std::variant. Should I just use unions?
>>
>>71833880
You don’t use malloc in C++ cnile. You would overload operator new, which can be done at the global scope or in your own namespaces according to your needs.
>>
>>71833925
std::variant is literally just unions but better
>>
>>71833940
>You don’t use malloc in C++ cnile.
Just what do you think does your overloaded new operator call internally?

Fuckin' imbecile.
>>
>>71833925
std::variant is not bad because it's a bad idea, it's bad because the API is garbage.
>>
File: 1 layer.png (113 KB, 1924x1056)
113 KB
113 KB PNG
>>71833871
yeah no since its not layer dependant started it with only 1 layer of printing because the output is easier to bebug (i dont want to dig into a 10000 lines txt file)

its when i throw the whole program into wich is 100x time bigger that thing started to mess
>>
>>71833959
>the C++ is implemented in C meme
Memory allocation is done by the os moron. They both make the same underlying system calls, which are implemented differently depending on the platform. Learn a little about operating systems before you embarrass yourself.
>>
>>71833959
Using malloc in C++ without using new is literally undefined behaviour.
>>
>>71833673
Isn't IoT basically embedded?
>>
>>71833994
Hey, imbecile, why don't you just do as I said in the beginning, hm? Overload fucking malloc/free and see if they're actually being called. Because if not, this would be your chance to show me, hm?

Or maybe you know internally that you're just an utter retard who's spouting bullshit, and that's why you don't do it. In any case, as long as you don't do it, I win. Simple as that.
>>
>>71833959
>>71833994
Technically both of these lads are correct.
>>71834031
Only if you mix new/free or malloc/delete. This is because new allocates on the free store(which might be the heap but not necessarily) while malloc allocates on the heap.

https://stackoverflow.com/questions/1350819/c-free-store-vs-heap
>>
>>71834081
This is nothing to do with allocation location.
This piece of code invokes undefined behaviour in C++.
void foo()
{
int *p = (int*) malloc(sizeof *p);
*p = 0;
free(p);
}
>>
>>71834110
Just. Overload. Malloc. And. Free. And. See. For. Yourself.
>>
>>71834119
I'm not talking about that shit lmao pay attention
>>
>>71833880
lol are you that dumb anon who claimed you can't manage memory at compile time, no wonder this thread is utter crap
>>
>>71834158
>>71834158
>>71834158
>>
>>71834137
>I'm not talking about that shit
You initially quoted me saying that
>using malloc in C++ without using new is literally undefined behaviour
, as if telling me that this is why new simply cannot call malloc internally. Congrats; you're in this together with
>>71834144
, whom I still haven't seen doing the one thing that could make me admit defeat. You two apparently really like to be on the loser's side. Well, not my problem. Loser's gonna lose and all that.
>>
>>71834171
you seem to think that using malloc in C++ is a good thing because new does it internally
I'm saying there's literally no safe way to use malloc without using new so why even bother
>>
>>71834171
linear types proved you wrong long ago, but again, you couldn't be assed to read the wiki article on substructural type systems, which leads me to believe you're baiting and shitposting
>>
>>71834171
It doesn't even matter if new calls malloc internally because if the specification says you calling it directly is undefined then it is undefined
>>
>>71834193
>you seem to think that using malloc in C++ is a good thing
No, I never said that. The purpose of you overloading malloc/free is not because I think it's OK; it's because I want you to see how many retardedly small allocations the oh-so-optimised C++ performs at runtime, as could've well been read from
>that counts how many 64-Bytes-or-less allocations have been performed
>>
File: New.jpg (157 KB, 1080x1034)
157 KB
157 KB JPG
Oof
https://github.com/llvm/llvm-project/blob/master/libcxx/src/new.cpp
>>
>>71834203
You do not seem to realise that as long as you don't do what I told you to do, literally everything you're going to say is completely null and void because I've done the thing, and I've seen the results, and I don't care what some retard on some wiki page wrote; I trust runtime symbol resolving a hole lot more.
>>
>>71834222
mea culpa, I entered the conversation at >>71833959 and that seemed to be what you were getting at
>>
File: 1545531404062.jpg (94 KB, 640x716)
94 KB
94 KB JPG
>>71834250
yes we get, you start to seethe whenever things get too complicated for your little brain. The mark of a true cnile. I'm proud of you.
>>
>>71832500
because you need to cast things in different ways

whats the problem?



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.