« first day (1350 days earlier)      last day (2799 days later) » 

3:00 PM
and other people from different domains can gain knowledge by reading your question and its answer
 
Business as usual.. Linking question in case anybody else runs into this:
0
A: What is the correct syntax to the -Context parameter of EF 7's Add-Migration command?

MaverikYou're using the wrong EF7 package! As per the announcement, there's no longer an Entity Framework 7 but only EntityFrameworkCore. As per your linked documentation and specifically following the documentation section for Full DotNet You need to reference Microsoft.EntityFrameworkCore.* and not E...

 
Thanks, Maverik
Good to know the name has changed
 
lol ><
 
@Learning do you have difficulties formulating your question in an abstract way ?
 
@franssu Yes right now i am really struglling to demonstrate my problem
 
3:08 PM
I have a table A which contains a list of elements B and another table C which contains ids of B elements....
 
and little frustrated too as because i have been searching for this since from 2-3 hours
 
^ this is what your question should look like
 
ok let me try to create again my question from scratch
 
@Learning stop creating questions.. it'll get closed by votes
formulate questions here
 
what's interesting is...
once you've formulated your question...
you should automatically have your answer
 
3:13 PM
many times you'll be able to solve it without asking
 
because that's what queries are about
 
i read your mind grin
Learning, asking a good question is like trying to explain to a 10 year old what your problem is
 
i have never been in this situation like before
 
detach yourself from details
 
nowadays whenever i ask question i have always got a upvote
 
3:15 PM
Franssu said, WE shouldn't have to learn about details of your problem domain
 
but i am only struglling with this question
 
so think of us as all dumb people who cannot understand your project
yet by some miracle we can answer your question once we get what you need :D
ok.. try another thing
change all the class names from problem
like franssu said
 
but i have already did it
 
rename everything to a, b, c while maintaining data relationship
 
because this are not original names
 
3:16 PM
@Alex looks like this after renaming.
 
@JohanLarsson I like it!
Good job, Johan
 
@Learning good vocabulary to ask your question : list, enumerable, collection, aggregate, collect, select, group, group by, where, select many, ....
 
@Learning using meaningful names in a renamed class is a pretty bad idea - it forces the reader to recreate meanings that shuoldn't matter
you're relying on semantics of data that the readers do not know of
either use analogies like apples / oranges / bananas, cut / peel / eat, for operation for example
or change it to single letter class names and try to explain how many of what shuold be in what
again, do it here instead of editing your question
 
so..
if linq is about writing queries...
which are named queries for a good reason...
two possible situations
1/ OP doesn't know some query language vocab
2/ OP doesn't know what his question really is
 
i know what my question is
 
3:29 PM
then translate it to linq
 
    var data =(from mk in context.Test
                  select new
                  {

                      TotalVariants = (mk.TestOperation.Select(t => t.SubVariants).Count()
                                   +
                                      mk.TestOperationDifference.Select(t => t.SubVariants).Count())
                    }).ToList();
Notice this query
For each test i am getting number of Test operation done
same way for each test i am getting particular Testoperationdifference done
For Eg: i have used test Id:100
 
you don't have to explain it
TotalVariants = (mk.TestOperation.Select(t => t.SubVariants).Count()
                                   +
                                      mk.TestOperationDifference.Select(t => t.SubVariants).Count())
it's does what it tells
 
So for testOperation count should be 2
Id   TestId    SourceSubVariantId   TargetSubVariantId   variation
1     100       69                    70                   0
1     100       70                    71                   20
1     100       72                    73                   90
Because first 2 records are referring to same Variants
so for first 2 record count should be 1
 
what..
 
mk.TestOperation.Select(t => t.SubVariants).Count()
 
3:37 PM
your query reads: Pick all the SubVariants of TestOperation and count them
 
TestOperation has 5 SubVariants
 
then you do same wiht TOD version of it and then you add the sum
 
mk.TestOperation.Select(t => t.SubVariants).Count() = 5. why would you expect different
 
notice SourceSubVariantId and TargetSubVariantId with Id:69,70,70 71
This Id belongs to single parent variant
 
none of those variables are used in your linq query
 
3:38 PM
that is why i want count as 1 for this
check my classess
you will find it
 
what does it matter if they are in your classes but not used in the linq?
you are not performing any logic against them
 
this is how problem solving works
problem is with your query, so we'll focus there.. I'm still not getting how we're supposed to get 5 even xD
@Learning where are you showing us this parent variant?
nvm.. i see where
in yet another table
 
i think i get it >.<
 
so mk.TestOperation.Select(t => t.SubVariants.Variants).Distinct().Count()
as some of the other peopel have already said in their answers
mk.TestOperation.Select(t => t.SubVariants.Variants).Union(mk.TestDifferenceOperation.Select(t => t.SubVariants.Variants)).Distinct().Count()
that then should give the correct answer
 
