Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
He'll also require a lot of storage and/or RAM.
-
Mark, he is not after the solutions/roots to a quadratic equation, but the extremum. They're not at all the same.
-
If you just want to be able to scroll you can set overflow:auto; and some sort of (max-)width/height.
-
If it's always a quadratic equation, you can just hard code the derivative. If you have [imath]y = ax^2+bx+c[/imath] then [imath]\frac{dy}{dx} = 2ax+b[/imath]. So [imath]2ax+b=0 \Rightarrow x = \frac{-b}{2a}[/imath]. Thus the extremum of any quadratic equation is given by [imath]\frac{-b}{2a}[/imath].
-
Reminds me of one of the examples in one of my text books. infix 6 ++ --; infix 7 ** //; datatype fexpr = Const of real | X | ++ of fexpr * fexpr | -- of fexpr * fexpr | ** of fexpr * fexpr | // of fexpr * fexpr | Sin of fexpr | Cos of fexpr | Ln of fexpr | Exp of fexpr; fun D(Const _) = Const 0.0 | D X = Const 1.0 | D(Const y ** f) = Const y ** D f | D(f1 ++ f2) = D f1 ++ D f2 | D(f1 -- f2) = D f1 -- D f2 | D(f1 ** f2) = D f1 ** f2 ++ f1 ** D f2 | D(f1 ++ f2) = (D f1 ** f2 -- f1 ** D f2) // (f2 ** f2) | D(Sin f) = Cos f ** D f | D(Cos f) = ((Const ~1.0) ** Sin f) ** D f | D(Exp f) = Exp f ** D f; Even though it's fairly limited it actually goes a long way. You could port that to PHP and extend it to support differentiation of many more functions, but the implementation would be a lot more clumsy because PHP doesn't have the kind of pattern matching that some functional programming languages do.
-
I was just talking about his usage of the word ignorant. He was ignorant in the sense that he lacked knowledge about the meaning of the word "ignorant".
-
No, that's being obstinate. Ignorance is simply lacking knowledge about something. Incidentally, you are being ignorant right now.
-
[SOLVED] proper usage of spl_autoload_extensions ???
Daniel0 replied to alexweber15's topic in PHP Coding Help
-
[SOLVED] proper usage of spl_autoload_extensions ???
Daniel0 replied to alexweber15's topic in PHP Coding Help
If you make your own autoloading function, there will not be used any fallback. -
If it's on a gTLD you might be able to try your luck with ICANN if you can prove you've given them money for the domain name.
-
I want to beable to use a Session expires in 20 Seconds possible?
Daniel0 replied to Gayner's topic in PHP Coding Help
session_set_cookie_params -
<?php if (!empty($_SERVER['PATH_INFO'])) { header('HTTP/1.1 404 Not Found'); die('gtfo'); }
-
Use sshfs.
-
I tried it out back when it was in a closed beta. It was just annoying most of the time.
-
http://en.wikipedia.org/wiki/IPv6
-
It will undoubtedly slow down his web pages if he has to wait for the response of an external third party each time.
-
Tell your server admin to install an NTP client and adjust the time zone manually in PHP as described in this tutorial: http://www.phpfreaks.com/tutorial/working-with-dates-in-php
-
Win7 is already RTM. I'm running it right now (not a pirated one, mind you).
-
Someone knocked you out and built a house with no windows and doors around you. Simple.
-
User rankings / ratings for Solved topics
Daniel0 replied to gr1zzly's topic in PHPFreaks.com Website Feedback
Not without editing the source files. They're just ordered alphabetically. -
User rankings / ratings for Solved topics
Daniel0 replied to gr1zzly's topic in PHPFreaks.com Website Feedback
yeah that did kinda always bug me a little, never got around to mentioning it though....kudos to nrg for reading my mind It does for admins, so I never realized it didn't. It only shows groups that have a different color. -
User rankings / ratings for Solved topics
Daniel0 replied to gr1zzly's topic in PHPFreaks.com Website Feedback
I just realised it's missing the 'staff alumni' category (unless that has been deliberately left out for some reason or another). Should display now. -
Updated to use jsMath. See first post for more info.
-
Uh... I never liked statistics and probability much. The calculations are often annoying to make, and it's easy making mistakes. Anyways, if we let [imath]E_n[/imath] be the event that letter [imath]n[/imath] is in the correct envelope and we just consider having 3 envelopes (because I don't want to write this for 50 or one million), then [imath]P(E_1)=\frac{1}{3}[/imath] and [imath]P(E_1 \cap E_2) = \frac{1}{3}\cdot\frac{1}{2}[/imath], right? It is common to imagine the probability space as a set [imath]U[/imath] having cardinality 1, so [imath]\forall E_i \in U:0\leq|E_i|\leq1[/imath]. We say that the probability of an event occurring is the cardinality of the corresponding set. Note that you normally do not talk about sets that have a cardinality that's not a natural number because it normally not makes sense to say that a set has e.g. 0.42 elements. Iff two sets [imath]A[/imath] and [imath]B[/imath] are disjoint, the cardinality of their union will be the sum of each set's cardinality, i.e. [imath]A\cap B = \emptyset \Leftrightarrow |A\cup B|=|A|+|B|[/imath]. In probability terms, two disjoint sets correspond to two events that cannot possibly occur at the same time, and the union of two sets corresponds to the probability that both events will occur. In our case, it is indeed possible that two or more of our events can occur at the same time, so they're not disjoint. To find the cardinality of two non-disjoint sets [imath]A[/imath] and [imath]B[/imath] you do like before, but you have to remove the common elements (the intersection) to prevent double counting (you can draw a Venn diagram to see that this is true). So [imath]|A\cup B| = |A|+|B| - |A \cap B|[/imath]. This holds generally because if two sets are disjoint, their intersection will be empty (thus having cardinality 0). So this means, [imath]P(A \cup B) = P(A) + P(B) - P(A\cap B)[/imath] for some events [imath]A,B\in U[/imath]. Note that the union corresponds to "or" and the intersection corresponds to "and". For [imath]n=3[/imath] envelopes, we can then calculate [imath]P(E_1 \cup E_2 \cup E_3)[/imath], the probability that at least one of the letters are in the right envelope. [math]\begin{split} P(E_1 \cup E_2 \cup E_3) &= P(E_1) + P(E_2) + P(E_3) - P(E_1 \cap E_2) - P(E_1 \cap E_3) - P(E_2 \cap E_3) + P(E_1 \cap E_2 \cap E_3) \\ &= 1 - 3\left(\frac{1}{3}\cdot\frac{1}{2}\right) + \frac{1}{3}\cdot\frac{1}{2}\cdot\frac{1}{1} \\ &= \frac{2}{3} \\ &\approx 0.667 \end{split}[/math] This is pretty close to your 0.632 for n=50. My guess is that the probability converges towards that number as n goes to infinity (or I made an error during my calculations). Note to self: Need to install jsMath for better LaTeX support on the forums. Edit: Installed jsMath and updated post to use it.
-
As long as they're the largest browser, they have no reason to care . Yes they do. Their market share is in a decline.