« first day (1016 days earlier)      last day (2164 days later) » 

12:00 AM
2017-03-18 10:43:47.8729;ERROR-2.0.13.36418;Rubberduck.Inspections.Concrete.Rubberduck.Inspections.Inspector+<FindIssuesAsync>d__6;Rubberduck.Root.InterceptedException: Unable to cast object of type 'Rubberduck.Parsing.QualifiedContext`1[Rubberduck.Parsing.Grammar.VBAParser+LiteralExpressionContext]' to type 'Rubberduck.Parsing.QualifiedContext`1[Rubberduck.Parsing.Grammar.VBAParser+AnnotationContext]'. ---> Rubberduck.Root.InterceptedException: Unable to cast object of type 'Rubberduck.Parsing.QualifiedContext`1[Rubberduck.Parsing.Grammar.VBAParser+LiteralExpressionContext]' to type 'Rubbe
 
RELOAD!
[Hosch250/Rubberduck] 71 commits. 41729 additions. 49053 deletions.
 
40 minutes to complete inspections
 
[retailcoder/Rubberduck] 41 commits. 28087 additions. 25847 deletions.
[rubberduck-vba/Rubberduck] 73 commits. 9 opened issues. 2 closed issues. 26 issue comments. 42237 additions. 49566 deletions.
 
@ThunderFrame Holy smokes.
 
Huh. VBA passes missing optional parameters as VT_ERROR. I would have expected VT_EMPTY.
 
12:54 AM
UI should be completely de-coupled from the Business Logic, correct?
 
1:06 AM
@IvenBach correct
That way you can test the logic without dealing with the UI
 
And Business Logic is the data that is used? Be it Database, CSV, or whatever form of file?
I'm just a bit fuzzy still on the Business Logic part.
 
The business logic is what ties everything together :-)
 
IAssert is missing a GUID.
 
data <=> BL <=> UI
@Comintern tools > generate GUID
 
Oh, that's the easy part. I was considering creating a "guid-space" for RD.
 
1:15 AM
@Mat'sMug So data=*CSV, Database, external files etc...*, BL=*VBA code*, and UI=*the spreadsheet*.
 
@IvenBach depends. I'd see the spreadsheet as the data... Or as the UI, depending on what I'm doing
 
Ideally there shouldn't be any dependency on the data and UI, but rather abstraction? 'Depend on abstraction rather than concrete' is my poor paraphrasing.
 
@Comintern now that definitely would warrant a version jump
@IvenBach exactly
bbiab
 
I understand that in theory but I'm trying to translate that to actually doing that and that's where I'm having difficulty.
 
Yeah may be better to hold off - I'd need to test it with the installer.
 
1:29 AM
Home time. I'll get my XAML mess up on CR to ask for some help with a project. Thanks for the help again.
 
@IvenBach in practice it's accomplished with UI design patterns - I suppose you're familiar with Smart UI, where the UI runs the show. With WinForms (and VBA/UserForms) you want to look into Model-View-Presenter (MVP); while that also works with WPF, XAML bindings facilitate the Model-View-ViewModel (MVVM) pattern.
On the web you'll need a slightly different twist to MVP - Model-View-Controller (MVC) works wonders
 
@Mat'sMug I've heard those terms before but I don't have an understanding of them.
It's something that I'm trying to read and try myself to better understand it.
 
2:34 AM
@IvenBach patterns are just names we put on concepts; they're only a mean of communication, so other programmers can follow along. they're all pretty simple, really.
- "Smart UI" is ideal for prototyping; you get something that looks like it works. It does everything it needs to do, but it's not written to be maintained - it's written to get it done "fast". If you don't need to care for maintainability because you're just whipping up a mock-up to show some clients tomorrow at 10AM, you're not going to care much about the bugs & other issues, because by lunchtime that code is scrapped.
the problems begin when the bosses pressure to release a patched-up prototype.
In a Smart UI the View is responsible for everything: data access is written in button click handlers, intertwined with the business logic.
 
2:52 AM
@Mat'sMug I don't get the meaning of that. The general idea, yes, but not much else. It's going to take me a little bit of messing with examples before it clicks. I hope at least.
 
3:05 AM
@IvenBach it's quick-and-dirty code; if you need a "save" button, you'll be handling it all in SaveButton_Click() - prompting for a path/filename, writing to the file/database, etc.
 
[retailcoder/Rubberduck] retailcoder pushed 25 commits to rd-next (only showing some of them below)
 
