r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3-OLD1]

Geomol
12-Mar-2009
[11976]
Brian, makes sense with the refinement and ls. :-)
BrianH
12-Mar-2009
[11977x2]
Steeve, one of the problems with multiple value replace is that there 
are basically two ways to do it:

- One value/replacement pair at a time (like your FOREACH loop above).

- In order using either an inner loop of FIND/match calls, or PARSE 
rules and alternation.

Neither of those are very efficient, but the PARSE rules tends to 
be more so, at the expense of building the rules. REWORD uses the 
compiled PARSE rules method. Most of its overhead is working around 
bugs in map! or going away with new REBOL features. If we do an inplace 
replacement, we'll have the same overhead. The only solution is to 
optimize the runtime, or hand-write the PARSE rules.
I've basically decided to bite the bullet and optimize the runtime. 
The feature requests and bug reports that came from implementing 
REWORD will be much more valuable than REWORD itself. That's why 
I wrote it :)
Steeve
12-Mar-2009
[11979]
i make a proposal:

Most of the times, we use the same rules several times on different 
data.
reword should be able to not reconstruct the rules if so.

I used the similiar tricks in some scripts, for example:

map-chars: func [
	{replace/all pair chars in a string}
	data [string!] values [block!]
	/local chars pos
][

 ;** if the first value in values is a bitset, do not reconstruct 
 the bitset
	unless bitset? chars: first values [
		chars: make bitset! 256
		forskip array 2 [append chars array/1]
		insert values chars
	]
	pos: data
	values: next values

 while [pos: find pos chars][pos: change/part pos select/skip values 
 first pos 2 1]
	data
]

data: "Hello You"
map-chars copy data values: [#"s" "SS" #"t" #"T"] 
;** the second call is faster
map-chars copy data values
[unknown: 5]
12-Mar-2009
[11980]
Cool Steeve.  You should be a way bigger part of the REBOL team.
BrianH
12-Mar-2009
[11981]
Replacing single characters is all you need? That isn't general enough 
to make it into REBOL, but it might be a good library function.
Steeve
12-Mar-2009
[11982]
bah, to be here and in Rebdev is good enough for me
BrianH
12-Mar-2009
[11983]
You do help already :)
Steeve
12-Mar-2009
[11984x2]
Brian, it was just an example to show reusable rules
In your case, it could be an object or a parsing rules instead of 
a bitset
BrianH
12-Mar-2009
[11986]
I like functions that generate functions, if that helps :)
Steeve
12-Mar-2009
[11987]
yes or a funtion :)
Geomol
12-Mar-2009
[11988]
Playing with icons: http://www.fys.ku.dk/~niclasen/rebol/R3/icons.png
Robert
13-Mar-2009
[11989]
Docs/Wiki: I know the difference. How much content is overlapping? 
I see a problem if we maintain two lanes of documentation regarding 
concepts etc.


It's again the fragmentation problem that makes it so hard to get 
R2 details collected and structured.


IMO the Wiki is one of the best things that happend to Rebol. Finally 
most information in one place.
[unknown: 5]
13-Mar-2009
[11990]
Cool John.  I favor a glosser look myself.
Henrik
13-Mar-2009
[11991]
http://hmkdesign.dk/r512.png

An old icon I did a few years ago.
Geomol
13-Mar-2009
[11992]
Henrik, that font is closer to the old icon. Did you create it or 
got it from somewhere?
[unknown: 5]
13-Mar-2009
[11993]
Looks good also Henrik.
Henrik
13-Mar-2009
[11994]
I made it in SVG. I can't remember how I did the R, but I think I 
took an Arial Bold and made some adjustments.
[unknown: 5]
13-Mar-2009
[11995x2]
I like John's R a bit better.
But I like the size of Henrik's.
Henrik
13-Mar-2009
[11997x2]
There is also an r256 and r128, if you want to compare sizes.
But I guess we can't cheat. Was the requirement that we did the icon 
in DRAW?
Geomol
13-Mar-2009
[11999x2]
I don't think so. Carl just said, we plan to go with an old script 
and change colors in that.
we = he
Henrik
13-Mar-2009
[12001x2]
Geomol, I made a very primitive SVG importer for R3. it can only 
handle one shape in one color, but it's nice if you need to draw 
it by hand. If you need it for complex shapes, let me know.
http://rebol.hmkdesign.dk/files/r3/gui/093.png

Some shapes in this image was done that way.
Geomol
13-Mar-2009
[12003]
Ok, I'm waiting for some reply from Carl, if he needs any of our 
help.
Pekr
13-Mar-2009
[12004]
We should start to write-down our wishes for View/VID imo, maybe 
we are close when Cyphre will be called to continue his work :-)
PatrickP61
13-Mar-2009
[12005]
I have some questions regarding timestamps on files.  They look like 
they are all GMT and don't take into account what time zone you are 
in.

To my way of thinking, they probably should default to what the system 
is doing.
For example:
Create any file TEST.r in your what-dir
>> GET QUERY %TEST.r

