Hello,
As a challenge I had to write some code that makes ranks from a
competition.
Im still busy trying to find out how to model this problem.
Right now I have made the code I included and I wonder how I can improve
this code before I go on with this way.
Roelof
Object subclass: #Team
Op 16-3-2019 om 22:24 schreef Sven Van Caekenberghe:
imageUrl1 := levelsJson detect: [ :item | item name = 'z4' ].
imageUrl := imageUrl1 tiles first url.
Thanks
I used NeoJsonReader. After chancing it to NeoJsonObject It worked.
I think I can do the same here :
json := NeoJSONReader
Op 16-3-2019 om 18:16 schreef Sven Van
Caekenberghe:
imageUrl1 := levelsJson detect: [ :item | item name = 'z4' ].
imageUrl := imageUrl1 tiles first url.
nope,
when I do this I see this error messsage :
:
On Sat, 16 Mar 2019 at
23:29, Roelof Wobben <r.wob...@home.nl> wrote:
oke,
how do I then get the url of the line where th
Op 16-3-2019 om 16:24 schreef Ben Coman:
On Sat, 16 Mar 2019 at
17:05, Roelof Wobben <r.wob...@home.nl> wrote:
Hello,
I try to parse a json that differs some times
after parsing with neojson I see something like this
"an Array(a Dictionary('height'->3640 'name'->'z0' 'tiles'->an Array(a
Hello,
I wonder if I can add a custom class to a material design card so I can
have a image on the left or a image on the top based on the dimisions of
the image.
Roelof
Op 11-3-2019 om 00:03 schreef Ben
Coman:
getMoreData "or a better name of your own"
| url json artObjectJson |
url := 'https://www.rijksmuseum.nl/api/nl/collection/'
, objectNumber , '?key=[API_KEY]=json'
Op 12-3-2019 om 18:46 schreef Ben
Coman:
On Wed, 13 Mar 2019 at 00:43, Roelof
Wobben <r.wob...@home.nl>
Op 11-3-2019 om 00:03 schreef Ben
Coman:
On Mon, 11 Mar 2019 at
01:09, Roelof Wobben <r.wob...@home.nl>
Op 11-3-2019 om 00:03 schreef Ben Coman:
collectionUrl :=
'https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak=json=schilderij=True'.
json := NeoJSONReader fromString: (ZnEasy get: collectionUrl)
contents.
paintings := Paintings fromJSON: json.
Thanks a lot , Ben
I almost
Op 10-3-2019 om 17:45 schreef Ben
Coman:
On Sun, 10 Mar 2019 at
23:40, Roelof Wobben <r.wob...@home.nl>
2019 at
17:55, Roelof Wobben
<r.wob...@home.nl>
fromJson2 or
fromJSONFromLink2 ?
Op 10-3-2019 om 10:25 schreef Roelof Wobben:
Op 10-3-2019 om 02:13 schreef Ben
Coman:
On Sun, 10 Mar 2019
Op 10-3-2019 om 02:13 schreef Ben
Coman:
On Sun, 10 Mar 2019 at
04:55, Roelof Wobben <r.wob...@home.nl> wrote:
Hello,
I try to make a app which displays images from a external api .
I was hoping I could do it with only 1 json parsing but to get the
right size of images I need more then 1
Right now I have two classes with fromJson methods
Painting class
On Sat, 9 Mar 2019 at
21:09, Roelof Wobben <r.wob...@home.nl>
wrote:
Of
course.
Here are the links :
s -ben
On Sat, 9 Mar 2019
at 18:55, Roelof Wobben <r.wob...@home.nl>
wrote:
Hello,
When starting up the launcher on Windows 10 I see a crash.
A dmp file is included.
Roelof
-
Mon Feb 25 12:52:40 2019
Exception code: C005
Exception addr: 65942944
Access violation (read access) at 0133C05C
Op 2-3-2019 om 19:36 schreef Esteban Maringolo:
renderContentOn: html
html render: header
html mdlLayoutContainer: [ self renderPageContentOn: html ]
Are you sure.
If I do your changes I see these error messages
renderContentOn: html
html mdlLayout
beFixedHeader;
with:
*The problem is that I do not see the text "Blog post here" under my
header.
I use Pharo version 7 on Windows 10, Seaside latest and MDL latest.
I hope someone can help me figure out why this happen and how to solve this
Regards,
Roelof Wobben
I succeeded in doing it this way
1) make on the root of the disk a seperate directory for example
c:/repo
2) on the settings goto tools -> software configuration
management -> iceberg and check share repo and point it to the
repo you made on
Thanks,
How do I know the next time if I need to use a instance or a class method ?
That was the trick.
Roelof
Op 25-2-2019 om 22:05 schreef Sven Van Caekenberghe:
json := (NeoJSONReader fromString: (ZnEasy get:
Hello,
I try to ask a api for some data and then display the data I want.
But when I do :
json := (NeoJSONReader fromString: (ZnEasy get: 'https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak=json=schilderij=True') contents).
Paintings new
Hello,
I have ask this before on the discord channels but I cannot find
there the solutions anymore.
I try to make a website that displays the paintings of the
Rijksmuseaum in Amsterdam.
That provides a json response
So I do :
| json
--- Begin Message ---
Op 30-12-2018 om 02:14 schreef Ben
Coman:
'abcdefg' asArray overlappingPairsRemainderCollect: [ :a :b :rem
| { a.b.rem } ]
Sorry, I do not see how this can work so I can find the answer
qjhvhtzxzqqjkmpb is nice
:
On Sun, 30 Dec 2018 at 00:29,
Roelof
Op 29-12-2018 om 21:05 schreef Hernán Morales Durand via Pharo-users:
Thanks,
I will look at these but I think there are too advanced for Aoc
challenges but maybe I see a way to solve it more easily
Hello,
Still working on AdventOfCode
Im struggeling to see how this can be solved.
Now, a nice string is one with all of the following properties:
It contains a pair of any two letters that appears at least
twice in the string without
findFirst: [:each |
each = $(
ifTrue: [floor := floor + 1]. "up"
each = $)
ifTrue: [floor := floor - 1]. "down"
floor = -1
"basement"]
On Tue, 18
hello
I have this code
hasReachedBasement: aFloor
"comment stating purpose of message"
^ aFloor = -1
initialize
"comment stating purpose of message"
super initialize.
position := 1.
floor := 0
moveFloorDown: aFloor
"comment stating purpose of message"
^
com>
wrote:
On Mon, 17 Dec 2018 at 03:25, Roelof Wobben
<r.wob...@home.nl> wrote:
Hello
Are there more people who cannot in
Hello
Are there more people who cannot install voyage on Windows
I see a message that the name is
too long
where pharo works on the root
Regards,
Roelof
Op 16-12-2018 om 12:34 schreef Ben
Coman:
On Sun, 16 Dec 2018 at 02:37, Roelof
Wobben <r.wob...@home
elf
assert: (FindNiceStrings new isNice: testData) equals:
#('ugknbfddgicrmopn' 'aaa’)
Regards,
Nic
On 15 Dec 2018, at 19:36, Roelof Wobben <
Op 15-12-2018 om 21:46 schreef Roelof Wobben:
moment
Does the isNice not ends on result nice.
What do you then use as smalltalk version.
Roelof
Op 15-12-2018 om 21:36 schreef Nicol
testData) equals:
#('haegwjzuvuyypxyu’)
is working fine.
Please can you check it on your side!
Regards,
Nic
On 15 Dec 2018, at 21:20, Roelof Wobben <r.wo
Regards,
Nic
On 15 Dec 2018, at 19:36, Roelof
Wobben <r.wob...@home.nl>
wrote:
he implementation of: ByteString>>#includesSubstring:
Regards,
Nic
On 15 Dec 2018, at 19:36, Roelof Wobben <r.wob...@home.nl> wrote:
Hello,
Hello,
I have this code :
https://gist.github.com/RoelofWobben/7c08680797d1d9f84436653a0e4edd3b
as my solution to a AoC challenge.
But the last test `testIsNice` is still outputting the wrong
output.
The right output is : `ugknbfddgicrmopn `
Fine with me.
I almost the whole day on discord expecially the learning channels
under the name ` Roelof Wobben`
Roelof
Op 15-12-2018 om 14:54 schreef Cédrick Béler:
Perfect.
Maybe we can
And found the culprit after some good
night sleep.
But any feedback is appreiciated.
Roelof
Op 15-12-2018 om 10:34 schreef Roelof Wobben:
Thanks for the reviews.
I have change my code a little
more recent work also.
Does anyone
know whether there's a multiple pattern algorithm for
Pharo? One
could always fall back on ternary search trees...
hu, Dec 13, 2018 at 8:13 AM Roelof Wobben
<r.wob...@home.nl>
wrote:
Hello,
I have this code :
FindAndDeleteWordsWithForbiddenParts
"deletes all the words that contain forbidden parts"
| re
Hello,
I have this code :
FindAndDeleteWordsWithForbiddenParts
"deletes all the words that contain forbidden parts"
| result |
result := words
select: [ :word |
[ (forbiddenWords reject: [ :forbidden | '*' , forbidden , '*' match: word ])
wrote:
On Mon, Dec 10, 2018 at 8:52 AM Roelof
Wobben <r.wob...@home.nl>
wrote:
Hello,
is there a way I can check if a word ha
Op 10-12-2018 om 18:04 schreef Richard Sargent:
On Mon, Dec 10, 2018 at 8:52 AM Roelof Wobben
<r.wob...@home.nl>
wrote:
Hello,
is there a way I can check if a word has 2 the same chars after
each other
I was hoping that '#groupby could help me but that one
sorts
so abba
the aa is
Op 10-12-2018 om 08:29 schreef Ben Coman:
solver := Key5Solver new startCalculation .
Got it working
There was a dot missing
Roelof
Op 10-12-2018 om 08:29 schreef Ben Coman:
solver := Key5Solver new startCalculation .
Thanks
but still problems
I have this :
startCalculation
| zeros zerosSize count secret candidate |
secret := 'abcde'.
zeros := '000'.
zerosSize := zeros size.
count := 0.
[
and then have a different method you call
after you see that to return the answer.
cheers -ben
On Mon, 10 Dec 2018 at 04:16, Roelof Wobben
<r.wob...@home.nl> wrote:
this part(
Transcript crShow: 'ANSWER = ' , count printString.
)
so it still returns the count.
I tried ^count printstring but that is not allowed
Regards,
Roelof
Op 9-12-2018 om 12:29 schreef Roelof Wobben:
Helllo,
a question about
Helllo,
a question about day4 of 2015
is it right that I can only solve
this bruteforece
so begin at for example 1 , encode
it, check for 5 zeros if found then I have
Thanks,
I think that is because im a beginner which has to learn a lot.
May I have a hint how to read the data as as Dictonary. Right now
I use a OrderedCollection for that.
I read in the data like this :
lines :=
13000 plans
Roelof
Op 4-12-2018 om 22:55 schreef Ben Coman:
On Wed, 5 Dec 2018 at 00:45, Roelof Wobben <r.wob...@home.nl>
wrote:
s
, Dec 4, 2018 at 5:07 PM Roelof Wobben <r.wob...@home.nl>
wrote:
Hello,
For adventofCode I had to write some code that calculates
the overlap that multiple rectangles have.
Fo far I have it w
Hello,
For adventofCode I had to write some code that calculates the
overlap that multiple rectangles have.
Fo far I have it working for 1 rectangle but I do not like the code
because of the nested loops.
Can I make this more the pharo way
Op 3-12-2018 om 17:01 schreef Benoit St-Jean via Pharo-users:
Many many many thanks
For me too
and that is the answer I expect
Two question,
Why is trough StandardFileStream a line
and can this also be rewritten with a StreamContents
Roelof
found it.
I use the old reading code from part1.
but on part2 you did add the input to the numbers collection
so numbers was keeping empty
sorry for the noise
Roelof
Op 3-12-2018 om 16:13 schreef Benoit St-Jean via Pharo-users:
| file total numbers index frequencies duplicate |
duplicate
Op 3-12-2018 om 16:13 schreef Benoit St-Jean via Pharo-users:
file := StandardFileStream readOnlyFileNamed: 'C:\Recv\day.1.input'.
[file atEnd] whileFalse: [numbers add: (file nextLine asInteger)].
file close.
very wierd, on my Pharo 7 box I do not work.
I also see a message that temp variables
Op 3-12-2018 om 16:08 schreef Benoit St-Jean via Pharo-users:
yep
I did change it by the argument
partTwo: aFileName
| total numbers index frequencies duplicate file |
duplicate := false.
frequencies := Set new: 15.
frequencies add: 0.
numbers := OrderedCollection new: 1000.
total :=
yep, on Pharo this is a empty collection.
numbers := OrderedCollection new: 1000.
so index \\ (numbers size) is something divide by zero
Roelof
Op 3-12-2018 om 15:44 schreef Roelof Wobben:
Op 3-12-2018 om 15:30 schreef Benoit St-Jean via Pharo-users:
Thanks,
But at first glance you
Op 3-12-2018 om 15:30 schreef Benoit St-Jean via Pharo-users:
Thanks,
But at first glance you do not use the contents of file anywhere or am I
mistaken.
When I try your code on the real input I see a divide by zero error message.
Roelof
have been
handy. But just for this case? No.
On Tue, 4 Dec 2018 at 00:25, Roelof Wobben <r.wob...@home.nl>
wrote:
hello
Richard,
Thanks, I
> array length
index =: 1
else
index := index + 1
and then read the number with array at: index
Roelof
Op 3-12-2018 om 10:08 schreef Richard O'Keefe:
Roelof Wobben wrote
&quo
Hello,
Im not going for a quick answer.
For me its about practising and solving it and I do not matter to
me how long it takes,
I have finisched the MOOC and see this as a opportunity to
practice with Pharo ( the syntax and the way things can be
Thanks,
For the second I have to take a good look.
I have to reread the file till the adding causes the same outcome
as we had already
so for example if we have the sequence :
+3, +3, +4, -2, -4
it has as
Hello,
I have this code to solve the AOC 2018 day1 part1 challenge
| input input2|
input := Array streamContents: [ :lines |
'input.txt' asFileReference readStreamDo: [ :in |
[ in atEnd ] whileFalse: [ lines nextPut: in nextLine ]]].
input inject: 0 into: [
numbers; it merely
made a new array with everything that
was not #+. In
the original post there were no
strings. (By the way,
you wrote "trailing" where you meant
"leading".)
On Mon, 3 Dec 2
the array elements
that are not + .
So,
(array select:
[:each | each ~~ #+]) sum
The *best* approach is
not to put the + symbols
into the array in the
first place.
On Sun, 2 Dec 2018 at 23:46, Roelof
, 2 Dec 2018 at 23:46, Roelof Wobben <r.wob...@home.nl>
wrote:
Op 2-12-2018
om 11:15 schreef Hilaire:
> #(+1 -8) inject: 0 into: [:sum :each | each ~= #+ ifTrue:
[sum + each]
> ifFalse: [sum]] .
Again a memory message?Op 2 december 2018 om 17:06 schreef phil--- via Pharo-users :
Op 2-12-2018 om 12:19 schreef Benoit St-Jean via Pharo-users:
oke, and if I understand your code files is then the variable that holds
the file.
Roelof
Op 2-12-2018 om 11:55 schreef Benoit St-Jean via Pharo-users:
Nope, only the part how I can read the file.
Roelof
Op 2-12-2018 om 11:43 schreef Benoit St-Jean via Pharo-users:
if you can learn me that.
Right now., the input is a method.
I think I can do the rest from there
Hello,
I have a collection that looks like this :
sampleData1
"comment stating purpose of message"
^ #( -8
+7)
I want to add those numbers up but the code chokes at the +
so I did this :
FrequencyFinderData new class sampleData1 inject: 0 into: [:sum :each
| (each ~= $+)
We want
to find the first place where something
becomes
true. There are again at least to approaches.
Hello,
Yesterday I had a talk with luc frabresse about using if then.
He said if I understand it right, Its the best to not using a if then or
a ifTrue/ifFalse.
Can anyone help me figure out how to rewrite this project so I will not
use the ifTrue in the basement function.
my code so far
there, you need to select “demote to package with tag”. This
will move all Project-Action package into “Project” package, “Action” tag.
Cheers,
Esteban
On 27 Nov 2018, at 09:33, Roelof Wobben wrote:
Hello,
Right now I have three seperate packages.
Project
Project-test
Project-Actions
Hello,
Right now I have three seperate packages.
Project
Project-test
Project-Actions
Is it possible in P7 to have something like this
Project
--- Tests
Actions
and if so, how to I make it work,
On 25 Nov 2018, at 17:42, Roelof Wobben <r.wob...@home.nl> wrote:
Hello,
I have made this function :
calculateNewFloor: aFloor index:
Op 25-11-2018 om 19:12 schreef dorellang:
What you want to do is:
findBasement: input2
"solution to part1 of this challenge"
input2 withIndexDo: [ :element :index | |action| action:=
SantaFloorAction getActionFor: element. floor := action
calculateNewFloor: floor index: index ].
Hello,
I have made this function :
calculateNewFloor: aFloor index: index
"comment stating purpose of message"
|action floor |
action:= SantaAction getActionFor: aFloor. floor := action
doMovementFor: aFloor
now I want to send a message to this function :
findBasement: input2
and
'Complementary metal-oxide semiconductor' splitOn: ' '
does work
Op 24-11-2018 om 22:19 schreef Roelof Wobben:
thanks,
this one looks very promosing : self assert: ('foobar'
splitOn: '[aeiou
method in pharo, with examples :)
Am Sa., 24. Nov. 2018 um 21:49 Uhr schrieb Roelof
Wobben <r.wob...@home.nl>:
Hello,
For a acronym maker challenge on exercism.io
I have to make acronyms.
But
Hello,
For a acronym maker challenge on exercism.io I have to make acronyms.
But I see I have to split the parts on space and when it's a word with a
- then I have to split on that,
Any hint how I can do that ?
Roelof
and input are instance variables where input is the input the
user wants to use and floors is a Collection new.
Roelof
Op 9-11-2018 om 20:07 schreef Roelof Wobben:
hmm, got a idea
I could use this part :
|input floor stepChanges|
input := '))('.
floor := 0.
stepChanges := input asArray collect
hmm, got a idea
I could use this part :
|input floor stepChanges|
input := '))('.
floor := 0.
stepChanges := input asArray collect: [ :c |
floor := floor + (c = $( ifTrue: [ 1 ] ifFalse: [ -1 ]).
].
two times if the outcome would be a collection.
The challenge is 2 parts.
1) find out
t: implementation used
in String. I've opened https://pharo.fogbugz.com/f/cases/22652/collect-over-Strings-is-broken
On Fri, Nov 9, 2018 at 2:17 PM Roelof Wobben
&l
detectIndex: [ :each | each = -1 ] ifNone: [ 'invalid
input yo' ].
then I see this error message : Improper store to indexable
object.
Roelof
Op 9-11-2018 om 17:39 schreef Roelof Wobben:
stepChanges := input collect
Op 9-11-2018 om 16:44 schreef Peter
Uhnak:
On Fri, Nov 9, 2018 at 1:26 PM Roelof Wobben
<r.wob...@home.nl> wrote:
Thanks
Ben Coman:
On Fri, 9 Nov 2018 at 15:25, Roelof Wobben
<r.wob...@home.nl> wrote:
Hello,
I try to solve a adventofcode challenge where I must
fin
Hello,
I try to solve a adventofcode challenge where I must find out when santa
is first at the basement. the floor is there -1.
So I thought I use a while loop like this :
santaFloorOnBasement
"calculates which step take Santa to the basement"
| index|
index := 1.
???
Problem has solved.
I had the instance variable to instance := self new. instead of
instance := self basicNew.
Roelof
Op 5-11-2018 om 22:50 schreef Sven Van Caekenberghe:
On 5 Nov 2018, at 22:41, Roelof Wobben wrote:
I use this code to try to read things:
json paintingCollection
I use this code to try to read things:
json paintingCollection |
json := (NeoJSONReader fromString: (ZnEasy get: 'https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak=json=schilderij=True') contents).
paintingCollection := PaintingCollection fromJSON: json.
Hello,
I try to use the rijksmuseum api.
This gives json back for 10 paintings and the json looks like this :
{
"elapsedMilliseconds": 164,
"count": 359,
"artObjects": [
{
"links": {
"self":
Hello,
Is there a book / tutorial/ challenges that I can use to become a expert
in Pharo ?
Roelof
On Fri, Nov 7, 2014 at 6:01 PM, Roelof
Wobben r.wob...@home.nl
wrote:
Hello,
Is there a book / tutorial/ challenges that I can use to
become a expert in Pharo
and in stackoverflow. You dont need to be
expert , just someone that finds pharo enjoyable and useful.
On Fri, Nov 7, 2014 at 7:17 PM, Roelof
Wobben r.wob...@home.nl
wrote:
Thanks.
By expert
By Example... it
should give you everything to get you started. You can
download it here http://pharobyexample.org/
Peter
On Fri, Nov 7, 2014 at 7:13 PM, Roelof
Wobben r.wob...@home.nl
wrote
201 - 300 of 350 matches
Mail list logo