« first day (1624 days earlier)      last day (1556 days later) » 

6:00 PM
@GSerg - Yeah, that's one issue - the returned Material really isn't a constant - there's nothing to prevent the caller from grabbing a reference to it. Ideally I'd combine this with one of the solutions from this QA to make the return value immutable, but that's a bit above and beyond. — Comintern 12 mins ago
 
saw that :)
the ideal solution involves Rubberduck anyway
"I don't like having 20 modules" #OnlyInVBA
"I have 20 implementations of that interface" - only a problem in VBA
 
"Keep it all in one big honking module" is very common. Too common.
 
Just so long as it honks!
 
Bozos can have it. I'm in business of solving problems, not honking, kthxbye
 
6:15 PM
thing is, that OP is just another code-vs-data problem. all these constants are just data. IMO a more solid solution is to abstract away the container with a get-only interface (IMaterial) and have the data live outside the code, on a worksheet, or in a table. Then have code that reads the data and yields IMaterial instances as needed.
wanting an Aluminum identifier in code doesn't feel right.
anyway. moves along
 
Unfortunately, that's not a VBA-only thing, is it?
Lot of people in other languages make that mistake, too.
"meh, setting up a database table/XML file/whatever is too much trouble. I'll just code up a bunch of constants!"
 
@R.Binter VBA doesn't do class ineritance, so you couldn't have an aluminum sub-type, but you can indeed have as many classes implementing IMaterial as you need. IMO we all missed a fundamental point though: this is data, not code. If the code is hosted in Excel, have the data live on a (hidden?) worksheet table (or a db table in Access) - then you only need one implementation of the interface, say, a Material class, and the rest of the code can be written against IMaterial, and all instances can be stored in a Dictionary with the Symbol as a key, making it trivial to retrieve. — Mathieu Guindon 1 min ago
 
This can't end well. My name came up in an email chain for a solution involving JavaScript.
 
#AtLeastItWasntPHP
 
In this case though, it really shouldn't be just data - I'm guessing that the OP is planning to do lots of stuff with the Materials that would be much better suited as members on an IMaterial interface.
 
6:29 PM
maybe. I'm not sure where the OP is going with that
 
I don't know the first thing about JavaScript, yet.
 
...basically I'd challenge the premise that Aluminum.Density even needs to exist; the code should only need to know about IMaterial, and not need to care whether it's working with Aluminum or Titanium or Gold. Much code gets slashed away if the code is the same regardless of what material you're working with! — Mathieu Guindon 1 min ago
 
This comment was suspect:
I like that! it gives easy to read notation, its value can't be modified, it lets me even pass the result like a variable with an enforced type. Example: Function CalculateWeight(Mat As Material, Volume as float) End Function Weight = CalculateWeight(Materials.Aluminum, 50.6) — R. Binter 39 mins ago
A material should be calculating it's own weight, not a random function.
 
^
maybe we should nudge the OP to put up whatever they have on CR..
 
It's a trap!
This is attracting enough interest that it would be nice to see the final product posted as a question on Code Review if you're up for it. — Comintern 6 secs ago
 
6:32 PM
nice!
 
hmm
[11/16/2018 9:10:44 AM Informational] ========== Run test finished: 4212 run (0:02:25.0078087) ==========
i guess im good?
 
@KySoto Did they all pass?
 
it doesnt say any failed?
a lot of warnings
 
when one doesn't trust their own code - say, why do we make anything private in C#? Or final in Java? It annoys me to no end that the attitude is "bah, doesn't really matter" only when the language is VBA. — Mathieu Guindon just now
 
@KySoto open the test explorer
 
6:37 PM
^
Why do I always take that as assumed? Opening it has become too habitual.
 
for me it's always open.
but AIUI, it's not the default behavior
which is kind of lame
"meh, you can run unit tests and we don't feel a particular need to show you the results. you're a big boy so you open it yourself, ok?"
 
IDK, if it's open too long or I run too many test runs it starts eating a crapload of RAM. Probably not the explorer's fault though.
 
Hmm. Interesting. Haven't observed that.
i keep it open on the left sidebar with my solution explorer in tabs. (yes, Mat, I know, heresy yadda yadda)
 
It's probably some strange misconfiguration on my end. Haven't figured it out yet.
I personally can't stand having it docked. It gets its own monitor. :-)
 
Why?
it's just a list?
 
6:41 PM
It's not just a list. If you select a test it shows the results of the assert to the right.
 
@this Ah yeah, it looks like they all passed since theres some nice fancy green check circles
 
