« first day (1021 days earlier)      last day (2159 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
RELOAD!
[rubberduck-vba/Rubberduck] 3 opened issues. 40 issue comments.
[rubberduck-vba/RubberduckWeb] 6 issue comments.
 
@Hosch250 did you see this?
 
Nice.
I would have made about that much at the BAE internship that I almost got
That was just an 11 week internship, too.
 
Wow. What's up with the VB6 devs wanting more money?
2
 
@Mat'sMug Is removing a parameter declaration supposed to remove the comma too, if relevant?
 
Yes. Otherwise it breaks the code...
 
12:06 AM
Thought so.
@Mat'sMug That needs to be adjusted for US.
DevOps made on average $60k, but in the US, they averaged $100k.
 
@Hosch250 it is adjusted currencies
All the details are in the methodology section at the bottom
 
@Mat'sMug Yeah, using the conversion rate.
But most US jobs pay higher, even considering the currency conversion rate, than in foreign nations.
 
Wow, TFS is a lot lower than I would have thought.
 
That's part of why it is so cheap to outsource stuff overseas.
Well, I'll need to wait to finish moving the remove over. I've got a headache again, and I'm having trouble understanding what is going on in the rewriter as a result.
 
12:12 AM
$33K USD for entry-level seems fairly reasonable. With CAD exchange rate that's about $56K CAD, which is higher than CAD market
 
@Mat'sMug What's the use of being a dev? I can make 60k as a firewatch at the refinery just during turnarounds. No degree required.
:(
Whatever. I'll see what happens.
 
@Mat'sMug Most stuff around here is around $40K entry level, higher in some technologies.
 
Keyword entry-level ;-)
 
You mean, if someone picked me up drunk in the gutter I could make that much?
 
12:15 AM
I've also yet to crash a computer as hard as I could crash a refinery.
2
 
That makes more sense.
@Comintern Betcha I could crash one of those iPhones (or was it Galaxy's?) at least as hard. The ones with the faulty batteries, you know.
 
I don't know, same type of crash, much lower order of magnitude.
 
It would still be useless and toxic at the end of the day.
 
Hmmm... is the order that RD runs unit tests in deterministic?
 
12:21 AM
@Comintern IIRC, it groups them by module and runs them.
 
Probably not then.
 
So, yes, for a given set, it will run them in the same order every time, just because that's how the .NET framework members we use work.
On the other hand, I wouldn't recommend anyone or anything rely on them being run in that order.
 
I'm pretty sure they get passed through the concurrents that won't guarantee order.
 
Just means I need to comment out the passthrough tests.
 
12:23 AM
Too bad we can't run them concurrently
 
That would be an absolute sh!t show in the VBE.
 
LOL
> Rubberduck.Setup.2.0.13.0.exe (5.83 MiB) - Downloaded 310 times.
Last updated on 2017-03-12
> Total Downloads 10,472
 
12:47 AM
Think I'm going to reword Fail assertion failed....
 
Assert Failed Assert?
 
Assert Failure succeeded?
Expected: Failure. Actual: Success.
 
0
A: Is BoundValue a valid property for a MultiPage or TabStrip control?

ThunderFrameHuh, I assigned Me.MultiPage and Me.TabStrip1 to variables of type Control and inspected the BoundValue in the Locals window. The MultiPage BoundValue property returns the complete Pages collection, and the TabStrip BoundValue property returns the complete Tabs collection. For a MultiPage contro...

What bl00dy use is the Pages collection as the return type of BoundValue?
 
WTH?
 
That is what RD is constantly showing me.
 
1:01 AM
@ThunderFrame I guess it would help if RD status bar showed parameterized getters as such, would it not?
 
@IvenBach sure, Hungarian is an opinion, but "code is unreachable" and/or "code will throw runtime error" inspections aren't opinion so much as they are subtle LINQ bugs leading to False positives real problems that need to be addressed.
 
lol
 
@Mat'sMug How would RD display them? With an indexer? Item()
 
@Mat'sMug BoundValue returns a Variant, so it doesn't take an index.
 
@Comintern dunno. perhaps.. Althougj that might be confusing a bit.
 
1:03 AM
@ThunderFrame Try casting it to a DataBindings
 
@IvenBach RD (or ANY static code analysis tool) inspection results are just observations about your code. What you do with them is entirely up to you =)
 
It's making me see things I didn't see before and making me think more. That's a good thing!
 
@Comintern Just doing it in VBA for now... But it's a potential RTE - Looping over the controls on a form and reading the BoundValue property, requires an IsObject guard, or an error handler.
 
> Would the scope of Rubberduck's Fakes be limited to only VBA's own functions, or would it be able to fake any COM class?
 
This MVP seems to think Excel is compiling the VBA code, and that loading modules is a performance bottleneck
Best Practices for Organizing VBA Modules https://goo.gl/fb/qIpa4i
Left a comment, awaiting moderation
 
1:13 AM
> @robodude666 - It doesn't even need to be a COM class - it can literally be any dll. Would a framework for faking arbitrary Declare Functions be useful? That would be a ton of shoot yourself in the foot (or higher) potential. Or is giving the user a rope and saying "hang" yourself useful?
 
@Mat'sMug Huh? That makes no sense what-so-ever. The run-time has to load everything. Otherwise type resolution, identifier resolution, and about 50 other things would fall on their faces.
 
@Comintern not quite. A module that isn't in a
Ugh stupid phone
 
@Comintern but it doesn't have to compile everything
 
depends on the execution paths
 
if this is in module1:
Sub foo()
  Debug.Print "Foo"
End Sub

Sub dfgbvwr()

  awdsf qwerf qwer fvwe rgfvqe rgf

End Sub
then you can't run `foo until the module compiles...
 
1:17 AM
you can have missing references in a code path that is never called by production code, VBA will happily run it
 
but code in module2 (that doesn't refer to Module1), will run just fine. But if Module2 does refer to Module1, then Module1 must compile before a procedure in Module2 can run.
 
e.g. early bound RD tests
@ThunderFrame yeah that
 
Early bound does compile though. It just doesn't compile against the references - it compiles to "examine the IUnknown", get the address by name, invoke it.
 
Wow Nick Craver is pissed at GitHub right now lol
 
but, I think, if you've compiled your project, then all the executable code is in memory. It's only when you try to run a module that isn't compiled that VBE spends some time compiling.
 
1:21 AM
Ahhh... he's talking about Compile on Demand.
 
Make your entire project compile is more important than optimize your code for fast loading.
 
"optimizing modules for fast loading" is shorthand for "allow non-compiling modules to release"?
 
If your biggest performance bottleneck is module loading,.... nope, that just can't be.
 
If you notice compilation, something is horribly, horribly wrong.
 
1:25 AM
Telling you, people win MVP titles from cereal boxes
 
unless you're faking compilation, and Alt-D-L starts playing Hammertime
 
LOL
 
> Your comment is awaiting moderation.

The article seems to be (intentionally?) mixing up Excel (the host application) and the VBA runtime – Excel isn’t loading, compiling or executing anything, that’s VBA’s job.

Anyway I just wanted to chip in with an *actual* solution for organizing VBA code:

https://rubberduckvba.wordpress.com/2017/03/05/annotations-the-underducks/

Folders. The VBE’s Project Explorer forces all modules to be regrouped by type (document/worksheet code-behind, standard/procedural modules, class modules, user forms), regardless of their purpose. With Rubberduck’s Code E
 
Eh, he can think what he wants until I'm "the next poor soul to take over his bloated application".
 
I suspect he'll take my comment as spam
 
1:27 AM
@Mat'sMug IKR - I was going to just discover accessible control properties from an Office 2013 book, but I discovered the book is relying on Microsoft Documentation using a Ouija board to determine the members.
 
I'd say I trust MS Office books as far as I can throw them, but I've got a pretty good arm.
 
I'm officially saying this book is NOT good - amazon.com/Mastering-VBA-Microsoft-Office-2013/dp/1118695127
@Comintern The MS requirements, specification, implementation and documentation are usually mutually exclusive.
4
 
@Mat'sMug I must have bad luck since I go through lots of cereal...
 
1:45 AM
Hmmm... HTH do I fake CurDir? The runtime is apparently expecting it to return something or throw.
 
 
1 hour later…
2:51 AM
FML - Time to write my own marshaller...
5
 
ramdisk?
 
The .NET marshaller is getting in the way of some of these calls. I think vbe7.dll was written by a bunch of contractors or something. There are about 10 different calling conventions, and a bunch of them require passing around Variants as structs. The .NET marshaller is screwing them up and there isn't any good way to force it to return a Variant in a lot of cases.
The problem is that C# delegates have to be strongly typed.
 
Yes, that's exactly what I said earlier: use a For Each loop to iterate object collections. If you think about how arrays are represented in memory it's not surprising either that a For loop is faster for arrays. Object collections use a hidden [_NewEnum] property getter to yield the next object reference, they're literally optimized for For Each loops - it's much more work to retrieve an item by its index than using the enumerator. — Mat's Mug 14 secs ago
Looping 101
 
3:06 AM
[StructLayout(LayoutKind.Explicit)]
public struct Variant
{
    [FieldOffset(0)]
    public readonly ushort vt;
    [FieldOffset(2)]
    private readonly ushort wReserved1;
    [FieldOffset(4)]
    private readonly ushort wReserved2;
    [FieldOffset(6)]
    private readonly ushort wReserved3;
    [FieldOffset(8)]
    public readonly int data01;
    [FieldOffset(12)]
    public readonly int data02;
    [FieldOffset(12)]
    public readonly long data;
}
Supports 32 or 64 bit data pointers. The interesting thing is that MS seriously lucked out on that one. If it wasn't for double data types, they would have pretty much been f@cked when they had to port these to 64 bit.
 
[rubberduck-vba/Rubberduck] build for commit c49e48bd on next: AppVeyor build succeeded
 
They will be f@cked if\when there is 128-bit addressing.
 
lol
by then VBA will be fossilized...
 
@Mat'sMug I thought the problem was that VBA is fossilized.
 
Not the rest of COM. They only get 96-bit addressing with that struct.
 
3:11 AM
well they had to cut it off at one point
 
The odd thing is that they really should have put in 2 more reserved bytes. Lack of foresight. "Nobody will ever need more than 640k".
They'll probably do some hack and use the reserved bytes to page the address space or something like that.
 
I think I'll call it a day and try to get some pre-midnight sleep
 
^
I should motivate in that direction too.
@RonRosenfeld - Indexing into a SAFEARRAY is simply pointer math and memory dereferencing. Once you have the base address and the element size, it's as simple as calculating the offset. I have a VBA demo in this answer. — Comintern 18 secs ago
 
3:43 AM
Does Rubberduck have access to the Err object?
 
@robodude666 Err isn't an object, it's a function that returns an ErrObject
but, @Comintern has been trying to capture it. IDK if he's been 100% successful yet
 
Oh, I can get it really easily. I just can't Raise with it - it throws a managed error that gets wrapped when it isn't handled in managed code.
I'm going to try to hook the kernel debugger over the weekend... :-D
That reminds me. Need to free some HDD space for core dumps...
 
@Comintern COM is alive and well.
The entire UI system of Windows, even in the new Store apps, is built on COM.
If you try to access data owned by a UI thread in a worker thread in WPF, guess what exception is thrown?
 
Oh yeah. Massive re-write for 128 bit though. I'd imagine that they'll add new new VAR_TYPE for a long long ptr and dereference it twice.
 
LOL.
Look, that is dozens of years in the future.
At that point, they'll hopefully rewrite it to take advantage of the new processors.
The current processors only support 48 bits, or something--the other ones are just ignored.
 
3:52 AM
But I want 2^127 bytes of RAM.
16 exbibytes just doesn't cut it any more...
 
Shameless plug for my work:
You must use braces when you use multiple instructions. You should always use braces to help prevent bugs. Use my analyzer and code fix in VS 2017 to fix the ones without braces. — Hosch250 18 secs ago
@IvenBach That is looking pretty good, I wouldn't post any more revisions.
People will get sick of reviewing it.
Try something else. I wouldn't say to try something harder yet--you still need to get more experience at this level, I think.
Bull and Cows would be a good one, or something like that.
Or hangman.
 
@Hosch250 I'm just glad I'm understanding the simple fixes that people have helped me with so far.
I know I have a long ways to go but at least it's some progress.
 
You'll pick it up quick.
Just wait until you meet IoC and DI.
 
4:13 AM
I think I'm getting the idea if DI but IoC completely eludes my comprehension.
 
I used them both for a year now, and I'd just say that it is only within the past few months that I've really started appreciating them.
I've known about them for two years.
 
@Hosch250 Yet another reason you're underselling yourself. I know pro devs with 15 years experience that have never used DI.
 
IKR?
 
Most companies pay low dev salaries because most jnr devs are a cost for the first 6-12 months while they find their feet. Your experience on RD and VS is proof you can be productive from day 1.
 
I can sure believe that.
I fit better in a group of 30 yos. than 21 yos.
Most people don't apply themselves.
 
4:18 AM
except for the disposable income ;-)
 
That is where my learning ability comes from.
@ThunderFrame Yup.
I've applied myself as hard as I could since late middleschool, and it is just second-nature now.
 
@Hosch250 I try to but don't feel I get very far.
 
@IvenBach I have close to 8 years of experience with that. Don't worry about it if you are just starting.
And if you aren't, well, we all have limitations--mine are in the music and art department.
Just as long as you do your best, nobody can blame you.
 
DI in layman's terms, as I understand it, is feeding in an object rather than creating an object internally. That way you can fake what goes in for testing and see if the test works.
 
@IvenBach Pretty much the concept.
That isn't the only reason to do it, and really shouldn't be.
That is one of the best side-effects, though.
 
4:21 AM
What are some of the other reasons for it though?
 
Mark Seemann says that should be a secondary consideration. The primary reasons are because you decouple the dependencies.
As an example, you don't need to know or care if you are reading data from a text file, an RDB, an XML file, a JSON file, or from memory.
If an object can provide you with the information you need, it doesn't matter where it comes from.
 
Decouple means things aren't innately tied together, like a messy ball of yarn, but rather in a nice spool. Neat and tidy?
 
If you ever need to switch out implementations for a different purpose, DI makes that possible without even changing the code--just pass in a new one.
Kind of.
Basically, one object doesn't drag its buddies around.
Like, they say railroad cars are coupled together.
Decoupled classes are stand-alone. Just give them the data they need, and they don't care where it comes from, or whatever.
 
But don't they care about what type of data they get? Or is that the purpose of DI? Since behind the private curtain, internal to the class, you can change what's being done with it and nothing on the outside will know.
 
In this instance, they don't care.
Because all the data providers can implement the same interface.
So, it doesn't matter if you get an XmlReader, a DatabaseReader or a JsonReader because all it cares about is getting an IReader (assume the afore-mentioned classes all implement IReader).
 
4:28 AM
I guess I'll have to get more experience with it. In my VBA-landia I don't do much with inheritance or implements.
@Hosch250 It's something I have minimal use for right now and can't make the connection.
 
You'll have use for it plenty soon, but it will take significant work to get it.
 
5:03 AM
Thanks for the hand-holding, yet again. Refactoring some old examples to practice and get them up on CR for more help. Night.
 
Night, folks.
 
 
4 hours later…
Kaz
9:14 AM
Just a story of a large IT system:

They're a pretty big enterprise. Corporate users in the tens of thousands. Their password system isn't *supposed* to accept special characters in passwords. But does anyway. Sometimes. Until it doesn't.
 
> I'm using Excel 2010 and now read this:

https://support.office.com/en-us/article/After-installing-KB3178690-in-Excel-2010-calculation-may-result-in-a-hang-or-crash-14cd3b5c-aa2a-4fba-ba0a-414dedeb3ba0
 
Kaz
9:34 AM
My password has had a "!" in it since I created it months ago. And today, suddenly, it stopped letting you type those into the password box. For no specific reason the support team can determine. Other than "Sometimes it does that".
 
 
3 hours later…
12:24 PM
0
Q: compares and contrasts two seperate datasets in Excel VBA

plan303Good morning CodeReview community. Made the following code to take to 2 reports and compares them to show the end user elements which are missing from one of the reports so they can make the adjustments needed. This is the main part of the process where the data within the two reports are pro...

 
 
2 hours later…
1:58 PM
@Duga lol, seems we're not the only ones struggling with interacting with Microsoft's code base without sending everything up in flames
 
2:11 PM
greaaat... Are we back to the days of waiting 2 weeks to apply MS patches so they can fix the fixes? :)
 
