Re: [Pharo-users] Validate password with PBKDF2

2017-06-30 Thread Erik Stel
Francis, 

The hashpw function returns a hash with the salt prepended. So it contains
both elements. (See for example explanation at:
https://stackoverflow.com/questions/27413248/why-can-bcrypt-hashpw-be-used-both-for-hashing-and-verifying-passwords).
 

You can do the same thing here. Assuming you have a fixed size salt, just
prepend it before the hash value. Since the salt is (should be) random,
returning it's value does not weaken the security. Using a salt prevents
against rainbow table attacks: pre-generated hash values for many possible
passwords. (See https://en.wikipedia.org/wiki/Rainbow_table).   

Cheers, 
Erik



--
View this message in context: 
http://forum.world.st/Validate-password-with-PBKDF2-tp4952973p4953067.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Validate password with PBKDF2

2017-06-30 Thread Erik Stel
Francis,

You're using an empty salt when creating the hash. Just prepending a random
number does not add much security. Anyone knowing your solution will just
prepend a random number. And creating only a few accounts in your system
will probably reveal that information as well. A wrong-doer will just use a
fake salt and will still be able to try a rainbow table attack.

Please use a real random value for the salt. And easiest would be to give it
a fixed size. 

(Don't have an image and/or code available, so this might lead to some
pseudo code ;-) 

To generate a safe password hash which you can store in your db, the
following method. It creates a random number (your example of a UUID of 16
bytes) and uses that as a salt for the password hash. Both values are then
concatenated and returned as a 'safe' password. This can be stored in your
db.



To validate a user's password you retrieve the safePasswordHash from your db
(based on the user's id) and validate the given password against it. For
this the salt is retrieved from the safePasswordHash (first 16 bytes because
UUID is 16 bytes) and it is then used to calculate the hash of the given
password. It should match the second part of the safePasswordHash.



Hope this helps.

For real safety, please add some checks for valid values. Did we receive a
valid password? Is the safePasswordHash the correct length (in this case 32
bytes)? You might consider using another salt generator than UUID.

Cheers,
Erik




--
View this message in context: 
http://forum.world.st/Validate-password-with-PBKDF2-tp4952973p4953129.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Validate password with PBKDF2

2017-07-01 Thread Erik Stel
Hi Francis,

You write:

Pharo Smalltalk Users mailing list wrote
> FIY
> 
> UUID new asByteArray
> 
> does not give a ByteArray because UUID is a subclass of ByteArray and
> asByteArray returns self

(Entering teacher mode)
This actually means that "UUID new asByteArray" does answer a ByteArray. It
will answer (as you mentioned correctly) itself. Since a UUID is a ByteArray
it means it will answer a ByteArray (in contrary to your statement). 

To put it differently: The inheritance relation (UUID being a subclass of
ByteArray) is a "IS-A" relation. So any UUID is a ByteArray.

This means however the message "asByteArray" did not have to be send of
course (it is already a ByteArray). I was not sure the class UUID was
actually a subclass of ByteArray when writing my reply. Turns out it is.

Cheers,
Erik





--
View this message in context: 
http://forum.world.st/Validate-password-with-PBKDF2-tp4952973p4953168.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Validate password with PBKDF2

2017-07-01 Thread Erik Stel
Agreed.



--
View this message in context: 
http://forum.world.st/Validate-password-with-PBKDF2-tp4952973p4953207.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



[Pharo-users] TestCases and forked processes in TestResource don't play well

2019-06-12 Thread Erik Stel
Hi,

I'm developing a web application using (amongst others) WebSockets. To
prevent test methods from becoming too big and slow I created a TestCase
with a TestResource containing my web application instance. After the first
test method is run, the WebSocket is closed unexpectedly and automagically.
It turns out that all forked processes are terminated when a TestCase has
executed a test method. What would be the proper way to prevent these forked
processes from terminating after a single test method? Or am I missing
something/doing something wrong?

TestExecutionEnvironment>>#checkForkedProcesses is responsible for
terminating any (non failed) processes. It is executed after
TestExecutionEnvironment>>#runTestCaseSafelly: [sic: this should be
#runTestCaseSafely:]. A possible solution might be to check whether the
Context in which a forked process was created has the #setUp method of a
TestResource of the TestCase (you still with me ;-) in its Context chain. If
that is the case, the process is probably forked for a reason. This forked
process does have to be terminated when all TestCases have finished of
course (when the TestResource does #tearDown).

IFF the forked processes should be kept alive during the execution of all
TestCase methods, does the suggested solution above seem logical or are
there any (better) alternatives?

Regards,
Erik



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] TestCases and forked processes in TestResource don't play well

2019-06-13 Thread Erik Stel
Hi Denis,

Thanks for the fast response.

When you say proper fix, do you mean a general fix for all TestResources or
do you mean the fix for my situation?

I can't oversee (yet) what the effect will be of halt/debug code inside the
web application (TestResource) which is the subject of the TestCase.
Normally this gets caught and handled specifically. And proper termination
of those forked processes from the TestResource will need to be handled
specifically (similar to the TestExecutionEnvironment :-) in the resource
#tearDown. Will try it out.

Cheers,
Erik



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Resources Page

2020-01-29 Thread Erik Stel
I think SqueakJS would be a good addition for the Open Source resources:
https://squeak.js.org (Javascript based VM for running both headful and
headless images both in the browser or (headless) in nodejs).

And maybe Caffeine should get a mention in that same area (it uses
SqueakJS):
https://caffeine.js.org/ (live coding environment)

Cheers,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] NeoJSONParseError: invalid input: ' while parsing a Wikipedia exported article.

2020-02-08 Thread Erik Stel
Offray,

JSON only allows double quotes for strings, not single quotes. 

Cheers,
Erik



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] DNS over HTTPS (DoH) in Pharo

