« first day (339 days earlier)      last day (2841 days later) » 

12:00 AM
@Duga so, who's winning?
 
RELOAD!
[Cardshifter/Cardshifter] 1 opened issue.
[retailcoder/Rubberduck] 5 commits. 5 opened issues. 2 closed issues. 9 issue comments.
3
 
Hmm
 
[Unihedro/JavaBot] 2 commits. 1 closed issue.
 
That's it?
 
 
1 hour later…
1:23 AM
... I just posted a VB.NET answer...
 
 
4 hours later…
5:14 AM
> You might be interested in Software Recommendations.SE: softwarerecs.stackexchange.com
 
 
8 hours later…
1:17 PM
> > As a VBA dev, I would like to be able to cancel long running Rubberduck tasks.

Tasks like refreshing the code explorer and inspecting the code base should be cancelable as this could take a very long time on large code bases.

For example, the method that currently refreshes the code inspections is defined [like this][1].

private async Task RefreshAsync()

We should pass a cancelation token to the Task and provide an UI element to allow the user to request a cancelation.
 
2:07 PM
> Should closing the toolwindow cancel the task, or there should be another UI element added for that, like a button on the toolbar? We already disable the "refresh" button, should we turn it into a "cancel" button instead?
 
2:31 PM
Y'all had a busy weekend! Hope you remembered to call your moms.
 
2:41 PM
> I'm not sure if closing the tool window should cancel the task or not. Since closing the tool window doesn't actually destroy it, it might be okay to just let it finish what it's doing in the back ground. Thoughts?

I do like the idea of turning the "Refresh" button into a "Cancel" button though. That's a UI that makes sense IMHO.
 
@FreeMan hey there!
 
:D
 
been more busy with promoting on Twitter than actually coding anything..
> Rubberduck.Setup.1.3.0.1.exe(4.05MB) - Downloaded 20 times.
Last updated on 2015-05-05
> Rubberduck.1.22.Setup.x64.exe(2.86MB) - Downloaded 73 times.
Last updated on 2015-04-01
Rubberduck.1.22.Setup.x86.exe(3.21MB) - Downloaded 145 times.
Last updated on 2015-03-31
> Tweets
56 +154.5%
Tweet impressions
5,223 +98.1%
Profile visits
487 +6.1%
Mentions
30 +87.5%
Followers
49 +12
Tweets linking to you
8
I ♥ Twitter Analytics :)
(28-day summary here)
> 27%
stackexchange.com
15%
stackoverflow.com
14%
google.co.jp
8%
google.co.nz
6%
google.ca
30%
Others
^^ rubberduck-vba.com referrers this month so far
(500 visits)
 
3:06 PM
Hey guys. How goes it.
So, I was really excited that my class is covering Async, then became incredibly disappointed.
It failed to really explain anything. =(
 
>

I'm not sure what closing the window actually does - it certainly doesn't cancel the task, but I'd have to test it to see if the treeview is refreshed if it's closed and then reopened after a while; I think the way we have it, displaying it triggers a refresh... which kills the point (of not cancelling the task when window is closed), but isn't exactly wrong either.
Same for code inspections.

Sent from my Samsung device
 
@RubberDuck TMLI5 class? ;-)
 