huh. For me, it's on the bottom.
@KySoto the point is that there should be no red
there might be some yellow which is ok-ish. (need to trim them down to 0....)
 
You can also group by outcome.
 
ah yeah, there are 39 skipped tests
 
We'll assign them to you if you want.
 
6:45 PM
lol.
 
@this no
 
i have no idea how tests work in htis :P
 
i received some frustrating news yesterday so took the day off
I am going to have to make up for this weekend
 
@Jelly :(
 
Sorry to hear, @Jelly
 
6:46 PM
@Jelly Sup! I hear you're in the states now.
 
@Hosch250 hopefully things will get resolved keep me in your payers
 
@Jelly Immigration related?
 
@Comintern yeah i am these united states!
 
That's been a ****-show recently.
 
6:46 PM
I mean, we can't just have open-borders, but it doesn't need to be this way either :/
 
For several values of ****.
 
realistically, if you work and pay taxes and whatnot, i dont really care if you are here
 
i dont know why all tension against legal qualified immigrants..
 
^^
 
^^^
 
6:47 PM
@Jelly Ignorant pineapples.
 
i pay taxes
anyhow
 
You're from where?
 
And legal immigrants have more of my respect than people who didn't choose to be here.
 
wew! better than many natives!
 
Tunisia. I am Arab.
So...
 
6:47 PM
At least, the immigrants chose to be here.
 
ahh that sucks man, racism is real -_-
 
I prefer ethical moral skilled immigrants over homegrown unskilled pineapples. Wish more had that mentality.
 
Everything will be resolved. I am very grateful I have a legal status and everything. Transition has been very stressful but I am very thankful and grateful for where I am.
 
yeah, i bet.
 
and I don't want or like to complain. I will keep that to my gf.
 
6:49 PM
you wouldnt be here if you werent
 
You guys are a nice bunch
 
@Jelly Keep at it. Bottle that frustration and use it to build your skillset. Not all "Muricans" are xenophobes.
 
What Iven said.
 
^^
 
@IvenBach: All people I have met in Vancouver WA are amazing. I have loads of friends. The people are amazing.
 
6:50 PM
from what i can tell , its usually the ignorant ones raised in crappy situations that end up xenophobic
 
I have actually caught my first wild steel head up in the kalama river...
 
Nice!
 
which is a big achievement for someone from the sahara
 
you know... im jelly.
i wanna live up there
 
6:51 PM
but i also like my job, so that makes it hard
 
In a couple years I plan on looking for work in the Pac NW.
 
and you get to duck the state income tax and sales tax, too. ;-)
 
Nice fish.
 
Yup! Fishing is amazing man especially when you are fighting it...
 
6:52 PM
@this Hmm? WA doesn't have state income/sales tax?
 
Anyone know of a good site to go to for learning JavaScript?
 
I knew at least one of the Dakota's didn't, and Montana.
 
WA= no income tax, but has sales tax; OR = income tax, no sales tax.
 
@this yea wa has no income tax i do my shopping in portland or which has no sales tax
 
@IvenBach Hell?
 
6:52 PM
@IvenBach W3 Schools isn't too bad.
 
wait, what?
they have income in WA now?
 
@Comintern That's about how I feel right now...
 
you are right i corrected myself
 
oh ok
 
@Jelly Careful about that. You usually have to declare "imported" goods anyway, I think.
 
6:53 PM
whew i was worried I missed the news
 
like food?
oh okay.
 
Not sure, IANAL.
 
TBH, that never has been a problem.
 
Food is sales tax exempt almost everywhere, isn't it?
 
Food in MN isn't taxed, although we have sales and income tax.
 
6:54 PM
it's common for the WA border residents to do all the shopping on OR side. At least it is the way when I was there long ago.
 
@Comintern where you at?
anyone in dayton ohio im flying on Monday?
@this where you at too man?
 
@Jelly I'm smack in the middle of flyover country.
 
Heart of the land.
Nebraska
?
 
More like the ass.
 
^ Denoted by his Motherland image.
 
6:55 PM
in middle of this state country called "Texas".
 
@Jelly Yep.
 
Dude i went to Dallas last summer. Texas has its own thing going on.
 
@Comintern I'm obliged to ask you this.... Why cornhuskers?!?
 
The people were so nice...
 
@this Because Bugeaters was worse.
 
6:56 PM
Of course it was
but....
 
Why this year's Cornhuskers?
 
My buddy was making a joke about texas: They say in Texas when you go to bar they check you for guns and if you dont have one, they give you one
lol
 
@Jelly well considering how wild pigs are a problem... I wouldn't be surprised.
 
