Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: StukA
  • Order by date
  1. StukA

    How do I prohibit user from unwanted "USE <db>"?

    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...
  2. StukA

    MTE Emulation Parameters

    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?
  3. StukA

    Program to listen on port...

    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...
  4. StukA

    checking for invalid characters. C++

    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(&quot;datafile.txt&quot;); while (infile){ std::getline(infile, line); while ((pos =...
  5. StukA

    Help with fork() function !!

    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...
  6. StukA

    Thread Synchronization (POSIX and SOLARIS)

    Synchronization methods: semaphores, mutexes, and condition variables. Semaphores: Posix and SysV
  7. StukA

    POSIX communication Mechanisms

    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.
  8. StukA

    PROGRAM DOES NOT SEEM TO RECOGNIZE EQUALITY OPERATOR!PLEASE HELP

    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 << &quot;Equal&quot;; if ((x - y) < -err ) cout << &quot;Y >...
  9. StukA

    c++ / MySQL programming resources

    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...
  10. StukA

    ide's for gcc = recommendations pls

    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...
  11. StukA

    Sockets

    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...
  12. StukA

    vector in C++

    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;
  13. StukA

    Rookie question: string sorting with vectors

    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...
  14. StukA

    DADS Setup Issues

    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!
  15. StukA

    changing pthread attributes

    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.
  16. StukA

    getting mac-address of networkcard

    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...
  17. StukA

    exiting a function

    You might use a temporary variable to hold the input name, and if it's &quot;X&quot;, 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?
  18. StukA

    Implementing Vectors

    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...
  19. StukA

    Need some specific OS method

    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...
  20. StukA

    Using .so ???

    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 &quot;short&quot; name, like libqt, or libgnome, for example. To link your code against libgnome, using gcc, you'd add the flag...

Part and Inventory Search

Back
Top