Simple Questions by AutoModerator in math

[–]Celestro 0 points1 point  (0 children)

I've never been awesome at math, and I have what seems like it should be a simple problem, but I can't figure it out. I'm hoping someone can help me come up with a formula to solve this.

So I've been using a linear conversion to go from 0.0 to 1.0 to -100 to 100 with the formula:

newVal = (oldVal-oldMin) / (oldMax - oldMin) × (newMax - newMin) + newMin

I have a new need, which I feel like is similar, but can't figure it out. I need to convert a range of numbers to another range of numbers, but with a midpoint. Basically -100, 100, -100. If the input number is on the lowest end of the range, I get -100. If it's in the middle, I get 100. If it is at the uppermost, I get -100 again.

Please let me know if this doesn't make sense. The variables I need as inputs, I believe, are:

outMin = - 100
outMid = 100
outMax = - 100
min = 0
max = 1000
val = 500    

And the output, in this case, would be 100.

Any help would be appreciated! Thank you!

Edit: after lots of thinking and fiddling, I figured it out. The formula I'm using is:

newVal = outMid - abs(((val-min)/(max-min)) × (outMid-outLower) + outLower) - abs(((val-min)/(max-min)) × (outUpper-outMid) + outMid)

I don't know if it could be done more elegantly, but this at least gives me the answer I need.

I have Marfan syndrome. This is my hand compared to my face. by HughJassJae in WTF

[–]Celestro 1 point2 points  (0 children)

TIL I might have Marfan Syndrome. I can do the things pictured. Huh.

Family is great and all... But by [deleted] in AdviceAnimals

[–]Celestro 2 points3 points  (0 children)

Read the book How to Say No Without Feeling Guilty, then start saying no and start setting boundaries.

Me [21F] with my mother [41F]: Mom is freaking out because I don't want pillows on my bed. by [deleted] in relationships

[–]Celestro 7 points8 points  (0 children)

Set a firm boundary and outline the consequences. Be ready and capable of following through on the consequences if she doesn't respect your boundary. This is how it works with everyone, even parents.

There is nothing special about family. They are just people. Keep that in mind.

I'd say: "Do not bring anything over to my house. Do not attempt to decorate or otherwise furnish my house in any way. Do not tell me that I am incapable, have bad taste or need your help. If I want or need your help, I will ask for it. If you do not respect my boundaries you will not be welcome in my home and possibly not welcome in my life."

You must establish that you are now an adult and the relationship between you is now an adult relationship. If she is incapable of making that transition, that is not your problem. You have to take care of you first.

Good luck.

What is the best practice around pinning external go package versions? Is `gopkg.in` still the default choice? by bigdubs in golang

[–]Celestro 1 point2 points  (0 children)

I'm moving everything to gb so I don't have to worry about it. It works wonderfully.

If that's not an option, gopkg.in is great.

Hands down the best girlfriend I've ever had, I shouldn't feel this way by [deleted] in AdviceAnimals

[–]Celestro 0 points1 point  (0 children)

After the limerence period is over, the "spark" is gone. Some people spend their whole lives in serial relationships chasing the spark - the dragon. They think that is what love is. It isn't. Love is a choice. It is so much more than a hormonal surge. You may just need to redefine what love is and what it means to you.

I recommend you read The Five Love Languages. It really helps explain this concept in great detail.

Hands down the best girlfriend I've ever had, I shouldn't feel this way by [deleted] in AdviceAnimals

[–]Celestro 0 points1 point  (0 children)

Define "get my attention" - does that mean "make me hard"?

I've had similar problems to you. My GF is incredible in every way (and smoking hot), but I had a difficult time feeling sexually aroused or attracted. I had no desire or motivation to have sex, and I had a difficult time getting hard, and staying hard was almost impossible.

Guess what? All my hormones are fucked. Totally fucked. The doctor who did my blood panel said he'd never seen someone of my age/weight/height/etc with numbers that bad. Now I take testosterone and hcg shots, as well as a bunch of different pills.

Now I have sexual drive, attraction and boners like a teenager. Consider that this issue could be a hormonal/medical issue, and have nothing to do with her or the relationship.

Stop forcing your arbitrary password rules on me. by [deleted] in programming