@Jelly Is that sarcastic?
I've heard it both ways.
That they are nice, and they are aggressive.
Maybe they are both :)
 
Yes, both.
 
6:58 PM
yeah lol
 
Would I fit in then? :P
 
I swear the people I meet were pretty cool but there again most of them are professionals
 
Or am I not nice enough...
 
@Hosch250 : I think you are pretty cool. People need to get to know you first.
 
Well, I'll try to be nicer then.
 
7:01 PM
the funniest thing that happens to me when people walk to me and start speaking Spanish which I find hilarious
 
Don't want to piss too many people off needlessly, but don't want to be a wishy/washy say-what-they-want-to-hear type either.
@Jelly Interesting.
Holy cow, my inbox just filled.
 
on declaring closer to usage: "vba doesn't have scopes for `For...Next` or `If...End If`blocks. Therefore it's better to declare variables above, because scope gets confusing otherwise."
counter: extract the loop body / conditional code into its own procedure. poof, it has its own scope!
 
@Jelly That happened to me Europe - people assumed I was German for some strange reason.
 
Because you are look like German lol
I do not mind that at all. I look like a Hispanic but to Hispanics I don't.
 
@MathieuGuindon you mean I have to make yet another procedure? Uggghhhhh
 
7:04 PM
@this That's awesome out-of-context.
 
@Jelly considering the history of spain and northern africa that's not actually terribly surprising
 
@Comintern Just don't start time-traveling. Looking German could get you shot in some times.
 
@this IKR?
if only there was a refactoring to help with that
3
 
@Hosch250 It must be in the eye of the beholder, because I look very much like a Scot.
 
yes, I have plan to get back on that particular horse soon...
 
7:06 PM
@this you know I'm only kidding, right?
 
@Vogel612: Ancestry.com says I am 49 Middle Eastern, 39 North African (Native of North Africa) and 11 Iberian.
 
I do know that. But it is also personally annoying because I've been meaning to get back to it.
 
@Jelly What's the other 1?
 
1 European Jewish which is awesome considering my entire history is Muslim.
 
Oh, interesting.
 
7:07 PM
I think it is hilarious.
 
More interesting than my heritage, which is mostly Luxembourgian.
 
FWIW I wonder how actually useful ancestry sites are
 
@Comintern Wife's co-worker assumed I was German before I met her. Made a full on, I'm assuming, German meal when we went to house for dinner.
 
@Vogel612 Mine is from our genealogy tree. Which is supposedly more/less accurate :P
 
@IvenBach oh what did you get?
 
7:08 PM
This map feels like my ancestors because my dna extends from both ends
 
Wifes Co-Worker: "Here's some German beer I got for you"
Me: "Uh.... I don't drink. I'm not even German. I'm American and my family came from somewhere in Europe, I think."
3
 
@this feel free to bug me about the darn Add/Remove References dialog I've been meaning to do for 2 years
@IvenBach you know Germany is somewhere in Europe?
 
@Vogel612 Sausage of some kind (bratwurst), Sauerkraut, and a few other things.
 
Actually Germany is Europe.
 
@MathieuGuindon Now that you mention it, it is a pretty long scroll down to Rubberduck in the references list...
 
7:10 PM
When it's not France.
 
/politics
 
LOL
haha
 
@Comintern scrolling? type S, arrow up 2 times, done.
 
that is unless you want me to go into full blown rant mode on european and german politics
 
@MathieuGuindon I don't support the stereotype by knowing all my genealogy.
 
7:10 PM
@Vogel612 I could on US politics too, but I think I'll abstain :)
Just a bunch of power-trippers that most people hope trip over their own power.
 
@this what part of the us are you at?
 
15 mins ago, by this
in middle of this state country called "Texas".
 
Sorry...
 
No worries :)
 
I didn't see that. I thought that was comintern
 
7:12 PM
And I'm St Paul, and Iven is Southern California.
 
@Jelly I can understand why certain Latinos would speak Spanish to you.
 
@this fair enough... got a shortcut for Microsoft Scripting Runtime? ;-)
 
No, Comintern is Nebraska.
 
Nah, he's eating bugs and husking corns.
(whatever the hell that is)
 
LOL
 
7:12 PM
And most of the rest are from Australia. Vogel is German.
The Australians aren't online now.
 
<~ Canada
 
Max is also German
 
@this I'm not entirely sure how to husk a bug, but I guarantee that eating corn is the better option.
 
Yep.
 
lol
 
7:13 PM
mansellan and M.Doerner both, I think.
 
@Jelly Please don't hold the fact that I live in SoCal against me. I'm actually a nice down to earth person.
 
