Why the default padding classes of tailwind css not working after I add a custimization to It?

After adding this custom padding class in tailwind.config.js

  module.exports = {
         theme: {
      padding: {
          yt: '56.25%'
        }
    }

I am able to use the class as pb-yt for bottom padding.
However the normal classes for padding which used to work doesn’t work now.
Eg : p-8 p24 px-4 pb-4 are default classes by tailwind which used to work before I added the custom class.
What am I doing wrong here?

html – CSS Calcular padding baseado no padding superior

Estou tentando fazer um menu aside com ul e a minha ideia é fazer uma árvore onde cada novo ul dentro de um li ser acrescido um padding-left para que cada novo submenu (ul) adicionado tenha um espaço extra identificando de forma fácil a hierarquia destes submenus.

Isto pode ser facilmente resolvido adicionado um padding-left a ul, cada novo ul estará espaçado um pouco a mais da margem devido ao acumulo de padding-left.

O Problema desta abordagem é que o :hover não ficará até a borda já que todos os elementos terão sofrido um padding-left juntos.

Particularmente sempre que preciso configurar medidas e paddins faço diretamente no link a para que este problema de :hover não ocorra, no entanto não descobri uma forma de fazer um padding-left acumulativo no link.

aside {
  width: 300px;
  height: 700px;
  position: static;
  left: 0;
  background-color: #292d39;
}

aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
aside ul a {
  display: block;
  padding: 10px 0px;
  text-decoration: none;
  color: #fff;
}
aside ul a:hover {
  background-color: #007acc;
}
aside ul{
  padding-left: 15px;
}
<aside>
  <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">Menu 1</a>
      <ul>
        <li><a href="#">&lt;Afastado: Sub 1.1</a></li>
        <li><a href="#">Sub 1.2</a></li>
        <li><a href="#">Sub 1.3</a>
          <ul>
            <li><a href="#">&lt;Hover não fica no canto: Sub 2.1</a></li>
            <li><a href="#">Sub 2.2</a></li>
            <li><a href="#">Sub 2.3</a></li>
          </ul>
        </li>
      </ul>
    </li>
    <li><a href="#">Menu 2</a></li>
  </ul>
</aside>

Aqui em baixo uma versão com padding-left aplicado diretamente ao link <a>. Muito melhor pois o :hover irá atuar até mesmo no canto esquerdo pois o padding-left está afastando o conteúdo do link e não mais o link da lateral esquerda.

aside {
  width: 300px;
  height: 700px;
  position: static;
  left: 0;
  background-color: #292d39;
}
aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
aside ul a {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: #fff;
}
aside ul a:hover {
  background-color: #007acc;
}
/*Funciona mas tem que ficar repetindo este código acrescentando mais espaço*/
aside ul ul a{
  padding-left: 30px;
}
aside ul ul ul a{
  padding-left: 45px;
}
<aside>
  <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">Menu 1</a>
      <ul>
        <li><a href="#">Sub 1.1</a></li>
        <li><a href="#">Sub 1.2</a></li>
        <li><a href="#">Sub 1.3</a>
          <ul>
            <li><a href="#">Sub 2.1</a></li>
            <li><a href="#">Sub 2.2</a></li>
            <li><a href="#">Sub 2.3</a>
<ul>
            <li><a href="#">Sub 3.1 (não vai pois tem que repetir o css)</a></li>
            <li><a href="#">Sub 3.2</a></li>
            <li><a href="#">Sub 3.3</a></li>
          </ul>
</li>
          </ul>
        </li>
      </ul>
    </li>
    <li><a href="#">Menu 2</a></li>
  </ul>
</aside>

Alguém tem alguma dica ou a solução é apelar para o JS?

Padding Inside a Floating div

I am in the middle of creating a basic, plain jane, old school div layout. But for the life of me, I can’t figure out how to get padding in the content area and side menu without the template distorting with extra padding. I’ve been searching online for hours — and I’m finding ‘apparent’ solutions, but when I try to implement them, they don’t work. I now have a migraine. If anyone has a solution, I’d be rapt to know what it is.

Note: The template isn’t complete, per se. I’m just trying to get the basic layout/functionality right.

html {
  height: 100%;
  font-size: 1.8vw;
}
body {
  height: 100%;
  background-color: #EEEEEE;
  font-family: arial;
}
.wrap {
  width: 80%;
  height: 100%;
  background-color: #FFFFFF;
  max-width: 1200px;
  margin: 0px auto 0px auto;
  border-left: 1px solid #999999;
  border-right: 1px solid #999999;
}
.head {
  margin-top: 10px;
}
.logo {
  background-color: #FFFFFF;
  float: left;
  width: 30%;
  height: 100px;
  line-height: 100px;
  text-align: center;
}
.head-right {
  background-color: #FFFFFF;
  float: right;
  width: 70%;
  text-align: center;
  height: 100px;
  line-height: 100px;
}
.topmenu {
  clear: both;
  background-color: #FFFFFF;
}
.content-wrap {
  background-color: yellow;
}
.content {
  background-color: #CCCCCC;
  float: left;
  width: 70%;
}
.content-box {

}
.content-2 {
  clear: both;
  border-top: 1px solid #999999;
  background-color: #FFFFFF;
}
.content-2-box {
  padding: 1vw;
}
.sidemenu {
  background-color: #999999;
  float: right;
  width: 30%;
}
.sidemenu-box {

}
.foot {
  clear: both;
  background-color: #FFFFFF;
  margin-top: 10px;
}
/* Top Menu */
ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: green;
  text-align: center;
}


