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
4
votes
1 answer

CGImage Masking with UIImage pngData()

I'm trying to mask an image in swift. Here's my code: (Normally, originalImg is an image that is loaded from UIImagePickerController and then cropped by UIGraphicsGetImageFromCurrentImageContext(), and makedImage is an image that is drawn by the…
KeroppiMomo
  • 564
  • 6
  • 18
4
votes
2 answers

Numpy array loses shape after applying mask across axis

Problem I have np.array and mask which are of the same shape. Once I apply the mask, the array loses it shape and becomes 1D - flattened one dimensional. Question I am wanting to reduce my array across some axis, based on a mask of axis length…
Max Collier
  • 573
  • 8
  • 24
4
votes
1 answer

Please include phone-type-formatter.{country}.js lib

I am trying to use the phone mark with React, but I am getting the error Please include phone-type-formatter.{country}.js lib. This is how I've attempted: import CleavePhone from "cleave.js/src/addons/phone-type-formatter.i18n"; // and also import…
user4383363
4
votes
1 answer

How to Concatenate 2 Embedding layers with 'mask_zero=True' in Keras2.0?

I have two Embedding layers, one assigned mask_zero=True, the other not, as defined bellow. a = Input(shape=[30]) b = Input(shape=[30]) emb_a = Embedding(10, 5, mask_zero=True)(a) emb_b = Embedding(20, 5, mask_zero=False)(b) cat =…
Geralt Xu
  • 41
  • 1
  • 2
4
votes
1 answer

How to use the result of embedding with mask_zero=True in keras

In keras, I want to calculate the mean of nonzero embedding output. I wonder what is the difference between mask_zero=True or False in Embedding Layer. I tried the code below : input_data = Input(shape=(5,), dtype='int32',…
user9680322
  • 41
  • 1
  • 2
4
votes
2 answers

masking, or clipping mask with p5.js

I want to use one shape (for instance a rectangle) to act as a mask or clipping path for another shape (for instance a circle, or line) in P5.js I can see solutions for using images as masks, but not shapes. It seems mask() is not a function of…
amcc
  • 523
  • 5
  • 16
4
votes
1 answer

Mask numpy array evaluating nan as True

Consider a numpy array with the data: aa = np.array([-4.793, -1.299, 0.453, np.nan, np.nan, 1.131, 0.684, 1.037]) I need to create a mask like so: mask = -4. < aa which evaluates to array([False, True, True, False, False, True, True, True],…
Gabriel
  • 40,504
  • 73
  • 230
  • 404
4
votes
2 answers

what some ways to mask a mysqldump?

anybody knows efficiency in masking(anonymization) of some tables in a mysqldump? I have already finished my parser but unfortunately it doesn't work that good on big dumps (let say a dump of 1GB++) because it really increases the dump time due to…
poymode
  • 1,479
  • 3
  • 11
  • 14
4
votes
2 answers

How do I unmask a link from my domain masked site to an external site?

I registered domain www.a.com I then forwarded with masking (using GoDaddy) traffic from www.a.com to www.really.long.url.com, so users will only see www.a.com in their address bar when visiting my site. The problem, is that if a user clicks a link…
Cory Klein
  • 51,188
  • 43
  • 183
  • 243
4
votes
1 answer

How use ngMask in md-datepicker

I am trying to use ngMask with material datepicker and is not working. Anyone, has any idea how to put it to work together ? Some ngMask examples: http://candreoliveira.github.io/bower_components/angular-mask/examples/index.html#/
Thalles Noce
  • 791
  • 1
  • 9
  • 20
4
votes
2 answers

How can I do this python list comprehension in NumPy?

Let's say I have an array of values, r, which range anywhere from 0 to 1. I want to remove all values that are some threshold value away from the median. Let's assume here that that threshold value is 0.5, and len(r) = 3000. Then to mask out all…
pretzlstyle
  • 2,774
  • 5
  • 23
  • 40
4
votes
1 answer

Masking an image to make it a view like binocular

I have been trying to get an output where an image is masked inside a binocular shaped element. The circular part moves with the mouse cursor and wherever the mouse goes it reveals the part of the image. Also need to set the mouse doesnt go out of…
undefinedtoken
  • 921
  • 1
  • 8
  • 26
4
votes
1 answer

Simulink: Control Variant Subsystems Using Mask

I would like to find a simple process for switching the model innards under a mask using the mask parameters. This question has expanded enough such that it has been reimplemented here. Variant subsystems are an excellent method and can be…
kando
  • 441
  • 4
  • 16
4
votes
2 answers

Time validation 24h-Format in jQuery Mask Plugin

I am trying to use the jQuery Mask Plugin by Igor Escobar for time validation: $("input").mask("Hh:Mm",{ translation: { 'H': { pattern: /[0-2]/ }, 'h': { pattern: /[0-9]/ }, 'M': { pattern: /[0-5]/ }, 'm': { pattern:…
eurocups
  • 51
  • 1
  • 4
4
votes
1 answer

Cairo masking - is there something I'm missing?

So I'm trying to set up a mask in Cairo, but can't get it to make any difference. Below I have a simple program based off the one here: http://snipplr.com/view/22584/cairo-hello-world-examble/. I'm setting a completely transparent mask so nothing…
Chris
  • 6,642
  • 7
  • 42
  • 55