1,857 Posted Topics

Member Avatar for Kiri_1

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.

Member Avatar for tinstaafl
0
289
Member Avatar for strongard63

> 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 …

Member Avatar for m.shajeeh
0
183
Member Avatar for Papa_Don

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 …

Member Avatar for Papa_Don
0
444
Member Avatar for ajaxkappasig

Does the computer connect to the internet when connected directly to the router, without the hub?

Member Avatar for ajaxkappasig
0
671
Member Avatar for ibpet11

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.

Member Avatar for ibpet11
0
185
Member Avatar for zamm65

Try using the ToString() method: Query = "Select ContainerNo, TotalGrossWeight, TotalCartons, TotalPieces From Shipments Where RegShipmentID = '" & cboShipmentNo.SelectedValue.ToString() & "'"

Member Avatar for zamm65
0
156
Member Avatar for bashkaru

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.

Member Avatar for Mr.M
0
718
Member Avatar for Mike Askew
Member Avatar for weekendrockstar

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 …

Member Avatar for weekendrockstar
0
228
Member Avatar for hwoarang69

From a quick perusal, I see, you're using an object(`temp`) that doesn't appear to be instantiated anywhere.

Member Avatar for tinstaafl
0
534
Member Avatar for kukuruku

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 …

Member Avatar for tinstaafl
0
144
Member Avatar for rfresh

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";

Member Avatar for tinstaafl
0
219
Member Avatar for Captiva

Herer's an [article](https://msdn.microsoft.com/en-us/library/bb384833.aspx) that discusses accessing and manipulating xml in VB.net

Member Avatar for tinstaafl
0
252
Member Avatar for TObannion

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 …

Member Avatar for tinstaafl
0
2K
Member Avatar for Papa_Don

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).

Member Avatar for Papa_Don
0
309
Member Avatar for nimz143

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)

Member Avatar for nimz143
0
2K
Member Avatar for westsiderailway

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 …

Member Avatar for westsiderailway
0
4K
Member Avatar for Phoeboo

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{ …

Member Avatar for tobyITguy
0
322
Member Avatar for TObannion

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 …

Member Avatar for ROMEO VINEET
0
3K
Member Avatar for weekendrockstar

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);

Member Avatar for weekendrockstar
0
1K
Member Avatar for Asira18

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 …

Member Avatar for tinstaafl
0
273
Member Avatar for markdean1989

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 …

Member Avatar for David W
0
2K
Member Avatar for SpeakerKeyboard

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 …

Member Avatar for SpeakerKeyboard
0
976
Member Avatar for Baalla

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());`

Member Avatar for Baalla
0
204
Member Avatar for kiail

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() << …

Member Avatar for tinstaafl
0
424
Member Avatar for Curious Gorge
Member Avatar for Curious Gorge
0
333
Member Avatar for kouty
Member Avatar for rose_2

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. …

Member Avatar for tinstaafl
0
147
Member Avatar for priyanka_12

One option, modify the datasource and refill the combobox. Specific details of other options will depend on the objects in the datasource.

Member Avatar for JerrimePatient
0
186
Member Avatar for Muhammad Faizan_1

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 …

Member Avatar for tinstaafl
0
615
Member Avatar for SpeakerKeyboard

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 …

Member Avatar for SpeakerKeyboard
0
2K
Member Avatar for Petcheco

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 …

Member Avatar for Petcheco
0
420
Member Avatar for Thomas_25

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, …

Member Avatar for tinstaafl
0
721
Member Avatar for Papa_Don

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.

Member Avatar for tinstaafl
0
4K
Member Avatar for Papa_Don

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 …

Member Avatar for Papa_Don
0
1K
Member Avatar for tgreiner

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).

Member Avatar for tinstaafl
0
142
Member Avatar for danielg55

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)

Member Avatar for rubberman
0
100
Member Avatar for Suzie999

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.

Member Avatar for tinstaafl
0
237
Member Avatar for Pompy

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 …

Member Avatar for Santanu.Das
0
240
Member Avatar for Ahmed_62

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 …

Member Avatar for gusano79
0
206
Member Avatar for cannon_1

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] == …

Member Avatar for tinstaafl
0
484
Member Avatar for adnan_6

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.

Member Avatar for tinstaafl
0
2K
Member Avatar for Ahmed_62

This sounds like some sort of Sudoku type problem. Researching C++ source code for Sudoku should give you some samples to work with.

Member Avatar for Ahmed_62
0
304
Member Avatar for Petcheco

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 …

Member Avatar for Petcheco
0
291
Member Avatar for Petcheco

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) { …

Member Avatar for Petcheco
0
321
Member Avatar for rnyamonga

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 …

Member Avatar for rnyamonga
0
728
Member Avatar for James_44

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 …

Member Avatar for tinstaafl
0
209
Member Avatar for Petcheco

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 …

Member Avatar for Petcheco
0
134
Member Avatar for seriy

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)

Member Avatar for Stuugie
0
61
Member Avatar for NOVICE3

The End.