|
It's always a good time to use ungulate in a sentence.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Time for a holiday in Bhutan
|
|
|
|
|
... too quiet
10 hours without a "do my homework" request (or any other request) in QA?
Where is the real Codeproject, and what have you done with it?
[edit]
Question posting isn't working - I tried and failed.
Reported in S&B
[/edit]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Possibly because of this[^].
|
|
|
|
|
Maybe all the "do my homework" questions will now be posted elsewhere (look out SO, etc.).
|
|
|
|
|
Summer break?
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
|
|
|
|
|
OriginalGriff wrote: Question posting isn't working - I tried and failed.
Remember we cannot see your screen. Where did it fail and what were you doing? We are happy to help if you tell us what you have tried, and what error you are getting.
Sorry ... couldn't resist
|
|
|
|
|
I tried to tell you but it failed when I tried.
Can't you just fix it for me? plzzzzzzzzz ... I gotta hand it in tomorrow ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
("1".ToDec() * 100M).ToString() == "100"
("1.10".ToDec() * 100M).ToString() = "110.00"
And because PayPal wants integer amounts (hence the multiplier by 100), it bombs when it sees a string amount containing ".00".
Fix:
("1.10".ToDec() * 100M).ToString().LeftOf(".00");
Yes, copious use of extension methods, but really???
public static decimal ToDec(this string value, decimal defaultValue = 0)
{
decimal ret;
if (!decimal.TryParse(value, out ret))
{
ret = defaultValue;
}
return ret;
}
Why, after multiplying by 100M, would ToString() behave differently when the original value had "cents". It makes no "cents" to me!
I guess it's because the decimal type originally had a fractional component to it, and that somehow gets preserved when multiplying by 100, so the ToString() behavior changes.
|
|
|
|
|
You can remove decimal part if you divide the number by 1.000000000000000000000000000000000m
|
|
|
|
|
Mladen Janković wrote: You can remove decimal part if you divide the number by 1
Well, that's a different solution!
|
|
|
|
|
Marc Clifton wrote: Fix:
("1.10".ToDec() * 100M).ToString().LeftOf(".00"); Or preferably:
("1.10".ToDec() * 100M).ToString("###0");
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Ha! You beat me to it! "###0" is the best answer.
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
Richard Deeming wrote: Or preferably:
Yah yah. Good point.
|
|
|
|
|
I think it's because decimals are denormalized EVIL.
People keep telling me I need to embrace these emoticon things. There we go, its a happy post now.
Regards,
Rob Philpott.
|
|
|
|
|
For my Rational class, I used decimal.GetBits to access the exponent portion of the value -- and (I think) ensure that it is positive to force an "integer" value.
|
|
|
|
|
If Paypal wants integer you're surely skipping the step that would render the result consistent.
("1.10".ToDec() * 100M).ToInt();
Or is that just me?
|
|
|
|
|
I don't much care for waking up in the morning, but its made worse when you've spent the night on a mattress which dips in the middle and has given you backache overnight. I'm on my 3rd mattress in ten years now, and because I'm a superking kind of guy, these things aren't cheap. It goes the same way each time, a new mattress is wonderful and flat but after a few months it starts to dip in the middle. I am genetically quite a big bloke to start off with, and I like to supplement that with a copious helping of lard around the waist so I can't entirely blame the mattress, material science just can't keep up with me.
So I'm faced with yet another purchase. Perhaps it is time to splash the cash and go into multiple thousands on one of these things, but that will annoy me intensely if it goes the same way in six months. Mattress guarantees don't cover against the things getting flattened by large men it seems.
I can't be alone in this, does it sound familiar? And I know its a divisive topic, but springs or foam?
[Suspected this might be a repost, yes I asked a similar question in 2009, page 38,123]
Regards,
Rob Philpott.
|
|
|
|
|
You did say you were a big "bloke" so I am assuming you are more heavy than the average humanoid.
Best Mattress For Heavy People of 2021 | Sleep Foundation[^]
I am 6'5" and weigh roughly 260 (30 pounds overweight, so the doctor says). I have only used/tried spring mattresses. I can't speak to foam, although, I know a lot people that like them.
I have had the same spring mattress for over 10 years now. You do have to rotate it, once a year. Also, if you sleep alone, make sure that you are not always sleeping in the center - rotate locations also.
...oh, and yes, you HAVE to spend $$$ to get a good mattress. Anyone who says otherwise is being silly.
|
|
|
|
|
Sounds like a vote for springs. I'm 6'2 and err (calculator...) about 220lbs.
On the subject of tallness, do you find the world is too low down? I'm familiar with not fitting in beds with footboards or seats on public transport, but as I get older and things ache more and I recently realised that I have to stoop over all the time to reach everyday things like kitchen surfaces, wash basins etc. No wonder my posture is so appalling - the world is designed for the more compact person it seems.
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: the world is designed for the more compact person it seems.
Indeed.
I have to have an extra long mattress due to my height (California King is what I think we have). I hate having the feet dangling or hitting the footboard all the time. this type of mattress is usually expensive for a good one.
|
|
|
|
|
This is one of my major complaints with the local big & tall clothing stores - why do they put the smaller sizes up high, and the larger ones down low? Why are the XL shirts on the top shelf while the 4XLT shirts are on the shelf that's 3 inches above the floor? I complained to them about it for years (decades, even), but now I usually skip the local shopping altogether and order online.
|
|
|
|
|
If you have back problems, I'm told that the harder the mattress the better. My late uncle took this to extremes - he used to sleep on a wooden board. I doubt that you need to go that far...
The advantage of spring mattresses is that they can be made with springs of any hardness. Foam mattresses, OTOH, are limited by the strength of the material making up the foam. If you are larger than average, I would definitely go for a hard spring mattress.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Woah, I started composing and went away for half an hour, and you said the same thing I did. The harder the surface, the better it is, I totally agree.
Cheers,
Vikram.
|
|
|
|
|
This is probably a cultural thing, but I sleep on either the floor with a thin mat (not a mattress, a mat) or if I absolutely had to sleep on a bed, I use a thin mattress (6 inch thickness) with cotton stuffing that's very hard.
I had serious trouble sleeping when I visited the UK several years ago as Western style thick mattresses tend to dip in the middle, it gave me bad back pain. And I definitely don't have weight issues, I am 176 cm tall and weigh 65 kg.
Reed mat (craft) - Wikipedia
Cheers,
Vikram.
|
|
|
|