« first day (335 days earlier)      last day (2845 days later) » 

12:00 AM
RELOAD!
[Cardshifter/Cardshifter] 29 commits. 3 opened issues. 4 closed issues. 10 issue comments.
2
[retailcoder/Rubberduck] 2 commits. 1 opened issue.
[Zomis/Duga] 1 opened issue. 1 issue comment.
 
 
4 hours later…
4:10 AM
0
A: Making a tag for a Code Review community project

Mat's Mug Disclaimer: I own the Rubberduck project's GitHub repository. Should we create a rubberduck-vba tag? No. The project's name is "Rubberduck", so the tag should be rubberduck. Okay then. Should we create a rubberduck tag? I'm biased, but I'll say yes, and @rolfl's answer says pretty much ...

 
5:02 AM
 
 
6 hours later…
11:28 AM
I need to finish Git integration so I can go answer these questions...stackoverflow.com/search?q=VBA+source+control
 
11:59 AM
Can you answer this? Exploring the code of the Code Explorer http://codereview.stackexchange.com/q/90029?atw=1 #csharp
@StackCodeReview community is awesome! #Rubberduck now has its own tag! Thanks you CR!
 
 
2 hours later…
2:01 PM
Boy I'm glad RD parses async now. I forgot how big this project is.
 
@StackExchange s/Thanks you/Thank you/ ;D
 
morning! Quiet night, eh? you all go have a life yesterday?
 
Yeah. A little bit. I've been distracted by RL lately.
 
2:18 PM
good for you!
 
Thanks.
Holy carp! It's still parsing.
 
2:33 PM
Anyone have a clue why this "empty" inbox is showing that an email is present?
 
@RubberDuck speaking of that, I know what's wrong with the Code Explorer.
 
@Phrancis because Microsoft
 
right here:
                Control.Invoke((MethodInvoker)delegate
                {
                    Control.SolutionTree.Nodes.Add(node);
                    Control.SolutionTree.Refresh();
                    AddProjectNodes(project, node);
                });
AddProjectNodes is running on the UI thread
 
Well.... that would do it I suppose.
 
