« first day (1928 days earlier)      last day (63 days later) » 

12:01 AM
RELOAD!
[rubberduck-vba/Rubberduck] 18 commits. 1 opened issue. 4 closed issues. 4 issue comments. 10787 additions. 2348 deletions.
[Minesweeper] Games Played: 67, Bombs Used: 46, Moves Performed: 9061, New Users: 6
 
12:58 AM
 
 
6 hours later…
7:16 AM
^ the shift of IT talent
 
7:43 AM
> **Rubberduck version information**

Version 2.4.1.4940
OS: Microsoft Windows NT 10.0.18362.0, x64
Host Product: Microsoft Office x64
Host Version: 16.0.12026.20108
Host Executable: WINWORD.EXE

**Description**

I'm getting the following inspection result, but the variable highlighted when I double click the inpsection report is not that referred to by the inspection report

Error: In a context that requires a value type, the expression 'Split(p.Value, mySeparator)' of object type
 
 
4 hours later…
@Duga Either the reported expression or the reported type seem to be off.
 
12:36 PM
Split returns a Variant, no?
 
It might be that the reported context is wrong.
I need to do some tests tonight when I am back at home.
The natural candidate for the error is p.Value.
I guess, p is of the type Kvp from the referenced c# library.
 
Actually that didn't make sense to me because it's that's not a C# type.
it seems to come from VBAExtensions.Kvp
 
However, I would like to double check that the reported selections, contexts and types are collected correctly.
 
Never mind. I'm blind. It has VBAExtensions.tlb before.
 
The thing is, that type makes no sense for the reported expression.
 
12:49 PM
It might be a good idea to ask for the interface definition.
 
> @SteveLaycock is it possible to share the interface definition for the Kvp? Knowing how the dispatch IDs are arranged may help clarify the issue.
 
1:06 PM
> No problem. I've attached the source code file. Please be aware that I am not a professional programmer have only previously coded in VBA (apart from some 6502 assembly and a small amount of ANSI C back in the 1980's doing image processing stuff for my PhD). This was my first foray into c# and it did take a few months googling and trial and error to get to the current state. I'm currently working up courage to put it up on code review for comment.


