• 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
r4wp169
r3wp938
total:1107

results window for this page: [start: 1001 end: 1100]

world-name: r3wp

Group: Parse ... Discussion of PARSE dialect [web-public]
Maxim:
27-Apr-2011
no the cursor did not advance.   there are two concepts at play here... 
the notion of index, and the notion of "slots"   a single slot has 
two positions, its start and end, but it has only one index.
Maxim:
27-Apr-2011
a matching rule, will expand the segment's area, but not its index. 
 rules are stacked based on end-to segments.  if a rule has a segment 
of size 0 (as in the none rule) there is no index change in the next 
rule segment. i.e. it shares its index since its index is previous 
index + 0
Group: !REBOL2 Releases ... Discuss 2.x releases [web-public]
BrianH:
10-Apr-2010
Install the 32bit drivers here: http://www.firebirdsql.org/index.php?op=files&id=odbc

http://www.firebirdsql.org/download/prerelease/odbc/Firebird_ODBC_2.0.0.148_win32.exe
Graham:
14-May-2010
If I want to set something to the index of a series, or something 
else if it's not there I have to do this

b: either a: find series var [
	index? a
][ 	default ]

when I'd rather do

 b: any [ index? find series var default ]

So how about letting index? also take none as an argument ?
Group: !REBOL3 Extensions ... REBOL 3 Extensions discussions [web-public]
Geomol:
26-Aug-2009
I took the image from: http://www.antigrain.com/screenshots/index.html
NickA:
11-Sep-2009
My first attempt with extensions failed quickly.  I tried:
>> secure [extension allow]
>> import %libwmp3.dll

and got this error:

** access error: cannot open: %libwmp3.dll reason: none


libwmp3.dll is available at http://www.inet.hr/~zcindori/libwmp3/index.html
, an
d I've gotten it working in REBOL2

Any suggestions?


PS - that fact that we need to include "secure [extension allow]" 
should really

be included at http://rebol.com/r3/docs/concepts/extensions-using.html
!
BrianH:
6-Nov-2009
A command! is an indexed dispatch function, and the index has no 
inherent meaning. You could dynamically generate functions with libtcc, 
which would all have the same function signiature because they would 
just take command! call frames. These generated functions could be 
referenced from an array of function pointers. After you generate 
a new function and assign it to a new array slot, return the index 
of that slot to the calling REBOL code (embedded in the libtcc extension) 
and it can then make a command! with the libtcc extension's handle 
and that index. Then that command! can be called like any other REBOL 
function.


A trick though is that the generated C code would need to use the 
extension macros to manipulate the function arguments, rather than 
direct variable access. In other words, your generated functions 
would be extension-style code, not regular C code.
Robert:
28-Nov-2009
This uniton gives a warning/error with mingw:

typedef union rxi_arg_val {

	i64 int64;

	double dec64;

	REBYTE bytes[8];

	struct {

		i32 int32a;

		i32 int32b;

	};
	struct {

		u32 index;

		void *series;

	};
	void *handle;

} RXIARG;
Maxim:
28-Jan-2010
so you'd say:

define "mystruct {int index, int count}
myfunc: declare "libname.myfunc (int data, struct *mystruct)"
myfunc 12 1024
Robert:
15-Jul-2010
// 	string to convert to R3 string
//  R3 frame to add string too
REBSER* RXI_Make_String(const char *string){
		// build string
		int string_len = string == NULL ? 0 : strlen(string);

  odprintf("RXI_Make_String with length = %d, string = %s", string_len, 
  string);
		REBSER *s = RXI_MAKE_STRING(string_len, 0);
		if(string_len == 0) return s;

		// and set single chars if there are some
		for(int x=0; (*(string+x)) != '\0'; x++){
			RXI_SET_CHAR(s, x, *(string+x));
		}

		odprintf("RXI_Make_String: done");
		return s;
}


void RXI_Return_String(const char *string, RXIFRM *frm, int frm_position) 
{
		REBSER *s = RXI_Make_String(string);

		// set parameter 1 (=return value?) to constructed string
		// set index to 0
		// set type to string
		RXA_SERIES(frm, frm_position) = s;
		RXA_INDEX(frm, frm_position)  = 0;
		RXA_TYPE(frm, frm_position)   = RXT_STRING;
}
Maxim:
16-Jul-2010
the idea of handles is for an extension to give a key to a script, 
and make sure the script can't play with it.   by key, I mean an 
arbitrary value which makes sense for the extension (pointer, index, 
value, etc).
Carl:
17-Jul-2010
Has some useful new ext funcs:

	void *(*make_block)(u32 size);
	void *(*make_string)(u32 size, int unicode);
	int (*get_string)(REBSER *series, u32 index, void **str);
	u32 (*map_word)(REBYTE *string);
	u32 *(*map_words)(REBSER *series);
	REBYTE *(*word_string)(u32 word);
	u32 (*find_word)(u32 *words, u32 word);
	int (*series_info)(REBSER *series, REBCNT what);
	int (*get_char)(REBSER *series, u32 index);
	u32 (*set_char)(REBSER *series, u32 index, u32 chr);
	int (*get_value)(REBSER *series, u32 index, RXIARG *val);

 int (*set_value)(REBSER *series, u32 index, RXIARG val, int type);
	u32 *(*words_of_object)(REBSER *obj);
	int (*get_field)(REBSER *obj, u32 word, RXIARG *val);
	int (*set_field)(REBSER *obj, u32 word, RXIARG val, int type);
