updates – Updating Android make it to user more data transfer, now there is no way to block data by default

I have accidentally updated my Android One phone to v10 of 2020-05-01 and now each time I switch-on the phone data transfer is also on.

How can I disable data transfer by default so I need to manually enable it whenever I want.

Previously once I switched-off the data, by sliding a drawer from top of the screen and tapping data transfer triangle, it was off until I really made it on. It also stayed up when I rebooted the system.

c – Is `extern int x = 1;` in a block a definition?

https://stackoverflow.com/questions/51920598/is-a-declaration-of-a-variable-inside-a-block-also-a-definition/51920825#51920825 says

a declaration of an “object” (the C standard avoids using the word “variable”) at block scope is a definition, except when the declaration of that object uses the storage-class specifier extern, in which case it is not a definition.

In a block, is it legal to write

{
    extern int x = 1;
}

?

According to the quote, is the declaration not a definition because of extern?

Does haveing “initializer” 1 make the declaration a definition? If not, is = 1 an assignment instead of an initializer?

Does C11 standard have relevant specification for this case?

url redirection – When do browsers block automatic redirects?

I am trying to understand various reasons where the browser would block redirects to another site. This lead me to have an understanding of why do sites have an interstitial redirect page which says redirecting you in 5 seconds, please click here if you are not redirected,

These are some of the reasons:

  • If javascript is not available, the user can click on the link explicitly to get redirected.
  • There might be some long running process before the user can get redirected. For example, you might be running some javascript / network calls to capture some data before redirecting. In such cases, if something fails and the code does not reach the javascript redirect or takes too long, the user can still click on the link directly.
  • From UX perspective, this might be an indication to the user that they are leaving the current site (though this shouldn’t require any explicit CTA to click here, as we are not expecting the redirection to fail)
  • This might be a page to check the traffic before redirecting to the correct page.

All of the above are more related to UX and javascript code. I have been trying to understand if browsers can block automatic redirects as well ? (Javascript as well as http redirects). Some of the things that I have encountered:

  • chrome blocks third party iframes from redirecting the parent window
  • chrome blocks the tab-under behavior, where on clicking of a link the correct page opens up in a popup, but the current window is redirected to an ad

Some of the questions which I am seeking clarity for:

  • Are there any reasons where browsers may block top level cross origin redirects from happening? Both http redirects/ meta redirects, as well as javascript location redirects. I want to understand this, so that i can decide whether or not i should have a manual click here fallback for a redirection.
  • slightly off topic, but, why do sites need the tab under behaviour? Wouldn’t the popup be blocked by browsers? and why do they not redirect the user as soon as they land on the site? why wait for user click to change the url for the current tab?

partition – VMware esxi host partedUtil sector bit and block size?

Alright, things i did are: studying https://kb.vmware.com/s/article/1036609 and https://kb.vmware.com/s/article/2004299 , and also googled some other information about the “partedUtil” in ESXi.

I encountered doubts when utilizing partedUtil commandlines to configure partitions in ESXi 7.0 host but I failed to find proper answer for my own doubts.

According to figure below,

enter image description here

can anyone please tell me what is the measuring unit(is it kb?) of 16987000 and 17092000? (i know they are the “sector start” and “sector end”, respectively.)

additionally, how do i know the measuring unit(mb?) of block size for specific partition(such as VMFS Datastore or Linux Swap, for example) when configuring with partedUtil in ESXi??

The last question is: do I need to multiply “block size” by “space I need” as the space(between start sector and end sector) for the partition I need? or maybe the space between start and end sector is quite simple to calculate which does not need to take “block size” into consideration?

thanks in advance!!

8 – How to display default drupal search block in twig template

In twig_tweak module before version 2 (for Drupal 8) I could place the following code in my page twig template and it would work:

{{ drupal_block('exposedformsearch_contentpage_1') }}

This would display put the default site search box.

After upgrading to version 2, this doesn’t work anymore and see the following message on the page:

This block is broken or missing. You may be missing content or you might need to enable the original module. 

I tried using the command:

{{ drupal_block('search_form_block') }}

That displays the same error message.

Does anyone know what the the correct call is? I can’t seem to find any documentation anywhere as to what the replacement call should be.

Thanks.

magento2 – Add arguments to block via layout update

In the catalog_product_view.xml ofthe Magento_Catalog module there’s this block

<block class="MagentoCatalogPricingRender" name="product.price.final">
    <arguments>
        <argument name="price_render" xsi:type="string">product.price.render.default</argument>
        <argument name="price_type_code" xsi:type="string">final_price</argument>
        <argument name="zone" xsi:type="string">item_view</argument>
    </arguments>
</block>

I have a catalog_product_view.xml in my own theme’s layout folder, which is adding some additional blocks and moving or removing some others.

Now what I need to do is to add more arguments to the price block, but without changing anything else. So no moving, now changing of the original arguments etc.

Just adding for example:

<argument name="some_param" xsi:type="boolean">true</argument>
<argument name="another_param" xsi:type="boolean">false</argument>

How do I do that? What do I need to put in my layout file.

encryption – Block cipher exercise CTR, CBC and ECB

I’m trying to figure out this exercise about CTR, CBC and ECB

given Encryption Matrix

(29->0, 11->1, 26->2, 1->3, 21->4, 4->5, 15->6, 31->7, 27->8, 28->9, 2->10, 14->11, 8->12, 20->13, 9->14, 5->15, 0->16, 22->17, 7->18, 10->19, 3->20, 6->21, 25->22, 17->23, 24->24, 23->25, 19->26, 18->27, 16->28, 12->29, 13->30, 30->31)

0 encyrpts to 29, i.e. E(K, 0) = 29, 3 maps to 20. To decrypt read backwards, so 29 goes to 0 and 30 to 31. in notation: D(K, 30) = 31.

Hints:

· Plaintexts are 6 letter german words.

· Blocklenght = 5.

· You must convert decimal to 5 bit binary to XOR in CBC and CTR Mode example: 11_10 XOR 17_10 = 01011_2 XOR 10001_2 = 11010_2 = 26_10.

Code table:Code table

ECB-Ciphertext: (25, 29, 14, 14, 10, 21)
P_i=D(K,C_i)

CBC-Ciphertext (IV=0):(29, 16, 18, 7, 10, 23)

C_0 := IV

C_i=E(K,P_i XOR C_i-1)

P_i=C_i-1 XOR D(K,C_i)

CTR-Ciphertext (IV=0):(25, 14, 10, 23, 16, 29)

P_i=C_i XOR E(K,IV+i mod 2^blocksize)

I only get false results these are no german words

ECB Wallte

CBC abldut

CTR efqwfz