Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-30 Thread Fernando Cabral
I thank you guys for the hints on counting and eliminating duplicates. In the end, I resorted to something that is very simple and does the trick in three steps. In the first step I sort the array. In the second step I count the number of occurrences and prepend it to the word itself (with a separa

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-30 Thread Gianluigi
Just for curiosity, on my computer, my function (double) processes 10 million strings (first and last name) in about 3 seconds. Very naif measurement using Timers and a limited number of names and surnames eg Willy Weber has come up 11051 times To demonstrate the goodness of Tobias' arguments, abo

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-30 Thread Gianluigi
Sorry Tobias, other explanations are not necessary. I would not be able to understand :-( I accept what you already explained to me as a dogma and I will try to put it into practice by copying your code :-). Thanks again. Gianluigi 2017-06-30 17:44 GMT+02:00 Gianluigi : > > 2017-06-30 17:21 GMT

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-30 Thread Gianluigi
2017-06-30 17:21 GMT+02:00 Tobias Boege : > > I wouldn't say there is anything *wrong* with it, but it also has quadratic > worst-case running time. You use String[].Push() which is just another name > for String[].Add(). Adding an element to an array (the straightforward way) > is done by extendi

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-30 Thread Tobias Boege
On Fri, 30 Jun 2017, Gianluigi wrote: > What was wrong in my example which meant this? > > Public Sub Main() > > Dim sSort As String[] = ["A", "B", "B", "B", "C", "D", "D", "E", "E", > "E", "E", "F"] > Dim s As String > > For Each s In ReturnArrays(sSort, 0) > Print s > Next > For

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-30 Thread Gianluigi
What was wrong in my example which meant this? Public Sub Main() Dim sSort As String[] = ["A", "B", "B", "B", "C", "D", "D", "E", "E", "E", "E", "F"] Dim s As String For Each s In ReturnArrays(sSort, 0) Print s Next For Each s In ReturnArrays(sSort, -1) Print s Next End Pri

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-30 Thread Tobias Boege
On Fri, 30 Jun 2017, Fernando Cabral wrote: > 2017-06-30 7:44 GMT-03:00 Fabien Bodard : > > > The best way is the nando one ... at least for gambas. > > > > As you have not to matter about what is the index value or the order, > > the walk ahead option is the better. > > > > > > Then Fernando ...

Re: [Gambas-user] any way to convert Result to Collection more faster than copy?

2017-06-30 Thread PICCORO McKAY Lenz
i get more than 30 minutes, due i must parse to a low end machine, not to your 4 cores, 16Gb ram super power machine.. i'm taking about a 1G ram and single core 1,6GHz atom cpu i need to convert from Result/cursor to other due the problem of the odbc lack of cursor/count .. i thinking about use

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-30 Thread ML
On 30/06/17 08:20, Fernando Cabral wrote: > 2017-06-30 7:44 GMT-03:00 Fabien Bodard : >> The best way is the nando one ... at least for gambas. >> As you have not to matter about what is the index value or the order, >> the walk ahead option is the better. >> Then Fernando ... for big, big things..

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-30 Thread Fernando Cabral
2017-06-30 7:44 GMT-03:00 Fabien Bodard : > The best way is the nando one ... at least for gambas. > > As you have not to matter about what is the index value or the order, > the walk ahead option is the better. > > > Then Fernando ... for big, big things... I think you need to use a DB. > Or a na

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-30 Thread Fabien Bodard
The best way is the nando one ... at least for gambas. As you have not to matter about what is the index value or the order, the walk ahead option is the better. Then Fernando ... for big, big things... I think you need to use a DB. Or a native language maybe a sqlite memory structure can be

Re: [Gambas-user] any way to convert Result to Collection more faster than copy?

2017-06-30 Thread adamn...@gmail.com
On Thu, 29 Jun 2017 18:57:29 -0400 PICCORO McKAY Lenz wrote: > can i convert directly or more faster than copy each row, a Result from > database to a collection or a VArian matrix? > > i'm taking about 200.000 rows in a result... the problem its that the odbc > db object support only cursor wit

Re: [Gambas-user] Fwd: No menus visible Qt5 on Unity

2017-06-30 Thread Fabien Bodard
2017-06-30 2:48 GMT+02:00 Benoît Minisini via Gambas-user : > Le 29/06/2017 à 09:55, Ian Haywood a écrit : >> >> Running gambas under Qt5 on Ubuntu unity no menus are visible or >> accessible (in either the app window or the top bar) >> >> using Qt4 fixes the problem (so does not using Unity!) >> >