Jump to content

requinix

Administrators
  • Content Count

    11,000
  • Joined

  • Last visited

  • Days Won

    203

Everything posted by requinix

  1. requinix

    mySQL and rebuilding keys

    1. Because MySQL updates the index automatically. After all, having to manually rebuild the index every time data changes would be incredibly tedious. 2. Same thing. One key is named automatically, one key is named manually. And no, the name does not matter. But adding the primary key after the table is created is annoying - do it when the table is created, inside the table definition.
  2. requinix

    Trouble with showing image in url

    What is your real problem? Because allowing there to be HTML markup in the query string that you then display on the page is very much not the right solution.
  3. e is an event object. e.target is the object firing the event (the select). You can get the files from it.
  4. requinix

    issues with Libreoffice

    Help for what? I told you not to run it from the command line, which you're still doing, but now you've posted part of your kernel log which I can only assume you're doing for a reason that I can't figure out.
  5. requinix

    Service to support different types of resources

    Can you decouple the storage mechanism from the chart? Entirely? The general chart service would lookup the basic chart information, determine the data source, and inject that into the chart.
  6. requinix

    Service to support different types of resources

    RemoteChart sounds like it's more of a data thing than a chart thing. Sounds like you need to abstract out the data retrieval/storage process. Probably specialized for the way charts will use it, but more or less separate from the actual chart business.
  7. requinix

    Service to support different types of resources

    "Service" is probably a more accurate term. It may be functioning like a controller in that it has various actions called for requests, but it isn't directly interacting with the request or response so it's not quite entirely a controller. You're talking about single-responsibility with the chart creation bit? You're still observing it: the single responsibility of creating charts is in one central location. Your method seems more or less right: single place to look up chart data, chart identifier maps into a class through a factory, class handles the precise work of the various operations. Chart types are not dynamically created (eg, no user-defined types) so hardcoding identifiers and class names is acceptable.
  8. requinix

    changes in the UUID - how to achieve that !?

    Have you seen /etc/fstab?
  9. The problem isn't that you have to intval() things. The problem is that $var1 and/or $var2 are not proper numeric values. You need to figure out why that might be the case, then probably add or edit input validation so that the non-numeric values are not being allowed.
  10. requinix

    issues with Libreoffice

    Don't start it from the command line.
  11. The AJAX request failed. Use your browser's developer tools to see what happened with it.
  12. Use mt_rand() to generate a random number.
  13. That's a new warning for PHP 7.3. Your composer is 1.4.2, current is 1.8.5.
  14. requinix

    Arrays: concatenation operator .= vs =

    Either you use it everywhere or you don't use it at all. I'm in the latter camp: I like the automatic conversions, and I'm already aware of and careful with value types. I would probably opt-in if I could do it globally, but there were good reasons not to support that and to only make it per-file.
  15. requinix

    Arrays: concatenation operator .= vs =

    According to Andrea (the original author of the scalar type hints RFC where strict_types came from), Shrug.
  16. requinix

    obtain last apache restart time with php

    No, there is no such function.
  17. As with most things in Linux, you install one program for the data and another program for a graphical utility. Try install psensor.
  18. requinix

    Site Won't Submit Multiple Variables

    You probably didn't see that I edited your first, and now second, post: please use the Code <> button when posting code. You can't simply change the value in your <option> and expect it to work. If you want to support multiple values then you have to have code that supports multiple values. And this // check vars if(!is_numeric($query_city_id)) { die('Wrong city id'); } $query_city_id = (int)$query_city_id; and this $query = "SELECT city_name, state FROM cities WHERE city_id = :query_city_id"; $stmt = $conn->prepare ($query); $stmt->bindValue(':query_city_id', $query_city_id); do not. Decide whether you want "3,1" or "3;1" or "3 1" or whatever, then adjust the code so it can support one or more city IDs at a time.
  19. requinix

    Site Won't Submit Multiple Variables

    using 3;1 or 3,1 could work if your code knew that it had to handle those. But I don't see where that code is...
  20. opcache is for code, not data. Don't serialize: whatever you use to cache will serialize for you. A real memory cache like memcached or redis would be best. Can you?
  21. requinix

    SELECT QUERY from table with no relationship

    How do you know how many points a user has?
  22. requinix

    array in mysql database?

    No. The backslashes are optional but okay. It does not matter if they are there. Do not try to manipulate the JSON string like that.
  23. Yes. PUT should be the entire body, PATCH should be whatever the changes are, and POST can sorta be either. So if you want to support a generic API for updating specific properties, use PATCH. PATCH /some/resource/123 HTTP/1.1 Content-Type: application/json {"option":{"plotOptions":{"solidgauge":{"dataLabels":{"enabled":true}}}}} Unless you think a sort of "enable/disable chart label" API would make more sense, along the lines of /toggle/label/name/state: POST /some/resource/123/toggle/label/solidgauge/enabled HTTP/1.1
  24. Can't say I agree with that approach. It's too weird. Stick with the standard: the data in the request body. If, however, modifying one or three specific properties is a common use case then that suggests your API should support it with a specific operation.
×

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.