code logs -> 2015 -> Sun, 25 Jan 2015< code.20150124.log - code.20150126.log >
--- Log opened Sun Jan 25 00:00:42 2015
00:09 Kindamoody is now known as Kindamoody[zZz]
00:12 Kindamoody[zZz] [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has quit [Operation timed out]
00:13 Kindamoody[zZz] [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has joined #code
00:13 mode/#code [+o Kindamoody[zZz]] by ChanServ
00:30 thalass is now known as Thalass|slep
00:54
<@celticminstrel>
McMartin: You can wrangle it so that you get an exception in C++, too - if you dynamic_cast to a pointer, you get null on failure, while if you dynamic_cast to a reference, you get an exception on failure.
00:55
<&McMartin>
Oho, OK then.
00:55
<@celticminstrel>
Actually, I vaguely recall Go doing it in a nice way. I think it was similar to Java but didn't require an explicit cast.
00:55
<&McMartin>
"Type assertions". It's totally an explicit cast.
00:55
<@celticminstrel>
Hm, okay.
00:55
<&McMartin>
It's just phrased foo.(type) instead of (type)foo.
01:01
< JBeshir>
It's only valid on interfaces.
01:02
< JBeshir>
Go has type assertions, which look like that, for saying "get me type out of the interface", and it has a "v, ok" form for doing it and getting a bool saying whether it was in fact that type rather than a panic if it wasn't.
01:02
< JBeshir>
And also has conversions, which convert types to other types, mostly used for numeric stuff and []byte <-> string, which looks like int(bluh)
01:03
< JBeshir>
Whereas C uses the same syntax for both, I think.
01:03
<&McMartin>
It does, but C++ distinguishes the former (dynamic_cast<>()) from the latter (c syntax, or, alternately, static_cast<> on primitive types), and I believe the latter are also called "coercions" in C and C++.
01:04
< JBeshir>
I thought C++ distinguished, yeah.
01:04
<@celticminstrel>
I think C-style casts can be used for both dynamic and static casts.
01:04
<@celticminstrel>
static_cast does perform coercions, I think.
01:04
<@celticminstrel>
reinterpret_cast does not.
01:04
< JBeshir>
I just wasn't sure enough. It's been a long time since I messed with C++ and my use was pretty limited.
01:04
<&McMartin>
Yeah
01:05
<&McMartin>
This is a corner of C++ that you explicitly aren't supposed to use anyway, so even though I use C++ professionally I'm rusty on this part.
01:05
<&McMartin>
reinterpret_cast<> is like deliberately using the wrong field of a union.
01:05
<@celticminstrel>
I think so, yes.
01:06
<&McMartin>
Also, in a weird corner of the C++ "must be like C wherever feasible" design space, it turns out you can't dynamic_cast<> any class with no virtual methods.
01:06
<&McMartin>
Because a class with no virtual methods is a C struct in all ways including memory layout, and as such there is no room for type IDs.
01:06
<@celticminstrel>
I'm not sure why you'd want to?
01:07
<&McMartin>
Uniform reference? Not having to care precisely what you were passed?
01:08
<@celticminstrel>
You need dynamic_cast for that?
01:08
<&McMartin>
There are ways to do inheritance in C with nothing but C casts and careful structure layout - those still work in C++.
01:08
<&McMartin>
They do not work once C++ inheritance comes into play because C++ inheritance Doesn't Work Like That
01:09
<&McMartin>
In particular, in the presence of multiple inheritance you are no longer guaranteed that the same object statically cast to a parent type is the same bit pattern as it was going in.
01:09
<&McMartin>
Static casts of pointers in C are no-ops in the binary.
01:09
<@celticminstrel>
Casting to a base cast might modify the pointer.
01:09
<&McMartin>
Yep.
01:10
<&McMartin>
A hypothetical C++ with only single inheritance doesn't have that restriction; it's trivial to retain the property that upcasts don't modify the pointer in those cases.
01:10
<@celticminstrel>
I think the pointer generally is modified only if it's not the first base class, or something like that.
01:10
<&McMartin>
Yep.
01:11
<&McMartin>
So, anyway, if you had a class with only fields, and a subclass that added fields, and there were no methods for it, you couldn't use dynamic_cast<> to get the second from the first.
01:12
<&McMartin>
"You should have been using composition", I hear you say, and you're right - inheritance is awful and I don't think it's a coincidence the latest generation of languages is moving away from it.
01:17 celmin [celticminst@Nightstar-i3llni.dsl.bell.ca] has joined #code
01:17 mode/#code [+o celmin] by ChanServ
01:18 celticminstrel [celticminst@Nightstar-de4ll6.dsl.bell.ca] has quit [Ping timeout: 121 seconds]
01:18 celmin is now known as celticminstrel
01:48 gizmore|2 [kvirc@Nightstar-5j63s3.pools.vodafone-ip.de] has quit [[NS] Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
01:52 gizmore [kvirc@Nightstar-5j63s3.pools.vodafone-ip.de] has joined #code
03:08 Thalass|slep [thalass@Nightstar-h1qmno.eastlink.ca] has quit [Ping timeout: 121 seconds]
03:23 Thalass|slep [thalass@Nightstar-h1qmno.eastlink.ca] has joined #code
04:00 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [Connection reset by peer]
04:07 ASCII [pink@Nightstar-rcj56n.dyn.optonline.net] has joined #code
04:10
< ASCII>
Is there a python wrangler in the house?
04:11
<@celticminstrel>
I know python, though others probably know it better.
04:12
< froztbyte>
ASCII: what's up?
04:15
< ASCII>
I am several levels deep in confusion, using an unfamiliar file import script in unfamiliar software, with a badly understood file format. I'm getting an error with certain files.
04:15
< ASCII>
http://i.snag.gy/wMRPn.jpg is the exact error.
04:15
< froztbyte>
okay
04:15
< froztbyte>
how much of that message do you understand?
04:15
< froztbyte>
(as in, where do I start?)
04:16
< ASCII>
From what I gather, the padding between the files that work and the ones that don't are different, and the importet only knows one version.
04:16
< ASCII>
But I might be misinterpreting it entirely.
04:18
< froztbyte>
so if you look at https://docs.python.org/2/library/struct.html
04:18
< froztbyte>
.unpack will give you a tuple result
04:18
< froztbyte>
and then it tries to pick the first element of that tuple
04:19
< froztbyte>
the f is presumably some filehandle, and it's trying to read 4 bytes and parse it all according to whatever the hell 'l' is (long or something, I guess)
04:19
< ASCII>
Right.
04:19
< froztbyte>
what I reckon is happening is that you're not ending up actually getting 4 bytes (for whatever reason)
04:20
< froztbyte>
I vaguely know that there are File Oddities on windows
04:20
< froztbyte>
(in python)
04:20
< froztbyte>
but I don't know them well enough to tell you where to look, unfortunately
04:21
< froztbyte>
if you can edit that module (I'm guessing you can?), you can perhaps disjoin that read from the struct, then print out a repr or something of it
04:22
< ASCII>
I have the py files, so I can do whatever
04:24
< ASCII>
But as mentioned, I know practically nothing about python, or blender for that matter.
04:24
< froztbyte>
right
04:24
< froztbyte>
well, the traceback tells you what the calling filepath is
04:24
< ASCII>
Right.
04:24
< froztbyte>
so try to match up against the file that it is loading, try to poke at it a bit in a python repl
04:25
< froztbyte>
it's fairly easy to get started
04:25
< froztbyte>
f = open('/path/to/file', 'r')
04:25
< froztbyte>
type(f.read(4))
04:25
< froztbyte>
etc
04:25
< froztbyte>
(f.seek(0) will reset you to beginning)
04:28
< ASCII>
Hm.
04:35
< ASCII>
Can you suggest a suitable interpreter to experiment with?
04:36
< ASCII>
I'd rather not look at blender any more than I need to
04:36
< froztbyte>
python idle is the only thing I know of on windows
04:53
< ASCII>
Hm. No progress, yet, but at least I'm on a bit of a better footing when I track down the guy who wrote this...
04:53
< ASCII>
Thanks for the help!
05:32 Derakon is now known as Derakon[AFK]
06:03 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
06:10 Checkmate [Z@Nightstar-pdi1tp.customer.tdc.net] has quit [Ping timeout: 121 seconds]
07:02 macdjord [macdjord@Nightstar-r9vt2h.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
07:19 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Ping timeout: 121 seconds]
07:32 celticminstrel [celticminst@Nightstar-i3llni.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
07:47 Kindamoody[zZz] is now known as Kindamoody
08:17 macdjord [macdjord@Nightstar-r9vt2h.mc.videotron.ca] has joined #code
08:17 mode/#code [+o macdjord] by ChanServ
08:21 AverageJoe [evil1@Nightstar-2ofrtr.ph.cox.net] has joined #code
09:06 Thalass|slep is now known as Thalass
09:06 mode/#code [+o Thalass] by ChanServ
09:42 Kindamoody [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
09:45 Kindamoody [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has joined #code
09:45 mode/#code [+o Kindamoody] by ChanServ
10:19 Kindamoody is now known as Kindamoody|afk
10:21 Kindamoody|afk [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has quit [[NS] Quit: Switching networks, brb]
10:21 Kindamoody|autojoin [Kindamoody@Nightstar-e0h756.mobileonline.telia.com] has joined #code
10:21 mode/#code [+o Kindamoody|autojoin] by ChanServ
10:21 Kindamoody|autojoin is now known as Kindamoody|afk
10:48 AverageJoe [evil1@Nightstar-2ofrtr.ph.cox.net] has quit [[NS] Quit: Leaving]
12:05 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
12:43 Reivthia [orthianz@Nightstar-n23.mif.98.101.IP] has quit [Ping timeout: 121 seconds]
12:48 Orthia [orthianz@Nightstar-1kv.0qv.184.203.IP] has joined #code
12:48 mode/#code [+o Orthia] by ChanServ
12:52 Orthia [orthianz@Nightstar-1kv.0qv.184.203.IP] has quit [Ping timeout: 121 seconds]
12:56 Orthia [orthianz@Nightstar-n23.mif.98.101.IP] has joined #code
12:56 mode/#code [+o Orthia] by ChanServ
13:29 Orthia [orthianz@Nightstar-n23.mif.98.101.IP] has quit [Ping timeout: 121 seconds]
13:34 Orthia [orthianz@Nightstar-nqv.l72.224.119.IP] has joined #code
13:34 mode/#code [+o Orthia] by ChanServ
14:53 Orthia [orthianz@Nightstar-nqv.l72.224.119.IP] has quit [Ping timeout: 121 seconds]
14:57 Orthia [orthianz@Nightstar-21h389.callplus.net.nz] has joined #code
14:57 mode/#code [+o Orthia] by ChanServ
15:20 Thalass [thalass@Nightstar-h1qmno.eastlink.ca] has quit [Ping timeout: 121 seconds]
15:24 Kindamoody|afk [Kindamoody@Nightstar-e0h756.mobileonline.telia.com] has quit [Ping timeout: 121 seconds]
15:31 Kindamoody|afk [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has joined #code
15:31 mode/#code [+o Kindamoody|afk] by ChanServ
15:41 Thalass [thalass@Nightstar-h1qmno.eastlink.ca] has joined #code
15:41 mode/#code [+o Thalass] by ChanServ
16:00 Thalass [thalass@Nightstar-h1qmno.eastlink.ca] has quit [Connection closed]
16:10 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
16:11 mode/#code [+o Checkmate] by ChanServ
16:14 celticminstrel [celticminst@Nightstar-i3llni.dsl.bell.ca] has joined #code
16:14 mode/#code [+o celticminstrel] by ChanServ
16:59 * Julius finishes reinstalling Win7 for the umpteenth time.
16:59 * Julius neuters the load-bearing USB not to launch windows setup, EVER.
17:27
< simon_>
ugh. I just keep a Windows 7 in a VirtualBox. whenever it screws up, I copy in the version from when it was just installed.
17:29 thalass [thalass@Nightstar-h1qmno.eastlink.ca] has joined #code
17:29 mode/#code [+o thalass] by ChanServ
18:35 celticminstrel [celticminst@Nightstar-i3llni.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
18:35 celticminstrel [celticminst@Nightstar-i3llni.dsl.bell.ca] has joined #code
18:35 mode/#code [+o celticminstrel] by ChanServ
18:38 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code
18:38 mode/#code [+o Alek] by ChanServ
19:30 Kindamoody|afk is now known as Kindamoody
20:11 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: ZNC - http://znc.in]
20:26 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Ping timeout: 121 seconds]
20:33
< Julius>
http://stackoverflow.com/questions/6163683/cycles-in-family-tree-software <- LOL.
20:42 Attilla [sid13723@Nightstar-ed0oqj.irccloud.com] has quit [Connection closed]
20:43 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code
20:43 mode/#code [+o Alek] by ChanServ
21:22 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
21:49 ToxicFrog` [ben@Nightstar-2k0p46.dsl.teksavvy.com] has joined #code
22:24 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
22:24 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
22:27 Checkmate [Z@Nightstar-pdi1tp.customer.tdc.net] has joined #code
22:27 mode/#code [+o Checkmate] by ChanServ
22:27 Kindamoody is now known as Kindamoody[zZz]
22:35
< simon_>
quiz: does anyone know what the Python code 'False == False in [False]' does, and why?
22:35
< simon_>
s/does/results in/
22:36 Attilla [sid13723@Nightstar-ed0oqj.irccloud.com] has joined #code
22:39 ToxicFrog` [ben@Nightstar-2k0p46.dsl.teksavvy.com] has quit [Connection closed]
22:39
<@thalass>
simon: True
22:42
<@celticminstrel>
Shouldn't it return false?
22:43
<@celticminstrel>
Or wait, I don't actually know which of == and in has higher precedence.
22:43
<@celticminstrel>
But no, it doesn't actually matter.
22:43
< simon_>
celticminstrel, it's a trick question.
22:43 * thalass shrugs
22:44
< simon_>
celticminstrel, it looks like it's a precedence question, but it wouldn't make sense either way.
22:45
< simon_>
'(False == False) in [False]' becomes 'True in [False]' which is False, not True. and 'False == (False in [False])' becomes 'False == True', which is also False.
22:45
<@celticminstrel>
So why does it return true?
22:45
< simon_>
Python's logical operators can be chained, sort of like 1 < 2 < 3. so what I wrote is, for some forsaken reason, syntax sugar for 'False == False and False in [False]'
22:46
<@celticminstrel>
Ah... that's...
22:46
< simon_>
easy to guess, right! ;)
22:46
< simon_>
my friend had to inspect python bytecode to figure it out.
22:47
<@thalass>
heh
22:47
< simon_>
I don't think it's that common of an idiom in Python.
22:47
<@celticminstrel>
I'd say it'd make more sense if in was excluded from chaining.
22:48
<@celticminstrel>
Though, chaining in with in might be useful.
22:48
<@celticminstrel>
(Not sure.)
22:49
< simon_>
chaining much more than '<' isn't very useful for me, since it's so different from what any other language would do.
22:50
<@celticminstrel>
The following pairs make sense in chaining: (<,<=), (<,<), (>,>=), (>,>), (==,==)
22:50
<@celticminstrel>
It might be different from other programming languages, but it's more like math.
22:51
<@celticminstrel>
There might be other pairs that make sense.
23:29 Derakon[AFK] is now known as Derakon
--- Log closed Mon Jan 26 00:00:37 2015
code logs -> 2015 -> Sun, 25 Jan 2015< code.20150124.log - code.20150126.log >

[ Latest log file ]