• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp178
r3wp2151
total:2329

results window for this page: [start: 236 end: 335]

world-name: r3wp

Group: !AltME ... Discussion about AltME [web-public]
Maxim:
14-Mar-2005
it loads, but gives me a script load error, as if it was not able 
to decrypt the code within...
Izkata:
7-Apr-2005
This seems to be something to fix/change - AltME couldn't connect 
a few minutes ago, and IE wouldn't load any websites - I ran Ad-Aware 
and removed 17 tracking cookies.  As soon as they were gone, IE worked 
-and- AltME connected..

Is Rebol or AltME dependant on Internet Explorer?
Group: Core ... Discuss core issues [web-public]
shadwolf:
31-Dec-2004
hello every body On rebolfrance Forum we have a guy who wants to 
load a library DLL he have done most part of the work but he can't 
find how to convert in his rebol cloned struct! the int intpointer[4] 
from C language to an equivalent type of rebol. Can you enlight us 
please (you can respond directly to shadwolf)
Pekr:
10-Jan-2005
I just wanted to load small text files (representing records) into 
block, then sort them. But as life goes on, your system evolves and 
I can imagine, that your e.g. Contact database will be extended by 
e.g. cell-phone2 record. But your previous records are already synced 
across tens of users. I wanted to sort and wondered, what to do about 
old records ...
shadwolf:
13-Jan-2005
the thing is how to load or convert a C structure like this and use 
it in REBOL in a approachant way of C (I hope we could find even 
a better way to do it with rebol than in C)
shadwolf:
13-Jan-2005
//-------------------------------------------------------------
//- SMD2Header
//- Header for all Md2 files, 
struct SMD2Header
{
   int m_iMagicNum; //Always IDP2 (844121161)
   int m_iVersion;  //8
   int m_iSkinWidthPx;  
   int m_iSkinHeightPx; 
   int m_iFrameSize; 
   int m_iNumSkins; 
   int m_iNumVertices; 
   int m_iNumTexCoords; 
   int m_iNumTriangles; 
   int m_iNumGLCommands; 
   int m_iNumFrames; 
   int m_iOffsetSkins; 
   int m_iOffsetTexCoords; 
   int m_iOffsetTriangles; 
   int m_iOffsetFrames; 
   int m_iOffsetGlCommands; 
   int m_iFileSize; 
};

//-------------------------------------------------------------
//- SMD2Vert
//- Vertex structure for MD2
struct SMD2Vert
{
float m_fVert[3];
unsigned char m_ucReserved;
};


//-------------------------------------------------------------
//- SMD2Frame
//- Frame information for the model file 
struct SMD2Frame
{
float m_fScale[3];
float m_fTrans[3];
char m_caName[16];
SMD2Vert * m_pVerts;

//Cleans up after itself
SMD2Frame()
{
m_pVerts = 0;
}

~SMD2Frame()
{
if(m_pVerts)
delete [] m_pVerts;
}
};

//-------------------------------------------------------------
//- SMD2Tri
//- Triangle information for the MD2
struct SMD2Tri
{
unsigned short m_sVertIndices[3];
unsigned short m_sTexIndices[3];
};

//-------------------------------------------------------------
//- SMD2TexCoord
//- Texture coord information for the MD2
struct SMD2TexCoord
{
float m_fTex[2];
};

//-------------------------------------------------------------
//- SMD2Skin
//- Name of a single skin in the md2 file
struct SMD2Skin
{
char m_caSkin[64];//filename
CImage m_Image;//Image file ready for texturing
};

