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

7:07 PM
they might have taken it down
 
yeah I figured I'd just report here... I couldn't understand what FaneDuru was getting at for a while......
 
@M.Doerner so it is reading in all the handlers here var builtInEventHandlers = State.DeclarationFinder.FindEventHandlers().ToHashSet(); but then from there is not able to tell whether the handler is tied to a user defined or built in event?
 
it's not able to tell what event it's tied to
let alone if that event is user-defined or not ;-)
 
tries to remember event handler syntax in VBA :)
wait lol this might be a dumb question but isnt the event in the name of the handler?
 
7:15 PM
it works by name lookups and signature validation, basically
@theVBE-it'srightforme the name alone says very little about the object it belongs to
 
for that, you need typelib api
 
you need to know what type of object the part before the underscore is
that sounds not fun then :)
 
esp for the built-in events since there won't be a declaration for it.
 
im getting a theme here with com/net interactions
 
7:17 PM
I suppose that you could infer user-defined events by the fact that there's a WithEvents declaration.
 
WithEvents works with built in events too?
 
I'm trying to and failing to think of an example where you could create a event handler for a user-defined event without a WithEvents declaration.
hmm, yeah, but then we'll know the type, too.
 
e.g. Private WithEvents MyForm As Access.Form
 
^ ;)
wow my vba is legit rusty already this is bad
wait so if that is the case cant you just look for WithEvents then inspect whatever type is there?
every user defined event has to be declared explicitly after all
@this also i would really strongly recommend taking a look at the code accompanying that article i edited into the PR comment
if you havent already
 
7:28 PM
unfortunately there's this thingee named.... "work"
will try to ASAP
 
@this right
leaves in shame
 
> Should we replace the dead link with a Wayback Machine link to the original page, or just rework that paragraph?
 
if i have time ill try to make sense of it since i've spent enough time with reflection i might have a chance a bit
thanks to him making good comments
sorry for not sharing this earlier btw
i found it like a day or two later but then forgot about it when i realized i didnt need custom marshaling for what i was doing
glad i remembered now :)
 
It would actually be easy to find out whether a handler handles a built-in event once #5379 is closed.
 
@M.Doerner no difficulty tag :p
 
7:33 PM
That again is also not too hard when done at the right place, i.e. when resolving references.
I tend to forget to add them.
Now, it has one.
 
oof that is above my capabilities
btw on the note of hte resolver, i've always wondered this
why is it so difficult to find out what is causing a resolver error
 
The main problem is that you have to understand how things are done in the parsing process and how to implement proper invalidation.
 
are those the things that cause parser/resolver errors?
 
I guess, because you have to know how the resolver works.
By now, I usually find the reason rather quickly.
 
7:36 PM
@M.Doerner i mean from a UX standpoint
 
Usually, the problem is that the input is not legal VBA.
 
like it tells you why a parse failed but you have to dig through the error file or have a sense of what might be wrong to get a resolve error
why does RD not tell you what module it is in though, like it does for parse errors?
even if not the actual line
 
For the parser, ANTLR, the parsing framework, returns an error when it cannot match things.
The resolver is completely home-brewed.
Moreover, the structure is not really optimal.
 
got it
not an easy fix then lol
 
So, to answer why resolver errors do not tell you what went wrong, it tis simply that nobody cared to produce sensible error messages for the user so far.
 
7:40 PM
okay well as a point of feedback from a user that is really really annoying
 
You could open an enhancement issue for it, though.
 
It will not be done soon, but we will have it on the radar, then.
 
yeah i guess i was asking if you wanted it on the radar or not
 
I think, it makes sense in the same way it makes sense to provide some information about parser errors.
 
I still plan to rewire the resolver some time in the future to more act like a function.
I.e. to return a result object instead of adding the references directly to the declarations.
 
where exactly is the resolver in the source code?
also that makes sense to me i think
 
Then, we could just return some resolver error object in case something goes wrong.
There are actually two resolvers.
 
do i use "feature request" issue?
 