[Kvp.zip](https://github.com/rubberdu
 
@Duga there are no DispIds defined so there should be no default member for that class.
 
@this groan...
 
2:08 PM
Why does Excel (in both 2016 and 365) refuse to show me the DATEDIF() function when I type =DAT in a cell? It shows me DATE and DATEVALUE, and that's it.
#BecauseMicrosoft <-- self-answer, upvote, accept
according to their documentation, it's been around a while (like since 2010)
It's almost like they want you to do (StartDate - EndDate) / 365 to get the elapsed years...
 
2:30 PM
@PeterMTaylor I find it strange that so many people don’t continue learning once they start working. Should be expected and not the outlier.
 
2:40 PM
@FreeMan there are a few undocumented functions. my working hypothesis is that they're undocumented because they're broken in one way or another
 
DATEDIFF isn't documented?
huh, it's DATEDIF, not DATEDIFF?
 
#ProTip: Don't rely on Excel to do dates for you.
 
3:17 PM
> I've tried to had Option Explicit but i get an error everytime
...
#ThatsByDesign
 
@MathieuGuindon Yeah, what @this said (and I pointed out in my initial question...:)
it's documented, it's just that Excel doesn't give it to you as an option in IntellinotsoSensical
 
3:34 PM
 
@MathieuGuindon I have several beefs with that article:
> If your spreadsheet experiences began with Lotus, which is true for many thousands of users
Not any more - they're all dead!
 
> As serial numbers, which is Microsoft Excel’s unique method of storing dates so you can use them in calculations
No, that's not unique to Excel. Didn't it actually start with 1-2-3?
 
I am wondering if DATEDIFF works, too
 
3:43 PM
lol, date math is by design
 
> add half a month or half a year to the formula like this: =DATEDIF(A19,B19+15,”m”) for half a month (or 15 days)...
 
nope, doesn't look like
 
Don't tell people to add 15 to a date to add 1/2 a month!!!! (there are functions for that!)
 
note to self: read the article before dropping it here
 
> You can also nest the DATEDIF() function ... =DATEDIF(A23,B23,”y”) &” years, “&DATEDIF(A23,B23,”ym”) &” months, “ &DATEDIF(A23,B23,”md”) &” days”
 
3:44 PM
I think you're better off writing your VBA wrapper functions.
 
That's not NESTING, that's CONCATENATING
@MathieuGuindon LOL
 
why deal with 2 quirky implementations?
 
> If you want to find out exactly how old Whoopi Goldberg is today
No, nobody cares
> or find a packrat friend who still has the Microsoft Excel 2000 reference manual
haz a sad over missing manuals...
 
what do you mean? Google is your documentation!
 
@FreeMan that one is particularly sad tbh
 
3:46 PM
@MathieuGuindon the sad part is that is what "journalism" has become.
 
I have to ask, though - what exactly is a half a month for a 31 days month?
do you say it's 15.5 days?
or do you make it 15 or 16 days?
 
@this (365.25/12)/2 ish
 
that comes to ~ 15.22 days
 
exactly! ish
 
which still is kind of a crappy fraction to deal.
Not all businesses treat days as a fractional number
and even if they do, sometime they only measure in halves
Hours would be a much better UOM
 
3:49 PM
a lot of hourly employees get paid to the nearest 10th of an hour...
so you may have worked 15.6 days.
 
but that's based on your hourly timesheet.
 
0
Q: Saving Charts with Multiple Series in Excel and PowerPoint

aLearningLadyContext I'm trying to create a multi-series chart/infograph to display total number of sales for the day as compared to the average. The chart consists of three series: Series 1: The base bar graph showing the number of each item sold Series 2: A scatterplot to overlay the icons for each item ...

 
that would be... takes off shoe... 40... takes off other shoe 44.8 hours...
 
should we tell 'em the chart is probably better off with only the first series anyway?
no scale, rounded-corner bars, ... Jon Peltier would like that one
Use proper indentation, please. This bites my eyes. You can automate your indention using RubberDuck VBA. — Patrick Honorez 13 mins ago
lol
 End If
  End If
 'Next c
 Next r
 End Sub
 
@this Why would you expect the type to have a default member?
In the expressions, there is only a member access on it.
 
3:55 PM
I didn't say I expected it to have one? I said there were no since there were no DispId defined for that class (rather its inteface)?
 
it makes that much less that's unknown in the OP's code
 
Maybe that'll clarify- before I asked for the interface definition - I had wondered that if there was a recursive default member that might cause it to be implicit (e.g. p.Value.Value) or something like that. But now we can see that this can't be the case since there should be no default member access for this particular class.
 
4:18 PM
I'm just wondering - why isn't the resolver using the ITypeComp for binding?
 
4:36 PM
In VBA the first argument to the split function must be a string. My original post does state that p.vakue is a string.
 
4:55 PM
@this hm, because we haven't had ITypeInfo for user code until... last month?
(right?)
 
@MathieuGuindon last year rather but yeah, resolver was before that time
so that's a good reason. I guess the question ought to be -- ought we be using it now that we have type info for everything?
one sucky aspect, though, is that for user code type infos, it's one threaded and on UI thread, too
so no parallelizing nor background threading
but that shouldn't be a restriction for the non-user-code type infos, though.
However, it says the ITypeComp exists to provide a fast access for that data. If it is in fact fast, it might help cut down on the resolution time, and could be at least batched
 
Hi, @user12074868.
 
5:49 PM
@ticker looks like it's "concatenate all the SQL parameters" day
 
Totally random question. Why do we have usings outside the namespace? I've always seen it outside but I noticed that there are times where they put it inside the namespace.
 
it's a style thing, and personally it makes me twitch. move them to the top of the file if/when you see them inside a namespace.
:)
 
yeah, I figured that much. Still, it makes me wonder - I always presumed the using directives were file-scoped. I don't know for sure but also presume that that is still true even inside a namespace --- unless the file had more than one namespace (in which the file is FUBAR)
 
6:06 PM
2018
A: Should 'using' directives be inside or outside the namespace?

