Re: [Pharo-users] Base64 encoding + UTF8 ?

2014-06-12 Thread Henrik Johansen

On 11 Jun 2014, at 10:28 , Sven Van Caekenberghe  wrote:

> Bonsoir François,
> 
> From the class comment of ZnBase64Encoder:
> 
> [...]
> Note that to encode a String as Base64, you first have to encode the 
> characters as bytes using a character encoder.
> [...]
> 
> Sending #asByteArray to a String is the same as doing no encoding (or doing 
> null encoding).
> 
> Consider:
> 
> ZnBase64Encoder new encode: (ZnUTF8Encoder new encodeString: 
> 'tamèreenslipdeguerre'). 
> 
> => 'dGFtw6hyZWVuc2xpcGRlZ3VlcnJl'
> 
> ZnBase64Encoder new encode: (ZnByteEncoder iso88591 encodeString: 
> 'tamèreenslipdeguerre'). 
> 
> => 'dGFt6HJlZW5zbGlwZGVndWVycmU='
> 
> ZnBase64Encoder new encode: (ZnNullEncoder new encodeString: 
> 'tamèreenslipdeguerre'). 
> 
> => 'dGFt6HJlZW5zbGlwZGVndWVycmU='
> 
> The last two are often the same, and thus equivalent to #asByteArray, but not 
> always.
> 
> HTH,
> 
> Sven

In other words, Base64 isn’t really an encoding, it’s a transfer format, whose 
purpose is to only transmit bytes with "safe" values that have no chance of 
being interpreted as control sequences by a set of protocols.

Encoding Strings -> Bytes is a separate concern.

Cheers,
Henry


signature.asc
Description: Message signed with OpenPGP using GPGMail


[Pharo-users] [ANN] Base62/Base36

2014-06-12 Thread Norbert Hartl
Just for the record. I’ve uploaded a package to smalltalkhub that contains util 
classes to en-/decode values into/from Base62/Base36.

Base62/Base36 encode numbers in short strings. These are used e.g. by url 
shortener services from google, bit.ly etc. 

Base36 uses lowercase letters and numbers to encode, Base62 uses all characters 
from Base36 plus all uppercase letters. Base62 produces smaller strings while 
Base36 produces case insensitive ones.

Example: 

Base62 fromNumber: 10 -> 'q0U‘ 

Base36 fromNumber: 10 -> ‚255s'

FYI,

Norbert




Re: [Pharo-users] [Pharo-dev] [ANN] Base62/Base36

2014-06-12 Thread Norbert Hartl
Hmm *cough*

http://smalltalkhub.com/#!/~NorbertHartl/Base62


Norbert

Am 12.06.2014 um 13:12 schrieb Norbert Hartl :

> Just for the record. I’ve uploaded a package to smalltalkhub that contains 
> util classes to en-/decode values into/from Base62/Base36.
> 
> Base62/Base36 encode numbers in short strings. These are used e.g. by url 
> shortener services from google, bit.ly etc. 
> 
> Base36 uses lowercase letters and numbers to encode, Base62 uses all 
> characters from Base36 plus all uppercase letters. Base62 produces smaller 
> strings while Base36 produces case insensitive ones.
> 
> Example: 
> 
> Base62 fromNumber: 10 -> 'q0U‘ 
> 
> Base36 fromNumber: 10 -> ‚255s'
> 
> FYI,
> 
> Norbert
> 
> 



Re: [Pharo-users] Gradualtalk

2014-06-12 Thread Bob Williams
Johan

Thank you for pointing me to the VM download on the Pharo site, that worked
after I changed Pharo.exe to Gradualtalk.exe. Is there a more thorough
reference than the quick reference (I have the paper Gradual Typing For
Smalltalk)? I noticed that Magnitude, Number and Integer have uses:TTyped.
The quick reference stated that the class and it subclasses would have the
type system activated, so are the last two required or is the reference in
error?

Will this typing be incorporated into Pharo or is it dead?

Thanks

bw



--
View this message in context: 
http://forum.world.st/Gradualtalk-tp4762633p4762831.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Emails

2014-06-12 Thread Bob Williams
Bernat

Thanks, that's the one. It is now Bookmarked.

bw



--
View this message in context: 
http://forum.world.st/Emails-tp4762288p4762833.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Gradualtalk

2014-06-12 Thread Johan Fabry
Hi Bob,

AFAIK it’s not required for the subclasses to use TTyped as well. If that does 
not work in your case do tell us, that means there’s a bug somewhere.

Gradualtalk, as is, is a research prototype and not ready for production at 
all. We are doing experiments with GT, but it would take a considerable effort 
to have it ready for daily use in ‘real life’ situations. Sadly we do not have 
such resources at our disposal. :-(

On Jun 12, 2014, at 12:50 PM, Bob Williams  wrote:

> Johan
> 
> Thank you for pointing me to the VM download on the Pharo site, that worked
> after I changed Pharo.exe to Gradualtalk.exe. Is there a more thorough
> reference than the quick reference (I have the paper Gradual Typing For
> Smalltalk)? I noticed that Magnitude, Number and Integer have uses:TTyped.
> The quick reference stated that the class and it subclasses would have the
> type system activated, so are the last two required or is the reference in
> error?
> 
> Will this typing be incorporated into Pharo or is it dead?
> 
> Thanks
> 
> bw
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/Gradualtalk-tp4762633p4762831.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 
> 



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile




[Pharo-users] Roassal forms+edges

2014-06-12 Thread rosariosm
Hi,

I'm trying to do a visualization that shows a group of twitter users
connected to each other. It shows the images from the users but when i add
the edges, the images dissapear. 

Here's the code:

view := RTView new.
e1 := RTElement on: user1.
e2 := RTElement on: user2.

elements := OrderedCollection newFrom: {e1. e2}.

elements do: [ :e | 
| label shape form edge |
label := RTLabel new text: e1 model name. 
 form := Form fromFileNamed: 'aFilename'.
shape := RTBitmap new form: form.   
e + (RTVerticalCompositeShape new shape1: shape; shape2: label) ].


line := RTArrow new color: Color red.
view add: (line edgeFrom: e1 to: e2 ).

view addAll: elements.
view open.



View without edges   
View with edges   




Anyone know how to fix this (show both images and edges)??

Thanks,
Rosario


 
 



--
View this message in context: 
http://forum.world.st/Roassal-forms-edges-tp4762851.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Coding by sending messages

2014-06-12 Thread Tudor Girba
Hi Matthew,

Is this an ongoing project? If yes, I would be interested in learning more
about your effort and see if there are no synergies with the work on
GToolkit.

Doru


On Wed, Jun 11, 2014 at 11:31 AM, Matthew Chadwick 
wrote:

> hello,
>
> It's interesting that in Smalltalk, coding is still done via a text
> editor, not by sending messages to objects (except in the background,
> parsing & compiling etc). I've been playing with coding by messaging nodes
> in the AST with a view to coding this way via Roassal graph visualizations
> of object dependencies combined with some nice graphical tools. Has any
> work on this way of coding been done before ? What I have in mind is a
> keyboard-centric, fast system designed as an alternative to the text
> editor, with a focus on top-down style coding.
>



-- 
www.tudorgirba.com

"Every thing has its own flow"