Questions tagged [masking]

Force user input to conform to given rules.

Input masking restricts inputs for a given UI element without actually performing validation. Instead of collecting and validating user input, the masking approach restricts the inputs that a user can make in the first place.

An example of this would be a text field that is set to accept telephone numbers from a given country: instead of collecting digits and letters, and then validating them against the format, an input-masked field will only allow digits to be input, and will only accept them in an order that forms a valid input.

When dealing with arrays / matrices 'masking' means to ignoring certain parts of the array an only use the unmasked elements for further calculations.

1153 questions
23
votes
1 answer

SVG clipPath to clip the *outer* content out

Normally, the element hides everything that is outside the clip path. To achieve the opposite effect - that is to "cut out" something from the image - i want to use two paths in the clipPath and the clip-rule="evenodd" attribute.…
tillda
  • 18,150
  • 16
  • 51
  • 70
23
votes
13 answers

mask all digits except first 6 and last 4 digits of a string( length varies )

I have a card number as a string, for example: string ClsCommon.str_CardNumbe r = "3456123434561234"; The length of this card number can vary from 16 to 19 digits, depending on the requirement. My requirement is that I have to show the first six…
Kartiikeya
  • 2,358
  • 7
  • 33
  • 68
23
votes
2 answers

Performance Issues When Using Many CALayer Masks

I am trying to use CAShapeLayer to mask a CALayer in my iOS app as it takes a fraction of the CPU time to mask an image vs manually masking one in a bitmap context; When I have several dozen or more images layered over each other, the CAShapeLayer…
daveMac
  • 3,041
  • 3
  • 34
  • 59
22
votes
1 answer

Hiding raw_input() password input

I want to hide my password but I don't know how. I have seen show="*" and also getpass but I don't know how to place them into this code. I'm using Python 2.7.3 and coding on a Raspberry Pi. ans = True while ans: print(""" …
Steven Sharman
  • 251
  • 1
  • 2
  • 8
21
votes
3 answers

Javascript Input Text Masking without Plugin

I want to mask the text in an input box without changing the actual value. I can not use any plugins. I am currently doing this - but as you can see the issue is that the actual value is changed on submit. How can I just change the display…
user1392897
  • 831
  • 2
  • 9
  • 25
20
votes
1 answer

On Android how do I make oddly shaped clipping areas?

Here is how to create a clipping area the shape of a circle: Path path = new Path(); path.addCircle(200,200,100,Direction.CW); c.clipPath(path); // c is a Canvas Now there's a clipping area on the Canvas which prevents drawing anything outside the…
HappyEngineer
  • 4,017
  • 9
  • 46
  • 60
20
votes
2 answers

Alpha masking in c# System.Drawing?

I'm trying to draw an image, with a source Bitmap and an alpha mask Bitmap, using the System.Drawing.Graphics object. At the moment I loop X and Y and use GetPixel and SetPixel to write the source color and mask alpha to a third Bitmap, and then…
Origamiguy
  • 1,294
  • 2
  • 13
  • 19
18
votes
1 answer

Keras lstm with masking layer for variable-length inputs

I know this is a subject with a lot of questions but I couldn't find any solution to my problem. I am training a LSTM network on variable-length inputs using a masking layer but it seems that it doesn't have any effect. Input shape (100, 362, 24)…
Florian Mutel
  • 1,044
  • 1
  • 6
  • 13
18
votes
1 answer

Reordering factor gives different results, depending on which packages are loaded

I wanted to create a barplot in which the bars were ordered by height rather than alphabetically by category. This worked fine when the only package I loaded was ggplot2. However, when I loaded a few more packages and ran the same code that created,…
eipi10
  • 91,525
  • 24
  • 209
  • 285
17
votes
2 answers

Box-shadow on element with -webkit-mask-image

I have a div with background-image inside another div with -webkit-mask-image, because border-radius was not working on WebKit browsers in this case. If I set a box-shadow to the parent div, it shows up in Firefox but not in Chrome. How can I…
Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
16
votes
2 answers

Using CSS to give a black icon another color

I saw some apps where even though a black icon was included, some how the app used CSS to convert the icon into a different colour. I can't seem to repeat this process Here's my back.css file: .dashboard-buttons a { width: 80px; height:…
John
  • 32,403
  • 80
  • 251
  • 422
15
votes
2 answers

How to input mask value to Convolution1D layer

I need to feed variable length sequences into my model. My model is Embedding + LSTM + Conv1d + Maxpooling + softmax. When I set mask_zero = True in Embedding, I fail to compile at Conv1d. How can I input mask value in Conv1d or is there another…
Jaspn Wjbian
  • 279
  • 3
  • 7
15
votes
3 answers

Pandas best way to subset a dataframe inplace, using a mask

I have a pandas dataset that I want to downsize (remove all values under x). The mask is df[my_column] > 50 I would typically just use df = df[mask], but want to avoid making a copy every time, particularly because it gets error prone when used in…
sapo_cosmico
  • 6,274
  • 12
  • 45
  • 58
14
votes
6 answers

Masking user input in python with asterisks

I am trying to mask what the user types into IDLE with asterisks so people around them can't see what they're typing/have typed in. I'm using basic raw input to collect what they type. key = raw_input('Password :: ') Ideal IDLE prompt after user…
Jackson Blankenship
  • 475
  • 2
  • 7
  • 19
14
votes
3 answers

SKCropNode masking edge anti-aliasing

I created a circular mask and animate a sprite inside the mask by using sprite kit SKCropNode class. But the edge of the mask looks pixellated. Is there a way to use anti-aliasing to smooth the edges?
Rikkas
  • 572
  • 4
  • 19
1
2
3
76 77