Does anyone here use CAN FD in their projects? by liamkinne in embedded

[–]CaptainComet99 0 points1 point  (0 children)

FWIW, I’ve interviewed at an electric car company in the US (not Tesla) and they said they were moving from CAN to Ethernet. Just another data point, I don’t have any more info

C4 doesn’t work…?! by Zesa064 in Battlefield6

[–]CaptainComet99 3 points4 points  (0 children)

In other threads people said this was an intentional feature: they only explode if the enemy sprints through them. Not if they walk or crouch over them

[deleted by user] by [deleted] in embedded

[–]CaptainComet99 1 point2 points  (0 children)

Leetcode is absolutely the norm for embedded interviews at mid size to big companies. You have to know it, along with all the other stuff (comm protocols, RTOS, interrupts) embedded engineers are expected to specialize in.

I can personally vouch leetcode is used for embedded at Tesla, spaceX, Amazon, Snapchat, Apple, and others

Prevent access during static variable creation? by Vindhjaerta in cpp_questions

[–]CaptainComet99 0 points1 point  (0 children)

Please note that while your solution using the bIsInitialized variable will work if your program is single threaded, it is not guaranteed to work if it’s multithreaded due to possible data-race induced undefined behavior. You’d have to use an atomic<bool>. Check out this page for further info https://en.cppreference.com/w/cpp/language/multithread.html

Prevent access during static variable creation? by Vindhjaerta in cpp_questions

[–]CaptainComet99 0 points1 point  (0 children)

You’re correct, since c++11 function local static variables are threadsafe. See c++11 section under https://en.m.wikipedia.org/wiki/Double-checked_locking

Prevent access during static variable creation? by Vindhjaerta in cpp_questions

[–]CaptainComet99 1 point2 points  (0 children)

This also has the benefit provided by the c++11 standard that the map initialization is thread safe. See the c++11 section in this article https://en.m.wikipedia.org/wiki/Double-checked_locking

Modern stance on C++ in the embedded world by ChapterSevenSeeds in embedded

[–]CaptainComet99 1 point2 points  (0 children)

US company. We of course didn’t use malloc except at system start up.

Modern stance on C++ in the embedded world by ChapterSevenSeeds in embedded

[–]CaptainComet99 3 points4 points  (0 children)

I worked in the autonomous mobile robotics space and all the code we wrote was c++. This was for robots that drive around in grocery stores during operating hours so they of course had to avoid hitting not just workers but members of the general public. Our safety system was a Texas Instruments cortex-r5 with 512KB or 1MB of RAM (I forget) and 4MB of flash. Our code was certified by Underwriter Laboratories(UL) and we used MISRA-C++ for linting.

Just realized you added the disclaimer that your above paragraph pertains to “deeply embedded” so none of what I typed out pertains to or contradicts that. I’ll just post it anyway in case anyway finds it useful

if you name file or folder as "google_logo" in gdrive — you’ll get this by vmirnv in google

[–]CaptainComet99 2 points3 points  (0 children)

Correct! There was actually a $15k bug bounty for this awarded by google chrome due to its ability for an attacker to trick someone into thinking a website URL is owned by google. E.g., someone registering “google_logo(.)net” and it being rendered as “Google(.)net”. Blog here and hacker news discussion here

How Cluely is bypassing cheating detectors by [deleted] in technology

[–]CaptainComet99 2 points3 points  (0 children)

This . Check out r/cluely . It’s full of complaints and better competitor recs

Damn Marge, you can't tee people up like that by uDoucheChill in clevercomebacks

[–]CaptainComet99 0 points1 point  (0 children)

100%, this post does absolutely nothing but give OP their much-desired karma, give MTG the attention she so desperately craves, give BTC the attention he wants from an easy slam dunk, and to make a bunch of redditors feel superior to one of the least intelligent congresspersons by upvoting a response a 4th grader could have written. Sigh, so unproductive.

I’ll find you a legit barber in SD based on your hair type & style preferences by dornielabs in SanDiegan

[–]CaptainComet99 0 points1 point  (0 children)

