565 Posted Topics
Re: > example i want search data where month 07 in my column table 01/07/2014 Looks like you need some query for the database: //MySQL syntax: SELECT * FROM table_name WHERE DATE_FORMAT(STR_TO_DATE(column_name, '%d/%m/%y'), '%m') = 'your_month_number' -- assuming that in your table 'table_name' you have a column 'column_name' -- which is … | |
I kinda like the idea behind the static/fixed header, but I was wondering if there's any chance to actually extend it, and add the user information to it, like this:  | |
Re: Here this should fix it: for (double n = 1; n <= i; n++){ pi += pow(-1, n+1)*(4/(2*n-1)); } Pow requires double as arguments, so you'll need to make your variable from the loop a double. Another thing you could do, when you try to print real numbers, is to … | |
Re: This is a simple string concatenation. In PHP, strings can be concatenated using the `.` (dot) operator (read more [here - Click Here](http://www.php.net/manual/en/language.operators.string.php) or [here](http://phphowto.blogspot.ro/2006/12/concatenate-strings.html)). In this case `$master_id` is a variable, so they used string concatenation to get its value and add it into the statement $master_id = "14"; … | |
Re: You can also use the `stringstream` class - [Click Here](http://www.cplusplus.com/reference/sstream/stringstream/) Here's a small example: #include <sstream> #include <iostream> #include <string> using namespace std; int main(){ char a = 'a'; char b = 'b'; stringstream ss; ss<<a<<b; //adds both chars to the stringstream string concat = ss.str(); //you can get a … | |
Re: This was already tackled at this post, see the doing, and try to apply to your need: [Click Here](http://www.daniweb.com/software-development/cpp/threads/456193/output#post1982383) Search the forums first, you'll be amazed of what you can find. ;) | |
Re: I see only instructions, did you miss any code to post with that too? I'm asking this because our member rules (on which you agreed upon registration) state this: ***Do** provide evidence of having done some work yourself if posting questions from school or work assignments.* Some basic starters: [Classes](http://www.cplusplus.com/doc/tutorial/classes/) … | |
Re: Well, you can do it using plain ifstream handling: bool existFile(string filename){ return ((ifstream(filename.c_str())).good()); } [Click Here](http://www.cplusplus.com/reference/ios/ios/good/) | |
Re: Have a look at the `range(start, stop[, step])` function ([Click Here](http://docs.python.org/2/library/functions.html#range) ) from python. Also, you can use it to generate reverse lists: [Resource - click me](http://stackoverflow.com/a/14931024/1432385) Regarding your usage of the `map(function, iterable)` function: it applies a function to the iterable agrument, so you'll need some elements on which … | |
Re: `WinMain@16` usually apears when you try to compile some files, which doesn't contain the `main()`/`WinMain()` function (starting point of the program). In your case, not including the souce file with the `main()` function in it was causing your troubles. | |
Re: If you have any problems please post your questions. If you just want to contribute to DaniWeb with Sample codes, please post your code in a Code Snippet thread format. | |
Re: Here's a small Linq example: public static IEnumerable<string[]> Read(string path) { return from line in File.ReadLines(path) select line.Split(new [] {','}); } | |
Re: Search for this line when you edit your profile: Disable Ads? (Please consider a small [donation](http://www.daniweb.com/home/donate) if you disable ads). If you do check that box, make sure you check that donation link too. | |
Re: Here, take a look at this simple example, maybe it will help you understand how smart pointers can work: #include <iostream> #include <vector> #include <memory> using namespace std; #define SIZE 10 class Test { int* nr, curElem; public: Test() { cout<<"Object created\n"; nr = new int [SIZE]; curElem = 0; … | |
Re: Our member rules (on which you agreed upon registration) state this: *Do provide evidence of having done some work yourself if posting questions from school or work assignments.* We won't do your homework. Provide us with an actual problem over your code, and we might be able to help you. … | |
Re: As of a quick search on Daniweb I got this: [Click Here](http://www.daniweb.com/software-development/cpp/threads/67312/connecting-c-to-ms-access) which contains other links to this: [Linking MS Acess to C++](http://reydacoco.blogspot.ro/2011/10/linking-to-ms-access-data-source-using.html) [Developing Access Solutions to native C/C++ from MSDN](http://msdn.microsoft.com/en-us/library/cc811599.aspx) | |
Re: **NOTE:** this should be in the C++ forum thread. You need after each input operation to increase the size of the array. Your constructor definition is good, initializing the data, but you must have another function, let's call it `extendArray()` which increases your array size. For example: void extendArray(){ string … | |
Re: Just logged in. This new layout... totally blew my eyes off. Will take some time to adjust, but I see you put a lot of effort in it. I hope others appreciate it. :) ![]() | |
Re: Daniweb rules state this: **Do** provide evidence of having done some work yourself if posting questions from school or work assignments. Show us what you have so far. | |
Re: Static arrays are allocated on the stack and they have fixed sized, e.g. their size cannot be changed, either shortened or expanded. Dynamic arrays are allocated on the heap. You set their size and than even change it, making them "dynamic". In order to use these kinds of arrays you'll … | |
Re: I love how Dani was giggling almost all the interview. Immediately thought of this, I don't know why:  | |
Re: Well it depends. Where I work, Daniweb is kinda slow, but when I go home (which is near the city, ~15 km away), Daniweb is ultra fast... So depends on the ISP I guess. | |
Re: This is a video-driver-related problem. Check for updates on your video driver, see if anything changes. Google the error message: it will yield a lot of good links, such as this one: [Click Here](http://www.tomshardware.co.uk/forum/32085-63-display-driver-stopped-responding-successfully-recovered) | |
![]() | Re: First of all, it's int main() not void main() 2nd, line 22 sum=sum+(rem*rem*rem); should be sum=sum+pow(rem, numberOfDigits); How to get that `numberOfDigits`? Easy, apply `log10` over it: #include <math.h> #include <stdio.h> int main(){ //don't forget this!!! //code goes here //get your range for int len = (int)log10(num)+1; //get the number … ![]() |
![]() | Re: Search the website first, then post your question: [Click Here](http://www.daniweb.com/software-development/cpp/threads/455587/loops#post1979476) |
Re: 1. If you think that the problem at hand is not that hard, you can only sketch it and start writing code (for larger projects a deeper analysis is required). 2. Since you have to compute the carbon footprint of each of those objects, and you have the formulas, I'm … | |
Re: > I m new in programming languge and using turbo c . Get a moder C++ compiler first. >If u kindly give me the above said code, i will be remain thankful to you. Our member rules state this: **Do provide evidence of having done some work yourself if posting … | |
Re: Need more info and the code that you think has to do that... See if you assigned to your menu item the jpopmenu object. | |
Re: 1st, it's `int main()` and not `void main()` 2nd, You were actually doing a pointer aritmetic by this line: xx+= x + ", "; In your case, `", "` is a pointer to a sequence of characters. When you add an integer to that sequence, you are using pointer arithmetic. … | |
Re: Still, you could've formatted the code a bit. **nullptr**'s example points out very well the use of a default constructor. For multiple elements to be initialized, you could go the plain old fashion way of: class Foo{ int a, b, c, d; float e, f, g, h; public: Foo() { … | |
Re: Here's a small example. You can use the `getButton()` function from `MouseEvent`. final JLabel lblRightClickMe = new JLabel("Right click me"); //create a label lblRightClickMe.setBounds(152, 119, 94, 14); final JPopupMenu jpm = new JPopupMenu("Hello"); //create a JPopupMenu jpm.add("Right");jpm.add("Clicked");jpm.add("On"); //add some elements jpm.add("This");jpm.add("Label"); lblRightClickMe.setComponentPopupMenu(jpm); //set jpm as this label's popup menu lblRightClickMe.addMouseListener(new … | |
Re: For a better understanding of this output, I suggest this code to run in the `main()` function: int main() { Base obj; cout<<" 1st - initialization.\n"; int b = obj+6; cout<<" 2nd - get the int via the int() conversion operator\n"; obj = b; cout<<" 3rd - create a new … | |
Re: Try using a csv file [Click Here](http://viralpatel.net/blogs/java-read-write-csv-file/). | |
Re: It's kinda hard for us to figure out your problems since you didn't share them with us. | |
Re: Wrong thread. Post it here [Click Here](http://www.daniweb.com/software-development/python/114). ![]() | |
Re: **Abhinisha** if you have a specific question please start your own thread. Our member rules state this: *Do not hijack old forum threads by posting a new question as a reply to an old one*. This thread is 9 years old. I doubt they're still looking for answers. | |
Re: Maybe this link will share some light over this situation: [Click Here](http://tartarus.org/martin/PorterStemmer/)(never heard of it too). | |
Re: Usually Java has some tutorials on this over their website: [Click Here](http://docs.oracle.com/javase/tutorial/essential/io/buffers.html) Full tutorial: [Click Here](http://docs.oracle.com/javase/tutorial/essential/io/index.html) | |
Re: Your problem lies in line 17: name = ""; Your `name` attribute is initialized to a read only memory having `name` to point to that memory location, but any writing is illigal, thus your error. If you would initialize `name` as this: name = new char[200]; you would allocate memory … | |
Re: Our rules cleary state this: **Do** provide evidence of having done some work yourself if posting questions from school or work assignments | |
Re: What is the error that comes out of your pythonw.exe? Try runnning it in a cmd window to see if you have any errors. | |
Re: As **iamthwee** pointed out, if you put in the constructor the name argument, that's ok, your object will set the name attribute to whatever you want, but, if along the run of your program, you want to make changes to your object, e.g. the course name has been changed, you … | |
Re: Here, this is an example of your problem, but reversed, from top to bottom: #include <iostream> using namespace std; #define SIZE 12 int main(){ for (int i=0;i<SIZE/2;i++){ for (int j=0;j<SIZE;j++){ cout<<" "; if (j >= (SIZE/2-i)-1 && (SIZE/2-1) >= j) cout<<"X"; else if (j > SIZE/2) break; } cout<<endl; } … | |
Re: Here's a good place to start: [Click Here](http://vulcan.wr.usgs.gov/Miscellaneous/ConversionTables/conversion_table.html) | |
Re: Maybe something along this snippets will help you: [Click Here](http://www.laurentluce.com/posts/python-threads-synchronization-locks-rlocks-semaphores-conditions-events-and-queues/) Also, this for i %2 == 1 in range(200): never, use the step argument from the range funtion: for i in range(1, 200, 2): #odd numbers for i in range(0, 200, 2): #even numbers | |
Re: If you want the `C-style` string (null terminated sequences of characters), you can get it by the `c_str()` function from the `std::string` class. [Click Here](http://www.cplusplus.com/reference/string/string/c_str/) As for getting the sufix, try using the `substr(startpos, stoppos)` function. [Click Here](http://www.cplusplus.com/reference/string/string/substr/) Also, here's a small example of how you can convert a string … | |
Re: Why would you need to `delete` p if it's not allocated by `new`? If you really want to "clear" out the `p` pointer, you could asign it to `NULL`. | |
Re: averageCal; productCal; sumCal; should be averageCal(userinputs); productCal(userinputs); sumCal(userinputs); They are functions. You should call them accordingly. | |
Re: I'm guessing you already found this good tutorial on PostgreSQL and Python: [Click Here](http://zetcode.com/db/postgresqlpythontutorial/) What is your problem with your code (except the fact that it isn't even inserted in a code block...). Do you get a specific error message, or you just don't get any result at all. I'm … |
The End.