li {
  display: inline-block;
}

li a {
  display: block;
  color: white;
  text-align: center;
  padding: 16px;
  text-decoration: none;
}

li a:hover {
  background-color: #111111;
}
.home-link {
  padding-left: 20%;
}
/* Responsive */
@media screen and (max-width: 600px) {
  html {
    font-size: 2.5vw;
  }   
  .logo {
    float: none;
    width: 100%;
    text-align: center;
  }
  .head-right {
    float: none;
    width: 100%;
  }
  .content {
    float: none;
    width: 100%;
  }
  .sidemenu {
    float: none;
    width: 100%;
  }
}

Code (CSS):


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8" />
  <title></title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
  <div class="wrap">
    <div class="head">
      <div class="logo">
        LOGO
      </div>
      <div class="head-right">
        head right
      </div>
    </div>
    <div class="topmenu">
      <ul>
        <li>
          <a href="#">Home</a>
        </li>
        <li>
          <a href="#">About</a>
        </li>
        <li>
          <a href="#">Contact</a>
        </li>
        <li>
          <a href="#">Blog</a>
        </li>
      </ul>
    </div>
    <div class="content-wrap">
      <div class="content content-box">
        <h1>This Is A Page Heading</h1>
        <p>This is some content.</p>
      </div>
      <div class="sidemenu sidemenu-box">
        sidemenu
      </div>
      <div class="content-2 content-2-box">
        Content 2
      </div>
    </div>
    <div class="foot">
      <div class="content content-box">
        <p>Foot Left</p>
      </div>
      <div class="sidemenu sidemenu-box">
        Foot Right
      </div>
    </div>
  </div>
</body>
</html>

HTML:

SEMrush

 

How do I get the actual boot image file from a block device without padding?

I have 9.6mb file that after doing dd if=/dev/zero of=/dev/block/mtdblock2 I write to mtdblock2. Before writing I have done a sha1sum on the file. I can use applypatch -c to check both size and sha but if I do a sha on the blockdevice it is of course different because of the space left on the device. If I copy the device I will get a 16mb image including that free space. Every where I read the suggestions are to use fdisk to get a count and then use the count option in dd. However, this does not work because the block and partition is the boot partition. How can I copy the original file, same size and sha, back off of the block device?

magento2.3 – Declarative schema uses padding in 2.3, gone in 2.4, do we have to use it?

In a module we’re developing we declare a new database table with a foreign key relationship to the sales_order table. We want to support Magento 2.3 and 2.4, so we use the declarative schema (db_schema.xml).

