Changing the C# BasexClient.cs
Monday, 29 September 2014 · 10 messages · last reply 30 Sep 2014
ND
Nilanjan Dutta29 Sep 2014 10:05 #
Hi All,
I want to change/overload the implementation private void Send (Stream s)
method in the BaseXClient.cs file. [
basex <https://github.com/BaseXdb/basex> / basex-api
<https://github.com/BaseXdb/basex/tree/master/basex-api> / src
<https://github.com/BaseXdb/basex/tree/master/basex-api/src> / main
<https://github.com/BaseXdb/basex/tree/master/basex-api/src/main> / c#
<https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23> /
*BaseXClient.cs*]*Existing implementation:*
private void Send(Stream s) { while (true) { int t = s.ReadByte(); if (t == -1) break; if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert.ToByte(0xFF )); stream.WriteByte(Convert.ToByte(t)); } stream.WriteByte(0); info = Receive(); if(!Ok()) { throw new IOException(info); } }
*What I want it to be:*
[image: Inline image 1]
This one is faster for my use case. Please do let me know how can this be done?
Regards,
N.D.
ND
Nilanjan Dutta29 Sep 2014 10:22 #
Below query is more of a process related. Wanted to know what is the process of such change and also the legal part of it if I just change it in my local and package the dll to my software.
Regards,
N.D.
---------- Forwarded message ----------
Quoted text · Nilanjan Dutta · 27 lines
From: Nilanjan Dutta <nilanjan.dutta.india at gmail.com> Date: Mon, Sep 29, 2014 at 1:35 PM Subject: Changing the C# BasexClient.cs To: basex-talk at mailman.uni-konstanz.de Hi All, I want to change/overload the implementation private void Send (Stream s) method in the BaseXClient.cs file. [ basex <https://github.com/BaseXdb/basex> / basex-api <https://github.com/BaseXdb/basex/tree/master/basex-api> / src <https://github.com/BaseXdb/basex/tree/master/basex-api/src> / main <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main> / c# <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23> / *BaseXClient.cs*] *Existing implementation:* private void Send(Stream s) { while (true) { int t = s.ReadByte(); if (t == -1) break; if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert.ToByte(0xFF )); stream.WriteByte(Convert.ToByte(t)); } stream.WriteByte(0); info = Receive(); if(!Ok()) { throw new IOException(info); } } *What I want it to be:* [image: Inline image 1] This one is faster for my use case. Please do let me know how can this be done? Regards, N.D.
MS
Hi N.D.,
feel free to send a pull request on GitHub [1,2]:
https://github.com/basexdb/basex
This way we will be able to incorporate your patch into our sources.
Hope this helps and thanks for your contribution,
Michael
[1] https://help.github.com/articles/using-pull-requests
[2] http://docs.basex.org/wiki/Git#Using_Git_to_contribute_to_BaseX
Quoted text · Nilanjan Dutta · 35 lines
On 29 Sep 2014, at 10:05, Nilanjan Dutta wrote: > Hi All, > > I want to change/overload the implementation private void Send (Stream > s) > method in the BaseXClient.cs file. [ > basex <https://github.com/BaseXdb/basex> / basex-api > <https://github.com/BaseXdb/basex/tree/master/basex-api> / src > <https://github.com/BaseXdb/basex/tree/master/basex-api/src> / main > <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main> / c# > <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23> > / > *BaseXClient.cs*] > > *Existing implementation:* > > private void Send(Stream s) { while (true) { int t = s.ReadByte(); if > (t == > -1) break; if (t == 0x00 || t == 0xFF) > stream.WriteByte(Convert.ToByte(0xFF > )); stream.WriteByte(Convert.ToByte(t)); } stream.WriteByte(0); info = > Receive(); if(!Ok()) { throw new IOException(info); } } > > *What I want it to be:* > > > [image: Inline image 1] > This one is faster for my use case. Please do let me know how can > this be > done? > > Regards, > N.D. > > [image.png]
ND
Nilanjan Dutta29 Sep 2014 10:26 #
How about I change this code in my local dev environment and package it ? Will that be legally OK?
I'd do that git hub request in parallel though.
Regards,
N.D.
Quoted text · Michael Seiferle · 52 lines
On Mon, Sep 29, 2014 at 1:53 PM, Michael Seiferle <ms at basex.org> wrote: > Hi N.D., > > feel free to send a pull request on GitHub [1,2]: > https://github.com/basexdb/basex > > This way we will be able to incorporate your patch into our sources. > > Hope this helps and thanks for your contribution, > > Michael > > [1] https://help.github.com/articles/using-pull-requests > [2] http://docs.basex.org/wiki/Git#Using_Git_to_contribute_to_BaseX > > > > On 29 Sep 2014, at 10:05, Nilanjan Dutta wrote: > > Hi All, >> >> I want to change/overload the implementation private void Send (Stream s) >> method in the BaseXClient.cs file. [ >> basex <https://github.com/BaseXdb/basex> / basex-api >> <https://github.com/BaseXdb/basex/tree/master/basex-api> / src >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src> / main >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main> / c# >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23> / >> *BaseXClient.cs*] >> >> *Existing implementation:* >> >> private void Send(Stream s) { while (true) { int t = s.ReadByte(); if (t >> == >> -1) break; if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert. >> ToByte(0xFF >> )); stream.WriteByte(Convert.ToByte(t)); } stream.WriteByte(0); info = >> Receive(); if(!Ok()) { throw new IOException(info); } } >> >> *What I want it to be:* >> >> >> [image: Inline image 1] >> This one is faster for my use case. Please do let me know how can this be >> done? >> >> Regards, >> N.D. >> >> [image.png] >> >
DK
Dirk Kirsten29 Sep 2014 10:43 #
Hi Nilanjan,
BaseX is using the BSD license, which allows almost anything. You can find the surprisingly short license in license.txt. Basically you can do anything except removing the copyright notice and the list of contributors.
As for all legal advice: IANAL (I am not a lawyer). If you want to know it for sure, you will have to ask a lawyer.
Cheers,
Dirk
Quoted text · Nilanjan Dutta · 62 lines
On 09/29/2014 10:26 AM, Nilanjan Dutta wrote: > How about I change this code in my local dev environment and package it ? > Will that be legally OK? > I'd do that git hub request in parallel though. > > Regards, > N.D. > > On Mon, Sep 29, 2014 at 1:53 PM, Michael Seiferle <ms at basex.org> wrote: > > > Hi N.D., > > > > feel free to send a pull request on GitHub [1,2]: > > https://github.com/basexdb/basex > > > > This way we will be able to incorporate your patch into our sources. > > > > Hope this helps and thanks for your contribution, > > > > Michael > > > > [1] https://help.github.com/articles/using-pull-requests > > [2] http://docs.basex.org/wiki/Git#Using_Git_to_contribute_to_BaseX > > > > > > > > On 29 Sep 2014, at 10:05, Nilanjan Dutta wrote: > > > > Hi All, > >> > >> I want to change/overload the implementation private void Send (Stream s) > >> method in the BaseXClient.cs file. [ > >> basex <https://github.com/BaseXdb/basex> / basex-api > >> <https://github.com/BaseXdb/basex/tree/master/basex-api> / src > >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src> / main > >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main> / c# > >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23> / > >> *BaseXClient.cs*] > >> > >> *Existing implementation:* > >> > >> private void Send(Stream s) { while (true) { int t = s.ReadByte(); if (t > >> == > >> -1) break; if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert. > >> ToByte(0xFF > >> )); stream.WriteByte(Convert.ToByte(t)); } stream.WriteByte(0); info = > >> Receive(); if(!Ok()) { throw new IOException(info); } } > >> > >> *What I want it to be:* > >> > >> > >> [image: Inline image 1] > >> This one is faster for my use case. Please do let me know how can this be > >> done? > >> > >> Regards, > >> N.D. > >> > >> [image.png] > >> > > >
--
Dirk Kirsten, BaseX GmbH, http://basex.org
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
ND
Nilanjan Dutta29 Sep 2014 10:47 #
Thanks Dirk.
GitHub is something new to me. Having a hard time raising a "pull request" as we talk. I'll get it right sometime soon may be . Meanwhile I'll continue my version of the said method and use the dll.
Regards,
N.D.
Quoted text · Dirk Kirsten · 88 lines
On Mon, Sep 29, 2014 at 2:13 PM, Dirk Kirsten <dk at basex.org> wrote: > Hi Nilanjan, > > BaseX is using the BSD license, which allows almost anything. You can find > the surprisingly short license in license.txt. Basically you can do > anything except removing the copyright notice and the list of contributors. > > As for all legal advice: IANAL (I am not a lawyer). If you want to know it > for sure, you will have to ask a lawyer. > > Cheers, > Dirk > On 09/29/2014 10:26 AM, Nilanjan Dutta wrote: > > How about I change this code in my local dev environment and package it ? > > Will that be legally OK? > > I'd do that git hub request in parallel though. > > > > Regards, > > N.D. > > > > On Mon, Sep 29, 2014 at 1:53 PM, Michael Seiferle <ms at basex.org> wrote: > > > > > Hi N.D., > > > > > > feel free to send a pull request on GitHub [1,2]: > > > https://github.com/basexdb/basex > > > > > > This way we will be able to incorporate your patch into our sources. > > > > > > Hope this helps and thanks for your contribution, > > > > > > Michael > > > > > > [1] https://help.github.com/articles/using-pull-requests > > > [2] http://docs.basex.org/wiki/Git#Using_Git_to_contribute_to_BaseX > > > > > > > > > > > > On 29 Sep 2014, at 10:05, Nilanjan Dutta wrote: > > > > > > Hi All, > > >> > > >> I want to change/overload the implementation private void Send > (Stream s) > > >> method in the BaseXClient.cs file. [ > > >> basex <https://github.com/BaseXdb/basex> / basex-api > > >> <https://github.com/BaseXdb/basex/tree/master/basex-api> / src > > >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src> / main > > >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main> / > c# > > >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23> > / > > >> *BaseXClient.cs*] > > >> > > >> *Existing implementation:* > > >> > > >> private void Send(Stream s) { while (true) { int t = s.ReadByte(); if > (t > > >> == > > >> -1) break; if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert. > > >> ToByte(0xFF > > >> )); stream.WriteByte(Convert.ToByte(t)); } stream.WriteByte(0); info = > > >> Receive(); if(!Ok()) { throw new IOException(info); } } > > >> > > >> *What I want it to be:* > > >> > > >> > > >> [image: Inline image 1] > > >> This one is faster for my use case. Please do let me know how can > this be > > >> done? > > >> > > >> Regards, > > >> N.D. > > >> > > >> [image.png] > > >> > > > > > > > -- > Dirk Kirsten, BaseX GmbH, http://basex.org > |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz > |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: > | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle > `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 > >
AB
Andy Bunce29 Sep 2014 10:57 #
Hi Nilanjan,
It may be faster but surely your change misses the correct handling of the bytes 00 and FF?
Quoted text · Nilanjan Dutta · 1 line
> if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert.ToByte(0xFF));
This is required for binary content and possibly some unicode documents? This may not be a problem for your use cases but it would be for others. /Andy
Quoted text · Nilanjan Dutta · 103 lines
On 29 September 2014 09:47, Nilanjan Dutta <nilanjan.dutta.india at gmail.com> wrote: > Thanks Dirk. > > GitHub is something new to me. Having a hard time raising a "pull request" > as we talk. I'll get it right sometime soon may be . Meanwhile I'll > continue my version of the said method and use the dll. > > Regards, > N.D. > > On Mon, Sep 29, 2014 at 2:13 PM, Dirk Kirsten <dk at basex.org> wrote: > >> Hi Nilanjan, >> >> BaseX is using the BSD license, which allows almost anything. You can >> find the surprisingly short license in license.txt. Basically you can do >> anything except removing the copyright notice and the list of contributors. >> >> As for all legal advice: IANAL (I am not a lawyer). If you want to know >> it for sure, you will have to ask a lawyer. >> >> Cheers, >> Dirk >> On 09/29/2014 10:26 AM, Nilanjan Dutta wrote: >> > How about I change this code in my local dev environment and package it >> ? >> > Will that be legally OK? >> > I'd do that git hub request in parallel though. >> > >> > Regards, >> > N.D. >> > >> > On Mon, Sep 29, 2014 at 1:53 PM, Michael Seiferle <ms at basex.org> wrote: >> > >> > > Hi N.D., >> > > >> > > feel free to send a pull request on GitHub [1,2]: >> > > https://github.com/basexdb/basex >> > > >> > > This way we will be able to incorporate your patch into our sources. >> > > >> > > Hope this helps and thanks for your contribution, >> > > >> > > Michael >> > > >> > > [1] https://help.github.com/articles/using-pull-requests >> > > [2] http://docs.basex.org/wiki/Git#Using_Git_to_contribute_to_BaseX >> > > >> > > >> > > >> > > On 29 Sep 2014, at 10:05, Nilanjan Dutta wrote: >> > > >> > > Hi All, >> > >> >> > >> I want to change/overload the implementation private void Send >> (Stream s) >> > >> method in the BaseXClient.cs file. [ >> > >> basex <https://github.com/BaseXdb/basex> / basex-api >> > >> <https://github.com/BaseXdb/basex/tree/master/basex-api> / src >> > >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src> / main >> > >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main> / >> c# >> > >> < >> https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23> / >> > >> *BaseXClient.cs*] >> > >> >> > >> *Existing implementation:* >> > >> >> > >> private void Send(Stream s) { while (true) { int t = s.ReadByte(); >> if (t >> > >> == >> > >> -1) break; if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert. >> > >> ToByte(0xFF >> > >> )); stream.WriteByte(Convert.ToByte(t)); } stream.WriteByte(0); info >> = >> > >> Receive(); if(!Ok()) { throw new IOException(info); } } >> > >> >> > >> *What I want it to be:* >> > >> >> > >> >> > >> [image: Inline image 1] >> > >> This one is faster for my use case. Please do let me know how can >> this be >> > >> done? >> > >> >> > >> Regards, >> > >> N.D. >> > >> >> > >> [image.png] >> > >> >> > > >> > >> >> -- >> Dirk Kirsten, BaseX GmbH, http://basex.org >> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz >> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: >> | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle >> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 >> >> >
ND
Nilanjan Dutta29 Sep 2014 11:03 #
Yes indeed. Hence I wanted at least a 'overload'.
Since i'm not dealing with a stream which would contain -in any case - such char, I implemented the entire byte to go and sit in the network stream, which is faster than traversing each element in the incoming stream.
Regards,
N.D.
Quoted text · Andy Bunce · 119 lines
On Mon, Sep 29, 2014 at 2:27 PM, Andy Bunce <bunce.andy at gmail.com> wrote: > Hi Nilanjan, > It may be faster but surely your change misses the correct handling of the > bytes 00 and FF? > > > if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert.ToByte(0xFF)); > > This is required for binary content and possibly some unicode documents? > This may not be a problem for your use cases but it would be for others. > /Andy > > > > On 29 September 2014 09:47, Nilanjan Dutta <nilanjan.dutta.india at gmail.com > > wrote: > >> Thanks Dirk. >> >> GitHub is something new to me. Having a hard time raising a "pull >> request" as we talk. I'll get it right sometime soon may be . Meanwhile >> I'll continue my version of the said method and use the dll. >> >> Regards, >> N.D. >> >> On Mon, Sep 29, 2014 at 2:13 PM, Dirk Kirsten <dk at basex.org> wrote: >> >>> Hi Nilanjan, >>> >>> BaseX is using the BSD license, which allows almost anything. You can >>> find the surprisingly short license in license.txt. Basically you can do >>> anything except removing the copyright notice and the list of contributors. >>> >>> As for all legal advice: IANAL (I am not a lawyer). If you want to know >>> it for sure, you will have to ask a lawyer. >>> >>> Cheers, >>> Dirk >>> On 09/29/2014 10:26 AM, Nilanjan Dutta wrote: >>> > How about I change this code in my local dev environment and package >>> it ? >>> > Will that be legally OK? >>> > I'd do that git hub request in parallel though. >>> > >>> > Regards, >>> > N.D. >>> > >>> > On Mon, Sep 29, 2014 at 1:53 PM, Michael Seiferle <ms at basex.org> >>> wrote: >>> > >>> > > Hi N.D., >>> > > >>> > > feel free to send a pull request on GitHub [1,2]: >>> > > https://github.com/basexdb/basex >>> > > >>> > > This way we will be able to incorporate your patch into our sources. >>> > > >>> > > Hope this helps and thanks for your contribution, >>> > > >>> > > Michael >>> > > >>> > > [1] https://help.github.com/articles/using-pull-requests >>> > > [2] http://docs.basex.org/wiki/Git#Using_Git_to_contribute_to_BaseX >>> > > >>> > > >>> > > >>> > > On 29 Sep 2014, at 10:05, Nilanjan Dutta wrote: >>> > > >>> > > Hi All, >>> > >> >>> > >> I want to change/overload the implementation private void Send >>> (Stream s) >>> > >> method in the BaseXClient.cs file. [ >>> > >> basex <https://github.com/BaseXdb/basex> / basex-api >>> > >> <https://github.com/BaseXdb/basex/tree/master/basex-api> / src >>> > >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src> / main >>> > >> <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main> >>> / c# >>> > >> < >>> https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23> / >>> > >> *BaseXClient.cs*] >>> > >> >>> > >> *Existing implementation:* >>> > >> >>> > >> private void Send(Stream s) { while (true) { int t = s.ReadByte(); >>> if (t >>> > >> == >>> > >> -1) break; if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert. >>> > >> ToByte(0xFF >>> > >> )); stream.WriteByte(Convert.ToByte(t)); } stream.WriteByte(0); >>> info = >>> > >> Receive(); if(!Ok()) { throw new IOException(info); } } >>> > >> >>> > >> *What I want it to be:* >>> > >> >>> > >> >>> > >> [image: Inline image 1] >>> > >> This one is faster for my use case. Please do let me know how can >>> this be >>> > >> done? >>> > >> >>> > >> Regards, >>> > >> N.D. >>> > >> >>> > >> [image.png] >>> > >> >>> > > >>> > >>> >>> -- >>> Dirk Kirsten, BaseX GmbH, http://basex.org >>> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz >>> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: >>> | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle >>> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 >>> >>> >> >
DK
Dirk Kirsten29 Sep 2014 11:16 #
Hi Nilanjan,
such a solution would almost certainly not be merged into the main branch of BaseX. As Andy correctly points out, this would break the client for many users, although you might not need it.
However, for the general public and because the problem was faced quite a few times the last couple of weeks I wrote a short tutorial how to correctly submit a feature or bug report for BaseX using git. It can be found at http://docs.basex.org/wiki/Git#Developing_a_new_feature_or_bug_fix_using_git
Cheers,
Dirk
Quoted text · Nilanjan Dutta · 130 lines
On 09/29/2014 11:03 AM, Nilanjan Dutta wrote: > Yes indeed. Hence I wanted at least a 'overload'. > Since i'm not dealing with a stream which would contain -in any case - such > char, I implemented the entire byte to go and sit in the network stream, > which is faster than traversing each element in the incoming stream. > > Regards, > N.D. > > On Mon, Sep 29, 2014 at 2:27 PM, Andy Bunce <bunce.andy at gmail.com> wrote: > > > Hi Nilanjan, > > It may be faster but surely your change misses the correct handling of the > > bytes 00 and FF? > > > >> if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert.ToByte(0xFF)); > > > > This is required for binary content and possibly some unicode documents? > > This may not be a problem for your use cases but it would be for others. > > /Andy > > > > > > > > On 29 September 2014 09:47, Nilanjan Dutta <nilanjan.dutta.india at gmail.com > >> wrote: > > > >> Thanks Dirk. > >> > >> GitHub is something new to me. Having a hard time raising a "pull > >> request" as we talk. I'll get it right sometime soon may be . Meanwhile > >> I'll continue my version of the said method and use the dll. > >> > >> Regards, > >> N.D. > >> > >> On Mon, Sep 29, 2014 at 2:13 PM, Dirk Kirsten <dk at basex.org> wrote: > >> > >>> Hi Nilanjan, > >>> > >>> BaseX is using the BSD license, which allows almost anything. You can > >>> find the surprisingly short license in license.txt. Basically you can do > >>> anything except removing the copyright notice and the list of contributors. > >>> > >>> As for all legal advice: IANAL (I am not a lawyer). If you want to know > >>> it for sure, you will have to ask a lawyer. > >>> > >>> Cheers, > >>> Dirk > >>> On 09/29/2014 10:26 AM, Nilanjan Dutta wrote: > >>>> How about I change this code in my local dev environment and package > >>> it ? > >>>> Will that be legally OK? > >>>> I'd do that git hub request in parallel though. > >>>> > >>>> Regards, > >>>> N.D. > >>>> > >>>> On Mon, Sep 29, 2014 at 1:53 PM, Michael Seiferle <ms at basex.org> > >>> wrote: > >>>> > >>>>> Hi N.D., > >>>>> > >>>>> feel free to send a pull request on GitHub [1,2]: > >>>>> https://github.com/basexdb/basex > >>>>> > >>>>> This way we will be able to incorporate your patch into our sources. > >>>>> > >>>>> Hope this helps and thanks for your contribution, > >>>>> > >>>>> Michael > >>>>> > >>>>> [1] https://help.github.com/articles/using-pull-requests > >>>>> [2] http://docs.basex.org/wiki/Git#Using_Git_to_contribute_to_BaseX > >>>>> > >>>>> > >>>>> > >>>>> On 29 Sep 2014, at 10:05, Nilanjan Dutta wrote: > >>>>> > >>>>> Hi All, > >>>>>> > >>>>>> I want to change/overload the implementation private void Send > >>> (Stream s) > >>>>>> method in the BaseXClient.cs file. [ > >>>>>> basex <https://github.com/BaseXdb/basex> / basex-api > >>>>>> <https://github.com/BaseXdb/basex/tree/master/basex-api> / src > >>>>>> <https://github.com/BaseXdb/basex/tree/master/basex-api/src> / main > >>>>>> <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main> > >>> / c# > >>>>>> < > >>> https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23> / > >>>>>> *BaseXClient.cs*] > >>>>>> > >>>>>> *Existing implementation:* > >>>>>> > >>>>>> private void Send(Stream s) { while (true) { int t = s.ReadByte(); > >>> if (t > >>>>>> == > >>>>>> -1) break; if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert. > >>>>>> ToByte(0xFF > >>>>>> )); stream.WriteByte(Convert.ToByte(t)); } stream.WriteByte(0); > >>> info = > >>>>>> Receive(); if(!Ok()) { throw new IOException(info); } } > >>>>>> > >>>>>> *What I want it to be:* > >>>>>> > >>>>>> > >>>>>> [image: Inline image 1] > >>>>>> This one is faster for my use case. Please do let me know how can > >>> this be > >>>>>> done? > >>>>>> > >>>>>> Regards, > >>>>>> N.D. > >>>>>> > >>>>>> [image.png] > >>>>>> > >>>>> > >>>> > >>> > >>> -- > >>> Dirk Kirsten, BaseX GmbH, http://basex.org > >>> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz > >>> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: > >>> | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle > >>> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 > >>> > >>> > >> > > >
--
Dirk Kirsten, BaseX GmbH, http://basex.org
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
ND
Nilanjan Dutta30 Sep 2014 07:48 #
Hmm...had it been a overload..this would have solved purpose for clients like me..who would care about performance more considering the fixed type of file.
However...I'd have this piece locally itself- which makes my life even easier.
Regards,
N.D.
Quoted text · Dirk Kirsten · 169 lines
On Mon, Sep 29, 2014 at 2:46 PM, Dirk Kirsten <dk at basex.org> wrote: > Hi Nilanjan, > > such a solution would almost certainly not be merged into the main branch > of BaseX. As Andy correctly points out, this would break the client for > many users, although you might not need it. > > However, for the general public and because the problem was faced quite a > few times the last couple of weeks I wrote a short tutorial how to > correctly submit a feature or bug report for BaseX using git. It can be > found at > http://docs.basex.org/wiki/Git#Developing_a_new_feature_or_bug_fix_using_git > > Cheers, > Dirk > > On 09/29/2014 11:03 AM, Nilanjan Dutta wrote: > > Yes indeed. Hence I wanted at least a 'overload'. > > Since i'm not dealing with a stream which would contain -in any case - > such > > char, I implemented the entire byte to go and sit in the network stream, > > which is faster than traversing each element in the incoming stream. > > > > Regards, > > N.D. > > > > On Mon, Sep 29, 2014 at 2:27 PM, Andy Bunce <bunce.andy at gmail.com> > wrote: > > > > > Hi Nilanjan, > > > It may be faster but surely your change misses the correct handling of > the > > > bytes 00 and FF? > > > > > >> if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert.ToByte(0xFF)); > > > > > > This is required for binary content and possibly some unicode > documents? > > > This may not be a problem for your use cases but it would be for > others. > > > /Andy > > > > > > > > > > > > On 29 September 2014 09:47, Nilanjan Dutta < > nilanjan.dutta.india at gmail.com > > >> wrote: > > > > > >> Thanks Dirk. > > >> > > >> GitHub is something new to me. Having a hard time raising a "pull > > >> request" as we talk. I'll get it right sometime soon may be . > Meanwhile > > >> I'll continue my version of the said method and use the dll. > > >> > > >> Regards, > > >> N.D. > > >> > > >> On Mon, Sep 29, 2014 at 2:13 PM, Dirk Kirsten <dk at basex.org> wrote: > > >> > > >>> Hi Nilanjan, > > >>> > > >>> BaseX is using the BSD license, which allows almost anything. You can > > >>> find the surprisingly short license in license.txt. Basically you > can do > > >>> anything except removing the copyright notice and the list of > contributors. > > >>> > > >>> As for all legal advice: IANAL (I am not a lawyer). If you want to > know > > >>> it for sure, you will have to ask a lawyer. > > >>> > > >>> Cheers, > > >>> Dirk > > >>> On 09/29/2014 10:26 AM, Nilanjan Dutta wrote: > > >>>> How about I change this code in my local dev environment and package > > >>> it ? > > >>>> Will that be legally OK? > > >>>> I'd do that git hub request in parallel though. > > >>>> > > >>>> Regards, > > >>>> N.D. > > >>>> > > >>>> On Mon, Sep 29, 2014 at 1:53 PM, Michael Seiferle <ms at basex.org> > > >>> wrote: > > >>>> > > >>>>> Hi N.D., > > >>>>> > > >>>>> feel free to send a pull request on GitHub [1,2]: > > >>>>> https://github.com/basexdb/basex > > >>>>> > > >>>>> This way we will be able to incorporate your patch into our > sources. > > >>>>> > > >>>>> Hope this helps and thanks for your contribution, > > >>>>> > > >>>>> Michael > > >>>>> > > >>>>> [1] https://help.github.com/articles/using-pull-requests > > >>>>> [2] > http://docs.basex.org/wiki/Git#Using_Git_to_contribute_to_BaseX > > >>>>> > > >>>>> > > >>>>> > > >>>>> On 29 Sep 2014, at 10:05, Nilanjan Dutta wrote: > > >>>>> > > >>>>> Hi All, > > >>>>>> > > >>>>>> I want to change/overload the implementation private void Send > > >>> (Stream s) > > >>>>>> method in the BaseXClient.cs file. [ > > >>>>>> basex <https://github.com/BaseXdb/basex> / basex-api > > >>>>>> <https://github.com/BaseXdb/basex/tree/master/basex-api> / src > > >>>>>> <https://github.com/BaseXdb/basex/tree/master/basex-api/src> / > main > > >>>>>> <https://github.com/BaseXdb/basex/tree/master/basex-api/src/main> > > >>> / c# > > >>>>>> < > > >>> https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23> > / > > >>>>>> *BaseXClient.cs*] > > >>>>>> > > >>>>>> *Existing implementation:* > > >>>>>> > > >>>>>> private void Send(Stream s) { while (true) { int t = s.ReadByte(); > > >>> if (t > > >>>>>> == > > >>>>>> -1) break; if (t == 0x00 || t == 0xFF) stream.WriteByte(Convert. > > >>>>>> ToByte(0xFF > > >>>>>> )); stream.WriteByte(Convert.ToByte(t)); } stream.WriteByte(0); > > >>> info = > > >>>>>> Receive(); if(!Ok()) { throw new IOException(info); } } > > >>>>>> > > >>>>>> *What I want it to be:* > > >>>>>> > > >>>>>> > > >>>>>> [image: Inline image 1] > > >>>>>> This one is faster for my use case. Please do let me know how can > > >>> this be > > >>>>>> done? > > >>>>>> > > >>>>>> Regards, > > >>>>>> N.D. > > >>>>>> > > >>>>>> [image.png] > > >>>>>> > > >>>>> > > >>>> > > >>> > > >>> -- > > >>> Dirk Kirsten, BaseX GmbH, http://basex.org > > >>> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz > > >>> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: > > >>> | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle > > >>> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 > > >>> > > >>> > > >> > > > > > > > -- > Dirk Kirsten, BaseX GmbH, http://basex.org > |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz > |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: > | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle > `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 > >
Written for BaseX 7.9. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery