javascript – I can’t clear the paint image in my Canvas

I’m trying to make the Mario move, but somehow it leaves traces behind, can anybody help???

var canvas = document.getElementById("screen");
var ctx = canvas.getContext("2d");
var mario;
var marioSprite;
var tiles;
var speedX = 1;

//marioSprite Specification
mario = {
    //target picture specification X & Y, Width & Height
    px:276,
    py: 44,
    pwidth: 16,
    pheight: 16,
    //drawing on Canvas specification X & Y, Width & Height
    cx: 16,
    cy: 116,
    cwidth:16,
    cheight:16,
}


//draw Mario in Canvas
function drawMarioSprite(){
    marioSprite = new Image();
    marioSprite.src = "http://gamedev.stackexchange.com/file:///C:/Users/MASTONO ALI/Desktop/img/characters.gif";
    marioSprite.addEventListener('load', e => {
    ctx.drawImage(marioSprite, 
        mario.px, mario.py, mario.pwidth, mario.pheight, 
        mario.cx, mario.cy, mario.cwidth, mario.cheight);
    });
    this.position = function() {
        this.mario.cx += speedX;       
    }
    position();
}//drawMarioSprite() end

//drawTiles and tilesLoop
function drawTiles() {
    tiles = new Image();
    tiles.src = 'file:///C:/Users/MASTONO ALI/Desktop/img/tiles.png';
    tiles.addEventListener('load', e => {
        tilesLoop();
    });
}
function tilesLoop(){
    for (let x = 0; x < 25; x++){
        for (let y = 11; y < 13; y++){
            ctx.drawImage(tiles, 
                0, 0, 26, 26, 
                x*12, y*12, 20, 20);
        }
    }
}//drawTiles() end


function draw(){

    drawMarioSprite();
    drawTiles();
    window.requestAnimationFrame(draw);
}

window.requestAnimationFrame(draw);

thank you

nginx – picture accidentally missing with paint on Magento2

I'm currently struggling to find the right configuration for my M2 shop and I can't figure out how to fix it.

In some pictures, the paint backend randomly returns 503 backend requests, sometimes it appears, sometimes it doesn't.

I'm using Ubuntu 18.4 with Nginx / Varnish 5.2.1 and PHP 7.3.16.

Here is the content of my default.vcl: https://pastebin.com/HJ2B7pvf

Then my nginx conf: https://pastebin.com/GDytNsht

The first thing I struggled with was that I couldn't activate health_check, no matter what I put on it. Every time a 503 backend fetch failed, I disabled it (tried to remove pub /). Second, I cannot set MAGE_ROOT directly in my pub every time a 404 error occurs.

I'm kind of in there, any help would be appreciated.

Thank you so much!

magento2 – How can the TAG cache be cleared programmatically? (including paint)

I looked for a correct method for programmatically clearing the cache by tags and found two different solutions for CMS pages:

  • Use the CacheInterface described here, which actually suggests something as simple as the following code. The cache for the Magento cache-level page is properly cleaned. However, the cache on the paint side is not cleaned up::
    $this->cacheManager->clean((cache_TAGS_array))
  • A second approach with Magento PageCache Model Cache Type that seems to be cmpage specific (although I'm not 100% sure). It suggests something like the following code. It clears both the magento and the paint cache. But it seems to clear the cache for ALL pages, even though we're passing a certain array of tags.
    $this->pageCache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, (cache_TAGS_array));
  • Note: The tags array is of type (cms_p_2).

Then my question is:

  • How can I clear the homepage cache (only the homepage) for Magento and Varnish? None of the above solutions gives a 100% good result.

magento2 – paint is cached, but Google Chrome does not display cached?

I installed Varnish and configured it according to the policy.
And if I try curl -I https://d-o-m-a-i-n.com I follow what appears to be working properly.

