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 static void main(String... args) { | |
AtomicInteger a = new AtomicInteger(); | |
Observable.just(1, 2, 3, 4, 5, 6, 7, 8) | |
.repeatWhen(notification -> { | |
return notification.flatMap(o -> { | |
System.out.println("'repeatWhen'"); | |
if(a.getAndAdd(1) < 10){ | |
return Observable.just(o).delay(1,TimeUnit.SECONDS); |
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
Lets consider this simple code snippet : | |
final EventLoopGroup group = new NioEventLoopGroup(1); | |
group.execute(new Runnable() | |
{ | |
@Override | |
public void run() | |
{ | |
{ | |
Bootstrap b = new Bootstrap(); |
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
photos.flatMap(it -> Observable.from(it)) | |
.delay(1, TimeUnit.SECONDS) | |
.subscribeOn(AndroidSchedulers.mainThread()) | |
.flatMap(it -> { | |
view.pictureUploadProgress(it.getPictureType().name()); //to jest ustawienie widoku że wysyłam it element | |
client.uploadDriverPicture(reservationId, pictureInput) //to jest observable który wykonuje potem zapytanie i zwraca response | |
.subscribeOn(Schedulers.io()) // na tym wątku muszę wykonać zapytanie sieciowe | |
.observeOn(AndroidSchedulers.main()) //na tym wątku mogę robić update widoku, ale nie chcę tego robić tutaj | |
.doOnNext(response -> {}) |
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
Observable.just(1, 2, 3, 4, 5)// | |
.map(c -> { | |
System.out.println("1 " + Thread.currentThread().getName()); | |
return c; | |
})// | |
.flatMap(a -> { | |
return Observable.just(1) // | |
.observeOn(Schedulers.io())// | |
.map(b -> b)// |
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
Observable.just(1, 2, 3, 4, 5)// | |
.map(c -> { | |
System.out.println("1 " + Thread.currentThread().getName()); | |
return c; | |
})// | |
.flatMap(a -> { | |
return Observable.just(1) // | |
.observeOn(Schedulers.io())// | |
.map(b -> b)// |
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
char* adasidaisdu(char **args, int argc) | |
{ | |
char* szukaj = "-d"; | |
int i=1; //omit 0 - due to 0 is application name itself | |
for(i = 1; i < argc; i++) | |
{ | |
if(strcmp(decompressionFlag, args[i]) == 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
int sprawdzanie_argumentow(char** argv,char* argument) | |
{ | |
int b = 1; | |
while ( b < 8 ){ | |
if (strcmp(argv[b],argument) == 0){ | |
printf("ARGV %s\n",argv[b]); | |
return 0; | |
} | |
else{ |
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
<output jsf:id="confirm" name="confirm"> | |
Hoho ale to trudne - #{reservationBean.lista[0]}. | |
</output> |
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
... | |
... | |
private List<String> lista = new ArrayList<>(); | |
@PostConstruct | |
public void init(){ | |
lista.add("1"); | |
lista.add("2"); | |
lista.add("3"); | |
} |
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
System.out.println("Asdasd"); |