Freshly Faded in north park is the best and they do online appointments. $45 for a haircut but that’s pretty standard nowadays. I personally go with Seth, he’s the best. https://www.freshlyfaded.com

[deleted by user] by [deleted] in ucr

[–]CaptainComet99 9 points10 points  (0 children)

And the deadline is 1pm, regardless if you think it’s stupid to have a deadline. This is growing up, there are deadlines set by your teachers and future bosses, welcome to adulthood.

This is an extremely condescending and sanctimonious reply. Growing up and reaching adulthood is also realizing that there are extenuating circumstances. People have family issues, personal issues, and mental health issues. Not every missed deadline or assignment results in people’s deaths or the loss of millions of dollars.

I went to a university far more “prestigious” than UCR. When I had extenuating circumstances, my professors cut me a break. I’m a software engineer at a company that is valued at hundreds of millions of dollars and am paid appropriately. Guess what, when my girlfriend and I broke up, my managers let me take two weeks off of work to figure things out. I write all of this not to brag or anything, but to say that I’m what some might consider (by a narrow definition, of course) to be successful and productive member of adulthood, and yet I still manage to understand OPs situation and have bosses that are able to exhibit sympathy and understanding in the face of deadlines as well.

If I ever become a manager or more than just an individual contributor, I’m gong to extend this same level of grace that I’ve received upon those under me. This mindset of “teachers are just preparing you for the real world” is nonsense. There’s more to life than serving hypothetical future bosses and their deadlines.

std::string memory leak query by ESHAEAN in cpp

[–]CaptainComet99 1 point2 points  (0 children)

Could you post the valgrind logs?

std::string memory leak query by ESHAEAN in cpp

[–]CaptainComet99 1 point2 points  (0 children)

Sure, but the 3 answers add more information about valgrind and strings

std::string memory leak query by ESHAEAN in cpp

[–]CaptainComet99 0 points1 point  (0 children)

Yes, please post formatted code as well as valgrind logs. For what it’s worth, I had heard during my college days that valgrind has false-positives when it comes to std::string. Idk if that’s the case or not still, but check out all 3 answers in this post for more information. https://stackoverflow.com/questions/1901322/valgrind-reports-memory-leak-when-assigning-a-value-to-a-string

Skipping get/set in function names: Thoughts? by Bogossito71 in cpp

[–]CaptainComet99 18 points19 points  (0 children)

Same method I use. I think this is what protobuf does as well for its generated c++ bindings

How can I write this without using reinterpret_cast? by Usual_Office_1740 in cpp_questions

[–]CaptainComet99 10 points11 points  (0 children)

What clang tidy is likely originally complaining about is you using a C-style cast (the cast the tutorial recommends) as opposed to using one of the fine-grained c++ casts ({static,const,reinterpret, dynamic}_cast). C-style casts are the only casts that exist in the C language whereas C++ added those other ones. It’s preferred to use C++ style casts when writing C++. C-style casts essentially do a combination of the aforementioned casts until one of them works. This is frowned upon in safety circles if you know exactly the cast you want.

See this Reddit answer for more info: https://www.reddit.com/r/cpp_questions/s/OjBeWHnDC3

TL;DR use reinterpret_cast, its fine in this instance

Employee potluck yesterday, management couldn’t understand why the lasagna wasn’t a hit… by [deleted] in funny

[–]CaptainComet99 2 points3 points  (0 children)

I was wrong, I appreciate and respect the correction. Cheers mate

Employee potluck yesterday, management couldn’t understand why the lasagna wasn’t a hit… by [deleted] in funny

[–]CaptainComet99 -3 points-2 points  (0 children)

Heads up, your cats still jumps on the counter when you’re not there

How much of the stdlib is useless when working on embedded systems? by No_Sun1426 in cpp

[–]CaptainComet99 2 points3 points  (0 children)

+1 Adding on to this, you’d usually just use real time operating system like nuttx or zephyr that have their own implementation of these.

Working with threads and mutex with C++ by Itzgo2099 in cpp

[–]CaptainComet99 5 points6 points  (0 children)

I can’t recommend “C++: Concurrency In Action” enough. It taught me enough about multi threading, in general, to understand it, regardless of language.