« first day (2575 days earlier)      last day (605 days later) » 

12:02 AM
REFRESH!
 
@IvenBach I think I actually get this!
   public static bool operator == (Person person1, Person person2)
   {
      if (((object)person1) == null || ((object)person2) == null)
         return Object.Equals(person1, person2);

      return person1.Equals(person2);
   }
Overrides the == to define how equality/equivalence works for this object
Though I don't get the if (((object)person1) == null || ((object)person2) == null) line. If either object is null then return Object.Equals(person1, person2);? If either object is null aren't they different by default?
anyway, Object.equals() calls the base class .Equals as defined in IEquatable.
right?
if the if is false, then return the result of person1's .Equals method, which was defined above.
 
12:48 AM
Given:
interface IMyInterface{};
//
class A{}
//
class B : A, IMyInterface{};
//
class C : A, IMyInterface{};
assume classes B & C have some different methods to make defining them worthwhile...
I can do:
B myClassB = new B;
IMyInterface inter = myClassB;
But why would I want to?
AIUI, inter is a pointer (reference) to the exact same space in memory as myClassB, but I can't access everything in myClassB, only those parts of it defined by IMyInterface. What would be the advantage of doing so?
assume also, that classes A & B add things that aren't on the interface
I get that I can, I just don't know why I'd want to.
I guess there was no need for class C in the setup, was there...
 
1:20 AM
Using the above, I can also:
 
@FreeMan IEquatable only defines the signature. The class implementing it provides the implementation.
 
A car = new A();
A truck = new B();
now, car and truck both have all the properties & methods of A, none of the extended properties/methods that may exist in B, but truck will have anything that is an override in B.
Why would I want to do that?
@IvenBach yeah. I knew that... :/ I thought I was doin' good. Where does Object.Equals() come from, then?
 
OK. that makes sense. System.Object is defined somewhere in one of the DLLs that's provided with C#. Object.Equals(); is shorthand for System.Object.Equals(); and is enabled by using System (or is it System.Object?)
Nope, docs show just using System. Makes sense...
 
@FreeMan Besides the sake of doing so see that it can be done mumble mumble :shrug:. It's more of not caring about where it comes from, rather that it can be done.
 
1:28 AM
sort of the programming class version of the ricer car. Just because you can put every little do-dad from PepBoys on your car doesn't mean that you should.
 
My current understanding with interfaces leads me back to IoC and dependency injection.
 
OK, think the brain is about full for tonight... thanks for your help, @IvenBach! Remember, if you can teach it, you really know it!
@IvenBach my brain is full for the night, I'm not going to attempt to parse that sentence...
 
You have a public void Foo(IHaveAnInterface interface) and whatever also implements that interface is valid.
You really don't care how it implements it, just that it does. And from that it lets you call the members on the interface to perform the actions.
I dunno if I'm teaching anything. Mostly pointing to docs that helped me understand. I vividly remember how confused I was when I first was presented with all this new info.
 
 
13 hours later…
2:43 PM
I've not paid attention to the RD install in forever. However, I'm installing a fresh build on my fresh laptop for the first time, and it wants to install it to C:\Users\<user>\AppData\Local\Rubberduck. Is that right? Is that where it's always installed it?
I thought AppData\Local\... was where it kept logs & stuff, not where it was actually installed...
 
if it's the per-user install, yes that is correct.
 
'course, I mighta thought wrong.
OK. Just never caught my attention before, I guess. Thanks!
Yay! another machine has been Ducked™!
 
