« first day (1026 days earlier)      last day (2154 days later) » 
00:00 - 21:0021:00 - 00:00

12:01 AM
RELOAD!
[Hosch250/CheckersUI] 2 commits. 44 additions. 30 deletions.
[rubberduck-vba/Rubberduck] 2 commits. 3 opened issues. 1 closed issue. 4 issue comments. 58 additions. 24 deletions.
[VSDiagnostics/VSDiagnostics] 1 opened issue. 1 issue comment.
 
12:27 AM
@Mat'sMug
> In software engineering, we use mocking frameworks to stand in for missing or complex parts of a system in unit testing. You know, it's like making a mockup of something. They don't actually mock us. Taunting frameworks, on the other hand...those can be quite rude.
Also, I need to take this to heart:
> Also, this is a pretty good narrative on how business people can spin any skill you have into whatever buzzword a customer thinks they want.
 
lol, where's that from?
 
amphibian.com
Also, I've not heard of this before:
> A man in NY was stabbed in 1957. He recovered from his stab wound and lived until 2014, into his 90’s. When he died, the autopsy determined that the stab wound from 57 years earlier was a contributing cause of his death and it was declared a homicide.
 
wut
 
statute of limitations?
 
1:06 AM
Don't think there is one on murder, since it's affect is kind of permanent...
 
indeed, but 6th amendment should get you right to a speedy trial
 
1:50 AM
Sounds like something out of Tv series Cold case
 
@IvenBach LOL.
He would have died sooner or later anyway.
@ThunderFrame You have to be charged to have a trial.
That only applies after the charge.
That was primarily so they can't charge (political) enemies and leave them to rot in jail forever without a trial.
I'm getting quite sick of helping people with copy/paste programming.
I've helped two so far.
That is, I've walked two through it line-by-line as they did it.
I walked a third through line-by-line, but they did it on their own.
The fourth, I've not helped yet--he did the home page and the CSS.
 
 
2 hours later…
3:45 AM
how did other languages within stack overflow coped with cutting/pasting codes?
 
4:06 AM
0
Q: String Repeat function in VBA

ThunderFrameVBA has a built-in functions for repeating a single character: Function String$(Number As Long, Character) As String Function Space$(Number As Long) As String But neither are of any use when you need to repeat a string that has more than one character. You could repeat a string "abcde...

 
4:20 AM
 
4:32 AM
@PeterMTaylor What do you mean by that?
 
Your code will fail with Overflow error when ActiveSheet.UsedRange.Rows.Count > 32767. Declare your variables as Long, and use meaningful names l is too visually similar to 1 and doesn't have any meaning to your future self or replacement. — ThunderFrame 24 secs ago
 
@Mat'sMug I won't be able to do this by our next release, but what do you think about me completely revising the inspections feature all in one blow?
I should be able to get some work done on it in April, but after that (around May), I'm going to fulfill my promises to the Roslyn and F# tooling teams.
 
@Comintern ^^ thought you might enjoy that StringRepeat question on CR.
 