> It sets the visible property to false. Nothing more or less. The tool window (and incidentally, all of it's resources) open and in memory. Just invisible.

Given your point that we always refresh when showing the window, there's no reason not to cancel any tasks if the Visible property is set to false for whatever reason.
 
@Mat'sMug Yeah. Something like that.
 
@Duga that's not always true. I'm swallowing an exception every time the "Find all references" toolwindow is closed-and-reopened. not sure how to fix.
..but that exception tells me the closing of the window is destroying the window host instance.
perhaps other code explorer / code inspections don't have that issue?
 
3:30 PM
You can't modify the window if it's not visible. That's why we're getting a com exception @Mat'sMug.
        private Window CreateToolWindow(IDockableUserControl control)
        {
                object userControlObject = null;
                var toolWindow = _vbe.Windows.CreateToolWindow(_addin, _DockableWindowHost.RegisteredProgId, control.Caption, control.ClassId, ref userControlObject);
                var userControlHost = (_DockableWindowHost)userControlObject;
                toolWindow.Visible = true; //window resizing doesn't work without this

                EnsureMinimumWindowSize(toolWindow);
See how it sets the visibility to true before resizing? That's to avoid that COM exception.
So, instead of swallowing that exception, we should be able to check the window's visibility first.
Then take action on it only if it's visible.
 
3:46 PM
I mean, "Find all references" window shows up the first time, then you close it, and then there's an exception when you bring it up again - it's that exception?
 
3:58 PM
@RubberDuck this has been edited:
1
Q: Optimize Collatz conjecture

LozeputtenHow can i optimize this code, for example: Is it possible to write it shorter or better performance. import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); PSD(i); } ...

 
Oh. That exception. How did I fix that last time? I can't recall.
@SimonAndréForsberg duly noted and vote corrected.
 
@RubberDuck I can't recall either.. feel free to tweak it if you do! :)
 
Was it because we were losing the reference?
I think that's exactly what's going on.
        public RubberduckMenu(VBE vbe, AddIn addIn, IGeneralConfigService configService, IRubberduckParser parser, IInspector inspector)
            : base(vbe, addIn)
        {
            _configService = configService;

            var testExplorer = new TestExplorerWindow();
            var testEngine = new TestEngine();
            var testPresenter = new TestExplorerDockablePresenter(vbe, addIn, testExplorer, testEngine);
            _testMenu = new TestMenu(vbe, addIn, testExplorer, testPresenter);
But I need to get in front of my IDE to know for sure.
The relevant part....
var codePresenter = new CodeExplorerDockablePresenter(parser, vbe, addIn, codeExplorer);
 
4:17 PM
hmm
hey where do we ever use that addIn instance?
 
Annnndddddddd...... that's it. Only place we use it.
 
4:46 PM
Hey there
 
in The 2nd Monitor, 1 min ago, by Steve Hémond
@RubberDuck : I was wondering how you came so interested to VBA you decided to improve the editor ? :)
Hey!
 
I'm just curious
 
Easy answer. I write VBA for a living.
And the IDE sucks.
 
ok !
yeah indeed lol
 
LOL.
 
4:47 PM
i took a look at what you did and it's pretty awesome
3
 
Yeah, it's that simple. Wish there was a better story to it.
@Mat'sMug has done a lot more work than I have.
 
followed you on github, also
 
D'awww. Thanks Steve.
 
oh hi!
 
So, do you VBA?
 
4:48 PM
Obviously, since he knows the VBE ***.
 
i did like, 15 years ago. i had to make it generate excel "reports" with data coming from various endpoints in a paper mill
 
Oh boy does that sound familiar.
 
i think it's still used to this day
 
it is
 
More than likely.
 
4:51 PM
i was talking about the vba thing ive written
 
So was I. =)
 
ah :P
sorry i'm not waken up entirely i think
i'm off work
in a café ... where i had to pay for wifi ..
10 minutes remaining ...
 
A few years ago I started replacing all of those things we had around with one single tool built on top of Access.
They had been around at least 15 years, and my app will probably be around at least as long...
 
its been almost 10 years I was thinking "in which office version will MS will kill VBA" and they never did, looks like its still solid
 
I was recently speaking to a MS rep who says they're working on a CLR compiler for VBA.
Don't know how true it is.
 
4:53 PM
ok !
fuck ... i got to go, my wifi will expire
 
@SteveHémond No worries! Nice meeting you!
 
can you believe that ... having to pay to use wifi in a public spot ...
nice meeting you
will be back here tonight for sure
have a nice day !
 
@Mat'sMug where's that question about the async Code Explorer stuff? This class might not be so worthless after all.
You too @SteveHémond!
 