3:25 PM
> Take a Sub (or Function) such as the following, with multiple arguments split across multiple lines:
```vba
Public Sub Foo(ByVal Var1 As Integer, _
ByVal Var2 As Integer)

Debug.Print Var1
Debug.Print Var2

End Sub
```
If `Var1` is renamed to `Var3` using Refactor -> Rename, it results in the following:
```vba
Public Sub Foo(ByVal Var3 As Integer, ByVal Var2 As Integer)
ByVal Var2 As Integer)

Debug.Print Var3
Debug.Print Va
 
oh boy. that one's going to be hard.
 
@ticker...... are you serious?
0
Q: Error (Run-time error 5) will not raise when "On error resume next" is active

CBRF23I've provided the actual code I'm using below. The exact condition I'm trying to handle is the strCurrentRev argument as a zero-length string. (e.g. strCurrentRev="") If I comment out the error handling statements, trying to execute the ASC method on a zero-length string throws Run-Time Error 5...

 
Hint: no error will ever be raised when On Error Resume Next is active ;-) Avoid it unless you know what you're doingMat's Mug 5 secs ago
 
> Thanks for your feedback! Our VBA grammar has a number of limitations: numbered lines, comments, nested conditional compilation statements, ... and line continuations are a problem.

More specifically, the parser doesn't even see the line continuations. Since we're using a `TokenStreamRewriter` to actually perform the renaming, this issue may be very hard to fix without addressing the grammar issue with line continuations.

But it might not be impossible either. This is a very interesting
 
3:36 PM
@Duga Well.... that sucks.
Might be a good reason to re-introduce the concept of a physical line??
Idk.
 
that's a seriously major undertaking
oh fuck off
@Mat's Mug, your comment is incorrect. The error IS raised, however this statement tells the run-time environment to ignore the error and continue execution. Please do not confuse anyone by providing incorrect information. ;) — CBRF23 33 secs ago
of course it's raised and you can check for Err.Number. But for the common of mortals it's perhaps easier to understand that On Error Resume Next is shoving runtime errors under the carpet - and that's in no way an incorrect statement. — Mat's Mug 16 secs ago
 
Ummmm. No. No it is not the best way to trap and handle specific errors differently. Not at all. No no no no no. — RubberDuck 9 secs ago
That code might have just inspired a blog actually.....
 
3:51 PM
0
A: Error (Run-time error 5) will not raise when "On error resume next" is active

Mat's MugYou're not using the right tool for the job. Runtime errors should be handled, not shoved under the carpet (because that's what On Error Resume Next does - execution happily continues as if nothing happened). You need to try to avoid raising that error in the first place. What's causing it? lng...

 
4:37 PM
Oh... shit
Almost accidentally did SQL injection XD
 
Little Bobby Tables called to say hello.
2
 
5:19 PM
v1.22 just hit 200 downloads!
2
 
@Phrancis Oh... shit OH SNAP!
 
@Mat'sMug shouldn't people be downloading 1.3? Considering all the stuff that running 1.22 can break if you're not careful?
but, yay for downloads!
 
I think it's still marked as a pre-release.
@Mat'sMug we should chuck this into the parser and see if it breaks the grammar.
Select Case filterBy
    Case Is <> SmartScheduleFilterBy.CYCLE
        Set filterRecords.CYCLE = CreateNewFilterRecordset(CYCLE)

    Case Is <> SmartScheduleFilterBy.STORE
        Set filterRecords.STORE = CreateNewFilterRecordset(STORE)

    Case Is <> SmartScheduleFilterBy.TEAM
        Set filterRecords.TEAM = CreateNewFilterRecordset(TEAM)
End Select
 
@RubberDuck it is. I need to fine tune identifier resolution
...and get the code explorer async code right.
Oh and I just had a flash! ..hold on.
 
@RubberDuck I was really wondering... WHY, but then I figured you need to test RD
 
5:25 PM
@skiwi Why? Because I need to take an action only when it isn't that type... odd situation to be sure.
 
@RubberDuck Is that the easiest code there is for that?
 
Short of going OOP, yes.
 
Uh ok
 
Or having three separate procs to do it..
 
VBA, enough said :D
 
5:27 PM
It's an ugly situation admittedly. I don't like it much.
 
> I'm pretty sure there's an [extremely] easy fix for that one, but it involves rewriting the multiline signature on one line.

Would that work for you? The idea is to avoid breaking the code at all costs.
 
I just got done with a side-by-side meeting with a new IT guy
 
Got to show them around SNAP and all the other crappy systems we use. I also mentioned the injection problem to him...
 
5:30 PM
@Phrancis keep telling them. Someone will listen eventually.
2
 
That's what I keep telling myself...
 
Well then, short of avoiding avoidable errors, the correct way to handle them in VBA is to jump to an error-handling subroutine with On Error GoTo [label], handle the error, and if the error is recoverable to resume with a Resume Next instruction - inlining error handling with Resume Next is a dirty way of going about it - you're intertwining the procedure's logic with error-handling, which obscures the intent of the code. — Mat's Mug 12 secs ago
 
5:58 PM
0
A: Error (Run-time error 5) will not raise when "On error resume next" is active

RubberDuckI was asked to elaborate on a better way to handle the error, and this is the easiest place to do so. I think it's okay, because in a way it does answer the original question as well. However, let me say first that the right thing to do here is to avoid the error entirely, but for the sake of com...

 
6:37 PM
[BEST OF] We're off for two days! But let's remember this great russian game. Who will dare? http://www.commitstrip.com/en/2014/05/16/russian-roulette/ http://t.co/JadJ0N4jWY
 
7:04 PM
@StackExchange LOL that's hilarious
 
7:15 PM
@FreeMan Call serves no purpose, it's just a deprecated syntax for making a procedure call. — Mat's Mug 16 mins ago
@Mat'sMug I've never seen Call used when invoking a method of an object...
deprecated or not
 
8:07 PM
sigh
Or you could just.. .CommandText = "SELECT * FROM table WHERE parentid=" & myparam & ";" — Luigi Mackenzie C. Brito Apr 8 at 10:16
 
8:27 PM
@Mat'sMug I think this might convince you that PostgreSQL is a really cool DB engine!
 
9:12 PM
room topic changed to VBA: Discussions about anything VBA (and/or VB6) [fun] [pushing-it] [rubberduck] [rubberduck-programming] [vb6] [vba] [whiskey-tango-foxtrot]
I wanted that tag shortcut here :)
 
Nice!
Wow, this is like sorcery
select *
from json_populate_recordset(
  null::x,
  '[{"a":1,"b":2},{"a":3,"b":4}]'
);
>
 a | b
---+---
 1 | 2
 3 | 4
 
lol
pretty cool
 
Turns out we store game replays (and other things like user decks) in JSON, so we might be able to just shove that in a DB table and extract stats from that!
 
 
2 hours later…
10:53 PM
That is pretty cool!
 
8
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...

All right, so let's act like I only know C# so well and don't feel like necessarily reading all that code... but I do want to try help, and I do have a pretty decent (I feel) understanding of multithreading
So let me see if I understand the issue correctly...
In the background, you're trying to "explore the code" to find what belongs in the tree, and then you intend to update the UI (which obviously must be done in the UI thread)
And you'd like the UI to get an update every time the background is done finding a particular object, correct?
Right?
 
11:10 PM
Ahhh, I'm not sure if multithreading is going to be possible. Office apps are single threaded I believe and the extension runs under the parent thread.
i.e. the Office app runs the extension for you.
 
Why... would that prevent you from spawning extra threads?
 
An ex-colleague of mine used external libraries to launch additional processes with callbacks into Excel.
but that was launching external processes I believe.
 
Launching extra processes is extraordinarily different from launching multiple threads.
 
yup, that's what I'm trying to say.
Not sure if launching additional threads is going to be possible, but I stand to be corrected.
 
Why wouldn't it be possible though?
That's what I don't understand.
If I make a single-threaded .exe, if can call stuff out of a .dll that does multithreaded stuff no problem.
I'm not sure what you're basing this assumption on.
I'm not saying it would definitely allow multithreaded work. I'm just saying I don't see where you make that connection.
 
11:16 PM
Can a single threaded process create more than one thread?
 
Yes. The only thing that makes it single-threaded is the fact that it's not creating multiple threads.
How else does any process become multithreaded?
They all have to start with a single thread.
 
Oh really? I thought that when the process started it had to be STA or MTA
I didn't realise it could alter that.
 
Everything starts as single threaded.
 
cool.
 
So... @Mat'sMug, this is Swift/stub, but this would be my approach:
@objc public protocol CodeExplorerDelegate {
     func codeExplorer(explorer: CodeExplorer, didFinishExplorering results: Array<CodeResult>)
     optional func codeExplorer(explorer: CodeExplorer, didMakeProgress results: Array<CodeResult>)
}

@objc public class CodeExplorer {
    public var workerQueue: NSOperationQueue = NSOperationQueue()
    public var callbackQueue: NSOperationQueue = NSOperationQueue.mainQueue()

    public weak var delegate: CodeExplorerDelegate?

    public func doWork() {
Where obviously the second argument in the "codeExplorer" function calls on the delegate is the actual data object representing explorered code.
Probably not an Array, but whatever it is.
I don't know if it's even remotely possible to translate that nicely to C#.
 
11:36 PM
did you read Matt's answer to himself: codereview.stackexchange.com/a/90059
 
@Rossco the C# code can run multithreaded without any issues.
 
Yeah, but I don't understand what all is happening there exactly.
Does my Swift stuff make sense for what I'm doing?
 
Hmm
 
I can explain it. Multithreading stuff is complicated. I feel like I understand it pretty well, and I feel like I'm pretty good at it in Objective-C/Swift, but it's something that is handled so differently from language to language.
 
Basically what you want to do is populate the nodes in the loop with:
var node = new TreeNode(project.Name + " (parsing...)");
node.ImageKey = "Hourglass";
node.SelectedImageKey = node.ImageKey;
 
11:40 PM
Kids bath time, gimme a few minutes
 
Not to interrupt, but my phone is dying, so... I'm looking at this code here and I'm wondering why we don't create some kind of Parsed event. Inject a single instance of the parser and notify all the different clients that their "cache" is invalid. github.com/retailcoder/Rubberduck/blob/master/RetailCoder.VBE/…
 
And then launch the parsing in separate threads with a callbacks to update the nodes.
 
I like that
 
yeah I'm just trying to find the syntax to make that happen...
 
@nhgrif your code makes perfect sense. I'm just not sure... that ^
 
11:47 PM
Of course it makes perfect sense.
Never forget.
 
You wouldn't let me if I tried. =;)-
 
We need something that fires up some ParsingStarted and ParsingCompleted events, which the code explorer, todo explorer, code inspections, refactorings, etc. - ..everything that needs a ParseResult can tell everyone else "guys I'm refreshing the parse tree" and then that something tells everyone "ok kids, if you need to refresh anything, here's the latest parse tree"
 
When you parse something, do you cache the previous parse or is it a reparse of everything?
i.e. is there any way to only parse the stuff that's changed?
 
Only modified modules get completely re-parsed
 
ok, did you find a way to determine those that have changed?
is that the hash thing again?
 
11:51 PM
If it's a comma in a 20k LoC module.... yeah
 
awesome ;-)
 
@Mat'sMug So... Objective-C/Swift would do this with something called NSNotificationCenter... I doubt there is something similar to it in C#, but I can give you an example of how I might write the class myself.
 
I also think we need to separate the concerns in the code explorer. Parsing and updating the code explorer are two related but different things.
 
So, brb with some pseudo code.
 
you're using winforms controls in the explorer?
 
11:54 PM
Well that something I'm talking about actually replaces the IRubberduckParser dependency
@Rossco the whole RD UI is WinForms
@nhgrif cool!
 
is WPF an option?
it has way better binding.
 
I wish
 
Hmm... Since ToolWindows don't get destroyed when they close, we should figure a way to catch the them closing and unregister the parsing watching event.
 
But the docking toolwindows make it..
Challenging
 
That ^
 
11:56 PM
@RubberDuck that's another issue I'm swallowing and pretending it's not there if you look closely at the FindAllReferences presenter, I fucked up somewhere...
 
I've not even looked at that code to be honest.
 
@objc public protocol CodeExplorerDelegate {
    func codeExplorerDidStartExploring(explorer: CodeExplorer)
    func codeExplorer(explorer: CodeExplorer, hasUpdatedResults results: AnyObject)
    func codeExplorer(explorer: CodeExplorer, didCompleteResults results: AnyObject)
}
^ this is basically just an Interface, if that's not obvious.
and the CodeExplorer always passes itself.
 
@Rossco Last I checked we couldn't even add a WPF control or window to the project.. I might have missed something thought.. but also since we're a dll things are a bit different, we can't leverage styles the same way we would in a standalone app
 

« first day (335 days earlier)      last day (2845 days later) »