Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Which one? Random? First? First in what order?
  2. Nope, you were clear.
  3. I can give pointers, sure, but I don't know what all you've been taught. Your teacher wouldn't ask you to write a parser unless s/he gave instructions on how to do so. So now, (a) did the teacher tell you how to do it and (b) are you sure you're supposed to?
  4. There are two problems: 1. getElementsByClassName (as well as getElementsByTagName) returns a DOMNodeList, or whatever the name of the interface is. It's more than just an array: it can change as its elements change. When you remove items that are found in that list, they also disappear from the list. As i counts up, the length of the list counts down. 2. "in" is dangerous. It will find everything that's a member of whatever you're trying to traverse. Try console.log()ing or alert()ing i, see what you get. var details = document.getElementsByClassName("details"); // simply going from 0->length wouldn't work as the length changes // going in reverse is a cheap alternative for (var i = details.length; i > 0; i--) { var p = details[0].parentNode; p.removeChild(details[0]); // once removed, [1] becomes [0], [2] becomes [1], etc. }
  5. When you don't want external code to have access to something but might want children to. Like "helper" methods or useful variables.
  6. Yeah... Because you're overwriting the previous value. Right there on the first line.
  7. Assuming that totaltime was previously set, just subtract that value from time(). time() - $_SESSION['Yahtzee']['totaltime']
  8. Yes, but first you should ask your teacher/professor whether the malformed XML was intentional and how you should deal with it. [edit] And whether you're supposed to write your own XML parser or what. I would expect so.
  9. A web-based text editor comes to mind. How? [edit] You might be talking about a kind of site administration thing, but in that case the .htaccess is just a normal file you'd want to edit as your site evolves. We're talking about something that needs the .htaccess to change dynamically and (I assume) automatically for whatever reason.
  10. What errors, if any, does libxml_get_errors return?
  11. ...but there are, like, zero reasons you should ever need to. What are you trying to do?
  12. Check the PHP manual for exactly what the w+ mode means:
  13. I vaguely recall there being problems with PHP, libxml, and filesystem access. Some security settings preventing reading and writing. Are you simply dumping /Schema/Table to a file?
  14. bind_param("$srt.'i'", $par, $c_arr_tags) That first argument is a bit messed up. If $str was empty then you'd be passing literally .'i'
  15. string cmd = string.Format(@"-u{0} -p{1} -h{2} {3}", "root", "password", "localhost", DBName); Those are the arguments you're giving to mysqldump.exe. Modify that so you get the kind of backup you want. mysqldump
  16. Go through the lines in the file and keep track of (=store in an array) the lines you actually want to choose from. Then array_rand() on that.
  17. Try something more like foreach ($array as $key => $value) { if ($value is an array) { $return = recursive search on $value; if ($return means that the search found the value) return $return; } else if ($value matches the search value) { return whatever you want; } }
  18. Well, like I said it's a problem on their server. Contact them and see if they can fix whatever the problem is. Or it could be that a 500 error means there's no location (or something like that) and you should do something different. Or something.
  19. A tags are anchors (and inline). Use a DIV instead (which is block).
  20. A 500 error means a problem on the remote server. Is it your server too or what?
  21. mysqld is the server process: that needs to be running before you can connect to it.
  22. Do you need to specify a "category" in that $arg2?
  23. copy works too.
  24. That syntax is bad, yes. Accessing them in general is fine, but the way to do it is self::$FormatType Yes, PHP is tolerating the code, but somewhere it's creating warning messages (even if you can't see them).
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.