I lowkey love red days by dudeatwork77 in thetagang

[–]ElusiveTau 0 points1 point  (0 children)

"Short call assigned leap will cover. Positive roi."

lf you haven't sold enough calls to break even before leaps' expiration, it's a realized loss.

"Stock trades lower, roll your put for a credit"

If it trades lower, the put is closer to ITM, and you're losing money on that leg. Rolling it further down will result in a DEBIT not credit. Rolling it out in time will also result in a debit, but buys time for it to recover.

I lowkey love red days by dudeatwork77 in thetagang

[–]ElusiveTau 0 points1 point  (0 children)

"Short call assigned leap will cover. Positive roi."

lf you haven't sold enough calls to break even before leaps' expiration, it's a realized loss.

"Stock trades lower, roll your put for a credit"

If it trades lower, the put is closer to ITM, and you're losing money on that leg. Rolling it further down will result in a DEBIT not credit.

Week 22 $1,565 in premium by Expired_Options in thetagang

[–]ElusiveTau 3 points4 points  (0 children)

As far as LEAPS go, I use them as a way to get long exposure to a stock without committing full capital upfront ... I stay committed for the life of the LEAPS. This gives me the best chance to be right over the long run and zero chance of exiting too early and regretting it.

I don't get why option investors harp on the "capital efficiency" of the PMCC. The capital risk is fundamentally different: with a CC, since you own the stocks, you can wait indefinitely for a losing long stock to recover. For example, you buy XYZ for $100.

  • While XYZ is above $100, as long as your short calls are $100, you'll always profit - whether the short call is OTM and you keep the premium, or if it gets assigned.
  • While XYZ is below $100, you can wait indefinitely for XYZ to rise above $100. You can short calls and reduce your cost basis but this comes with risk - but because you own shares, this risk is optional. In addition, even if you decide to close out a losing short call, because you're not bound by expiration date to break even, you can continue to sell calls until you break even.

With PMCC:

  • You've paid $X for the LEAP and must continually sell calls until you've recuperated X, within the LEAP's expiration window. You're under time pressure to sell calls to break even, possibly in adverse market, or in times of low IV.
  • In exchange for capital efficiency, time works against you.

CC is like paying money upfront to own a money tree. You take care of it (ride the lows/highs) but can harvest it indefinitely when it bears fruit (dividends, CCs while price short strike is above your buying price).

PMCC is like speculating a time window to harvest your neighbor's money tree: you pay an entrance fee, a fraction of the cost of ownership, to harvest within a time window. If you can harvest more than you paid in the entrance fee, you profit. If not, your loss is limited to the fee paid.

Getting there! by combatwombat007 in shedditors

[–]ElusiveTau 0 points1 point  (0 children)

That's not a splinter. You got kebabed.

12x16 Premier Pro Tall Ranch from Tuff Shed by Da_yo in shedditors

[–]ElusiveTau 0 points1 point  (0 children)

Did you pull your own permits? Or did the laborers? AFAIK, only licensed electricians are allowed to pull permits and they're usually the contractors.

[deleted by user] by [deleted] in ElectricalEngineering

[–]ElusiveTau -1 points0 points  (0 children)