== [%TEST.r 7329 13-Mar-2009/20:26:42.429 file]		<-- notice the timestamp 
is not CST where I created this at 3pm, not 8pm

If you look at the file through Windows Explorer, you will see it 
is dated at the local time, not GMT.

Do I need to subtract 5 hours (DST) or 6 hours, depending upon my 
timezone and if we are on Daylight saving time?
Do we have some refinements or another way to handle that?
Pekr
13-Mar-2009
[12006]
WTF .... while sitting in a pub, having my 3rd good Czech beer, I 
plugged my USB pen in, started R3 and run Demo. I looked at what 
it does so many times, but never looked at the source. While VID 
3.4 contains only basic styles, when looking at various panels, I 
always thought - the code for this screen has to be some 5 pages 
long. WTFonce again - 10 - 15 lines of code with such a functionality? 
Awesome .... I think I will become even more REBOL fanatic ;-) ... 
Cheers :-)
Graham
13-Mar-2009
[12007]
You sure it was only 3 glasses of beer??
Pekr
13-Mar-2009
[12008x2]
yes, of course, now fourth! But beware - Czech beer is very special 
:-)
... but really, looking at SharePoint portal sources last week, and 
now into VID source, is quite a difference. I think that most of 
the systems out there, especially the big glory web and JS - are 
just - crap.
Henrik
13-Mar-2009
[12010]
Whatever you do, Pekr, don't spill the beer in the laptop :-)
BrianH
13-Mar-2009
[12011]
PatrickP61, that is a known bug: http://curecode.org/rebol3/ticket.rsp?id=615
Geomol
13-Mar-2009
[12012]
Another icon example: http://www.fys.ku.dk/~niclasen/rebol/R3/gold-blue.png
Henrik
13-Mar-2009
[12013]
very nice
Steeve
13-Mar-2009
[12014]
add eyes to do a smiley inside the R  :)
Geomol
13-Mar-2009
[12015]
Thanks, I'm not 100% satisfied with the bottom. It looks like it's 
bending outward. A dark line or something would make it better.
Steeve
13-Mar-2009
[12016]
Geomol, you done it with draw ?
Geomol
13-Mar-2009
[12017]
yes
Steeve
13-Mar-2009
[12018]
souuuuuuuuurce
Geomol
13-Mar-2009
[12019x2]
:-D
It's really a mess. Some from Gabrieles example. It's split in 2 
scripts to make the table mirror effect. But you can have it, if 
you want?
Steeve
13-Mar-2009
[12021x2]
you can post it here ? is that so huge ?
only the primary draw, not the reversed part
Geomol
13-Mar-2009
[12023x2]
sx: sy: 1
lw: 10
clip-tl: 20x20
clip-br: 380x380
sz: 400x400
color0: orange
color1: 0.0.228
color2: gold
icon: make image! sz

image: [
    transform 0 sx sy 0x0 0x0
    pen none
    fill-pen color0
    box 0x0 400x400 50
    fill-pen color1
    box 20x20 380x380 30

    clip clip-tl clip-br
	pen black
    fill-pen color2
    line-width lw
	arc 65x335 305x305 180.0 360.0
    fill-pen color1
	arc 65x335 148x148 180.0 360.0
    fill-pen color2
	arc 65x335 56x56 180.0 340.0
    clip 0x0 sz
    pen black fill-pen white
    line-width lw
	line-join round
	push [
	scale 0.9 0.9
	translate 20x20
	shape [
		move 221x60
		line 85x60 85x349 187x349 187x255 230x349 340x349 264x238
		curve 264x238 323x218 323x152
		curve 323x152 323x60 221x60
		move 204x187
		line 187x187 187x137 204x137
		curve 204x137 225x137 225x162
		curve 225x162 225x187 204x187
	]
	]

    fill-pen none
	pen color0
    box 10x10 389x389 44
	pen black
    box 15x15 384x384 40

    pen none line-width 0
    fill-pen linear 0x0 0.0 110.0 90.0 1.0 1.0
		255.255.255.40 255.255.255.120 255.255.255.200

    shape [move 400x80 arc 0x80 400.0 300.0 line 0x0 400x0 400x80]
    fill-pen linear 0x290 30.0 110.0 90.0 1.0 1.0
		255.255.255.255 255.255.255.192 255.255.255.128

    shape [move 0x300 arc 400x300 600.0 200.0 line 400x400 0x400 0x300]
]
view center-face layout [
	origin 0
	across

	b: box 400x400 black effect [draw image][
		file: request-file/only/save/file %rebol-icon.png
		if not file [exit]
		if not find file ".png" [append file ".png"]
        img: make image! b/size
        img2: make image! b/size
        img2/alpha: 255
		draw img2 [pen none fill-pen black box 0x0 400x400 50]
		draw img image
		img/alpha: img2/alpha
		save/png file img
	] return
	btn "Color 0" [color0: request-color/color color0 show b]
	btn "Color 1" [color1: request-color/color color1 show b]
	btn "Color 2" [color2: request-color/color color2 show b]
]
Something like that.
Steeve
13-Mar-2009
[12025]
thx