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

World: r3wp

[!RebGUI] A lightweight alternative to VID

PeterD
10-Apr-2007
[5807]
Any of you gurus feels a need for a multi-level-sort-table ?
I  need one and hopefully I'm not alone ! 


I have a lot of data with a lot of same values in some columns, no 
simple sort will do what I need.

For right now a simple hard coded: first by Col1, than by Col2 and 
so forth will do.
A more elegant and flexible [sort-definition] can follow later.
Cheers
btiffin
10-Apr-2007
[5808x3]
In the meanwhile check Cesar's %multple-key-sort.r in the rebol.org 
library.

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=multiple-key-sort.r
Ashley;  Build 74

>> do %rebgui.r
>> q
Segmentation fault

Debian Linux, rebview 2.7.5
A little more
>>echo %trace.txt
>>trace on
>>do %rebgui.r
>>echo none
Trace:  echo (word)
Trace:  none (word)
Trace:  if (word)
Trace:  port? (word)
Trace:  system/ports/echo (path)
Result: true (logic)
Trace:  [
    close system/ports/echo
    system/ports/echo: none
] (block)
Trace:  close (word)
Trace:  system/ports/echo (path)
REBOL Internal Error: Stack overflow


                                    Program terminated abnormally.

                                                                  This should never happen.

                                                                                           Contact www.REBOL.com with details.
Ashley
11-Apr-2007
[5811]
Can't reproduce that under Win or Mac. Does the error occur if you 
'do another script and quit (i.e. is it dependent on loading %rebgui.r)? 
Failing that, try commenting out the third last line of %rebgui.r 
(system/view/face/feel: none) and see if that changes things.
Pekr
11-Apr-2007
[5812x4]
Henrik - gradient being assymetric is what I like. Well, the only 
one trouble for me is small visual "defect", where buttons don't 
look too good on dark background, because they miss more concrete 
border. I wonder if it would look good, if buttons shared default 
widget border? Well, probably not :-)
But - visual look is area for customisation for anyone. However - 
I showed mine adapted default look to 3 ppl - 1 PC admin, 1 web designer, 
one reboller, and most agreed that the difference (using mild blue 
colors and grays, non-rounded shaping of tabs) is some 30% of feel 
to them :-)
hehe, just tried to make button and table tabbable, got following 
error - imo because of table :-)
** Script Error: empty? expected series argument of type: series 
port bitset
** Where: set-focus
** Near: view*/caret: case [

    all [caret in face 'caret face/caret] [at face/text face/caret]
    find behaviors/caret-on-foc...
Gabriele
11-Apr-2007
[5816]
segmentation fault at quit on Linux is very common with REBOL. I 
don't think it's rebgui related.
btiffin
11-Apr-2007
[5817]
Ashley;  Yeah , this seems to be an internal stack problem in REBOL 
beta  Sorry for dropping this here.
Graham
11-Apr-2007
[5818x3]
Pekr, can you post your code so we can reproduce the error?
Cyphre's spell checker http://www.rebol.cz/~cyphre/spell.r
And Ladislav posts an improvement leading to 3x speed increase.
Ashley
11-Apr-2007
[5821]
post your code

 ... I suspect it was as simple as adding a fiew widget names into 
 behaviors/tabbable via request-ui

posts an improvement leading to 3x speed increase
 ... where?
Graham
11-Apr-2007
[5822]
mailing list
Steeve
11-Apr-2007
[5823x2]
hum, i'm not sure that all modifications made by ladislav are improvment
his 'train function is slowest than the primary
Ladislav
11-Apr-2007
[5825]
yes, it is, but it does more things
Steeve
11-Apr-2007
[5826x4]
^^^
ladislav, i gan 1 second while intializing the dictionary with this 
train function:

train: func [
	words [block!]
	/local keys values pos i
][
	keys: to hash! unique words
	values: head insert/dup cp [] 0 2 * length? keys

 i: 0 loop length? keys [change values first keys values: skip values 
 2 keys: next keys]
	values: head values
	keys: head keys
	foreach word words [
			pos: 2 * index? find keys word 
			poke values pos 1 + pick values pos
	]
	sort/reverse/skip/compare values 2 2
	values
]
the first 'sort in your train function consume a lot of time
anyway, my function is not perfect ...either
Ashley
11-Apr-2007
[5830]
The 'correct function is *very* slow, takes almost 4 seconds to do 
the following:

	>> correct "caustic"


Also, where is the bin file sourced from and are other languages 
supported?
Steeve
11-Apr-2007
[5831x3]
yeah all languages are supported, it's the good thing with this algo
you juste have to replace the corpus by another bin file
i mean, all "latin" languages are supported
Ashley
11-Apr-2007
[5834]
And a good collection of bin files would be located at?
Steeve
11-Apr-2007
[5835x4]
hey, they are just plain text books
just take a book well writed
what is your language ?
take a classic
Ashley
11-Apr-2007
[5839]
Queen's English ;)
Steeve
11-Apr-2007
[5840]
use books.google.com to find a good one
Ashley
11-Apr-2007
[5841]
I'm wondering whether, for RebGUI, this approach is actually "better" 
than the current soundex approach? If it means having to pick arbitrary 
literary works for each language then what's the point? I was hoping 
that someone had pre-generated some "standardized" dicts somewhere 
I could grab.
Steeve
11-Apr-2007
[5842x3]
i dunno
soundex is faster
but more complicated
Ashley
11-Apr-2007
[5845]
? It's less than a dozen lines of code!
Steeve
11-Apr-2007
[5846x2]
oh really ?
right
Ashley
11-Apr-2007
[5848]
http://trac.geekisp.com/rebgui/browser/rebgui-edit.r?format=raw
Ladislav
12-Apr-2007
[5849]
steeve: don't forget, that the 1s difference in TRAIN speed does 
not actually matter, since it is just a dictionary preparation. What 
matters is the speed of the CORRECT function
Graham
12-Apr-2007
[5850]
how fast is the correct function?
Ladislav
12-Apr-2007
[5851x2]
the version I just sent to the ML is now almost 4 times faster than 
Cyphre's
on his example it is about 9 words/s
Pekr
12-Apr-2007
[5853]
Graham - Ashley is right - all I did wat I added 'table name to the 
behavior tabbing category ....
Ladislav
12-Apr-2007
[5854]
Soundex is a language-specific algorithm, unfortunately
Graham
12-Apr-2007
[5855]
So soundex is specific to English ?
Ashley
12-Apr-2007
[5856]
Seems so: http://en.wikipedia.org/wiki/Soundex