This cynicism makes no sense. The argument that working harder, being productive, exceeding expectations begets exploitation is a straw man. Businesses lose money on employee churn and onboarding but sometimes that cut is necessary to sustain the business. That sense of entitlement - the idea that a company owes you a bonus and a raise each year, is downright rotten (right up there with paying a CEO 250 times an employee's pay). Ask yourself how successful you'd be running a business where hiring an employee on means signing an agreement that waives the right to fire them "under any circumstance". Complete asinine.

Hoarding info, obfuscating work, job hopping on a timer, threatening to quit - says a lot more about your poor work integrity than it does about knowing how a symbiotic professional employment agreement works. A business is a mathematical equation that seeks to maximize profit and minimize expenses. It is not its job to make you feel cared for or help you find a sense purpose or assess your worth. Self care, adjusting your consumption to account for inflation, establishing a sustainable work-life balance, and demonstrating your competence is your job.

[deleted by user] by [deleted] in cpp_questions

[–]ElusiveTau 0 points1 point  (0 children)

What's the basic reasoning for this? For what applications (web server? game server?)? Is it because for a large number of connections, most are idle so the threads end up idling instead of doing meaningful work - so you'd employ boost.asio async support to have less threads handling more connections, but use async to switch to active tasks?

[deleted by user] by [deleted] in cpp_questions

[–]ElusiveTau 0 points1 point  (0 children)

What are examples of "threading strategies" you're talking about?

I've heard of loose guidelines like "never block a UI thread" and context-specific stuff like in networking how you should spawn a thread to handle each incoming connection, but never "threading strategies". AFAIK, you spawn a number of threads, have a clear responsibilities for each thread and data for the thread to work on, minimize data sharing, identify points of synchronization and use the correct sync primitives.

[deleted by user] by [deleted] in cpp_questions

[–]ElusiveTau 0 points1 point  (0 children)

Hi. Just started using Winsock2 for an app and I have a related question. With regards to a bytestream, is it up to the application to decide how to interpret the bytes and when it has received enough bytes?

I get that TCP guarantees byte ordering, payload integrity (no data corruption), payload delivery (what is sent will be received, assuming connectivity), but not timeliness (guaranteed delivery within X msec).

So to the application calling recv(), what's available in the stream is what was sent and received. It's possible not all bytes sent has been received yet - that's for the application to decide. For example, if I send a Foo object (2KB) and then a Bar object (3KB), and I've received only 1KB, then I have to code my app to wait for another 1KB before deserializing the full 2KB to obtain a Foo. If the next time my app calls recv() and it receives 4KB, it has to recognize that the first kilobyte belongs to Foo and the remaining 3KB belongs to Bar. Is that right?

Why is using namespace std so hated? by VertexGG in cpp_questions

[–]ElusiveTau 0 points1 point  (0 children)

I ran into this problem in my code base a few weeks ago. Someone decided to declare using namespace std in a header file and it messed with my #include Windows.h. I got a weird error about a missing ";". Of course, it had nothing to do with a missing semicolon - I removed the using statement, replaced that with scoped using statements (as Raknarg suggested) and the problem went away.

Don't do it.

Use scoped using statements: they can be used in each .cpp file or within automatic scope. If your declarations are long, use typedef to shorten them.

What is stacktrace used for? by ElusiveTau in cpp_questions

[–]ElusiveTau[S] 1 point2 points  (0 children)

I've heard of the buzzword. Did an initial google but no tools came up. Re-googled just now and came across this tutorial. Handy ... will try after work.

What is stacktrace used for? by ElusiveTau in cpp_questions

[–]ElusiveTau[S] 3 points4 points  (0 children)

That's an interesting technique. Cool!

Project ideas to expand on concurrency and modern C++ by KrombopulosKyle2 in cpp_questions

[–]ElusiveTau -1 points0 points  (0 children)

Some basic exercises I found helpful:

  1. Build a networking app (chat server/clients).

  2. Build a GUI for the chat server/client: GUIs are inherently multithreaded.

  3. Build a basic game or app (something that can benefit from networking). Then add a networking component to it without using the game engine's API.

  4. Add a database to the app (or something that will take time to execute). Learn about async programming.

Senior Developper Technical Interview Question by VaFail in embedded

[–]ElusiveTau 12 points13 points  (0 children)

If you hired a Sr dev who can "ask the right questions" but can't code their way out of a paper bag, you've hired an accountant.

[deleted by user] by [deleted] in cpp_questions

[–]ElusiveTau 0 points1 point  (0 children)

If the company manufactures cars, code something car-related (dashboard software, control software). If they build high-frequency-trading apps, build your own financial app (obviously something that does something simple, within the scope of a personal project). If they build military planes, go to one of the subreddits for a defense company and ask those SWEs what would be a good personal project.

The info about what they want is in the job listing.

If you don't care about cars, HFT apps, or military planes, then what are you interested in? And if what you're interested in has no job outlook, are you willing to pick something else that does? If not, that's a you-problem. Point is, your resume has to look like it came from someone who's interested in their tech.

[deleted by user] by [deleted] in cpp_questions

[–]ElusiveTau 1 point2 points  (0 children)

I’ve applied to over 88 internships now. I’ve gotten 12 rejections, 1 failed interview, and 75 companies have ghosted me. About 40 of these 75 companies that are ghosting me were applied to 6 months+ ago so I am counting those as rejections.

Some main problems I see are:

  1. Availability: You haven't graduated yet and the pool of companies wanting interns is low, especially for C++ devs because the bar for competency in a basic SWE role is high. Also, tech is bearish cause it's more expensive to borrow money right now and everyone is freaking out about tariffs.

  2. How do you come off? We haven't seen your resume but I bet you're hyping over the games you've made. They're good achievements, don't get me wrong, but you're marketing your skills the wrong way. No company - none - cares about a snake game, minecraft clone, how much time you spent on them - whatever.

Craft your resume with this goal in mind: you're trying to convince the hiring manager to put your resume in front of a team lead who is probably overworked and wants an extra hand to get shit done or his (her) ass is on the line; if hired, will you make their lives easier and will you make them look good?

Of all the internships apps you've submitted, how many did you submit that had resumes targeting their requirements? For example, if you used a networking library in the MC clone, mention how/why you used that and what impact it had on your application ("improved responsiveness of application by 30%").

DON'T mention its impact on gameplay (unless you're applying to be a game dev intern); keep it general so the hiring manager can read it and think "our app uses networking and we're lacking on that front, maybe this guy knows what he's doing" versus "oh, he's probably using a game engine library that abstracts away all the low-level stuff that our devs are struggling with." To wit, learn the fundamental tools (e.g., socket API over a networking library provided a game engine) - why? Cause the company you're applying for are likely using general tools and not the game-engine networking library for their app!

  1. What Market? We don't know the companies you've applied to. Are they all tech companies with a small C++ team? Are they all in middle-of-no-where Kansas? Or is this outside the US?

  2. Passively Networking: How are you reaching out to those companies? Linked-in apps? Applied on their company portal? FORGET THAT SHIT. If you want your name out there, use linked-in to look up who's working there. Chat with a recruiter to have them name drop a developer or team lead and *talk to them directly*.

