« first day (1777 days earlier)      last day (1403 days later) » 

12:01 AM
RELOAD!
[rubberduck-vba/Rubberduck] 13 issue comments.
[Zomis/minesweeper-server] 3 commits. 413 additions. 415 deletions.
[Zomis/xploria-perms] 1 commit. 33 additions.
[Minesweeper] Games Played: 98, Bombs Used: 45, Moves Performed: 12303, New Users: 27
 
 
2 hours later…
1:44 AM
It would be nice if IDE's supported coloring member variables differently from other variables. — Scott Langham Sep 22 '08 at 9:58
hmm...
 
2:02 AM
@MathieuGuindon feels kinda wrong to rely on colors to distinguish one variable from another. I'm thinking that if your code requires an IDE to be comprehensible, isn't that a smell?
 
lol true
still better than HN though
 
makes me wonder whether there's big style difference between those who code in an text editor vs. those in IDE.
 
I like the one that says seeing m_ tells them where to go look for the declaration.
like goto definition or ctrl+click wasn't a thing.
and yet I cling to my _underscore
 
yeah, I have had that feeling that we're still doing it HN-esque; only not so blatantly obvious but it's still there.
(in my case, it's usually those that gets suffixed... stuff like fooTextBox, to distinguish from fooField or something silly like that.)
 
...I suffix control names too
feels like "ha! no prefix!"
 
2:09 AM
IKR? One thing that suffix does have over the HN prefix is that it's more clear and isn't subject to variants
(e.g. txt vs tbx vs tx or whatever)
 
a semantic meaning like Field isn't harmful though
 
But in the end, it's still encoding the type....
 
FooField?
 
you'd have to if you had more than one field to work with
 
BarField
GarField
 
2:27 AM
ugh
runs inspections, doesn't talk about the fix button, and the undocked toolwindow has the linkbuttons at the bottom entirely out of sight. guy goes and types "option explicit" manually, renames his modules manually, types "public" in front of the test procedure...
I really need to start making RD vids
3
like, really
 
3:04 AM
It is worth pointing out that 0 / 0 is a special case. The normal argument against calculations of the form x / 0 where x <> 0 is that there is no number y such that y * 0 = x, and that x / 0 is therefore undefined. This is not the case for 0, as 0 * 0 is indeed 0. So if VBA generates a different error for 0 / 0 as opposed to 1 / 0, I take my hat off to it! — Jonathan Willcock Aug 3 '17 at 14:18
#nuggets
 
3:29 AM
@MathieuGuindon Do it. It's not like you're trying to write a book. Or herding cats ducklings for an OSS project. Or even working full time. You have plenty of time for all these ideas.
 
You're one of the reason why I started my Excel blog trying to teach my co-workers.
All the links I get made me wish I had a canned explanation for questions I get.
 
 
2 hours later…
5:09 AM
0
Q: Excel VBA: Looping through table rows and replacing keyterms in word template

NickSo below is my code for a sub which does the following: read header of a table into an array reads first row of said table into a 2nd array loops through the first array and replaces the marked keywords <keyword> in a word template file (.dotx) with the data row cell (includes header and ...

 
5:27 AM
ooof... Nerd-sniped by my own question. That's rough.
night pond</iven>
 
 
2 hours later…
7:08 AM
0/0 is as undefined as 15/0. From a mathematical standpoint the division a/b is just a shorthand for the multiplication a*b^-1 where b^-1 is the inverse of b in the group (C\{0},*). </math mode>
 
 
4 hours later…
10:41 AM
> Agreed. The most important thing is to indicate the module and that will allow a first pass at the mechanics required to get the feature right, such as opening the correct path in the tree GUI, scrolling the tree to bring the active module into view, etc.
 
10:59 AM
@MathieuGuindon can we change fonts in the IDE???
 
Yes but then it must be Comic Sans
 
I'd rock that!
@MathieuGuindon OutStandingInMyField
Maybe if the user turns off the HN inspection, silently run it in the background, then set ForegroundColor = BackgroundColor for any detected instances. :) <evilLaugh>
 
11:14 AM
for my git workflow on VBA projects, this is what I'm thinking:
1) local HD directory for exporting all VBA code modules
2) Personal network share directory for my repo
3) Shared network directory as the "master" repo for everyone to push to
that make sense?
especially since both 2 & 3 will be backed up by Corp IT every night while ! won't be.
or does 1 need to really be a repo, too?
 
I do not think 1 is useful.
Usually, you just work on the source currently loaded into the workspace of your local repo.
Since the VBE does not directly work off files, it is the next best thing to export to and import from the workspace of your local repo.
So, I think either 1 or 2 is not really needed.
Unless you want a github style workflow with forks.
However, that is probably overkill.
 
@MathieuGuindon ask and ye shall receive:
Enjoy!
 
