« first day (999 days earlier)      last day (1502 days later) » 

8:00 PM
Each test needs to test an isolated instance.
public class RenameTests
Am I missing the static there somewhere?
the mock vbe (and its state) in the base class would be shared by all test methods
And what happens when one test deletes a component, and the next one tries to access it?
shit hits the fan
8:01 PM
There is an extremely good reason that tests are single isolated blocks.
We'd need to setup/teardown anyway.
Need some TestRunner classes then.
So, I'm willing to go that route, if we can get it set up so we can add the code in the test...
But really, I think it would be much better to just refine the builder.
8:05 PM
@Hosch250 the builder API is really not too far from where it needs to be for that, I think
Something more like this:
var tester = new RenameTestRunner();
var actual = tester.Test(code, selection);
Assert.AreEqual(actual, expected);
var builder = new MockVbeBuilder();
IVBComponent component;
var vbe = builder.BuildFromSingleStandardModule(inputCode, out component, selection);
var project = vbe.Object.VBProjects[0];
var module = project.VBComponents[0].CodeModule;
var mockHost = new Mock<IHostApplication>();
MockVBE.CreateModule(moduleName, code, selection)
I can definitely make it do that.
Heck, I could even make it add out parameters for the project and vbe itself.
Yeah. Needs to be flexible enough to allow adding classes, modules, forms,..
8:07 PM
If we go to C# 7, we could just pass wildcards to those instead of needing overloads.
And then the tests themselves need to assert the parse trees instead of the text output
I'm green-lighting C# 6 after .12 is released
That will be much harder.
@Mat'sMug If you wait until March 7, we can do C# 7 :)
We could even just target C# 7 in the test project.
not yet
8:09 PM
Not critical, but it would be fun.
OK, I'll just do a few overloads.
6 will be a major improvement. I see 7 as experimental for now
@Hosch250 or ASTs
Meh, 7 will be worth it just for the out parameter features.
8:11 PM
On a slightly different note, I think we should start to actually write unit tests and not scenario tests. There are quite a number of tests that test simple functionallity of a class by running code through the parser instead of building the necessary declarations by hand and only testing the class under test.
@M.Doerner Actually, those are blackbox tests.
Don't delete the blackbox tests, but go ahead and write new whitebox tests.
The indenter definitely needs to swing that direction- it already has way too many bizarre configurations to account for.
That'll speed things up quite a bit, too
Yeah, whitebox tests are much better as a general rule.
And a code re-writer will have too many bizarre corner cases to cover with blackboxing.
8:13 PM
My Checkers library uses whitebox tests primarily, but has a set of blackbox tests too.
for https://github.com/rubberduck-vba/Rubberduck/wiki/Unit-Testing#example would it be better to separate `Dim sut As New NumKeyValidator` to be `Dim sut As NumKeyValidator
Set sut = new NumKeyValidator'
I mean, there should always be some blackbox/scenario tests, but the majority should be whitebox/unit tests.
@IvenBach probably, yeah... lol that article probably predates the "self-assigned object variable" inspection
Better would be:
With New NumKeyValidator
    Dim i As Integer
    For i = 0 To 9
        Assert.IsTrue .IsValidKey(Asc(CStr(i)), Value), "Value '" & i & "' was not accepted."
