🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
xheimlich so in Python every object has a (up to pseudo-one-way function collisions, I presume) function called "hash". 12:05
most, maybe all objects are hashable. I use this to generate unique filenames for serialized objects.
in Raku hash is the name for a dict (or hashmao, sure). What is Python's "hash"? 12:06
(I use cksum in bash, but I'm not sure that's the same.)
MasterDuke .WHICH maybe
xheimlich p6: say <1 2 3 4>.WHICH; say "Something else".WHICH; 12:08
camelia List|54965328
Str|Something else
xheimlich huh. so It's like an internal identifier? But will it remain the same in a different session/run,or is it like "what's its name in the current session?"
MasterDuke p6: say <1 2 3 4>.WHICH; say "Something else".WHICH; 12:10
camelia List|62519168
Str|Something else
xheimlich yeah, what I'm looking for is pretty much a checksum. I don't expect it to be compatible with other systems, just that it always gives the same number to the same object and that with some probability same number => same oject. 12:12
xheimlich in my local machine with Rakudo version 2020.01 implementing Perl 6.d, > say "Something else".WHICH; 12:13
Str|Something else
MasterDuke hm, not sure rakudo has something exactly like that
xheimlich I have workflows that download images from bing, google etc. image searches. 12:14
This is done in Python, so I save them has f"{hash(file_contents)}.{original ext}". In this way I avoid most duplicates. 12:15
then I have some bash lollapalooza to move and copy these files to and from hierachical directory structures, a mess. 12:16
MasterDuke ah, i don't think rakudo has a built-in hashing function. if you use nqp there's nqp::sha1, but it's probably better to just use a module
xheimlich So I started to rewrite my bash scripts in Raku and it seemed that downloading the files in Raku was neater. Separate the data wrangling and the machine learning (has to be in Python due to Pytorch).
I can be called experienced in ML with Python but I still can't use it for "shell scripting", it's too convoluted. I already know Raku better than Python for that, and this in a week's time. 12:17
MasterDuke modules.raku.org/search/?q=hash has a bunch of options 12:18
xheimlich ok. Iḿ going to do my homework then.
oh wait. there's MD5. That's a little more secure than needed, but file renaming performance shouldn't be a bottleneck. 12:23
Altreus Never thought I'd see someone say MD5 is more secure than needed :D 13:27
perryprog who needs MD5 when you have strlen 13:52
tadzik not PHP :P 13:58
perryprog Sorry sorry, I meant .chars 14:01
Altreus I'm sorry that you recognised it as a PHP function 14:10
nobody should have to be in that position
tadzik nah, I was refering to that story where Rasmus allegedly picked different naming conventions for PHP stdlib functions because he was hashing them with strlen and didn't want too many conflicts 14:13
Altreus A logical philosophy that is fundamental to the design of the entire language 14:23
Altreus any discorders? Is it dead? timotimo ? 14:43
Altreus Had to fight myself not to put @ on that nick 14:43
timotimo yeah discord is ded
-ish
Altreus k 14:47
how am I supposed to waste time now
timotimo federated social networks :) 14:53
timotimo check out all the latest memes on the secure scuttlebutt 14:55
perryprog timotimo is there news regarding Discord, or do you mean just in general? 14:58
lizmat and another Rakudo Weekly News hits the Net: rakudoweekly.blog/2020/11/09/2020-...-serviced/ 14:59
perryprog \o/
timotimo dunno, it's just having a little bit of a partial outage or something 15:01
i haven't checked on the details
Altreus it's having a paddy 15:03
I will use the time to read the latest newsletter 15:04
xinming SmokeMachine: when we use Red module, is Red:api<2> recommend? or, `use Red` will use all the new features? 15:05
SmokeMachine xinming: I’d say to always use :api<2>, even to make it continue working when we lunch :api<3> 15:12
guifa` lizmat++ 19:58