3:29 AM
Sup, @BZngr?
OK, so the _ErrObject defines .Raise like this:
[id(0x6002000a), helpcontext(0x000f79a7)]
HRESULT Raise(
                [in] long Number,
                [in, optional] VARIANT* Source,
                [in, optional] VARIANT* Description,
                [in, optional] VARIANT* HelpFile,
                [in, optional] VARIANT* HelpContext);
Everything except Number is passed ByRef (WTF?), so that means when RD calls it out of context (i.e. via a static method in AssertHandler) it throws an access violation because the parameters are going out of scope.
Would it be evil to do something like this?
        private static object _source;
        private static object _description;
        private static object _helpfile;
        private static object _helpcontext;

        public static void RaiseVbaError(int number, object source, object description, object helpfile, object helpcontext)
        {
            var errObject = (_ErrObject)rtcErrObj();
            _source = source;
            _description = description;
            _helpfile = helpfile;
            _helpcontext = helpcontext;
 
@Comintern Sup
 
Just repeatedly crashing Excel. Same ol' same ol'.
 
3:44 AM
Really...mine seems fine lately thanks to you.
 
Oh, I'm reaching around blindly in vbe7.dll and yanking on wires right now.
 
@IvenBach You aren't allowed to ask about non-written code.
We can review the UI, as long as it works, but we can't help you with anything else.
 
@Comintern then it goes with the territory I suppose.
 
@IvenBach your code isn't ready to be peer reviewed - you haven't implemented it yet
 
3:46 AM
@Hosch250 That belongs on SO then?
 
Well, not really.
 
I'd recommend you take down the question before the community does ;-)
 
Apparently raising VBA errors is not trivial.
 
SO's principle is that you tried and failed.
 
@Comintern It is if you write VBA code the way I do.
 
3:48 AM
Oh, trust me. It's easier to raise a VBA error with VBA code than with C# code.
 
fair enough
 
@Comintern says otherwise ;-)
 
lol
 
@IvenBach I can walk you through MVVM sometime.
 
Methinks it wants an IntPtr to a VARIANT struct.
 
3:49 AM
But for now, here is a quick, simple example: View, Code Behind, and ViewModel
The Model is just the supporting types.
 
I have the idea in my head but no knowledge of how to articulate it into code.
 
Reading through that code might help.
 
@Hosch250 Do I copy that code into VS to see it?
 
Of course, you have to set the View's DataContext to the VM for it to get connected.
@IvenBach Well, there's nothing stopping you from cloning the repo (follow the instructions here: github.com/Hosch250/Checkers).
But, you can just read the code on GitHub too.
 
@IvenBach in MVVM the View is coupled with a ViewModel that knows nothing about a View.
and then the Model knows nothing about a View or a ViewModel.
in MVP the View knows about a Model, and the Presenter knows about both the View and the Model; again the Model knows nothing of either of the other two, and the View knows nothing of a Presenter.
 
3:54 AM
Wow, Marshal.GetNativeVariantForObject is also non-trivial. WTH is the C# equivalent to malloc?
 
3
A: How to implement malloc operation in C#

LegionairIs there any reason why you need unmanaged memory for your application? Otherwise the normal way to do it would be ThreadID = new float*[Nthreads]; That will allocate a new Array for you. If you use this kind of statement in a function that is called a lot, you might want to add the stackalloc...

 
Yes, there is a reason why I need unmanaged memory for my application.
 
@Mat'sMug I'm grateful for all the information. I just don't understand the terminology for it to be useful. I'll keep reading for now.
 
sorry for the OCD-induced triple ping
 
Perfect. I'm going to give that a shot.
I think I'll just grab a handful in the static ctor and hand onto it.
I'm guessing there's a corresponding function to release it, but meh.
 
3:58 AM
of course MSDN says nothing of it
 
It'll release when the AppDomain dies. IIR there isn't a way to specify a static dtor.
 
4:17 AM
> 6800 commits
^ current [next]
 
I'd better quick do 200 more.
Didn't get around to programming more today, but maybe I'll tackle Move Closer tomorrow.
Get rid of that nasty double-parse in there.
 
ah, so that's why that test is stuck
    [TestMethod]
    [Ignore] // bug: test doesn't run to completion, it's stuck in a loop somwehre
    public void MoveCloserToUsageRefactoring_FieldInOtherClass()
 
Why did I join the RD team instead of the CardShifter team?
Most of the programming jobs in MN are web-dev positions.
I'd have experience with Java, Groovy, and a bunch of JS frameworks employers want.
 