And I hope to get a job soon too, so that might throw a wrench in there.
 
 
1 hour later…
5:45 AM
@Hosch250 I mean from a user behaviour point of view. A way of measuring their bad coding habits. Was thinking to myself when I hear a pattern that moderators of this club is slowly more frustrated than the normal about copy/paste code by other users questioning it
This wondering what's this like across other tags so to speak with stack overflow
^ Thus not this I meant silly iPhone auto corrector
 
 
3 hours later…
Kaz
8:59 AM
Rocket launch pushed back a day :(
Also, Monking
 
9:48 AM
monking
 
10:21 AM
Monking @Kaz
 
10:56 AM
0
Q: Code iterates through all rows and inserts value in cell for each

António PiresI would like that this code would now be done in a faster way: Sub TechMapping() Set mappingWB = Workbooks.Open(Filename:="path\workbook1.xlsx") Sheets("Sheet1").Activate Dim Lookup_Range As Range Set Lookup_Range = Range("A2:P1779") Workbooks("workbook2.xlsb").Activate ...

 
 
3 hours later…
1:49 PM
@IvenBach:
Questions like this from veteran members demonstrate that the rules and principles we attempt to hold to are by no means straightforward or simple. They're [sort of] self-contradictory and mystical ... as any good set of rules should be. And, I'd like to believe questions like this humble the wise, and give hope to those feeling hopelessly stupid. Thanks, Robert! — svidgen 16 hours ago
 
 
2 hours later…
Kaz
3:28 PM
Online reporting system has a strong dislike for european date formats.
 
@Kaz Who was stupid enough to use an nvarchar?
You can set how the dates display, IIRC.
 
Kaz
@Hosch250 This financial provider. Apparently.
 
@Hosch250 well at least they're storing it as a date... they could probably better validate their user inputs though
 
Kaz
I'm less surprised at the Amero-Centrism and more at the fact that it blew up.
This isn't some tiny out-of-the-way never-used system. I'm amazed it hasn't been fixed before.
 
3:44 PM
@Kaz they couldn't be bothered to specify the format they want the date entered in?
that's kinda lame
unless specified otherwise, a user has all rights to assume yyyy-MM-dd is the date format to use
 
@Mat'sMug I've seen that it's not all hard cut lines and 90 degree angles. It's nice seeing others with more experience than myself ask questions that I would ask.
 
Basically, being a software developer requires knowledge of the basic principles, knowledge of the language(s), experience, and a goodly amount of uncommonsense and good humor.
 
> Just to be clear, what's being renamed is DoSomething?
 
@Hosch250 I'd say that applies to most disciplines.
 
3:54 PM
True, with a few tweaks.
Except for the last items.
A lot of jobs only require common idiocy.
 
Kaz
@Mat'sMug Funnily enough, it's fine with yyyy/mm/dd
It's just dd/mm/yyyy that blows it up.
 
@puzzlepiece87 interesting read. Don't really know the different dinosaurs but appreciate the tree diagram
 
4:11 PM
function checkKey( String key ) {
 try {
    Integer.valueOf( key );
 } catch ( NumberFormatException e ) {
    return;
 }
 throw new CodeUnreachableException( "Keys may not be purely numeric: " + key );
}
 
@Duga @Mat'sMug suggested that I take a look at refactoring RenameRefactor - which is how I found this. I also have a fix....but still working on the refactoring.
 
good catch :)
 
4:33 PM
Are optional parameters best eliminated if possible? IE if multiples calls can be made to a method and only 1 will use an optional parameter is it better to make everything explicitly pass in the parameter and not have it optional?
 
hard to tell without seeing the code
optional parameters are basically the VBA way of implementing method overloading
nothing wrong with them per se
 
Can it also be thought of as 'This feature was added later and we don't want to/can't update previous calls'
 
that sounds more like tacking new functionality into an existing procedure
write a new procedure that calls the old one?
 
4:58 PM
> @BZngr I guess it is a typo in your first method that you omitted the `I` in `Dim c1 As IClass1`, right?

Given that, I can fully reproduce this when renaming any public sub on an interface. As remarked above, it does not matter whether the method is called via an interface. Whenever the interface of a class gets implemented, no references are updated by `RefactorRename`, period. Only the implementing methods get adjusted.

Since we currently do not clean up sub and super classes when we r
> @BZngr I guess it is a typo in your first method that you omitted the `I` in `Dim c1 As IClass1`, right?

Given that, I can fully reproduce this when renaming any public sub on an interface. As remarked above, it does not matter whether the method is called via an interface. Whenever the interface of a class gets implemented, no references are updated by `RefactorRename`, period. Only the implementing methods get adjusted.

Since we currently do not clean up sub and super classes when we r
> @BZngr I guess it is a typo in your first method that you omitted the `I` in `Dim c1 As IClass1`, right?

Given that, I can fully reproduce this when renaming any public sub on an interface. As remarked above, it does not matter whether the method is called via an interface. Whenever the interface of a class gets implemented, no references are updated by `RefactorRename`, period. Only the implementing methods get adjusted.

Since we currently do not clean up sub and super classes when we r
> > Since we currently do not clean up sub and super classes when we reparse

We should be doing that for all user code.
 
5:34 PM
> Not necessarily a typo...at least this is how I've used VBA interfaces in the past. The first line establishes what class is implementing the interface in preparation for the Set statement. If I had added the "I" in the first statement, calls to DoSomething() are forwarded to the interface defintion (empty proc bodies).
 
