Readit News logoReadit News
sicp-enjoyer commented on Ask HN: How did you rebuild yourself after having hit rock bottom?    · Posted by u/Schroedingers2c
toomuchtodo · 3 years ago
My apologies, sometimes I forget connecting the dots must be more explicit. Tell me the lifestyle of someone who has their assets split in half and having to provide alimony/maintenance for (possibly) the rest of their partner’s life. I can only speak for my circle of social acquaintances, many divorced, all living terrible lifestyles because of the financial burden of divorce. Some got away with only losing half their assets and having to provide $3k-$5k/month post tax to their ex partners. Some, worse. One expects to have to work to death, and can never retire.

I’m just working back to first principals. You can be happy without the legal Russian Roulette of marriage is my overarching thesis, and I apologize again it took so many words to arrive at my point.

sicp-enjoyer · 3 years ago
Now you're talking about financial burden again. I don't wish the situation you are describing on anyone, and I am sympathetic to making choices to avoid that happening. I don't think that is inconsistent with my other comments.

Just to add, here are a few other things that also limit your day to day freedom and add some risk of legal nightmares:

- operating a business

- owning a home or other building

- running for political office

- raising a child

- using a professional license (medical, law, civil engineer, etc)

sicp-enjoyer commented on Ask HN: How did you rebuild yourself after having hit rock bottom?    · Posted by u/Schroedingers2c
toomuchtodo · 3 years ago
Married men live longer, but the last years are mostly garbage anyway. If you’re co-dependent or really need that companionship, autonomy and agency might not be what you’re optimizing for. Cashflow and wealth doesn’t buy love or happiness, only choices and freedom. Optimize accordingly.
sicp-enjoyer · 3 years ago
Your comment cautioned against marriage for its "cost". Now you are talking about lifestyle preferences.
sicp-enjoyer commented on Ask HN: How did you rebuild yourself after having hit rock bottom?    · Posted by u/Schroedingers2c
toomuchtodo · 3 years ago
Evolve or die. Marriage is an unnecessary burden and construct in modern times. Love, date, cohabitat (non community property state), but the failure rate is too high (~66% of marriages fail) when the cost is similarly high.

Warren Buffett says the factor which most contributes to your future wealth is who you pick to marry. Do you feel lucky?

https://www.amazon.com/Science-Happily-Ever-After-Enduring/d...

sicp-enjoyer · 3 years ago
> the failure rate is too high

The rate dramatically changes with demographic, for example many of those were married young and did not complete education.

> who you pick to marry

The quote doesn't say whether :) Married men also tend to make more money and work for longer periods of time. There is a cynical view of whether that's good or not, but 40-50 year old single men don't seem to be a particularly successful demographic.

sicp-enjoyer commented on Ask HN: How did you rebuild yourself after having hit rock bottom?    · Posted by u/Schroedingers2c
ianai · 3 years ago
This actually reads almost normal for a last year of a phd. But you’re in a phd program and probably much closer to complete than you think.

I’d reach out to your professors about your misgivings about your research. Make it clear that you’re looking to complete the thing asap and need guidance.

Forget the outside stuff. Relationships can wait until you’re done. Feeling like a failure or success is almost a worthless concern as you’re clearly nearly done with a huge life goal. A life goal that will change the context of your life ever after. Much more than any marriage could even. Marriages are fundamentally just a societal complication of a relationship - complete with dubious legal consequences and a not a sure thing that can end. (Plus if someone is bailing on you when you’re finishing a degree they definitely weren’t going to be there for you in actually troubling times - like an illness or your house burning down.) But a degree is a hurdle you surpass once and get to wave the success of forever after. (Just don’t be a jerk about it, side point.)

Know that on the other side of your phd is a huge weight off your shoulders regardless of failure or successful defense. This time of strife will end when the phd. Freedom is soon.

You’re looking at a time where the job market remains strongly favorable. I graduated into the Great Recession and would have benefited greatly from this market, high interest rates and other things be damned. The future is still bright - just got to get past this last bit.

sicp-enjoyer · 3 years ago
I have noticed that Phd holders usually advise buckling down and dealing with whatever abuse or bureaucratic nightmares are required to finish.

