« first day (2020 days earlier)      last day (1160 days later) » 

12:01 AM
RELOAD!
[rubberduck-vba/Rubberduck] 2 opened issues. 1 closed issue. 5 issue comments.
[Zomis/Duga] 1 commit. 54 additions. 2 deletions.
[Minesweeper] Games Played: 55, Bombs Used: 29, Moves Performed: 7584, New Users: 17
 
12:42 AM
 
 
3 hours later…
3:26 AM
So I dont think i'd use this frequently but the idea popped up and couldnt find anything about it in the object model reference so i figured id ask here: is it possible to alter the cursor in word/excel beyond selecting from the Application.Cursor presets? for example, can i take the standard northwest arrow but double the size and make it a neon blue instead of the standard white?
 
 
2 hours later…
5:43 AM
@M.Doerner Hi. Should be (it's 6:43 here) done today. Only a few lines (the longest) left.
 
 
1 hour later…
7:05 AM
@SonGokussj4 great to hear that :)
 
 
5 hours later…
11:51 AM
@MathieuGuindon @mansellan was exploring that, till he got distracted and wandered off. He kinda sucks like that :-)
If anyone's ever done Myers-Briggs (which I really reccomend), I'm an INTP. The nutty-professor type, big on ideas but rarely finishes anything...
 
12:12 PM
The thing they don' tell you about Myers Brigg is that if you answer the questions correctly it gives you your 'ground state'. You can easily change categories but this costs you mental resources. So an introverted type can act as a extroverted type but not for long etc. Think about that in the context of hiring interviews.
 
12:30 PM
@this le sigh... blocked at work.
@MathieuGuindon they will because "the cloud" is "the thing"!! But then, like touch screens every. bloody. where. people will begin to realize that there's a time and place for each technology and that "the cloud" isn't the end-all-be-all-solution-for-every-stinking-thing-there-is, but that it has its place.
Hey, I know that @mug!!!!
#LateToTheParty:(...
@MathieuGuindon took a moment, but LOL
 
12:55 PM
@theVBE-it'srightforme Sure, draw up and install a custom cursor and ba-da-boom! neon-blue-double-the-size-cursor-leading-to-confused-customers you go!
 
1:32 PM
 
@this so they basically suggest that you can implicitly treat anything that adheres to the IDisposable interface (even if through an extension method) as such an IDisposable, even if it's not explicitly that
I hate to say it, but .... java did that first
and Java basically stole it from Scala's trait system
it's a good feature
also java unsurprisingly fucked it up by not making Closeable a FunctionalInterface
T.T
I like the using modifier more, actually... that's pretty cool
 
Apparently, they did it so that you could using a ref struct.
Since struct cannot currently take an interface.
 
2:25 PM
ya
 
@this IIRC, they did it so you could have a public static void Dispose().
 
hmm a disposable static instance?
 
Yeah.
Because you can't implement a static member through an interface.
 
Yeah. It's just that I'm not sure how to feel about that.
It's funny because we have a few static classes that's pseudo-disposable in Rubberduck because they have to be static
but even so, I don't see how one can use the using since they are meant to be long-lived
 
 
1 hour later…
3:59 PM
In light of yesterday's discussion about 64-bit hosts, I had a chance to fire up RD, using one of our bigger project which I knew to crash on 32-bit host due to OOM.
On 64-bit Access, I was able to parse it.... at a whopping 1.1 GB memory used.
and while it works, it seems to be quite sluggish.
 
@this not sure why my head read that as "1.21 GW"
 
I see you're in habit of buying your plutonium from your local drugstore.
 
and fighting off the redacted
 
I think it was Libyans
 
doh... i'll take other "L words" for $400, Alex
to your point, that's pretty massive
 
4:08 PM
First questions first, are we lazy-loading as much as we possibly can on declarations/references?
 
not sure but I kind of doubt it.
I mean, to parse it, you have to know about all declarations & references?
 
Because, for example, if we aren't, we might be loading stuff that we need on, say, all declarations, but that we rarely/never use on variables, etc.
@this You need to know they exist. You don't need to know all the details.
IIRC, it's mostly done based on name, scope, and type.
And I'm not even sure about the type.
 