2:31 PM
@FreeMan I know you are joking, but I'll mutter darkly that it's at least a month these days, if not more....
If I understand correctly, they have monthly patch Tuesdays now for Windows 10 and they've been occasionally cancelling those because, now that they're bundling patches, one broken change can impact the whole build.
They've been letting outstanding zero-days just sit around.
grumble grumble
@Mat'sMug @IvenBach On the topic of fun code comments/names, do either of you ever use Sub MakeThingsPretty()?
 
what does MakeThingsPretty do?
it makes things pretty, dummy mug
 
Different things for every project, but for this project:
Sub MakeThingsPretty(ByVal Sheet1Val As Worksheet)

    Sheet1Val.Columns(1).AutoFit
    Sheet1Val.Columns(2).AutoFit
    Sheet1Val.Columns(3).NumberFormat = "0"
    Sheet1Val.Columns(3).AutoFit
    Sheet1Val.Columns(4).AutoFit
    Sheet1Val.Columns(5).AutoFit
    Sheet1Val.Columns(6).AutoFit
    Sheet1Val.Columns(7).EntireColumn.ColumnWidth = 100
    Sheet1Val.Columns(8).EntireColumn.ColumnWidth = 100

End Sub
Unless I missed a joke, which is entirely possible
How did you fix that formatting? Select all the text and then do "Fixed Font"?
 