see this sql query which gives me perfect result:
select c.Name from [dbo].[TestOperation] as MS
join [dbo].[SubVariants] as CD on MS.SourceSubVariantId =CD.Id
join [dbo].[Variants] as C on C.Id =CD.VariantId where MS.TestId=100 group by C.Name
 
3:44 PM
"69 is going to test (or whatever) 70, 70 is in the table too as a source, and 70 is going to test 71. 72 is going to test (or whatever) 73. so the count is 2 because you'd only have to "start" 2 separate tests"
 
your SQL has a group by. your linq does not
 
69 is compared against 70
 
^ it's lower
:D
 
so this sql query gives me output
:
3
 
SourceSubVariantId is a Parent UNLESS the number in SourceSubVariantId also shows up in the TargetSubVariantId column.
 
3:48 PM
Problem is only during this as 69,70 and 70,71 belongs to same variant so i want to count them as 1
 
Learning, the query that 3 different people have given you.. should work according to your logic
 
no they are not working at all
 
mk.TestOperation.Select(t => t.SubVariants.Variants).Distinct().Count() should give you 1
unless you don't know how to operate it on correct domain
logically, it does what you're asking
if this doesn't work, we need see a copy of your database
make a github project
and throw an embedded sql mdf in there
would have been a lot quicker to see it in a sample project than the amount of time this has taken from all of us
create a console app -- copy paste your test context file in there and have console.writeline do your result
attach the sample tables into db file and post it all up (everything basically from your question in form of a proper sample project)
(i hope you know how to use "(localdb)" database server)
 
seriously there's a more fundamental problem
 
theres a lot of them if you ask me xD
 
3:54 PM
linq is a query language
can't read people's mind
 
RelativeSource={RelativeSource Parent} and RelativeSource={RelativeSource Root} would be nice
RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}, AncestorLevel=1}
is what parent looks like now I think
 
yes it would Johan, but I really don't know how is that going to help since the answer should be 3
 
RelativeSource={RelativeSource AncestorType={x:Type Window}}
is root I guess
@franssu 3?
 
it's what the answer should be :D
sorry
 
lol
 
4:03 PM
:)
 
ruthless
I found the answer ---> System.Console.WriteLine(3);
 
    <Style TargetType="{x:Type propertyGrid:Row}">
        <Setter Property="Background" Value="Lavender" />
    </Style>

    <Style BasedOn="{StaticResource {x:Type propertyGrid:Row}}" TargetType="{x:Type propertyGrid:StringRow}" />
Is the second row always needed?
StringRow : Row
 
3
 
reboot franssu
 
mustve logged into a new user to add another upvote
 
4:13 PM
The question is on its way to getting closed @Learning -- if you're gonna try to do something, you should do it fast
there's 2 close votes on it right now with reason: "question is not clear" .. 3 more votes and it'll be force closed
 
must be late in India
 
I didn't get it!
how is that relevant? O.O
 
did you say 3 more votes?! thats the answer we're looking for!
 
according to time.is/India -- it's 21:46 right now .. so yea it is late :D
 
The closing on so is annoying.
close meta
 
4:18 PM
0
A: How to group by on 2 child entities and get total of both this child entities?

David Bfrom test in Tests where version == 0 let opsVariants = test.TestOperations .SelectMany(x => x.SourceSubVariant.Variant).Distinct() let diffsVariants = test.TestOperationDifferences .SelectMany(x => x.SourceSubVariant.Variant).Distinct() let variants = opsVariants.Union(diffsVariants) select ...

really should be spot on answer.. i dont get how its not
 
Yeah I just came home
Office was closing so I need to get out of there
The above answer which you show me I have tried it but was getting error on subsourcevariant because there is nothing like such property in my code
 
@Learning read the logic and fix it yourself
 
4:33 PM
Wow.. it's been busy in here.
 
not really, just noise
 
yea mostly noise :)
 
  [XamlSetMarkupExtension("ReceiveMarkupExtension")]
^ looks interesting
 
@Maverik ok
 
can't remember where I want to use it though
 
4:35 PM
Thank you all for guiding me through out this problem
 
did you solve it @Learning ?
 
yea that'd be the big question!
 
No but tomorrow I will try some variations with those answers
 
:(
 
throws papers on desk
 
4:38 PM
Little frustrated now
 
how long have you beem programming ?
 
been using DD since before it was cool. lol
 
don't worry, it still isn't ;)
 
About to complete 2 years
 
4:44 PM
@Julien i've been trying for 2 years but just can't get the hang of it :(
i get the idea but there's not enough documentation for me to effectively wield it
 
I didn't got the good opportunities in my previous job
 
i had a lot of help from the author
i think i was his first real user lol
 
possible!
would have been nice if you blogged about your experiences :)
 
as soon as you have big datasets and the need to filter and sort on the fly, DD becomes a great idea
 
that guy has some pretty cool projects
 
4:48 PM
yea i've had quite a few of those times.. i've actually wanted to use it on webservice side of things
 
sharp UI
 
for me it was more manipulating OC's and getting the UI to follow along
 
Sorry guys I think I should not say all this
 