true. not sure how that is handled. Mat or Max would have better insight into that.
 
My next question would be are we re-using as much of the VBE members as we can? Or are we creating, say, a new VBE/Component/Whatever every time we need to look at it?
 
but TBH, I don't think lazy loading is going to cut it.
 
4:11 PM
Those should be singletons, shouldn't they?
@this Possibly not completely, but it's really helped the Roslyn team.
 
I am pretty sure we don't duplicate. At least I hope not.
 
Yeah, well, we did at one point.
 
but do Roslyn run in-proc?
 
Lazy loading the UI would help the startup time I think. Not much beyond that.
 
@this Good point. I always forget about that.
I don't know what is and what isn't.
So, in other words, we need the language server or whatever it's called.
Make the parser/resolver its own thing and RD basically just a UI.
 
4:14 PM
Yes, exactly. We have a GH issue about exploring LS PoC
if it is shown viable, then we could make RD VBIDE addin a frontend only
which would greatly relieve the memory pressure on the host
 
and keep everything in a database and analyze vb projects outside the VBE
 
Yeah, we might want a database for the library references. They aren't likely to change.
 
thinking we'd want the user stuff too
 
sure, but they'll be more volatile
 
module content hashes, everything
yeah
and then we can have per-user and per-project configs
 
4:18 PM
we would need to analyze that there is a benefit to storing and indexing volatile content
as opposed to simply rebuilding the user contents every time
 
inspections running on a database server instead of in-process?
 
if the analysis holds, then yeah, I can see us storing user contents.
hmm.
the cache invalidation problem would be 1000x worse in that scenario. ;-)
 
there's that
 
FWIW; that project that broke the 1 GB level of usage had 479 VBComponents. It has 200+ forms and 170+ reports (but that count is not accurate since not all forms/reports have a code module behind it.
 
yikes
great news that we parse it without blowing up on x64
 
4:21 PM
it's a old, continually developing project.
in active duty for 10+ years
let's see how many inspections I get....
 
only a few to fix.
 
amazing it even renders
 
but I think it does contribute to the overrall sluggishness
 
definitely
 
4:27 PM
does RD report CoL somewhere?
 
if not under metrics, ...
wait what's CoL?
 
count of lines?
what would be LoC, anyway?
 
Lines of Code :)
 
lol
metrics doe have LoC but not aggregated across all modules. :\
 
or Lots of Calamaris, depends
metrics' UI needs lots of love
 
4:30 PM
^
to be at 200K LoC, it'd need to average ~417 lines per modules
 
[rubberduck-vba/Battleship] retailcoder pushed commit 97f99d99 to tweaks: introduced IPlayerFactory interface, PlayGridId enum, removed Dictionary/added Scripting library reference.
[rubberduck-vba/Battleship] retailcoder pushed commit 4d2897b4 to tweaks: added IPlayerGrid
 
eyeballing, I don't think it's anywhere close to 200K LoC
100K, maybe.
 
> This PR furthers the decoupling of components, updates all annotations & attributes, and handles or ignores all inspection results (except one "Stop statement" deliberately left in-place).
Merge pull request #22 from rubberduck-vba/tweaks

Misc. Fixes
 
@Duga so I ended up introducing an IGameController interface, and renamed GameController to StandardGameController - and now we can have a SalvoModeGameController :)
noted lots of false positives for ByRef assignments
 
welp, that's interesting:
hWnd and hWndSplash both are LongPtr
 
4:39 PM
huh
 
@FreeMan Mug and Mike are the only ones not wearing a dress/collared shirt.
 
the weird thing is that after it crashed the first time, it still overflow even without memory. I restarted it one more time and now it works
 
@Vogel612 Holly sh*t this sentence... Who constructed this type of evil. Extremely hard to comprehend/translate :-D
Default member accesses hide away the actually called member. This is especially misleading if there is no indication in the expression that such a call is made and if the default member cannot be determined from the declared type of the object. As a consequence, errors in which a member was forgotten to be called can go unnoticed and should there not be a suitable default member at runtime, an error 438 'Object doesn't support this property or method' will be raised.
 
going to try and parse it to see if I can repro the overflow
nope, didn't reproduce. So no idea how it managed to overflow
 
