Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Uh... use an XML parser to parse XML. Look up what "XML namespaces" is.
  2. You could try clicking on the "Chat" link in the navigation bar.
  3. You just need to make sure it's not parsed to a clickable link. You can put it in [nobbc] or tags to prevent that. Example: http://www.google.com
  4. http://en.wikipedia.org/wiki/Nested_set_model
  5. Yeah, that's why I wanted the URL to his website.
  6. What's your website's URL?
  7. You just need to echo the $res1 variable.
  8. Though untested, this should do it in Θ(n): $res = array(); for ($i = 0, $size = 0, $max = count($lines); $size <= 5000; ++$i) { for ($j = $i; $j < $max; $j += 50) { $res[] = $lines[$j]; ++$size; } }
  9. I still like Notepad though I have always found it to bad Notepad didn't support syntax highlighting, intellisense, and auto-indentiation. How about such a simple thing as being able to figure out that LF is a line break? It's the only editor I've ever known that doesn't support LF style line breaks.
  10. I'm slightly impressed with how you're as familiar with oni-kun's history here because 1) you're a fairly new member, 2) oni-kun's account history (warnings, bans, etc.) isn't public. oni-kun is constantly trolling. A while ago he was banned. He started whining and his ban was lifted after a month. Soon after he started again and was given a final warning. He still continued and yesterday happened to be the day when he was banned. So no, he was not just banned for this topic. Besides, like it or not, "free speech" doesn't apply here. Free speech only prevents your government from passing censorship laws. If you visit someone and keep acting like a douche, they can tell you to leave their house/apartment. If you visit someone's website and keep acting like a douche, they can tell you to leave the website. In both cases they can force you to do it as well.
  11. Furthermore, strip_tags will have no effect after htmlentities has been used on the string. Not that a MySQL database is vulnerable to anything HTML related though.
  12. How does reading the fucking manual have anything to do with being male or female?
  13. No, it would be pretty fucked up if Comcast tried changing the internet protocol.
  14. Because he got promoted.
  15. "Don't try to argue with idiots. They'll bring you down to their level and beat you with experience." -- Someone whose name I can't be bothered to look up.
  16. Right, as I said, you need to use "Remove Topic" to remove a topic. The "[X] Remove" thing is for removing posts. SMF allows you to remove a topic that way iff it's the only post in the topic. That's how SMF designed it to work for some reason.
  17. Which button are you using when you're trying to delete it from within the thread? The one with the red X or the one on the bottom where "Mark Solved" also is? Use the one on the bottom.
  18. The fact that many people often have difficulty finding one would indicate otherwise.
  19. Are you familiar with the saying "you get what you pay for"?
  20. coder, programmer (n): an organism that can turn caffeine into code. I guess I'm no coder/programmer then
  21. You could read the changelog. http://php.net/changelog
  22. Here is my take on a very simple one: <?php function math_rpn($expr) { $stack = array(); $getOps = function() use (&$stack) { if (count($stack) < 2) { throw new Exception('Invalid expression: not enough elements on stack'); } $op2 = array_pop($stack); $op1 = array_pop($stack); return array($op1, $op2); }; $tok = strtok($expr, ' '); do { switch ($tok) { case '+': array_push($stack, array_sum($getOps())); break; case '-': list($op1, $op2) = $getOps(); array_push($stack, $op1 - $op2); break; case '*': list($op1, $op2) = $getOps(); array_push($stack, $op1 * $op2); break; case '/': list($op1, $op2) = $getOps(); array_push($stack, $op1 / $op2); break; case '^': list($op1, $op2) = $getOps(); array_push($stack, pow($op1, $op2)); break; default: array_push($stack, $tok); break; } } while ($tok = strtok(' ')); if (count($stack) !== 1) { throw new Exception('Invalid expression: end stack doesn\'t have exactly one element.'); } return $stack[0]; } echo math_rpn('1 2 + 5 * 2 /');
  23. How do you then handle 354 + 3? Or is it all separated by a space, but having an Assembler background I don't see how that could work as how would I know I had to read 1 byte, 2 bytes, 3 bytes? It's stack based: 354 - adds 354 to the stack 3 - adds 3 to the stack, now it contains: 354 3 + - pops an element from the stack and adds it. the stack now contains 357 If you traverse an abstract syntax tree in pre-order and just output the nodes to the screen instead of doing something with them, you'll get reverse polish notation.
  24. Sorry but, no it isn't. It may be to you, but not in the general sense. It is entirely possible being good at your job without making it your entire life.
×
×
  • 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.