Skip to content

Instantly share code, notes, and snippets.

View rebolek's full-sized avatar

Boleslav Březovský rebolek

  • 04:26 (UTC +01:00)
View GitHub Profile
pivo-pilsner-urquell Penny Market leták 22,90 Kč
pivo-pilsner-urquell JIP leták 22,90 Kč
pivo-pilsner-urquell Lidl leták 22,90 Kč
pivo-pilsner-urquell Albert leták 155,00 Kč
pivo-pilsner-urquell CBA leták 25,90 Kč
pivo-pilsner-urquell FLOP leták 28,90 Kč
pivo-pilsner-urquell Makro leták 44,65 Kč
pivo-pilsner-urquell JIP leták 23,90 Kč
pivo-svetly-lezak-11-svijansky-maz-svijany Tesco leták 9,50 Kč
pivo-svetly-lezak-11-svijansky-maz-svijany BILLA leták 12,90 Kč
array: func [
"Makes and initializes a series of a given size."
[catch]
size [integer! block!] "Size or block of sizes for each dimension"
/initial "Specify an initial value for all elements"
value {Initial value (will be called each time if a function)}
/local block rest
][
if block? size [
if tail? rest: next size [rest: none]
@rebolek
rebolek / info.sh
Last active April 23, 2020 08:11
Get Red website running
#!/bin/sh
# This is what needs to be done on fresh Ubuntu 19.10
# update your system, just in cause
sudo apt-get update
sudo apt-get -y upgrade
# install required tools: curl, gnupg (applies to LXC version of Ubuntu, ISO has them)
sudo apt-get -y install curl gnupg
N4IghgrgLg9gylMAnKIBcAzMAbAzgUwBoRt8A3fbAVQDtsYBjAa3wBN0BGANmNIuwTIobTj3DZsAFQCWAW3wAJaQHMAFvlxQAMuUqcArMQBG9GOzQcALPu4A6DgAZ9AdmcAON10sBmNx2NIYNI0uOj6DsYwNBqcnpHRuJIwiNic1n7EEAAOyoGsMWgA2qDS5v4gNGDy6CAAQqasUKrSSJogxAwwmpIAnln4NSYwZu0ggTRM6N5iUH0DaCCsVWDKA8T4GBj4DKgWAL6EJeYATMfEldULAApIcjgABABKG6QAHjEdXVC9-YOBwaFiONJhYziBZr8Frh+iJ1pttrsOAcjugwRd5iAtNIWPcdGAmvgkKNOt05oMGqNgai3MQIRj1DgmqMNlsdpwHMiQKUpucqhiAMIwbCse4IGCBVbEr4-DFDEZAsATAy0skLIz-EL8sBZZnwtlocKc7loY4RCp8moAUWiSGUPSeEFwqilpMhIHVQRClMVIOcKrd+Btdse+LWIBZCPQDls+iNJ3K6JqAFkwJpCaKILJZFFCS7vqr3RrAWMfegAJz+jGBwl2rU6uGs3axw5ck6WXmXEC0VRC+2CkJQJAQHbSKJ5mV-T3FqkWSs1ToDocjscNyP7FvG47eDsY+rDEUKZAUNqfV2yovepUWGYFuWsMUS-BXfm6xtR+xx9CWM2Jha1HP3JIqhIDm463jm06lgac4LNWto9HWr5ro4n5oJYCYWgs-IgQA7jQ9wwBg9z-gkYFukYEGXiC7bggWcHBqGSH6tGxyoTRv4gM8DA9Aw2DBMo9zSLg9yCkKZGyhSCpXo4MGFp6XEwBQSD8qoioMGGEbMR+G7mIY5qdgAmjAEBIKKxnYIJwlJsE+AAITieS+5Ueysm3AQABiIGyEB+AACL4GArAqWpGl6rs0ZIjpX5ophdQ5kYyC4cWJL5uRlFSSCYJ0oMOaChICLinWYAMNIsxMU2bHbvpu4Ac8wQYOK6kipIPrJdK4GkRlPK0eRDSIau+qmg4HIALq
@rebolek
rebolek / missing
Created October 4, 2019 12:32
Missing ===end-group=== marks
>> foreach-script %./ [sg: eg: 0 parse mold data [some ["===start-group===" (sg: sg + 1) | "===end-group===" (eg: eg + 1) | skip]] unless equal? sg eg [print filename]]
./source/units/auto-tests/interp-find-test.red
./source/units/auto-tests/interp-load-test.red
./source/units/auto-tests/interp-binding-test.red
./source/units/auto-tests/run-all-interp.red
./source/units/auto-tests/run-all/recycle-test.red
./source/units/auto-tests/run-all/load-test.red
./source/units/auto-tests/run-all/find-test.red
./source/units/auto-tests/run-all/binding-test.red
./source/units/auto-tests/interp-recycle-test.red
@rebolek
rebolek / print-table.red
Created September 18, 2019 14:12
Print table in console
Red[]
test-table: [
["Name" "Mass" "Orbit"]
["Mercury" 0.055 0.4]
["Venus" 0.815 0.7]
["Earth" 1.0 1.0]
["Mars" 0.107 1.5]
]

Every executable is compiled 5 times, extreme values are thrown away and compile time is average of three times.

Encap versions are wrapped in do [] block.

Source code size of CSV codec is 10181 bytes for full version and 4988 bytes for lite version (~49%).

Lite version supports block of records only as Red format, full version suppoorts block of maps and map of columns also, plus some additional features like header handling.

name compile time (ms) % of original compile time difference (ms) size (bytes) % of original size difference (bytes)
@rebolek
rebolek / test-csv.red
Last active September 18, 2019 12:01
Red[]
#include %profile.red
#include %make-csv.red
right-now: func [][now/time/precise]
test-files: function [
][
files: read %.
@rebolek
rebolek / make-csv.red
Created September 1, 2019 07:46
Make CSV from simple dialect
Red[
Dialect: {
pair! (req) - block size: record size x number of records
[MAX] integer! (opt) - value size: string length for values in records. MAX
switches to variable size
}
]
make-string: func [
"Return random string!"
Rebol [
Title: "Build"
Author: ["Ladislav Mecir" "Brian Hawley"]
File: %build.r
Date: 2-May-2006/13:36:38+2:00
History: [
7/apr/2003/19:02 {using INSERT and ONLY keywords}
30/Oct/2004/12:55 {intermediate version - alpha}
31/Oct/2004/9:49 {intermediate - word - insert/only, :word - insert}
4/Nov/2004/6:55 {word - insert and evaluate, :word - insert/only}