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
[ | |
{ | |
"type": "Resource", | |
"resourceChange": { | |
"policyAction": "ReplaceAndDelete", | |
"action": "Modify", | |
"logicalResourceId": "TestAppMonitor", | |
"physicalResourceId": "TestAppMonitor", | |
"resourceType": "AWS::RUM::AppMonitor", | |
"replacement": "True", |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "CWACloudWatchServerPermissions", | |
"Effect": "Allow", | |
"Action": [ | |
"cloudwatch:PutMetricData", | |
"ec2:DescribeVolumes", | |
"ec2:DescribeTags", |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "CWACloudWatchPermissions", | |
"Effect": "Allow", | |
"Action": [ | |
"cloudwatch:PutMetricData", | |
"ec2:DescribeTags", | |
"logs:PutLogEvents", |
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
<script crossorigin='anonymous' src='https://dcupkcmoyuvm5.cloudfront.net/runtime-db3ced03541c6a1dba73.js'></script> | |
<script crossorigin='anonymous' src='https://dcupkcmoyuvm5.cloudfront.net/pages-074ae03aaa397e157edc.js'></script> | |
<script crossorigin='anonymous' src='https://dcupkcmoyuvm5.cloudfront.net/nodes-empty-states-image-chrome-f42fa5df0e74c8aaa91c.js'></script> | |
<script crossorigin='anonymous' src='https://dcupkcmoyuvm5.cloudfront.net/dialogs-678c6bdbd3b98c546e3a.js'></script> | |
<script crossorigin='anonymous' src='https://dcupkcmoyuvm5.cloudfront.net/jquery-lodash-3809ac86f28ed37b84b5.js'></script> | |
<script crossorigin='anonymous' src='https://dcupkcmoyuvm5.cloudfront.net/clouddrive-flux-adapters-1981fc80a7972ac1ec20.js'></script> | |
<script crossorigin='anonymous' src='https://dcupkcmoyuvm5.cloudfront.net/moment-92a69cf17837993ab7e3.js'></script> | |
<script crossorigin='anonymous' src='https://dcupkcmoyuvm5.cloudfront.net/react-virtualized-f223c90cce2a7c654658.js'></script> | |
<script crossorigin='anonymous' sr |
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
/** | |
* 2. 給兩個相同長度的integer array, 分別表示從A城市到B城市每天去程和回程的票價. | |
* 要找出來回票價加總最便宜是多少,規定不能同天來回, 回程要在去程之後. | |
* 舉例: departure=[10, 8, 9, 11, 7], arrival=[8, 8, 10, 7, 9], | |
* 那結果是15 (departure[1] + arrival[3] = 8 + 7 = 15) | |
*/ | |
public class CheapestFlights { | |
public int cheapeast(int[] from, int[] to) { | |
} |
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
class Solution { | |
public int longestOnes(int[] nums, int k) { | |
int n = nums.length; | |
int countOfZero = 0; | |
int longest = 0; | |
//. s | |
// [0,1,1,0,0,0,1,1,1,1,0] |
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
/** | |
* Definition for a binary tree node. | |
* public class TreeNode { | |
* int val; | |
* TreeNode left; | |
* TreeNode right; | |
* TreeNode() {} | |
* TreeNode(int val) { this.val = val; } | |
* TreeNode(int val, TreeNode left, TreeNode right) { | |
* this.val = val; |
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
class Solution { | |
// Tree level-traversal | |
// Graph - BFS | |
public List<Integer> rightSideView(TreeNode root) { | |
if (root == null) return Collections.emptyList(); | |
List<Integer> results = new ArrayList<>(); | |
Deque<TreeNode> queue = new LinkedList<>(); | |
queue.add(root); |
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
private def logTempDiskSpace() = { | |
val tempDirectory = new File(System.getProperty("java.io.tmpdir")) | |
val tempDirectoryPath = tempDirectory.getCanonicalPath | |
val tempDirectorySize = FileUtils.byteCountToDisplaySize(FileUtils.sizeOfDirectory(tempDirectory)) | |
logger.debug(s"Temp directory [$tempDirectoryPath] with size $tempDirectorySize") | |
tempDirectory.listFiles().toList.foreach(file => { | |
if (file.isDirectory) { | |
val directorySize = FileUtils.byteCountToDisplaySize(FileUtils.sizeOfDirectory(file)) | |
logger.debug(s"${file.getName} - $directorySize") |
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
// sliding[B >: A](size: Int, step: Int = 1): GroupedIterator[B] | |
// Returns an iterator which presents a "sliding window" view of another iterator. | |
// The first argument is the window size, and the second is how far to advance the window on each iteration; defaults to 1. | |
// Example usages: | |
// Returns List(List(1, 2, 3), List(2, 3, 4), List(3, 4, 5)) | |
(1 to 5).iterator.sliding(3).toList | |
// Returns List(List(1, 2, 3, 4), List(4, 5)) | |
(1 to 5).iterator.sliding(4, 3).toList | |
// Returns List(List(1, 2, 3, 4)) |
NewerOlder