« first day (1921 days earlier)      last day (1259 days later) » 

12:01 AM
RELOAD!
[rubberduck-vba/Rubberduck] 1 closed issue. 2 issue comments.
[Minesweeper] Games Played: 74, Bombs Used: 44, Moves Performed: 10597, New Users: 13
 
12:11 AM
900+ stars achieved. Now towards the big 1,000.
 
12:24 AM
@IvenBach I couldn't fix that > thing for some reason.
Thanks for the feedback, though.
 
12:39 AM
Heap vs stack. Reading C# In Depth and I think I've understood it but want to make sure.
> a variable's value lives wherever it's declared, se if you have a class with an instance variable of type int, that variable's value for any given object will aways be where the rest of the data for the object is - on the heap. Only local variables (variables declared within methods) and method parameters live on the stack.
InspectionSettings has the field DataContext to which the view model is assigned.
The DataContext comes from from the inheritance hierarchy, ultimately from FrameworkElement.DataContext.
Because that is also a field as defined in the hierarchy it is located on the heap.
If there were a int FooBar field that too would also be on the heap? That's what I understand since it's needs to reside with the object itself.
In the case of a void DoSomething() method any variables declared within it (local variables) or those parameters passed to it would be on the stack?
My second question is on the page following.
> When a reference type is involved, either the variable is passed by reference or the value of the argument (the reference) is passed by value.
When the ref keyword is used it's the variable itself is passed by reference.
When not then the value of the argument, in this case a pointer-to-the-variable, is passed by value. Is my understanding correct?
 
1:04 AM
@MathieuGuindon So these are the #InsiderVideos you get access to as an MVP?
 
lol no, it was tweeted
=)
 
 
2 hours later…
3:32 AM
> attempting to learn about LINQ without understanding genetics and iterative would be tricky.
Which is exactly what I did... Too stubborn to let my own ignorance/stupidity stop me.
 
 
2 hours later…
6:15 AM
I know there are risks associated with auto-instantiation e.g. Dim htmlDocument As New Mshtml.HTMLDocument, but are these outlined anywhere please?
 
@IvenBach Local variables do not necessarily live on the stack. If you instantiate a reference type, the object will always live on the heap; only the pointer to it will live on the stack.
Second question, yes.
 
6:58 AM
@M.Doerner thank you
@M.Doerner So it doesn't really touch on the risks though I guess the pertinent bit is Each time the content of an automatic instantiation variable is accessed and the current data value of the variable is Nothing, a new instance (section 2.5) of the named class is created and stored in the variable and used as the accessed value.
 
 
4 hours later…
10:29 AM
It is basically the same as adding an If myVariable Is Nothing Then Set myVariable = New MyClass in front of every access.
This is rather inefficient.
Moreover, doing it with objects that need further initialization will postpone errors to later in the execution path.
If you do not use As New, the first member access will raise an error. However, if you do, your code will just run with the missing further initialization and most likely fail much later.
Obviously, you have the same problem if you set the variable to a new instance and then forget to do the further initialization.
However, since you actively set it, it is more likely to remember to do the full setup.
 
 
1 hour later…
11:41 AM
Well now...the language of cobol turns 60. “200 billion lines of COBOL code are still in use today and that 90% of Fortune 500 companies still having COBOL code keeping the lights on.” Source:zdnet.com/article/cobol-turns-60-why-it-will-outlive-us-all
 
 
2 hours later…
2:00 PM
@PeterMTaylor @PeterMTaylor i was just talking about this last week... old mainframes are the basis of the US banking system, and some european banking systems... supposedly you can't migrate a lot of the old data, so they're stuck in antiquity from the antiquity of persons in charge
i have a buddy who works for a canadian banking system (writes new applications to interface with the historic data), so he was explaining how dealing with the mainframe and the old COBOL systems are like 80% of his job
 
 
1 hour later…
3:04 PM
monking all
 
'morning!
 
3:27 PM
They are resurfacing the parkinglot at work this week.
Today and tomorrow, they are grinding the top layers off.
Thursday and Friday, they are paving it.
 
sounds like you're in for some rough parking.
 
Some people are working from home all week.
It's part of a complex of buildings (2 or 3).
So we can share parking with other buildings (they are only doing part of it at a time).
One of the buildings is between tenants, so that helps.
 
hm, @Duga is down
we got 2 new stars since the 900th
 
@MathieuGuindon I think you meant to say that @Duga is star-stricken.
 
Do I get some kind of prize for the 900th star?
 
3:42 PM
A privilege to buy a lottery ticket?
 
BTW, thanks for the 900th star!
 
@M.Doerner thanks for clarification.
 
4:01 PM
@MathieuGuindon ping Simon, or does he actually get Duga's pings, too?
 
