Monthly Archives: July 2018

Sharing some discussions

To give you a feel of the friendliness of the Pharo community, here is a part of a discussion:


Hi Offray,

> On 27 Jul 2018, at 12:39, Offray Vladimir Luna Cárdenas <offray.luna at mutabit.com> wrote:
> 
> Hi,
> 
> I was ready to show a friend the Pharo web capabilities with the
> classical "myString asUrl retrieveContents", but the friend gave me a
> url that contains non Latin characters[1] and then I got an
> ZnInvalidUTF8 error.
> 
> [1]
> http://www.bidchance.com/freesearch.do?&filetype=&channel=&currentpage=1&searchtype=zb&queryword=%BF%A6%CA%B2&displayStyle=&pstate=&field=&leftday=&province=&bidfile=&project=&heshi=&recommend=&field=&jing=&starttime=&endtime=&attachment=
> 
> How can I process web addresses in Pharo that contain non latin
> characters like the one in [1]?

I am on holiday, so I cannot go too deep into this, but AFAIU the URL is wrong (or it assumes a specific context with a non-standard encoding).

In a URL's query part, non-ASCII data is first UTF-8 encoded, then percent encoded (this is the modern way).

I don't read Chinese, so it is hard to infer much from the original site, but I am assuming the search is for '喀什', a city called Kashgar, https://en.wikipedia.org/wiki/Kashgar_(disambiguation).

The string in question can be written as (to avoid copy/paste problems):

  String with: 21888 asCharacter with: 20160 asCharacter.

The encoding in a URL has to be:

  ZnPercentEncoder new encode: (String with: 21888 asCharacter with: 20160 asCharacter).

This gives us for example the following URL:

  'https://www.google.com/search?q=%E5%96%80%E4%BB%80' asUrl.

Which parses OK and contains the correct encoded string (decoded in the URL object):

  'https://www.google.com/search?q=%E5%96%80%E4%BB%80' asUrl queryAt: #q.

If you copy/paste that URL in your browser it should resolve to stuff about Kashgar.

Obviously the website www.bidchance.com does something else (non-standard ?).

HTH,

Sven

> Thanks,
> 
> Offray
Advertisements

Cryptography on github

After several attempts to solve the Cryptography package problems over the years I decided to move it on my own to github.

What I did:

- researched all authors and used the git migration tool to get the package from smalltalkhub to github 
- released a version 0.1 that should be exactly the same as the code on smalltalkhub for people that want to change
- fixed an occurrence of IfNotNilDo: in the Cryptography package to make it load in pharo7
- added a metacello baseline
- added a group „all" that loads everything like it is now with one package
- added travis files and enable travis checks for pull requests
- released a version 0.2 that contains the original code plus travis and metacello
- Started to cut off the ASN1, PKCS12 and X509 classes in separate packages
- Added to each new package a -Tests package containing tests
- constructed all dependencies in the baseline
- added a core group that loads the now slimmed down package solely

I must say this was really great with the help of promote-demote package tag functionality and the dependency browser. The only thing missing is kind of a tool to construct the metacello baseline. I miss Versionner here.

What I didn’t do:

- checking all the other packages in the repo. There are packages with old style ffi calls and things that seem to be squeak dependent.

I hope with the time and people’s complaints we can figure out what is obsolete and what needs to be adjusted.

The repository is now at

https://github.com/zweidenker/Cryptography <https://github.com/zweidenker/Cryptography>

but I’m happy to move it to a better place if someone has an idea. 

Pull requests and tickets are welcome.

Hope you like it,

Norbert

New success story: LawTracker

Here is a new success story around Pharo.

http://pharo.org/success/LawTracker

Do not hesitate to send to us your success stories.

About dynabook and DrGeo

Hi,

The Dynabook concept and Dr. Geo share some values.

Here is how http://blog.drgeo.eu/post/2018/The-Dynabook-Concept

Hilaire

Thermite

Hello,

I am finally releasing an initial public version of Pharo Git Thermite, a tool that I am developing as part of my master thesis for visualizing Monticello and Git commits, for Pharo and Python:

GitHub Page with sources/documentation/issue tracker:
https://github.com/ronsaldo/pharo-git-thermite

Short video examples:
- Monticello Visualization; https://youtu.be/02CUHBmm-K8
- GitHub pull request: https://youtu.be/f196btLfYxM
- Local git commit: https://youtu.be/LCHTiJ4nx3g

Feedback form:
https://docs.google.com/forms/d/e/1FAIpQLSeir6VlE3bR78oRsNAp9eHLkUn2Q016wEliOJN7tFlTmYFi8w/viewform?usp=sf_link

Best regards,
Ronie

Google API

I created a new repo at https://github.com/seandenigris/St-Google-API since the original repo is self-hosted, I don’t know what the contribution policy is, and I need the fix to continue my work. I’ll keep the MC meta info so that my changes can be merged back if desired.

Fun fact. I was able to send a multipart text & html email after a few gotchas. Here is the script in case someone wants to do the same:
| api message raw |
api := GoogleGmailApiUsersMessages new.
api authenticate.
message := MailMessage
from: ‘”Mr. Sender” <me@myurl.com>’
to: { ‘”Mrs. Receiver” <me@anotherurl.com>’. }
about: ‘Thank you!’
asFollows: ”.
message
addAlternativePart: self plainTextString contentType: ‘text/plain’;
addAlternativePart: self htmlString
contentType: ‘text/html’.
raw := message asSendableText base64Encoded.
“Web-safe base64 from https://stackoverflow.com/questions/26663529/invalid-value-for-bytestring-error-when-calling-gmail-send-api-with-base64-encod
raw := raw copyReplaceAll: ‘+’ with: ‘-‘.
raw := raw copyReplaceAll: ‘/’ with: ‘_’.
api send: ‘me@myurl.com’ api options: (Dictionary with: ‘raw’ -> raw)

where #send:options: is just the generated #send: with an argument passed through (instead of nil) as the last argument to:

^ self makeRequestTo: path usingMethod: action with: optionsDict.

[ANN] New Academic Partner: University of Yaoundé 1

The Pharo Consortium is very happy to announce that University of Yaoundé 1 has joined as a Academic Partner.

About
- University of Yaoundé 1: http://www.uy1.uninet.cm
- Pharo Consortium: http://consortium.pharo.org

The goal of the Pharo Consortium is to allow companies and institutions to
support the ongoing development and future of Pharo.

Individuals can support Pharo via the Pharo Association:

http://association.pharo.org

[ANN] New Academic Partner: SQLab

The Pharo Consortium is very happy to announce that SQLab has joined as a Academic Partner.

About
- Software Quality Laboratory, Part of University of Novi Sad: https://sqlab.pmf.uns.ac.rs
- Pharo Consortium: http://consortium.pharo.org

The goal of the Pharo Consortium is to allow companies and institutions to
support the ongoing development and future of Pharo.

Individuals can support Pharo via the Pharo Association:

 http://association.pharo.org