2020-02-26 Thread Erik Stel
Sven,

Thank you very much. The new package is really well done (again ;-).

For others/future readers: although not explicitly explained so by Sven, the
first examples will not work for all addresses. The first address returned
by the Cloudflare API can be another named address instead of IP address (a
kind of redirect). Therefore using the new package is more than just robust,
it offers more functionality as well. Don't be shy, use the full package and
use the NeoSimplifiedDNSClient class!

Trying all (except last) examples using 'www.nos.nl' as hostname will result
in an error, because the first answered address will be 'nos.nl'. The second
answered address wil be the actual IP address.

Regards,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Clean up method like #exiting from VAST

2020-03-13 Thread Erik Stel
Vince,

You could check SmalltalkImage>>#addToShutDownList:

Greetz,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Stale SQLite connection

2020-03-13 Thread Erik Stel
Jeff,

You could have a look at SmalltalkImage>>#addToShutDownList: and
SmalltalkImage>>#addToStartUpList: to stop/(re)start the connection when
image is closed or a snapshot is taken. Add a method #startUp: to handle
reconnecting. See for example Clipboard>>#startUp:

Cheers,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Minimality

2020-04-13 Thread Erik Stel
Hi Cedreek,

(Part of this I mentioned on Discord as well, but not all readers will be on
Discord)

I'm working with a tiny Smalltalk image (currently around 150Kb) which
contains basic classes (very similar to PharoCandle, but with the regular
Smalltalk names without PC-prefix, see
https://github.com/carolahp/PharoCandleSrc). It additionally supports
WebSockets when used in combination with SqueakJS, but I'm working on a
regular WebSocket-version for OpenSmalltalk-VM as well.

The image has an ObjectEncoder/Decoder pair allowing the image to 'receive'
encoded classes and methods from a regular Smalltalk image (bytcode only,
since no compiler is present in the tine image). The tiny image can install
these classes and use them. The current 'protocol' is to send messages to
this tiny image and have the image send events back to the regular image.
The tiny image (client) is responsible for making a connection with the
regular image (server). But this protocol can be adjusted with newly
installed classes of course ;-).

