569 Posted Topics
Re: Try: $result = mysql_query("SELECT * FROM b8_14160309_simpleDB3 LIMIT 1") or die ("Something is wrong here", mysql_error()); OR try: if(mysql_num_rows($result)==0) { echo "Theres something wrong here"; } | |
Re: RMS is not difficult. I don't code in Matlab anymore but can give you the algorithm and then you can code it. Or just find one online? | |
| |
Re: What exactly do you want to do with these signals? How do you think an FFT algorithm would fit into this? It's a pretty hard question; when you give so little about what it is you're trying to do. Please expand more. | |
Re: Hey, Just a quick note. It's probably not effective to store the `salary` as a string. Why is this? You take advantage of STL's map structure. It works something like this: You have two types of data (esentially) which could be represented inside a map.. std::map<string, float> employees; employees["Phorce"] = … | |
Re: What? No. This is not how OOP works. Why are you defining your class implementation in main.cpp? This should be inside of the .cpp associated with your class file! Why do you have a empty/initial constructor that initialises some strings? Look at your code, get it to work as just … | |
Re: First of all.. What does the file contain? I have no experience in this file format, but, I'm sure there will be some tutorials out there on the header and how to handle the format. If it's numerical, 8bit, 16bit, etc.. You have to handle these. Read the file into … | |
Re: I did not just read.. >> write a function named, smallestValue, that accepts five integers and return the smallest integer accepted.( just write a function) Please tell me this is not given to you as a home work assignment? | |
Re: Should be something like the following: int foo(double a) { return a; } std::function<void(double)> call_foo = &foo; | |
Re: Why is this title in another language and the post is written in English? Also, on topic, what have you tried yourself? ![]() | |
Re: Do you really need that many classes? Will these classes get used more than once? For example, the class "ProgressBar" what is this for? | |
Hey DaniWeb *Never fear, Phorce is here!* I've completely stopped getting emails from you guys when a watched article has been read. I've clicked "Watch article" and everything but still nothing.. Checked my spam folder, nothing. Anyone else facing this issue? | |
Re: Could you not do something like: $action = $_GET['action']; // assume that action.php?action=edit switch ($action) { case "Edit": echo "EDIT STUFF HERE"; break; case "update": echo "Update here"; break; /*.....*/ default: echo "Default"; } | |
Re: I'm a bit confused regarding the actual question you're trying to ask, so, here's a solution to the problem of passing an array to a function: // 1D representation void showFunction(int* arrayValues, int SIZE) { for(unsigned i=0; (i < SIZE); i++) { std::cout << arrayValues[i] << std::endl; } } Here … | |
Re: Just throwing it out there, but did you add `-std=c++0x`? | |
Re: What do the values represent? I.e. P, r, etc.. I'm guessing `n` is the current position in the matrix? ![]() | |
Re: If I'm guessing correctly, this function: `public function contact()` has to accept paramaters.. Then you could do something like this: <?php if(!isset($_POST['form_submitted'])) { // output the form }else{ $c = new ccontctus(); // constructor $c->contact($_POST['uname'], blah, blah, blah); Something like this? | |
Re: This piece of code is a Class, which forms part of the OO techniques built into PHP. OO in itself is a very large subject, so, it would be impossible for me to write a massive post explaining it all, but, you can try the following links: [PHP Class](http://php.net/manual/en/keyword.class.php) [OOP](http://net.tutsplus.com/tutorials/php/object-oriented-php-for-beginners/) … | |
Re: Just a quick question.. Have you installed RE2 correctly? Also, are you linking it correctly when you compile this code? I.e. show what line you use when compiling `g++ blah` it sounds to me that you're not linking the library properly. | |
Re: Just a very quick question.. Why would you need/want to convert this to an .exe - Why not give them the source code? Have you tried: http://www.pyinstaller.org/ ? | |
Re: Let me just ask you: Is there really any point in sitting down and learning Python, when you already know C/C++? Let's look at this logically, from gaining knowlege in C/C++ you should have an understanding of syntax and how programming logic works. So, would you benefit from sitting down … | |
Re: The only reason the US wants to take Military action is to nuke the hell out of Syria, thus killing innocent people and all to show Iran and the rest of the world what such a powerful country the US is. The security council and the UN should come up … | |
Re: What's the specific errors? I can see a lot of problems within this code, but, I don't have the time to physically sit down and re-write this, sorry. | |
Re: You are missing the `;` off your function prototypes. The ones you have, should work with your compiler.. You could, however, do the following: `void Scanned(std::ifstream& ifp,int i);` but make sure you include `<fstream>` Your `struct` seems fine, is there a reason why you're not using classes - Just out … | |
Re: What don't you understand? are you allowed to sort using `std::sort` are you sure that `arrays` are the best structure for this data? | |
Re: Why do you want to do this? I don't get the point?? | |
Re: Hello, >> ld, but I need to start somewhere and make some visible results on my projects. Maybe you should assess what your "projects" are and then make the decision on the language to choose? | |
Re: Hey, Something like this: #include <iostream> const std::size_t limit = 10; int main(int argc, char *argv[]) { unsigned int numb; try { std::cout << "Please enter a number: "; std::cin >> numb; if(numb > limit) throw 1; } catch(...) { std::cout << "Out of bounds"; } } // input 100 … | |
Re: What do you mean it doesn't? Could you give an example of the input/output? If, you mean like: "Hello my name is phoce" would then become "hellomynameisphorce" then you can do: `std::remove_if(str.begin(), str.end(), isspace)` or `str.erase(str.begin(), str.end(), isspace), str.end());` Hope this helps. | |
Re: `echo $obj->setPassword("dsadsadasdas'das");` this is wrong. Yo don't return anything, so don't output this. You're setting, not getting. What seems to be the error? | |
Re: Do you honestly expect someone to give you an answer based on the attempt that you've done? Seriously.. Do some work and if you get stuck on something in particular then someone will help. >> proper technique for opening files Who has stated a "proper technique" by who's standards? | |
Re: Why session register? Why not just: `$_SESSION["pw"] = "blah";` and then you can: `if(!isset($_SESSION["pw"])) { // }` etc.. | |
Re: I believe what you are meaning here is Polymorphism? Here is an example: class Base { public: Base() { } virtual std::string speak() { return 0; } }; class Dog : public Base { public: Dog() { } std::string speak() { return "woof"; } }; class Cat : public Base … | |
Re: Show what you have done so far / give examples of the data | |
Re: The style and syntax is horribly wrong. You should work on this, here: Q: Why do you need to include the .cpp to this? It's just.. not needed. Here's an alternative: Stuff.h #include <string> bool Correct_Parent(std::string x) { int p_Left_Counter = 0; int p_Right_Counter = 0; for(unsigned int c = … | |
Re: @cam - No, this has to be outside of the class definition. You're delcaring a static reference, the class has to know where it is initialised. | |
I don't know why I'm having such a problem with this, basically, I want to have a Queue that is constantly running during the program called "Worker" this then works, however, every 10 seconds or so.. Another method called "Process" comes in and processes the data. Let's assume the following, … | |
I have two threads, and, I want one thread to run for 10 seconds, and then have this thread stop, whilst another thread executes and then the first thread starts up again; this process is repeated. So e.g. from threading import Thread import sys import time class Worker(Thread): Listened = … | |
Re: Alternatively, have one standard.. PDF (which is compatible through many operating systems) thus providing that all documents can be open in the web browser. ![]() | |
Re: This: void getData (string city[], string country[]), double lat[], double lon[]; Is not valid C++ for a function prototype. It's hard to say, since you don't give an example of the data contained in the file.. Is this possible to supply? | |
Re: Do you already have the robotic arm? You could do this using an Arduino, there are hundreds and hundres of resources out there. GIYF (google is your friend) | |
Re: Why use an array? Since you're just asking for the persons namr, you can do: #include <string> #include <iostream> int main() { std::string name; std::cout << "Please enter your name: "; std::cin >> name; std::cout << "Size: " << name.length(); } | |
Re: Would it not just be easier to use: <?php $email_a = 'joe@example.com'; $email_b = 'bogus'; if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) { echo "This ($email_a) email address is considered valid."; } PHP already has this built-in!! But, what you have used is a function, to call this function you would use: if(!validate_email($_POST['email'])) { … | |
Re: Like @prit said, are you sure you have the right port? Are you sure this port is open? I Persume that you're using local machines (i.e. not a server) for this? | |
Re: Are you allowed to use vectors? If so, this is a way to think of it. In no means, is this the final solution. Just a way for you to think about it. I would use a vector to store the values in, then, create another vector to store the … | |
Re: This question cannot be answered; since, it depends purely on the programmer and their preferences. (Bit like the Mac vs Windows arguement) each have their own strenths and own weaknesses and based on those, you should make your own decision. ![]() | |
Re: It is all well and good to concentrate on "coding" type security preventions, but, what are you doing in terms of server-side? I.e. "Hackers" or people who want to generally cause a havoc to your website might not generally go down the route of XSS or trying to find vunerabilities … ![]() |
The End.