//-------------------------------------------------------------
//                        CTIMER                              -
// author: Evan Pipho ([evan-:-codershq-:-com])                     -
// date  : Jul 10, 2002                                       -
//-------------------------------------------------------------
class CMd2 : public CModel
{
public:

//Set skin to one of the files specified in the md2 files itself
void SetSkin(unsigned int uiSkin);
//Set skin to a different image
void SetSkin(CImage& skin);

//Load the file
bool Load(const char * szFilename);

//Render file at the initial position
void Render();
//Render the file at a certain frame
void Render(unsigned int uiFrame);


//Animate the md2 model (start and end frames of 0 and 0 will loop 
through the WHOLE model

void Animate(float fSpeed = 30.0f, unsigned int uiStartFrame = 0, 
unsigned int uiEndFrame = 0, bool bLoop = true);

//constructors/destructo
CMd2();
CMd2(const char * szFile);
~CMd2();

private:

CTimer m_Timer;
//file header information
SMD2Header m_Head; 
//Frame information
SMD2Frame * m_pFrames;
//Triangles
SMD2Tri * m_pTriangles;
//Texure coords
SMD2TexCoord * m_pTexCoords;
//Skin files
SMD2Skin * m_pSkins;
//Interpolated vertices
SMD2Vert * m_pVerts;
//Current skin
unsigned int m_uiSkin;
//Using a custom skin?
bool m_bIsCustomSkin;
//The custom skin
CImage * m_pCustSkin;

};
shadwolf:
14-Jan-2005
the goal is to provide to REBOL the capability to do such a load 
in the simpliest and fastest way I think the posibility of using 
a vectorial data like float myvar[3];
shadwolf:
14-Jan-2005
//-------------------------------------------------------------
//- Load
//- Loads an MD2 model from file
//-------------------------------------------------------------
bool CMd2::Load(const char * szFilename)
{
	unsigned char * ucpBuffer = 0;
	unsigned char * ucpPtr = 0;
	unsigned char * ucpTmpPtr = 0; 
	int iFileSize = 0;
	FILE * f;
	
	if(!(f = fopen(szFilename, "rb")))
	{
		APP->Log(COLOR_RED, "Could not open MD2 file %s", szFilename);
		return false;
	}

	//check file size and read it all into the buffer
	int iStart = ftell(f);
	fseek(f, 0, SEEK_END);
	int iEnd = ftell(f);
	fseek(f, 0, SEEK_SET);
	iFileSize = iEnd - iStart;

	//Allocate memory for whole file
	ucpBuffer = new unsigned char[iFileSize];
	ucpPtr = ucpBuffer;

	if(!ucpBuffer)
	{

  APP->Log(COLOR_RED, "Could not allocate memory for %s", szFilename);
		return false;
	}

	//Load file into buffer
	if(fread(ucpBuffer, 1, iFileSize, f) != (unsigned)iFileSize)
	{
		APP->Log(COLOR_RED, "Could not read from %s", szFilename);
		delete [] ucpBuffer;
		return false;
	}

	//close the file, we don't need it anymore
	fclose(f);

	//get the header
	memcpy(&m_Head, ucpPtr, sizeof(SMD2Header));

	//make sure it is a valid MD2 file before we get going
	if(m_Head.m_iMagicNum != 844121161 || m_Head.m_iVersion != 8)
	{
		APP->Log(COLOR_RED, "%s is not a valid MD2 file", szFilename);
		delete [] ucpBuffer;
		return false;
	}
	
	ucpTmpPtr = ucpPtr;
	ucpTmpPtr += m_Head.m_iOffsetFrames;

	//read the frames
	m_pFrames = new SMD2Frame[m_Head.m_iNumFrames];
	
	for(int i = 0; i < m_Head.m_iNumFrames; i++)
	{
		float fScale[3];
		float fTrans[3];
		m_pFrames[i].m_pVerts = new SMD2Vert[m_Head.m_iNumVertices];
		//expand the verices
		memcpy(fScale, ucpTmpPtr, 12);
		memcpy(fTrans, ucpTmpPtr + 12, 12);
		memcpy(m_pFrames[i].m_caName, ucpTmpPtr + 24, 16);
		ucpTmpPtr += 40;
		for(int j = 0; j < m_Head.m_iNumVertices; j++)
		{

   //swap y and z coords to convert to the proper orientation on screen

   m_pFrames[i].m_pVerts[j].m_fVert[0] = ucpTmpPtr[0] * fScale[0] + 
   fTrans[0];

   m_pFrames[i].m_pVerts[j].m_fVert[1] = ucpTmpPtr[2] * fScale[2] + 
   fTrans[2];

   m_pFrames[i].m_pVerts[j].m_fVert[2] = ucpTmpPtr[1] * fScale[1] + 
   fTrans[1];
			m_pFrames[i].m_pVerts[j].m_ucReserved = ucpTmpPtr[3];
			ucpTmpPtr += 4;
		}
		
	}

	//Read in the triangles
	ucpTmpPtr = ucpPtr;
	ucpTmpPtr += m_Head.m_iOffsetTriangles;
	m_pTriangles = new SMD2Tri[m_Head.m_iNumTriangles];
	memcpy(m_pTriangles, ucpTmpPtr, 12 * m_Head.m_iNumTriangles);

	//Read the U/V texture coords
	ucpTmpPtr = ucpPtr;
	ucpTmpPtr += m_Head.m_iOffsetTexCoords;
	m_pTexCoords = new SMD2TexCoord[m_Head.m_iNumTexCoords];
	
	short * sTexCoords = new short[m_Head.m_iNumTexCoords * 2];
	memcpy(sTexCoords, ucpTmpPtr, 4 * m_Head.m_iNumTexCoords);

	for(i = 0; i < m_Head.m_iNumTexCoords; i++)
	{

  m_pTexCoords[i].m_fTex[0] = (float)sTexCoords[2*i] / m_Head.m_iSkinWidthPx;

  m_pTexCoords[i].m_fTex[1] = (float)sTexCoords[2*i+1] / m_Head.m_iSkinHeightPx;
	}
	
	delete [] sTexCoords;

	//Read the skin filenames
	ucpTmpPtr = ucpPtr;
	ucpTmpPtr += m_Head.m_iOffsetSkins;
	m_pSkins = new SMD2Skin[m_Head.m_iNumSkins];
	
	//Load textures
	for(i = 0; i < m_Head.m_iNumSkins; i++)
	{
		memcpy(m_pSkins[i].m_caSkin, ucpTmpPtr, 64);
		//hack off the leading parts and just get the filename
		char * szEnd = strrchr(m_pSkins[i].m_caSkin, '/');
		
		if(szEnd)
		{
			szEnd++;
			strcpy(m_pSkins[i].m_caSkin, szEnd);
		}

		m_pSkins[i].m_Image.Load(m_pSkins[i].m_caSkin);
		ucpTmpPtr += 64;
	}
		
	delete [] ucpBuffer;
	return true;
}
shadwolf:
14-Jan-2005
class CMd2 : public CModel
{
public:

	//Set skin to one of the files specified in the md2 files itself
	void SetSkin(unsigned int uiSkin);
	//Set skin to a different image
	void SetSkin(CImage& skin);

	//Load the file
	bool Load(const char * szFilename);
	
	//Render file at the initial position
	void Render();
	//Render the file at a certain frame
	void Render(unsigned int uiFrame);


 //Animate the md2 model (start and end frames of 0 and 0 will loop 
 through the WHOLE model

 void Animate(float fSpeed = 30.0f, unsigned int uiStartFrame = 0, 
 unsigned int uiEndFrame = 0, bool bLoop = true);

	//constructors/destructo
	CMd2();
	CMd2(const char * szFile);
	~CMd2();

private:
	
