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
function Finance() {}; | |
Finance.CalcMonthlyPayment = function (a,monthlyInterestRate, duration) { | |
var Q = (1 + monthlyInterestRate); | |
var n = duration; | |
var monthlyPayment = a * Math.pow(Q,n) * (1-Q) / (1 - Math.pow(Q,n)); | |
return monthlyPayment; | |
} |
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
;; =================================================== | |
;; this is used by new-blog.r to output list of blogs in blogs.txt | |
;; =================================================== | |
rebol[] | |
sql_file_rootname: "<#sql-file-rootname#>" | |
domainname: "<#domain-name#>" | |
db_prefix: "<#db-prefix#>" |
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
;; =================================================== | |
;; Script: csv-tools.r | |
;; downloaded from: www.REBOL.org | |
;; on: 16-Sep-2017 | |
;; at: 21:13:49.846747 UTC | |
;; owner: brianh [script library member who can update | |
;; this script] | |
;; =================================================== | |
REBOL [ | |
Title: "CSV Handling Tools" |
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
Red[] | |
to-rebol-file: :to-red-file | |
print "get-vars loaded" | |
get-vars: func[source-file][ | |
vars: [] | |
html-template: read to-rebol-file source-file | |
rules: [any [thru "<%" copy var to "%>" (append vars var)]] | |
parse html-template rules |
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
rules: [ | |
(code: false) | |
any [ | |
thru {```} (code: not code) | |
any [ | |
to "form" mark: ( | |
if code [remove/part mark 4 insert mark "win"] | |
) | |
| | |
thru {```} (code: not code) |
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
>> make-system: function[_param][ | |
[ param: _param | |
[ if value? system/words/:param [ | |
[ system/words/:param: function[][ | |
[ print "test ok" | |
[ ] | |
[ system/words/:param | |
[ ] | |
[ ] | |
== func [_param /local param][param: _param |
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
; Warning: works only for small strings (like "Hello") because of lack of BigInteger support currently | |
; Download Red-lang.org and copy and paste the code, see execution sample at the bottom | |
base58-alphabet: ["1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F" "G" "H" "J" "K" "L" "M" "N" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"] | |
to-base58: func[string][ | |
base: 58 | |
i: 0 | |
n: length? string | |
set 'cum 0 |
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
unfold: function [spec][ | |
to string! collect [ | |
repeat i length? bitset: charset spec [ | |
if bitset/:i [keep to char! i] | |
] | |
] | |
] | |
to-base58: function [string][ | |
base58: rejoin [ |
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
debug: func[var][ | |
varName: to-string var | |
varValue: get var | |
print rejoin [varName ": " varValue] | |
] | |
to-debug: func[ /local test][ | |
test: 20 | |
debug 'test |
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
??: func [ | |
"Prints a word and the value it refers to (molded)" | |
'value [word! path!] | |
'comment [word! string! unset!] | |
][ | |
switch/default type?/word get/any 'comment [ | |
unset! [ |
OlderNewer