Oldes:
8-Nov-2010
//I want: char **MagickQueryConfigureOptions(const char *pattern, 
unsigned long *number_options)
//I have:
            unsigned long *number_options;
            char *item;

            char **list = MagickQueryConfigureOptions("*",number_options);
      
            REBSER *b = RL_MAKE_BLOCK(*number_options);
            RXA_SERIES(frm, 1) = b;
            RXA_INDEX(frm, 1) = 0;
            RXA_TYPE(frm, 1) = RXT_BLOCK;

            int i,j;
            for(i=0; i<*number_options; ++i)    {
                item = list[i];
                REBSER *s = RL_MAKE_STRING(strlen(item), 0);
                for (j = 0; j < strlen(item); ++j)
                    RL_SET_CHAR(s, j, item[i]);
                RL_SET_VALUE(b, i, s, RXT_STRING);
            }
Maxim:
8-Nov-2010
this is what carl will be adding to the next host-kit.... 


//------------------
//-    #RXV_xxx
//
// REBOL EXTENSION GET Macros
//
// provide direct RXIARG access macros
// with these macros, the single argument should be an RXIARG *
//

// this is usefull when the RXIARG is NOT being used from an argument 
frame

// but as a single value, like when we use RL_Get_Field() or RL_Get_Value()
//
// if the argument is dynamically allocated, ex:
//    RXIARG arg = OS_MAKE(sizeof(RXIARG)); 
// then use the macros like so:
//     RXV_WORD(*(arg));
//------------------
#define RXV_INT64(a)		(a.int64)
#define RXV_INT32(a)		(i32)(a.int64)
#define RXV_INTEGER(a)	(a.int64) // maps to RXT_INTEGER
#define RXV_DEC64(a)		(a.dec64)
#define RXV_DECIMAL(a)	(a.dec64) // maps to RXT_DECIMAL
#define RXV_LOGIC(a)		(a.int32a)
#define RXV_CHAR(a)		(a.int32a)
#define RXV_TIME(a)		(a.int64)
#define RXV_DATE(a)		(a.int32a)
#define RXV_WORD(a)		(a.int32a)
#define RXV_PAIR(a)		(a.pair)
#define RXV_TUPLE(a)		(a.bytes)
#define RXV_SERIES(a)		(a.series)
#define RXV_BLOCK(a)		(a.series)
#define RXV_INDEX(a)		(a.index)
#define RXV_OBJECT(a)	(a.addr)
#define RXV_MODULE(a)	(a.addr)
#define RXV_HANDLE(a)	(a.addr)
#define RXV_IMAGE(a)		(a.image)
#define RXV_GOB(a)		(a.addr)
Maxim:
8-Nov-2010
//I want: char **MagickQueryConfigureOptions(const char *pattern, 
unsigned long *number_options)
//I have:
            unsigned long *number_options;
            char *item;

            char **list = MagickQueryConfigureOptions("*",number_options);
      
            REBSER *b = RL_MAKE_BLOCK(*number_options);
            RXA_SERIES(frm, 1) = b;
            RXA_INDEX(frm, 1) = 0;
            RXA_TYPE(frm, 1) = RXT_BLOCK;

            int i,j;
            for(i=0; i<*number_options; ++i)    {
                RXIARG arg;
                item = list[i];
                REBSER *s = RL_MAKE_STRING(strlen(item), 0);
                for (j = 0; j < strlen(item); ++j)
                    RL_SET_CHAR(s, j, item[i]);
                RL_SET_VALUE(b, i, arg, RXT_STRING);
            }
Maxim:
8-Nov-2010
//I want: char **MagickQueryConfigureOptions(const char *pattern, 
unsigned long *number_options)
//I have:
            unsigned long *number_options;
            char *item;

            char **list = MagickQueryConfigureOptions("*",number_options);
      
            REBSER *b = RL_MAKE_BLOCK(*number_options);
            RXA_SERIES(frm, 1) = b;
            RXA_INDEX(frm, 1) = 0;
            RXA_TYPE(frm, 1) = RXT_BLOCK;

            int i,j;
            for(i=0; i<*number_options; ++i)    {
                RXIARG arg;
                item = list[i];
                REBSER *s = RL_MAKE_STRING(strlen(item), 0);
                arg.series = s;
                for (j = 0; j < strlen(item); ++j)
                    RL_SET_CHAR(s, j, item[i]);
                RL_SET_VALUE(b, i, arg, RXT_STRING);
            }