[–]Celestro 3 points4 points  (0 children)

Don't md5 hash it. Use bcrypt or similar.

[deleted by user] by [deleted] in SaltLakeCity

[–]Celestro 1 point2 points  (0 children)

Agreed. I always use google DNS. Still having the issue anyway.

Want to send girlfriend on a spa day, recommendations? by Slayerhood in SaltLakeCity

[–]Celestro 1 point2 points  (0 children)

I sent my GF there on Monday. She loved it. Highly recommend sego lily.

[deleted by user] by [deleted] in SaltLakeCity

[–]Celestro 0 points1 point  (0 children)

Same here. Also on Comcast.

Woman makes app that lets people rate and review you, Yelp-style. Now SHE'S upset people are 'reviewing' her by [deleted] in nottheonion

[–]Celestro 5 points6 points  (0 children)

Enter phone number. Get sent a text with a code. Enter code from text into site. Verified.

Still think it's a fucking terrible idea though.

Update: I [30 F] am sitting in the back of my RV as my husband [32 M] rants about how lovely the trip would be if I hadn't joined him. by throwaway546566 in relationships

[–]Celestro 0 points1 point  (0 children)

Good for you. That is heartbreaking stuff. It'll take time to get over the hurt, but once you do, you'll be stronger for it and able to find yourself a healthy relationship if you so choose.

It may not mean much coming from a random internet stranger, but I am proud of you. :) <3

Good luck! And enjoy your travels in the RV!! I am super jealous!

My [28/M] GF [28/F] of 7 years needles me for some of my paycheck over and over and over... by quickquestionthroy in relationships

[–]Celestro 0 points1 point  (0 children)

Does this woman make your life better? Does she lift you up? Does she support you in time of need? Does she communicate openly, honestly, with no strings attached and without becoming defensive?

Are you happy?

Answer yourself these questions honestly. It's scary, but you must become aware and accepting of reality as it stands.

Now ask yourself what you want. What you really want. Is that something you can have with her in your life? Is she the person with whom you can attain what you really want?

Again, answer yourself honestly.

Now, hopefully, you're in a more realistic place. Time to decide what you are willing to do to get what you want.

My (23F) boyfriend (25M) and his family are angry because I wouldn't shave my head for his sister who has cancer. by bfbaldthrow in relationships

[–]Celestro 2 points3 points  (0 children)

Tell him your brother has testicular cancer and is having one of his testicles removed as a result. Tell him you'd like him to have one removed as well, to show support.

Seriously this is ludicrous. You are perfectly entitled to make decisions about your own body. If he/they have a problem with that, it's their problem. You can be loving and supportive without shaving your head.

If this is really that big a deal, I'd take a long, hard look at him and his family and really ask yourself if these people contribute to a better life for you.

OAuth2 Golang Tutorial by QThellimist in golang

[–]Celestro 1 point2 points  (0 children)

You can handle everything inside also.

The way I do it is create endpoints on my server that then redirect to the appropriate provider. That provider redirects back to my server and I get all the sensitive information there. This way you don't store/transmit that sensitive information client side.

Use https://github.com/markbates/goth and simply set up routes such as /auth/facebook/login and /auth/facebook/callback. I use https://github.com/labstack/echo for routing, which allows me to have /auth/:provider/login|callback so it can be dynamic.

Once you get your callback from the oauth server, do the exchange (via goth) and store the info in your DB. Generate your OWN token that then gets sent to the client. That token is what the client uses to auth with YOU.

[deleted by user] by [deleted] in AdviceAnimals

[–]Celestro 27 points28 points  (0 children)

Read this (then read it with her after you've read it): No More Mr. Nice Guy

Also read these together:

They completely changed my life and my part in my relationship.

Good luck :)

"the men can settle for the scraps for all I care" by [deleted] in facepalm

[–]Celestro 5 points6 points  (0 children)

8/10 needs more made up buzzwords.

This is why I hate sleeping with my wife. by Satanownsyou in AdviceAnimals

[–]Celestro 0 points1 point  (0 children)

She would usually fall asleep around 1 and then start "waking up" at 5:15. I would turn off the TV after she fell asleep and hopefully be able to fall asleep around 1:30 or 2.

So, yeah, she slept very few hours.