« first day (1743 days earlier)      last day (1437 days later) » 
00:00 - 17:0017:00 - 00:00

want to extend this to arbitrarily many constant values?
 
posted on March 15, 2019 by CommitStrip

 
@MathieuGuindon FWIW, that's only an antipattern when there is a constant.
 
@Vogel612 not sure. just.. thinking there has to be a way to heuristically identify that pattern
@Hosch250 or more :)
 
@Hosch250 no, not really
it just needs to be effectively final
 
5:06 PM
Yeah.
 
it doesn't matter whether it's a constant or never reassigned during the loop
 
It has to be a fixed value that is operated on.
 
So what would RD suggest for something like this?
Private Function TryGetWorksheet(parent As Workbook, name As String) As Worksheet
    Dim result As Worksheet
    For Each result In parent.Worksheets
        If result.name = name Then
            TryGetWorksheet = result
            Exit Function
        End If
    Next
End Function
 
It can't be something like if (foo.val == fixedVal) do_something(foo)
 
Rely on the error handler?
 
5:07 PM
^
just OERN, done
Reminds me of that one conversation - the guy did not want to use OERN why? because he has his VBIDE set to "Break on all errors" so it's easy for him to debug, so he prefer to code code without any OERN or anything that would potentially raise an error.
 
I should do some benchmarking sometime - I suspect the performance of the error handler blows.
 
@Comintern Exit Function makes it bail out, #ThisIsFine
 
Although if you were running that sample code in a loop, you should be smacked anyway.
 
@MathieuGuindon lol no...
 
also = vs Like changes things
 
5:11 PM
RD can detect what the iterator is and whether we have a member access for it...
 
@Comintern I wouldn't be surprised if OERN version sucks for small enough set, but if the set can grow, then OERN should start to look better. I'd be surprised if it sucks in all situations.
 
@Comintern it should be suggesting to use Set in front of TryGetWorksheet =...
;-)
 
Oooo... good test opportunity.
Caught it.
Yay!
 
@Comintern #WhatIf there are 200 worksheets and the one you want is the 198th one though?
 
I can't imagine it would be much different than using the indexer.
 
5:14 PM
The only difference would be running it in C++
(e.g. less overhead than via the IEnumVARIANT )
 
I'd be shocked if the internal implementation used a hashed lookup.
 
wait it's not O(1) vs O(n)??
 
I would be shocked if it didn't allow for O(1) lookups...
 
For worksheets?
 
come to think of it, I'm not sure I'd be that shocked...
 
5:15 PM
yeah.
i mean, any collections of an unknown size has to be a hash lookup... right?
 
It has to support case insensitive lookups though.
 
or have I misplaced my faith in my fellow programmers?
that doesn't prevent you from creating a hash function for that.
can be something moronic like LCase()
 
Right, but if I estimate that a collection is going to typically have under 10 members, needs not one but 2 hash lookups, one of them custom...
That would be way down on my optimization list.
 
Right. When I have no idea of what how many I will have, I just grab me a collection class, and call it a day.
TBH the OERN vs looping to find a document in a document collection is likely mirco-optimizing anyway. Not many people will run around with 2000 worksheets Excel file... I hope.
 
I'm mainly curious on the effect of setting the error state in general though.
I.e., does that cause thread aborts in the host, stuff like that.
 
5:20 PM
With Access, we have multiple collections, so even for a file with 500 tables, the worst is more likely to be the query collection or possibly the form collection but I've never seen it go more than 1000 in a single collection.
Dumb question -- in C++ the default behavior is basically OERN. It's usually on the programmers to check the return on every single function call. This is cheap compared to handled exception, right?
 
depends
its been many years since i last actually wrote C++
 
@KySoto You misspelled #ItDepends
 
lol thanks
i rarely ever use the pound sign
 
Y'all are too hard to tell apart, @MathieuGuindon, @Hosch250, @Comintern
You need some different colors in your avatars...
 
5:31 PM
@FreeMan you seem to be objecting to the color red. Better dead than red?
 
I'm more concerned about the implication that we look like dogs.
 
@this actually, red is my favorite colour (or it least it was when I was a kid and that stuff mattered). The 3 of them were talking and that little corner-of-the-eye-glance at the avatar to see who what saying what just wasn't working. Too much cognitive load. Like naming variables a, b and c...
nah, only Hosch looks like his dog
 
Yeah, I look at names, not avatars.
Too hard to tell apart in the small size.
I can usually tell who's who by their writing style and what they are saying.
 
