Are identical Docker image layers with different parent layers stored twice? - docker-compose

Suppose I have an image with 2 layers, A and B, where A is the bottom layer and B is the top layer.
When I build a second image and replace the bottom layer A with AA, but the contents of the top layer is identical to B, does Docker store the contents of B second time in its folder structure, or does it know to reuse what it already has (I'm using overlay2)?
I understand that Docker uses its cache and if a cache miss occurs for a layer, it and all following layers will be rebuilt, but can it reuse the contents somehow?
When I push these two images, will the top layer be also pushed twice, or will the remote registry know that it already has all the contents?

Related

How to scale up image where objects's size are remained same?

If you have a file which include objects for example for EE like transistors, resistors etc and if you group them into one and then from the corner drag it to zoom in a bigger figure.
How can I make sure that these components are not zoom in only wiring changes?
The problem is that I have like 30 images with different sizes and I'm placing them in a table with many images side by side. However, if I keep the same scale then some images looks small compared to other. So I tried to scale them to get the same size. However, this make the components's sizes are also scaled up with different scale factors.
Here is an example of circuit using the bult-in shapes in Visio. As you can see the components'sizes got bigger when I scaled up the object. This is usually desired. However, in my specific case I want to keep the component's size same.
Here is the Visio file or I think you can also use any available components in Visio.
https://file.io/VRUCR8yVgYxs

Time plot does not update

I have two agents:RE and SUB.
Agent RE is the content and Agent SUB is the container.
The container SUB moves to a gis point and picks up RE and I want to know the number of RE that picked up by the container.
I tried to use time plot to obtain the number and visualize it, with code agent.contents().size().
But the time plot did not update after I run the model.Do you have any solution to this?
enter image description here
enter image description here
/wYAkZ.png
Appreciate for any help!
enter image description here
enter image description here
Based on your screenshot you are trying to plot the size of the container element inside the pickup object (which will always be empty) and not the size of the container agent that is used in the pickup object.
See the simple example model below
As you can see when an object exists the pickup block I add the size of the contents it is carrying to the dataset.
Since I am adding the data manually to the data set I have disabled all auto-updating on the data set
as well as the chart
For the simple example I have set the container agent (the top source) to sent agents about every minute, and for the agents that will be loaded into the container to arrive about every second.
Here are the results

Segmenting individual blobs connected by boundaries

Let's say I have the following image.
I want to consider these two blobs as two separate blobs; however, finding connected components labels them as a single component because they are touching.
I tried img = bwmorph(img, 'branchpoints'); and that does segment and erode these two blobs but that also erases blobs other blobs. For instance, in the following image, the upper left structure has been erased, but that structure should not be erased and moreover, I would like to segment that structure as two blobs that can be evidently seen.
The unfilled blob on the left has disappeared. How to get around this problem?
here's an idea, use imfill to fill holes in your blobs:
bw=imfill(im,'holes');
then do bw-im and get this:
you can take it from there...

Parsing for RGB regions over thousands of high resolution image files

I have lots of high resolution image files that have regions of colors, basically blobs with different rgb values. I need to go through the images and for every image make a text file that contains the coordinates to one pixel in every blob. Because I have so many files the script needs to be fast. I already wrote some scala code to do the task except it only saves locations for one blob per specific RGB value, meaning if I have two blobs of the same color that are not connected it will only save one the location for the first one found. The solution to this is for each images copy the location and colors to a map and when I find a blob flood delete (flood fill except delete instead of fill) and then keep parsing on the new map. However, I think this will make run time horribly slow because I will have to go through the entire image to add it to a map before even starting the parse. Thoughts? Am I going about this all wrong?
Thanks.

Is it possible to give different icons to a cluster group when it starts unclustering?

The red circles with numbers are clusters, but part of a bigger cluster when zoomed out.
Is it possible to change the marker/icon of the marker cluster in this present zoom depending on the markers that they have inside them? This without clicking them or anything, just change depending on the values of the markers that are hidden?
I have tried accessing the layer that is clustering all of them but I haven't been able to find the markers themselves, much less know how it would be possible to change the appearance of one without changing the other.
It looks like you already know how to customize your clusters appearance.
In the case your question refers only to the number of contained markers, you would just need to use a slightly modified version of the default iconCreateFunction to adjust the threshold values. When markers are removed/added from the MarkerClusterGroups and a cluster is de-/populated in consequence, its icon is re-drawn automatically. Customising the Clustered Markers
Now if you want this appearance to depend on some data from the contained markers, you would simply need to use cluster.getAllChildMarkers(); within your iconCreateFunction to get the array of markers contained within the cluster being styled. Then iterate through that array of markers, look for your data and create an icon accordingly.
Then, I understand that some data attached to your markers is changing, without any user action, and you want your clusters to update their appearance in consequence? In that case, please refer to this related question to upgrade your markercluster plugin with the new refreshClusters() method.
If your iconCreateFunction is properly designed, you do not have to worry about which clusters are changed. In fact, ALL clusters can be re-drawned, but if their markers data has not changed, they will get the same icon.