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
#!/bin/sh | |
# this will exit the script if any command fails | |
set -e | |
set -o pipefail | |
## FOLLOW THIS STEPS FIRS TO SET EVN VARIABLE FOR THE FOLLOWING COMMANDS | |
# Set android home path | |
export ANDROID_HOME=~/Library/Android/sdk |
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
@Singleton | |
class ApiFactory @Inject constructor() { | |
/** | |
* [apiBaseUrl] | |
* because we are adding it from parameter in the request | |
* */ | |
private val apiBaseUrl = BuildConfig.BASE_URL | |
private var retrofit: Retrofit? = null |
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.io.* | |
import java.util.zip.ZipFile | |
/** | |
* UnzipUtils class extracts files and sub-directories of a standard zip file to | |
* a destination directory. | |
* | |
*/ | |
object UnzipUtils { |
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
interface Reader { | |
fun read():Char | |
} | |
interface Writer { | |
fun write(ch Char) | |
} | |
public fun copy(r Reader, w Writer ){ | |
var ch Char |
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
enum OutputDevice {PRINTER, DISK} | |
public fun copy(OutputDevice dev){ | |
val c:int | |
while((c=readKeyBoard)!=EOF){ | |
if(dev==PRINTER) | |
{ | |
writePrinter(c) | |
}else{ | |
writeToDisk(c) |
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
interface Robot { | |
fun reset() | |
} | |
interface Flyable { | |
fun fly() | |
} | |
interface Talkable { | |
fun talk() |
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
interface Robot { | |
fun reset() | |
fun fly() | |
fun talk() | |
} | |
class ButterflyRobot : Robot { | |
override fun reset() { | |
TODO("not implemented") |
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 interface Car { | |
void accelerate(); | |
} | |
public interface EngineType { | |
void turnOnEngine(); | |
} | |
/***********************/ |
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 ElectricCar implements Car { | |
public void turnOnEngine() { | |
throw new AssertionError("I don't have an engine!"); | |
} | |
public void accelerate() { | |
//this acceleration is crazy! | |
} | |
} |
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 interface Car { | |
void turnOnEngine(); | |
void accelerate(); | |
} | |
public class MotorCar implements Car { | |
private Engine engine; |
NewerOlder