1,857 Posted Topics

Member Avatar for John_145

One of the ways that I've found useful, is doing programming challenges online(HackerRank,Project Euler,CodeWars, etc.). Any challenge that requires concepts that you're not familiar with you can learn about them and apply them(there are numerous sources online: cplusplus.com,cppreference.com, etc.). As you complete each challenge, many of these sites, will let …

Member Avatar for rubberman
0
393
Member Avatar for Tre Sivileo

A couple of suggestions I'd make: Instead of reading each character separately, it would be easier to read a string. Once you get the string, change the while loop to a for loop to loop through the characters in the string. The string class includes a size function to use …

Member Avatar for tinstaafl
0
302
Member Avatar for Eugene_8

One of your problems is here: totalSale=tPrice*ticketsSold; You're overwriting totalSale instead of adding to it: totalSale += tPrice * ticketsSold;

Member Avatar for rproffitt
0
617
Member Avatar for Justin Kent

Not sure if we should be answering, since you didn't acknowledge any of the help you got on your other question about the same problem. Opening new questions about the same problem is not really going go get you anywhere. Also the code you're showing isn't even trying to solve …

Member Avatar for tinstaafl
0
523
Member Avatar for Justin Kent

I would venture that your problem is here: If Val(TextBox18.Text) > Val(zero(row, col)) And Val(TextBox18.Text) < Val(zero(row, col)) Then ListView1.Items.Add(total = (Val(TextBox18.Text) - Val(zero(row, col)))) End If You're testing if one value is greater than and less than another value at the same time. This is impossible and will never …

Member Avatar for tinstaafl
0
459
Member Avatar for can-mohan

If you have the reverse case figured out the others are just a substring being reversed and concatenated with the unreversed part. If you're using std::string in your class to hold the base value, then std::string.find() can be used to find the spaces between words. Then pass the substring indicated …

Member Avatar for JamesCherrill
0
484
Member Avatar for HibaPro

I think your best bet is to add uthentication to each directory that user might use. This way even if they change the url they won't be authorized to enter that directory.

Member Avatar for HibaPro
0
245
Member Avatar for naruto_2

It looks to me that your problem is here: std::deque<Camera::edge_point_t *> find_edge_points(Camera::meniscus_finder_context &c) You didn't declare this as belonging to Camera. Try this: std::deque<Camera::edge_point_t *> Camera::find_edge_points(Camera::meniscus_finder_context &c)

Member Avatar for tinstaafl
0
392
Member Avatar for tinstaafl

