Re: [Pharo-users] How to calculate someone's age elegantly? Does Duration work?

2017-07-20 Thread K K Subbu
Date>>ageOn: aDate " assert: (self <= aDate) | age | age = aDate year - self year + 1. aDate monthIndex < self monthIndex ifTrue: [ ^age - 1 ]. (aDate monthIndex = self monthIndex and: [aDate dayOfMonth < self dayOfMonth]) ifTrue: [ ^age - 1 ]. ^age HTH .. Subbu On Friday 21 July 2017 05:28 A

Re: [Pharo-users] How to calculate someone's age elegantly? Does Duration work?

2017-07-20 Thread Tim Mackinnon
Hmmm to compound my woes ) I notice that Timespan is broken - as the following fails: testEndDateIsPreserved | startDate endDate | startDate := Date year: 2000 month: 2 day: 28. endDate := Date year: 2011 month: 2 day: 27. self assert: (Timespan starting: startDa

[Pharo-users] How to calculate someone's age elegantly? Does Duration work?

2017-07-20 Thread Tim Mackinnon
Hi - I just ran a great MobProgramming session with Smalltalk for the XProLo group - and there was lots of great feedback and questions, however one of them really got me thinking… We did a little exercise to create a Person class with name, dob - and then we TDD’d an age method… which seems si

Re: [Pharo-users] Zinc newbie question: How to get file metadata from Dropbox

2017-07-20 Thread jb
Sven Van Caekenberghe-2 wrote >> On 20 Jul 2017, at 19:57, Johannes Brauer < > brauer@ > > wrote: >> >> Hi! >> >> To download a file from Dropbox is easy: >> >> ZnClient new >> https; host: 'content.dropboxapi.com'; >> addPath: '2'; addPath: 'files'; addPath: 'download'; >> headerAt: 'Autho

Re: [Pharo-users] Zinc newbie question: How to get file metadata from Dropbox

2017-07-20 Thread Sven Van Caekenberghe
> On 20 Jul 2017, at 19:57, Johannes Brauer wrote: > > Hi! > > To download a file from Dropbox is easy: > > ZnClient new > https; host: 'content.dropboxapi.com'; > addPath: '2'; addPath: 'files'; addPath: 'download'; > headerAt: 'Authorization' put: > 'Bearer '; > headerAt: 'Dropbox-API

[Pharo-users] Zinc newbie question: How to get file metadata from Dropbox

2017-07-20 Thread Johannes Brauer
Hi! To download a file from Dropbox is easy: ZnClient new https; host: 'content.dropboxapi.com'; addPath: '2'; addPath: 'files'; addPath: 'download'; headerAt: 'Authorization' put: 'Bearer '; headerAt: 'Dropbox-API-Arg' put: '{"path": "/demo.txt"}' ;get. But I cannot figure out how t

Re: [Pharo-users] object serialization, STON & PharoJS

2017-07-20 Thread Sven Van Caekenberghe
> On 20 Jul 2017, at 12:08, Diego Lont wrote: > > Hi, > > What I remember of STON is that it simply puts out the entire tree. So it > might include things you don’t want (like thisContext), and also does not > handle loops well. But that is from memory, I might be wrong there. Hmm, I think y

Re: [Pharo-users] object serialization, STON & PharoJS

2017-07-20 Thread Sven Van Caekenberghe
> On 16 Jul 2017, at 21:00, Siemen Baader wrote: > > Hi all, > > I’m trying to transpile the STON class to JavaScript with PharoJS to use it > in a client side web application. The goal is it to retrieve object(graphs) > from the server and deserialize them in the frontend via xhr. > > But

Re: [Pharo-users] object serialization, STON & PharoJS

2017-07-20 Thread Diego Lont
Hi, What I remember of STON is that it simply puts out the entire tree. So it might include things you don’t want (like thisContext), and also does not handle loops well. But that is from memory, I might be wrong there. For serialisation you could also look into the Magritte serialisation. It h

Re: [Pharo-users] Can anyone answer this?

2017-07-20 Thread Tim Mackinnon
It would be nice if the JPMorgan folks could comment on this one (their system is now 20 years old I think, its huge, has had large numbers of people successfully working on it - concurrently) and I know they did leverage live coding ability particularly in error scenarios however there is a cav

Re: [Pharo-users] Can anyone answer this?

2017-07-20 Thread Dimitris Chloupis
I agree The stupidity of opposing live coding is that they only language that a computer can execute , machine code, is a live coding language. Live coding is extremely essential for machine coding and it does this through several way , using pointer registers to control flow of execution giving a