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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by lgang

  1. lgang

    Help in finding an implementation (algorith or code) of Chebyshev

    Check the book, "Recipe in C", I remember I have read it somewhere. Or check books in digital signal processing area. Cheb Polynomial is also covered. I am not sure what you are looking for. Repost it if you like.
  2. lgang

    Help with fork() function !!

    Now it is clear the problem is signals interrupt system calls. Many ways to work it out, to restart it after signal interruption, or use sigaction.sa_flags as SA_RESTART. As for input/output buffering, I believe both can be buffered. Unless you specify it using setvbuf(.), the default input...
  3. lgang

    Removing files and/or directories

    Your code is a little ugly ;) 1. you can use access() to check file or dirctory exists or not. actually rmdir() fails if the directory is not empty. 2. you can fork(), then exec() any program you like, From fork() you can get pid. system() is much slower.
  4. lgang

    input, output iterators help needed SOS

    Thanks a million. First it gives the result as I suggested. You can try it yourself if you don't believe it. I am not complaining the code does not work, I am just curious how the code generates this funny results. Acutally somebody asked me this question and I can not figure it out why...
  5. lgang

    input, output iterators help needed SOS

    Forgive me, the 2nd line should be read as istream_iterator<int, ptrdiff_t> s(ifile); //r should be s. You did not get my point. What I am asking is how r and s are operated. If the ptr r incremented, why s is also incremented? ++r; ++s; //why now r points to 2? I assumed it should be 0...
  6. lgang

    input, output iterators help needed SOS

    Hi buddies, I don't know how to understand the input and output iterators are based on _single pass_ algo. Here is the code: ifstream ifile(&quot;0123.txt&quot;); //file content is 0 1 2 3 istream_iterator<int, ptrdiff_t> r(ifile); istream_iterator<int, ptrdiff_t> r(ifile); ++r; ++s...
  7. lgang

    PHP and C mix programming

    How can I call a C function in a PHP script? I heard on windows there is an interface so that you can call win32 functions, is there a correpsonding way on Unices (solaris, linux for example)? BTW, what is the most popular php debugging tools? Thanks a billion

Part and Inventory Search

Back
Top