edit -> fixed font
just that
 
Cool, good to know
Still getting the hang of chat formatting
 
the problem with MakeThingsPretty is that it could be doing many unrelated things
 
2:45 PM
@Mat'sMug Ah, so professionally it would be better to rename it Sub AdjustColumnWidthAndFormat
Thanks for the feedback :)
I'm going to give you a little ribbing if you do end up putting Easter Eggs in RD lol
 
yeah... except "XandY" in a procedure name blatantly says "I'm doing many things that don't really belong together" ;-)
 
@puzzlepiece87 - Calling AutoFit on columns like that is asking for a horizontal scrollbar a mile wide. You should set a maximum width:
Dim col As Integer
For col = 1 To all.Columns.Count
    all.Columns(col).AutoFit
    If all.Columns(col).ColumnWidth > 110 Then
        all.Columns(col).ColumnWidth = 110
    End If
Next col
 
@Comintern Oh, that's why some are autofit and some are .columnwidth = 100
 
Just do it automatically. It's more reusable then.
 
@Comintern Only if you always want to .AutoFit every column according to those conditions, but I see what you're saying
I appreciate knowing how to do it right even if sometimes I will do it wrong, thanks.
 
2:48 PM
parameterize it with a MaxWidth then :)
 
@Mat'sMug Same for this, thanks for teaching me how to do it right even though I will probably do it wrong this time, I'm glad to know what the proper way is :)
@Mat'sMug Ha, good point, and it needs a MinWidth too :)
@Mat'sMug I'm scared to ask, but how many methods do you two find yourselves copying over from project to project?
I can't imagine re-using an AutoFit method being easier than just re-writing it as needed, but I'm still a babby.
 
