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
$QueueName = "myQueue" | |
$TopicName = "myTopic" | |
$Region = "us-west-2" | |
$SNSUserAccountID = (Get-EC2SecurityGroup -GroupNames "default")[0].OwnerId | |
$QueueURL = New-SQSQueue -QueueName $QueueName -Region $Region | |
$QueueARN = (Get-SQSQueueAttribute -QueueUrl $QueueURL -AttributeName QueueArn).Attributes['QueueArn'] | |
$TopicARN = New-SNSTopic -Name $TopicName -Region $Region | |
$Sid = "Sid" + (Get-Random) |
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
Function Store-Object($Object, $BucketName, $Key) { | |
$ObjectFilePath = "$env:temp\object$(get-random).xml" | |
$Object | Export-Clixml -Path $ObjectFilePath | |
Write-S3Object -BucketName $BucketName -File $ObjectFilePath -Key $Key | |
Remove-Item $ObjectFilePath | |
} | |
Function Retrieve-Object ($BucketName, $Key) { | |
$ObjectFilePath = "$env:temp\object$(get-random).xml" |
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
def fib1(n): | |
# Using array operations | |
fibArr = [0,1,1] | |
for i in range(0, n): | |
fibArr.pop(0) | |
fibArr.append(fibArr[0] + fibArr[1]) | |
return fibArr[0] | |
def fib2(n): | |
# Using a recursive inner function |