« first day (308 days earlier)      last day (2872 days later) » 

12:01 AM
RELOAD!
[retailcoder/Rubberduck] 11 commits. 4 opened issues. 3 closed issues. 6 issue comments.
[Vogel612/BloggingPlatform] 2 commits. 2 issue comments.
[Zomis/Duga] 1 opened issue. 1 issue comment.
 
12:15 AM
@SimonAndréForsberg slacking off? :p
 
@Mat'sMug Cool beans. Neat little tool, so I'm not complaining, just letting you know what I'm seeing.
 
12:31 AM
@Mat'sMug I have been focused on interview-preparations lately, and will go AFK on Monday for a week
 
Good stuff! (prepares for a zombie hunt)
 
Tired stuff! (prepares for a TTGTB)
 
Good night!
 
 
3 hours later…
3:16 AM
0
A: Excel VBA - Get Folder Names

Mat's MugUX Before diving into the code, I have a few points to mention about the user experience of it. You're not resetting the Application.Statusbar before the procedure exits, which means whenever the code runs to completion, the Excel status bar remains "frozen" with the last processed folder. You...

A whole VBA answer without mentioning Rubberduck!
 
 
1 hour later…
 
5 hours later…
9:54 AM
> created separate control for branches view
 
 
3 hours later…
1:01 PM
> CodeSnippetBlog is now following you on Twitter
 
1:11 PM
You too?
 
I think most if not all variable usage inspection false positives are now resolved. I just have a few little things to tweak with rename, and then I can move on to find all references and safe delete, and then 1.29 is ready to go
 
1:27 PM
0
Q: Speed up a .find Macro

NewOneI would like to speed up this piece of code. The macro get a search variable from the worksheet "RAW_DATA_ARCHIVE" and then it should find it in the worksheet "RAW DATA". When it found accordance then value of column A from WS "RAW DATA" will written in the last column of "Raw_Data_Archive". Fo...

 
is it just me or we're getting more and more CR questions? :)
ugh
You don't need a VBA macro to do this. Have you seen what VLOOKUP can do for you? — Mat's Mug 16 secs ago
 
We are, but what we need are more reviewers.
Speaking of...
0
A: Is it too easy to post your code for review?

RubberDuckTo answer the surface question, "Is it too easy to post your code for review?", the answer is an emphatic No. It certainly is not too easy to post code for review. I don't think it could be too easy. In fact, it should be as easy as possible to come to our community and ask a question in my opini...

 
^^ New SNAP error :D
2
 
1:43 PM
Tell ya what, I'll just re-write it using the Access runtime. Even that would be better than what you've got...
@Mat'sMug why just a comment? Hell..... that's the whole answer.
 
lol
 
1:57 PM
(hint: the product was never replaced)
3
 
oh wow
 
2:09 PM
@RubberDuck heck, posted.
 
Someone nominate me for SO mod
jkjk
 
I just re-read your question Dave. The last bit, about introducing a third class, that's called the Facade pattern and is quite common when exposing .Net assemblies to com interop. You may want to look into it. — RubberDuck 9 secs ago
 
If Not foo Is Nothing Then 'This Syntax Is Not Makes No Sense
 
it's easier with braces: If Not (foo Is Nothing) Then
it's because of the Is Nothing comparison, AFAIK Is Not Nothing isn't valid, although it would read more naturally
#WhyCSharpKilledMyLoveForVBA
2
 
Come on, after you learn any decent programming language I bet VBA sucks ;-)
 
2:20 PM
except JavaScript ;)
oh, right, decent.
2
 
Sooooon this will rise to the top
39
A: A quick and easy way to join array elements with a separator (the opposite of split) in Java

skiwiUsing Java 8 you can do this in a very clean way: String.join(delimiter, elements); This works in three ways: //directly specifying the elements String joined1 = String.join(",", "a", "b", "c"); //using arrays String[] array = new String[] { "a", "b", "c" }; String joined2 = String.join(",",...

#TakingOverAQuestionFrom2009
 
To be fair, I'd rather work with js than php...
 
@Mat'sMug If foo != Nothing would make the most sense...
 
9 mins ago, by Mat's Mug
#WhyCSharpKilledMyLoveForVBA
exactly :)
 