End With
@M.Doerner yup. not sure how we can do that though. Could we inject a bunch of hand-crafted declarations into a mock parser state?
8:22 PM
I could mock up a resolver really quick. I could probably have it ready in time for RD 12.0
OK, hold off a sec.
Let's get what we have cleaned up before we jump into this.
I'll get to work on this sometime this/next week.
Or wait, when is 2.0.12 coming out?
I think we should do that after the release though
Any day now, I suppose.
8:26 PM
@Hosch250 rubberduckvba.wordpress.com
@Mat'sMug One could actually do that. Although, since the inspection now tend to use a DeclarationFinder one should probably mock that on the RubberduckParserstate and fill it with the desired declarations.
Not if, but when, I find edits like that there's no qualms about me making update?
The 4th? I'll be available more/less after the 6th.
Do we actually need the _undeclared collection on the DeclarationFinder for anything but collecting the undeclared variables while resolving? If not, I could stop rebuilding it after every refresh.
@M.Doerner I think not. Wait what is the undeclared variable inspection using if not that?
8:31 PM
I think the IsUndeclared flag.
I am using that to rebuilt the collection.
So yeah it wouldn't be used beyond the collecting of declarations then
Then I will just remove it. I anyway introduced a separate collections for the temporary jobs when I introduced the rebuilding of the '_undeclared` and _unresolved collections.
@IvenBach feel free to update the screenshots too :-)
I don't know how to do screenshots on GitHub.
Should Test Explorer>Add>Test Method add the code wherever the cursor is active or should it add it below the currently active method?
8:42 PM
Is there any reason in particular why all the dictionaries in the DeclarationFinder are concurrent? The only place where we are writing to them is in the constructor.
@Mat'sMug Can you even selectively run tests anymore?
I can't remember why "Selected Tests" was removed from the "Run" menu, but yeah it needs to come back
Q: Applying same formatting to multiple borders in Excel VBA?

SelracIs there a better way to format the cells with borders than what you get when you record a macro? For example, I want to add borders to a cell range. The recorded code is: Range("A1:C19").Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xl...

Q: Fixing Medical Claim Files

puzzlepiece87With thanks to @Mat'sMug and @Comintern for their encouragement, here is a program I wrote to help my team fix medical claim files. The goal of this program is to make the process of emergency changes to medical claim files as human-proof and rapid as possible, and deliver all the corrected file...

@Mat'sMug Me either. WT*
@Comintern I got PropertyBag working in VBA, and I could implement some of the VBRUN interfaces, but I couldn't get much further than that.
8:51 PM
I dont know if that's worth dedicated question, but the only trouble i had so far with RD is that in my office's desktop Excel sometimes "complains" that it is not the "default application" for Excel files or something like that. It's not a problem because everything still goes smoothly but is that something expected or should I worry about it? — A.S.H 2 mins ago
did that happen to anyone? I don't see how RD could affect it in any way
Nope, not RD.
@Mat'sMug Is there a conflict with another add-in?
Strange, after introducing selective resolving of references, it consistently takes twice as long to reparse when I did not change anything compared to when I changed something.
> Basically, with just these, you could conclude that MSVBVM60.dll IS NEEDED no matter what. All custom controls and Class Modules need the IClassModuleEvt and the HiddenInterface interfaces, all projects need the IProjectControl and IVbeRuntimeHost. All data-binding needs the data interfaces and classes, and all appications need the App class...
> Basically, you can't remove MSVBVM60.dll. You CAN remove stdole...but only if you don't need the StdPicture, StdFont, and IUnknown, which is never the case...IUnknown is needed for every program...
All long help threads should have a sticky globally-editable post at the top saying 'DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far ...'
8:55 PM
@ThunderFrame Hmmm... Maybe Marshal.GetIUnknownForObject and then cast?
Oh wait, that's the wrong way, isn't it.
XKCD strikes again!
@ThunderFrame The reason you can remove stdole is that it's forward declared in both msvbvm60 and vbe7.
9:16 PM
@Mat'sMug I've never seen that
9:27 PM
So is Planned for next release the .12 release or the next one after that? I'm confused because there's also a Planned column. Is Planned basically, "yeah, we'll get these, but haven't figured out when yet"?
> Whenever we create a class module the VBA compiler also creates a
default interface for that class. The default interface is given the same
name as the class and contains a list of all the public properties, methods,
and so on that we add to the class. When we dimension a variable using Dim
clsTheClass As CClassName, we’re saying that the variable uses the
interface CClassName. When we use code like Set clsTheClass = New
CClassName, we’re creating an object that is a new instance of the class
^^very readable description, thanks!
@FreeMan planned for next release would be .12, yes.
@Comintern Is that what HiddenInterface is doing?
planned is there because otherwise the backlog would be a bit unmanageable, so it serves as some kind of prioritization buffer
And of course, managing the projects and cards ...is a project in itself!
9:37 PM
@ThunderFrame I think it's baked in at a lower level that than that. As long as the interfaces are referenced in the type library and registered you can use them. All of the API calls into the library are just that - API calls. Since everything inherits from IUnknown, IDispatch those types will always get pulled in. stdole doesn't really define much that isn't going to forward declared from a bajillion different places.
@Mat'sMug thx
I wonder if some of the VBE messages are throwing PropertyBags around...
Q: Prevent saving for an opened CSV file?