	CTimer m_Timer;
	//file header information
	SMD2Header m_Head; 
	//Frame information
	SMD2Frame * m_pFrames;
	//Triangles
	SMD2Tri * m_pTriangles;
	//Texure coords
	SMD2TexCoord * m_pTexCoords;
	//Skin files
	SMD2Skin * m_pSkins;
	//Interpolated vertices
	SMD2Vert * m_pVerts;
	//Current skin
	unsigned int m_uiSkin;
	//Using a custom skin?
	bool m_bIsCustomSkin;
	//The custom skin
	CImage * m_pCustSkin;

};
shadwolf:
14-Jan-2005
if you want to load 3 MD2 files you need only to make other main 
pointer to the information you retrieve from the file
shadwolf:
14-Jan-2005
in rebol you will need to load 3 files to declare SDM2Header_f1 SMD2Header_f3 
and SMD2Header_f3 with for both the stricly identical content tso 
your recoding 3 times or X times the same thing ...
shadwolf:
14-Jan-2005
I'm not an expert on struct! far of that (wel in C yes but in REBOL 
no and I think it's because I'm not using load/library capability 
until now) but that's a good discution to point to difficulties on 
this kind of task and I hope help rebol Core to have a bettre handling 
of that
Terry:
15-Jan-2005
Has anything changed with core regarding loading?  I'm trying to 
load a function using a URL, and it comes back as a block?
Terry:
15-Jan-2005
Has load become load/all ?
Sunanda:
15-Jan-2005
For anything other than a simple value, you've always got a block 
back from load (as far as I remember)
>> load "1"
== 1               --- a value
>> load "1 2"
== [1 2]               --- a block
>> load mold :to-idate
== [func .....         -- a block


>>
sqlab:
24-Jan-2005
load mold works too
>> t: rejoin [ [] to-word "[" to-word "]"]
== [[ ]]
>>  load mold  t
== [[]]
>> type? first load mold t
== block!
>>
Group: Script Library ... REBOL.org: Script library and Mailing list archive [web-public]
Sunanda:
1-May-2007
That's a nice idea for a sort of "REBOL explainer" application.
But it would be difficult to do in the Library.

The Library does attempt to load and parse scripts -- that's how 
we do the colorisation. But (as with Gabriele's code) we rely on 
REBOL's own reflective abilities to tell us what is a word, function, 
operator etc.

The Library runs an old version of Core (and even if we update that, 
we'd never run a version of View on a webserver) so it does not have 
access to all the information a proper explainer.highlighter would 
need.
Take this script for example:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?color=yes&script=reboldiff.r

'new-line is a valid REBOL word, but it is not colored: that's because 
it is not a word in the version we use.

So sadly, the colorisation at REBOL.or remains a nice bit of eye 
candy rather than a solidly dependable feature.
Sunanda:
1-May-2007
That's true -- not something we could do safely on a server.....Hence 
we are limited to load/header etc.

A desktop application may be able to be more daring -- provided you 
don't let arbitrary code out of the sandbox.
Anton:
4-Sep-2008
Hmm... How to do that?
We need to know where a particular
Maybe:
1. Read script *and* Load script
2. Visit each item in the loaded block, recursively.
3. As each item is visited, check its type.

4. Depending somewhat on type, parse (in the READed script) to the 
molded item:
4.1  If it's a series, search for the "opener", eg. block! -> "["
4.2  If it's a non-series, search for it molded.
4.3
Sunanda:
4-Sep-2008
We do index the files, and we have several indexes, some built by 
parsing parts of the script. So we can, usually, search for special 
parts of scripts -- like strings or comments.

Part of the difficulty is that there are some scripts that we cannot 
do a 'load or a 'load/header on - they are broken or have an incompatible 
'needs: header. So we cannot add those scripts to the sepcialised 
indexes. They need specialised handling :-)

Watch this space -- I'm fiddling with some code that may partially 
need your need.
Anton:
4-Sep-2008
Can't load ? Just skip it with with a warning message :) You still 
get your 99% solution.
Sunanda:
4-Sep-2008
If we can't load, we try a few tricks (like commenting out the needs: 
header and reloading).

But still, there are one ot two that we fail with. So they don't 
get as well indexed as the others...And (for the same reasons) they 
are the ones that appear in black and white even if you click the 
"view in color" link.
BrianH:
4-Sep-2008
For that matter, do you index line comments separately, as LOAD filters 
them out?
sqlab:
14-Apr-2009
Mike

I checked your library example from the I'm new group producing errors.

There is probably a weakness, as the script does not regard comment 
lines.
A short enhancement would be
   
parse-ini-file: func [
    file-name [file!]
   /local ini-block
    current-section
    parsed-line
    section-name
][
 ini-block: copy []
    current-section: copy []
    foreach ini-line read/lines file-name [
		if #";" <> first ini-line [ ; do not process comment lines
			section-name: ini-line
			error? try [section-name: first load/all ini-line]
			either any [
				error? try [block? section-name]
				not block? section-name
			][
				parsed-line: parse/all ini-line "="
				append last current-section parsed-line/1
				append last current-section parsed-line/2
			][
				append ini-block current-section
				current-section: copy []
				append current-section form section-name
				append/only current-section copy []
			] ;; either
		]
    ] ;; for
 append ini-block current-section
 return to-hash ini-block
 ]
BrianH:
24-Jun-2009
The Needs header works in R3, and is only checked on DO, not LOAD.
Sunanda:
9-Jul-2009
REBOL.org just migrated from the world's slowest single server to 
a small load balanced cluster.
Sadly, we're not superfast, but its early days yet.


One cosmetic problem: we're showing the date as 6 hours out. Highly 
trained techies are working to resolve that. Other than that, it 
was a smooth move, mainly handled by the ISP.
Group: Make-doc ... moving forward [web-public]
Henrik:
11-Jan-2005
there seems to be some things missing (how to make bold and italic?) 
and I can't properly process multiple documents using makedoc2. the 
<html>, <body> and CSS code is only included in the first one, but 
not subsequent ones, if I 'load-only makedoc2 and follow the example 
shown in the source code.
Group: MySQL ... [web-public]
Maxim:
25-Jan-2005
The server I am accessing is very quick and in general, it accomplishes 
its query in micro seconds.  so its not really a question of server 
load...
Terry:
18-Feb-2005
try this from your rebol console.. 

do load http://powerofq.com/start
°load° "°mysqlprot°"


a: read join mysql://yourName:[yourPassword-:-localhost]/yourDatabaseName 
"show tables"
Tim:
18-Feb-2005
Here are the results: >> do load http://powerofq.com/start
connecting to: powerofq.com
>> load "mysqlprot"
== mysqlprot
a: read join mysql://tim:[password-:-localhost]/hs4u "show tables"
>> a: read join mysql://tim:[password-:-localhost]/hs4u "show tables"

** Access Error: Invalid port spec: mysql://tim:[password-:-localhost]/hs4ushow 
tables

** Near: a: read join mysql://tim:[password-:-localhost]/hs4u "show tables"
Sunanda:
25-Feb-2005
Apologies on Insert -- I'd assumed from the fact you'd asked the 
question that MySQL did not support the Values syntax.


Update is trickier as you are potentially changing a whole load of 
values.

