--- Log opened Fri Sep 20 00:00:08 2013 |
00:20 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
00:23 | | * TheWatcher hairpulls at OAuth2 |
00:27 | <@Azash> | TheWatcher: http://hueniverse.com/2012/07/oauth-2-0-and-the-road-to-hell/ |
00:32 | | Derakon[AFK] is now known as Derakon |
00:32 | | mode/#code [+ao Derakon Derakon] by ChanServ |
00:39 | | * Vornicus takes Vash to work. |
00:39 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
01:02 | | Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Client exited] |
01:08 | | You're now known as TheWatcher[T-2] |
01:17 | | You're now known as TheWatcher[zZzZ] |
01:24 | < [R]> | "WS-* bad"?\ |
01:46 | | Turaiel[Offline] is now known as Turaiel |
02:13 | | himi [fow035@Nightstar-36db723c.ffp.csiro.au] has joined #code |
02:13 | | mode/#code [+o himi] by ChanServ |
02:48 | | Vorntastic [Vorn@Nightstar-87792ed0.sub-70-211-11.myvzw.com] has joined #code |
03:52 | | Vornlicious [Vorn@Nightstar-ce564888.sub-70-211-10.myvzw.com] has joined #code |
03:54 | | Vorntastic [Vorn@Nightstar-87792ed0.sub-70-211-11.myvzw.com] has quit [Ping timeout: 121 seconds] |
04:05 | | McMartin [mcmartin@Nightstar-141a9c34.pltn13.sbcglobal.net] has quit [[NS] Quit: reboot] |
04:12 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
04:12 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
04:15 | | Kindamoody[zZz] is now known as Kindamoody |
04:19 | | Vornlicious [Vorn@Nightstar-ce564888.sub-70-211-10.myvzw.com] has quit [[NS] Quit: Bye] |
04:27 | | McMartin [mcmartin@Nightstar-141a9c34.pltn13.sbcglobal.net] has joined #code |
04:27 | | mode/#code [+ao McMartin McMartin] by ChanServ |
04:38 | | Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code |
04:38 | | mode/#code [+ao Derakon Derakon] by ChanServ |
05:09 | | Derakon is now known as Derakon[AFK] |
05:33 | | Alek [omegaboot@Nightstar-4093ec22.il.comcast.net] has quit [Ping timeout: 121 seconds] |
05:36 | | Alek [omegaboot@Nightstar-4093ec22.il.comcast.net] has joined #code |
05:36 | | mode/#code [+o Alek] by ChanServ |
06:33 | | RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has quit [[NS] Quit: Gone.] |
06:35 | | ErikMesoy|sleep is now known as ErikMesoy |
06:35 | | Turaiel is now known as Turaiel[Offline] |
06:37 | | RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has joined #code |
07:34 | | Kindamoody is now known as Kindamoody|out |
07:37 | | himi [fow035@Nightstar-36db723c.ffp.csiro.au] has quit [Ping timeout: 121 seconds] |
08:34 | | gnolam [lenin@Nightstar-b19b2ac3.addr.tdcsong.se] has joined #code |
08:35 | | gnolam is now known as NSGuest51385 |
08:43 | | thalass [thalass@Nightstar-4ab061cc.bigpond.net.au] has joined #code |
08:53 | | NSGuest51385 is now known as gnolam |
08:53 | | mode/#code [+o gnolam] by ChanServ |
09:33 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
09:33 | | mode/#code [+o himi] by ChanServ |
09:39 | | * thalass ponders |
09:51 | | Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Client closed the connection] |
09:52 | | Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code |
09:52 | | mode/#code [+o Pandemic] by ChanServ |
10:12 | | You're now known as TheWatcher |
10:15 | | AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has joined #code |
10:15 | | thalass is now known as Thalass|dinnar |
10:54 | | AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has quit [[NS] Quit: Leaving] |
11:20 | | ErikMesoy1 [Erik@A08927.B4421D.FE7332.0AD079] has joined #code |
11:22 | | ErikMesoy [Erik@Nightstar-404c8d4f.80-203-17.nextgentel.com] has quit [Ping timeout: 121 seconds] |
11:23 | <@Tarinaky> | That moment when I realise I don't remember how to use GCC :/ |
11:28 | | * Tarinaky glares. That's... different. |
11:42 | <@Tarinaky> | All the hits for help on Google are getting further than me. I'm obviously doing something really stupid here and I can't think what. |
11:43 | < Syka> | using GCC |
11:43 | | * Syka runs |
11:43 | <@Tarinaky> | Yeah, no. It gets worse when you realise my preferred IDE is cygwin >.> |
11:43 | <@Tarinaky> | Because fuck learning Powershell to have a decent shell :/ |
11:44 | | ErikMesoy1 [Erik@A08927.B4421D.FE7332.0AD079] has quit [Ping timeout: 121 seconds] |
11:44 | <@Tarinaky> | http://pastebin.com/pwwY56pt |
11:44 | | ErikMesoy [Erik@Nightstar-404c8d4f.80-203-17.nextgentel.com] has joined #code |
11:45 | <@Tarinaky> | which verifies that I'm using the 'native' version of MingW, so cygwin shouldn't be getting in the way. |
11:45 | <@Tarinaky> | But I also tested it under cmd.exe to the same effect. |
11:46 | < RichyB> | I wonder if you can get MS Visual Studio to hook up with Clang+LLVM yet? |
11:46 | < RichyB> | I seem to remember hearing about some kind of project to enable that. |
11:48 | <@Tarinaky> | Also get the same output if I use cygwin's g++. |
11:52 | | cpux [cpux@Nightstar-98762b0f.dyn.optonline.net] has joined #code |
11:52 | | mode/#code [+o cpux] by ChanServ |
11:53 | <@Tarinaky> | Compiling with -pedantic just flags up some instances of long long. |
11:54 | <@Tarinaky> | Maybe if I try compiling the library from source idk. |
12:06 | <&McMartin> | YOu could comment out all the lines but the first two. |
12:07 | <&McMartin> | If that doesn't work, then comment out all of it and do a printf just to make sure the -l isn't somehow toying with you |
12:08 | <&McMartin> | Also you're using driver, smgr and guienv without checking, and while that's probably safe, it's probably worth eyeing anyhow |
12:19 | <@Tarinaky> | McMartin: Which two lines are we calling the first two? |
12:19 | <@Tarinaky> | #include and using namespace? |
12:19 | <@Tarinaky> | Or the first two lines of in main? |
12:20 | | gnolam [lenin@Nightstar-b19b2ac3.addr.tdcsong.se] has quit [[NS] Quit: Je suis arrivé] |
12:20 | <@Tarinaky> | Oh hang on. |
12:20 | <@Tarinaky> | DERP |
12:21 | <@Tarinaky> | g++ needs debug symbols explicitly enabled. |
12:21 | <@Tarinaky> | I am an idiot. |
12:23 | <@Tarinaky> | Told you I was doing something wrong :p |
12:24 | <&McMartin> | heh |
12:25 | <&McMartin> | I meant first two lines of main (to make sure that it isn't "g++ and your lib are using different ABIs") |
12:25 | <&McMartin> | I should break out mingw soon, myself |
12:25 | <&McMartin> | I need a windows port of xa65 |
12:26 | <&McMartin> | Which, given that it was originally for the Atari ST, ought to be relatively portable. =P |
12:37 | <@TheWatcher> | So, in work there's a system (that I've actually be tasked with replacing, but that's another story) that is used to handle internal enrolment of UG students, keep track of which tutor groups they are in, record assignments and grades, that kind of thing. |
12:38 | <@TheWatcher> | Each tutor group has a number of students in it, and a staff member as tutor. Simple enough |
12:38 | <@TheWatcher> | Except that, for Azathoth knows what reason, despite the fact that students are identified by usernames... the tutor is identified by their initials |
12:39 | <@TheWatcher> | Guess what, they are not unique! |
12:39 | <&McMartin> | I am shocked! |
12:40 | <@TheWatcher> | Indeed. Who would have thought?! |
12:41 | <@TheWatcher> | Apparently not the fucking idiot who did this, and the morons who enabled it. |
12:42 | <&McMartin> | This seems like the kind of thing that would have shown up on nonelectronic systems |
12:51 | <~Vornicus> | wtfx |
13:05 | | gnolam [lenin@Nightstar-f7705974.cust.bredbandsbolaget.se] has joined #code |
13:05 | | mode/#code [+o gnolam] by ChanServ |
13:12 | <@Tarinaky> | So. The issue seems to be that for some unknown reason device->setWindowCaption is having the side-effect of setting device to 0. |
13:12 | <@Tarinaky> | Which makes exactly no sense. |
13:13 | <&McMartin> | I've never used this system, so I don't have much sensible to say about that side of things |
13:19 | <@Tarinaky> | Rebuilding the library from source seems to have fixed the issue. |
13:21 | <&McMartin> | Oh C++ |
13:21 | <&McMartin> | (See also: why Monocle is pure C) |
13:26 | <@TheWatcher> | McM: oh, it had, multiple times |
13:27 | <@TheWatcher> | Unfortunately the current maintainer is either unwilling or unable to correct the situation |
13:28 | <@TheWatcher> | It works well enough for his needs, so that's all that matters, right? |
13:28 | <@Tarinaky> | It's a pity that building C/C++ applications on Windows is such a pain. |
13:29 | <&McMartin> | What you have hit is not a Windows issue, alas >_< |
13:29 | <@Tarinaky> | "Please follow these instructions for a single pay-for-IDE that's at least two versions out of date or commune with whatever Gods you worship to figure out how these instructions translate to your needs" |
13:30 | <&McMartin> | SCons bridges the gap better than most, and someone who makes "work on MinGW" an actual goal will generally get you to "type make" levels |
13:31 | | * McMartin gestures vaguely at SDL |
13:31 | <&McMartin> | But yeah, despite rather liking the human-presented interface, MSVS is a horrid mess |
13:31 | <&McMartin> | UUIDs are not an acceptable way of identifying build products, dammit >_< |
13:31 | | gnolam [lenin@Nightstar-f7705974.cust.bredbandsbolaget.se] has quit [Client closed the connection] |
13:31 | | gnolam [lenin@Nightstar-f7705974.cust.bredbandsbolaget.se] has joined #code |
13:31 | | mode/#code [+o gnolam] by ChanServ |
13:32 | <@Tarinaky> | How easy is SCons to set up and manage btw? |
13:32 | <&McMartin> | But yeah, the thing you're running into here is "if you compile a shared library in C++, unless not only the compiler but the compiler flags are utterly identical, you will be unable to interoperate with them" |
13:32 | <&McMartin> | re: SCons: Building stuff that uses it has always been very easy for me, though the only major program I used that needed it was a custom build of NSIS |
13:33 | <&McMartin> | I haven't yet had a build problem worthy of it myself so I don't know how easy it is to set up and use for a personal project. |
13:33 | <&McMartin> | But flipping through it it is a design I like |
13:34 | <&McMartin> | It seems to be trying to live in the yawning chasm between Make and Maven. |
13:35 | <&McMartin> | The real ugly bit with SCons is that if you're using it to its full power as a build-configuration generator this means you have to write code acceptable to all those compilers. |
13:35 | <~Vornicus> | ah, make |
13:35 | <&McMartin> | Which is less than trivial in the first place. -_- |
13:36 | <~Vornicus> | The first time I discovered i needed a makefile and I didn't have a thing that would build it for me, I blew right past its abilities. |
13:36 | <@Tarinaky> | Make is really nice for LaTeX though. |
13:37 | <@Tarinaky> | Which is... maybe ironic I'm not sure. |
13:43 | | Thalass|dinnar is now known as thalasleep |
13:50 | | thalasleep [thalass@Nightstar-4ab061cc.bigpond.net.au] has quit [[NS] Quit: Leaving] |
14:25 | | Turaiel[Offline] is now known as Turaiel |
14:37 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
15:29 | < ToxicFrog> | Tarinaky: only if you aren't using a LaTeX-build-system aware editor. |
15:29 | < ToxicFrog> | Which you should be. |
15:31 | < ToxicFrog> | As for building things on windows - I highly recommend premake4 and mingw. Premake will happily turn a build file into both msys-compatible Makefiles and MSVS project files. |
15:31 | < ToxicFrog> | Then on windows you build in either, or in linux you install the cross compiler and $ mingw32-make -f build/win32/Makefile |
15:34 | | * TheWatcher makes a note for the future: flexible and powerful role based access control systems are wonderful for controlling access, but for fuck's sake set up an interface to manage it before people find out about the system |
15:46 | | Turaiel is now known as Turaiel[Offline] |
16:06 | | himi-cat [qicruser@Nightstar-5d05bada.internode.on.net] has joined #code |
16:07 | < [R]> | People bothering you to make changes instead? |
16:08 | | himi-cat [qicruser@Nightstar-5d05bada.internode.on.net] has quit [Connection closed] |
16:09 | | himi-cat [qicruser@Nightstar-5d05bada.internode.on.net] has joined #code |
16:10 | | mode/#code [+o himi-cat] by ChanServ |
16:12 | | himi-cat [qicruser@Nightstar-5d05bada.internode.on.net] has quit [[NS] Quit: qicr for android: faster and better] |
16:12 | | himi-cat [qicruser@Nightstar-5d05bada.internode.on.net] has joined #code |
16:12 | | mode/#code [+o himi-cat] by ChanServ |
16:15 | | himi-cat [qicruser@Nightstar-5d05bada.internode.on.net] has quit [[NS] Quit: qicr for android: faster and better] |
16:24 | <@TheWatcher> | [R]: yeah, people want to use the system. In the absence of an actual UI to manage the role allocations, I need to do it by hand in the database. |
16:27 | <@TheWatcher> | This is not particularly /complicated/, mind - one SQL statement to create the user's row, another one to insert anywhere from 4 to perhaps 15 rows for role allocation. It just means a lot of double-checking that I'm picking the right contexts and role IDs >.< |
16:32 | | Turaiel[Offline] is now known as Turaiel |
16:34 | < [R]> | :/ |
16:48 | | cpux|2 [cpux@Nightstar-98762b0f.dyn.optonline.net] has joined #code |
16:50 | | cpux [cpux@Nightstar-98762b0f.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
16:53 | <@TheWatcher> | An now, back to doing battle with OAuth2! |
16:59 | | Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has joined #code |
17:00 | | mode/#code [+ao Derakon Derakon] by ChanServ |
17:17 | | Turaiel is now known as Turaiel[Offline] |
17:23 | <@iospace> | yay having to get my full ESD gear on |
17:24 | <@Tamber> | =o |
17:25 | | * Derakon eyes this installer, which has so far prompted him over half a dozen times for permission to install various sub-components. |
17:25 | | Kindamoody|out is now known as Kindamoody |
17:26 | <&Derakon> | The best part is, the names of the sub-components are too long to fit in the dialog, so they get cut off with an ellipsis...and the dialog is non-resizable! |
17:26 | <&Derakon> | So I have no way of knowing which components I'm agreeing to install. |
17:39 | <@TheWatcher> | Knowing what you're installing is next to COMMUNISM! |
17:40 | <&Derakon> | It's right up there with having EULA dialogs where you have more than a 4x80 character scrolling box in which to read the contract. |
17:43 | <@Tamber> | Unresizable 4x80 box? |
17:43 | <@Tamber> | And the standard EULA of eleven billion pages? |
17:50 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
18:19 | | * Derakon mutters at Python and ctypes. |
18:19 | <&Derakon> | I have a third-party library "C:\\path\\to\\oldaapi64.lib". |
18:19 | <&Derakon> | I try doing "ctypes.cdll.LoadLibrary(path)". |
18:20 | <&Derakon> | A dialog pops up saying "path is either not designed to run on Windows or it contains an error. Try installing the program again blah blah blah". |
18:20 | <&Derakon> | And then the Python program throws an error "WindowsError: [Error 193] %1 is not a valid Win32 application". |
18:24 | | * Tarinaky glares at Scons. |
18:24 | <&Derakon> | Oh wait, guess it has to be a DLL, not a .lib, if ctypes is to work. Fuck. |
18:36 | <@froztbyte> | Derakon: aaaaactually |
18:36 | <@froztbyte> | Derakon: there are those window introspection tools |
18:37 | <@froztbyte> | so I guess you just lack sufficient curiousity |
18:37 | <@froztbyte> | (but, given the problem at hand, it might be best not knowing) |
18:39 | <&Derakon> | Que? |
18:39 | <&McMartin> | LoadLibrary is equivalent to dlopen - it indeed only works on DLLs. |
18:40 | <&McMartin> | .LIB is for collections of precompiled object files |
18:42 | <&Derakon> | This leaves me with my fallback option of SWIG...which in turn leaves me stuck with either needing the paid version of VS2008 (so I can build against 64-bit Python) or using the free version and having 32-bit Python installed, solely to wrap around this one library. |
18:42 | <&Derakon> | Bleh! |
18:43 | <&Derakon> | (Clarification: you must use VS2008 if you want to build against the python.org Windows builds; VS2008 is what was used to build Python 2.7; the free version of VS2008 basically cannot do 64-bit builds) |
18:45 | <&Derakon> | I guess alternately I could try to wrap the 32-bit .lib into a 32-bit .dll which ctypes could handle. |
18:45 | <&Derakon> | Does that sound plausible? |
18:46 | <&McMartin> | It's doable but a little tricky. |
18:46 | <&McMartin> | MSVS has a really ugly set of compiler directives for this. |
18:47 | <&McMartin> | That, extremely annoyingly, also works out to be closer to the right thing than gcc's default, though gcc can be configured to do better. -_- |
18:47 | <&McMartin> | (This is what the MONOCULAR macro was for in Monocle.) |
18:47 | <&McMartin> | (In fact, let me dig that up...) |
18:47 | <&Derakon> | (Actually, if I'm going the wrap-into-DLL thing then I don't have to use VS2008 so I could make it 64-bit anyway) |
18:49 | | * McMartin nods |
18:49 | <&McMartin> | https://github.com/michaelcmartin/monocle/blob/master/include/monocle.h |
18:49 | <&McMartin> | Lines 4-18 are me setting up the export silliness. |
18:50 | <&McMartin> | When compiling the DLL you have to set __declspec(dllexport) and then when *using* the DLL you have to set __declspec(dllimport). |
18:50 | <@TheWatcher> | Derakon: Wait, your uni doesn't have a license for VS? |
18:50 | <&McMartin> | The fact that you have to do this is a convenient excuse to mark exported functions as __attribute__ ((visibility("default"))) in gcc, and then compile with -fvisibility=hidden |
18:51 | <&Derakon> | TW: you have to do it on a per-lab basis, AIUI, though there is an academic discount. I just don't want to go through the hassle of having to buy things with the university system. |
18:51 | <&McMartin> | That said |
18:51 | <@TheWatcher> | huh, craziness. |
18:52 | <&McMartin> | That said, if you do, 2008 or 2012 is the version to get |
18:52 | <&Derakon> | What's wrong with 2010? |
18:52 | <&McMartin> | It looks like an MS Office product from the era where they were forcing the wacky not-really-quite-icon-bars on everyone. |
18:52 | <&Derakon> | (It's already installed on this computer, hence why I ask) |
18:52 | <&Derakon> | Ahh. |
18:52 | <&Derakon> | Right, good enough reason. |
18:52 | | * TheWatcher ponders, goes check something |
18:52 | <&McMartin> | 2008 looks like older versions of MSOffice and 2012 looks Hella Slick. |
18:53 | <&McMartin> | As in, "it is my favorite IDE to look at" |
18:53 | <&McMartin> | ...snerk |
18:53 | <&McMartin> | Looking for my screencap of it, found https://hkn.eecs.berkeley.edu/~mcmartin/console.png instead |
18:54 | <&Derakon> | Yep |
18:54 | <&McMartin> | https://hkn.eecs.berkeley.edu/~mcmartin/msvs2012.png |
18:55 | <@TheWatcher> | Blegh, need to use the VPN to get to this |
18:55 | | * TheWatcher hauls out the lappy |
18:55 | <&McMartin> | If 2010 was a concession to MS Office, 2012 is a concession to Windows 8 Metro... |
18:55 | <&McMartin> | ... but in a way that actually was an improvement~ |
18:56 | | * Derakon blarghs, admits that he doesn't actually understand why the difference between static and dynamic libraries is in the library file, as opposed to how the compiler treats the file. |
18:56 | <&Derakon> | Shouldn't there just be a switch you flick in your project that says "I want to bundle this library in my executable, but this one should stay separate"? |
18:57 | <&McMartin> | .libs are allowed to do things like inline themselves into your own object code |
18:57 | <&McMartin> | And I think the metadata is also different |
18:57 | <&McMartin> | .a and .lib can't do export control, I know. |
18:57 | <@TheWatcher> | Oh, hey, I can can VS2008 pro |
18:58 | <@TheWatcher> | *can get |
18:58 | <&McMartin> | Derakon: For Windows, at least, you load a DLL by just doing a memory map and resolving a set of function pointers |
18:58 | <&McMartin> | But .LIB requires the assistance of a full-scale linker |
18:58 | <&McMartin> | I don't know about Linux, but I do know that .a is basically a zip of object files. |
18:58 | <@TheWatcher> | Seems I can also get 10 and 12. Good to know |
18:59 | <&McMartin> | Woo, MSDN subs~ |
18:59 | <&Derakon> | Anyway, given the MONOCULAR example, if I wanted to DLL-wrap the .lib, I'd basically write a file that does "extern __declspec(dllexport) thingDefinedByLib" over and over again? |
18:59 | <&McMartin> | Yeah |
18:59 | <&Derakon> | And then compile that to a .dll, naturally. |
18:59 | <&Derakon> | That sounds doable. |
18:59 | <&McMartin> | ctypes presumably is using LoadLibrary and GetProcAddress |
19:00 | <&Derakon> | ctypes.LoadLibrary is definitely a thing. |
19:00 | <&McMartin> | Basically, unless you spec it to be exported, it isn't, so that if the DLL's internals has a function named, say, "dump_value" then you can also have a function by that name without conflict. |
19:00 | <&McMartin> | Since the DLL world doesn't have namespaces |
19:00 | <&McMartin> | [*] |
19:00 | <&Derakon> | Gotcha. |
19:00 | <&McMartin> | [*] As of Windows 2000 it totally does, but POSIX doesn't, so C abstracts this away |
19:00 | <&Derakon> | IOW declarations are private unless stated otherwise. |
19:00 | <&McMartin> | Right. |
19:01 | <&McMartin> | gcc reverses that by default, and is wrong |
19:01 | <&McMartin> | There are some corner cases I don't fully understand, other than that gcc has a "hide by default" mode and a "mimic MSVS semantics exactly" mode and they aren't the same mode |
19:01 | <&Derakon> | /o\ |
19:02 | <&Derakon> | Thanks for the assistance. |
19:02 | <&Derakon> | I'm gonna go refuel my mobile sack of meat and then get back to this. |
19:16 | <&Derakon> | Mm, given that I'll probably use nmake for this (never did get around to learning the VS UI), I guess it doesn't matter much which version of VS I use. |
19:25 | <&Derakon> | Always a good sign, BTW, when a file is named "oldaapi64.lib" |
19:26 | <&Derakon> | Though I think that's supposed to be read as "OL DA API 64", with the DA standing for "data acquisition". No idea what OL means though. |
19:29 | <&Derakon> | ...there are a lot of things in here. |
19:34 | <@Tamber> | "old a(cquisition) api"? |
19:42 | | * Derakon whips up a simple test, compiles, tries to load, gets the "is not a valid Win32 application" error again. |
19:42 | <&Derakon> | http://pastebin.com/WrtTBjfe |
19:42 | <&Derakon> | Any ideas? |
19:44 | <&Derakon> | I appear to have mixed spaces and tabs in the .cxx file. How gauche. |
19:49 | | Kindamoody is now known as Kindamoody[zZz] |
19:50 | <&Derakon> | Ahh, got it; 32/64-bit confusion. |
19:51 | <&Derakon> | 64-bit Python's ctypes can't load 32-bit DLLs, duh. |
19:56 | <&Derakon> | Next question is why my "printer" function isn't seen by ctypes... |
19:59 | < ToxicFrog> | Because printers are the devil~ |
20:00 | <&Derakon> | Ah no, forgot that MS assumes C++ by default, so I needed to wrap it in "extern "C"". |
20:00 | <&Derakon> | So now it works! |
20:02 | <&Derakon> | So now, time to figure out how little of oldaapi.h I can get away with exporting~ |
20:38 | <&Derakon> | ...as soon as I #include any of the vendor libraries, I start getting "No Target Architecture" errors when building. |
20:51 | | * Derakon throws "/D_AMD64_" onto the compiler flags, makes the error go away without really knowing if he's done the right thing. Oh well! |
21:51 | | Turaiel[Offline] is now known as Turaiel |
21:58 | | * Derakon swears at the SDK documentation, which names each function, gives a short description, and notably does not define the return value or argument types. |
21:59 | <&Derakon> | ...oh, I have to use the Windows Help system to get access to that documentation. |
22:00 | <&Derakon> | Why do companies insist on using this format instead of something standardized? |
22:00 | <&McMartin> | Why do they use that system when it is literally obfuscated HTML -_- |
22:00 | <&Derakon> | Exactly!@ |
22:00 | <&Derakon> | s/@// |
22:00 | <&Derakon> | "ECODE olDaSetNotificationProcedure (HDASS hDass, OLNOTIFYPROC lpfnNotifyProc, LPARAM lParam)" |
22:00 | <&Derakon> | Why do they do such a shitty job of naming parameters? |
22:01 | <&McMartin> | oof. |
22:01 | <@Tamber> | lpfn == "long pointer to function"? |
22:01 | <&McMartin> | Yeah. |
22:01 | <&McMartin> | Hungarian notation hoooooo |
22:02 | <@Azash> | Hungarian notation is kind of like vim: It's the best thing ever, 12 months from now |
22:03 | < ErikMesoy> | Systems Hungarian or Apps Hungarian? :V |
22:03 | < [R]> | Derakon: because they're coding for WinAPI which assumed you want to use MS' bastardized version of hungarian. |
22:04 | <@Tamber> | Erik: Which is the stupid "the computer knows it's a long and can tell you, but it *needs* an 'l' prefix"? |
22:04 | < [R]> | Yes |
22:04 | | * Tamber peers at [R]. |
22:04 | <&McMartin> | LPARAM isn't really Hungarian, though. |
22:05 | <&McMartin> | WPARAM and LPARAM are the two parameters that stick to window events. |
22:05 | <&McMartin> | And they're both DWORDs. |
22:05 | < Syka> | more like dumb words |
22:05 | < Syka> | amirite |
22:05 | < [R]> | Real Hungarian is something like: paramDass, paramNotifyProc, paramParam. |
22:05 | <&McMartin> | I dunno, it seems to have stuck. |
22:05 | < ErikMesoy> | Tamber: Systems Hungarian is the one where everything is prefixed with its object type (e.g. "long") because cargo cult. Apps Hungarian is the one where everything is prefixed with its usage type (e.g. "bytecount") because then you immediately know not to add a bytecount to a pixelheight. |
22:06 | <@Tamber> | Right. Thank-you. |
22:06 | <&McMartin> | (In that 64-bit things are "quads" even at the assembler level, so clearly "a word" is still 16-bit) |
22:06 | <&McMartin> | (Because THE AMIGA IS THE LAST TRUE COMPUTERMACHINE) |
22:06 | <@Tamber> | *grumblegrumble* |
22:07 | <@Tamber> | McM: I thought it was more of an Intel thing? |
22:07 | <&McMartin> | Yes, but everyone hates Intel chips, including Intel |
22:07 | <&McMartin> | And the Amiga still has a cargo cult going~ |
22:07 | <&Derakon> | (I also note they appear to have copied the documentation for this function from the documentation for a similar function that is expected to post messages to a window) |
22:07 | <@Tamber> | (Because, y'know, everything has to be compatible all the way back to DOS crusty.ancient.) |
22:08 | <@Tamber> | (Except for the stuff that doesn't work. *cough* Itanium.) |
22:08 | <&McMartin> | (It's a little wackier than that, because x86/x64 Protected is basically A Shitty RISC Machine, and you only see the DOS stuff in bootloaders.) |
22:10 | <@Tamber> | Segments! Segments everywhere! |
22:14 | | * Derakon copies the example programs off to his laptop so he can use grep, discovers that every single one uses the "post messages to a window" function instead of the "post messages to a generic procedure" function, ergo there is no example he can copy. |
22:14 | <&Derakon> | And the intuitive way to write the thing throws errors on compile. |
22:15 | <&Derakon> | ("cannot convert parameter 2 from 'void (__cdecl *)(UINT,HDASS,LPARAM)' to 'OLNOTIFYPROC'") |
22:18 | <&McMartin> | That implies that the function has a different signature than it expects |
22:18 | <&Derakon> | Yes, which is not discussed anywhere in the docs. |
22:18 | <&Derakon> | WTF is an OLNOTIFYPROC and how do I make one. |
22:19 | <&McMartin> | It's presumably a function pointer of some kind |
22:19 | <&McMartin> | If I were in Visual Studio I would put my cursor on it and hit F12 ("Go To Declaration") |
22:19 | <&Derakon> | Yep. |
22:19 | <&Derakon> | It's not defined in any of their header files AFAICT. |
22:20 | <&McMartin> | I googled for OLNOTIFYPROC and found only one hit, which is clearly the file you're editing |
22:20 | <&McMartin> | I'd guess oltypes.h. |
22:21 | | * TheWatcher manages to get LWP::Authen::OAuth2 to actually talk to google, after entirely too much effort |
22:21 | <&McMartin> | DalekAuth |
22:21 | <&McMartin> | AUTHENTICATE |
22:22 | <&Derakon> | Okay, my syntax is a bit rusty; could this be it? "typedef void (FAR PASCAL *OLNOTIFYPROC) (UINT uiMsg, WPARAM wParam, LPARAM lParam);" |
22:23 | <&McMartin> | That's the one. |
22:24 | <&McMartin> | The function you're feeding it takes an HDASS as a second parameter, and it should take a WPARAM. |
22:24 | <&McMartin> | Which is probably an HDASS that's been cast. =P |
22:24 | <@TheWatcher> | ... good gods, this code is shit |
22:24 | <&Derakon> | The documentation says "Name: wParam; Type: HDASS" |
22:25 | <&McMartin> | Yeah, WPARAM is a typedef for DWORD. |
22:25 | <&McMartin> | You'll need to do the casting internally |
22:25 | | * Derakon changes the function definition to use WPARAM instead of HDASS, it compiles. |
22:25 | <&McMartin> | The FAR PASCAL thing is worrisome though |
22:25 | <&McMartin> | That may require __stdcall instead of __cdecl. |
22:26 | <&Derakon> | This function doesn't need to be exported. |
22:26 | <&Derakon> | I've decided to make the C code "smart" and only expose high-level functionality. |
22:27 | <&Derakon> | Because the necessary code is absurdly complicated, and dealing with all of the Python <-> C type conversions would take me weeks. |
22:28 | | * TheWatcher sighs, tries to decide whether to just go with this hacked-up version of someone else's godawful code, or just bit the bullet and write his own fucking OAuth2 code |
22:28 | <@TheWatcher> | *bite |
22:28 | | cpux [cpux@Nightstar-98762b0f.dyn.optonline.net] has joined #code |
22:28 | | mode/#code [+o cpux] by ChanServ |
22:28 | <@TheWatcher> | Who am I kidding, I know I'm going to end up getting pissed off and writing it anyway -_- |
22:30 | | cpux|2 [cpux@Nightstar-98762b0f.dyn.optonline.net] has quit [Operation timed out] |
22:33 | <@Namegduf> | Your own OAuth2 implementation? |
22:33 | <@Namegduf> | Jeeze. |
22:33 | <@Namegduf> | That really shouldn't be necessary. |
22:34 | <@TheWatcher> | No, it shouldn't. |
22:34 | <@Namegduf> | I've not done it with Perl, so I don't know of any libraries for that, but surely there should be a decent one somewhere? |
22:34 | <@TheWatcher> | I've gone through 5 different modules |
22:34 | <@TheWatcher> | (well, packages; they vary from a couple to a dozen modules internally) |
22:35 | <@TheWatcher> | Not a single one of them worked properly. |
22:35 | <@TheWatcher> | Well, 4 of them wouldn't, I couldn't try the fifth because the documentation was so abysmal I didn't even want to /try/ |
22:36 | <@TheWatcher> | LWP::Authen::OAuth2 came closest - I had to modify a couple of functions to actually include arguments that Google requires |
22:37 | <@TheWatcher> | But other than that, it works, I guess. |
22:37 | <@Namegduf> | In another language I had to modify the library to introduce a delta if the local clock was off, because otherwise it completely blocked all communication. |
22:37 | <@Namegduf> | But it mostly worked otherwise. |
22:38 | <@Namegduf> | OAuth2 implementers mostly suck, I think. |
22:40 | <@TheWatcher> | At the same time, some of the stuff this code is doing is making me go O.o and wonder WTF the author was on |
22:40 | <@TheWatcher> | It works, but in the most weird and convoluted fashion |
22:43 | <&Derakon> | (Another sin this code makes is using 3-space indents) |
22:43 | <&Derakon> | (Just putting that out there) |
22:54 | <&McMartin> | I've mentioned severl times that TheWatcher is one of the only people I will grant writes clean and readable and well-structured Perl code |
22:54 | <&McMartin> | ... this has Implications if he ever decides to start using other people's code. |
22:55 | <@TheWatcher> | (Which I do; I just tend to avoid looking at it when I can. In this case, I couldn't avoid it >.>) |
22:59 | <&Derakon> | Whelp. The code seems to work, except in that it doesn't generate visible output when controlling the hardware (a DAQ board). |
22:59 | <&Derakon> | Asked the lab for a multimeter so I could measure the output voltages of each port on the box. They don't have one. |
22:59 | <&Derakon> | Sooooooo, next week I bring in my own multimeter~ |
23:00 | <@TheWatcher> | ... don't have one |
23:00 | <&Derakon> | Assuming I can find it! |
23:00 | <@TheWatcher> | I... what |
23:00 | <&Derakon> | Yeah, surprised me too. |
23:01 | <@TheWatcher> | How about an oscilloscope? |
23:01 | <&Derakon> | Ha, no. |
23:01 | <@TheWatcher> | -_- |
23:01 | <&Derakon> | I don't even see any BNC cables aside from the ones hooked up to the back of the DAQ. |
23:08 | <@gnolam> | How... just how can a lab that has /anything/ electronic not have a multimeter? |
23:08 | <&Derakon> | Beats me, man. |
23:17 | <&Derakon> | Ha! It works! |
23:17 | <&Derakon> | (The LEDs didn't have power; that was the problem) |
23:34 | <@TheWatcher> | Bah, pesky things, demanding elecricity like that. |
23:36 | | * Derakon makes the red LED do a sine-wave of intensity. |
23:36 | | * Derakon pretends the Enterprise is under red alert. |
23:41 | <@TheWatcher> | Pfft |
23:41 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
23:42 | | mode/#code [+o himi] by ChanServ |
23:45 | <&Derakon> | Thanks again for all your help, McM. |
23:45 | <&Derakon> | And now, vanishtime. |
23:45 | | Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has quit [[NS] Quit: leaving] |
--- Log closed Sat Sep 21 00:00:23 2013 |