A wife sent her programmer husband to the grocery story. She said, "Get a loaf of bread, if they have eggs, get a dozen." He came back with a dozen loaves of bread.
2
 
2:30 PM
> What? They did have eggs!
2
hi @Chrismas007!
2
 
Three logicians walk into a bar. The bartender asks, “Do all of you want a drink?”
The first logician says, “I don’t know.”
The second logician says, “I don’t know.”
The third logician says, “Yes!”
 
bahbhahahahah I like that one. It made me think.
How've ya been @Chrismas007?
 
@RubberDuck I like it too, it made me drink.
 
@RubberDuck Too busy for programming :-(
 
@skiwi my job does that to me.
 
2:35 PM
@RubberDuck No alcoholic beverages though :( Heading to my 2nd exam now!
 
@skiwi see ya buddy.
 
There is this band called "1023MB"... They haven't gotten any Gigs yet...
 
> A COBOL programmer made a killing on the Y2K bug, so he had himself cryogenicly preserved.
He left instructions to have himself woken up when the last COBOL program had been replaced, so that he could enjoy his retirement in peace.
The old programmer woke from his artificial sleep, groggy, but joyful and ready to enjoy his retirement.
"Ahhhh... what year is it?", asked the old man.
"It's the year 9999. You know COBOL, right?"
2
 
in The 2nd Monitor, 49 secs ago, by Mat's Mug
I just scored +32 scanning through my own unaccepted questions and going on a checkmark-spree. Some were waaay overdue. Sorry for the delay, @Community
 
A programmers wife is having a baby. When the baby is born, the doctor hands the baby to the programmer to announce the gender. The wife says, "Is it a boy or a girl?" The programmer responds, "True."
2
 
2:44 PM
lol
user image
3
> This is a flower pot.
 
3:29 PM
I'm pretty sure this fix [...] doesn't apply - but did you try it? — Mat's Mug 1 min ago
 
3:59 PM
@RubberDuck, @Mat'sMug -- would it be worth changing the way the quick fix on that works. Currently it breaks the code with no hint of what it was supposed to be.
bar = TODO
 
yeah, that inspection is disabled
 
if that was changed to: bar = 'TODO: "foo" is never assigned into that would be a great reminder of what it was supposed to do and be much easier for the programmer to fix up
/is weird - reads documentation at lunch...
 
lol
@FreeMan that's a very good idea though
or NOTE: variable 'foo' is never assigned (taking the inspection result's text)
it was disabled because there were too many false positives with assignment inspections
could be worth re-enabling now
 
4:17 PM
> This also applies to the x86 32-bit version:

`C:\Program Files\Rubberduck\Rubberduck`
 
#YayInstallers
 
4:37 PM
@ticker Sounds like that should go on SuperUser... Not sure the will be well received on SO...
 
4:55 PM
@Mat'sMug Can you check my answer for accuracy?
0
A: Get a subrange that has all the cells of a range except for those on the first row?

PhrancisI think you're looking for Range.Offset property. Like this: Set rng = Range("B5:H20") Set subRng = rng.Offset(RowOffset:=1, ColumnOffset:=0).Select Or shorter (but less clear): Set subRng = rng.Offset(1, 0).Select Here is a tutorial with more information: http://www.homeandlearn.org/the_of...

Lots of FGITW answers on there
 
I hate Offset...
Powerful but confusing as hell!
TBH it's one of the few things I have yet to fully understand in Excel...
 
yesterday, by Mat's Mug
@RubberDuck We're programmers, we can do anything
 
Actually, I just updated my answer because it was wrong, a combination of Offset and Resize is needed for it to work like OP asked
 
How come this one's got a yellow start w/a black outline?
5 stars makes it special?
 
5:10 PM
I pinned it ;)
 
Ah. Seems.... self serving? ;)
 
Boy IE is the best browser ever!
hides
 
yesterday, by Mat's Mug
A lot of issues marked 1.3 will end up in 1.4
 
I also said "1.3 isn't shipping without source control integration"
 
True :)
 
5:21 PM
So if we release anything without SC, it's going to be <1.3
 
But isn't SC mostly a "convenience" feature rather than a "make your code better" feature?
 