11:31 AM
@M.Doerner Thanks, Max! I'm currently set up with 1) & 3), but was thinking that adding in 2) might be worthwhile.
I might shift 1) to 2) simply for the nightly backups, though. If my HD were to fail, I'd lose all the work I'd done but not pushed to production.
Of course, if we keep a master/production branch on 3) and make a next branch that we push to regularly, with a variety of WIP branches, then I can push to 3 on a daily basis and only merge to master when it's thoroughly tested.
right?
 
@this =D
 
@this that white on blue is so old skool WordPerfect v2.0!!!
I must be doing something wrong (he says, not for the first time)...
I installed the git-scm.com version of the git client. When I do something like git log -p -2 I get automatic pagination, which is perfect. I hit space to go from page to page. When I get to the end of the output, I hit... I dunno, space, enter, esc, ctrl-c, something eventually returns me to my $ prompt, but then I get no visual display of what I've typed.
For example, I can type git log<enter> again at the $ prompt. I cannot see "git log", but I get the output.
the only way to fix it is to close the git bash session & restart.
What am I screwing up?
 
12:10 PM
> **What**
An inspection that flags interfaces with more than `n` members (10? 20? 50? Configurable?) and reminds users about the Interface Segregation Principle.

This should include classes' default interface, since any class can implement any other class' public members.

**Why**
Interfaces should not be designed to continually grow new members; we should be keeping them small, specific, and specialized.

---

**QuickFixes**

1. **Move Members**

A refactoring that pops a di
 
@sputier @andrew_hoefling @Frackham1 Great idea, it's up for grabs! https://github.com/rubberduck-vba/Rubberduck/issues/4923
 
@FreeMan q
git log uses less internally, which is a better version of more.
you quit it with q
though Ctrl+C and Ctrl+D should also work
 
12:31 PM
And after editing a commit message it is Esc - > :wq - > Enter
As a windows user, the vim editor really caught me by surprise.
 
use git config --global core.editor to change it
one of the many things notepad is useful for
note that the commit only comes through if the program returns with a nonzero exit code on closing the file given, so using np++ is not a good idea
 
> @Bzgr I think the linked issue might be throwing a wrench into the class-to-class scenario, or warrant an interface-to-interface scenario (very much not trivial if already implemented). Thoughts?
 
@Vogel612 thanks for the tips. I set git config --global core.editor to use np++ on install. I intend to type the commit message on the command line -m 'message', so I don't think that'll be an issue, but I've been wrong before...
q. I'd have never thunk that...
@M.Doerner I've used vi before, but it's been many moons...
and yes, it's a nightmare!
 
12:49 PM
> and yes it's a nightmare for mouse users!
T, FTFY. ;-)
 
comfortable with a keyboard, but many years using 98+% Windoze has unlearned me some *nix CLI ninja skillz
 
When performing a code review: 1. Mention what you like, don't focus only on the bad things 👍 2. If you are nitpicking, be clear about it. (nit: I don't like this name). 3. When you are not sure about something, ask for clarification. 4. Always be nice. Don't forget to thank.
Due to me doing a lot of support for VBA code nowadays. I am going to have to check out @rubberduckvba
In #VBA with Rubberduck you can decorate a member with (no space between @ and Obsolete): ´@ Obsolete("Little bandage for the huge technical debt") Marks the procedure as obsolete; code inspections will then give you a warning for every usage. https://twitter.com/sputier/status/1118433966334386176
 
Well, this sucks: Application.VBE.ActiveVBProject.VBComponents(workingName).Remove is returning a 438 Object doesn't support this property or method. Can I not specify which VBComponent I want by passing it the name as an index?
@TweetingDuck #TIL!
 
1:05 PM
I don't think the syntax is right.
Remove is a member of VBComponents collection, not a member of VBComponent object.
you wanna more like ...VBComponents.Remove ...VBComponents(workingName)
 
so I need to call .Remove with an argument that is a VBComponent and that is what I identify with the subscripted name of the component.
That makes sense!
BTW- attempting to use VBComponents.Remove to remove the module that is currently executing fails! <-- #ThingsThatAreGoodToKnow
 
@FreeMan I wouldn't have expected anything else...
 
#SpokeTooSoon it does not update the PE to show the removal until code execution has stopped. Once code execution has stopped, the existing module is, in fact, gone!
#VBAExpectTheUnexpected
 
yeah, you're basically pulling the carpet out under your feet.
 
Wheeee!!!!
It does continue to execute, though, which is, I guess, kinda nice!
 
1:15 PM
@FreeMan Excuse me, need to call my lawyer. Something about copyright infringement.
@FreeMan FWIW, even if it did work, I still wouldn't want to do it to a module that's currently executing.
 
