- Sixth Summer School on Formal Techniques / 22-27 May
- Twelfth International Summer School on Advanced Computer Architecture and Compilation for High-Performance and Embedded Systems / 10-16 July 2016
- Oregon Programming Languages Summer School / 20 June-2 July 2016
- The 6th Halmstad Summer School on Testing / 13-16 June, 2016
- Second International Summer School on Behavioural Types / 27 June-1 July 2016
- Virtual Machines Summer School 2016 / 31 May - 3 June 2016
- ECOOP 2016 Summer School
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
package tests.recursive; | |
public class GoldenRation { | |
public static long fib(int n) { | |
if (n <= 1) return n; | |
else return fib(n-1) + fib(n-2); | |
} | |
public static double goldenratio(int n){ | |
return fib(n+1)*Math.pow(fib(n),-1); |
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
#include "Expressions.h" | |
void* SumExpression::Accept(Visitor& v) | |
{ | |
return (void*) v.VisitSum(this); | |
} | |
void* ConstantExpression::Accept(Visitor& v) | |
{ | |
return (void*) v.VisitConstant(this); |
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
IDisposable generator = Observable.Generate<Tuple<Random, int>, int>( | |
new Tuple<Random, int>(new Random(), 0), | |
value => value.Item2 < 100, | |
value => new Tuple<Random, int>(value.Item1, value.Item2 + 1), | |
value => value.Item1.Next(0, 100), scheduler).Subscribe(Console.WriteLine); |
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 IObservable<Tuple<TSource, bool>> Bloom<TSource>(this IObservable<TSource> source, int size) | |
{ | |
BitArray bitmap = new BitArray(size); | |
return source.Select<TSource, Tuple<TSource, bool>>(value => | |
{ | |
var hashCode = value.GetHashCode(); | |
var tuple = new Tuple<TSource, bool>(value, bitmap[hashCode] == true); | |
bitmap[hashCode] = true; | |
return tuple; |
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
# qdbus lists all service names of services that are running and you can manipulate at the moment. | |
qdbus | |
# control dbus | |
qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next | |
qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous | |
# and use --literal if you need to print the reply in plain text | |
qdbus --literal org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Playlists.ActivatePlaylist /org/mpris/MediaPlayer2/Playlists/20 |
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
class PlaylistManagerInterface : public QObject { | |
Q_OBJECT | |
public: | |
PlaylistManagerInterface(Application* app, QObject* parent) | |
: QObject(parent) {} | |
// methods | |
public slots: | |
virtual void Load(const QString& filename) = 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
package benchmark; | |
import java.util.stream.*; | |
import org.openjdk.jmh.annotations.*; | |
import java.util.concurrent.TimeUnit; | |
import java.util.*; | |
@OutputTimeUnit(TimeUnit.NANOSECONDS) | |
@BenchmarkMode(Mode.AverageTime) | |
public class MyBenchmark { |
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
(* http://fssnip.net/sE in BER MetaOCaml *) | |
open Runcode;; | |
let rec fix : (('a -> 'b) -> ('a -> 'b)) -> 'a -> 'b = fun f x -> | |
f (fix f) x;; | |
let fix' : (('a -> 'b) code -> ('a -> 'b) code) -> ('a -> 'b) code = fun f -> | |
.< fun x -> let rec loop x = (fun f' -> .~(f .<f'>.) ) loop x in | |
loop x >.;; |
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
package builders; | |
import java.util.function.Function; | |
public class Cont { | |
interface K<A, B, C> extends Function<Function<A, B>, C>{ } | |
/* | |
* Step 1: https://en.wikibooks.org/wiki/Haskell/Continuation_passing_style | |
* ---> just transforming continuations of type (a->r)->r to polymorphic (a->b)->c |
OlderNewer