Why does this perfectly valid link(`http://www.databasejournal.com/features/mssql/article.php/3112381/SQL-Server-Calculating-Running-Totals-Subtotals-and-Grand-Total-Without-a-Cursor.htm`) show up as a broken link in a [post](https://www.daniweb.com/programming/software-development/threads/506824/how-to-get-the-value-from-cells-of-a-datagridview-table#post2212833)?

Member Avatar for Dani
0
509
Member Avatar for can-mohan

Is there a reason you can't reverse the order of the inheritence?: class D : public C , public B { };

Member Avatar for can-mohan
0
476
Member Avatar for _1_14

Take a look at this [post](http://stackoverflow.com/questions/12905485/storing-a-bmp-image-in-a-qr-code). It appears that while it might be possible to encode a very small image(60X60 pixels). The resulting code would be so tight that it would be hard for software readers to decode it. You might be better off having the pics online and adding …

Member Avatar for tinstaafl
0
490
Member Avatar for tinstaafl

I moved this post to a new question. since it was getting lost. Something I've been meaning to bring up for sometime. I can't login on Chrome Mobile. I get the sign in page, but then it just goes back to the generic home page with the login link. I'm …

Member Avatar for Dani
0
493
Member Avatar for Smith5646

Along with what Reverend Jim is saying, since you real data is a more complex type, create a class to represent that data, it could be called `Coordinates`,and your dictionary would be [Dictionary<string,Coordinates>](https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx) If you need them sorted you can use a [SortedDictionary<string,Coordinates>](https://msdn.microsoft.com/en-us/library/f7fta44c(v=vs.110).aspx). The links go to the MSDN document …

Member Avatar for tinstaafl
0
294
Member Avatar for Jemone_1

For comparing the month entered to get number of days, I would suggest a struct with the name of the month and the number of days. A map<string,month> with the name of the month as the key and the corresponding month instance as the value. Now you can get the …

Member Avatar for David W
1
381
Member Avatar for nadiam

In the CellContentClick handler, the DataGridViewCellEventArgs(e) contains a RowIndex property that you can then use to get the value you want from the DataGridView. Here's an example where OrderID is an integer and the invoice is shown in a different tabpage with a DataGridView: Private Sub DataGridView1_CellContentClick(sender As Object, e …

Member Avatar for tinstaafl
0
417
Member Avatar for nadiam

I found this [article](http://www.databasejournal.com/features/mssql/article.php/3112381/SQL-Server-Calculating-Running-Totals-Subtotals-and-Grand-Total-Without-a-Cursor.htm) for you which should help explain it. Basically you need to use the SELECT statement to create the data for the other columns.

Member Avatar for nadiam
0
616
Member Avatar for nadiam

It looks to me that you have the cell indexes backwards. It should be row,column: Private Sub product_list(ByVal pid As String) Dim getPID As String = "SELECT * FROM TBL_PRODUCTS_A154287 WHERE FLD_PRODUCT_ID='" & pid & "'" Dim thePTable As New DataTable Dim reader As New OleDb.OleDbDataAdapter(getPID, myconnection) reader.Fill(thePTable) For i …

Member Avatar for nadiam
0
630
Member Avatar for Lukas_2

Another way to approach this is with a LINQ extension(`Distinct`). This will return a collection of elements that are unique. If the count is the same as the original collection, then the original collection is all unique elements. Since a string is basically a collection of characters, this method can …

Member Avatar for tinstaafl
0
477
Member Avatar for Salem_2

From the error I would suspect that the stored procedure might not be set up right. The error indicates it doesn't expect any parameters. I'm thinking that you'll have to start looking at the stored procedure

Member Avatar for Xavier_5
0
322
Member Avatar for Dani

Something I've been meaning to bring up for sometime. I can't login on Chrome Mobile. I get the sign in page, but then it just goes back to the generic home page with the login link.

Member Avatar for Dani
0
916
Member Avatar for nadiam

What you need to do is create the control in the loop: Private Sub btn_addline_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_addline.Click Dim i For i = 0 To 5 Dim txtB1 As New TextBox Me.Controls.Add(txtB1) With txtB1 .Name = "chkDemo" & i End With Next i End …

Member Avatar for Xavier_5
0
580
Member Avatar for Bradley_3

As pointed out your problem is here: for ( i = 1; i <= num; i++ ) { if ( i % 2 == 0 ) even_sum = even_sum + i; else odd_sum = odd_sum + i; } Instead of using `i` you should using the index of `arry[i]`: for …

Member Avatar for Xavier_5
-1
304
Member Avatar for PulsarScript

You're using Tuples with values from the invoice instances. This won't show up as invoice instances. You can make a List<Invoice> and add each instance you want to it. Also you were using the InvoiceManager class to call the method instead of the instance of the InvoiceManager: var invoiceList = …

Member Avatar for PulsarScript
0
2K
Member Avatar for sidyusuf

With c# it's a little more complicated Add a new code file to your project create a namespace for it create a static class in that namespace add whatever variables,methods you want to that class, remember to mark them `public` and `static`: namespace Globals { public static class Global { …

Member Avatar for ddanbe
0
831
Member Avatar for noorullah06

Instead of adding to an old dead post, you should make a new one and include the code you're referring too. There are probably 3 or 4 or more snippets of code in this post. It is almost impossible to tell which one if any you're talking about. Also if …

Member Avatar for tinstaafl
0
4K
Member Avatar for EVELYN_2

In the event handler for the CalculateButton.Click event you're parsing raw data without checking if it's valid. you will find much better success by initializing the decimal variables to 0 and parsing the textboxes with TryParse. If it succeeds the variable will have a new value. If not it will …

Member Avatar for tinstaafl
0
254
Member Avatar for savedlema

You could also use a Dictionary(Of String,TextBox). The name of the column as the index of the Dictionary will return that specific TextBox that you can set or get any of its properties.

Member Avatar for tinstaafl
0
299
Member Avatar for Roger_2

I think you might need to revise your logic a bit. See if something like this helps: counter = 0 while input > 0 output = output + ((input mod 10) mod 10) * (counter pow 10) input = floor(input/10) count = counter + 1 endloop return output If you …

Member Avatar for Taywin
0
461
Member Avatar for Frank_16

If you override the constructor for form3 you can get it to accept a string. then it's a simple matter of assigning the string to the text property on form3: Public Class Form3 Public Sub New(form2Data As String) ' This call is required by the designer. InitializeComponent() ' Add any …

Member Avatar for tinstaafl
0
378
Member Avatar for tinstaafl

Whenever I try to access my Inbox I get an error message - `Rate limit exceeded: Please try your request again in a few minutes.`. This happens even trying to access a conversation from an email notification.

Member Avatar for Dani
1
546
Member Avatar for Sashika_1

I assume by time period you mean the fiscal year of the company. One thing that should work is to create an index say based on the 2 calendar years referenced in the fiscal year(2016/2107). This will put each record for the company under that index and separate the transactions …

Member Avatar for tinstaafl
0
223
Member Avatar for Avishai_1

Here's a [link to the posting rules](https://www.daniweb.com/welcome/rules). In a nut shell, we will help you fix existing code, not do your homework for you.

Member Avatar for tinstaafl
-1
245
Member Avatar for Bryan_5

Also, instead of constantly iterating over the array to check for duplicates, you should find it more efficient to use a `vector<int>` of indexes. Once you've chosen a random index, erase it from the vector. This way even if the same number is chosen it will point to a different …

Member Avatar for tinstaafl
0
299
Member Avatar for Tima_1
Member Avatar for Tim_10

Here's the code from the pastebin: print ("This calculates the sum of the cubes of the 1st natural numbers") natn = eval(input("How many cube numbers do you want to sum? ")) print("sum of even cubes between 0 and {} : ".format(natn-1),sum(i**3 for i in range(0,natn,2)),"\n", "sum of cubes between 0 …

Member Avatar for tinstaafl
0
381
Member Avatar for Croco_1

Also, showing code that doesn't work or is poorly designed, is basically the point of asking for help here. Seeing the code allows someone to see exactly where you need corrections.

Member Avatar for tinstaafl
0
425
Member Avatar for nitin1

I think your problem might be your compiler. GCC seems to work but VS2015 doesn't. One work around for VS2015 is to assign the output of the function to a variable then use its address: #include <iostream> #include <string> using namespace std; string fun() { string abc = "Daniweb"; // …

Member Avatar for AssertNull
0
3K
Member Avatar for i.

I'm not that well versed in pseudocode but could you declare P2 as a Char and run the For loop from 'A' to 'B'?

Member Avatar for AssertNull
0
382
Member Avatar for tinstaafl

When I receive the DaniWeb Digest the subject line includes some sort of query string - `DaniWeb Digest for t=?UTF-8?Q?instaafl?=`

Member Avatar for tinstaafl
0
828
Member Avatar for Bryan_5

The size of each array should be the same as the size of the string that it got its values from. size1 = s1.size(); size2 = s2.size(); intArray = new int[size1]; intArray2 = new int[size2]; Do you have to use arrays to create the integers? You could do it quite …

Member Avatar for tinstaafl
0
367
Member Avatar for glao

What you're seeing is one of the drawbacks to recursion. Each iteration means the another copy of the function is running until the last one exits. In some cases this can put an unrecoverable strain on resources.

Member Avatar for glao
0
493
Member Avatar for Muntaha_1

Start by thinking of how you would do this in the real world. You know how much your target amount is, so you start with the highest available denomination. Count until you equal the target, one more would go over, or you've run out of that denomination. Move on to …

Member Avatar for tinstaafl
1
970
Member Avatar for Usman_10

Look at my answer in this [post](https://www.daniweb.com/programming/software-development/threads/506168/couldn-t-send-textbox-values-through-child-forms-vb-net) it shows a relatively simple way to do this. Basically pass a reference of the form with the data to the other form in its constructor.

Member Avatar for tinstaafl
0
98
Member Avatar for tinstaafl

Is the lack of a synopsis, for each post, in a page with a list of posts, on purpose?

Member Avatar for tinstaafl
0
362
Member Avatar for tinstaafl

The algorithm for formatting code has has never treated vb.net comments properly. I've discovered a nifty work around that will format the code properly. Close the comment with another comment character(') and the algorithm will treat the rest as code. I've never tried it, but this should also work for …

Member Avatar for Dani
1
324
Member Avatar for Sashika_1

It looks to me that you're trying to use the class types as instances. One, relatively simple, way to do what you want, is to pass an instance of Form2 to Form3 in the constructor. In Form3 code: Public Class Form3 Public targetForm As New Form2 Public Sub New(target As …

Member Avatar for tinstaafl
0
1K
Member Avatar for Bryan_5

If read what your doing, you're getting an int as the value of the enum, you can use `static_cast<Title>` to convert that int to an enum value. Once that is done you can use a `map<Title,string>`to convert that to a displayable string. I converted your struct to a class to …

Member Avatar for tinstaafl
0
182
Member Avatar for Sashika_1

Instead of firing off another question, the least you could do is answer the posts in your previous questions. Just saying that they don't work doesn't tell anyone how to fix it. In fact an answer in one of those posts, does exactly what you describe.

Member Avatar for tinstaafl
0
296
Member Avatar for catastrophe2

Something else to consider, there is another type of comments and both types of comments can be appended to a line of code. Here's some code that will ignore both types of comments, using the whole line or appended tot he end of a line: //append is true to add …

Member Avatar for tinstaafl
0
330
Member Avatar for Sashika_1

Just from a glance at your code, it looks to me that you're using the GetString method wrong. You're supposed to pass the zero-based column number to get the value of that field returned as a string.

Member Avatar for Sashika_1
0
2K

The End.