We are using RxJava in android and combine result. I have explained each and every step
Let’s first define our Retrofit object to access Github’s API, then setup two observables for the two network requests above:

Retrofit repo = new Retrofit.Builder()
        .baseUrl("https://api.github.com")
        .addConverterFactory(GsonConverterFactory.create())
        .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
        .build();

Observable<JsonObject> userObservable = repo
        .create(GitHubUser.class)
        .getUser(loginName)
        .subscribeOn(Schedulers.newThread())
        .observeOn(AndroidSchedulers.mainThread());

Observable<JsonArray> eventsObservable = repo
        .create(GitHubEvents.class)
        .listEvents(loginName)
        .subscribeOn(Schedulers.newThread())
        .observeOn(AndroidSchedulers.mainThread());

The Retrofit interfaces are simple enough:

public interface GitHubUser {
  @GET("users/{user}")
  Observable<JsonObject> getUser(@Path("user") String user);
}

public interface GitHubEvents {
  @GET("users/{user}/events")
  Observable<JsonArray> listEvents(@Path("user") String user);
}

Lately we use RxJava’s zip method to combine our two Observables and wait for them to complete before creating a new Observable.

Observable<UserAndEvents> combined = Observable.zip(userObservable, eventsObservable, new Func2<JsonObject, JsonArray, UserAndEvents>() {
  @Override
  public UserAndEvents call(JsonObject jsonObject, JsonArray jsonElements) {
    return new UserAndEvents(jsonObject, jsonElements);
  }
});

What’s the UserAndEvents? It’s just a simple POJO to combine the two objects:

public class UserAndEvents {
  public UserAndEvents(JsonObject user, JsonArray events) {
    this.events = events;
    this.user = user;
  }

  public JsonArray events;
  public JsonObject user;
}

Finally let’s call the subscribe method on our new combined Observable:

combined.subscribe(new Subscriber<UserAndEvents>() {
          ...
          @Override
          public void onNext(UserAndEvents o) {
            // You can access the results of the 
            // two observabes via the POJO now
          }
        });


Posted by [czar]
,

eclispe 오류


error: org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)



Please try the CI build from 


https://otto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.2/N/LATEST/




go to "Help/Install new software/Add repository"




m2e extensions 업데이트

Posted by [czar]
,

./configure \

--prefix=/usr/local/nginx-1.11.10 \

--with-http_ssl_module \

--with-http_realip_module \

--with-http_addition_module \

--with-http_image_filter_module \

--with-http_sub_module \

--with-http_dav_module \

--with-http_flv_module \

--with-http_gzip_static_module \

--with-http_stub_status_module \

--with-http_v2_module \

--with-http_secure_link_module






심볼릭 링크 변경

ln -Tfs nginx-1.11.10/ nginx



Posted by [czar]
,