Questions tagged [pad]

This tag is currently a synonym for [padding]. For other purposes, please consider [gamepad] or [ipad] or [pad-xml] instead.

Padding is the process of fitting a given data type (usually a number, image, array, or string) to a particular size by adding data to it without changing its overall meaning.

132 questions
1
vote
1 answer

Pad Ruby number on Left AND Right of Decimal?

I have seen the solution to pad a number on each side of a decimal, in ruby, but not both on the same time. here are the pieces I have: mysize = 5000.127 f1_mysize = "%.2f" % mysize puts f1_mysize mysize2 = 5000.8 f2_mysize = "%06d" % mysize2 puts…
missscripty
  • 529
  • 2
  • 11
  • 30
1
vote
1 answer

Xboxdrv "windows/super" key EV_KEY name

I want to map windows/super keyboard key in my xboxdrv config but KEY_SUPER or KEY_WINDOWS doesn't work. what is the EV_KEY name of the "super" key? (I mean key with windows logo on many keyboards)
yaneq6
  • 151
  • 8
1
vote
1 answer

Reading a 2d array from inside another 2D array in java

In order to do local histogram equalization, I am trying to read some rows and columns from a zero padded 2D array and do some process on them. At first step I pad my original array (arr[][]) with zero and save it into temp_arr[][] which works fine.…
Nazi
  • 61
  • 10
1
vote
6 answers

bash 0 pad numbers on substrings

I have long lists as follows: D6N T69TN K70R M184V T215FEG The result must be like this: D006N T069TN K070R M184V T215FEG I'm new on bash, I tried approaches based in splitting it in columns and reformat. However the positions and length of 2nd…
1
vote
1 answer

padding a matrices to equalize heights with numpy

I have a list of matrices, some of them have bigger height (.shape[0]) than the others I want to make them all in equal height. So I want to find the height of the biggest matrix and add pad the rest of matrices with the difference so that the…
EasternDude
  • 413
  • 4
  • 16
1
vote
0 answers

Android Studio closely cropped PNG drawable has big vertical margins

Noob here. I have a drawable PNG that is cropped around just the image. There is no vertical white space. When I overlay it on the parent blank vertical margins are added: I want the PNG to display without those margins. In my main activity I'm…
1
vote
1 answer

Get row count of a multiline AcroField

I have a PDF with AcroFields. Some fields are multi-line fields. I have a requirement to populate AcroFields with given text and pad any remaining space in the field with an "*" (or a predefined character/string). I can add text using iText, but…
Chamila
  • 13
  • 4
1
vote
1 answer

Regex.Replace to deidentify/normalize columnar text

VB2010: I am using RegEx to de-identify a block of text and also normalize the text. That is to say to take lines of text and de-identify the name and the confirmation code and then normalize the text so that data lines up in columns. I have almost…
sinDizzy
  • 1,300
  • 7
  • 28
  • 60
1
vote
1 answer

Trouble implementing crib drag

so I'm enrolled in Stanford's Cryptography class on Coursera and I've been struggling with the first programming assignment (I'm a few weeks behind.) I've been playing around with different variations of this code for a few weeks to try and remove…
aweeeezy
  • 806
  • 1
  • 9
  • 22
1
vote
0 answers

How can I implement a dictionary attack on a multi-use pad?

I'm taking Stanford University's cryptography class on Coursera (actually behind a couple of weeks :/ ), and I'm having a little trouble with the first assignment. The code below may be, or is certainly, overkill... When I ran into problems with…
aweeeezy
  • 806
  • 1
  • 9
  • 22
1
vote
1 answer

Is it possible to change the thickness of the line drawn by "quadraticCurveTo" as you go along the curve?

I have a drawing pad, and I use quadraticCurveTo to make all of the lines and curves, and I want the line to get thinner when you move the mouse faster. However if I just do something like calculate the velocity of the pen and have that alter the…
fewaf
  • 145
  • 13
1
vote
1 answer

Padding string with zeros in crystal report formula

I have some string whose max length cab be 4. But the leading zeros are not present so I need to pad the same in string from left. I am confused, as the string are like: 11A 12B 13 6 6A Is there a way by which I can add leading zeros and then sort…
Incredible
  • 3,495
  • 8
  • 49
  • 77
1
vote
1 answer

Padarray function translating

I have to translate from Matlab to C this function: impadded = padarray(impadded, padSzVec, 'replicate', 'both'); Really it pads the array copying the last elements of the object impadded of every row and column(obtening a bigger object). What I…
Elvio
  • 17
  • 7
1
vote
5 answers

simple rand() question

I need a random 4 digit number right now im using rand(1000,9999) that always gives me a 4 digit number but i eliminates 0000-0999 as possible results. how do you pad a random number? (also this is eventually going to be added to a string do i need…
Crash893
  • 11,428
  • 21
  • 88
  • 123
1
vote
1 answer

mathematica: PadRight[] and \[PlusMinus]

Is there any way that PadRight[a \[PlusMinus] b,2,""] Returns {a \[PlusMinus] b,""} Instead of a \[PlusMinus] b \[PlusMinus] "" ? I believe that i need to somehow deactivate the operator properties of [PlusMinus]. Why do i need this? I'm…
1 2 3
8 9