One thing to note here is that just because a user can 'USE db_name' doesn't mean they can see any data there. From the info you posted, the user doesn't have SELECT or INSERT privileges on the db, so they can't read or write data into it, nor grant privileges either. I don't see how this can be...
I need to be able to connect to Max system and get the same data as the MTE shows - but I'm having trouble nailing down the correct terminal emulation parameters. Has anyone done this before?
What kind of client are you going to expect users to use? If you want to allow the use of telnet or ssh type clients, and you want the user to see the output of the bash script, then the easiest solution for a Linux/FreeBSD box is to add a new user to the system, and make the bash script their...
Better yet, use the C++ STL features to make your life easier.
[CODE]#include <string>
#include <fstream>
#include <iostream>
std::ifstream infile;
std::string line;
int pos;
infile.open("datafile.txt");
while (infile){
std::getline(infile, line);
while ((pos =...
You need to clean up your input buffer. There are several ways to do that, but the basic problem is that you're getting newline characters in the buffer and not clearing them. If you're actually using C++ and not C, the you can use cin.ignore() to clear up everything. If not, you'll need...
POSIX IPC includes pipes, FIFOs, and shared memory. The best thing I can recommend for understanding them is W. Richard Stevens' book Unix Network Programming Vol. 2: IPC. It will tell you everything you ever needed to know about Unix IPC.
As was mentioned, never test floating point values for equality. What you can do is replace as follows:
float err = .001;/*or whatever margin of error is valid for you*/
float x = 1.51675, y= 1.51675;
if ( abs((x - y) < err) ) cout << "Equal";
if ((x - y) < -err ) cout << "Y >...
Have you looked at http://www.mysql.com/documentation/mysql++/index.html ? It's the MySQL++ manual, from MySQL AB, so it ought to have anything you need as far as the C++/MySQL interface goes. I don't know how much, if any, the manual will overshoot your knowledge of C++, but since you already...
For Linux, if you're using KDE, there is KDevelop, which I'm told is a nice IDE. I've never used it (I looked at it once, but didn't use it). It looks quite a bit like VC++ for Windows, and I'm told that they are working on adding features along the lines of code completion and such that make...
My guess (and I'm no expert) is that you'd need your application to operate the NIC in 'promiscuous' mode, and listen in on the communications that way. For a simpler method, you can get a Windows version of tcpdump (I know it exists, but don't have a link), and run that while your apps are...
Any STL vector or list would have to be created with a specific type, which means that you couldn't have a list/vector of QueueArrays of arbitrary type. You could always do: vector <QueueArray <int> > int_qa_vector;
Well, sort() can take a third argument, and something like this:
struct string_less : public binary_function<string, string, bool> {
bool operator()(const string& x, const string& y) const{
return (strcmp(x.c_str(), y.c_str()) <= 0 ? true : false);
}; ought to work, if I read the...
Anyone have any experience with setting up DADS (Definity ACD Simulator)? I've installed it, but it doesn't appear to work properly. It starts up, but the VFM won't ever come out of idle state. Any help would be greatly appreciated!
Are you running the code as a privileged user? EPERM means you don't have sufficient privileges to set a particular scheduling parameters/policy requested.
Sounds like you did things the best possible way. On a side note, if you have a MAC address, you can actually build a packet up that will get to it, and if you supply an address, can sometimes (I think it depends on the NIC, but I'm not sure) force the machine to that IP address - probably...
You might use a temporary variable to hold the input name, and if it's "X", break out of the for loop. If it's not, assign your temp variable to the permanent location, then proceed with your input. BTW, if this is in C++, why use printf and scanf, when cin and cout are much more civil?
Actually, a dynamically allocated linked list is going to allocate memory for EVERY item added - a dynamically allocated array doesn't have to (the STL vector allows you to reserve space for a given number of items, in addition to growing as needed, and IIRC, it grows in chunks to prevent...
1. time() and localtime() together will give you the system date (as part of the tm structure returned from localtime).
2. gethostname() will give you the hostname of the system.
3. gethostbyname() returns a hostent structure that includes the address(es) of the host.
4. There is a function...
Assuming you have the relevant header files, you'd include those as usual in your files, then link against the libraries. Generally speaking, the .so libraries have a "short" name, like libqt, or libgnome, for example. To link your code against libgnome, using gcc, you'd add the flag...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.