Simply mask a UIView with a rectangle

Thanks to the link from MSK, this is the way I went with which works well: // Create a mask layer and the frame to determine what will be visible in the view. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; CGRect maskRect = CGRectMake(0, 0, 50, 100); // Create a path with the rectangle in it. … Read more

Implement an input with a mask

A solution that responds to the input event instead of key events (like keyup) will give a smooth experience (no wiggles), and also works when changes are made without the keyboard (context menu, mouse drag, other device…). The code below will look for input elements that have both a placeholder attribute and a data-slots attribute. … Read more

How can I mask a UIImageView?

There’s an easier way. #import <QuartzCore/QuartzCore.h> // remember to include Framework as well CALayer *mask = [CALayer layer]; mask.contents = (id)[[UIImage imageNamed:@”mask.png”] CGImage]; mask.frame = CGRectMake(0, 0, <img_width>, <img_height>); yourImageView.layer.mask = mask; yourImageView.layer.masksToBounds = YES; For Swift 4 and plus follow code below let mask = CALayer() mask.contents = UIImage(named: “right_challenge_bg”)?.cgImage as Any mask.frame = … Read more

Update row values where certain condition is met in pandas

I think you can use loc if you need update two columns to same value: df1.loc[df1[‘stream’] == 2, [‘feat’,’another_feat’]] = ‘aaaa’ print df1 stream feat another_feat a 1 some_value some_value b 2 aaaa aaaa c 2 aaaa aaaa d 3 some_value some_value If you need update separate, one option is use: df1.loc[df1[‘stream’] == 2, ‘feat’] … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)