2,157 Posted Topics
Re: [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] | |
Re: 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 … | |
Re: Looks like it couldn't find XLiveRedist.msi in the install directory. | |
Re: 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. | |
Re: 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. | |
Re: 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 | |
Re: Set PasswordChar to whatever you want displayed. | |
Re: [URL="http://education-portal.com/article_directory/Top_Information_Technology_Schools.html"]Top IT Schools[/URL] | |
Re: [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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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] | |
Re: 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 | |
Re: Nothing in the first set matches anything in the second set so the intersection is empty. | |
Re: 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 … | |
Re: 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 | |
Re: 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? | |
Re: [URL="http://jax.troy.edu/"]Troy State University in Jacksonville[/URL] | |
Re: 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 … | |
Re: 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. | |
Re: 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")? | |
Re: 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 … | |
Re: 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 … | |
Look [URL="http://stackoverflow.com/questions/5508110/why-is-this-program-erroneously-rejected-by-three-c-compilers"]here[/URL] ![]() | |
![]() | Re: 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 … ![]() |
Re: 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. | |
Re: 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 … | |
Re: Don't copy the method, put the code from inside the method into the method you posted, replacing it. | |
Re: 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 ..." | |
Re: 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. | |
Re: You need to provide a lot more information, this is way to vague for anyone to give a meaningful answer. | |
Re: [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. | |
Re: There are 'gag' programs that do this. Might want to check what is running on your system. | |
Re: 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. | |
Re: [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); … | |
Re: Are the methods predefined or are they created at runtime? | |
Re: [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. | |
Re: 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 … | |
Re: 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 … | |
Re: [CODE]sortList.Values.Min()[/CODE] And why do you call it a sortList when it is neither sorted nor a list? | |
Re: 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] | |
Re: 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. | |
Re: If you want the cannon to move, set the cannon position, not the mouse position. | |
Re: As long as you have a strong reference to the object, it won't be garbage collected. | |
Re: 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 … | |
Re: [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? | |
Re: [url]http://msdn.microsoft.com/en-us/library/4y171b18.aspx[/url] | |
Re: Take a look at [URL="http://en.wikipedia.org/wiki/Adaptive_Huffman_coding"]Adaptive Huffman coding[/URL] |
The End.