[Gambas-user] [Gambas Bug Tracker] Bug #1112: Request to add bufferSize configuration into Local Socket - gb.net

2017-06-01 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1112=L21haW4-

Olivier CRUILLES reported a new bug.

Summary
---

Request to add bufferSize configuration into Local Socket - gb.net

Type : Request
Priority : Medium
Gambas version   : 3.9.90 (TRUNK)
Product  : Networking components


Description
---

Hello Benoit,
It is possible to add an option to configure the buffer value of a Socket in 
gb.net ?
I did not find it in the documentation.
thank you


System information
--

[System]
Gambas=3.9.90
OperatingSystem=Linux
Kernel=4.4.0-75-generic
Architecture=x86
Distribution=Linux Mint 18.1 Serena
Desktop=MATE
Theme=Gtk
Language=fr_CA.UTF-8
Memory=8098M

[Libraries]
Cairo=libcairo.so.2.11400.6
Curl=libcurl.so.4.4.0
DBus=libdbus-1.so.3.14.6
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.803.0
GTK+2=libgtk-x11-2.0.so.0.2400.30
GTK+3=libgtk-3.so.0.1800.9
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.28.0.0
Poppler=libpoppler.so.58.0.0
QT4=libQtCore.so.4.8.7
QT5=libQt5Core.so.5.5.1
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6

[Environment]
CLUTTER_BACKEND=x11
CLUTTER_IM_MODULE=xim
COMPIZ_CONFIG_PROFILE=mate
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-l4hOArkBvc,guid=acbd9b2811b5f5bd388bfb12592c3c7b
DEFAULTS_PATH=/usr/share/gconf/mate.default.path
DESKTOP_SESSION=mate
DISPLAY=:0
GB_GUI=gb.qt4
GDMSESSION=mate
GDM_XSERVER_LOCATION=local
GTK_IM_MODULE=ibus
GTK_MODULES=gail:atk-bridge
GTK_OVERLAY_SCROLLING=0
HOME=
LANG=fr_CA.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
LC_MONETARY=fr_FR.UTF-8
LC_NAME=fr_FR.UTF-8
LC_NUMERIC=fr_FR.UTF-8
LC_PAPER=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LIBVIRT_DEFAULT_URI=qemu:///system
LOGNAME=
MANDATORY_PATH=/usr/share/gconf/mate.mandatory.path
MATE_DESKTOP_SESSION_ID=this-is-deprecated
MDMSESSION=mate
MDM_LANG=fr_CA.UTF-8
MDM_XSERVER_LOCATION=local
PAPERSIZE=a4
PATH=/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PWD=
QT4_IM_MODULE=xim
QT_ACCESSIBILITY=1
QT_IM_MODULE=ibus
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
QT_STYLE_OVERRIDE=gtk
SESSION_MANAGER=local/:@/tmp/.ICE-unix/2333,unix/:/tmp/.ICE-unix/2333
SHELL=/bin/bash
SSH_AGENT_PID=2438
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
TZ=:/etc/localtime
USER=
USERNAME=
WINDOWPATH=7
XAUTHORITY=/.Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-mate:/etc/xdg
XDG_CURRENT_DESKTOP=MATE
XDG_DATA_DIRS=/usr/share/mate:/usr/local/share/:/usr/share/:/usr/share/mdm/
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_COOKIE=7799fc85266d4f0d61afdf215179697f-1496071290.556597-1145314354
XDG_SESSION_DESKTOP=mate
XDG_SESSION_ID=c1
XDG_VTNR=7
XMODIFIERS=@im=ibus



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1111: Request to add bufferSize configuration into Local Socket - gb.net

2017-06-01 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.=L21haW4-

Olivier CRUILLES changed the state of the bug to: Invalid.




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1111: Request to add bufferSize configuration into Local Socket - gb.net

2017-06-01 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.=L21haW4-

Olivier CRUILLES reported a new bug.

Summary
---

Request to add bufferSize configuration into Local Socket - gb.net

Type : Bug
Priority : Medium
Gambas version   : Unknown
Product  : Unknown


Description
---

Hello Benoit,

It is possible to add an option to configure the buffer value of a Socket in 
gb.net ?

I did not find it in the documentation.

thank you


System information
--