you can't put per-user install in a non-userland. The Program Files folders are normally considered non-userland because you'd need to elevate in order to install it there.
BTW, logs and templates actually goes to the AppData\Roaming\Rubberduck
(which is arguably questionable since I'm not sure how you can "roam" with those files)
 
gotcha
@this (I wondered about that, too)
@this I seem to have also lost all my bookmarks on my desktop machine (in addition to getting a new laptop w/o any bookmarks). What's the link to your page on setting up OASIS? Pleeeeeas...
 
@this tyvm and bookmarked. again...
 
Can always make a repo for your bookmarks as an emergency backup.
 
not a bad idea. Guess I'd have to find my FF bookmark file & store it off.
have to remember to commit though... :/
 
I think they even let you make a "cloud profile" so that your bookmarks goes anywhere you go even on another computer.
tis ok. Your data will be safe in the hands of your big brother
 
Done that, but I've ended up with my work & personal bookmarks intertwined. I've got personal items that don't need to show up on the work machine. (minds outta the gutter...)
Guess I need to log into the work machines with my "personal work" email account and the personal machines with my "personal personal" email.
 
3:23 PM
@this BB trims his moustache so it tickles the back of your neck while he reads your work from behind you.
 
4:02 PM
@IvenBach that's... disturbing... on many levels
 
^^^^^ exactly
 
> I'm getting the same error on a different Access project on a brand new machine

```
2021-06-24 12:04:16.4689;ERROR-2.5.2.5951;Rubberduck.Parsing.VBA.Parsing.ModuleParser; Unexpected exception thrown in thread 10 while parsing module Tools, ParseTaskID da4f5e90-fea9-4495-8702-c2c800aa47a5.;System.UnauthorizedAccessException: Access to the path 'C:\Users\bshepard\AppData\Local\Temp\Rubberduck\u20kes1g.fzu' is denied.
```

Again, the workaround of editing the file in NPP and saving it does
 
^ sadly, it wasn't just my funky old laptop. :(
 
> I'm getting the same error on a different Access project on a brand new machine

```
2021-06-24 12:04:16.4689;ERROR-2.5.2.5951;Rubberduck.Parsing.VBA.Parsing.ModuleParser; Unexpected exception thrown in thread 10 while parsing module Tools, ParseTaskID da4f5e90-fea9-4495-8702-c2c800aa47a5.;System.UnauthorizedAccessException: Access to the path 'C:\Users\bshepard\AppData\Local\Temp\Rubberduck\u20kes1g.fzu' is denied.
```

Again, the workaround of editing the file in NPP and saving it does
 
interesting... I imported a Tools module to this new project & commented out a bunch of things I don't currently need. (I'm sure I'll need 'em shortly, so I'm not going to delete them yet.)
In the midst of a bunch of commented code:
it shows a function separator line.
 
4:32 PM
If I delete the comment on the blank line immediately above the next live line of code Public Function... the function separator line moves to the appropriate location.
I guess the VBE is trying, but failing to be helpful
 
 
2 hours later…
6:11 PM
I've only done a tiny bit of C# learning, but I'm already starting to feel my right pinky reaching for the ; key before hitting <enter> when writing VBA.
 
@FreeMan Heh, I'm having the opposite problem - as I've been playing around with twinBASIC, I keep starting to write c# methods with Sub :-(
 
6:33 PM
oops!
Even I know that's wrong. :)
 
7:03 PM
Private Function Foo() As String
    Static FSO As Scripting.Dictionary
    Set FSO = New Scripting.Dictionary

End Function
If I have multiple functions like this... is there any benefit to using Static with FSO?
 
only if you're wearing socks and have carpet...
 
cue the lame jokes
 
<dad-joke-mode: ON>
 
Foo is called repeatedly within a loop.
Which made me think of Static.
um geesh typo, that should be Scripting.FileSystemObject.
 
That's just a waste of cycles
this would make more sense:
Public Function Foo() As String
  Static FSO As Scripting.FileSystemObject
  If FSO Is Nothing Then
    Set FSO = New Scripting.FileSystemObject
  End If
End Function
 
7:19 PM
danke
 
Though, that is kind of questionable for this particular type of object.
The FSO doesn't have any state and there's no point in having multiple instances of FSO. So why not a function that returns a FSO?
 
I just thought the same thing.
 
I do something similar to this:
#If LateBind Then
Public Function FSO() As Object
  Static f As Object
#Else
Public Function FSO() As Scripting.FileSystemObject
  Static f As Scripting.FileSystemObject
#End If

  If f Is Nothing Then
    Set f = CreateObject("Scripting.FileSystemObject")
  End If
  Set FSO = f
End Function
 
I just hit the same thing a bit earlier in the day and wondered the same thing, though I didn't think of Static. Wouldn't @this effectively be the code posted?
 
Though, I don't use Static; I just New it up all the time but that gives me an abstraction for getting FSO without the early/late binding details.
 
7:23 PM
@this Ah, so myObject as Object: Set myObject = FSO()?
 
If you want to latebind, yeah
 
I suppose this is all over-engineering for my specific use case but still, useful.
 
then I'm drawing a blank on how that helps if you're early binding. Use case example?
Oh, duh.
 
but I'm more likely to With FSO() ... End With, or maybe #If LateBind:Dim myObject As Object:#Else Dim myObject As Scripting.FileSystemObject:#End If: Set myObject = FSO
 
oh, yeah, that makes sense
 
7:25 PM
apologies for the gratuitious usage of colons
 
lol.
It's allowed, but only in chatbox
 
The Static keyword maintains a reference even after execution of the Member concludes?
 
yeah
the only difference between a Static variable and a module-level variable is that the Static variable is private to that procedure
Public Function TakeANumber() As Long
  Static Number As Long

  Number = Number + 1
  TakeANumber = Number
End Function
Question: how do you reset it?
 
@this makes it much cleaner. Great idea. Thanks again.
 
You're welcome!
 
7:30 PM
@this small thermonuclear device.
 
@FreeMan I'll have to ask you to stop listening to a certain octogenarian... Can't have you playing with F-15s, too.
 
looks up to see reference waaaaay up there...
 
@IvenBach Static statement vs keyword.
 
8:01 PM
Why does string s; Console.WriteLine(s == null); give me an error about an unassigned variable instead of printing True. Doesn't NULL usually indicate the lack of data?
because C# doesn't initialize variables to anything, so nothing != null. (right?)
but still... :/
 
No, C# will not initialize for you. You must initialize it yourself.
e.g. string s = null; or var s = string.Empty;
 
yeah, I get that (even if I didn't say it clearly). I guess I just don't understand why uninitialized != null.
 
The goal here is to protect you from using a variable without having provided a starting value, unlike VBA which helpfully initializes it to some default value which may not be what you want.
 
maybe coming from a more SQL background where NULL == <no info> is leading me astray.
 
Yes, in that context null actually maps more closely to Nothing than Null
 
8:06 PM
I'd expect string s; if (string == null){} to fall into the true block
 
or if you're coming from C++, null => zero pointer
to be clear, "uninitialized" isn't even a thing when you're in runtime. This is all at compile-time, insisting that you give it a value.
 
I guess I always equated null with "no data" and would expect even an uninitialized variable to have "no data"...
 
it's not like that.
string might be a confusing example - let's try int. Why can't you do int i = null;?
 
I guess it comes from from C's malloc() where you get a pointer to some place in memory, but who knows what's there until you tell it what should be there.
this is just protecting you from forgetting to initialize the memory space in some way before using it.
 
Exactly.
 
8:08 PM
OK, I guess I can accept thinking about it that way instead of the SQL null way.
 
VBA's approach is basically "oh, I'll just use this default value for you!"
 
makes sense
 
C#'s approach is "hey, you moron! What is this value?"
C++'s approach is "eh, whatever. I guess you want to segfault, cool by me."
 
VBA tries to be helpful (sometimes by loading the gun for you, but hey, it's friendly). C is all like "dude you bought the rope, I'm no longer responsible, now go away.". C# is, "hey, you do what you want, but dude... that's gonna hurt!"
I can live with that.
 
One niggle, though - C# won't let you do it.
 
8:11 PM
well, fine. :/ but it's a fun way of thinking of it. :)
 
:)
 
different kind of helpful than VBA
 
Also to tie up the other loose end --- it's better to think of null as more like "null pointer" than "no data" which are two different concepts.
Yes, agreed.
 
@this null pointer is about the 1 thing I do know about C. Well, I know that null pointers are... bad. Either crash program or snoop in computer, but, either way, bad...
 
yeah, hence why you'd get null reference exception if you tried to use a null. In VBA, that'd be error 91 (object not set)
 
8:24 PM
@this (Muddying the waters) ArrayPool can give you uninitialized memory github.com/dotnet/coreclr/pull/24504. But that's a low-level, high perf API.
Not something a beginner would stumble across
 
no matter how high they make the walls, there's always a way to break out of the walled garden.
 
C# just hides the footguns better
 
^
<totally tangential> I wonder whether a Rust-based OS would make all the APIs much more nicer.
after all, the whole thing is built on top of abstraction which fundamentally boils down to this: is this pointer safe to use at this very moment of time?
 
 
1 hour later…
9:43 PM
@IvenBach Derp! Object.Equals() is the basest of base class function calls. Object will work on any object because they all inherit from there. Object.Equals() is the lowest level you can go...
 
10:03 PM
@FreeMan so long as you definitely call the implementation on Object and not one of the subclasses.
 
10:20 PM
@MathieuGuindon Congrats - your country is now leading the world on first-dose vaccinations.
 
@Vogel612 That was referring to a snippet of code in MSDN docs that Iven pointed me to yesterday.
 
@mansellan not sure how good that is, given a pandemic is by definition worldwide... I'm glad I got a jab (1st dose, Pfeizer), but I can't not think it's done at the expense of another, possibly worse off, population elsewhere.
 
if an object is immutable, that means that the memory address it points to cannot be changed, not that what's stored at that address can't change. got it.
 
@MathieuGuindon True. It's not a competition. We all need to get jabbed, worldwide. But Canada must have a pretty impressive program.
 
@FreeMan yep, that's what the readonly keyword does =)
Wait I'm reading this wrong
 
10:29 PM
Doin' the @IvenBach "learn out loud" thing. When I get thumbs up, I'm good. When I get 3 pages of notes, probably wasn't so good... ;)
 
@FreeMan No. A field is immutable if it can't be changed after it's object is constructed (readonly). An object is immutable if it's properties and fields are only settable at construction (or, with Net 5 records, at construction or initialisation).
 
Wow... So this happened few hours ago 40 kilometers from me
 
@SonGokussj4 OMG that's awful
 
Glad to hear you are okay
 
10:32 PM
@mansellan oh. This is in reference to strings, so maybe it's a bit right and a bit wrong since strings are "special"?
 
@MathieuGuindon While I understand the feeling, it's not really useful to beat yourself up over systemic issues.
@FreeMan Strings are special, yes
 
@SonGokussj4 Hope everything is safe.
 
Thanks. Those 2 villages are totally destroyed. Austria, Slovenia helping, people on FB offering places to stay, things, really good peeps.
Here there was only a "medium blizzard".
 
"only"
 
Holy carp! Seriously, if there were 150 injuries and no deaths, though, that's good. Tornados tend to kill people round here. I live in "tornado alley" (Midwest US).
Still not fun, but thankfully nobody killed.
 
10:35 PM
Not as bad as in the Breclav (friend is from there)
 
Property can be replaced. People can't.
 
@FreeMan death reports are usually slightly delayed... Earlier today the reports only had a single digit number of deaths in Miami Beach.
 
Honestly didn't know tornados were a thing in central Europe
 
@Vogel612 that's true... What @IvenBach said!
 
@mansellan They're much less prevalent, but Europe does have a tornado alley as well
 
10:37 PM
Not trying to down play it. It's scary and it sucks for those there.
 
I've recorded this after everything ended. These are distant lightnings.
Pretty! :-)
 
@FreeMan Strings are immutable (at least in most languages), meaning that even when you call a method on a String instance, that does not modify the internal state of that instance.
 
@mansellan In Czech Republic, there is like 1 tornado per 2 years. But never this strong. The last strong tornado in CZ was in 13xx I think. Heard that today in some video.
 
there's a difference between immutable and readonly (and const)
 
@Vogel612 yeah. took me a minute to grok the text in my tutorial. for a minute I thought it was trying to say they were effectively const. I got there in the end. Just cornfusing text.
 
10:40 PM
@FreeMan Wow. I don't envy you.
 
const is ... annoying, because the semantics of it are subtly different between various programming languages.
 
We've had a few near us, @SonGokussj4. Fortunately never had one do damage to us or our property.
 
The most common one is reference immutability (basically readonly or Java's final)
 
Just wanted to share some info. Going to sleep now. :-) See'ya.
 
Sleep well :)
 
