SOLVED -- see below
Here is the Perl code in question:
# basic init
my $myhtml = myhtml_create();
myhtml_init($myhtml, 0, 1, 0);
# init tree
#!/usr/bin/env node | |
// pdf2svg Logography\ for\ Kokanu.pdf input/kokanu_%d.svg all | |
// node kokanu.mjs pre | |
// node kokanu.mjs post | |
import fs from 'fs/promises' | |
import fsx from 'fs' | |
import readline from 'readline' |
{ | |
"jest": { | |
"moduleFileExtensions": [ | |
"js", | |
"json", | |
"jsx", | |
"node", | |
"coffee" | |
], | |
"preprocessorIgnorePatterns": [ ], |
# this is my solution to GRAPH. | |
# it offers an interactive mode and some test cases | |
use v6; | |
class Graph { | |
has @!nodes; | |
has %!neighbour; | |
method connect($a, $b) { |
# curl https://raw.githubusercontent.com/perl6/ecosystem/master/META.list | sort | perl -nlE 'say m{//.+?/([^/]+)}' | uniq -c | sort -bgr | |
49 jonathanstowe | |
28 retupmoca | |
25 supernovus | |
24 tony-o | |
22 zoffixznet | |
21 tadzik | |
15 azawawi | |
14 colomon |
SOLVED -- see below
Here is the Perl code in question:
# basic init
my $myhtml = myhtml_create();
myhtml_init($myhtml, 0, 1, 0);
# init tree
#!/usr/bin/env perl6 | |
use v6; | |
use Term::termios; | |
use NativeCall; | |
class FILE is repr('CPointer') { | |
sub fdopen(Int, Str) returns FILE is native { * } | |
method new(Int $fd) { | |
fdopen($fd, "r"); | |
} |
SOLVED
Trying to get this to bind properly with Perl6, and it's being difficult!
#include <stdlib.h>
#include <stdio.h>
int floatArrayTest(float **pa) {
*pa = malloc(sizeof(float *) * 500);
Not necessarily in order of importance or ease of implementation!
Is there a cute Perl 6 way to take an array (say
‘a’..‘d’
) and get all head/tail partitions of it (e.g.(<a>, <b c d>), (<a b>, <c d>), (<a b c>, <d>))
?
Sure! Pick one:
my @a = ‘a’..‘e’; say (@a[^$_, $_..*] for 1..^@a);
my @b = ‘a’..‘e’; say (1..^@b).map: {@b[^$_, $_..*]};
my @c = ‘a’..‘e’; say (@c.rotor($_, ∞, :partial) for 1..^@c);
my @z = ‘a’..‘e’; say @z[0..*-2].keys.map: {@z[0..$_, $_^..*]}; # same as b
my @d = ‘a’..‘e’; say (1..^@d).map: {@d.rotor: $_, ∞, :partial};