Require a blank line after blocks.
function () {
for (var i = 0; i < 2; i++) {
if (true) {
return false;
}| // ---- | |
| // libsass (v3.2.5) | |
| // ---- | |
| $placeholder-name: 'foo'; | |
| @for $i from 1 through 4 { | |
| %#{$placeholder-name}-#{$i} { | |
| content: $i; | |
| } |
| getCommonAncestor: function(headSha, baseBranch) { | |
| return new Bluebird(function(resolve) { | |
| var command = "bash -c 'diff -u <(git rev-list --all " + headSha + ") "+ | |
| "<(git rev-list --first-parent " + baseBranch+")' "+ | |
| "| sed -ne 's/^ //p' | head -1"; | |
| execute(command, function(data) { | |
| resolve(data); | |
| }); | |
| }); |
| /* | |
| Given two images of equal size, whose dimensions are square with edge length of a power of 2, | |
| calculate the overlap of those imagesin O(log(N)) average case where N is the number of pixels. | |
| n1 = | |
| +----+----+ | |
| | 2 | 3 | | |
| +----|----| | |
| | 2 | 2 | | |
| +----|----+ |
| Get-ChildItem –Recurse –Include *.jpg,Desktop.ini,thumbs.db –Force | Remove-Item -force #–whatif | |
| # pulled from http://guyellisrocks.com/powershell/powershell-script-to-remove-empty-directories/ | |
| $items = Get-ChildItem -Recurse | |
| foreach($item in $items) | |
| { | |
| if( $item.PSIsContainer ) | |
| { | |
| $subitems = Get-ChildItem -Recurse -LiteralPath $item.FullName | |
| if($subitems -eq $null) |
| /*Question: | |
| Given a non-negative integer k and an array a containing random integers, determine the number of instances where two integers in the array have a numerical difference of k. | |
| Do not assume anything about the given inputs unless it is strictly stated. | |
| Example 1: | |
| k = 4 | |
| a = [ 1, 1, 5, 6, 9, 16, 27] |
| <?php | |
| /* | |
| d = ['cat', 'cats', 'bat', 'beetle'] | |
| similar(q, d): | |
| .... | |
| returns all words from d with edit distance 1 | |
| similar('cat', d) --> ['cat', 'cats', 'bat'] |
| <?php | |
| // $a[0] = [ 1, 2, 3, 4] | |
| // $a[1] = [ 5, 6, 7, 8] | |
| // $a[2] = [ 9, 10, 11, 12] | |
| // $a[3] = [13, 14, 15, 16] | |
| // 1 2 3 4 8 12 11 10 9 5 6 7 | |
| /* | |
| 0,0 3,2 |
| <?php | |
| /* | |
| INPUT: | |
| - an unsorted array of integers, A | |
| - an integer q, where 0 < q <= A.size | |
| OUTPUT: | |
| - find the q_th smallest element in A | |
| /*Implement a function which answers whether a given string matches a provided pattern. The pattern is written in a small regex-like language, consisting of: | |
| - Lowercase latin characters (a to z) | |
| - . (dot), which matches any latin character. | |
| - *, indicates that the previous character is repeated 0 or more times. | |
| - +, indicates that the previous character is repeated 1 or more times. | |
| You can assume that the input pattern is well formed and the string to match consists of lowercase latin characters only. | |
| Examples: |