|
I pity the tiger that have to eat some of my co-workers...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
As long as it doesn't eat the tea lady...
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
Teams made of tigers who are paid to mew, and not roar.
|
|
|
|
|
How do i count for specific integer values in a datagridview row, with a column range in c#. And display the count results in a certain column.
I have tried this, but am getting an error:
for (int i = 0; i <DataGridView.Rows.Count; i++)
{
try
{
var values = DataGridView.Rows.Cast<DataGridViewRow>().Select(x => x.Cells[i].Value);
var sector1 = values.Count(x => Convert.ToInt32(x) >= 34 && Convert.ToInt32(x) <= 50);
var sector2 = values.Count(x => Convert.ToInt32(x) >= 51 && Convert.ToInt32(x) <= 100);
DataGridView.Rows[i].Cells[4].Value = values.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
modified 13-Dec-15 11:22am.
|
|
|
|
|
Start by learnoing to read; especially the bit above in red about Programming Questions.
|
|
|
|
|
Start with Google.
If that doesn't help try here: Ask a question[^] - but two things:
1) Explain exactly what you have tried, and where you are stuck. The more accurate you are the better the response.
2) Pay attention to what you are doing in future: not bothering to look at instructions which tell you what not to do is a good way to annoy people. Annoyed people do not help as much as happy people...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
The error am getting is "System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Windows.Forms.DataGridViewRow,System.Object]".
Am trying to select a rang of values and count how many they are in a row, starting from a column 4 upto of all rows upto column 20 of each and every row
|
|
|
|
|
You are clearly a very slow learner.
This is not the right place for technical queries, as you have been told twice before.
I repeat:
0) Start with Google.
1) Start paying attention to your surroundings. Look at the top of this page and you will see in bright red letters that this isn't the place for technical queries. So if you want to make people happy, post this in the right place. Happy people give better help than annoyed ones do...
2) Post it here: http://www.codeproject.com/Questions/ask.aspx[^] but think first: Remember that we can't see your screen, access your HDD, or read your mind - we only get what you tell us to work from. So write your question based on that!
3) Explain exactly what you have tried, and where you are stuck. The more accurate you are the better the response.
And don't post questions here again, or I for one will start to consider it as abusive behaviour...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Me think that the 'real' problem is that Google Translate can't handle numbered lists...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Me think the "real" problem is mummy always did everything for him...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
How large your code is?[^]
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Before obfuscation!
<sig notetoself="think of a better signature">
<first>Jim</first> <last>Meadors</last>
</sig>
|
|
|
|
|
True.
|
|
|
|
|
Friend: Do you mean your whole life fits on two 3.5 inch floppy disks?
Coder: Well, yes, ... ... ... and also some cache in my bank account
|
|
|
|
|
The flaw with that comic:
If he's only been coding for 12 years, it's kinda surprising he's used floppies long enough to still remember their storage capacity.
|
|
|
|
|
A european floppy or an african floppy?
|
|
|
|
|
After years and years of using JavaScript, only now do I find that checking for zero on the denominator when dividing is a complete waste of time since JavaScript handles it gracefully without crashing.
console.log(0 / 0);
console.log(1 / 0);
var divide = (...args) => args.reduce((a, b) => a / b);
console.log(divide(0, 0));
console.log(divide(1, 0));
var result = divide(42, 0);
saveMeSomehow.result = isNaN(result) || !isFinite(result) ? 0 : result; These young kids these days just don't know how spoiled they are.
Note: I don't think the syntax highlighting supports ES6 yet, so yay I broke the Internet.
Jeremy Falcon
modified 13-Dec-15 1:20am.
|
|
|
|
|
This way of sweeping all kinds of errors under the rug is one of the many reasons why I will never voluntarily use it for any serious work.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
It doesn't just sweep it under the rug. It returns Infinity rather than just crashing. It seems like a much better solution than bringing down the entire system.
Jeremy Falcon
|
|
|
|
|
Ok, but I must admit that I still do not like it. This way you always have to test the results which bloats up the code. First, it's an avoidable error and, assuming it comes to my attention, I will find out why the denominater can become zero and then eliminate the problem once and for all.
So what's won by bravely keeping going until the error manifests itself somplace else? You will just have to spend more time tracing it back to its origin and then essentially doing the same work to correct it.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
Oh I totally agree with you on those points. I'm a very defensive programmer so I'd always validate my inputs. To the point my coworkers think I'm nuts for being so verbose.
I've been doing some hardcore JS development in the past couple years. I'm just delighted to know that this won't crash the system anymore, which is a step in the right direction.
I'll always validate my inputs. It's what Jesus would do.
Jeremy Falcon
|
|
|
|
|
Jeremy Falcon wrote: I'm a very defensive programmer so I'd always validate my inputs And you wonder why you are just now finding out the divide by zero handling in JS .
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Are you back in Oz over Christmas.
If so we better catch up for a beer.
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004
|
|
|
|
|
Cambodia, going to see the beaches there. Oz is only in cairns these days, very rarely get to Sydney.
Never underestimate the power of human stupidity
RAH
|
|
|
|