-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Yes, you can 'logically' say it is impossible to know, any of those could happen. However, the odds are overwhelmingly stacked in favor of the widely accepted answer. But that doesn't make it true, that just makes it accepted as true, for 'practicality' sake. Let me give you a hypothetical question, and it's rigged on purpose so don't bother crying foul: Let's say you were standing in line for something. There are say, 1000 people ahead of you. or 1 million. Long fuckin' line, you can't even see the end. Waiting to get on the next roller coaster ride, pay your bill; doesn't matter what it is. You're just standing in line and know people are moving forward occasionally. All of a sudden you see people way ahead of you start to leave. Then the people behind them start walking off, too. More people are walking off. It's taking a while to get anywhere near you, so you have plenty of time to think. At what point in time do you start thinking about all the different reasons people could be leaving? At what point in time do you assume regardless of what happened at the beginning of that line, no point in sticking around, may as well leave, too? Saying "I'm too curious, I'd go see what happened" is not an option. If you find that you can reasonably say that, then restart the scenario in your head, only adding more people. When you get back to the question, if you still find yourself thinking that's a reasonable answer, wash rinse and repeat until you stop thinking that's a reasonable answer. This is the rig, meant to simulate "convenience" and "practicality;" just accept it already and move on. Congrats, welcome to level 2! Now that you have figured out that after seeing X amount of people walk off, you're willing to also walk off, regardless of why, let me ask you this: The "widely accepted" answer is the 'practical' thing to do, but does that make it the truth? You know, looking from the outside-into this thought experiment, that it is not the truth, and yet it is accepted as such. The truth is, you accepted on faith that regardless of whatever the reason people left was, it wasn't worth standing in line for, and followed the masses. You may not know what the truth is; for all you know the ride could have broken. Store could have been closed. Company could have started offering waivers on your bill if you jerk them off. Who knows? You can't prove what the truth is, but how is what you opted to do any better? I maintain that in fact, it is worse, but I'm fine with you at least accepting it is not any better, because now you understand that it is not the truth, nor can you prove it. Faith is believing in something without seeing. Everybody has faith in something. Writing it off as 'widely accepted' or 'practical' does not make it remove the element of faith.
-
At no point do you have to accept it as truth, because it cannot be proven. Realistically, at the end of the day, even though it cannot be proven, you say fuck it and accept it as truth...which sounds suspiciously like faith. So if you believe anything that's faith? I have faith echo "Hello World"; will output Hello World Actually, yes. Can you honestly say you know every single thing at work and involved and working together to do something as simple as even that? Or do you, like everybody else, just take for granted and not even think about all those abstracted layers of software and then hardware are doing what they are 'supposed' to be doing, and then throwing into the mix some random other thing doesn't somehow interfere.
-
At no point do you have to accept it as truth, because it cannot be proven. Realistically, at the end of the day, even though it cannot be proven, you say fuck it and accept it as truth...which sounds suspiciously like faith. Now you're just being biased. If anything, religion is stereotyped for interpreting things differently as the situation suits them.
-
there is proof that it works. there is no proof on HOW it works.
-
It's easy to defy gravity. Just learn to throw yourself at the ground and miss.
-
hmm okay how about using base64_decode before trying to use file_put_contents.
-
so like, I could be wrong, but I think you need to save it in binary mode/format, and file_put_contents doesn't do that unless you have php6. What is this $attachment_raw coming from? A file uploaded from a form? think you should be using something like move_uploaded_file insted of file_put_contents. Is it an image resource? You would save it with imagejpeg
-
it happens. One thing I wasn't 100% clear on though. You said "require 4 digits" do you mean a minimum of 4 of any of those specified things (alphanumeric underscore or dot), or do you mean that out of 20 of those things, at least 4 of them have to be a digit as in a number (0-9)?
-
at best, regex sucks at nested tags (or nested anything for that matter), use DOM
-
preg_match('~^[a-z0-9_.]{4,20}$~i',$subject)
-
you have a " in your $pattern that does not look like it's in your $data
-
so...it looks like you still didn't escape it. Alternatively, you can use a different delimiter than /
-
you don't need those first 4 \d's since your pattern is expecting the 2 \d's after the 20. $input = preg_replace("~/20(\d\d)~", "/19$1", $input);
-
the dot normally does not match \n so it is not necessary to have all that extra junk in there.
-
[SOLVED] remove [square brackets and contents] from string
.josh replied to andyd34's topic in Regex Help
also, I didn't suggest anything...I actually pointed out how someone's regex was flawed. You really should take the time to read stuff...I'm sure you are quite lovable, but stuff like this makes me think you should be gob smacked. -
[SOLVED] remove [square brackets and contents] from string
.josh replied to andyd34's topic in Regex Help
so I guess all the other people before you who already gave a viable solution don't count? IT'S ALL ABOUT YOU, ISN'T IT -
preg_match('~^Subject: (.*)~',$content,$match); print_r($match); edit: that assumes that there is also a \n before "Subject: ..." you may need to remove that ^
-
anyways, where is this array of dates coming from? From a db? How about doing the math in the query instead?
-
Alternate way to do it. Dunno which is better per se... $mondays = array( strtotime("October 12, 2009"), strtotime("October 19, 2009"), strtotime("October 26, 2009"), strtotime("November 2, 2009"), strtotime("November 9, 2009"), strtotime("November 16, 2009") ); $t = time(); $mondays[] = $t; sort($mondays); $k = array_search($t); echo $mondays[$k+1];
-
okay, assuming that your form elements are called 'day' 'month' and 'year' and you're submitting via POST method, it should look like this: $dd = $_POST['day']; $mm = $_POST['month']; $yyyy = $_POST['year']; $datestring = $yyyy . "-" . $mm . "-" .$dd; $dob = mysql_real_escape_string(stripslashes($datestring));
-
I'm not going to write code for you but the key ingredient is javascript's "window.open"
-
well you can use dd-mm-yyyy in your php. You can display it to the user like that just fine. You just have to go through the extra step of converting it back and forth.
-
php cannot do that. You would need a client-side language like javascript to do that.