←2020-08-19 2020-08-20 2020-08-21→ ↑2020 ↑all
00:27:50 <zzo38> Today I wrote this program: http://sprunge.us/3AtNod (I don't know if it is any good to you, but, there it is.)
00:30:50 -!- FreeFull has quit (Ping timeout: 265 seconds).
00:31:22 <moony> zzo38: What language is that?
00:32:03 <zzo38> moony: PostScript.
00:33:30 -!- FreeFull has joined.
00:46:39 <zzo38> (Although, with some features specific to Ghostscript, such as the %pipe% device, and the makeimagedevice operator.)
00:47:51 <kmc> zzo38: what does it do?
00:48:16 <zzo38> kmc: It parses and renders a DVI file (such as output from TeX).
00:49:07 <kmc> oh, cool
00:50:34 -!- tromp has joined.
00:56:27 -!- tromp has quit (Ping timeout: 272 seconds).
01:20:35 -!- Sgeo has quit (Read error: Connection reset by peer).
01:22:46 -!- Sgeo has joined.
01:24:00 -!- adu has joined.
02:59:31 -!- craigo has quit (Ping timeout: 246 seconds).
03:23:35 <esowiki> [[Troll Online]] https://esolangs.org/w/index.php?diff=76749&oldid=65983 * LegionMammal978 * (+49) replace private repo with clone
04:15:08 <esowiki> [[E62qpodb593]] https://esolangs.org/w/index.php?diff=76750&oldid=76427 * AlexIsOK * (-5)
04:26:23 -!- Lord_of_Life_ has joined.
04:28:09 -!- Lord_of_Life has quit (Ping timeout: 265 seconds).
04:28:09 -!- Lord_of_Life_ has changed nick to Lord_of_Life.
04:53:06 -!- tromp has joined.
04:57:40 -!- tromp has quit (Ping timeout: 244 seconds).
05:00:54 -!- adu has quit (Quit: adu).
05:04:11 -!- kritixilithos has joined.
05:07:49 -!- kritixilithos has quit (Remote host closed the connection).
05:08:36 -!- kritixilithos has joined.
05:57:57 -!- ProofTechnique has quit (Ping timeout: 246 seconds).
05:59:50 -!- ProofTechnique has joined.
07:17:32 -!- tromp has joined.
07:36:39 -!- Sgeo has quit (Read error: Connection reset by peer).
07:37:06 -!- imode has quit (Ping timeout: 260 seconds).
07:40:17 -!- glowcoil has quit (Ping timeout: 260 seconds).
07:46:07 -!- ocharles has quit (Ping timeout: 240 seconds).
07:57:31 -!- ocharles has joined.
08:02:22 -!- glowcoil has joined.
08:09:48 -!- hendursa1 has joined.
08:10:23 -!- tromp has quit (Remote host closed the connection).
08:11:43 -!- hendursaga has quit (Ping timeout: 240 seconds).
08:30:03 -!- kritixilithos has quit (Changing host).
08:30:03 -!- kritixilithos has joined.
08:30:04 -!- ProofTechnique has quit (Changing host).
08:30:04 -!- ProofTechnique has joined.
08:30:05 -!- glowcoil has quit (Changing host).
08:30:06 -!- glowcoil has joined.
09:16:55 -!- t20kdc has joined.
09:29:14 -!- tromp has joined.
10:38:00 -!- xelxebar has quit (Quit: ZNC 1.7.2+deb3 - https://znc.in).
10:38:24 -!- xelxebar has joined.
11:11:43 -!- kritixilithos has quit (Ping timeout: 240 seconds).
11:24:54 -!- kritixilithos has joined.
12:08:43 -!- kritixilithos has quit (Ping timeout: 240 seconds).
12:10:15 -!- hendursa1 has quit (Quit: hendursa1).
12:10:30 -!- hendursaga has joined.
12:12:56 -!- kritixilithos has joined.
12:34:23 -!- kritixilithos has quit (Ping timeout: 240 seconds).
12:43:11 -!- kritixilithos has joined.
12:59:58 -!- Lord_of_Life has quit (Read error: Connection reset by peer).
13:00:29 -!- Lord_of_Life has joined.
13:09:20 -!- Frater_EST has joined.
13:27:13 -!- spruit11 has quit (Remote host closed the connection).
13:27:34 -!- spruit11 has joined.
13:30:28 -!- arseniiv has joined.
14:48:33 -!- craigo has joined.
14:49:29 <b_jonas> what type of integer does getsockopt(fd, IPPROTO_IP, IP_MTU, &i, sizeof(i)); expect?
15:15:00 <spruit11> https://man7.org/linux/man-pages/man7/socket.7.html
15:17:37 <b_jonas> spruit11: "Unless otherwise noted, optval is a pointer to an int." that suggests int, but I'm not sure it applies to IP_MTU, which is doc'ed in ip(7)
15:17:54 <spruit11> Lemme check.
15:18:53 <spruit11> That's not listed as an option you can pass?
15:19:51 <b_jonas> ip(7) says "Returns an integer."
15:20:17 <b_jonas> probably an int, that's wide enough for all IP MTU
15:20:41 <spruit11> Success...
15:26:29 <b_jonas> ah look https://man7.org/linux/man-pages/man2/getsockopt.2.html says "Most socket-level options utilize an int argument for optval."
15:27:48 <fizzie> Well, isn't that exactly the same as man 7 socket's "unless otherwise noted, optval is a pointer to an int" that you quoted?
15:29:03 <fizzie> As in, it's not strictly a "socket-level option" if you pass IPPROTO_IP as the level, so if you don't think one of them necessarily applies, the other shouldn't either.
15:29:21 <fizzie> (I'd assume `int` anyway.)
15:30:46 <b_jonas> fizzie: yes, but there are sockopt options associated with different layers, distinguihsed by the second arg of ?etsockopt, so SOL_SOCKET layer doc'ed in socket(7), IPPROTO_IP layer doc'ed in ip(7) etc, and ip(7) does not have such a ocmment, but the getsockopt(2) comment is for any layer
15:31:18 <b_jonas> fizzie: and eg. libcurl I think uses long or long long as default type for options
15:32:09 <fizzie> No, I don't think it's for any layer.
15:32:13 <fizzie> It says "socket-level options".
15:32:20 <b_jonas> hmm
15:32:35 <fizzie> The second parameter of getsockopt is called `level`, not `layer`.
15:32:39 <b_jonas> but does "socket-level" mean socket(7) level or any level of sockets?
15:33:04 <fizzie> I would *assume* it means level == SOL_SOCKET.
15:33:04 <b_jonas> I should look at the header file, it may have useful comments
15:33:11 <fizzie> "To manipulate options at the sockets API level, level is specified as SOL_SOCKET."
15:33:16 <fizzie> (Another bit from man getsockopt.)
15:34:03 <b_jonas> probably
15:34:35 <b_jonas> yep, the header "/usr/include/x86_64-linux-gnu/bits/in.h" has a clear comment that says int
15:34:39 <b_jonas> that's where I should have looked at first
15:35:12 <b_jonas> although... it also says "bool" for some types, and iiuc those are of int type, not of the C99/C++ bool type (which has sizeof 1 on x86)
15:35:39 <b_jonas> but these comments may have been written when <stdbool.h> wasn't a usual thing so bool wasn't a macro or keyword
15:35:47 <b_jonas> or at least by people who were used to that
15:36:25 <fizzie> Yeah, I imagine `bool` in that context just means "int with value 0 or 1".
15:37:06 <b_jonas> in fact there's a comment for that too: "bool" means a boolean value stored in an `int'.
15:37:10 <b_jonas> in the same header file
15:37:42 <b_jonas> headers are often useful, I should look at headers more often
15:38:01 <b_jonas> they're not useful for all libraries, but for linux ones they are
15:38:50 -!- Arcorann has quit (Read error: Connection reset by peer).
15:40:13 <fizzie> I did a class on Objective-C and iOS things once, and the instructor was firmly of the opinion that it's better to read Apple's header files than their documentation.
15:40:22 <fizzie> They have surprisingly few comments in there though.
16:10:44 <Taneb> Is the a classification of finite categories analogous to that of the finite groups?
16:26:12 <esowiki> [[Special:Log/newusers]] create * Joaomilho * New user account
16:26:58 -!- Lord_of_Life_ has joined.
16:29:46 -!- Lord_of_Life has quit (Ping timeout: 265 seconds).
16:29:50 -!- Lord_of_Life_ has changed nick to Lord_of_Life.
16:41:17 -!- spruit11 has quit (Quit: Lost terminal).
16:47:56 -!- spruit11 has joined.
17:00:59 <esowiki> [[Esolang:Introduce yourself]] https://esolangs.org/w/index.php?diff=76751&oldid=76739 * Joaomilho * (+207) Introduce myself
17:07:12 <rain1> finite categories
17:34:23 -!- adu has joined.
17:46:18 <b_jonas> Taneb: try to count those finite categories as a function of size modulo whatever kind of isomorphism you want and search on OEIS to find out
17:55:43 -!- kritixilithos has quit (Ping timeout: 240 seconds).
17:57:04 -!- kspalaiologos has joined.
17:59:20 -!- Sgeo has joined.
18:43:25 <arseniiv> a friend of mine asked how often there is a type like “angle32” or “angle64” which encodes angle values (R/2πR or R/R as you prefer) in an obvious manner (fixed point without overflow and without allowing multiplication or division by values of the same type, only multiplication by integers if one really wishes to do that)?
18:44:45 <arseniiv> I know there is an algorithm to compute cosine/sine from that representation and that it’s used in some special hardware but I doesn’t know more. Maybe there are interesting things related to that
18:47:18 <arseniiv> ah, there would also be of course useful an intrinsic operation (x, m) ↦ 2π(x mod m) which doesn’t resort to floating-point operations (x, m may be non-angular fixed-point numbers or integers)
18:48:51 <arseniiv> the friend came to this noting that expressing angles in floating point makes some values less precise than others, which is quite unnatural for angle representation
18:50:43 <b_jonas> arseniiv: hmm... I don't know, I've only seen sin and cos routines for various floating points, including arbitrary precision. so if you gave me a fixed point value with some known range, I'd just scale it to a floating point value of the required precision and compute the sin that way.
18:51:33 <b_jonas> you could probably do it directly with fixed points if you really wanted to, but the fact is, double precision floats (64 bit) is almost always eonugh precision for computations like this, and they're fast
18:51:58 <b_jonas> so usually just use double precision or single precision, and even then you can choose a full sincos routine or some faster but less precise approximation
18:52:25 <b_jonas> trying to do the computation with integers would just slow this down
18:52:43 <b_jonas> at least on the modern fast x86_64 hardware that I work on
18:53:53 <b_jonas> you can still use a scaled fixed point value for storage or communication if you want
18:53:55 <arseniiv> in a usual system, yes, but there happen to be a dedicated hardware for doing that…
18:55:31 <b_jonas> yes, dedicated hardware for measurements for example. at our work we do industrial control, and all the analog sensors have a hardware that gives fixed point numbers with a known scale (the scale is known from the type of hardware) to the computer, but then our program on the cpu just scales that to a single-precision floating point number before we do anything with it
18:55:53 <b_jonas> except possibly an out of range checks (to detect hardware failures), that may be before the scaling
18:57:20 <b_jonas> though we very rarely need to compute anything like a sincos from them, I believe the only case is a tank where we're estimating the volume of the contained liquid from a distance sensor that measures the height, and we know the shape of the tank in advance
18:57:54 <b_jonas> and that's for the operator UI, not for the control
19:25:26 <arseniiv> yeah double is very precise and even single is sometimes good, damn you IEEE 754 for being so good
19:25:40 <b_jonas> yes, sometimes single is good, sometimes not
19:26:16 <b_jonas> of course you also have to write your program correctly, if you write it bad so it has additions that cancel out or such similar problems, then no amount of precision is enough
19:26:29 <arseniiv> Minecraft used single in some places but then in very big worlds very far away this caused entities to misalign. Not long ago they changed to double in those places to alleviate that
19:30:40 <b_jonas> and that's why when kids grow up to programmers, we tell them that their teachers lied to them about the quadratic equation a*x**2 + b*x + c = 0 where a, b, c are given real numbers: its actual solutions are x_0 = -(b + sgn(b) * sqrt(b**2 - 4*a*c)) / (2*a), x_1 = c / (a * x_0)
19:32:44 <b_jonas> and when you understand why exactly that is true, you've done the first step on the long path to become a numeric programmer
19:54:05 <esowiki> [[Imeight]] N https://esolangs.org/w/index.php?oldid=76752 * Kekcsi * (+2589) Created page with "== What is imeight == ''imeight'' is an imaginary eight-bit machine imagined by Csaba Skrabk. As an open source project, its emulator is also implemented and available onli..."
20:01:35 -!- aaaaaa has joined.
20:02:51 <esowiki> [[Imeight]] https://esolangs.org/w/index.php?diff=76753&oldid=76752 * Kekcsi * (+188)
20:12:16 -!- adu has quit (Ping timeout: 256 seconds).
20:12:26 -!- aaaaaa has quit (Quit: leaving).
20:13:39 <esowiki> [[Imeight]] https://esolangs.org/w/index.php?diff=76754&oldid=76753 * Kekcsi * (+8) /* Interpreted? */
20:20:00 -!- adu has joined.
20:20:49 -!- kspalaiologos has quit (Quit: Leaving).
20:32:29 <int-e> Fucking Google.
20:37:23 -!- Frater_EST has quit (Remote host closed the connection).
20:41:35 <int-e> https://paste.debian.net/1160688/ <-- all I wanted to do is send an email.
21:07:05 <arseniiv> <b_jonas> and when you understand why exactly that is true, you've done the first step on the long path to become a numeric programmer => yeah numerics are hard
21:07:37 <arseniiv> x_0 = -(b + sgn(b) * sqrt(b**2 - 4*a*c)) / (2*a), x_1 = c / (a * x_0) => I think I saw something more sophisticated
22:12:00 -!- tromp has quit (Remote host closed the connection).
22:19:32 <esowiki> [[Imeight]] https://esolangs.org/w/index.php?diff=76755&oldid=76754 * Kekcsi * (+1050)
22:27:42 -!- arseniiv has quit (Ping timeout: 256 seconds).
22:44:03 <esowiki> [[Imeight]] https://esolangs.org/w/index.php?diff=76756&oldid=76755 * Kekcsi * (+4) /* Interpreted? */
22:53:25 -!- Arcorann has joined.
22:54:07 <esowiki> [[User:Kekcsi]] N https://esolangs.org/w/index.php?oldid=76757 * Kekcsi * (+309) Created page with "Hello World! I am a professional user of programming languages, interested in the development of the languages actually used, and a fan of languages that are too interesting..."
23:12:54 <b_jonas> arseniiv: more sophisticated how? handles complex a,b,c? can avoid some rare overflows/underflows?
23:13:47 <b_jonas> or the much more complicated but still practically important cubic solver?
←2020-08-19 2020-08-20 2020-08-21→ ↑2020 ↑all