LeifI'm interested in collecting rows from multiple CSV workbooks but a good deal of the data is not useful to me. I've got a roster of some several dozen people but the workbooks house all the data of some several hundred. The method I've used already is that the tool workbook will start by Defin...

@QuackExchange @Mat'sMug can you just move it for him?
...where to?
9:50 PM
of course, it'll get closed there because it doesn't have any code? SO
but at least at SO, he'll get prompted to post broken code so it can be fixed.
rule #1: don't. migrate. crap.
I thought rule #1 was The Doctor lies...
if it gets closed on the target site, migration gets rejected and the post bounces right back over here.
ok... never mind then, he'll probably duplicate his post there, then. :)
TTGH, I'm not going to get anything useful done in 8 minutes...
Is it just me, or do the accountants that are self-taught VBA programmers sometimes write better Excel code than the Enterpise programmers?
9:57 PM
@ThunderFrame Every now and then the blind pig finds a truffle.
I think it comes down to amateurs, including myself, know just enough to make it work and can't overthink or overdesign things.
FWIW, I taught myself VBA when I was working in a financial services job. Actually, the only language I have formal schooling in is VB.NET, which I never use...
my schooling predates .NET, so I did VB6 and some C++... although I don't recall any C++
...and I'm the only one here at work that doesn't use Java style closures in C#. :shudder:
A few friends tried to make fun of me when I was learning Excel. Now I'm hired because of it and they ask me questions regarding it...
Granted, I did write a bunch of TRS-DOS BASIC way back in the day...
10:01 PM
I had a .NET colleague boast about his VSTO add-in that ran in 5 minutes. A business colleague showed him the same outcome in VBA running in 0.025 seconds. VSTO was just as capable of those times, but because the dev didn't know about reading ranges as arrays (and wasn't familiar with the Excel Object Model), his code was orders of magnitude slower.
@ThunderFrame Well now you know!
Amazing how tweaking just a few small things does wonders
@ThunderFrame I bet it left the Excel process lingering in task manager, too
Unit Testing. Is there any convention about Assert.<Test>?
Working on RD now makes me sound like a know-it-all when I talk about the intricacies of line_continuators
10:03 PM
Assert.AreEqual varResult, varExpectedAnswer as opposed to Assert.AreEqual SomeFunctionCall(inp1, inp2, ..., inpN), varExpectedAnswer
HR wants to speak to me about my proselytizing on instruction separators being evil
"Well you, know, you could do this..." :gives @Comintern a wicked indenter issue:
@ThunderFrame excuse my ignorance but what's an instruction separator?
@IvenBach oh. I'd usually have some Dim expected As Whatever and a Dim actual As Whatever locals, and do Assert.AreEqual expected, actual instead of inlining the calls - that way makes it easier to debug
10:05 PM
@IvenBach Sub Foo(): Debug.Print "Foo": End Sub <--it's the colon.
Do :Loop
That's a Dont Do: Loop.
^That one will hang the App
@Comintern so ":" = Instruction separator and "_" is a line continuation
Sideways 8 loop?
10:06 PM
yep, unless they're inside square brackets, or double quotes.
Or a comment.
Hi guys, Thanks @Comintern for the invitation :)
Hey, @A.S.H
hi @A.S.H
Now you know where VBA devs go to die solve the world's problems
@ThunderFrame I'm just like @ThunderFrame's comment and Comintern's background, business guy who never had a programming class.
10:08 PM
Anytime someone posts in Stack Overflow or [cr] with the tag VBA that's when we get the RSS feed, correct?
@puzzlepiece87 I gave up the business guy part for the programmer part and went back to school.
Where I learned VB.NET.
@ThunderFrame lol, I have to say I somehow "knew" that :D
I took a week's course on Logo for C64 when I was 12. Otherwise self - experimented taught
Almost went back to business, found C#, and was like "Ahhhhh... much better."
@ThunderFrame I am actually also not a programmer by trade but an actuary.
10:11 PM
Interesting. I learned VBA when I was doing reinsurance billing.
I learned VBA when... Oh wait, I didn't.
Admit it. You could write VBA if you wanted to.
Yes, I could.
I got some VB.NET into the Roslyn repo.
Hell, you could probably answer VBA questions on SO.
Umm, perhaps.
10:14 PM
A lot of, "you need to exit the loop" or "you're missing an End If" or "you need a Nothing check".
With a search engine, for sure.
^ or RTFM.
Meh, I post those as a comment and VTC the question.
^ yep. Unless there's too much wrong to fit in a comment.
Those probably have genuine educational value.
What percent of the people who have too much wrong to fit in a comment actually read the answer?
And what percent of those actually understand the answer?
@Comintern You are in Nebraska? What's the outlook of programming jobs there? I want to get out of MN--I've seen too much of it.
The problem with being a smart genius is that you (at least, I) have tendencies to become a cynic extremely young.
10:17 PM
Not too bad, really. You don't want to live in Nebraska though...
Why not?
It's kind of backward. I'm originally from MN.
Too conservative for you, or something?
I love the country, and I'm leaving MN because of the liberals.
That's only part of it. There really isn't a lot to do here.
Don't need a lot. Give me a computer and a bike and my two legs, and I can amuse myself all day.
10:19 PM
The rural areas are worse - it's too developed agriculturally. Everything is in crop production.
Like southern MN and Iowa.
Yeah, I was thinking Utah or Montana, maybe.
Yeah. I think of country as more like central - northern MN.
Yeah, I've been up there. Real pretty.
Move to California, where I live, it's not like there's anything liberal around here...
> Code explorer hangs before any of the tests output a result (see that duration is 0ms for each test).