I disagree with that.
I think that what you've done would be validly labeled as 1.3 even without SC.
Even though I've made lots of progress on it, it's going slow due to other obligations.
 
I'll help you finish it, it's pretty much 80% there, right?
 
@Mat'sMug 65%?
The GUI is coming together well, but we still need a way to (de)serialize repo info, store it, and transmit it into the SC presenter.
I've been averaging one commit every other day. sigh
 
@RubberDuck @Mat'sMug Might I suggest something? Perhaps try polling your Twitter followers to see if they'd rather have the other 1.3 things earlier and keep SC for 1.4?
 
5:25 PM
And I did almost nothing throughout February
 
And even once it's done, it's going to be buggy.
@sᴉɔuɐɹɥԀ has a point @Mat'sMug.
Maybe put a "poll" post up on RD News and share it on twitter.
 
My feeling is that most people that use SC either use the command line, or a specialized program like SourceTree, rather than the IDE's built-in SC stuff. I almost never use Eclipse's SC stuff, other than to change repository
 
@RubberDuck Oops.
 
(of course I'm not a reference as to "most programmers" since I'm not really one, at least just yet)
 
@sᴉɔuɐɹɥԀ I use the built in stuff for committing, switching branches, etc. The routine stuff, but I default to the command line anytime I need to merge anything, re-write history, etc.
 
5:30 PM
I hardly ever use cmd line
Only when the team explorer borks
 
There's quite a bit of work left to do on the #SourceControl feature. Should we ship v1.3 without it? Inspection fixes, refactor/rename, ...
 
@StackExchange I don't twit much, so I'll vote YES here. Lots of little niggley things have been fixed in the last 2 days that I'd be interested in having before a major minor release comes out.
 
*tweet ;)
@FreeMan under the hood, there's enough changes in that release to call it 2.0
 
@Mat'sMug RT
 
OK, whatever you want to call it, the fixes for the few things I've found would be great!
 
5:36 PM
Hehe.. I'll stick to 1.3, and there's a number of other things I want to release together with the rename refactoring, too
The code explorer needs to properly support the rename refactoring, and then having all identifier references handy makes find all references and safe delete almost trivial to implement.
Or release early/often means ship what you have, release the rest later...
4
I guess these things can go for 1.31, they shouldn't take more than 2 weeks to implement
I'm about to.convince myself that we're about ready to ship 1.3
4
 
6:02 PM
RT as well
 
Thanks!
 
@Mat'sMug You're welcome ;)
 
in VBA, is there something that's inherently wrong with using Class_Initialize to populate members of the class?
I'm getting error '91' Object variable or With block variable not set when I try to set x = classobject(key), even though I've just populated it (in Class_Initalize) with a known, existing key.
 
What's the code?
classobject(key) is a function returning an object?
 
6:19 PM
Guess I'll post a full-blown SO question... This is a near identical copy of some other code I wrote earlier in the week. the only difference I can identify is that this one pushes values in the _Initialize(), whereas the other one gathered info 'during execution'.
I'm trying to store some predefined colors to be used later.
 
Code plz. =;)-
 
6:32 PM
0
Q: Error 91 in class function

