Print All N-Digit Strictly Increasing Numbers in C++

sudhir sharma
Updated on 22-Jan-2020 10:36:09

401 Views

In this problem, we are given a number N and we have to print all n-digit numbers whose digits are strickly increasing from MSB to LSB i.e. the number at LSB (left) should be smaller than the number at right.Let’s take an example to understand the problem −Input − n = 2Output −01 02 03 04 05 06 07 08 09 12 13 14 15 16 17 18 19 23 24 25 26 27 28 29 34 35 36 37 38 39 45 46 47 48 49 56 57 58 59 67 68 69 78 79 89.Explanation − as you ... Read More

Get All Processes on Local Computer Using Get-Process Command in PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:35:52

6K+ Views

To get the threads of the running processes in the server using PowerShell you need to use Get-Process command. When you run this command default fields (ProcessName, Id, SI, CPU(s), WS(K), PM(K), NPM(K), Handles) will be displayed as a table.CommandGet-processOutputHandles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName -------  ------    -----      -----     ------     --  -- -----------     502      27     9796      19340       1.72   6320   1 AcroRd32     640      52   112028     ... Read More

Use of Get-Process Command in PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:34:31

705 Views

Get-Process is a PowerShell cmdlet which used to get all the instances of the running background processes in the windows terminal. Whichever processes are displayed in the Task Manager Processes tab, all their threads can be displayed in the PowerShell console through Get-Process command.

Start Dependent Services in PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:33:58

821 Views

To start dependent service in PowerShell, it is unlike the stopping the dependent services with –Force parameter because there is no –Force parameter is available.You need to first get the dependent services and then start them.Get-Service -Name Winmgmt -DependentServices | Start-Service -Verbose

Start Multiple Windows Services Using PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:33:25

3K+ Views

To start multiple services with PowerShell, we need to use comma (,) between services.For example,Start-Service -Name Spooler,AdobeARMservice -VerboseGet-Service -Name Spooler,AdobeARMservice | Start-Service -VerboseTo start the services with display name,Start-Service -Name “Print Spooler”, “Work Folder” -Verbose Get-Service -Name “Print Spooler”, “Work Folder” | Start-Service -Verbose

Print All Nodes at Distance K from a Given Node in C++

sudhir sharma
Updated on 22-Jan-2020 10:32:32

488 Views

In this problem, we are given a binary tree, a target node and an integer K. We have to print all the nodes of the tree that are at a distance K from the target node.Binary Tree is a special tree whose each node has at max two nodes (one/two/none).Let’s take an example to understand the problemK = 2Target node: 9Output −5 1 3.Explanation −The distance can be taken for node a higher, lower or at the same level. So, we will return nodes accordingly.To solve this problem we have to understand what are the types of nodes that are ... Read More

Start Windows Service with Display Name in PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:32:28

857 Views

To stop the service using display name, use the parameter –DisplayName.For Example,PS C:\> Start-Service -DisplayName "Print Spooler" -Verbose VERBOSE: Performing the operation "Start-Service" on target "Print Spooler (Spooler)".You can also start the service with display name using,PS C:\> Get-Service -DisplayName "Print Spooler" | Start-Service -Verbose

Stop Service with Dependent Services in PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:26:00

2K+ Views

To stop the service which has dependent service in PowerShell -Force parameter is used. First, we will check what are the dependent services for specific service, to get them -DependentService parameter is used.ExampleFor example, WMI service (Name: Winmgmt) has multiple dependent services.Get-Service -Name Winmgmt -DependentServicesOutputtatus   Name           DisplayName ------   ----           ----------- Running  UALSVC           User Access Logging Service Stopped  smstsmgr           ConfigMgr Task Sequence Agent Stopped  SepLpsService      Symantec Endpoint Protection Local ... Stopped  NcaSvc           ... Read More

Print All Nodes Between Two Given Levels in Binary Tree in C++

sudhir sharma
Updated on 22-Jan-2020 10:23:32

232 Views

In this problem, we are given a binary tree and two levels in the tree (upper and lower) and we have to print all nodes between upper and lower levels of the tree.The binary tree is a special tree whose each node has at max two nodes (one/two/none).Let’s take an example to understand the problem −upper − 1lower − 3Output −6 3 9 7 4 8 10To solve this problem, we have to print nodes of the tree at a given level. We will call a recursive function using a loop from the upper to lower level in the tree.This algorithm is simple ... Read More

Start a Windows Service Using PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:23:19

3K+ Views

To start a specific windows service, you need to use Start-Service command.ExampleStart-Service -Name SpoolerAbove command, will start the service name spooler. To check if service is started, use Get-Service –Name Spooler command.OutputStatus Name DisplayName ------ ---- ----------- Running spooler Print SpoolerThis command will not show the command progress. To check the command progress, use –Verbose parameter.PS C:\> Start-Service -Name Spooler -Verbose VERBOSE: Performing the operation "Start-Service" on target "Print Spooler (Spooler)".You can also start the service with, Get-Service -Name Spooler | Start-Service -Verbose PS C:\> Get-Service -Name Spooler | Start-Service -Verbose VERBOSE: Performing the operation "Start-Service" on target "Print Spooler ... Read More

Advertisements