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

World: r3wp

[I'm new] Ask any question, and a helpful person will try to answer.

BrianH
31-Mar-2006
[290]
That's the View cache directory (or sandbox if you prefer), which 
gets set by the installer. Although stuff is downloaded to it it 
is more like the Windows application data directory for REBOL, a 
place for (perhaps untrustworthy) scripts to put their stuff. It's 
not really a default download directory as such.


If you want to change it, the easiest way (for a newbie) is to uninstall 
REBOL, move the entire View directory (not the public subdirectory) 
where you want it to be, and reinstall REBOL, specifying the new 
location. If you are more ambitious, the View root directory is stored 
in the registry and can be changed from there. You can't move the 
public subdirectory seperately from the entire View directory though.


Keep in mind that the View root directory is under Application Data 
for good reasons, particularly to make it easier for multiple users 
on the same computer to use REBOL. It's the standard way to do this 
on Windows, and a good idea overall. 


I tend to leave the View root in appdata where it belongs and then 
set a junction point (sort of like a symbolic link for directories 
on NTFS) in some more friendly location so I can get to the data 
easier. I use the axwLink shell extension for this, which you can 
get here: http://arniworld.de/downloads.htm
Normand
31-Mar-2006
[291]
Thanks.
Gabriele
31-Mar-2006
[292]
you can also use --reinstall or +i to force view to reinstall. of 
course you still need to move the files manually as brian described.
Anton
1-Apr-2006
[293]
That looks like useful stuff, Brian.
Thør
2-Apr-2006
[294]
Normand, are you referring to downloads from the script library?
Anton
2-Apr-2006
[295]
Good question, because the rebol.org script library will need some 
modification to path-thru to handle the url's with the '?' character 
in it. Normand, maybe you just want to change the VIEW-ROOT path 
within rebol. If is used by PATH-THRU, If you care to have a quick 
look at the source. And path-thru is used by exists-thru?, read-thru, 
load-thru... all the functions dealing with the public cache.
Julia
4-Apr-2006
[296]
I read about 40 platforms, can anyone axplain me how use rebol under 
win mobile?
Henrik
4-Apr-2006
[297x2]
can't do that yet
that's one of the unsupported platforms :-)
Julia
4-Apr-2006
[299]
what about another mobile platforms?
Henrik
4-Apr-2006
[300]
I'm not really sure that any mobile platforms are supported yet. 
This has something to do with the memory handling of Rebol. I think 
PocketPC is in the works as it's been wanted for some time now.
Julia
4-Apr-2006
[301]
what a pity
Graham
4-Apr-2006
[302]
RT looked at the number of downloads for Windows CE and decided that 
there was no interest .. AFAIK
BrianH
5-Apr-2006
[303x4]
Yeah, they ported /Core 2.50 to WinCE on StrongARM at my request, 
but apparently I and my clients were the only ones interested. You 
can run this build on Windows Mobile but since this was for a Handheld 
PC it doesn't adjust its window to an onscreen keyboard, making it 
significantly less useful on the Pocket PC platform.
Plus the user interface loks a little off because it is written for 
an older version of WinCE, and the title bar didn't match the standard 
layout even then.
I haven't tried it on the smartphone layout, but I would be shocked 
if it worked. :)
I will definitely request again when REBOL has Unicode support, probably 
with REBOL 3.
Gregg
5-Apr-2006
[307]
We wanted to use it too Brian, but it wasn't up to what we asked 
of it (View being important).
Pekr
5-Apr-2006
[308]
it is overall interesting issue - to get rebol running on various 
platforms in a way so it adheres to particular platform habits .... 
OS-X, WinCE being reported as Rebol feeling kind of hostile there 
...
Henrik
5-Apr-2006
[309]
it probably amounts to have rebol being more flexible with the types 
of windows and interfaces it can make... currently, just being able 
to create one type of windows isn't enough for more and more platforms.
Julia
13-Apr-2006
[310]
could you help me with parsing? what is the best way to change value 
of "src"'s in html document to another value?
Henrik
13-Apr-2006
[311]
probably through old fashioned search/replace
Anton
13-Apr-2006
[312x2]
Parse is probably the best way.
I presume just src of image tags ?
Julia
13-Apr-2006
[314x2]
yes
about mobile... is it plannig rebol/view 1.3.2 for win mobile 5.0? 
I want to see power and buty of rebol/view on vga(640/480) handheld 
screen :)
Henrik
13-Apr-2006
[316]
julia, http://www.rebol.net/article/0217.html<--- this is the closest 
hint we have so far
Julia
13-Apr-2006
[317]
thanks
Anton
14-Apr-2006
[318x4]
Julia, I have just written this so it's not well-tested:
page: read http://www.rebol.com

