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 android.os.AsyncTask; | |
import android.os.Bundle; | |
import android.support.annotation.Nullable; | |
import android.support.v4.app.Fragment; | |
public abstract class RetainedAsyncTask<Params, Progress, Result> extends Fragment | |
{ | |
private AsyncCustom asyncCustom; |
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 CheckableLinearLayout extends LinearLayout implements Checkable { | |
private static final int[] CHECKED_STATE_SET = {android.R.attr.state_checked}; | |
private boolean mChecked; | |
public CheckableLinearLayout(Context context) { | |
super(context); | |
} | |
public CheckableLinearLayout(Context context, AttributeSet attrs) { |
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 mastermind | |
data class Evaluation(val rightPosition: Int, val wrongPosition: Int) | |
fun evaluateGuess(secret: String, guess: String): Evaluation { | |
var rightPos = 0 | |
var wrongPos = 0 | |
if (secret == guess) { | |
return Evaluation(4, 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
#ifdef _WIN32 | |
// Use discrete GPU by default. | |
extern "C" { | |
// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf | |
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; | |
| |
// http://developer.amd.com/community/blog/2015/10/02/amd-enduro-system-for-developers/ | |
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; | |
} | |
#endif |