Anatomy of a Program in Memory. hn. more hn.
Branch Prediction - Fundamentals Every Programmer Need Not Know
Watching for software inefficiencies with Valgrind
Lecture 12 How Linux Works II : I/O, Memory Management, Booting, Loadable Kernel Modules
| Prelude M R> :set -XTypeApplications -XDataKinds -XFlexibleContexts -XAllowAmbiguousTypes | |
| import qualified Data.RBR as R -- from "red-black-record" | |
| Prelude M R> :{ | |
| Prelude M R| let r = R.insertI @"a" (3::Int) | |
| Prelude M R| . R.insertI @"b" False | |
| Prelude M R| . R.insertI @"c" 'c' | |
| Prelude M R| $ R.unit |
| // https://www.golang-book.com/books/intro | |
| package main | |
| import ("fmt" | |
| "reflect") | |
| func main() { | |
| fmt.Printf("hello, world\n") | |
| //var foo string = "foooo" | |
| var x [5]int |
| // | |
| from string s | |
| where s = "hello".charAt(_) | |
| select s | |
| // | |
| predicate isCountry(string country) { | |
| country = "Germany" | |
| or | |
| country = "Belgium" |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE GADTs #-} | |
| module Pipy where | |
| import Data.Kind (Type) | |
| import GHC.TypeLits | |
| import Data.Char (isAlpha) | |
| -- GADT containing a chain of functions, and which remembers the types of each internal step. | |
| data Pipeline (start :: Type) (middle :: [Type]) (end :: Type) where |
| {-# LANGUAGE AllowAmbiguousTypes #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE DeriveAnyClass #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| -- this file requires aeson and generics-sop |
| class Foo | |
| def initialize() | |
| @val = 0 | |
| end | |
| def go_up() | |
| @val+=1 | |
| end | |
| def go_down() | |
| @val-=1 | |
| end |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE OverloadedLabels #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| module Main where | |
| import GHC.OverloadedLabels | |
| import GHC.Records |
| FROM oracle/graalvm-ce | |
| WORKDIR /truffle-sandbox | |
| RUN yum-config-manager --save --setopt=ol7_developer_EPEL.skip_if_unavailable=true && \ | |
| yum install -y iputils && \ | |
| yum install -y iproute && \ | |
| yum install -y xeyes && \ | |
| yum install -y git && \ | |
| yum install -y maven && \ | |
| yum install -y vim && \ | |
| gu install native-image && \ |
| {-# LANGUAGE BlockArguments #-} | |
| import CodeWorld.Reflex | |
| import Reflex | |
| -- Move mouse to rotate squares. | |
| -- Click to add squares. | |
| positions :: [(Color,(Double,Double))] | |
| positions = zip assortedColors [(0,0),(2,2),(-2,2),(-2,-2),(2,-2)] |