Best way is to have the update data in a 2nd table, and then select 
as appropriate.
MikeL:
16-Sep-2005
This is related, I think, to my notes about VID and MySQL in the 
View section. In a test that we ran in 2004 we were able to load 
1,000,000 rows in under 30 minutes.  We did not investigate further 
but we thought we could improve this by running parallel loads and 
putting it on a real server instead of a laptop.  This volume was 
equal to the annual volume of  the transactions we were interested 
in so would represent a journal of everything that happened to this 
app as a keyed transaction in one year.   


From that 1,000,000 row database, we were able to create an HTML 
report based on some selected criteria in 2.5 seconds.  

All tests done with REBOL View using Doc's mySQL protocol.
Pekr:
9-Jan-2006
Doc, are you sure your 'docode table is ok? I mean defs/client ....

client [
			long-password		1		; new more secure passwords
			found-rows			2		; Found instead of affected rows
			long-flag			4		; Get all column flags
			connect-with-db		8		; One can specify db on connect
			no-schema			16		; Don't allow db.table.column
			compress			32		; Can use compression protcol
			odbc				64		; Odbc client
			local-files			128		; Can use LOAD DATA LOCAL
			ignore-space		256		; Ignore spaces before '('
			change-user			512		; Support the mysql_change_user()
			interactive			1024	; This is an interactive client
			ssl					2048	; Switch to SSL after handshake
			ignore-sigpipe		4096	; IGNORE sigpipes
			transactions		8196	; Client knows about transactions
		]

While in protocol description, there is:

MySQL uses the following codes:
Capability name	Value	Meaning
LONG_PASSWORD	1	New more secure passwords
FOUND_ROWS	2	Found instead of affected rows
LONG_FLAG	4	Get all column flags
CONNECT_WITH_DB	8	One can specify db on connect
NO_SCHEMA	16	Don't allow database.table.column
COMPRESS	32	Can use compression protocol
ODBC	64	ODBC client
LOCAL_FILES	128	Can use LOAD DATA LOCAL
IGNORE_SPACE	256	Ignore spaces before '('
PROTOCOL_41	512	Support the 4.1 protocol
INTERACTIVE	1024	This is an interactive client
SSL	2048	Switch to SSL after handshake
IGNORE_SIGPIPE	4096	IGNORE sigpipes
TRANSACTIONS	8192	Client knows about transactions
SECURE_CONNECTION	32768	New 4.1 authentication
MULTI_STATEMENTS	65536	Multi-statement support
MULTI_RESULTS	131072	Multi-results
Dockimbel:
14-Jan-2006
I have plans for a version 2 of this driver including a full code 
rewritting for much cleaner design, speed improvements, optional 
async API, support more protocol features (like LOAD DATA), implement 
the v5 protocol, improved user API (e.g.: select column in a record 
by field name), etc...
Dockimbel:
11-Jun-2006
1) Load the REBOL mysql console : do %mysql.r
2) Connect to the server
3) Command: show tables
4) result ok
5) Stop/Start the server
6) Command: show tables
7) result ok (the driver has reconnected transparently)
Group: Linux ... [web-public] group for linux REBOL users
Henrik:
3-Mar-2006
it's a load of crap. who has the resources to go through that? and 
do they really expect to find security holes by doing it?
[unknown: 10]:
22-Mar-2006
Its strange.. I should not be needing to run a fontserver..My desktop 
is already anti-aliased with fonts and so it the rest..But rebol 
still does not display it... mmm It does load the font though..(also 
when i look with an Strace during the execute rebol does read the 
font..) it simply does not display it ..yet! ;-)

>> probe fnt1

make object! [
    name: "/usr/X11R6/lib/X11/fonts/TTF/VeraMono.ttf"
    style: none
    size: 32
    color: 0.0.0
    offset: 2x2
    space: 0x0
    align: 'center
    valign: 'center
    shadow: none
]
Group: !Readmail ... a Rebol mail client [web-public]
PhilB:
10-Jan-2005
rebmail 4.7.14 & associated helptext has been released (31/12/2004) 
...

Changes Since 4.7.11
Enhancement - re-work locale format (for security purposes)
Bug Fix - Correct Fetch All Error
Enhancement - Use load/all & Construct to load locale from file


rebmail.r can be found at .... http://www.upnaway.com/~philb/philip/pbmail/readmail.r

reabmail is also the following formats 

rip format at  .... http://www.upnaway.com/~philb/philip/pbmail/readmail.rip

zip format at  .... http://www.upnaway.com/~philb/philip/pbmail/readmail.zip


the archive containing rebmail.r & rebamail.html (rip = compressed 
self extracting rebol archive)
 
Any problems let me know.
PhilB:
10-Jan-2005
rebmail 4.7.14 & associated helptext has been released (10/01/2004) 
...

Changes Since 4.7.11

4.7.12 - Enhancement - re-work locale format (for security purposes)
4.7.13 - Bug Fix - Correct Fetch All Error

4.7.14 - Enhancement - Use load/all & Construct to load locale from 
file


rebmail.r can be found at .... http://www.upnaway.com/~philb/philip/pbmail/readmail.r

reabmail is also the following formats 

rip format at  .... http://www.upnaway.com/~philb/philip/pbmail/readmail.rip

zip format at  .... http://www.upnaway.com/~philb/philip/pbmail/readmail.zip


the archive containing rebmail.r & rebamail.html (rip = compressed 
self extracting rebol archive)
 
Any problems let me know.
Group: XML ... xml related conversations [web-public]
CarstenK:
7-Nov-2005
to John (or geomol),

first I've got the following error:
>> my-cdoc: xml2rebxml/preserve read %short.xml
** Syntax Error: Invalid word -- -->
** Near: (line 9) -->

So I replaced
  insert tail output load join "<!--" data
with
  insert tail output join "<!--" data
and it works fine with my files!