What other info could I provide to help debug this?
10:21 PM
I want a change of scenery from swamps and forests, though.
I was thinking Oklahoma or Texas too.
My family has a friend in Oklahoma, maybe I could get something with his connections.
The Michigan Upper Peninsula would probably meet the conservative\pretty standard fairly well.
Oklahoma is like living in a Steinbeck novel without the exciting moving west part.
Oh, I can put up with liberals, really, and conservative extremists are just as annoying.
Most of it is I want a change of scenery.
Oh hai @A.S.H!! Welcome to our little corner of SE!
Hi @Mat'sMug, thanks a lot!
10:24 PM
@Hosch250 Upstate NY - Rochester, Syracuse, that area.
I'll consider it.
bring a gun
Hi, @A.S.H. Looking to contribute to RD, or just report bugs?
@Mat'sMug Why?
I lived about 60 miles south of Syracuse for 3 years growing up. Bring a gun.
10:25 PM
Bears, or outlaws?
Otherwise it's like showing up without pants.
Well, I'd rather not have to use a gun, but I'm certainly not afraid of them.
I'll remember your advice.
"I had this dream last night when I showed up at work and all I was wearing were my clothes!" "Ooooooo".
So, are they gun-extremists, or escaped crooks?
Neither really. More of a culture thing. That's probably changed since I lived there though.
10:28 PM
Oh, I see.
Well, I'd rather have that culture than one like inner-city Chicago/Detroit/Minneapolis.
@Comintern I'm sticking with the business part for as long as I can because I have a passion for problem-solving and business strategy - automation will eat a lot of business jobs before I retire, so programming is something I do to make sure I have a viable career in 15 years.
@Hosch250 Hi. I wasn't considering it, but, well, if I can be helpful that will be a pleasure. Still too early though but will be involved within time :)
If you like copy/pasta and drudge work, you can help clean up the existing tests once I get a better framework setup.
A lot of pineapples can't figure out that lots of stuff that can be automated should be.
10:30 PM
@IvenBach Of course, by the time they figure that out they probably won't need amateur programmers like you and I either: arstechnica.com/information-technology/2016/08/…
The Congressional Budget Office (US) recently exceeded industry estimates for automation. The old best-cited estimate was 40% of jobs by 2050, now it's 47% by 2040.
It will be a very tricky transition for the US. EU countries are pretty well-prepared. They basically already have UBI.
I don't think the US will have a problem, except with employment issues.
@Hosch250 if you choose Texas. Bring lots of guns.
LOL. You guys are reminding me of an article I read once: the guy lived in the country, everybody knew each other, and everybody knew everybody else had a gun; no crime. Moved to inner-city, couldn't find someone with a gun for love or money; crime every day.
Trying to write a cover letter to a recruiter for a defense company I almost landed an internship with last summer.
Who knows, I could end up working in the UK or Australia (well, probably not, since all the jobs seem to require citizenship).
@Comintern is the Com part of your nickname related to "com"?
@A.S.H I think it is related to COM Interop stuff, not .com.
10:42 PM
@Hosch250 That's more the "everybody knew each other" than the "everybody else had a gun".
@Comintern Yup.
yeah i mean DCOM of MS
@A.S.H No, that's just a coincidence. Comintern as in the international communist conspiracy. It was my MUD handle back in the 90s.
It stuck because it's usually available. :-)
that's should be the feeling of many members I think... because you're COM expert and the first thing I thought about when I read your posts was
must be some member of the COM team or so
It would actually be really funny if I interned somewhere in a COM field.
10:48 PM
@Hosch250 UBI = Universal Basic Income
I hate performance testing. I have been wondering why the initial parse takes 10s longer after introducing selective resolving of references. In the end, its just that my computer is slow today, Switching to another branch without the changes gave the same runtime.
Are you running a profiler, or just using the timestamps?
It was just the timestamps.
@Hosch250 And yes, I think employment issues will be THE problem. I'm of the belief that of those 47% of jobs, some will reappear in new ways but many will not. The US has poor safety nets, so we'll see the poverty rate grow until we accept that not everyone needs to be employed.
10:50 PM
I should start using a profiler.
@M.Doerner Did you ever get a community R# subscription? The profiler in there is decent.
Based on Test Driven Design (TDD) do you write how the result will be tested or do you build and write tests as you buld?
Percentage of time in procedure and call counts are much more relevant.
@puzzlepiece87 And Microsoft Rubberduck VBA for Office™ will be used for the other 53% of tasks
10:51 PM
@puzzlepiece87 Meh, I think European countries will have a lot of failing businesses.
They won't be able to afford to go full automatic and pay their unneeded employees.
@ThunderFrame Ha, I think once we start automating everything people will start using better tools :P
@puzzlepiece87 Maybe it will be Uber Rubberduck VBA for Tesla Office™
@ThunderFrame Uber's on deathwatch, otherwise your statement could be correct lol.
you're right.... Hosch Inc. VBA for Office
> I cleaned and rebuilt the Rubberduck solution from the latest repo just now.