actually I think mansellan is briton
 
Isn't mansellan in the UK?
 
mansellan is in UK IIRC
 
lol
 
7:13 PM
OK. No offense, mansellan.
 
IIRC KySoto Is SoCal too.
 
Yeah, we're a motley bunch.
 
bunch crew
motley crew
 
crüe?
 
however they spelled that
 
7:15 PM
@IvenBach: You are all good man! SCal is beautiful!
 
I think in that point in heavy metal history, the extraneous umlauts were obligatory.
 
hence the name of the Guitar Hero character, Umlaut
 
back to work now...
@Comintern: Why do you think this might return a null?
Dim regKey As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Classes\CLSID\{DD2533E5-1513-40D8-82B4-927790D0A895}\InprocServer32")
The key actually exists in my registry
 
what does it return if you .OpenSubKey("gibberish that doesn't exist")?
 
regkey is nothing according to vs
 
7:19 PM
the key is to not assume the code will run against your registry ;-)
 
meaning?
 
@Jelly Probably not, but you need to dispose it apparently.
 
^
@Jelly meaning you can't assume it's not going to be null
and yeah, needs a using block
 
@Comintern may husk corn, but I'm (now) a Hoosier. No, I haven't a clue what that means and nobody else does, either.
although, it seems we're somewhat famous for tires
 
@Comintern this is not about disposing it which I will do or assuming it is null. I would like to get a return value so I can get value from the subkey.
Am I making myself clear or confusing you?
 
7:22 PM
been a while since I last futzed with Registry class but I seemed to recall it being pedantic about whether you had a leading? trailing? slash.
 
Let's try trhat..
 
No, that's clear, but I'd still put the null check in there. So it's not returning a key you know exists?
 
Yes. Of course.
But i have to make it work first...
@this no trailing or leading slash fixes that still null
 
hmm. wondering if you're tripping over the 32/64
 
Aren't keys in CLSID covered by UAC?
 
7:24 PM
I just looked at the script for local debug registration
 
ohhhh.
 
Try it running as admin.
 
> MakeRegistryEntries(entry, RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32));
MakeRegistryEntries(entry, RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64));
Lack of access would be also a culprit, as well.
 
@Comintern are we talking permissions? I am running vs with admin priv
 
what about the 32/64 redirection?
 
7:25 PM
I'm missing something. I've got a Public Enum A declared in class1. In class1, I have a Public Property of type A. In Class2, I've tried declaring a Public Property of type A, but it errs on compile:
 
@this how would you go about that?
 
@FreeMan your enum is private
 
Public Enum ReportTypes
  rtBizSol
  rtCustomerExperienceOnly
  rtEOHS
  rtOccHealth
End Enum
 
7:26 PM
Public DoSomething(ByVal foo As SomePrivateThingTheCallerDoesNotSee)
 
despite the Public keyword?
 
Yes.
 
SOFTWARE\WOW6432Base\Classes\CLSID\{DD2533E5-1513-40D8-82B4-927790D0A895}\Inproc‌​Server32 ?
 
No, use the ReigstryView to abstract this out
 
7:27 PM
@FreeMan is the class private or public?
 
JACKPOT!!!!!!!!!!!!!!!!!!!!
 
:+1:
 
@FreeMan Despite the `Public`. Think about how it needs to build the type library - it can't *register* the Type if it's in a Private class. That means it can't supply a parameter type in the generated type info.
 
IOW, you're being an Indian giver.
here's a public enum! But no! it's for my secret class!
 
One of these days I'm going to stop throwing trash on the floor where my trash can used to be.
 
7:30 PM
@MathieuGuindon ummm.. how do I know the difference? he asks sheepishly...
 
It's in the properties window for the class.
 
@FreeMan 99.99% of the time, VBA classes are private. You'd have to change the Instancing property.
 
@this its the registry redirection:
Public Function GetSOLIDWORKSPDMAddInLocation() As String
Dim baseReg = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)
Dim reg = baseReg.OpenSubKey("SOFTWARE\Classes\CLSID\{DD2533E5-1513-40D8-82B4-927790D0A895}\InprocServer32")
If reg Is Nothing Then
Return String.Empty
End If
Return reg.GetValue("").ToString()
End Function
it works. Thank you a lot for the redirection!
 
Nice. FWIW, you probably can use HKCR
(and you should be for that subhives, anyway)
 
@this Which means export it, change one of the attributes, then reimport it. right?
 
7:32 PM
No, not necessarily. As Comintern said, it's exposed in the properties window
 
yeah, sorry. Was focused on typing and didn't see that.
 
