
Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
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.
-
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.
-
No, an IP address is one 32-bit unsigned integer. The dotted notation is for humans, not computers. So to get a random IP address you just generate a random number lower than 4294967296 and convert it to dotted format.
-
if you ran it...then where's the code the author wont let me post it neither tell me how he did, so i just took a quick screenshot ^^, wishing anyone could suggest how'd it could be done There is a program in my textbook that I don't understand how works. Can you tell me how it works? I won't show you the source code, but surely you can tell me how it works, right?
-
What do you mean with "looks like ASCII"? ASCII is just a character set.
-
[SOLVED] Parent Variable as Default Parameter
Daniel0 replied to seventheyejosh's topic in Application Design
You can only specify a constant value as default for an argument. -
When finding a duplicate, just subtract 1 from $i and move on. That'll give you the required number of random integers.
-
You can do it in a much more clever way: <?php $wStatuses = array( array('min' => 0, 'title' => 'Very poor'), array('min' => 100000, 'title' => 'Poor'), array('min' => 350000, 'title' => 'Worker'), // etc. ); $money = 105032; $i = 0; $next = 1; while (isset($wStatuses[$next]) && $wStatuses[$next]['min'] < $money) { $i = $next++; } echo 'Having ' . $money . ' money, your wealth status is: ' . $wStatuses[$i]['title']; This makes it much easier adding additional wealth statuses.
-
That's not an equation. Just saying.
-
What do you hope to achieve by reporting my post? Not to be a smart ass, but I can read all reports, and I'm highest authority around here. I think you've missed the point with getting help for free online. People will help you if they want to and when they want to. If nobody wants to help you, you just won't get help. If you want to increase the chances of getting help you just need to make sure that you are presenting a problem that is interesting enough for other people to bother using their own time on helping you for free. The fact that you are even whining about not getting any responses just shows that you are disrespecting people who potentially would help you. You aren't any more important that other people. You asked a question, and I answered it. My answer was based on why I myself wouldn't answer a topic.