CharlieThere is actually a (subtle) difference between the two. Imagine you have the following code in File1.cs: // File1.cs using System; namespace Outer.Inner { class Foo { static void Bar() { double d = Math.PI; } } } Now imagine that someone adds an...

 
@this IIRC, it's mostly useful for inside if you don't want to leave the scope.
Outside, they go to file scope. Inside, it's namespace scope.
Should only be useful for generated code, really.
 
and bad code with ambiguous names
 
That's just evil on multiple levels.
 
lol
yeah I know. we established that in this question's accepted answer five years ago. — Mark Cidade Feb 10 '14 at 21:58
 
@MathieuGuindon That's why SO drives me nuts.
They need to make it so answers can be locked as "having an authoritative answer."
Perma-locked, not just 10-rep locked.
If it changes, they can have a flag to request unlocking.
 
6:15 PM
@MathieuGuindon "Wall of 'Using'" is acceptable, but "Wall of `Dim'" is not. makes a note
only sorta joking
 
@FreeMan yes
 
Ugh.
 
@this How exactly would we use ITypeComp?
 
QA is throwing everything at me because I'm leaving...
Even though I have something I'm trying to finish before I leave...
 
@FreeMan well, sorta... If it's a big wall, it's probably telling you you have too many namespaces. I tend to prefer having folders go "deeper" than namespaces...
 
6:23 PM
@Hosch250 talk to your boss, let them prioritize your work for the time that's left
2
i.e. pit QA against your boss :)
 
Good idea.
 
After all, prioritizing your work is your boss's job.
 
Technically, it's really not that big of a deal, but it's "hotfix" stuff in an area I work on normally.
And I was in the middle of the other thing.
 
@M.Doerner well, the binding would point to another ITypeInfo representing that thing being bound. Therefore, if a declaration was mapped to a given ITypeInfo, then we would be able to bind a name expression to one such declaration.
 
So it's not just "leave it in my queue for later" like I have been.
 
6:26 PM
The thing is, we only map to Declaration.
And we do the mapping and binding on multiple threads concurrently.
 
but the resolving of a name is in the resolving declaration phase which currently takes quite a while, no?
 
that part is where we traverse the parse trees and create the Declaration objects
 
Resolving declarations is reasonably fast.
Resolving references takes far longer.
 
? am I conflating phases again....
probably that's the one I'm conflating
the references does involve binding, though no?
 
In that step, we resolve tons of expressions.
 
6:29 PM
we have lot of simple name expressions (and then some)
which we need to bind to some declaration... right?
 
I wonder if we could parallelize that even further?
 
We have a lot of member access and index expressions as well.
 
Maybe make one pass to find various scopes, and kick off child threads to handle each sub-scope?
 
for non-user-code that can be parallelized/put it in background
 
Like, one task per Sub?
 
6:30 PM
for user-code, it must be on UI thread, unfortunately.
 
Resolving references from the parse tree?
 
However, if the binding provided by ITypeComp turns out to be much faster, it might be worth considering.
 
It's already off the UI thread...
 
Yes, because it doesn't have to be.
 
That's what I'm saying. That's one of the slow parts.
 
6:31 PM
@this huh, but we don't traverse parse trees for non-user code... we don't have such parse trees to traverse in the first place
 
Could we parallelize that even further?
 
That's the downside of the typelib API - you can't do it off the UI thread.
 
He wants to use ITypeComp with the user typeliobs for binding instead.
 
Ohh.
NVM me then.
 
Also, that is only worth doing if there is actually significant speed boost.
 
6:32 PM
seems it would be useful if we didn't have everything built around Declaration
 
(and presumes that we can actually use that for resolving the references)
 
@MathieuGuindon I think this means to resolve member accesses to non-user types.
 
no, that would work for both, I think.
 
so, kind of replaces parts of the DeclarationFinder then, IIUC
 
6:33 PM
hmm. I am not sure. I'm only thinking about the binding process itself
 
I really think, the lookups in the declaration finder are not that slow.
The main problem is that we have to do tons of lookups.
 
Right now, resolver has lot of binding logic. If ITypeComp::Bind did the same work for much less, then it's easier for us to convert a ITypeInfo reference into a declaration reference.
That's what I'm thinking. But I might be off.
 
Currently, binding is basically a few lookups in the declaration finder for most things.
 
ah I see. Makes things complicated because we definitely don't want to tote along the ITypeInfos, esp. not outside the UI thread.
 