@Mat'sMug Well, C# has optional parameters and method overloading...
@Hosch250 @Mat'sMug Did you see this?
I could move the inspections and quick fixes into their own assembly, make the result independent of the quick fixes, make the inspections run on state changed instead of with the inspector, and more.
Then, I could add an AddInspectionAnnotation(result) method to ParseTreeNode, or whatever that base type is`, and add the results to the node as they are created.
And a List<IInspectionResult> InspectionResults member for the node too.
Then, in the inspection viewer, we could either walk the tree, or fire an event with the inspection result when we add it and update the view by listening to that (not sure if this is the best idea...).
 
@Hosch250 C# didn't always have optional parameters
 
True.
 
the problem with running inspections on state changed is that the coordinator loses control over what happens when
 
Should it have that control?
Also, we need a mechanism to only run inspections on certain modules.
 
5:46 PM
IInspection.GetInspectionResults can't do that
 
Why not?
 
because its role is to return all inspection results, that's its contract
 
It could take a QMN, or something.
 
we're going to have to change the IInspection interface anyway - might as well do it once
 
There's nothing saying it can't return all inspection results that have a certain quality.
Or, I could add another method.
 
5:48 PM
I was thinking of making inspections annotate parse tree nodes... i.e. they'd return void
 
@Mat'sMug Well, I proposed that above ^
I'd make the inspection add the result to the ParseTreeNode we are working off it (or the context for the declaration we are working off of.
 
there is no base type we can add that to. we need to implement some IInspectable interface on all annotatable ParserRuleContext derived classes that can be inspected
 
@Mat'sMug Why couldn't we extend ParserRuleContext?
Isn't that the base class all the other nodes implement?
(That's the node I was thinking of--just couldn't remember the name.)
 
is because it's in the Antlr runtime and we can't tweak it good enough?
 
Maybe. It isn't partial?
 
5:51 PM
no
the generated types are
 
OK.
 
this needs to be well thought-out and documented before it's implemented
otherwise it's going to be a royal pain in the neck
 
Well, the first step is whether to keep using the inspector or make the inspections run themselves.
Either is fine, but they will result in different designs.
 
I think we can keep the inspector, it makes a nice place to inject IInspection implementations into - IMO the IInspector would become a dependency of the ParseCoordinator which would run the inspector when inspections are ready to run
 
And the next step is how we are going to manage asynchronicity. Are we going to inject the inspector/inspections into the parse coordinator, or are we going to pass the cancellation token as part of the state changed event?
@Mat'sMug That is where I disagree.
We are going to have other tasks that could/should use that token.
 
5:57 PM
like what?
 
ParserCoordinator is going to become an absolute mess if we inject everything into that.
 
and injecting every single inspection into it is a better idea???
 
@Mat'sMug Well, the code explorer and unit test explorer for two, once we start updating every time the code pane content changes.
@Mat'sMug No.
I propose passing the cancellation token as part of the parse updated event.
 
the problem is that the execution order of multicast delegates (events) is non-deterministic AFAIK
 
It absolutely doesn't matter.
We just check before the process starts, and at a few places during the process.
 
6:00 PM
it's much easier to report progress if it's done in the coordinator
e.g. ParserState.Inspecting
 
I don't see how. You still have to check for cancellation (or use the try/catch and throw when it is cancelled) in the inspector.
@Mat'sMug Yeah, sure, but it will still be running off the event.
In fact, that defeats the whole purpose, because I'm not going to have the refactorings, commands, etc. all wait until the inspector is done to become available. They currently update on Ready, but they'll have to start updating on Inspecting
And then, Inspecting will just be the new Ready.
 
what if most inspections become parse tree inspections and actually annotate the nodes during the parse?
 
@Mat'sMug Well, you know what?
 
@Hosch250 you're right, ParserState.Inspecting doesn't make much sense
@Hosch250 what?
 
Collecting results, and then analyzing them would be ridiculous.
 
6:05 PM
^
 
Monking!
 
that's the point: we wouldn't be collecting results anymore
@JudeNiroshan hi!
 
The right thing to do would be to inspect and update the node as they run.
Hi, @JudeNiroshan.
 
whenever possible, yes
 
That will absolutely kill performance in the parse, though.
 
6:05 PM
I have a problem with understanding to work with my fork and the original source project
 
@JudeNiroshan You clone your fork and work from that.
When you have a new feature/bug fix, submit a Pull Request (PR).
 
first I forked the project.
Then i cloned it into my laptop
then i did the fix
 
so far so good :)
 
@Mat'sMug This is precisely why I want free-reign to do everything in one sweep.
 
now i have committed it
 
6:07 PM
It will make it much, much simpler.
 
then I have pushed it to my fork
 
Good. Time for a pull request.
 
now I see there are formatting problem :(
 
@Hosch250 granted - but I'd like the IInspectable stuff to be discussed first!
 
Don't worry--just do another commit.
@Mat'sMug Sure.
 
6:08 PM
But I don't know how to compare my local branch with the remote original source code through IDEA
 
we need to seriously think about that one - implementing an interface to extend single ANTLR-generated class is a MASSIVE undertaking, we don't want to be making major structural changes to that after it's done
 
i need to compare and replace the formatting places
 
@JudeNiroshan you can do that directly on GitHub
 
Basically, we need to decide on two things: 1) how to handle cancelling a task--and I insist you make it scalable, because I won't refactor it for you later, and 2) whether to keep the inspector, or whether to make the inspections each responsible for themselves.
 
wait, IDEA handles C#? Are you not on Visual Studio?
 
6:10 PM
Yeah, get on VS, or maybe Rider; I'm going to try that one out after I'm done with college.
 
It's Java
 
Rubberduck is not Java.
Maybe in 1200 years, Java will be advanced enough to compile it.
 
@JudeNiroshan <~ I'm confused
 
@Mat'sMug I have a feeling it isn't about a PR for RD.
 
Opps Dopps!
 
6:11 PM
@Hosch250 aaaawwwwww
 
I thought this is second monitor. Sorry for that
 

 The 2nd Monitor

General discussion about codereview.stackexchange.com - Welcom...
:)
 
BTW; I am about to make the pull request
 
well done!
 
and I can see the formatting has messed
 
6:13 PM
I'm off to finish about 20 pages of Gulliver's Travels.
 
Is there anyway that I can correct this?
 
Much better than the last book I read for this class.
 
@JudeNiroshan got a link to the diff?
 
> FWIW - RenameRefactoring was free of unit tests for renaming controls (though it has code for for doing that). I added a RenameControl unit test and it failed in a similar manner as this issue (renamed declaration, left references as they were). I'm currently working on refactoring RenameRefactoring and am fixing these issues as I find them.
 
@Duga RenameRefactoring had unit tests?
 
6:16 PM
I'm sorry. I'm lost now
I can't understand how this works
 
:)
 
I know how to work with subversion without any issue
but Git has many terms and makes it more complicated
 
@BZngr one reason lame justification why RenameControl didn't have any tests is probably because it was implemented well before it was even possible to mock a UserForm, let alone form controls :)
Commented-out code rarely works as expected — Mat's Mug 20 secs ago
evil grin
 
@Mat'sMug Yep.
@Mat'sMug Commented-out code always works as expected, except in languages which compile the comments.
 
6:42 PM
@Mat'sMug yeah - I spotted the UserFormMock - or, I may not have added a test either. :)
 
t3chb0t drives me nuts. He gives a lot of answers that address normal things that get upvoted.
The latest is about a private static field in C#--"How are you going to access it if it is private?".
 
@Hosch250 I have a ton of those too
 
@Mat'sMug Not like these.
You know that you can access a private static field within the class it is defined in...
 
Yeah...
 
I need to post something--I'm 5 points away from 1.6k.
 
6:55 PM
Here's an interesting one. Reinventing the wheel or just pure ignorance?
What problem does this pattern solve that multicast delegates (a.k.a. events) don't? The framework's solution to the problem you're describing is to encapsulate the event args in an object derived from the EventArgs base class, so you get EventHandler<TEventArgs> as a generic delegate, with object sender, TEventArgs args as a signature. So... Indeed there's an established way of doing this: events! — Mat's Mug ♦ 9 mins ago
 
@Mat'sMug Reinventing the wheel from pure ignorance?
 
much
that one will end with a gigantic facepalm I think
#ConnectTheDots
I guess I shall have to look up events since your answer contains many terms I don't know. Thanks for pointing me in that direction though. — TheFaithfulLearner 2 mins ago
Yup
 
7:12 PM
Does that seem like a copy paste type of question based on his response?
 
"that"?
 
Yeah.
 
I'm sorry I don't understand the context of the question..
the events thing?
 
@Mat'sMug Is a copy paste feel to me.
 
meh, the guy was reading about design patterns, thought "Mediator" seemed like a very useful one, decided to implement it in C# without realizing that the framework itself implemented the pattern
this scares me
private volatile object locker = new object();
you don't understand events and multicast delegates, but you understand volatile? no way
 
7:17 PM
I've still a lot to learn it seems...
 
oh, no worries - volatile is way above my head also ;-)
 
Hard to stay motivated when it seems like there's an insurmountable pile of knowledge in front of you.
 
7:45 PM
@Mat'sMug volatile basically means that the system can't cache it.
 
extremely dumbed-down, yeah
 
It has to read it from the memory each time you access it because it might have been written to from multiple threads.
@IvenBach That's what makes it fun!
If you know where to look for the knowledge, it is easy to learn it. The hard part is finding something new to learn when you don't know what you don't know.
 
@IvenBach I'm still learning things about how VBA works, 20 years into it
2
 
I know that I don't know SQL and ASP.NET, so I'm going to learn those ASAP.
@Mat'sMug LOL, that's because the last few years you've been looking at the real implementation, not the intended implementation.
 
I'm not giving up but every day I see more of what I don't know.
It's scary realizing how little one actually knows.
 
7:51 PM
Keep at it and keep writing code; you'll learn. And besides, learning is fun--I get stale when I don't learn something each day.
 
> “The more you know, the more you know you don't know.”


― Aristotle
 
The larger the island of knowledge the greater the shoreline of mystery.
 
@Mat'sMug Newton had a version like that too.
 
Descartes too IIRC
 
On the flip side of the coin, the more you know, the more you can forget.
 
7:53 PM
At least it's a (2 : radius) relationship.
@Hosch250 don't worry about forgetting. Once you're married you'll never forget...
The wife makes sure of that one.
 
Oh, but I have no interest in marriage.
I've seen enough of my relations' marriages to not want to be in that type of relationship.
 
It's like programming. If you set it up right to start off it runs smoothly. Just watch out for those refactorings, they can make things bumpy.
 
Well, people generally automate Excel with VBA, not C++. Doing that in VBA avoids many pitfalls you're getting to put up with in C++. I'd probably just generate a .csv file and use Excel to import it, and then pivot it perhaps. Or use VBA to lay it out as needed. But straight-up Excel automation in C++.... you're a brave warrior man! — Mat's Mug 6 secs ago
 
8:09 PM
I would like to repeat my point regarding the inspections. For better control of when the inspections start, I would prefer injecting the 'Inspector` or better an implementation of an interface IInspectionRunner into the ParseCoordinator that simply has a void method RunInspection.
This could have an overload taking the CancellationToken or an optional parameter with default value CancellationToken.None. It could also have an overload taking a Collection<QualifiedModuleName> to have an interface for running the inspections on selected modules only. How exactly they are run, how concurrency between them is handled and cancelling running the inspections would be a concern of the implementation of that interface.
BTW, I would actually like to refactor the ParseCoordinator quite a bit and pull the details of running the different steps into their own runners and inject them back. Than the Coordinator would truely only be responsible for the overall coordination.
 
