1,857 Posted Topics
Re: you can leverage some of the methods in the Char class for this: If Char.IsNumber(e.KeyChar) OrElse e.KeyChar = Chr(Keys.Back) OrElse e.KeyChar = "."c Then End If | |
Re: decearned doesn't get set to .01 if decSubTotal is less than or equal to 500. Your assignment says the interest rate changes at 5000 not 500. The final total should be `decsubtotal + (decsubtotal * decearned)` The interest earned would be `decsubtotal * decearned` | |
Re: your error probably comes from using the length as the limit for the Substring index. Also you're trying to convert a string to a boolean. And lastly the index of substring only changes when intcounter does. so as soon as a character doesn't match the keyword you hit an infinite … | |
Re: If your list is a simple or integrated type and you only need 1 column, you can use it as a datasource for a Listbox, which is basically the same output. | |
Re: As long as there is a connection between the computer and the server, whether it's intranet, or internet, you can make the program connect. The main question is changing the connection string to reflect a different server address, and possibly different credentials. | |
Re: It should work the way it is. Unless your panel is only the size of the maze and the cursor is starting on a wall. Try sizing the panel to be a lot bigger than you need and moving the maze farther away from the top-left corner. | |
![]() | Re: I think your problem is here: void reduce(void) { int numeratorValue; int denominatorValue; int getresult1; int getresult2; int gcd = getGCD(); // Get the greatest common divisor. // Get the result of the numerator. getresult1 = numeratorValue/GCD; // Get the result of the denominator. getresult2 = denominatorValue/GCD; return(getresult1, getresult2); // … |
Re: Looks to me like you'll acheive the same result with list<T> result = two; return result.merge(one); Which if I'm not mistaken is O(M+N-1), according to this [reference](http://www.cplusplus.com/reference/list/list/merge/) | |
Re: One problem is, in sum.h, you set up sum(), but you didn't implement it. Add this to your class definition file: sum::sum() { } On a side note, you might find it more versatile to return the answer and keep the console I/O in the calling procedure. In a large … | |
Re: If I'm not mistaken a '.jar' file is basically a text file. Renaming it with a '.txt' extension, will allow Visual Studio to load it as text. It's a simple matter from there to write it to disc, to run it, and delete it after you're done. | |
Re: Using a class that holds the from character, the to character and the number, will simplify things quite a bit for you. A vector will then have all the info you need in each item: #include <iostream> #include <string> #include <fstream> #include <vector> #include <array> #include <sstream> using namespace std; … | |
Re: Your second attempt came close. see if this helps. static void Main() { string numbers; Console.Write("Enter a number between 1 and 99999: "); numbers = Console.ReadLine(); DisplayDigits(numbers); } public static void DisplayDigits(string numbers) { foreach (char c in numbers) Console.WriteLine( c + " "); } If you haven't covered `foreach` … | |
Re: You're initializing the random number generator to the same spot, every time the loop iterates. Move that to the top of your function and it should work. Also try using something like `Dim rand As New Random(Date.Now.Millisecond)`, to acheive more randomness. | |
Re: Your code never compares the values in the gridview with the value in the textbox. See if something like this helps: protected void date_issued_TextChanged(object sender, EventArgs e) { DateTime newdtissued = new DateTime(); if (DateTime.TryParse(date_issued.Text, out newdtissued)) { foreach (GridViewRow row in gvw.Rows) { DateTime dtissued = Convert.ToDateTime(maDDL.getControlValue("date_issued", row)); DateTime … | |
Re: c++ has both a r[eplace](http://www.cplusplus.com/reference/string/string/replace/) method and a [find](http://www.cplusplus.com/reference/string/string/find/) method, for strings, which will do the job: string test2 = "I am going to school"; test2.replace(test2.find("cho"),3,""); | |
Re: A lot can be but not all. Intellisense/MSDN will say for sure. | |
Re: You can simplify thing quite a bit by leveraging the New constructor in your class something like this: <Serializable()> _ Public Class LessonPlans Public Property Teacher As String Public Property RoomNumber As String Public Property Subject As String Public Property Students As New List(Of Student) End Class <Serializable()> _ Public … | |
Re: > Apostrophe e's ( é ) and Apostrophe's ( ´ ) Gets deleted when I decrypt. (which I have in a txt file) 'apostrophe' is declared and used but never set, changing it to 'ch' in your `if` statement should correct that. On a side note, You might be overthinking … | |
Re: what object and what error message? | |
Re: If the valuies taken from form1 are to be default values that the user can change as needed, one option is to overload the Show method and send the values directly to the second form when the calling form calls the Show method. | |
Re: Here's a couple of articles with examples: [Click Here](http://msdn.microsoft.com/en-us/library/ms233672%28v=vs.110%29.aspx) [Click Here](http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-3) | |
Re: Why not use the on screen keyboard that comes with windows? | |
Re: What is the routine doing or not doing, that you want fixed. Also how is your array structured, what does each row and column mean? If I read your question right, you might need to rethink your approach. Since you're only comparing 4 quarters, compare the first and last quarter … | |
Re: Here's one [place to start](https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/). | |
Re: A couple of things I noticed: Firstly, the compiler has to know how to find the functions before you call them, either have them before main in the file or declare them with prototypes. Secondly, you're passing data to your functions without telling the function how to receive the data(line … | |
Re: one way is to use an array of intervals and when the user enters a number(1-5?) that's the index of the array and set the interval to that value. | |
Re: If you handle the MouseClick event, `e.Location` will give you the location within the pictureBox: private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { int x = e.Location.X , y = e.Location.Y; label1.Text = x.ToString(); label2.Text = y.ToString(); } | |
Re: You'll probably be better off using a class for this instead of a struct, and add a timer and a counter as properties of the class: public class Node { public string ip4 = ""; public double temp = 0.0; public double battery = 0.0; public string light = ""; … | |
Re: If they are name sequentially you can use a loop and build each name using the indexer of the loop. So if they are named PictureBox1,PictureBox2,etc., the code could look something like this: For I = 1 to 4 Me.Controls("PictureBox"+I.ToString).Visible = True Next The controls collection allows indexing by name. … | |
Re: First thing needed is how are coding the app? Are you using VC++ with CLR? or some other library? Also you should show what code you've got. Include what effort you've made to research this question. | |
Re: Swapping listviewitems is problematic at best. I think the problems stems from the fact that Insert creates a new item. The most viable solution is probably to swap the data of the items. Here's one way that can be done, this code is somewhat optimized and modified for groups, from … | |
Re: You can also shorten your code considerably using the pow function and leveraging the implicit cast between char and int. something like this: string ToBinary(int input) { //Fill the array with 0's and only change the needed elements to a 1 char output[9] = "00000000"; for(int i= 7; i >= … | |
Re: A sample of the beginning data and a sample of the desired ending data would be very helpful | |
Re: use [Application Settings](http://msdn.microsoft.com/en-us/library/vstudio/a65txexh%28v=vs.100%29.aspx/html) | |
Re: The only thing I see is that `loss = loss++;` is redundant. `loss++;` does the same thing. Other than that if `company` is an array of int, double, etc. and any value less than 0 indicates a loss, 2 loops will iterate through the array and get the total you're … | |
Re: If you don't need the data kept in memory after you save it you can write it directly from the first loop using (StreamWriter write = new StreamWriter(filePath, true)) { string[] line = strInput.Split('~'); foreach (string part in line) { string[] strField = part.Split(','); write.WriteLine(strField[0] + "," + strField[5] + … | |
Re: Try this: `temp = line.Replace("Figure 1", @"<a href=""#fig1"">Figure 1</a>")` on a side note, when you have a problem like this, it helps when you explain what you've tried and what it does wrong. | |
Re: I think the problem is that data binding won't show until the control is visible. You might have to resort to a function to apply the properties to the textboxes | |
Re: First off that code looks like VB6 not VB.net. Try setting the value of the subitems instead of the whole object. | |
Re: when the mouse is dragged from the corner read the movement along both the x and y axis and adjust the resize on both x and y axis. Something like this: Dim XOffset, YOffset as Integer XOffset = MousePosition.X - Me.Location.X YOffset = MousePosition.Y - Me.Location.Y Me.Size = New Size(Me.Location.X … | |
Re: It might need a bit of a re-write, but one way is to put your input into a stringstream and use the '>>' operator to convert to double or whatever type you need, and do your calulations with that. | |
Re: Here's one [place to start](http://www.codeproject.com/Articles/25625/Notepad-NET-Creating-a-clone-of-notepad-in-Visual) | |
Re: Not sure about optimal but here's a way using included functions, rather than chained conditionals: #include <iostream> #include <cmath> using namespace std; int Clip(int Val) { return fmin(fmax(Val,0.0),255.0); } int main() { int test; test = 100; cout << Clip(test); return 0; } | |
Re: You could try handling the Validated event. You have the option to cancel the validation so that the user's focus stays on the textbox until the value is valid. Using the Integer.TryParse then checking the value, is an easy way to validate the text. Alternatively using a NumericUpDown control will … | |
Re: That's assuming of course that you've set the View property to Details | |
Re: The first thing I see is calling the property "tenLinh" and setting it with "tenLin" | |
I've noticed that comments in VB code snippets are ended in the middle of a line if an apostrophe is present(i.e. using a contraction), then continue from the next one over several lines until it reaches another. I'm wondering if that can't be changed to keep it as a comment … | |
Re: When I run your Sdriveer sub routine it works properly and reports the drives on the computer it's running from. I suspect the computer your testing it with has an E drive and that's why you're seeing an entry for it. |
The End.