@SonGokussj4 the first part is saying the default member call is implicit/hidden, and that's especially misleading when the return type of the default member can't be determined from the member's definition, like Range.[_Default] returns a Variant. The "as a consequence" part basically says [ab]using implicit default member calls makes it hard to spot places where a member should have been (explicitly) invoked, and in such places where an explicit member call is missing...
..and the object doesn't have a default member, error 438 can be expected
 
4:48 PM
Okay. Sorry to interrupt. Czech is updated. Pushed to my github repo. So now just PR from my czech-transl branch into RD/next branch?
 
woot!
yep
 
@SonGokussj4 Děkuju
 
no need to apologize for interrupting - chat can have multiple streams.
 
@IvenBach Nice :D
 
Thank online translators.
We accommodate for multiple thought processes.
 
4:51 PM
@MathieuGuindon So if I understand this correctly, me calling set mytable = Range('my-table-name').ListObject is this type of inspection.
 
> Newest czech translation with almost? newest next branch integrated within should be complete.
 
@IvenBach speak for yourself! like vba, line by line, no multi-threading
 
@Cyril LOL, must be super easy to derail you.
Also, possibly to do an XSS attack.
 
indubitably
makes my wife a bit irritated, but hey, it is what it is
 
@Duga tweeted
oh shoot I need a release tag
 
4:58 PM
 
@SonGokussj4 I don't think that triggers the inspection. A better example would be something like myRange = Range("A1")
what did we mean to do there? If we meant to assign a Range to myRange, we forgot to use the Set. If we meant to assign the value from one range to another range, then we forgot to add .Value.
Therefore, it's more accurate/clear to say myRange.Value = Range("A1").Value
.Value is the default* member that gets used when you omit it.
* technically it's [_Default] but we'll pretend they are the same thing.
 
[rubberduck-vba/Rubberduck] build for commit 95fc203b on unknown branch: AppVeyor build succeeded
> Fixed!
> Done!
> v1.1 introduced an IGameController class; closing this as no longer relevant.
> The IGameController interface introduced in v1.1 came with a renaming of GameController to StandardGameController; a SalvoModeGameController could be implemented without affecting the standard controller code, and the common logic could be extracted into a new GameControllerBase class.
[rubberduck-vba/Battleship] web-flow pushed commit 589ba95c to master: Update README.md
 
5:20 PM
well damn, y'all have battleship
 
Mucking around on SO just for the heck of it. I found a Vogel edit.
 
@Cyril if you have any ideas on how to make "Merciless" even more dangerous, I'm all ears!
(it beats me ~50% of the time)
 
i haven't looked at your actual game... saw the duga stuffs and clicked to see what that was all about.
 
wait you've never seen that project?
 
nope
 
5:32 PM
enjoy!
 
assuming "merciless" is a difficulty, you can use the recent battleship rule change (not sure if official) but every 5 turns, you are able to move any of your currently positioned ships 1 post in the direction of bow/stern or allow them to turn 90 deg based on the middle pin for odd-count and front pin for even-count
 
@MathieuGuindon Well, if it's smart enough to know the minimum length of any remaining ships, it could pick every Nth item shifting up one column each row.
 
wut
@Hosch250 that's already implemented :)
 
Nice.
 
"recently" meaning in the past 20 years!
 
5:35 PM
@Cyril Never heard of that rule.
But, it does make the game harder.
But, anyway, at that point, you're basically doing a binary search already.
I don't think you can get any better.
 
@Cyril more like a strategy - "random" just shoots at random, "fairplay" shoots at random until it finds a ship (then hammers it), and "merciless" is... well, ...means to be a badass that knocks you out (without cheating!) in as few moves as possible
 
My personal strategy is random + merciless.
For example, figure out a map of squares you are going to hit at the start, and then hit them randomly.
 
I've seen it win a game in 30 moves (the 5 ships make 17 hits)
 
And once the shorter ships die, re-generate your map.
So instead of systematically cleaning up the X = 1 row, for example, before touching X = 2, you get a broader sampling across the board and (IME) are more likely to hit a ship early on.
 
