Groovy Documentation query

2017-05-31 Thread Merlin Beedell
was easier to use, for publishing your documentation both on the web and as a pdf / html page set included in each release? I ask because both services are really very good, and just the sort of thing that we could use! Merlin Beedell [https://www.cryoserver.com/wp-content/uploads/2017/03/ISO

RE: Slashy strings in GroovyConsole

2017-06-16 Thread Merlin Beedell
t1.groovy") def myScript = new File(scriptDir, "Script1.groovy") It saves getting the System.properties['file.separator'] – and you can even ignore the drive letter (if it is on the current disk). def myScript = new File("/Folder1/My Scripts", "Script1.groovy&q

gpars for calculating directory content size

2017-06-16 Thread Merlin Beedell
ound (the sum of each being performed in parallel). Actually - my interest is more in seeing a useful(?) example of gpars! Merlin Beedell [https://www.cryoserver.com/wp-content/uploads/2017/03/ISO-logo-signature.jpg] [https://www.cryoserver.com/wp-content/uploads/2017/03/softech-signature.png] [h

RE: Use of SystemOutputInterceptor with different groovy versions

2017-11-10 Thread Merlin Beedell
as somewhat internal when we made that change. You could use: myLogger = new SystemOutputInterceptor({ Object... args -> logOutput << args[-1]; logOutput.flush(); true }) Cheers, Paul. On Fri, Nov 10, 2017 at 4:15 AM, Merlin Beedell <mbeed...@cryoserver.com<mailto:mbeed...

RE: Scriptom

2017-12-18 Thread Merlin Beedell
"Hi there" OutMail.Send() OutMail = null OutApp = null } Merlin Beedell 0800 280 0525 / +44 (0)207 045 0520 DDI: +44 (0)207 045 0528 Mob: +44 (0)7876 226865 Cryoserver: A focused, flexible email archive delivered by experts -Original Message- From: vlkodlak [

Getting Methods/Properties of objects under "Scriptom"

2017-11-16 Thread Merlin Beedell
tch.invokev(Dispatch.java:858) at com.jacob.com.Dispatch.get(Dispatch.java:1258) at com.jacob.activeX.ActiveXComponent.getProperty(ActiveXComponent.java:171) at scanMailbox.listMnP(scanMailbox.groovy:61) at scanMailbox$_run_closure2.doCall(scanMailbox.groovy:45) at scanMailbox$_run_closure2.doCall(scanMailbox.groovy) at scanMailbox.run(scanMailbox.groovy:37) Merlin Beedell

Use of SystemOutputInterceptor with different groovy versions

2017-11-09 Thread Merlin Beedell
I also noted that the following code would work just fine in recent Groovy version, but not in older. The idea is to intercept the stdout (System.out) so any output can be logged to a text file as well as to the console [really rather handy!]. import groovy.ui.SystemOutputInterceptor

JDK 10: Use of var over def?

2018-03-23 Thread Merlin Beedell
oovy move to support this syntax in the same way (support 'var' only for Type Safe inferred declarations) or as a general alias to the "def" keyword? JDK 10 also has support for "docker" containers. The ecosystem has certainly shifted! Merlin Beedell

Advent of Code challenges

2018-12-10 Thread Merlin Beedell
is using JavaScript and Python, as these are taught at school. Merlin Beedell

RE: [DISCUSS] Groovy 2.6 potential retirement to focus on Groovy 3.0

2018-12-10 Thread Merlin Beedell
I see a monthly release of the 2.5x product – but nothing similar for version 3. What might be happening in the V3 world? Given the license terms change under JDK 11, will the main target be OpenJDK? Merlin Beedell From: Paul King Sent: 23 June 2018 2:53 AM To: users@groovy.apache.org

RE: New Groovy Windows installer

2019-02-18 Thread Merlin Beedell
shame that a multi-platform Java based installer could not be used (if such a thing exists). Merlin Beedell From: Keegan Witt Sent: 11 February 2019 2:24 AM To: users@groovy.apache.org Subject: New Groovy Windows installer I'm working on a new installer<https://github.com/keeganwitt/groovy-wix>

RE: Groovy file associations on Windows

2019-02-11 Thread Merlin Beedell
Name='" + process.Name() + "'} Where AssocClass=Win32_DependentService Role=Antecedent")) { println "\tAsc: ${depServ.DisplayName} state: ${depServ.State}" } } } } Merlin Beedell 0800 280 0525 / +44 (0)207 045 0520 DDI: +44 (0)2

Help! - GPARS with eachFile & database concurrency

2020-01-24 Thread Merlin Beedell
s://stackoverflow.com/questions/35702351/concurrent-parallel-database-queries-using-groovy But I just cannot see how or why the db connection pool interacts with the GPARs so that the same connection is not grabbed by each concurrent process. Yours, hopefully, Merlin Beedell

RE: 3.0.x Windows installers released

2020-09-29 Thread Merlin Beedell
is shifting to newer APIs and web services (like OAuth and ‘Graph’). So if there was a simple way to download and install Jacob/scriptom as a separate thing, that might help for the few that still use it! Merlin Beedell From: Keegan Witt Sent: 29 September 2020 7:33 AM To: users@groovy.apache.org

3.0.x Windows installers released

2020-09-28 Thread Merlin Beedell
k to 2.0.4) would all work. PS – Why call groovy using “execute” rather than GroovyScriptEngine? Well some of these called scripts use System.exit (error-number) and if I use the ScriptEngine or similar, it causes my script to exit as well! Merlin Beedell 0800 280 0525 / +44 (0)207 045 0520 DDI:

File counting methods

2020-06-10 Thread Merlin Beedell
(dir).each {i++} } catch (e) { println (e) } return i } Merlin Beedell

RE: Defining a global variable

2020-10-21 Thread Merlin Beedell
) } test = 'hello' func() //=== Or just //=== void func() { println(test) } test = 'hello' func() //=== Merlin Beedell -Original Message- From: MG Sent: 15 October 2020 6:21 PM To: users@groovy.apache.org; Jochen Theodorou Subject

Self logging scripts

2021-01-26 Thread Merlin Beedell
1]; logOutput.flush(); true } ) myLoger.start() if (args) { print "Parameters provided:" args.each {print " " + it} println "" } println "this is printed to the console window and to the log file - like a 'tee' feature. Really useful" Merlin Beedell 0800

Delete empty folders in a tree

2021-01-26 Thread Merlin Beedell
ers first // but do not delete a folder if it is not empty emptyDirs.reverseEach { it.delete() } } Merlin Beedell

RE: Self logging scripts

2021-01-26 Thread Merlin Beedell
This line should have been like this: new File(getClass().protectionDomain.codeSource.location.path).name.toLowerCase().replace('.groovy', '') Merlin Beedell From: Merlin Beedell Sent: 26 January 2021 3:33 PM To: users@groovy.apache.org Subject: Self logging scripts Hi all, I am

RE: Design pattern for processing a huge directory tree of files using GPars

2022-05-13 Thread Merlin Beedell
.filter(p -> (Files.isRegularFile(p) && p.toString().matches(fileMatch) ) ) //skip files that do not match a regex pattern .collect(Collectors.toList()) .parallelStream() .map(Path::toFile) .forEach( msgFile -> { processedCount++ } ) return processedCount }

Design pattern for processing a huge directory tree of files using GPars

2022-05-09 Thread Merlin Beedell
use the withPool { filesArray.eachParallel { ... - but this does not seem like an efficient solution - especially if there are several hundred thousand files in a directory. What design pattern(s) might be better to consider using? Merlin Beedell

Displaying the entered command-line options as parsed by clibuilder

2024-01-16 Thread Merlin Beedell
rguments()) {println opts.arguments()} prints (note - args are in the same order as defined): -i(input) = b -o(output) = c -d(depth) = 1 -m(max) = 5 -t(threads) = 4 -w(wrapped) = false -x(filefilter) = .* -?(help) = false [Plus, more] Merlin Beedell

RE: Displaying the entered command-line options as parsed by clibuilder

2024-01-16 Thread Merlin Beedell
And if anyone is interested to print the cliBuilder usage in the order that you added them, try def cli = new CliBuilder(usage:'Blaa') cli.x(..) cli.a(..) cli.formatter.setOptionComparator({a,b -> 1}) cli.usage() will now print in the order added (x then a). Merlin Beedell From: Merlin Beed