come back anytime!
(and follow rubberduckvba on twitter! wink-wink)
 
5:13 PM
@RubberDuck on Programmers?
 
Found it
10
Q: Exploring the code of the Code Explorer

Mat's MugThe Code Explorer is a dockable toolwindow that displays a TreeView that shows all opened VBA projects and their respective modules, but unlike the "native" Project Explorer, Rubberduck's explorer also drills down to individual module members, and allows quickly navigating them: While it looks...

It's a mess and it's my fault. It started with me.
I think I see how to clean it up now though.
 
Posting a question on SO, if anyone is interested.
 
@RubberDuck eh, we're both guilty here
 
Gosh, that feed sure is brisk.
@Mat'sMug I'm afraid I was abetting you.
 
what's "abetting"?
 
5:17 PM
> Encourage or assist (someone) to do something wrong, in particular, to commit a crime or other offense.
 
if Service Locator is a crime...
 
I think what we need to do is pass Task<TreeNode> s back to the UI thread and let it update it as they come in.
But I've not looked at the code since that question was asked. I know you got it working truly async now.
 
It isn't a crime, just an offense.
 
@RubberDuck that would be ideal. same with the inspection results - better update the UI as soon as we have a result
@RubberDuck you pulled my changes on 'next'?
 
Not yet. Mother's day and all.
 
5:19 PM
lunch. bbl
 
5:56 PM
@Mat'sMug if Service Locator is wrong I don't want to be right...?
 
@FreeMan depends on what you're doing, really. but if you're doing DI/IoC, Service Locator is an anti-pattern ;)
@RubberDuck like I said on Programmers.SE, the RubberduckParser will never give us "partial" parse results; it's an all-or-nothing situation. What RubberduckParser gives the rest of Rubberduck isn't a parse tree, it's a parse tree and Declaration objects, each with their References resolved.
in order to resolve all declaration references, you need to have the entire project parsed
 
But that's not necessary for the treeview, just the find all references tool.
Disable it until it's done parsing.
Which frees up the treeview.
 
drawing the nodes takes longer than parsing the entire project
 
Oh. I had it backwards.
 
I posted an SO question, and got an answer inside of a couple minutes. Apparently, I was making a newbie mistake :(
 
6:11 PM
it happened to me more than my SO profile shows ;)
 
Deleted the question?
 
yeah
 
I accepted the answer, so I can't do that.
 
you can't delete a question once it has answers
 
No.
if (component.CodeModule.CountOfLines > 0)
{
    if (component.Type == vbext_ComponentType.vbext_ct_Document)
    {
        var text = component.CodeModule.get_Lines(1, component.CodeModule.CountOfLines);
        File.WriteAllText(filePath, text);
    }
    else
    {
        component.Export(filePath);
    }
}
Would that defuse the bomb?
There should probably be an else, though.
 
6:13 PM
yes, except component.Export needs to run regardless of CountOfLines
 
Then why can't we just put the condition in the other if?
Like this:
 
because when the component.Type != vbext_ComponentType.vbext_ct_Document then we want to Export the thing, instead of just creating a text file with just the code.
if (component.Type == vbext_ComponentType.vbext_ct_Document && component.CodeModule.CountOfLines > 0)
^^ works, but I don't like accessing component.CodeModule more than I need to
 
Oh, OK.
Well, create a variable to hold it.
 
@Mat'sMug there was an implicit ;) in there. Guess it wasn't obvious enough.
 
actually, doesn't. because the else branch would also run for vbext_ct_Document components without a line of code
@FreeMan oh. I always have Option Explicit on ;)
2
 
6:16 PM
Oh.
 
so it needs to be a nested condition
 
I'm just here for the comedy factor and to maybe learn a thing or two. Mostly the RD code is over my head, though I'm getting the general ideas...
@Mat'sMug well played, good sir! Well played, indeed!
 
:)
 
