|
Seriously, what's with this worship for mental arithmetic?
Growing up I always felt oppressed by my inability to do mental math. Specially in elementary school when my parents would point out to other kids that could multiply two or 3 digit numbers while I was still struggling with multiplication table. Relief came latter on, when I discovered geometry, algebra and all the other fine parts of math. I've managed to be gainfully employed and build fairly sophisticated things while still maintaining my hesitations about 7 times 8.
Don't get me wrong, I understand the value of having a large array of information and concepts at your disposal in your brain can help you solve complicated problems. It's just that I don't see where multiplications table fits in this picture.
Griff mentioned the slide rule; that's one thing I liked while growing up. It would give a rough idea what the answer was, without having to be too accurate.
If the world went downhill in the last 50 years, which I'm not sure it did, I don't think mental math skills are the root cause.
Mircea
|
|
|
|
|
Well, I'm betting this is a first for the Lounge. Getting trolled for a (light-hearted) post about decimilisation!
Mircea Neacsu wrote: Seriously, what's with this worship for mental arithmetic? I didn't notice any "worship".
Mircea Neacsu wrote: Growing up I always felt oppressed by my inability to do mental math. Pick ANY subject in the world, and someone out there is going to be not very good at it. So, (on that basis), should we stop posting about anything?! That's a rhetorical question, BTW. No answer needed. I've never been very good at fighting, drinking, telling jokes or picking up women - and I'm colour-blind. So, in future, if someone mentions one of those, should I go on a rant? Yep, rhetorical again!
Mircea Neacsu wrote: If the world went downhill in the last 50 years Nope! I've double checked. I didn't mention the world going downhill.
Chill....
|
|
|
|
|
I thoroughly apologize if my short rant rubbed you the wrong way. It wasn't my intention at all. I was chill and intend to stay that way (specially with the -12 degrees outside )
Mircea
|
|
|
|
|
|
Very true, we learnt LSD at home and school and it became second nature to repeat to oneself the 'table'
12 pence one shilling
20 pence one and eight
30 pence two and six
40 pence three and four
...
|
|
|
|
|
Richard MacCutchan wrote: 20 pence one and eight Well, sort of; except that pre-1971 (in my part of the UK at least) if you used the word "pence" in any context other than "thruppence" or "sixpence" (or in relation to shillings, as in 1/8 = one shilling and eight pence, though normally vocalised just as "one and eight") people would think you were mad. 1/8 is 20 pennies.
[I think I've recalled on here before my colleagues astonished looks when in a business meeting in 2009, which was dealing with small monetary values, I referred to 3p as "thruppence"... Yes, I was the oldest person in the room at the time.]
|
|
|
|
|
I don't know where you were brought up, but in that context we would always say pence. No one that I ever knew recited, "twenty pennies one and eight". The post decimal time was where it got confused because the new 1p coin was inscribed "One new pence", so people started saying pence all the time even where it was incorrect.
|
|
|
|
|
Richard MacCutchan wrote: Very true, we learnt LSD at home and school I knew that the 60ies were pretty relaxed with the (ab)use of drugs, but giving LSD in a school... that could explain some things
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Yeah, but I went to school in the 50s. I missed the drug scene by doing other things.
|
|
|
|
|
Had the UK not decimalised its currency, it would today be in the good company of Madagascar and Mauritania.
The US shares the dubious distinction of non-metric standards with Liberia and Myanmar.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
About that, when are you going to go back in time properly?
Not this brexit nonsense, I bet the kids of today can't wait to start counting their money on both their hands and their feet.
|
|
|
|
|
Jörgen Andersson wrote: counting their money on both their hands and their feet.
Knowing today's kids, you don't want to go back to using guineas.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Not enough of them having six toes on one foot?
|
|
|
|
|
Canada hasn't had real money since 1967, the last full year of silver coinage. If you do the conversion between Imperial and metric, a dime bought a liter of gas then. It still does, though you'd have to take it to a coin shop first.
The last year for the US was 1964, but I don't know the last year for the UK.
|
|
|
|
|
I'm wrapping a bluetooth library because i have to. So much of it is asynchronous, but it uses an event model for the asynchronicity which if you think about it makes everything more difficult.
Consider the simple act of terminating a connection. It can take some time over the bluetooth protocol to do so gracefully.
The library exposes a (weirdly named but okay) "OnDisconnect" event from its client object. You must hook that event to know when the disconnection is complete. (This is especially critical for methods like Connect that aren't usually fire and forget but disconnect is simpler so i'm using it here)
It means you have to hook an event to find out when you can keep going, and you often have to unhook your handler from the event when you're done because next time you call disconnect or connect or whatever, you may need to do a different thing this time when it completes!
Callbacks would have been easier.
Worse, you can't pass any kind of state argument to Connect or Disconnect, or any other async method, which means in the real world, you pretty much have to hoist arguments and vars from your surrounding code, which means handling your events using anonymous method lambdas, which means it's very difficult to unhook your anonymous handler from the event when you're done.
This kind of thing above - exposing something that should be a callback as an event, and then not allowing a state parameter is an example of how not to do it.
In order to make stable code, I've been wrapping the entire library with something that uses exceptions instead of int error result values (correcting another sin) and then wrapping the event model with microsoft's awaitable TAP pattern (ie: using the familiar task framework)
It's a pain in the elephant because of the mess above.
This is what it looks like, even for the simplest thing. Don't do it, kids. If you're going to make code that exposes asynchronicity plan it for real world scenarios.
public int Disconnect(int millisecondsTimeout = Timeout.Infinite)
{
if (_gattClient.State != wclClientState.csConnecting &&
_gattClient.State!=wclClientState.csConnected)
throw new InvalidOperationException("The client is not connected");
int result = 0;
using (var ev = new AutoResetEvent(false))
{
wclClientConnectionDisconnectEvent cde = (object sender, int reason) =>
{
result = reason;
ev.Set();
};
_gattClient.OnDisconnect += cde;
BleException.Check(_gattClient.Disconnect());
if (!ev.WaitOne(millisecondsTimeout))
throw new TimeoutException("The disconnect operation timed out");
_gattClient.OnDisconnect -= cde;
}
return result;
}
wclClientConnectionDisconnectEvent _cdeHandler;
public Task<int> DisconnectAsync()
{
if (_gattClient.State != wclClientState.csConnecting &&
_gattClient.State != wclClientState.csConnected)
throw new InvalidOperationException("The client is not connected");
var tcs = new TaskCompletionSource<int>();
System.Diagnostics.Debug.Assert(null == _cdeHandler,"The async disconnect was somehow already in progress");
_cdeHandler = (object sender, int reason) =>
{
tcs.SetResult(reason);
_gattClient.OnDisconnect -= _cdeHandler;
_cdeHandler = null;
};
_gattClient.OnDisconnect += _cdeHandler;
BleException.Check(_gattClient.Disconnect());
return tcs.Task;
}
Real programmers use butterflies
|
|
|
|
|
It has been a long time I had to work with multiple event chains but....
Last I did, I turn them into IObservable and that help me express concisely what would have been messy otherwise...
Have a look at Rx.NET and learn it a bit!
GitHub - dotnet/reactive: The Reactive Extensions for .NET
I always despised working event and event handler and state variable, it's very spaghetti prone
But by turning events into Observables I can describe what I want and my conditions in very expressive and simple fashion!
|
|
|
|
|
I prefer, where possible to turn them into TAP patterns (async/await). That's what I'm doing with that code above. It's ugly because it hides ugly details behind a nice clean TAPpy API
Real programmers use butterflies
|
|
|
|
|
MM.,... just read a bit about...
it looks like it's about turning 1 event into 1 async method...
Rx.NET and Observable it's about something like LINQ to query multiple events, in any order.. not just one!
|
|
|
|
|
TL;DR, but I'm sure there's a braceless single-line if-statement in there somewhere, so prepare to be pitchforked just in case
|
|
|
|
|
You've got it all wrong. Mad scientists are pitchforked; witches are burnt!
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Next post:
honey the codewitch wrote: I'm wrapping creating a bluetooth library because i have to.
Sorry, but I had to.
|
|
|
|
|
*cries*
Real programmers use butterflies
|
|
|
|
|
I expected a witty answer, now I feel bad.
|
|
|
|
|
I'm over it. I just decided to continue writing the wrapper around this mess.
Real programmers use butterflies
|
|
|
|
|
If "The disconnect operation timed out", does that mean you are still connected?
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
|
|
|
|