HTTP/1.1 200 OK
Date: Sat, 28 Mar 2020 03:17:02 GMT
Server: Apache/2.4.18 (Ubuntu)
Expires: Sun, 29 Mar 2020 03:17:03 GMT
Cache-Control: max-age=86400, public, s-maxage=86400
Pragma: cache
X-Magento-Tags: cms_b_porto_homeslider_3,store,cms_b,cms_p_91,cms_b_porto_custom_notice_new,cat_p,cat_c_p_30,cat_p_22,cat_p_1,cat_p_34,cat_p_21,cat_p_41,cat_p_11,cat_p_39,cat_p_35,cat_p_33,cms_b_porto_footer_top_1_for_5,cms_b_porto_footer_middle_1_for_5,cms_b_porto_footer_middle_2_for_5
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Vary: Accept-Encoding
X-UA-Compatible: IE=edge
Content-Type: text/html; charset=UTF-8
X-Varnish: 33268 3
Age: 13957
Via: 1.1 varnish (Varnish/5.2)
X-Cache: cached
Accept-Ranges: bytes

However, when I check in the response to the Google Chrome header, I get the following information indicating that Varnish is not cached and the age is 0.

Accept-Ranges: bytes
Age: 0
Cache-Control: max-age=86400, public, s-maxage=86400
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 20027
Content-Type: text/html; charset=UTF-8
Date: Sat, 28 Mar 2020 07:13:35 GMT
Expires: Sun, 29 Mar 2020 07:13:35 GMT
Keep-Alive: timeout=5, max=100
Pragma: cache
Server: Apache/2.4.18 (Ubuntu)
Vary: Accept-Encoding
Via: 1.1 varnish (Varnish/5.2)
X-Cache: uncached
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Magento-Tags: cms_b_porto_homeslider_3,store,cms_b,cms_p_91,cms_b_porto_custom_notice_new,cat_p,cat_c_p_30,cat_p_1,cat_p_22,cat_p_21,cat_p_11,cat_p_34,cat_p_41,cat_p_39,cat_p_35,cat_p_33,cms_b_porto_footer_top_1_for_5,cms_b_porto_footer_middle_1_for_5,cms_b_porto_footer_middle_2_for_5
X-UA-Compatible: IE=edge
X-Varnish: 1704417
X-XSS-Protection: 1; mode=block

Do you have any ideas why this is so?

webapp rec – take a screenshot and paint on it – without a native GUI

Chrome is my new desktop environment.

I want to be able to take screenshots (of chrome) and then
I want to paint this screenshot.

I usually paint a few arrows and simple text on the screenshot
Inform the product owner or QA staff.

So far I've been using Gimp, but a simpler tool would be nice.

Is there a web app that could help?

magento2 – Forwarding the web setup wizard – paint

After installing lack, I cannot open the web setup wizard. The browser spins for a while and then I get an error at https://example.com:81/setup, which Chrome interprets as follows: took too long to respond. ERR_CONNECTION_TIMED_OUT which I think means a redirect loop.

My site is Apache and 100% SSL.

My Apache access_log:

127.0.0.1 - - [31/Dec/2019:20:23:42 +0000] "GET /hdadmin/admin/backendapp/redirect/app/setup/key/6c049d5d7c7cb9eb0c5a0babee49950449cc73c950d03cb7f74d967563bdf751/ HTTP/1.1" 302 -
[IP] - - [31/Dec/2019:20:23:42 +0000] "GET /hdadmin/admin/backendapp/redirect/app/setup/key/6c049d5d7c7cb9eb0c5a0babee49950449cc73c950d03cb7f74d967563bdf751/ HTTP/1.1" 302 -
127.0.0.1 - - [31/Dec/2019:20:23:42 +0000] "GET /hdadmin/admin/backendapp/redirect/key/6c049d5d7c7cb9eb0c5a0babee49950449cc73c950d03cb7f74d967563bdf751/?app=setup HTTP/1.1" 302 -
[IP] - - [31/Dec/2019:20:23:42 +0000] "GET /hdadmin/admin/backendapp/redirect/key/6c049d5d7c7cb9eb0c5a0babee49950449cc73c950d03cb7f74d967563bdf751/?app=setup HTTP/1.1" 302 -

I suspect that something is missing in the paint configuration that allows access to the setup wizard, but I'm not very familiar with the paint setup.

magento2 – Caching problems with Magento 2.3.3 with paint 6.2

I used the Magento 2.3.3 generated VCL after I clicked Export to VCL for Paint 6. Two things strike me. One thing I can see is that when a product is deleted or added, it is not reflected in the store. Second, the change is not consistent across the business after the currency change. On some pages the old currency will be displayed and on some pages the new one. Help please.