Jump to content

requinix

Administrators
  • Posts

    15,066
  • Joined

  • Last visited

  • Days Won

    414

Everything posted by requinix

  1. That answer also got shut down I gave up and found the answer somewhere else and there is no trickery in the question after all. Nested hints:
  2. ^ That. Once you submit your post, the forum will do a little light processing on it, and that will screw around with whitespace. Those Code blocks also provide some simple syntax highlighting, provided you pick the right language, so please do use them.
  3. Nope, a decimal point counts as an operator (apparently). Supposedly it really is just the problem at face value: those four numbers, each used once, and as many add/subtract/multiply/divide operations (and parentheses) as you want. The way that latter point is phrased is unusual. "Unlimited supply", but you'd only ever need three... So you'd think there's a trick there, but it specifically states you have to use them as binary operators.
  4. Could swear I had a book with these sorts of puzzles but I can't find it. So I'm looking through the internet for a good source to post - not original, but it is something - and I find this one: I can't solve it. Even ran a quick script to try every possible combination of ((# _ #) _ #) _ # and nothing works. So I'm figuring there must be some trick in the phrasing, except I'm not seeing a loophole in there: "each number exactly once" using the "binary operations" of "addition, subtraction, multiplication, and division". (And in fact, creating operators like negation and exponent still isn't enough to get a solution.) Non-answer: if the goal is to be legally an adult then coming up with 22 would be fine too.
  5. If you're not running this in Docker, or perhaps even if you are, it sounds like your database configuration wasn't set up properly. Check the hostname you have it using.
  6. Is that missing one? The version I know has 11 "had"s. Though 10 works too, it's just changing which boy was correct. There's also the classic "buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo" (needs punctuation and capitalization), but that can totally be stretched out further - like pretty easily to "buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo". I should go looking for some puzzles too...
  7. That wasn't the answer? No way, that totally was the answer Then I'm thinking 11 twigs.
  8. Speaking of thinking outside the box,
  9. I love shortcuts too but damn, that one is just plain annoying 😆 Ah, I envy that ability to think outside the box...
  10. Yay added the spoiler button. Been a long time since I've done integrals, so I first tried the brute-force solution to make sure I had the right answer. With that out of the way, the integral. It's actually much easier regarding the sheer math work, but requires a little more thinking to get it. That's more interesting math than I've ever had to do as a (web) developer. Actually, with maybe one exception... but I don't remember quite what it was so whatever.
  11. Alright, this one took me a while to remember how to do. It's part of a class of problems of manipulating one number's digits to come up with another number, and the work to solve it tends to have a common pattern.
  12. I know that 17 is going to be important, but my brain blew up before I could get further. Not really seeing any shortcuts that could help... I'm thinking it's a big number.
  13. requinix

    Anti XSS

    What "fallback"? It doesn't make sense to have a "fallback". What you're doing is altering the data being passed to your script. You're saying "yes, you did type one thing, but I'm going to change it and pretend you typed something else". There are two basic parts to things like HTML and SQL and JSON and the like: you have the bits with values that you want to fill in (data), and you have the bits that are not data but fundamentally define how the HTML/SQL/JSON works (structure). Sanitization is about making sure that the data stays "data" and never crosses over into "structure".
  14. requinix

    Anti XSS

    1. Never modify $_GET and $_POST. 2. Never sanitize values ahead of time. 3. Always work with pure, unaltered values, and reserve sanitizing values until the very last step according to what you're doing with those values. So yes, there is a problem with that there. Don't do it. You should only ever be doing two(ish) things: use prepared statements for your SQL, and use htmlspecialchars when outputting an unknown value into HTML. More than that is probably wrong and going to create problems for yourself in the present and/or future.
  15. You want to encrypt a stream using functionality that encrypts files? That doesn't sound right... "No such file or directory" sounds relevant. Does the $messageData file exist, and is it readable by PHP? Does the $encryptedMessage file exist, or at least its parent directory, and is it writable by PHP?
  16. That response doesn't look like the data you need. In the earlier code, you had three arrays: one of Region, one of McTotal, and one of McAssigned. Now you have one single array with all of the Branch (not Region?), McTotal, and McAssigned values. If you make your PHP return the three arrays separately from each other (such as in an object) then your Javascript can take the three arrays and use them with the graph.
  17. What part are you having a problem with? Is it the Javascript? Can you change your Javascript so that the graph can update when one of those variables changes? Make a function to do this, make its arguments be those three values, then call that function when the page loads. Is it the PHP? Can you change the code so that it filters in the way you want, getting whatever values it needs to do so from $_POST?
  18. You're throwing a lot of CSS at this problem. If you have a problem, adding more CSS rarely ever makes things any better. Rethink how your different blocks of content are arranged. If you want the border to span the width of the input as well as the button, don't put the border on the container. If you want the button to sit next to the input, don't use absolute positioning. If you want a gap between the input and the button, don't add padding to the inside of the input. Learn about margins vs. padding, about inline-block, and if you want bonus points, about flexbox.
  19. I would first check the VS PHP extension to see what support it has; probably not PHP_CodeSniffer, but quite possibly Xdebug. If not then there's a good chance you're out of luck - because nobody uses Visual Studio for PHP. And, frankly, you should take that as a hint, and go for a PHP IDE (like PhpStorm) or switch to VS Code (at least for this). Don't get me wrong, I like Visual Studio. I think it's a great platform. But software development is about using the right tool for the job.
  20. Your command will set the "Content Block" value to a string which happens to contain JSON data. If you want that string value to be interpreted into a JSON value then try CAST-ing it.
  21. Visual Studio or VS Code? Anything you haven't been able to figure out with some searching on your own? Myself, I'm seeing a number of results on how to set both of those IDEs up for PHP development...
  22. Your .swiper-slide is being overridden by the "swiper-bundle" rules. Don't fight the framework. If the swiper wants to have width:100% then put it inside a fixed-width container.
  23. 1. If you use /s for regex delimiters (at the beginning and end) then any /s you want inside the regex have to be escaped. Look at what your original had. 2. What's the rest of the code?
  24. Why would you use Javascript for this? It's okay to have the regex be multiple patterns. You don't, not necessarily, have to use a single capture group to get the one value you care about. youtube.com/shorts/(\w+)|youtube.com/watch\?v=(\w+)|youtu.be/whatever else Only one of $1 or $2 (or what you put in the "whatever else") will ever have a value. And do remember that "." matches anything, so "youtubexcom/short/blah" will match the above too.
×
×
  • 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.