
Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
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
-
[code] block and tab characters
Daniel0 replied to ddrudik's topic in PHPFreaks.com Website Feedback
Works fine for me. -
And preferably namespaces without the ugly backslashes
-
"Free" and Microsoft. There is something else to it...
-
As being a programmer do you also invest and play with stock Market?
Daniel0 replied to ok's topic in Miscellaneous
Then don't play in a casino but play in e.g. poker tournaments either online or live. -
How do Europeans put thier address into international websites?
Daniel0 replied to tibberous's topic in Miscellaneous
Can't you just write "N/A" or whatever? -
As being a programmer do you also invest and play with stock Market?
Daniel0 replied to ok's topic in Miscellaneous
Oh... you mean like this? -
There you see. It wasn't so difficult
-
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.
-
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.
-
I've heard good things about Gallery, but I haven't personally used it.
-
If that's the case then you have not yet fully grasped what OO is about
-
PHP Code security exploit (PHP injuction) How do I fix this?
Daniel0 replied to drfate's topic in PHP Coding Help
http://www.phpfreaks.com/tutorial/preventing-remote-file-include-attacks-with-mod-rewrite -
Insofar no adult material is posted here nor links to pages containing it there shouldn't be any problems.
-
Suggestion: Daily or Weekly PHP Coding
Daniel0 replied to premiso's topic in PHPFreaks.com Website Feedback
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 -
Suggestion: Daily or Weekly PHP Coding
Daniel0 replied to premiso's topic in PHPFreaks.com Website Feedback
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. -
Suggestion: Daily or Weekly PHP Coding
Daniel0 replied to premiso's topic in PHPFreaks.com Website Feedback
Sounds like the competitions we once used to have. It was dropped due to lack of interest. -
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);
-
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.
-
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.
-
I'll sticky this for further reference and in case other people might know books that people might find useful.
-
I can't remember when I've last used FTP. I always use SSH, SCP and SVN.
-
I've read some of SitePoint's Simply JavaScript. At the time I read it I found it pretty good.
-
[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.