|
Nish Nishant wrote: One line of code - clear and easy.
Hah! Forgot about that version.
OT - Funny you're in Columbus OH. I had a remote gig for a couple years with a company, Emergitech (they got bought out last year, I think) that located in Columbus. Fun times!
|
|
|
|
|
Marc Clifton wrote: I had a remote gig for a couple years with a company, Emergitech (they got bought out last year, I think) that located in Columbus. Fun times!
Interesting. I don't believe I've heard of them. Their website redirects to a company that seems to be selling a crime database.
|
|
|
|
|
Nish Nishant wrote: that seems to be selling a crime database.
Well, not really a crime database, more a records management database, the idea being that the data on, say, individuals in a household, is available to everyone, from the police to the emergency responders, so people know what to expect in terms of occupants and possible past criminal records, medical conditions, prior incidents, and so forth. Of course, one of the amusing things about all this stuff was that each county (count-ee, not countr-ee) has their own database system, and of course sharing data across counties is not just a technical challenge but more often than not, a political one. Given the number of counties in a state, it gets ridiculous.
|
|
|
|
|
|
You should only need to write this once!
public static class ArrayExtensions
{
public static void Populate<T>(this T[] array, Func<int, T> createItem)
{
if (array == null) throw new ArgumentNullException(nameof(array));
if (createItem == null) throw new ArgumentNullException(nameof(createItem));
for (int index = 0; index < array.Length; index++)
{
array[index] = createItem(index);
}
}
public static T[] Create<T>(int length, Func<int, T> createItem)
{
if (length < 0) throw new ArgumentOutOfRangeException(nameof(length));
if (createItem == null) throw new ArgumentNullException(nameof(createItem));
if (length == 0) return Array.Empty<T>();
T[] result = new T[length];
Populate(result, createItem);
return result;
}
}
Usage:
Client[] clients = ArrayExtensions.Create(10, _ => new Client());
Client[] clients = new Client[10];
clients.Populate(_ => new Client());
If you're pre-4.6, you'll need to replace the Array.Empty[^] method:
public static class ArrayExtensions
{
...
public static T[] Empty<T>()
{
return EmptyArray<T>.Value;
}
private static class EmptyArray<T>
{
public static readonly T[] Value = new T[0];
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
modified 21-Sep-17 9:33am.
|
|
|
|
|
Now you made me look like I asked a programming question in the lounge.
+5!
|
|
|
|
|
I mashed the little finger on my right hand last night and tore off about half the nail.
Unfortunately, that's the finger I use for the Shift key.
Software Zen: delete this;
|
|
|
|
|
And that little piggy cried wee wee wee all the way home.
Hope the owie goes byee!
|
|
|
|
|
USE CAPS INSTEAD!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
WHAT'S THAT SONNY? I CAN'T HEAR YOU FOR ALL THE SHOUTING!
Software Zen: delete this;
|
|
|
|
|
Now you have an excuse to write everything in uppercase, use it I wish you speedy recovery
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Know anybody who's got a good C# to FORTRAN converter?
Software Zen: delete this;
|
|
|
|
|
No, but there is a guide here on Converting C# to COBOL[^] - that's all SHOUTY as well!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
ask cortana to pull up the voice input keyboard
Format Success.
Welcome to your new signa&*(gD@@@ @@@@@@*@x@@
|
|
|
|
|
At last, a sensible suggestion!
(Not very practical in the middle of a cube farm, but still...)
Software Zen: delete this;
|
|
|
|
|
Gary Wheeler wrote: (Not very practical in the middle of a cube farm, but still...)
Sure it. Practical, in the sense of making the Powers That Be rethink the office environment.
|
|
|
|
|
Dilbert Comic Strip on 1994-04-24 | Dilbert by Scott Adams[^]
As always Wally hits the problem right on the head.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Gary Wheeler wrote: Unfortunately, that's the finger I use for the Shift key
So, you need to shift hands then?
|
|
|
|
|
:groan:
Software Zen: delete this;
|
|
|
|
|
I'm surprised nobody else said that.
And, being the age I am, I learned to type on a typewriter with blacked out keys.
We learned to shift with either hand... but I find myself always using my left hand... odd.
|
|
|
|
|
I'm originally a hunt-and-peck typist(*). While I use most of the fingers on both hands, I 'prefer' specific fingers for certain keys. Interestingly, my right hand is more flexible on the keyboard even though I write left-handed.
(*) My mother is a classically trained typist who could manage 90 words per minute on an IBM Selectric typewriter. She can't watch me type on a computer keyboard without turning a bit green .
Software Zen: delete this;
|
|
|
|
|
Tim Carmichael wrote: We learned to shift with either hand... but I find myself always using my left hand... odd.
Same here. Shifting with the right hand just feels wrong for some reason
On the other hand, you have different fingers. - Steven Wright
|
|
|
|
|
I originally read that as the "Sh*t key" - and I would have to agree.
|
|
|
|
|
Curious - are you left handed? I'm right-handed and use my left hand pinky for the shift key. I Just Tried Typing This With My Right-Hand Pinky and it was a painfully slow experience, not to mention that my left hand pinky kept twitching "I want to do it!"
|
|
|
|
|
Marc Clifton wrote: Curious - are you left handed? Yup, although I'm a collaborationist leftie. I use scissors with my right hand, fire a pistol right-handed, etc. I throw a baseball or swing a tennis racket with my left.
The deciding factor seems to be precision tasks I do with my left hand, strength tasks with my right. I've measured my grip strength at the gym, and my right hand is measurably stronger than my left.
Software Zen: delete this;
|
|
|
|