Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- 6 participants
- 50351 messages
Re: [Pharo-users] ZnClient get then post?
by Paul DeBruicker
Hey Tim,
Your emails aren't getting posted to the users list, only the nabble forum.
Are you a subscriber? If not you should sign up as described here:
http://forum.world.st/mailing_list/MailingListOptions.jtp?forum=1310670
I know Sven (the Zinc package author) may have other or better ideas for how
to approach what you're attempting. There is also some oAuth stuff in this
repo:
http://smalltalkhub.com/#!/~JanVanDeSandt/Cloudfork
Good luck.
Paul.
Tim Mackinnon wrote
> That Charles app is pretty darn good - I can see some differences between
> a browser and Zn.
>
> The encoding of submitted form values is different (the browser seems to
> encode a / as %2F when it submits a field value?), there are also some
> cookies missing.
>
> Will check these difference out.
>
> Tim
>
> On 25 Jun 2014, at 15:35, Tim Mackinnon <
> tamackinnon@
> > wrote:
>
>> Hey Paul - I was following:
>> https://trello.com/docs/gettingstarted/index.html#token - where it shows
>> how to manually get a token. When you do an initial request like:
>> https://trello.com/1/authorize?key=substitutewithyourapplicationkey&name=My…
>>
>> It takes you to a page in your browser which has some hidden fields,
>> which you can then click on accept and its posts the form to the url
>> (/1/token/approve). You then get a text result showing your token.
>>
>> I thought this would be a simple way to get the credentials - as in just
>> do what the user does manually. However, I guess its not a simple as that
>> - and it may need OAuth, which I can see there are some Pharo classes
>> Sven did - so maybe I can investigate that (although its getting a bit
>> more complicated than I wanted).
>>
>> Tim
>>
>> p.s. Of course if I get it working, happy to share the secret sauce (Iâve
>> also spotted a few bugs in the new Pharo as well - so I should report
>> those too)
>>
>> On 25 Jun 2014, at 15:14, Paul DeBruicker [via Smalltalk] <
> ml-node+s1294792n4764722h62@.nabble
> > wrote:
>>
>>> Where in their docs do you see to use the /1/token/approve endpoint?
>>>
>>>
>>> I didn't see it in this list:
>>>
>>> https://trello.com/docs/api/index.html
>>>
>>> or in the discussion about user tokens
>>>
>>>
>>>
>>>
>>>
>>> also - when you get this working you'll post a MIT licensed version for
>>> everyone to use right? ;)
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Tim Mackinnon wrote
>>> Hi Paul - yes that ZnEasy call works fine - in my case I am trying to
>>> read some data from Trello.com and so you do an initial request with an
>>> application key and then you authorise an operation with some parameters
>>> to get back a token to use for private requests.
>>>
>>> The sequence I am using is this:
>>>
>>> | znc resp soup key sig |
>>>
>>> (znc := ZnClient new) logToTranscript.
>>>
>>> resp := znc
>>> url: 'https://trello.com/1/authorize';
>>> queryAt: 'scope' put: 'read';
>>> queryAt: 'expiration' put: '1day';
>>> queryAt: 'name' put: 'Pharo App';
>>> queryAt: 'response_type' put: 'token';
>>> queryAt: âkey' put: 'xxxxxxx1d588819825d57da6dad4dd';
>>> get;
>>> response.
>>>
>>> soup := (Soup fromString: resp entity).
>>> key := soup findTag: [ :e | (e name = 'input') and: [ (e attributeAt:
>>> 'name' ifAbsent: ['']) = 'requestKey' ]].
>>> sig := soup findTag: [ :e | (e name = 'input') and: [ (e attributeAt:
>>> 'name' ifAbsent: ['']) = 'signature' ]].
>>>
>>> Transcript cr; cr; show: (key attributeAt: 'value'); cr; show: (sig
>>> attributeAt: 'value'); cr; cr.
>>>
>>> resp := znc
>>> resetEntity;
>>> url: '/1/token/approve';
>>> formAt: 'approve' put: 'Allow';
>>> formAt: 'requestKey' put: (key attributeAt: 'value');
>>> formAt: 'signature' put: (sig attributeAt: 'value');
>>> post;
>>> response.
>>>
>>>
>>> If I look at the logging in the transcript - the first part works fine:
>>>
>>> 2014-06-25 14:50:37 042813 I Wrote a ZnRequest(GET
>>> /1/authorize?response_type=token&key=xxxxxxxxxx1d588819825d57da6dad4dd&scope=read&name=Pharo%20App&expiration=1day)
>>> 2014-06-25 14:50:37 042813 D Sent headers
>>> Accept: */*
>>> User-Agent: Zinc HTTP Components 1.0
>>> Host: trello.com
>>>
>>> 2014-06-25 14:50:37 042813 I Read a ZnResponse(200 OK
>>> text/html;charset=utf-8 2199B)
>>> â¦..
>>>
>>> Its the next bit of the log which is doing something weird - and showing
>>> a resource moved - so I wonder if the server is expecting something
>>> extra? The transcript is showing I have extracted my key and signature
>>> to populate my form and then I see the 302 status code?
>>>
>>> xxxxxx1bf70c02d829c9541f0c3c
>>> xxxxxx5437639/0f28401bf858e7f623c971a45b77291dc113988782
>>>
>>>
>>> 2014-06-25 14:50:37 042813 I Wrote a ZnRequest(POST /1/token/approve)
>>> 2014-06-25 14:50:37 042813 D Sent headers
>>> User-Agent: Zinc HTTP Components 1.0
>>> Content-Length: 146
>>> Host: trello.com
>>> Content-Type: application/x-www-form-urlencoded
>>> Accept: */*
>>>
>>> 2014-06-25 14:50:37 042813 I Read a ZnResponse(302 Moved Temporarily
>>> text/plain;charset=UTF-8 35B)
>>> 2014-06-25 14:50:37 042813 D Received headers
>>> X-Frame-Options: DENY
>>> Content-Length: 35
>>> Content-Type: text/plain; charset=UTF-8
>>> X-Powered-By: Express
>>> X-Content-Type-Options: nosniff
>>> Location: /
>>> Cache-Control: no-store, no-cache
>>> Strict-Transport-Security: max-age=15768000
>>> Date: Wed, 25 Jun 2014 13:50:37 GMT
>>> X-Xss-Protection: 1; mode=block
>>> Vary: Accept, Accept-Encoding
>>>
>>> 2014-06-25 14:50:37 042813 D Redirecting to https://trello.com:443/
>>> 2014-06-25 14:50:37 042813 I Wrote a ZnRequest(GET /)
>>> 2014-06-25 14:50:37 042813 D Sent headers
>>> User-Agent: Zinc HTTP Components 1.0
>>> Host: trello.com
>>> Accept: */*
>>>
>>> 2014-06-25 14:50:38 042813 I Read a ZnResponse(200 OK
>>> text/html;charset=utf-8 147886B)
>>> 2014-06-25 14:50:38 042813 D Received headers
>>> X-Frame-Options: DENY
>>> Content-Length: 147886
>>> Set-Cookie: sup=1; Path=/; Expires=Thu, 25 Jun 2015 13:50:37 GMT
>>> Content-Type: text/html; charset=utf-8
>>> X-Powered-By: Express
>>> Etag: "579547792"
>>> X-Content-Type-Options: nosniff
>>> Date: Wed, 25 Jun 2014 13:50:37 GMT
>>> Cache-Control: no-store, no-cache
>>> Strict-Transport-Security: max-age=15768000
>>> X-Xss-Protection: 1; mode=block
>>> Vary: Accept-Encoding
>>>
>>> 2014-06-25 14:50:38 042813 D Received cookie: sup=1; path=/;
>>> domain=trello.com; expires=Thu, 25 Jun 2015 13:50:37 GMT
>>> 2014-06-25 14:50:38 042813 D Received cookie: sup=1; path=/;
>>> domain=trello.com; expires=Thu, 25 Jun 2015 13:50:37 GMT
>>> 2014-06-25 14:50:38 042813 T GET / 200 147886B 1136ms
>>>
>>>
>>> I think Iâm a bit out of my depth on this, so maybe I might have to find
>>> a different way of doing things.
>>>
>>> I appreciate the help.
>>>
>>> Tim
>>>
>>> On 25 Jun 2014, at 14:41, Paul DeBruicker [via Smalltalk] <[hidden
>>> email]> wrote:
>>>
>>> > Are you able to get the contents of
>>> >
>>> > ZnEasy get: 'https://www.google.com'
>>> >
>>> >
>>> > ?
>>> >
>>> >
>>> >
>>> > If so then is not an SSL issue. If not you'll need to use charles
>>> proxy (http://www.charlesproxy.com/) or an equivalent to see the decoded
>>> https requests. Wireshark only has encrypted packets.
>>> >
>>> >
>>> > Are you doing the #resetEntity prior to setting the url or other
>>> parameters when doing your POST?
>>> >
>>> >
>>> >
>>> > Tim Mackinnon wrote
>>> > Actually looking at this a bit more - #resetEntity does do what you
>>> suggest (my mistake) - but I still have some problem, possibly related
>>> to https? Not sure whats going on as it looks like the post call is
>>> sending out what I think it should - but somehow the receiving server is
>>> not happy and is redirecting to â/â?
>>> >
>>> > Not really sure how to debug that - guess I might have to learn how to
>>> use wireshark.
>>> >
>>> > Tim
>>> >
>>> > On 25 Jun 2014, at 08:55, Tim Mackinnon <[hidden email]> wrote:
>>> >
>>> > > Hi Paul - thanks for your suggestions, #resetEntity doesn't seem to
>>> clear the parameters or have any effect (which I think makes sense given
>>> the name?).
>>> > >
>>> > > The get portion and decoding parameters is all working perfectly,
>>> it's the post that has me confused.
>>> > >
>>> > > If I inspect the request - it seems to be issuing to "/" - so it's
>>> like the URL: is not being honoured (and the response I get back is the
>>> contents of the / webpage).
>>> > >
>>> > > I think I'm confused about the interaction of URL:, and setting
>>> request and form params. From the docs, it wasn't obvious to me that
>>> ordering is important - but it seems that it is (I was expecting #post
>>> or #get to assemble everything when invoked - but I'm not sure it works
>>> like that).
>>> > >
>>> > > I guess I will have to debug through the code.
>>> > >
>>> > > Tim
>>> > >
>>> > > Sent from my iPhone
>>> > >
>>> > > On 25 Jun 2014, at 05:12, "Paul DeBruicker [via Smalltalk]" <[hidden
>>> email]> wrote:
>>> > >
>>> > >> Do your query parameters from the initial GET get cleared from the
>>> request before the POST? If you're not sure send the client
>>> #resetEntity.
>>> > >>
>>> > >>
>>> > >> Is the response of the GET correct & are the keys decoded properly?
>>> if not can you get a valid signature and request key from somewhere else
>>> (e.g. web ui, or ....) to test the POST?
>>> > >>
>>> > >>
>>> > >> Is it important to reuse the connection? IF not add the #beOneShot
>>> method to both and see if that helps as it does some resetting.
>>> > >>
>>> > >> The #post method is a convenience method that conjoins a send to
>>> #method: and #execute. You could separate them and use #method: at the
>>> top and #execute; before the #request line but I'd be surprised to learn
>>> that fixed things.
>>> > >>
>>> > >>
>>> > >> Good luck
>>> > >>
>>> > >> Paul
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >> Tim Mackinnon wrote
>>> > >> Hi I'm a bit confused about how to send a get request to a resource
>>> and then post a response to it? I seem to fail on the post part, as it
>>> seems that my query is not being well formeed - or something is not
>>> being cleared when I reuse the connection I used in the get. My code
>>> looks as follows (and I'm sure there is a simple mistake).
>>> > >>
>>> > >> It seems that in my post request, it doesn't formulate the post I
>>> expect - it shows a GET / msg, and as such my response doesn't give me
>>> the token I expect. If I move the "post" line up to the start, I seem
>>> to get a request header I expect, but still not the the result I expect.
>>> Can anyone offer any tips? Do I need to clear my Client in some way
>>> before the second post operation?
>>> > >>
>>> > >> Tim
>>> > >>
>>> > >> | znc resp |
>>> > >>
>>> > >> (znc := ZnClient new) logToTranscript.
>>> > >>
>>> > >> resp := znc
>>> > >> url: 'https://trello.com/1/authorize';
>>> > >> queryAt: 'scope' put: 'read';
>>> > >> queryAt: 'expiration' put: '1day';
>>> > >> queryAt: 'name' put: 'Pharo App';
>>> > >> "queryAt: 'response_type' put: 'token';"
>>> > >> queryAt: 'key' put: 'xxxxxx1d588819825d57da6dad4dd';
>>> > >> get;
>>> > >> request;
>>> > >> response.
>>> > >>
>>> > >> soup := (Soup fromString: resp entity).
>>> > >> sig := soup findTag: [ :e | (e name = 'input') and: [ (e
>>> attributeAt: 'name' ifAbsent: ['']) = 'signature' ]].
>>> > >> key := soup findTag: [ :e | (e name = 'input') and: [ (e
>>> attributeAt: 'name' ifAbsent: ['']) = 'requestKey' ]].
>>> > >>
>>> > >> resp := znc
>>> > >> url: 'https://trello.com/1/token/approve';
>>> > >> formAt: 'approve' put: 'Allow';
>>> > >> formAt: 'requestKey' put: (key attributeAt: 'value');
>>> > >> formAt: 'signature' put: (sig attributeAt: 'value');
>>> > >> post;
>>> > >> request;
>>> > >> response.
>>> > >>
>>> > >>
>>> > >> If you reply to this email, your message will be added to the
>>> discussion below:
>>> > >> http://forum.world.st/ZnClient-get-then-post-tp4764605p4764608.html
>>> > >> To unsubscribe from ZnClient get then post?, click here.
>>> > >> NAML
>>> >
>>> >
>>> > If you reply to this email, your message will be added to the
>>> discussion below:
>>> > http://forum.world.st/ZnClient-get-then-post-tp4764605p4764717.html
>>> > To unsubscribe from ZnClient get then post?, click here.
>>> > NAML
>>>
>>>
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>> http://forum.world.st/ZnClient-get-then-post-tp4764605p4764722.html
>>> To unsubscribe from ZnClient get then post?, click here.
>>> NAML
>>
--
View this message in context: http://forum.world.st/ZnClient-get-then-post-tp4764605p4764779.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
June 25, 2014
Programming Puzzles & Code Golf: What color is this?
by MartinW
Hi,
i entered a Pharo version to this Code Golf contest:
http://codegolf.stackexchange.com/a/32535/26615
"Given three number values - being the Red, Green, and Blue elements of a
colour (eight bits per channel, 0 to 255) - your program must output the
name of the given colour.â
My answer is:
| color colorNames nearestColorName |
color := Color r: 255 g: 0 b: 0.
colorNames := Color registeredColorNames.
nearestColorName := colorNames detectMin: [ :each | (Color named: each)
diff: color].
But, the results are of mixed quality. All darker colors are named as gray,
dark gray or very dark gray.
Is it my fault, the fault of Colorâs diff: method or the fault of the
available color names?
M.
--
View this message in context: http://forum.world.st/Programming-Puzzles-Code-Golf-What-color-is-this-tp47…
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
June 25, 2014
Re: [Pharo-users] A question about sets
by Alain Busser
About the birthday problem, I already pulished something that I had
exeperimented in the classroom, but it is in French:
http://irem.univ-reunion.fr/spip.php?article618 (clic on "problème des
anniversaires" tab). The idea is that if you add say 30 times a "365
atRandom" to a bag (instead of a set) it happens now and then that a number
appear more than once. In this classroom, two students actually had the
same birthday, and they were eager to know of it happens often, so that
they were very active for this exercise.
Happy reading ;-)
Alain
On Wed, Jun 25, 2014 at 12:10 PM, hilaire <hfern(a)free.fr> wrote:
> Alain,
>
> I love very much your cultural insight and I would like to see more
> examples
> like this one applied to Dr. Geo scripting or Smalltalk sketches.
> Personally, I don't have the time to both develop Dr. Geo *and* to
> investigate such examples; contributions like yours are more than welcome.
>
> Thanks
>
> Hilaire
>
>
>
> --
> View this message in context:
> http://forum.world.st/A-question-about-sets-tp4763094p4764640.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>
June 25, 2014
Re: [Pharo-users] [Tutorial] Rediscovering the UX of the legendary HP-35 Scientific Pocket Calculator
by Sven Van Caekenberghe
Apparently it already got posted on YC News
https://news.ycombinator.com/item?id=7943876
so it needs votes and comments to survive.
On 25 Jun 2014, at 15:29, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
> I have written a new, extensive, long form, introductory article about Pharo.
>
> Rediscovering the UX of the legendary HP-35 Scientific Pocket Calculator
>
> A tutorial on Pharo, test and specification based immersive programming
>
> https://medium.com/@svenvc/rediscovering-the-ux-of-the-legendary-hp-35-scie…
>
June 25, 2014
Re: [Pharo-users] ZnClient get then post?
by Paul DeBruicker
Where in their docs do you see to use the /1/token/approve endpoint?
I didn't see it in this list:
https://trello.com/docs/api/index.html
or in the discussion about user tokens
also - when you get this working you'll post a MIT licensed version for
everyone to use right? ;)
Tim Mackinnon wrote
> Hi Paul - yes that ZnEasy call works fine - in my case I am trying to read
> some data from Trello.com and so you do an initial request with an
> application key and then you authorise an operation with some parameters
> to get back a token to use for private requests.
>
> The sequence I am using is this:
>
> | znc resp soup key sig |
>
> (znc := ZnClient new) logToTranscript.
>
> resp := znc
> url: 'https://trello.com/1/authorize';
> queryAt: 'scope' put: 'read';
> queryAt: 'expiration' put: '1day';
> queryAt: 'name' put: 'Pharo App';
> queryAt: 'response_type' put: 'token';
> queryAt: âkey' put: 'xxxxxxx1d588819825d57da6dad4dd';
> get;
> response.
>
> soup := (Soup fromString: resp entity).
> key := soup findTag: [ :e | (e name = 'input') and: [ (e attributeAt:
> 'name' ifAbsent: ['']) = 'requestKey' ]].
> sig := soup findTag: [ :e | (e name = 'input') and: [ (e attributeAt:
> 'name' ifAbsent: ['']) = 'signature' ]].
>
> Transcript cr; cr; show: (key attributeAt: 'value'); cr; show: (sig
> attributeAt: 'value'); cr; cr.
>
> resp := znc
> resetEntity;
> url: '/1/token/approve';
> formAt: 'approve' put: 'Allow';
> formAt: 'requestKey' put: (key attributeAt: 'value');
> formAt: 'signature' put: (sig attributeAt: 'value');
> post;
> response.
>
>
> If I look at the logging in the transcript - the first part works fine:
>
> 2014-06-25 14:50:37 042813 I Wrote a ZnRequest(GET
> /1/authorize?response_type=token&key=xxxxxxxxxx1d588819825d57da6dad4dd&scope=read&name=Pharo%20App&expiration=1day)
> 2014-06-25 14:50:37 042813 D Sent headers
> Accept: */*
> User-Agent: Zinc HTTP Components 1.0
> Host: trello.com
>
> 2014-06-25 14:50:37 042813 I Read a ZnResponse(200 OK
> text/html;charset=utf-8 2199B)
> â¦..
>
> Its the next bit of the log which is doing something weird - and showing a
> resource moved - so I wonder if the server is expecting something extra?
> The transcript is showing I have extracted my key and signature to
> populate my form and then I see the 302 status code?
>
> xxxxxx1bf70c02d829c9541f0c3c
> xxxxxx5437639/0f28401bf858e7f623c971a45b77291dc113988782
>
>
> 2014-06-25 14:50:37 042813 I Wrote a ZnRequest(POST /1/token/approve)
> 2014-06-25 14:50:37 042813 D Sent headers
> User-Agent: Zinc HTTP Components 1.0
> Content-Length: 146
> Host: trello.com
> Content-Type: application/x-www-form-urlencoded
> Accept: */*
>
> 2014-06-25 14:50:37 042813 I Read a ZnResponse(302 Moved Temporarily
> text/plain;charset=UTF-8 35B)
> 2014-06-25 14:50:37 042813 D Received headers
> X-Frame-Options: DENY
> Content-Length: 35
> Content-Type: text/plain; charset=UTF-8
> X-Powered-By: Express
> X-Content-Type-Options: nosniff
> Location: /
> Cache-Control: no-store, no-cache
> Strict-Transport-Security: max-age=15768000
> Date: Wed, 25 Jun 2014 13:50:37 GMT
> X-Xss-Protection: 1; mode=block
> Vary: Accept, Accept-Encoding
>
> 2014-06-25 14:50:37 042813 D Redirecting to https://trello.com:443/
> 2014-06-25 14:50:37 042813 I Wrote a ZnRequest(GET /)
> 2014-06-25 14:50:37 042813 D Sent headers
> User-Agent: Zinc HTTP Components 1.0
> Host: trello.com
> Accept: */*
>
> 2014-06-25 14:50:38 042813 I Read a ZnResponse(200 OK
> text/html;charset=utf-8 147886B)
> 2014-06-25 14:50:38 042813 D Received headers
> X-Frame-Options: DENY
> Content-Length: 147886
> Set-Cookie: sup=1; Path=/; Expires=Thu, 25 Jun 2015 13:50:37 GMT
> Content-Type: text/html; charset=utf-8
> X-Powered-By: Express
> Etag: "579547792"
> X-Content-Type-Options: nosniff
> Date: Wed, 25 Jun 2014 13:50:37 GMT
> Cache-Control: no-store, no-cache
> Strict-Transport-Security: max-age=15768000
> X-Xss-Protection: 1; mode=block
> Vary: Accept-Encoding
>
> 2014-06-25 14:50:38 042813 D Received cookie: sup=1; path=/;
> domain=trello.com; expires=Thu, 25 Jun 2015 13:50:37 GMT
> 2014-06-25 14:50:38 042813 D Received cookie: sup=1; path=/;
> domain=trello.com; expires=Thu, 25 Jun 2015 13:50:37 GMT
> 2014-06-25 14:50:38 042813 T GET / 200 147886B 1136ms
>
>
> I think Iâm a bit out of my depth on this, so maybe I might have to find a
> different way of doing things.
>
> I appreciate the help.
>
> Tim
>
> On 25 Jun 2014, at 14:41, Paul DeBruicker [via Smalltalk] <
> ml-node+s1294792n4764717h7@.nabble
> > wrote:
>
>> Are you able to get the contents of
>>
>> ZnEasy get: 'https://www.google.com'
>>
>>
>> ?
>>
>>
>>
>> If so then is not an SSL issue. If not you'll need to use charles proxy
>> (http://www.charlesproxy.com/) or an equivalent to see the decoded https
>> requests. Wireshark only has encrypted packets.
>>
>>
>> Are you doing the #resetEntity prior to setting the url or other
>> parameters when doing your POST?
>>
>>
>>
>> Tim Mackinnon wrote
>> Actually looking at this a bit more - #resetEntity does do what you
>> suggest (my mistake) - but I still have some problem, possibly related to
>> https? Not sure whats going on as it looks like the post call is sending
>> out what I think it should - but somehow the receiving server is not
>> happy and is redirecting to â/â?
>>
>> Not really sure how to debug that - guess I might have to learn how to
>> use wireshark.
>>
>> Tim
>>
>> On 25 Jun 2014, at 08:55, Tim Mackinnon <[hidden email]> wrote:
>>
>> > Hi Paul - thanks for your suggestions, #resetEntity doesn't seem to
>> clear the parameters or have any effect (which I think makes sense given
>> the name?).
>> >
>> > The get portion and decoding parameters is all working perfectly, it's
>> the post that has me confused.
>> >
>> > If I inspect the request - it seems to be issuing to "/" - so it's like
>> the URL: is not being honoured (and the response I get back is the
>> contents of the / webpage).
>> >
>> > I think I'm confused about the interaction of URL:, and setting request
>> and form params. From the docs, it wasn't obvious to me that ordering is
>> important - but it seems that it is (I was expecting #post or #get to
>> assemble everything when invoked - but I'm not sure it works like that).
>> >
>> > I guess I will have to debug through the code.
>> >
>> > Tim
>> >
>> > Sent from my iPhone
>> >
>> > On 25 Jun 2014, at 05:12, "Paul DeBruicker [via Smalltalk]" <[hidden
>> email]> wrote:
>> >
>> >> Do your query parameters from the initial GET get cleared from the
>> request before the POST? If you're not sure send the client #resetEntity.
>> >>
>> >>
>> >> Is the response of the GET correct & are the keys decoded properly? if
>> not can you get a valid signature and request key from somewhere else
>> (e.g. web ui, or ....) to test the POST?
>> >>
>> >>
>> >> Is it important to reuse the connection? IF not add the #beOneShot
>> method to both and see if that helps as it does some resetting.
>> >>
>> >> The #post method is a convenience method that conjoins a send to
>> #method: and #execute. You could separate them and use #method: at the
>> top and #execute; before the #request line but I'd be surprised to learn
>> that fixed things.
>> >>
>> >>
>> >> Good luck
>> >>
>> >> Paul
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> Tim Mackinnon wrote
>> >> Hi I'm a bit confused about how to send a get request to a resource
>> and then post a response to it? I seem to fail on the post part, as it
>> seems that my query is not being well formeed - or something is not being
>> cleared when I reuse the connection I used in the get. My code looks as
>> follows (and I'm sure there is a simple mistake).
>> >>
>> >> It seems that in my post request, it doesn't formulate the post I
>> expect - it shows a GET / msg, and as such my response doesn't give me
>> the token I expect. If I move the "post" line up to the start, I seem to
>> get a request header I expect, but still not the the result I expect. Can
>> anyone offer any tips? Do I need to clear my Client in some way before
>> the second post operation?
>> >>
>> >> Tim
>> >>
>> >> | znc resp |
>> >>
>> >> (znc := ZnClient new) logToTranscript.
>> >>
>> >> resp := znc
>> >> url: 'https://trello.com/1/authorize';
>> >> queryAt: 'scope' put: 'read';
>> >> queryAt: 'expiration' put: '1day';
>> >> queryAt: 'name' put: 'Pharo App';
>> >> "queryAt: 'response_type' put: 'token';"
>> >> queryAt: 'key' put: 'xxxxxx1d588819825d57da6dad4dd';
>> >> get;
>> >> request;
>> >> response.
>> >>
>> >> soup := (Soup fromString: resp entity).
>> >> sig := soup findTag: [ :e | (e name = 'input') and: [ (e attributeAt:
>> 'name' ifAbsent: ['']) = 'signature' ]].
>> >> key := soup findTag: [ :e | (e name = 'input') and: [ (e attributeAt:
>> 'name' ifAbsent: ['']) = 'requestKey' ]].
>> >>
>> >> resp := znc
>> >> url: 'https://trello.com/1/token/approve';
>> >> formAt: 'approve' put: 'Allow';
>> >> formAt: 'requestKey' put: (key attributeAt: 'value');
>> >> formAt: 'signature' put: (sig attributeAt: 'value');
>> >> post;
>> >> request;
>> >> response.
>> >>
>> >>
>> >> If you reply to this email, your message will be added to the
>> discussion below:
>> >> http://forum.world.st/ZnClient-get-then-post-tp4764605p4764608.html
>> >> To unsubscribe from ZnClient get then post?, click here.
>> >> NAML
>>
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://forum.world.st/ZnClient-get-then-post-tp4764605p4764717.html
>> To unsubscribe from ZnClient get then post?, click here.
>> NAML
--
View this message in context: http://forum.world.st/ZnClient-get-then-post-tp4764605p4764722.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
June 25, 2014
Re: [Pharo-users] ZnClient get then post?
by Paul DeBruicker
Are you able to get the contents of
ZnEasy get: 'https://www.google.com'
?
If so then is not an SSL issue. If not you'll need to use charles proxy
(http://www.charlesproxy.com/) or an equivalent to see the decoded https
requests. Wireshark only has encrypted packets.
Are you doing the #resetEntity prior to setting the url or other parameters
when doing your POST?
Tim Mackinnon wrote
> Actually looking at this a bit more - #resetEntity does do what you
> suggest (my mistake) - but I still have some problem, possibly related to
> https? Not sure whats going on as it looks like the post call is sending
> out what I think it should - but somehow the receiving server is not happy
> and is redirecting to â/â?
>
> Not really sure how to debug that - guess I might have to learn how to use
> wireshark.
>
> Tim
>
> On 25 Jun 2014, at 08:55, Tim Mackinnon <
> tamackinnon@
> > wrote:
>
>> Hi Paul - thanks for your suggestions, #resetEntity doesn't seem to clear
>> the parameters or have any effect (which I think makes sense given the
>> name?).
>>
>> The get portion and decoding parameters is all working perfectly, it's
>> the post that has me confused.
>>
>> If I inspect the request - it seems to be issuing to "/" - so it's like
>> the URL: is not being honoured (and the response I get back is the
>> contents of the / webpage).
>>
>> I think I'm confused about the interaction of URL:, and setting request
>> and form params. From the docs, it wasn't obvious to me that ordering is
>> important - but it seems that it is (I was expecting #post or #get to
>> assemble everything when invoked - but I'm not sure it works like that).
>>
>> I guess I will have to debug through the code.
>>
>> Tim
>>
>> Sent from my iPhone
>>
>> On 25 Jun 2014, at 05:12, "Paul DeBruicker [via Smalltalk]" <
> ml-node+s1294792n4764608h28@.nabble
> > wrote:
>>
>>> Do your query parameters from the initial GET get cleared from the
>>> request before the POST? If you're not sure send the client
>>> #resetEntity.
>>>
>>>
>>> Is the response of the GET correct & are the keys decoded properly? if
>>> not can you get a valid signature and request key from somewhere else
>>> (e.g. web ui, or ....) to test the POST?
>>>
>>>
>>> Is it important to reuse the connection? IF not add the #beOneShot
>>> method to both and see if that helps as it does some resetting.
>>>
>>> The #post method is a convenience method that conjoins a send to
>>> #method: and #execute. You could separate them and use #method: at the
>>> top and #execute; before the #request line but I'd be surprised to learn
>>> that fixed things.
>>>
>>>
>>> Good luck
>>>
>>> Paul
>>>
>>>
>>>
>>>
>>>
>>> Tim Mackinnon wrote
>>> Hi I'm a bit confused about how to send a get request to a resource and
>>> then post a response to it? I seem to fail on the post part, as it seems
>>> that my query is not being well formeed - or something is not being
>>> cleared when I reuse the connection I used in the get. My code looks as
>>> follows (and I'm sure there is a simple mistake).
>>>
>>> It seems that in my post request, it doesn't formulate the post I expect
>>> - it shows a GET / msg, and as such my response doesn't give me the
>>> token I expect. If I move the "post" line up to the start, I seem to
>>> get a request header I expect, but still not the the result I expect.
>>> Can anyone offer any tips? Do I need to clear my Client in some way
>>> before the second post operation?
>>>
>>> Tim
>>>
>>> | znc resp |
>>>
>>> (znc := ZnClient new) logToTranscript.
>>>
>>> resp := znc
>>> url: 'https://trello.com/1/authorize';
>>> queryAt: 'scope' put: 'read';
>>> queryAt: 'expiration' put: '1day';
>>> queryAt: 'name' put: 'Pharo App';
>>> "queryAt: 'response_type' put: 'token';"
>>> queryAt: 'key' put: 'xxxxxx1d588819825d57da6dad4dd';
>>> get;
>>> request;
>>> response.
>>>
>>> soup := (Soup fromString: resp entity).
>>> sig := soup findTag: [ :e | (e name = 'input') and: [ (e attributeAt:
>>> 'name' ifAbsent: ['']) = 'signature' ]].
>>> key := soup findTag: [ :e | (e name = 'input') and: [ (e attributeAt:
>>> 'name' ifAbsent: ['']) = 'requestKey' ]].
>>>
>>> resp := znc
>>> url: 'https://trello.com/1/token/approve';
>>> formAt: 'approve' put: 'Allow';
>>> formAt: 'requestKey' put: (key attributeAt: 'value');
>>> formAt: 'signature' put: (sig attributeAt: 'value');
>>> post;
>>> request;
>>> response.
>>>
>>>
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>> http://forum.world.st/ZnClient-get-then-post-tp4764605p4764608.html
>>> To unsubscribe from ZnClient get then post?, click here.
>>> NAML
--
View this message in context: http://forum.world.st/ZnClient-get-then-post-tp4764605p4764717.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
June 25, 2014
[Tutorial] Rediscovering the UX of the legendary HP-35 Scientific Pocket Calculator
by Sven Van Caekenberghe
Hi,
I have written a new, extensive, long form, introductory article about Pharo.
Rediscovering the UX of the legendary HP-35 Scientific Pocket Calculator
A tutorial on Pharo, test and specification based immersive programming
https://medium.com/@svenvc/rediscovering-the-ux-of-the-legendary-hp-35-scie…
It is a bit different because
- it is based on a non-trivial example
- it uses a backdrop story unrelated to Pharo
- it uses several multimedia elements
- it is published on medium.com which is a general publishing platform
The appendix describes several ways you can get the code. I think building both a Spec and Seaside UI from the same specification as well as reusing functional tests in different contexts is cool. Anyway, I hope you enjoy it.
Sven
--
Sven Van Caekenberghe
Proudly supporting Pharo
http://pharo.org
http://association.pharo.org
http://consortium.pharo.org
June 25, 2014
[Tutorial] Rediscovering the UX of the legendary HP-35 Scientific Pocket Calculator
by Sven Van Caekenberghe
Hi,
I have written a new, extensive, long form, introductory article about Pharo.
Rediscovering the UX of the legendary HP-35 Scientific Pocket Calculator
A tutorial on Pharo, test and specification based immersive programming
https://medium.com/@svenvc/rediscovering-the-ux-of-the-legendary-hp-35-scie…
It is a bit different because
- it is based on a non-trivial example
- it uses a backdrop story unrelated to Pharo
- it uses several multimedia elements
- it is published on medium.com which is a general publishing platform
The appendix describes several ways you can get the code. I think building both a Spec and Seaside UI from the same specification as well as reusing functional tests in different contexts is cool. Anyway, I hope you enjoy it.
Sven
--
Sven Van Caekenberghe
Proudly supporting Pharo
http://pharo.org
http://association.pharo.org
http://consortium.pharo.org
June 25, 2014
numeric pad
by Pablo R. Digonzelli
Hi, how can i enable numeric pad in pharo?.
by defect it does not work i think.
TIA
Ing. Pablo Digonzelli
Software Solutions
IP-Solutiones SRL
Metrotec SRL
25 de Mayo 521
Email: pdigonzelli(a)softsargentina.com
pdigonzelli(a)gmail.com
Cel: 5493815982714
June 25, 2014
Re: [Pharo-users] Contextual menu
by phil@highoctane.be
In the Nautilus package
Phil
On Wed, Jun 25, 2014 at 12:36 PM, Mark Rizun <mrizun(a)gmail.com> wrote:
> One more question: where is the implementation of SystemBrowser?
>
>
> 2014-06-25 13:06 GMT+03:00 Mark Rizun <mrizun(a)gmail.com>:
>
>> Thanks. I just used Finder to search for pragmas: *worldMenu*,
>> *contextMenu* and just *Menu*.
>> Fortunately, I found a lot of useful results in it.
>>
>> Mark
>>
>>
>> 2014-06-25 12:40 GMT+03:00 Yuriy Tymchuk <yuriy.tymchuk(a)me.com>:
>>
>> Iâm not pro in this question, but you can take a look at the class
>>> comments of PragmaMenuBuilder and MenuRegistration. Methods that add items
>>> to world menu are annotated with <worldMenu> pragma.
>>>
>>> Uko
>>>
>>> On 25 Jun 2014, at 11:30, Mark Rizun <mrizun(a)gmail.com> wrote:
>>>
>>> > Hi,
>>> >
>>> > Can somebody tell me, where I can find an implementation of contextual
>>> menu.
>>> > In particular I'd like to know where I can find some kind of its
>>> initialization and adding items to this menu.
>>> >
>>> > Cheers,
>>> > Mark
>>>
>>>
>>>
>>
>
June 25, 2014