Found 975 Articles for Software & Coding

How to get empty files in Windows OS using PowerShell?

Chirag Nagrekar
Updated on 30-Mar-2021 13:05:47

1K+ Views

To get the list of empty files in Windows OS using PowerShell, there are two ways, a) Using Length parameter. We will count the length of the file. If it is 0 then the file is empty as shown below.Get-ChildItem C:\Temp\ -Recurse | where{$_.Length -eq 0} | Select @{N='EmptyFiles';E={$_.FullName}}Output:b) Another method is a long one that we don’t want to go into. We need to check each file's content and if it is empty then we will declare that file as an empty file.Get-ChildItem C:\Temp -Recurse -File | foreach{ if((Get-Content $_.FullName) -eq $null){ ... Read More

How to take the backup of environment variables using PowerShell?

Chirag Nagrekar
Updated on 30-Mar-2021 12:53:56

1K+ Views

Sometimes changes in the Windows environment variable can be deadly because it saves information about user profiles, application information, and OS information. It is always better to keep the Environment backup handy and update that file whenever there are any changes or at the regular interval.Taking up the environment variables backup is easy. To retrieve the environment variable list we can use the below command, Get-ChildItem env:To store the environment variable, we can use the Out-File command with text file but if the particular environment variable length is larger enough then we can’t store it in the text file properly.Instead, ... Read More

How to use the ConvertFrom-StringData command in PowerShell?

Chirag Nagrekar
Updated on 30-Mar-2021 14:01:32

1K+ Views

The ConvertFrom-String command converts the String to the Hashtable format as shown below.ExamplePS C:\> "This is string" | ConvertFrom-StringOutputP1 P2 P3 -- -- -- This is stringIn the above example, We haven’t specified any header so that the output is separated the delimiter by space P1, P2 and continuous. By default, this command separates the string with a ‘=’ delimiter as shown below.Example$stringhash = @" Name = Spooler Starttype = Manual Status = Stopped "@ $stringhash | ConvertFrom-StringDataOutputName Value ---- ----- ... Read More

How to add multiple values in the Hashtable using PowerShell?

Chirag Nagrekar
Updated on 30-Mar-2021 13:59:38

3K+ Views

ExampleFor example, we have a below-created hashtable.PS C:\> $servicehash = @{Name='Spooler';State='Stopped';StartType='Automatic'} PS C:\> $servicehashOutputName       Value ----       ----- Name       Spooler StartType  Automatic State      StoppedWe need to add multiple values to the Name Key. If we directly append the value to the key it will treat it as a string and we will not get the desired output. See the example below.ExamplePS C:\> $servicehash.Name += "Winrm" PS C:\> $servicehashOutputName Value ----       ----- Name       SpoolerWinrm StartType  Automatic State      StoppedSo to add the multiple ... Read More

Difference Between 3NF and BCNF

AmitDiwan
Updated on 25-Mar-2021 06:31:13

6K+ Views

In this post, we will understand the difference between 3NF and BCNF.3NFThere shouldn’t be any transitive dependency.There shouldn’t be any non-prime attribute that depends transitively on a candidate key.It is not as strong as BCNF.It has high redundancy.The functional dependencies are already present in INF and 2NF.It is easy to achieve.It can be used to achieve lossless decomposition.BCNFFor any relation A->B, ‘A’ should be a super key of that specific relation.It is stronger than 3NF.The functional dependencies are present in 1NF, 2NF and 3NF.It has low redundancy in comparison to 3NF.The functional dependencies may or may not be preserved.It is ... Read More

Difference Between Linear and Logistic Regression

AmitDiwan
Updated on 25-Mar-2021 05:51:05

1K+ Views

In this post, we will understand the difference between linear regression and logistic regression.Linear RegressionIt helps predict the variable that is continuous, and is a dependent variable.This is done using a given set of independent variables.It extrapolates a line to find the value of dependent variable.Least square methods are used to estimate the accuracy.The best fit line is found, that helps predict the output.It is generally a continuous value.The relation between the dependent variable and independent variable has to be linear.The independent variables may have collinearity between them.It is considered a machine learning problem, i.e an applied statistics problem.Logistic RegressionIt ... Read More

Difference Between Clustered and Non-clustered index

AmitDiwan
Updated on 25-Mar-2021 05:49:21

677 Views

In this post, we will understand the difference between clustered index and non-clustered index.Clustered indexIt is quick.It requires less memory to perform operations.The index is the main data.A table can have one clustered index only.It has inherent ability to store data on the disk.It can store pointers to block not to data.The leaf nodes contain actual data.The clustered key defines the order of data within table.It is a type of index where the table records are physically reordered to match with the index.Non-clustered indexIt is slower.It requires more memory to perform operations.The index is a copy of data.A table can ... Read More

Difference Between Grant and Revoke

AmitDiwan
Updated on 25-Mar-2021 05:46:44

4K+ Views

In this post, we will understand the difference between grant and revoke.GrantIt is a DCL command.It grants permissions to users on database objects.It can also be used to assign access rights to users.For every user, the permissions need to be specified.When the access is decentralized, permission granting is easier.Syntax:grant privilege_name on object_name to {user_name | public | role_name}RevokeIt is a DCL command.It removes permissions if they are granted to users on database objects.It takes away/revokes the rights of the users.If access for a user is removed, all specific permissions provided by that user to others will be removed.If decentralized access ... Read More

Difference Between Array and Pointer

Kiran Kumar Panigrahi
Updated on 20-Feb-2023 15:47:39

10K+ Views

Array and pointers have a very close relationship in programming, but there are several differences between them. Read this article to find out how Arrays are different from Pointers. But let us first discuss some basics of arrays and pointers. What is an Array? An array is one that stores the values of a homogeneous data type. It refers to a collection that consists of elements of homogenous/same data type. Arrays are considered as a primitive data type. They are declared using the '[ ]' and are stored in contiguous memory locations. Also, arrays use subscripts/ '[ ]' (square brackets) ... Read More

Difference Between Array and Structure

Kiran Kumar Panigrahi
Updated on 20-Feb-2023 16:05:22

18K+ Views

Arrays and Structures are two different types of container datatype. The most basic difference between an array and a structure is that an Array can contain the elements of same datatype, while a Structure is a collection that can contain the elements of dissimilar datatypes. Read this article to learn more about Arrays and Structures and how they are different from each other. What is an Array? An array refers to a collection that consists of homogenous elements, i.e. of same data type. Arrays are declared using '[]'. It uses subscripts/ '[ ]' (square brackets) to access the elements. An ... Read More

Advertisements