Oldes:
8-Nov-2010
unsigned long number_options;
            char *item;

            char **list = MagickQueryConfigureOptions("*",&number_options);
      
            REBSER *b = RL_MAKE_BLOCK(number_options);
            RXA_SERIES(frm, 1) = b;
            RXA_INDEX(frm, 1) = 0;
            RXA_TYPE(frm, 1) = RXT_BLOCK;

            int i,j;
            for(i=0; i<number_options; ++i)    {
                RXIARG arg;
                item = list[i];
                REBSER *s = RL_MAKE_STRING(strlen(item), 0);
                arg.series = s;
                for (j = 0; j < strlen(item); ++j)
                    RL_SET_CHAR(s, j, item[i]);
                RL_SET_VALUE(b, i, arg, RXT_STRING);
            }
Maxim:
8-Nov-2010
I think I found the bug.  it could have worked earlier with your 
other memory access issues but will not work anymore.
    RXA_INDEX(frm, 1) = 0;

AFAIK this effectively erases the assignment of:
    RXA_SERIES(frm, 1) = b;
Oldes:
9-Nov-2010
I can say, that the **list is filed correctly because when I for 
example use at the tail:
            REBSER *s = RL_MAKE_STRING(strlen(list[2]), 0);
            for (c = 0;  c< strlen(list[2]); ++c)
                RL_SET_CHAR(s, c, list[2][c]);
            RXA_SERIES(frm, 1) = s;
            RXA_INDEX(frm, 1)  = 0;
            RXA_TYPE(frm, 1)   = RXT_STRING;
            return RXR_VALUE;
I get the correct list[2] value.
Maxim:
9-Nov-2010
using above code as reference...

RXA_SERIES(frm, 1) = b;
RXA_INDEX(frm, 1)  = 0;  // AFAIK this is 0 by default.
RXA_TYPE(frm, 1)   = RXT_BLOCK;
return RXR_VALUE;
Andreas:
9-Nov-2010
A simple `a.index = 0` is missing.
Maxim:
9-Nov-2010
actually, in Olde's code its:   

 s.index = 0;
Maxim:
9-Nov-2010
actually... its:    arg.index = 0;
Maxim:
9-Nov-2010
we could propose a usefull macro to not get bitten by  this  again:

something like:

#define NEW_RXIARG(v) RXIARG v; v.index=0
Oldes:
10-Nov-2010
This works:
            REBSER *ser;
            i32 len;
            
            ser = RXA_SERIES(frm, 1);

            len = RL_SERIES (ser, RXI_SER_TAIL) - RXA_INDEX(frm, 1);

            char pattern[len]; 
            for(n = 0; n < len; ++n)   
                pattern[n] = RL_GET_CHAR(ser, n);
Oldes:
11-Nov-2010
And, what would you do: (1.) Save wand pointers on REBOL side, or 
(2.) only on C side and provide just IDs (index) to this pointers 
(which is probably safer but would require dynamic array on the C 
side)?
Oldes:
26-Dec-2010
I'm experimenting with image! as a command agrument and found this 
strange behaviour:
I have:
	img-echo: command [img [image!] ]
In RX_Call I use just:   return RXR_VALUE;

And then when I call the img-echo I get image, but with index at 
the tail so it looks like:
>> i: img-echo img
== make image! [50x20 #{
}]
>> index? i
== 1001

Is this normal? How I can set the index on the C side?
Kaj:
27-Dec-2010
Image index at tail sounds like a bug
Kaj:
27-Dec-2010
RXA_INDEX(arguments, 1) = 0;
Oldes:
27-Dec-2010
Correction... it returns image index at tail when there is any exported 
context.. the command can be out of the context.
Oldes:
27-Dec-2010
btw... I was trying to use: RXA_INDEX(frm, 1) = 0;  but in my complex 
extension I was even able to crash REBOL. But I'm not able to simplify 
it. The sample.c included with the bug report must be enough, it 
clearly shows that there is something wrong.
Oldes:
27-Dec-2010
It's also strange that it returns correct index before I eval the 
exported context.
Oldes:
25-Jan-2011
I'm using this piece of code to get pointer to binary argument:
            char *srcData;
            REBSER *ser = RXA_SERIES(frm, 1);
            srcLen = - RL_GET_STRING(ser, 0, (void **) &srcData);
But also must do this:
	srcData+=RXA_INDEX(frm,1);

To fix the pointer to correct position if the source binary index 
is > 0.
Is this a bug or is it normal? Should it be reported in CC?
Oldes:
25-Jan-2011
Correction... the right result is:

	srcData = RL_SERIES(ser, RXI_SER_DATA) + RXA_INDEX(frm,1);

 srcLen =  RL_SERIES(ser, RXI_SER_SIZE) - RL_SERIES(ser, RXI_SER_LEFT) 
 - RXA_INDEX(frm,1) -1;

so I don't know what is better.
Maxim:
25-Jan-2011
Oldes, AFAIK its normal... in C we always have access to the full 
string.  

we use RL_SERIES to figure out the portion of the string which is 
used by a specific Series reference.

so basically if you call:

a: [1 2 3]
b: next a


and use A or B in the command, you get the same string (logically, 
not physically), but with only the RL_SERIES and RXA_INDEX() which 
are set to different values.
Oldes:
25-Jan-2011
and yes.. it's fine that RL_SERIES(ser, RXI_SER_DATA) returns string 
at it head. Than I would like to have the RXI_SER_LENGTH as a shorthand 
for: RL_SERIES(ser, RXI_SER_SIZE) - RL_SERIES(ser, RXI_SER_LEFT) 
- RXA_INDEX(frm,1) -1 


