1,857 Posted Topics
Re: 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 … | |
Re: 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 … | |
Re: One of your problems is here: totalSale=tPrice*ticketsSold; You're overwriting totalSale instead of adding to it: totalSale += tPrice * ticketsSold; | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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) | |
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)? | |
Re: Is there a reason you can't reverse the order of the inheritence?: class D : public C , public B { }; | |
Re: 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 … | |
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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 = … | |
Re: 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 { … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
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. | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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"; // … | |
Re: 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'? | |
When I receive the DaniWeb Digest the subject line includes some sort of query string - `DaniWeb Digest for t=?UTF-8?Q?instaafl?=` | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Is the lack of a synopsis, for each post, in a page with a list of posts, on purpose? | |
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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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. |
The End.