Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,804,004 events total
2021-08-06 06:28:20 × juhp quits (~juhp@128.106.188.220) (Quit: juhp)
2021-08-06 06:31:08 chele joins (~chele@user/chele)
2021-08-06 06:33:00 <Cajun> > endBy ", " . drop 1 . init $ "[(233,173,20), (200, 10, 155)]"
2021-08-06 06:33:01 <lambdabot> ["(233,173,20)","(200","10","155)"]
2021-08-06 06:33:05 timexdd joins (~timexdd@202.14.120.238)
2021-08-06 06:34:11 <Cajun> i have no idea if the file has spaces
2021-08-06 06:34:11 juhp joins (~juhp@128.106.188.220)
2021-08-06 06:34:48 <Cajun> there are, which makes this harder
2021-08-06 06:34:55 <Axman6> might be time to start using parsers...
2021-08-06 06:35:07 <Cajun> so much for nice memory usage
2021-08-06 06:37:01 kenran joins (~kenran@b2b-37-24-119-190.unitymedia.biz)
2021-08-06 06:37:18 <Axman6> eh? why do you think that won't let you have decent memory usage?
2021-08-06 06:38:01 <Cajun> thinking it would have some big overhead
2021-08-06 06:38:10 <Axman6> you should think again
2021-08-06 06:38:10 × timexdd quits (~timexdd@202.14.120.238) (Quit: Connection closed)
2021-08-06 06:38:31 <Axman6> attoparsec isn't named after a very small unit of measure for nothing
2021-08-06 06:40:17 <Cajun> i only know so much about parsers. the textbook i read touched on a homemade variety, but i havent touched on them much more
2021-08-06 06:41:26 × markpythonicbitc quits (~markpytho@2601:647:5a00:35:298a:b52c:58df:cdd4) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-08-06 06:41:42 <Cajun> hm, attoparsec doesnt seem to be useful for Strings, only ByteStrings
2021-08-06 06:44:44 lortabac joins (~lortabac@2a01:e0a:541:b8f0:113:1bce:1dde:b94a)
2021-08-06 06:50:02 m4m41 joins (~goober@49.207.205.58)
2021-08-06 06:51:30 burnsidesLlama joins (~burnsides@client-8-91.eduroam.oxuni.org.uk)
2021-08-06 06:51:35 × burnsidesLlama quits (~burnsides@client-8-91.eduroam.oxuni.org.uk) (Remote host closed the connection)
2021-08-06 06:52:01 burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
2021-08-06 06:53:12 burnside_ joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
2021-08-06 06:53:14 × burnside_ quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer)
2021-08-06 06:53:14 × burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer)
2021-08-06 06:53:36 burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
2021-08-06 06:54:05 burnside_ joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
2021-08-06 06:54:05 × burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer)
2021-08-06 06:55:05 burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
2021-08-06 06:55:06 × burnside_ quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer)
2021-08-06 06:55:40 burnside_ joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
2021-08-06 06:55:41 × burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer)
2021-08-06 06:55:45 <Axman6> yes, you really want to be doing this using ByteStrings, String is absolutely terrible
2021-08-06 06:56:54 burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
2021-08-06 06:56:55 × burnside_ quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer)
2021-08-06 06:58:08 × m4m41 quits (~goober@49.207.205.58) (Quit: Leaving)
2021-08-06 06:59:43 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
2021-08-06 07:00:43 <Cajun> though i thought we wanted lazy file reading. `Data.ByteString.readFile` is strict
2021-08-06 07:02:42 × oxide quits (~lambda@user/oxide) (Ping timeout: 250 seconds)
2021-08-06 07:03:49 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
2021-08-06 07:04:47 <Axman6> right, you use lazy bytestrings
2021-08-06 07:05:44 <Cajun> ah yeah forgot those existed
2021-08-06 07:07:08 <Cajun> ill have to leave making the parsers for another day, its already 2am lol
2021-08-06 07:07:24 <Cajun> thanks for the help!
2021-08-06 07:07:26 × burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Remote host closed the connection)
2021-08-06 07:07:35 × Cajun quits (~Cajun@user/cajun) (Quit: Client closed)
2021-08-06 07:08:18 Cajun joins (~Cajun@user/cajun)
2021-08-06 07:08:27 michalz joins (~michalz@185.246.204.62)
2021-08-06 07:09:25 oxide joins (~lambda@user/oxide)
2021-08-06 07:09:29 <jle`> Cajun: yeah, i think overall you can just do map (read . filter isChar) . splitOn "," -- and then you can use `Image PixelRGB8`
2021-08-06 07:10:00 <jle`> Cajun: the way PixelRGB8 works is that it expects the internal vector to be a list of Word8's, where each group of 3 represents a 3-color-channel pixel
2021-08-06 07:10:37 <jle`> so you can just do stringToImg :: String -> Image PixelRGB8; stringToImg = Image 100 100 . Vector.fromList . map (read . filter isDigit) . splitOn ","
2021-08-06 07:11:26 Erutuon joins (~Erutuon@user/erutuon)
2021-08-06 07:11:37 <jle`> note that internally, in the JuicyPixels library, an image of PixelRGB8's doesn't actually contain any PixelRGB8. it contains a "continguous memory" vector of each component
2021-08-06 07:12:16 <jle`> PixelRGB8 itself is merely a "view"/abstraction over the internal representation. and so ideally you never access the bytes directly, you ask for pixelrgb8's, and juicypixels aggregates them and gives them to you
2021-08-06 07:13:14 <jle`> so using the Image constructor is "unsafe" in a way and is pretty low-level, because if you don't have the bytes in exactly the right order and orientation it will fail. but luckily in your case, it happens to magically line up
2021-08-06 07:14:10 × wolfshappen_ quits (~waff@irc.furworks.de) (Ping timeout: 258 seconds)
2021-08-06 07:14:57 × endlesseditions quits (~endlessed@135.129.112.36) (Quit: Textual IRC Client: www.textualapp.com)
2021-08-06 07:15:26 Cajun85 joins (~Cajun@user/cajun)
2021-08-06 07:15:34 <Cajun85> random disconnects are a pain
2021-08-06 07:15:55 epolanski joins (uid312403@id-312403.brockwell.irccloud.com)
2021-08-06 07:16:17 × anandprabhu_ quits (~anandprab@86.106.121.228) (Quit: Leaving)
2021-08-06 07:16:23 <jle`> Cajun85: ah heh, i figured you did sleep. but i sent a few messages about five minutes ago if you're interested still
2021-08-06 07:16:47 <Cajun85> i can see them, its just disconnecting for a split second lol
2021-08-06 07:17:12 Shires joins (~Shires@user/shires)
2021-08-06 07:18:58 × Cajun quits (~Cajun@user/cajun) (Ping timeout: 246 seconds)
2021-08-06 07:19:34 <Cajun85> it surely did something, though its definitely not 100 by 100
2021-08-06 07:19:49 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-08-06 07:19:58 <Cajun85> idk how big it is, so ill just keep scaling up until it errors
2021-08-06 07:21:03 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
2021-08-06 07:21:32 × tommd quits (~tommd@cpe-76-179-204-251.maine.res.rr.com) (Remote host closed the connection)
2021-08-06 07:23:32 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
2021-08-06 07:25:30 <jle`> Cajun85: ah yeah, that was just a placeholder :)
2021-08-06 07:26:04 <jle`> if you're guessing and checking, one thinkg you can do is to count the number of items and see what the factors are
2021-08-06 07:26:16 <jle`> length . splitOn ","
2021-08-06 07:26:23 <jle`> er, and divide that by three :)
2021-08-06 07:27:07 <jle`> Cajun85: but yeah, important to remember that the only reason this scheme works is because of a big coincidence in that the way your data is encoded happens to be exactly the internal representation juicypixels uses for images (if you flatten the tuples out). so, a happy coincidence
2021-08-06 07:27:26 <jle`> *for 3-channel color images
2021-08-06 07:27:36 <Cajun85> very interesting, i didnt realize that. would this also work for 4 channel RGBA?
2021-08-06 07:27:37 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2021-08-06 07:27:52 <Cajun85> if it were arity 4 tuples instead
2021-08-06 07:28:00 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
2021-08-06 07:28:09 <maerwald[m]> Anyone running stack on FreeBSD?
2021-08-06 07:28:35 <Axman6> I tried, but it doesn't work on 13.0 :'(
2021-08-06 07:29:23 <maerwald[m]> I'm building it on 12.2
2021-08-06 07:29:25 × aman quits (~aman@user/aman) (Quit: aman)
2021-08-06 07:29:33 <jle`> Cajun85: it looks like from https://hackage.haskell.org/package/JuicyPixels-3.3.5/docs/src/Codec.Picture.Types.html#line-1753, PixelRGBA8 expects r, g, b, then alpha channel bytes
2021-08-06 07:29:36 <Axman6> can't you grab it from pkg?
2021-08-06 07:29:40 <jle`> so it would work if you did Image PixelRGBA8
2021-08-06 07:29:52 <jle`> but again, this isn't really a robust way of doing this heh
2021-08-06 07:30:09 <maerwald[m]> Axman6: i don't use FreeBSD. I'm trying to run the integration tests on it and build binaries
2021-08-06 07:30:15 <jle`> so an ImageRGBA8 would, in its internal representation, be [r1,g1,b1,a1,r2,g2,b2,a2,...] etc.
2021-08-06 07:30:58 <jle`> but juicypixels is designed around not having to deal with the internal rep. just taking advantage of a happy coincidence here :)
2021-08-06 07:32:01 kuribas joins (~user@ptr-25vy0i8khwnki6rybr8.18120a2.ip6.access.telenet.be)
2021-08-06 07:33:03 <maerwald[m]> Axman6: so what doesn't work on 13?
2021-08-06 07:33:23 <Axman6> stack is liked against something that has a newer version on 13
2021-08-06 07:33:48 <maerwald[m]> Ah so you mean upstream binaries don't work
2021-08-06 07:34:34 Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es)

All times are in UTC.