images: copy []

use [whsp ws non-end-tag strd p1 p2 delim non-delim][

	whsp: charset " ^-^/" ; whitespace
	ws: [any whsp] ; a rule for any number of whitespace characters
	non-end-tag: complement charset ">" ; all characters except ">"
	strd: charset {"'} ; string delimiters, double and single quote
	parse/all page [
		any [
			thru "<img" [
				ws "src" ws "=" ws 

    p1: [strd (delim: form p1/1) | (delim: ">")] (non-delim: complement 
    union whsp charset delim)

    p1: any non-delim p2: (append images copy/part p1 p2) ; keep the 
    url
				| non-end-tag
			] | skip
		]
	]

]


new-line/all images on ; add hidden newlines to the images block 
so it molds nicely
print mold images
It sounds like you want to modify the image links in place, so we 
can show you how to do that safely, too.
I should mention some characteristics of the above parse rule.

Since it does not parse html, its detection of real img tags is simple 
and cannot determine the context in which the string  "<img" is found. 
 For instance, there might be written some code in a preformatted 
text section, eg:
	<pre>
		<img src="...">
	</pre>

Such a section should be left alone by the parser as it is not "inside" 
the html.
Unfortunately, making a full html parser is not so easy...
But you may find the above rule is sufficient for your needs.
Alek_K
14-Apr-2006
[322]
'alt' and other atributes can be before img -> <img alt="picture" 
src="picture.jpg"/>
Anton
14-Apr-2006
[323]
Thankyou Alek, you are right.... hmm..
Alek_K
14-Apr-2006
[324]
about <pre> - html tags inside are permitted
Anton
14-Apr-2006
[325]
Yes, but they shouldn't be touched, should they ?
Alek_K
14-Apr-2006
[326]
But images are excluded from this :)
Anton
14-Apr-2006
[327]
I understand you, but maybe I didn't make myself clear above.
Alek_K
14-Apr-2006
[328x2]
Maybe I didn't  :) - <img> inside <pre> are not permited (as w3c 
states) - but IE / Opera / Firefox displays it
so changing src in it - is all way expected as for now
Anton
14-Apr-2006
[330]
Hmm... that's a strange rule. I thought that any text could be inside 
<pre> ... </pre> so that you could put code in. I don't claim to 
have a real indepth knowledge of html, though. I try to avoid it. 
:)
Alek_K
14-Apr-2006
[331]
If You want to show html code in <pre> - You should use &gt; for 
> and &lt; for <
Anton
14-Apr-2006
[332x3]
Ok, here is a version that should skip other attributes.
page: read http://www.rebol.com
images: copy []

use [whsp ws non-end-tag strd p1 p2 delim non-delim][

	whsp: charset " ^-^/" ; whitespace
	ws: [any whsp] ; a rule for any number of whitespace characters
	non-end-tag: complement charset ">" ; all characters except ">"
	strd: charset {"'} ; string delimiters, double and single quote
	parse/all page [
		any [
			thru "<img" whsp [
				any [
					ws "src" ws "=" ws 

     p1: [strd (delim: form p1/1) | (delim: ">")] (non-delim: complement 
     union whsp charset delim)

     p1: any non-delim p2: (append images copy/part p1 p2) ; keep the 
     url
					| non-end-tag 
				]
			] | skip
		]
	]

]


new-line/all images on ; add hidden newlines to the images block 
so it molds nicely
print mold images
Ah yes.
Alek_K
14-Apr-2006
[335x2]
one more - value in quotes can contain whitespaces - it is ok to 
have <img src="one two.jpg">
and second - one can write <img alt="picture" src=one.jpg /> - which 
is also good - and besides that IMO all is OK.
Anton
14-Apr-2006
[337]
Really ? "one two.jpg" doesn't have to have the space url encoded 
?
Gabriele
14-Apr-2006
[338x2]
no, quotes are for that.
also, in xhtml quotes are mandatory