Jump to content

requinix

Administrators
  • Posts

    15,281
  • Joined

  • Last visited

  • Days Won

    432

Posts posted by requinix

  1. 13 minutes ago, oslon said:

    Place a queen on board when there is no conflict with the other queen(diagonalwise, row-wise, col-wise)

    But where? How do you decide where to make each move? And how do you make sure you don't make the same set of moves in future attempts?

    15 minutes ago, oslon said:

    If there is conflict, reset and start again.

    Doesn't that count as backtracking?

  2. ...It's running. It's already running. You know it's running because you get the "it works" page. So what was this about trying to start it?

    If you're looking at Windows's services list, "Automatic" means that the service will run automatically on startup. Which is good, and means you don't have to run it yourself manually. You don't need to change that.
    (Suggestion: change that to Delayed, meaning it's a little lower priority, to help with better startup times.)

    If you have PHP basically working then mysqli is a matter of php.ini settings. Edit your php.ini (phpinfo will tell you exactly where that is), creating it if you don't have one yet, find the "extension=" area, and uncomment the extensions you want to use. Then restart Apache.

  3. It's better to paste the (relevant) code, and/or screenshots for stuff that's visual, directly into your post: most people here try to keep safe and so won't download random files from strangers on the internet.

    That stuff you included there is XML, and it's easy to read with PHP. But you're talking about margins and line breaks, which isn't actually PHP, though the line between what is and isn't PHP does get a little blurry sometimes.
    Can you give a more detailed description about what you're doing, what you've written so far, what happens when you run it, and what you were expecting it to do instead? Remembering to post code as you go, of course.

    • Like 1
  4. An alternative to using HTML markup for the value would be to put it directly into the Javascript code.

    const END_TIMESTAMP_MS = <?= $whatever_end_time ?> * 1000;

    You need to consider the same sorts of things you would with putting values into HTML, in that you should make sure the value is safe - safe for Javascript, that is.
    (But since I'm assuming $whatever_end_time is a number, it's naturally safe without needing any escaping.)

    And tip: don't literally count down to the time, as in do things like "seconds--". Because you won't be able to get to-the-second accuracy with Javascript, and it will drift as it runs: for example, you'll find you did "seconds--" 60 times but it's actually been 61 seconds, and now the timer is off by a second.
    It may sound weird, but instead of counting down, recalculate how much time is left on every "tick". As in

    function update() {
      const remaining = END_TIMESTAMP_MS - Date.now();
      if (remaining > 0) {
        // calculate hours/minutes/seconds and display
      } else {
        // count down complete
      }
    }

    The drift will still happen, and you'll notice that occasionally the timer will skip a second because of it, but (a) some drift is unavoidable and (b) it's probably more important that you provide an accurate timer than you provide a "smooth" count down.

  5. The server should be configured as:

    - en.mobirom.ro uses that /en/ directory as its root
    - the English URL paths do not have an "/en/" prefix, as in "/en/whatever/page.html" - they should be the same as the normal Romanian ones

    Doing a little checking on your site, that's not the case: the English site is also using the root directory, which means I have to go to en.mobirom.ro/en for it to work.

    After fixing the site to use /en/ as its root, and hopefully you can but if not then keep reading and we'll solve that problem separately,

    - The .htaccess for the Romanian site (/.htaccess) will only apply to mobirom.ro
    - The .htaccess for the English site (/en/.htaccess) should only apply to en.mobirom.ro, however:
    - Unless you tell Apache otherwise, mobirom.ro/en/whatever/page.html will work. This is bad for SEO and you should make sure the English site is only accessible at en.mobirom.ro. That will also mean the /en/.htaccess only gets used for the English site.
    - This thread is public to the internet. Please don't create debugging pages like you have now for /en/ unless you want anybody to be able to see them... Checking the REMOTE_ADDR to only allow you would solve this.

    So /.htaccess should look something like

    RewriteEngine on
    
    #
    # HTTP->HTTPS and WWW redirect
    #
    
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://www.mobirom.ro%{REQUEST_URI} [L,R=301]
    
    RewriteCond %{HTTP_HOST} !=www.mobirom.ro
    # you should not need these two...
    #RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    #RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    # you do not need this, Let's Encrypt will follow redirections
    # they also won't validate the SSL cert, so an expired or even self-signed cert will be okay
    #RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteRule ^ https://www.mobirom.ro%{REQUEST_URI} [L,R=301]
    
    #
    # English site redirect
    #
    
    RewriteRule ^en/(.*) https://en.mobirom.ro/$1 [L,R=301]
    
    #
    # HTML pages
    #
    
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(2)\.html$ /mese/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(6)\.html$ /scaune-curbate/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(3)\.html$ /mese-bar/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(5)\.html$ /scaune-bar/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(4)\.html$ /tabureti/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(7)\.html$ /seturi-mese-si-scaune/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(15)\.html$ /mobilier-lemn-curbat/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(9)\.html$ /masute-cafea/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(11)\.html$ /scaune-balansoar/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(13)\.html$ /mobilier-terasa/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(1)\.html$ /scaune/$1_$2_$3.html [L,R=301]

    And /en/.htaccess will look similar:

    RewriteEngine on
    
    #
    # HTTP->HTTPS and WWW redirects
    #
    
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://en.mobirom.ro%{REQUEST_URI} [L,R=301]
    
    RewriteCond %{HTTP_HOST} !=en.mobirom.ro
    # you should not need these two
    #RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    #RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    # you do not need this, Let's Encrypt will follow redirections
    # they also won't validate the SSL cert, so an expired or even self-signed cert will be okay
    #RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteRule ^ https://en.mobirom.ro%{REQUEST_URI} [L,R=301]
    
    #
    # HTML pages
    #
    
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(2)\.html$ /tables/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(6)\.html$ /bent-chairs/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(3)\.html$ /bar-tables/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(5)\.html$ /bar-chairs/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(4)\.html$ /stools/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(7)\.html$ /table-chair-sets/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(15)\.html$ /bent-wood-furniture/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(9)\.html$ /coffee-tables/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(11)\.html$ /rocking-chairs/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(13)\.html$ /outdoor-furniture/$1_$2_$3.html [L,R=301]
    RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(1)\.html$ /chairs/$1_$2_$3.html [L,R=301]

    Since your server looks properly configured for the two sites, you could actually use %{SERVER_NAME} in place of the hostnames, making some of this easier to copy and paste.

    One more thing: PHP 7.4 is really old so please upgrade if you can.

  6. What part of the page are you talking about? The "322GW" at the top?

    image.png

    Yes, it isn't absolute positioning. It's simply a <body> with overflow-x and a descendant element (a heading inside a div inside a div inside a div...) whose text content is overflowing out the side.

    The positioning is done (using grid) by splitting the "row" in half, with the image on the left and the text on the right. The text's font size was chosen such that it's able to fit the text on the screen normally (the text is known to be a short string like "322GW" or "222"), and there appears to be a little bit of responsive design involved, but collapsing the page enough will eventually cause it to overflow.

  7. Absolute positioning is a double-edged sword. It does make sense in a number of situations, and is even the "correct answer", but there are a number of other situations where it isn't a good idea and the design should be done through choices in layout instead.

    I'm not really sure what the goal is because making text go off the side of the screen seems weird, but I'll throw out something: have you considered using screen-relative measurement units (like vw/vh) with things besides the width? Like, you can apply it to font-size (but be careful about that), or margin-left.

  8. 48 minutes ago, simona6 said:

    Am I allowed to post the actual website where this is happening on here, so you can see it in total context?

    Nah, it's fine. As long as it's okay with you, "here is my site, please help me understand why it's not working" is totally a reasonable thing to do.

    5 minutes ago, simona6 said:

    Since the text is Absolute Positioned

    Absolute positioning? Oh, that could be a problem. Really should avoid that whenever possible.

×
×
  • 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.