- Strength to Increase Rep
- +10
- Strength to Decrease Rep
- -2
- Upvotes Received
- 190
- Posts with Upvotes
- 163
- Upvoting Members
- 109
- Downvotes Received
- 13
- Posts with Downvotes
- 12
- Downvoting Members
- 8
Asp.Net Developer
- Interests
- Programming mostly.
- PC Specs
- Desktop: Windows 7 Ultimate 64-bit, 16384MB RAM, Processor: Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz…
565 Posted Topics
Re: Disturbing noises can be heard from my neighbours | |
| |
Re: Assuming your system time is ok, this will calculate an aproximate of your years: #include <ctime> #include <iostream> using namespace std; int main(){ struct tm date = {0}; int day, month, year; cout<<"Year: "; cin>>year; cout<<"Month: "; cin>>month; cout<<"Day: "; cin>>day; date.tm_year = year-1900; date.tm_mon = month-1; date.tm_mday = day; … | |
Re: This looks more of a school asignment. Also > I have been programming C# for some time, and i recently learned about constructors and objects, but didn't fully understand. indeed looks like a contradictory statement. The questions you've put here are the basic understanding of OOP, and are not tied … | |
Re: Apparently it is a stand-alone account, and I needed to log in via Dazah with the new resetted password to work. | |
Re: Here's a good place to start reading about I/O operations: [Click Me!](https://docs.oracle.com/javase/tutorial/essential/io/) | |
Re: > i can't get. what is the id and pass. They are on line 8 and 9: char uid[25],pwd[25],s_uid[][25]={"11user1","12user2","13user3"}; char s_pwd[][25]={"Pwd1","Pwd2","Pwd3"},ch='a';/*dummy character in ch */ | |
Re: DW starting page for C++: * [C++ Books](https://www.daniweb.com/software-development/cpp/threads/70096/c-books) * [Starter problems](https://www.daniweb.com/software-development/cpp/threads/67837/c-c-faqs-and-practice-problems) These two threads should put you on a good track. :) | |
Re: """ result ... with the @Memoize decorator ... first pass: fibo1(30) takes 106.077 micro-seconds/pass second pass: fibo1(30) takes 2.281 micro-seconds/pass without (commented out) the @Memoize decorator ... first pass: fibo1(30) takes 875692.257 micro-seconds/pass second pass: fibo1(30) takes 877517.997 micro-seconds/pass """ Or wasn't that clear enough? His first test was indeed … | |
![]() | Re: Maybe this topic will help you: http://www.daniweb.com/software-development/cpp/threads/426915/asterisk-right-triangle It's almost the same concept/ideea involved. |
Re: It's kinda hard to tell what you're trying to accomplish here. Putting System.IO.StreamWriter file = new System.IO.StreamWriter("Conservateur.txt"); file.WriteLine(lines); file.Close(); inside your `foreach` statement will do you no good, because it will overwrite the same file, over and over again. var inMemoryProcessedItems = new List<string>(); using (var sw = new StreamWriter("yourfile.txt")) … | |
Re: To get a better answer to your problem, post your question in a new thread. | |
Re: Because he escaped from a 1900's prison. Knowing that, on a regular computer, such as the PC one, 9.9999999999999999999999999999864e+4351 * 9.9999999999999999999999999999864e+4351 = 9.9999999999999999999999999999728e+8703, and 9.9999999999999999999999999999728e+8703 * 9.9999999999999999999999999999728e+8703 = Overflow, how much is Overflow * Overflow? | |
Re: It would be like this: current_year<-2012 for i=current_year to current_year+123 do for j=0 to 124 do if i*i==j then print year=j print age=i print birth year=j-i end_if end_for end_for Remember, this is written in pseudo-code, so you'll have to implement it. | |
Re: Maybe it's a problem related to the culture and settings on the client's PC (as in missing fonts or encoding). As **Suzie999** suggested, check the dependencies of your software with the client. Also, provide the code of your software that is loading the data into the reports, maybe you've missed … | |
Re: You could also use LINQ to search for that. Knowing that Hashtable uses internally DictionarEntry to store its items (since .Net 1.1), we can cast it to such and search for the item we want. var hash = new Hashtable(); hash.Add("1", "one"); hash.Add("2", "TEST"); hash.Add("3", "one"); var res = hash.Cast<DictionaryEntry>() … | |
Re: Is this: private void Popup_Load(object sender, EventArgs e) { Panel panel2 = new Panel(); panel2.Size = new Size(1280, 720); panel2.Location = new Point(20, 20); panel2.BackColor = Color.Red; this.Size = new Size(1280, 720); this.Controls.Add(panel2); } declared as an event in the Form which is calling the pop-up, or in the pop-up … | |
Re: Here's something for you: I/O on files: [Click Here](http://www.cplusplus.com/doc/tutorial/files/) For the XML part: **a.** use some libraries for parsing the file: TinyXML: [Click Here](https://sourceforge.net/projects/tinyxml/) Xerces: [Click Here](http://xerces.apache.org/xerces-c/) **b.** use regex for matching: Here's an online tool to test your regex:[Regex101](http://regex101.com/) **c.** brute parse the file and count the `<home>` and … | |
Re: it's kinda improper for you to say that things lsallen, because daniweb is a free source code website, so, I don't think that any1 will 'steal' your code and sell it on ebay... | |
Re: You should have a look at this too: [nreco.pdfgenerator official site](http://www.nrecosite.com/pdf_generator_net.aspx) [nreco nugget](https://www.nuget.org/packages/NReco.PdfGenerator/1.0.2) Here's the basic example, after adding the library to your project: var htmlContent = String.Format("<body>Hello world: {0}</body>", DateTime.Now); var pdfBytes = (new NReco.PdfGenerator.HtmlToPdfConverter()).GeneratePdf(htmlContent); | |
Re: Well, you could attach a signal to the button, so that when it's pushed it will perform some actions, in your case to show the help. It's been a while since I've worked with QT so I don't have a concrete example (not a correct one at least), so I'll … | |
Re: Here's a headstart. Regex to find words starting with a lowercase vowel. #include <iostream> #include <regex> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { regex reg("\\b[aeiou]\\S*"); string str("Carry umbrella and overcoat when it rains"); smatch match; while (regex_search(str, match, reg)) { for (auto i : match) cout … | |
Re: Look at this post: [Click Here](http://stackoverflow.com/a/11822850/1432385) You can kill the thread you're opening when you press enter. Happy reading ;) | |
Re: I suggest changing a bit your struct: struct point { float x, y; point (float x, float y) { this->x = x; this->y = y; } bool operator <(point &p){ return this->x < p.x && this->y < p.y; // comparison logic } friend ostream& operator<<(ostream& os, const point &p) { … | |
Re: Since you're posting in the C++ thread, at least use the corresponding I/O functions: [Click Me!](http://www.cplusplus.com/doc/tutorial/basic_io/) In your case, you're `"syntax error"` comes from the lines 5 and 6... you forgot the `';'` ending character. Regarding the logic of the program: What is the discount in your problem? Is a … | |
Re: Always read the documentation if in doubt: [PyDoc - def](https://docs.python.org/release/1.5.1p1/tut/functions.html) As for you, here's an example of a submenu (Python 3.x): def firstMenu(): print ('''This is the first menu 1. Hello 2. World 3. Submenu q - exit ''') while True: answer = input("Insert command: ") if answer == "1": … | |
Re: Have you looked at the specification from the website? [substring(click here)](http://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/StringUtils.html#substring\(java.lang.String, int, int\)) What are the actual parameters that the function takes? > Parameters: str - the String to get the substring from, may be null start - the position to start from, negative means count back from the end … | |
Re: It's snowing here too, but it's kinda warm for a winter day (only -2C). Snow is already around 10 cm high. Who knows, maybe I'll go snowboarding this weekend. | |
Re: Try to take a modular approach, or a class approach, it will suite this project better than a sigle .cpp file. | |
Re: I hope I didn't misunderstand your question: So let's say you have 2 forms, `Form1`, and `Form2`. Your main form is `Form1`, your popup form is `Form2`. You also have 1 textbox and one button on each of the forms, but when you click on the button from the `Form1`, … | |
Re: Here, this should pretty much clear everything uncertain about converting any number to base 10: [Click Here](http://mathbits.com/MathBits/CompSci/Introduction/tobase10.htm) Also, your function is wrong, don't rush through steps, it will get you confused: #include <cmath> int ToBase10(int number, int base){ int ret = 0; //return number; for (int i = 0; i … | |
Re: Use in your main window a Dictionary with a `Key` and a specific class to store your progress information. Also, have a `StackPanel` in your main window, to display the `ProgressBar`s. private Dictionary<Key, Progress> progressBars = new Dictionary<Key, Progress> { { Key.O, new Progress() } , { Key.L, new Progress() … | |
Re: You only declared your pointer. Also you allocate memory for your `filter_list` pointer in an `if` clause, yet you try to access that pointer in an `else if` clause. The compiler throws a warning, saying that it's possible to enter only in the `else if` clause, without entering first in … | |
Re: What do you mean by >quick or efficient? Function replaceNull() Dim filename = "a.txt" Dim regex As Regex = New Regex(New String(vbNullChar)) Dim replacement As String = " " Dim reader As StreamReader = My.Computer.FileSystem.OpenTextFileReader(filename) Dim writer As StreamWriter = New StreamWriter("out_" + filename, True) Dim line As String Do … | |
Re: First of all, you'll need a MySql connector for your project [Click Here](http://dev.mysql.com/downloads/connector/net/6.8.html), or you can import it (if using VS) by managing NuGet packages. After that you'll need to have some sort of access to the database, like this: string connStr = String.Format("server={0};user id={1}; password={2};" + "database=your_database; pooling=false", "server_ip", … | |
Re: Have you checked this thread? You can find a lot of problems to solve, and some of them are quite interresting. [Click Here](http://www.daniweb.com/software-development/cpp/threads/67837/c-c-faqs-and-practice-problems) | |
Re: You could do it using the ifstream class [Click Here](http://www.cplusplus.com/reference/fstream/ifstream/). Here's a small example: string filename = "a.txt"; ifstream fin(filename.c_str(), ios::in); if (fin.good()){ string line = ""; while (getline(fin, line)){ cout << line << endl; } } | |
Re: All we can do is to answer (if we know) specific questions, asked upon specific code/logic related errors. I see only a statement and a request, not a question. Please formulate a question regarding a specific part of your assignment that is giving you a hard time, and also post … | |
Re: Here's a small example: char* a = "abcdef"; cout << a[2] << endl; //offset 2 of a is c And here's a good link to describe that: [Click Here](http://www.cplusplus.com/doc/tutorial/pointers/#arrays) | |
Re: Have you tried removing the `https:` from the frame? And link it just like `//connect.facebook.net` or whatever plugin is there? This will force the frame to load using the current page scheme (protocol relative URL). | |
Re: Change `icons[i].src` to `this.src` Note that you are inside the function of `icons[i]` by `icons[i].onload = function()` Here's a small example: <html> <head> <title></title> <script> var img = []; for (i = 0;i<3;i++){ img[i] = new Image; img[i].src = "b.png"; //assuming you have a b.png img img[i].onload = function(){ alert(this.src); … | |
Re: You could parse the log file line by line, and see if there are duplicate lines: def uniq(inlist): return [i for i in inlist if inlist.count(i) > 1 and not inlist.remove(i)] So for your log, for i in uniq(open("log.txt").readlines()): print i, this would be the output ''' at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:1326) ~[org.apache.axis2.jar:na] … | |
Re: Maybe this post will help you: [Click Here](http://stackoverflow.com/a/622308/1432385) If you have a proper ip to relate to your windows mysql server, then it will be a matter of setting the right properties in the python connection. | |
Re: Here's a small example: # en to de trans = { "house" : "haus", "car" : "auto", "food" : "lebensmittel", "sleep" : "schlaf" } while True: ans = raw_input("Translate: ") if ans == "quit": break print trans[ans] if ans in trans else "Invalid word." Basically, you search for the given … | |
Re: In order to do this program, one should know the very basics of arrays. Here, this might help you: [Quick, Click Me!](http://www.cplusplus.com/doc/tutorial/arrays/) | |
Re: Here are some basic list examples: l = ["1","2","3","4","5","6"] half = len(l)/2 print (l) #normal list print (l[ : : -1]) #reverse list print (l[: half - 1 : -1]) #reverse list from last to middle print (l[half - 1 : : -1]) #reverse list from the middle to first … | |
![]() | Re: **iamthwee** you can make a shorthand of the original link from google, like this: www.google.co.uk/search?q=what+to+search so that you can avoid having a long google link. Also, words are split by `'+'`. |
Re: **sheetalphapale** if you have a question, please start your own thread. One of our rules is not to hijack old threads (this is 4 years old), especially when you have a question. That being said, here, this might help you: > You can make use of the `stringstream` class from … | |
Re: You can make use of the `std::sort()` ([Click Here](http://www.cplusplus.com/reference/algorithm/sort/)) function which is found in the `<algorithm>` header. It require two random access iterators from a sequence, the first iterator should point to the beginning of the sequence, and the second to the end of the sequence. It also requires a … |
The End.