« first day (719 days earlier)      last day (2461 days later) » 

8:00 PM
and... that code shouldn't be in the view
 
I'm just going to skip the ones that take anything other than RubberduckParserState as a ctor injection.
@Mat'sMug Yeah, I'll look into moving it out.
 
doesn't the project reference Ninject?
you'd have a much easier time working this out with proper DI
hmm looks like it doesn't
 
Referencing it now.
 
hmm looks like most of 'em only have a RubberduckParserState dependency
still it's better to have it DI'd, so we don't have to worry about breaking the website when we change things in the actual duck
public ParameterNotUsedInspection(VBE vbe, RubberduckParserState state, IMessageBox messageBox)
 
Yup.
OK, I have it all ready except the user input and the DI.
 
8:08 PM
lol
 
And it is out of the view.
 
looks at a pile of 4 tires "look, a car!"
good job!
 
@Mat'sMug Nah, right now, it is more like a car without the tires.
And an empty gas tank.
 
and no engine
 
The engine is there.
And so is the steering.
 
8:10 PM
well you're on the right path then
keep going!
that's utterly cool :)
 
The windshield isn't, though.
 
that IMessageBox dependency on ParameterNotUsedInspection smells; it's really a dependency of the quick-fix class
the thing needs a ResultFactory of some sort
actually all inspections should have RubberduckParserState and IInspectionResultFactory dependencies, period.
2.1
for now let's leave it
@Hosch250 walk me through what you're going to do to set up ninject :)
where's your composition root going to be?
(hint: you do not want to re-do this work for every single request)
 
