This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are given a two-digit integer n. Return the sum of its digits. | |
Example | |
For n = 29, the output should be | |
solution(n) = 11. | |
Input/Output | |
[execution time limit] 3 seconds (java) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[Parameter(Position=0, mandatory=$true)] | |
[string] $jsonConfigFilePath, | |
[parameter(mandatory=$false)] | |
[int] $debugLvl = 0, | |
[parameter(mandatory=$false)] | |
[string] $reportFilePath | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fileWordArray = [System.IO.File]::ReadAllLines("C:\Users\joshu\dev\temp\powershell\something.txt") | |
Write-Host "Begin: fileWordArray ----------------------------------------------------------------" | |
Write-Host $fileWordArray | |
Write-Host "Items in file: " $fileWordArray.Length | |
foreach ($word in $fileWordArray) { | |
Write-Host $word | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PowerShell Script to Count Occurrences of Regular Expressions in a File | |
# Specify the path to the file | |
$filePath = "C:\Users\redacted\test.txt" | |
# Define the list of regular expressions to search for | |
$regexPatterns = @("\bwinget\b", "\bmsstore\b", "\bUnknown\b") | |
# Check if the file exists | |
if (Test-Path $filePath) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Input CLI params with default values | |
param ( | |
$number=1, | |
$shape="Square", | |
$color="Blue" | |
) | |
try { | |
# Ordered hash table | |
[hashtable]$hash = [ordered]@{Number = $number; Shape = $shape; Color = $color} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
digitalocean = { | |
source = "digitalocean/digitalocean" | |
version = "~> 2.0" | |
} | |
} | |
} | |
# Set the variable value in *.tfvars file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: true | |
vars_prompt: | |
- name: ssh_username | |
prompt: Enter SSH username | |
private: false | |
- name: tpot_username |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listener wordpresssslv6 { | |
address [ANY]:443 | |
secure 1 | |
keyFile /usr/local/lsws/conf/example.key | |
certFile /usr/local/lsws/conf/example.crt | |
map wordpress example.com, www.example.com | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listener wordpress { | |
address *:80 | |
secure 0 | |
map wordpress example.com, www.example.com | |
} | |
listener wordpressssl { | |
address *:443 | |
secure 1 | |
keyFile /usr/local/lsws/conf/example.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listener wordpress { | |
address *:80 | |
secure 0 | |
map wordpress example.com, www.example.com | |
} | |
listener wordpressssl { | |
address *:443 | |
secure 1 | |
keyFile /usr/local/lsws/conf/example.key |
NewerOlder