• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About pakloong82

  • Rank
  1. Hi there, I wonder can a php file automatically trigger itself without being called. For example, I reside a php file that do auto backup of the databse in a protected folder and only admin can access it. Now I want that file to automatically trigger itself without the admin calling using browser at a particular time, so is this possible? Thank you in advance.
  2. hi... Is there any java library or source out that enable a java application/servlet to limit or control bandwidth? Thanks
  3. The code not woking, can't get select() to throw write and exception file descriptor...... Thanks
  4. well, the problem is how to invoke: if(FD_ISSET(listener, &write_fds)) { //do write stuff here } if(FD_ISSET(listener, &except_fds)) { //do exception stuff here } the 2 codition 1)if(FD_ISSET(listener, &write_fds)) 2)if(FD_ISSET(listener, &except_fds)) how do we execute both of them? cause I need to test the statement is working or not... Thanks
  5. for(;;) { read_fds = master; // copy it if (select(fdmax+1, &read_fds, &write_fds, NULL, NULL) == -1) { perror("select"); exit(1); } if(FD_ISSET(listener, &write_fds)) { printf("write\n"); } if(FD_ISSET(listener, &except_fds)) { printf("Exception occur\n"); } } ok... the code above should work? Thanks
  6. code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #define PORT 9034 // port we're listening on int main(void) { fd_set master; // master file descriptor list fd_set read_fds; // temp file descriptor list for select() fd_set write_fds; fd_set except_fds; struct sockaddr_in myaddr; // server address struct sockaddr_in remoteaddr; // client address int fdmax; // maximum file descriptor number int listener; // listening socket descriptor int newfd; // newly accept()ed socket descriptor char buf[256]; // buffer for client data int nbytes; int yes=1; // for setsockopt() SO_REUSEADDR, below socklen_t addrlen; int i, j; FD_ZERO(&master); // clear the master and temp sets FD_ZERO(&read_fds); FD_ZERO(&write_fds); FD_ZERO(&except_fds); // get the listener if ((listener = socket(PF_INET, SOCK_STREAM, 0)) == -1) { perror("socket"); exit(1); } // lose the pesky "address already in use" error message if (setsockopt(listener, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) { perror("setsockopt"); exit(1); } // bind myaddr.sin_family = AF_INET; myaddr.sin_addr.s_addr = INADDR_ANY; myaddr.sin_port = htons(PORT); memset(&(myaddr.sin_zero), '\0', 8); if (bind(listener, (struct sockaddr *)&myaddr, sizeof(myaddr)) == -1) { perror("bind"); exit(1); } // listen if (listen(listener, 10) == -1) { perror("listen"); exit(1); } FD_SET(listener, &master); fdmax = listener; // so far, it's this one // main loop for(;;) { read_fds = master; // copy it if (select(fdmax+1, NULL, &write_fds,&except_fds, NULL) == -1) { //perror("select"); exit(1); } for(i = 0; i <= fdmax; i++) { if(FD_ISSET(i, &write_fds)) { printf("write\n"); } if(FD_ISSET(i, &except_fds) { printf("Exception occur\n"); } } } return 0; } well the code i provide simply not working...... can't get it to invoke write and exception.... Thanks [Edited by - pakloong82 on June 22, 2006 1:16:20 PM]
  7. hi... can anyone provide some tutorial about how to utilize fds_write and fds_exception in selec()..... most of the tutorial that I had read only utilize fds_read, so I need tutorial on how to use fds_write and fds_exception in select()... Thanks
  8. hi there, I wonder does anyone know any open source or tutorial that teach us to built our own 3D software render engine or API by using Java? Thanks you in advance.
  9. OpenGL THE question : opengl or glut

    for learning at the first place use GLUT then pure WIN API + OGL then lastly use SDL + OGL
  10. java package errors

    have you set the class path yet?
  11. 3D Body Deformation

    Quote:Original post by Unrealizer What kind of information do you need, Formulas? Ya i need both formulas.... and some examples of it if can..... btw Thanks You all for the replies.....
  12. 3D Body Deformation

    hi there, I wonder where can i find information on Deformation on Human body such as 'when a shotgun shot at a person body at close range, of course we can see limbs or part of its body being torn off (something like zombie body physic)'...... so any idead? Thanks You in advance. :)
  13. C++ header files

    Quote:Original post by Subncho I wonder the difference between Class and Struct? When use struct and class? in C we refer Struct as Class, while in C++ we refer Class as Struct
  14. C++ help

    Quote: the number. and the average is something like this: -8.33037e+061 this problem usually being encounter if you don't intialise your array double to something...... try the code below //for the double type donation array //this code works for VS C++.Net 2002 edition and above for(int a = 0; a < Arsize; a++) { donation[a] = 0.0; //or just 0 }