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 LazySingleton { | |
private LazySingleton() { | |
} | |
private static volatile LazySingleton sInstance; | |
public static LazySingleton INSTANCE() { | |
if (sInstance == 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
package com.zala.model; | |
import android.os.Parcel; | |
import android.os.Parcelable; | |
import android.util.SparseArray; | |
/** | |
* https://gist.github.com/kaushikgopal/9eea148a2188dc58fe37 | |
*/ | |
public class ParcelableSparseArray<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
"""A video iterator in Keras. | |
Use it like any other iterators. | |
Author: Yuhuang Hu | |
Email : duguyue100@gmail.com | |
""" | |
from __future__ import print_function | |
import os | |
import shutil |
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.content.Intent; | |
import android.os.Bundle; | |
import android.os.Parcel; | |
import android.os.Parcelable; | |
import android.util.SparseArray; | |
import junit.framework.TestCase; | |
public class ParcelableSparseArray | |
extends SparseArray<Object> |
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 RxBus { | |
private static RxBus sInstance; | |
private final Relay<Object> mBus = PublishRelay.create().toSerialized(); | |
public static RxBus getInstance() { | |
if (sInstance == null){ | |
sInstance = new RxBus(); | |
} |
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
// Dagger 1 example | |
@Module( | |
complete = false, | |
library = true | |
) | |
public final class ApiModule { | |
@Provides | |
@Singleton | |
Retrofit provideRetrofit(Gson gson, Application app) { | |
return new Retrofit.Builder() |
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 | |
public class RealmManager { | |
private ThreadLocal<Realm> realms; | |
@Inject | |
public RealmManager() { | |
realms = new ThreadLocal<>(); | |
} | |
public Realm openRealm() { |
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
apply plugin: 'jacoco' | |
apply plugin: 'idea' | |
jacoco { | |
toolVersion = "0.7.0.201403182114" | |
} | |
jacocoTestReport { | |
reports { | |
xml.enabled = true |
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
/* | |
* Copyright (C) 2017 Darel Bitsy | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
OlderNewer