Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread TedVanGaalen
Thanks for the Info/Link, Stephan

So it is a VM error then?

Guess we'll have to wait for a VM + Pharo 7.xx combo that works correctly on
macOS.

I now re-installed Pharo 5.0 (pre spur vm) 
loaded Seaside with Zincserver (using gofer) into it and my .st files from
2011...

might be a bit slower perhaps, but this 5.0 Pharo version works flawlessly. 
well, apart from the bugs in the dental app i'm building of course,
but that's my problem :o) 

Regards
Ted





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



Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread Stephan Eggermont
TedVanGaalen  wrote:
> Sure. Which one? and with what image?

See https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/380

Stephan




Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread TedVanGaalen
Did just try with scaled resolution 1920 * 1080 (on my 4K screen) to no
avail.
same error:freeze with "toggle full screen"



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



Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread TedVanGaalen
Hope stack tells more. 
Could dig out an old hdmi HD monitor from 
unpacked moving cartons somewhere,
tell me you don't need me to do so :o\



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



Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread TedVanGaalen
from the other terminal window:

teds-personal-mac-mini:~ TedvG$ ps -a | grep pharo
  811 ttys0000:00.01 bash ./pharo-ui Pharo.image
  815 ttys0000:10.06
/Users/TedvG/pharo-vm/Pharo.app/Contents/MacOS/Pharo Pharo.image
  824 ttys0010:00.00 grep pharo
teds-personal-mac-mini:~ TedvG$ kill -SIGUSR1 815
teds-personal-mac-mini:~ TedvG$ 





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



Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread TedVanGaalen
and so i did. result   (the omega was a ctrl z to get up. had to open another
term. window to kill and dump. see here:
=
teds-personal-mac-mini:~ TedvG$ ./pharo-ui Pharo.image 
Ω   


SIGUSR1 Wed Apr 17 17:45:27 2019


VM: 201901051900 https://github.com/OpenSmalltalk/opensmalltalk-vm.git
Date: Sat Jan 5 20:00:11 2019 CommitHash: 7a3c6b6
Plugins: 201901051900 https://github.com/OpenSmalltalk/opensmalltalk-vm.git

C stack backtrace & registers:
rax 0x0004 rbx 0x4f9f rcx 0x7ffee4b8df18 rdx
0x7ffee4b8dfd0
rdi 0x rsi 0x rbp 0x7ffee4b8e100 rsp
0x7ffee4b8df18
r8  0x7ffee4b8df40 r9  0x0090 r10 0x7ffee4b8df50 r11
0x0297
r12 0x7ffee4b8dfd0 r13 0x7ffee4b8df50 r14 0x7ffee4b8df40 r15
0x000d431d82f75f17
rip 0x7fff6db6361a
0   libsystem_kernel.dylib  0x7fff6db6361a __select + 10
1   Pharo   0x00010b0c7642 reportStackState
+ 952
2   Pharo   0x00010b0c7860 sigusr1 + 182
3   libsystem_platform.dylib0x7fff6dc0cb5d _sigtramp + 29
4   ??? 0x7ffee4b8da07 0x0 +
140732735740423
5   Pharo   0x00010b0cab6d
ioRelinquishProcessorForMicroseconds + 53
6   Pharo   0x00010b07fda7
primitiveRelinquishProcessor + 54
7   ??? 0x00010f70b32b 0x0 + 4554011435
8   Pharo   0x00010b03f23a interpret + 628
9   Pharo   0x00010b0c8dca
-[sqSqueakMainApplication runSqueak] + 393
10  Foundation  0x7fff43890dd6
__NSFirePerformWithOrder + 362
11  CoreFoundation  0x7fff41571c94
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
12  CoreFoundation  0x7fff41571bc9
__CFRunLoopDoObservers + 451
13  CoreFoundation  0x7fff4151474e __CFRunLoopRun +
1143
14  CoreFoundation  0x7fff41514085
CFRunLoopRunSpecific + 459
15  HIToolbox   0x7fff407f29db
RunCurrentEventLoopInMode + 292
16  HIToolbox   0x7fff407f261d
ReceiveNextEventCommon + 355
17  HIToolbox   0x7fff407f24a6
_BlockUntilNextEventMatchingListInModeWithFilter + 64
18  AppKit  0x7fff3eb8cffb _DPSNextEvent +
965
19  AppKit  0x7fff3eb8bd93
-[NSApplication(NSEvent)
_nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1361
20  AppKit  0x7fff3eb85eb0 -[NSApplication
run] + 699
21  AppKit  0x7fff3eb753f0 NSApplicationMain
+ 777
22  libdyld.dylib   0x7fff6da273d5 start + 1
23  ??? 0x0002 0x0 + 2


All Smalltalk process stacks (active first):
Process0x113277e80 priority 10
0x7ffee4b9a0b0 M ProcessorScheduler class>idleProcess 0x11009d660: a(n)
ProcessorScheduler class
0x7ffee4b9a0f0 I [] in ProcessorScheduler class>startUp 0x11009d660:
a(n) ProcessorScheduler class
0x7ffee4b9a130 I [] in BlockClosure>newProcess 0x113282088: a(n)
BlockClosure

suspended processes
Process0x11327a9e0 priority 50
0x7ffee4b960b0 I WeakArray class>finalizationProcess 0x11009e420: a(n)
WeakArray class
0x7ffee4b960f0 I [] in WeakArray class>restartFinalizationProcess
0x11009e420: a(n) WeakArray class
0x7ffee4b96130 I [] in BlockClosure>newProcess 0x113646fa8: a(n)
BlockClosure

Process0x11299b5a8 priority 80
0x7ffee4b910e8 M DelayMicrosecondTicker>waitForUserSignalled:orExpired:
0x1104db528: a(n) DelayMicrosecondTicker
0x7ffee4b91130 M [] in
DelaySemaphoreScheduler(DelayBasicScheduler)>runBackendLoopAtTimingPriority
0x1104d03c0: a(n) DelaySemaphoreScheduler
   0x1132542e8 s BlockClosure>ensure:
   0x11298a590 s
DelaySemaphoreScheduler(DelayBasicScheduler)>runBackendLoopAtTimingPriority
   0x113242ee8 s [] in
DelaySemaphoreScheduler(DelayBasicScheduler)>startTimerEventLoopPriority:
   0x11298a668 s [] in BlockClosure>newProcess

Process0x113277e30 priority 60
0x7ffee4b940b0 I SmalltalkImage>lowSpaceWatcher 0x1100ab9a8: a(n)
SmalltalkImage
0x7ffee4b940f0 I [] in SmalltalkImage>installLowSpaceWatcher
0x1100ab9a8: a(n) SmalltalkImage
0x7ffee4b94130 I [] in BlockClosure>newProcess 0x113646e80: a(n)
BlockClosure

Process0x113277ed0 priority 60
0x7ffee4b92068 M InputEventFetcher>waitForInput 0x1107ef020: a(n)
InputEventFetcher
0x7ffee4b920b0 M InputEventFetcher>eventLoop 0x1107ef020: a(n)
InputEventFetcher
0x7ffee4b920f0 I [] in InputEventFetcher>installEventLoop 0x1107ef020:
a(n) InputEventFetcher

Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread TedVanGaalen
Note! Just being playing a bit further with Squeak 5.2
and it freezes too, when resizing the window!
Similar things in VM ?
Regards
TedvG




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



Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread Paul DeBruicker
Don't know about 4k.  Have you tried a smaller monitor on your mini just to
see?


When pharo locks up from the command line you can get a stack dump in the
terminal window you started pharo in.

first find the pharo process you're interested in with

ps -a | grep pharo


then do a

kill -SIGUSR1 


where you replace the  bit with the actual process number of
your frozen pharo image




TedVanGaalen wrote
> Is pharo tested on 4K macs and/or mac mini with 4K screens?
> so on anything with this resolution?
> 
> Does Pharo or the VM emit a post-mortem log/dump file? cannot find any. 





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



Re: [Pharo-users] NewWave - WorkflowEngine

2019-04-17 Thread BrunoBB
Hi Sebastijan,

Excellent work !!!

I have something similar (a BPM engine) but developed with GemStone
Smalltalk:
Code:
https://github.com/brunobuzzi/BpmFlow
Documentation:
https://bpmflow.gitbook.io/project/introduction

It can be ported to Pharo, from the top of my head i see a couple of issues
with the port:
- GemStone/S special indexes collection must be changed for regular Pharo
collections.
- GsQuery should be implemented in Pharo (maybe already is i do not know) or
remove GsQuery references and so regular collection queries (select:,
collect: anySatisfy and so on)

The project is totally open source.

Regards,
Bruno



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



Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread TedVanGaalen
Sure. Which one? and with what image?
However, don't know if that would make a difference,
because I've been trying this repeatedly since Pharo 6.0

Squeak 5.2 (just downloaded and launched just to try) works ok,
but for what I do, and previous work/classes made with Pharo 5.0,
Pharo/Seaside would be preferable.
Squeak uses another VM or so it seems
(thought for a moment VMs were the same,
that's why I tried Squeak,)

regards from Souillac. (F) 
TedvG

>From Squeak About

/Applications/Squeak5.2-18229-64bit.app/Contents/Resources/Squeak5.2-18229-64bit.image
Squeak5.2
latest update: #18229
Current Change Set: Unnamed1
Image format 68021 (64 bit)

Virtual Machine
---
/Applications/Squeak5.2-18229-64bit.app/Contents/MacOS/Squeak
Croquet Closure Cog[Spur] VM [CoInterpreterPrimitives
VMMaker.oscog-eem.2461] 64 bit
Mac OS X built on Oct 20 2018 08:16:09 UTC Compiler: 4.2.1 Compatible Apple
LLVM 7.3.0 (clang-703.0.31)
platform sources revision VM: 201810190412
https://github.com/OpenSmalltalk/opensmalltalk-vm.git Date: Thu Oct 18
21:12:21 2018 CommitHash: 15341b5 Plugins: 201810190412
https://github.com/OpenSmalltalk/opensmalltalk-vm.git
CoInterpreter VMMaker.oscog-eem.2461 uuid:
b3cd33f5-6309-43a1-b669-7a1805111f34 Oct 20 2018
StackToRegisterMappingCogit VMMaker.oscog-eem.2464 uuid:
0b1fa0a3-a781-4fd5-b1cf-1809796ccbbf Oct 20 2018



 




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



Re: [Pharo-users] NewWave - WorkflowEngine

2019-04-17 Thread Tomaž Turk
This is excellent, thanks! For busness applications, getting the tools 
for process-driven development is essential. Some emails ago there was 
an announcement on Netstyle's engine available here 
https://github.com/Netstyle/Workflow.


Best wishes,
Tomaz

-- Original Message --
From: "Sebastijan Kaplar" 
To: "pharo-users@lists.pharo.org" 
Sent: 17. 04. 2019 15:03:23
Subject: [Pharo-users] NewWave - WorkflowEngine


Hello everyone,

we've been working on a workflow engine written in Pharo. You can check 
it out at: https://github.com/skaplar/NewWave
It is still in the early development and we discussed about making it 
public so everyone interested can join, take a look or provide any kind 
of feedback. I'm also at discord so you can contact me @skaplar.


Best regards,
Sebastijan Kaplar

Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread Stephan Eggermont
TedVanGaalen  wrote:

> The freeze problem still exist. (since 2017, starting with Pharo 6) 

Hi Ted. It would be interesting to see if this is related to the fullscreen
bug I described in an opensmalltalkvm issue. I was able to triangulate it
to a set of commits, so could you try with a vm from just before?

Stephan




Re: [Pharo-users] Migration from VW to Pharo

2019-04-17 Thread Christian Haider
There is the bundle {Gemstone Fileout Project} in the public store (MIT 
license).

Some information about it is at [1] and in the slides of the “PDF for Gemstone” 
talk at ESUG 2017 [2].

 

It is a generic code transformation machinery controlled by a declarative 
specification of changes to be applied to the source code (VW) to create target 
code (Gemstone). The tool is almost complete (class renamings, needed for 
namespace translations, are missing and overrides are not tested) and provably 
useful, since it was sufficient to port the PDFtalk project with it.

 

To make it work for VW -> Pharo, class renamings need to get implemented, if 
you use namespaces in your source system. Also, the backend needs to get 
extended to create Tonel or FileOut format source files.

 

Both features are not too difficult to add. If your project is large, this 
might be a way to do it.

Especially, if you don’t want only a one-shot migration, but to maintain an 
evolving project for different dialects, this approach is very attractive, I 
find.

 

Happy hacking,

Christian

 

[1] https://wiki.pdftalk.de/doku.php?id=gemstonefileout

[2] https://www.slideshare.net/esug/pdftalk-for-gemstone

 

Von: Pharo-users  Im Auftrag von Sreenath 
G K
Gesendet: Mittwoch, 17. April 2019 13:52
An: pharo-users@lists.pharo.org
Betreff: [Pharo-users] Migration from VW to Pharo

 

Hello All,

 

I just wanted to know if we have any tools for which we can make use of to 
migrate VW code base into Pharo. If something is there please let me know or 
your suggestion d to port it.

 

Thanks in advance.

 

Best Regards,

Sree



Re: [Pharo-users] Migration from VW to Pharo

2019-04-17 Thread Esteban Maringolo
You can migrate from Store to a git repository using a virtual machine
with Linux and then continue working on Windows.

It is certainly going to be simpler than having to export
packages/bundles manually from VisualWorks.

Esteban A. Maringolo

On Wed, Apr 17, 2019 at 9:51 AM Sreenath G K  wrote:
>
> Hey,
>
> Unfortunately I have Windows though. I will have a look at it. Thanks for 
> letting me know
>
> Best Regards,
> Sree
>
> On Wed, Apr 17, 2019, 5:27 PM Esteban Maringolo  wrote:
>>
>> There is this tool: https://github.com/GemTalk/SETT
>>
>> I used it with a few packages with no special Namespace and it worked just 
>> fine.
>>
>> It provides, however, several settings to map namespaces, packages,
>> etc, so it should work.
>>
>> It only works in Linux though, because of the dependency to external
>> process calls.
>>
>> Regards,
>>
>> Esteban A. Maringolo
>>
>> On Wed, Apr 17, 2019 at 8:53 AM Sreenath G K  wrote:
>> >
>> > Hello All,
>> >
>> > I just wanted to know if we have any tools for which we can make use of to 
>> > migrate VW code base into Pharo. If something is there please let me know 
>> > or your suggestion d to port it.
>> >
>> > Thanks in advance.
>> >
>> > Best Regards,
>> > Sree
>>



[Pharo-users] NewWave - WorkflowEngine

2019-04-17 Thread Sebastijan Kaplar
Hello everyone,

we've been working on a workflow engine written in Pharo. You can check it out 
at: https://github.com/skaplar/NewWave
It is still in the early development and we discussed about making it public so 
everyone interested can join, take a look or provide any kind of feedback. I'm 
also at discord so you can contact me @skaplar.

Best regards,
Sebastijan Kaplar


Re: [Pharo-users] Migration from VW to Pharo

2019-04-17 Thread Sreenath G K
Hey,

Unfortunately I have Windows though. I will have a look at it. Thanks for
letting me know

Best Regards,
Sree

On Wed, Apr 17, 2019, 5:27 PM Esteban Maringolo 
wrote:

> There is this tool: https://github.com/GemTalk/SETT
>
> I used it with a few packages with no special Namespace and it worked just
> fine.
>
> It provides, however, several settings to map namespaces, packages,
> etc, so it should work.
>
> It only works in Linux though, because of the dependency to external
> process calls.
>
> Regards,
>
> Esteban A. Maringolo
>
> On Wed, Apr 17, 2019 at 8:53 AM Sreenath G K 
> wrote:
> >
> > Hello All,
> >
> > I just wanted to know if we have any tools for which we can make use of
> to migrate VW code base into Pharo. If something is there please let me
> know or your suggestion d to port it.
> >
> > Thanks in advance.
> >
> > Best Regards,
> > Sree
>
>


Re: [Pharo-users] How to prevent Mustache from replacing & with etc.?

2019-04-17 Thread Norbert Hartl


> Am 17.04.2019 um 11:19 schrieb jtuc...@objektfabrik.de:
> 
> Hi Norbert,
> 
> thanks for commenting. I had a bad feeling about creating new class editions 
> while I implemented them, so I appreciate your comments and I'll revisit my 
> implementation, because I agree with all of your input here.
> Especially extending the Visitor felt "wrong" or bad. DD can be helpful, but 
> does not lend itself well to extensions, especially "personal" ones ;-)
> 
> I didn't expect you to accept my extensions to Mustache anyways, becaus 
> Mustache should be Mustache.
> 
> But given that we now have multiple "standard" mechanisms for mixing text 
> into templates in Smalltalk, and none fits very well for a lot of cases, I 
> thought it could probably be a good starting point to look into Mustache as a 
> powerful and nicely crafted starting point for more extendable 
> implementations for inserting text. An  extension point that builds on top of 
> your
> 
> parser := MustacheParser new.
> parser delimiterExtensions at: $§ put: [ parser readLaTeXEscapedToken ]
> 
> suggestion would be nice, but is not needed.
> 
> I am just playing with ideas here.
> 
> 
> Again: thanks a lot for your help and comments. Even if nobody else never 
> needs or wants what I will implement here, this still helps me a lot in 
> achieving what I need.
> 
If you want to try you can checkout 
https://github.com/noha/mustache/tree/api-enhancements 
 branch. I enhanced the 
API so you can set a custom visitor. Now you can do:

aTemplate
value: aDictionary
visitor: MyCustomVisitor new

Hope it helps!

Norbert
> 
> 
> Joachim
> 
> 
> 
> 
> 
> 
> Am 17.04.19 um 10:52 schrieb Norbert Hartl:
>> Joachim,
>> 
>> I put the comments inline.
>> 
>>> Am 17.04.2019 um 10:34 schrieb jtuc...@objektfabrik.de:
>>> 
>>> So I think I found a solution for my problem which seems to work. Thanks 
>>> for listening and your input of ideas.
>>> 
>>> 
>>> What I did was to follow this idea:
>>> 
>>> 
 I am thinking of introducing a modifier, say § to switch the html entity 
 encoding for another one which I of course have to implement on my own. 
 The end result would be:
 
 {{ myObject }} to encoe with HTML entities for all things (X)HTML
 {{& myObject }} to not encode at all (e.g. when I need & as & in the 
 resulting String)
 {{§ myObject }}for an individually added encoding (tbd - for my LaTeX 
 needs)
 
>>> It turns out is was easy to implement a prototype of this (20 minutes?)
>>> 
>>> There is only one tiny hole in this implementation: If I want to fill in a 
>>> table body with Text that includes an &. I need to think about it later. 
>>> Maybe I'll have to come back to the catcode thingie and choose some 
>>> unlikely character for column separation and use my newly implemented {{§ 
>>> encoding...
>>> 
>>> 
>>> All that's needed to implement the above idea were these changes (VA 
>>> Smalltalk Fileout Format):
>>> 
>>> 
>>> !Character publicMethods !
>>> 
>>> asLaTeXString
>>> "substitute characters like &  into LaTex compliant elements"
>>> "For protoytpe just encode &"
>>> 
>>> (Dictionary  with: $& -> '\&')
>>> keysAndValuesDo: [:k :v | self = k ifTrue: [^v]].
>>> ^String with: self! !
>>> 
>>> !String publicMethods !
>>> 
>>> asLaTeXString
>>> "substitute the < & > into LaTeX compliant elements"
>>> "'<&>' asLaTeXString"
>>> ^ self class new: self size streamContents: [ :s|
>>> self do: [:c | s nextPutAll: c asLaTeXString ]]! !
>>> 
>>> 
>>> MustacheToken subclass: #MustacheLaTeXEscapedToken
>>>   instanceVariableNames: ''
>>>   classVariableNames: ''
>>>   poolDictionaries: ''!
>>> 
>>> !MustacheLaTeXEscapedToken publicMethods !
>>> 
>>> accept: aVisitor
>>> 
>>> aVisitor visitLaTeXEscapedToken:  self!
>>> 
>>> valueInContext: anObject
>>> 
>>> ^(super valueInContext: anObject)asLaTeXString ! !
>>> 
>> This is the way it is designed so you can use your own token/visitor pair to 
>> extend it.
>>> !MustacheParser publicMethods !
>>> 
>>> buildDelimiterExtensions
>>> 
>>> ^Dictionary new
>>> at: $# put: [self startSection: #MustacheSection abrAsClass];
>>> at: $/ put: [self endSection];
>>> at: ${ put: [self readDefaultUnescapedToken];
>>> at: $& put: [self readUnescapedToken];
>>> at: $!! put: [self readComment];
>>> at: $^ put: [self startSection: #MustacheInvertedSection 
>>> abrAsClass];
>>> at: $= put: [self readChangeDelimiter];
>>> at: $> put: [self readPartial];
>>> at: $§ put: [self readLaTeXEscapedToken];
>>> yourself!
>>> 
>> I don’t think you need to change the parser to do that.
>> 
>> parser := MustacheParser new.
>> parser delimiterExtensions at: $§ put: [ parser readLaTeXEscapedToken ].
>> 
>> should do as well. If you have more specific needs I would subclass the 
>> parser
>> 
>>> 

Re: [Pharo-users] Migration from VW to Pharo

2019-04-17 Thread Esteban Maringolo
There is this tool: https://github.com/GemTalk/SETT

I used it with a few packages with no special Namespace and it worked just fine.

It provides, however, several settings to map namespaces, packages,
etc, so it should work.

It only works in Linux though, because of the dependency to external
process calls.

Regards,

Esteban A. Maringolo

On Wed, Apr 17, 2019 at 8:53 AM Sreenath G K  wrote:
>
> Hello All,
>
> I just wanted to know if we have any tools for which we can make use of to 
> migrate VW code base into Pharo. If something is there please let me know or 
> your suggestion d to port it.
>
> Thanks in advance.
>
> Best Regards,
> Sree



[Pharo-users] Migration from VW to Pharo

2019-04-17 Thread Sreenath G K
Hello All,

I just wanted to know if we have any tools for which we can make use of to
migrate VW code base into Pharo. If something is there please let me know
or your suggestion d to port it.

Thanks in advance.

Best Regards,
Sree


Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread TedVanGaalen
Hi Sven
-launched the original image again.
-dragged the Pharo window to almost full screen, (4K) 

  it then gets redrawing problems: 
  - drawing the window contents partly 
  - and in the wrong places
  and after a short time then freezes again.
  Exactly the same symptoms as described previously in this thread in 2017.

I tried this several times: launching Pharo with the original pristine
image.
dragging the window bigger, hitting the green bullet + option key etc. 

I have no idea why. frustrating. want to get things done with Pharo.

Is pharo tested on 4K macs and/or mac mini with 4K screens?
so on anything with this resolution?

Does Pharo or the VM emit a post-mortem log/dump file? cannot find any. 

All other apps run without problems and Pharo 5 did also run OK.

TedvG






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



Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread Sven Van Caekenberghe
Try option-click on the green window expansion button. 
This will put the window in almost full screen mode. 
In my experience, that works much better.

> On 17 Apr 2019, at 13:05, TedVanGaalen  wrote:
> 
> Hi Paul
> thanks for responding.
> 
> what I did now:
> - removed all Pharo apps & images etc. from my system
> (no problem, i have all i need backed up in .st and .mcz files)
> followed your instructions to install the latest VM and Image:
> 
>  terminal log: ===
> 
> teds-personal-mac-mini:~ TedvG$ curl https://get.pharo.org/64/ | bash
>  % Total% Received % Xferd  Average Speed   TimeTime Time 
> Current
> Dload  Upload   Total   SpentLeft 
> Speed
> 100 12695  100 126950 0  53119  0 --:--:-- --:--:-- --:--:--
> 53117
> Downloading the latest 70 Image:
>http://files.pharo.org/get-files/70/pharo64.zip
> Pharo.image
> Downloading the latest pharoVM:
>   http://files.pharo.org/get-files/70/pharo64-mac-stable.zip
> pharo-vm/Pharo.app/Contents/MacOS/Pharo
> Creating starter scripts pharo and pharo-ui
> teds-personal-mac-mini:~ TedvG$ ./pharo-ui Pahro.image
> teds-personal-mac-mini:~ TedvG$ ./pharo-ui Pharo.image
> teds-personal-mac-mini:~ TedvG$ ./pharo-ui version
> teds-personal-mac-mini:~ TedvG$ ./pharo-ui --version
> 5.0 5.0.201901051900 Mac OS X built on Jan  5 2019 19:11:02 UTC Compiler:
> 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31) [Production Spur 64-bit
> VM]
> CoInterpreter VMMaker.oscog-eem.2504 uuid:
> a00b0fad-c04c-47a6-8a11-5dbff110ac11 Jan  5 2019
> StackToRegisterMappingCogit VMMaker.oscog-eem.2504 uuid:
> a00b0fad-c04c-47a6-8a11-5dbff110ac11 Jan  5 2019
> VM: 201901051900 https://github.com/OpenSmalltalk/opensmalltalk-vm.git
> Date: Sat Jan 5 20:00:11 2019 CommitHash: 7a3c6b6
> Plugins: 201901051900 https://github.com/OpenSmalltalk/opensmalltalk-vm.git
> 
> teds-personal-mac-mini:~ TedvG$ ./pharo-ui Pharo.image
> ./pharo-ui: line 11:  1539 Terminated: 15 
> "$DIR"/"pharo-vm/Pharo.app/Contents/MacOS/Pharo" "$@"
> teds-personal-mac-mini:~ TedvG$ 
> end terminal log 
> 
> In the above as yet unchanged new image, I did nothing else
> than "toggle full screen mode"  in the menu bar
> Pharo then freezes. had to kill it with force quit.
> 
> As you can see in the terminal log, it emits this line when/before freezing:
> ./pharo-ui: line 11:  1539 Terminated: 15 
> "$DIR"/"pharo-vm/Pharo.app/Contents/MacOS/Pharo" "$@"
> Maybe this is helpful.
> Would be strange if I am the only one with this problem?
> Kind regards
> TedvG
>  
> 
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 




Re: [Pharo-users] Pharo 6.0 and 6.1 64 bit freeze on MacMini -also in 7.03

2019-04-17 Thread TedVanGaalen
Hi Paul
thanks for responding.

what I did now:
- removed all Pharo apps & images etc. from my system
(no problem, i have all i need backed up in .st and .mcz files)
followed your instructions to install the latest VM and Image:

 terminal log: ===

teds-personal-mac-mini:~ TedvG$ curl https://get.pharo.org/64/ | bash
  % Total% Received % Xferd  Average Speed   TimeTime Time 
Current
 Dload  Upload   Total   SpentLeft 
Speed
100 12695  100 126950 0  53119  0 --:--:-- --:--:-- --:--:--
53117
Downloading the latest 70 Image:
http://files.pharo.org/get-files/70/pharo64.zip
Pharo.image
Downloading the latest pharoVM:
http://files.pharo.org/get-files/70/pharo64-mac-stable.zip
pharo-vm/Pharo.app/Contents/MacOS/Pharo
Creating starter scripts pharo and pharo-ui
teds-personal-mac-mini:~ TedvG$ ./pharo-ui Pahro.image
teds-personal-mac-mini:~ TedvG$ ./pharo-ui Pharo.image
teds-personal-mac-mini:~ TedvG$ ./pharo-ui version
teds-personal-mac-mini:~ TedvG$ ./pharo-ui --version
5.0 5.0.201901051900 Mac OS X built on Jan  5 2019 19:11:02 UTC Compiler:
4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31) [Production Spur 64-bit
VM]
CoInterpreter VMMaker.oscog-eem.2504 uuid:
a00b0fad-c04c-47a6-8a11-5dbff110ac11 Jan  5 2019
StackToRegisterMappingCogit VMMaker.oscog-eem.2504 uuid:
a00b0fad-c04c-47a6-8a11-5dbff110ac11 Jan  5 2019
VM: 201901051900 https://github.com/OpenSmalltalk/opensmalltalk-vm.git
Date: Sat Jan 5 20:00:11 2019 CommitHash: 7a3c6b6
Plugins: 201901051900 https://github.com/OpenSmalltalk/opensmalltalk-vm.git

teds-personal-mac-mini:~ TedvG$ ./pharo-ui Pharo.image
./pharo-ui: line 11:  1539 Terminated: 15 
"$DIR"/"pharo-vm/Pharo.app/Contents/MacOS/Pharo" "$@"
teds-personal-mac-mini:~ TedvG$ 
end terminal log 

In the above as yet unchanged new image, I did nothing else
than "toggle full screen mode"  in the menu bar
Pharo then freezes. had to kill it with force quit.

As you can see in the terminal log, it emits this line when/before freezing:
./pharo-ui: line 11:  1539 Terminated: 15 
"$DIR"/"pharo-vm/Pharo.app/Contents/MacOS/Pharo" "$@"
Maybe this is helpful.
Would be strange if I am the only one with this problem?
Kind regards
TedvG
 




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



Re: [Pharo-users] Fwd: Re: How to prevent Mustache from replacing & with etc.?

2019-04-17 Thread jtuc...@objektfabrik.de

Hi Norbert,

thanks for commenting. I had a bad feeling about creating new class 
editions while I implemented them, so I appreciate your comments and 
I'll revisit my implementation, because I agree with all of your input here.
Especially extending the Visitor felt "wrong" or bad. DD can be helpful, 
but does not lend itself well to extensions, especially "personal" ones ;-)


I didn't expect you to accept my extensions to Mustache anyways, becaus 
Mustache should be Mustache.


But given that we now have multiple "standard" mechanisms for mixing 
text into templates in Smalltalk, and none fits very well for a lot of 
cases, I thought it could probably be a good starting point to look into 
Mustache as a powerful and nicely crafted starting point for more 
extendable implementations for inserting text. An  extension point that 
builds on top of your


parser := MustacheParser new.
parser delimiterExtensions at: $§ put: [ parser readLaTeXEscapedToken ]

suggestion would be nice, but is not needed.

I am just playing with ideas here.


Again: thanks a lot for your help and comments. Even if nobody else 
never needs or wants what I will implement here, this still helps me a 
lot in achieving what I need.




Joachim






Am 17.04.19 um 10:52 schrieb Norbert Hartl:

Joachim,

I put the comments inline.


Am 17.04.2019 um 10:34 schrieb jtuc...@objektfabrik.de:

So I think I found a solution for my problem which seems to work. Thanks for 
listening and your input of ideas.


What I did was to follow this idea:



I am thinking of introducing a modifier, say § to switch the html entity 
encoding for another one which I of course have to implement on my own. The end 
result would be:

{{ myObject }} to encoe with HTML entities for all things (X)HTML
{{& myObject }} to not encode at all (e.g. when I need & as & in the 
resulting String)
{{§ myObject }}for an individually added encoding (tbd - for my LaTeX needs)


It turns out is was easy to implement a prototype of this (20 minutes?)

There is only one tiny hole in this implementation: If I want to fill in a table 
body with Text that includes an &. I need to think about it later. Maybe I'll 
have to come back to the catcode thingie and choose some unlikely character for 
column separation and use my newly implemented {{§ encoding...


All that's needed to implement the above idea were these changes (VA Smalltalk 
Fileout Format):


!Character publicMethods !

asLaTeXString
 "substitute characters like &  into LaTex compliant elements"
 "For protoytpe just encode &"

 (Dictionary  with: $& -> '\&')
 keysAndValuesDo: [:k :v | self = k ifTrue: [^v]].
 ^String with: self! !

!String publicMethods !

asLaTeXString
 "substitute the < & > into LaTeX compliant elements"
 "'<&>' asLaTeXString"
 ^ self class new: self size streamContents: [ :s|
 self do: [:c | s nextPutAll: c asLaTeXString ]]! !


MustacheToken subclass: #MustacheLaTeXEscapedToken
   instanceVariableNames: ''
   classVariableNames: ''
   poolDictionaries: ''!

!MustacheLaTeXEscapedToken publicMethods !

accept: aVisitor

 aVisitor visitLaTeXEscapedToken:  self!

valueInContext: anObject

 ^(super valueInContext: anObject)asLaTeXString ! !


This is the way it is designed so you can use your own token/visitor pair to 
extend it.

!MustacheParser publicMethods !

buildDelimiterExtensions

 ^Dictionary new
 at: $# put: [self startSection: #MustacheSection abrAsClass];
 at: $/ put: [self endSection];
 at: ${ put: [self readDefaultUnescapedToken];
 at: $& put: [self readUnescapedToken];
 at: $!! put: [self readComment];
 at: $^ put: [self startSection: #MustacheInvertedSection abrAsClass];
 at: $= put: [self readChangeDelimiter];
 at: $> put: [self readPartial];
 at: $§ put: [self readLaTeXEscapedToken];
 yourself!


I don’t think you need to change the parser to do that.

parser := MustacheParser new.
parser delimiterExtensions at: $§ put: [ parser readLaTeXEscapedToken ].

should do as well. If you have more specific needs I would subclass the parser


!MustacheVisitor publicMethods !

visitLaTeXEscapedToken: aToken ! !


!MustacheWriteVisitor publicMethods !

visitLaTeXEscapedToken: aToken

 self addString: (aToken valueInContext: context)! !



I would make a visitor subclass for that. The problem is that the write visitor 
class name is hardcoded. We need to make that a setting. Then you could provide 
your own visitor.

This way you can make it a real extension to mustache.



So what do people think about this? Is this a worthwhile extension? Do you see 
problems on the horizon that I cannot see?



I don’t think it is a good extension. Mustache is implemented along the 
documentation and putting every use case in the code is not good. Changing the 
code so you can apply your changes or provide an extension package is needed of 
course.

Norbert



Re: [Pharo-users] Fwd: Re: How to prevent Mustache from replacing & with etc.?

2019-04-17 Thread Norbert Hartl
Joachim,

I put the comments inline.

> Am 17.04.2019 um 10:34 schrieb jtuc...@objektfabrik.de:
> 
> So I think I found a solution for my problem which seems to work. Thanks for 
> listening and your input of ideas.
> 
> 
> What I did was to follow this idea:
> 
> 
>> I am thinking of introducing a modifier, say § to switch the html entity 
>> encoding for another one which I of course have to implement on my own. The 
>> end result would be:
>> 
>> {{ myObject }} to encoe with HTML entities for all things (X)HTML
>> {{& myObject }} to not encode at all (e.g. when I need & as & in the 
>> resulting String)
>> {{§ myObject }}for an individually added encoding (tbd - for my LaTeX 
>> needs)
>> 
> It turns out is was easy to implement a prototype of this (20 minutes?)
> 
> There is only one tiny hole in this implementation: If I want to fill in a 
> table body with Text that includes an &. I need to think about it later. 
> Maybe I'll have to come back to the catcode thingie and choose some unlikely 
> character for column separation and use my newly implemented {{§ encoding...
> 
> 
> All that's needed to implement the above idea were these changes (VA 
> Smalltalk Fileout Format):
> 
> 
> !Character publicMethods !
> 
> asLaTeXString
> "substitute characters like &  into LaTex compliant elements"
> "For protoytpe just encode &"
> 
> (Dictionary  with: $& -> '\&')
> keysAndValuesDo: [:k :v | self = k ifTrue: [^v]].
> ^String with: self! !
> 
> !String publicMethods !
> 
> asLaTeXString
> "substitute the < & > into LaTeX compliant elements"
> "'<&>' asLaTeXString"
> ^ self class new: self size streamContents: [ :s|
> self do: [:c | s nextPutAll: c asLaTeXString ]]! !
> 
> 
> MustacheToken subclass: #MustacheLaTeXEscapedToken
>   instanceVariableNames: ''
>   classVariableNames: ''
>   poolDictionaries: ''!
> 
> !MustacheLaTeXEscapedToken publicMethods !
> 
> accept: aVisitor
> 
> aVisitor visitLaTeXEscapedToken:  self!
> 
> valueInContext: anObject
> 
> ^(super valueInContext: anObject)asLaTeXString ! !
> 
This is the way it is designed so you can use your own token/visitor pair to 
extend it.
> 
> !MustacheParser publicMethods !
> 
> buildDelimiterExtensions
> 
> ^Dictionary new
> at: $# put: [self startSection: #MustacheSection abrAsClass];
> at: $/ put: [self endSection];
> at: ${ put: [self readDefaultUnescapedToken];
> at: $& put: [self readUnescapedToken];
> at: $!! put: [self readComment];
> at: $^ put: [self startSection: #MustacheInvertedSection abrAsClass];
> at: $= put: [self readChangeDelimiter];
> at: $> put: [self readPartial];
> at: $§ put: [self readLaTeXEscapedToken];
> yourself!
> 
I don’t think you need to change the parser to do that.

parser := MustacheParser new.
parser delimiterExtensions at: $§ put: [ parser readLaTeXEscapedToken ].

should do as well. If you have more specific needs I would subclass the parser

> 
> !MustacheVisitor publicMethods !
> 
> visitLaTeXEscapedToken: aToken ! !
> 
> 
> !MustacheWriteVisitor publicMethods !
> 
> visitLaTeXEscapedToken: aToken
> 
> self addString: (aToken valueInContext: context)! !
> 
> 
I would make a visitor subclass for that. The problem is that the write visitor 
class name is hardcoded. We need to make that a setting. Then you could provide 
your own visitor. 

This way you can make it a real extension to mustache.

> 
> 
> So what do people think about this? Is this a worthwhile extension? Do you 
> see problems on the horizon that I cannot see?
> 
> 
I don’t think it is a good extension. Mustache is implemented along the 
documentation and putting every use case in the code is not good. Changing the 
code so you can apply your changes or provide an extension package is needed of 
course.

Norbert

> Joachim
> 
> 
> 
> 
> 
> 
> -- 
> 
> ---
> Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de
> Fliederweg 1 http://www.objektfabrik.de
> D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com
> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
> 
> 
> 




Re: [Pharo-users] Fwd: Re: How to prevent Mustache from replacing & with etc.?

2019-04-17 Thread jtuc...@objektfabrik.de
So I think I found a solution for my problem which seems to work. Thanks 
for listening and your input of ideas.



What I did was to follow this idea:


I am thinking of introducing a modifier, say § to switch the html 
entity encoding for another one which I of course have to implement on 
my own. The end result would be:


{{ myObject }}     to encoe with HTML entities for all things (X)HTML
{{& myObject }}     to not encode at all (e.g. when I need & as & in 
the resulting String)
{{§ myObject }}    for an individually added encoding (tbd - for my 
LaTeX needs)



It turns out is was easy to implement a prototype of this (20 minutes?)

There is only one tiny hole in this implementation: If I want to fill in 
a table body with Text that includes an &. I need to think about it 
later. Maybe I'll have to come back to the catcode thingie and choose 
some unlikely character for column separation and use my newly 
implemented {{§ encoding...



All that's needed to implement the above idea were these changes (VA 
Smalltalk Fileout Format):



!Character publicMethods !

asLaTeXString
    "substitute characters like &  into LaTex compliant elements"
    "For protoytpe just encode &"

    (Dictionary  with: $& -> '\&')
        keysAndValuesDo: [:k :v | self = k ifTrue: [^v]].
    ^String with: self! !

!String publicMethods !

asLaTeXString
    "substitute the < & > into LaTeX compliant elements"
    "'<&>' asLaTeXString"
    ^ self class new: self size streamContents: [ :s|
        self do: [:c | s nextPutAll: c asLaTeXString ]]! !


MustacheToken subclass: #MustacheLaTeXEscapedToken
  instanceVariableNames: ''
  classVariableNames: ''
  poolDictionaries: ''!

!MustacheLaTeXEscapedToken publicMethods !

accept: aVisitor

    aVisitor visitLaTeXEscapedToken:  self!

valueInContext: anObject

    ^(super valueInContext: anObject)asLaTeXString ! !


!MustacheParser publicMethods !

buildDelimiterExtensions

    ^Dictionary new
        at: $# put: [self startSection: #MustacheSection abrAsClass];
        at: $/ put: [self endSection];
        at: ${ put: [self readDefaultUnescapedToken];
        at: $& put: [self readUnescapedToken];
        at: $!! put: [self readComment];
        at: $^ put: [self startSection: #MustacheInvertedSection 
abrAsClass];

        at: $= put: [self readChangeDelimiter];
        at: $> put: [self readPartial];
        at: $§ put: [self readLaTeXEscapedToken];
        yourself!


!MustacheVisitor publicMethods !

visitLaTeXEscapedToken: aToken ! !


!MustacheWriteVisitor publicMethods !

visitLaTeXEscapedToken: aToken

    self addString: (aToken valueInContext: context)! !




So what do people think about this? Is this a worthwhile extension? Do 
you see problems on the horizon that I cannot see?



Joachim






--

---
Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1





[Pharo-users] Fwd: Re: How to prevent Mustache from replacing & with etc.?

2019-04-17 Thread jtuc...@objektfabrik.de

I sent this to Norbert only instead of to the list...


---

Hi Norbert,

so I already found the & modifier, which means  {{& myObject.asString }} 
will not have escaped characters in it.
So far so good for & which I want to be interpreted by LaTeX as Column 
delimiters.


But now I have this need for &'s that should be printed. Of course that 
means I need the encoded, just not as HTML entities ;-)



Do you happen to know how I could implement my own modifier that enables 
to plug a custom encoding?


I am thinking of introducing a modifier, say § to switch the html entity 
encoding for another one which I of course have to implement on my own. 
The end result would be:


{{ myObject }}     to encoe with HTML entities for all things (X)HTML
{{& myObject }}     to not encode at all (e.g. when I need & as & in the 
resulting String)
{{§ myObject }}    for an individually added encoding (tbd - for my 
LaTeX needs)


A mechanism like this could be used to make a "universal superset" of 
Mustache, I guess. Especially if we introduce some syntax for selecting 
an encoding from the template...



Any pointers are welcome. And also ideas if this is a feasible/clever 
idea or not.


Joachim





Am 17.04.19 um 08:31 schrieb Norbert Hartl:

Joachim,


Am 17.04.2019 um 07:56 schrieb jtuc...@objektfabrik.de:

Norbert,

thanks for answering. I had tried the {{{ }}} option. In case of 
LaTeX, this is not so easy, however, because {{{ and }}} are 
completely valid syntactical elements of LaTeX.


It seems like you can replace {{ and }} in Mustache, but not {{{ and 
}}}. At least it didn't work when I tried. Using '{{{=### ###=}}} ' 
in my MustacheTemplate would leave text like 
'###myObject.printString###' unchanged in the resulting text instead 
of replacing it with the text representation of myObject.


So what I tried last and what gave me quite some mileage on the way 
to a sulotion was to use


\catcode to replace & with ; in my LaTeX file for the Column 
separator problem
{{=## to make sure I can fill in my table rows with ; as column 
separator.


Thus my Mustache-Template looks like this (excerpt):

% redefine Mustache-Insertion syntax {{=## ##=}}
\catcode`\;=4 % redefine ; for & to allow non-escaped 
column-separators in \tabular


...
\begin{tabular}{ccp{6.0cm}rrr}
##myObject.asLatexTableRows## % This is where & is needed for LaTeX 
to separate table columns, but Mustache would replace the with the 
html entity 

\end{tabular}


This is a bit hacky, and as I wrote, also still presents problems, 
because if any of the Strings being inserted using Mustache contains 
an &, there will be an  in the .tex file, which will lead to a 
LaTeX error.



So, essentially, what I am most likely looking for is a way to 
replace {{{ and }}} in Mustache to make sure the $&'s will remain 
untouched in my inserted text...
Sorry for asking the wrong question, I was so glad how far I'd gotten 
with what I did that I didn't see the forest between all the trees.


So my real question is: how can I replace {{{ in Mustache with 
something that will not irritate LaTeX?



Any ideas?

Sure ;) In Mustache {{ and }} are the default delimiters. Every 
addtional character is a modifier. So {{{ is actuall a start delimiter 
{{ with a { as modifier. So what you can do is to change the delimiter 
but leave the { modifier like so


'{{=<% %>=}} <%{ value %>}' asMustacheTemplate value: { #value -> 
'' } asDictionary


So {{ is the start delimiter, = is the modifier to change the 
delimiters. We set them to <% and %>. If you want to have unescaped 
strings you keep using the { on the new delimiter which turns out to 
be <%{ and %>}.


Norbert

Am 16.04.19 um 12:00 schrieb Norbert Hartl:

Hi,



Am 16.04.2019 um 09:02 schrieb jtuc...@objektfabrik.de:

Hi Pharoers,


I may be a bit wrong on this list. I try anyways.

I am using Mustache to fill text into a String which will then be 
handed over to LaTeX. The Data I fill in comes from the Database.


Now the problem is this: if a String from the database contains an 
ampersand (like in 'Katz & Maus'), Mustache will replace special 
chars with HTML entities. That is fine in a web context, but LaTeX 
doesnt actually work well with HTML entities. I could, of course, 
remove the html entities after Mustache invested a lopt of work 
into creating them. But it seems more logical to keep Mustache from 
being so eager to help.
It is not logical because mustache is defined that way. So 
redefining does not improve it. But just use triple {{{ }}} to have 
strings not being escaped.


BTW: I already took the hurdle of Mustache excaping $& fir tabular 
environments (LaTeX uses the ampersand as a divider for table 
cells) by using \catcode in our .tex template files. But now the 
String comes from the database and so I am a bit lost...



So is there any best practice for this problem?


Yes, use it this way

'{{{ value }}}' asMustacheTemplate value: { #value -> '' } 
asDictionary


Norbert




--

Re: [Pharo-users] How to prevent Mustache from replacing & with etc.?

2019-04-17 Thread Norbert Hartl


> Am 17.04.2019 um 08:31 schrieb Norbert Hartl :
> 
> Joachim,
> 
>> Am 17.04.2019 um 07:56 schrieb jtuc...@objektfabrik.de:
>> 
>> Norbert,
>> 
>> thanks for answering. I had tried the {{{ }}} option. In case of LaTeX, this 
>> is not so easy, however, because {{{ and }}} are completely valid 
>> syntactical elements of LaTeX.
>> 
>> It seems like you can replace {{ and }} in Mustache, but not {{{ and }}}. At 
>> least it didn't work when I tried. Using '{{{=### ###=}}} ' in my 
>> MustacheTemplate would leave text like '###myObject.printString###' 
>> unchanged in the resulting text instead of replacing it with the text 
>> representation of myObject.
>> 
>> So what I tried last and what gave me quite some mileage on the way to a 
>> sulotion was to use
>> 
>> \catcode to replace & with ; in my LaTeX file for the Column separator 
>> problem
>> {{=## to make sure I can fill in my table rows with ; as column separator.
>> 
>> Thus my Mustache-Template looks like this (excerpt):
>> 
>> % redefine Mustache-Insertion syntax {{=## ##=}}
>> \catcode`\;=4 % redefine ; for & to allow non-escaped column-separators in 
>> \tabular
>> 
>> ...
>> \begin{tabular}{ccp{6.0cm}rrr}
>> ##myObject.asLatexTableRows##  % This is where & is needed for LaTeX to 
>> separate table columns, but Mustache would replace the with the html entity 
>> 
>> \end{tabular}
>> 
>> 
>> This is a bit hacky, and as I wrote, also still presents problems, because 
>> if any of the Strings being inserted using Mustache contains an &, there 
>> will be an  in the .tex file, which will lead to a LaTeX error.
>> 
>> 
>> So, essentially, what I am most likely looking for is a way to replace {{{ 
>> and }}} in Mustache to make sure the $&'s will remain untouched in my 
>> inserted text...
>> Sorry for asking the wrong question, I was so glad how far I'd gotten with 
>> what I did that I didn't see the forest between all the trees.
>> 
>> So my real question is: how can I replace {{{ in Mustache with something 
>> that will not irritate LaTeX?
>> 
>> 
>> Any ideas?
>> 
> Sure ;) In Mustache {{ and }} are the default delimiters. Every addtional 
> character is a modifier. So {{{ is actuall a start delimiter {{ with a { as 
> modifier. So what you can do is to change the delimiter but leave the { 
> modifier like so 
> 
> '{{=<% %>=}} <%{ value %>}' asMustacheTemplate value: { #value -> '' } 
> asDictionary 
> 
> So {{ is the start delimiter, = is the modifier to change the delimiters. We 
> set them to <% and %>. If you want to have unescaped strings you keep using 
> the { on the new delimiter which turns out to be <%{ and %>}. 
> 
I’m not sure the { should not be nested. Need to think about it. It might 
should be like <%{ }%>.

Norbert

> Norbert
>> 
>> Am 16.04.19 um 12:00 schrieb Norbert Hartl:
>>> Hi,
>>> 
>>> 
 Am 16.04.2019 um 09:02 schrieb jtuc...@objektfabrik.de:
 
 Hi Pharoers,
 
 
 I may be a bit wrong on this list. I try anyways.
 
 I am using Mustache to fill text into a String which will then be handed 
 over to LaTeX. The Data I fill in comes from the Database.
 
 Now the problem is this: if a String from the database contains an 
 ampersand (like in 'Katz & Maus'), Mustache will replace special chars 
 with HTML entities. That is fine in a web context, but LaTeX doesnt 
 actually work well with HTML entities. I could, of course, remove the html 
 entities after Mustache invested a lopt of work into creating them. But it 
 seems more logical to keep Mustache from being so eager to help.
>>> It is not logical because mustache is defined that way. So redefining does 
>>> not improve it. But just use triple {{{ }}} to have strings not being 
>>> escaped.
>>> 
 BTW: I already took the hurdle of Mustache excaping $& fir tabular 
 environments (LaTeX uses the ampersand as a divider for table cells) by 
 using \catcode in our .tex template files. But now the String comes from 
 the database and so I am a bit lost...
 
 
 So is there any best practice for this problem?
 
>>> Yes, use it this way
>>> 
>>> '{{{ value }}}' asMustacheTemplate value: { #value -> '' } asDictionary
>>> 
>>> Norbert
>>> 
>>> 
>>> 
>> 
>> -- 
>> ---
>> Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de
>> Fliederweg 1 http://www.objektfabrik.de
>> D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com
>> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1



Re: [Pharo-users] How to prevent Mustache from replacing & with etc.?

2019-04-17 Thread Norbert Hartl
Joachim,

> Am 17.04.2019 um 07:56 schrieb jtuc...@objektfabrik.de:
> 
> Norbert,
> 
> thanks for answering. I had tried the {{{ }}} option. In case of LaTeX, this 
> is not so easy, however, because {{{ and }}} are completely valid syntactical 
> elements of LaTeX.
> 
> It seems like you can replace {{ and }} in Mustache, but not {{{ and }}}. At 
> least it didn't work when I tried. Using '{{{=### ###=}}} ' in my 
> MustacheTemplate would leave text like '###myObject.printString###' unchanged 
> in the resulting text instead of replacing it with the text representation of 
> myObject.
> 
> So what I tried last and what gave me quite some mileage on the way to a 
> sulotion was to use
> 
> \catcode to replace & with ; in my LaTeX file for the Column separator problem
> {{=## to make sure I can fill in my table rows with ; as column separator.
> 
> Thus my Mustache-Template looks like this (excerpt):
> 
> % redefine Mustache-Insertion syntax {{=## ##=}}
> \catcode`\;=4 % redefine ; for & to allow non-escaped column-separators in 
> \tabular
> 
> ...
> \begin{tabular}{ccp{6.0cm}rrr}
> ##myObject.asLatexTableRows##  % This is where & is needed for LaTeX to 
> separate table columns, but Mustache would replace the with the html entity 
> 
> \end{tabular}
> 
> 
> This is a bit hacky, and as I wrote, also still presents problems, because if 
> any of the Strings being inserted using Mustache contains an &, there will be 
> an  in the .tex file, which will lead to a LaTeX error.
> 
> 
> So, essentially, what I am most likely looking for is a way to replace {{{ 
> and }}} in Mustache to make sure the $&'s will remain untouched in my 
> inserted text...
> Sorry for asking the wrong question, I was so glad how far I'd gotten with 
> what I did that I didn't see the forest between all the trees.
> 
> So my real question is: how can I replace {{{ in Mustache with something that 
> will not irritate LaTeX?
> 
> 
> Any ideas?
> 
Sure ;) In Mustache {{ and }} are the default delimiters. Every addtional 
character is a modifier. So {{{ is actuall a start delimiter {{ with a { as 
modifier. So what you can do is to change the delimiter but leave the { 
modifier like so 

'{{=<% %>=}} <%{ value %>}' asMustacheTemplate value: { #value -> '' } 
asDictionary 

So {{ is the start delimiter, = is the modifier to change the delimiters. We 
set them to <% and %>. If you want to have unescaped strings you keep using the 
{ on the new delimiter which turns out to be <%{ and %>}. 

Norbert
> 
> Am 16.04.19 um 12:00 schrieb Norbert Hartl:
>> Hi,
>> 
>> 
>>> Am 16.04.2019 um 09:02 schrieb jtuc...@objektfabrik.de:
>>> 
>>> Hi Pharoers,
>>> 
>>> 
>>> I may be a bit wrong on this list. I try anyways.
>>> 
>>> I am using Mustache to fill text into a String which will then be handed 
>>> over to LaTeX. The Data I fill in comes from the Database.
>>> 
>>> Now the problem is this: if a String from the database contains an 
>>> ampersand (like in 'Katz & Maus'), Mustache will replace special chars with 
>>> HTML entities. That is fine in a web context, but LaTeX doesnt actually 
>>> work well with HTML entities. I could, of course, remove the html entities 
>>> after Mustache invested a lopt of work into creating them. But it seems 
>>> more logical to keep Mustache from being so eager to help.
>> It is not logical because mustache is defined that way. So redefining does 
>> not improve it. But just use triple {{{ }}} to have strings not being 
>> escaped.
>> 
>>> BTW: I already took the hurdle of Mustache excaping $& fir tabular 
>>> environments (LaTeX uses the ampersand as a divider for table cells) by 
>>> using \catcode in our .tex template files. But now the String comes from 
>>> the database and so I am a bit lost...
>>> 
>>> 
>>> So is there any best practice for this problem?
>>> 
>> Yes, use it this way
>> 
>> '{{{ value }}}' asMustacheTemplate value: { #value -> '' } asDictionary
>> 
>> Norbert
>> 
>> 
>> 
> 
> -- 
> ---
> Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de
> Fliederweg 1 http://www.objektfabrik.de
> D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com
> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
> 
> 
> 




Re: [Pharo-users] How to prevent Mustache from replacing & with etc.?

2019-04-17 Thread jtuc...@objektfabrik.de
So writing my answer I came to the conclusion to 
visithttps://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/Mustache/Mustache.html 
again.


BTW: Good work, thanks for both implementing and documenting Mustache 
this nicely!


And I found {{& which keeps Mustache from escaping. By combinng {{=## 
and {{& for the "insertion points" I can now render table data with $& 
as column seprators from Smalltalk. No need for the \catcode any more.


But this is not the end of the story. Now I get 'misplaced alignment tab 
character' errors from LaTeX whenever the text contains an &. Because 
LaTeX wants & to be escaped as \& ;-



So now I can transport my &'s to Latex without much trouble by using 
##&, but LaTeX needs the & which are intended to be printed as & to be 
escaped, just not as html entities but tex entities ;-)


Does anybody have a solution for this already or should I try to use 
Mustache and bend it to my LaTeX needs...?



Joachim


P.S.: some problems look so easy at the beginning and open a wide 
universe of unmatching available solutions when you attack them. I 
cannot use bindWith: because of the % signs, expandMakrosWith: also 
doesn't work, and Mustache is not suitable out of the box. It's worth a 
laugh, but somehow it's not funny...







--
---
Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1