@M.Doerner I'm 100% behind this :)
 
That would also allow to have synchronous versions of the runners for the unit tests.
 
(including injecting IInspector/IInspectionRunner/IWhateverRunsAllInspections)
 
BTW, I think pulling the inspections out into their own assembly might not be as easy as it looks.
IIRC, they have dependencies on other stuff in the main assembly.
That would probably yield circlar references between the assemblies that need to be resolved.
 
"inspector" assembly (/any plugin assembly) would have a reference on the RD main assembly; as far as RD main is concerned, all inspections are just IInspection - there's no circular reference involved
wait no
damn, you're right
...
no - we wouldn't be referencing the plug-in at compile-time, but loading it at startup
it should be fine
 
8:31 PM
I love random unexplained downvotes
 
I also just realized that you have already pulled out the UI name list for the inspection into Rubberduck.Parsing. That was what had been in my mind.
 
Thanks for the downvote. Mind telling me what's wrong with this answer so I can improve it? /edit: added a note about not really needing to read the cell value into a variable. Hope I'm a good mind reader. — Mat's Mug 8 mins ago
@M.Doerner had to... wouldn't compile otherwise :)
 
Ah, OK.
 
...honestly it feels a bit awkward to have resources in that assembly though
 
+1 from me to restore justice (and for a good read)
 
