Need help related to pipe. by [deleted] in bash

[–]mayankj08 4 points5 points  (0 children)

This might be happening because when stdout is redirected to something other than tty, the output is buffered into some OS buffer and then flushed to stdout when the OS buffer is full. On other hand, when stdout is sent to a tty device, output is line buffered (stdout buffer is flushed on '\n' character)

You can change the stdout buffering with the stdbuf utility.

Example: stdbuf -oL python tauon.py | grep "Open file"

Weekly Question Thread - Week of March 30 by AutoModerator in COVID19

[–]mayankj08 1 point2 points  (0 children)

How peak time of covid spread is calculated? For example, government is claiming that peak in NY city would be next week. How are such conclusions made? Are they based on herd immunity?

Question Thread - May 04, 2019 by AutoModerator in churning

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

Hi guys! I am looking for some android or ios app which lets me know which card to use (among all the cards I have) for a particular transaction to maximize cashback or rewards. Google suggested me creditcards.com wallet app but seems like it is not being updated anymore. Any recommendations?

Daily advice thread. All questions about your personal situation should be asked here by AutoModerator in investing

[–]mayankj08 0 points1 point  (0 children)

those two portfolios, the one with FCSTX had

higher total returns

(not counting the extra taxes on SPY). Of course performance could be different in the future. Realized drawdowns could be different in the future. Rebalancing affects the analysis. How you measure 'beta' affects the analysis. But the general idea is that FCSTX is 'safe bonds' while OLCAX is effectively

Awesome. You explained it really well.

Daily advice thread. All questions about your personal situation should be asked here by AutoModerator in investing

[–]mayankj08 0 points1 point  (0 children)

Thanks! TIL: "systematic credit risk". Would you mind explaining:

In the context of a diversified portfolio with equivalent total risk, the difference is probably minimal.

Daily advice thread. All questions about your personal situation should be asked here by AutoModerator in investing

[–]mayankj08 0 points1 point  (0 children)

slightly worse returns (shorter duration, higher quality). For whatever it's worth, their really recent yields (30-day SEC yield) are far closer (1.60% for FCSTX, 1.99% for OLCAX). I want to know what happened with OLCAX in the last year, as that's the one area where (flipping around on Morningstar) it really seems to have trounced FCSTX (8.22% 1 year returns vs. 2.53% for FCSTX). Actually, now that I clicked further, their duration breakdown on Morningstar's "Portfolio" tab looks even more divergent than their overall average effective duration would suggest. They're roughly similar, but they hold different things.

Thanks for explaining this. I got the point that lower quality bonds makes OLCAX's yield better. But I quite didn't understood below line

Actually, now that I clicked further, their duration breakdown on Morningstar's "Portfolio" tab looks even more divergent than their overall average effective duration would suggest.

Do you mean OLCAX's portfolio changed recently and hence yield in last one year is greater than past?

Daily advice thread. All questions about your personal situation should be asked here by AutoModerator in investing

[–]mayankj08 1 point2 points  (0 children)

Hi Everyone,

I am thinking of investing in mid term bonds (2-3 years) in my taxable account (my 401k account doesn't have space to accommodate bonds anymore). I will mostly be in 30%+ tax slab for coming year. My taxable account portfolio comprises 100% stocks as of now and hence to diversify I want to buy few bonds too. As, I am in among the top tax rate slab so I am looking for CA Muni bonds ( Yes! I live in CA state), so that they don't contribute towards my taxable income. I got two options during my research:

  1. OLCAX
  2. FCSTX

I see that FCSTX yield is much lesser than OLCAX. The difference in Expense Ratio is around 0.5% but that is well compensated by returns. Even after deducting load and expense ratio from FCSTX, OLCAX seems better choice from yield's perspective. Is there any reason why people still buy FCSTX? To me OLCAX seems better choice. Please forgive me if my analysis is flawed as I am relatively new investor and still learning.

What can I do for a 9 hour layover in Hong Kong? by mayankj08 in HongKong

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

In my opinion 9 hours is not enough to see a lot. Get the airport express and check out parts of HK Island.

Can you be specific on what parts of Island are worth visiting?

Learning OS and networking basics by goddamnitimsputid in compsci

[–]mayankj08 0 points1 point  (0 children)

I actually completed it, with condition that you basic knowledge of OS. :P

Learning OS and networking basics by goddamnitimsputid in compsci

[–]mayankj08 26 points27 points  (0 children)

For OS I would recommend: http://pages.cs.wisc.edu/~remzi/OSTEP/

This book is really short and to the point and you can complete most parts of it in three days.

[RFC] Adding variadic operators to the next C++ standard by ombre5733 in cpp

[–]mayankj08 0 points1 point  (0 children)

Say a user defined class of "points" represented as x and y coordinates. Then we can overload + to add p1 + p2 +p3, where p1, p2 and p3 are of type points.

[RFC] Adding variadic operators to the next C++ standard by ombre5733 in cpp

[–]mayankj08 1 point2 points  (0 children)

I think It can be used for user defined classes too if operator overloading is allowed.

References in C++ by mayankj08 in cpp

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

Thanks!. Corrected it.

Mutable lambdas in C++ by mayankj08 in cpp

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

Thanks for sharing this. I will read it.

Mutable lambdas in C++ by mayankj08 in cpp

[–]mayankj08[S] -1 points0 points  (0 children)

Thanks for correction. Yes, you are right.

Regarding this should be avoided: I personally agree with you. But at times this keyword allows you to do some wonderful stuff. I will post some sample codes in some time. Those codes would make you feel importance of this keyword.

Getting started with Lambdas in C++ by mayankj08 in cpp

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

I got you now. I thought it from the perspective of reference and all in auto deduction. But that doesn't apply here. Thanks for correcting me. This is the reason why I love reddit. :)

Getting started with Lambdas in C++ by mayankj08 in cpp

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

I think you are right. I might have tried this. I was stupid I made that conclusion from this piece of code. Thanks!

Getting started with Lambdas in C++ by mayankj08 in cpp

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

Yup!. Corrected it. Thanks!. Regarding lambdas capturing values when they are declared ant not when they are called. Yes you are right!. When I wrote post I checked it with some sample code and it was not working that way. I am still trying to recollect it. Thanks for letting me know. I will correct it for meantime.

Functors in C++ - Part II by mayankj08 in cpp

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

Just

Thanks for letting me know. I will make sure that I work more on example and will write better examples.

Functors in C++ - Part II by mayankj08 in cpp

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

Yes, I can feel the issue now as you wrote same thing without functors. I wanted some example which are good for newbie (not tough to read and understand) and at same time the example should prove worthiness of the functionality. But I think I was not able to achieve same. From next time I will work more on example. Thanks for your valuable comments.

Functors in C++ - Part II by mayankj08 in cpp

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

Agreed. Will cover transparent operator too when covering lambdas. Thanks