Private Function IGameStrategy_Play(ByVal enemyGrid As PlayerGrid) As IGridCoord
    Dim position As GridCoord
    Do
        Dim area As Collection
        Set area = enemyGrid.FindHitArea

        If Not area Is Nothing Then
            Set position = base.DestroyTarget(Random, enemyGrid, area)

        Else
            If this.Random.Maybe(AlmostNever) Then
                Set position = base.ShootRandomPosition(this.Random, enemyGrid)

            ElseIf this.Random.Maybe(Sometimes) Then
                Set position = ScanCenter(enemyGrid)
^ how merciless plays
 
5:38 PM
Then, once the shorter ships die, you redo the map to widen your targets a bit.
 
let's see if i can draw it out on here...

   ABCDE
1 F
2 X
3   XXF
4
5

where X is the body and F is the front of the ship (bow)

if i get through 5 turns and nothing has been sunk (all sections destroyed) i can move my ships up to 1 space, or turn 90 deg on the current middle pin... i could change mine to be:

   ABCDE
1 FX
2
3     XXF
4
5

note that the 2-pt boat was facing a wall so i couldn't go forward, so i turned... it doesn't have a "middle" point, so it rotates on the front-middle pin.  the 3-pt boat "floated" one position forward so it went from B-C-D to C-D-E
 
side note, I love how you can read that code and stop for a second and wonder if you're looking at VB.NET or VBA code
 
@MathieuGuindon Yeah, it looks pretty nice.
 
oh shoot, that arg should be As IPlayerGrid
 
just realized my example had additional spaces that were taken out... damn you CSS!
 
5:40 PM
Although, I still hate the scoping.
Braces or whitespace is the only way to do scoping good :)
 
@MathieuGuindon copy
 
@Cyril Do fixed font :)
4 leading spaces on each line.
 
i'm bad about hitting the button for fixed font lol
 
Also, BBIAB. Lunch.
 
I want an inspection that tells me when I'm taking in a concrete parameter type that could be an interface
 
5:42 PM
apparently that is not an official rule, but it part of a video game based on battleships... had to google to verify
@MathieuGuindon if it "could" then how it is concrete?
 
like, "Rubberduck, find me all the places that are taking a PlayerGrid, and quickfix that to use IPlayerGrid"
Private Function IGameStrategy_Play(ByVal enemyGrid As PlayerGrid) As IGridCoord
 
so like... replaceall(xline,"PlayerGrid","IPlayerGrid")?
 
and then be like As IIplayerGrid? :D
 
of course!
 
I suppose I could use Ctrl+H more
 
5:46 PM
that was my thought, but figured you wanted somethign more programmatic
 
I mean it's one thing to search & replace, it's another to have a tool saying "hey did you realize this parameter could be declared with an abstract interface type?"
pretty sure there's already an open issue for that lol
 
got'cha
 
Well, TBH, that's easy.
 
i'll bite... how does that game indicate that VBA can be OOP? because the grid positions are fixed objects and the overlay objects are bound to pointers in said grid area?
 
Any reference whose declaration implements an interface and the members used are implemented by said interface.
 
5:57 PM
literal orientation of objects in a cartesian space?
@Hosch250 is that like checking the typename or something?
 
@Cyril Kind of.
Basically, it would see the "As PlayerGrid" and check to see if PlayerGrid implemented an interface.
 
copy
 
And then, it would see if it could be changed to be an IPlayerGrid and create the inspection result.
If it couldn't use the IPlayerGrid, it could create an inspection result to update IPlayerGrid and use it, maybe.
 
so it focuses on checking the dimensioning rather than use-case
so i guess this goes back to mat, what makes IPlayerGrid an interface? cus i can f up adding "i" to my variables all day
 
An interface doesn't have an implementation.
It's just a contract that specific implementations can sign.
 
6:00 PM
got'cha
 
And most of the time, we don't really want an implementation, we want a contract.
Like, we don't really care if we use SQL Server or Postgre DB. We just care that we have an IDatabase to work with.
Then, we can start with Postgre through that contract, and painlessly switch it to SQL Server by writing code to connect to it and exposing that contract to its callers.
 
