« first day (321 days earlier)      last day (2859 days later) » 

00:00
RELOAD!
[retailcoder/Rubberduck] 2 commits. 1 opened issue. 1 closed issue. 6 issue comments.
@ryankey721 using listeners implies walking the entire parse tree; we try to do it as little as possible. 1.2x had pretty much a listener per inspection - which was dumb now that I look back.
We make 2 passes: first one identifies all declarations, 2nd locates identifier usages (and assigns each identifier their respective IdentifierReferences)
I have one listener left to deprecate; the extract method refactoring needs to start using the Declarations instead of walking the parse tree.
Lol. @ryankey721 I've yet to touch that blasted parser... Been at it six months or more. Damn thing's black magic as far as I'm concerned.
00:15
@RubberDuck I think that's probably how I'll treat it for the time being... I'm still trying to get a solid grasp of the => operator.
Ahh lamdas are fun once you get it. Don't let Mug's code scare ya.
I think my problem was that I saw "Lambda" and thought, "Oh great, those were a lot of fun in Lisp" and then got hit with what I think are called LINQ queries?
I can see the similarity, but man the syntax is throwing me off.
(parameters) => { anonymous method }
The right side of a lambda is a method / delegate
parseResult.Declarations.Items.Where(parameter => { anonymous method })
That ^^
00:27
@ryankey721 The Where method takes a predicate parameter - that's a function that takes a parameter and returns a bool
.Where(x => x.Name = "Foo")
K, so it's returning any "parseResult.Declarations.Items" for which the { anonymous method } is true?
^^ returns all elements where x.Name is foo. Except that one has a syntax error
I'm guessing that it's assigning Foo to x.Name?
I'm on my mobile. Cut me some slack.
00:28
@ryankey721 exactly. It runs for each element in the IEnumerable
VB# FTW
@RubberDuck Me too ;)
Kind of.. It's lazy evaluated.
Which is cool, but drives me nuts sometimes.
Okay, and how does that compare to .Select( => )?
Same thing, except Select takes a different type of function that returns whatever you want
00:31
I've only used select in the context of creating new objects.
Ok.. I think I have an example.
.Select(x => x.Name)
It's used for projecting a selection into a new shape
Wow, that was a lot more helpful than staring at code. Thanks
Yeah, or .Select(x => new { x.name, x.value })
Returns a "list" of strings populated from the Name property.
I have to go for today, see you all tomorrow
00:33
See ya!
And mine returns an enumerable of an anonymous type
Later!
Battery's dying.. bbl
Got a new follower on Twitter
01:20
Going to bed. Got some sleep to catch up.
Woah, 1.22 just had like 10 downloads! 39+79, 118 downloads!
 
12 hours later…
morning, all
glad to see you took a 12 hour break
Good morning
13:32
> 125 downloads
Hi!
13:49
@FreeMan Yeah.. I woke up at like 4:15am... then slept some more, ...and woke up late lol
14:01
of course you earned the get up late, since you woke up so early...
Morning @all
14:27
Morning
14:39
@sᴉɔuɐɹɥԀ Hey there.
@sᴉɔuɐɹɥԀ 'sup?
15:33
hmm I wonder.. did I just do the same mistake as yesterday here?
0
A: VBA Text Array - Scan two columns rather than one

Mat's MugConsistent Indentation. The first thing I would address, is the indentation. Improving code that isn't properly formatted is just... not right. Here are the signs: Sub arraycolumnmatch() Dim txtArray As Variant, T As Variant Dim I As Long, J As Long And: Next I End Sub But also: 'Check ...

If Range("G" & j).Value = T Then
    Range("G" & i).Value = T
Else If Range("F" & j).Value = T Then
    Range("F" & i).Value = T
