569 Posted Topics

Member Avatar for mattyd

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"; }

Member Avatar for Dani
0
394
Member Avatar for bilal.saim

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?

Member Avatar for phorce
0
178
Member Avatar for orbar

Hey. Welcome to DaniWeb. May I suggest learning a different language? ;)

Member Avatar for uisc
0
55
Member Avatar for Ancient Dragon
Member Avatar for vani krishnan

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.

Member Avatar for phorce
0
345
Member Avatar for roidbeginner

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"] = …

Member Avatar for Dani
0
119
Member Avatar for roidbeginner

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 …

Member Avatar for roidbeginner
0
312
Member Avatar for daino

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 …

Member Avatar for daino
0
196
Member Avatar for apiatex

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?

Member Avatar for phorce
0
189
Member Avatar for cambalinho

Should be something like the following: int foo(double a) { return a; } std::function<void(double)> call_foo = &foo;

Member Avatar for richieking
0
142
Member Avatar for amani_1

Why is this title in another language and the post is written in English? Also, on topic, what have you tried yourself?

Member Avatar for Warrens80
0
121
Member Avatar for Con7e

Do you really need that many classes? Will these classes get used more than once? For example, the class "ProgressBar" what is this for?

Member Avatar for Con7e
0
275
Member Avatar for phorce

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?

Member Avatar for Ancient Dragon
0
119
Member Avatar for dany12

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"; }

Member Avatar for dany12
0
243
Member Avatar for ticomatik

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 …

Member Avatar for kal_crazy
0
727
Member Avatar for skyyadav
Member Avatar for Kanoisa
0
1K
Member Avatar for abhi10kumar

What do the values represent? I.e. P, r, etc.. I'm guessing `n` is the current position in the matrix?

Member Avatar for diafol
0
97
Member Avatar for davy_yg

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?

Member Avatar for davy_yg
0
329
Member Avatar for arifkutty

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/) …

Member Avatar for arifkutty
0
164
Member Avatar for DuffManLight

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.

Member Avatar for phorce
0
287
Member Avatar for patk570
Member Avatar for sam.tubb.75

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/ ?

Member Avatar for sam.tubb.75
0
333
Member Avatar for nitin1

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 …

Member Avatar for nitin1
0
417
Member Avatar for aVar++

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 …

Member Avatar for HiHe
3
2K
Member Avatar for Andy90

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.

Member Avatar for mridul.ahuja
0
516
Member Avatar for Andy90

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 …

Member Avatar for Ancient Dragon
0
674
Member Avatar for VUEKID

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?

Member Avatar for linux
0
185
Member Avatar for cambalinho
Member Avatar for exN4TURAL

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?

Member Avatar for <M/>
0
349
Member Avatar for nathan.pavlovsky

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 …

Member Avatar for phorce
0
122
Member Avatar for laklaker

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.

Member Avatar for phorce
0
257
Member Avatar for devianleong

`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?

Member Avatar for devianleong
0
138
Member Avatar for 9Nightcrawler
Member Avatar for fashxfreak

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?

Member Avatar for fashxfreak
0
687
Member Avatar for Victor_4

Why session register? Why not just: `$_SESSION["pw"] = "blah";` and then you can: `if(!isset($_SESSION["pw"])) { // }` etc..

Member Avatar for pzuurveen
0
4K
Member Avatar for cambalinho

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 …

Member Avatar for cambalinho
0
234
Member Avatar for TalentedIndividual
Member Avatar for phorce
0
70
Member Avatar for younes.keraressi

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 = …

Member Avatar for younes.keraressi
0
216
Member Avatar for cambalinho

@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.

Member Avatar for cambalinho
0
214
Member Avatar for phorce

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, …

Member Avatar for woooee
0
271
Member Avatar for phorce

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 = …

Member Avatar for Gribouillis
0
11K
Member Avatar for dannybarh

Alternatively, have one standard.. PDF (which is compatible through many operating systems) thus providing that all documents can be open in the web browser.

Member Avatar for diafol
0
192
Member Avatar for VUEKID

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?

Member Avatar for VUEKID
0
130
Member Avatar for Daiwat

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)

Member Avatar for phorce
0
99
Member Avatar for laklaker

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(); }

Member Avatar for deceptikon
0
187
Member Avatar for ncis_sg1

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'])) { …

Member Avatar for ncis_sg1
0
1K
Member Avatar for mmcdonald

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?

Member Avatar for Atli
0
893
Member Avatar for LokiSoliman

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 …

Member Avatar for Ancient Dragon
0
164
Member Avatar for johmny

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.

Member Avatar for diafol
0
152
Member Avatar for mmcdonald

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 …

Member Avatar for diafol
0
293

The End.