2,157 Posted Topics

Member Avatar for yirax

[code]int numberWhoHaveA = 0 While elements in ArrayOfGrades If currentElement.Score >= 90 increment numberWhoHaveA end If end While Output "Number who received an A is " + numberWhoHaveA[/code]

Member Avatar for yirax
0
80
Member Avatar for ninjatalon

Because TFaculty inherits from Person. You can consider it a typeof Person and a typeof TFaculty so we can use pointers of either type to reference it. Do to the 'magic' of virtual methods the system knows that even though we are using a Person pointer we are really pointing …

Member Avatar for Fbody
0
143
Member Avatar for Kath_Fish
Member Avatar for Robert955
Member Avatar for lxXTaCoXxl

Line 8 you are creating a new main form then setting the visibility on that form. You never show that form and it vanishes when the current form closes. You need an actual reference to the first form.

Member Avatar for lxXTaCoXxl
0
84
Member Avatar for iainiow

You could try to open the file with exclusive access: [code]Filestream fs = File.Open(myFileName, FileMode.Open, FileAccess.ReadWrite, FileShare.None);[/code] As long as another process is using the file this call will fail.

Member Avatar for iainiow
0
79
Member Avatar for Arjun_Sarankulu

When using an enumerator to iterate through a collection (which is what foreach is doing) you can't modify the collection as that invalidates the enumerator. You'll need to create a third list of items to delete and delete them once you are done with your foreach loops

Member Avatar for Saikalyankumar
0
73
Member Avatar for Saikalyankumar
Member Avatar for Makcarov

[URL="http://education-portal.com/article_directory/Top_Information_Technology_Schools.html"]Top IT Schools[/URL]

Member Avatar for jit4mech
0
50
Member Avatar for lxXTaCoXxl

[QUOTE=Saikalyankumar;1525744]Create the Form instances in Program.cs File, main one. Then all the Items in every individual form can be accessible in another form.[/QUOTE] This is a bad idea. Anything you need access to on a secondary form should have a property providing you with the appropriate access (get, set). If …

Member Avatar for Momerath
0
113
Member Avatar for RogerInHawaii

It's determined by the order they are in in the controls collection. So the first on is on top, the next one under that, etc. So if you add a new control using the Add method it will end up behind all the other controls. You can use this.Controls.SetChildIndex to …

Member Avatar for ddanbe
0
144
Member Avatar for aravinda reddy

I'd use dynamic programming to generate possible combinations and build upon those, tossing those that violate the constraints. Once done sort the remaining ones by value and take the highest one.

Member Avatar for Momerath
0
134
Member Avatar for ashley11

Use [URL="http://msdn.microsoft.com/en-us/library/0w96zd3d.aspx"]LastIndexOf[/URL] and [URL="http://msdn.microsoft.com/en-us/library/hxthx5h6.aspx"]Substring[/URL]

Member Avatar for CsharpChico
0
576
Member Avatar for TechSupportGeek

Start is not a static method so you have to create a Process object first: [code]static void Main() { Process myProcess = new Process(); myProcess.Start("IExplore.exe"); }[/code] You'll probably want to play with the [URL="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.startinfo.aspx"]StartInfo[/URL] properties, also

Member Avatar for CsharpChico
0
5K
Member Avatar for Kath_Fish

Nothing in the first set matches anything in the second set so the intersection is empty.

Member Avatar for Kath_Fish
0
363
Member Avatar for pinkygirl

You need to install the .NET internal tables in the database you want to use. To do this: [LIST=1] [*]Locate the appropriate version of .NET that you're using, (ie, 2.x, 3.x, 4.x) under c\:Windows\Microsoft.Net [*]Double-click on aspnet_regsql.exe follow the prompts, entering the connection info as required. [*]When that's done, go …

Member Avatar for pinkygirl
0
104
Member Avatar for Tazsweet19

At the bottom of [URL="http://www.daniweb.com/software-development/csharp/code/355645"]this[/URL] snippet you'll see that I use ForAll to help with Matrix Multiplication. If you have questions about it, please ask

Member Avatar for Momerath
0
60
Member Avatar for Phil++

Other than you create a rectangle object then don't use it to draw the rectangle, I don't see a problem with the code. Are you having some issue?

Member Avatar for ddanbe
0
110
Member Avatar for SouthCarolinian
Member Avatar for Momerath
0
94
Member Avatar for elliot81

You don't have two names for your variables. Take _CallRate for example. It is a private variable of type decimal. You also have a special type of method, known as a Property, named CallRate that provides read only access to the variable _CallRate. I don't know what you are referring …

Member Avatar for elliot81
0
139
Member Avatar for Phil++

Code works fine here, message box shows, form closes, everyone is happy. Did you attach the method to the FormClosing event? You can try putting a MessageBox as the first line just to see if the event is firing.

Member Avatar for abelLazm
0
105
Member Avatar for leo88

Do you mean an exact match( "1 2" == "1 2") or if the array element contains string second as a substring ("1 2" is in "3 1 2 4")?

Member Avatar for leo88
0
101
Member Avatar for AdmiralDonkey

The problem is in your Balance routine. It's not :) I don't have time right now to fully debug it, but if you haven't solved it, I'll take a look at it later. Just FYI, it seems it's always going to line 249 in the Balance routine. I haven't confirmed …

Member Avatar for AdmiralDonkey
0
468
Member Avatar for CrazyProgrammer

String is a class that acts like a value type in some ways. One of those is the assignment operator. The designers made it this way because it is so commonly used. Unfortunately: =, ., ?:, ->, new, is, sizeof, typeof These operators cannot be overloaded. Means you have to …

Member Avatar for CrazyProgrammer
0
158
Member Avatar for Momerath