End If
^^ is that equivalent to OP's twin loops?
I think not... He has a different column for each J loop ("G50000" and "F50000"). They could both be in the same T loop I believe, but if the (rows in G) != (rows in F) then yours will be off. Right?
yeah, but I'm assuming the data is a table and that OP is just trying to find the last row
I've recommended to actually pull that step out of his loop, because, the last row isn't going to change between iterations
Yeah, with that assumption then yours is the same.
Oh, i didn't see his table snippet. Your way actually fixes an error that his has. Nice job.
Ugh, tried to track down a RD error that I was getting on an in-house Access project. I think I've hit a brick wall...
15:51
What's up?
Coders are never satisfied http://www.commitstrip.com/2015/04/13/coders-are-never-satisfied/ http://t.co/qjNJYS8sIY
2
^^ seen that one? It's hilarious!
I'm getting an exception "System.NullReferenceException" in Rubberduck.Parsing.Symbols.IdentifierReferenceListener.GetClosestScope(IEnumerab‌​le`1 declarations, ParserRuleContext context) on line 477.
That is "var parentMemberName = memberProcedureCallContext.implicitCallStmt_InStmt().Stop.Text;"
I think it's stemming from my project having this as its parent: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Vbe.Interop.Application'.
Haha, I'd never seen that comic.
You wouldn't happen to have your debug build available would you?
I'm curious about what the statement is that breaks it
What do you need?
...not sure. Perhaps a try/catch and a breakpoint in the catch block, to inspect the memberProcedureCallContext that blows up
And that code is just totally wrong. I mean, I need to refactor that crap before releasing.
That and the extract method that's been bothering me. I can feel the parse tree being walked for no reason when I bring up that dialog.
@ryankey721 but that cast exception is intriguing, where is it occurring?
16:19
Okay, I caught the exception, "Object reference not set to an instance of an object." I have the memberProcedureCallContext. I think I have the text that it's choking on, but it's fairly long. What do you recommend for posting it in the chat?
meh, just paste it :)
+ InputStream {Option Compare Database
Option Explicit

Private poSendMail As vbSendMail.clsSendMail

Public Sub WorkingOrdersEmails()

Dim rs As DAO.Recordset
Dim lastMessage As Integer
Dim poSendMail As New clsSendMail

Set rs = CurrentDb.OpenRecordset("EmailsToSend")

Forms("Auto-Emails").email_status.Caption = ""

If Not rs.EOF Then
With poSendMail
.UseAuthentication = Settings.getValue("emailAuthenticate")
.SMTPHost = Settings.getValue("emailSMTP")
.from = Settings.getValue("emailFrom")
.FromDisplayName = Settings.getValue("emailFromName")
Not sure how to narrow it down from here.
wait no, that's the input stream - that's the entire module ;)
and with it I can repro the NRE here
but I don't have VS handy
Haha, like I said, the parser is a black box to me.
if you break in the catch block, you can hover the memberProcedureCallContext in the var parentMemberName = memberProcedureCallContext.implicitCallStmt_InStmt().Stop.Text; line. Expand the children field; one of them should be an ImplicitCallStmt_InStmtContext object .. but apparently isn't, otherwise it wouldn't blow up. Or is it the memberProcedureCallContext that's null?
you can narrow it down a bit by getting me the memberProcedureCallContext.Start.Symbol.Text
oh crap. I think it's the With block frakking it up
16:26
0
A: Which Oracle database model is better. Friendly bet

PhrancisI don't think your concerns about storage space are that significant, considering modern databases can easily contain terabytes worth of data. Rather, I think you should worry more about consistency and proper normalization. In that regards, I think your model is better. You have one unique ID_...

