00:31
xinming joined
02:19
pony joined
02:51
hulk joined
02:52
kylese left
|
|||
antononcube | @timo Yes, " we don't have phi" !! 😱🚫🏆🔪 | 03:11 | |
Andl, yes, polymod was recently discussed here, I read its docs, and apparently I forgot about it. | 03:13 | ||
03:15
hulk left,
kylese joined
03:23
MyNetAz left
03:38
MyNetAz joined
05:20
SrainUser left
05:33
Aedil joined
07:55
Xliff joined
|
|||
Xliff | \o | 07:56 | |
Anyone awake? | |||
In c there is a long double type that aparently raku is unaware of. How difficult would that be to add? | |||
08:15
Sgeo left
09:37
lizmat left
|
|||
antononcube | You could give your long doubles to the fat rats. | 10:46 | |
@timo I don’t think polymod works for conversion to a real number base. Even if it can be used it’s invocation is not trivial. | 11:03 | ||
Xliff | antononcube: Not for native. | 11:30 | |
antononcube: So if I need to put long doubles into a NativeCall CStruct, I have to use 2 gdoubles to get the right structure size. Even then, I have to hope that the C size has get and set support via a gdouble to access them. | 11:31 | ||
Either that or a way for C to push a long double into a FatRat via MoarVM. | 11:32 | ||
It's either that or adding num128 support to MoarVM, which would be the preferable mechanism, hence my question. | |||
Yeah...no long double support in MoarVM. See nqp/MoarVM/src/6model/reprs/P6num.c line 106 | 11:39 | ||
And that looks like a pretty hefty set of changes to override change. | 11:40 | ||
s/override change/override/ | |||
timo | m: say pi.polymod(sin(e) xx *).head(10) | 11:57 | |
camelia | (0.26612362006943124 0.01671806145054955 0.15796708938073678 0.33265224021202755 0.0017089887989527597 0.2821637652954223 0.22587974285193013 0.17814066440359966 0.30887654092293815 0.05041693617022247) | ||
timo | antononcube, i haven't verified this result, but it looks like polymod can do what you ask | ||
m: say [\+] pi.polymod(sin(e) xx *).head(10) Z* (sin(e) >>**>> 1..*) | 11:59 | ||
camelia | (0.10931860408542679 0.13290413239334 0.513728235987621 1.6483322731466838 1.6558702489667838 3.1825966710851086 4.630662300463871 5.950823803303825 8.54871683477373 9.023179594408939) | ||
timo | i think i probably did this wrong? | ||
oh, right, i understand what you meant by "not trivial", sin(e) xx * is not correct it has to be the same sin(e) >>**>> 1..* as the other one | 12:00 | ||
m: say [\+] pi.polymod(sin(e) Z** 0..*).head(10) Z* (sin(e) Z** 0..*) | 12:01 | ||
camelia | (3.141592653589793) | ||
timo | m: say [\+] pi.polymod(sin(e) X** 0..*).head(10) Z* (sin(e) X** 0..*) | ||
camelia | (3.141592653589793) | ||
timo | i guess there's no "remainder" when using reals? | 12:02 | |
or our pi is too precise and/or sin(e) is too imprecise | |||
oh, no it's because my first number is 1 | |||
so the result is just pi | |||
m: say [\+] pi.polymod(sin(e) X** 1..*).head(10) Z* (sin(e) X** 1..*) | 12:03 | ||
camelia | (0.10931860408542678 0.12308923922099448 0.12547287998523385 0.12551934162408468 0.12562489374474925 0.12563269279019293 0.12563309429521047 0.12563371284592548 0.12563371284592548 0.12563371284592548) | ||
timo | yeah that doesn't seem right either | ||
doesn't help that i don't know what exactly we want it to do | 12:07 | ||
Xliff | timo! | 12:13 | |
Did you see the question I was asking, earlier? | |||
If not I'll repeat it: How hard would it be to implement a num128 (C long double)? | 12:14 | ||
timo | good question. depends on the amount of integration you require i guess? | 12:24 | |
like, i think making regular nqp::blah_n ops work with num128 would be a good chunk of work, since many places assume 64bits as "the size" for some things, like registers, and the P6num object is not "variable size" and i'm not sure what places exactly that touches if we need to change it | 12:26 | ||
on the other hand, if it's okay to be using nativecall for all the things, you can "just" malloc a 128bit piece of memory and pass a pointer to that around everywhere | 12:27 | ||
12:30
ACfromTX left
|
|||
timo | and of course there's steps in between ... i assume :) | 12:30 | |
Xliff | Yeah. | 12:59 | |
Really, all I want is a way to turn a proposed num128 into a FatRat | |||
Or even a CArray[uint8].alloc(16) to FatRat would work, as well. | 13:01 | ||
That could work until official support is added. | |||
antononcube | @timo Thanks from trying things on the my real-digits question. | 13:17 | |
I tried similar to yours code. Note, that it does not return “digits.” | 13:18 | ||
Here is page showing what I want to do: mathworld.wolfram.com/PhiNumberSystem.html | 13:19 | ||
And, now, again, I am thinking that real-digits should be in “Math::Sequences”. | 13:20 | ||
I will fork “Math:Sequences” and put in first real-digits implementation within an hour or two… | 13:36 | ||
This is @librasteve and other people doing physics (with Raku or otherwise): | 13:46 | ||
cdn.discordapp.com/attachments/633...2d083& | |||
14:31
Voldenet_ joined
14:32
Voldenet left,
Voldenet_ is now known as Voldenet
|
|||
librasteve | lol | 14:35 | |
can anyone tell me the best wau to do a case insensitive grep in raku Red in example like this (from Red docs Getting Started)... | 14:41 | ||
for Person.^all.grep(*.name.starts-with('Jo')) -> $person { say $person } | |||
please | |||
14:49
vrurg joined
14:53
vrurg_ left
14:54
Sgeo joined
15:12
vrurg_ joined
15:14
vrurg left
|
|||
nahita3882 | *.name ~~ /:i ^ 'Jo'/ i think | 15:14 | |
:i for case, ^ for starting | 15:15 | ||
15:15
vrurg_ left,
vrurg joined
|
|||
librasteve | tx! lemme try that... | 15:16 | |
ok - it works as intended, but getting a warning | 15:18 | ||
falling back (to mute this message, please define the $*RED-FALLBACK variable): This type cannot unbox to a native string: P6opaque, Red::Column | |||
i have tried to suppress with my $*RED-FALLBACK = True; but no joy | 15:20 | ||
that's wierd, I can suppress the warning if I place the RED-FALLBACK line inside the method I call, but not if it is set where I define the model | 15:22 | ||
I also suspect that with RED-FALLBACK set, this is no longer using the DB to do the search via a WHERE SQL clause since that appears to want the Red specific checks like starts-with() | 15:23 | ||
15:58
lizmat joined
15:59
lizmat left,
lizmat joined
|
|||
SmokeMachine | Red does not accept regex (not yet)… doesn’t .grep({ .column.lc.starts-with: “jo” }) work? | 16:37 | |
That error is because Red cannot translate regex to SQL yet… so it breaks and then do the filtering in raku… that’s not what you want | 16:40 | ||
If .lc.strats-with does not work, I’ll need to implement it… | 16:42 | ||
16:44
hvxgr left
16:45
SrainUser joined
|
|||
[Coke] | in general, use .fc instead of .lc for forcing case insensitivity for that approach | 16:57 | |
(more unicode-safe approach) | |||
SmokeMachine | (I was not sure fc was implemented in Red... but it seems lc wasn't either) | 17:00 | |
[Coke] | ah, ok | 17:02 | |
17:05
Sgeo left,
Sgeo joined
|
|||
librasteve | thanks guys, I already tried | 17:10 | |
for Person.^all.grep(*.name.lc.starts-with($needle.lc)) and the .fc option (as recommended by ChatGPT lol) ... both these seem to be doing the fallback thing, so I gather there is no way to do case insensitive grep in Red yet | 17:12 | ||
SmokeMachine | I'm implementing lc/fc/uc now | ||
librasteve | \o/ yay | 17:13 | |
SmokeMachine | Almost there... www.irccloud.com/pastebin/N6H1fedQ/ | 17:19 | |
done | 17:35 | ||
librasteve | fantastic - thanks! | ||
rebuilding now | |||
Voldenet | in sql actually you may need that LOWER, depending on the collation | 17:43 | |
like mssql uses SQL_Latin1_General_CP1_CI_AS and mysql uses utf8mb4, meaning they're case insensitive by default | 17:44 | ||
s/you may need/you may not need/ | 17:45 | ||
so `where Name like '%thing'` would match "SOMETHING" and "one more thing" | 17:46 | ||
(I didn't include postgres or o**cle because they are case sensitive by default) | 17:49 | ||
SmokeMachine | sadly Red has no MySQL driver... :( | 17:50 | |
librasteve | .oO - actually I have seen some odd results with SQLite .... I'll check a few things | ||
Voldenet | sqlite is insensitive iirc | ||
ofc you can make them all CS/CI but defaults are different | 17:51 | ||
it's more important when making unique indexes on columns | |||
librasteve | ChatGPT: SQLite is case-insensitive by default for text comparisons in SQL statements | ||
SmokeMachine | but anyway, it has LOWER() and UPPER(), so, doing .fc on red will make the code able to use different DBs... | 17:53 | |
librasteve | cool | 17:54 | |
appreciate the help! | |||
SmokeMachine | did that work for you? | 17:55 | |
librasteve | yep - works fine | 17:56 | |
Voldenet | i checked and sqlite is indeed case insensitive | ||
>create table foo(n text); insert into foo(n) values ("BAR"); select * from foo where n like 'b%' | 17:57 | ||
17:58
Xliff left
18:02
SrainUser left
19:36
Aedil left
19:49
hvxgr joined
|
|||
guifa | we don't have a module to parse ifconfig info do we? | 21:44 | |
librasteve | metacpan.org/pod/Net::Ifconfig::Wrapper plus Inline::Perl5 ? | 22:03 | |
timo | maybe it's time to stop using ifconfig and use ip instead, which has json output as a feature :) | 22:04 | |
iproute2 i should say | 22:05 | ||
> Hence, our plans are to replace net-tools completely with iproute, maybe leading the route for other distributions to follow. | 22:06 | ||
^- in a mail from 2009 | |||
guifa | ip isn't on Mac ha | 22:15 | |
librasteve | ~ > which ifconfig ... /sbin/ifconfig on macos | 22:16 | |
also perl ;-) | 22:17 | ||
guifa | I want to have a good module for handling determining network interfaces | ||
Voldenet | ip isn't on bsd too | 22:19 | |
iirc | |||
timo | oh, right, iproute is called out as being able to expose all the features "of the linux kernel" | ||
guifa | Voldenet yeah, bsd and mac both do something slightly weird things with the network interfaces | ||
1 - embedding their scope_id into the address itself | |||
and 2 - not using 0 as the "default" one | 22:20 | ||
librasteve | guifa: long term suggest you add that to the most wanted list ... short term looks like some kind of compromise ifaict | ||
guifa | oh I'm going to go ahead and develop it | ||
I need it for a module I'm working on, although that module will rely on some PRs I've submitted for MoarVM and one I'm about to submit for Rakudo | |||
librasteve | guifa: nice (rolling your own was one compromise option) | 22:21 | |
guifa | I'm just going to call it Net::Interfaces with two commands -- one that gets all the interfaces and the other that tries to figure out the default one | 22:22 | |
antononcube | I made initial versions of real-digits and phi-number-system in "Math::Sequences". See : github.com/antononcube/Raku-Math-Sequences | 22:27 | |
So, @librasteve , are you interested in reviewing "numberphile" functions or subs? (In order to do a PR for "Math::Sequences".) | 22:28 | ||
@timo Please see the test file link I posted above. (Related to the polymod discussion earlier.) | 22:31 | ||
23:01
Tirifto_ left
23:05
Tirifto joined
|
|||
coleman | On mac... is netstat a builtin too? I use netstat -r for routes on mac, but I forget if I need to install it from brew | 23:07 | |
guifa | netstat is built in | 23:09 | |
coleman | The proper thing to do is unfortunately the most difficult, which is to use the low level and OS-dependent C/Obj-C APIs to query interfaces, routing table, etc. | 23:10 | |
And it doesn't help that Linux is always doing something goofy down there | 23:11 | ||
Like, are we supposed to use netlink for everything now? www.kernel.org/doc/html/v6.7/users...index.html | 23:13 | ||
Linux networking is confusing. | |||
honestly, parse ifconfig like a boss. | 23:15 | ||
guifa | yeah | 23:17 | |
I think just using various forms of OS / version checking | |||
just frustrating because ifconfig doesn't have super nice output | 23:34 | ||
apparently ip can output in json in some versions |