|
You're saying so you could run a number of methods (funcs) (in the foreach loop), right?
That would be interesting.
Once you start doing this stuff it inspires you to see everything this way.
|
|
|
|
|
This thread, and the responses to it, are the kind of back-and-forth that makes CP so valuable to me ! thanks, again, to your ever curious mind for starting it.
cheers, Bill
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
Replace params Func<T, T>[] funcs simply with <IEnumerable<Action<T>>> and you're good to go.
Marc
Latest Article - Contextual Data Explorer
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Nice ! thanks, Bill
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
|
Thanks very much. I will read that later today.
I was looking for just such a resource.
Love it when the answers just crash into me without me having to exert any energy.
|
|
|
|
|
I'll get a static initialised without a explicit ctor if it kills me!
header:
struct client {
static client dummy;
std::string username;
int id;
} cpp:
client client::dummy = std::move(*[=] { client * c = new client();
c->username = "<DUMMY>";
c->id = -1;
return c;
}()
); I'm not going to use this code but I wonder about it... memory leak?
|
|
|
|
|
And you are sure you didn't miss a way to write it more unreadable?
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
I'm used to C# so tried
return new client(){username = "<DUMMY>"; } but didn't get told off about it until compile-time
|
|
|
|
|
Why does the struct have to have a static copy of itself in it? Why can't you just do:
struct client {
std::string username;
int id; }
static client theInstance;
theInstance.username = "<DUMMY>";
...
|
|
|
|
|
David O'Neil wrote: Why does the struct have to have a static copy of itself in it?
Doubt it but might be the pattern used by some of .NET for defaults. Think string.Empty or Comparer<T>.Default [^].
modified 18-Mar-18 21:00pm.
|
|
|
|
|
I wrote an in-house Overtime system for our workers. One particular shift is a 24-hour on-call, which is typically 8am to 8am the next day. A worker happened to do an on-call shift 3/10 8am to 3/11 8am, and the system said it was invalid--because he only did 23 hours due to the clocks being moved forward! Once he changed the end time to 9am, it worked.
Strictly speaking, the system is correct--but it sure looks weird.
|
|
|
|
|
Hmmm... one of those annoying issues.
'Work' a full shift, but on that day, it's only 23 hours.. and in the Autumn, it's 25 hours.
What happens if there is overlap for users? This user entered 8:00 AM to 9:00 AM, presumably, someone else may have worked from 8:00 AM on during the same hour.
|
|
|
|
|
DST is evil; don't do it.
Or at least convert everything to UTC and call it good.
|
|
|
|
|
|
Actually - just make it permanent and call it "The New Standard Time" (good start for TV Series?)
It's absolutely great leaving (I cut out at 15:00) and having that bright sunshine, hours of it, ahead of me.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I generally work 07:00 to 15:30 . No need to change your clock or insist that other do.
|
|
|
|
|
He actually spent 23 hours. The system (and his contract) should allow 23, 24, 25
... such stuff as dreams are made on
|
|
|
|
|
Internals in UTC, presentation in local time.
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
den2k88 wrote: Internals in UTC, presentation in local time.
The presentation still wouldn't add up...just make presentation UTC as well...they'll get used to it! No more DST problems!
"Go forth into the source" - Neal Morse
|
|
|
|
|
If the presentation doesn't add up due to DST shenanigans it's not a problem - presentation is for the human user who could use his human brain to take into account the reason of discrepancy.
kmoorevs wrote: make presentation UTC as well...they'll get used to it! Empyrical proof taught me that this is not the case, unfortunately
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
A method out there:
public bool ImportSQLTableIntoHive(SqoopJobRequest jobRequest);
and used like:
private bool CopySQLTableToHive(string tableName)
{
this.SqoopJobManager.ImportSQLTableIntoHive(request);
return true;
}
|
|
|
|
|
Ehsan Sajjad wrote: Sqoop
I keep reading that as the "ScoopPoopJobManager"
Latest Article - Contextual Data Explorer
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
let me refactor the name of it
|
|
|
|
|
I have found a better name: ScoobyDooImportToHive()
|
|
|
|