[System]
Gambas=3.9.90
OperatingSystem=Linux
Kernel=4.4.0-75-generic
Architecture=x86
Distribution=Linux Mint 18.1 Serena
Desktop=MATE
Theme=Gtk
Language=fr_CA.UTF-8
Memory=8098M

[Libraries]
Cairo=libcairo.so.2.11400.6
Curl=libcurl.so.4.4.0
DBus=libdbus-1.so.3.14.6
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.803.0
GTK+2=libgtk-x11-2.0.so.0.2400.30
GTK+3=libgtk-3.so.0.1800.9
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.28.0.0
Poppler=libpoppler.so.58.0.0
QT4=libQtCore.so.4.8.7
QT5=libQt5Core.so.5.5.1
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6

[Environment]
CLUTTER_BACKEND=x11
CLUTTER_IM_MODULE=xim
COMPIZ_CONFIG_PROFILE=mate
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-l4hOArkBvc,guid=acbd9b2811b5f5bd388bfb12592c3c7b
DEFAULTS_PATH=/usr/share/gconf/mate.default.path
DESKTOP_SESSION=mate
DISPLAY=:0
GB_GUI=gb.qt4
GDMSESSION=mate
GDM_XSERVER_LOCATION=local
GTK_IM_MODULE=ibus
GTK_MODULES=gail:atk-bridge
GTK_OVERLAY_SCROLLING=0
HOME=
LANG=fr_CA.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
LC_MONETARY=fr_FR.UTF-8
LC_NAME=fr_FR.UTF-8
LC_NUMERIC=fr_FR.UTF-8
LC_PAPER=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LIBVIRT_DEFAULT_URI=qemu:///system
LOGNAME=
MANDATORY_PATH=/usr/share/gconf/mate.mandatory.path
MATE_DESKTOP_SESSION_ID=this-is-deprecated
MDMSESSION=mate
MDM_LANG=fr_CA.UTF-8
MDM_XSERVER_LOCATION=local
PAPERSIZE=a4
PATH=/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PWD=
QT4_IM_MODULE=xim
QT_ACCESSIBILITY=1
QT_IM_MODULE=ibus
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
QT_STYLE_OVERRIDE=gtk
SESSION_MANAGER=local/:@/tmp/.ICE-unix/2333,unix/:/tmp/.ICE-unix/2333
SHELL=/bin/bash
SSH_AGENT_PID=2438
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
TZ=:/etc/localtime
USER=
USERNAME=
WINDOWPATH=7
XAUTHORITY=/.Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-mate:/etc/xdg
XDG_CURRENT_DESKTOP=MATE
XDG_DATA_DIRS=/usr/share/mate:/usr/local/share/:/usr/share/:/usr/share/mdm/
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_COOKIE=7799fc85266d4f0d61afdf215179697f-1496071290.556597-1145314354
XDG_SESSION_DESKTOP=mate
XDG_SESSION_ID=c1
XDG_VTNR=7
XMODIFIERS=@im=ibus



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Editing still blocked

2017-06-01 Thread William Cabrera
The editor is already working after revision #8141, thx


--
William Cabrera
https://blog.willicab.com.ve

2017-05-22 7:11 GMT-04:00 Fernando Cabral :

> For those of you that, like me, are having trouble with editing a source
> file, I have been using two functional workarounds:
>
> a) I run a virtual machine (vbox), and then I mount the project directory
> onto the virtual machine. From this virtual machine I edit the source code,
> compile it, and then switch back to the real machine, where I test it.
>
> b) Running on the real machine, I edit the source code using vi. After
> saving the edited file I reload it on the gambas IDE, compile it and test
> it.
>
> Cumbersome, perhaps, but workable enough to let me keep learning gambas
>
> Regards
>
> - fernando
>
>
> 2017-05-18 15:31 GMT-03:00 Karl Reinl :
>
> > Am Donnerstag, den 18.05.2017, 00:50 +0200 schrieb Benoît Minisini:
> > > Le 17/05/2017 à 22:30, Fabien Bodard a écrit :
> > > > So the problem come from the drawingarea.
> > > >
> > >
> > > I have changed something related to events in revision #8132, so it
> must
> > > me that.
> > >
> > > But everything works correctly on my system...
> > >
> > > I will investigate, but not before next week.
> > >
> > > Regards,
> > >
> >
> > Salut,
> >
> > until your solution comes, the SVN-user can check out release 8131
> > svn checkout -r 8131  
> > --
> > Amicalement
> > Charlie
> >
> >
> > 
> > --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > ___
> > Gambas-user mailing list
> > Gambas-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
>
>
> --
> Fernando Cabral
> Blogue: http://fernandocabral.org
> Twitter: http://twitter.com/fjcabral
> e-mail: fernandojosecab...@gmail.com
> Facebook: f...@fcabral.com.br
> Telegram: +55 (37) 99988-8868
> Wickr ID: fernandocabral
> WhatsApp: +55 (37) 99988-8868
> Skype:  fernandojosecabral
> Telefone fixo: +55 (37) 3521-2183
> Telefone celular: +55 (37) 99988-8868
>
> Enquanto houver no mundo uma só pessoa sem casa ou sem alimentos,
> nenhum político ou cientista poderá se gabar de nada.
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Regex - expert opinion requested

