1,857 Posted Topics
Re: If your number has multiple digits a stringstream will work but you have to use the extraction operator(>>) to get automatic conversion: int currentqueue = 0; string input = "123"; std::stringstream converted; converted << input; converted >> currentqueue; | |
Re: If you have control over the .dll source code, make the login form modal(.ShowDialog) and open it in the Load event handler of the .exe form. If the dialog result is good continue loading the .exe form. If it's bad try again or quit altogether. | |
Re: One way to make your coding more efficient is to use a string to represent the digits that may be encountered: const string digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Now for any base the value of a particular digit can easily be converted to the appropriate symbol just by using the index of … | |
Re: [Click Here](http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.items%28v=vs.110%29.aspx) | |
Re: [Click Here](http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.items%28v=vs.110%29.aspx) | |
Re: Basically it's when you assign a default value to a member. For number types this usually means 0. For strings usually an empty string(""). For more complex, types the `new` keyword is used to get the system default value(s) assigned to the member. | |
Re: The source code is automatically generated when you design the GUI. It's greatly discouraged to directly manipulate the GUI code. | |
Re: That's very case dependant. The controls do have a Validation event that can be handled to accept or reject the user input. But, the actual code will depend on the type of data and the values regarded as valid. | |
Re: You probably are looking for the [Copy method of the System.IO.File class](http://msdn.microsoft.com/en-us/library/c6cfw35a%28v=vs.110%29.aspx) | |
Re: The first thing I see is syntax errors. You have no open brace for the class prototype and there is an extra closing brace at the end of the code. Also Get_Gas doesn't follow the prototype declaration. | |
Re: A few things I noticed. To use an object by reference instead of by value use the addrees of(&) operator. To strip the dollar portion from the total cents use the modulo(%) operator To keep a running total, there's no need for a loop, just keep incrementing it each time … | |
Re: For what you want a class would be handy. Include properties for the keyword, definition, and radiobuttons for each. Instead of randomizing what each definition radiobutton holds, randomize the location of the definitions. | |
Re: The else statement is only executed if the innermost If statement is false. If any of the others are false the execution will bypass the the addition statement. A quick fix, is an else statement for each of the if statements and don't nest them, have each one separate. On … | |
Re: It looks to me the first 2 rows are set up to use 50% each and the other rows are fit in as best they can. Try making the row height value literal instead of a percentage. | |
Re: A Dictionary(Of String, Panel) would work here: Dim PanelCollection As New Dictionary(Of String, Panel) Dim newpanel As New Panel With {.Name = "Panel1"} PanelCollection.Add("First Panel", newpanel) newpanel = New Panel With {.Name = "Panel2"} PanelCollection.Add("Second Panel", newpanel) newpanel = New Panel With {.Name = "Panel3"} PanelCollection.Add("Thired Panel", newpanel) Now `PanelCollection("Second … | |
Re: Why won't casting the division result to an int, `(int)(num/den)`, work? | |
Re: To me it looks like your problem is trying to do too much inside one class. For something like this you'll probably find it much easier to use stronger organization of your classes. for example a StudentClass class that contains a vector of Student class which contains a vector of … | |
Re: Here's one thing that might help a [free open source document management software](http://www.opendocman.com/free-download/) written in PHP and interfaces with a MySQL server. At the very least it can give you a starting point. | |
Re: I think what you want is something like this: Console.Write("List the first sahabi who was promised paradise \n(hint he was Prophet Muhammad (peace be upon him)'s best friend: "); answer = Console.ReadLine(); if(answer.ToLower() == "abu bakr") { Console.WriteLine("That is correct good job!\n\n"); ++score; } This converts the answer to all … | |
Re: A few things to consider: Try to avoid keywords for object/variable names and use something more apropos You may know what it refers to now, but will you remember months or years from now. Using an enum for the 4 conditions(No winner, X, O, and Draw) set to the char … | |
Re: the controls are classes you can declare one the same as any class, `Dim MyTextBox As New TextBox` | |
Re: Something to keep in mind, in the game 501 the winning player is the one that reaches exactly 501. If a player goes over, that turn is forfeited. Another thing to remember is that not all the scores from 0-60 are valid. Only the 1, 2 and 3 multiples of … | |
Re: For that you might be better off loading the rows into a datatable reading the file one line at a time. As far as I know reading a textfile like that will only take the whole file as one table. | |
Re: Why are you asking this over and over? Start applying what you've learned and use it. | |
Re: This would be one of your first steps, [Read the Rules](http://www.daniweb.com/community/rules) | |
Re: 00|01|02|03|04|05|06|07|08|09|10|11 h |e |l |l |o | |d |o |l |l |y | h |e |l |p | |m |e |l |a |n |i |e You can see from this simple table that only indexes 0,1, and 2 contain the same charactrers in both strings and that is what Intersect … | |
Re: Try this: } ttotal += i; printf("\n \tAnother Product? <1> Yes <2> No :"); scanf("%d", &ap); if(ap==1) goto y; else if(ap==2) goto n; else if(ap>2) { printf("The Program will be terminated"); return 0; } else if(ap=0) { printf("The Program will be terminated"); return 0; } n: printf("\tPlease Enter the Discount … | |
Re: It sounds like you've set the DataSource somewhere. Remove that and this should work. | |
Re: Change `Me` to the name of the panel. Alternatively you can use `For Each cControl As Control In Panel1.Controls.OfType(Of Label)` to iterate through just the labels instead of every control. | |
Re: Here's a rather simple way to validate the text from a textbox: Dim strtoint As Double = 0 'Check for valid number If Double.TryParse(TextBox1.Text, strtoint) Then 'Less than 1 add leading 0 If strtoint < 1 Then TextBox1.Text = "0" + TextBox1.Text 'A whole number? add trailing 0's and a … | |
Re: Your problem might be with these: Private CurrentData As String Private CurrentScrollValue As Integer Private CurrentScrollText As String Private CurrentScrollWaiting As Integer Private OutputComm As String Private OutputIP As String Private OutputPort As String Private OutputFile As String Private OutputMode As Integer Private MAX_CHARS As Integer Either intialize them in … | |
Re: what kind of error? syntax or output? what is the desired output? | |
Re: Have you looked at [GSL - GNU Scientific Library](http://www.gnu.org/software/gsl/)? | |
Re: What line is throwing the exception? | |
Re: Did you make sure the casing is right? C# is case dependant. | |
Re: Try using a new compiler. In Windows both Visual Studio and Code::Blocks have free C++ ide's with up to date compilers. Also have you tried optimizing your code? Especially look for redundant blocks that can be put into a function. | |
Re: What have you got so far? What have you researched? What have you tried? To test for even values use `if(input % 2 == 0)` to catch odd values use `== 1` | |
Re: > will I still be able to send and read lines from the subsiquent console application the same as if I were to run a console .exe directly? Probably not, at least not without a lot of headaches. But since a .bat is basically a textfile you can read it … | |
Re: I think perhaps you've misunderstood the assignment. Here's some revised code that should make it clearer: static void Main(string[] args) { double balance = 0.00; Console.WriteLine("Current credit limit is : " + CustomerCreditLimit().ToString()); Console.Write("Enter the customer current balance: "); balance = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("The credit limit for this balancxe is : … | |
Re: The instructions for merging are given to you, including which files to get the data from. | |
Re: The menu item should have a PerformClick method that you can call in the form's load event handler. | |
Re: Your problem isn't that the new dvd isn't be added. The problem is that when you initialize the vector to 5 dvd objects the default constructor creates 5 blank dvd objects. So when you push_back one it's number 6. Try using an empty vector and setting a limit when you … | |
Re: Using a custom equalitycomparer and LINQ should do the job: Dim hTable As List(Of ListViewItem) = (From lvi In ListView1.Items Let newlvi = DirectCast(lvi, ListViewItem) Select newlvi ).Distinct(New CompareLVI).ToList ListView1.Items.Clear() ListView1.Items.AddRange(hTable.ToArray) Public Class CompareLVI Implements IEqualityComparer(Of ListViewItem) Public Function Equals1(x As ListViewItem, y As ListViewItem) As Boolean Implements IEqualityComparer(Of ListViewItem).Equals … | |
Re: in line 20 change ` total_cost= coffeePrice;` to ` total_cost += coffeePrice;` This will keep adding additional items to `total_cost` until the program exits. If you plan on creating another order before the program exits just set `total_cost` to zero when you start the new order. A couple of notes: … | |
Re: A few things with your code: As was pointed out using unsigned char gives you more predictable results Using the `islower/isupper` methods to set the appropriate offset to the character code block simplifies your code tremendously The modulus operator(%) creates further simplification by allowing your values to wrap around and … | |
Re: One thing I noticed line 19 should probably use matches not patterns. For searching the directory with multiple search terms straight LINQ would work well: string[] patterns = new string[] { "GA1", "GA2", "INTW", "LET1", "RA2", "RA3", "A4", "RA5" }; var matches = (from string f in Directory.EnumerateFiles(wedTemp) from string … | |
Re: It appears to me that an `X` object is created as a member of `D`, which should call `X`'s constructor when a `D` object is created. | |
Re: This page,[XML in Visual Basic](http://msdn.microsoft.com/en-us/library/bb384833%28v=vs.110%29.aspx), has links to a number of tutorials/walkthroughs that deal with reading/writing/accessing xml | |
Re: Another thing the median returns the index not the value. something like this should work: //find median //Put values in ascending order //Not the best sorting algorithm but useable for (int i = 1; i < count; i++) { if(values[i] < values[i-1]) { int temp = values[i]; values[i] = values[i-1]; … | |
Re: Your code is missing the Properties class |
The End.