FreeManUsing Access 2010, I'm gathering information and dropping it on an Excel spreadsheet. When I run the code below, I'm getting Run-time error '91':Object variable or With block not set in my class on this line Set Cci = ChartColorItems(ColorID) in Public Function GetRGB(ByRef ColorID As Strin...

 
what do you guys know about number formats
?
 
@Chrismas007 enough. What's up?
 
So if I put in a ten digit number and custom format the field as (###) ###-#### I will get a nice phone number
But if I need to add an extension, I would use something like (###) ###-#### x####
 
That looks right to me.
 
However, when applying that to a number without an extension, it dumps the last four digits of the 10 digit phone number into the extension (gives preference to the extension over starting in the parenthesis)
 
6:35 PM
@Chrismas007 Why not just use a String type?
 
Try (###)###-#### x0000
 
Non VBA
 
Oh....
 
What platform/language then?
 
Excel
 
6:36 PM
Pretty sure it goes right to left, so you would need to right pad it to 14
 
Format Cells dialogue box
 
gotta work - bbl
 
so when i use (###) ###-#### x#### OR (###) ###-#### x0000 it takes an input of 1234567890 and makes it () 12-3456 x7890
 
Yup. You're gonna need to right pad that number somehow.
Just trying to think how.
 
Found out how to left pad
doesn't help lol
=IF(LEN(H3)=10, TEXT(H3, "(###) ###-####"), CONCATENATE(TEXT(LEFT(H3, 10), "(###) ###-####"), " x", MID(H3, 11, 99)))
 
6:43 PM
@Chrismas007 hold up. I've almost got it
 
Whoa, you can do IF conditions in Excel?
 
@sᴉɔuɐɹɥԀ Sometimes I can't tell if you are being serious or sarcastic
 
Serious :)
I've used Excel commands for calculations and formatting, I seriously did not know you could use it for logical operations too!
 
@Chrismas007 this assumes the value you want to right pad is in E1.
=E1*POWER(10,(14-LEN(E1)))
must be a number
ignore the garbage, just B & E are relevant
 
Now I just need to drop the zeroes if no extension
:-D
=IF(LEN(H4)=10, TEXT(H4, "(###) ###-####"), IF(LEN(H4)>10, CONCATENATE(TEXT(LEFT(H4, 10), "(###) ###-####"), " x", MID(H4, 11, 99)), ""))
 
6:51 PM
@sᴉɔuɐɹɥԀ It's not fun until you've got the IF statements nested 5-7 deep. Excel's little editor bar is so not useful for sorting that out...
 
@FreeMan what should I pass into ColorId
Where's the client code?
 
@FreeMan Well, you could write it in Notepad, using regular code formatting, then just paste in the bar, no?
 
        Set ColorWheel = New ChartColors
        i = 1
        For Each pnt In CChart.Chart.SeriesCollection(1).Points
          pnt.Format.Fill.ForeColor.RGB = ColorWheel.GetRGB("Pie" & i)
        Next
@sᴉɔuɐɹɥԀ quite often!
 
I don't think the key exists in the collection.
 
NOTE: there are 10 colors defined, I cut my sample off after 2 for brevity...
Set Cci = New ChartColorItem
Cci.Red = 149
Cci.Green = 55
Cci.Blue = 53
Cci.ColorID = "Pie1"
Colors.Add Cci, Key:=Cci.ColorID
Set Cci = Nothing
 
6:54 PM
Ohhhhhhhhhh
 
Does the Excel formula ignore white space completely?
 
LOL.
 
doesn't Colors.Add Cci, Key:=Cci.ColorID add it with the key?
Does @Duga auto-star every "LOL" only comment?
4
 
Nope. Wasn't the key. You're gonna kick yourself @FreeMan.
0
A: Error 91 in class function

RubberDuckYou defined the private collection at the module level as pCharColorItems, but you never initialize it in the class' intialize method. Instead, you use a locally scoped Colors collection variable. Private Sub Class_Initialize() Dim Cci As ChartColorItem Dim Colors As Collection Set Colo...

 
> Guys, this is a nice idea and all, but we already have a bunch of people out there with it installed in this location. Do we have any idea how changing this will affect an upgrade? I don't. It needs to be tested if we do this.
 
7:08 PM
@FreeMan @SimonAndréForsberg I have a feature request....
 
18
A: What's a Zombie? And what are the many other memes of Code Review?

rolflMeme: LOL - AutoStar Originator: Mat's Mug / Jamal Cultural Height: The 2nd Monitor Background: "lol" somehow got targeted at this point here (the first starred lol): retailcoder: lol (darn, again) Followed shortly by: Jamal: lol (don't star that) And then the tradition was cement...

 
@RubberDuck D'oh! And, I understand the difference between what I wrote earlier and this. Thanks!
 
@FreeMan You're welcome!
 
@RubberDuck mkay....?
 
Oh. Sorry. Didn't mean to ping you exactly.
Simon wrote Duga. She doesn't auto-star LOLs right now, but.... ahem...
 
7:12 PM
@RubberDuck Ah. I was wondering since the star was about 15 seconds after you posted...
 
Mug's probably still lurking.
2
sigh
_GN_          '!!!!!!! for some reason placing the "not a coffin" validations before the other ones results in SA being unable to GetValue()s. It returns "#ERROR#" instead.
_GN_          ' and now the the same issue is happening whenever the POG Status1 is Pending or live, but not WIP
_GN_               'MerchZPlacement must be set to edge
_PS_               For planograms
_PS_                    '     I have no idea why this would fix GetValue(), but it does. See '!!!!!!! comment
_PS_               End Planograms
This makes me very afraid to touch this code... but there's a bug of mine in here sometwhere too....
 
Nice!
Glad to know we all know which features are the really important ones.
 
7:30 PM
@sᴉɔuɐɹɥԀ Thank you. Now I feel like I'm in
 
7:44 PM
so how come there aren't options like this anymore?
 
@Chrismas007 lol
2
 
> +1
Would be awesome to see it in some future version of ducky. I'd even go further like complex snippets for progress bar, database connection, XML, custom parts.. etc.
I'd let user adding her specific snippets, maybe even maintain some NuGet-like site.. hmm I've already started dreaming about it!
 
8:11 PM
> ExcelVBA is now following you on Twitter
> @rubberduckvba yes, you can always do v1.4 in next week :)
 
@Mat'sMug it's me
 
oh hai!
:)
@FreeMan huh?
 
@Mat'sMug LOL. I'm glad people think we're that awesome...
 
oh, "pass parameter by value" was removed because it broke arrays... I guess it can be reinstated
 
Hey @PetLahev. How goes it.
 
8:22 PM
@Mat'sMug But it's there on the Parameter x can be passed by value item. Seems to make sense to me that if neither is specified in the code, the 'ByRef implicitly' pops up, then me, the user, can choose for each issue what resolution I want.
Before I set the by value to DoNoShow, I would get both suggestions appearing.
 
@RubberDuck not bad, sunny day, Friday. Yeah pretty good. Going to suggest a feature for RubberDuck 2.0 :)
 
