1,857 Posted Topics
Re: Just from a perusal of your code it looks like you're assigning random pictures to the labels, but you're generating two more random numbers to get the answer. Which stands to reason, that they probably won't match the images you've used. | |
Re: > number = translateThousand( n % 1000 ) + padIfNeeded( power_to_text[ chunk_count ] + padIfNeeded( number ) ); Basically each component here is a function returning a string. This means that instead of assigning the values to a variable first, you can use the values concatenated with other string functions … | |
Re: It looks to me the data is coming from `restranFile` and you're trying to read the data from `saveRestran`. Also you're loading all the data as one long string then seem to want to read the data one line at a time. You might be better off using `File.ReadAllLines` and … | |
Re: Does the computer connect to the internet when connected directly to the router, without the hub? | |
Re: Basically, you'll want to handle the `SelectedIndexChanged` event of the combobox holding the state names. The method for handling this event will allow you to add the code to change the contents of the other combobox. | |
Re: Try using the ToString() method: Query = "Select ContainerNo, TotalGrossWeight, TotalCartons, TotalPieces From Shipments Where RegShipmentID = '" & cboShipmentNo.SelectedValue.ToString() & "'" | |
Re: If I understand you correctly, you need to offset the coordinates you want by the coordinates of the top left corner, since that is your new 0,0 point. | |
| |
Re: I think what's happening is that the dataset is creating a separate table for each node. You're using table 0 as the datasource, try using table 2. To display the Transaction ID with the table, you can dock the datagridview inside a groupbox with its text property to the Transaction … | |
Re: From a quick perusal, I see, you're using an object(`temp`) that doesn't appear to be instantiated anywhere. | |
Re: While you might be able to get a LINQ query to work, I would suggest using code or a combination of both. Since you seem to want to pivot the table twice, the LINQ query will most likely be quite complicated and will severely impact the maintainability of your code … | |
Re: Certain parts of the listview have always been kind of kludgy. You'll probably have more success using then `FocusedItem` property instead: listView1.FocusedItem.SubItems[2].Text = "test"; | |
Re: Herer's an [article](https://msdn.microsoft.com/en-us/library/bb384833.aspx) that discusses accessing and manipulating xml in VB.net | |
Re: One cause for errors I see is: void Reset (bool resetWin, char board, char plays) This is declared ouside the class and instead of passing character arrays you're passing characters and trying to access them like arrays. Once you declare the function inside the class you don't need to pass … | |
Re: I think the [Dir function](https://msdn.microsoft.com/en-us/library/aa262726%28v=vs.60%29.aspx), which has wildcard search capabilities, should do the job you want. For more invlolved Drives, Files and Folders access you'll probably need the [File System Object(FSO)](https://msdn.microsoft.com/en-us/library/aa241712%28v=vs.60%29.aspx). | |
Re: The problem is exactly like the error says. You're trying to pass 2 arguments to a function that only requires 1. dsDraw = clsDrawNum.getDrawingNumber(drpPlaceOfOrig.SelectedValue, PlcCode) | |
![]() | Re: The second block is easy since each statement is identical except for the item index. Therefore, in the loop have one statement and replace the item index with the loop variable(i). The first block is a little more tricky. Basically follow the same idea and replace the column index with … ![]() |
Re: You put the increment for 'hold' outside the loop, which means 'hold' will always equal 1 and the loop will never exit. I think you want something like this: int div1,div2,rem, num; int hold=1; int count1=0,count2=0,sum1=0,sum2=0; system("cls"); cout<<"Enter divisors : "; cin>>div1>>div2; cout<<"Enter remainder to search : "; cin>>rem; do{ … | |
Re: You're getting the value for password inside the function. You should get the password inside main so that you can pass it to the function. The assignment clearly states to pass a string not a char array. The string class has an indexing operator([]) that you can use to get … | |
Re: Simply create a New() method that accepts the 3 variables. Then when you create a new version of the form use that overload to send the variables.(`public Form2(string varA,string varB, string varC)`). In Form1: Form2 newForm2 = new Form2(var1,var2,var3); | |
Re: The only thing your code is doing once the password is checked, is telling the user whether it's valid or not. I would suggest a bool and a while loop: string name = ""; string ph = ""; bool done = false; while (!done) { cout << "Enter Username\n"; cin … | |
Re: Your problem may be compiler/system specific. When I run your code on 2 different compilers(VS, Cygwin) it works fine. One possibility which might explain what you're seeing, if your system uses `\n\r` for each newline, then getline will only read to the `\n` and leave `\r` in the buffer, which … | |
Re: One option would be to use the MonthName function of the DateAndTime module, to decode the letter to the month name then build the destination directory name directly from the filename: Function MakeDirectoryPath(rootFolder As String, fileName As String) As String Dim monthdirectory As String = DateAndTime.MonthName(Asc(fileName(2)) - 96) Dim dayDirectory … | |
Re: When you're using a vector that doesn't have any elements in it, you can't use the index operator([]) you have to add what you want to put into the vector: `degree.push_back(adj[i].size());` | |
Re: It's hard to tell exactly without proper indenting and without seeing the full DVD class. But as a guess I'd say that there's an inconsistency here: if (i < 1) { if (mydvd[i].getLength() != 0) { cout << endl << setw(10) << right << mydvd[i].getTitle() << setw(10) << mydvd[i].getLength() << … | |
Re: You'll have to show the function that you're trying to run and the class it's part of. | |
| |
Re: Here are some things I noticed: First off, you say you have a problem but you don't itemize what the problem is. That's like taking your car to a mechanic and saying,"Fix it it's broken.". In line 15, you're trying to get the output from a function that returns void. … | |
Re: One option, modify the datasource and refill the combobox. Specific details of other options will depend on the objects in the datasource. | |
Re: The easiest way is with a `vector<string>`. You can keep adding names until adding a new name causes a memory overflow error. Checking for `\n` won't work cin automatically delimits the retuirn with `\n` and ignores it. A better option would be to use `getline`. This will return "" if … | |
Re: You need a conditional block(If statement). Also you'll probably find that a while loop will work better than a do loop. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim Reader As New IO.StreamReader("C:\" & TheFileName.Text & ".txt") 'This will allow me to type in name of file … | |
Re: Building the seive than getting the sum is taking a lot of extra time. You can build the sum when you're building the seive. Since this is for a specific purpose and problem, you cheat a bit by using a bitset. This requires a constant value to initialize, but it … | |
Re: Another way is with a map<string,int>. Accessing an index that isn't present automatically adds it. So that a simple single iteration through the names will give you a count for each unique name: map<string, int> mapNames; for (auto n : names) { mapNames[*(n)]++; } Now in each element of mapNames, … | |
Re: One option that comes to mind is here, `pdfDoc.Add(New Paragraph(txtLine))`. One of the overloads for the Paragraph constructor allows you to set the font. | |
Re: It looks to me you want something like this: Dim objReader As New System.IO.StreamReader(getRestranName(i)) fileName = getRestranName(i) If System.IO.File.Exists(fileName) Then Do While objReader.Peek() <> -1 txtLine = objReader.ReadLine() prpName = Trim(Microsoft.VisualBasic.Left(txtLine, 30)) destinationFile = destinationFolder & "\" & Trim(Microsoft.VisualBasic.Right(fileName, 15)) If prpName = propertyName Then objReader.Close() System.IO.File.Move(fileName, destinationFile) Exit Do … | |
Re: It looks to me that you have the path string wrong. In the first string you have this folder,"D:/__GNU analyze"(2 underrscore characters). But in the second string, it's this folder, "D:/_GNU analyze"(1 underscore character). | |
Re: It looks to me that fopen doesn't return true or false, it returns a pointer, which is null on fail. See if this helps: fd = fopen(buf, "r"); if(fd != NULL) | |
Re: Apparently that option isn't available in that library. One workaraound that I read about is to extract to a temp folder then move the specific folder where you want. The only other option, I'm aware of, is to modify the library to allow it explicitly. | |
Re: The first comparison is fine but the other 3 are off a bit. The middle 2 should follow the pattern of the first using 80 and 90. The last one is outside that pattern and should use `<=`. Function Lettergrade(ByVal Numgrade As Integer) As Char If Numgrade < 70 Then … | |
Re: It looks to me you're getting confused by using single statement blocks without brackets. The first code basically translates like this: bool isEmptyLocation(int arr[size], int &r) { for (r = 0; r < size; r++) { if (arr[r]==empty) { return true ; } } return false ; } The second … | |
Re: Since `\n` and `\t` are treated as one character not 2, near as I can tell you're pretty much much left with looking for those and replacing them with 2 characters in their place: string unknown1 = "\n\t\n\t\n\n\n\n\n"; for (int i = 0; i < unknown1.size();i++) { if (unknown1[i] == … | |
Re: You're probably better off using the mailing list set up to field questions like this. The instructions to use it is on the webiste for that software. | |
Re: This sounds like some sort of Sudoku type problem. Researching C++ source code for Sudoku should give you some samples to work with. | |
Re: I would suggest not, since the maximum value you might encounter is 9 to the power of 13, which will need a structure that big. Creating an integer from a char can be more simply done by subtracting the '0' char from the char which will implicitly cast to an … | |
Re: There must be a bug in your testing algorithm 116396280 / 16 equals 7274767.5 Rather than a naive approach, you'll find, using a Lowest Common Multiplier(lcm) algorithm that uses a Greatest Common Divisor(gcd) algorithm much more efficient: int gcd(int a, int b) { int t; while (b > 0) { … | |
![]() | Re: You might need to rethink your approach a bit. The ListBox class already has an item collection it's called `Items`. It has everything you need to maintain the shopping cart. You can use a list for the available items. I would suggest overriding the `ToString()` function of the `Item` structure … ![]() |
Re: A few things I notice right off the bat: - You're only using one index, 0, to do any calculations. You need to loop through the indexes over the whole array to get the sums and the averages. - Nowhere do you declare rowSum, colSum, rowAvg, or colAvg - Once … | |
Re: One option you have is to declare the vector as pointer,`vector<double>* Coeficientes;`. Now to initialize it use the new operator, after the user inputs Numero_de_Materias,`Coeficientes = new vector<double>(Numero_de_Materias);`. Then before you exit the program make sure to delete it, to release the memory, `delete(Coeficientes);` This will allow indexed access before … | |
Re: First off, since rectangles are represented by 2 dimensions(length,width), basically you will be working with a 2 dimensional array. With .net there are 2 types of these arrays: [multidimensional](https://msdn.microsoft.com/en-us/library/2yd9wwz4.aspx) and [jagged](https://msdn.microsoft.com/en-us/library/2s05feca.aspx) | |
Re: Use the `SelectedIndex` property. |
The End.