« first day (1907 days earlier)      last day (82 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
8 cores in i7-7700.
 
RELOAD!
 
ok that is one explanation
 
[Minesweeper] Games Played: 101, Bombs Used: 62, Moves Performed: 14436, New Users: 10
 
Technically there's some progress. It's showing 'Restoring packages for C:\Users\IvenBach\source\repos\Rubberduck\Rubberduck.SmartIndenter\...'
Yet when I let it run last night for nearly an hour it never finished.
 
might’ve been msbuild locking itself up, who knows
i would try that suggestion
42
Q: Building a solution file using msbuild

TVSuser1654136I was about to build a Visual Studio solution file using msbuild. I used the following commandline for building the solution msbuild.exe SolutionFile.sln /t:Build/p:Configuration=Release;Platform=Win32 Even though the build starts at some point the build is looking hang and fails to move forwa...

get the diagnostic output. see ifbewe can get anything useful
 
12:12 AM
Well that's a lot of output.
c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin>msbuild.exe "c:/Users/IvenBach/source/repos/Rubberduck/Rubberduck.sln"
Microsoft (R) Build Engine version 15.6.82.30579 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 8/25/2019 5:11:43 PM.
Project "c:\Users\IvenBach\source\repos\Rubberduck\Rubberduck.sln" on node 1 (default targets).
Huzzah. Thank you git bash for teaching me the non Ctrl+C copy hotkey.
Builds failing.
 
so, it blames not having the file obj\project.assets.json for the vbeditor project
 
@this Duh check. When I cancel the build process in VS it should kill the MSBuild.exe process?
 
not necessarily
 
Mkay. Is the battery charging icon a visual indicator that MSBuild is in the background?
 
that’s why i said earliet if you built rubberduck.sln and try to build rubberduckmeta.sln, it would fail because of msbuild still loaded
not sure.
 
12:25 AM
I'm just dead in the water as it currently stands.
 
did you try nuget restore on vbeditor project?
 
Not yet.
That's done by going through Package Manager Console>Default project>RD.VBEditor?
 
sure
 
What's the exact incantation? I don't know it.
dotnet restore Rubberduck.VBEditor outputs 'Project file does not exist.'
 
12:43 AM
@this is the ComCommands PR good to go? Max approved it, so if you resolve the conflicts I've no objections to merging =)
 
@user9822309 Welcome to the pond.
 
@IvenBach did you break your build setup again?
 
I didn't do diddly.... VS FUBARD itself on me.
@MathieuGuindon At present I can't build RD on home machine. That's worse that not building at work.
 
shld be just nuget restore
@MathieuGuindon i will address max comments then do one more push then it’s good
 
PM> nuget restore
nuget : The term 'nuget' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:1
+ nuget restore
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (nuget:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Does that mean it's acting like it can't find NuGet?
 
12:48 AM
doh that is ps
shld be..
Update-Package -Reinstall
double check syntax
 
@IvenBach :(
@this all right!
 
1:02 AM
@this Tried with that syntax and it seems like something started. The stop button is shown, but now output is being displayed. Is that normal behavior?
Progress? Statusbar showing 'Installing NUnit3TestAdapter 3.10.0'
How long should the restore process take?
 
for me only few mins
 
1:18 AM
It's going through them very slowly.
It feels like... VS is being slowed down by something.
 
indeed. i honestly don’t know what to say. at that point i would try reinstalling vs. maybe updating it if thats not already done
 
Here goes updating.
I'm not the one to blame. Even VS admits it!
If nothing else I'm learning how to debug and Un-FUBAR VS through a variety of unusual circumstances.
That looked hopeful. 'Restore complete' displayed. I'm almost afraid to touch it now...
I got output errors. #Progress
> This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see go.microsoft.com/fwlink/?LinkID=322105. The missing file is C:\Users\IvenBach\source\repos\Rubberduck\\.nuget\NuGet.targets.
@this Could the `\` be what's causing the issue?
I already did NuGet restore on the solution.
> All packages are already installed and there is nothing to restore.
The package restore options are both already checked.
AFK 2 go 2 the big room IRL. Back after a while.</iven>
 
2:10 AM
nah, the duple slashes are harmless. it means current directory basically
does that apply?
i would also read and try suggestions: stackoverflow.com/questions/9011889/…
 
2:58 AM
I do get a .nuget directory and have deleted it several times already.
 
3:09 AM
i know but what about the enable package restore thingee? the first link says it’s the wrong thing to do
 
I need to be in front of VS and testing it to fully understand. Out at mall currently.
At least with the update I was getting failing outputs again. M
 
4:10 AM
@this I don't see any option to even enable it.
Without VS open I deleted .nuget directory. Opened VS, all projects loaded, then synchronized, then Restore completed. Output showed 18 errors all saying the same 'The missing file is C:\Users\IvenBach\source\repos\Rubberduck\\.nuget\NuGet.targets.'
Clean succeeds with all expected output.
C:\Users\IvenBach\Source\Repos\Rubberduck\\.nuget\NuGet.targets. isn't the expected directory however.
The directory that .nuget is within is `C:\Users\IvenBach`.
 
hmm. im not at my computer at the moment but i don’t think you are supposed to have nuget folder inisde thenrepo folder, only at the user profile folder
 
4:25 AM
Tried Tools>NuGet Package Manager>Package Manager Settings>Clear All NuGet Cache(s) cleared successfully. Attempting to build then brings up:
Error NETSDK1064 Package NLog, version 4.5.10 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. Rubberduck.RegexAssistant C:\Program Files\dotnet\sdk\2.1.508\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 198
@this That's what I have. There's only a .nuget directory within my user profile. Nothing exists within the repo.
Based on the link you provided settings appear correct.
 
how did you do the automatic package restore originally?
 
These damnable cosmic rays keep touching my SSD and screwing things up.
I didn't do any auto package restore. I never turned that option on.
 
seems so. i honestly don’t understand why you seem to have build problems. maybe one night do screen share?
 
I'm more than willing.
Frustrates me to no end that I appear to be the only one that gets these issues.
 
i would be too.
it is also disconcerting because i do want the build process to be no brainer
maybe tmw night?
 
4:32 AM
Classes start tomorrow. Tuesday night I ought to be home.
Progress at least. PM> Update-Package -reinstall gave me 'No package updates are available from the current package source for project 'Rubberduck.JunkDrawer'.` for all the projects.
 
4:47 AM
:deep-breath: It worked. Nuked the repo as #HailMary last ditch effort and it worked.
Why did it work? NFI... But it worked.
Updates and nukes. mumble mumble wtf it not work mumble first time mumble tried it mumble spent hours dicking around.
@IvenBach past-Iven you've come a long ways since then: nuked your old repo cloned fresh from upstream/next, renamed origin to be upstream, added your own remote repo and correctly named it origin, and checked out your branch you wanted to work with. All without having to open the manual.
Failures taught you so much... It's taught me it's bed time.
At least I didn't have to spill coffee on this machine.</iven>
 
 
2 hours later…
6:52 AM
@IvenBach I'd need a flow-chart to figure out why that worked, but I'm glad you got it sorted :-)
 
 
6 hours later…
12:51 PM
@Mast You and me both, my friend.
 
Not only does that explain so many of @IvenBach's issues, but... Wow! That is a lot of photography equipment!
Just curious... What does a Rubberduck keep in its Rubberduck.JunkDrawer?
 
1:06 PM
its junk?
seriously it's just to hold some common functions that are useful in more than few projects.
 
So, not old toothbrushes, keys to long ago sold cars, a random screwdriver or two and about 4,000 twist ties? #hazasad
 
a more pedestrian name would have been Rubberduck.Common
 
#NamingIsFun
 
but the thing is that it's kind of a smell, which is why I believe Vogel612 opted to call it a JunkDrawer
 
yup
currently it contains the interface for outputting to clipboard and the StringExtensions class
 
1:19 PM
@Vogel612 just checking - why not Rubberduck.Formatters, then?
 
because the implementation for exporters isn't in there and I assumed that it would organically grow fester over time
 
at least as Formatters, it'd grow in a more controlled fashion
JunkDrawer, while more honest, is still shapeless as Common is.
 
Interesting SO research I saw posted on 2nd Monitor
Grrr! I'm the only person in this DB right now, but Access is giving me a Write Conflict claiming that the record has been changed by another user. (linked table on the SQL server)
 
while that is somewhat true, I don't think we can justify a whole project for Formatters alone...
 
screw you, Access. Opens SSMS, changes it there
 
1:41 PM
You may need a rowversion column.
esp if you're including floats or dates where precisions don't match
 
You talkin' to me? This is just some config data that gets changed by hand on occasion to indicate customer changes...
There should be dates (effective dates), but there aren't...
 
if you don't like that dialog Access throws at you...
normally we add it to all tables by default.
 
can't remember the last time I got that error.
Not sayin' that I shouldn't have a rowversion column, but that it hasn't bitten me that often often enough to make me change yet.
 
in those cases, they don't necessarily happen every time.
only need certain values to trip it up
the basic reason is that when Access saves something in ODBC, it immediately requeries for same record.
If no rowversion, it does by comparing all columns that the user dirtied and submitted
 
It’s a mystery why VS suddenly started working. No logical reason I can come up with, hence Cosmic Rays.
 
1:52 PM
but why does it think that someone else modified it when I'm the only one using the DB at all. The one other person who gets in there would be in Prod at this time if anything...
 
Therefore, if Access sent in 1.333 and SQL Server saved it as 1.337, Access has no way of knowing that it was the difference between precision vs. some other user legitimately changing it. Thus, write conflict.
 
@IvenBach Cosmic Rays are better than Comic Sans any day!
@this ah. But the difference between 1 and 0?
#IBlameMicrosoft
returns to counting framesets to download more data from a website... :(
 
@FreeMan Maybe you have a haxor in your system.
 
2:07 PM
Ghost in the Machine
 
Who ya gonna call?
 
question: Why do we have a separate VariableDescriptionAnnotation that seems to be unused?
it's not registered in the VBAParserAnnotationFactory...
 
Ghost in the Machine (Just in case you youngsters didn't catch the reference.)
 
there is a test to check the backtransformation from VB_VarDescription to a variable description.
But currently we can't parse these annotations correctly...
 
@FreeMan so, hackbuster?
 
2:19 PM
hmm ... oh well, it should register correctly now
 
haxbustors!
 
@Vogel612 I assume because our mock parser doesn't set up the attribute parser/pass/whatacallmit
 
ugh... I hate fumbling my way through HTML to automate web-scraping. If only this company had an API I could use that would gimme what I actually need...
 
@this no, actually because it wasn't correctly registered in the VBAParserAnnotationFactory.
 
@FreeMan did they straight up say to go to their website and scrap it?
 
2:23 PM
there was no mocking setup involved, because the stuff is currently (in next) manually "registered" at compile time
 
@this almost... This is an appointment scheduler. With the API, I can add, remove & update appointments. I can see what's coming up today or tomorrow, but I cannot look at what happened yesterday!
However, now I'm trying to get some customer lists out of it, so the API (If I can figure out getting data back from the API - I had issues with that the last time 'round), might just be the way to go.
 
umm.... interesting business model they have there.
 
@Vogel612 Sorry, not registering it is my bad.
 
let us help you schedule the future! And forget that it ever happened!
 
@M.Doerner no worries, I was just wondering how it worked before, but if it didn't that makes sense :)
 
2:28 PM
Of course, we're now going to be pulling the data daily, so instead of doing it at 12:30 am and getting yesterday's appointments, I might, just might be able to make it work by pulling all of today's appointments at 11:30pm...
@this pretty much.
When I asked about that, they were like, "wow, that's a good idea, I'll talk to the devs about that". Of course, that's what happens when you're talking to a sales drone instead of the tech people...
 
I must have forgotten to add it along with the other attribute annotations.
 
digs back into the API docs to see if he can make something happen...
 
@FreeMan still, one'd thunk that at some point in the business startup, someone would have wondered about the utility of having past appointments for confirmation/verification purposes.
ah, the life's a bowl of cherries. :)
 
weird....
I'm apparently not setting up the ModuleParser correctly in the MockParser setup
~sighs. Found it T.T
 
@this well, I guess that's what happens when you don't use your own software...
 
2:43 PM
@this lol
 
2:57 PM
aight... down to 37 failing tests from ~250
3
 
@this Here's what they straight up said:
> Unfortunately, there are no API methods that supports this.. It’s largely due to the fact the schedule is set for today and in the future and we don’t capture the historical configuration of the way the schedule existed in the past. One could do some basic math against a known schedule for known times and look at “booked” or completed appointment and come up with the difference.
How one cannot "capture the historical configuration" I don't know... I can look at the schedule in the past by browsing the web site, I just can't get that info from the API. :/
 
22 mins ago, by FreeMan
@this well, I guess that's what happens when you don't use your own software...
Betcha you they aren't even using the API internally for their website.
 
I'm sure they're not. Would like to introduce them to dog food.
 
3:19 PM
@FreeMan Probably a schema change that wasn't documented by someone way back.
 
Perhaps but if they were using their own API internally in the website, then they wouldn't have to wonder about inability to capture historical configuration.
 
@FreeMan And boy howdy is this saugsage dog food tasty. Good stuff!
3
 
@FreeMan What exactly does the web interface show, all previously existing appointments or only those not deleted or rescheduled after they should have taken place?
 
@M.Doerner Oh, I can see the whole history if I browse the site - completed, rescheduled, cancelled, everything.
 
3:31 PM
@FreeMan Open the Network tab in the browser and make it do that.
Sort through the requests and see what you get back. I bet you can build some of them on your own.
 
Yeah. I'm running into the same issue looking at it this time that I remember from last time. I can get the API to work with Postman, but I can't get it from within VBA code
I can recreate the exact same URL string and POST from VBA that Postman is showing me. Postman gives me back boatloads o'data. VBA returns an error from the server.
 
VBA is pretty terrible for working w/ REST stuff.
 
> "Web Services authentication failed: invalid Site ID or API Key"
^^ yeah, well, VBA is what I've got for now.
 
I'd just write a C# DLL and pass data to VBA
done correctly it should be a xcopy deployment
(meaning no installer beyond having the .net framework, obviously)
 
hey as long as you have windows you are good to go
 
3:35 PM
^^ yes, yes you would. I, however, would spend months trying to figure out how to do that in C# and the project would be exceptionally late by then, instead of just the sorta late that it's currently heading towards...
 
if you have 7 you should automatically have 3.5
 
the URL from Postman:
https://ws.appointment-plus.com/Customers/GetCustomers?Authorization:Basic=<USER-ID>:<API-KEY>&response_type=json
the URL from VBA:
https://ws.appointment-plus.com/Customers/GetCustomers?Authorization:Basic=<USER-ID>:<API-KEY>&response_type=json
I've compared USER-ID and API-KEY 6 ways to Sunday and they appear to me to be identical...
 
its funny how much web crap i see in vba
 
aaaaargh...
 
Public Sub RESTtestBigURL()

  Dim Url As String
  Url = "https://ws.appointment-plus.com"

  Dim Method As String
  Method = REQUEST_GET_CUSTOMERS

  Dim responseType As String
  responseType = "response_type=json"

  Dim restRequest As WinHttp.WinHttpRequest
  Set restRequest = New WinHttp.WinHttpRequest

  Dim restResult As String

  With restRequest
    .Open "POST", Url & Method & "?Authorization:Basic=" & SITE_ID & ":" & API_KEY & "&" & responseType, True
    .Send
    .WaitForResponse
    Debug.Print ".ResponseText: " & .ResponseText
that bad boy gives me:
 
3:40 PM
> Attribute constructor parameter 'toAnnotationValues' has type 'Func<IReadOnlyList<string>, IReadOnlyList<string>>', which is not a valid attribute parameter type
 
.ResponseText: {
            "resource":"customers",
            "action":"getcustomers",
            "request":"",
            "result":"fail",
            "count":"0"
,"errors":[
    "Web Services authentication failed: invalid Site ID or API Key"
]}
 
@FreeMan lemme guess... status code 200?
 
@Vogel612 everything must be a constant there. Func can't be a constant, so....
 
some people writing REST APIs need to be smacked over the head with a printout of the HTTP1.1 RFC
@this yea, I've learned that now...
 
I ran into that myself when setting up TestCase
 
3:42 PM
makes it near impossible to strictly-typedly deal with transformation, though.
 
In that case, I wrote an Arrange procedure to take stringified/typeof'd inputs and construct the delegates.
e.g. make it be (string[], string[]) and build the Func in ctor
(not sure if you can construct a enumerable as a constant. I doubt it, hence the arrays.)
 
yea no...
that won't work because it needs to deal with basically arbitrary input and output values.
I'll just manually dispatch to a static method
 
@Vogel612 indeed!
 
I've sunk to a new level of :derp: just now.
    class Program
    {
        static void Main(string[] args)
        {
            var backingField = ClipboardWriterAppendingInformation.All;

            var bitwiseOperator = backingField & ClipboardWriterAppendingInformation.XmlSpreadsheetFormat;
            Console.WriteLine(bitwiseOperator);

            var bitwiseAndEqualityCheck = (backingField & ClipboardWriterAppendingInformation.XmlSpreadsheetFormat) == ClipboardWriterAppendingInformation.XmlSpreadsheetFormat;
            Console.WriteLine(bitwiseAndEqualityCheck);
Just a couple minutes to tease out why it was coming out false. :hands-head:
 
hey, I lost 20 minutes or so on the question why something like this ctor doesn't initialize a field:
class Foo(Bar bar)
{
  _bar = _bar;
}
@IvenBach sidenote: I'd write XmlSpreadsheetFormat = 1 << 0
 
3:58 PM
To continue with convention?
 
yes
also allows at least my brain to not worry about whether 1 == 1 << 1
 
@Vogel612 Why not have the conversion logic in the concrete annotation classes?
 
that's where I put it now
the problem is dispatching to that conversion logic
the AttributeAnnotationProvider doesn't (and actually can't) create instances of the concrete annotation class
therefore I need to dispatch to some static, which I can't do through an interface aaaaaand that's the whole issue
so I need to dispatch via reflection, which is... annoying.
            if (typeof(FlexibleAttributeValueAnnotationBase).IsAssignableFrom(type))
            {
                // obtain flexible attribute information
                var attributeInfo = GetAttribute<FlexibleAttributeValueAnnotationAttribute>(type);
                if (attributeInfo.AttributeName.Equals(attributeName, StringComparison.OrdinalIgnoreCase)
                    && attributeInfo.NumberOfParameters == attributeValues.Count)
                {
                    if (attributeInfo.HasCustomTransformation)
 
4:28 PM
if you're reflecting - why not have CW do it?
maybe what you actually want is CW automagic factory to construct the concrete instance?
 
@this how would I get CW to do stuff during parsing?
that's not its job
 
No, no, you need CW to give you a factory
which would then construct the concrete to do the actual parsing, right?
 
no.
just no
the problem is that all annotations are bound to VBAParserContexts and we're in the attributes pass
the annotation we're resolving may not even be present in the code
and injecting a factory only to invoke a ctor is an anti-pattern IMO
with that said.... food, then groceries. Or maybe the other way round.
BBIAB
 
if (includeUnicodeFormat && results is IEnumerable<Declaration> unicodeResults)
{
    var unicodeTextFormat = title + Environment.NewLine + string.Join(string.Empty, unicodeResults.OfType<IExportable>().Select(result => result.ToClipboardString() + Environment.NewLine).ToArray());
    AppendString(DataFormats.UnicodeText, unicodeTextFormat);
}
Currently I have the above. I would like to replace IEnumerable<Declaration> with IEnumerable<Foo> where I assign Foo to a type earlier.
 
@Vogel612 TBH, that puzzles me -- isn't the whole purpose of the factory pattern is to abstract away the construction construction, so that you are given a method to pass the arguments that you can only have at runtime and the factory then invokes the ctor on your behalf?
 
4:38 PM
That's just a contrived way of hiding the tight coupling
If you're always creating the same concrete type, you're just hiding coupling in the DI registration
 
I see. Sorry for the bad idea.
 
Stupid question, can't you just create the annoation passing null as the context?
 
@M.Doerner I'd prefer not to. It also works now (2 failing tests around backtransformation)
 
Well, the backtransformation is not used on any hot-path.
 
There might be some sense in separating the Annotation and the context it's specified in, though...
 
4:48 PM
We really need to be able to identify it for rewriting purposes.
 
Yea, I know. The static and nonstatic difference annoys me, though
 
I guess we could split it into an Annotation and a ParseTreeAnnotation taking an Annotation and a ParserRuleContext.
 
Using the API would make this so much easier... I've opened a support ticket and I've posted on SO. Expects some sort of useful answer from somewhere...
Aug 22 at 19:52, by Mathieu Guindon

We're all idiots

17 mins ago, 15 minutes total – 24 messages, 6 users, 0 stars

Bookmarked 6 secs ago by Mathieu Guindon

@IvenBach Generic or Brand Name, please step back from the meth...
 
5:03 PM
#Lurk much?
 
@IvenBach Is the type determined at compiletime?
 
Believe so.
 
Why not use a generic method?
How do you determine the type Foo?
 
I was trying var foo = Declaration.GetType(); but that failed miserably.
 
For which purpose do you need the code above?
 
5:07 PM
public void AppendInfo(ColumnInfo[] columnInfos, object results, string titleFormat, ClipboardWriterAppendingInformation appendingInformation)
{
object[][] resultsAsArray;
switch (results)
{
	case IEnumerable<Declaration> declarations:
		resultsAsArray = declarations.Select(declaration => declaration.ToArray()).ToArray();
		break;
	case IEnumerable<IInspectionResult> inspectionResults:
		resultsAsArray = inspectionResults.OfType<IExportable>().Select(result => result.ToArray()).ToArray();
		break;
In the very last code block I want to replace Declaration with the type that results is passed in as.
I'm trying to consolidate the copy to clipboard logic since it's the same in 3 different places.
 
Dear Chrome,
Why don't you list the frame sets in a consistent order so I know how to count them?
Sincerely,
FreeMan
 
How about introducing a function private string UnicodeTextFormat<T>(T results) : where T is IEnumerable<U>, U class or something like that? (air-coding)
 
@M.Doerner I'm trying to write it out with the correct syntax. I don't understand it well enough to get it right.
 
It might also be possible to simply use IEnumerable<T> in the parameter list.
 
5:17 PM
Yes. I need to replace that in AppendInfo. It's taken me a while do dig down and realize they are all IEnumerable<T>.
In one of the usages a reference to Results instead of _results was giving an IEnumerable and that's what had me stumped for a bit.
Supplying a generic parameter to another method with a generic argument is proving difficult to do correctly.
 
What exactly is the problem?
 
I don't fully know. The compiler redlines parts and brings up a hovertext of implicit conversion not available.
 
@IvenBach Do you know the difference between explicit and implicit conversion yet?
If not, now would be a great time to learn it.
 
Explicit is where you do it yourself, implicit is where you've defined the conversion.
 
5:31 PM
Then that's a no.
 
You write the conversion the same way.
Explicit uses the explicit keyword, implicit uses the implicit keyword.
Then, when you actually use them, it goes like this:
Say I have a Foo and I want to cast it to a Bar:
Implicit, you don't have to do the cast. The compiler figures it out: Bar bar = foo;
Or you can pass it into a method that takes a Bar without casting it.
 
@IvenBach If I'm reading correctly, you're trying to make results strongly-typed?
 
If you define it as explicit, you have to actually cast it: Bar bar = (Bar) foo;
 
@IvenBach Could you post again what you have tried?
 
IINM, the thing in question to convert is a Declaration -- which is a reference type. Thus, creating an implicit conversion that's not interface casting seems a smell to me.
 
5:33 PM
If you pass it to a method that takes a bar, you have to manually cast it: Method((Bar) foo).
 
I remember doing User-defined conversion but not really understanding it when I was doing it.
 
...if that's the case then AppendInfo needs to become a generic method, i.e. instead of AppendInfo(args) it'll be AppendInfo<T>(args), as Max mentioned above
 
public void AppendInfo<T>(ColumnInfo[] columnInfos, IEnumerable<T> results, string titleFormat, ClipboardWriterAppendingInformation appendingInformation)
{
    object[][] resultsAsArray;
    switch (results)
    {
        case IEnumerable<Declaration> declarations:
            resultsAsArray = declarations.Select(declaration => declaration.ToArray()).ToArray();
            break;
        case IEnumerable<IInspectionResult> inspectionResults:
            resultsAsArray = inspectionResults.OfType<IExportable>().Select(result => result.ToArray()).ToArray();
 
and then you can have a IEnumerable<T> results argument
ok
 
Which is what I've done.
 
5:34 PM
good. needs a generic type constraint though
 
var unicodeText = UnicodeText<T>(title, results); is the part it's barfing on.
 
like, can T be a valuetype?
@IvenBach the <T> shouldn't be needed here
ok the problem is that UnicodeText<T> has a generic constraint: where T : IEnumerable<T>
so the T in AppendResult needs to have the same constraint
 
Good News™: It's not just my VBA code that gets back an Invalid ID/Key - I tried using curl as well and their API spits that back at me that way, too!
 
actually the constraint makes no sense
 
for some value of "good"
 
5:36 PM
Why the restriction th IEnumerable<T>?
 
you probably want where T : class
@M.Doerner guessing that's why it's not compiling - IEnumerable<T> where T : IEnumerable<T> makes no sense
 
@FreeMan sounds like they aren't being totally forthright with what they require. Most likely, you're missing some kind of authorization token that's there in web browser but not included in the VBA/curl.
@MathieuGuindon sure it does. It's when you want to constraint it to <IEnumerable<IEnumerable<T>> :-p
 
Is there an easy way to get the hover text to copy it?
 
Really, the generic function is kind of pointless.
I just realized that you cast anyway.
 
I also have a question -- who is responsible for formatting? The type itself or the formatter?
 
5:41 PM
@this if T is IEnumerable<T>, then T is either recursive, or undefined in IEnumerable<T>
where T : IEnumerable<U> could make sense if T is IEnumerable<IEnumerable<U>>, but then U probably needs to be constrained too
 
@this sounds legit... I've opened a support ticket with them. My cow-orker, who's usually the one that deals with them says they're usually pretty quick to respond. We'll see what happens...
 
@MathieuGuindon Appending that to each generic method causes all issues to vanish. Why?
 
In the meantime, back to working on the web scraper as a fall-back...
 
@IvenBach T in DoSomething<T> is local to DoSomething. If you want to pass T to another generic method, then that other method must accept a T that is statically provably fulfilling the same type constraints
if one says "T is any class" and another method says "T is any IEnumerable of any class", then they're not compatible
 
5:48 PM
but .Select(result => result.ToClipboardString() looks like you have a very specific interface in mind for T there
one that has a ToClipboardString method
 
He does a cast beforehand.
That is why the generic function is pointless.
 
If the first called DoSomething<T> has a constraint of where T : class and that calls DoInnerSomething<T> that has a constraint of where T : IEnumerable<T> this usage fails because DoInnerSomething can be a non-class IE a possible struct?
.Select(...) was part of the original code. I've blindly brought it along as I've refactored.
 
No, because the class T might not implement the interface.
 
How does the constraint T : class ensure that DoInnerSomething<T> guarantee it also implements the interface?
 
It doesn't.
 
5:55 PM
if you want to force it into an interface you're usually well off with where T : FooInterface
 
It might be any class.
 
@M.Doerner I'm not seeing why the generic function is not needed.
 
00:00 - 18:0018:00 - 00:00

« first day (1907 days earlier)      last day (82 days later) »