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
{ | |
"require-dev": { | |
"phpunit/phpunit": "4.1.*" | |
}, | |
"autoload": { | |
"classmap": ["web/"] | |
} | |
} |
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
public class CalculateSize<T> { | |
public int sizeOf(Iterable<T> items) { | |
int size = 0; | |
if (items instanceof Collection) { | |
size = Collection.class.cast(items).size(); | |
} else { | |
for (Object item : items) { | |
size++; | |
} | |
} |
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
find . -iname '*.jp*g' -print0 \ | |
| xargs -0 -L 1 -I @ identify -format '%[EXIF:DateTime] %d/%f\n' @ \ | |
| egrep '^[[:digit:]]{4}:04' \ | |
| cut -d' ' -f3- \ | |
| tar -cf april.tar -T - |
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
*** Settings *** | |
Library String | |
*** Testcases *** | |
Stable test | |
Should Be True ${True} | |
Unstable test | |
${bool} = random_boolean | |
Should Be True ${bool} |
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
//Step 1 :: Index data | |
DELETE demo | |
POST demo/product/ | |
{ | |
"brand": "BrandA", | |
"id" : "Pro 005", | |
"name": "Meo", | |
"barcode" : "000051", | |
"unit" : 1 |
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
BufferedReader reader = new BufferedReader( new FileReader (file)); | |
String line = null; | |
StringBuilder output = new StringBuilder(); | |
while( ( line = reader.readLine() ) != null ) { | |
output.append(line); | |
} |
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
*** Variables *** | |
${BASE_URL} url1 | |
${BASE URL} url2 | |
${BASEURL} url3 | |
*** Testcases *** | |
Hello scalar variable | |
Log to console ${BASE_URL} | |
Log to console ${BASE URL} | |
Log to console ${BASEURL} |
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
abstract class Employee { | |
public int id; | |
public abstract void accept(EmployeeVisitor employeeVisitor); | |
} | |
class HourEmployee extends Employee { | |
@Override | |
public void accept(EmployeeVisitor employeeVisitor) { |
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 :: A | |
OutPut | |
A | |
Input :: B | |
Output | |
A | |
B B | |
A |
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
Range has a lot of nifty issues. | |
integer range contains | |
[2,6) contains {2,4} | |
[2,6) doesn't contain {-1,1,6,10} | |
getAllPoints? | |
[2,6) allPoints = {2,3,4,5} | |
ContainsRange? | |
[2,5) doesn't contain [7,10) | |
[2,5) doesn't contain [3,10) |