10:41 PM
We get so many that every town has multiple tornado sirens. You hear that sucker screaming, you head for the basement. Unless it's Friday at 11:00 - that's when they test them.
indeed. Sleep!
 
we started seeing small tornadoes in my corner of the world recently, too. these things are scary... glad to see you're all right! good night @SonGokussj4!
 
^^ probably not quite up to date, but...
 
@Vogel612 Maybe I should move to Scotland lol
 
Don't go looking for that map of the Midwest US. it'll scare you.
 
Yeah. No problem in my locality anymore. Will do. :)
Thanks everyone.
 
10:44 PM
US has never appealed. Not so worried about the storms, more the guns...
 
@FreeMan I've read you've got like 600 tornados per year?
 
OK, this tutorial says, "But arrays have their drawbacks:

They have a limited length". That's not literally some upper limit to the number of items that can be stored in an array is it? You can store what you want (until you run out of RAM/swap/whatever). But that they're limited to the size at creation, right?
 
Actually, Australia is off my emigration list too. They have spiders, snakes, marine moluscs that are deadly. Who needs that?
Oh, and sharks. Let's not forget those.
 
Wiki says over 1000 in 2020. On occasion, there are "swarms" where you can have 100+ in one day in one state.
 
@mansellan Everything is fine until those big spiders get wings...
 