The DeclarationResolver and the IdentifierReferenceResolver.
Yep
 
7:45 PM
ok ill make that while you explain the resolvers
 
You can actually find a description in the wiki. However, I still have to write the page for how exactly the resolvers work.
 
"you invoke a method and get what you want"
ez done
:)
 
It is more like: walk tree to find interesting contexts -> determine embedded expressions -> create expression binding for expression -> resolve expression binding -> add appropriate identifier references to declarations based on resolved expression binding.
 
well yeah but i couldnt explain that
or even say what that really means
actually i get it a little bit
but i see why you havent written that wiki page yet :-p
 
At least, I have already modified the identifier resolver to use pattern matching instead of dynamic; that makes it possible to actually follow the steps in the IDE.
One reason why I have not written it is that I want to change a bit how it works.
I do not intend to do the documentation twice.
@MathieuGuindon Regarding the events, I think there are actually good arguments to either not exclude event handlers and their parameters at all or to exclude all of them.
 
7:56 PM
@M.Doerner justifying putting something off with completely valid logic is <3
 
> I personally would prefer linking to wayback, if only to simplify attribution (because the previous work we built on was quite extensive).
 
An argument not to exclude them is to simply warn about the fact that the other declaration is shadowed.
An argument to also exclude user-defined event handlers is that changing the parameter names actually would require changing the names of the event parameters.
 
Hi guys. The RD is coded in C#. Right?
 
Depending on the number of consumers of the event that might be complicated to do.
Yep, it is.
 
I'm going to the 1-week course for C# beginners next week. Any tips on what I should be focused on if I want to help you? :)
 
8:01 PM
everything :)
 
lol
 
Oh nice! Got that! That will be my first question if he asks "anyone has a question?" :D :D
 
@SonGokussj4 Don't worry about that, we're kinda experienced at onboarding people by now :)
 
@Vogel612 ^ Kappa
 
@SonGokussj4 what other coding experience do you ahve
 
@theVBE-it'srightforme Well I'm self taught programmer (5 years) beginning with Bash (Linux), Python, then for the last 3 years VBA with increasing experience because of you guys, then a little bit of C#, VB.NET, of course HTML/CSS but those are not languages and then Docker/networking and stuff which is not a language either.
 
"of course HTML/CSS but those are not languages " <- I laughed ngl
 
@SonGokussj4 I mean, a beginner course will be covering the basics, the foundation - you want to pay attention to literally everything there, I think. take it as a solidification of what you already know, and an opportunity to learn (or re-learn) some more
I mean, sorry / I agree "everything" was a little terse ;-)
 
focus especially on syntax
 
8:10 PM
I was thinking more in the way that the teacher will try to teach us how to write "print" and for cycles, while, ... I hope something more (It's week long so... HOPE :-D)
But the same problem I've experienced with VBA - how to create a complex program. What are the tips-questions we need to ask him to create a well-structured project.
 
and how to achieve common things you do a lot
 
@MathieuGuindon No-problem :-) I know.
 
those are the little annoying things that cause you to not learn a language well
try to write something in C# and get stuck bc you cant declare array cleanly etc
(definitely not saying this from personal experience :3)
 
@theVBE-it'srightforme :-) If I get stuck with is, I can google it and resolved it under an hour. I'm more concerned about the bigger picture that StackOverflow doesn't tell you.
 
@SonGokussj4 oh, but for that you need to look into architectural design patterns
 
8:12 PM
^
but those are completely mostly language agnostic
 
they're language-agnostic concepts, won't be covered in a language-specific class
 
@MathieuGuindon Okay, that could be a "keyword" I can ask him.
 
@MathieuGuindon you taught me well lul
 
@theVBE-it'srightforme exactly lol
 
@theVBE-it'srightforme not completely, actually..
 
8:13 PM
how do you strike through text
 
there is vast differences between C++, C and C#
 
Oh... So they are not specific to language... But I don't think they could be applied, for example, to Bash/Python. :-D
 
---strikethrough---
 