if (component.Type == vbext_ComponentType.vbext_ct_Document)
{
    int lineCount = component.CodeModule.CountOfLines;
    if (lineCount > 0)
    {
        var text = component.CodeModule.get_Lines(1, lineCount);
        File.WriteAllText(filePath, text);
    }
}
else
{
    component.Export(filePath);
}
 
^^ that
 
6:18 PM
Should I PR it?
 
sure
 
grumble....
I really hate async.
 
lol
I ♥ async
what's wrong with it?
you're going to have to bribe me to stuff a BackgroundWorker in our code base over async/await
 
Because it's terribly ambiguous sometimes.
 
6:23 PM
I'm going to call upon the almighty Python gods and say
> There should be one and only one obvious way to do a thing.
 
insta-merge!
 
Well, the trouble is backward compatibility.
 
[retailcoder/Rubberduck] Hosch250 pushed commit 33bfede4 to master: Defuse bomb
 
Now you can close the issue.
 
6:23 PM
\[[**retailcoder/Rubberduck**](https://github.com/retailcoder/Rubberduck)\] [**retailcoder**](https://github.com/retailcoder) pushed commit [**12f5b5d9**](https://github.com/retailcoder/Rubberduck/commit/12f5b5d948e271bf8979000d4e2718b48f6c8cae) to [**master**](https://github.com/retailcoder/Rubberduck/tree/master): Merge pull request #455 from Hosch250/next

Defuse bomb
 
oh crap, it went to master
 
Huh.
Bother.
 
@Duga you allright?
 
I submitted it from my Next branch.
 
@SimonAndréForsberg Duga just vomitted
 
6:24 PM
I guess I pulled it to Master, instead of Next.
You undo that, and I'll PR it to Next.
 
PR to next anyway.. @RubberDuck any idea how to undo that?
 
Or, we could just call it a hotfix ;)
 
yeah
lol
 
@Mat'sMug Yeah, but I'm not sure how to explain it and I can't do it right now...
 
meh
 
6:26 PM
You need to git reset --hard <commit-id>
Damn it. I know how I would do this problem, but the homework is asking for something completely different.
4 mins ago, by RubberDuck
> There should be one and only one obvious way to do a thing.
 
lovely classes where you need to unlearn stuff to get the marks...
 
I can't find the file in next.
 
Exactly that Mat.
 
I'm about to do it my way and say to hell with it.
Lowest score gets dropped anyway and I've aced the class so far.
 
6:30 PM
@Hosch250 oh crap, we went through some pretty major architectural changes
 
OK, I'll fork that branch.
 
yeah for a fresh next
s/for/fork
 
@RubberDuck just do it the right way ;)
 
That's exactly what I'm doing right now.
At least I think I am. Still a bit uncertain about async/await.
 
I might try to figure a way to pos this one for review.
 
There, that should work.
 