10:49 PM
@FreeMan Sounds nice. Are there parks nearby?
 
Places that have appealed to me: Germany. Canada. New Zealand. Uh, maybe Scandinavia?
Oh, and pretty much any island. I love isolation.
 
Isolation? Go to Jesenik. My birth city. 11K people, nature everywhere, hills, extremely clean water, public spa places :-)
 
Sounds amazing
 
We have a "forest bar" where you can get what you want and leave (or not) any money you want. :D
 
10:55 PM
Whoaaa
 
You must have people of integrity. Don't see that kind of honor system working in every country.
 
Like
 
@IvenBach We have the worst system. If it would be in the middle of city, it wouldn't last a week. But it's quite distant and you have to go 1km to the steep hill to get there 9 no cars) so most of the people are tourists. It's working for around 10 years.
 
@mansellan Yup, we've got a park right here in town. Swing set, slide, the works!
 
11:00 PM
@mansellan And the city and surroundings
You would love it. See the gallery (ignore czech language)
https://www.idnes.cz/cestovani/na-kole/jeseniky-cyklotoulky.A140711_135343_na-kolo_skr
 
That's... beautiful.
 
At first quick glance, I thought it was Machu Picchu.
 
It is :-) I'm proud I'm from there. Love the nature. Hiking, bicycle, cross-country skiing. Everyone is always shocked I drink water from streams in woods. :-D
 
