--- Log opened Fri Aug 23 00:00:57 2019 |
00:05 | | mac [macdjord@Nightstar-rslo4b.mc.videotron.ca] has joined #code |
00:05 | | mode/#code [+o mac] by ChanServ |
00:08 | | macdjord|slep [macdjord@Nightstar-rslo4b.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
01:01 | <@celticminstrel> | You probably want an Optional, Derakon. (Not sure if that's what it's called in C# tho.) |
01:01 | | macdjord|slep [macdjord@Nightstar-rslo4b.mc.videotron.ca] has joined #code |
01:01 | | mode/#code [+o macdjord|slep] by ChanServ |
01:03 | <&Derakon> | Apparently C# has nullable primitives: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/using-nullable-types |
01:04 | | mac [macdjord@Nightstar-rslo4b.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
01:04 | <&Derakon> | I ended up just declaring that if the ship's waterline is more than a million meters below the surface, I probably haven't initialized it yet~ |
01:08 | <&[R]> | Derakon: https://termbin.com/nn2x |
01:08 | <&[R]> | JS and C |
01:09 | <&Derakon> | Yeah, I'm not particularly surprised now, but it caught me out earlier. |
01:09 | <&[R]> | Same when I first learned that |
01:11 | <&[R]> | `tcc -run` is pretty much the only reason to use tcc |
01:11 | <&[R]> | Unless you need a really small compiler for some reason |
01:17 | | himi [sjjf@Nightstar-1drtbs.anu.edu.au] has joined #code |
01:17 | | mode/#code [+o himi] by ChanServ |
02:23 | <&ToxicFrog> | Reiv: NaN is definitely not NULL! |
02:24 | <&ToxicFrog> | Derakon: if you want to use NaN as a sentinel value, `function isNaN(x) return x != x end` |
02:27 | <@Reiv> | ToxicFrog: Okay yes I did not say it correctly |
02:28 | <@Reiv> | NaN is however like NULL in that they do not compare directly against each other, and nor can you add them, divide them, etc against any other number without it Being Bad. |
02:29 | <&ToxicFrog> | That's all incorrect though? NULL does == NULL, and you can perform math operations on NaN and get more NaNs back (assuming nonsignaling NaNs, which is typical) while doing that on NULL/nil is a type error in most languages. |
02:46 | <@Reiv> | ... NULL has never equalled NULL in any system I've worked in |
02:46 | <@Reiv> | And doing math to NULL results in NULL, which can be a fun afternoon of tracing through subqueries let me tell you |
02:47 | <@Reiv> | Select case when null = null then 1 else 0 end |
02:47 | <@Reiv> | > 0 |
02:47 | <@Reiv> | Select case when null != null then 1 else 0 end |
02:47 | <@Reiv> | > 0 |
02:48 | <@Reiv> | Select 5 + null |
02:48 | <@Reiv> | > NULL |
02:48 | <&McMartin> | Derakon: NaN != NaN is not only permitted but required by IEEE 754 |
02:49 | <&McMartin> | It is not for "uninitialized" |
02:49 | <&McMartin> | It is for, broadly speaking, 0/0. |
02:50 | <&Derakon> | Yeah, math breakdowns. This is what happens when I get lazy~ |
02:50 | | JustBob [justbob@Nightstar.Customer.Dissatisfaction.Administrator] has quit [Ping timeout: 121 seconds] |
02:50 | <&Derakon> | IIRC applying any math operator to NaN yields NaN? |
02:51 | <@Reiv> | NULL is uninitialized. Gotta confess, I'm going to miss it. |
02:52 | <@Reiv> | Well, nonexistant. |
02:52 | <@Reiv> | But still. |
02:55 | <&McMartin> | But you won't! |
02:55 | <&McMartin> | Because C# has nullable types. |
02:56 | <&McMartin> | `int` vs `int?` |
02:57 | <@Reiv> | ... huh, really? Okay, I now like C# a teeny bit better. |
02:58 | <&McMartin> | (Also generally speaking almost all languages allow nullability of anything that isn't a primitive type like 'integer that fits in a register') |
02:59 | <&McMartin> | (This is, not to put too fine a point on it, Actually Bad) |
03:00 | <@Reiv> | ... yes, quite |
03:01 | <@Reiv> | I dunno, I hadn't come accross it in my early forays into programming |
03:01 | <&McMartin> | The idea of NULL being an all-caps thing is from C |
03:01 | <&McMartin> | The spelling "nil" is from Lisp and is also pretty common |
03:02 | <@Reiv> | Yeah, I don't think I got anywhere useful in C |
03:02 | <@Reiv> | hoo boy, I am going to have to plan all this very carefully aren't I |
03:03 | <&McMartin> | That's why I was suggesting "maybe also just mess around in C# writing goofy small things like Tic-Tac-Toe referees", though tbh if all you have to do in Unity is compute math formulae and feed them back into fields maybe that's not so necessary |
03:04 | <@Reiv> | mm |
03:04 | <@Reiv> | I once wrote Chess in C |
03:04 | <&McMartin> | That's not small |
03:04 | <@Reiv> | It was an ASCII board representation, nothing fancy |
03:05 | <@Reiv> | But I did not get as far as juggling NULLs. |
03:05 | | * McMartin nods |
03:05 | <&McMartin> | Oh hey |
03:05 | <&McMartin> | https://exercism.io/tracks/csharp/exercises turns out to be a lot more filled out than the one for Erlang, who knew |
03:05 | <&McMartin> | For if you want to literally give yourself homework assignments |
03:08 | <@Reiv> | I will... keep it in mind. |
03:08 | <@Reiv> | Let's see if I pass the test of 'getting everything installed', I suppose |
03:13 | <&ToxicFrog> | Reiv: ok, I've barely used SQL and related languages, so I think that's where the disconnect comes in |
03:13 | <@Reiv> | It behaves differently in proper programming? If so, that could be really handy to know in advance >_> |
03:16 | <&ToxicFrog> | So, in all the languages I use on the regular (C++, C, Python, Lua, and Clojure), nullptr/NULL/None/nil is a singular value that is equal to itself |
03:16 | <&ToxicFrog> | Even in C/++, "a null pointer to a Foo" == "a null pointer to a Bar" |
03:17 | <&ToxicFrog> | This is also true in Java (although I do not use it regularly anymore) |
03:17 | <&ToxicFrog> | In all of those except C/++, trying to do math on nil is an error; I'm pretty sure it's always at least a warning in C/++ but I'm a bit rusty on that aspect. |
03:19 | <&McMartin> | The answer to C++ is "oh god, don't go there, also please use `nullptr` instead of `NULL`" |
03:19 | <&McMartin> | "Please don't ask why" |
03:19 | <&ToxicFrog> | The behaviour you're familiar with with null (null is valid for operations but "poisons" them, does not compare equal to itself) is how NaN behaves. |
03:20 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
03:21 | <&McMartin> | The answer for C, which is mostly true in C++ except for some ugly bits involving the stricter type rules which I no longer recall offhand but which is why you need to use nullptr |
03:21 | <&McMartin> | Is that NULL is defined to be "0 when used in a pointer context" |
03:21 | <&McMartin> | It is, very specifically, not necessarily the pointer whose value inside the machine is actually all zero bits. |
03:22 | <&McMartin> | Because that might be valid and if so NULL is not supposed to refer to it. |
03:22 | <&McMartin> | (It did, sometimes, anyway; relying on this fact apparently is one way to tell if code was written for the PDP/11) |
03:22 | <&McMartin> | But if you take the value that "NULL" is and then use it in an integer context, the compiler is to automagically transform it into a zero. |
03:22 | <&McMartin> | (don't do this) |
03:23 | <&McMartin> | In practice on all modern machines hardware developers know that C exists and design the system so that any given system will not have valid memory mapped in at the very bottom of the address space. |
03:26 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code |
03:28 | <@Reiv> | ... so NULL is a trap, run with NaN where it does not hurt my head, gotcha |
03:28 | <@Reiv> | Vaugely wonder why programming languages and databases decided to disagree on such a fundamental point of data definition, sigh heavily, move on~ |
03:34 | <&McMartin> | They were designed independently |
03:35 | | * Reiv has history shot. |
03:35 | <&McMartin> | NULL as a value in C is a vestige of the era where computers were programmed by hooking them up to RAM chips and actually directly controlling the values that got put *on* those RAM chips |
03:35 | <&McMartin> | and its pins |
03:36 | | * McMartin shares some code from the program he's been dissecting. https://bumbershootsoft.files.wordpress.com/2019/08/front_attack_05_sprite_definitions.png |
03:36 | <&McMartin> | And here it is actually working https://bumbershootsoft.files.wordpress.com/2019/08/front_attack_01_gameplay.png |
03:39 | <&McMartin> | Reiv: As a rule, the thing about NULL in C# and Java is that if you end up actually doing anything with it other than checking to see if it *is* NULL, your program crashes |
03:39 | <&McMartin> | C# has a number of operators for "do something sensible if it *is* NULL" that I don't have memorized because as noted I don't use the language |
03:40 | <&McMartin> | But I *do* use several languages that stole notation or at least vocabulary from it. |
03:40 | <@Reiv> | I see |
03:46 | < Pink> | Hey, I don't suppose anyone knows how to set an object reference in unity via animation properly? |
03:46 | < Pink> | Both animation events and setting keyframes work totally fine until I reload the project, where all reference are wiped from the animation. |
03:55 | < Pink> | (Well, that is, the event works but doesn't take arguments so is less useful) |
03:58 | <@Reiv> | I cannot assist you on this, but Derakon might have just barely enough experience to do so |
03:58 | <@Reiv> | If you use Unity though, I may have to annoy you more in the near future given I apparently have a project this weekend >_> |
03:59 | < Pink> | I do indeed |
04:05 | <@Reiv> | Well, that could prove helpful. |
04:05 | <@Reiv> | I blame it all on Derakon, of course. |
04:05 | <@Reiv> | His battleship game has left me inspired to do something. Curse that 'inspiration' and 'productivity', ha. :p |
04:06 | < Pink> | Oh? What're you making? |
04:08 | <@Reiv> | At this stage? My goal is to make a cube that glides along, Star Wars speeder-style, above a rudimentary terrain in a satisfying way. |
04:09 | < Pink> | http://motorcity.updog.co/Life001/life001.html Gliding eh |
04:10 | <@Reiv> | that won't load on my work machine, but is it a Game of Life glider by chance :P |
04:11 | <@Reiv> | If I can pull that off - and given how important 'feel' is, that's not a trivial question - I will see if I can pull off making a speeder sim. Based, of all things, on the Technical-style motorized assymetric combat of recent African conflicts... just with space hovercraft equvilants of Hiluxes and muscle cars getting guns strapped to them and sent |
04:11 | <@Reiv> | forth to do battle against tyrannical foes. |
04:11 | <&Derakon> | Pink: I'm not really familiar with Unity animation support, unfortunately. Can you describe what you're trying to do more broadly though? |
04:11 | <@Reiv> | But I have learned the danger of talking about a thing instead of doing a thing, so I'm not focusing on that too much. |
04:12 | <@Reiv> | First up is Cubey. Let's see if I can manage that much >_> |
04:12 | < Pink> | Reiv- it includes one. |
04:12 | < Pink> | It is a tiny puzzle game where you have to get a glider across multiple walls |
04:13 | < Pink> | Derakon, I can set an object reference field in a script via animation keyframe, just like most properties. |
04:14 | < Pink> | It works fine, until I reload the project and suddenly all such keyframes are empty. |
04:14 | < Pink> | That is, there is still a keyframe but it has no value. |
04:14 | <&Derakon> | Hmm. |
04:15 | <&Derakon> | Are you trying to edit a prefab instead of a gameobject, by any chance? |
04:15 | < Pink> | No error messages or anything to easily track down, and internet searches bring up the exact opposite(that is, trying to set animation via script) |
04:15 | < Pink> | I am not. |
04:15 | <&Derakon> | Honestly my advice though would be to join #unity3d on Freenode. They have way more breadth of experience there. |
04:16 | < Pink> | I suppose I'll need to. |
04:17 | < Pink> | For now, it seems my best bet is to set a list of possible targets and set it by an index. |
04:23 | <@Reiv> | What're you trying to animate, Pink? |
04:23 | < Pink> | A camera, in this case. Or rather a script on one |
04:39 | <@Reiv> | Machinima? |
04:39 | <@Reiv> | (Is it still called that these days, I wonder?) |
04:45 | <&McMartin> | (yes) |
04:47 | < Pink> | Nope, an actual game. And while I could get around this by using cinemachine, I still want to figure out what the problem is. |
05:01 | | * Reiv nods. |
05:01 | <@Reiv> | What game you workin' on? |
05:12 | < Pink> | Nothing fancy; making a very basic quest/mission framework |
05:15 | <@Reiv> | For anything in particular, or does that part remain a Dread Secret? |
05:16 | | Derakon is now known as Derakon[AFK] |
05:34 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has quit [Ping timeout: 121 seconds] |
05:39 | | celticminstrel [celticminst@Nightstar-6an2qt.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
05:45 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has joined #code |
05:45 | | mode/#code [+o Reiv] by ChanServ |
06:10 | < Pink> | Well, mostly for testing out some ideas I had. |
06:11 | < Pink> | Bit of mystery solving, so in THAT sense there are dread secrets |
06:11 | < Pink> | Also, a buried ship. |
06:11 | < Pink> | America has a surprising number of gigantic riverboats buried under cornfields. |
07:33 | <&McMartin> | Looks like tonight I'm writing about 6502 stuff instead of playing it or doing SDL2 work |
07:36 | | Vorntastic [uid293981@Nightstar-2dc.p8m.184.192.IP] has joined #code |
07:36 | | mode/#code [+qo Vorntastic Vorntastic] by ChanServ |
07:50 | < Pink> | Ok, really dumb question. |
07:50 | < Pink> | Anyone know how to reset the animator window? |
07:51 | < Pink> | I seem to have zoomed and/or scrolled away from the center so far that I can't find anything >.> |
07:51 | < Pink> | ...well, rebooting fixed that, but would be nice to have a 'zome to extents' for that |
07:53 | | himi [sjjf@Nightstar-1drtbs.anu.edu.au] has quit [Operation timed out] |
09:28 | | Kindamoody[zZz] is now known as Kindamoody |
10:35 | | himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code |
10:35 | | mode/#code [+o himi] by ChanServ |
11:24 | <&Reiver> | Hey Pink |
11:25 | <&Reiver> | Did you sign up with a realname or alias for your Unity account? |
11:25 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
11:26 | < Pink> | both, why? |
11:28 | <&Reiver> | How both? |
11:28 | < Pink> | That is, I used a partial name that is close enough if I ever need to be billed |
11:28 | <&Reiver> | Or is this "You do not attempt to have any seperation between online nickname and IRL names"? |
11:28 | <&Reiver> | Aha, I see |
11:28 | <&Reiver> | And then full realname in the correct spot? |
11:28 | | JustBob [justbob@ServerAdministrator.Nightstar.Net] has joined #code |
11:28 | | mode/#code [+o JustBob] by ChanServ |
11:28 | < Pink> | Yes. |
11:29 | <&Reiver> | huh. I honestly hadn't thought of that. Thank you. |
11:29 | <&Reiver> | Excuse me while I go throw together a new email account~ |
11:36 | < Pink> | Of course, lots of people don't believe my real name anyway. |
11:44 | <&Reiver> | now you've got me curious :p |
11:46 | <@ErikMesoy> | Is it something like the unfortunate protagonist of Meet the Parents, 'Gaylord Focker' ? |
11:53 | <@gnolam> | Falcon T. Lightningspear: https://tragedyseries.tumblr.com/post/23622570977 |
12:11 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
12:20 | < Pink> | Hah, no, Jim Lawless |
12:29 | <&Reiver> | That is indeed a glorious name. |
12:31 | <&Reiver> | I am, alas, not nearly so gifted, but I'll see what I can do. |
12:32 | | * TheWatcher can't even remember what he signed up with >.> |
12:33 | <@TheWatcher> | Oh, hey, I did use my real name. |
12:40 | <@sshine> | Jim Lawless is a cool name. |
12:41 | <@sshine> | mine's Simon Shine. my brother Stephen works with making social events, and every time he gets to know someone slightly better they always ask him what his real name is. |
12:48 | < Pink> | At least you didn't get named Reisen. |
12:49 | <@sshine> | who's Reisen? |
12:50 | < Pink> | A bad pun |
12:51 | < Pink> | Though still not the worst name I've known. I know a girl whose parents named her after(misspelled) pastry after all. |
12:52 | <&Reiver> | wut |
12:53 | <@sshine> | my father named one of my sisters after a prostitute he really liked. |
12:53 | < Pink> | Poor Crissan. |
12:53 | <@gnolam> | sshine: ... |
12:53 | <@sshine> | yes, that's fucked up. |
12:57 | <~Vorntastic> | |
12:59 | <&Reiver> | ... liked how |
13:00 | <&Reiver> | We don't want to know the answer do we |
13:01 | <@sshine> | I don't really know, to be honest. and I don't really want to know, either. |
13:01 | <&Reiver> | That is a wholly appropriate attitude to take on this one, rest assured |
13:03 | <@TheWatcher> | Idly, I hate Java. |
14:38 | <@sshine> | https://github.com/openbsd/src/pull/13 -- good to see that OpenBSD is under active development. |
14:52 | | Kindamoody is now known as Kindamoody|afk |
15:06 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
15:06 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
15:44 | | * Vornicus finds a thing in the assembler that is... oh boy if it is what he thinks it is.... |
15:44 | <~Vornicus> | Okay we have: beq foo; rts; foo: pla; pla; rts; |
15:48 | <&ToxicFrog> | pla? |
15:48 | <~Vornicus> | pull a byte from the stack and put it into the accumulator |
15:48 | <~Vornicus> | If I have this right, this bit actually forces a return *two* functions up |
16:20 | < Yossarian> | Is this MOS6... err... damn their numbering scheme - VIC-20/C64 ? |
16:21 | <~Vornicus> | C64, the 6510 |
16:24 | < Yossarian> | I saw a 6{3-7}{0-9}0 in my brain's memory. |
16:25 | < Yossarian> | hardware stack? |
16:27 | <~Vornicus> | yep. 256 bytes. you have PHA and PLA to push and pop arbitrary bytes, PHP and PLP for the status register, and JSR and RTS use it too. |
16:27 | < Yossarian> | fancy! |
16:28 | < Yossarian> | PDP-8 has no hw stack so you have to crib to software |
16:30 | < Yossarian> | I was thinking of springboarding back in to writing code last night by making some random curses applications, making a terminal based PDP-8 front panel simulacrum/interface with keybindings for the switches would be interesting... since my monitor doesn't have a touchscreen. |
16:47 | <&ToxicFrog> | I do recommend messing around in the tty, it's lots of fun |
16:52 | < Yossarian> | I did pdcurses while on Windows; with curses and termcap - termcap supports more than 256 color for some time now |
16:53 | < Yossarian> | and possibly get UTF-8 support, don't think cmd.exe supported it |
16:53 | < Yossarian> | cmd.exe, lol |
17:15 | | Vorntastic [uid293981@Nightstar-2dc.p8m.184.192.IP] has quit [[NS] Quit: Connection closed for inactivity] |
18:12 | | Vash [Vash@Nightstar-sjaki9.res.rr.com] has joined #code |
18:41 | <&ToxicFrog> | I usually just blorf the control codes straight to the terminal, but I also don't care about supporting anything that isn't at least vt220 compatible |
18:46 | <~Vornicus> | is that a technical term |
18:47 | <&ToxicFrog> | It is now. |
18:47 | <~Vornicus> | solid |
19:40 | <&McMartin> | cmd.exe does in fact support Unicode, but you are correct that it does not expect UTF-8 |
19:41 | <&McMartin> | (The Windows equivalent of write(2) expects UTF-16 when targeting console) |
19:49 | | Derakon[AFK] is now known as Derakon |
20:47 | | Vash [Vash@Nightstar-sjaki9.res.rr.com] has quit [[NS] Quit: Leaving] |
20:52 | | Kindamoody|afk is now known as Kindamoody |
20:52 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
23:20 | <&Reiver> | hey, does using GitHub /require/ an open source kind of liscence or is the 'create a new project' thing just trying to point you really heavily in that direction? |
23:20 | <&McMartin> | At least when I created my repos, it required it for public repositories and you were charged for private ones. |
23:21 | <&McMartin> | This may have since changed. |
23:21 | <&McMartin> | For public repositories you will at least need to grant them fairly expansive rights to publish it from their datacenters. |
23:22 | <&McMartin> | There appear to now be unlimited private repositories |
23:23 | <&McMartin> | The limit is on how many other people you can authorize to get at your private repos, it seems. |
23:26 | <&Reiver> | Oh I see |
23:28 | <&McMartin> | If you do plan on publishing the source code for stuff though I do *strongly recommend* a standard open-source license, ideally one of the zlib-like permissive ones, but I am willing to spend a half hour or so discussing what your needs end up being more seriously |
23:28 | <&McMartin> | But the tl;dr is "these days, if you aren't willing to open-source the code, don't publish the source" |
23:54 | <&Derakon> | Just got one of those "how did this ever work?" things going on. |
23:54 | <&Derakon> | A couple days ago I fixed my ships to have defined waterlines instead of floating at some arbitrary offset from the object center. |
23:55 | <&Derakon> | This involved writing some code to examine the mesh and determine the waterline; I only wanted to do this once, so I initialized the waterline to -1e10 as a clearly-impossible number (it'd mean your ship floats at 10 million meters below the center of the mesh). |
23:55 | <&Derakon> | So I had some code that says "if the waterline value is less than -1e6, then we've already initialized it, so just return that"... |
23:56 | <&Derakon> | And somehow this gave correct behavior for like two days before spontaneously breaking. |
23:56 | <&Derakon> | What the fuck. |
--- Log closed Sat Aug 24 00:00:59 2019 |