I wish I had more than 3 weeks worth, or so, of ASP.NET experience.
If I had 3 years of ASP.NET (optionally MVC), React.js, and SQL down, I'd be getting a lot more hits.
Or if I hadn't gotten Meadow, I wouldn't have to live at home with her, and I could go anywhere in the country I wanted.
We spayed her recently to prevent pyometra (sp?), which is basically a bacterial infection of the uterus, and she was traumatized pretty badly. She gets a fever if I just leave the house for a couple hours :/
I need to at least be with her once a day, and most apartments and rentals don't allow dogs, much less German Shepherds.
TCF bank entry-level job:
> As a .Net Developer at TCF you will be a top level technical expert in one or more highly specialized phases of applications engineering.
Ouch.
Maybe I don't want the TCF bank job. Who knows what their systems look like?
 
4:58 AM
@IvenBach
"Good comments say why, not what" - this is why. https://twitter.com/rvagg/status/842928726597812224
</mug>
 
@Hosch250 you gotta start somewhere ;-)
 
I'm going to apply tomorrow. That was a joke.
BTW, the IEEE has the best articles.
https://t.co/N9XwlBtpDl
 
 
5 hours later…
10:15 AM
> A declare statement such as:

```vb
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
```

Has exactly 1 parameter, and triggers the "Comment uses obsolete 'Rem' marker" inspection.

It doesn't seem to matter if the `Declare` is a `Sub` of a `Function`, or if it is `PtrSafe`. The inspection still triggers if there are line continuations:

```vb
Private Declare Function QueryPerformanceFrequency Lib "kernel32" _
(lpFrequency As Cur
 
@Mat'sMug A test for your TSR code... The following produces 2 inspections for use of Global access modifier.
Global foo As String, bar As Long
if your TSR fixes the first instance, what does it do with the second.
or does it do both in a single strike?
 
 
2 hours later…
1:37 PM
> The original aggregated results knew about all the individual results. The problem is that this didn't contribute to reduce overhead at all.. So we removed individual results from aggregates - an aggregate result doesn't know about any "child" results.

What's a good way to do this?
> Seems every parse tree inspection is producing crap, because they're getting the parse tree results and not filtering properly.
> Seems every parse tree inspection is producing crap, because they're getting the parse tree results and not filtering properly.
 
@Duga correct diagnosis, wrong patient lol
 
2:11 PM
Having these issues with a green build means only one thing: we need more tests
 
> Learning a lot about things that VBA lets you get away with (e.g. no type specified in parameter list). I'm hoping this solution is general enough to cover all the bases...though not all that elegant.
[rubberduck-vba/Rubberduck] build for commit 117e74ef on unknown branch: AppVeyor build succeeded
 
2:45 PM
> Note that the similar problem exist in Access, where by default adding a control to form is given the same name as the backing field. This has the effect of shadowing the Access.AccessField with the Access.Control; an inspection should recommend renaming control so they are distinct. If there are other cases like that, it might be more desirable to make this inspection more generic and extensible so that it can be easily set up to check for different collections that may contain the confl
 
OK, so in my quest to figure out a calling convention for ErrObject.Raise, I decided to build a PIA for VBE7.dll and ran across this:
Assuming that we can get an instance of VBEGlobal, is grabbing references to loaded UserForms useful in any way?
 
When I initiate a parse from Excel, I am consistently getting the following Assert: secure215.inmotionhosting.com:2083/cpsess0985144203/viewer/…
Anyone else?
 
@BZngr The image link is asking for credentials.
 
3:01 PM
ugh - thought I had a solution for sharing images.
 
Do you use Dropbox?
 
nope...
Let me work on getting something here.
 
:thumbsup:
 
Woohoo!!
 
That's on every parse?
 
I am unable to complete the initial parse. The assert is as far as I get.
 
Hmmm... where does it take you when you hit Retry?
 
3:27 PM
I'll check. In debug, I get the following: dropbox.com/s/nqwbcaps3hwhcan/RDAssertDebug_03182017.png?dl=0
 
Crap. I need to get a PR finished - that's coming from a code path that I don't have synched into my fork.
Weird that the debugger isn't taking you to the Assert site though. I'm not sure I've had that happen before.
 
OK. If I hit Retry, I'm asked to open a debugger. If I pass on that option, Excel closes.
 
Try running it in debug mode.
Whatever is asserting is obviously testing some sort of "this has to be true or Excel will implode" assumption.
 
Ah - that explains why it breaks to that line - it's asserting from inside an anonymous function.
 
Here's what I get if I connect to the debugger after hitting 'Retry': dropbox.com/s/igzzoqbulm7zrmn/RetryToDebug03182017.png?dl=0
 
What file is that in?
Oh, duh.... Look up @Comintern.
 
DeclarationExtensions.cs
 
That's newer than my branch - was that part of the inspection refactor that @Mat'sMug PR'd?
 
4:02 PM
I can't say...
 
Oh - you should be able to check the commit history in VS. Right-click on the file in the Solution Explorer and "View History..."
It brings up this window:
Then you can right-click on each line and do all kinds of fun stuff.
 
Looks like it. Last commit was 3/10 by @Mat'sMug (f881cb9e).
 
That might be related to how we're dealing with undeclared variables, but I'd need to pull next to check. I should get my local cleaned up and WIP a PR for Fakes.
 
> why did the encapsulation of individual results not help us? If we can reintroduce these results (which shouldn't actually be a problem, since we do keep them all in memory at one point anyways) then fixing this is significantly easier...

I'm guessing the eager initialization of QuickFix instances for all our child results made keeping the individual results not provide sufficient memory-saving... could we work around that? Would it be feasible to have a single QuickFix for each Inspection
> why did the encapsulation of individual results not help us? If we can reintroduce these results (which shouldn't actually be a problem, since we do keep them all in memory at one point anyways) then fixing this is significantly easier...

I'm guessing the eager initialization of QuickFix instances for all our child results made keeping the individual results not provide sufficient memory-saving... could we work around that? Would it be feasible to have a single QuickFix for each Inspection
> @Vogel612 - I'm thinking that the quick-fixes helped, but not nearly enough. I still lean in the direction of trying to fix this at the UI level - the InspectionResultsControl is still rendering the entire grid so that it can size the scroll-bar. Whatever direction displaying aggregates goes, at some point we need to figure out how to address that.
 
4:41 PM
Huh. We might be able to use VBA's own casting functions in PermissiveAssertClass. I.e. call rtcVarDateFromVar to cast to a Date.
 
5:31 PM
Anyone know if there is a simple-ish way to determine the beginning of an expression?
Private bar As Boolean
Private Sub Foo(ByRef bat As Boolean)
    bat = bar
End Sub
Move Closer is currently inserting the new declaration right before bar.
It needs to insert it before that expression.
Before, I just kept looking for an instruction separator or a new line without a line continuator.
 
@Hosch250 Would recursively calling .Parent until it wasn't an expression context work?
 
@Comintern I'm going to try going back until the parent is a BlockStmtContext.
 
Yeah, that might be safer. Expression pops up in some weird places in the grammar.
 
5:55 PM
[Hosch250/Rubberduck] Hosch250 pushed commit d8cd8500 to Issue2884: Fix Move Closer
[Hosch250/Rubberduck] Hosch250 pushed commit 0495620e to Issue2884: Merge branch 'Issue2884' of github.com/Hosch250/Rubberduck.git
 
Fixed it. And no reparse.
 
Merge pull request #2896 from Hosch250/Issue2884

Rewrite Encapsulate Field
[rubberduck-vba/Rubberduck] build for commit 3573df7d on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
Ah, the quick fix...
 
[Hosch250/Rubberduck] Hosch250 pushed commit 90a0ae8c to Issue2884: Fix the quick fix test
[rubberduck-vba/Rubberduck] build for commit 90a0ae8c on unknown branch: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] Hosch250 pushed commit d8cd8500 to next: Fix Move Closer
[rubberduck-vba/Rubberduck] build for commit b4565e4c on next: AppVeyor build succeeded
 
6:30 PM
[Hosch250/Rubberduck] Hosch250 pushed commit 3174f110 to Issue2884: Make Implement Interface use the rewriter
Merge pull request #2901 from Hosch250/Issue2884

Fix Move Closer
> Is there a way to tell it to only load the first N items? If we do that, then we can load more when the user hits the last loaded item, or we can have a "load more" button.
[rubberduck-vba/Rubberduck] build for commit 3174f110 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
#WorksOnMyMachine
Oh wait, no, those are the Extract tests.
 
[rubberduck-vba/Rubberduck] build for commit b17f7b18 on unknown branch: AppVeyor build failed
BUILD FAILURE!
[Hosch250/Rubberduck] Hosch250 pushed commit 2c0135d2 to Issue2884: Fix Extract Interface tests
 
@Duga Yeah, I made Implement Interface put the stuff at the bottom of the module instead of the top.
 
[rubberduck-vba/Rubberduck] build for commit 8045aee9 on unknown branch: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 3174f110 to next: Make Implement Interface use the rewriter
 
Lunch time. Maybe I'll tackle the other three later.
 
6:42 PM
[rubberduck-vba/Rubberduck] build for commit d23fe3bc on next: AppVeyor build succeeded
 
I'm going to upper-case all of the parameter names on RD's public unit testing interfaces. Adding the reference forces all the Value uses in the project to lower case in some cases.
 
7:34 PM
Shoot. I just realized that the resume I submitted to my last few job applications had the wrong phone number :/
MUAHAHAHAHA!
US Bank lists Java as JAVA!
 
 
2 hours later…
9:59 PM
@Comintern seems reachable via VBA
Sub test()
  Dim vbg As VBEGlobal
  Set vbg = VBA.Global
  Debug.Print vbg.UserForms.Count
End Sub
 
Isn't that just the same thing as Debug.Print UserForms.Count in VBA though? I'd bet we could get on in C# by just calling GetObject or something like that.
Not sure how useful it would be though - it only holds instances of forms that are currently running.
 
10:14 PM
Would GetObject be C#'s way of detecting object or returning a pointer where the object is in memory? @Comintern
 
@PeterMTaylor - Yep. It would pretty much be the exact same thing as calling GetObject from VBA. The VBA implementation is just a thin wrapper around the Windows API function.
Hmmm... should I cut down on my use of Value as a property?
var underTest = usage.Value.Value is ComVariant ? ((ComVariant)(usage.Value.Value)).Value : usage.Value.Value;
 
10:37 PM
@Comintern follow MS convention and make alternate use of Value, Default and Item. Sometimes make it a property, other times make it a method? ;-)
 
LOL
 
> Just thinking here, is what @Hosch250 is saying in comparison to SQL Select distinct (count(inspection)>1) from InitialRun.Parser ? And optionally load more if required?
> I agree that it would be nice to be able to load only the first N inspection results and then to have a button to load more results. Something like this is actually a quite common feature in mobile applications and should be intuitive to the user. Moreover, limiting the number of loaded results should avoid having memory problems again.
> What about a treeview approach? Expanding an aggregated node returns the individual inspections?
 
@Mat'sMug I'm glad I don't have any of that...
 
11:40 PM
> Leading and Consecutive semi-colons are redundant.

RD should identify these leading and/or consecutive usages, for more readable code.

The extreme example:
```vb
Debug.Print ; "Foo" ; ; ; ; ; ; ; ; ; ; ; ; ; "Bar"; ; ; ; ; ; ; ; ; ; ; ; ;
```

Can be rewritten as:
```vb
Debug.Print "Foo"; "Bar";
```
> ref #2863, #2891

Consider this WIP. There are a couple of features that still aren't implemented, and it's only lightly tested at this point. That said, it would be nice to get it merged in that there are quite a few changed files and the merge commit is already promising to be unpleasant. If push comes to shove, it can easily be "switched off" by making the relevant members `ComVisible(false)`.
[rubberduck-vba/Rubberduck] build for commit 6479899a on unknown branch: AppVeyor was unable to build non-mergeable pull request
BUILD FAILURE!
> It makes absolutely zero sense to concatenate an empty string with any other string or expression.

```vb
Dim msg As String
msg = "" & vbCrLf & vbNullString & "Foo"
msg = "" + 6
```

Can be rewritten as:
```vb
Dim msg As String
msg = vbCrLf & "Foo"
msg = 6 'Yes, implicit cast, but that's another inspection
```
 
@Hosch250 you there?
 
Yeah.
Not sure I'll be much use--got a nasty headache.
 
I'm reading through examples of accessing a CSV file but I'm not internalizing or understanding the info.
 
I've never worked with CSV data.
XML and JSON, sure, but not CSV.
 
[rubberduck-vba/Rubberduck] build for commit 53f65a22 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
I don't think you want to write a CSV parser. Use one of the available libraries.
Writing a reliable parser for any type of data is usually quite difficult.
You have to deal with all sorts of data corruption, etc.
 
I'm not trying to write one, just trying to understand them.
112
Q: How to read a CSV file into a .NET Datatable

Ronnie OverbyHow can I load a CSV file into a System.Data.DataTable, creating the datatable based on the CSV file? Does the regular ADO.net functionality allow this?

I'm trying to use the code, but without knowing how/why it works I'm not making any progress.
 

« first day (1016 days earlier)      last day (2164 days later) »