@Hosch250 same
 
5:58 PM
you can tell its me because i am too lazy to capitalize anything or really use punctuation
also by the wrestling match between me and @IvenBach over the burger king derp crown
 
lol, you can tell I'm on mobile when my sentences start with a capital letter
(usually)
 
yeah, me too, thats also when i have the most punctuation
 
I'm probbably recognisable by numberous typls and seplling erorrs.
 
i guess i DO use commas and stuff sometimes....
and caps for emphasis
 
@Comintern who's this clown?
 
6:01 PM
Typo the Clown?
 
@this some dude with a red avatar?
 
6:14 PM
Just don't infringe on my use of green.
@KySoto I'm pretty protective of that crown. I'm willing to lend it to you occasionally though.
 
@IvenBach Yeah, that's a hard pass.
 
totalitarian propaganda needs to be red-black colored ;)
 
by the by, Why does the confusion around y'all not include me? I'm also red?
 
@Vogel612 You are white and black?
 
6:23 PM
no, that's red.
 
Eh, it's dark enough to pass for black.
 
~grmbl mmbl
 
And your avatar has a distinct outline.
 
@Comintern It's-a-me Luigi!
 
@Vogel612 What's funny is that I didn't realize it was a hand until just now. I thought it was some bird (like the kindergarten turkeys). The "Vogel" is misleading.
 
6:25 PM
if you say so ...
 
@Comintern you're not alone. I did thought it was some kind of Cthulhu tentacles. Have to see the bigger icon to see the hand outline.
 
and that's how well y'all know me, huh? ~sniffle ;)
 
Just sayin'
 
TBH, that hand looks like something that might be the result of Cthulhu tentacles.
 
You never clicked to view his profile?
 
6:27 PM
I have, but I generally don't do that to inspect avatar icons.
 
@Comintern Whoever has that hand needs to go see the doctor about that tumor pronto.
 
@Comintern I always thought is was some predator-type alien holding out a gun
 
@mansellan Turkeys are mean AF.
Not Predator mean, but close.
 
That fat kid in Jurassic Park needs to be told about that.
 
@Comintern Turkeys v Predators. Now there's a sequel!
 
6:29 PM
@Vogel612 A) You weren't in the long string of Mug, Hosch, Comintern comments. B) Your avatar is mostly white with some red/black
 
@mansellan I would totally watch that. :-D
 
@mansellan is there honestly that much difference between a turkey and a human for a predator?
 
Ostich :check: Emu :check: Any other large bird :check: Why be scare of a turkey?
 
@Comintern PETA may not approve.
 
@IvenBach Those spurs.
 
6:30 PM
@IvenBach reminds me of the Emu war that Australia lost
 
No turkeys were harmed during the filming of this motion picture.
 
@Vogel612 LOL, my brothers think that was hilarious.
 
because they died instantly without any pain
 
@IvenBach Have you seen how mean they get around Christmas Thanksgiving?
 
@this all the more reason to make & watch it!
 
6:31 PM
@Comintern you mean like no animals were harmed in the making of harry potter one, where the thanksgiving food was actual food?
 
I swear it's the user-name that pointed me in the wrong direction though. If it didn't translate to "bird612", I probably never would have made the connection.
 
You know, I've read military stories about animals freaking out and running onto the gun range.
If you shoot at the animal instead of the target, you get in trouble for not having proper control of yourself.
 
@Vogel612:
 
If you miss the animal, you get in even bigger trouble.
 
Just not red enough to be confused.
 
6:32 PM
For not having competent marksmanship.
 
I've seen cars that have hit wild turkeys that have run onto the road before. It's not pig collision bad, but they'll mess a car up too.
 
@mansellan I live in SoCal. The only turkeys I see are the pinapples on the streets of LA.
 
@Comintern LOL, reminds me of the story my brothers tell of the wild turkey displaying on the highway.
 
My BIL took out a cow had a cow take out the front end of his minivan once
 
I almost hit a cow on the interstate when I was driving to Chicago one time.
 
6:33 PM
A pickup truck went over it, and it had all its feathers out, so it got blown around.
 
the cow???
see what can happen...
 
Not sure if it survived (guessing not), but apparently it was so low the truck just went over it.
 
Only time I hit a bird it survived.
It was weird as hell - it swooped down below the hood where I couldn't see it, but I heard the thump.
 
How do you know it survived?
 
on a trip in italy we nearly hit a large bird-of-prey with our mobile home
 