The schema looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="my_order_table" resource="default" engine="innodb">
        <column xsi:type="int" unsigned="true" nullable="false" name="sales_order_id" padding="10" />
        <!-- extra columns, including a PK -->
        <constraint xsi:type="foreign" referenceId="MY_ORDER_SALES_ORDER_ID" table="my_order_table" column="sales_order_id" referenceTable="sales_order" referenceColumn="entity_id" />
    </table>
</schema>

So the column my_order_table.sales_order_id references Magento’s sales_order.entity_id, and all is well. As long as we use Magento 2.4, because for 2.3 their own declaration is different. Compare:

Magento 2.3:

<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="sales_order" resource="sales" engine="innodb" comment="Sales Flat Order">
        <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true"
                comment="Entity ID"/>

Magento 2.4:

<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="sales_order" resource="sales" engine="innodb" comment="Sales Flat Order">
        <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
                comment="Entity ID"/>

In 2.3, there’s the padding="10" attribute on the column, which is gone in 2.4. If we add that same attribute to our schema, it works in both 2.3 (on MariaDB 10.3) and 2.4 (on MySQL 5.7). If we omit that padding, it works in 2.4 but in 2.3 gives the error while running setup:upgrade:

Column definition “sales_order_id” and reference column definition “entity_id” are different in tables “my_order_table” and “sales_order”

This attribute was removed in a commit named “MC-14884: MySQL-8 and MariaDB-10.4 support”.

So my question is: why does it work if we declare the referencing column with padding, and what problems can that cause on later upgrades? Is it related to MariaDB?

java – Why am i getting padding of 0’s in the result

In my java assignment, we were given the task to multiply arbitrarily large number stored as an array list with help of normal grade-school multiplication algorithm. So I made four functions. One function for adding two Array List in O(n). Second, for shifting a number with 0, that is multiplying by a power of 10. Third for multiply a single digit with an Array List in O(n). Fourth for multiplying an ArrayList.

package lecture.files;
import java.util.Arrays;
import java.util.ArrayList;
public class FastMult {
    public static ArrayList<Integer> norm_mult(ArrayList<Integer> a_1,int b_1) {
        ArrayList<Integer> result = new ArrayList<Integer>();
        int carry=0,a = 0;
        for(int i = 0;i<=a_1.size();i++) {
            if(carry == 0 & i == a_1.size()) {
                break;
            }
            a = 0;
            if((a_1.size()-1-i) >= 0)
                a = a_1.get(a_1.size()-1-i);
            
            result.add(0,(a*b_1+carry)%10);
            carry = (a*b_1 + carry)/10;
        }
        return result;
    }
    public static ArrayList<Integer> multiply(ArrayList<Integer> a_1,ArrayList<Integer> b_1){
        ArrayList<Integer> result = new ArrayList<Integer>(Arrays.asList(0));
        ArrayList<Integer> temp = new ArrayList<Integer>();
        int size = b_1.size();
        if(a_1.size()>b_1.size())
            size = a_1.size();
        for(int i = 0;i<size;i++) {
            int b = 0;
            if((b_1.size()-1-i) >= 0)
                b = b_1.get(b_1.size()-1-i);
            temp = norm_mult(a_1,b);
            temp = left_shift(temp,i);
            result = add(result,temp);
        }
        return result;
    }
    public static ArrayList<Integer> add(ArrayList<Integer> a_1,ArrayList<Integer> b_1) {
        int size = b_1.size();
        if(a_1.size()>b_1.size())
            size = a_1.size();
        int a1=0,b1=0,carry=0;
        ArrayList<Integer> result = new ArrayList<Integer>();
        for(int i = 0;i<=size;i++) {
            a1=0;b1=0;
            if(carry == 0 & i == size) {
                break;
            }
            if(i<a_1.size())
                a1 = a_1.get(a_1.size()-1-i);
            if(i<b_1.size())
                b1 = b_1.get(b_1.size()-1-i);
            result.add(0,(a1 + b1 +carry)%10);
            carry = (a1 + b1 + carry)/10;
        }
        return result;
    }
    public static ArrayList<Integer> left_shift(ArrayList<Integer> a,int shift) {
        ArrayList<Integer> result = a;
        for(int i = 1;i<=shift;i++) {
            result.add(0);
        }
        return result;
    }
    public static ArrayList<Integer> string_to_array(String no){
        ArrayList<Integer> result = new ArrayList<Integer>();
        for(int i=1;i<=no.length();i++) {
            char a = no.charAt(no.length()-i);
            int num = Character.getNumericValue(a);
            result.add(0, num);
        }
        return result;
    }
    public static void main(String args()) {
        ArrayList<Integer> a = string_to_array("886656");
        ArrayList<Integer> b = string_to_array("88");
        ArrayList<Integer> result = multiply(a,b);
        System.out.println(result);
    }
}