---double--- triple dash
 
8:13 PM
bash is ... a bit complicated, mostly the same patterns as for C apply
because both of these are just straight procedural languages
neither has object-orientation
 
@Vogel612 would you agree that it's actually a matter of whether you are going to craft the pattern manually or have the language do it for you, though?
 
@Vogel612 the idea of thinking in design patterns and then using design patterns based on your situation, which includes the capabilities/limitations of the language you are using...
 
For C++ you need to to deal with memory, so there's a ton of patterns around that
 
(e.g. we can always fake constructors in C or VBA by conventionally calling one)
 
@Vogel612 right that requirement was kind of implicit :)
 
8:14 PM
@this it's more like some languages lend themselves well to certain design patterns
C# for example is great at event-based design patterns because of the "native support" for that
 
@this if it's a framework, does it count as manual or language?
 
Right.
and you wouldn't really do RAII in C#, I guess
 
Java doesn't do that and everything to do with events is a giant cluster of suck
 
but is that really a architectural thing?
@MathieuGuindon if you need to add the framework, that's just manual. Not as manual as "code your own" but still manual.
See: JavaScript ecosystem
 
8:16 PM
no, I was referrring to architectural patterns e.g. MVC
 
@Vogel612 Java doesn't do that and everything to do with events is a giant cluster of suck <-- please consider these revisions
3
 
sure it is. Events are a solution to "how does a controlled class notify it's instantiator of things"
@theVBE-it'srightforme Java actually has some (small) good sides, but overall ... yea
 
@SonGokussj4 a lot of examples of oop design patterns have python
 
@theVBE-it'srightforme Well I'm trying to use OOP with more complex python scripts (not apps...) but I don't think it's different than just "import this 'file' and use it's class" thing.
 
@SonGokussj4 well everything is that at some level
 
8:19 PM
What Matt tried to teach me is to use interfaces in VBA and I think they are in C# too. Should I ask the teacher about them?
 
the key is how you design the classes
 
@SonGokussj4 yes
 
@SonGokussj4 yes
 
Python has interfaces?
 
@MathieuGuindon ok
@theVBE-it'srightforme ok
@this no
 
8:20 PM
@this yeah but the script sheds them once a year
 
O.O really? Python has interfaces??
 
lol no
 
it was a dad joke
 
@SonGokussj4 yes.
 
(sorry it was)
 
8:21 PM
Uf.......... :-D
 
I was sweating tho :-D
 
haha
I've read python, but I never wrote any
 
@SonGokussj4 interfaces made the main idea of changing things out click for me.
 
8:23 PM
Our task (me and my colleague (padawan of mine)) will be to create a windows gui app to read from a serial port 60 data per second for 2 minutes and create real-time plot of the values from the data.
 
That kinds of ties into the point about design not completely agnostic -- python uses mixins. That is foreign to VBA & C#
Apparently Rust and PHP uses mixins too.
Truth be told, I'm a bit fuzzy on what a mixin is exactly.
 
@MathieuGuindon what file exactly are the implementations of IDeclarationResolveRunner in?
 
@MathieuGuindon It's a beautiful language. Everytime I write VBA, it's real messy. Python is just... "English in code". Beautiful.
But there are few things that are better in other languages I thing.
 
@SonGokussj4 Yesssssssss
 
For example.
 
8:25 PM
how do you embed a picture
 
I don't :-) I post a link (to my blog. Or IMGUR :-) )
 
without ( ) <
 
@this Technically yes and no. We have Protocols, but they technically don't do anything.
 
@theVBE-it'srightforme everything derived from DeclarationResolverRunnerBase
 
8:27 PM
@IvenBach I would ask for more information but I know I wouldn't understand that right now. :-) But I'll keep that in mind.
@theVBE-it'srightforme Old but gold.
 
@SonGokussj4 there’s no Option Explicit equivalent in python?
 
@SonGokussj4 gotta appreciate the classics
 
@IvenBach it's ducks all the way down!
 
