by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    tpietzsch
    @tpietzsch
    (8,9]
    Florian Jug
    @fjug
    damn!
    you are FAST!
    tibuch
    @tibuch
    :D
    (8,9] != range(8,9)
    Florian Jug
    @fjug
    :finger:
    tpietzsch
    @tpietzsch
    8̸(8,9]8 \not\in (8,9]
    Emil Melnikov
    @emilmelnikov
    range(8, 9) == [8;9)[8; 9) != (8;9](8; 9]
    tpietzsch
    @tpietzsch
    $$8 \not\in (8,9]$$
    Florian Jug
    @fjug
    pPeople.Clap(p)\forall_{p\in \text{People}} . Clap(p)
    tpietzsch
    @tpietzsch
    sooo ...
    7:30?
    Florian Jug
    @fjug
    ++
    then yes!
    tibuch
    @tibuch
    image.png
    tibuch
    @tibuch
    :beers:
    Christian "Tischi" Tischer
    @tischi
    dinner?
    Petr Bainar
    @PetrBainar

    Plan for tomorrow morning

    Meeting next to the Rektorát VŠB tram stop at 10:00 (see the map here: https://en.mapy.cz/s/3mp2s)
    Taking tram no. 7 from there to the Vřesinská tram stop at 10:08
    Taking tram no. 5 from there at 10:16
    Arriving at Budišovice, Zátiší at 10:35
    Strolling around fields, meadows and forests for roughly 1 hour
    A cup of hot beverage in one of the local pubs
    Taking a bus from there back to Ostrava at 12:22
    Arriving at the Pustkovecká bus stop at 12:44, going straight to Lev/U Jarošů for lunch (others can meet us there)

    Florian Jug
    @fjug
    Meeting in lobby at :45?
    Anybody in?
    turekg
    @turekg
    We are already waiting’s
    Christian "Tischi" Tischer
    @tischi
    I will skip the forest but join for lunch
    Florian Jug
    @fjug
    :+1:
    tibuch
    @tibuch
    Hey @/all! Are you already back?
    Florian Jug
    @fjug
    We’re in the bus to the lunch spot.
    We arrive in 10 min!
    Are you joining? Are you with others?
    Gaby is on her way I think...
    tibuch
    @tibuch
    where is the lunch spot?
    I will join
    @tischi probably wants to join too
    Jan Kožusznik
    @kozusznik
    Christian "Tischi" Tischer
    @tischi
    @tibuch now in lobby we meet?
    tibuch
    @tibuch
    @tischi yes on my way
    Florian Jug
    @fjug
    See you!
    turekg
    @turekg
    @ bus stop
    Florian Jug
    @fjug
    We go inside
    Christian "Tischi" Tischer
    @tischi
    @tpietzsch Are you planning on coming to iti4? I would need some expert advise :-)
    tibuch
    @tibuch
    I know totally out of character, but do we have dinner plans?
    order vs going out?
    Florian Jug
    @fjug
    don’t care
    tpietzsch
    @tpietzsch
    /**
     * A variable of type {@code T}.
     * Accessible via {@link #get()} / {@link #set(Object)}.
     * Listeners
     *
     * @author Tobias Pietzsch
     */
    public class ListenableVar< T, L >
    {
        private final AtomicReference< T > ref;
    
        private final Listeners.List< L > listeners;
    
        private final BiConsumer< L, T > notify;
    
        private final boolean notifyWhenSet;
    
        public ListenableVar( final T value, final Consumer< L > notify )
        {
            this( value, notify, false );
        }
    
        public ListenableVar( final T value, final BiConsumer< L, T > notify )
        {
            this( value, notify, false );
        }
    
        public ListenableVar( final T value, final Consumer< L > notify, final boolean notifyWhenSet )
        {
            this( value, ( l, t ) -> notify.accept( l ), notifyWhenSet );
        }
    
        public ListenableVar( final T value, final BiConsumer< L, T > notify, final boolean notifyWhenSet )
        {
            this.ref = new AtomicReference<>( value );
            this.notify = notify;
            this.notifyWhenSet = notifyWhenSet;
            this.listeners = new Listeners.SynchronizedList<>();
        }
    
        public void set( final T value )
        {
            final T previous = this.ref.getAndSet( value );
            if ( notifyWhenSet || !previous.equals( value ) )
                listeners.list.forEach( l -> notify.accept( l, value ) );
        }
    
        public T get()
        {
            return ref.get();
        }
    
        public Listeners< L > listeners()
        {
            return listeners;
        }
    
        interface ChangeListener
        {
            void changed();
        }
    
        interface ValueListener< T >
        {
            void valueChanged( T value );
        }
    
        public static void main( String[] args )
        {
            {
                ListenableVar< Integer, ChangeListener > var = new ListenableVar<>( 1, ChangeListener::changed );
                var.listeners().add( () -> System.out.println( "value changed" ) );
                var.set( 10 );
                System.out.println( "var = " + var.get() );
            }
    
            {
                ListenableVar< Integer, ValueListener< Integer > > var = new ListenableVar<>( 1, ValueListener::valueChanged );
                var.listeners().add( v -> System.out.println( "value changed to " + v ) );
                var.set( 10 );
                System.out.println( "var = " + var.get() );
            }
        }
    }
    Florian Jug
    @fjug
    its sunday… maybe going out?
    Emil Melnikov
    @emilmelnikov
    You could try the reactive approach, if that's applicable to your problem: http://reactivex.io/
    tpietzsch
    @tpietzsch
    @emilmelnikov thanks for the pointer
    do you use this?
    Emil Melnikov
    @emilmelnikov
    No, haven't had a chance, but it's very popular in GUI applications (Android at least).
    Apparently, there is also https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/Flow.html. Requires Java >= 9 though...
    tpietzsch
    @tpietzsch