« first day (1572 days earlier)      last day (1608 days later) » 
00:00 - 19:0019:00 - 00:00

7:00 PM
still a bloody mess anyway
I can't imagine what the LINQ provider for EF looks like
ah, there it is:
10
Q: Tracking Entity Changes (not EF)

Mathieu GuindonSo, I kept refactoring my Sage300 API wrapper - I wanted the client code to feel just like using Entity Framework - this is the closest I got to it: using (var context = new SageContext(/*redacted credentials*/)) { context.Open(); var header = context.PurchaseOrderHeaders.Single(po => ...

even though it was never put into production, that's some of the code I'm the proudest of
 
7:28 PM
hey @mansellan
 
7:40 PM
@MathieuGuindon hey
Just been catching up. We use Dapper at work, is that an option?
 
Think so.. but never used it and, afaik no orm does cross-server mappings =)
besides I'm having too much fun with reflection now =)
@mansellan did you catch this morning's tweet?
 
Dapper doesn't try to do any fancy expression-to-sql stuff, you bring the sql it just does the projections back to objects.
 
@MathieuGuindon Johan Larsson is doing a set of Roslyn inspections for reflection.
He wants feedback on it.
 
guy was asking about RD in VS6, told him I thought it was only enabled in debug builds, is that correct?
 
Yep I saw it just now. Not used the installer in a while but afair the installer adds the relevant keys...
 
7:45 PM
hmm then it should have worked
 
Maybe he' tryna use per-user with elevation?
 
@Hosch250 it's up on CR?
 
Elevation needs per machine
 
@mansellan could be that. I'll tweet back
tks
 
Will check when I get home in an hour or so
 
7:46 PM
Ok I'll wait then
 
@MathieuGuindon No.
It's on NuGet, I think.
 
aw
hi @StormRider01!
 
Hello, I ended up here from the msaccess-vcs-integration project.
 
interesting... github?
 
7:56 PM
wah, completely forgot about this comment!
FWIW we ended up dropping the source control panel feature / git integration
 
I've got 8 or so 100mb Access front ends that I'm wrangling through source control.
 
@StormRider01 only 8? :P jk, none of mine tend to get htat big unless they havent been "repaired" recently
just taking a quick look, i have like 208 logged front ends (with some false positives where there are duplicates) that i can see.
 
Our largest one has ~5,000 objects (forms/queries/reports/modules)
 
oof
 
stalks SO profile so you do C# and ASP.NET? RD's website desperately needs some love from an actual web dev wink-wink, nudge-nudge :D
 
8:02 PM
yeah, fortunately we tend to make an application for a specific task instead of making one giga access "application"
 
We're working on replacing these, but to stop doing Access development, you've got to do more Access development.
 
yeah, some things we do just make sense to do in access rather than something like C# or vb.net
(im far better in vb.net than C#)
just due to development time
especially in access reports, since they are pretty simple to slap 98% of them together
 
I've got a powershell/vbscript script that will run the msaccess-vcs code on a build server to "decompile" all of the access stuff, and push the changes back into a git branch. The big one takes 8 hours to run.
 
oof
 
8:07 PM
It's too bad that MS won't provide a modern source control interface for Access.
 
yeah... im pretty convinced that will never happen
 
eh, they don't provide one for SQL Server either ;-)
 
It's also a lot easier to script out a SQL Server database :)
 
yeah thats true
 
there's that
 
8:14 PM
its funny, im trying to get my fellow programmer co-worker to chill in here and soak up some brilliance
and dang its hard
hes pretty anti social
 
@KySoto If your development time is lower in VB.NET than C#, you must not be using any lambdas...
 
or i know eff all about C#
:P
i literally started playing with C# talking to you guys
 
@KySoto LINQ in VB.NET is harder than in C# IMO
or anything involving delegates, anonymous methods, or any kind of lambda, for that matter
 
yeah, i have used anonymous methods exactly once
 
It's verbose as f**k. I could write a small application for each anon function in VB.
 
8:19 PM
and that was interfacing with a C# library
@Comintern it was, holy crap.
 
@KySoto you're missing out on literally what makes VB.NET better than VBA :)
 
(other than the .NET framework itself)
 
That and Option Strict
 
and implicit ByVal, and no more Set keyword, and Visual Studio and ReSharper and...
 
8:23 PM
lol
well sadly anon functions were left out of the vb.net classes i took
i never really knew they existed
 
depends when you took it
 
i mean i heard sorta of them in other langs, like javascript and c# but it was never clear till i had to research it
uhh we used visual studio 2012
 
but if it was after .net 3.5, that class was a glorified VB6 course then
 
I'm not sure anybody teaches that stuff.
 
its a local community college
 
8:25 PM
I bet they had Imports Microsoft.VisualBasic at the top of every file
 
nope
 
ok good
 
our instructor did enforce good habits with the options though
since it was more of a programming basics class for the first one, then more advanced concepts in the second one
 
What do they consider "advanced concepts"?
 
classes and structures
 
8:28 PM
O_O
 
yeah
a lot of people quit out before they even got to that point
the use of properties in classes for data validation
well, he was on the data validation train from day one
well, week 2 anyway
week one, you were allowed to use val, week 2 you had to use tryparse
The class was for a Computer Information Systems degree
 
I'd probably assign something where Val wouldn't work correctly and weed out the chaff.
It does if you have Imports Microsoft.VisualBasic...
 
yeah, that probably would nuke 95% of the class
yeah i derped out
i thought you said var, not val
 
This is why I don't teach at a community college.
 
yeah
but you have people coming to this class who have literally NEVER programmed anything in their life
 
8:32 PM
I could probably do a decent job teaching it, but I'm not sure I'd have the patience for the students who couldn't hack it.
 
they havent developed the troubleshooting methods to figure it out
 
I'm kind of up in the air with that. I think I'd probably walk them through a static analysis before firing up a debugger.
 
@Comintern I'd go with InStr or MsgBox
"any of you know some VBA?"
"good. unlearn it."
 
@MathieuGuindon "Trick question. None of you know jack."
 
bwahaha I did say "some"
;-)
        public virtual TEntity Find(int id)
        {
            var result = new TEntity();
            var table = result.TableMapping;
            var sql = $"select * from mrp.[{table}] where [Id]=@id";
            using (var connection = new SqlConnection(Properties.Settings.Default.SageExtDb))
            {
                connection.Open();
                using (var command = new SqlCommand(sql))
                {
                    command.Parameters.AddWithValue("@id", id);
                    using (var reader = command.ExecuteReader())
@Comintern ^^ does that look halfway near decent?
 
8:43 PM
Can reader[property.Value] be DBNull?
 
yes
that'll go boom, won't it
 
Possibly. I don't think DBNull has a type.
At least it isn't null.
 
but I can compare it to DBNull.Value though
                        var value = reader[property.Value];
                        type.GetProperty(property.Key).SetValue(result, value == DBNull.Value ? null : value);
 
Other than that, I don't see anything that jumps out.
I'm actually going to be doing something similar with Dapper in the not so distant future.
 
what would dapper buy me here?
 
8:56 PM
Auto mapping. I'm using it to convert between 2 class implementations.
For example:
    public class JavelinBudget : ConvertableClass<Budget>
    {
        [Column(Name = "GLID")]
        public uint GlId { get; set; }

        [Column(Name = "FISCYR")]
        public int FiscalYear { get; set; }
        [Column(Name = "FISCPR")]
        public int FiscalPeriod { get; set; }
        public DateTime Date => new DateTime(FiscalYear, FiscalPeriod, 1);

        [Column(Name = "BDGAMT")]
        public decimal Amount { get; set; }
        public BudgetType Type => BudgetType.ToDate;
 
but it couldn't do these:
        _remoteKeys = new Lazy<IDictionary<string, RemoteKeyAttribute>>(() => properties
            .Select(p => new
                {
                    Name = p.Name,
                    RemoteKey = p.GetCustomAttributes(typeof(RemoteKeyAttribute), true).SingleOrDefault() as RemoteKeyAttribute
                })
            .Where(k => k.RemoteKey != null)
            .ToDictionary(k => k.Name, k => k.RemoteKey));
 
That uses attributes, but you can easily build it with a different mapper.
The only code I need to fill a list is this: var raw = Connection.Query<JavelinBudget>(SelectStatement).ToList();
 
right, and it does pretty much the exact same reflection trickery under the hood
 
Pretty much. The reason I'm using it is because you can do custom field transformations too.
 
<~ too lazy to learn to use an ORM; writes entire reflection-based mapper logic by hand
 
9:00 PM
For example:
    public sealed class JulianDate : ConvertedDateField<int>
    {
        private const int JulianDateOffset = -1721426;

        public JulianDate() { }
        public JulianDate(int value) : base(value)
        {
            Value = new DateTime().AddDays(value + JulianDateOffset);
        }
    }
If I declare a property as a JulianDate and map it to an integer field, it will automagically convert it.
 
interesting
 
I was finding that about 75% of the code I was writing was silly stuff like field transformations of some sort or another. So... I dapper up a query to give me a list of ConvertableClass<T> (the T is the type I'm converting to), then it runs through this...
public virtual TClass Converted
{
    get
    {
        var type = GetType();
        var converted = Activator.CreateInstance<TClass>();

        foreach (var property in Properties)
        {
            var matching = type.GetProperty(property.Name);
            if (matching?.GetValue(this) == null)
            {
                continue;
            }
            property.SetValue(converted,
                matching.PropertyType == property.PropertyType
                    ? matching.GetValue(this)
...which instantiates the class that I really want.
 
@MathieuGuindon i seriously doubt any of them know any vba
the most vba i got when i went to school was the access class, when they said "VBA exists"
then went back to macros
it may have existed a little bit in the excel class, but i never took it.
yeah, my access class was more about making pretty forms than making it actually do anything
maybe doing some basic basic queries
or using the input mask for phone numbers
i never got the hang of that portion, but then, i never have ever used that since then.
 
:grumble: 3 hours of work just poofed I'm not happy.
 
confirmed that current installer works for VB6, must be the current-user-plus-elevation thing.
if it is that, it would have popped up the "Rubberduck cannot be loaded, remove it from the list of Add-Ins" dialog
 
9:16 PM
@mansellan awesome! so just to be clear, in order for it to work in VB6 user needs machine-level install, right?
yeah, hard to tell exactly what the problem was from the original tweet
 
Can you even do a user level VB6 install?
 
@MathieuGuindon is the easiest answer. You can run under a non-admin account per-user if you don't choose to elevate, but VB6 itself hates running as non-admin
@Comintern yes, and Carlos documented some registry hacks to make it useful, but suspect very few people run that way.
 
Not surprising in that it predates UAC.
 
VB6 RD is pretty stable at this point, its mostly just extra features I wanna add now :-)
 
Yes, I used a pre-release build and installed under all users and it loads now. Thank you! https://twitter.com/rubberduckvba/status/1044612354720354304
 
9:22 PM
@Comintern It predates most everything ;-)
 
good job @mansellan!
 
:-)
the installer was @this
 
we probably need to add something about VB6 install requiring machine-level, not user-level install
@Duga oh nice!
 
9:25 PM
@MathieuGuindon agreed
trundles off to the wiki
oh actually, I'll wait till it's 'official'
 
@Hosch250 Ummm so you can met the level of insane tests edge cases like Thunderframe consistently?
 
@IvenBach Autorecover saved you all but 10 mins of work. You got lucky fool.
I got to remember not to trust Excel with more than 15 mins of work increments.
 
9:46 PM
@IvenBach i just dont trust excel :P
 
@IvenBach You certainly shouldn't run some of my SO code without saving your work.
 
@Comintern Private Declare Funct... oh, it's GPF'd...
;-)
 
I don't. I just got in shoulder deep with a refactoring. My mistake for not saving periodically and turning off the BeforeSave event. Like I said I got lucky and didn't have to redo 3 hours. :whew:
 
but seriously, before i got into the habit of snapshotting in access (well its a custom thing where it closes everything and then saves a copy of the file for me) every so often, i lost like 6 hours of work
it sucked
 
@Comintern I can't understand 1/3 what you suggest... It used to be 1/2 so I'm making progress.
 
9:48 PM
i basically gave up for the rest of the day
 
@IvenBach LOL. Don't sell yourself short.
 
@KySoto I FUBAR'd 2 weeks worth of work once, long story. Lesson learned from that one.
Comintern, a lot of the stuff you post makes my head spin. It does provide lots of reading material.
God I wish I could have some vague notion of tests on these refactorings. #WishForTheBest
 
I spent 2 days scanning and shredding documents once, right before that hard drive crashed. That really sucked.
 
oooof
 
~.~ Ouch
I love what technology can do, except when it's bad.
 
9:51 PM
yeah one of my worst ones, i had like 2 or 3 days of work on a project
and i had some seriously good breakthroughs
 
Luckily both my scanner and shredder are slow. :-P
 
and left it on over hte weekend, computer wouldnt let me log in
it just did the spinning circle thing
had to hold hte power button shutdown the computer
i was sad because it totally corrupted the file and i hadnt made any snapshots of it yet and had to start from scratch
The database is most likely corrupt because someone keeps insisting on mucking around with it while it's open by an unknown user instead of leaving it alone and figuring out who has it open instead. Access is not designed to have people replacing it's databases while they're open by someone else, especially by overwriting them improperly. Fix the problem instead of making things worse by futzing around doing things you shouldn't be doing. Someone has this file open, so let me overwrite it at the same time. Hmmm... I wonder why it keeps getting corrupted?Ken White 4 mins ago
that made me giggle
 
10:19 PM
@KySoto Oh dear.
 
the guy in that question is kinda a derp
which is why i think that comment is funny
 
Patient: My nose only bleeds when I put my finger in there.
Doctor: I think you have your answer...
Patient: But I don't want to stop!
Along the lines of conversation I had with a small human recently.
 
or better, my foot hurts when i kick the brick wall without shoes really hard...
 
Eh, we're all derps at one point or another, with one tech or another.
 
Hot diggity! It sure helps when you can RTFM and figure it out yourself. RTE451 has been resolved.
:pout: Rejoiced too soon...
 
10:33 PM
Do we have an open issue for an inspection that flags multiple conditional statements on an inline IfStmt?
e.g. If foo Then bar : baz
where conditionality of baz is ambiguous
 
That feels like one we'd already have.
 
I don't think we have half of the formatting inspections we should.
public class ThunderCodeInspection : ParseTreeInspectionBase
Interestingly, this is compiled as a multi-line If statement: If x Then y: End If
 
We literally don't have half the inspections we thought of implementing
@Comintern wait so baz is unconditional? :confused:
 
And, the VBE removes the superfluous : after the y in this: ` If x Then y: Else z: End If`
 
10:49 PM
Inspector needs to stop systematically running for all projects/modules if RD is going to be running 175+ inspections
thinks of that sidebar again
 
@MathieuGuindon Nope.
Public Sub Foo()
    If x Then y: z
End Sub

Function x() As Boolean
    x = False
End Function

Sub y()
    Debug.Print "y executes"
End Sub

Sub z()
    Debug.Print "z executes"
End Sub
^ Does nothing.
This however... If x Then y: End If: z
I'm considering a "Use of : operator" inspection at this point.
 
ok so it's not too bad. ...but still bad nonetheless
@Comintern I'd like one that flags redundant ones at least
Like Case 12: and On Error GoTo EH:
 
Yeah, that would be nice.
 
that one has an open issue IIRC
 
What is the technical name of :? I don't think I've ever found it.
 
10:54 PM
Instructions separator?
possibly w/singular "instruction" though
 
Searching for ":" in ms-vbal is not much fun, BTW.
 
So... "Explicit EOS is redundant. ENTER is good enough"
 
"Explicit EOS is an unreadable POS"?
 
2% bbl
 
11:15 PM
@IvenBach @Rubberduck The dividends keep paying off on your article christopherjmcclellan.wordpress.com/2015/04/21/…. While MVCE realized I'd forgot to include .[_NewEnum]
 
11:37 PM
 
Home time. AFAICT refactoring was a great success. Logic is much easier to follow.
 
00:00 - 19:0019:00 - 00:00

« first day (1572 days earlier)      last day (1608 days later) »