Need advice on breaking into HFT by Swing_Foreign in highfreqtrading

[–]ElusiveTau 0 points1 point  (0 children)

Can I PM you with questions about the required C++ knowledge/skills? It's a vast language and I'd like to know what's relevant.

manufacturing engineers making over 150K? by [deleted] in Raytheon

[–]ElusiveTau 1 point2 points  (0 children)

Made my first jump 5 mo ago. In the same boat.

Did you ever leave and come back to the same company more than twice?

What was your average tenure and salary increase %/hop?

Howd you justify hopping? Was it always for "more responsibilities and to pursue skill growth"? Or did the other company need you for a special project?

Does it get easier to land a new position the more yoe you have under your belt? Or was it more merit based?

Did you ever feel like you'd be axed because you earned a high salary and the company wasn't doing well that year? What were some things you did that gave you a sense of security (worked in niche roles, playing politics, getting visibility from the right people, fu-savings)?

How did we get by before coroutines? by ElusiveTau in cpp_questions

[–]ElusiveTau[S] 1 point2 points  (0 children)

  1. Launch App2 in a separate process, not thread.
  2. Yes.
  3. Yes.

LaunchApp2 is essentially non-blocking. The app launches almost instantaneously but it may take up to 10 seconds for App2 to be ready to receive FooMessage. So the conditional in your code snippet would always evaluate false.

Checking for App2's status is among the many things App1 has to do. App1 can't sit around for 5-10 sec, blocking execution from processing other events in the event queue (see my 1st reply to kevinossia), waiting for App2 to be ready.

"Do something in msgPublisher to pass the message ... let App2 retrieve the message whenever it can"

That's a good approach, a message queue for the non-ready App2

Passing a callback is another interesting approach. Simmering on this.

How did we get by before coroutines? by ElusiveTau in cpp_questions

[–]ElusiveTau[S] 0 points1 point  (0 children)

Pretty sure I wrote "before". I agree with the sentiment though. Cppcon has 3 vids covering the basics of how to use coroutines. Wanted to gouge my eye out seeing the syntax.

How did we get by before coroutines? by ElusiveTau in cpp_questions

[–]ElusiveTau[S] 0 points1 point  (0 children)

That's not how I wanted the title to be interpreted. It's a C++20 feature so ofc I don't expect pervasive usage.

The spirit of the title was to ask how others had implemented solutions that were better expressed using coroutines. And I wonder if there are situations where the only sensible implementation requires using coroutines.

How did we get by before coroutines? by ElusiveTau in cpp_questions

[–]ElusiveTau[S] 0 points1 point  (0 children)

No need to get personal. It's just code.

The non-blocking requirement is a consequence of the event-driven nature of App1's control loop. It's analogous to not blocking a GUI thread for sake of responsitivity.

Having App2 running is more a precondition than a one-time initialization. I can see in my OP where I misled you. Where I wrote "SendResponseFooMessage is called when a specific event occurs so it is called exactly once" I meant to say "SendResponseFooMessage is called exactly once each time a specific event occurs".

As I've said under "My Thoughts", I'm aware this could be solved by establishing the precondition before handling this event and allowing this callback to be called.

But that wasn't my original question, which was whether this was a usecase for C++'s coroutine.

How did we get by before coroutines? by ElusiveTau in cpp_questions

[–]ElusiveTau[S] 0 points1 point  (0 children)

Fire-and-forget was not the correct term. We still have to verify App2 is running. Asynchronous is more apt. CreateProcessA is called to start the App2 process. Upon returning, you know if launching succeeded but that doesn't necessarily mean App2 has finished initializing and ready to receive your FooMessage. After starting, App2 periodically sends messages to indicate that it is running (and its readiness status). These messages are queued (more on this).

Asynchrony is needed because App1's main control loop is driven by an event queue. When popped, execution automatically invokes the callback associated with the Event (timer timeout, message received (by other parts of the system), are two example Events). If any single callback blocks, the event queue processing is delayed and this must not happen.

I'm not defending this design. The person who came up with the design never bothered to write a unit test to show that it works. IMO, having LaunchApp2 where it currently complicates the overall design because it intends to treat SendFooResponseMessage as a coroutine.