I removed the offending Test module from my Access Project.

I re-started Rubberduck via the Debug AnyCPU in Visual Studio.

I opened the Access file and opened the VBE, and clicked the "Pending Button" but it got stuck at "Resolving Declarations" after beginning the Parse. It seems I am in deeper trouble now as the new build will not parse (and there are a muber of COM exceptions being thrown).

Here is the
10:55 PM
Google opened a very convincing lawsuit that Uber stole all their self-driving tech. Uber loses $2B a year currently, their venture capital was counting on them making self-driving taxis. Once they lose this lawsuit they'll be toast.
Coming back to my question from before, if nobody can tell me a good reason why the dictionaries on the DeclarationFinder should be concurrent, I will convert them to ordinary dictionaries for performance's sake.
We only write to them in the constructor.
A Google engineer spoke with Uber leadership, downloaded all of Google's tech to disk, resigned, founded a self-driving company, and Uber bought them 6 months later for $700M
^ Standard Google Model
OK, WTF. Why am I getting the throws for if (!_listening)` in SubClassProc?
@ThunderFrame Ha, except Google does it the legal way, by buying the entire company rather than by paying an employee to steal trade secrets
10:58 PM
@puzzlepiece87 I meant tech/people leaving Google
@ThunderFrame Oh agreed, though using the ideas is fine and I don't have a problem with it. It's when you walk out with everything on disk and a pre-arrangement to get bought out that the problem starts :P
Every big company leaves some opportunities open due to their own prioritization. If people see a niche to capitalize, go for it.
@puzzlepiece87 disks???? Sync with BitBucket/GitHub is so much easier.
@ThunderFrame Right? :P
Why didn't he use a floppy disk? Not like that tech is going to be obsolete.
@ThunderFrame The one I'm most curious about is the NSA contractor who took like 18 highly-classified TB home.
@IvenBach Maybe Google wouldn't spring for the drives :P
11:04 PM
I'm guessing Google would fail to see the irony of uploading the source of Google Drive to Google-Drive
If only anonymous free accounts had more than 15 GB
@ThunderFrame, Thanks for helping me with my earlier coding issues, we got it resolved successfully.
np - How's the performance?
I think we got it done in 20 min
(Which to me is not bad at all for a 1 GB file)
1.5M rows and 162 columns
hmm, that seems pretty slow
This answer was reading and processing a file (including searching for duplicates) at about 6.5MB/s. For a 1TB file, that would equate to about 150 seconds.
If you're just splitting up a file, you should be able to get performance (Depending on your hardware) at 45MB/s or more. 45MB/s would equate to a 22 second run time.
Are you sure your system can load a 40 GigaByte file in 1 second? A really fast SSD can theoretically read up to 2500MB/s, but reading 40GB in 1 second would be 16 times faster than that. Do you perhaps mean a 40MB file? — ThunderFrame Sep 14 '16 at 8:11
11:20 PM
Thanks, I will give that a look and try to improve the performance!
@Hosch250 If you're serious about Australia - skilled workers in certain professions can get Visas border.gov.au/Trav/Work/Work/…
> This PR introduces selective resolving of references (by module). More precisely, only references of modules referencing a module that gets parsed are resolved. To achieve this, I had to pull the store the unresolved declarations outside of the DeclarationFinder; they now live on the ModuleStates in a new collection separate from the real declarations. This has the added benefit that the DeclaratioFinder seen by the inspections now really see the undeclared declarations in the...
[rubberduck-vba/Rubberduck] build for commit 2971896d on unknown branch: AppVeyor build succeeded
@Duga yay!
> Create an FAQ from the links referenced in #2762.
These questions arise frequently and the info is all available, but doesn't seem to be quite visible enough. Then make it "big & visible".

- [ ] Create FAQ in the Wiki
- [ ] Add section in the ReadMe that links to it.
- [ ] Add link to it in the website?
- [ ] Add it to the about dialog?
@puzzlepiece87 About 90% of their jobs require security clearance.
Their stuff is so secret their workers can't even bring their phones into certain rooms when they work.
Given what I know about phones, why am I not surprised?
11:36 PM
Does this pattern leak objects? new Task(() => DispatchSelectedProjectNodeDeclaration(_vbe.SelectedVBComponent)).Start();
Well, in a way.
The objects will exist at least until they are garbage collected when the task is garbage collected.
Task is IDisposable, but keeping a reference around to dispose it defeats the purpose.
You usually don't dispose tasks.
These methods will get a ton of throughput, but they block on the main VBE thread.
If you haven't read that you, you should.
11:39 PM
Reading it now - I should be fine, I just need to keep the Window message pump from blocking. The Declaration lookups are just too expensive.
Wow, that is indescribably better.
@Comintern what is?
The status bar updates. Switching to native event handling completely killed the responsiveness.
It was blocking on the VBE's UI thread.
@Comintern IKR - I could hardly tab between codepanes
In my next PR.
"Deleted code is debugged code." - Jeff Sickel
11:50 PM
Comintern's corollary - "Commented out code is code waiting to be debugged."
Actual code is code with undiscovered bugs :D
it's the same as CodeWisdom's tweet actually, I didn't get it fast enough!
:deletes _DockableWindowHost.cs: <--debugged.
Testing an idea now.

« first day (999 days earlier)      last day (1502 days later) »