I'm useless at languages, so I couldn't live there. But I could certainly see myself wandering around on holiday trying to pronounce from an English-Czech translation dictionary!
And failing
 
@mansellan Go for it! In this time with our technologies, it's extremely easy to say something in English and phone says it in czech. And vice-versa. And for writing, this motherf**ker is awesome. deepl.com/translator
If you wander there, let me know. I can give you a small tour or just some tips :-)
 
11:05 PM
My wife says that appears to be a suitable destination. As soon as we can travel again without everyone panicking and stupid quarantine, it's on the list!
Um, where, exactly, is it?
:)
 
Sounds great! Just got to wait for this damn pandemic to end...
 
Duly noted. Thank you sir!
 
seems awkward to refer to members of a list with [] positional notation...
doesn't one normally foreach through a list?
 
11:11 PM
@FreeMan Oh wait, you've discovered indexers. Have fun!
They are a bit more flexible than in VBA
 
mkay... continues reading
 
You absolutely can foreach. But you don't have to.
 
11:47 PM
[rubberduck-vba/Rubberduck]: 1363 stars vs. [decalage2/oletools]: 1619 stars
 
1 hour ago, by FreeMan
OK, this tutorial says, "But arrays have their drawbacks:

They have a limited length". That's not literally some upper limit to the number of items that can be stored in an array is it? You can store what you want (until you run out of RAM/swap/whatever). But that they're limited to the size at creation, right?
@mansellan ^ ??
 

« first day (2575 days earlier)      last day (605 days later) »