2017-06-01 Thread Fernando Cabral
Tobi,

> This sounds interesting, because for one thing I can't imagine a pipe
chain
> of "sed" invocations to take this long on just 500 KiB input (but I could
> be wrong).

"sed" does it in a lightning fast way.
For instance, sed 's/[^.:;,?!]//g' About your regular expressions: I think the key point is that you are
really
>just erasing characters of character casses. Your expressions are extremely
>simple in that regard. You mentioned that avoiding regular expressions
gives
>you a big speedup but the code took you longer to write. I don't see why.
>You should be able to write a general function.

Yes, that's what amazes me the most: the RE are pretty simple;
nevertheless, slow when using PCRE.

On the other hand, yes, I have written a general expression (see the
attached code). It is just a very simple parser that breaks the text into
char, non-char, syllable, words, sentences.
In the end, this solution is about 31 times faster than the solution based
on the regex.replace function.
That's a lot faster than both gambas.

> Regardless, I would be a little interested in getting a sample project
which
> includes your regular expressions and such a text file, to see for myself
> where the time is exactly spent. Can you send a version of your project
that
> contains only the parts relevant to these regular expressions?

I am attaching the two versions, the one based on RE, and the other one I
built from scratch. Neither is an example of good code. I am trying to
learn gambas so I certainly have not used the best possible alternatives
available.  Many things I did by trial and error because I don't have any
experience with gambas. So, pardon me for the low code quality.

I have also attached the test file. Its text is not in good shape. This
means it has a lot of broken things, like missing or wrong punctuation,
blank lines, dangling words, unpaired parenthesis and quotes. This is one
of the reasons I am using it as a test platform. It allows me to test the
code robustness.

To run and compare the two versions timewise, do:

$  time ./Legibilidade-odt PauloCoelho.odt
$ time ./AnalisaSenteca PauloCoelho.odt

You will have to install "unoconv" in your machine. Just in case you don't
have it and you do not want to install it, I am sending also a txt version
of the same file. You can use it to test the RegExp using sed and also you
can change the code to skip the conversion phase (conversion from ODT to
TXT).

Results generated by the two programs are very similar, but the time spent
by each of them is quite different.

SInce the list administrator did not allow me to send the files, I am
sending you the links so you can get them from Dropbox:

https://www.dropbox.com/s/6prpw8l7bir177f/AnalisaSentenca-0.0.665.tar.gz?dl=0
https://www.dropbox.com/s/82adoan7ojbwvbn/Legibilidade-odt-0.0.354.tar.gz?dl=0
https://www.dropbox.com/s/3n637e7g8rwqzfd/PauloCoelho.odt?dl=0
https://www.dropbox.com/s/3n637e7g8rwqzfd/PauloCoelho.odt?dl=0



Regards

- fernando
PS - Neither of the two programs is good stuff. They are not finished
and some of the algorithms and functions are only crude versions of what
they could be.

2017-05-31 19:21 GMT-03:00 Tobias Boege :

