Skip to content

Instantly share code, notes, and snippets.

View tareq3's full-sized avatar
🎯
Focusing

Tareq Islam tareq3

🎯
Focusing
View GitHub Profile
@tareq3
tareq3 / thymeleaf
Last active October 19, 2019 08:28
## Themeleaf
### initializaion:
```
xmlns:th="http://www.thymeleaf.org"
```
## Quick Summary:
```
## Commands for new Project:
### For installing heroku CLI:
npm install -g heroku
### >> New Project
heroku login
git init
git add .
git commit -m "Inititial Commit"
heroku create <APP_NAME>
### in vs code settings
#### search for
```
javascript.suggest.completeFunctionCalls": true
```
and turn on

show services running

netstat -ano | findstr 8080

kill service by process Id or pid

taskkill /pid 21424 /F

How to add padding around a vector image

scale , pivot and viewport are the factor for padding in vector file.

without padding :

<vector android:height="96dp" android:viewportHeight="512"
    android:viewportWidth="512" android:width="96dp" xmlns:android="http://schemas.android.com/apk/res/android">

Observable types:

Flowable<T>:

Emits 0 or n items and terminates with an success or an error event. Supports backpressure, which allows to control how fast a source emits items.

Observabl<T>:

Emits 0 or n items and terminates with an success or an error event.

Single``:

Concat vs Merge

These two operators will used to combine two or more Observables into a single Observable.

Concat:

Concat operator combines output of two or more Observables into a single Observable. Concat operator always maintains the sequential execution without interleaving the emissions. So the first Observables completes its emission before the second starts and so forth if there are more observables.

Let’s say we have two separate Observables that emits Male and Female users. When Concat operator is used, the both Observables will be combined and act as single Observable.

Merge:

Merge also merges multiple Observables into a single Observable but it won’t maintain the sequential execution.

Map:

Consider using Map operator where there is an offline operations needs to be done on emitted data. As explained in the article,

we got something from server but that doesn’t fulfils our requirement.

In that case, Map can be used to alter the emitted data.

FlatMap And ConcatMap:

Choose FlatMap when the order is not important. Let’s say you are building a Airline Ticket Fair app that fetches the prices of each airline separately and display on the screen.

Connectable Observable

when multiple Observers needs same data stream.

* ConnectableObsevable doesn't start emiting on Subscribe

* ConnectableObservable start emiting on connect()

ticketsObservable.connect(); 

RxAndroid {Scheduler added in rxAndroid }

RxAndroid is specific to Android Platform with few added classes on top of RxJava.

More specifically, Schedulers are introduced in RxAndroid (AndroidSchedulers.mainThread()) which plays major role in supporting multithreading concept in android applications.

Schedulers basically decides the thread on which a particular code runs whether on background thread or main thread. Apart from it everything we use is from RxJava library only.

Even through there are lot of Schedulers available,

*Schedulers.io() and *AndroidSchedulers.mainThread()

are extensively used in android programming. Below are the list of schedulers available and their brief introduction.