6:35 PM
@Hosch250 Maybe a lifted Obviously Compensating (OC) truck. Certainly not a Donk.
 
Then like 5 miles later I was slowing down to go through some town and it flew off the front of the car.
Must have grabbed onto the grill or something.
 
:O
 
It squeezed past between the windshield and the protuding sleep cabin above the driver cabin
 
My mom was driving in the city once, and she smacked a starling flying around with her windshield.
 
it's like the "death by pigeon" story from 1000 ways to bite the dust
 
6:36 PM
They're usually quick enough to avoid cars, even at highway speeds.
 
got a bit of downtime at work, so doing a POC into MS Orleans. It's exceptionally cool.
 
7:00 PM
Huh, TIL.
> Orleans is a framework that provides a straightforward approach to building distributed high-scale computing applications, without the need to learn and apply complex concurrency or other scaling patterns.
Sounds like it's for script kiddies to generate rainbow tables, LOL.
 
@Hosch250 s'ok, Lisa Frank approves.
 
@Hosch250 Have you been snooping on my POC?
 
No.
 
;-)
 
Why, is that precisely what you are doing?
 
7:03 PM
lol no just kidding :-)
TBH, it's not so much not having to learn them that's the biggest win - it's not having to use them. concurrency is hard
 
@mansellan I learned that working on Rubberduck's parser.
 
lol
 
To this day, I'm more comfortable with concurrency than most other devs I've met. Pretty much all them except the Roslyn ones.
LOL, interesting things happening with spring.
Farmers having to dig cows out of snow tunnels.
Town a few miles away is building a wall to stop the illegal immigration of water from the river.
 
i'm sorry, cows' making snow tunnels?
 
@this We got so much snow it just kind of buried them.
They managed somehow to keep their heads mostly clear, so it looks like they are down in a tunnel.
 
7:12 PM
o_O
This is why there are no "wild cows".
 
There used to be.
Used to be they just turned the cows out on the range and they'd manage mostly fine.
OTOH, they would end up dying a lot in bad winters and major dust storms. That's how Theodore Roosevelt lost his herd--bad winter in ND.
Lots of ranchers went under that winter, I've read.
Also, that's how you get lean, mean longhorns that aren't good for eating or milk.
 
I know very little about large ruminants, but don't they typically come from sub-tropical climates?
 
Yaks? Muskox?
 
I always understood that originally they migrate across a large range
 
Reindeer, moose?
 
7:18 PM
which is why bisons are so endangered; we basically chopped up their range.
 
@this That, and we shot them all up.
 
uh, are reindeer and moose ruminants?
 
Are Reindeer and Moose considered ruminants?
 
Ummmm, they chew their cud, at any rate.
 
Makes me wonder - are deers ruminants, too?
 
7:18 PM
Yep.
> an even-toed ungulate mammal that chews the cud regurgitated from its rumen. The ruminants comprise the cattle, sheep, antelopes, deer, giraffes, and their relatives.
 
well, #TIL. Or rather, #SHKB
 
wow... giraffes have quite a long ways to go there...
 
IKR?
 
LOL.
 
"Here, let me hack something up to chew on..."
 
7:21 PM
What I don't get is how moose basically is a forest animal. you'd think the huge-ass antlr would be an liability.
 
Technically, they are a swamp animal.
And they don't have their big antlers for that long, either.
They take a while to grow in.
And they lose them every year shortly after the mating season.
 
@this Damnit, now you have me envisioning "ass antlers".
 
LOL
 
SMH...
 
@Comintern wishes he hadn't read that
 
7:36 PM
Sub WaitUntilLButton()
    Do Until GetAsyncKeyState(VK_LBUTTON)
        DoEvents
    Loop
    MsgBox ("Ta Da")
End Sub
@Comintern ^^ is it normal that a bunch of red flags are tickling, or it's just me?
 
i hope it's just an example code and not actual code.
 
0
Q: VBA F9 Button recognized left mouse button not recognized

user3354549The VBA code "WaitUntilF9Key" detects the "F9" key pressed when its pressed and not until it is pressed. The "WaitUntilLButton" fires right away, not when the left keypad button is pressed. Why would this be? Tkx Option Compare Database Option Explicit Private Declare Function GetAsyncKeyState L...

sorry
 
That said, if the key state is API, and doesn't provide a nice way to callback, and subclassing in VB is uh.... fun.
IOW, better find a different approach entirely.
 
anything would be better than trapping everything in a loop like this
 
oh yeah totally
it's just that polling.... ew.
 