I don't do enough VBA anymore to wonder... you don't have an add-in project for the "common stuff" yet?
 
I haven't found enough "common stuff" to make one, but maybe I'm not looking hard enough. The closest thing I've found to "common stuff" are the three programs I wrote for my team because everyone could benefit from the same methods for certain tasks.
What's your favorite example of common stuff you included in your add-in?
 
SQL/ADODB connectivity
 
Oh good point, I should do that
That's common for me
Thanks, that was a great example.
 
2:55 PM
I just reference my add-in and then I can do Set results = SqlCommand.Execute(conn, "SELECT * FROM dbo.Foobar WHERE abc = ?", 42)
and results contains an ADODB.Recordset object with my results
and the query is properly parameterized and all
although, I lost that add-in long ago, so when I need it I just import a bunch of classes from my VBTools repository and work with that
I'm slowly replacing all my recordset-dumping code with actual SSRS reports anyway
 
@puzzlepiece87 Close to 0 - that's what add-in are for. ;-)
 
3:28 PM
> RD 2.0.13 Excel2010 Win7

The title is a bit generic, but the situation is kinda complex: I have a macro enabled workbook template (.XLTM) that automatically saves itself with the proper naming convention in the proper location as a standard workbook (.XLSX). (Because my users can't figure out a simple naming convention, so I do it for them. :/ )

When I open the file to edit the VBA (`right-click|Open`), I can edit code & run through the macro. If I accidentally hit F5, the code runs to c
 
4:00 PM
@Mat'sMug Was just researching, this may be where we go in 5 years
 
The QueryClose handler should be Private, and CloseModeInfo has no business being Public either - as it stands the worksheet code is able to call frm.UserForm_QueryClose and do frm.CloseModeInfo = 42, which is far from sane. — Mat's Mug 38 secs ago
 
Seriously? MS abstracted way too much of UserForm away in VBA. Everyone seems to treat them like function calls.
 
IKR?
 
Just edited - downvote retracted.
 
4:17 PM
@FreeMan I have a feeling that isn't what the problem is.
The CE has no affect on the parse--it reads the results of the parse.
 
and caches things IIRC
 
No, it doesn't.
It completely reloads all the content on a successful declaration resolution.
 
hmm then what we're seeing is a reflection of the RPS' caching issues
 
What it does do is remember the path of the last selected item and re-select it afterward.
Probably.
 
4:31 PM
> I want this one to ship for next release.... badly. It's way overdue and plaguing way too much VBA code out there.
 
@Ralph huh, TIL - I always explicitly specify vbModal, assuming the default is modeless. Your comment is entirely correct then, and I learned something! — Mat's Mug 6 secs ago
hth did I come to think the default was modeless????
 
4:48 PM
@Comintern any thoughts on the pending PR? I'm not sure what to think of VariableRequiresSetAssignmentEvaluator
it feels like it's doing a lot of work, too
oh wow
Woo Hoo!! That works perfect! Thanks so much!! — ryguy72 11 mins ago
 
Gah, stupid git review thing doubled all the comments up...
 
5:48 PM
hey
@Comintern
just wanted to run something by you
im using mutex to make sure there is a single instance my winforms application so far so good
now im a little stuck i'd like to pass the args list from other instances before they get close to that single instance
 
@Jelly Isn't a mutex usually used for access, not to ensure singletons?
 
yes
 
If you are using DI, on the other hand, it is easy to enforce singletons--just create one and inject it everywhere.
 
di?
 
@Hosch250 that won't work across instances of the application
 
5:56 PM
True.
 
has anyone played around explorer context menu
?
 
But, if the user opens two instances, usually they want two separate instances.
@Jelly Explorer? I've done context menus in WPF, but that is probably irrelevant.
 
yup
i've added a contextmenu item to sldprt (solidworks part document file)
the problem these contextmenu do not support multiple file selection
 
00:00 - 18:0018:00 - 00:00

« first day (1021 days earlier)      last day (2159 days later) »