Just dropping this here in case someone has SO votes left ;D
Yeah, I have the memberProcedureCallContext.Start.Line, and look at that line it is in the With block at ".Send"
todo: figure out how to resolve With blocks
It looks like it chokes on that code each time that it appears.
On the plus side, adding that try/catch makes it so my access stops crashing and I can actually get work done
Though it doesn't help that I forgot what I was doing...
yeah, but it's swallowing the exception and breaking RD ;)
lol
@ryankey721 what's the point of that?
16:29
My calculator works!
3
nice!
1 + 2 * 3 - 4 = 3
I was VisitChildren when I needed to just Visit
GD bad API if you ask me.
@ryankey721 I can confirm it's the With blocks breaking it. I no longer get the NRE if I replace all With block variable references with poSendMail calls
@RubberDuck did you end up traversing downwards?
@Mat'sMug Yes, but in a smart way.
> This code throws a `NullReferenceException` in `IdentifierReferenceListener.GetClosestScope`:

Dim foo As New FooBar
With foo
.Bar = 42
End With

The `IdentifierReferenceListener` needs to be able to *resolve* `With` block variables.
16:37
So, given that tree right there.
From compileUnit, I walk into the first Expression.
Then, at each level, I walk left and right.
When I hit a "Number", I return back up the tree.
So, it's absolutely right for multiplication to be at the bottom of the tree.
Because it's the first thing to be fully evaluated.
So, basically, walk the whole way to the bottom of the tree, then start evaluating your way back up.
Here's the whole damn visitor class.
    class MathVisitor : BasicMathBaseVisitor<int>
    {
        public override int VisitCompileUnit(BasicMathParser.CompileUnitContext context)
        {
            // There can only ever be one expression in a compileUnit
            return Visit(context.expression(0));
        }

        public override int VisitNumber(BasicMathParser.NumberContext context)
        {
            return int.Parse(context.GetText());
        }

        public override int VisitAddition(BasicMathParser.AdditionContext context)
@RubberDuck and that's why I think your grammar has operator priorities backward
There's not much to review.
include your .g4 in the post ;)
I don't think so. How else would you do it?
Will do.
I want to write some tests quick to make sure it does what I think it does.
food first
@RubberDuck that actually makes sense to me...
16:42
you officially know more about using ANTLRWorks and visitors than I do ;)
Which means I might be implementing the Unreachable Code Inspection... Awesome. Lol
I think that's how we would do that. A Visitor could actually interpret and simulate the execution.
just make sure you implement that interpretor code somewhere it can be reused - and go for it!!
It would take two passes I think. One with the listener to build the symbol table, a second with the visitor to simulate.
the symbol table's pass is done already
there's 2 passes occurring: one to get all declarations, another to get all identifier references
so you just need to visitor ;)
17:06
For n = 1 To 100
    If n > 100 Then
        MsgBox "unreacheable code!"
    End