don't worry about it, keep bettering yourself, keep @Learning, and get some rest tonight, its late for you
 
@Kevin thanks buddy
 
4:52 PM
I don't think there's anything wrong with your comment that you deleted
 
Actually I am keeping watch on my question
 
you're acknowledging a problem.. not bashing the organisation - that's the key difference on what you should or shouldn't say
 
cough
 
Actually I am alone with major all my projects so when sometimes I am stuck I am just stuck
That is why I share all my problems on SO
 
you need to socialize
get friends who enjoy programming
 
4:56 PM
Here is the big and major problem
The place where I live hardly have .net programmers
 
Or just programmers
 
This is a pretty neat WPF app too: github.com/flagbug/Espera
 
From india
 
where in India ?
 
you have to go to Surat :p
 
I was there only in surat
How you know about surat?
 
Right now I have change my job and now doing in my city only
 
> Queen lead singer Freddie Mercury had family origins in Valsad,
crazy
 
5:04 PM
I'm going home.
cu guys
 
tschau
 
get some rest @Learning !
 
See ya @franssu
 
See you too sir
Ok and thank you
 
i will never understand how > 1.2 billion people fit into a land mass the size of india
 
5:11 PM
India is very big country
Enough to accommodate this size and can accommodate greater than this size too
Var india= new Arraylist();
Size will increase dynamically on each addition
 
@Kevin He was a Zoroastrian, from what I remember
 
India is smaller in size than the united states
i like my land to not be a densely populated city every where i go
 
Interesting trivia about India: "India has 22 official languages. According to Census of India, the total number of mother tongues spoken in India is 1652. However, only around 150 languages have a sizable speaking population. The Indian census of 1961 recognised 1,652 different languages in India (including languages not native to the subcontinent)."
 
Every country is beautiful is his own way
 
true, no knocking India at all--I want to visit. Its just that, that's a lot of people!
 
5:17 PM
You are most welcome and I am damn sure you will definitely like it
Awesome food awesome places
When you come india do visit my city also
I will explain you my recent problem face to face
Ha ha
 
lol
 
I too want to come US
But it is impossible
 
why?
 
US visa is impossible to get
Actually I want to come US for job
 
5:22 PM
can't you get one just to visit?
ohh
 
All kinds of visa for US are tough
But my reasons are different for coming to US
 
See the Baha'i temple in India
Millions go there every year
 
@Alex have you ever came to india?
 
No, but would love to
 
Most welcome alex
And same proposal for you too
 
5:33 PM
Thanks, @Learning
My brother was going to come last summer, but forgot to get his visa before the flight. Assumed they didn't need one
 
Alex what do you think about this api:
<propertyGrid:StringRow Header="default" Value="{Binding StringValue}" HeaderStyle="{StaticResource HeaderTextBoxStyle}"/>
 
Johan, it looks straightforward
Easy to use
Self explanatory
 
the idea is if you pass in a style for HeaderStyle with TargetType="TextBox" it will use a readonly textbox for the header
 
Really?
Interesting
 
and if you pass in a style for textbox it will use a controltemplate for that
 
5:38 PM
If I try that with the default controls, they'll blow up
Nice
 
same with the error & old value stuff
 
@Alex whenever you or any or your family member gonna comes to india do tell them to visit my city
 
@Learning Sure will. Thanks, Learning
 
if you pass in InfoPresenterStyle="{x:Null}" it will create a grid looking like this:
 
I was out to lunch. Did you get your SO question figured out, @Learning?
 
5:39 PM
So when is your brother coming to india
Nope not yet
 
He's busy but maybe next year
 
so brother got plane tickets, and ended up not being able to use them? lol
 
^would be with textbox for headers & no info bs
 
Maverik fransu all really helped me so much
 
5:40 PM
Well, we realized before he went to the airport
 
Brother was coming to india?
 
@Learning These are good people here :)
@JohanLarsson I like how it does so much automagically
@Learning Yeah, last summer
 
can be both good and bad
 
All are really good people here because I have forgot to take some names
 
@Alex so he was out $1000?
 
5:42 PM
Don't know. He might have been able to use it for something else
@JohanLarsson Wondering if for some features, you can have IsSomething attached property to toggle on/off more explicitly
 
maybe
 
It'll have a default, but then you can more explicitly toggle it too
But that's another version :)
 
but you can always write styles for it so flexibility is high
 
Not sure if there's even something this nice in the HTML world -- just pass some values to a tag and have it generate a nice label and control + validation, etc.
How do you find the energy to do all these cool things, @JohanLarsson? :)
Putting me to shame here!
Still wrestling with that first WPF app
 
it is good that you wrestle and don't just ship shit
 
5:56 PM
Trying to avoid that
Now collecting requirements for the reports
Also trying to understand how SSRS reports will receive parameters from the VM passed into the code-behind. Or maybe, the parameters can somehow be shown in the report using dropdowns, etc.
 

« first day (1350 days earlier)      last day (2799 days later) »