he hasn't been here for too long, can't ping him. @Vogel612 can though, but power-ping is arguably mod-power abuse for this
 
But Duga & he isn't only in this room, either. I imagine he'd know via other rooms.
 
@FreeMan he logs on as @Duga during WinterBash to give her a hat... and that's the yearly reveal of the number of @Duga pings
@this true. the bot dumps SO comments mentioning to CR in The 2nd Monitor, and unless it changed it also dumps SO comments mentioning softwareengineering.se in The Whiteboard
 
"the yearly reveal" that sounds so dramatic and important!
 

 Duga's Neighborhood

It's a beautiful bot in the neighborhood. Would you be mine, w...
Duga's back up now, but was down for 8 hours.
 
4:13 PM
gal needs a good night of sleep once in a while, I suppose
 
I do, I'm sure she does....
 
 
5:01 PM
@Feeds similar to "never write code drunk".
 
@this how do you simulate windowing functions in Access?
AFAICT you're using DAvg and DCount functions outside the query. On SQL Server I would use a windowing function to calculate the average/rank by approver, and perhaps even pivot the result so that I have JW_DAYRNK, CD_DAYRNK, ..., JW_DAYQTY, ..., BE_DAYQTY columns in the recordset - i.e. let the query to the calculations, not external functions. Not sure how that would be done in Access /without windowing functions though - I guess it involves a number of sub-queries... obviously not optimal. If your backend is SQL Server, make a T-SQL view or stored procedure for it. — Mathieu Guindon 1 min ago
 
@PeterMTaylor COBOL Cowboy. YeeHaw!
 
5:18 PM
@MathieuGuindon not sure I see a need for windowing function there. That can be done with a simple WHERE... GROUP BY but maybe I'm not following.
 
hm, I think you're right
 
that's a common Access noob mistake -- writing one-trick pony queries never thinking in sets.
 
*SQL noob mistake
 
yeah, true.
 
5:32 PM
really Access, SELECT distinctrow????
 
DISTINCTROW is a Access specific extension
 
#LetsJustMessWithEveryoneThatKnowsSQL
 
and another common mistakes people make, choosing DISTINCTROW when they really need DISTINCT
 
If VBA is allowed, can't window functions be simulated with module-level variables, that hold aggregates for the length of the window?
And of course they have to be reset before each time the query is run,
 
Yes that's what I do for row numbering.
There are caveats, though
 
5:36 PM
I think I'd simulate them by traversing a sorted recordset once, and storing windowed sums/averages/ranks into dictionaries (keyed with the windowing partition)
 
There are at least 6 ways, though.
 
am I reading correctly that OP is calculating the average of averages? is that mathematically valid??
 
See, that's why they need to be asking questions about what they want to do
instead of asking how to do Y.
While Not Rs.EOF is another one that grates on my nerve.
Even if it was Do While, it still feels funny to read Not Rs.EOF when you could simply say Do Until Rs.EOF. Less mental gymnastics, please.
 
my biggest issue with While Not rs.EOF is that it's a While...Wend block ;0)
 
 
1 hour later…
7:05 PM
@this If you have an empty result set, isRS.EOF TRUE thus causing the loop to be skipped entirely?
My particular (potential) cargo-cult on that one is While not RS.BOF and not RS.EOF (which also violates While...Wend).
 
it's not really necessary
95%+ of the time you're rs.MoveNexting
so the EOF is the correct test.
If you were MovePrevious, then BOF would be the test.
either case, if it's empty, the loop will be skipped
 