Have to be careful, though lest you end up leaking the implementation details.
As an example, you wouldn't want IDatabase to have an object that returns an array of objects -- something that PostgreSQL can do OOB but not SQL Server
 
Yep. You don't want your IDatabase really being an IPostgreDatabase.
 
That's the really hard part, I think.
 
On the other hand, you could still return an array of objects from SQL Server. You'd just have to write code to pull the results and put them in an array manually.
Of course, a collection would be better than an array...
 
6:06 PM
Yeah, that can be done in the implementation of the IDatabase - I was trying to think of a good example where you would leak the PostgreSQL specific behavior
which would not then translate well to SQL Server's implementation
 
@Cyril what makes this Excel Battleship special, is that the GameSheet worksheet is just another I/O device: it will work just the same if you make a version that plays and displays in a textbox, or some userform. The worksheet (UI) isn't the game state, just a representation of it.
 
Which explains the Liskov's principle --- if your ducks quacks but needs batteries, then you have the wrong abstraction.
And the example of abstracting out the UI as with IGrid is much easier to see the benefits than making a good generic IDatabase
 
And that, is totally and completely language-agnostic.
OOP isn't a language
 
^
 
I guess what I'm coming at is, if VBA is a gateway language, then this is the door you need to go through
 
6:11 PM
hey, I resent that!
 
@MathieuGuindon VBA, the marijuana of programming.
 
@Cyril You need to be high to choose to use it :P
 
fly the abstraction, man!
 
I thought Mug was the door by which we enter the land of VBA OOP.
 
6:21 PM
that would make him a tankard, not a mug.
3
but calling the lid a door is a stretch of terms.
 
what did I just walk into
lol
 
You're the one that started it.
 
I ..the gateway thing?
 
Yeah.
 
"gateway language" ...they don't say that anymore?
 
6:24 PM
@MathieuGuindon You'll just have to throw your handles up and walk away.
@MathieuGuindon I've not heard it, LOL.
 
@Cyril don't fret if abstractions aren't something that make sense immediately. They took me a while to grok. Heck I'm still getting the idea of them.
 
i'm still struggling with class modules, though i feel if i just start trying to make one it will make a lot more sense...
 
Set yourself up for failure.
I mean that in the positive way.
 
"a language you learn the basic basics of programming with", basically
 
Try something you're not fully sure of. Step out of your comfort zone. You can only progress by trying new things.
 
6:28 PM
@IvenBach isn't abstraction just calling already defined things? e.g., (my very simple understanding) i can .find() because someone defined .find() instead of having to breakdown into looping and instr() etc. Just utilizing what has been defined previously, to interact with said defined object
@MathieuGuindon hence BASICS
 
when you put a value in a variable, that variable is an abstraction... for that value
 
Once you understand and can work with classes the next step is creating/using an Interface that the class can Implements. Then instead of calling your Foo class you can call an IFoo (which is the Interface) and anything that implements that IFoo interface can be swapped out.
 
it's ...levels
levels of abstraction
so, variables, procedures, modules, projects/libraries
and then on another level, interfaces
 
Kind of like a network switch panel. You want the ability to swap out and connect different things for testing.
 
^ that.
 
6:31 PM
Again the plug example comes up for defining an interface.
@MathieuGuindon I'm on the other side of the table this time... Awkward for me this time.
 
i think i'm following
 
procedures are a tool to abstract a sequence of operations that do something
 
BRB. MVCE time for me.
 
and you lost me again
lol
 
6:34 PM
Sub DoSomething()
    '...stuff
End Sub
 
Mug's so far ahead of us mortal duckling he looses us a lot.
 
modules and functions are the tool to abstract the contents of said modules and functions? using the contained abstractions, you are doing something.
 
"stuff" is a sequence of operations
so instead of writing that stuff inline and take 5, 10 lines of code, I'll just invoke DoSomething
 
@MathieuGuindon but that "stuff" contains a, possible, list of abstractions, whcih in series perform a task
 
6:35 PM
copy. just wanted to make sure i understood your statement first. tried to re-hash it but didn't see if that was understood or not
 
and what you want to do, is for your procedures to have a consistent abstraction level
 
@MathieuGuindon You tweeted "Mixed fixes"?
 