You were right, the replacements in text nodes are only &amp; &gt; 
&lt;. In attributes we need to escape the other 2 entities as allready 
done by you.
Geomol:
7-Nov-2005
Carsten, I think, your removal of LOAD in the error solution, you 
posted, does lead to some problems. But there also is a problem with 
the script, as it is now. I'm doing some investigation.
CarstenK:
7-Nov-2005
But if you have 10 or more you can collect them, maybe they print 
some report (time, errors etc.) and you avoid things like this: carstens 
removes a "load", it works for him, but breaks another piece of code. 
And often nobody writes test scripts/code. And the test scripts, 
if available, are always a good code base to learn how the real script 
should be used. I'll look into rebol-unit (but only tomorrow)...
Pekr:
11-Nov-2005
hmm, couldn't we just somehow mix the aproach, so to have some streamed 
dom? :-) I don't like the idea of having 10MB XML interchange file 
to load into memory ....
Maxim:
12-Apr-2006
my own  when I started the project I did not have many days to "get 
on with it" and for various reasons all the tools I tried didn't 
properly load the specification I was trying to load.
Maxim:
12-Apr-2006
my tool currenctly loads 1MB of xml tags in under a second.  its 
almost as fast as load/markup.
Pekr:
12-Apr-2006
does it work SAX way or DOM way? I mean - load first, then parse, 
or parse while reading way?
[unknown: 9]:
21-Apr-2006
We have done a little in Qtask.  WE save the tasks as XML (and call 
it XLS so that Excel can load it).
We will be writing an RSS reader soon.
Maxim:
27-Apr-2006
although getting XML:schema LOAD/SAVE , complete, native  XML 1.0 
LOAD/SAVE  that would at least allow us to start using XML in the 
first place  ;-)
Chris:
19-Nov-2008
; Usage:

do http://www.ross-gill.com/r/qxml.r
load-xml {<some xml="to">Try</some>}
Gregg:
19-Nov-2008
** Script Error: pop has no value
** Where: load-xml
** Near: mk: insert mk: back mk
Chris:
3-Dec-2008
>> load-xml {<some xml="to">Try</some>}
==  [
	<some>
		/xml "to"
		# "Try"
	]
]
Chris:
3-Dec-2008
>> load-xml "<try>This</try>"
== [
    <try> "This"
]
Chris:
3-Dec-2008
response: context [
	status: name: value: none
]

example: {<rsp>
	<status>Good</status>
	<payload>
		<value name="one">two</value>
	</payload>
</rsp>}

probe make response [
	parse load-xml example [
		<rsp> into [
			<status> set status ["Good" | "Bad"]
			<payload> into [
				<value> into [
					/name set name string! # set value string!
				]
			]
		]
	]
]
Chris:
3-Dec-2008
do http://www.ross-gill.com/r/qdom.r

doc: load-dom {<some><xml>to try</xml></some>}
values: doc/get-by-tagname <xml>
values/1/value = "to try"
Chris:
4-Dec-2008
Ok, another revision.  This has a few more methods, I may strip them 
down to read-only, as I don't need to manipulate the object though 
I left them in for completeness.

>> do http://www.ross-gill.com/r/qdom.r
connecting to: www.ross-gill.com
Script: "QuickDOM" (none)
>> doc: load-dom {<some><xml id="foo">to try</xml></some>}
>> foo: doc/get-by-id "foo"
>> foo/name
== <xml>
>> foo/value
== [
    /id "foo" 
    # "to try"
]
>> kids: foo/children
== [make object! [
        name: #
        value: "to try"
        tree: [
            # "to try"
        ]
        position: [
   ...
>> kids/1/value
== "to try"
>> doc/tree/<some>/<xml>/(#)           
== "to try"
Graham:
22-Jun-2009
format-xml: func [ xml
    /local out space prev
][
    out: copy ""
    spacer: copy ""
    prev: copy </tag>
    foreach tag load/markup xml [
        either tag = find tag "/" [
            ; we have a close tag
            

            ; reduce the spacer by a tab unless the previous was an open tag
            either not tag? prev [
                ; not a tag
                remove/part spacer 4
            ][
                ; is a tag
                if prev = find prev "/" [
                    ; last was a closing tag
                    remove/part spacer 4
                ]
            ]
        ][ 
            either tag? tag [
                ; current is tag
                ; indent only if the prev is not a closing tag
                if not prev = find prev "/" [
                    insert/dup spacer " " 4
                ]
            ][
                ; is data
                insert/dup spacer " " 4 
            ]
        ]
        repend out rejoin [ spacer tag newline ]
        prev: copy tag
    ]
	view layout compose [ area (out) 400x400 ]
]

obj2xml: func [ obj [object!] out [string!]
	/local o 
][
	foreach element next first obj [
		repend out [ to-tag element ]
		either object? o: get in obj element [
			obj2xml o out
		][
			repend out any [ o copy "" ]
		]		
		repend out [ to-tag join "/" element ]
	]
]
Maxim:
24-Jun-2009
>> probe load replace {#[object! [a: #[object! [b: #[object! [c: 
"%VALUE%"]]]]]]} "%VALUE%" "tadam!"
make object! [
    a: make object! [
        b: make object! [
            c: "tadam!"
        ]
    ]
]
Maxim:
24-Jun-2009
my client has a few thousand data types to cope with ;-) rebxml allows 
you to load that up pretty quickly...but not using the xsd obviously.


its parser builds up a string and then loads it.   I found it to 
be quite fast actually.  its MUCH faster than firefox, for example.
Maxim:
24-Jun-2009
you can just do a mold/all load, that will in effect copy the whole 
tree along with all the series too.
Maxim:
24-Jun-2009
ex:

load mold/all make object! [
    a: make object! [
        b: make object! [
            c: "tadam!"
        ]
    ]
]


