Questions tagged [padding]

Extra space inserted into memory structures to achieve address alignment -or- extra space between the frame and the content of an HTML element -or- extra spaces or zeros when printing out values using formatting print commands like, in C, the printf*-family of functions.

Padding in memory structures is the insertion of additional bytes of unused space to make the internal fields of a structure align to desirable address boundaries.

Padding in HTML layout is extra space inserted between the content of the element and its border or frame. Padding is space added to the interior of the element; margin is space around the exterior of the element.

In arrays, padding is addition of extra 0's (zeros) in one or more dimension of the array in a symmetric, circular or replicating manner. This is important for signal and image processing, in the context of and convolution.

3939 questions
1
vote
4 answers

I can't remove the space above and below a paragraph

I can't remove the space above and below a paragraph that only consists of the letter "I" at the top of my Web Page. I have already tried to remove it with the "margin" and "padding" properties but it is not changed. Also I have tried, for the…
Israel
  • 25
  • 6
1
vote
4 answers

What's the best candidate padding char for url-safe and filename-safe base64?

The padding char for the official base64 is '=', which might need to be percent-encoded when used in a URL. I'm trying to find the best padding char so that my encoded string can be both url safe (I'll be using the encoded string as parameter value,…
SamS
  • 1,561
  • 2
  • 15
  • 22
1
vote
1 answer

Calculating byte alignment using a single or double modulus

I apologize if this may seem obvious to some people, but I'm having a bit of a brain fart. Can someone confirm if these two different methods of aligning to a 4 byte boundary are mathematically equivalent? Using a single modulus operation: int…
jscarle
  • 1,045
  • 9
  • 17
1
vote
1 answer

Tmux pad format string

I want to pad a format string to a certain length. For example, the Tmux Battery plugin introduces the battery_percentage format string. I can use this in the status bar as #{battery_percentage}. The battery percentage values can be: Between 0% and…
Ameer Taweel
  • 949
  • 1
  • 11
  • 37
1
vote
1 answer

Mobile Webkit Adds Padding

On my site I am using padding to control the size of my navigation buttons: #topnav a { padding: 2px 34px; } This works fine on all the desktop browsers including Safari and Chrome (which use desktop Webkit). However, on Safari for ipod and the…
big_smile
  • 1,487
  • 4
  • 26
  • 59
1
vote
3 answers

Adding padding to a UILabel with a background colour

I have a multiline UILabel that contains an NSAttributedString, and this has a background colour applied to give the above effect. This much is fine but I need padding within the label to give a bit of space on the left. There are other posts on SO…
user1162328
1
vote
1 answer

Memory allocation from struct in 64 bit system

I was going through old examns and found this question, where I have to put in field size and padding size for this specific struct on a 64 bit operating system: struct mystruct { char a; uint32_t b; int16_t c; int64_t d; }; The…
paperplan3
  • 57
  • 5
1
vote
2 answers

How to add padding in a dataset to fill up to 50 items in a list and replace NaN with 0?

I have the following encoded text column in my dataset: [182, 4] [14, 2, 31, 42, 72] [362, 685, 2, 399, 21, 16, 684, 682, 35, 7, 12] Somehow I want this column to be filled up to 50 items on each row, assuming no row is larger than 50 items. And…
1
vote
2 answers

Why is there only 1 padding byte for a char (on a 32-bit machine)?

A tutorial on data padding says that the char c following int i in the C struct below needs 1 padding byte. struct test2 { int i; // 4 bytes char c; // 1 byte // 1 padding byte. <-- question here short s; // 2 bytes }; I…
zell
  • 9,830
  • 10
  • 62
  • 115
1
vote
2 answers

Using SQL to pad values to calculate previous week values

Sample Table CREATE TABLE SAMPLE_TABLE (WEEK DATE, TYPE VARCHAR(50), Movie VARCHAR(50), Question VARCHAR(50), Answer VARCHAR(50), value NUMBER(38,0)); Sample Data INSERT INTO sample_table VALUES('10/1/2020', 'A', 'Contaco', '1', 'N/A',…
1
vote
0 answers

Asymmetric cryptography using hazmat.primitives. - ValueError: Encryption/Decryption failed

I'm trying to write a basic script to encrypt/decrypt some files on-the-go. The issue here is apparently relating to the padding method or to the size itself of the RSA key (as far as I understood from the online resources I've checked and currently…
Tywilt
  • 11
  • 3
1
vote
3 answers

add numbers to specific observations

I have several IDs I am working with. I want to add a leading zero for values that have 1 integer after the dash in id. Here is sample data. I id 2034-5 1023-12 1042-22 1231-9 I want this: id 2034-05 1023-12 1042-22 1231-09 I tried this, but it's…
D. Fowler
  • 601
  • 3
  • 7
1
vote
2 answers

Effect of padding sequences in MultiHeadAttention (TensorFlow/Keras)

I am trying to use the MultiHeadAttention layer to process variable-length sets of elements, that is, sequences where the order is not important (otherwise I would try RNNs). The problem is that I'm not sure I'm understanding the effect of padding…
1
vote
1 answer

AmCharts4 Remove Padding / Margin between Graph and Container

Is there a way to remove the padding between the container and the graph in AmCharts4? I have tried chart.padding(0, 0, 0, 0) but it doesn't have an effect. https://codepen.io/ChazUK/pen/JjKVvNv const chart = am4core.create('chart',…
ChazUK
  • 744
  • 4
  • 26
1
vote
7 answers

Why is there a gap on the top of my webpage?

I'm sure the answer is obvious, but I haven't been working with html/css that much... There is a gap of white space in between the top of the browser and the first div. I don't really get why the gap is there. I didn't use margin-top or…
Derek
  • 11,980
  • 26
  • 103
  • 162