why do I have memories of errors being thrown when rs.BOF is True?
(empty recordset, I'd guess)
 
that shouldn't happen
maybe a buggy version of ADODB?
 
hm, could have been
 
IME, BOF and EOF are always safe to test regardless what.
well, in ADODB, you could get an error if it's not open
 
7:47 PM
@this I think I know why - it's the cargo-cult initial .MoveFirst that throws an error if rs.BOF is true
Pretty sure rst.BOF check is useless if you removed the would-be redundant rst.MoveFirst - what would be a reason for a brand new recordset to not be on its first record before you start iterating it? Also rst.EOF = True is redundant, rst.EOF is already a Boolean, so Do Until rst.EOF is all you need. — Mathieu Guindon 1 min ago
 
Yep. The only time you should do this is if you're getting it as a parameter (which might be a code smell as well)
 
if I'm ever receiving a recordset as a parameter, I'd assume the recordset has never been iterated and is freshly generated - ergo, let it blow up if that's not the case. Or Debug.Assert rs.BOF
 
The problem is that if there was some CopyFromRecordset or ToArray(? don't remember the method off the cuff) or similar methods on it, then it might not be at the initial placement anymore
I did have one situation where I had to iterate the recordset more than once; can't remember why, though but I remember having to make it a procedure so it can be reused by different routines. Something to do with Excel formatting, I'm sure.
 
@this GetRows
CopyFromRecordset does the same
 
@ZevSpitz Yes, that's the one I was trying to remember.
 
8:01 PM
And GetString
 
and in ADODB, we have Save. I can't remember off the cuff but I think that also changes the position, too
Anyway I bet that might led to the cargo cult programming of If Not .EOF Then MoveFirsting which is especially gratuitous when it's a local variable and you've opened it.
 
inspection-worthy?
 
hmm. think we need CPA for that
 
on its way
 
basically, check that it's a local variable, then verify that Move** is the first use
Thinking if it needs to be generalized.
gosh, when I think about it there are so MANY anti-patterns
one is rs.MoveLast: count = rs.RecordCount: rs.MoveFirst: While Not rs.EOF
 
8:13 PM
I'm in the middle of turning the Walker into something that no longer tracks a single variable, rather tracks everything within a procedure scope and spits out a node tree that can then be traversed for further analysis. It's F'n slow though.
 
hmmm.
 
need to figure out a way to get rid of all the generic/placeholder nodes
(tree is currently 1:1 IParseTree : INode)
 
just to check --- shouldn't we be decorating the parse tree?
say that it's a LetStmtContext, let it subclass AssignmentNod
ditto for SetStmtContext and so forth
that way we don't have to transform it?
 
it can't, it's already a ParserRuleContext
but all the ParserRuleContext classes being partial, that's definitely an option
....one I'm thinking is more and more worth looking into
 
those are code-gen'd, though
so if we extend those, we need to verify it's not extending nothing
(should be easy to test for.... right?)
simply giving them an empty(?) interface should be sufficient, I think.
 
8:20 PM
IIRC there's already a number of partial classes doing exactly that
 
oh, ok
 
FWIW that has been my preferred approach since day 1 - it's just... daunting
 
maybe we need to be code-gen'ing it, too
 
hm, come to think of it... it's not too bad
no
we just need to make IfStmtContext : IBranchNode
and so on
 
@MathieuGuindon Isn't that roughly what I was doing already?
Or not?
Oh, wait, no, I was building my own nodes.
Not using the ANTLR tree.
 
8:31 PM
no, you're traversing the parse trees, and duplicating every node newing up GenericNode(tree) off every single agonizing node in the parse tree :)
 
Yeah.
Well, not quite :)
 
mostly ;-)
 
My new job wants me ASAP.
 
time to jump off the sinking ship then
 
I might be able to get the feature deployed next release instead of release after (4 weeks--not counting the release we are testing this week).
I have roughly half of it done already.
 
So, if I can get it ready for testing by next Monday, I'll get it in and tested.
And then I'll jump ship.
 
Oh, and they'll go hysterical, since our main QA is out next release.
 
<walking-away-with-sunglasses-from-explosion-in-background.gif>
 
Looks like Duga's back, too. Probably had to walk from an explosion herself, too.
 
@Duga hm, can't repro either... consider fixed?
 
I don't know whether it is fixed or the cause was something else.
 
I'd take a bet that the massive resolver work done since the issue was submitted, especially that around default members, fixed it
 
As mentioned in the comment thread, I did not get a repro with the snipped even before the resolver work.
 
9:05 PM
let's just close it and let a (better repro) new issue be opened if it's still a problem :)
 
Btw, I am in the process of shortening this inspection considerably.
 
been reading up on Roslyn's red/green trees
very cool indeed
but one thing I don't get is how they manage to construct the red tree lazily on-demand, without that being slow as molasses... Surely that must still be a fair chunk of work...
 
As far as I understand, they only do it for the currently shown code.
Doing it for one class only, should be acceptably fast.
 
ah ok
 
9:13 PM
And they do not have to parse to do it.
 
and they can work out document offsets from the green tree even though it lacks positions, as they can just sum up the span lengths.
 
They just need look at the root green tree.
 
damn clever stuff
 
Exactly
Still, you have fun once you need references or want to do some refactoring that rewrites multiple modules.
 
heh, yeah...
 
9:16 PM
@M.Doerner Last I heard a few years ago, they were considering exposing their internal reference code.
They didn't have it in the public API, though.
 
Oh, I thought it was all Apache?
 
Not as far as I know.
 
this, or something lower?
 
That.
They didn't expose their reference finding system to third-party authors, but were considering it.
Also, TTQW. TTYL!
 
bye :-)
 
9:19 PM
Bye :D
 
@Hosch250 last I checked all the actual parsing was closed-source :(
 
9:34 PM
ttqw here too
 
10:26 PM
@mansellan IIUC the green tree structure can allow skipping some subtrees for a non-complete red tree creation
 
10:58 PM
@MathieuGuindon Yes, most of the parser/compiler is closed source.
 

« first day (1921 days earlier)      last day (1259 days later) »