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 CollectionsMovies { | |
public Genre genres; | |
public ResponseMovies movies; | |
} |
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 GenerosResponse { | |
private List<Genre> genres; | |
} |
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 Genre { | |
private int id; | |
private String name; | |
} |
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 ResponseMovies { | |
private int id; | |
private int page; | |
private List<Result> results = null; | |
private int totalPages; | |
private int totalResults; | |
} |
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 Result { | |
private boolean adult; | |
private String backdropPath; | |
private List<Integer> genreIds = null; | |
private int id; | |
private String originalLanguage; | |
private String original_title; | |
private String overview; | |
private String release_date; | |
private String poster_path; |
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 interface api{ | |
@GET("{movie}/{list}") | |
Observable<GenerosResponse> getAllGeneros( | |
@Path("movie")String movie, | |
@Path("list")String list, | |
@Query("api_key")String key); | |
@GET("{number}/{movies}") | |
Observable<ResponseMovies> getAllMovies( | |
@Path("number")int number, | |
@Path("movies")String movies, |
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 void RemoteClass(){ | |
//funcion con el service de getAllGeneros | |
private Observable<GenerosResponse> makeRequestToServiceGender() { | |
return service.getAllGeneros("movie","list","key"); //some network call | |
} | |
//funcion con el service de getAllMovies | |
private Observable<ResponseMovies> makeRequestToServiceMovies(Genre genre) { | |
return service.getAllMovies(genre.getId(),"movies","key","created_at.asc"); //some network call based on response from ServiceA |
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
int COUNTER_START = 1; | |
int ATTEMPTST = 7; | |
int ORIGINAL_DELAY_IN_SECONDS = 2; | |
@Override | |
public Observable<ResponseService> getAllBus(String idSearch) { | |
return remoteData.servicePolling(idSearch) | |
.repeatWhen(new Func1<Observable<? extends Void>, Observable<?>>() { | |
@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
//Service GetStudent | |
public Observable<ResponseService> GetStudent(String id_student) { | |
return retrofit.create(Service.class).GetStudent(id_student); | |
} | |
//Ids of Students | |
String id_student1= "asdfghjkl11"; | |
String id_student2= "qwertyuio88"; | |
//creation of observables with the service |
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
func almostIncreasingSequence(sequence: [Int]) -> Bool { | |
if (isIncreasingSequence(sequence : sequence)) { | |
return true; | |
} | |
for (n, c) in sequence.enumerated() { | |
var tmpSequence = sequence.dropFirst(0); | |
tmpSequence = tmpSequence[n...1]; | |
if (isIncreasingSequence(sequence : Array<Int>(tmpSequence))) { |