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
o: object [a: 1 b: 2 c: 3] | |
== make object! [ | |
a: 1 | |
b: 2 | |
c: 3 | |
] | |
>> set o object [a: 11 b: 12] | |
== make object! [ | |
a: 11 | |
b: 12 |
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
view [ | |
size 390x220 | |
across space 0x0 | |
base 367x200 with [ | |
flags: 'scrollable | |
pane: layout/only [ | |
origin 0x0 space 0x0 | |
p: panel 350x800 [ | |
origin 0x0 space 0x0 | |
below |
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
view [panel [origin 0x0 text 40 "Data:" t0: text 40 "" return | |
sc: scroller 200x300 on-change [t0/text: to-string face/data]] | |
below text "Selected:" t1: text "" | |
slider 25x260 [t1/text: to-string round/to sc/selected: face/data .01] | |
return text "Steps:" t2: text "" | |
slider 25x260 [t2/text: to-string round/to sc/steps: to-float face/data .01] | |
] |
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
foreach line split help-string action! newline [append actions: [] first split trim/lines line " "] | |
write/lines %actions.txt sort actions | |
foreach line split help-string datatype! newline [append datatypes: [] first split trim/lines line " "] | |
write/lines %datatypes.txt sort datatypes | |
foreach line split help-string event! newline [append events: [] first split trim/lines line " "] | |
write/lines %events.txt sort events | |
foreach line split help-string native! newline [append natives: [] first split trim/lines line " "] |
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
view [ | |
sc: scroller 15x150 [tl/selected: to-integer round/ceiling face/data / face/steps] | |
on-created [ | |
face/steps: 1.0 / length? tl/data | |
face/selected: 1.0 / (length? tl/data) * 100%] | |
tl: text-list 100x150 data [ | |
"one" "two" "three" "four" "five" "six" "seven" | |
] | |
] |
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
context [ | |
rt: scr: i2: none | |
select-line: function [line][ | |
pos: rt/text | |
loop line - 1 [pos: find/tail pos newline] | |
i1: index? pos | |
if not i2: find next pos lf [i2: tail rt/text] | |
i2: index? i2 | |
rt/data/1: as-pair i1 i2 - i1 | |
] |
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
public static void Retry( | |
Action action, | |
int coolDownSeconds, | |
int maxAttempt) | |
{ | |
var exceptions = new List<Exception>(); | |
for (int attempted = 0; attempted < maxAttempt; attempted++) | |
{ | |
try | |
{ |
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
In this post, .net platform has this pinvoke mechanism where it is allowed that you call into the Native windows . | |
this is extremely useful when you have some 3rd party libraries or if you try to program against with the low-level windows APIS. | |
One of the typic application htat utilize the Lowe-level windows apis are those Native win32 applications. Where you creat a message pump with the necessary WNDCLASSEX to represent/register the window message pump and message handler process. What you will deal with the win32 applications include the following. | |
RegisterClassEx, CreateWindowEx, GetMessage(), TranslateMesage(), and DispatchMessage(...). | |
to be able to use the Window API, you have to declare tons of Structure and PInvoke Method, while you can find help from the Pinvoke.Net. | |
First, we will introduce some of the win32/user32 functions and their relative structure definitions. |
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 [] | |
get-api-data: function [][ | |
collect/into [ | |
foreach w sort words-of system/words [ | |
if all [word? w any-function? get/any :w][ | |
a: "" | |
append a "-------------" | |
append a newline | |
append a w |
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 [needs 'view] | |
;;keywords: to-block read %keywords.txt this puts the words on different lines | |
;;keywords: to-block form read/lines %keywords.txt | |
functions: read %functions.txt | |
natives: read %natives.txt | |
types: read %datatypes.txt | |
events: read %events.txt | |
;; could also do read/lines %keywords.txt and put each word on it's own line in the file itself. |