8:34 PM
> ![refs](http://i.imgur.com/TYfQgLD.png)

The visual clue is useful in Project Explorer, but Code Explorer doesn't provide the hint.
> The Code Explorer will do much better than that once we get #950 references dialog redone. :wink:
 
@Duga - Dang - I was just off looking for that one
 
tip: # and then start typing keywords - GitHub finds the number for you ;-)
 
@Duga notice how VBE doesn't put the document name next to Normal project?
 
yeah, well, tough luck
 
@Mat'sMug The clipboard can accomodate multiple formats, but it's up to the consumer to decide which formats it supports and prefers, with text being the simplest. But you can't define more than one type of text format. However, it might be useful to have a Copy as Markdown button that copies text in Markdown format for GitHub or StackExchange.
 
8:45 PM
meh
@Hosch250 @MitropoulosMitropoulos lol, you guys came in at the same time, it looked like HoshMitropoulos was enternig the chatroom!
 
Rubberduck Code Inspections - 5/26/2016 6:39:40 AM 2 issues found.
Type Project Component Issue Line Column
Error Normal (Normal) ThisDocument (Normal.dotm) Option Explicit is not specified in 'ThisDocument' 1 1
Error Project (Document1) ThisDocument Option Explicit is not specified in 'ThisDocument' 1 1
 
Hi. Just back from a 30 minute walk (including setup and teardown) with my dog.
 
@Mat'sMug I got an email notification :)
 
My previous record for it this year was 35 minutes.
 
I will definitely open up and do new testing as soon as you get 2.0b happening
 
8:47 PM
^ Normal is not acting Normal
 
I am super pumped
 
Walk.Setup(Dog);
Walk.Execute();
Walk.TearDown();
 
@Vogel612 phew. you know, Execute(Dog) would have been a disaster.
 
If you guys execute my dog, you'll have me to deal with.
 
8:48 PM
using Dog {Walk}
 
And it won't be funny for you. Or rather, you won't be.
 
you'll tear us down
 
@ThunderFrame Well, she more walks me.
 
I haven't had a whole lot of time to run more tests lately or keep up with what you guys have been up to: how's it been going?
 
Pretty much the only thing she doesn't do is look for cars and set the pace too fast for me (she tries).
@MitropoulosMitropoulos Busy.
 
8:49 PM
@MitropoulosMitropoulos there's 6 PR's waiting to be merged... all just today's work
 
Right now, I'm working on the website.
 
woooowww
great
 
TTGTW
 
I haven't been this excited since Ocarina of Time came out (lol)
 
@Mat'sMug This is where I'm going to load my kernel:
protected void Application_Start()
{
    AreaRegistration.RegisterAllAreas();
    FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
    RouteConfig.RegisterRoutes(RouteTable.Routes);
    BundleConfig.RegisterBundles(BundleTable.Bundles);
}
 
8:51 PM
good! in global.asax
 
Yup.
Now, where in the world will I dispose of it?
Just make that implement IDisposable?
 
no
 
Isn't there an Application_Stop() method, or something?
 
what do you need to dispose?
whatever
 
The kernel.
 
8:53 PM
I'm talking about the dependencies
i.e. why do you need to dispose of the kernel
 
System.Web.HttpApplication
That already implements Dispose--just need to override it.
 
yup
 
@Mat'sMug Because it implements IDisposable.
 
ok, good, yes.
 
And to dispose of anything it loads.
 
8:54 PM
but this is a web application, you don't know when the application is going to shut down
if ever
so I'm asking, how will you set up your bindings?
 
Well, if it ever does, it should be able to dispose.
 
yes, but if that's 1200000 requests after it started, you might have memory issues on the web server
 
I'm going to inject it into the static class I'm using to get the inspections results.
I made the inspection list static too.
 
there are things you want to keep alive as long as the app is running, e.g. your Mock<VBE>
that's not how OOP works ;-)
 
Oh, right.
@Mat'sMug I'm pretty sure I need it static so I can call it from the view.
 
8:57 PM
let go of the control over the lifetime of objects - that's the IoC container's job
no. the view can - and should - take it as a model
 
Oh, OK.
On the other hand, if it is static, doesn't that mean there will be a single instance servicing all calls?
 
@Hosch250 interleaving is a problem then
 
if it's static, it means there's no instance
 
Oh, OK.
 
@Mat'sMug meh. that's not quite right
if you have a static field that means there is only ever a single incarnation
 
8:58 PM
IIRC there's no static class in Java, right?
 
there is...
it should do the same as in C#
 
anyway, what I'm trying to get to, is that you should bind whatever needs to live for the span of a single request, .InRequestScope()
and the kernel will dispose it as it should, if it has to
 
Oh, OK.
 
and stuff that needs to stay around longer can be bound in other scopes
 
yep
 
9:00 PM
I'm guessing there's a SessionScope and an ApplicationScope in the very least
in The 2nd Monitor, 10 secs ago, by Vogel612
heya there @ScottCraner nice to see you drop by
 
OK, so what should be in call scope?
The text from the user?
 
isn't that just the model?
 
Everything else, AFAIK, can be reused between all calls, except the parser.
 
@Hosch250 you should get that as a Request Parameter. probably a form value
 
9:02 PM
Yeah.
@Vogel612 Yeah, I know.
 
that shouldn't be injected through DI
 
I know.
 
so, quick recap before I leave work: you set up your kernel in global.asax, tell ninject to take over the controller instantiating, and then you can have constructor parameters in your controllers, and ninject deals with them automatically
that way you can constructor-inject the IInspector or whatever you've got there, into the InspectionsController
 
you'll need access to both the Parser and the IInspector
because those are decoupled
 
well-executed MVC is such enjoyable code
 
9:07 PM
> Cause it's easy once you know how it's done, you can't stop now it's already begun, you feel it flooding through your bones, ...
 
NVM for now.
OK, this is what I need:
I'm going to handle the button click with JS.
How am I going to call into my controller from the JS?
Everything seems to say to use AJAX and post/get calls.
 
umm... how do I put this...
you don't
 
OK.
 
HTTP POST 101?
 
So, how do I call into the controller when a certain button is clicked?
 
9:11 PM
you use an <asp:button>
 
OK.
 
and bind OnAction
 
Thanks.
 
@Vogel612 been a while, you sure this isn't ASP.NET stuff?
/webforms
 
9:12 PM
@Mat'sMug umm... shouldn't it be??
 
And how am I going to Ninject the controller to the view?
 
you definitely don't
 
We are using ASP.NET MVC.
 
okay then you can use that
whatever webforms is, it probably wouldn't have had that
 
I don't have asp:button.
At least, it doesn't look like it.
 
9:14 PM
just make an <input> and post
or try the toolbox, there's always a toolbox with drag-n-drop things for noobs like me
I'd just post though
like, a basic HTML form that posts text to a url
 
1
Q: ASP.NET MVC action on button click

Ashok DamaniI want to take some action on a button click the code is given below---> <% if(Model!=null && Model.Count>0){%> <ul> <% foreach(var Movie in Model) { %> <li> <%= Movie.Id %> <%= Movie.Title %> <%= Movie.ReleaseDate %> <input type="but...

 
@Vogel612 We aren't using that.
 
the url gets routed to a controller method that takes the text as a parameter, or even a model object
 
sidenote: that uses the razor and not the XML views
 
We are using the Razor engine, not the ASP.NET engine.
 
9:16 PM
@Hosch250 we are
 
Well, we aren't using the one with <%.
 
lol Razor is ASP.NET
so the XML one?
 
It shouldn't be that hard to translate it.
We are using the @{} one.
 
gosh they introduced a third engine?
 
never heard of "the xml one"
 
9:17 PM
Yeah, I was just reading about it.
 
60
A: ASP.Net MVC 4 Form with 2 submit buttons/actions

RamunasThat's what we have in our applications: Attribute public class HttpParamActionAttribute : ActionNameSelectorAttribute { public override bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo) { if (actionName.Equals(methodInfo.Name, String...

lol
 
Oh, we aren't using ASPX.
 
dooode
 
Oh, this looks easy.
 
ASPX is the ASP.NET / WebForms engine
 
9:18 PM
Then what is all that?
 
okay microsoft really needs to stop doing the same things in like... 20 different ways
 
We aren't using the one with ASPX files.
 
never heard of the bottom two
 
That is the most prevalent one, though, and has been driving me absolutely nuts.
@Mat'sMug I've heard of Spark, but never knew what it was.
 
but hey last time I wrote MVC, .net 3.5 was all the hype
 
9:19 PM
Spark sounds suspiciously java
 
But then, I didn't know what Razor and ASPX was either.
 
you gotta understand the role of the controller, the view and the model though
esp. the controller :)
it exposes methods that the routing engine routes requests to
that's very much coupled with what the request url looks like
so /Foo/Bar/42 calls method Bar of controller Foo and passes parameter 42 to it
 
OK.
 
that's HTTP get
here you'll want to mark the controller method with an HTTP post attribute
 
And pass the text in JSON format
 
9:23 PM
so that it can only resolve for a post request
or whatever you like
but yeah
so the controller receives the request, processes it, and issues a view (with a model)
 
So, basically, I just build another view that it loads and returns?
 
And embed it in the page?
 
I find it cleaner
 
@Vogel612 Yeah, that is the one with .aspx views.
 
9:28 PM
@Vogel612 the problem with .aspx is that it tended to create literally unreadable views littered with <% tags
razor fixed that
@Hosch250 depends what the view is
you could return a partial view
gotta go
 
Like the Inspections page itself?
See you.
That is embedded in the layout page.
 
yeah that makes sense
TBH I need to foster my knowledge of the actual mechanics behind this, there's a big chunk that's complete for me
 
@Vogel612 Do you know how to tell Ninject to load the controllers?
 
not the slightest clue
I didn't even work with ninject back in the day
 
there's an extension specifically for mvc, and the wiki is extremely well done
 
9:37 PM
Everything is coming along beautifully, but it crashed when it tried to load the controller because it doesn't have a parameterless ctor.
@Mat'sMug Thought you were gone.
I'll take a look.
 
leaving
 
Are we on MVC 5? MVC 3?
 
@Hosch250 that's because it's still the default controller factory creating the controllers - you want to change that to Ninject's controller factory
 
5.2.3
 
probably 5
 
9:39 PM
Yeah, that's what I was asking how to do.
So, I uninstall the other Ninject now?
 
uh, no. it's an extension, goes on top of it
 
lol I was going to drop you a link exactly to that url
see, it does everything for you :)
 
> Not at all. Plus one for this suggestion to user or refactor option.
 
Oh wow, just installing the thing fixed it.
Literally the only thing left is styling the form and formatting the output.
 
@Mat'sMug Any idea why this is injecting an empty enumerable?
public InspectionsController(IEnumerable<IInspection> inspections)
 
use IInspector
 
private void BindCodeInspectionTypes()
{
    var inspections = Assembly.GetAssembly(typeof(InspectionBase))
                              .GetTypes()
                              .Where(type => type.BaseType == typeof (InspectionBase));

    // multibinding for IEnumerable<IInspection> dependency
    foreach (var inspection in inspections)
    {
        _kernel.Bind<IInspection>().To(inspection).InSingletonScope();
    }
}
That finds them all.
 
that one's preconfigured and also handles special inspections correctly
 
Oh, OK.
 
9:57 PM
> I think I'd personally leave out warning about implicit conversion from anything -> Variant (or customizable). There are so many functions that take Variants in VBA that you wouldn't be able to see the code for the CVar()s.
 
10:13 PM
It can't find IInspector.
This is weird.
 
overkill?
that would work in 2007+
 
Looks awesome.
Can you use the same icons we use, though?
 
no, I'm constrained to the built-in icons, when using Conditional formatting.
 
OK.
 
10:21 PM
@Vogel612 I know where it is.
It doesn't work even when I explicitly bind to it.
 
wat.
 
Right now, it is saying cyclical dependency.
 
IDK - maybe I could inline custom images in the XML.... Otherwise it's definitely possible with the Open XML clipboard format (aka a zip file like a mini xlsx), but we'd need to nuget the Open XML SDK (which we'll probably need to do anyway, at some point)
 
@Hosch250 that's interesting ...
 
I can get the exact types out, but every time I bind, it messes things up.
Oh, I'm loading it in the wrong spot.
 
10:47 PM
Got it.
> Move module-level variable 'bar' to a smaller scope. Suggestion

'TestModule1' has more than one '@Folder' annotation. Error

Consider renaming project 'TestProject1' Suggestion

Consider renaming module 'TestModule1' Suggestion

variable 'bar' is not used Warning

Option Explicit is not specified in 'TestModule1' Error
Look at that.
4
The website generated that.
I have three inspections disabled for now--Active Sheet, Active Workbook, and Parameter Not Used.
Those three inject the VBE, but I need to create that each time to set the component text.
Parameter Not Used shouldn't need it...
The other two are Excel specific, so I'm not planning on re-enabling them.
At least not until I let the user say which host they are running it on.
Once I get this done, we could even let the user experiment with the tests and refactorings.
Well, no, not the tests--yet.
Return value of function 'Foo' is never used.	Warning	CodeQualityIssues
Move module-level variable 'bar' to a smaller scope.	Suggestion	MaintainabilityAndReadabilityIssues
'TestModule1' has more than one '@Folder' annotation.	Error	MaintainabilityAndReadabilityIssues
Consider renaming project 'TestProject1'	Suggestion	MaintainabilityAndReadabilityIssues
Consider renaming module 'TestModule1'	Suggestion	MaintainabilityAndReadabilityIssues
Return value for member 'Foo' is never assigned	Error	CodeQualityIssues
 
11:05 PM
Hmm. Visio let's me add a test module using the RD menu, but adding a Test method is not enabled.
 
@ThunderFrame No, running it isn't enabled.
We really should check if running isn't allowed and disable that feature.
Or rather, leave a menu item in that gives a popup prompting them to help us out if they want it.
 
@Hosch250 project is not running
 
Huh?
Weird.
On a happier note, I just made it accept user input.
On a sadder note, the first time I run it, it always fails at Parsed.
 
Oh, how do you check for is running? This is Visio 2002, so it's VBA 6. Are you inspecting a command bar? Maybe the command bars changed???
 
What isn't running?
OK, I fixed the resolve not finished problem.
I just committed it just in case something happens.
The only thing that is left is formatting the output.
And formatting the input block.
 
11:41 PM
@Mat'sMug Feel free to PR/merge that any time and take over.
Literally all it needs is a couple UI tweaks (I think).
And Parameter Not Used needs to stop using the VBE and be reenabled
10 minutes to go and supper time. BBL.
 
^ Tests in Visio!
and Visio doesn't have Application.Run...
teases with a long pause
`Document doc = Application.Documents[qualifiedMemberName.QualifiedModuleName.ProjectDisplayName];`
`var call = GenerateMethodCall(qualifiedMemberName);`
`doc.ExecuteLine(call);`
markdown fail
 

« first day (719 days earlier)      last day (2461 days later) »