Most of the binding logic is figuring which kind of access we are actually looking at.
I doubt the ITypeComp can tell us whether an index expression is an array access, a function access or a default member access.
 
6:36 PM
IOW implementing VBA's semantics - something we won't get to skip with ITypeComp either
 
Currently, we try in a sensible order based on the expression classification of the binding of the lExpression.
We might be able to use it for the member access bindings and simple nema bindings, but we need those as intermediate steps in the remaining resolution.
 
basically, ITypeComp is something we could be using if we were the VBE
(with the full picture, not just the bits leaking out)
 
The other question is whether it might help as a fallback for ambiguous implicit binding - it has a section in remarks about appobject.
@MathieuGuindon I do recall Wayne saying that this exists primarily for the compiler's benefit and we really don't compile, so....
Just thought would check if this is something to think about.
 
The restriction to use the UI thread really defeats it.
 
7:00 PM
> It takes a bit of prep to make an iPad dog safe and vice versa; but after a heavy duty screen protector and a rugged case our dog has his own iPad.
Wat...
 
must be one smart dog!
 
Apparently he likes "Games for Dogs" and jumps up and down on it to make the animated dog squeak.
 
next: flappy dog
 
I assume the next thing they'll train the dog is how to use google to search for other dogs
 
Or Tindog. swipes left.
 
7:11 PM
If Me.Status.Value = "Ordered" Then
Me.Status.Enabled = False
Else: Me.Status.Enabled = True
End If
whimpers
 
@Freeflow Can you tell us how p is declared? I am currently completely unable to reproduce the issue.
 
@this but... but.
why??
 
why not, I guess? Not my code. Cleaned up but....
 
7:38 PM
> I put a breakpoint. Still not working.
sigh
 
7:57 PM
On Error Resume Next -->> "I don't receive any error messages" — Tim Williams 2 mins ago
2
LOL
 
I was mildly concerned that there were no candidates yet.
Then I saw this:
> nomination period began 5 mins ago
 
8:21 PM
I was pulling appointments and stuffing them into the patient table but it wasn't working. Weird...
 
> @SteveLaycock Two questions:

1. You wrote that when double-clicking something else than the reported expression is highlighted. Could you please tell us what is selected when you double-click. That might help us find the issue.
2. Could you also tell us how exactly `p` is declared. That might also help.

So far, I have not been able to reproduce this issue ar any discrepancy between the selection and expression.

Final stupid question, just in case: you have not defined a public funct
 
4
Q: Announcing a Pro Tempore Moderator election

JNatSummary: Open Source Stack Exchange will begin the nomination stage for a special election on September 16 to bring in one more moderator. For full details of the process, see the announcement on Meta Stack Exchange. The timeline: Starting on September 16, users can nominate themselves. Users ...

Dannngg.
4 votes and no other participation.
60 more rep on the site and I could run.
 
8:38 PM
@this I needed that today.
 
> A program is free software if it gives users adequately all of these freedoms. Otherwise, it is nonfree. While we can distinguish various nonfree distribution schemes in terms of how far they fall short of being free, we consider them all equally unethical.
Does that mean it's unethical for a high-rise builder to charge their clients for building buildings?
 
no. That's not what the free means
not free as in beer, but free as in open to modification by the user / consumer
 
Oh.
What about company-internal software?
 
in what way does that apply here?
 
@Hosch250 aw, I'm missing 101 :)
 
8:46 PM
It doesn't qualify as free software because it's not available to anyone.
I mean, if I put the effort in, I could easily shut down the entire enterprise employee incentives business with OSS software.
They all do the same thing.
The main difference between two companies is the customer support around it.
And how much they cut their prices.
 
@Hosch250 that's true for a lot of software...
@Hosch250 why do you think large swathes of enterprise software are generated?
 
They are?
I thought most of it was COBOL and VB6...
It's really mostly the tech industry that uses generated software, isn't it?
Like, companies that sell ERP software.
 
depends on how strict you want to see generated...
because Car software is largely assembled from components
and aircraft software is partially generated since a few years
 
True.
 
My understanding always has been that you are free to _not_distribute the software
therefore, if you modify software for internal use, you can do whatever you want and not distribute it all.
 
