Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. You can try to prove that P = NP and compete with Deolalikar who is trying to prove that P != NP
  2. Let [imath]x[/imath] be the number of times it should be executed per day. Then the script will run every [imath]S=\frac{x}{86400}[/imath] seconds. Now let [imath]s[/imath] be the number of seconds that have passed that day. Then there will be [imath]\lceil \frac{86400 - s}{S} \rceil[/imath] times left that day.
  3. Of course. It's still a benefit even if it's morally questionable. I never said I condoned any such behavior though.
  4. 1) Makes it harder for spammers. 2) You have a way of contacting them. 3) You can use it when they need to reset their password. 4) You can sell it to spammers for $$$.
  5. If you're using PHP 5.3: $timestamp = new DateTime('05:00'); $diff = $timestamp->diff(new DateTime()); echo $diff->format('%h hours, %i minutes'); See: http://php.net/datetime.diff http://php.net/dateinterval.format
  6. This topic has been moved to Staff Cafe. http://www.phpfreaks.com/forums/index.php?topic=307240.0
  7. Google decides entirely for itself which links it will display there based on what it finds most important/relevant.
  8. 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.
  9. Have you considered it might be a good idea looking at the error message you get from PDO instead of throwing it away?
  10. On GET/POST data, PHP considers things in [] to be array indices.
  11. 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.
  12. Are you seriously calling those "cool features"? It's just marketing BS. If you're the only user (which you are on a VPS), there is no reason why you shouldn't have those...
  13. Not very much. Most of what is served is text. So far this year we've used about 567 GB on HTTP traffic according to awstats.
  14. I'd go with IP.Board if you're willing to pay. If you're not, then I have no recommendations.
  15. Daniel0

    project

    What degree? What kind of courses have you taken? What have you learned?
  16. 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.
  17. Any reason why a VPS couldn't suit your needs? Linode has got a plan that gives you 1 GB memory and 32 GB disk space for $39.95/month (£25.02).
  18. You'll need a dedicated server or a VPS. No shared host is going configure their web servers to listen on multiple ports for individual customers.
  19. They loaded fine for me before. Now they don't.
  20. Oh come on. We want pictures in this topic
  21. Why are you using number_format() and printf() at the same time?
  22. Why don't you just install a packet sniffer and have a look?
  23. If you have a problem with Pikachu2000, why not take it up with him personally instead of involving the staff?
  24. 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.