[retailcoder/Rubberduck] Hosch250 pushed commit 81d80910 to next: Fix Bomb
\[[**retailcoder/Rubberduck**](https://github.com/retailcoder/Rubberduck)\] [**retailcoder**](https://github.com/retailcoder) pushed commit [**d24e8731**](https://github.com/retailcoder/Rubberduck/commit/d24e8731b148ce5c2214fb3f5b03422440c633b0) to [**next**](https://github.com/retailcoder/Rubberduck/tree/next): Merge pull request #456 from Hosch250/next

Fix Bomb
 
@RubberDuck it's usually 1) get it to work 2) ask new question on CR 3) paste teh codez 4) explain teh codez 5) wait for reviews
 
Smarty mug.
 
6:41 PM
=)
 
Problem is, I feel like this code is completely hypothetical and mostly not mine.
I was given a template that did it synchronously and told to make it async.
So, is that my code?
 
Lunch, BBL.
 
by making it async, you're maintaining it, aren't you?
if it's short enough, you could even put the original code in blockquotes
 
I think I might.
 
6:57 PM
@Mat'sMug Now, is this an acceptable fix, or should we send some sort of signal about the problem?
Maybe we should create a new empty file and export it?
 
@Hosch250 nope. Until we figure out a format to export document properties with (#450), an empty code file is an empty code file ;)
 
OK.
 
document-type modules are special
you can't quite export them
they're the "Sheet1" and "ThisWorkbook" of the world
std modules, class modules and forms can be exported though. and should.
there's tons of metadata in there
 
Someone's OneNote installation is acting up, and they are whining to me about Windows 8.
 
could be worse
 
7:00 PM
I have a feeling it is completely their fault and they haven't the slightest idea about computers.
 
they could be bitching about your app not working on XP
 
Yes, could be worse.
Lol, you can only install it through the Windows 8.1 store.
 
@Mat'sMug sigh...... been there. Done that.
 
I put my email in the app for my app support, and all that has happened is I've become an MS OneNote supprt guy.
I've taking it out next release. Maybe I'll put a link to my Twitter account.
Glad to help you solve that problem.
I'm going to pick another one after I get my app cleaned up a bit better.
See you.
 
later!
 
7:11 PM
Stuff is still blocking the UI thread and I don't know why.
 
because you still have stuff running on the main UI thread that shouldn't be
#EverSoHelpfulMug
 
Thanks Captain Obvious. =;)-
 
start at the beginning, and follow the execution path
 
Okay. Starting over....
Just found out that the ever so helpful teach gave us an impossible assignment.
Smoke first.
 
email me that code, I'm curious!
 
7:30 PM
@RubberDuck There's a reason he's teaching and not coding for a living. Just sayin'
3
 
7:56 PM
And the task was impossible in two places....
Mother trucker....
 
8:27 PM
And I'm done with this nightmare.
 
so it was possible then?
 
Yeah, but it was f'd up and dirty.
        private async Task<string> ReadTextAsync(string filePath)
        {
            return await Task.Run<string>(async() =>
            {
                using (FileStream sourceStream = new FileStream(filePath,
                    FileMode.Open, FileAccess.Read, FileShare.Read,
                    bufferSize: 4096, useAsync: true))
                {
                    StringBuilder sb = new StringBuilder();

                    byte[] buffer = new byte[0x1000];
                    int numRead;
That's an async method that awaits on an anonymous async method.
That meets the requirements to spec.
And it just feels wrong.
 
You don't have to inline the async method there
Sleep(3000), really??
@RubberDuck it does
 
@Mat'sMug How would you do it? The method has to return a Task<string>.
I think I would have just made the whole damned thing an anonymous method to begin with. I don't see the benefit of nesting it like this.
 
8:49 PM
> :+1: thanks @Hosch250!
 
TTFN!
 
9:17 PM
@RubberDuck wouldn't this work?
        private async Task<string> ReadTextAsync(string filePath)
        {
            using (FileStream sourceStream = new FileStream(filePath,
                FileMode.Open, FileAccess.Read, FileShare.Read,
                bufferSize: 4096, useAsync: true))
            {
                StringBuilder sb = new StringBuilder();

                byte[] buffer = new byte[0x1000];
                int numRead;
                while ((numRead = await sourceStream.ReadAsync(buffer, 0, buffer.Length)) != 0)
 
> Glad to help.
 
9:36 PM
> Profile visits
529 +15.3%
7 hours ago, by Mat's Mug
> Tweets
56 +154.5%
Tweet impressions
5,223 +98.1%
Profile visits
487 +6.1%
Mentions
30 +87.5%
Followers
49 +12
Tweets linking to you
8
 
10:12 PM
Yeah. I guess it would. I would just have to change the signature of void that calls it to async void, right?
 
don't do async void. unless you're handling a button's click event or something
async Task is the new void
I'm not sure, not in front of my IDE right now, ...but I believe async Task<string> lets you return sb.ToString()
won't compile without the async there, though
 
 
2 hours later…
11:50 PM
reload incoming
 
4 minutes and dusts
I don't expect RD to "win" today though
 

« first day (339 days earlier)      last day (2841 days later) »