8:53 PM
@this Yes, you are. But the FSF doesn't like people who do that.
 
and software for controlling rail switches in the german rail network is generated
 
It's when you actually do distribute it in some form, then you might be required to preserve the same freedoms for those consuming the software.
 
pretty sure that what @this says is what the fsf wants to say.
 
I'm just a bit curious as to where the line falls. I know it's different for everyone, but if all software was free, and businesses only made money off support, I'm not sure that's sustainable.
 
leaving aside for a bit the fact that rms is a jackass.
 
8:54 PM
@Hosch250 kind of amusing to imagine Richard busting in my room just because I wrote a hack on their GPL software for my own use.
was that a freudian there....
 
    The freedom to run the program as you wish, for any purpose (freedom 0).
    The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.
    The freedom to redistribute copies so you can help your neighbor (freedom 2).
    The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.
 
note that the language there is "freedom"
 
You are free to not distribute it, but it makes it more than clear they really really want you to distribute it.
 
sure, that's the whole premise behind FOSS
but you are not obliged to do so
so my filthy hack on a GPL software needs not be shared.
and rms can't barge in with a warrant for my ass for not sharing.
 
Which, TBF, is why there are lots of licenses.
I understand GPL--especially for projects like RD where people could easily make a living off it.
But again, I understand view-only ones, where people share it mostly for security purposes, but want to keep a monopoly on the sale of it.
Or whatever people share it for.
Personally, I like Apache 2.0 for side projects, and if I ever decided to make the effort to sell it, I'd just take the project off GitHub and add the killer features before I tried.
 
9:00 PM
@Hosch250 isn't that more of a Microsoft-only thing?
TBH I don't know of any other companies that has view-only license.
 
@this Mostly what I've seen, yes.
And, TBF, it was basically a transition step between full OSS for most of their systems too.
 