THe results are correct.But in the output i am getting padding of 0’s. I want to remove it.How can i make function for triming the 0’s

complexity theory – An opposite method of padding argument

Is there a method to prove things with longer input in complexity theory?

For example, using padding argument it’s trivial to show that
$text{NTIME}(n^2) subseteq text{DTIME}(n^4) Rightarrow forall k ge 2, text{NTIME}(n^k) subseteq text{DTIME}(n^{2k})$

Is there a common method for the opposite direction, i.e., for something like
$text{NTIME}(n^4) subseteq text{DTIME}(n^{12}) Rightarrow forall 1 ge k < 4, text{NTIME}(n^k) Rightarrow text{DTIME}(n^{3k})$?

android – Como diminuir o padding de um menu item (Menu 3 pontos)

Olá, comecei recentemente a programar para Android Nativo e estou com dificuldade na hora de mudar o padding do menu item 3 pontos. Gostaria de saber se é possivel e como fazer para diminuir o padding do item em questão.

inserir a descrição da imagem aqui

Tentei mudar o minWidth dele no style.xml porém não obtive exito.

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorPrimaryLight</item>
    <item name="android:actionOverflowButtonStyle">@style/DotsTheme</item>
    <item name="android:actionButtonStyle">@style/ActionButtonTheme</item>
</style>

<style name="DotsTheme" parent="android:style/Widget.Holo.ActionButton.Overflow">
    <item name="android:src">@drawable/ic_baseline_more_vert_24</item>
    <item name="android:minWidth">0dp</item>
</style>

<style name="ActionButtonTheme" parent="@android:style/Widget.ActionButton">
    <item name="android:minWidth">0dp</item>
</style>

Segue abaixo o codigo do menu_chat.xml

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/menu_video_call"
        android:icon="@drawable/ic_baseline_videocam_24"
        android:title="@string/menu_video_call"
        app:showAsAction="ifRoom"/>
    <item
        android:id="@+id/menu_voice_call"
        android:icon="@drawable/ic_baseline_call_24"
        android:title="@string/menu_voice_call"
        app:showAsAction="ifRoom"/>
    <group
        android:id="@+id/menu_more">
        <item
            android:id="@+id/action_view_contact"
            android:title="@string/menu_moreViewContact"/>
        <item
            android:id="@+id/action_view_all_media"
            android:title="@string/menu_moreViewAllMedia"/>
        <item
            android:id="@+id/action_search"
            android:title="@string/menu_more_search"/>
        <item
            android:id="@+id/action_silence_notify"
            android:title="@string/userProfile_silence_notify"/>
        <item
            android:id="@+id/action_change_wallpaper"
            android:title="@string/menu_moreChangeWallpaper"/>
        <item
            android:id="@+id/sub_menu_more"
            android:title="@string/more">
            <menu>
                <item
                    android:id="@+id/action_report"
                    android:title="@string/report"/>
                <item
                    android:id="@+id/action_block"
                    android:title="@string/block"/>
                <item
                    android:id="@+id/action_clear_chat"
                    android:title="@string/clearChat"/>
                <item
                    android:id="@+id/action_export_chat"
                    android:title="@string/exportChat"/>
                <item
                    android:id="@+id/action_add_shortcut"
                    android:title="@string/add_shortcut"/>
            </menu>
        </item>
    </group>
</menu>