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
pthread_setschedparam failed: Operation not permitted | |
This VM uses a separate heartbeat thread to update its internal clock | |
and handle events. For best operation, this thread should run at a | |
higher priority, however the VM was unable to change the priority. The | |
effect is that heavily loaded systems may experience some latency | |
issues. If this occurs, please create the appropriate configuration | |
file in /etc/security/limits.d/ as shown below: | |
cat <<END | sudo tee /etc/security/limits.d/pharo.conf | |
* hard rtprio 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
import threadpool, strformat, os, strutils, math | |
type | |
Tree = ref object | |
left: Tree | |
right: Tree | |
proc deepCopy[T](x: var T, y: T) = | |
x = y | |
proc check(t: Tree): int32 = |
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 math | |
proc fizzbuzz(n: int) {.compileTime.} = | |
for i in 1 .. n: | |
let | |
by3 = (i mod 3) == 0 | |
by5 = (i mod 5) == 0 | |
if (by3 and by5): echo "FizzBuzz" | |
elif by3: echo "Fizz" | |
elif by5: echo "Buzz" | |
else: echo $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
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE DuplicateRecordFields #-} | |
{-# LANGUAGE NamedFieldPuns#-} | |
data C = C { c::[Int] } deriving Show | |
data B = B { b::Bool, c::C } deriving Show | |
data A = A { a::String, b::B } deriving Show | |
mkA = A "hello world" (B True (C [1,2,3])) |
OlderNewer