something feels off with this. anyone here sees a way to rephrase it better?
            var response = _request.RequestItems(args);
            var content = response.GetContent();
            var items = content.Items;

            var cursor = response.GetNextPageCursor();
            do
            {
                if (!string.IsNullOrEmpty(cursor))
                {
                    _logger.Trace($"Response header yielded a page cursor. Requesting next page.");
                    response = _request.RequestItems(cursor, args);
                    content = response.GetContent();
 
@Vogel612 for my edification - why would they want to generate software for those type of applications?
 
@this allows proving safety and security properties
 
I had a nicely working paginated requests setup, and now Shopify is pulling the rug from under my feet by removing the "page" argument from the GET url, and adding "next" and "previous" page "cursors" in the response headers... and gosh, what a mess.
 
9:05 PM
@MathieuGuindon sorry I'm distracted by SaveEntities - why are we apparently reading then saving?
 
mostly by proving those properties on a model and then proving the generator does not compromise them
 
@this I'm pulling data from a REST API and dumping the records into a database
please ignore the non-async nature of it all, the requests need to run in a specific order
 
@Vogel612 Hmm interesting. I don't exactly get how that helps proving safety/security but I'll take the word for it.
 
(rather, the records need to land in the db in a specific order)
 
@MathieuGuindon seems to me you need to split this into 2 parts
one to fetch, one to update
 
9:07 PM
@this proofs over code are ... complex and really annoying
 
oh wait, so you're talking about a bunch of CS & mathematicians writing proofs for specific applications?
 
yeap
 
Since we're on this topic anyway, you guys might be interested in F*.
 
hmm and how do they know that the model is correct? That's the hardest thing about the math - you can make proof of anything in abstract but it doesn't mean it correspond to the physical reality?
 
It's basically a "proof" language built in F# and another language.
You write the proof, and it generates the output.
I learned about it from the Roslyn team, and they use it some for language implementation.
> After verification, F* programs can be extracted to efficient OCaml, F#, C, WASM, or ASM code. This enables verifying the functional correctness and security of realistic applications. The main ongoing use case of F* is building a verified, drop-in replacement for the whole HTTPS stack in Project Everest. This includes verified implementations of TLS 1.2 and 1.3 and of the underlying cryptographic primitives.
> F* is written entirely in F*, and bootstraps in OCaml and F#.
OK, I had that slightly wrong.
 
9:11 PM
@MathieuGuindon also, in that case, that implies you need to orchestrate the read and the update, so possibly a 3rd entity, so that the reader can hide the silly pagniation while providing a faithful representation of the records accessed in same order, simplifying hte update.... hopefully.
 
@Hosch250 proof generation languages are generally not turing complete, btw
 
Do they need to be?
 
they need to be not turing complete to allow proving the proof generation terminates
 
I mean, a ditch digger isn't a waiter.
I mean, being non-Turing complete isn't an issue as long as they get the job done.
 
@this yeah... I'm hitting essentially every endpoint there. I'm not worried about that part for now - but something itches about the duplication of string.IsNullOrEmpty checks... eh, I'll just ...let it be and move on... tomorrow.
for now.. TTGH and write some actual fun code =)
2
 
9:21 PM
isn't do { if <condition> { ... } } while <condition> basically same as do until <condition> { ... }
but I don't blame you - API are #NotSoFun
drive safe!
 
@this gah! #ImAnIdiot!!
 
22 mins ago, by this
@MathieuGuindon sorry I'm distracted by SaveEntities - why are we apparently reading then saving?
If I got distracted, it's no wonder. :) You can blame Shopify, not yourself for making you code weirdly.
 
9:42 PM
> Your stupid question is entirely correct in its surmise. I am stupid, I will go and stand in the corner with my pointy hat on for the rest of the evening. The code in question should of course read VBA.Split... Which of course raises the follow on inspection thought that VBA has missed this duplication of names so maybe its a job for rubberduck?

BUT what would be causing a similar error in the following case

```
'@TestMethod("HelperForStrings")
Private Sub T2A_Stringify_object()
> FWIW we do have shadowed inspection. I think that should have been caught.
 
anyone else noticing that inspection list seems to take a while to load?
 
@this could you retry?
seems like it needed to refresh the cache?
 
it's fast
that part is a bit fuzzy, though - it refresh on the first visit?
which would kind of suck
 
@Vogel612 found a regex Crossword if you feel up to a mental challenge to pass some time :). regexcrossword.com
 
oh cool, another thing to procrastinate on cramming with :)
 
10:15 PM
> OK, this is a legitimate bug. The resolver does not correctly handle param arrays, atm.
 
@Duga Fix on its way.
 
@PeterMTaylor This would help me remember regex a lot more.
 
@M.Doerner where did you determine he was using params? I don't see it in the attached zip nor in the report?
 
right now, it looks like it isn't responding.
if it instantly loaded a "refreshing list" page, then it wouldn't be as bad UX as it is
 
10:30 PM
loaded (with a delay) here
 
in my case, it took 2? 3? minutes?
 
(mobile)
Huh wtf
 
yeah, that's why I asked. after I visited it for nth time, it is fast
but the first time, it just basically spinning for lllloooonnnngggg
 
@this The function Array takes a param array.
 
oooh. I thought it was in reference to his shadowing Split
(which is a separate issue anyway)
 
10:33 PM
No, to the second example.
 
Right, I see now.
 
@this nah, I was in a "while" mindset, and should have thought "until". Shopify's move was under the belt, but that was entirely on me =)
@this eventually I'll figure out some AJAX and load the page before I get the inspections
 
I usually find that AJAX works the best when you take a bit of water and some sponge to it.
2
 
11:00 PM
OK, that problem is a bit more involved.
The fix will have to wait until tomorrow.
The problem is not with param arrays, but with the com collector.
It gives arrays the wrong AsTypeName.
More precisely, I forgot to align it to the consistent convention.
 
> I have to correct myself, the problem is not strictly with param arrays but with the type names provided for arrays by the part of RD that loads libraries. It adds parentheses to the type name ,if the type is an array. This interferes with the check for the parameter type Variant for param arrays.
 
11:16 PM
@Duga ...that's another Mat-ism bug isn't it?
 
No, that is me not considering the COM collector when adjusting the user code function types for array returning functions.
For user variables, we never had the parentheses.
That was inconsistent and the parentheses were in the way when checking the element type.
 
I do recall you asking me about these parens semi-recently though ;-)
(might have been elsewhere though)
 

« first day (1928 days earlier)      last day (63 days later) »