- [Data Structures] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#data-structures)
- [Linked Lists] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#linked-lists)
- [Trees] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#trees)
- [Binary Trees] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#binary-trees)
- [Binary Search Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#binary-search-tree)
- [Red-Black Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#red-black-tree)
- [AVL Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#avl-tree)
- [Tries] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#tries)
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
class Main { | |
public static void main(String[] args) { | |
for(int i=0; i<26; i++){ | |
System.out.print(getAlphabetsAZ()[i]); | |
} | |
} | |
public static char[] getAlphabetsAZ(){ | |
char[] alphabetArr=new char[26]; | |
int x=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
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
// Only set fragment when saved instance is null | |
if(savedInstanceState==null) { | |
FragmentManager fragmentManager = getSupportFragmentManager(); | |
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); |
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
# Created by https://www.gitignore.io/api/android,intellij+iml | |
### Android ### | |
# Built application files | |
*.apk | |
*.ap_ | |
# Files for the ART/Dalvik VM | |
*.dex |
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
android { | |
... | |
signingConfigs { | |
release { | |
storeFile file("someDirectory/my_keystore.jks") | |
storePassword "my_store_pass_here" | |
keyAlias "my_key_alias_here" | |
keyPassword "my_key_pass_here" | |
} |
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 MyActivity extends AppCompatActivity { | |
private DummyAsyncTask dummyAsyncTask = new DummyAsyncTask(new DummyAsyncTask.StatusCallback() { | |
@Override | |
public void progressStarted() { | |
} | |
@Override | |
public void onProgress(int progress) { |
In RxRoom
, Flowable
will always emit atleast one item, so using single()
and isEmpty()
functions won't work as expected.
So, the one where you are checking if projects are cached or not using isEmpty()
function, room will still emit one item which would be an empty list object. This happens because even if no values exist in db, Room will still create an empty list first and then try to populate it if any items exist. Finally, it would emit the list object even if it is empty.
You can resolve this issue by updating the areProjectsCached()
function in ProjectsCacheImpl.kt
like this:
override fun areProjectsCached(): Single<Boolean> =
projectsDatabase.cachedProjectsDao()
.getProjects()