> On Wed, 31 May 2017, Fernando Cabral wrote:
> > This is only for those who like to work with regular expressions.
> > It is a performance issue. I am using 26 different regular expressions of
> > this kind:
> >
> > txt = RegExp.Replace(TextoBruto, NaoNumerais, "&1\n", RegExp.UTF8)
> > txt = RegExp.Replace(Txt, "\n\n+?", "\n", RegExp.UTF8)
> > txt = RegExp.Replace(Txt, "^\n+?", "", RegExp.UTF8)
> > txt = RegExp.Replace(Txt, "\n+?$", "", RegExp.UTF8)
> >
> > Those are pretty fast. Less than one second for a text with 415KB (about
> > six thousand lines).
> >
> > But the following code is quite slow. About 27 seconds each:
> >
> > ttDigitos = String.Len(RegExp.Replace(TextoBruto, "[^0-9]", "",
> > RegExp.UTF8)) ' 27 segundos
> > ttPontuacao = String.Len(RegExp.Replace(TextoBruto, "[^.:;,?!]", "",
> > RegExp.UTF8))  ' 27 segundos
> > ttBrancos = String.Len(RegExp.Replace(TextoBruto, "[^ \t]", "",
> > RegExp.UTF8))   ' 27 segundos
> > Print "Especial antigo", Now
> > 'ttEspeciais = String.Len(RegExp.Replace(TextoBruto,
> > "[^-[\\](){}\"@#$%&*_+=<>/|ºª§“”‘’]", "", RegExp.UTF8))  ' 27
> segundos
> > Print "Especial novo", Now
> > ttEspeciais = String.Len(RegExp.Replace(TextoBruto,
> > "[-aeiouãáéíóúâõàbcçdfghjlmnpqrstvxyz
> > ,.:;!?()0-9êôwkèìòùäÄÁÉÍÓÚÀÈÌÒÙÂÔÂÊÔÇABCDEFGHIJKLMNOPQRSTUVWXYZ]", "",
> > RegExp.UTF8))  ' 27 segundos
> > Print "fim especial novo", Now
> >
> > Quite slow. The whole programm takes 2 minutes to run. The above lines
> > alone consume 108 seconds (108:120).
> >
> > I tried some variations. For instance, ttEspeciais =  has two
> versions.
> > One negates what to leave in, the other describes what to take out. End
> > result is the same. And so is the time spent.
> >
> > I have also written a much longer code that does the same 

Re: [Gambas-user] Working with .so library

2017-06-01 Thread Admin

31.05.2017 19:50, Benoît Minisini пишет:

Le 31/05/2017 à 14:36, Admin a écrit :

31.05.2017 18:18, Benoît Minisini пишет:

Le 31/05/2017 à 12:38, Admin a écrit :

31.05.2017 16:58, Benoît Minisini пишет:
Apparently all that black box is written in C++ with QT, and 
without the header of the library interface , I can't tell you if 
it is possible to use the library with Gambas, and how.


Regards,

I was lucky enough to find the header file shared by developers and 
an example program in C++ that utilizes this lib.


Here they are: http://allunix.ru/back/atol-header.tar.gz



Maybe CreateFptrInterface() is a C++ only thing, and that you must 
call another function from the C interface to do something similar. 
But I couldn't find it reading the C header.


You need the documentation of the C interface, or at least an 
example written in C to know. You usually can't use C++ exported 
functions from Gambas.


Regards,

Maybe it is. One of the authors of the original .so library stated on 
one forum:


"You can use purely C interface like this:

void *fptr = CreateFptrInterface();
put_DeviceSingleSetting(fptr, L"Port", "4");
ApplySingleSettings(fptr);

"

but I can't see the difference.


Dmitry.



Then it should work the way you did. But you did not respect the 
interface of put_DeviceSingleSettingAsInt(). It wants a "wchar_t *", 
whereas the Gambas strings are encoded in ASCII or UTF-8.


You must first convert the Gambas string to wchar_t by using 
Conv$(, "UTF-8", "WCHAR_T") or Conv$(, "ASCII", 
"WCHAR_T").


Regards,


Oh. My. God. That's exactly what I needed.

Actually, I saw that the library expetcs a variable in wchar_t format, I 
had no idea what it was, so I googled "gambas wchar_t" and found 
absolutely nothing. Then I wrote my first letter to this maillist.


And now when you gave me this line of the code, the library works 
exactly the way it should, doing everything I'm asking it for.


Huge thank you!

Dmitry/


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user