7:39 PM
@MathieuGuindon Yeah, that's a bit...sketchy.
Needs more subclass.
 
in VBA?
 
OP wants a keyhook. the can of worms is already opened.
 
That's presuming it's not a X-Y problem, though.
 
there's that
 
The op doesn't even say why he's wanting to hook to the keys
 
7:46 PM
"irrelevant details"
 
IKR?
 
OP didn't read the documentation, I don't see why the OP would care about any details.
 
is it the same guy that was asking why Not 1 isn't 0?
 
Nope. 1 prior question, tagged vb.net.
 
ha, someone beat you to an answer :)
 
7:48 PM
@Comintern often, in early stages of the programmer's lifetime, they just blindly copy'n'paste any random API from an API repository. Anyone else remember the "VB API heaven"?
mentalist.org something.
 
dementalist if you ask me.
 
@this huh that url does ring a distant bell somehow
 
Exactly. Those sites did more harm, IMO.
 
That would explain why the declaration is correct and the usage isn't.
 
that site I'm thinking of seems long ago dead
(thankfully)
 
7:52 PM
It's a Vegas magic show website now.
Seems appropriate.
 
but lot of times, they're just promiscuously swapping around API declares, without even linking to the source documentation. And they act surprised when it doesn't work the way they thought it'd.
 
huh, is it Mesmer?
 
no. doesn't sound right.
 
Some guy named Gerry McCambridge.
 
right, just went (to the url, not the show)
 
8:26 PM
Hi folks :-) So I finished the translation in time and for today I tried to turn on english comments.... What an idiot :-D There are so much helpful statements that simplify the translation... That should be somewhere written on wiki - let the english comments column turned on... :-D
 
yeah we have an open issue to write up a wiki article. :\
 
Oh and - is it possible that somewhen in the future, you will be focusing on quicker RD parsing? For my project, it takes about 30 seconds. Don't know if that's normal :)
 
how many objects do you have?
 
@this: When I will be on 4 hours train in the future, I'll think about it :)
is there a simple way to find that out?
 
in some o fmy project it does take a while. for me, the bigger problem is the memory limitation.
I would probably start with Application.VBE.ActiveVBProject.VBComponents.Count
that'll get us the # of all VBA objects that would probably get parsed.
 
8:32 PM
52
 
hmm, do they contain a lot of lines of code?
(no easy way to mesaure this in a one line, unfortunately)
maybe code metrics will help - if it's working. Rubberduck -> Tools -> Code metrics
 
Not possible to share a private repo link, is it :-)
github
 
it is possible, the link will just 404
 
Any chance to send private message here? :)
 
not really. There's stuff like onetimepad
otherwise you'd want to secure an out-of-band communication channel
 
8:36 PM
Okay :) Scratch that. Go here, I made it a public for a while and posted the link here.
 
got it, you can delete the link - but I need to do my work work so won't be able to look until few hours later
 
In the Dev branch is the code in text files.
or you can view the xlsm file and try it for yourself.

Take your time. It's not a priority :)
I ask just for a one thing. Please, clone it, I will turn it to Private again afterward.
 
I already downloaded a zip
 
9:18 PM
@Duga we're apparently their 666th star
and 1-short again
 
need to twitter more, I guess?
 
need to release :)
and blog
side note, apparently I had forgotten to let my boss & HR know that I was off to Seattle all week next week
 
ooo.... doh.
does that mean you won't go? :(
 
lol
all is good
 
whew
 
9:26 PM
TTQW
 
try to remember next time. ;-)
 
10:03 PM
@pond Enjoy the weekend everyone.
 
10:20 PM
@this Have a minute? :) Can I turn the repo into private again?
 
10:57 PM
Huh? Are there really no tests for the various rename commands?
 
> only Handles/Pointers should get LongPtr, others stay mostly Long
 
@M.Doerner there should be ...
 
I could not find them.
All other refactoring commands have several tests.
 
so... I've made a dll now. Dumpbin still claims it's 32 bit, but I can't see how it can be. The compiler will be emitting 64-bit code, and it's linked FM20 which I've confirmed to be 64-bit
 
There are no references to the constructor of CodePaneRefactorRenameCommand.
 
11:05 PM
I think whatever in the VBE is creating the obj file is hard-coded to emit the x86 flag in the COFF header, even though the payload is actually 64-bit. Does that sound plausible?
If I'm right, 64-bit COM Dlls authored in VB are acheivable
And probably exes to - iiuc that's pretty much just a linker option
 
