[Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Hello I have a problem with text storage, to which I seem to have found a solution, but it's a bit clumsy-looking. I would be grateful for confirmation that (a) there is no neater solution, (b) I can rely on this to work - I only know that it works in a few test cases. I need to store a lar

[Pharo-users] Antlr4 + SmaCC

2019-10-03 Thread Santiago Bragagnolo
Hi there! I am trying to build a parser for visual basic. For doing so i found the Antlr definition of VB on the microsoft site. I was wondering if it would be possible to use SmaCC for generating this parser. Does any have experience in adapting Antlr4 grammars to the SmaCC format ?? Or any clue

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
Hi Peter, About #zipped / #unzipped and the inflate / deflate classes: your observation is correct, these work from string to string, while clearly the compressed representation should be binary. The contents (input, what is inside the compressed data) can be anything, it is not necessarily a

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Tomohiro Oda
Peter and Sven, zip API from string to string works fine except that aWideString zipped generates malformed zip string. I think it might be a good guidance to define String>>zippedWithEncoding: and ByteArray>>unzippedWithEncoding: . Such as String>>zippedWithEncoding: encoder zippedWithEncoding: e

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Hi Sven The DB system I am using at the moment is OmniBase - despite Todd Blanchard's warning, I have decided to experiment with it. It has the advantage of being fully object based, though I am not yet using anything more elaborate than strings, dictionaries and arrays as the data types. One s

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
Hi Tomo, Indeed, I stand corrected, it does indeed seem possible to use the existing gzip classes to work from bytes to bytes, this works fine: data := ByteArray streamContents: [ :out | (GZipWriteStream on: out) nextPutAll: 'foo 10 €' utf8Encoded; close ]. (GZipReadStream on: data) upToEnd ut

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
Actually, thinking about this a bit more, why not add #zipped #unzipped to ByteArray ? ByteArray>>#zipped "Return a GZIP compressed version of the receiver as a ByteArray" ^ ByteArray streamContents: [ :out | (GZipWriteStream on: out) nextPutAll: self; close ] ByteArray>>#unzipped

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Tomohiro Oda
Sven, Yes, ByteArray>>zipped/unzipped are simple, neat and intuitive way of zipping/unzipping binary data. I also love the new idioms. They look clean and concise. Best Regards, --- tomo 2019年10月3日(木) 20:14 Sven Van Caekenberghe : > > Actually, thinking about this a bit more, why not add #zipped

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Sven, Tomo Thanks for this discussion. I shall bear in mind Sven's proposed extension to ByteArray - this is exactly the sort of neater solution I was hoping for. Any chance this might make it into standard Pharo (perhaps inP8)? Peter Kenny -Original Message- From: Pharo-users On Beha

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
https://github.com/pharo-project/pharo/issues/4806 PR will follow > On 3 Oct 2019, at 13:49, PBKResearch wrote: > > Sven, Tomo > > Thanks for this discussion. I shall bear in mind Sven's proposed extension to > ByteArray - this is exactly the sort of neater solution I was hoping for. Any > c

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
https://github.com/pharo-project/pharo/pull/4812 > On 3 Oct 2019, at 14:05, Sven Van Caekenberghe wrote: > > https://github.com/pharo-project/pharo/issues/4806 > > PR will follow > >> On 3 Oct 2019, at 13:49, PBKResearch wrote: >> >> Sven, Tomo >> >> Thanks for this discussion. I shall bear

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Thanks Sven. Just 5 hours from when I raised the question, there is a solution in place for everyone. This group is amazing! -Original Message- From: Pharo-users On Behalf Of Sven Van Caekenberghe Sent: 03 October 2019 15:28 To: Any question about pharo is welcome Subject: Re: [Pharo-u

[Pharo-users] [ANN] HeySql - a mini db-orm for Postgres

2019-10-03 Thread Petter Egesund
Hi, nice to meet you all :) As my first Smalltalk attempt I have written a mini orm for Postgres, based on the P3-library. Some features: - Closely connected to sql - Easy to use - Runtime compiled methods based on server side statements - Generated methods for insert, update on method objects -

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sean P. DeNigris
Peter Kenny wrote > Just 5 hours from when I raised the question, there is a solution in place > for everyone. This group is amazing! Indeed. Bravo, Sven and all of our other contributors. I can't resist mentioning that the fix would almost certainly have taken significantly longer a few years a

Re: [Pharo-users] [ANN] HeySql - a mini db-orm for Postgres

2019-10-03 Thread Sean P. DeNigris
Petter Egesund wrote > Hi, nice to meet you all :) Code submission is a wonderful way to meet ha ha. Thanks! - Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
> On 3 Oct 2019, at 18:25, Sean P. DeNigris wrote: > > Peter Kenny wrote >> Just 5 hours from when I raised the question, there is a solution in place >> for everyone. This group is amazing! > > Indeed. Bravo, Sven and all of our other contributors. Thanks, but I must say that it was Tomo's

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Richard O'Keefe
The interface should surely be SomeClass methods for: 'compression' zipped "return a byte array" class methods for: 'decompression' unzip: aByteArray "return an instance of SomeClass"

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Richard I don't think so. The case being considered for my problem is the compression of a ByteArray produced by applying #utf8Encoded to a WideString, but it extends to any other form of ByteArray. If you substitute ByteArray for SomeClass in your examples, I think you will see why the chosen

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Richard O'Keefe
Here's how it would look in my library: compressed := original zipped. "There is currently one definition, in AbstractStringOrByteArray, covering [ReadOnly]ByteArray, [ReadOnly]String and its many subclasses, ByteBuffer,StringBuffer, Substring, [ReadOnly]ShortArray, [ReadOnly]Mapped