@MathieuGuindon oh i didnt check the VBA folder!
 
@this yeah. Heard 'mixin' for the first time in my life... what's that??
 
8:28 PM
i thought surely not
 
@MathieuGuindon actually....
 
@IvenBach Nope. But from python 3.6 i think you can define what will be passed so instead of:
 
python supports classes and inheritance, as such you could argue that it has interfaces
 
def add(a, b):
    return a + b
 
there's also special methods like __str__
 
8:29 PM
You can write:
def add(a: int, b: int) -> int:
    return a + b
 
@this I had to look up mixins, yeah I don't use them much in Python
 
thought: if languages could mate, what would the child of VBA + Python would be like?
 
But STILL you can pass a STRING to that function :D
 
@this mostly horrible
 
@Vogel612 That's a given. The question is more "how would that horrorshow look like"
 
8:30 PM
well, indentation for scoping, but even less typesafety than before
 
@Vogel612 That's a method for a custom class to just return what you see if you print(yourObject)
 
yeap, which is basically an interface
 
@this Oh no... no No NO...
@Vogel612 Which I don't know because I don't understand interfaces :-)
 
@SonGokussj4 not sure if it'll be worse than xBasic (basically the child of C++ & VB)
 
@MathieuGuindon ^ (interfaces) oh hey, next blog post idea :-D
@this I mean... ... .... en.wikipedia.org/wiki/Brainfuck
Is anything worse?
 
8:34 PM
would anyone actually try to program in it for reals, though?
 
@SonGokussj4 I prefer LOLCODE.
 
It's a language expressly designed to be esoteric.
The award should go to the language that designers actually tried to make something good but failed miserably & horribly
 
@this The internet is wast.... The people are the stupid.
@this Matlab
 
@theVBE-it'srightforme if you're in VS you just right-click the interface and select "find implementations"
 
If we're still probing python... For example. Is there a better way to load a file in a 'list/1D array' of lines stripped of \n and only lines that starts with '#'? How would you do that in C#?
with open('/file/path', 'r') as f:
    lines = [line.strip() for line in f.readlines() if line.startswith('#')]
@BigBen Holly actual shit this is amazing :D
 
8:42 PM
It really is
@SonGokussj4 list comprehension is amazing too
 
@SonGokussj4 If you're asking for a better way in Python then you've pretty much got it.
 
@MathieuGuindon oh i should just download RD shouldnt it
i hadnt bothered because i knew nothing about c#
it would make finding things a lot easier
 
More amazing is generator. Just change [] -> () and you've got generator... when reading file (only once) even if it has 5GB size, you just read line after line in a second. Not waiting until it load into memory.
 
Yep
 
@Peilonrayz Nah. I'm interested in C# way. (because I don't know C# and I'll go for a 1-week course next week) :-)
 
8:48 PM
Are you trying to learn the basic syntax?
 
There are many things I love in python. And few that are better in VBA... Python is not the "best language". Not at all. :-) But it was my first. I think making GUI applications in it is quite nasty even with PyQT5/PySide
@IvenBach I can google the basic syntax. I can use my keyboard. I'm more interested in "best practices".
 
Look no further than the RD code base. Only #BestPractices used here.
 
@SonGokussj4 Ah I don't know C# that well, but I'm sure linq has some coll way to method chain it all.
 
As I wrote. How would to load every line from a file starting with '#' into a 'list' or 'array' or what is the 'thing' in C# :-) (collection in VBA)
@IvenBach I believe you. But that's above complicated for me right now. Just as I was reading python codes 5 years ago.
 
@IvenBach uh, pretty sure we have few places where #HereBeDragons
 
8:55 PM
@Vogel612 Actually I agree. Java gives a real sense of satisfaction when you uninstall it.
 
Few and far between. Besides, those are the corners new ducks never go because of the sign posts.
 
@mansellan Javanese people might find it a little inconvenient when you do that to their island. Just sayin'.
lol, a site just presented me with a "what's new" modal dialog. Had the "x" that didn't work and thus forced me on a tour I didn't want to take. Clever!
 