@Cyril just to re-iterate - the key point is that there can be several level of abstractions involved.
So far, you've used examples about hiding complexity behind a procedure call (e.g. Find instead of manually looping)
but we can go one level up and start talking about objects rather than individual objects.
 
@MathieuGuindon @this so touching on mat's point, we've moved beyond variable and procedure to a class, yes?
 
6:41 PM
Need a data store? Here's a IDatabase. Need a file system? Here's a IFileSystemObject*
* technically FileSystemObject is itself an interface but I want to keep the naming convention to keep things straight.
 
^ that did hang me up, then i saw the "I"
 
Yes, but classes themselves need to be abstracted
for example, if you have WindowsFileSystem and MacOSFileSystem. Do you choose between them? No! You use IFileSystem
then the program can seamlessly switch between the windows or Mac OS filesystem and it'll still "work"
 
dim fakeClass as object... but fakeClass has all of the pieces that were defined, so that is inherently an abstraction of the pieces that make up fakeClass, yes?
 
well... that's a quirk of VBA/COM.
mainly COM.
COM is beyond the scope of discussion RE: OOP
 
As Object goes into runtime stuff
 
6:44 PM
for right now you just need to know that in world of COM, everything's an interface
so VBA classes has the accidental property of being an interface also
but you need to keep the interface distinct from the implementation
 
...*goes to google COM*
 
Component Object Model
 
^
 
uses the components inherent to the microsoft application
that was my quick read from something related to outlook lol
 
if I understand correctly, some kind of language-independent framework/platform
 
6:46 PM
not exactly.
It's an ABI
You know what an API is
 
ABI (Application Binary Interface) is simiar-ish to API in that it provides a common routines but they do at binary level, rather than at language level
 
application programming interface; a specific language to allow your shit stuff to interface with the actual program?
 
which means COM is language-agnostic; you just need to conform to the binary specifications of how things should work
One consequence of being a language-agnostic ABI, we can't rely on language features to help us enforce conventions. So therefore, COM uses interfaces, which can be implemented as a virtual table (v-table) which allows some limited inheritance and good composition even among various languages.
that is why a VBA program can talk to a C++ DLL with no problem; they both only need to follow the COM protocols, and then they can interact with no problem
heck, you can even make Java program talk to any other COM clients/servers
But that is a big digression from the OOP and not that relevant, I promise!
the only reason it's bought up is due to the fact that COM sees everything as an interfaces and hides away the details of creating new instances away because creating a new instance is very language-specific
(it has whole thing about how to create an object, how to enable other clients to discover that a certain object exist and how it can instantiate)
(incidentally, that also explains why a VBA class cannot have parameterized constructors)
so going back to the OOP discussion, the key takeaway is that you need to make a clean distinction between abstractions --- that's interfaces --- from implementations --- that's concrete classes.
 
@this that summation helped a bit. was not wholly following the above, but that will come with time
 
6:55 PM
As was mentioned earlier, the hardest part is making sure that your abstractions actually make sense.
 
@this that is actually why i thoguht VBA was considered inherently unable to be truly OOP, though it can use some of the OOP techniques, even if it can't do all tasks of otehr languages
i feel like mat might shoot me for that gross trivialization
"can't do all aspects = cannot be"
 
In the simple example of IFileSystem, you can see how we can easily substitute different filesystem, making the program more robust and able to work on different filesystems. But in practice, it can get hairy -- should a IGrid contain Ships collection for example?
 
what is ships?
 
For a battleship game, it could be argued that it's OK, but for a generic board system, that might not make as much sense.
 
iGrid looks like an interface, but is ships the class or the interface of the ships which overlay the grid?
not trying to be a butt about that, trying to take what you've all explained to me and dissect the question
 
6:58 PM
in that hypotheical example, it'd be a collection of IShip interfaces. representing a number of ships on the board.
 
ahh, then i would think that no, it should not, as interfaces shouldn't be mixed
 
So, you see, that's the main work you'd do - working out what interface(s) you need and what they should have as methods.
 
i feel like i took that from the SOLID link you sent me the other day... or i extrapolated from the single-purpose aspect
 

« first day (2020 days earlier)      last day (1160 days later) »