will effectively create a complete duplicate of the whole object 
tree.
Graham:
24-Jun-2009
So, I can continue to make the objects as I have been doing.  But 
just before I use it ... I load mold/all on it to ensure I have unique 
objects
Graham:
24-Jun-2009
ie. I load a serialized form of the object
Graham:
24-Jun-2009
seems not :(

>> pharmacy: make object! [
[     name: none
[     init: func [ n ][
[          self/name: n
[         ]
[    ]
>> a: load mold/all make pharmacy []
>> probe a
make object! [
    name: none
    init: func [n][
        self/name: n
    ]
]
>> a/init "testing"
** Script Error: self has no value
** Where: init
** Near: self/name: n
Maxim:
24-Jun-2009
if you have a function inside, I think you have to do it instead 
of load it.
Graham:
24-Jun-2009
so, I have to  now do

a: do load mold make pharmacy [ ]  ?
Sunanda:
24-Jun-2009
Do has some dangers if you do not trust the code involved. This works 
for me, and keeps the load/all (but not the self).....Even more tortured:
   a: first reduce load/all mold pharmacy
Sunanda:
24-Jun-2009
You may have some other issues to consider as part of building/loading 
the data structures.

For example, Version2 of the application adds some fields  not present 
in V1.

To avoid a one-off bulk conversion exercise, the load process needs 
to check each object and add missing fields with default values.
Chris:
12-Aug-2009
>> do http://www.ross-gill.com/r/altxml.r
connecting to: www.ross-gill.com
Script: "AltXML" (7-Jun-2009)
>> all-stats: load-xml/dom your-xml-data 
>> player: stats/get-by-id "b.11965"                        
>> his-stats: first player/get-by-tag <stats-baseball-offensive>
>> his-stats/get #hits                                          
== "1"


>> remove-each code codes: all-stats/get-by-tag <sports-content-code> 
["league" <> code/get #code-type]
== [make object! [
        name: <sports-content-code>
        space: none
        value: [
            #code-type "league" 
      ...
>> foreach code codes [probe code/get #code-name]
Major ^/      League Baseball
== "Major ^/      League Baseball"
Chris:
14-Aug-2009
>> google-xml: load-xml/dom clipboard:// ; copied from page
>> entries: google-xml/get-by-tag <entry>
== [make object! [
        name: <entry>
        space: none
        value: [
            #etag {"BxAUSh5RAyp7ImBq"} 
            <...
>> foreach entry entries [probe entry/get <resourceId>]
spreadsheet:key
== "spreadsheet:key"
Pekr:
4-Jan-2010
I like SAX model, because IIRC it allows to work on things in a "streamed" 
way, whereas DOM requires you load everything in memory? Sorry if 
I oversimpilifed it :-) IIRC Doc used such aproach in his Postgress 
SQL driver, in opposite to his mySQL one ...
Group: PowerPack ... discussions about RP [web-public]
Robert:
28-May-2005
One major point wasn't said: We need a library system to handle all 
this. I won't use code, where I need to 'do zillions of single files 
in a specific order, handle path and lookup things, need local sub-directories 
to load images etc.


I'm still using Slim on my xpeers system, because that's the only 
thing I know about that handles all this quite well. And I can tell 
you, it pays off. Something like this is required.
Graham:
30-Jan-2010
So to use the power pack, we have to load the module system first 
....
Graham:
30-Jan-2010
I was just looking to see what I needed to use the html-filter function, 
and it seems I have to load the module system, and then import all 
stuff needed to run the html-filter ...
Group: Sound ... discussion about sound and audio implementation in REBOL [web-public]
Rebolek:
27-Jun-2005
snd: load http://krutek.info/rebol/sound.r

view layout [
	button "play" [
		wav: make sound [rate: 22050 data: snd] 
		print "make wav" ? wav
		sndport: open sound:// 
		insert sndport wav 
		print "insert sound" ? wav
		close sndport
	]
]
Rebolek:
2-Feb-2006
Anyway, it works. In the bottom row, there are six buttons. Press 
second button (load sound) and go to %sounds/ directory. Select a 
sound and open it.
Sunanda:
17-Jun-2008
Can any one help me reply to this question (received via REBOL.org's 
feedback form)?
Thanks!
<<
Where can I find more Hex Code like in psg-ay-3-8910-study.r

Please point me to a tool that I can use for development of  Sound 
Code for the AY-3-8910 where I end up with Hex Code that I can then 
load into EPROMs which would drive the AY-3-8910. Thanks for any 
help.

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=psg-ay-3-8910-study.r
>>
amacleod:
15-Mar-2009
Any reason I can play pre-recorded .wav files but if try to make 
my own they do not work:

** Access Error: Bad image data
** Where: narrate
** Near: insert sound-port load talk
Steeve:
21-Apr-2009
you have to load a wav sample
Anton:
21-Apr-2009
Oldes, thanks. Do this

 load-thru/update http://anton.wildit.net.au/rebol/os/make-external-library-interface.r
then try again.
Group: Rebol School ... Rebol School [web-public]
BrianH:
4-Apr-2006
denismx, when I've taught REBOL to people, even people who are already 
familiar with other programming languages, it has been helpful to 
make the distinction between the REBOL language and the dialect engines.


REBOL is really a data model and related syntax, and a bundle of 
library functions that manipulate data in this model. A dialect is 
really a semantic model for interpreting this data, like what people 
think of as a language in real life. A dialect engine is a set of 
library functions that think of the data in the same way - I know 
this sounds anthropomorphic, but it makes it easier to explain REBOL 
if you think of the different dialect engines as entities that are 
acting on a set of commands you are giving them. You can even use 
role playing to demonstrate this, having one of your students act 
out the part. It also helps to name each of these models after the 
main function that implements them - otherwise people might not get 
the distinction between them and REBOL as a whole.


There are some functions that only deal with the REBOL data model 
and don't really do anything with the data other than translate it 
from or to some concrete syntax. It is best to group these functions 
by the syntax they implement - the group that implements what people 
normally think of as the REBOL syntax is LOAD, SAVE and MOLD.


When teaching REBOL dialects I usually start with what I call the 
DO engine, what people normally think of as the REBOL language. DO 
is a stack machine like Forth, but it uses a prefix syntax to make 
it easier to use (by making DO dialect code more resemble that in 
other programming languages). DO also does a simple swapping hack 
to implement inline operators, which you will have to demonstrate 
so that your students will understand DO's operator precedence or 
lack thereof. DO always works on REBOL data: If you pass it a string 
or file that contains REBOL syntax code, DO will call LOAD to convert 
it to REBOL data - this is an important distinction to make so that 
your students can distinguish between the data and the processor 
of that data. There are many functions that depend on DO to interpret 
their blocks of "code", such as IF, WHILE, FOR, etc. It is important 
to note that these are just functions, not "syntax". DO's only syntax 
is the predefined operators that DO swaps (these are effectively 
keywords because of how the swap is implemented), the word/set-word/get-word 
difference, the interpretation of paths and the precedence of parens. 
Everything else is a function.


There is also the PARSE engine, a rule-based recursive-decent parser 
with limited backtracking, that implements three dialects (simple 
parse, string parse and block parse). These dialects actually have 
keywords, as well as an entirely different execution model. Also, 
there is the View engine, which implements the LAYOUT and DRAW dialects.


Refering to these engines as state machines isn't helpful, because 
the distinctions between their execution models, or whether they 
even have execution models, is important for distinguishing between 
them. You need to use the higher-level terms like stack machine, 
composition engine and such.

I hope this helps!
denismx:
19-Apr-2006
Actually, since Von Neuman, code is treated as data. You load it 
into memory and process is as a special kind of data.
Anton:
22-Apr-2006
Ok, so here's my frequency table:
    6 compose 
    5 as-pair 
    5 func 
    4 do 
    3 show 
    2 all 
    2 copy 
    2 find 
    2 form 
    2 get 
    2 in 
    2 pick 
    2 print 
    2 to-image 
    2 use 
    1 * 
    1 + 
    1 - 
    1 <> 
    1 = 
    1 append 
    1 bind 
    1 center-face 
    1 change 
    1 clear 
    1 context 
    1 do-events 
    1 either 
    1 first 
    1 foreach 
    1 if 
    1 join 
    1 layout 
    1 load-thru 
    1 make 
    1 mold 
    1 object? 
    1 reduce 
    1 remold 
    1 remove-each 
    1 repeat 
    1 second 
    1 select 
    1 to-pair 
    1 to-path 
    1 view
Anton:
5-May-2006
read file --> string
load file --> block
Anton:
5-May-2006
Strings and blocks are both series, so first, next find etc work 
on both, but when you load you get a block and the units are values. 
When you read, you have a string and the units are characters.
Anton:
5-May-2006
When you load, the file has to be LOADable by rebol, which means 
everything in it must be parseable into rebol values.

When you read, the file can be absolutely anything. I usually have 
to read web pages and parse a string, for instance.
Group: SQLite ... C library embeddable DB [web-public].
Ashley:
13-Feb-2006
sqlite3-protocol.r has a minor bug whereby locals/cols are not cleared. 
Fix is to add a "clear cols" at the beginning of the ' sqlite-exec 
func. Two other changes I made to this function were:


1) Changing “SQLITE_TEXT [any [attempt [load val: sqlite3/column_text 
stmt j] val]]” so as REBOL values are returned, and

2) Removing the /only clause from "system/words/insert/only tail 
result col" for those that prefer flat data structures (i.e. non-blocked 
records)

Finally, a simple wrapper makes the whole thing more usable:

context [

	db: none

	set 'open-db func [name [file!]] [
		db: open join sqlite://localhost/ name
	]

	set 'close-db does [
		close db
	]

	set 'describe func ['table [word!]] [

  insert db rejoin ["select type, name, sql from sqlite_master where 
  upper(tbl_name) = '" uppercase form table "' order by rootpage"]
		db/locals/sqlresult
	]

	set 'sql function [arg [string! block!]] [statement] [
		case [
			string? arg [insert db arg]
			string? first arg [
				statement: copy first arg
				repeat i -1 + length? arg [
					replace/all statement join ":" i pick arg i + 1
				]
				insert db statement
			]
		]
		db/locals/sqlresult
	]
]

which lets you do stuff like:

>> open-db %test.db
>> sql "create table t1 (col1 INTEGER, col2 TEXT)"
== []
>> describe t1
== [table t1 "CREATE TABLE t1 (col1 INTEGER, col2 TEXT)"]
>> sql reduce ["insert into t1 values (1,':1')" now/date]
== []
>> sql "select * from t1"
== [1 13-Feb-2006]
>> close-db
Ashley:
13-Feb-2006
I will once they've settled down ... the SQLITE_TEXT change mentioned 
previously should read:

	SQLITE_TEXT [
		val: sqlite3/column_text stmt j
		any [
			all [
				attempt [tmp: load val]
				not block? tmp
				not word? tmp
				tmp
			]
			val
		]
	]


which should correctly handle TEXT with embedded white-space or illegal 
load chars. The context of funcs can also have the following useful 
func added:

	set 'sql-columns does [
		copy db/locals/cols
	]


and should probably 'copy return db/locals/sqlresult in both the 
'sql and 'describe functions.
Ashley:
15-Feb-2006
As I mentioned near the beginning of this thread, SQLite supports 
multiple database files each containing one or more tables - in fact 
they go so far as recommending that you separate multiple high-access 
tables out into different databases for concurrency reasons. In this 
sense, SQLite "databases" act more like traditional "tablespaces". 
So, if we wanted we could write our REBOL front-end so that it created/accessed 
each table in a database of the same name thus ensuring a one-to-one 
mapping between table names and database names. The advantages of 
this approach are:

	backups (only those tables that change need be backed up)

 external table administration (you can drop a table by deleting its 
 database file)

 concurrency (you spread your file locking across a greater number 
 of physical files)

Disadvantages:


 Administering your database is more cumbersome (you can't use the 
 sqlite3 admin tool to administer all tables in one session)

 Value of sqlite_master is diminished (you can't "select * from sqlite_master" 
 to report on all your tables in one query)

 Query references need to add a database prefix when referring to 
 a table not in their own database

 Name conflicts (all tables in one file means multiple databases can 
 use the same table names - the solution with multiple files would 
 be to segregate at the directory level)

 Multiple database files means you need to zip them prior to some 
 operations such as email attachment, etc


On balance, I actually prefer the one file / one database approach.


Pekr's other comments in relation to schema implementation also have 
merit (I've agreed with Pekr twice today - a new record!); I see 
the value of an ftp schema, an http schema, etc; but what value in 
a sqlite schema? Given that the entire schema can be written in a 
much more concise fashion as an anonymous context that exports a 
couple of key access functions to the global context; I can't see 
what the functional differences between the two implementations would 
be?


So, bar any good reasons to the contrary, these are the features 
of the implementation I am currently working on (a rough design spec 
if you like):

	Implemented as an anonymous context

 "Database" is a directory (which is specified when a database is 
 opened with 'open-db)

 Each table resides in a "tablespace" (aka SQLite database file) of 
 the same name
	File is automatically opened on first reference

 The /blocked refinement of 'db-open specifies that rows will be returned 
 in their own block (default is a single block of values)

 Non-numeric values (which SQLite stores natively as INTEGER and REAL) 
 will be subject to 'mold/all on insert and 'load on retrieval

 The /native refinement of 'open-db will turn this behaviour off (see 
 comments below)

 SQLite binding will be supported allowing statements such as ["insert 
 into table values (?,?,?)" 1 [bob-:-mail-:-com] "Some text"] and ["select 
 * from table where email = ?" [bob-:-mail-:-com]]


Whether to store values (including string!) as molded values in SQLite 
is an interesting question; on the one hand it gives you transparent 
storage and access to REBOL values – but at the performance cost 
of having to mold and load every TEXT value returned; and the storage 
cost of the overhead of a molded representation. On the other hand, 
if I only want to store numbers and strings anyway then I don't want 
this overhead. I think the only practical solution is a /native type 
option as detailed above.
Ashley:
16-Feb-2006
I've given up on the one table per database idea as the default attachment 
limit is 10 files. On the positive side, the ATTACH command seems 
to work properly under 3.0+ and table names unique to an attached 
database do not have to be prefixed in queries. ;) My 'connect function:

>> help connect
USAGE:
    CONNECT database /create /attach databases /blocked /direct

DESCRIPTION:
     Open a SQLite database.
     CONNECT is a function value.

ARGUMENTS:
     database -- (Type: file url)

REFINEMENTS:
     /create -- Create database if non-existent

     /attach -- Attach up to 10 databases (of type file!) to this connection
         databases -- Database files (Type: block)
     /blocked -- Return each row as a block
     /direct -- Do not mold/load REBOL values

lets you do this:


 connect/attach %/c/app/data/system.db [%/c/app/data/users.db %/c/app/data/reports.db]
	sql "select * from a-system-table"
	sql "select * from a-user-table"
	sql "select * from a-report-table"


which could be quite useful in many situations. The default, however, 
is now one database.


BTW, my rewrite (even after adding a lot more functionality) is about 
twice as fast as the original protocol version.
Anton:
9-Mar-2006
He might be doing this :
	context load %script
Gabriele:
14-Mar-2006
notice that encap does a mold/flat load on the script too
Gabriele:
14-Mar-2006
does   do mold/flat load %sqlite.r    still work?
Ashley:
20-Mar-2006
Graham, yes to all the above except timestamp/date fields. SQLite 
only supports 5 datatypes: Integer, Decimal, Binary, Null and Text. 
The driver (unless using the /direct refinement to connect) MOLDs 
and LOADs other REBOL types such as date!, pair!, etc into SQLite 
TEXT fields so date is certainly supported at the REBOL level (although 
an "order by date" clause will not give the expected results ... 
I tend to use 'sort/skip SQL "select id,date from t" 2' type constructs 
to achieve the desired result).


Given how common this later operation is (order by date) I'm looking 
at changing the way date is bound. Instead of just MOLDing it, if 
it is transformed to YYYY-MM-DD format then not only can LOAD recognize 
it but it can be sorted (as TEXT) directly by SQLite.
Pekr:
21-Mar-2006
Ashley - the question is, if there should be any delimiter in DB 
:-) You can write simple copy/part at .... if you want .... and load 
will load it into rebol format anyway, no?
Ashley:
21-Mar-2006
Pekr, "the question is, if there should be any delimiter in DB". 
There has to be, otherwise LOAD will treat "20060101" as an integer 
not a date. Remember that SQLite has no concept of "column types" 
so the MOLDed values themselves have to carry / represent the REBOL 
type when LOADed. What we are trying to do with date is to use an 
alternate representation that REBOL will still recognize as a date 
but that also happens to sort correctly; YYYY-MM-DD achieves both 
those objectives, it's just a cosmetic question as to what delimiter 
"looks" better if someone looks at the raw data (prior to being LOADed 
into REBOL values) or uses the format directly in their statements 
(e.g. "select * from t where date = '2006-01-01'").


Graham, "If they are stored as numbers, then just as easy to sort!" 
Yes, but as per above we lose the fact that they are dates. If they 
are stored as integer then we'll get them back as integers.


Graham, "what about time?" REBOL time values (in HH:MM:SS format) 
are already supported, and nothing prevents you from using now / 
now/precise except that these values will not be sorted correctly 
[with an "order by" clause that is].
Ashley:
21-Mar-2006
Mind you, I can always extend the date handling logic (as posted 
previously) to check to see whether the date has a time component; 
something like:

	if val/time [...]


Should we be checking for a zone component as well? The shortest 
possible timestamp that REBOL will recognize is:

	type? load "2006-01-01/13:30"

But that excludfes both seconds and zone.
Robert:
23-Mar-2006
Is the linking between SQLite and RebGUI already implemented? In 
that if I get back a result set, that I can use it directly to fill 
a list or drop-down list? Or load a result set into a form?
Group: Postscript ... Emitting Postscript from REBOL [web-public]
Ryan:
5-Apr-2006
I lean toward PDF too, but the dialect is not much fun to use, it 
can take a long time to load, and you have to preview it before printing, 
not too mention versioning issues. Thats why I had been looking for 
a BMP printing solution. I was considering using PS for printing 
only images directly to printers, which would still be nice--mainly 
for non-win OS's. I think this would be much easier to impliment. 
I dont know squat about post script, but it could potentially be 
just a hack.
Group: !GLayout ... ask questions and now get answers about GLayout. [web-public]
Graham:
21-Sep-2006
So, if it resides on the local drive, and you load it each time .. 
you're okay?
Group: !Liquid ... any questions about liquid dataflow core. [web-public]
Pekr:
7-May-2007
I wonder if other languages could benefit from View? I know they 
have e.g. wxWidgets, but not sure how easy would it be to integrate? 
Maybe with R3 as a whole, pythonists can link/load "rebol library" 
to do so :-) View simply needs rebol interpreter ...
201 / 232912[3] 45...2021222324