« first day (1568 days earlier)      last day (1612 days later) » 
00:00 - 19:0019:00 - 00:00

7:00 PM
depends on how well the data-driven tests fail
if you can only fail a data-driven test "all or nothing" that's not helping
if you get separate fails for every data parameterization, it's probably easier to use data-driven here
 
OP's For loop then
 
the problem with OP's for loop is that most frameworks abort after the first assertion failure
so you get incomplete information
 
good point. I also feel like Public Sub Remainder doesn't tell me what the thing is testing, and what it's testing depends on the arbitrary data: the intended test cases aren't half as clear-cut as dedicated test-per-testcase
 
@Vogel612 I figured out --soft and --hard but I get confused with the terms. Are "Index" and "Snapshot" synonyms? I can't understand the manual, yet. I was reading at atlassian.com/git/tutorials/… and they use "Snapshot"
 
that said I'm probably missing a test or two that assert the actual correctness of the calculation
 
7:07 PM
@IvenBach dunno, lemme check.
"staged snapshot" ~= "index" ~= "staging area"
 
A word by any other name would still mean the same... So long as they are indeed referring to the same thing.
 
the problem with the idea of a snapshot here is that the git "snapshots" (aka. index) may be "partial", which is not usually a property of snapshots
 
What's a partial snapshot then?
 
do you remember way back when we started with git?
the different ways of how source control can work?
 
I don't remember much of when I started.
 
7:16 PM
so there's two ways to store versions
either you go "start here, then do this, then this, then this, then this, and now you're done"
 
