code logs -> 2019 -> Tue, 03 Dec 2019< code.20191202.log - code.20191204.log >
--- Log opened Tue Dec 03 00:00:32 2019
01:29 * Vornicus C#s, tries to figure out how to do a = [int(x) for x in b]
01:40
<~Vornicus>
ok in ... I suppose C++, I'd do something like int[] a = new int[b_length]; for (k = 0; k < b_length; k++) { a[k] = toInteger(b[k]); }
01:44
<~Vornicus>
int[] a = new int[b.Length]; foreach (x in b) { a[k] = Int32.Parse(x); }
01:45
<~Vornicus>
that's considerably better
01:45 celmin|away is now known as celticminstrel
01:47
<~Vornicus>
...no it's not, because I don't have the index
01:47
<~Vornicus>
which means it doesn't help to *use* foreach because i don't have enumerate
01:48
<~Vornicus>
so I'm back at the classical for loop.
01:57 Degi [Degi@Nightstar-vrqfbc.dyn.telefonica.de] has quit [Ping timeout: 121 seconds]
02:01
<~Vornicus>
ah, `List` and its method `Add` okay back on track
02:02 Degi [Degi@Nightstar-8dgi39.dyn.telefonica.de] has joined #code
02:15
<&ToxicFrog>
Vornicus: I think you can also do: int[] a = b.Select(Int32.Parse)
02:15
<&ToxicFrog>
(for some reason C# calls functional collection operations LINQ and calls map Select)
02:16
<&McMartin>
LINQ is functional programming operations being sold to people used to writing SQL
02:16
<&McMartin>
where SELECT is in fact secretly map and WHERE is filter.
02:16
<~Vornicus>
aha!
02:21
<~Vornicus>
apparently it doesn't quite like that...
02:25
<~Vornicus>
CS1061: 'string[]' does not contain a definition for 'Select' and no accessible extension method 'Select' accepting a first argument of type 'string[]' could be found (are you missing a using directive or an assembly reference?)
02:27
<~Vornicus>
I have the linq using in the top, and autofill seemed to be okay with it but
02:30
<~Vornicus>
a = (int[])b.Select(int.Parse);
02:31
<~Vornicus>
I don't know exactly what it was complaining about before
02:31
<~Vornicus>
but man it's weird
02:32
<~Vornicus>
it's ... uh... it looks like it's doing "implicit" templating in places where I would expect it to be explicit and then doing it explicitly does weird things.
02:50
<~Vornicus>
a = b.Select(int.Parse).ToArray();
02:50
<~Vornicus>
that is the truth. okay.
03:00 * Vornicus corrects dumb errors like c = b*b instead of c = a*b, proceeds
03:21 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
04:41 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
04:41 mode/#code [+qo Vornicus Vornicus] by ChanServ
05:07 Derakon is now known as Derakon[AFK]
05:27 * jeroud desperately needs a shower, and also a walk down the road for coffee and a sandwich.
05:28
<&jeroud>
AoC will fit in either between or after those things.
05:31 himi [sjjf@Nightstar-1drtbs.anu.edu.au] has quit [Ping timeout: 121 seconds]
06:34 celticminstrel [celticminst@Nightstar-2kik29.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
07:54 gnolam [lenin@Nightstar-e3tf4i.priv.bahnhof.se] has quit [[NS] Quit: Bleh]
08:25 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
08:25 mode/#code [+o himi] by ChanServ
09:33 You're now known as TheWatcher[d00m]
10:02 * Vornicus finally finishes aoc day 2, gets onto day 3, let's do this
10:35 gnolam [quassel@Nightstar-0oc.n80.224.185.IP] has joined #code
10:35 mode/#code [+o gnolam] by ChanServ
11:19
<~Vornicus>
...need an Optional
11:19 Kindamoody[zZz] is now known as Kindamoody
11:20
<~Vornicus>
which only exists for basic types sigh
11:30
<~Vornicus>
suppose I could just return null.
11:48 You're now known as TheWatcher
11:48
<~Vornicus>
why do I forget things like that exist
11:48
<~Vornicus>
I guess I'm used to dynamically typed languages where whatever null is is a different thing than an actual object
11:50
<~Vornicus>
anyway
12:21 gnolam [quassel@Nightstar-0oc.n80.224.185.IP] has quit [[NS] Quit: Bleh]
13:05 celticminstrel [celticminst@Nightstar-2kik29.dsl.bell.ca] has joined #code
13:05 mode/#code [+o celticminstrel] by ChanServ
13:55 celticminstrel is now known as celmin|away
16:17 gnolam [quassel@Nightstar-e9kifc.cust.bredband2.com] has joined #code
16:17 mode/#code [+o gnolam] by ChanServ
17:07 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
17:54 Derakon[AFK] is now known as Derakon
18:21 * abudhabi encounters a second email address validator that rejects .info.
18:22 * Emmy rejects your reality.
20:45 himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [The TLS connection was non-properly terminated.]
21:06
<~Vornicus>
does help if I actually bother writing code, doesn't it
22:02 * Alek snerks.
22:36 gnolam [quassel@Nightstar-e9kifc.cust.bredband2.com] has quit [[NS] Quit: Z?]
22:53 himi [sjjf@Nightstar-1drtbs.anu.edu.au] has joined #code
22:53 mode/#code [+o himi] by ChanServ
23:21 Kindamoody is now known as Kindamoody[zZz]
23:31 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds]
--- Log closed Wed Dec 04 00:00:33 2019
code logs -> 2019 -> Tue, 03 Dec 2019< code.20191202.log - code.20191204.log >

[ Latest log file ]