and the bug is, that the binary is not using wide, but reports it 
and counts the pointer position as wide - as Kay reported.
Oldes:
25-Jan-2011
I don't see it as a problem when I write:
    RXA_SERIES(frm, 1) = destSer;
    RXA_TYPE(frm, 1)   = RXT_BINARY;
    RXA_INDEX(frm, 1)  = 0;

At least it's clear in the source, what you can expect. Or what you 
want to propose. It's Maxim's wish:)
Andreas:
25-Jan-2011
Oldes, to get the length of the series use:
RL_SERIES(ser, RXI_SER_TAIL) - RXA_INDEX(frm, 1)
Maxim:
25-Jan-2011
I just realized that it sucks that that index position is also part 
of the argument frame and not the argument itself  :-(
Andreas:
25-Jan-2011
I.e. if you have an RXIARG of of a series type (RXT_BINARY, RXT_STRING, 
etc), this arg also holds the index.
Oldes:
25-Jan-2011
TAIL - INDEX looks better, thanks... btw.. https://github.com/Oldes/R3A110/tree/master/extensions/zlib
Oldes:
17-Feb-2011
Is there any other way how to get series index than from RXA_INDEX 
macro?  http://issue.cc/r3/1858
Andreas:
17-Feb-2011
And it is quite possible that this may not be doable at all (if the 
index is not stored in the "REBSER" structure and the REBSER has 
no back-pointer to the index-containing rebol value).
Andreas:
17-Feb-2011
The workaround/solution is simple: don't pass REBSERs to function, 
but use the RXIARG instead and then access the index via .index and 
the REBSER via .series.
Kaj:
17-Feb-2011
The index is simply not part of a series at the implementation level
Kaj:
17-Feb-2011
What appears to be a series with an index in REBOL is actually a 
reference with an index. That's exactly what an RXIARG is. What the 
hostkit level calls a REBSER is the actual series, not a reference, 
so that doesn't have an index
BrianH:
17-Feb-2011
The index is part of the reference for series, not part of the series 
itself.
Robert:
12-Mar-2011
// call R3 callback
	RXA_COUNT(cbi) 		= 1;

/*
	RXA_TYPE(cbi, 1) 	= RXT_INTEGER;
	RXA_INT64(cbi, 1) = 123;
*/

	RXA_TYPE(cbi, 1) = RXT_STRING;
	RXA_SERIES(cbi,1) = RL_Make_String(message);;
	RXA_INDEX(cbi,1) = 0;

	int cb_error = RL_CALLBACK(cbi);
Group: !REBOL3 GUI ... [web-public]
BrianH:
19-Jan-2010
Any chance we can use this? http://www.antigrain.com/research/font_rasterization/index.html
Cyphre:
29-Jan-2010
regarding the caret obect:

the CARET, HIGHLIGHT-START and HIGHLIGHT-END fields must be defined 
as block! of the following format:
[block! string!]


the first block! value must be the gob/text block! at the index position 
of the text element


the second string! value must be string of the text element at specified 
position


You cannot just copy the first block as in your example above. You 
have to set the block to the position where the text element really 
is in the dialect block(this way the text engine can use the index). 
This part is a bit tricky but it was decided after long discussion 
with Carl. I proposed to use simple integer! for the index, but Carl 
wanted it to be this way which is easier as you can manipulate the 
block index easily without the need to use INDEX? to get the integer.
Cyphre:
16-Jun-2010
Pekr, re font rendering improvements....have a look at this famous 
article: http://antigrain.com/research/font_rasterization/index.html#FONT_RASTERIZATION

Mcseem describes possible way we could try in R3 version but it would 
need some more expereiments.
Graham:
16-Aug-2010
I think what would be neat would be a way to access widgets by index 
...
Pekr:
23-Aug-2010
Robert - what is further "low-level" plan? I can see ( http://www.rebol.net/wiki/Host-Kit_Development_Notes
) that we will get A104, A105, which are going to be more of a merge 
releases. But do you have an idea, what will Carl work on next? Not 
that there would not be lots of work ahead :-) ( http://www.rebol.com/rebol3/index.html
) Will e.g. tasking be next?

Two notes here. Please ask Carl for two small changes/additions:


- Add Projects page directly to the right menu here: http://www.rebol.com/rebol3/index.html
- it is simply hidden and can be seen only from a Roadmap page ...

- I thought we already added tasking/IPC methods to the projects 
page. It is imo important and legitimate, and it should be briefly 
added, untill such feature is implemented - http://www.rebol.com/projects.html
shadwolf:
26-Oct-2010
another optimisation is that when you create a document you will 
obviously do alot of insert action so the idea is to regroupe the 
insert actions betwin  insert space
For example:


insert "a", insert "b"', insert "c"; insert " " -> trigger of the 
sorting algorithm insert "abc" [line1-:-0] (this optimisation can be 
seen in OpenOffice 3.2)
 

Would be better if instead of registery the action done by the user 
you register the mirror action to be apply to reverse it
then you have