Okay. Wikipedia didn't help much :D :D I cite"Javanese may refer to: Of Java Javanese people, and their culture Javanese language Javanese script, traditional letters used to write Javanese language Javanese (Unicode block), Old Javanese, the oldest phase of the Javanese language Javanese ..."
 
@SonGokussj4 mansellan didn't specify what "Java" he was uninstalling. ;-) There's an island named "Java". Uninstalling the island from Earth might be.... teensy weensy unsettling for some???
 
teensy weensy doctor who? :-D
 
That’s a bad UX being unable to close it.
 
@IvenBach that much is evident. The only question is whether it was deliberate. :)
 
9:22 PM
> Just to note, though - sometime the resolver errors are transient. As an example, if you are actively editing the code while parse is running in the background, that can sometime lead to resolver error in which case the remedy is to just re-run the parse again.
 
@SonGokussj4 One thing they should definitely cover is LINQ.
 
in a 101 class?
While I agree LINQ is very useful, I'd want the beginners to understand the underlying magic first before using it.
 
C# may not have list comprehension, but with LINQ that is not that much of a problem.
Nah, you can try to understand the magic later.
After all, nobody tries to understand the magic behind list comprehension before using it.
 
So the course tells:

Platforms of Microsoft .NET
Variables, data types
Block of program, conditionals, cycles
Exceptions
basis of OOP
work with referenc types
Constructors, finalizers and releasing sources
inheritance, virtual methods, abstract classes, interface
Register to events
Usage of properties and indexers
translated from czech description. Don't know if I translated that right. :)
 
@SonGokussj4 File.ReadLines(path).Where(line => line.StartsWith("#")).Select(line => line.Trim()).ToList()
 
9:38 PM
@M.Doerner Nice! At least someone answered :-) This will create which object in C#. 'List'? I'm not acquainted with C# object yet.
 
-1
Q: Calculating a Score in VBA based on selected ShapeStyle. Is there a better/shorter way to do this?

Michelle I'm calculating a score based on whether or not certain colors shape is selected. Some of the shapes are in groups, some are not. For the shapes which are in groups, only one of them will count towards the score. I have figured out how, as you can see below. However, I have 9 more shapes/scores t...

 
@SonGokussj4 I think you're wanting to use File.ReadLines() which returns an IEnumerable<string>. The Where extension method is used to filter.
 
It will create a List<string>, which is a dynamic array of strings.
 
Select then projects each element with each result trimmed. Lastly ToList creates the List<T>.
I'm far too slow at explaining things...
 
If you want an array of strings, i.e. a string[], you can use ToArray() instead.
Everything until the last method is what would be a generator in Python.
Only the last method actually materializes the result.
Basically, generators in Python are instances of IEnumerable<T> in C#.
Note however that the elements have a defined common type T.
 
9:58 PM
@M.Doerner And that's because of delayed execution?
Nothing happens until it needs to be iterated over. For performance reasons it doesn't make you wait until it needs the result.
 
10:29 PM
Odd behavior in RD? Export current project: at first open and after initial parse exporting the current project is only a few seconds, but after a somewhat lengthy session with multiple reparses, workbook saves, etc. the export can take tens of minutes or more. Any thoughts? I notice that using an Add-In that i created reacts similarly, so I don't think it's RD per se unless there is something RD does that dirties up Excel.
In Windows Explorer looking at the parent folder of the folder where the code modules are being written there is a slow progression of tmp files...
Time for cocktails.. check back tomorrow
 
 
1 hour later…
11:53 PM
@this are you familiar with Excel Power Query (PQ)? Wondering if Left Anti Join is a PQ specific or a DB related term.
:derp: I fail at researching first then asking: sqlity.net/en/1360/a-join-a-day-the-left-anti-semi-join.
 
FWIW, that particular term is not commonly used in general parlance
e.g. most people won't know a LASJ even though they've already likely used it in one form or other.
 
00:00 - 19:0019:00 - 00:00

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