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
{-# 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])) |
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
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 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 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 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
3/home/deech/Pharo/vms/70-x64/lib/pharo/5.0-201806281256/pharo | |
Pharo VM version: 5.0-201806281256 Thu Jun 28 13:04:44 UTC 2018 gcc 4.8 [Production Spur 64-bit VM] | |
Built from: CoInterpreter VMMaker.oscog-eem.2401 uuid: 29232e0e-c9e3-41d8-ae75-519db862e02c Jun 28 2018 | |
With: StackToRegisterMappingCogit VMMaker.oscog-eem.2401 uuid: 29232e0e-c9e3-41d8-ae75-519db862e02c Jun 28 2018 | |
Revision: VM: 201806281256 https://github.com/OpenSmalltalk/opensmalltalk-vm.git Date: Thu Jun 28 14:56:30 2018 CommitHash: a8a1dc1 Plugins: 201806281256 https://github.com/OpenSmalltalk/opensmalltalk-vm.git | |
Build host: Linux travis-job-46342785-b1c1-4811-8c3c-9b2a88ae7ecc 4.4.0-101-generic #124~14.04.1-Ubuntu SMP Fri Nov 10 19:05:36 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux | |
plugin path: [default: /home/deech/Pharo/vms/70-x64/lib/pharo/5.0-201806281256/] | |
C stack backtrace & registers: |
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
import std.stdio; | |
double factorial (double i) | |
{ | |
if (i == 1) { | |
return 1; | |
} | |
else { | |
return (i * factorial(i - 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
curl -X PUT -H "Content-Type: application/x-tar" -H "Content-Encoding: gzip" --data-binary @"packagename-packageversion-docs.tar.gz" "https://usernae:[email protected]/package/packagename-packageversion/docs" |
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
diff --git a/c-src/Fl_C.h b/c-src/Fl_C.h | |
index 963bc04..9485c6c 100644 | |
--- a/c-src/Fl_C.h | |
+++ b/c-src/Fl_C.h | |
@@ -257,6 +257,7 @@ EXPORT { | |
FL_EXPORT_C(void ,Fl_release_widget_pointer)(fl_Widget w); | |
FL_EXPORT_C(void ,Fl_clear_widget_pointer)(fl_Widget w); | |
FL_EXPORT_C(void ,Fl_clear_widget_pointer)(fl_Widget w); | |
+#if FL_API_VERSION == 10304 | |
FL_EXPORT_C(void ,Fl_set_box_color)(Fl_Color c); |
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
(datatype is-prime | |
if (is-prime? N) | |
N : number; | |
============== | |
N : prime;) | |
(define is-prime? | |
X -> (prime* X (/ X 2) 2) where (number? X) | |
_ -> false) |
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
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help | |
Loaded GHCi configuration from /tmp/ghci7261/ghci-script | |
Prelude> class Foo a where { foo :: a -> Int } | |
Prelude> instance Foo () where { foo _ = 1 } | |
Prelude> f = foo () | |
Prelude> class Foo a where { foo :: a -> IO () } | |
Prelude> f | |
1 |
NewerOlder