@PetLahev Friday. Amen cuz.
 
@FreeMan it's there, commented-out:
        return new Dictionary<string, Action<VBE>>
            {
                // this inspection doesn't know if parameter is assigned; suggest to pass ByRef explicitly
                // and then let ParameterCanBeByVal inspection do its job.
                //{"Pass parameter by value", PassParameterByVal},
                {"Pass parameter by reference explicitly", PassParameterByRef}
            };
I need to fix these annoyances before next release
 
@Mat'sMug Looking at the time you usually send the most commits... Man, you work hard and late!
 
I forgot that was tracked....
 
8:28 PM
@Mat'sMug uncomment! UNCOMMENT!!!!!
If I select ByVal and break my code, it's my fault...
 
well if the parameter is an array, it won't let you pick it ;)
            if (Context.LPAREN() != null && Context.RPAREN() != null)
            {
                // array parameters must be passed by reference
                return new Dictionary<string, Action<VBE>>
                {
                    {"Pass parameter by reference explicitly", PassParameterByRef}
                };
            }

            return new Dictionary<string, Action<VBE>>
                {
                    // this inspection doesn't know if parameter is assigned; suggest to pass ByRef explicitly
I just need to add ParamArray to that
 
> Has anyone ever run across an instance where moving one section of code in front of another magically made entire blocks of code be "skipped" like they weren't even there.

I know this sounds crazy, but hear me out. No. It's not a logic issue. It's two simple, unrelated, For Planograms Where blocks. I feel like I'm losing my mind here. Can anyone confirm that they've seen this bizarre behavior?
You know it's a bad day when you post stuff like this on one of your linkedin groups.
Why does this fix it?!
1 hour ago, by RubberDuck
_GN_               'MerchZPlacement must be set to edge
_PS_               For planograms
_PS_                    '     I have no idea why this would fix GetValue(), but it does. See '!!!!!!! comment
_PS_               End Planograms
Okay... Print the code.
Get it all in front you @ducky.
It's 727 lines of BASIC. There has to be a logic issue.
It's not black magic. There's a reason for this.
 
8:47 PM
Ew.
 
Yeah. I know.
Proprietary BASIC.
Which means, even if there is a bug in the compiler, I can't find it or fix it.
But I already know there is..
So what do I do? What do you do @ducky?
You spent all after noon trying to repro.
And you can, in the actual script, but never in a simplified example.
What if you copy/paste it into a new one duck?
Try that.
 
Poor ducky. At least it's almost Beer-Thirty on Friday!
 
> Some sort of compatibility checker between 32bit/64bit version will be handy. Consider this code Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd As LongPtr, ByVal nIndex As LongPtr) As LongPtr
This is 32/64bit safe but **won't work in 2007 or lower** Obviously this won't work with 64bit Office Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA"...
_
(ByVal hwnd As Long, ByVal nIndex As Long) As Long