Next
I think we can live with a "known issue" about line numbers breaking the parser. But line labels are too common to release without a parser that supports them
imagine..
> Known issues:
1. Properly handling runtime errors breaks the parser.
@Mat'sMug meh, don't see an issue with that... ;)
17:28
Do yall know any SQL reference sites better than w3schools. my google-fu is weak.
fair but that's on a one by one basis
better for finer details than the basics.
@cheezsteak Microsoft SQL or another DBMS?
I just pulled up MySQL. Maybe there is a Wiki-Book?
YUS
Microsoft: [MSDN](https://msdn.microsoft.com/en-us/library/bb510741.aspx)
MySQL: [Oracle docs](http://dev.mysql.com/doc/)
PS: Do yourself a favor and don't use MySQL; there are better free DBMS out there. ;)
17:36
@sᴉɔuɐɹɥԀ Well I am stuck with Access right now..
in The 2nd Monitor, 7 mins ago, by RubberDuck
Anyone have any idea why I wouldn't be able to see a public static class in another project in my solution?
@Mat'sMug any idea? ^
C#?
is there a reference to project A in project B?
Yeah. I'm a bit baffled htere.
Yup.
if you type the static class' name in a valid context, does R# suggest to use the type in question?
Don't have R# on this machine...
I can call it internally in my project, but not externally.
17:43
@cheezsteak MySQL is a bit better than Access, not by a long shot though
OK... it's a lot better than Access, but still sucks in comparison to real RDBMS
@RubberDuck you sure the type and the member in question are public?
wtf, dude
Right?
Could it be because my namespace and class name are the same?
@sᴉɔuɐɹɥԀ What would be a better RDBMS?
17:50
@cheezsteak It depends on your overall technology stack. If you're mostly working with Microsoft tech, then Microsoft SQL Server is good. If you want more of an "open" stack, or non-MS tech, the PostgreSQL is good
Postgres has extensions for many non-Microsoft techs
18:02
To be fair, there is one exception where I actually would recommend MySQL; that is, if you are using PHP a lot, because PHP is designed around MySQL, and MySQL is bundled with most PHP dev packs
then you can ask questions on CR :)
I tried learning PHP a few years ago.
no beuno. I think I would use MariaDB before MySQL, but my company runs MySQL so...
My company runs MySQL also. I'm forcing SQL Server down their throats ;)
Can I do function composition with Queries?
PHP/MySQL is kind of a double-edged sword. It's good to know for the same reason as JavaScript is: It's everywhere if you're doing web dev
@cheezsteak Huh?
18:12
> 85+43 downloads
I wonder how many think "wow, that's way too buggy!" ..and uninstall.
@cheezsteak By all means, if you're stuck with MySQL, the Mug and I unfortunately have had a good amount of experience with its quirks ;)
@sᴉɔuɐɹɥԀ If a query take parameters can I use that query inside of another query?
Oh. Yes indeed, AFAIK
You would just need to make sure the data you access within your inner query is accessible to your outer query; there's a number of ways of doing that
In MySQL you can do that with OUT parameters, like this. You can also put an output result set into a temp table, and access that with your outer query
@sᴉɔuɐɹɥԀ Actually, I haven't touched MySQL ever since I'm staging all that data on SQL Express ;)
#YayCTEs
Yeah, CTEs are probably the thing MySQL is most sorely missing.
18:26
Only very skilled experts will spot a difference http://www.commitstrip.com/2015/04/23/when-i-have-to-explain-the-different-jobs-in-it/ http://t.co/iUsY5XnhXt
18:40
@cheezsteak My condolences.
Use the the MS SQL references, but understand there will be differences and they won't make any sense
because Access = mentally challenged
@FreeMan I got it to work but I have little understanding of why... I just drag lines between tables and magic happens. I look at the SQL generated and its just tons of INNER JOINs
@cheezsteak depends on how you're writing your queries
if they're all defined in Access and you're just calling them, then yes you can have
Query A takes parameters
Query B selects from Query A
@Mat'sMug You don't track uninstalls, do you?
But if you're calling them from somewhere else, I've found it easier to rework the queries so I don't have that...
@cheezsteak It's not just that they're inner joins, it's the funky syntax and that massive amount of ()(((())))()(()((()))()()()()())))))) that you get
2
@skiwi How could he?
18:46
I use the dragondrop to get the joins then usually hand write the rest because it makes more sense to me that way.
@cheezsteak No clue honestly
@FreeMan How would I link parameters from the input table to the composed query?
@FreeMan Don't forget the brackets too, more like ([(])[[]]()(][][)([])()))][])
I usually develop the FROM clause in the Access GUI, then write the rest by hand in VBA building the parameters in by variable so that i have a complete query string with no parameters. I found that to be much easier.
@sᴉɔuɐɹɥԀ Oh. My. Gawd!!!! don't remind me!
:D
SELECT *
FROM ([Contracts] INNER JOIN SKUs ON [Contracts].[SKU_number] = [SKUs].[SKU_Number]) LEFT JOIN [Claims] ON [Contracts].[Contract_Number] = [Claims].[Contract_Number]
ORDER BY [Contracts].[Contract_Number];
Wrote this yesterday for work ;D
18:57
Can't be Access, not enough (()()(((()))()()())))()()()))))))..... (I may have missed one)
5
you can take the [] out and it will work just fine though. Just use normal column names w/o spaces and you're fine.
Yeah, I did originally, but Access put them there after I closed out and reopened it -_-
19:13
@skiwi nope.
@cheezsteak well we could have a custom action in the uninstall step, to send an http request to some url - but I don't want to go there.
19:49
@Mat'sMug No, no one wants rubberduck to phone home
exactly
@FreeMan are those just sloppy byproducts of code generation and deletion?
if only... nope [ and ( are Access' bestest friends!
@cheezsteak rather byproducts of using the designer to write SQL
ReDim Preserve fun(ubound(fun)*2)
Alright, y'all plenty of room, fill 'er up!
enjoy your weekend, I'm out.
19:52
later!
20:45
@Mat'sMug Perhaps just including an optional feedback mailto: on uninstall? Would not be too intrusive yet give the opportunity to give feedback
Heck, even make it anonymous
IDK, installers are already enough of a pain as it is ;)
Haha ok
I guess a "Feedback" web form would be plenty for all intents and purposes :)
> Confirming that this happens in Excel and Access 2013 32-bit running on a 64-bit machine. Below is a dump that I was able to grab from C:\Users\{username}\AppData\Local\Temp. They get deleted very fast. ``` <?xml version="1.0" encoding="UTF-16"?> <WERReportMetadata> <OSVersionInformation> <WindowsNTVersion>6.1</WindowsNTVersion> <Build>7601 Service Pack 1</Build> <Product>(0x30): Windows 7 Professional</Product> <Edition>Professional</Edition>...
<BuildString>7601.18798.amd64fre.win7sp1_gdr.150316-1654</BuildString> <Revision>1130</Revision> <Flavor>Multiprocessor Free</Flavor> <Architecture>X64</Architecture> <LCID>1033</LCID> </OSVersionInformation> <ProblemSignatures> <EventType>APPCRASH</EventType> <Parameter0>EXCEL.EXE</Parameter0> <Parameter1>15.0.4701.1001</Parameter1> <Parameter2>54e30a7b</Parameter2> <Parameter3>clr.dll</Parameter3> <Parameter4>4.0.30319.18444</Parameter4> <Parameter5>52717e84</Parameter5>...
<Parameter6>c0000005</Parameter6> <Parameter7>000b6a64</Parameter7> </ProblemSignatures> <DynamicSignatures> <Parameter1>6.1.7601.2.1.0.256.48</Parameter1> <Parameter2>1033</Parameter2> <Parameter22>db80</Parameter22> <Parameter23>db80f48904568459ee85fcd5a01bc86f</Parameter23> <Parameter24>3e47</Parameter24> <Parameter25>3e470a8ab967a5f820ae39efbc1069ee</Parameter25> </DynamicSignatures> <SystemInformation> <MID>37AADDA1-2047-4F84-9FAF-80F4BE3CFE6B</MID> <MarkerFile>103C_HP_WS_Z400...
Workstation_Y53335X_0U_Q2UA020_EU_4A_I0B4Ch_SHP_VD_B786G3 v03.07_T100406_W748-1_L409_M8176_J80_7Intel_86A5_93.19_#130816_N14E41684_(VS933A‌​V)_X_CD6_Z_2_G10DE0638_Ohp DVD A DH16AAL_DDEL4026</MarkerFile> <SystemManufacturer>Hewlett-Packard</SystemManufacturer> <SystemProductName>HP Z400 Workstation</SystemProductName> <BIOSVersion>786G3 v03.07</BIOSVersion> </SystemInformation> </WERReportMetadata> ```
Whoops...
lol we're used to it, no problem :)
21:18
@Mat'sMug So, are we just going to have to create the keys manually for the 64-bit version?
I've been busy and haven't heard anything.
probably
actually, no.
0
Q: Is it possible to throw an exception if the input isn't valid?

