4,439 Posted Topics

Member Avatar for ogsirus

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.

Member Avatar for ogsirus
0
268
Member Avatar for Gribouillis
Member Avatar for Violet_82
Member Avatar for ~s.o.s~
0
238
Member Avatar for Dani

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 …

Member Avatar for invisal
0
608
Member Avatar for Amit_31

>>> 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 …

Member Avatar for Sean Francis
-1
133
Member Avatar for computer_man

Something like this? `if (me.DGV.CurrentCell== null) me.DGV.Rows.RemoveAt(me.DGV.CurrentCell.RowIndex)`

Member Avatar for ddanbe
0
152
Member Avatar for JOSheaIV

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 …

Member Avatar for Popc0rn
1
2K
Member Avatar for Curious Gorge

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 …

Member Avatar for triumphost
0
392
Member Avatar for MandrewP

Perhaps by installing a software patch? That supposes the knowledge of assembly I guess.

Member Avatar for rubberman
0
120
Member Avatar for Ghost0s

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*. …

Member Avatar for ddanbe
0
151
Member Avatar for ARIGAR

And a program to read [the rules](http://www.daniweb.com/community/rules) of DaniWeb perhaps?

Member Avatar for tinstaafl
0
270
Member Avatar for lefteven20

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 …

Member Avatar for Reverend Jim
0
200
Member Avatar for DenisOxon

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!!

Member Avatar for DenisOxon
0
387
Member Avatar for musthafafarhan

You could implement a KeyUp or KeyDown event from your main window and set a particular button according to which key was pressed.

Member Avatar for rproffitt
0
293
Member Avatar for Mark_42

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 = …

Member Avatar for JamesCherrill
-1
2K
Member Avatar for overwraith

? 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).

Member Avatar for ddanbe
0
412
Member Avatar for catastrophe2
Member Avatar for ddanbe
0
174
Member Avatar for Money_maker_11
Member Avatar for Husoski
0
229
Member Avatar for catby

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 …

Member Avatar for catby
0
887
Member Avatar for Ghost0s

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.

Member Avatar for ddanbe
0
120
Member Avatar for savvas3000

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.

Member Avatar for denvii92
0
213
Member Avatar for Paul_37

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?

Member Avatar for ddanbe
0
142
Member Avatar for Violet_82

Isn't there any local computer repair shop? Maybe your garantee with Dell gets broken that way. Depends how old your device is.

Member Avatar for Violet_82
0
311
Member Avatar for msliz

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.

Member Avatar for happygeek
2
369
Member Avatar for Suzie999

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

Member Avatar for ddanbe
0
421
Member Avatar for 9tontruck

A DrawingGroup has a Transform property. You could feed it a ScaleTransform object.

Member Avatar for ddanbe
0
171
Member Avatar for noobjavacoder

AFAIKS you have put your `switch` statement in the `while` condition of your `do` statement.

Member Avatar for stultuske
-1
160
Member Avatar for jas5988

If it's only the mode you're interested in, have a look [here](http://www.sanfoundry.com/c-program-find-mode-array/).

Member Avatar for ddanbe
0
212
Member Avatar for Sphinx'LostNose

Because objects are reference types that is easy, let one object point to the other: Object origObj = new Object(); Object newObj = origObj; //done!

Member Avatar for ddanbe
0
239
Member Avatar for Papa_Don

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!"

Member Avatar for Reverend Jim
0
550
Member Avatar for Callie C.

Well, I just came to the same conclusion. A bit late, but I'm glad you found it out by yourself. :)

Member Avatar for ddanbe
0
202
Member Avatar for COKEDUDE

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( …

Member Avatar for ddanbe
1
241
Member Avatar for zachattack05

You could use a small test project with a class with just the method involved. Don't think it really matters though.

Member Avatar for ddanbe
0
298
Member Avatar for Dani

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"!

Member Avatar for Nick Evan
2
1K
Member Avatar for sherwin_2

Might I say it is rather hard to shorten code more than it already is.

Member Avatar for rproffitt
0
111
Member Avatar for san_man

> I have to create a random matrix You have to, so why should WE have to? Show us your efforts, maybe we'll help.

Member Avatar for ddanbe
-2
316
Member Avatar for wilsonchama
Member Avatar for amacss

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/).

Member Avatar for ddanbe
0
303
Member Avatar for Tiger_2

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 = …

Member Avatar for ddanbe
0
477
Member Avatar for raj208851

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.

Member Avatar for Taywin
0
790
Member Avatar for Nikusha.Kalatozi
Member Avatar for zachattack05

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 …

Member Avatar for zachattack05
0
311
Member Avatar for DS9596

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`

Member Avatar for ddanbe
0
395
Member Avatar for Dani

No harm done I guess, she didn't use the [pluralis majestatis](https://en.wikipedia.org/wiki/Royal_we) :D

Member Avatar for diafol
0
377
Member Avatar for Swaraj_1

Put a class with `f1()`,in between Base1(with no `f1()`) and Dev1 and Dev2. Dev3 still derive from Base1.

Member Avatar for ddanbe
0
147
Member Avatar for Elliander_1
Member Avatar for ddanbe
0
1K
Member Avatar for overwraith

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-).

Member Avatar for ddanbe
0
249
Member Avatar for ddanbe

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 …

Member Avatar for Teme64
1
2K
Member Avatar for zachattack05

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 …

Member Avatar for zachattack05
0
221
Member Avatar for Suzie999

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.

Member Avatar for ddanbe
0
2K

The End.