Re: How do I all an interactive command?

2022-11-08 Thread ToddAndMargo via perl6-users
On 11/8/22 15:04, ToddAndMargo via perl6-users wrote: On 11/7/22 17:50, ToddAndMargo via perl6-users wrote: Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller's

Re: How do I all an interactive command?

2022-11-08 Thread ToddAndMargo via perl6-users
On 11/7/22 17:50, ToddAndMargo via perl6-users wrote: Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller's configuration utility:     hptraidconf     query array

Re: How do I all an interactive command?

2022-11-07 Thread ToddAndMargo via perl6-users
On 11/7/22 17:50, ToddAndMargo via perl6-users wrote: Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller's configuration utility:     hptraidconf     query array

How do I all an interactive command?

2022-11-07 Thread ToddAndMargo via perl6-users
Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller's configuration utility: hptraidconf query array exit I typically will creating a temporary

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
On 10/29/22 14:28, ToddAndMargo via perl6-users wrote: On 10/29/22 13:07, Elizabeth Mattijsen wrote: > $ echo "a/b/c/d" | raku -ne 'say .subst("/", Q/\\\/, :g)' > Hi Elizabeth, Thank you for the subst workaround! I created a keep of the subst. Got to love Raku. 101 ways of doing

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
aku -ne 'my $x=$_; $x~~s:g|$(Q[/])|Q[\\\]|;print $x ~ "\n"' aQ[\]bQ[\]cQ[\]d How do I put a literal string in the target of a regex? Many thanks, -T The guys on the chat line made me write a better description and in the process I figured it out! $ echo "a/b/c/d" | raku -

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
quot;' a\\\b\\\c\\\d But this does not: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|Q[\\\]|;print $x ~ "\n"' aQ[\]bQ[\]cQ[\]d How do I put a literal string in the target of a regex? Many thanks, -T On 10/29/22 13:07, Elizabeth Mattijsen wrote: $ echo "a/

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread Elizabeth Mattijsen
>>> >>> / >>> >>> into >>> >>> \\\ >>> >>> This works: >>> >>> >>> $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~ >>> "\n"' >>

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
quot; | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|Q[\\\]|;print $x ~ "\n"' aQ[\]bQ[\]cQ[\]d How do I put a literal string in the target of a regex? Many thanks, -T On 10/29/22 13:07, Elizabeth Mattijsen wrote: > $ echo "a/b/c/d" | raku -ne 'say .subst("/", Q/\\\/, :g)

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread Elizabeth Mattijsen
$ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~ > "\n"' > a\\\b\\\c\\\d > > > But this does not: > > $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|Q[\\\]|;print $x ~ > "\n"' > aQ[\]bQ[\]cQ[\]d > > > How do I put a literal string in the > target of a regex? > > Many thanks, > -T

how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
Hi All, I am trying to change / into \\\ This works: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~ "\n"' a\\\b\\\c\\\d But this does not: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|Q[\\\]|;print $x ~ &quo

Re: How do I print the last three lines in a file?

2022-10-23 Thread ToddAndMargo via perl6-users
On 10/22/22 23:26, ToddAndMargo via perl6-users wrote: On 10/22/22 22:33, Bruce Gray wrote: dir . /s /A:-D /d /a  | raku -e "say lines[*-2].words[2]" It is pretty !  I like it.  Thank you! I just verified it works on Windows 7, 10, and 11 You have to be careful to double check. Sometimes

Re: How do I print the last three lines in a file?

2022-10-23 Thread ToddAndMargo via perl6-users
On 10/22/22 22:33, Bruce Gray wrote: dir . /s /A:-D /d /a | raku -e "say lines[*-2].words[2]" It is pretty ! I like it. Thank you!

Re: How do I print the last three lines in a file?

2022-10-22 Thread Bruce Gray
> On Oct 22, 2022, at 11:46 PM, ToddAndMargo via perl6-users > wrote: > > On 10/22/22 21:11, Bruce Gray wrote: >>> On Oct 22, 2022, at 10:28 PM, ToddAndMargo via perl6-users >>> wrote: >>> >>> Hi All, >>> >>> Is there a way to print only the last three lines >>> in a long file (full on

Re: How do I print the last three lines in a file?

2022-10-22 Thread ToddAndMargo via perl6-users
On 10/22/22 21:11, Bruce Gray wrote: On Oct 22, 2022, at 10:28 PM, ToddAndMargo via perl6-users wrote: Hi All, Is there a way to print only the last three lines in a long file (full on \n's). In Windows, I am trying to such the last the lines is dir /s /A:-D /d /a ... Total

Re: How do I print the last three lines in a file?

2022-10-22 Thread Bruce Gray
> On Oct 22, 2022, at 10:28 PM, ToddAndMargo via perl6-users > wrote: > > Hi All, > > Is there a way to print only the last three lines > in a long file (full on \n's). > > > In Windows, I am trying to such the last the lines is > > > dir /s /A:-D /d /a > ... > Total Files Listed: >

How do I print the last three lines in a file?

2022-10-22 Thread ToddAndMargo via perl6-users
Hi All, Is there a way to print only the last three lines in a long file (full on \n's). In Windows, I am trying to such the last the lines is > dir /s /A:-D /d /a ... Total Files Listed: 13671 File(s) 3,265,285,462 bytes 3917 Dir(s) 18,406,518,784 bytes free

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread William Michels via perl6-users
Maybe my favorite example of the differential applications of `comb` vs `split`. Below, sometimes you want to precisely tease-apart text, and `comb` works towards that end. Other times you want to destructively blast-away at text--eliminating the destractions--so you use `split`, until you see the

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread ToddAndMargo via perl6-users
On 11/1/21 19:07, Patrick R. Michaud wrote: If you want only the first 10 digits, then: How about if I want 64 or more digits?

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread Patrick R. Michaud
This is a place where .comb() is likely much better than .split() -- .comb() allows you to specify what you're wanting instead of what you're wanting to avoid: $ raku -e "say sqrt(2).comb(/\d/).join(', ');" 1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 1 If you want only the first 10

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread William Michels via perl6-users
You did great for not knowing Raku! ~$ raku -e "say sqrt(2).split(/\.|''/);" ( 1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1 ) ~$ raku -e "say sqrt(2).split(/\.|''/).raku;" ("", "1", "", "4", "1", "4", "2", "1", "3", "5", "6", "2", "3", "7", "3", "0", "9", "5", "1", "").Seq ~$ raku -e "say

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread Sean McAfee
On Mon, Nov 1, 2021 at 1:53 AM sisyphus wrote: > Note that what you have there is a 200-decimal-digit (around 658-bit) > precision representation of the square root of 2 - which is quite different > to the (53-bit precision) Real sqrt(2). > Always gotta be careful with reals. I also attempted

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread sisyphus
On Mon, Nov 1, 2021 at 2:35 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 10/31/21 19:39, Sean McAfee wrote: > > > (2.FatRat, { $_ / 2 + 1 / $_ } ... (* - *).abs < 1e-100).tail > >

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
On 10/31/21 19:39, Sean McAfee wrote: On Sun, Oct 31, 2021 at 6:51 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: >> How do I get more digits out of sqrt? On 10/31/21 17:50, Kevin Pye wrote:  > You don't.  >  > sqrt is a func

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Sean McAfee
On Sun, Oct 31, 2021 at 6:51 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > >> How do I get more digits out of sqrt? > > On 10/31/21 17:50, Kevin Pye wrote: > > You don't. > > > > sqrt is a function which acts on 64-bit floating point nu

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
How do I get more digits out of sqrt? On 10/31/21 17:50, Kevin Pye wrote: > You don't. > > sqrt is a function which acts on 64-bit floating point numbers, and there's no more meaningful digits available. If you need more precision you're on your own. Dang! I was hoping ther

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Kevin Pye
>>> comb takes an argument that can save you a method call: >>> >>> 2.sqrt.comb.grep(*.Int) >>>    ==> >>> 2.sqrt.comb(/\d/) >>> >> >> >> >> > 2.sqrt.comb(/\d/) >> (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1) >> >> >> > 2.sqrt.comb(/\d/) >> (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1) >> >> >> >> :-) > > > How do I get more digits out of sqrt?

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
can save you a method call: 2.sqrt.comb.grep(*.Int)    ==> 2.sqrt.comb(/\d/) > 2.sqrt.comb(/\d/) (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1) > 2.sqrt.comb(/\d/) (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1) :-) How do I get more digits out of sqrt?

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
On 10/31/21 11:20, Sean McAfee wrote: On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users mailto:perl6-us...@perl.org>> wrote:     put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits comb takes an argument that can save you a method call:     2.sqrt.comb.grep(*.Int)   ==>    

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Sean McAfee
On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users < perl6-us...@perl.org> wrote: > put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits > comb takes an argument that can save you a method call: 2.sqrt.comb.grep(*.Int) ==> 2.sqrt.comb(/\d/)

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Andinus via perl6-users
ToddAndMargo via perl6-users @ 2021-10-30 23:57 -07: > Without going into why (it is a secret), how do I turn > >> my $x = sqrt 2 > 1.4142135623730951 > > into an array of integers? > @y[0] = 1 > @y[1] = 4 > @y[2] = 1 > @y[3] = 4 > @y[4] = 2 > @y[5] = 1

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Bruce Gray
> On Oct 31, 2021, at 6:10 AM, ToddAndMargo via perl6-users > wrote: > > On 10/31/21 01:43, Shlomi Fish wrote: > >>> ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) >> (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1) > > Cool! > > my Int @x = ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) > [1 4 1 4 2 1 3

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread sisyphus
On Sun, Oct 31, 2021 at 10:10 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 10/31/21 01:43, Shlomi Fish wrote: > > > > >> ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) > > (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1) > > Cool! > > my Int @x = ("" ~ sqrt(2)).comb().grep(* ne

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
On 10/31/21 01:43, Shlomi Fish wrote: ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1) Cool! my Int @x = ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) [1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1] Is there a way to set how many digits I get?

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Shlomi Fish
'1', > > '3', > > '5', > > '6', > > '2', > > '3', > > '7', > > '3', > > '1' > > ]; > > > Regards > > Alice > > On

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Alice
', '2', '3', '7', '3', '1' ]; Regards Alice On Sun, Oct 31, 2021 at 2:58 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > Without going into why (it is a secret), how do I turn > &

how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
Hi All, Without going into why (it is a secret), how do I turn > my $x = sqrt 2 1.4142135623730951 into an array of integers? @y[0] = 1 @y[1] = 4 @y[2] = 1 @y[3] = 4 @y[4] = 2 @y[5] = 1 etc. Many thanks, -T

Re: How do I address individual elements inside an object

2020-12-19 Thread ToddAndMargo via perl6-users
On 12/19/20 4:49 PM, Brad Gilbert wrote: You can interpolate a method call in a string, but you need the parens.     say "$FruitStand.location() has $FruitStand.apples() apples in stock"; Cool! Now four ways of doing it: print $FruitStand.location ~ "has " ~ $FruitStand.apples ~"

Re: How do I address individual elements inside an object

2020-12-19 Thread Brad Gilbert
You can interpolate a method call in a string, but you need the parens. say "$FruitStand.location() has $FruitStand.apples() apples in stock"; On Sat, Dec 19, 2020 at 4:28 AM Laurent Rosenfeld via perl6-users < perl6-us...@perl.org> wrote: > Yeah, right. $FruitStand.apples is not a direct

Re: How do I address individual elements inside an object

2020-12-19 Thread ToddAndMargo via perl6-users
apples."; Is the "." at the end of the apples literal or syntax?

Re: How do I address individual elements inside an object

2020-12-19 Thread William Michels via perl6-users
Great, Laurent! Works fine (and Todd's as well). Thank you for the explanation. --B. On Sat, Dec 19, 2020 at 2:27 AM Laurent Rosenfeld via perl6-users < perl6-us...@perl.org> wrote: > Yeah, right. $FruitStand.apples is not a direct access to the attribute, > but a method invocation (a call to a

Re: How do I address individual elements inside an object

2020-12-19 Thread Laurent Rosenfeld via perl6-users
Yeah, right. $FruitStand.apples is not a direct access to the attribute, but a method invocation (a call to a method implicitly created by Raku), so it doesn't get interpolated within the string. So it should be outside the string or used with a code interpolation block. For example: say

Re: How do I address individual elements inside an object

2020-12-18 Thread ToddAndMargo via perl6-users
On 12/18/20 9:42 AM, William Michels via perl6-users wrote: Hi Laurent, I get: Fruitstand in Fruit<140431957910656>.location has  Fruit<140431957910656>.apples apples. [Rakudo v2020.10] Best, Bill. Hi Bill, From my notes in progress: -T *** addressing values inside and object ***

Re: How do I address individual elements inside an object

2020-12-18 Thread William Michels via perl6-users
Hi Laurent, I get: Fruitstand in Fruit<140431957910656>.location has Fruit<140431957910656>.apples apples. [Rakudo v2020.10] Best, Bill. On Fri, Dec 18, 2020 at 5:29 AM Laurent Rosenfeld via perl6-users < perl6-us...@perl.org> wrote: > Hi Todd, > > 1. Yes, a class is a blueprint for

Re: How do I address individual elements inside an object

2020-12-18 Thread Parrot Raiser
Although it's a standard term, "class" has a misleading connotation of "set". Using the "fruit" example, the class Fruit should indicate a set of relevant properties for a fruit, such as name, colour, taste, size, possibly cost/kilo. Individual variables can be defined as Fruit-type objects. Then

Re: How do I address individual elements inside an object

2020-12-18 Thread Laurent Rosenfeld via perl6-users
Hi Todd, 1. Yes, a class is a blueprint for manufacturing objects, you can construct as many object as you want. 2. As an example, you can try: say " Fruitstand in $FruitStand.location has $FruitStand.apples apples."; 2. As you declared your class the object attributes will not be mutable.

How do I address individual elements inside an object

2020-12-17 Thread ToddAndMargo via perl6-users
Hi All, class Fruit { has Str $.location; has UInt $.apples; has UInt $.oranges; has UInt $.bananas; } my $FruitStand = Fruit.new( location => "Cucamonga", apples => 400, oranges => 200,

Re: How do I handle Getopt::Long stray entries?

2020-05-14 Thread Peter Pentchev
> > > { > > > my $opts = get-options( > > > "enablerepo=s@", > > > "y", > > > ); > > > CATCH { when Getopt::Long::Exception { .message.note; exit 1 } }; > > > dd $opts; > > > > > >

Re: How do I handle Getopt::Long stray entries?

2020-05-14 Thread Peter Pentchev
> $msg.note; > > exit 1; > > } > > > > { > > my $opts = get-options( > > "enablerepo=s@", > > "y", > > ); > > CATCH { when Getopt::Long::Exception { .message.note; exit 1 } }; > >

Re: How do I handle Getopt::Long stray entries?

2020-05-14 Thread ToddAndMargo via perl6-users
;Unknown command '$cmd'" unless $handler; exit $handler(|$opts); } How do I use it? Where are the options declared? $ GetOptLongTest2.pl6 Capture $opts = \() No command specified $ GetOptLongTest2.pl6 --help Unknown option help -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread Peter Pentchev
; > On Sun, May 10, 2020 at 06:20:02PM -0700, ToddAndMargo via perl6-users > > > > wrote: > > > > > Hi All, > > > > > > > > > > https://modules.raku.org/dist/Getopt::Long:cpan:LEONT > > > > > > > > &g

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread ToddAndMargo via perl6-users
::Long:cpan:LEONT How do I handle stray entries (unknown options) without crashing? Is there some grab bag I can stick all those into? When something signals an error using "die", you can catch it using a CATCH block, especially if you know that the exception thrown will be of a particular

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread Peter Pentchev
ules.raku.org/dist/Getopt::Long:cpan:LEONT > > > > > > How do I handle stray entries (unknown options) without > > > crashing? Is there some grab bag I can stick all > > > those into? > > > > When something signals an error using "die&q

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread ToddAndMargo via perl6-users
On 2020-05-10 23:47, Peter Pentchev wrote: On Sun, May 10, 2020 at 06:20:02PM -0700, ToddAndMargo via perl6-users wrote: Hi All, https://modules.raku.org/dist/Getopt::Long:cpan:LEONT How do I handle stray entries (unknown options) without crashing? Is there some grab bag I can stick all

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread ToddAndMargo via perl6-users
On 2020-05-10 23:47, Peter Pentchev wrote: On Sun, May 10, 2020 at 06:20:02PM -0700, ToddAndMargo via perl6-users wrote: Hi All, https://modules.raku.org/dist/Getopt::Long:cpan:LEONT How do I handle stray entries (unknown options) without crashing? Is there some grab bag I can stick all

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread Peter Pentchev
On Sun, May 10, 2020 at 06:20:02PM -0700, ToddAndMargo via perl6-users wrote: > Hi All, > > https://modules.raku.org/dist/Getopt::Long:cpan:LEONT > > How do I handle stray entries (unknown options) without > crashing? Is there some grab bag I can stick all > those into? W

How do I handle Getopt::Long stray entries?

2020-05-10 Thread ToddAndMargo via perl6-users
Hi All, https://modules.raku.org/dist/Getopt::Long:cpan:LEONT How do I handle stray entries (unknown options) without crashing? Is there some grab bag I can stick all those into? $ GetOptLongTest.pl6 --SomethingExtra Unknown option SomethingExtra in sub get-option at /opt/rakudo-pkg/share

Re: How do I open Raku in the background?

2020-03-31 Thread ToddAndMargo via perl6-users
On 2020-03-31 01:12, ToddAndMargo via perl6-users wrote: On 2020-03-30 21:06, ToddAndMargo via perl6-users wrote: On Mon, Mar 30, 2020 at 8:14 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: >> On Sun, Mar 29, 2020 at 8:44 PM ToddAndMargo via perl6-users >>

Re: How do I open Raku in the background?

2020-03-31 Thread ToddAndMargo via perl6-users
On 2020-03-30 21:06, ToddAndMargo via perl6-users wrote: On Mon, Mar 30, 2020 at 8:14 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: >> On Sun, Mar 29, 2020 at 8:44 PM ToddAndMargo via perl6-users >> mailto:perl6-us...@perl.org>    

Re: How do I open Raku in the background?

2020-03-31 Thread ToddAndMargo via perl6-users
On 2020-03-30 21:06, ToddAndMargo via perl6-users wrote: On Mon, Mar 30, 2020 at 8:14 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: >> On Sun, Mar 29, 2020 at 8:44 PM ToddAndMargo via perl6-users >> mailto:perl6-us...@perl.org>    

Re: How do I open Raku in the background?

2020-03-30 Thread ToddAndMargo via perl6-users
On Mon, Mar 30, 2020 at 8:14 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: >> On Sun, Mar 29, 2020 at 8:44 PM ToddAndMargo via perl6-users >> mailto:perl6-us...@perl.org> >> wrote: >> >>

Re: How do I open Raku in the background?

2020-03-30 Thread Brad Gilbert
There is a bit in the executable that tells windows to open a terminal. If you copy the executable to say rakudo_no_terminal.exe and change that bit in the copy, then Windows won't show you a terminal. On Mon, Mar 30, 2020 at 8:14 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: >

Re: How do I open Raku in the background?

2020-03-30 Thread ToddAndMargo via perl6-users
On Sun, Mar 29, 2020 at 8:44 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, Windows 10-1909 Pro raku -v This is Rakudo version 2020.01 built on MoarVM version 2020.01.1 implementing Perl 6.d. I am opening Raku from the registry with

Re: How do I open Raku in the background?

2020-03-30 Thread yary
This is a Windows explorer/shell issue. Search the web; this is one approach - use cmd with some switches to start with the window minimized https://stackoverflow.com/questions/4277963/how-to-call-cmd-without-opening-a-window I'm a fan of Emacs on all my platforms; their solution in Windows is a

How do I open Raku in the background?

2020-03-29 Thread ToddAndMargo via perl6-users
Hi All, Windows 10-1909 Pro raku -v This is Rakudo version 2020.01 built on MoarVM version 2020.01.1 implementing Perl 6.d. I am opening Raku from the registry with [HKEY_CLASSES_ROOT\*\shell\OpenWithFileAttributes.pl6\command] @="\"C:\\rakudo\\bin\\raku.exe\"

Re: How do I contact the moderator?

2020-02-11 Thread ToddAndMargo via perl6-users
On 2020-02-11 01:03, ToddAndMargo via perl6-users wrote: On 2020-02-11 00:44, Shlomi Fish wrote: Hi Todd, On Mon, 10 Feb 2020 19:25:50 -0800 ToddAndMargo via perl6-users wrote: Hi All, I have been getting a strange eMail on this group. How do I contact the moderator to check and see

Re: How do I contact the moderator?

2020-02-11 Thread Shlomi Fish
Hi Todd, On Mon, 10 Feb 2020 19:25:50 -0800 ToddAndMargo via perl6-users wrote: > Hi All, > > I have been getting a strange eMail on this group. > How do I contact the moderator to check and see > if it is a scam? > I think you should send an email to perl6-users-ow...@

Re: How do I contact the moderator?

2020-02-11 Thread ToddAndMargo via perl6-users
On 2020-02-11 00:44, Shlomi Fish wrote: Hi Todd, On Mon, 10 Feb 2020 19:25:50 -0800 ToddAndMargo via perl6-users wrote: Hi All, I have been getting a strange eMail on this group. How do I contact the moderator to check and see if it is a scam? I think you should send an email to perl6

How do I contact the moderator?

2020-02-10 Thread ToddAndMargo via perl6-users
Hi All, I have been getting a strange eMail on this group. How do I contact the moderator to check and see if it is a scam? Many thanks, -T

Re: How do I convert integer to cardinal on the fly?

2020-01-08 Thread ToddAndMargo via perl6-users
On 2020-01-07 08:20, ToddAndMargo via perl6-users wrote: On 2020-01-06 22:54, ToddAndMargo via perl6-users wrote: Hi All, What am I doing wrong here?  > my int16 $x = 0xABCD; -21555  > say $x.base(16); -5433  > my uint16 $y = $x.uint16; No such method 'uint16' for invocant of type 'Int'   

Re: How do I convert integer to cardinal on the fly?

2020-01-07 Thread Todd Chester via perl6-users
On Tue, Jan 7, 2020 at 10:20 AM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: On 2020-01-06 22:54, ToddAndMargo via perl6-users wrote: > Hi All, > > What am I doing wrong here? > > > my int16 $x = 0xABCD; > -21555 > > > say

Re: How do I convert integer to cardinal on the fly?

2020-01-07 Thread Brad Gilbert
my int16 $x = 0xABCD; my uint16 $y = $x; say $x.base(16); say $y.base(16) -5433 ABCD If you just want to coerce to uint16 (my uint16 $ = $x) say (my uint16 $ = $x).base(16) On Tue, Jan 7, 2020 at 10:20 AM ToddAndMargo via perl6-users <

Re: How do I convert integer to cardinal on the fly?

2020-01-07 Thread ToddAndMargo via perl6-users
On 2020-01-06 22:54, ToddAndMargo via perl6-users wrote: Hi All, What am I doing wrong here? > my int16 $x = 0xABCD; -21555 > say $x.base(16); -5433 > my uint16 $y = $x.uint16; No such method 'uint16' for invocant of type 'Int'   in block at line 1 Many thanks, -T Came up with a

How do I convert integer to cardinal on the fly?

2020-01-06 Thread ToddAndMargo via perl6-users
Hi All, What am I doing wrong here? > my int16 $x = 0xABCD; -21555 > say $x.base(16); -5433 > my uint16 $y = $x.uint16; No such method 'uint16' for invocant of type 'Int' in block at line 1 Many thanks, -T

Re: How do I assign values to CArray[WCHAR]?

2020-01-06 Thread ToddAndMargo via perl6-users
On 2020-01-06 22:02, ToddAndMargo via perl6-users wrote: Hi All, What am I doing wrong here?  How do I assign values to CArray[WCHAR]? I want $lpData[0] to be 0xABCD and $lpData[1] to be 0xEF12. > use NativeCall; Nil > constant WCHAR    := uint16; (uint16) This was the booboo. I

How do I assign values to CArray[WCHAR]?

2020-01-06 Thread ToddAndMargo via perl6-users
Hi All, What am I doing wrong here? How do I assign values to CArray[WCHAR]? I want $lpData[0] to be 0xABCD and $lpData[1] to be 0xEF12. > use NativeCall; Nil > constant WCHAR:= uint16; (uint16) > my $ValueData = 0xABCDEF12; 2882400018 > my CArray[WCHAR] $lpData; (C

Re: how do I read registry key?

2019-12-27 Thread ToddAndMargo via perl6-users
My Latest with Wolf's recommendations. Now I can open and close the key, but still am getting an invalid parameter trying to read the key K:\Windows\NtUtil>perl6 -I. -e "use WinMount :GetLUA; say GetLUA();" RegOpenKeyExW RegOpenKeyExW RtnCode 0 RegQueryValueExW 1 2

Re: how do I read registry key?

2019-12-27 Thread ToddAndMargo via perl6-users
On 2019-12-27 00:45, WFB wrote: Hi Todd, According to this: https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499- Return code 161 means: ERROR_BAD_PATHNAME. Changing your code fixed that:  my Str   $SubKey =

Re: how do I read registry key?

2019-12-27 Thread WFB
Hi Todd, According to this: https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499- Return code 161 means: ERROR_BAD_PATHNAME. Changing your code fixed that: my Str $SubKey = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System'; my $lpValueName =

Re: how do I read registry key?

2019-12-26 Thread WFB
I would love to look into that, however, my son needs all my free time and I do have very little knowledge about NativeCall. I hope I will find time in the next days to learn more of this stuff, but I will not much help :-( On Fri, 27 Dec 2019 at 07:31, ToddAndMargo via perl6-users <

Re: how do I read registry key?

2019-12-26 Thread ToddAndMargo via perl6-users
This is how far I have gotten: Note that is I use a "0" in $RtnCode = RegQueryValueExW( HKEY_LOCAL_MACHINE, $lpValueName, 1, REG_DWORD, $lpData, $lpcbData ); The program dies with no return code. -T K:\Windows\NtUtil>perl6 -I. -e "use WinMount :GetLUA; say GetLUA();"

Re: how do I read registry key?

2019-12-25 Thread ToddAndMargo via perl6-users
On 2019-12-25 21:48, WFB wrote: BTW, hat would be also a great module for pushing to https://modules.raku.org/. Not sure my code is good enough for that. :'(

Re: how do I read registry key?

2019-12-25 Thread ToddAndMargo via perl6-users
On 2019-12-25 21:48, WFB wrote: On Wed, 25 Dec 2019 at 23:10, ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, Windows https://docs.microsoft.com/en-us/windows/win32/sysinfo/retrieving-data-from-the-registry How do I use this to read re

Re: how do I read registry key?

2019-12-25 Thread WFB
On Wed, 25 Dec 2019 at 23:10, ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > Windows > > > https://docs.microsoft.com/en-us/windows/win32/sysinfo/retrieving-data-from-the-registry > > How do I use this to read retrieve a value of a regis

how do I read registry key?

2019-12-25 Thread ToddAndMargo via perl6-users
Hi All, Windows https://docs.microsoft.com/en-us/windows/win32/sysinfo/retrieving-data-from-the-registry How do I use this to read retrieve a value of a registry key? Many thanks, -T

Re: How do I do literal quotes in a regex?

2019-12-10 Thread ToddAndMargo via perl6-users
On 2019-12-09 00:46, Fernando Santagata wrote: On Mon, Dec 9, 2019 at 9:38 AM Fernando Santagata mailto:nando.santag...@gmail.com>> wrote: It can be used this way: $ raku -e'say „Hello!“' Hello! But it must be used with that closing quote '“' (U+201C); it cannot be used

Re: How do I do literal quotes in a regex?

2019-12-09 Thread Trey Harris
On Mon, Dec 9, 2019 at 03:54 Fernando Santagata wrote: > On Mon, Dec 9, 2019 at 9:38 AM Fernando Santagata < > nando.santag...@gmail.com> wrote: > >> It can be used this way: >> >> $ raku -e'say „Hello!“' >> Hello! >> But it must be used with that closing quote '“' (U+201C); it cannot be >> used

Re: How do I do literal quotes in a regex?

2019-12-09 Thread Fernando Santagata
On Mon, Dec 9, 2019 at 9:38 AM Fernando Santagata wrote: > It can be used this way: > > $ raku -e'say „Hello!“' > Hello! > But it must be used with that closing quote '“' (U+201C); it cannot be > used paired with itself: > There's another quotation mark that can be used with '„', it's '”'

Re: How do I do literal quotes in a regex?

2019-12-09 Thread Fernando Santagata
On Mon, Dec 9, 2019 at 1:27 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > What is the unicode for the subscript double quote „ ? > That's U+201E and can it be used together with the regular > quote the same as 「」 ? > It can be used this way: $ raku -e'say „Hello!“' Hello!

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
On 2019-12-08 19:34, Brad Gilbert wrote: I like to use them, but I am not you. Hi Brad, I am going to create a keeper and give it a shot! It is not like I don't have four or five of them open when I am programming :-) -T

Re: How do I do literal quotes in a regex?

2019-12-08 Thread Brad Gilbert
I like to use them, but I am not you. On Sun, Dec 8, 2019 at 8:19 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2019-12-08 18:04, Brad Gilbert wrote: > > I do not quite understand the question. > > > > I told you how to directly enter unicode by remembering the codepoint. >

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
On 2019-12-08 18:04, Brad Gilbert wrote: I do not quite understand the question. I told you how to directly enter unicode by remembering the codepoint. It's still the same characters. I would definitely recommend setting up, and getting used to Compose keys. I use them all the time for

Re: How do I do literal quotes in a regex?

2019-12-08 Thread Brad Gilbert
I do not quite understand the question. I told you how to directly enter unicode by remembering the codepoint. It's still the same characters. I would definitely recommend setting up, and getting used to Compose keys. I use them all the time for things like « » ‘ ’ “ ” ¹²³⁴⁵⁶⁷⁸⁹⁰¯⁺≠ On Sun,

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
On 2019-12-08 06:22, Brad Gilbert wrote: Personally though I just use 「Ctrl+Shift+u f f 6 2 Space」 and 「Ctrl+Shift+u f f 6 3 Space」 Hi Brad, Your technical opinion: is it better for maintainability to stick with escape sequences or to use the unicodes? I ask as I will never remember them.

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
On 2019-12-08 08:46, Fernando Santagata wrote: You won't believe it :-) but Raku's wonderful documentation has a page on how to enter Unicode characters: https://docs.raku.org/language/unicode_entry Hi Fernando, Oh they sure do go to town on that one! That page is nicely done. What is the

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
On 2019-12-08 06:22, Brad Gilbert wrote: Personally though I just use 「Ctrl+Shift+u f f 6 2 Space」 and 「Ctrl+Shift+u f f 6 3 Space」 So basically I just remember how to directly type in Unicode codepoints, and those the two codepoints. Taught me something new. Thank you!

Re: How do I do literal quotes in a regex?

2019-12-08 Thread Fernando Santagata
You won't believe it :-) but Raku's wonderful documentation has a page on how to enter Unicode characters: https://docs.raku.org/language/unicode_entry That page also links to a GitHub project which offers a .XCompose ready to use. I started from that and added some faster and easier (for me) to

Re: How do I do literal quotes in a regex?

2019-12-08 Thread Brad Gilbert
I would recommend setting up a compose key. But that is not enough because I don't think it has a binding for those two characters. So you would also have to modify the config to include them. I think that 「Compose [ [ 」 and 「Compose ] ] 」 might be what I would set them as. Note that 「‘」 is

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
> On Sat, Dec 7, 2019 at 12:51 AM ToddAndMargo via perl6-users > mailto:perl6-us...@perl.org>> wrote: > > Hi All, > > Is there a `Q[]` that can be used in a regex? > > I am looking for how to get around > > my $x = Q[\:\\::]; ( my $y = $x ) ~~ s/ '' /x/; say $y > \:x:: > >

Re: How do I do literal quotes in a regex?

2019-12-07 Thread Brad Gilbert
The shortcut spelling of Q[…] is to use 「 and 」 (U+FF62 and U+FF63) my $x = 「\:\\::」; ( my $y = $x ) ~~ s/ 「\\」 /x/; say $y \:\\:: The case could be made that \Q[\\] should work as well. (It would need to be added). (Along with \q[…] and \qq[…]) Note that \Q[…] doesn't work in string

  1   2   3   4   >