8:35 PM
When we run the inspections from the coordinator and not anymore from the view model, which had been listening to the state ready event, we will probably need an inspections finished event the view model can listen to. As rightly remarked above by @Hosch250 another parser state is not really an option.
 
@CallumDA thanks!
 
Moreover, we will need an IInspectionResultsProvider to inject into the view model, so that it can get the results.
That would just get the results from wherever we choose to store them, be it the parse trees or somewhere else until we have figured out how to annotate the parse trees properly.
 
@M.Doerner that would be a simple [set of] parse tree listener[s] that simply aggregate all results as we traverse tree nodes
 
pretty sure it's less than 10 lines of code :)
 
8:40 PM
Thinking of the inspections, isn't there some rather general context we can annotate other than the ParserRuleContext?
Something like ExpressionContext?
 
that's why I want to discuss & document this: we need to decide which subclasses we want to implement IInspectable, and what IInspectable needs to look like
 
@IvenBach Each piece of the knowledge pile consumed = more money/security
 
but yeah, some contexts have subtypes of their own; ExpressionContext would be one. in these cases we just make the base class implement IInspectable and we knock off all subtypes at once
 
In case we want to run everything directly on the parse trees, we will definitely have to rewrite a lot of inspections.
 
yeah
 
8:44 PM
I do not say that I do not like the idea to do that, but it will be some work.
 
