Search:

Type: Posts; User: pppbigppp

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    5,409

    Follow up question: What's the most graceful...

    Follow up question:

    What's the most graceful way to detect broken pipe? Currently, if either the client and the server close() its end of the pipe, select() on the other process will unblock...
  2. Replies
    10
    Views
    5,409

    Oh my, that was it. There is a rouge...

    Oh my, that was it. There is a rouge close(socket) statement in my client socket write routine(left over from the non-persistent connection design). I didn't notice it for so long cause I kept...
  3. Replies
    10
    Views
    5,409

    I didn't do anything special to the socket. By...

    I didn't do anything special to the socket. By default it blocks. The first read() works perfectly fine. I think I know what the problem is, but don't know the solution yet. My guess is that the...
  4. Replies
    10
    Views
    5,409

    I'm trying to read from a socket. ...

    I'm trying to read from a socket.

    READ->DISPLAY;
    KEYBOARD->WRITE(send)

    The problem is that read() blocks the first time, but for some reason it does not block anymore afterward(which is also...
  5. Replies
    10
    Views
    5,409

    I think I got it to work. I'm on linux. I'm...

    I think I got it to work. I'm on linux.

    I'm basically trying to demux socket IO and keyboard IO such that a user can send and receive message at the same time.

    new question:
    Is it possible to...
  6. Replies
    10
    Views
    5,409

    non-blocking keyboard read

    Hi,

    Does anyone know which function/library I should use to be able to read a line of user input without Curse? And once I find this function, the following code structure should be able to pick...
  7. Replies
    5
    Views
    1,372

    Thanks for the reply, here is the bash shell code...

    Thanks for the reply, here is the bash shell code you asked for



    echo "hahaha" > data.dat



    Regarding timeout, amazingly, I came to the same conclusion earlier. Still not sure why alarm()...
  8. Replies
    5
    Views
    1,372

    a side question about read(): Let say I create...

    a side question about read():

    Let say I create a text file containing 6 characters. It seems like when the file is written, it will end up with 7 character. So I guess there is a file delimiter...
  9. Replies
    5
    Views
    1,372

    strange read() problem

    Hi,

    I'm doing some raw socket UDP send and receive. After establishing a UDP "connection" using connect()*, I use read() and write() on the client side to send/receive char data.

    My client code...
  10. Efficient Implemention of Lagrange Quadratic Interpolation?

    Hi,

    So basically, my understanding of lagrange quadratic is this

    a(T) = L0( T )a( T0 ) + L1(T)a(T1) + L2(T)a(T2)

    with L0(T) = ( (T - T1)/(T0 - T1) )( (T - T2)/(T0 - T2))
    etc with L1(T) and...
  11. Replies
    2
    Views
    3,186

    yeah, thanks Still can't make the image to...

    yeah, thanks

    Still can't make the image to look right. Histogram equalization is the closest I got but it stretches the contrast a bit too much. ie. previously black background becomes grayish.
  12. Replies
    2
    Views
    3,186

    C++ image processing

    Hi,

    I'm implementing a laplacian mask image enhancement in Visual studio. I'm using a simple 3x3 mask of -1 -1 -1; -1 9 -1; -1 -1 -1 on some jpg; Applying the mask is easy. But I'm not sure what's...
  13. I agree. I don't like to use hacks on code too....

    I agree. I don't like to use hacks on code too. But I just want to use the simplest ways to solve this problem that I thought was trivial initially (the problem won't occur at all in Java)

    Rest...
  14. Hi, I just gave it a shot and it seems to...

    Hi,

    I just gave it a shot and it seems to work pretty well. Thanks

    The only problem seems to be that I can no longer define a double array like


    int m[][2] = { { 1, 1 }, {1, 1} }
    ...
  15. Thanks for the suggestion. Both methods would...

    Thanks for the suggestion. Both methods would work, but I don't think they are allow in my assignment. The assignment focus is not on C++ language anyways. I'm just trying to find ways to shorten my...
  16. Problem passing double array as a function parameter

    Hi,

    I'm using Visual C++. Let say I want to pass a const NxN matrix to a function, what syntax structure would allow the function to accept multiple value of N?

    Currently, if I want to pass a...
Results 1 to 16 of 16