-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
You can QA on your end to make sure you got things right, but then you can QA with them to make sure everything is set up right on their end. Maybe there are account settings that need to change, or options to enable, or stuff like that. And yes, you may need to help them do it, but make sure that ultimately they are the ones agreeing to the terms and conditions and whatnot. Developer accounts tend to have different agreements than production accounts: you'd probably use the former while they'd use the latter. If they're not so familiar with this then you can hold their hand through it. Sit down with them as they sign up for the keys and explain to them the things that they might not understand. Once that's done you can use their keys to do the final testing, after which it should all be ready to go. (Or maybe this all happens earlier on and you use the keys when you're comfortable enough to switch from yours.)
-
Always Getting Unexpect ';', Expecting T_Function
requinix replied to ViewFromTheBox's topic in PHP Coding Help
And at the end of a function definition it goes back into the class definition. And like you said, Summarized the code is /* comment */ add_action(); class sports_category { function sports_category() { } function widget() { ?> html } ?> html function form() { } function update() { } ?> html } ?> -
Not off the top of my head. Can you narrow it down to a specific problem? Also enable display_errors=on and set error_reporting=-1 and look for error messages.
-
You agree to it for your own keys, they agree to it for their own keys. The two sets are completely separate. Don't give them your keys, but if they chose to give you theirs then that's their choice.
-
Uh yes, it is less likely. After pulling a non-5 there is a 4/51 chance of getting one, but after pulling a 5 there is a 3/51 chance. No? 5, 5, 5, 5: 4/52 * 3/51 * 2/50 * 1/49 = 0.0000369% all unique: 4/52 * 4/51 * 4/50 * 4/49 = 0.00394% What you say is true only if you pull a card, put it back, shuffle, and pull again.
-
Like I said, timestamps have nothing to do with timezones. It's the same number everywhere. Like right now it's 1339523573 (give or take) regardless of where you are. That corresponds to 10:52am PDT and 1:52pm EDT. Let me be even more explicit: printf("Timezone: %s\n", date_default_timezone_get()); printf("Unix timestamp: %u\n", time()); printf("Time: %s\n", date("Y-m-d H:i:s")); printf("\n"); date_default_timezone_set("UTC"); printf("Timezone: %s\n", date_default_timezone_get()); printf("Unix timestamp: %u\n", time()); printf("Time: %s\n", date("Y-m-d H:i:s")); printf("\n"); date_default_timezone_set("Asia/Shanghai"); printf("Timezone: %s\n", date_default_timezone_get()); printf("Unix timestamp: %u\n", time()); printf("Time: %s\n", date("Y-m-d H:i:s")); Timezone: America/Los_Angeles Unix timestamp: 1339523573 Time: 2012-06-12 10:52:53 Timezone: UTC Unix timestamp: 1339523573 Time: 2012-06-12 17:52:53 Timezone: Asia/Shanghai Unix timestamp: 1339523573 Time: 2012-06-13 01:52:53 Your problem is you're using the wrong timezone for something. You should never adjust a time() value to use a different timezone: use date_default_timezone_set() to change the timezone then date() to get a date string. (Or the OOP equivalent.)
-
What you need to do is keep track of the deck. Protip: make your code model your... well, model. $cards = range(1, 52); shuffle($cards); $first_player = $house = array(); $first_player[] = array_shift($cards); $house[] = array_shift($cards); $first_player[] = array_shift($cards); $house[] = array_shift($cards); 1-13 is one suit, 14-26 is another (subtract 13), 27-39 is another (subtract 26), and 40-52 is the last (subtract 39).
-
No. And you shouldn't, because using quotes is what you should be doing. Array keys are integers or strings, and with $a[test] = 1; PHP tries to find a constant "test". Even if it existed that's not what you'd want it to use. Strings have quotes, so if you want a string then use quotes.
-
time() is the number of seconds since the beginning of 1970 local time. As such it is not affected by timezones. What is affected is what you get when you convert that number into a date string. Also, use date_default_timezone_get/set() if you go procedural. function getTimeByZone($zone){ $old = date_default_timezone_get(); date_default_timezone_set($zone); $time = date('r'); date_default_timezone_set($old); return $time; }
-
checkExistence() could be useful somewhere else, but as you said canView() makes calling it redundant.
-
Oops >_> Er, I mean, yeah. I said "like". As in "similar to but not exactly"
-
That's right. @doubledee: Any problems? kicken is totally correct with what he's been saying.
-
A regular (INNER) JOIN requires that both tables have matching values. An OUTER JOIN does not. SELECT... FROM... LEFT OUTER JOIN... LEFT OUTER JOIN... LEFT OUTER JOIN... WHERE... Note that the "OUTER" is optional as long as you use a LEFT or RIGHT.
-
You would do it like I showed in your other thread.
-
You do understand that for every worker you try to read a new line from the file? It's not that you're reading a file and then checking it for all the workers?
-
There's one thing you have to keep in mind with SimpleXML: everything is an object. If you need a string then you should (and sometimes must) cast to a string, like (string)$xml->pix[0]->pic
-
If you want to use jQuery then yes, you need to include the script from somewhere.
-
You don't need that third column. You already know what its values are so there's no point in storing it. It would just mean more data you have to insert and update. SELECT column1, column2, column2 - column1 AS column3, ... Or just do the math in your code. $column3 = $row["column2"] - $row["column1"];
-
highlight_string and non-English characters
requinix replied to The Little Guy's topic in PHP Coding Help
highlight_string() uses the same tokenizing stuff that PHP uses for code. What was the snippet with those comments? -
$(Ajax Help).load(this_topic); // http://www.phpfreaks.com/forums/index.php?topic=360742.0
-
AJAX. Using jQuery you could $("section#content article").load("includes/article1_n2.php"); which would work because apparently your entire article is in just that one .php file.
-
How to order MySQL data from multiple queries?
requinix replied to HDFilmMaker2112's topic in PHP Coding Help
Use one query, not two. With a JOIN. SELECT f.friend_id, su.status_message, su.time_posted, or whatever you want FROM status updates table AS su JOIN friends table AS f ON su.user_id = f.friend_id WHERE f.user_id = current user ORDER BY su.time_posted DESC -
Beginner problem: Trying to file_get_contents of file that force-downloads
requinix replied to yortzec's topic in Regex Help
file_get_contents() is enough. Apparently the sync.in server is refusing your connection to download the file. Or maybe your PHP configuration disallows downloading files but I think you'd get a different error message for that. I just tried echo file_get_contents("http://sync.in/ep/pad/export/c9ppXi1bp7/latest?format=txt"); and it worked for me. -
You can't tell us where the problem is or what function is causing it, and you haven't given us what we need to reproduce the problem on our ends. It should not be surprising that we can't tell you what the solution is.
-
jQuery's click() adds event handlers. Every time you call that you add a new event handler. When onclick happens every one of those will be executed.