I think I agree with 1 year out, but I would be surprised if this hasn't been going on for longer.

sicp-enjoyer commented on Effortless Performance Improvements in C++: std:unordered_map   julien.jorge.st/posts/en/... · Posted by u/jandeboevrie
powersnail · 3 years ago
> It's usually a red black tree and maybe could be a b-tree? "Search tree" is accurate.

I mean, I haven’t write red black trees for a while, but it is a type of binary search tree, as far as I remember, isn’t it?

sicp-enjoyer · 3 years ago
You are correct. Sorry if I am being pedantic. I was also trying to suggest it could be a b-tree but others have pointed out that it doesn't quite fit the spec.
sicp-enjoyer commented on Effortless Performance Improvements in C++: std:unordered_map   julien.jorge.st/posts/en/... · Posted by u/jandeboevrie
pixelesque · 3 years ago
Doesn't std::unique only generally work on consecutive items, and effectively requires the items to already be in a container (or at the very least have access to iterators to the items)?

If so, that sounds fairly limiting to me (i.e. potential extra storage - of duplicates, sorting required, etc).

sicp-enjoyer · 3 years ago
This person is already putting sets inside vectors, so I don't think they are worried about storage.

But yes, you either need to stop occasionally and remove the duplicates or use a set, if the storage is prohibitive.

Otherwise in terms of performance, sorting and unique is much faster than inserting one element at a time in a set.

sicp-enjoyer commented on Effortless Performance Improvements in C++: std:unordered_map   julien.jorge.st/posts/en/... · Posted by u/jandeboevrie
int_19h · 3 years ago
XOR is a bad way to do it, but there are ones that work much better that are described in answers to that post, and it's what other languages use in similar situations (e.g. tuples in Python and C#):

https://github.com/python/cpython/blob/71db5dbcd714b2e1297c4...

sicp-enjoyer · 3 years ago
Yes, and eventually you start computing another hash of the buffer of the concatenated members. I'm not saying it can't be done, I'm just comparing it with recursive memberwise comparison.
sicp-enjoyer commented on Effortless Performance Improvements in C++: std:unordered_map   julien.jorge.st/posts/en/... · Posted by u/jandeboevrie
masklinn · 3 years ago
> Can many hashes be combined quickly in a uniform way?

The XOR operator?

sicp-enjoyer · 3 years ago
If you do that 10 times for all members of your struct, do you get good uniformly distributed keys?

This post doesn't think so: https://stackoverflow.com/questions/5889238/why-is-xor-the-d...

sicp-enjoyer commented on Effortless Performance Improvements in C++: std:unordered_map   julien.jorge.st/posts/en/... · Posted by u/jandeboevrie
tialaramex · 3 years ago
By "iterate" I expect they mean to just look at all the key/value pairs in the map. Since it says "Unordered" right in the name they don't care what order they see the elements, just that they see them all.

This is easy to do in all sane hash map designs, and is very fast in a linear design like Abseil's Swiss Tables.

Also sadly C++ std::unordered_map is guaranteed to be not just a hash table but an open hash table, using buckets to keep all the stuff which collided together. This is probably not what you wanted, but too bad that's what was standardized.

sicp-enjoyer · 3 years ago
This is quite unfortunate. The way to get a really good hash table is by enforcing a bunch of simplifying assumptions (power of 2 sizes, sentinel values, etc). But the C++ committee has to make the "one true table" for everyone.

std::map actually seems to fit this role better. It works reasonable well for many workloads and types without tuning a bunch of parameters.

sicp-enjoyer commented on Effortless Performance Improvements in C++: std:unordered_map   julien.jorge.st/posts/en/... · Posted by u/jandeboevrie
ofalkaed · 3 years ago
Thanks for explaining the obvious, my self taught programming skills are unordered and my biggest obstacle is generally my not seeing what is right in front of me.
sicp-enjoyer · 3 years ago
All of <algorithm> uses ordering operators as well. If you have a "regular" type with proper comparison and assignment operators, it works for everything, container keys, sorting, etc, etc.

u/sicp-enjoyer

KarmaCake day434April 24, 2022
About
I like learning about Lisp, C, and BSD.
View Original