These are chat archives for ReactiveX/RxJava

7th
Jun 2016
Alex Reisberg
@a-reisberg
Jun 07 2016 04:18
if you have a category C, the Yoneda lemma says that the functor C --> Funct(C^op, Set) is fully-faithful
Timur Darmaev
@iTiPo
Jun 07 2016 12:24

Hello!
I try to repeat an example from https://github.com/ReactiveX/RxJava/wiki/How-To-Use-RxJava

public static void hello(String... names) {
    Observable.from(names).subscribe(new Action1<String>() {

        @Override
        public void call(String s) {
            System.out.println("Hello " + s + "!");
        }

    });
}

But i get an error Cannot resolve the method from.
How I can solve the problem?

Dorus
@Dorus
Jun 07 2016 12:25
This message was deleted
wait wrong channel
Timur Darmaev
@iTiPo
Jun 07 2016 12:26
@Dorus what is correct channel?
Dorus
@Dorus
Jun 07 2016 12:26
no i was talking about RxJs not RxJava
you are on the correct channel :)
Well, the same answer still applies, did you import it correctly?
This works for me:
import rx.Observable;
import rx.functions.Action1;

public class map2 {
    public static void hello(String... names) {
        Observable.from(names).subscribe(new Action1<String>() {

            @Override
            public void call(String s) {
                System.out.println("Hello " + s + "!");
            }

        });
    }
}
Timur Darmaev
@iTiPo
Jun 07 2016 12:29
@Dorus i try import rx.Observable;
But I get Connot resolve symbol rx. O_O
Dorus
@Dorus
Jun 07 2016 12:30
How did you add the dependany? My project uses maven:
  <dependency>
    <groupId>io.reactivex</groupId>
    <artifactId>rxjava</artifactId>
    <version>1.1.5</version>
  </dependency>
(edit: changed it to the latest version, 1.1.5)
Timur Darmaev
@iTiPo
Jun 07 2016 12:32
@Dorus I use gradle:
group 'rx_java'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.5

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.11'
    compile 'io.reactivex:rxjava:1.1.5'
}
Dorus
@Dorus
Jun 07 2016 12:34
So i guess rxjava-1.1.5.jar should pop up somewhere in your dependencies.
Timur Darmaev
@iTiPo
Jun 07 2016 12:42
I have solved the problem.
I have used "Refresh Gradle Project."
Dorus
@Dorus
Jun 07 2016 12:43
:+1:
Timur Darmaev
@iTiPo
Jun 07 2016 12:45
@Dorus thanks for help! :)