|
Hay... Nice answer, I agreed
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
The reason for that is maybe he is an old c++ developer.
IN C++ the new and all other allocation functions could
return a null pointer if the function couldn't allocate
the memory.
In C# this is not necessary, because it allocates the memory
block you requested or it throws an OutOfMemoryException.
But it is a common mistake made by the most old c++
developer (including me ) as they started
developing in C#.
Edit:
But throwing a NullReferenceException is very uncommon and cruel (can be misunderstood).
Greetings
Covean
|
|
|
|
|
Yes, his background is in C++
|
|
|
|
|
Just give him a friendly hint (senior developer don't like it if you say the produce senseless code )
that he hasn't to check for null and that those lines never will be executed -> just a waste of time.
Greetings
Covean
|
|
|
|
|
or just ask him to provide a class whose constructor does return null. That will keep him busy...
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hehe, I like this idea...but will probably go with the gentle reminder approach.
|
|
|
|
|
Hi
I've got a pretty basic question. I've got an application that loads up one main form where users can login using face recognition. I want to include a button called "Alternate login". If the user clicks this button, another form should load providing an alternate means of logging in. But the other form should close though, and this new form must load in its place, with the same size etc. In essence, it shouldn't look like a new form is opened at all, it should simply look like only the controls on the form change.
Is there an efficient way to do this without actually hiding and showing controls? Another example would be a wizard interface, where the user clicks next the whole time and then the form stays the same, only the controls change.
|
|
|
|
|
Check out this tip/trick:
Multiple Subsequent Main Forms in C# Winform Apps.aspx[^]
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
or use a TabControl?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
|
now should one use user controls when the user hasn't logged in and been properly identified yet?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Etienne_123 wrote: users can login using face recognition. I want to include a button called "Alternate login".
If they use the "Alternate login", does that mean they have to wear a disguise or a mask?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
You've been able to implement facial recognition as a log-in and you need our help for this question?
How do you expect to just change the controls on the form without hiding and showing controls? Magically morph a Button into 2 TextBoxes, 2 RadioButtons, and a Button? (assuming your alternate login used those controls.
I guess what I would do if I were trying to do that would be to create a UserControl. Place your alternate login methods on that UserControl. Then, when they click the "Alternate Login" button or whatever, set that UserControl's size to the same as your form's ClientArea and then add it to your form.
When you create your form, place a panel over all of the controls on your form and when you add the UserControl, just make that panel.Visible = false.
But I'm sure there are hundreds of ways to do this.
|
|
|
|
|
I read many articles on String.Format, in my case I have a string variable that I want to specify its format 10a (a is alpha-numeric), I would like you to help me write this instruction , thank you in advance
|
|
|
|
|
This may seem a little wacky, but String.Format is generally used for formatting other types to a string. Strings themselves cannot really be formatted in any meaningful way.
Perhaps you could explain your problem a little more, and then maybe someone can help you with a solution.
|
|
|
|
|
So in my case I have a table which contains 6 colomns which corresponds to a code and its value, and this table contains the characteristics of this value with format.donc to read a file from the code and its value must be correctly formatted according to the table, so I need to specify the format in 10 alpha numeric, so how do this??
|
|
|
|
|
I would recommend a validation process. If you try to format the return you will get spurious results.
Try using Regular Expressions to validate the value. ^[a-zA-Z0-9]{10}\z should do the job.
|
|
|
|
|
I believe this should do it.
myString = myString.PadLeft(10);
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
If you want "10a" (as opposed to " a"), you would use
myString = string.Format("10{0}", a);
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
It's unclear what you are asking; please provide "before" and "after" examples.
|
|
|
|
|
myString = myString.PadLeft(10, '0');
would keep it all-alphanumeric.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
string.Format("{0,10}", "a")
|
|
|
|
|
that fills with spaces, one could argue the result isn't all alphanumeric.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
thank you very much to all of you, I'll try all these proposals and I will post the solution works
|
|
|
|
|
So we must convert the type specified by theFormatting Numeric Results Table []
that correct??
modified on Friday, May 21, 2010 1:04 PM
|
|
|
|