I'm working with some old code from Chris (pre-git integration days old!). He does explicitly skip the module name that he gave the code. For kicks, I decided to not skip it, just to see what happens.
I'll probably put the "skip me" code back in... ;)
I am being very careful to export my code to disk before running the import code that attempts to delete modules.
@this that worked, btw. Thanks again!
makes much more sense than the way I did it. I had the example right in front of me, but just didn't see it.
 
1:58 PM
le sigh. Why do people persist in doing wrong things even though they've been told how to do it right....
 
you talking programming or society in general?
 
programming
I've told them never to do >= startDate and <= endDate or variants of but they still do it anyway
 
2:16 PM
#guilty
 
#metoo
liking my little private git repo! I have the import/export code working the way I like it (huge shout-out to @rubberduck203 for the initial code).
Just need to work on the git-related thought process. I started working on one thing, but forgot to create a branch to switch topics, so I've got 1 change and 1 partial change comingled into one commit.
I feel like such a grown up now!
 
Is there any way to access the Class Attributes without creating the class in notepad and importing? — Michael James 7 mins ago
 
@this idk if i could not use variants, specially in cases where i don't know if something is going to be a single value or an array (when I'm dealing with parameter lists for example)
 
no, not Variant data types - variants of the example
 
OH
 
3:19 PM
e.g. BETWEEN startDate AND endDate is a variant of >= startDate & <= endDate
 
eh kinda
if you dont provide a time component it defaults to midnight am
 
which is bad.
 
yesh
 
and usually isn't what people mean anyway.
 
aye, bit me more than once
 
3:20 PM
thats why i dont use between
 
I do, but explicitly cast to Date (i.e. never with DateTime)
 
it get really worse when you need to deal with different languages/systems which may use different data types with different range/precisions.
 
though i guess between might work properly if i force the time component to midnight am on the start, and then a second before midnight pm
 
@this like char(10)?
 
@KySoto no. That makes an assumption about the precision.
 
3:22 PM
well in our system i do know the precision
 
@MathieuGuindon no, VBA's Date data type vs. C#'s Date vs. various SQL dialects' definition of DATE/DATETIME
 
oh, I totally meant T-SQL date/datetime
 
@KySoto not good enough in my book. It can change. That has happened before.
 
how would it change?
 
@KySoto IME it does, but between as a keyword is ambiguous wrt whether it includes or excludes the supplied dates, which isn't ideal.
 
3:24 PM
@KySoto Y2K bug?
 
also, how would you deal with i want stuff sometime after this date
 
@MathieuGuindon I know. In a stored procedure, you can control it via parameters, but when you're programming from the client's side in the other language and passing parameters to some ad hoc statements (whether it's made by EF, Dapper, by hand, whatever, how doesn't matter here), then it can get messy.
 
actually, i think im losing track of which way you are saying it should be done.
 
the expression someColumn >= startDate AND someColumn < DATEADD(DAY, 1, CAST(endDate AS date)) is the way I'd do it and this is guaranteed to work regardless of the data types, and is still sargable.
 
oh
thats pretty much what i do
 
3:27 PM
@this and it's unambiguous
 
Never saw a sargable DATEDIFF() predicate.
 
though 99% of the date comparison stuff i work with ends up being on report filters
 
@MathieuGuindon Yep, there's that, too.
@KySoto which I bet are input by users.
 
i dont remember the last time i needed to use dates to filter a query
yes, but they are forced to be dates by the controls
 
so they'll say thing like "I wanna a report from 4/10 to 4/14" and expect 5 days
not 4 days
 
3:28 PM
they get 5 days
i have a function i built 3 years ago that i plug in the dates for reports
 
> Just for funs, here's another example I just discovered in my code:

```VBA
If markerLocation > 0 Then
Dim workingName As String
workingName = Right$(componentName, Len(componentName) - markerLocation - 1)
Else
workingName = componentName
End If
markerLocation = InStr(1, workingName, ".")
```

The first assignment is the one that's highlighted.
 
Public Function GetReportDateFilter(ByVal FName As String, ByVal argStart As Variant, ByVal argEnd As Variant) As String
    'Takes in the field name [FName] start date and end date, from that it builds a filter string to pass into
    'a report. if the start string is empty it assumes  that it is open ended in that direction. if the end is empty
    'it assumes it is open ended in that direction too. if they are both empty it assume you want all data
    Dim filter As String
    Dim FieldName As String
its designed to take control values
 
you're still doing >= and <=
that's wrong.
and will fail on SQL Server's datetime which has that weird precision of 1/3 milliseconds
that's why you don't want to do the second thing
 
yes, but all of the date times are generated in access
 
because you have to assume that the database will never store the time at different precision and that it won't be altered in process of saving.
because it's a float value, it is subject to rounding, so if you do some math on the dates, you might end up iwth 23:59:59.333 which then gums up things.
BT,DT.
 
3:33 PM
yeah but im pretty sure that access truncates that .333
 