RubberDuckI have a simple ANLTR grammar and accompanying Visitor. Everything works great, unless the input is invalid. If the input is invalid, the errors get swallowed and my calculator comes out with the wrong output. I've tried implementing an error listener, over riding the Recover method of the lexer...

I'll add a custom action step in the installer to run regasm.exe automatically
..but @Rossco might have come up with an InnoSetup script by then, and we'll have a single installer for both x86 & x64
21:21
Hey, I wanted to try github.com/retailcoder/Rubberduck/issues/397. Can I bounce my idea off of you guys to make sure there isn't a more elegant solution?
21:36
@ryankey721 sure!
(heading home)
21:55
Heck, pimp:
1
A: VBA Text Array - Scan two columns rather than one

Mat's MugConsistent Indentation. The first thing I would address, is the indentation. Improving code that isn't properly formatted is just... not right. Here are the signs: Sub arraycolumnmatch() Dim txtArray As Variant, T As Variant Dim I As Long, J As Long And: Next I End Sub But also: 'Check ...

@Rubberduck203 @MIERoss what's that smell? Oh look! It's our InstallShield installers burning to ashes!!
@Mat'sMug Well, my first thought was to just create a string array with all of the worksheet and workbook events as listed on MSDN, then compare them against the declaration.IdentifierName. But, that's not very flexible and I would need to do it for all other vbext_ct_Document types, like Access Forms. So now I'm wondering if there's a way to get a list of event procedures from VBE, but I'm not finding anything.
22:12
Not that I'm aware of @ryankey721 and I'm pretty familiar with the API at this point.
The API doesn't even really have a good concept of what constitutes a procedure, let alone an event procedure.
@Mat'sMug we can tell when a VBProject is removed from the current project. msdn.microsoft.com/en-us/library/aa445389(v=vs.60).aspx
I think...
22:39
@ryankey721 I had a similar thought process, although I would have just went with Workbook_* and Worksheet_* for Excel, UserForm_* for forms, and then all the other app-specific ones too - instead of hard-coding them all... although that would probably be much safer in terms of false positives
But then how flexible does it need to be? It's not like the Office object model is going to change on us right? ...right? Lol
@RubberDuck Ooh nice!!
That might fix the access violation exception!!
23:02
@ryankey721 The only other way I can think of, involves reflection over the Office object model itself.. and that would be waaaaay overkill imo
23:21
Yeah, I was just noticing that the code editing window identifies objects and available event procedures. I think my problem is that the user can create a form button that gets a custom name and event procedures. So sub mybutton1_Click() would activate the inspection.
Nope, that's solved already - I locate all controls on user forms and any procedure that starts with ControlName_* is ignored
That also enables refactor/rename of form controls :)
Assuming no one is dumb enough to name something that isn't an event procedure with that name.
Well then, too bad.
That would be a false negative if the proc isn't used.
I can live with that one ;)
@MIERoss @PeltierTech @WessexBob I'm not sure if anyone here is interested, but we welcome pull requests. https://github.com/retailcoder/Rubberduck/
Yeah. Better to under report than over report.
The plan is to also locate Shape objects on worksheets, and treat them the same, so refactor/rename wouldn't break macros triggered by activex controls on a worksheet
Or form controls on a worksheet either
23:39
Cool, then I'll just do the work of ignoring Worksheet_* etc. classes in that inspection. That makes life easier.
classes procedures ;)
Haha, I don't know how my phone autocorrected cases to classes...
You can go further and only ignore Worksheet_* and Workbook_* when the component type is vbext_document (something like that)
And UserForm_* only when the module is a userform ;)
Telling a worksheet from a workbook might not be possible though
You can access the component easily via the declaration or reference's QualifiedModuleName
Actually it would be a Declaration, not an IdentifierReference

« first day (321 days earlier)      last day (2859 days later) »