a lot of 'em need to be simplified anyway
 
I would still like to pass an interface IDataForInspecions to the inspections instead of the state to get a bit of separation between the state/parsing engine and the inspections.
 
I'd settle for IInspectionData ;-)
 
Obvioulsy, what this interface exposes would be completely open for discussions.
 
but yeah absolutely - the state is just too much power for a mere little inspection to have access to!
 
8:46 PM
I am completely fine with that name as well.
 
wouldn't the DeclarationFinder be all that's needed?
also, IInspectionResult needs some more thought
public interface IInspectionResult : IComparable<IInspectionResult>, IComparable
{
    IEnumerable<IQuickFix> QuickFixes { get; }
    string Description { get; }
    QualifiedSelection QualifiedSelection { get; }
    IInspection Inspection { get; }
    Declaration Target { get; }
}
if we're going to be annotating nodes, then we already have a Selection through the annotated Context, and the Target becomes redundant
not to mention, should a result know about the inspection that spawned it
 
DeclarationFinder has one little shortcomming: we also have to provide the parse trees.
 
huh?
 
We have inspections that run on parse tree listeners.
 
oh
hmm
 
8:51 PM
So, IIspectionData has to provide them.
A simple implementation could use the state to provide them and the DeclarationFinder.
 
well, no - the parse tree inspections typically just do static context-less analysis of a specific node
e.g. LetStmtContext with an explicit LET token
 
Well, they need to know on what they run, right?
 
well wait a minute - currently we pass these listeners and collect faulty Context instances, which we then assign to IParseTreeInspection implementations
 
Isn't the inspection on the result for the benefit of the inspections window.
 
these inspections then implement GetInspectionResults by simply taking the contexts and wrapping 'em up with an inspection result
 
8:54 PM
Oh, I thought we run them differently.
 
@M.Doerner yeah, something like that... sloppy design
 
More like, they all provide listeners which then all get registered to a walker that runs them all at once.
 
^
basically the real work is done in the listeners; the inspections are just spoon-fed with results
 
If we run everything on the parse trees, that might change the inspection interface quite a bit.
 
yeah.. not sure it's actually possible though
some inspections will need their own visitors - thinking of here
 
8:58 PM
Then they should have a property that returns a listener that can be used for walking the tree.
 
hmm
 
That listener, would annotate the tree.
Or trees
 
00:00 - 21:0021:00 - 00:00

« first day (1026 days earlier)      last day (2154 days later) »