My idea (dream?) is to create small cloud images for personal use, so you
can run many on limited computing units. These images will not have file- or
FFI-support and need to retrieve data through WebSocket/HTTP/... or other
web communication technology. It is part of a project I'm working on to
learn programming in Smalltalk to kids. They can spin up an image in the
cloud (or on their Raspberry Pi at home) and load their code from a remote
repository. The development environment will run in the cloud and be usable
with a web browser. In the web browser runs a tiny image which can execu...o
wait, I explained that part already ;-). So in the web browser this same
tiny image is running (on SqueakJS). This time, it loads code to be able to
manipulate the DOM. This tiny image is sort of the Javascript replacement.
So everything is Smalltalk! :-)

Still a long way to go though. I hope to be able to demonstrate a little of
this in a not so distant future. I will share my code as well. Everything
will be open source.

Feel free to reach out if anyone wants to participate. ;-)

Regards,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Minimality

2020-04-16 Thread Erik Stel
Richard,


Richard O'Keefe wrote
> This sounds a lot like Craig Latta's "Spoon".
> Probably worth talking to him about it.

In the past I had some interest in Spoon, but it seems inactive now in
favour of Caffeine and Naiad (the module system for Spoon). Spoon is not
open source btw. Spoon & Naiad is/was about live coding with versions of
classes and methods which is different from my needs. At that time Spoon had
its own VM I think. Recently I had some contact with Craig regarding
SqueakJS for my work and last Fall I presented some of my ideas at a meetup
where he was too. He did not reach out there and admittedly I did not ask.

My ideas are definitely not new and where possible I try to make use of
existing ideas, designs or products. Something about trying to stand on the
shoulder of giants comes up as a title ;-).

Thx for the pointer though.



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



[Pharo-users] New type of web application using HTML, CSS and Smalltalk

2020-05-03 Thread Erik Stel
I have published my first demo of a new type of webapplication based on a
tiny Smalltalk image running in the browser, acting as the JS-engine. Create
a dynamic application using Smalltalk only, with the direct manipulation
you're familiar with from Smalltalk. And ...(in the near future)... with the
same debugging capabilities. Still work in progress, but hopefully providing
an idea of what's in store.

Feel free to ask questions.

https://www.youtube.com/watch?v=qvY7R6te7go




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] New type of web application using HTML, CSS and Smalltalk

2020-05-04 Thread Erik Stel
Hi Konrad,

Correct, the minimal image is running on SqueakJS VM. You can find info
here: https://squeak.js.org

Interesting question regarding deployment. In my current setup you do need
the server, but it is not unrealistic to have a setup in which at some point
the client is asked to create a snapshot. The SqueakJS VM does allow this.
This snapshot could be stored somewhere as a final application. It could
even be possible to stop the communicator and remove it (as well as a few
other classes) from the image before taking the snapshot and kind of sealing
the application like that.

So it could be a way of creating standalone web applications. If that was
the thought behind the question.

I did use this mechanism of creating snapshots in an attempt to strip down a
regular Pharo image and create the small image to run inside the browser.
Until I decided that route was longer than doing the bootstrap route of
creating an image from scratch ;-).

Regards,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



[Pharo-users] Zinc WebSocket usage

2020-05-29 Thread Erik Stel
Sven or anyone else with experience with ZnWebSockets, a question regarding
ZnWebSocket usage.

I have the following code which sort of resembles my current usage of
ZnWebSockets. ZnWebSockets are used for both sending and receiving messages
in a random fashion (ie, no request-response like pattern). Because the
ZnWebSocket operates synchronous I fork 'handlers' which process the
incoming messages. When executing the code below, the client closes the
connection but will 'recognise' this itself only after a timeout (around 30
seconds by default). Is there a better way to use ZnWebSockets which does
not incur this delay?

My current workaround (see comment at the bottom in code below) is to send
an explicit "close" ZnWebSocketFrame instead of sending #close to the
ZnWebSocket. This will have the client close 'directly', after which I can
close the ZnWebSocket stream explicitly. The implementation of #close for
ZnWebSocket is to perform both: send close frame and close stream. The later
seems to 'stall' the receive message until timing out. The synchronous
handling of incoming messages might be causing this. But could not directly
find why closing the stream resulted in different behaviour than when only
sending the close frame. (Hope this explanation is helpful ;-).






--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Zinc WebSocket usage

2020-05-29 Thread Erik Stel
Hmmmweird. My code was visible in preview. I did not look at the final
result after posting. Maybe I should not have used the  tag.

| server client |
server := ZnWebSocket startServerOn: 1701 do: [ :webSocket |
[ webSocket runWith: [ :message | self crLog: 'Received message: ', 
message
printString ] ]
on: ConnectionClosed, PrimitiveFailed do: [ "ignore close" ].
self crLog: 'The server is closed' ].
client := ZnWebSocket to: (ZnUrl fromString: 'ws://localhost:1701').
[
[ client runWith: [ :message | "ignore received messages" ] ]
on: ConnectionClosed, PrimitiveFailed do: [ "ignore close" ].
self crLog: 'The client is closed'.
server stop ] fork.
(Delay forSeconds: 1) wait.
client sendMessage: 'Hello world'.
client close.
"Workaround: use the following instead of 'client close'.
client sendFrame: ZnWebSocketFrame close."




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Zinc WebSocket usage

2020-06-02 Thread Erik Stel
Hi Sven,

Maybe you missed the additional post with the source code (I attached it
again below with small change in way it is logging). Is there any advice on
how to do this (other than the workaround I'm using at the moment)? The
issue being that the client recognises its own closing only after a timeout
(around 30 seconds by default). A message "Client closed" will appear on the
Transcript after this 30 seconds. With the workaround (see comment in code),
it does recognise the closing immediately.

As you can see, I'm already using #runWith: as you suggested. Your recent
addition of sending 'ping' does not change the synchronous behaviour.

I'm using this on a Pharo 7 image, but also tested it on Pharo 9.

Kind regards,
Erik

Just in case, I added the code again (without using #crLog: this time):

| server client | 
server := ZnWebSocket startServerOn: 1701 do: [ :webSocket | 
[ webSocket runWith: [ :message | Transcript show: 'Received
message: ', message 
printString ; cr ] ] 
on: ConnectionClosed, PrimitiveFailed do: [ "ignore close" ]. 
Transcript show: 'The server is closed' ; cr ]. 
client := ZnWebSocket to: (ZnUrl fromString: 'ws://localhost:1701'). 
[ 
[ client runWith: [ :message | "ignore received messages" ] ] 
on: ConnectionClosed, PrimitiveFailed do: [ "ignore close" ]. 
Transcript show: 'The client is closed' ; cr. 
server stop ] fork. 
(Delay forSeconds: 1) wait. 
client sendMessage: 'Hello world'. 
client close. 
"Workaround: use the following instead of 'client close'. 
client sendFrame: ZnWebSocketFrame close." 





--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Zinc WebSocket usage

2020-06-05 Thread Erik Stel
Hi Sven,

(I hope this message does arrive. Sorry for the late reply. I have not been 
able to use the browser-interface for the ML for a number of days now. An admin 
could not figure this out either. So resorting to actually using a mail ;-)

My architecture is one in which client and server are working fairly 
independent. A client or server can send the other a message whenever it wants 
(and there is no response expected). The client is responsible for setting up 
the connection and keeping it ‘open’ (for the server to reach the client). When 
the client wants it can however disconnect and reconnect at a later time. The 
server will still be there (this is not visible in the example of course). Both 
client and server keep track of messages which can’t be sent when the 
connection is (temporarily) down.

So I have to have a separate process to read messages from the process that 
writes messages to the WebSocket. In a test I discovered that closing the 
connection from the client did not get noticed in the process doing the 
reading. I’d like that process to stop running fairly directly since it is 
performing some additional logic. Now it takes a timeout. Closing the 
connection using the specified workaround does get noticed and works for me. 
But I’m unsure if this is a good approach and there’s the risk it will not work 
on a next update. A shorter timeout could be a solution but does mean I’m going 
into a ‘polling’ mode. So I think I prefer my workaround over setting a very 
short timeout.

If you have a better solution though, please let me know.

Kind regards,
Erik




Re: [Pharo-users] Zinc WebSocket usage

2020-06-05 Thread Erik Stel
Sven,

Okay. Thx for spending your time to investigate this. I'll stick with the
current workaround then.

Cheers,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] New type of web application using HTML, CSS and Smalltalk

2020-06-26 Thread Erik Stel
Hi,

It took a bit longer than planned, but my code can be found online.
https://github.com/ErikOnBike/CodeParadise

Interested to hear your experience. Please add issues on Github if you
encounter problems.

Cheers,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



[Pharo-users] Re: We haven't had a design debate in a while - thoughts on CD.buy article...

2021-04-29 Thread Erik Stel
Hi people,

A bit late to the party, but I want to provide some info as well.

I think an Article can perfectly respond to a #sell (or #sellQuantity:)
message. Depending on the type of application it could know or interact with
other objects responsible for Stock for example to provide an estimated
delivery date and price. When a customer is not known through some context
it could be #sellToCustomer: or #sellToAccount:. But mostly to have a
delivery address and make sure payment is done. Not to have a customer do
the buying (as an act), that is irrelevant for most (web)shops.

There is often no need to have a person like object to fulfil the role of
actor (dare I say 'manager') in the object interactions. Objects have
behaviour and take on responsibilities of their own. Having a human like
object moves responsibilities away from the objects and creates unneeded
dependencies between objects. You'll quickly see conditional logic appear in
those classes.

Kids sometimes understand this way of looking at objects better than we
adults. A kid does not find it weird to see a movie or play in which a
teapot pours itself or where a CD plays itself.

So I do understand that a CD understands #play as a message. Perfectly fine.
We do not literally have to represent every physical object and its physical
characteristics in our world as objects in our applications. It is the
behaviour and responsibilities they posses that counts. (CRC cards are
really quite helpful in OO)

I highly recommend reading the book Object Thinking by Dave West. For sake
of clarity: yes, we are partners in ObjectGuild. See the link to the book
below. Don't be put back by the age of the book.

http://davewest.us/product/object-thinking/

Cheers,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html


Re: [Pharo-users] SortedCollection>>reverse answers an inconsistent object in Pharo 6

2018-04-23 Thread Erik Stel
Richard,

The 'problem' is that the result of the (original) #reverse is a
SortedCollection without a sortBlock. Meaning it defaults to comparing
values using #<=. When a new element is added to the reversed collection it
simply assumes all elements are already sorted and uses the (default)
sortBlock to add a new element. 

I think the solution should be to have #reverse add an explicit sortBlock
which consists of reversing the original sortBlock or defaulting to [ a: b:
| (a <= b) not ]. (Keep #<= as some classes might depend on only
implementing this)

Cheers,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] SortedCollection>>reverse answers an inconsistent object in Pharo 6

2018-04-23 Thread Erik Stel
I already deleted my post (within 1 minute after posting 8-) seeing that I
jumped the wagon too early. Sorry for that. Your message and proposed
solution is fine.



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] SortedCollection>>reverse answers an inconsistent object in Pharo 6

2018-04-23 Thread Erik Stel
Richard,

Can you explain me what you mean by "sortBlock is supposed to act like #<="?
Isn't it up to the developer to decide what the logic should be? I simply
used #<= because #> might not have been implemented for all relevant
classes, but would otherwise have chosen #> as a means to get the 'reversal'
of #<=.

Your solution is not resulting in the behaviour I would expect it. Adding
elements which are compared equally, but still have a different value, do
not get added in the same position. In the examples below I use
Associations, since it compares on the key only (for #<= comparison).

Consider a regular SortedCollection with default sortBlock (set explicitly):
| aCollection |
aCollection := SortedCollection sortBlock: [ :a :b | a <= b ].
{#k->'Some'. #k->'Value'. #k->'Or'. #k->'Other'} do: [ :each | aCollection
add: each ].
aCollection.
 "a SortedCollection(#k->'Some' #k->'Value' #k->'Or' #k->'Other')"

When I create a SortedCollection with your code's sortBlock reversed I get:
| aCollection |
aCollection := SortedCollection sortBlock: [ :a :b | b <= a ].
{#k->'Some'. #k->'Value'. #k->'Or'. #k->'Other'} do: [ :each | aCollection
add: each ].
aCollection.
 "a SortedCollection(#k->'Some' #k->'Value' #k->'Or' #k->'Other')"

The order of the result is the same in both situations. What I would expect
is the result you get from the sortBlock I suggested:
| aCollection |
aCollection := SortedCollection sortBlock: [ :a :b | (a <= b) not ].
{#k->'Some'. #k->'Value'. #k->'Or'. #k->'Other'} do: [ :each | aCollection
add: each ].
aCollection.
 "a SortedCollection(#k->'Other' #k->'Or' #k->'Value' #k->'Some')"

This last result is the reversal of the original result.

(side note)
IF in the above #addAll: was used instead of the repeated #add:, things
might be different again. Since the #addAll: implementation would on some
occasions (when size of receiver vs size of added elements is certain ratio)
add the elements at the end and then perform a #reSort. With values being
compared as equal, the order will be decided by the order they were added.
So the result of #addAll: depends on the collection sizes. This might not be
what a user would expect ;-).



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] SortedCollection>>reverse answers an inconsistent object in Pharo 6

2018-04-25 Thread Erik Stel
Why does the sortBlock has to answer true for the same (identical) object? I
have not been able to find where it is specified. And in different locations
I see #> being used as a comparator for the sortBlock. So why is it bad (as
you wrote)? (It seems you describe that SortedCollection should create a
collection with a Total Order, whereas I describe a situation where a Strict
Order is also valid.)




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Naming parameters - conventions?

2018-07-12 Thread Erik Stel
In the day, I learned from Smalltalk with Style:
http://sdmeta.gforge.inria.fr/FreeBooks/WithStyle/SmalltalkWithStyle.pdf

On PDF-page 13 naming starts. On PDF-page 29 parameter names are explained
(but refers back to typed names for example). Naming ends at PDF-page 35. So
quite elaborate explanation of naming ;-).

In practice I also mix typed names (aCollection), semantic names (addresses)
and a combination (anAddressCollection). I prefer the combination except for
trivial situations or when the (class and) method name provide(s) enough
context (name: aString). This later might in itself be less trivial if the
context get broader than class and method (name).

@Tim, the book might be useful for more than just naming since it covers
quite some ground.




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Status of Caffeine

2018-07-19 Thread Erik Stel
You can find the source at the GitHub-link below. Craig seems active on this
project seeing the number of recent commits. Focus is on creating a live
VR-environment. Cool stuff I think . It will run Pharo, but if that means
'production ready'... Small image sizes for production systems/applications
is probably a separate topic. Caffeine is a Smalltalk VM written in JS (with
some extra's), so image size depends on how small you can make your image. I
read in some of the more recent issues that on some mobile devices (based on
iOS) the page reloads after switching apps and/or locking the device. This
will loose any data currently in the Caffeine app. Craig is working on a
solution based on WebWorkers. This probably means: not production ready for
mobiles yet .   

Link:  https://github.com/ccrraaiigg/ccrraaiigg.github.io
  

HTH



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] ZnURL and parsing URL with diacritics

2018-09-11 Thread Erik Stel
Check out the following info:
 https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier
  

The REST API might be answering an IRI instead of an URI in which case it
might not be faulty after all (I did not check the API myself).




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] ZnClient receiving Expires header with Max-Age instead of HTTP formatted DateAndTime

2018-09-11 Thread Erik Stel
Sven,

According to the spec "0" or invalid date formats should mean 'isExpired'
(as you already suggested):
   A cache recipient MUST interpret invalid date formats, especially the
   value "0", as representing a time in the past (i.e., "already
   expired").

So I would vote for having 'isExpired' answer 'true' in those cases. Having
'expiresTimeStamp' throw an error seems reasonable. The sender can catch the
exception. 

Cheers,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] nested json problem

2018-11-05 Thread Erik Stel
Roelof,

What does not work in your code? How do you call
PaintingCollection>>fromJSON: ?

>From what I see this code could work if used like (replace URL with actual
URL):







--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



[Pharo-users] CodeParadise runs on P10

2022-12-28 Thread erik . stel
Hi all. A small holiday present for anyone interested: 
[https://github.com/ErikOnBike/CodeParadise](https://github.com/ErikOnBike/CodeParadise
 "https://github.com/ErikOnBike/CodeParadise";) now runs on P10 (and P11 with 
some care)! If you are using it on P8, please unload the CP-ClientEnvironment 
and reload it using the "pharo8" branch: 

```
Metacello new
  repository: 'github://ErikOnBike/CP-ClientEnvironment:pharo8';
  baseline: 'CodeParadise';
  load.
```

P11 seems to have some issues sometimes with restarting the image. Have not 
found the exact cause. Will look into this.\
\
Happy holidays!


[Pharo-users] Creating tiny Pharo images

2022-12-31 Thread erik . stel
Hi all.\
\
I have created a bootstrap helper package to create tiny Pharo images. I use 
this for CodeParadise, but it can also be used to create tiny images which run 
outside the browser. It can create both 32 and 64 bit images. A tiny image is 
around 200 to 300Kb.\
\
Two example usages are present. See the README in the repo.\
\
[https://github.com/ErikOnBike/TinyBootstrap](https://github.com/ErikOnBike/TinyBootstrap
 "https://github.com/ErikOnBike/TinyBootstrap";)\
\
Happy 2023 and happy Smalltalking!


[Pharo-users] Re: Creating tiny Pharo images

2023-01-15 Thread erik . stel
Hi all.\
\
I added a 'dynamic' image to the TinyBootstrap repo. It is a tiny image 
containing a pre-installed code loader. This code loader allows you to load 
additional classes and methods and (optionally) save this in the image. Code 
(in the form of a class method) can be executed from the command line. Once the 
image has the required content and functions as expected, it can be 'fused' in 
which case the code loader is removed from the image and only the defined 
functionality remains. To allow code to be installed from a regular Pharo 10 
image, a small TinyTools repo is available which allows generation of code 
files. It also contains a small 'Inspector' class which simply prints out all 
classes (and optionally methods) which are present in the image. Installing 
this class is explained in the TinyTools readme.\
\
The encoder/decoder combi used is an adapted version of the encoder/decoder in 
CodeParadise which are used to send code and objects between browser and 
application server. \
\
Have fun Smalltalking to tiny images! \
[https://github.com/ErikOnBike/TinyTools](https://github.com/ErikOnBike/TinyTools
 "https://github.com/ErikOnBike/TinyTools";)\
[https://github.com/ErikOnBike/TinyBootstrap/blob/main/README.md#dynamic-image](https://github.com/ErikOnBike/TinyBootstrap/blob/main/README.md#dynamic-image
 
"https://github.com/ErikOnBike/TinyBootstrap/blob/main/README.md#dynamic-image";)