tag:blogger.com,1999:blog-6979485574739813012.comments2023-08-06T09:24:27.138+02:00Sebastian Millies: Dev-Blog Sebastian Millieshttp://www.blogger.com/profile/11109789625080423651noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-6979485574739813012.post-64550656449894682572022-08-28T00:27:01.551+02:002022-08-28T00:27:01.551+02:00v499v3dcqgm770 horse dildo,horse dildos,male mastu...v499v3dcqgm770 <a href="https://www.dudesndildos.com/" rel="nofollow"><strong>horse dildo</strong></a>,<a href="https://www.euroceramic.fr/women-sexy-toys/dildos/horse-dildo/" rel="nofollow"><strong>horse dildos</strong></a>,<a href="https://www.xlovetime.com/svakom-hedy-male-masturbator-with-aquaglide-223.html" rel="nofollow"><strong>male masturbator</strong></a>,<a href="https://www.locodildo.com/" rel="nofollow"><strong>dildos</strong></a>,<a href="https://www.solidsexdoll.com/" rel="nofollow"><strong>realistic sex dolls</strong></a>,<a href="https://www.sextoys100.com/" rel="nofollow"><strong>vibrators</strong></a>,<a href="https://www.euroceramic.fr/women-sexy-toys/dildos/g-spot-dildos/" rel="nofollow"><strong>g-spot dildos</strong></a>,<a href="https://www.sexdollforest.com/" rel="nofollow"><strong>wholesale sex doll</strong></a>,<a href="https://www.dildosforfree.com/male-sexy-toys/penis-rings/" rel="nofollow"><strong>penis rings</strong></a> g233g3pfdxj349sishoughhttps://www.blogger.com/profile/03910326654036066751noreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-3952618034010862022022-07-22T20:14:09.808+02:002022-07-22T20:14:09.808+02:00o748e5nodcf412 horse dildo,vibrators,male sex toys...o748e5nodcf412 <a href="https://www.sextoys-discounter.com/" rel="nofollow"><strong>horse dildo</strong></a>,<a href="https://www.dudesndildos.com/" rel="nofollow"><strong>vibrators</strong></a>,<a href="https://www.osextoys.com/male-sexy-toys/" rel="nofollow"><strong>male sex toys</strong></a>,<a href="https://www.bestxxxsextoys.com/male-sexy-toys/masturbators/" rel="nofollow"><strong>masturbators</strong></a>,<a href="https://www.bestxxxsextoys.com/male-sexy-toys/prostate-massagers/" rel="nofollow"><strong>prostate massagers</strong></a>,<a href="https://www.bestdildosex.com/" rel="nofollow"><strong>vibrators</strong></a>,<a href="https://www.dildoxxtoy.com/" rel="nofollow"><strong>sex chair</strong></a>,<a href="https://www.axissdream.fr/women-sexy-toys/vibrators/g-spot-vibrators/" rel="nofollow"><strong>G-Spot Vibrators</strong></a>,<a href="https://www.vibratorsdildossextoys.com/women-sexy-toys/dildos/dog-dildo/" rel="nofollow"><strong>dog dildo</strong></a> y914m4mcdlb197soshanehttps://www.blogger.com/profile/18023132847136522452noreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-85351274544043560392022-03-05T14:54:11.076+01:002022-03-05T14:54:11.076+01:00'Twin Strike: The Last Chance To Hit The World...'Twin Strike: The Last Chance To Hit The World's - Baojititanium<br />to win it <a href="https://www.titanium-arts.com/chi-titanium-flat-iron.html" rel="nofollow">titanium mig 170</a> all the way back <a href="https://www.titanium-arts.com/titanium-bar.html" rel="nofollow">titanium septum ring</a> to September at the 2021 show. <a href="https://www.titanium-arts.com/titanium-quartz-meaning.html" rel="nofollow">nano titanium ionic straightening iron</a> 'Twin <a href="https://baojititanium.blogspot.com/" rel="nofollow">titanium tube</a> Strike: The Last Chance <a href="https://www.titanium-arts.com/ford-fusion-hybrid-titanium.html" rel="nofollow">where is titanium found</a> To Hit The World's Arena.odieuhlenhakehttps://www.blogger.com/profile/06661328034629627247noreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-31234057596151806462021-04-23T22:12:05.342+02:002021-04-23T22:12:05.342+02:00Very cool approach. For the List<Collection>...Very cool approach. For the List<Collection> cartesian yielding a List<List>, for the outer stream the first collection must be mapped to a stream of lists containing one of its elements, and the inner stream must discard the first collection.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-66157295195104604142020-02-07T12:20:52.659+01:002020-02-07T12:20:52.659+01:00Hi,
I am curious what was the comment aboutHi,<br /><br />I am curious what was the comment aboutModerator-Suprem Laurelhttps://www.blogger.com/profile/15903282742421033734noreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-87806437421668191702020-02-02T17:09:32.327+01:002020-02-02T17:09:32.327+01:00Example using Spring project Reactor
public sta...Example using Spring project Reactor<br /><br /><br /> public static class ConcurrentTrampoliningMemoizer1<br /> {<br /> <br /> private final ConcurrentMap> memo;<br /> <br /> public ConcurrentTrampoliningMemoizer1( ConcurrentMap> cache )<br /> {<br /> this.memo = cache;<br /> }<br /> <br /> public Function> memoize( Function> f )<br /> {<br /> return t -><br /> {<br /> Mono r = memo.get( t );<br /> if( r == null )<br /> {<br /> final CompletableFuture compute = new CompletableFuture<>();<br /> final Mono mono = Mono.fromFuture( compute );<br /> <br /> r = memo.putIfAbsent( t , mono );<br /> if( r == null )<br /> {<br /> r = f.apply( t )<br /> .flatMap( x -><br /> {<br /> compute.complete( x );<br /> return mono;<br /> } );<br /> }<br /> }<br /> return r;<br /> };<br /> }<br /> }<br /> <br /> public static class Fibonacci1<br /> {<br /> private static final Mono ONE = Mono.just( BigInteger.ONE );<br /> <br /> private final Function> fibMem;<br /> <br /> public Fibonacci1( ConcurrentMap> cache )<br /> {<br /> ConcurrentTrampoliningMemoizer1 memoizer = new ConcurrentTrampoliningMemoizer1<>( cache );<br /> fibMem = memoizer.memoize( this::fib );<br /> }<br /> <br /> public Mono fib( int n )<br /> {<br /> if( n <= 2 )<br /> return ONE;<br /> <br /> return fibMem.apply( n - 1 )<br /> .flatMap( x -> fibMem.apply( n - 2 )<br /> .map( y -> x.add( y ) ) );<br /> }<br /> }<br /><br /><br /><br />But I dont know how to avoid CompletableFuture completlely??transhttps://www.blogger.com/profile/16119168027378945549noreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-49320902656698657342020-02-02T15:22:35.588+01:002020-02-02T15:22:35.588+01:00exactly the same in Haskell
all the ideas about St...exactly the same in Haskell<br />all the ideas about State-monad taken from Haskell<br /><br />type MemoFib = [(Int,Int)]<br />inni::MemoFib<br />inni=[(0,1),(1,1)]<br /><br />memo::(Int->State MemoFib Int )->(Int->State MemoFib Int )<br />memo f = \x-> do<br /> s <- get<br /> let lookuped= lookup x inni<br /> case lookuped of<br /> Nothing->do<br /> result<-f x<br /> modify $ (:) (x,result)<br /> return result<br /> Just found ->do<br /> return found<br /><br />fibb::(Int->State MemoFib Int)<br />fibb n=do<br /> r1<-memo fibb (n-1)<br /> r2<-memo fibb (n-2)<br /> return $ r1+r2<br /><br />r9 = (runState (fibb 13)) inni<br />transhttps://www.blogger.com/profile/16119168027378945549noreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-38088053490542951382020-02-02T15:21:10.927+01:002020-02-02T15:21:10.927+01:00This comment has been removed by the author.transhttps://www.blogger.com/profile/16119168027378945549noreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-42587888082152772912018-06-15T14:27:57.626+02:002018-06-15T14:27:57.626+02:00For the record: this bug has been fixed for JDK 10...For the record: this bug has been fixed for JDK 10 with https://bugs.openjdk.java.net/browse/JDK-8075939Sebastian Millieshttps://www.blogger.com/profile/11109789625080423651noreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-39313285890950486772016-03-18T22:31:11.262+01:002016-03-18T22:31:11.262+01:00There have been some API changes in cyclops since ...There have been some API changes in cyclops since version 6.1.1 that necessitate some changes in the code above. See https://github.com/aol/cyclops-react/issues/160Sebastian Millieshttps://www.blogger.com/profile/11109789625080423651noreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-13478118207485428042015-04-30T21:25:59.662+02:002015-04-30T21:25:59.662+02:00As the above link seems to have expired, I just po...As the above link seems to have expired, I just post the code here, with some comments, but withoout the step-by-step exposition. (Sorry about the lack of formatting, but I can't figure out how that is supported in blog comments. But you should be alright when you copy the following into your favorite Java IDE.)<br /><br />import static java.util.stream.Collectors.toCollection;<br /><br />import java.util.Collection;<br />import java.util.Iterator;<br />import java.util.LinkedList;<br />import java.util.List;<br />import java.util.PriorityQueue;<br />import java.util.Queue;<br />import java.util.function.Predicate;<br />import java.util.function.UnaryOperator;<br />import java.util.stream.Stream;<br /><br />/**<br /> * A simple lambda implementation of the sieve of Eratosthenes, with optimizations<br /> *<br /> * June 18, 2013<br /> *<br /> * @author Brenden Towey, Sebastian Millies<br /> * @see Melissa O'Neill's <a href="http://www.cs.tufts.edu/~nr/comp150fp/archive/melissa-oneill/Sieve-JFP.pdf" rel="nofollow">excellent paper</a><br /> * @see <a href="https://mail.haskell.org/pipermail/haskell-cafe/2007-February/022666.html" rel="nofollow">This argument</a> on the Haskell Cafè mailing list<br /> */<br />public class Sieve {<br /><br /> public static void main(String[] args) {<br /> System.out.println( oddsOnly(200) );<br /> }<br /><br /> <br /> /** An infinite sequence of composite numbers represented as multiples of some prime factor. */<br /> private static class CompositeIterator implements Comparable, Iterator {<br /> <br /> public CompositeIterator(int prime, int factor, UnaryOperator next) { <br /> this.number = prime * factor;<br /> this.prime = prime;<br /> this.factor = factor;<br /> this.next = next;<br /> }<br /><br /> private int number; // the composite number represented by this instance<br /> private final UnaryOperator next; // the factor increment <br /> private final int prime; // the prime of which this composite is a multiple<br /> private int factor; // the remainder<br /> <br /> @Override<br /> public int compareTo(CompositeIterator other) {<br /> return Integer.compare(number, other.number);<br /> }<br /><br /> @Override<br /> public boolean hasNext() {<br /> return true;<br /> }<br /> <br /> @Override<br /> public CompositeIterator next() {<br /> this.factor = next.apply(factor);<br /> this.number = prime * factor;<br /> return this;<br /> }<br /> }<br /> <br /> private static Collection oddsOnly(int n) {<br /><br /> UnaryOperator nextInt = x -> x + 2;<br /><br /> Predicate sieve = new Predicate() {<br /> Queue composites = new PriorityQueue<>(n);<br /><br /> @Override<br /> public boolean test(Integer candidate) {<br /> boolean prime = composites.isEmpty() || composites.peek().number != candidate;<br /> if (prime) {<br /> // cross off the square of this prime<br /> composites.offer(new CompositeIterator(candidate, candidate, nextInt));<br /> } else {<br /> // cross off the next multiple of each prime that is a factor of this composite<br /> while (!composites.isEmpty() && composites.peek().number == candidate) {<br /> CompositeIterator cp = composites.poll();<br /> composites.offer(cp.next());<br /> }<br /> }<br /> return prime;<br /> }<br /> };<br /> <br /> List primes = new LinkedList<>();<br /> primes.add(2);<br /><br /> return Stream.iterate(3, nextInt)<br /> .filter(sieve)<br /> .limit(n - 1)<br /> .collect(toCollection(() -> primes));<br /> } <br />}<br />Sebastian Millieshttps://www.blogger.com/profile/11109789625080423651noreply@blogger.comtag:blogger.com,1999:blog-6979485574739813012.post-34806296027652909602013-06-17T09:27:48.051+02:002013-06-17T09:27:48.051+02:00Here's a post with a step-by-step exposition o...Here's a post with a step-by-step exposition of a genuine sieve implementation, based on the priority-queue algorithm from O'Neill's paper:<br /><br />http://en.it-usenet.org/thread/1150/101027/#post101142<br /><br />It doesn't need a lazy list, just regular Java 8 streams.<br /><br />-- SebastianSebastian Millieshttps://www.blogger.com/profile/11109789625080423651noreply@blogger.com