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
import asyncio | |
from itertools import islice | |
from typing import List, Callable | |
def chunk(arr_range, arr_size): | |
arr_range = iter(arr_range) | |
return iter(lambda: tuple(islice(arr_range, arr_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
package com.emma.recursion | |
import java.time.LocalDateTime | |
import java.time.format.DateTimeFormatter | |
import java.time.temporal.ChronoUnit.* | |
/** | |
* How to neatly show duration of a function execution in kotlin | |
*/ | |
fun timer(f: () -> Unit) { |
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
package com.emma.recursion | |
import kotlin.test.assertEquals | |
/** | |
* Insert items to a binary tree | |
* | |
* The side effect is, if the tree is printed with an inorder traversal, the items are sorted in asc order | |
* | |
* Worst complexity: n * log(n) (balanced) |
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
import java.util.*; | |
/** | |
* Check if a string has balanced braces, brackets and curly brackets | |
* | |
* Key Note: Use a stack data structure. Only pop when the stack top == current item in the string, else | |
* push | |
* | |
* @author emmanuel | |
*/ | |
class Solution { |
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
""" | |
This is code in python to test android hybrid applications using appium/selenium | |
The device in context is android 5.0 emulator. | |
Preconditions: | |
Install python appium client: pip install Appium-Python-Client source: https://github.com/appium/python-client | |
Install appium: npm install -g [email protected] | |
Install selenium: pip install -U selenium | |
On your terminal, run appium: appium |