Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Posts posted by Daniel0

  1. Congratulations. You almost discovered merge sort. If you have two sorted lists, you can combine them to one sorted list in linear time, so there is no need for the sort in #5. With that change you now have merge sort, or more specifically, parallel merge sort which has almost a linear speedup.

     

    With that said, it will be slower and more memory intensive fetching all the values and then sorting them in PHP. Your DBMS already has highly optimized sorting algorithms implemented, and seeing as it has to touch all the resulting rows anyways, it will be faster just doing the sort while it's at it.

  2. ok thanks

    i will continue the short php tags as they are prettier and they work better if they are enabled :)

     

    That's fine. Just remember that you might run into trouble if you're writing code that other people are going to use seeing as they're turned off by default.

  3. I'm looking for some ideas on what to make for my final year degree project, I know there are lots of topics out there like this but I just cant decide,

     

    What degree? What kind of courses have you taken? What have you learned?

  4. SMF is very easy to hook with your current website using the SSI.php file.

     

    I beg to differ. SMF's SSI.php hijacks the sessions, global namespace and the superglobals. You can write your website based on it, but integrating it with something existing would be difficult.

  5. The web server doesn't receive any email. That would be the MTA (mail transfer agent). Many Linux based MTAs use the /etc/aliases file to specify where the emails should be routed to. By default it's a user on the file system, but it's also possible piping it to STDIN on a script.

     

    This line would send email to something@example.com to to the user daniel:

    something: daniel

     

    This line would send email to something@example.com to a script called parse.php:

    something: "| /usr/local/bin/parse.php"

     

    In parse.php you can then use the I/O streams to read the email from STDIN. The input format is the usual email format, i.e. first the headers, then a blank line and then the body. That should be trivial enough to parse.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.