@mansellan from VB6 or VBA or both? that's crazy sick btw!!
 
@MathieuGuindon VBA. We always said it was the same thing right? This kinda proves it :-)
 
ikr
almost scared to fire up the hex editor and change the flag now...
 
[rubberduck-vba/Battleship] Imh0t3b pushed commit c57c1df0 to master: Win-API: fixed LongPtr declarations (only Handles/Pointers should get LongPtr, others stay mostly Long)
Merge pull request #20 from Imh0t3b/master

Win-API: fixed LongPtr declarations
 
11:38 PM
@mansellan what's stopping you man?!?
 
yeah, was kidding. had to find the right offset
tryna regsvr it now
 
wait, we have to regsvr it?
I thought it was just simply reference it from the VBA project
 
that didn't work
ok, so I changed the flag to report it as 64 bit. can't reference it or regsvr it, but that may be because I did something boneheaded in building it
lemme see what olewoo thinks of it
 
@SonGokussj4 > DEBUG-2.4.0.29211;Rubberduck.Parsing.VBA.ParseCoordinator;Parsing run finished after 57.7702398s. (thread 11).;
so yeah, not just you. :)
 
Ah :-) So it's just a big project and nothing can be done? :)
(and horrible project too... :-D Have to be finished this year...)
 
11:44 PM
 
@mansellan for regsvr32 to work you have to have the appropriate entry points. Is that a thing ODE does?
@SonGokussj4 not sure, I only had a quick glance - i see few of your modules have >1000 lines of code
whether that is a contributing factor or not, I'm not sure. Someone else here (@MathieuGuindon ? ) said that generally, it's faster to parse 1000 small code modules than it is to parse 100 large modules
might be wrong about that, though.
 
@this I struggled with it on that - with just class modules, it kept saying "no public creatable object" - I guess it was trying to set the entry point. Fettling the class attributes didn't work. So I added a form, fettled its attributes, then it let me build. Guess that's no good for COM though?
 
the parsing itself is actually pretty quick...
resolving is the time-expensive part...
the more modules (and the more references between them), the longer it takes
 
yeah. I would really need someone to review my code and give me some pointers...
I'm not saying you or Mat. I know you guys have a ton of work.
Bud I don't suppose I can just post the whole project to the stack-overflow review.

Don't know what to do :)
 
The good news is that I can intercept the obj file between the compile and link stage, so I should be able to adjust the entry point?
 
11:49 PM
@Vogel612 The weird thing is I noticed it takes (i think, it might not be a truth) more time than let's say an year ago. Is that possible?
 
definitely. Resolver got quite a bit smarter
wouldn't be surprised if that came with a performance penalty
 
It it possible for "him" to be more smarter and faster? :D
 
It is possible, only harder to make happen. :)
@mansellan I'm not sure what you mean by the word "fettle". I keep having the mental image of you putting on leg chains on those objects.
 
Or maybe, here's a thought, one could disable some of the resolvers capabilities from a settings menu :-) So that It won't take me 1 minute but only 20 seconds when I don't need inspections or tests or something like that.
And when I do, I would just turn it on in the settings.
 
oh, BTW, I remembered one more thing - we did observed a parser slowdown at one point because it in fact wasn't doing something right. It only seemed quick before becuase it was skipping a crucial step... lemme find that issue...
 
11:53 PM
@this lol - guess it's a UK word. just means "adjust"
actually its more like hack-adjust
 
oh I see. So you adjust your criminals.
like a TV rabbit ear antenna.
 
lol
 
lol
 
ok, again, I'm going blind here because I honestly don't know what to expect from ODE. I never counted on it making DLL that would be compatible with the regsvr32
 
11:57 PM
if it really is 64-bit, and it's just entry points to be fettled adjusted, it seems, uh, close?
 
what little I know about it is that in order to register it for COM use at machine level, you must have DllRegisterServer and DllUnregisterServer methods
 
hmm ok
 
That has nothing to do with the usability; however.
It only means that it becomes available for any other COM consumers to use
You can still have essentially a private COM DLL, by referencing it directly without going rummaging for it in the registry.
 
ok, so lets evaluate. this thing was meant to be used in conjunction with 2 specific ActiveX designers - Data Environment and Data Report. I know that those can magic-up a public-creatable class in the project. It's possible they also add the relevant entry points, and include the regsvr methods.
 
00:00 - 17:0017:00 - 00:00

« first day (1743 days earlier)      last day (1437 days later) »