Suggestion could be like this

#If VBA7 Then
Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _ (ByVal hwnd As LongPtr, ByVal nIndex As LongPtr) As LongPtr #Else Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long) As Long #End If
 
@RubberDuck You ever been to Thunder Over Louisville?
 
Never been to Kentucky. Been begging the wife to take me for a year now. =P
 
8:52 PM
@PetLahev that's a very very good idea!
note, that the PtrSafe syntax isn't part of the grammar in 1.22
I added it though, so Declare statements correctly get picked up in next release
 
It's this coming weekend, Sat April 18. Maybe you ought to drive over to Southern Indiana if you want to take a short trip and see the most amazing fireworks show in the country!
 
@Mat'sMug yep, sometimes it will save me hours. My wife is running 64bit office just because of this :)
 
Holy cow, issue number 374 already?
 
ruh-roh George! again...
 
8:55 PM
@skiwi 97 open | 237 closed
 
Just got Unhandled exception has occurred in a component in your application: Object reference not set to an instance of an object
it was reparsing the todo list
then Access crashed.
Will any of the debugging info Windows gathered help?
it's the stuff Dr. Watson gathers to send to MS.
the MS .NET Framework error box is unavailable to get details from
 
it can't hurt, for sure
oh
 
want me to spew them in here?
 
spew them on the issue, @Duga will spew them in here ;)
 
erm... I guess you want me to open an issue... otay...
actually, they're .cvr files. Notepad chokes on them. Have something that will read 'em?
well, one's an xml
 
8:59 PM
no idea
 
and I'm printing code...... I need a beer.
Y'all have a good weekend if I don't see ya.
 
crap. how do I post the dump files on an issue in Git?
 
Meh, nevermind. Can you repro?
 
bah. I'll have to post on pastebin when I get home.
 
@FreeMan You can't attach files to an issue... May need to upload the file somewhere, or if it's all text you can probably make files with the content on Github
 
9:04 PM
I dunno. I'm just hoping that I can recover the changes I'd made to code before it puked
 
Any luck with Notepad++?
 
work machine. can't install too many tools.
files are zipped & sent home. I'll see what I can do with it from there
Yay! code's still there.
will see if it reproduces on Monday.
TTFN
 
Ta ta for now
 
10:20 PM
@Duga Forked but not starred? :(
 
10:33 PM
> 55 downloads
 
11:10 PM
He tried to build his own 2 years ago.
 
11:23 PM
> Received this error while refreshing the TODO: list in Access 2010:

>Unhandled exception has occurred in a component in your application: Object reference not set to an instance of an object

Access fully crashed, so I wasn't able to get any info from it. The Dr. Watson files are located on my Dropbox. You should be able to access it [here](https://www.dropbox.com/sh/sbvok738s8ujjwv/AABpnS1Ahrin0RQpMCVInPe1a?dl=0)
 
@Chrismas007 thanks for covering for me... :)
 
@RubberDuck it just occurred to me, we can measure test coverage - we know what methods are being called from test methods, and what methods are called by these public methods...
 
OMG! That's awesome!
 
11:40 PM
2.0 ;)
 
Wait.. No. That's not quite how test coverage analysis works though.
Say I have this function.
If this Then
    Bar
Else
    Baz
End If
Code coverage would need to analyze how many of those execution paths get tested.
 
Oh. Right.
Not quite there yet then
 
We could pretty easily do a simple, "Hey, you've not tested this at all" alert though.
But I'd hate for that to kill anyone into a false sense of security..
s/kill/lull
 
11:56 PM
Great! Looks much better, but there's still room for improvement, feel free to make another post anytime! — Mat's Mug 1 min ago
 

« first day (308 days earlier)      last day (2872 days later) »