« first day (2076 days earlier)      last day (1104 days later) » 
00:00 - 19:0019:00 - 00:00

12:01 AM
RELOAD!
[Phrancis/Stack-Exchange-Utilities] 3 commits. 13 additions. 15 deletions.
[Minesweeper] New Users: 7, Games Played: 84, Bombs Used: 52, Moves Performed: 10922
 
see what is making this so confounding is that it is working through the first three methods and failing on the fourth one
 
In Duga posts, what is the [Minesweeper] info all about?
 
RELOAD!
 
that's Simon's stat aggregation for his minesweeper site
 
[rubberduck-vba/Rubberduck] 19 commits. 33708 additions. 17067 deletions. 2 issues closed. 1 issues opened. 6 issue comments
 
12:05 AM
interesting delay between the two instances
 
@SmileyFtW duga keeping custom stats and reporting them. I have an api key for it, we could have the number of "vba snippets indented", or number of page views, or whatever we want to tally and quick-report on
@Vogel612 it's explicitly delayed IIRC
 
ahhh
 
I figured something of that nature, but didn't/don't know where Simon's site is... not that I need any more distractions <G>
 
@theVBE-it'srightforme you've emitted more .net code with reflection than I have in 10 years =)
 
@MathieuGuindon im not sure whether that is a good thing or a bad thing
 
12:09 AM
just that I wish I could help, but I'm very much unfamiliar with these apis =)
closest I did was when I wrote some kind of LINQ provider to work with Sage 300's stupid "views" API
 
they're fun!
i highly recommend learning them!
very highly
 
what is a LINQ provider btw
 
10
Q: Linq-to-Sage Implementation

Mathieu GuindonFollowing-up on my last question where I wrapped the Sage API with a familiar IRepository interface, I decided to push the abstraction a step further, and... implement an actual LINQ provider. So my client code looks like this: class Program { static void Main(string[] args) { u...

@theVBE-it'srightforme basically it's the part that translates db.Things.Where(thing => thing.Foo = 42); into SELECT (explicit field list) FROM Things WHERE Foo = 42
 
" via reflection" <- actual quote :3
 
@MathieuGuindon oh
that is why i dont understand it :)
 
@theVBE-it'srightforme yep. But I'm only building (okay, generic) types and their properties - entity types don't have/need any methods =)
aaand apparently I didn't put that part up on CR
 
methods are the most complicated part
actually no
 
@Duga hm, that's scary
 
constructor and custom attribute
 
12:21 AM
constructing generic types is a whole lot of fun as well =)
 
oh yeah i only didnt say that because i didnt bother with them yet =)
btw
 
@Duga this might just be a parser fallback because the test setup uses the wrong parsing mode initially?
 
i fixed my problem
guess how
commenting out this stub that calls an empty unimplemented method if (CustomDataMarshal != null) { };
fun stuff imo
well part of it
idk why
 
@Vogel612 hm, do declaration lists break SLL?
 
dunno, but it seems plausible
 
12:25 AM
@Duga Not sure what 'parser fallback' is/means, but the tests I'm seeing this in use all the general base class code. So - I'm guessing the TestSetup parsing mode is the same as all the other tests I've written.
 
note the use of the word "might"
 
@Vogel612 Best happy-scenario explanation anyway
 
we already have that warning in the general output
like, it's one of the warnings that the CI outputs
 
@BZngr "live" parser starts by attempting a parse with SLL prediction mode, and either succeeds or retries with the slower but more accurate LL prediction mode. Not sure we built that mechanism into the test parser
 
Ah - 'SLL?'
 
12:28 AM
Good question
Something something parser theory something
 
:)
Clearly it won't help me to know anyways.
 
the most likely is that the warning is just the test parser logging a SLL failure... If that's the case then maybe we need to make them clearer that LL mode is being attempted (assuming it is)
 
Thanks!
 
12:35 AM
Bedtime
Toodles!
 
'Night!
 
@MathieuGuindon Suspected it might be a test-parser-only thing. I have a parameterized test with a handful of declarations in a list. So, it generates quite a 'wall' of complaints. Thought it was worth identifying once I found the cause. Other than the output 'noise' - the test(s) run just fine.
 
If the tests run fine, then it's probably just that: a warning about SLL failure. We should find the source of that warning and tweak the text so it's less confusing
 
12:58 AM
i found one area where VBA is objectively and unambiguously superior to C#
if (!tgt.IsInterface) doesnt work
i love the elegance of that syntax
why is it not usable in C# :(
once i saw you do that i copied it to all my vba code and it made it look so much better @MathieuGuindon
btw just for anyone who cares, dotPeek is an absolutely invaluable resource for reflection debugging
 
@theVBE-it'srightforme hm, not following
@theVBE-it'srightforme haha yes, yes it is!
 
@MathieuGuindon i used that syntax and it triggered the condition when it shouldnt have
 
I don't understand.. there's no ! operator in VBA?
 
but then i changed it to the standard if (tgt.IsInterface ==false) and it still triggered when IsINterface is true so...
@MathieuGuindon lmfao sorry
i literally
was translating Not to that
without even thinking about it
<-- has written essentially no VBA in three weeks
 
it begins lol
 
1:05 AM
well i cant write VBA libraries in VBA so...
but i blame you and @this and others here for enabling it by answering all my questions so helpfully
Console.WriteLine(tgt.IsInterface);
            if (tgt.IsInterface == false) {
                methods = src.GetMethods(BindingFlags.DeclaredOnly);
                Console.WriteLine(methods.Count());
            }
Console output: True
guess what line gets called next!
 
what type is tgt?
 
extended typebuilder
but get this
 
IsInterface is a bool property then?
 
yes
MethodInfo[] methods;

            Console.WriteLine(tgt.IsInterface);

            if (tgt.IsInterface == false) {
                methods = src.GetMethods(BindingFlags.DeclaredOnly);
                Console.WriteLine("a");//methods.Count());
            }

            else {
                methods = src.GetMethods();
                Console.WriteLine("b");
            }
so that fails
but then if i comment out all the lines with methods
it works correctly
 
what does "fails" mean?
 
1:16 AM
it calls the first block when tgt.IsInterface is true
i assume it has something to do with the array declaration
i would be lying if i said i had any real grasp of arrays in C#
just fixed it by declaring the binding flag before and not have the GetMethods() call inside the if block
Dictionary<string, MethodBuilder> output = new Dictionary<string, MethodBuilder>();
            BindingFlags fl = BindingFlags.Default;

            if (tgt.IsInterface == false) { fl = BindingFlags.DeclaredOnly; }
            MethodInfo[] methods = src.GetMethods(fl);

            foreach (MethodInfo method in methods) { Console.WriteLine(method.Name); output.Add(method.Name, tgt.CloneMethod(method)); }
            return output;
 
Hey all
 
@theVBE-it'srightforme I'm still trying to wrap my head around this
@FreezePhoenix hello!
 
@MathieuGuindon there will be a CR post when it is functional :)
 
:+1:
@ticker that's Case Else ...
 
i know it works, i just messed a bunch of things up trying to migrate it from "see if it works" to "actually designed correctly"
which as i understand is not a particularly uncommon thing
so i determined i have no idea how to use binding flags correctly :)
cant exclude derived methods
GetType etc
 
1:55 AM
used a hilariously ugly workaround for it
getting close!
MethodInfo[] methods = src.GetMethods();
            List<MethodInfo> actual = new List<MethodInfo>();
            for (int i = 0; i < methods.Count(); i++) { if (methods[i].DeclaringType == src) { actual.Add(methods[i]); } }
function always > form kapp
 
writing !(ugly.hilariously) reflection code is an art
 
i aspire to that level ^
 
really though? inline for loop with an explicitly-scoped body is peak
give it breathing space
go vertical
{

}
 
tbf i wasnt planning on keeping that one
im sure there will be other problematic things tho :3
 
2:16 AM
til that COM Interop does not automatically marshal object to variant!
anyways im very burned out for the day
ty for all the help
 
2:31 AM
yw =)
 
 
12 hours later…
 
3:26 PM
Yay! WFH today and BSOD.
In the old days, a BSOD just meant you hit the reset button or the power switch. Now, you feel obligated to wait 10 minutes or so for it to gather something, then you hit the reset switch when it's showing no further indication of functioning.
 
@ anyone with any COM interop experience - if i want to marshal <x> as say, currency, instead of decimal, does the MarshalAs attribute have to be applied to every instance of <x> in the type in question? i'm pretty sure i know what the answer is but im hoping im wrong for obvious reasons.
 
what's <x>?
 
Yes. Did you read the marshaling behavior?
 
I'm confused, doesn't [MarshalAs] apply to a member rather than a type?
 
There are defaults applied whenever you don't specify whatever.
Yes, Mat, but it's about the data type for the memer.
Note there are sub articles for particulars like strings or arrays. Those should be read, too.
sometime I think com interop is easier than web development...
 
4:18 PM
@FreeMan I smother it. Sad state of affairs, but sometimes it just needs to die. Get that pillow and put it over the mouth and just give it the 6 seconds to stop breathing that it needs.
 
@this yes that is why i said "i'm pretty sure i know what the answer is" :(
@MathieuGuindon yes sorry that wasn't clear, i meant <x> as in a certain data type that a class is oriented around that then might appear in several of its members
@this applying custom attributes in reflection is not particularly fun from my experience with it so far
you know that error i was having yesterday where it said the parameter was out of range when it wasnt? came from custom attribute copying being implemented incorrectly.
 
so you get why the mock PR is still hanging around.
 
I am not particularly thrilled at the prospect of writing my own type library converter just to work around the .NET's dumbs
 
think of the character it builds
i would help you
 
4:30 PM
Is that you, Calvin's dad?
 
i figured that reference would be appreciated here :)
 
as long you aren't Calvin.
 
<slowly shrinks into the background>
i feel like Calvin's dad was actually just doing it as a practical joke the whole time
also back to the subject of that mock PR like I said I would help but I don't get the contents of the links I gave you or what the actual problem is
 
let me refresh my memory
Oct 7 '19 at 17:32, by Mathieu Guindon
@this question: what's the current showstopper for the mocking PR?
see this link for details
 
i mean i dont even get what the mocking PR is
 
4:36 PM
actually maybe that won't make sense if you never mocked anything
 
@this now you get it :)
 
Mocking framework is a general thing that you normally use in a unit test
so that you don't have to create the actual thing
 
unit test is a completely foreign concept to learning programmer
 
only a mock of it to fulfill the dependencies
Alright, let's back up
 
however i think i get it conceptually now
 
4:37 PM
suppose you have a class Foo
you want to write automated tests for that class
normally you do so by calling various methods and looking at the results to see if they are right.
but what if the class Foo depends on Bar and Baz?
You could new it up but then it gets messy. For example, suppose Bar writes to a file, and Baz sends a web request.
but you don't want to do either when you're testing!
 
so would be like if i wanted to test the Button class in my VBA UI framework to make sure it emulates the standard windows forms button behavior correctly without having to worry about all the junk around it?
Bar in this case being the IFormButtonContainer that holds it and Baz being the actual form etc
 
Hence, you mock the Bar and Baz with something that looks and acts like either but won't actually write a file, send a web request but simply verify that they were invoked correctly to write a file/send a web request in theory.
 
yeah i get that conceptually now :)
actually very easy to understand
 
Yes, but you talk about UI elements - UI elements aren't normally a good candidate for unit tests.
 
4:40 PM
Unit tests deal more with the logic flow
e.g. assert that if you execute method A that x, y and z will happen
 
pushing a button would be actually more in the realms of UI testing or integrated testing
 
but the baseline concept is that you want to isolate a specific component and validate it internally while minimizing the cognitive load of setting up the external dependencies it needs to function correctly?
 
Yes. That's where the mocks become useful
 
@this i didnt mean pushing the button as much as making sure it drew itself correctly in response to interaction states
 
4:42 PM
ah, that might be testable but with a mock button.
 
ok
i think i got the idea which is what matters haha
 
e.g. you give it a mock button, and let it call drawing methods on the mock button, then check that all the drawing methods were correctly called with correct parameters.
 
okay yeah exactly
so i get it
 
that way, you avoid the need to actually pop open a entire form, putting on an actual button, and telling users to not touch while running the tests.
 
and that is a big feature of RD i know
@this "telling users to not touch while running the tests" nothing could go wrong there!
anyways so i am looking at the problem
 
4:44 PM
yeah. Except they dumbed it up totally with the type equivalence. That one bug alone has made it a giant PITA.
 
is your issue going the other way, from COM to .NET?
 
yes
 
but its the same thing in reverse
basically
 
kind of yes.
 
oh yeah not quite
but in your case that is good
because the links i had were more focused on that direction
the MSDN article and Adam Nathan examples were both going that way iirc
so that might make it suck less
let me see
btw, what does "pull request" actually mean?
 
4:51 PM
hi! I made some changes to your code! If you like it, please accept it and merge it with your code so we can share alike!
 
oh i suppose that makes sense aside from the "pull" part
so i dont think i put this on the original GH comment
this might be very useful
 
"pull" is because in this case, it would be you pulling my changes from my fork into yours.
 
e.g. the main repo is rubberduck-vba\rubberduck
but my changes is actually at bclothier\rubberduck
 
but you are the one submitting the request
so its more like a push to me
or did you not submit the request
 
4:54 PM
no, I push code to my repo at bclothier\rubberduck
 
then RD main makes a PR to you?
then it stays open until denied or code is ready to merge?
 
No. I make a PR request. It's then up to the RD owner to merge the changes from my fork to the main fork
 
got it
you are requesting the RD owner pulls your code
ty for explaining
" It just so happens that there is a custom marshaling routine called TypeToTypeInfoMarshaler that transforms an ITypeInfo interface into a System.Type object. "
^ does that mean anything useful to you
 
I don't use it directly but yes
 
@this says the guy with admin privs on the repo ;-)
...wait you have admin privs do you?
 
@MathieuGuindon i figured he did but i was talking in a technical sense :3
 
@MathieuGuindon I do. But that would muddy the water for explaining the PR. :)
 
besides, I think it's impolite to go around merging one's own PR esp. when it has lot of changes without having at least some another pair of eyeballs glancing over the code
 
"In addition, COM custom marshaling provides capabilities to change object views across the managed/unmanaged boundary. In many cases, some powerful method interception behaviors can be achieved when combining these techniques."
i feel like there is something here even though i couldnt say what it is
do you want me to put this article on the PR as well?
it was not in the original comment
 
5:01 PM
yes you can edit the comment and add it
where did u see that remark?
 
conclusion
comment edited
 
@this quietly slips a PR that renames every namespace, merges, (deservedly) gets hit by a bus
 
> While researching an unrelated problem I came across several things that concerned the use of IReflect to effectively implement custom IDispatch functionality. Start with the first answer on this SO post which contains a lot of useful ideas itself; the blog post they referenced is very helpful and while it has a broken link it can be accessed [through wayback](web.archive.org/web/20100701000
 
on the article I linked you? I don't see it
 
5:04 PM
@MathieuGuindon i get asked "what will happen if you get hit by a bus" at least weekly...
 
which article are you talking about?
 
@theVBE-it'srightforme this. Where did you see that comment?
 
the one i just added in the GH comment?
 
@Cyril next time, make a show of whispering into an unseen microphone, "... said by X, at time HH:NN" and give him a suspicious glance.
If asked, say you're collecting evidence to show that it was premeditated.
 
Assuming that IDispatch-based COM instances can, and generally do, return type information through their IDispatch implementations, it is possible to overcome the inherent shortcomings of .NET Framework reflection with respect to IDispatch.
that seems like a pretty apt description of the problem you are having
 
5:08 PM
@theVBE-it'srightforme Read the comment, Luke
Yes, I now see it now, thanks!
 
@this will try to remember that ~_*
 
@this i dont know what comment you're talking about :(
 
LOL. Let me start over.
I finally realized that the quote about marshaling you quoted was already linked in the link you added to the edit in the PR comment, and read it (finally). Hence self-deprecating remark about reading the comment.
IOW, it's not you. It's me.
 
ohhhhhhh
now it is clear :)
is that last thing i quoted in italics correct?
 
So... 39*80ish UDF references in a sheet... that's still probably better than having 4x index/match in each cell, with 3x if-statements, right?
long-term editing, just seems more reasonable to correct a UDF than decipher wtf someone Y years ago thought was a good formula
 
5:12 PM
Maybe. I technically need the type information.
 
"the inherent shortcomings of .NET Framework reflection with respect to IDispatch" seems like the core of the issue you are having from what you linked me on GH
"The provider aims to work around a deficiency in the <see cref="Type.IsEquivalentTo"/>, particularly for COM interop types"
 
5:27 PM
reading through it more i dont think i can actually implement anything but im pretty sure that will help you solve it
you could potentially just adapt the code in the example from what i am reading of it
 
5:43 PM
 
6:00 PM
@Duga 13 left till arbitrary achievement!
 
6:22 PM
Question regarding ShadowedDeclarationInspection: do we want it to exclude all event handlers and their parameters or only those for built-in events and their parameters?
This line says the second, but does the first.
 
6:35 PM
hm the intent was likely to exclude non-user code
wait no
hm
// User has no control over build-in event handlers or their parameters, so we skip them
yeah
so.. the bug is ...that all handlers get excluded?
 
Yep
However, I currently have no idea how to determine whether a handler handles a built-in event or a user-defined one.
 
6:54 PM
@BigBen: I am able to go wherever I want, pressing all the buttons. Only the link from the page (oaltd.co.uk/indenter/indentpage.asp) does not work, returning the error I mentioned before... — FaneDuru 6 mins ago
The link on the Indenter page: "The original author and current maintainer of the popular Smart Indenter add-in"... seems to be broken.
 
00:00 - 19:0019:00 - 00:00

« first day (2076 days earlier)      last day (1104 days later) »