--- Log opened Wed Oct 09 00:00:21 2019 |
00:01 | | Degi__ [Degi@Nightstar-bhptpp.dyn.telefonica.de] has quit [Connection closed] |
00:09 | | Kindamoody is now known as Kindamoody[zZz] |
00:18 | <~Vornicus> | Ok, plan: 120 frame cycle; on each frame I create a new random list of points for one section, and all other sections get 1 round of relaxation. I have to keep a registry of points/regions around so I can keep each region the same color as it relaxes. |
00:19 | <~Vornicus> | I record all that and give it like 100ms per frame and I have something that people can marvel at it |
00:43 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
00:55 | | ErikMesoy [Bruker@Nightstar-tqvql0.bb.online.no] has joined #code |
01:24 | | celmin|away is now known as celticminstrel |
02:12 | <&McMartin> | yay marvelousness |
03:40 | | Degi [Degi@Nightstar-bhptpp.dyn.telefonica.de] has quit [Ping timeout: 121 seconds] |
03:41 | | Degi [Degi@Nightstar-2jggm5.dyn.telefonica.de] has joined #code |
05:31 | | Derakon is now known as Derakon[AFK] |
06:24 | | celticminstrel [celticminst@Nightstar-ocfc15.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
06:38 | <&[R]> | So today I figgured out a bash trick |
06:39 | <&[R]> | I was trying to port `(var1 var2) = `` \n {command that outputs two lines}` from xs to bash |
06:40 | <&[R]> | In bash you'd do: command that outputs two lines | (read var1; read var2; everything that uses var1 and var2) |
06:41 | | Alek [Alek@Nightstar-o723m2.cicril.sbcglobal.net] has quit [[NS] Quit: ] |
06:51 | | Alek [Alek@Nightstar-o723m2.cicril.sbcglobal.net] has joined #code |
06:51 | | mode/#code [+o Alek] by ChanServ |
07:20 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [[NS] Quit: Leaving] |
07:25 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code |
08:28 | | Kindamoody[zZz] [Kindamoody@Nightstar-eubaqc.tbcn.telia.com] has quit [Ping timeout: 121 seconds] |
08:33 | | Reiver [quassel@Nightstar-ksqup0.co.uk] has joined #code |
08:33 | | mode/#code [+ao Reiver Reiver] by ChanServ |
08:42 | | Kimo|autojoin [Kindamoody@Nightstar-eubaqc.tbcn.telia.com] has joined #code |
08:42 | | mode/#code [+o Kimo|autojoin] by ChanServ |
09:31 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
09:31 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
11:27 | | Kimo|autojoin is now known as Kindamoody |
12:36 | < ErikMesoy> | What is the correct way of setting up a 2D java array row by row? I've tried a bunch of variations on int[][] arr = new int[10][4]; arr[0] = [12,20,4,4]; and they're throwing "Illegal start of expression", which StackOverflow has a lot of results for but none seemingly helpful. Is it just that I can't do it and need to go either cell by cell or the whole array at once? |
12:37 | <&McMartin> | Isn't it braces, not square brackets, for array initializers? |
12:39 | <&ToxicFrog> | Yes. |
12:39 | < ErikMesoy> | Same error. |
12:40 | < ErikMesoy> | XY problem context: I want to draw several rectangles, and each rectangle takes a 4-tuple of coordinates as an argument to draw, so I figured I'd use a 2d array of their coordinates. |
12:41 | <&ToxicFrog> | Remember that each row needs its own {} |
12:41 | <&ToxicFrog> | So you'll want something like: int[][] rects = { {x,y,w,h}, {x,y,w,h}, ... } |
12:43 | < ErikMesoy> | So I can't specify one row at a time? |
12:44 | <&[R]> | There's some array copying functions IIRC for that |
12:45 | <&McMartin> | This may have changed since the last time I paid attention, but ISTR that array initializers were special; Java doesn't have array literals, it just pretends to when declaring and initializing an array variable. |
12:46 | <&McMartin> | But even that is kind of getting out over my skis |
12:56 | < ErikMesoy> | ok that's interesting. int[][] stub = {{1,2},{3,4}}; works fine, but: int stub[][]; stub = {{1,2},{3,4}}; is six errors. |
12:56 | < ErikMesoy> | So it's seemingly not the single row that's the problem, it's the less-than-immediate initialization because apparently array initializers are very special indeed. |
--- Log closed Wed Oct 09 13:08:34 2019 |
--- Log opened Wed Oct 09 13:08:51 2019 |
13:08 | | TheWatcher [chris@GlobalOperator.Nightstar.Net] has joined #code |
13:08 | | Irssi: #code: Total of 33 nicks [25 ops, 0 halfops, 0 voices, 8 normal] |
13:08 | | mode/#code [+o TheWatcher] by ChanServ |
13:09 | | Irssi: Join to #code was synced in 14 secs |
13:11 | < ErikMesoy> | Grrrr. Why couldn't I be working in Python, where drawRect(rects[0]) would be legal. Nooo, Java is picky about the distinction between array and multiple arguments, and demands drawRect(rects[0][0],rects[0][1],rects[0][2],rects[0][3]). |
13:12 | <~Vornicus> | No expanders in java such as python's * or lua's unpack? |
13:13 | <~Vornicus> | also this calls out for a function that just accepts an array of rectangle bits and calls drawRect appropriately |
13:14 | < ErikMesoy> | overloading drawRect with that function is apparently the canonical solution |
13:29 | <@sshine> | ErikMesoy, in C# you could make your own extension method for a built-in class. I don't think Java has extension methods (yet)? |
13:30 | <@sshine> | ErikMesoy, it is annoying that the variadic function is the only one. |
13:32 | <@sshine> | ErikMesoy, https://stackoverflow.com/questions/12534531/how-to-pass-elements-of-an-arraylist-to-variadic-function |
14:08 | < ErikMesoy> | Acknowledged. |
15:39 | | Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code |
15:41 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
15:54 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code |
15:55 | | Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
16:07 | | Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code |
16:09 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
16:11 | <~Vornicus> | https://cdn.discordapp.com/attachments/474705430434807819/631501679791177738/lloyd_relaxation.gif |
16:14 | <@sshine> | nice animation! |
16:17 | <~Vornicus> | Victory. |
16:22 | | Degi_ [Degi@Nightstar-2jggm5.dyn.telefonica.de] has joined #code |
16:32 | | mode/#code [+o ErikMesoy] by ChanServ |
16:45 | | Degi_ [Degi@Nightstar-2jggm5.dyn.telefonica.de] has quit [Connection closed] |
16:48 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code |
16:49 | | Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
16:53 | <&jeroud> | Is Lloyd relaxation that thin where you move the points around to equalize the Voronoi regions? |
16:54 | <&jeroud> | (It took two tries to not say Vornonoi there. You have trained my phone well.) |
16:54 | <~Vornicus> | it is; each point is replaced with the centroid of its voronoi region |
16:58 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
17:15 | <~Vornicus> | what you're seeing here is generation of random points followed by 11 rounds of lloyd relaxation; once the 11th round is done it restarts with some new points. there's 120 distinct layouts here; each sector cycles through ten layouts before looping. |
17:17 | <@Alek> | https://i.imgur.com/DDQTevm.jpg |
17:17 | <~Vornicus> | (the whole gif lasts 12 seconds; each image is shown for 100ms) |
18:03 | <&[R]> | https://twitter.com/digitallawyer/status/1181348689756864513 |
18:05 | | catalyst [catalyst@Nightstar-v6lb30.cable.virginm.net] has joined #code |
18:28 | < Emmy> | clever |
18:55 | < Yossarian> | I have an interesting question. How do you corrupt a PDF file? |
18:55 | <&[R]> | Same as any file |
18:55 | <&[R]> | Just flip some bits |
18:56 | < Yossarian> | I'm trying, not getting an error message. |
18:57 | < Yossarian> | I won bigly at Social Services today, [R]. No move. Shoulda seen the look on my housing Social Worker's face. |
18:58 | < Yossarian> | So, good news. I want to corrupt a PDF because it's busywork she has assigned me. |
18:58 | <~Vornicus> | hooray |
18:58 | < Yossarian> | I need to buy some time. |
18:59 | < Yossarian> | cuz my mum and I were hypervigilant about today, thought we'd have to argue for staying so I can work up the street |
18:59 | < Yossarian> | and her busywork can piss right off, I will do it in the next hour, I just need to make a PDF give a error message that it is corrupted in most readers |
18:59 | < Yossarian> | maybe flip some more bits |
18:59 | < Yossarian> | for my test.pdf |
19:00 | <~Vornicus> | delete half of it |
19:00 | < Yossarian> | or replace /root tag? |
19:01 | <&[R]> | Why does she want a corrupt PDF? |
19:02 | <&ToxicFrog> | That, and also, what's wrong with just catting /dev/urandom into something with a .pdf extension |
19:02 | < Yossarian> | because I normally don't do this but |
19:02 | < Yossarian> | oh yeah |
19:02 | < Yossarian> | good point |
19:03 | <&ToxicFrog> | Like, if the goal is "produce something that PDF readers will fail to open", you don't want a corrupt PDF, you want something that isn't a PDF but is named like one. It won't pass `file`, but... |
19:03 | < Yossarian> | I'll do the busy work but if today they decided to move us (at least 3 Lyft/Uber rides, messing up pay schedule, making my part-time job less effective cuz the travel costs) I was gonna basically tell em to suck it |
19:04 | <&ToxicFrog> | None of this explains why you want a corrupt PDF? |
19:05 | < Yossarian> | I'm buying some time. |
19:06 | < Yossarian> | ah, I got it |
19:06 | < Yossarian> | that was fun |
19:06 | <&ToxicFrog> | This still doesn't explain anything. |
19:06 | < Yossarian> | Social Services makes my mother and I do busy work. |
19:07 | < Yossarian> | We search for apartments for rent and SS will help us, supposedly, but majority of the renters with my mum's fixed income and me with no jawb say "No, you don't make enough, too much of a financial risk" |
19:07 | < Yossarian> | we didn't do it |
19:07 | < Yossarian> | today is the only day we didn't do it, so I will do it; said we left it at home by accident |
19:08 | < Yossarian> | I just want to shoot it off to her like yeah sure because last time I left it at home but did it, she bit my head off, sent me an email like before I even got home (gotta take a train to take a bus that comes once every hour that takes 30+ minutes to get here) |
19:09 | < Yossarian> | she sent me an email or left a message "I NEED THAT NOW!!!!" but like... I was still waiting for the damned bus! |
19:09 | < Yossarian> | she knows how far away I am from the Social Services offices or she doesn't, which is why I wrote a wry and scathing email and I got them to cooperate today. |
19:10 | < Yossarian> | Kinda like "the dog ate my homework" because I'm a 31 year old man, I'm not gonna do busywork for the state. |
19:10 | <&ToxicFrog> | Oh, the old "send the professor a garbage file and claim the mail server ate your homework" trick. That was ancient when I was an undergrad. |
19:10 | < Yossarian> | But more clever. Since most people are technologically illiterate, the computer gremlins ate my homework until I get more time to do the busy work properly and compile it into a document. |
19:11 | < Yossarian> | I have never thought of this scheme up until now. |
19:11 | < Yossarian> | Didn't know it was a thing, there is a web based site that DOES apparently do that but my browser doesn't work with it/it's broken. |
19:11 | < Yossarian> | I was a very good student, I wrote english compositions and done book analysis like 30 minutes before they were due. |
19:12 | < Yossarian> | or in the case of coding classes I would start early because it's great fun or was great fun to me and it will be great fun to me again soon cuz my mojo is coming back |
19:13 | < Yossarian> | starting coding project early means more time to do fancy things and run test cases |
19:13 | < Yossarian> | although a lot of the stuff in CS1 and CS2 class was basically fuzzing... are there any decent fuzzing and automated C/C++ testing tools or libs out there? |
19:14 | <&ToxicFrog> | American Fuzzy Lop was the state of the art last time I looked, but that was some years ago |
19:16 | < Yossarian> | Interestin note: my version of zathura (suckless software I think? or recommended) won't throw an error on the messed up PDF, just opens it and it appears blank. |
19:16 | < Yossarian> | $ zathura -v |
19:16 | < Yossarian> | zathura 0.3.7 |
19:16 | < Yossarian> | (plugin) pdf-poppler (0.2.7) (/usr/lib/zathura/pdf.so |
19:17 | < Yossarian> | she's already bitching about the receipt of my mum's |
19:17 | < Yossarian> | I did it just fine. |
19:35 | <&[R]> | Uninstall poppler and switch over to mupdf |
19:35 | <&[R]> | Poppler takes a fucking minute to render a page |
19:38 | | * ErikMesoy puts in a good word for SumatraPDF. |
19:39 | <&[R]> | That'd require WINE or a VM |
19:40 | <&[R]> | zathura+mupdf is what I use to view all my PDFs |
19:40 | < Yossarian> | [R]: oh, yeah, can't you run zathura with mupdf? |
19:41 | <&[R]> | https://termbin.com/qixn |
19:42 | <&[R]> | firefox/chrome are good secondary PDF readers as well |
19:53 | <&[R]> | What paperwork are they wanting anyways? |
20:02 | < Yossarian> | The busywork is I list like 3 apts per day that I've contacted them and type the response. But previously with mum's fixed income and me with no jawb and no one to co-sign (ex-communicated by nutty family) it was like "nah, too big of a financial risk" |
20:03 | < Yossarian> | so lately we've taken to having a lot of filler stuff in there and the real good ones are the non LLCs and private renters who are more ah, leinient |
20:03 | < Yossarian> | the other doucment is a simple receipt but she never had a problem before |
20:04 | < Yossarian> | I don't have a scanner or anything so I use the cell phone camera, now the $50 LG has a better camera so it isn't as annoying but she might be feigning ignorance that the image or PDF with images sucks because boy, you shoulda seen her face today. |
20:05 | < Yossarian> | She was probably a bit livid inside but you know, constantly contradicting yourself while I'm legally homeless and such doesn't jive well with me. |
20:05 | < Yossarian> | "We only do business deals with this hotel." -- 8 mos. later -- "We need to move you out and into another motel." |
20:05 | < Yossarian> | like, wait what? |
20:05 | < Yossarian> | along with a litany of other utter shite |
20:08 | < Yossarian> | I digress. |
20:09 | < Yossarian> | #code doesn't need to know about how much of a fallen angel/piece of shit I am. That's what #thegentlemanloser is for. I mean, kinda? Sometimes? |
20:30 | < Yossarian> | which is a good channel on the good ol' but dying slashnet |
21:00 | <&[R]> | Slashnet just grew over 100 users this year |
21:01 | <&[R]> | That's now that I'd call dying |
21:01 | <&[R]> | not* |
21:15 | | Derakon[AFK] is now known as Derakon |
22:42 | | macdjord [macdjord@Nightstar-rslo4b.mc.videotron.ca] has quit [Connection closed] |
22:44 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
22:48 | | macdjord [macdjord@Nightstar-rslo4b.mc.videotron.ca] has joined #code |
22:48 | | mode/#code [+o macdjord] by ChanServ |
23:17 | <~Vornicus> | Ok, so, joining. I only need to concern myself with points that participate in a triangle whose circumcircle extends into other cells. |
23:18 | <~Vornicus> | This, conveniently, includes points that are simply On The Hull, because each hull edge is truly a triangle with at least one point at infinity and those have infinite radius |
23:32 | | Kindamoody is now known as Kindamoody[zZz] |
23:33 | <~Vornicus> | So: I'll call points that can interact with the outside world "participating". |
23:35 | <~Vornicus> | AndI'll call points that directly fall in this cell "own". |
23:36 | <~Vornicus> | So it goes like this: while I have own, participating points, iterate over cells that are touched by same, and add their own participating points to this cell's points to consider. |
23:36 | <~Vornicus> | rather, are touched by the circumcircles that cause the points to be participating |
23:38 | <~Vornicus> | When I add a cell's participating points, I also add that cell's geometry to the area we consider "not participating", which is to say that points are only participating if their corresponding circumcircles touch cells whose own participating points have not been added to this thing's consideration. |
23:42 | <~Vornicus> | ...and, once again, my decision to use points at infinity to bound my triangulation pays off: there is literally no difference between a finite triangle having this and an infinite one. |
--- Log closed Thu Oct 10 00:00:45 2019 |