Look [URL="http://stackoverflow.com/questions/5508110/why-is-this-program-erroneously-rejected-by-three-c-compilers"]here[/URL]

Member Avatar for iamthwee
1
67
Member Avatar for Falcon25

Don't declare Random objects in methods unless that method is only ever called once (or very rarely). You've placed it inside your loop so it creates a new random generator each time through the loop. Since the generator is seeded by the clock, there isn't enough time between instantiations for …

Member Avatar for Falcon25
0
881
Member Avatar for ashley11

You'll need to convert each string into an array of values, sort that array, then rebuild the string. I believe you've done all these things in previous posts, just not all together. Give it a try.

Member Avatar for ashley11
0
73
Member Avatar for bunny07

because M and N aren't declared static, they are instance variables. This means you need to create an instance of the class to use them. That is the error you are getting. If you don't want to create an instance, then you need to declare them as static [icode]static int …

Member Avatar for Momerath
0
77
Member Avatar for Phil++

Don't copy the method, put the code from inside the method into the method you posted, replacing it.

Member Avatar for Momerath
0
92
Member Avatar for shyla

Your code looks good except you are missing part of your DisplayFleet() method: "... and displays the total value of all Car objects". In your main method you are missing some calls to DisplayFleet() "... then calls DisplayFleet() three times - passing three, four, and five Car objects ..."

Member Avatar for shyla
0
143
Member Avatar for bunny07

ThreadStart expects a method with a void return and no parameters. You are trying to pass it methods with 8 parameters. You need to rethink your threading code.

Member Avatar for bunny07
0
120
Member Avatar for pink_872

You need to provide a lot more information, this is way to vague for anyone to give a meaningful answer.

Member Avatar for Momerath
0
79
Member Avatar for Suzie999

[QUOTE=Suzie999;1523922]Do all method calls from the new thread i started, execute from that thread?[/QUOTE] Anything done on the new thread is done on the new thread. If the method you use to start the thread makes calls to other methods, they all run on the new thread.

Member Avatar for Suzie999
0
120
Member Avatar for Dean_Grobler

There are 'gag' programs that do this. Might want to check what is running on your system.

Member Avatar for rubberman
0
139
Member Avatar for psychoflyer

MMOs don't require reliability as the state of the game is constantly changing. If you required each packet to be received then the client might not have the most current information.

Member Avatar for rubberman
0
186
Member Avatar for Freedom*

[code]public SetGrades() { for (int i = 0; i < 10; i++) { do { Grades[i] = Double.Parse(Console.ReadLine()); if (Grades[i] < 0 || Grades[i] > 10) { Console.WriteLine("Grade must be >= 0 and <= 10 but you entered {0}", Grades[i]); } } while (Grades[i] < 0 || Grades[i] > 10); …

Member Avatar for Freedom*
0
132
Member Avatar for BigTito89
Member Avatar for Momerath
0
178
Member Avatar for shyla

[code]Console.WriteLine("Taxpayer #1 SSN: {0} income ${1} Tax is ${2}", socialSecurityNumber[x], grossIncome[x]);[/code] You still need to add the tax in there.

Member Avatar for Momerath
0
236
Member Avatar for Carrots

Normally you keep form logic in the form, so you'd do your math in the form class not in the program class. That said, the variables a and b are instance variables. This means that they are only avialable if you create an instance of that object. The Program class …

Member Avatar for Carrots
0
2K
Member Avatar for judithSampathwa
Member Avatar for ashley11

Since 2 3 1 doesn't exist in the key/value sorted list, why is it in the output list and where did the value come from? Otherwise you do something like: [code]var e = ArrayList.Cast<String>().Intersect(SortedList.Keys); foreach(String key in e) { NewSortedList.Add(key, SortedList[key]); }[/code] Obviously you'll have to change the variable names …

Member Avatar for ashley11
0
110
Member Avatar for leo88

[CODE]sortList.Values.Min()[/CODE] And why do you call it a sortList when it is neither sorted nor a list?

Member Avatar for leo88
0
7K
Member Avatar for elvis1

Did you follow the examples on [URL="http://www.codeproject.com/kb/IP/sharpssh.aspx?fid=225425&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=276"]Code Project?[/URL]

Member Avatar for elvis1
0
150
Member Avatar for Suzie999

You need to understand [URL="http://www.blackwasp.co.uk/CSharpVariableScopes.aspx"]variable scope[/URL]. first only exists in the block where it was declared, it is a method variable and isn't visible outside the method.

Member Avatar for Momerath
0
110
Member Avatar for Robert955

If you want the cannon to move, set the cannon position, not the mouse position.

Member Avatar for Robert955
0
83
Member Avatar for Ramesh.KR

As long as you have a strong reference to the object, it won't be garbage collected.

Member Avatar for Momerath
0
92
Member Avatar for Erra93

Well, you aren't following the A* method exactly. At the start there should only be one node in your test path (the starting node). You add nodes to the test path only if they don't exist in the closed list. It's hard to tell what you are doing since it …

Member Avatar for Momerath
0
149
Member Avatar for shameemmMbstu

[QUOTE=DianaTsax;1522569]http://www.fordevs.com/2009/07/steps-to-create-setup-and-deployment-project-in-dot-net-vs-2008.html it realy help me! i hope it will help you too!!![/QUOTE] Do you really think the person has waited 2 years for you to post that?

Member Avatar for Momerath
0
2K
Member Avatar for Usmaan
Member Avatar for abelLazm
0
88
Member Avatar for eman 22

Take a look at [URL="http://en.wikipedia.org/wiki/Adaptive_Huffman_coding"]Adaptive Huffman coding[/URL]

Member Avatar for Momerath
0
93

The End.