> That test is essentially a "poor man's data-driven test" working around lack of data-driven support for Rubberduck unit tests (#1229).

An alternative work-around could be to split it into multiple tests that explicitly cover a single case, for example:

```vb
'@TestMethod
Public Sub GivenSameDividendAndDivisor_RemainderIsZero()
Const value As Double = 10
Const expected As Double = 0
If value = 0 Then
Assert.Inconclusive "Test is misconfigured"
Exit Sub
 
and that's "diff-based"
 
@Duga had to edit again, linked to the wrong issue
 
so you have a start, add some "changes" until you get to the "current version"
the alternative is to store each version completely separate from every other version
 
You're talking about the differences in version control.
 
7:21 PM
and the easiest way to do that is to use "snapshots"
@IvenBach yes.
everything in git is a snapshot
 
You should probably specify Option Explicit at the top of the module. That would highlight things like sSQLSting (boy that's an easy typo, btw) being undeclared (and sSQLQry being unused). Proper indentation would enhance readability, too. — Mathieu Guindon 30 secs ago
s[string] SQL Sting
 
usually you'd not think that a snapshot doesn't encompass "everything"
 
'Initial commit
Public Sub Foo()
    Dim bar As String
    bar = "duck"
    Debug.Print bar
End Sub
'Alter bar's value commit
Public Sub Foo()
    Dim bar As String
    bar = "DUCK"
    Debug.Print bar
End Sub
^ Git has a full entire snapshot of each
 
correct
svn instead stores:
 
Whereas a delta-diff VCS would be just the change between "duck"-->"DUCK"
 
7:24 PM
@IvenBach that's how you can browse any file in the repository at any given tree
 
'Initial commit
Public Sub Foo()
    Dim bar As String
    bar = "duck"
    Debug.Print bar
End Sub
---
- 'InitialCommit / + 'Alter bar's value commit
- bar = "duck" / + "bar = "DUCK"
 
@MathieuGuindon :lightbulb: Now I'm using them electrons.
And another reason why it's so fast.
 
exactly
 
:+1:
I take a long while but eventually get there.
 
now the cool thing about git snapshots is that they are smarter than you think
 
7:26 PM
Howso?
 
consider multiple files
what happens if a file does not change between commits.
How do you avoid storing the same file for every commit, even if it doesn't change?
 
7:40 PM
#magic
 
Is there any reason RD couldn't do data driven tests?
We could pull the parameters out of annotations.
 
@Comintern that's the idea of #1229
 
0
Q: Lathe faceplate - ID and use

DaveI've bought a second-hand lathe to try woodturning. Question 1. What make is the lathe, in case I need spares? there are no markings on it at all. About 1m long, cast iron hollow rectangular pylon at head end, twin round rails to which tailstock and tool support clamp. Twin square rails as a bas...

"I have a motor vehicle. It has 4 tires and a steering wheel. What kind is it?"
 
a farm tractor, duh
 
> M6 thread fits them. I'm wondering, why threaded?
Ummm, so the M6 screws don't just fall out?
 
7:49 PM
@MathieuGuindon there is no such thing as magic
 
I hope I don't lose too many followers for this, but too bad for them if I do. This shit is serious.
I try very hard to stay away from politics and controversy (there's plenty of it on Twitter already IMO), but this is important and I simply can't not retweet this thread. https://twitter.com/jezhumble/status/1043194008896524288
@Vogel612 except (computer) science so advanced it's indistinguishable from it =)
 
meh.
I grant you that deep neural networks are magic
everything else... de-magicable
I can give you a hint :)
say you have an object. And you need to know about the object in different instances of another class.
how would you go about "saving" (aka. storing on the heap) the object only once?
 
not sure I understand the premise
"the object in different instances of another class"?
so there's an instance of Class1 and Class2, both holding a reference to Thing1
click
pointers
 
ding
correct
 
@Comintern 'cause if it ain't threaded, it ain't a screw, it's a pin.
 
7:58 PM
Yay! I think I finally found my memory leak.
 
bleh, i cant think of a SQL way to get a value from the previous record
im reduced to using the ultra slow method of using a VBA function to get it
 
@Comintern you remembered it?
@KySoto "previous record" ...based on what?
 
LOL. I was remembering right up to the point where I crashed with an out of memory error.
 
the clustered index? some custom sort?
 
public static void WriteStatus(int current, int total)
{
    var write = "Processed " + current + " of " + total + " records.";
    Console.Write(new string((char)8, write.Length) + write);
    if (current == total)
    {
        Console.WriteLine(string.Empty);
    }
}
^ That.
 
8:03 PM
@MathieuGuindon We have engineering masters that have a set of sequence steps that operators clock labor into
 
@KySoto use window functions. That's what it's for.
 
they FREQUENTLY type in the wrong quantity at some step
 
depending on what you need, LAG() or LEAD(). You might actually want to use other aggregation functions.
 
@Vogel612 It only stores the file if it flags it as being modified, and you add it to the Index.
 
8:03 PM
@this I'd do a windowed row_number() in a CTE
 
SO im building a query that will give us a report of all of the active work orders where those quantities are bad
 
googles up LAG and LEAD
 
@IvenBach hm. but if you "jump to a commit" then, how do you know which files there are in the repo, if it's not been added to the "snapshot"?
 
I was just thinking ROW_NUMBER myself.
 
and the simple way im doing this is getting the good and bad quantities from the current step, then comparing it to the previous steps good quantity
 
8:04 PM
OMG WHERE WAS LAG ALL MY LIFE
 
You're welcome.
 
not that I'd need to use it very often
 
if the current steps quantity good + bad is higher than hte previous steps good
then we flag it
 
@Vogel612 Not quite sure I understand your question Big Dan Vogel. Wouldn't it traverse the parents to see what files should be there?
 
I don't use it very often either but when it's needed, it's a lifesaver
 
8:05 PM
if its the first step, we get the amount we created our work order for
 
@IvenBach but then you don't have independent commits
 
@KySoto in this case, I think you want a SUM(...) OVER (... with a range bounding.
 
i guess it does make sense to do it in sql server and make a view out of it
but since i didnt know how to get the value i needed
i had to do it via access
since i know i can get it from a vba function
 
no, don't
use sql server
 
8:08 PM
^
 
also, i have no idea what sum(...) over(... with range bonding is
 
^^
 
data belongs in database.
 
@Vogel612 That's why I'm missing something and don't understand your question.
 
buy my book, maybe? :p
 
8:09 PM
@KySoto shortly put: THE BEST THING SINCE SLICED BREAD
 
or chocolate?
:P
 
AND chocolate
 
O_O
 
but not Whiskey
 
i cant do whiskey
last time i drank it
i had one shot, (of only that) and woke up with the swims
 
8:11 PM
shot?!
 
yes?
 
lol, nope :)
 
wow. piece of junk copy paste
i was going to get a data sample, and it was like. naw cant paste this into excle
 
@IvenBach Think of a commit as an instance of a class
 
maaan
 
8:18 PM
what members does the class have?
 
lag and lead are sql server 2012
gdit
i have sql server 2008
 
@Vogel612 Whatever members you define it to have, and whatever it Inherits or Implements. Is this a trick question?
 
@KySoto You should have ROW_NUMBER
 
go ahead and define these members
what API does a commit expose to git internally?
 
I have no clue.
 
8:20 PM
what API does git expose to you as the user on a commit?
 
I don't know.
 
@Comintern man this just got even more complicated -_-
also that could give me an incorrect value
 
@Vogel612 Would it be the flags you can use in git-scm.com/docs/git-commit?
 
no. git-commit is a commit's constructor
and the flags are the constructors arguments
 
@KySoto Huh? What would be an incorrect row numbeR?
 
8:24 PM
the row number would be correct but i dont know how i could properly get the appropriate value
 
that's what you use the windowing for
 
i have literally zero idea what windowing is
 
row_number() over (partition by {fields} order by {fields})
 
partitioning
 
Think of the row numbers down the side of an Excel sheet. It literally does that in a field.
The partition is like a group
 
8:26 PM
@Vogel612 I'm struggling with what you're asking.
 
say you have dates and you want to number them. if you partition them by month-of-year then you get the row number to reset to 1 every first of the month
 
git can do stuff with commits. Like:
- show a log of commits
- check out a given commit
- merge two commits
- ...
 
Or if you have transactions for vendors. You partition by vendor and order by timestamp.
 
^ yeah that's a better example, perhaps
 
what would a class "Commit" expose to facilitate / enable these operations
 
8:28 PM
so i have this set of fields:
 
I don't know since I don't understand everything git does. Is git-scm.com/book/en/v2/Git-Internals-Git-Objects what you're asking?
 
[WORKORDER_TYPE]
,[WORKORDER_BASE_ID]
,[WORKORDER_LOT_ID]
,[WORKORDER_SPLIT_ID]
,[WORKORDER_SUB_ID]
,[SEQUENCE_NO]
the first field id need to filter with, the next 5 need to be joined
then i have to figure out what the previous sequence_no is
but the numbers are pretty arbitrary
some work orders start at sequence 70 and skip by 10s, or not depending on who made it
 
@IvenBach you're skipping ahead
 
,[RN]=row_number() over (partition by [WORKORDER_TYPE] order by [SEQUENCE_NO])
 
work order type is not unique
 
8:30 PM
I'm just trying to figure out what you're initially asking.
 
but yes, that's what I'm asking about
 
in fact i need to set it to "W" because this table stores quotes "Q" and masters "M"
and im looking only at "W"
 
doesn't matter
just try it!
 
Don't forget that even though I can better use git now I still have no clue what it's doing. Just like I can use Windows but don't know anything about WM api calls or anything underneath the GUI.
 
then play with it, change the partitioning (you can specify multiple fields to partition by), see what results you get
it's really the only real way of understanding just how awesome windowing functions are
 
8:33 PM
You probably want something like this:
SELECT WORKORDER_TYPE,SEQUENCE_NO,ROW_NUMBER() OVER(PARTITION BY WORKORDER_TYPE ORDER BY SEQUENCE_NO) AS NORMAL_SEQUENCE FROM Whatever
 
and once you grasp windowed sums, start playing with rows unbounded preceding - and now you can single-handedly issue year-to-date summaries instantly spit-out by SQL Server, without involving any Excel pivot
@Comintern ..looks very much like what I did, except with an explicit AS clause for the alias :)
AND SCREAMCASE. SCREAMCASE EVERYWHERE!
 
so this is my sql statement
SELECT
      [WORKORDER_TYPE]
      ,[WORKORDER_BASE_ID]
      ,[WORKORDER_LOT_ID]
      ,[WORKORDER_SPLIT_ID]
      ,[WORKORDER_SUB_ID]
      ,[SEQUENCE_NO]

,[RN]=row_number() over (partition by [WORKORDER_TYPE] order by [SEQUENCE_NO])
  FROM [VMFG1].[dbo].[OPERATION]
  where WORKORDER_TYPE = 'W' and WORKORDER_BASE_ID like 'W%'
  order by WORKORDER_BASE_ID desc,WORKORDER_LOT_ID,WORKORDER_SPLIT_ID,WORKORDER_SUB_ID,SEQUENCE_NO
 
I scream case SQL keywords.
 
WORKORDER_TYPE	WORKORDER_BASE_ID	WORKORDER_LOT_ID	WORKORDER_SPLIT_ID	WORKORDER_SUB_ID	SEQUENCE_NO	RN
W	W69918	1	0	0	70	277369
W	W69918	1	0	0	80	317899
W	W69918	1	0	0	90	371501
W	W69918	1	0	0	100	385067
W	W69918	1	0	0	110	433450
W	W69918	1	0	0	120	459636
W	W69917	1	0	0	70	277368
W	W69917	1	0	0	80	317900
W	W69917	1	0	0	90	371500
W	W69917	1	0	0	100	385068
W	W69917	1	0	0	120	459637
yeah i just threw it together
those row numbers are all over hte place
oh. derp. over base_id
 
that's because of the order by clause
make the final sorting match the partitioning & ordering, then everything should be in sequence
 
8:36 PM
WORKORDER_TYPE	WORKORDER_BASE_ID	WORKORDER_LOT_ID	WORKORDER_SPLIT_ID	WORKORDER_SUB_ID	SEQUENCE_NO	RN
W	W69918	1	0	0	70	1
W	W69918	1	0	0	80	2
W	W69918	1	0	0	90	3
W	W69918	1	0	0	100	4
W	W69918	1	0	0	110	5
W	W69918	1	0	0	120	6
W	W69917	1	0	0	70	1
W	W69917	1	0	0	80	2
W	W69917	1	0	0	90	3
W	W69917	1	0	0	100	4
W	W69917	1	0	0	120	5
 
thats better
 
That looks better.
 
@IvenBach then I don't understand what more you need to know about reset ...
but eh.
 
because if its a 1, then return a 0
for hte sequence
 
8:37 PM
just stick a -1 in there then
 
- 1?
 
well so now that i have row numbers
 
You actually had them before, you just normalized them.
 
now that i have useful row numbers
i might be able to make what i need
 
now turn that select into a CTE, since you can't use LAG - you'll need to join it onto itself to get the RN for the previous record
I can't imagine doing that in Access
 
8:39 PM
yeah CTE doesnt exist in access
 
well it'd be a subquery
 
i had to create a function to get the previous record
some people would use dlookup
but that is slow as balls
i just created a parameterized query that was as efficient as i could make it
 
re-run your query with the "show execution plan" - make sure you have all the indexes you need
 
but you are still opening and closing a recordset for every record
 
(there should already be an index on the columns you're partitioning and ordering by though)
 
8:41 PM
heh yeah, i probably dont, i mean this is a sql server 2000 database replicated over to sql server 2008r2
 
They had indexes long before 2000 ;-)
 
then they'll definitely pop up in the execution plan if they're missing
 
yeah but the replica part
 
Shouldn't matter.
 
i dont know if the index's were properly brought over
 
8:42 PM
with proper indexes the whole operation should be pretty much instant
 
i know the table designs dont show the pkey
 
oh, damn
 
Key != index
 
true
 
yeah but no PK => no clustered index => table scans every time
 
8:43 PM
true
 
yep, its a nonclustered index
2% cost though
 
ok, so there's an index, and execution plan isn't screaming about a missing index
and you're hitting the one that's there
that's good
 
That looks like it should have a composite PK on WORKORDER_TYPE, SEQUENCE_NO
 
I only ever use a composite PK for many-to-many assoc. table
 
yeah, they do have a composit key on the set of data i am working with
 
8:45 PM
@Comintern in my db that would be a unique constraint named NK_TableName
NK => "natural key"
 
yeah the index scan is only 2% on the execution plan
the two sorts i have are 49% each
 
In my DB it would have some crappy random name.
 
the row number sort, and the overall sort
 
I suck at naming constraints.
 
alter table mrp.[Fabrics] add constraint PK_Fabrics primary key clustered (Id);
alter table mrp.[Fabrics] add constraint NK_Fabrics unique ([Collection],[Code])
alter table mrp.[ModelCategories] add constraint FK_ModelCategories_Model foreign key (ModelId) references mrp.[Models] (Id);
 
8:47 PM
heh you have schemas
we have... dbo
 
works just as well
 
no other schemas at work here
 
the DB has several purposes, that's why I broke it down into schemas
 
schemas are more useful for partitioning data or managing access than anything else.
 
@Comintern it's really about picking a scheme, and sticking to it :)
 
8:49 PM
I try very hard to stay away from politics and controversy (there's plenty of it on Twitter already IMO), but this is important and I simply can't not retweet this thread. https://twitter.com/jezhumble/status/1043194008896524288
 
So just out of curiosity, what is the benefit of non-natural PK?
 
single-column FKs/joins over ints
 
Ah.
I'm so used to multi-field joins in the crap databases I deal with I tend to overlook that.
 
Personally I have my doubts about natural keys. If the natural keys are alphanumeric, then you are going to end up taking more space than if it was a surrogate integer key.
and more space = more work in the join
but TBH, I never actually put this to a serious test. Probably should.
 
the unique constraint is a built-in data integrity assurance that you get for free, and an index you get on columns that are VERY likely to be filtered on
I never use NKs for joins
not in my schemas anyway
I'm just very systematic with db design... served me well to this day :)
 
8:55 PM
RE: unique, that's not a reason why you can't use SK, since you still can create. The better argument would bet ath you end up with an extra unique index you wouldn't otherwise have had it been used as a NK.
 
Oh yeah, I am too.
 
I think you're in minority if you can manage to not use NK in the joins. All samples of NKs I 've seen always end up being used in a join.
 
huh
when interfacing with 3rd-party systems, yes. when querying my own stuff, nope, never.
 
I have an address table for a side project that uses the hash of all the fields as the PK (generated by an insert trigger).
 
maybe I should write a book ;o)
 
8:57 PM
I'd probably do something similar with other more complex natural keys.
 
One of my co-author advocates for "use NK when there's a good one, otherwise surrogate it" which seems more sensible. It's the joins that worries me the most.
@Comintern as long you don't exceed the hash length, but if you do, then don't you end up with collisions?
 
I use a PK/SK in every single table I create, and identify a NK that I enforce with a unique constraint too. ..every time.
> ZOMG but you have an extraneous index you don't KNOW you're going to need!
yes, and proud.
 
@this I've yet to have a collision. Granted, I only have about 10 million addresses.
 
Wait - I see what you mean now - when I talk about SK/NK, I usually implicitly mean them as a PK.
If they aren't PK, they're just indexes.
 
As above: PK (clustered) is always an int identity(1,1) column named Id
 
9:04 PM
In my book you're using SKs, then.
 
It's not as useful to say you're using NKs for index compared to using NKs for PKs.
 
and the application consuming the db never ever cares about them
 
since in theory, all indexes should be based on some kind of CKs.
Agreed. That's not application's concern.
 
What's a CK?
 
9:06 PM
candidate key
e.g. an academic term that only mathematicians like Chris Date care about.
all keys, whether it's PK, NK, or SK has to be derived from a CK. Otherwise, it wouldn't be a key in first place.
 
yeah so it looks like this thing i made really only needs to be ran once
because the macro i implemented will catch any future errors
 
> I considered splitting the test in several smaller tests, but since this is a rather simple function in a rather extensive Arithmetic class, I decided to try and keep all test cases as compact as possible.

Anyway, this worked:
> `Dim ExpectedRemainders As Variant`
> `ExpectedRemainders = Array(CDbl(0), CDbl(1), CDbl(1), CDbl(0), CDbl(0.2), CDbl(0.2), CDbl(0), CDbl(-1), CDbl(-1), CDbl(0), CDbl(-0.2), CDbl(-0.2))`

Thanks Mathieu.
> I considered splitting the test in several smaller tests, but since this is a rather simple function in a rather extensive Arithmetic class, I decided to try and keep all test cases as compact as possible.

Anyway, this worked:
> `Dim ExpectedRemainders As Variant`
> `ExpectedRemainders = Array(CDbl(0), CDbl(1), CDbl(1), CDbl(0), CDbl(0.2), CDbl(0.2), CDbl(0), CDbl(-1), CDbl(-1), CDbl(0), CDbl(-0.2), CDbl(-0.2))`

Thanks Mathieu.

By the way, nice idea the one you have going on for
 
9:23 PM
@Duga yet I don't know how your code reacts to a 0 divisor =)
 
hmm ...
 
Excel folks are funny
@rubberduckvba That is a solid strategy! Sounds like you're a pro. 😉
 
the extensibility assembly is not available for .NET Core projects by default it seems
 
@Vogel612 even if it were, I kind of doubt it's the only thing that 's not on .NET core
besides what does Core buy us?
 
9:31 PM
the new csproj format seems to kinda heavily push to core
 
well core & standard are the new thing. Still, I don't think we can benefit that much from either.
 
yea
 
10:14 PM
@all any suggestions to improve notepad in Window 10. An executive in MS is tweeting if people got ideas to improve calculator and notepad...now the time. onmsft.com/news/…
 
 
1 hour later…
11:30 PM
If hoping and wishing made code compile and work...
 
00:00 - 19:0019:00 - 00:00

« first day (1568 days earlier)      last day (1612 days later) »