Nope, not necessarily.
 
i have literally never seen it happen in 3 years
 
I have.
 
what is being used to generate the date time?
 
The point is that just because you haven't meant it won't happen - you're basically assuming that ALL of the systems used in the whole picture will all mesh together seamlessly and not collide in their different assumptions about a value.
Why does that matter? You don't want to care where/how. Just that the comparison is always reliable and accurate regardless of the input given.
Especially when you are dealing with more than one system (you're already dealing with at least two -- Access and SQL Server. Arguably, you could have 3rd which is VBA since VBA and Access has their own type systems)
Throw in a C# web application, and it becomes more fun.
 
3:37 PM
so if i used dateadd to move it to the next day midnight, why would it matter if i did <=?
 
You don't.
 
im having a hard enough time getting vb.net
you know what
im an idjit
i really need my migraine to clear up already
i dont want midnight the next day because then its coverage isnt accurate
hence < instead of <=
ugh
sorry i took so much time to realize stuff
 
and that works even if there's a record with 23:59:59.99999999999
which is why you don't want to deal with the precision; that means you have to ensure that all systems involved adhere to the same level of precision and that is hard enough to control.
 
hi @ChrisCunningham!
 
> This PR replaces the dynamic call in the binding stage of the references resolver.

This has two main advantages: it is easier to navigate the code when debugging (no need to find some code and run it through the debugger to follow the execution flow) and it is slightly faster.
 
3:51 PM
@Duga oooh nice!
 
That PR was a lot less painful than I had envisioned initially.
 
> What happens if the declaration is not inside the "Then-Block"?
 
@M.Doerner Nice! Was that all usages of dynamics in the parser subsystem or are there others beside those that you changed?
 
4:10 PM
I think that was the only place we used dynamic.
The dynamic there really wasn't necessary and just a simplification of the code.
At the time it was written, there was no pattern matching.
Hm, I seem to have missed a few.
 
> I just did a search for uses of dynamic adn I seem to have missed a few. So, WIP for now.
[rubberduck-vba/Rubberduck] build for commit 1c02d34e on unknown branch: AppVeyor build succeeded
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4924?src=pr&el=h1) Report
> Merging [#4924](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4924?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/63e529a2bd25f73822bcea037c83b4001b5aa800?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `83.81%`.


```diff
@@ Coverage Diff @@
## next #4924 +/- ##
=======================
[rubberduck-vba/Rubberduck] build for commit 1c02d34e on unknown branch: 64.52% (target 0%)
 
4:39 PM
> **Justification**
Right now when the resolver encounters a member it can't find a `Declaration` for, it logs a binding failure and attempts to resolve known identifiers in the rest of the expression. This makes late-bound member calls unresolvable:

Dim foo As Range
Set foo = ActiveWorkbook.Worksheets("Sheet1").Range(cellAddress)

Here `Range` is a late-bound member call made against `Object`, but assuming `cellAddress` is some local variable, that's all Rubberduck will be seeing
> Interestingly, that resolves the issue for this new instance. However, the original code has the declaration outside the If...End If, so the issue as a whole still stands.
 
5:11 PM
> Yes, but it could imply that it's a different underlying issue. I'm not sure whether this needs to be in a separate issue now... Let's leave it in here for now and see whether the same fix applies for both parts.
 
@Duga gigantic can of worms might be a bit of an understatement here
 
3-pound coffee can 55 gallon drum o'worms
 
delivered by barrels of monkeys.
 
but what an interesting and useful drum it would be!
 
5:18 PM
I think the old idea of providing additional resolver metadata floated here some times ago would e less of one.
 
5:36 PM
It is such an annoyance that the collactions in the OMs are not stronlgy typed although the documentation states that the values are of a specific type.
 
5:50 PM
> This has, once again, reared its ugly head.

Version 2.4.1.4666
OS: Microsoft Windows NT 10.0.15063.0, x64
Host Product: Microsoft Office 2016 x64
Host Version: 16.0.4822.1000
Host Executable: EXCEL.EXE

```VBA
Dim theChart As ChartObject
Set theChart = report.ChartObjects.Add(20, 20, 736, 211)
Dim Ser As Series
With theChart
Set Ser = .Chart.SeriesCollection.NewSeries
With Ser
.Values = "='" & DataRange.Parent.Name & "'!" & DataRange.Rows(mtdRow).Address(e
 
@M.Doerner interesting.. Worksheets is documented as returning a Sheets collection. Yet ?TypeName(Worksheets("Sheet1")) prints Worksheet. The documentation is inaccurate/incomplete.
 
@this They're nice monkeys, though. With the drum, they also bring you a copy of a book
 
Public Sub x()
Dim o As Object
Set o = Sheet1
Debug.Print TypeName(o)
End Sub
Returns Worksheet
 

« first day (1777 days earlier)      last day (1403 days later) »