Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. If array_combine is finding that the two arrays ($header and $values) have different lengths then you should troubleshoot for when those two arrays have different lengths. As in if (count($header) != count($values)) { print_r(["headers" => $header, "values" => $values]); }
  2. It no longer exists? I assume it existed when Apache was last restarted?
  3. MySQL is a database, not a programming language. Suck it up.
  4. ...yes? Like I said, the problem was that the regex needs to be a string.
  5. The closest I can come up with after a few minutes of thought is (also) to use regex_replace, but to remove not just lowercase letters but anything that isn't an uppercase letter. That will include punctuation too. It won't handle all city names very well, though. What you really need is a column for the shortened form of the location. The problem with your attempt at it is that the regular expression is a string.
  6. I don't know what you're trying to say so... probably not. Every time a function runs, it has a this. It is not inherited like you think - it's not a variable like that. Instead, what it is depends on how the function is called. It's kinda weird like that. The main function here is the callback for the click event. jQuery is the one calling your function and according to the docs: So it will be the .compare-change button. But only for code written directly inside this callback function. Later when you do the .each, inside that function the this is not inherited. As before, it depends on how the function was called. And as before, jQuery is the one calling your function, so you should consult the docs: Thus inside that function the this will be each element being iterated over.
  7. There's the problem. Your distro manages PHP extensions with the INI files, where opcache is enabled, but there's also a modification to your php.ini to load it again. Open up php.ini and remove the zend_extension line. Then look nearby for other edits that also don't belong in that file.
  8. You mean can you write $(this) like you're already doing in other parts of the code?
  9. By the way, some quick feedback: - Don't use the text of the button to decide what it should do. Use a class. Or a data attribute. - attr(class) gives you the value of that attribute. It does not test for the presence of a class. What if you added another one? Use .hasClass(compare-results) or .is(.compare-results). - $(callerCellRow children, this) is weird. I'm not even sure what jQuery whether would ignore the second argument or transform the first into a selector, but the docs probably answer that.
  10. exit isn't a thing in Javascript. You're killing the event callback by trying to call a function that doesn't exist. It's an error. Use return.
  11. The "normal" and "/ version" are the same thing. Duplicate title tags sounds like it means duplicate <title> tags. Check your HTML markup.
  12. Actually, before that, You're having the problem through Apache but you were looking at the CLI configuration files. You need to look in /etc/php/7.2/apache2 (I think) for the appropriate configuration files. But if you still don't see it there, first grep through /etc/php/7.2/apache2. There should not be many results at all. Look for references to the INI file or the extension's .so. The next place would be /etc/apache2 in case someone put PHP configuration settings in there. After that comes your website's configuration.
  13. By homepage, are you talking about the root of the domain? example.com, and not like example.com/homepage? Technically there is always a trailing slash for domain roots. Because it's not a trailing slash per se but rather a leading slash. And you cannot get rid of a leading slash - example.com and example.com/ are the exact same thing. What exactly is the software saying?
  14. You could try, but that would require extra data to be submitted in the form and that means more room for error. So instead of that, do what I said before: figure out the current list, figure out the new list, and compare the two. You mean if there's a better way than outputting Javascript? Yes.
  15. If you don't want to delete everything and recreate permissions then that means you want to delete the ones you don't want and add the new ones that you do. Right? So do that. Figure out all the pages the user had access to, figure out the pages the user should have access to, figure out what's different between the two, and run the appropriate queries. For the other question, is giving access to everything a common requirement? Then you could set that up as its own thing: the user has a little flag on their account that says they have access to everything. Then modify your permission checking to account for that flag. Another idea is to group pages together and grant/revoke access to the groups. Or you could adopt a sort of tagging system, tagging each page with whatever sounds good, then you grant access based on tags instead of direct pages.
  16. Have you tried grepping for any files that mention opcache?
  17. They're basically the same thing. A constraint exists to enforce some rule on the table, and an index exists to support queries. A unique constraint enforces uniqueness, and the way PostgreSQL implements that is by setting up a unique index. In other words, you just about always want a constraint. Because you want to enforce uniqueness. The index created for you is a bonus.
  18. They could be used that way, but I would not. How are your dependencies set up in code? Are you using relationships? Doctrine should be able to save in the right order but can only do so if it knows about the relationships between all objects. I haven't really used Doctrine myself, but I would expect that you should be able to construct the whole chart hierarchy in code, with objects contained in other objects, and then tell Doctrine to save the whole thing. It would then combine that with its knowledge of your foreign keys to save the the dependencies before whatever is using them.
  19. Clearly you've never had to do that. If they get breached then I'll have to get a new number. But if someone else gets breached then all I have to do is go to the app and disable the card. They don't care who I am. They just bill my credit card. Oh great, so it's an exclusive community. And I have to pay to get access to it. I'm sure the 1% will love it. I don't have the energy for explaining to you all the bad things that happen when companies and institutions have tried to mandate personal identification with their accounts. There it is. But we're not talking about screwing around. You want to target "anonymous users that do not behave the same way they would in real life". Your goal is to make sure that you have a community full of nice people who have to be careful about what they say lest they offend someone. Do you think PHP Freaks should require proof of identity for all of its members? After all, it's only to "protect our online community". You do the same thing every other online community does: ban the user, keep an eye out for their IP address and familiar activity from other accounts, and move on with your life. I'm done. I have other things to do than fight this. Like I said, I can't stop this from happening, but I'll be damned if I help it along.
  20. You don't need to defer constraints to use transactions. I can't tell for sure but it sounds like you're establishing a circular dependency somewhere in there. Can either of those entities exist in their own right without the other? Also, circular dependency. Rethink the architecture. That's a very good reason to not defer the uniqueness... Deferring a constraint means you need to perform a series of operations where a constraint must be violated. So before saying deferring is the answer, think about whether you really do have to violate a constraint. If the answer is not "no", think again. There is only one good reason I know of to do this: importing lots of data. Constraints necessarily slow operations, and slowing a lot of data means it takes longer to load it all. That's when you use deferred constraints, except the process goes: 1. Start with tables that are not already deferred - because there was no reason for them to be deferred until now 2. Modify to enable deferring 3. Start a transaction and begin deferring 4. Load all the data for all the tables 5. Commit 6. Modify the tables back to not allow deferring And remember: this is all my opinion. I'm sure there are DBAs out there who believe that all constraints should be deferrable, or that there are more lax requirements for doing it, or who otherwise disagree with me. And that's okay.
  21. They are the "bank" for a block of credit card numbers. When a transaction needs to be processed it goes to their system and they can handle the charge however they want. lol Riddle me this: Why the hell would I want to sign up for your community knowing (a) you are taking my personal information, including credit card numbers, in such a way that you are actively trying to establish my identity, (b) are doing so for reasons that have nothing to do with me initiating transactions on your site, but instead (c) are doing so because you want to be able to terminate my account if you decide that you don't like my behavior? Have you learned nothing from Twitter or Facebook or YouTube? Or from what is happening in China? I can't stop you from going forward with this idea, but I can tell you that I hate it and would never sign up for it.
  22. I have on my phone an app that lets me create nearly unlimited valid credit card numbers associated to me. I can defeat your system by taking the same measures I would with every other online transaction I enter into: by creating a new virtual card. That's to say nothing about the fact that I have more than one billable piece of plastic to my name. Trying to say that a credit card is an identity is naive. Why do you care whether someone uses the same credit card? I pay Netflix for myself and two other people, using three separate accounts, all with the same billing information. Do you think they care?
  23. Whatever the problem is, I doubt needing deferrable constraints is the answer. Why do you think you need them?
  24. I can't help but notice you had to sudo to access the file. Think about what that mmight mean. Maybe. Maybe not. I'm not the one who designed it. There might be a reason they made it just a warning.
  25. I don't see any PHP in there. I do see Javascript though. Probably means this question will do better in the Javascript forum. document.form1.sku999.value="44"; sku999 is a name. It is not a variable. You cannot stick a variable in there because Javascript is only going to look at its name. document.form1.'sku'+a.value="44"; I don't know why you think you can just stick a string in there. There are rules to how this kind of stuff works. Follow the rules. document.form1.conc.value="44"; Better except that "conc" is a variable, and like I said earlier, Javascript will only look at the name. And form1 doesn't have a "conc". Fortunately there is a way to access an object member using the value of a variable or expression. Square brackets. Just like arrays. document.form1['sku'+a].value="44";
×
×
  • 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.