This file contains hidden or 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 final class MyListenable extends SomeBaseClass implements Observable { | |
private final UpdateDispatcher updateDispatcher; | |
public MyListenable() { | |
// Original constructor code here... | |
updateDispatcher = Observables.updateDispatcher(new Bridge()); | |
} | |
// Original class body here... including: |
This file contains hidden or 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 ViewClickedObservable extends BaseObservable | |
implements View.OnClickListener { | |
@Override | |
public void onClick(View v) { | |
dispatchUpdate(); | |
} | |
} |
This file contains hidden or 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
// For type clarity only, the following are smaller, reused operators: | |
Function<String, DataBlob> urlToBlob = …; | |
Function<DataBlob, List<ItemBlob>> blobToItemBlobs = …; | |
Predicate<ItemBlob> activeOnly = …; | |
Function<ItemBlob, UiModel> itemBlobToUiModel = …; | |
Function<List<UiModel>, List<UiModel>> sortByDateDesc = …; | |
Function<String, List<UiModel>> urlToUiModels = | |
Functions.functionFrom(String.class) | |
.apply(urlToBlob) |
This file contains hidden or 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 MyUpdatableActivity extends Activity implements Updatable { | |
private Observable observable; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
observable = new MyObservable(); | |
} | |
@Override |
This file contains hidden or 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 AgeraActivity extends Activity | |
implements Receiver<Bitmap>, Updatable { | |
private static final ExecutorService NETWORK_EXECUTOR = | |
newSingleThreadExecutor(); | |
private static final ExecutorService DECODE_EXECUTOR = | |
newSingleThreadExecutor(); | |
private static final String BACKGROUND_BASE_URL = | |
"http://www.gravatar.com/avatar/4df6f4fe5976df17deeea19443d4429d?s="; | |
private Repository<Result<Bitmap>> background; |
This file contains hidden or 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
/** | |
* Fast Campus 안드로이드 앱 개발 입문 캠프 | |
* Java for Android (by mindwing) | |
* [5일차] 강의노트 | |
* 도전과제3 - 주어진 라인수만큼 직각삼각형 모양 출력 | |
*/ | |
public class D5_Challenge_3 { | |
public static void main(String[] args) { | |
} | |
} |
This file contains hidden or 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
/** | |
* Created by mindwing on 2016-01-04. | |
*/ | |
public class FactorialTest { | |
static int factorial(int f) { | |
if (f == 0) { | |
return 1; | |
} else { | |
return f * factorial(f - 1); | |
} |
This file contains hidden or 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.ArrayList; | |
/** | |
* Created by mindwing on 2016-01-02. | |
* 완전순열 | |
*/ | |
public class Test { | |
public static void main(String[] args) throws Exception { | |
ArrayList<String> arr = new ArrayList<>(); |
This file contains hidden or 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 AnsiColor { | |
public static final String ANSI_RESET = "\u001B[0m"; | |
public static final String ANSI_BLACK = "\u001B[30m"; | |
public static final String ANSI_RED = "\u001B[31m"; | |
public static final String ANSI_GREEN = "\u001B[32m"; | |
public static final String ANSI_YELLOW = "\u001B[33m"; | |
public static final String ANSI_BLUE = "\u001B[34m"; | |
public static final String ANSI_PURPLE = "\u001B[35m"; | |
public static final String ANSI_CYAN = "\u001B[36m"; | |
public static final String ANSI_WHITE = "\u001B[37m"; |
This file contains hidden or 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 cosmos.aquila; | |
/** | |
* Created by mindwing on 2015-12-13. | |
* Altair 는 독수리자리(Aquila)의 알파성(가장 밝은 별)입니다. | |
*/ | |
public class Altair { | |
public String getName() { | |
return "독수리자리-알타이르(견우)"; | |
} |