This file contains hidden or 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 rmq | |
| import java.util.ArrayList | |
| import java.io.InputStreamReader | |
| import java.io.BufferedReader | |
| import java.util.StringTokenizer | |
| trait RMQTree { | |
| fun getMinimum(from: Int, to: Int): Int | |
| } |
This file contains hidden or 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
| module Imp where | |
| data ℕ : Set where | |
| Z : ℕ | |
| S : ℕ → ℕ | |
| data Vec (A : Set) : ℕ → Set where | |
| [] : Vec A Z | |
| _∷_ : ∀ {n} → A → Vec A n → Vec A (S n) |
This file contains hidden or 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
| {-# LANGUAGE TupleSections #-} | |
| module Trees where | |
| data Tree = Leaf | |
| | Branch2 Tree Tree | |
| | Branch3 Tree Tree Tree | |
| deriving (Show, Eq) | |
| size :: Tree -> Int |
This file contains hidden or 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
| module Tree where | |
| data Expr = Digit Int | |
| | Complex Expr Expr Expr | |
| deriving (Show) | |
| generateAll :: Int -> [Expr] | |
| generateAll 1 = [Digit 0, Digit 1] | |
| generateAll n | n <= 0 = [] | |
| generateAll n = do |
This file contains hidden or 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
| import org.openjdk.jmh.annotations.GenerateMicroBenchmark; | |
| import org.openjdk.jmh.annotations.Scope; | |
| import org.openjdk.jmh.annotations.State; | |
| import java.lang.reflect.*; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.Collection; | |
| import java.util.List; |
This file contains hidden or 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
| import java.lang.reflect.*; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.Collection; | |
| import java.util.List; | |
| public class ProxyTest { | |
| private static interface CatInterface { | |
| public CatInterface printName(); |
This file contains hidden or 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 <iostream> | |
| #include <string> | |
| using namespace std; | |
| class A | |
| { | |
| public: | |
| virtual void operator-(const A& other) const; | |
| }; |
This file contains hidden or 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
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import java.io.PrintWriter; | |
| import java.util.Scanner; | |
| public class Gauss { | |
| public static void swapRows(double[][] a, double[] b, int i, int j) { | |
| double[] row = a[i]; |
This file contains hidden or 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
| square, double :: Int -> Int | |
| square x = x * x | |
| double x = x * 2 |
This file contains hidden or 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
| module RecursiveExplicit where | |
| import Prelude hiding (sum) | |
| import Data.Char (isDigit) | |
| type Stack = [(Integer, Char)] | |
| readInt :: String -> Integer | |
| readInt = read |