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
#!/usr/bin/env python | |
import sys | |
import re | |
commit_regex = '\[#[0-9]+\] : [a-zA-Z ]+(\n[a-zA-Z 0-9.])+' | |
error_message = "\ | |
Aborting commit. Please ensure your commit message meets the standard requirement. \n\n \ |
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
var i=0; | |
while(i<1000000000) i++; | |
// or | |
processImage = function() { | |
// code to do image analysis | |
} |
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
console.log("Hi! "); | |
setTimeout(function() { | |
console.log("tech"); | |
},5000); | |
console.log("I <3 "); |
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
console.log("Hi! "); | |
setTimeout(function() { | |
console.log("tech"); | |
},0); | |
console.log("I <3 "); |
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
console.log("about to do a GET request"); | |
$.get('https://www.google.co.in/search?q=swayam+raina', | |
function(data) { | |
console.log("completed network request"); | |
}); | |
console.log("GET request pushed to WebAPI block"); |
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 a the array in which a run is to be counted and possibly reversed | |
* @param lo index of the first element in the run | |
* @param hi index after the last element that may be contained in the run. | |
It is required that {@code lo < hi}. | |
* @param c the comparator to used for the sort | |
* | |
* @return the length of the run beginning at the specified position in | |
* the specified array |
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
/** | |
* Returns the minimum acceptable run length for an array of the specified | |
* length. | |
* | |
* @param n the length of the array to be sorted | |
* @return the length of the minimum run to be merged | |
*/ | |
private static int minRunLength(int n) { | |
assert n >= 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
Exception in thread "main" java.lang.IllegalArgumentException: Comparison method violates its general contract! | |
at java.util.TimSort.mergeLo(TimSort.java:777) | |
at java.util.TimSort.mergeAt(TimSort.java:514) | |
at java.util.TimSort.mergeForceCollapse(TimSort.java:457) | |
at java.util.TimSort.sort(TimSort.java:254) | |
at java.util.Arrays.sort(Arrays.java:1512) | |
at java.util.ArrayList.sort(ArrayList.java:1454) | |
at java.util.Collections.sort(Collections.java:175) | |
... | |
... |
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 void displayStudents(List<Student> students, Strategy strategy, Filter filter) { | |
if (null != filter) Filter.apply(students, filter); | |
if (null != strategy) { | |
Function strategyFunction = Strategy.getStrategy(strategy); | |
Collections.sort(students, Comparator.comparing(strategyFunction)); | |
} | |
} |
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
RUN 1: | |
+--------------+--------------+ | |
| Type | Time | | |
+--------------+--------------+ | |
| | | | |
| Imperitive | 1ms | | |
| Sequential | 61ms | | |
| Parallel | 4ms | | |
| | | | |
+--------------+--------------+ |
NewerOlder