delete "a", delete "b", delete "c"; delete " " -> trigger concatenation 
algorythm delete "abc"@line1:0, delete "space"@line1:3 (position 
here is set as line number followed by the caracters to pass in the 
line before reaching the character can speed up rendering if you 
are able to use remove index stuff in my opinion)
Cyphre:
23-Dec-2010
New 'X-mas' release of R3-GUI is available for download at http://www.rm-asset.com/code/downloads/

top-level changes:

-smarter face update mechanism
-improved dynamic panel content handling
-internal optimizations and more system-friendly redesign
-cleanup of obsolete code parts

some more detailed notes:


- panels can now contain normal, VISIBLE faces, HIDDEN faces (just 
invisible, but taking the same space as the visible faces), IGNORED 
faces (invisible, and not taking any space), FIXED (visible, but 
not resizing with the panel, having a fixed position and size)

- the ON-CONTENT actors for all panels (HGROUP, VGROUP, VPANEL, HPANEL) 
now are as much compatible with series function as practical, taking 
an integer index, high-level function can take a gob or a face to 
specify the position as well

- Data optimization: FACES attribute removed to not need to store 
and maintain the same information twice, risking the conflicts (they 
were already present, order of faces was not identical)


You can also download the latest R3.exe from our site which contains 
LOAD-GUI that directly loads the actual release. This way you are 
always using the latest R3GUI codebase.


We'll be updating the 'old' documentation soon to be up-to-date with 
our current R3GUI version. So interested developers can start using 
it for real or participate on the project.
Anton:
25-Dec-2010
I don't mind '?' being use to indicate a question, but I think the 
"-of" words more accurately reflect what information is being extracted 
FACES?
 - it's like  "huh?" - it's vague, someone's secret language.

(Maximum-of and minimum-of were poorly named; I wanted them changed 
to 'at-maximum(-of)' etc since they return the series at the index.)
Pekr:
15-Jan-2011
Henrik, when switching panels, there's following function I need 
to adapt:

	unless pan [
		pan: make-panel 'group pick test-blocks index [columns: 1]
		poke test-panels index pan
	]
Pekr:
15-Jan-2011
I translated it into:

	unless pan [

  pan: make-panel make-face 'vpanel (pick test-blocks index) 'group 
		poke test-panels index pan
	]
Pekr:
15-Jan-2011
I changed it to:

	unless pan [

  pan: make-panel make-face 'vpanel (pick test-blocks index) 'group 
		poke test-panels index pan
	]

But something is "not bound" ... I get following error:

** Script error: when has no value

** Where: make make make-face unless view-sub-panel do switch -apply- 
apply if f

oreach if do-face switch do do-bind-actor actor all foreach do-style 
set-face sw

itch do do-bind-actor actor all foreach do-style case do-event do-event 
do-event

 either -apply- wake-up loop -apply- wait do-events if view catch 
 either either
-apply- do

** Near: make styl/facets opts options: make object! any [opts []] 
ta...
Pekr:
16-Jan-2011
Ladislav - did not read all your posts here, but as you are here, 
and for me to proceed - how do I "easily" create panel, if I have 
layout stored in a block? Carl's demo uses:

view-sub-panel: funct [
	index
	main-pan
	desc
][
	set 'current-panel index
	set-face desc form pick test-notes index
	pan: pick test-panels index
	unless pan [
		pan: make-panel 'group pick test-blocks index [columns: 1]
		poke test-panels index pan
	]
	switch-panel main-pan pan 'fly-right
]

his

 make-panel used three values. OK, options block is not needed, nor 
 supported right now. Function attributes are now reversed (dunno 
 why, the argument order is not compatible with make-face for e.g.). 
 That is still easily fixable. But now "rma's" make-panel accepts 
 face, not dialect block. I tried to use make-face on a dialect block, 
 but no luck ....
Pekr:
16-Jan-2011
I simply need to fix this line: "pan: make-panel 'group pick test-blocks 
index [columns: 1]", if possible. Henrik suggested that the aproach 
is different, and that I should use 'content functions, which I know 
nothing about yet.
Ladislav:
16-Jan-2011
Regarding the

	unless pan [
		pan: make-panel 'group pick test-blocks index [columns: 1]
		poke test-panels index pan
	]

code, you should be good with:

	unless pan [
		insert-panel-content/pos/no-show test-panels compose/only [
			pan: hpanel 1 pick test-blocks index
		]
	]
Ladislav:
16-Jan-2011
sorry, forgot the paren:

	unless pan [
		insert-panel-content/pos/no-show test-panels compose/only [
			pan: hpanel 1 (pick test-blocks index)
		]
	]
Ladislav:
16-Jan-2011
and the index:

	unless pan [
		insert-panel-content/pos/no-show test-panels compose/only [
			pan: hpanel 1 (pick test-blocks index)
		] index
	]
Ladislav:
16-Jan-2011
Another option is to use something like:

pan: make-face 'hpanel [columns: 1]
insert-panel-content pan pick test-blocks index

, etc...
Pekr:
16-Jan-2011
it breaks in the following demo function:

view-sub-panel: funct [
	index
	main-pan
	desc
][
	set 'current-panel index
	set-face desc form pick test-notes index
	pan: pick test-panels index
	unless pan [
		pan: make-face 'hpanel [columns: 1]
		insert-panel-content pan pick test-blocks index
		poke test-panels index pan
	]
	switch-panel main-pan pan 'fly-right
]
Pekr:
24-Jan-2011
Interesting. I know that I was told that 'when style is not adapted, 
but - you probably saw my earlier screenshot, which shows space at 
the top of the panel. I get this, when I use the following method:

pan: make-face 'vpanel [columns: 1] 
insert-panel-content pan pick test-blocks index
set-panel-content main-pan pan


But - if I use Cyphre's method, the visual space at the top of the 
panel is not there. My quick conclusion is, that panel content handling 
funcitons are not compatible for various creation methods:


pan: make-face 'vpanel [columns: 1content: pick test-blocks index]
set-panel-content main-pan pan

Going to temporarily use Cyphre's version ....
Pekr:
25-Jan-2011
Or I have something wrong in the demo code, not yet fully adapted:

view-sub-panel: funct [
	index
	main-pan
	desc
][
	set 'current-panel index
	set-face desc form pick test-notes index
	pan: pick test-panels index
	unless pan [

  pan: make-face 'vpanel [columns: 1 content: pick test-blocks index]
;		insert-panel-content pan pick test-blocks index
		poke test-panels index pan
	]

	set-panel-content main-pan pan
;	switch-panel main-pan pan 'fly-right
]

view [
	title "R3 GUI Tests"
	text (reform ["R3 V" system/version "of" system/build])
	bar
	hgroup [

		; List of test sections:
		text-list test-sections do [view-sub-panel value main-pan desc]

		; Panel for showing test results:
		vgroup  [
			desc: text-area "Please read the instructions below."
			options [
				max-size: 2000x40
				text-style: 'bold
			]

			main-pan: vpanel [
				text "test" ;doc instructions
			] options [columns: 1 init-size: 280x380]

			hgroup [
				button "Source" do [
					either current-panel [
						view-code trim/head mold/only pick test-blocks 
current-panel
					][
						request "Note:" "Pick a test first."
					]
				]
				button "Halt" leaf close halt
				button "Quit" maroon quit
				check "Debug"  do [guie/debug: if value [[all]]]
				check "Remind" guie/remind do [guie/remind: value]
			]
		]
	]
;	when [enter] do [
;		if quick-start [
;			if spot: find test-sections quick-start [

;				view-sub-panel index? spot main-pan desc  ; for faster testing
;			]
;		]
;		;[request "Alert" instructions]
;	]
]
;[reactors: [[moved [save %win-xy.r face/gob/offset]]]]
Claude:
4-Mar-2011
** Script error: path filters/:index: is not valid for none! type

** Where: function! switch -apply- apply if foreach if do-face do-popup-parent 
function! switch -apply- apply if foreach if do-face -apply- apply 
use if actor all foreach do-style switch actor all foreach do-style 
either set-face switch actor all foreach do-style case do-event do-event 
do-event either -apply- wake-up loop -apply- wait do-events if view 
catch either either either -apply-
** Near: arg :face :value :actor-arg
Group: !REBOL3 Host Kit ... [web-public]
Kaj:
9-Jan-2011
If you give an index to RL_GET_STRING on a series of single bytes, 
it will return an address computed as if the items are double bytes
Group: Core ... Discuss core issues [web-public]
Steeve:
15-Dec-2010
Searching for an optimal (small and fast) implementation of the following 
pattern.
* Swap two subsets inside a serie.

input 
	block:  [4  5  6   1 2] (5 values)
	Starting index of the 2nd subset inside the block: 4

Output:
	[ 1 2    4  5  6] 

Easy to do in plain Rebol right ?

But here's the trouble, It must be memory safe. You're not allowed 
to do any memory allocation.

You're can only swap values inside the block. And the number of swaps 
should be optimal.
(no sort, no parse, no copy/make/insert/append/change)
Steeve:
15-Dec-2010
7 is the index if the second subset in the serie
Andreas:
15-Dec-2010
Not optimal, but a start:


bubble-to-front: funct [series index] [for i index 2 -1 [swap b: 
at series i back b] series]

swap-sub: funct [series position] [loop (n: length? series) - position 
+ 1 [bubble-to-front series n] series]
Ladislav:
25-Dec-2010
REBOL 3.0 A110 2-Nov-2010/3:56:20

>> source poke
poke: make action! [[

    {Returns value after changing its data at the given index. (Modifies)}
    value [series! port! map! gob! bitset!]
    index {Index offset, symbol, or other value to use as index}
    data "New value"
]]
>> poke [1] 1 #[unset!]
** Script error: poke does not allow unset! for its data argument
BrianH:
23-Feb-2011
Here's a working version:

map-each: func [

 "Evaluates a block for each value(s) in a series and returns them 
 as a block."
	[throw catch]

 'word [word! block!] "Word or block of words to set each time (local)"
	data [block!] "The series to traverse"
	body [block!] "Block to evaluate each time"
	/into "Collect into a given series, rather than a new block"

 output [any-block! any-string!] "The series to output to" ; Not image!
	/local init len x
][
	; Shortcut return for empty data
	either empty? data [any [output make block! 0]] [
		; BIND/copy word and body
		word: either block? word [
			if empty? word [throw make error! [script invalid-arg []]]

   copy/deep word  ; /deep because word is rebound before errors checked
		] [reduce [word]]
		word: use word reduce [word]
		body: bind/copy body first word
		; Build init code
		init: none
		parse word [any [word! | x: set-word! (
			unless init [init: make block! 4]
			; Add [x: at data index] to init, and remove from word
			insert insert insert tail init first x [at data] index? x
			remove x
		) :x | x: skip (

   throw make error! reduce ['script 'expect-set [word! set-word!] type? 
   first x]
		)]]
		len: length? word ; Can be zero now (for advanced code tricks)
		; Create the output series if not specified
		unless into [output: make block! divide length? data max 1 len]
		; Process the data (which is not empty at this point)

  until [ ; Note: output: insert/only output needed for list! output
			set word data  do init

   unless unset? set/any 'x do body [output: insert/only output :x]
			tail? data: skip data len
		]
		; Return the output and clean up memory references
		also either into [output] [head output] (
			set [word data body output init x] none
		)
	]
]
BrianH:
20-Apr-2011
Onetom, that error has been reported already and fixed in R2/Forward, 
but it hasn't made it into R2 yet. Here is the revised MAP-EACH:

map-each: func [

 "Evaluates a block for each value(s) in a series and returns them 
 as a block."
	[throw catch]

 'word [word! block!] "Word or block of words to set each time (local)"
	data [block!] "The series to traverse"
	body [block!] "Block to evaluate each time"
	/into "Collect into a given series, rather than a new block"

 output [any-block! any-string!] "The series to output to" ; Not image!
	/local init len x
][
	; Shortcut return for empty data
	either empty? data [any [output make block! 0]] [
		; BIND/copy word and body
		word: either block? word [
			if empty? word [throw make error! [script invalid-arg []]]

   copy/deep word  ; /deep because word is rebound before errors checked
		] [reduce [word]]
		word: use word reduce [word]
		body: bind/copy body first word
		; Build init code
		init: none
		parse word [any [word! | x: set-word! (
			unless init [init: make block! 4]
			; Add [x: at data index] to init, and remove from word
			insert insert insert tail init first x [at data] index? x
			remove x
		) :x | x: skip (

   throw make error! reduce ['script 'expect-set [word! set-word!] type? 
   first x]
		)]]
		len: length? word ; Can be zero now (for advanced code tricks)
		; Create the output series if not specified
		unless into [output: make block! divide length? data max 1 len]
		; Process the data (which is not empty at this point)

  until [ ; Note: output: insert/only output needed for list! output
			set word data  do init

   unless unset? set/any 'x do body [output: insert/only output :x]
			tail? data: skip data len
		]
		; Return the output and clean up memory references
		also either into [output] [head output] (
			set [word data body output init x] none
		)
	]
]
Henrik:
13-May-2011
that depends if both the concept of three states and index direction 
change can be merged into one function and if that makes sense.
Henrik:
25-Jul-2011
Geomol, the context is not relevant during serialization, so stating 
that "I suppose the none word holds the none value" is incorrect. 
It is the unreduced contents that are important. Also you don't have 
the index of the block.

Let me reveal what my-block actually contains:

my-block: next reduce [true none 'none]


That information is only available in the serialized format like 
this:

>> mold/all my-block
== "#[block![#[true] #[none] none]2]"
Cyphre:
26-Jul-2011
Yes, the string is copied in both cases. The difference is that  
copy/deep copies the whole string not only the part that is maked 
by index.
Steeve:
26-Jul-2011
an index is stored alltogether with any serie
Maxim:
26-Jul-2011
unless someone finds a better alternative, I don't see anything wrong 
with this syntax... maybe it needs a bit more components (like keeping 
tabs on the index of the block).  
in fact  maybe this is even better:

 #[block  #1 2 [ val1 val2 ]] 


here an issue type is used for the uid and the integer is used as 
the block index.
BrianH:
19-Sep-2011
map-each: func [

 "Evaluates a block for each value(s) in a series and returns them 
 as a block."
	[throw catch]

 'word [word! block!] "Word or block of words to set each time (local)"
	data [block!] "The series to traverse"
	body [block!] "Block to evaluate each time"
	/into "Collect into a given series, rather than a new block"

 output [any-block! any-string!] "The series to output to" ; Not image!
	/local init len x
][
	; Shortcut return for empty data
	either empty? data [any [output make block! 0]] [
		; BIND/copy word and body
		word: either block? word [
			if empty? word [throw make error! [script invalid-arg []]]

   copy/deep word  ; /deep because word is rebound before errors checked
		] [reduce [word]]
		word: use word reduce [word]
		body: bind/copy body first word
		; Build init code
		init: none
		parse word [any [word! | x: set-word! (
			unless init [init: make block! 4]
			; Add [x: at data index] to init, and remove from word
			insert insert insert tail init first x [at data] index? x
			remove x
		) :x | x: skip (

   throw make error! reduce ['script 'expect-set [word! set-word!] type? 
   first x]
		)]]
		len: length? word ; Can be zero now (for advanced code tricks)
		; Create the output series if not specified
		unless into [output: make block! divide length? data max 1 len]
		; Process the data (which is not empty at this point)

  until [ ; Note: output: insert/only output needed for list! output
			set word data  do init

   unless unset? set/any 'x do body [output: insert/only output :x]
			tail? data: skip data len
		]
		; Return the output and clean up memory references
		also either into [output] [head output] (
			set [word data body output init x] none
		)
	]
]
Endo:
12-Oct-2011
++ : "Increment an integer or series index."
Henrik:
2-Nov-2011
hmm... that does a comparison on the first value in the block instead 
of the index. is that useful?
Group: !REBOL3 Source Control ... How to manage build process [web-public]
Andreas:
29-Oct-2010
For example, git-update-index is no longer needed to resolve merge 
conflics. You'd use git-add instead.
Group: !REBOL3 Proposals ... For discussion of feature proposals [web-public]
Maxim:
13-Jan-2011
this is the easiest way to know if a data element can be traversed 
via pick without having to first know if the datatype can be traversed.


the issue is that many types have indexed content but are not series 
(i.e. no "current" index).  so we can get the value or deny listing 
in one function call.

ex:

print-tree: funct  [data][
	i: 0
	either len: length? :data [
		repeat i len [print-tree pick :data i]
	][
		print mold/all :data
	]
]
Maxim:
13-Jan-2011
another example, but this time applied to the index? function.
		
get-item: func [data][
	either i: index? data [
		pick data i
	][data]
]


note that this can be done differently, but I think this is the easiest 
to read because its almost like an algorithm.


i.e. "if this has an index, get its item at that index, otherwise 
just return the value."
Maxim:
13-Jan-2011
another proposal:


have info? support more datatypes.  it would be very nice for a single 
function to return information about any datatype in a single call.

ex:
>> a: make string! 1000
>> a: next append a "12345678"

== make object! [length: 7 index: 2 size: 8 buffer: 1000 references: 
1]
Group: Red ... Red language group [web-public]
BrianH:
28-Feb-2011
I meant offset references an internal pointer to the head and an 
offset index, like s: next s.
Dockimbel:
29-Mar-2011
I think that the language name alone is not the typical query that 
someone would do. Here's two examples:


- Tiobe index relies on "<language> programming" as its search query 
to mesure the popularity of a programming language (see http://www.tiobe.com/index.php/content/paperinfo/tpci/tpci_definition.htm)


- For Cheyenne web server (not a language, but uses a common name), 
people coming to the web site with only "cheyenne" as a search keyword 
are very few. A vast majority use "cheyenne server" or "cheyenne 
web" or "cheyenne rebol". Anyway, after been online for a few months/years, 
Cheyenne's web site appeared on first page if you search for that 
word only (while there's really a *lot* of others resources not related 
to this web server).


There's also another point to consider. If the target name is not 
strongly associated with an existing brand or a popular product, 
you'll see a lot of unrelated results on first page (that's the case 
for "Red"). So, AFAIU page ranking algorithm, once Red language will 
spread larger, I'm ready to bet that the cross-reference links of 
Red-related site (and back-references to Red's home site) will push 
it rapidly on the first page, or even in the top 3 list.
Dockimbel:
23-May-2011
Yes, it's 40000004h as the index is one-based.
Kaj:
27-May-2011
Yes, it's Amazon S3. You need to use the official URLs: syllable.org 
or web.syllable.org/pages/index.html
MagnussonC:
15-Sep-2011
Can someone explain how arrays work in red. I've seen an example 
where you progress through an array args with  args: args + 1. I 
would have understood better if it were the index that were increased 
for each loop, like item: item +1 in args/item ...
PeterWood:
15-Sep-2011
So the compiler doesn't treat item as an index but as a command to 
derefence the pointer heid in the current position of args.
Kaj:
15-Sep-2011
You can also do it with an index, but indexes are one-based. With 
pointer advancement you usually get the same effect as zero-based 
indexes
Kaj:
19-Sep-2011
stream!: alias struct! [
;	data				[binary!]
	index				[binary!]
	rest				[integer!]
]
fetch-audio: function [  ; Read sound buffer to be played.
	[callback]
	source				[stream!]
	sink				[binary!]
	size				[integer!]
	/local slice
][
	slice: source/rest
	if slice > size [slice: size]

;	copy-part source/index sink slice
	sdl-mix-audio sink source/index slice sdl-mix-max-volume

	source/index: source/index + slice
	source/rest: source/rest - slice
]
Kaj:
21-Oct-2011
http://www.youtube.com/watch?v=LnYa5_-1n7E&list=PL904CC146DCD27762&index=3
Kaj:
21-Oct-2011
http://www.youtube.com/watch?v=LriNVROAseI&list=PL904CC146DCD27762&index=4
Dockimbel:
19-Nov-2011
This one: http://gimite.net/en/index.php?Runnative executable in Android App
Dockimbel:
3-Dec-2011
Other possibility, yes, just install this app: http://gimite.net/en/index.php?Runnative executable in Android App
1001 / 110712345...8910[11] 12