4,439 Posted Topics
Re: If I understand you well, I think you can do something with [the intersect method](https://msdn.microsoft.com/en-us/library/bb460136(v=vs.110).aspx). If not, somewhat more explanation would be welcome. | |
Re: Nice snippet. :) Is there any particular reason for 11 characters? | |
Re: Can't you come up with something interesting for yourself? | |
Re: I probably don't have to tell you that your code needs a lot of comments to document it. Avoiding useless comment like "This is an if statement" etc. In the previous century (the owls could still speak sometimes :o) ) we used to keep some sort of diary where we … | |
Re: >>> eggs = 6 >>> # means the same as: make yourself a box, write eggs on the side and store the number 6 in it >>> # = is called an assignment operator: assign a value to a variable >>> eggs == 5 False >>> # == is a … | |
Re: Something like this? `if (me.DGV.CurrentCell== null) me.DGV.Rows.RemoveAt(me.DGV.CurrentCell.RowIndex)` | |
Re: Yes, I guess a lot of users don't feel at "home" anymore. Before, say a Java addict could jump right in into his habitat and feel cosy to ask a question or solve one or get some info by reading. Now he has to do his thing in some globality … | |
Re: Some programmers like to stay in total control. So they update the PATH variable and work with makefiles, write their code in NotePad or use vi, compile and debug via commands that look like strange incantations etc. etc. I did that. In the previous century. I now use the Visual … | |
Re: Perhaps by installing a software patch? That supposes the knowledge of assembly I guess. | |
Re: Defining your n variable on line 10 as` float n;` or writing `s = 1 / 4.0;` would also do the trick. `(float)1` is considered ugly, but needed in some cases. It is called *explicit conversion*. An expression like `s = 1.0/n`where n is an integer is called *implicit conversion*. … | |
Re: And a program to read [the rules](http://www.daniweb.com/community/rules) of DaniWeb perhaps? | |
Re: Pythagoras would have wanted this, but alas growth rates don't very often express themselves as Integer. So why are you defining yor variables as integers instead of doubles? Converting to boolean on line 8, as RJ points out boils down to true and false. false = 0 and true is … | |
Re: Move immediately to the latest version and skip the in betweens. It would be a great waste of time to do so. Make use of the oportunity to make some improvements here and there. Don't underestimate this, it will take longer than you expected. Success!! | |
Re: You could implement a KeyUp or KeyDown event from your main window and set a particular button according to which key was pressed. | |
Re: You could introduce a method to input an integer. Like this: /// <summary> /// Read an integer from the console /// </summary> /// <param name="prompt">descriptive message</param> /// <returns>an integer</returns> public int readInt(string prompt) { Console.Write(prompt); string line = Console.ReadLine(); int quantity; if (int.TryParse(line, out quantity) == false) { quantity = … | |
Re: ? VB has evolved to C# with somewhat different syntax. It is also called VB.NET instead of just VB, VB4-5-6 or VBA. So yield exists. [See here](https://msdn.microsoft.com/en-us/library/hh156729.aspx). | |
Re: I would make a login form and a separate DB handling form that opens when the login is complete. | |
Re: I think you had some trouble with your indentation. Indentation is very important. Try this from line 39: public static char[][] encrypt() char aChar [][] = new char [5][5]; char[][] aChar = "abcdefghijklmnopqrstuvwxyz".toCharArray(); { for (int i = 0; i < 5; i++) { for (int j = 0; j … | |
Re: Every statement has to end with a `;` `ptr = a;` It is not possible to assign the integer a to the pointer ptr. The reverse happens here `nptr = &a;` You cannot assign the address of integer a(a pointer) to the integer nptr. | |
Re: Welcome to Daniweb! :) If you are not completly sure what you really want, have a look at [this article](http://www.computerhope.com/jargon/p/proglang.htm). Most popular here are(web development asside) C++, Java, VB, C#, Python and C. | |
Re: Welcome to Daniweb :) What is the meaning of lines 47 and 48? Two loops with no statements to loop? Lines 52,53 and 54 reset always your textboxes to empty strings after a click of your button. Is that the intention? | |
Re: Isn't there any local computer repair shop? Maybe your garantee with Dell gets broken that way. Depends how old your device is. | |
Re: I'm sure Dani will appreciate this. We only help out students if they somehow get "stuck" and have shown some effort to reach their goal. | |
Re: Did you forgot the MinValue in your code? When I do this, Byte B = Byte.MaxValue; Console.WriteLine("B in hex is {0:X}", B); Byte C = Byte.MinValue; Console.WriteLine("C in hex is {0:X}", C); I get: FF 0 | |
Re: A DrawingGroup has a Transform property. You could feed it a ScaleTransform object. | |
Re: AFAIKS you have put your `switch` statement in the `while` condition of your `do` statement. | |
Re: If it's only the mode you're interested in, have a look [here](http://www.sanfoundry.com/c-program-find-mode-array/). | |
Re: Because objects are reference types that is easy, let one object point to the other: Object origObj = new Object(); Object newObj = origObj; //done! | |
Re: If you have code like `var1=` , `var2=`, `var3=` etc. That code is just screaming out: "Please put us in an array, or better still in a list!" | |
Re: Well, I just came to the same conclusion. A bit late, but I'm glad you found it out by yourself. :) | |
Re: I agree with rubberman. A function in a loop just wastes time if you evrey time through the loop, want the same value from it. I would call it before the loop int length = strlen(a_str); for ( int ix = 0, ix < length; ix++) { a_str[ix] = tolower( … | |
Re: You could use a small test project with a class with just the method involved. Don't think it really matters though. | |
Re: What is definitely a good side effect of this tagging, is that more and more members who were, say C++ afficionados now also answer questions tagged as C#, or java or whatever. Tagging erases borders between "language countries"! | |
Re: Might I say it is rather hard to shorten code more than it already is. | |
Re: > I have to create a random matrix You have to, so why should WE have to? Show us your efforts, maybe we'll help. | |
Re: Search DaniWeb, an interesting read is [this](https://www.daniweb.com/programming/software-development/threads/448647/new-programmers-what-resources-are-available-to-you). Search Google, [example](http://www.tutorialspoint.com/csharp/). | |
Re: Just so happens, one of my(too many?) projects is trying to build an IC simulator. I started with defining a pin. Be aware that this is just a sketch. struct port { public port(portIOtype pIO, signal sig) { portIO = pIO; state = sig; //defaults pinNr = 0; pinName = … | |
Re: Hi raj208851 welcome here at daniweb! Well your compile tells you what is wrong, it expected an expression before the `else` keyword. If you would send in some example code that would help us tremendously. | |
| |
Re: I guess CodeProject has some good articles about your subject. [Article1](http://www.codeproject.com/Tips/784331/WPF-MVVM-Validation-ViewModel-using-IDataErrorInfo). [Article2](http://www.codeproject.com/Articles/98681/Validating-User-Input-WPF-MVVM). You can write a complete WPF application without using XAML. It is just going to be a little harder I think. With WPF you could have two teams. One does the design and producing XAML and the other … | |
Re: Did you try to put your `#define x 20` in the .h file instead of the .cpp file? I would rather use `const` here, instead of `#define` | |
Re: No harm done I guess, she didn't use the [pluralis majestatis](https://en.wikipedia.org/wiki/Royal_we) :D ![]() | |
Re: Put a class with `f1()`,in between Base1(with no `f1()`) and Dev1 and Dev2. Dev3 still derive from Base1. | |
Re: Why don't you just loop with x through the Math.sin function to get an y value? | |
Re: This [tip](https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.fileio.textfieldparser.aspx?f=255&MSPPError=-2147217396) I got from deceptikon [here](https://www.daniweb.com/programming/software-development/code/468063/how-to-read-lines-from-a-csv-file-). | |
Some time ago, I needed to know the pathname of my running application, in order to create a temporary file. As it seems ther are alot more options than I thought. So I applied all I could find in this little snippet. I also used the full names to make … | |
Re: Well, I programmed for a living in a time when C++, Java and C# weren't even invented. Now being retired I like to program with C# very much in a more or less hobbyist way. So here's my two cents of advice. Programming with Forms is rather easy, but in … | |
Re: You might also have a look [here](https://www.daniweb.com/programming/software-development/code/500681/building-a-dynamic-context-menu-in-a-c-forms-application) a newly posted snippet. |
The End.