Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. degeberg ~ # cat >> test.php <?php while (1) { } ?> degeberg ~ # php test.php& [1] 1990 degeberg ~ # ps -A | grep php 1990 pts/0 00:00:00 php
  2. Works fine for me.
  3. And preferably namespaces without the ugly backslashes
  4. "Free" and Microsoft. There is something else to it...
  5. Then don't play in a casino but play in e.g. poker tournaments either online or live.
  6. Can't you just write "N/A" or whatever?
  7. There you see. It wasn't so difficult
  8. I was serious. I heard about a such tool once. Humans would review messages and rate them. Using artificial intelligence the system would learn to spot stupidity based on some sort of patterns.
  9. A lot of stupid posts are made on forums. You could create a system that learns to recognize stupidity and tells people to rethink their post.
  10. Daniel0

    Gallery

    I've heard good things about Gallery, but I haven't personally used it.
  11. If that's the case then you have not yet fully grasped what OO is about
  12. http://www.phpfreaks.com/tutorial/preventing-remote-file-include-attacks-with-mod-rewrite
  13. Daniel0

    Porn Site

    Insofar no adult material is posted here nor links to pages containing it there shouldn't be any problems.
  14. I wouldn't know how to do that. I can do it in hand, but I wouldn't know how to put it into code. I tried it last night, not fully tested but for my simple tests it worked. Right now it is just a function, but yea. <?php function solve_quadratic($a, $b, $c) { if ((2 * $a) == 0) { $x[0] = "Cannot divide by 0, this is impossible to do."; return $x; } $x[0] = ((($b * -1) + sqrt((pow($b, 2) - (4 * $a * $c)))) / (2 * $a)); $x[1] = ((($b * -1) - sqrt((pow($b, 2) - (4 * $a * $c)))) / (2 * $a)); if ($x[0] == "NAN" || $x[1] == "NAN") { $x[0] = "This quadratic is not solveable."; unset($x[1]); return $x; }else { $x[2] = ($b * -1) . " +/- SquareRoot (" . $b . "^2 - 4*$a*$c) / 2 * $a"; $x[3] = ($b * -1) . " +/- SquareRoot (" . pow($b, 2) . " + " . (4 * $a * $c) . ") / " . (2 * $a); $x[4] = ($b * -1) . " +/- SquareRoot (" . (pow($b, 2) + (4 * $a * $c)) . ") / " . (2 * $a); $x[5] = ($b * -1) . " +/- " . sqrt(pow($b, 2) - (4 * $a * $c)) . " / " . (2 * $a); $x[6] = ($b * -1) . " + " . sqrt(pow($b, 2) - (4 * $a * $c)) . " / " . (2 * $a); $x[7] = ($b * -1) . " - " . sqrt(pow($b, 2) - (4 * $a * $c)) . " / " . (2 * $a); $x[8] = ($b * -1) + sqrt(pow($b, 2) - (4 * $a * $c)) . " / 2 = " . (($b * -1) + sqrt(pow($b, 2) - (4 * $a * $c))) / 2; $x[9] = ($b * -1) - sqrt(pow($b, 2) - (4 * $a * $c)) . " / 2 = " . (($b * -1) - sqrt(pow($b, 2) - (4 * $a * $c))) / 2; } return $x; } echo "<pre>"; print_r(solve_quadratic(1, 3, -4)); echo "<br />"; ?> lol I was pretty bored yestarday, day off for Veterans Day. Oh, yeah if you already know what a, b, and c are then it's fairly easy, but take an equation like this: (25*46x)(13*(-13x)) = -32 That's a quadratic equation, but how would you solve it using PHP? The answer is (rounded to 3 decimals): x = -0.013 or x = 0.013
  15. I wouldn't know how to do that. I can do it in hand, but I wouldn't know how to put it into code.
  16. Sounds like the competitions we once used to have. It was dropped due to lack of interest.
  17. You could take a look at Zend_Pdf.
  18. No, you can check it in your php.ini file what it's set to and you can change it there (you'll have to restart the webserver when you've done that). Alternatively you can add these lines to the top of the script you want to change it in: error_reporting(E_ALL); ini_set('display_errors', true);
  19. There can be lots of reasons for that. Make sure you set error_reporting to E_ALL and display_errors to On to check that.
  20. My suggestion is to switch provider (I suppose you mean web host?). If they haven't updated to PHP 5.2+ by now then they're not worth dealing with in my opinion. The difference between PHP4's and PHP5's object model is vastly different and it'll likely be really difficult if not impossible to downgrade your scripts.
  21. I'll sticky this for further reference and in case other people might know books that people might find useful.
  22. I can't remember when I've last used FTP. I always use SSH, SCP and SVN.
  23. I've read some of SitePoint's Simply JavaScript. At the time I read it I found it pretty good.
  24. [quote author=lukkyjay link=topic=119433.msg728404#msg728404 date=1193718287] I'm just now starting to learn php for a project on my own site.  I don't understand how a WYSIWYG would work with php, but that would be awesome if it were actually possible.  Can you get specific about the best WYSIWYG for a beginner? [/quote] WYSIWYG is for HTML only. Best is a matter of personal preference and hence the reason why this and [url=http://www.phpfreaks.com/forums/index.php/topic,54859.0.html]this[/url] topic are created.
×
×
  • 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.