Go to the Picture-in-Picture Extension (by Google). Click Add to Chrome. Click Add Extension. Find a video you want to watch. Click the picture-in-picture icon in the Chrome toolbar. The video will pop out and keep playing while you have different programs open. You must keep the original video tab open in Chrome to watch in picture-in-picture. Thanks to LifeWire.com […]
Tag: use
How to use if else block to decide style in Razor
Declare a local variable at the beginning of the View: @{ var yourStyle = “”; if(Model.Condition) { yourStyle = “float:left;”; //specific conditions and logic } else { yourStyle = “float:right;”; //any other conditions and logic } } and then just use it in your div: <div style=”@yourStyle”>
How to get session value in Javascript
<script> let mySession = ‘<%= Session[“SessionName”].ToString() %>’; //use your session … console.log(mySession); alert(mySession); </script>
How to hide letters with asterisks except first letter in SQL
The easiest way to do that is using a function CREATE FUNCTION [dbo].[HideNameWithAsterisks](@Name varchar(max)) RETURNS varchar(MAX) AS BEGIN DECLARE @loop int = LEN(@Name) WHILE @loop > 1 SELECT @Name = STUFF(@Name, @loop, 1, CASE WHEN SUBSTRING(@Name, @loop – 1, 2) like ‘% ‘ THEN ‘ ‘ WHEN SUBSTRING(@Name, @loop – 1, 2) like ‘ %’ […]
How to use Stopwatch in C#
The Stopwatch object is often used to measure how long things take. One quick thing to remember here is that it will take the time for everything you do between starting and stopping it, so make sure you only put the actual code you want to time between those.
How to use Replicate function for masking in SQL?
You can use SQL “Replicate” command to mask the data. Below code shows how to make it: