the first four letter s to STDOUT.
>
$ raku -e 'printf "%.4s\n","andefghi"'
ande
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia
ngayw...@une.edu.au http://turing.une.edu.au/~ngay
On Fri, 29 Oct 2021 at 09:14, Norman Gaywood wrote:
>
> Might have to test this example again on 2021.10 (not easy for me).
>
I mean, test again on 2021.9 to see if there was a regex speed up in
2021.10
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
Univ
= (split( ": ", $line, 2))[1];
last;
}
}
}
say "{%ldap.elems} entries by starts-with in {now - BEGIN now} seconds";
}
multi MAIN ( "split", $ldif-fn = "db/icheck.ldif" ) {
my ( %f, $k, $v );
for $ldif-fn.
Oh, and I welcome suggestions on how I might do the task more quickly,
elegantly, differently, etc :-)
And critiques of the code also welcome. I still have a strong perl5 accent
I suspect.
On Thu, 28 Oct 2021 at 13:15, Norman Gaywood wrote:
> Executive summary:
> - comparing raku 2
k.ldif" ) {
my ( %f, $k, $v );
for $ldif-fn.IO.lines -> $line {
when not $line { # blank line is LDIF entry terminator
%ldap{%f} = User.new( |%f ); # attributes not used
are ignored
}
when $line.starts-with( 'dn: ' ) { %f = () } #
ld.
>
> Best, Bill.
>
> On Fri, Aug 27, 2021 at 6:46 PM Norman Gaywood
> wrote:
>
>> Thanks for the suggestions Andinus and James Cloos
>>
>> In the end I was able to solve the issue by doing:
>>
>> lsof -p
>>
>> and examining the ope
graphic):
>
> [image: image.png]
>
> While others:
>
> [image: image.png]
>
> Does anyone know what font package provides the required font here?
>
> Pretty sure I have to install this font on the system I'm ssh'ing FROM.
> It's correctly displayed ssh
: image.png]
Does anyone know what font package provides the required font here?
Pretty sure I have to install this font on the system I'm ssh'ing FROM.
It's correctly displayed ssh'ing from Windows 10.
--
Norman Gaywood, Computer Systems Officer
School of Science and Technolo
ong?
>
> Many thanks,
> -T
>
> --
> ~~~~~~~~
> If I had a dime every time I didn't know
> what was going on, I'd be like, "Why is
> everyone giving me all these dimes?"
>
>
--
Norman Gaywood, Computer Systems Officer
Scho
=> 1}
> my %h = gather { take eager "foo"=>1; take "bar"=>2;}
{foo 1 => bar => 2}
> my %h = gather { take eager "foo"=>1}
Odd number of elements found where hash initializer expected:
Only saw: $(:foo(1),)
in block at line 1
--
Norma
T
>
>
> On 2020-02-26 14:16, Andy Bach wrote:
> > @Result = qqx { C:/Windows/System32/fsutil.exe usn
> > readdata \"$FileName\" }.lines;
> >
> > Doesn't windows do something special for files with spaces in them? Hm,
> > $ type "hi mom" &g
erl6 -e 'say sqrt(2).Rat.base-repeating();'
(1.4
14213197969543147208121827411167512690355329949238578680203045685279187817258883248730964467005076)
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia
ngayw...@une.edu.au ht
.1.5-2.fc31.x86_64
On Thu, 23 Jan 2020 at 06:21, ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:
> RFE: REPL dependency check for Readline #153
> https://github.com/Raku/problem-solving/issues/153
>
> By the way, when you do this, it pops up immediately
> on the chat l
nenoise` or use
rlwrap for a line editor
To exit type 'exit' or '^D'
> my $history^[[A^[[A
This seems like a Fedora 31 packaging problem to me.
However, after this:
$ zef install Readline
The arrow keys once again work for me.
--
Norman Gaywood, Computer Systems Officer
On Tue, 21 Jan 2020 at 03:12, Brad Gilbert wrote:
> .say for lines
>
Since .say calls gist(), would it be not be better/safer to call .put
instead?
.put for lines
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NS
-T
>
>
>
>
>
>
> --
> ~~~~~~
> Computers are like air conditioners.
> They malfunction when you open windows
> ~~
>
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
On Tue, 5 Mar 2019 at 01:23, Brad Gilbert wrote:
>
> Somewhere on the Internet I layed out the rules that I think that
> should normally be followed, but I am not sure where.
>
Perhaps:
https://stackoverflow.com/questions/54338491/string-matching-in-main-parameters
--
No
On Mon, 4 Feb 2019 at 15:12, ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:
> https://docs.perl6.org/routine/read
>
> Where is the list of the options this thing will take, such
> as :ro and :bin?
>
>
Those are options for open()
https://docs.perl6.org/
Just been reading the latest of Elizabeth's wonderful blog posts on how
phasers work in perl6:
https://opensource.com/article/18/10/how-phasers-work-perl-6?fbclid=IwAR3eJSn5EdJh2DYgpjrFOy7kg-dShuilwQhHDHTANeb4JmHYSBiTz3WyxPA
I have question on the KEEP/UNDO example:
{
KEEP $dbh.commit;
UN
On Fri, 15 Jun 2018 at 06:13, Trey Harris wrote:
Thanks for the nice examples of IntStr and friends.
I was intrigued with this statement at the end:
> Also note that using s/printf at all is not encouraged
Could you expand on that?
>
>
--
Norman Gaywood, Computer Systems Offic
gt; 1 . 2 . 3
>
>
The second part of the s/// operator is a string (spaces count), not a
regex (spaces ignored).
> my $x="01.02.03"; $x ~~ s:global/"0"(\d)/$0/; say "$x"
1.2.3
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
Un
I've moved this question to stackoverflow
https://stackoverflow.com/questions/50573586/perl6-an-operation-first-awaited
More comments inline below.
On Tue, 29 May 2018 at 01:40, Brad Gilbert wrote:
> .
> > An operation first awaited:
> > in sub MAIN at ./traverse-dir0.p6 line 24
> > in blo
On Mon, 28 May 2018 at 17:24, JJ Merelo wrote:
> Hi
>
> El lun., 28 may. 2018 a las 9:04, Norman Gaywood ()
> escribió:
>
>> T""his simple program creates a thread to read a directory with dir() and
>> place the files on a channel. $N worker threads read t
T""his simple program creates a thread to read a directory with dir()
and place the files on a channel. $N worker threads read that channel
and "process" (prints) the files. But I'm getting this "An operation
first awaited:"
error.
I've read the traps page about this error several times, but still
.
>- you are allowed to put a | not only between things, but also at the
>very front. This is allowed in the syntax so that you can line things up
>vertically like I did. Think of it as similar to allowing a , after the
>last element in a list, like with [1, 2, 3, 4, ]
&g
There was a talk by Jonathan Worthington at the German Perl Workshop 2018,
http://act.yapc.eu/gpw2018/talk/7326
"8 ways to do concurrency and parallelism in Perl 6"
I'd be very interested in seeing the slides and/or video of this talk.
Anyone know if it is available or will be available anywher
Talking to myself :-)
Seems it has something to do with the values in the hash. If they are just
True, this works:
$ perl6
To exit type 'exit' or '^D'
> my %a= :k, :e, :r; my %r= :r; my %e= :e; my Set $s = %a (-) %r (-) %e;
set(k)
On 23 November 2017 at 16:20, Norman
se-10 number must begin with valid
digits or '.' in '⏏k' (indicated by ⏏)
in block at line 1
> my %a= k=>"k", e=>"e", r=>"r"; my %r= r=>"r"; my %e= e=>"e"; my Set $s =
(%a (-) %r) (-) %e;
set(k)
> my @a= &qu
tt-a.p6
#!/usr/bin/env perl6
my @excludes = "exclude";
my @all = "keep", "exclude", "remove";
my @remove = "remove";
my Set $take1 = (@all (-) @remove) (-) @excludes;
dd $take1;
my Set $take2 = @all (-) @remove (-) @excludes;
dd $take2;
$ ./tt
)
in block at ./traverse-dir0.p6 line 12
However, if I change the line 12 to:
$dir-channel.close;
The program does not throw and exception on this line and runs properly.
On 30 October 2017 at 16:58, Norman Gaywood wrote:
> Looking at Andrew Shitov's new "Using Perl6" bo
start {
while my $file = $dir-channel.receive() {
say $file.path;
}
CATCH {
when X::Channel::ReceiveOnClosed { .resume }
}
}
}
await $dir-read, @workers;
}
--
Norman Gaywood, Computer Systems Offic
Someone should mention perl6 :-)
http://profsjt.blogspot.com.au/2017/10/is-haskell-right-language-for-teaching.html
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia
ngayw...@une.edu.au http://turing.une.edu.au
old verbose:
if "eraseme.txt".IO.f {
say "exists";
} else {
say "does not exist";
}
It seems to me it only looks buggy when you are trying to do one liners and
you don't naturally get a boolean context.
--
Norman Gaywood, Computer Systems Officer
School of S
"erasxeme.txt".IO.f
It will fail (before the .f even) on the .IO call because "erasxeme.txt"
does not exist. perl6 will then throw an exception when you try to use the
value of that failed call.
So, you need to not "use" the value of the failed .IO call:
if not $
I'd like to see the same behavior that occurs in perl5. That is:
DB<3> mkdir "existingfile" or warn "$!\n"
File exists
DB<4> mkdir "/" or warn "$!\n"
File exists
DB<5> mkdir "/root/noway" or warn "$!\n"
Permission denied
DB<6> mkdir "newdir" or warn "$!\n"
DB<7> mkdir "newdir" or warn "$
To answer myself, it's a known bug reported over a year ago :-(
https://rt.perl.org/Public/Bug/Display.html?id=127772
On 18 September 2017 at 16:18, Norman Gaywood wrote:
> $ perl6 -v
> This is Rakudo version 2017.07 built on MoarVM version 2017.07
> implementing Perl 6.c.
>
azinga" }
Fail
In perl5:
DB<3> mkdir "afile" or warn "$!\n"
File exists
DB<4> mkdir "/" or warn "$!\n"
File exists
DB<5> mkdir "/root/noway" or warn "$!\n"
Permission denied
DB<6> mkdir "adir&qu
On 16 September 2017 at 23:29, Elizabeth Mattijsen wrote:
>
> > On 16 Sep 2017, at 13:32, Norman Gaywood wrote:
> > sub MAIN( :$debug = False, :$verbose is rw = False ) {
> > ...
> > $ ./tt.p6 --debug
> > ===SORRY!=== Error while compiling /home/ngaywood/
!=== Error while compiling /home/ngaywood/./tt.p6
Cannot use 'is rw' on optional parameter '$verbose'.
at /home/ngaywood/./tt.p6:4
Not sure what the neat way of doing this is.
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New Englan
N> in the
> docs if you want to know more).
>
> The point of all this is to not require exhaustive examples to show you
> possible ways of calling getc; you just need to know how to unlock the
> code.
>
> Putting it all together, it tells you that these are valid examples:
>
&g
le is intended to be condensed without any surplus code.
So my question is, is the $channel.close required? Leave it out and the
code still seems to work. Am I missing some subtle point?
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale
ro::HTTP:ver('0.7'): ===SORRY!===
Cannot locate symbol 'SSL_load_error_strings' in native library 'libssl.so'
===SORRY!===
Cannot locate symbol 'SSL_load_error_strings' in native library 'libssl.so'
in any at /home/ngaywood/rakudo-star-2017.07/ins
d I miss something
> obvious?
>
> Obviously it's possible to have operators that ignore whitespace (1+1
> works just fine) but is it possibly for user defined ones?
>
> Possibly more serious ones.
>
> Simon
>
--
Norman Gaywood, Computer Systems Officer
School of S
>From inside a program I'd like to send some input to the stdin of external
program and read back the stdout.
The example in https://docs.perl6.org/language/ipc under proc comes close
to what I want:
my $echo = run 'echo', 'Hello, world', :out;
my $cat = run 'cat', '-n', :in($echo.out), :out;
sa
On 24 May 2017 at 16:40, Norman Gaywood wrote:
>
> However, your code does not look like it will do what you want if you have
>> multiple TASKs
>>
>
>
Yes it does. Sorry ignore me :-)
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
U
' Ted Moon',
'',
'Mission C',
' Jim Kirk',
' Mr Spock',
'',
;
my $in-TASK = "";
for @Data -> $Line {
if $Line.contains( "TASK type" ) {
$Line ~~ m/ 'TASK
do it all at once.
>
>
> Many thanks,
> -T
>
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia
ngayw...@une.edu.au http://turing.une.edu.au/~ngaywood
Phone: +61 (0)2 6773 2412 <(02)%206773%20241
47 matches
Mail list logo