but your choice are Private (default) or PublicNotCreatable
 
yeah, I see that...
 
IIR editing them manually doesn't help either.
 
for whatever reasons MS decided that they wouldn't port other instancing options to VBA.
In VB6 you get like 6?
 
7:34 PM
It's part of an elaborate hack that prevents you from newing up VBA objects outside of VBA.
 
PublicNotCreateable sets Attribute VB_Exposed = True
 
yeah but you don't have to export+edit+import to change it
 
got it.
 
works?
 
Hmm that makes sense. VBA probably came with licensing requirement that you must run it in a VBA host
 
7:35 PM
that seems to have fixed that particular compile error. I'm making other changes that are in progress and leaving other compiler issues at the moment.
 
If that still errors, make a change to force a recompile. That one is tweaky sometimes.
 
which goes to show how frequently that property is used
 
guys if anyone of you is in the portland, or area, I would like to invite you for a beer (if you drink). Just tag me here...
Gotta go now...
 
seems to be working - I'm getting IntelliSense. can't wait for DuckSenseā„¢
yeah, all compiles clean now.
#TIL
I hope that #OMIR
On Monday I'll Remember
 
8:12 PM
...keeping in mind that any user that can do Alt+F11 can then type Sheet1.CheckBox1.Enabled = True in the immediate pane and defeat all of that. — Mathieu Guindon 12 secs ago
#SecurityTheater
 
i sometime wonder if there needs to be #ExcelIsNotAFrontEnd thing in addition to #ExcelIsNotADatabase....
 
#ReadingComprehension
 
#ExcelIsAVBAHostAndItHasFormsAndThings
#ITWontLetMeInstallVS
 
Exactly. At least use UFs.
Embedding UI into the worksheet is... weird.
 
Yeah, That always makes me cringe.
I mean, WTH would you need a TextBox on a Worksheet. It's literally MADE OF TEXTBOXES!
 
8:19 PM
and you really don't want to write intermediate data to that, either. Use UFs + code to validate the data entry if you must.
 
@Comintern the only thing that beats it is firing up calc.exe with Excel open
you're looking at a giant calculator already
 
See, that's why I thought they may have made a mistake making Access (the front-end technology) a separate product. In my case, it ends up being the "glue" of the Office suite since they need to use forms all the time to execute series of actions for business stuff (creating a workbook, emailing it to people with it attached, etc. etc. ) then I see them doing it all from Excel or Word without any sort of data integrity or validation...
 
LOL
To be fair, I do that all the time, but I'm usually doing it in hex.
 
@MathieuGuindon If I had a nickle for every time I saw my boss do that...
 
@MathieuGuindon The great-grandmother of all calculators, right?
 
8:25 PM
@FreeMan At least he's not using an abacus?
 
@IvenBach she's looking at a giant calculator!!!! but it's too [hard|confusing|something] to type =457*3.2 in a cell. Much faster to reach across the desk, grab the calculator, turn it on, type it into the calculator, then tear off & throw away the paper tape!!!!
 
<sarcasm>That's why he's your boss and not the other way around. Gotta get your priorities straight.</sarcasm>
I've already decided that I don't like JavaScript.
5
 
@IvenBach how long did it take you to arrive to that conclusion?
 
I thought it 0.00001 pico seconds after asked to research it.
Confirmed it shortly thereafter.
 
scrolls chat history
2 hours ago, by IvenBach
Anyone know of a good site to go to for learning JavaScript?
@this I'd say 2 hours.
until confirmation
 
8:31 PM
I decided ~15 mins in.
 
woah woah woah
0.0001 pico seconds, 2 hours, 15 minutes!
 
I kept trying cause I know this isn't a request I can ignore.
 
More importantly, why don't you like JavaScript?
 
Are we all moving at near light speed relevant to each other?
 
at this mass, we're all relatives
 
8:33 PM
@Hosch250 Cause this is something that's going to balloon into a mess.
In actuality it's not JavaScript that's the problem but Bluebeam.
 
Why will it balloon into a mess?
 
Turning on formatting for a text box to allow only numeric values, then enabling validation for a constrained range locks the program.
Because it always does.
SMH. Setting decimal places to 0, entering in 1.233 and leaving the text box shows 1 yet entering the text box it redisplays 1.233. That's not confusing in the least.
Calculated fields based on that text box include the decimals... Yep I can already tell this'll end up hitting the fan.
 
Trunc(textbox.value) <- that'll fix'em
 
So far this isn't JavaScript. Just testing numeric text boxes for a form.
 

« first day (1624 days earlier)      last day (1556 days later) »