« first day (1945 days earlier)      last day (3020 days later) » 

7:00 PM
@Failsafe you have that stack for logging purposes?
 
@Wardy and reports yea
and testing
 
I'm used to explicitly writing my SELECT/INSERT/UPDATE queries
 
many reasons
@Alex ok
 
@Failsafe logging or auditing or both?
 
@Wardy yes
 
7:01 PM
@Jeremy not much wave-making potential.
 
@Failsafe my stack is similar but its not that way for that reason
 
user47589
@Alex MVC isn't a database framework, you don't "do inserts in MVC". You can use SqlConnection, Entity Framework, Dapper, or any other library/framework
 
auditing / logging is made easy by it though (about 30 lines of code for my entire logging and auditing solution)
@Amy imo MVC shouldn't know anything about any of those
it should only speak to an API / service layer
 
@Alex if you are doing DAL's
disregard the MVC part of your app entirely
they are independent
the SQL queries should know nothing about your front end and vice versa
hence why we have DAL's
or API's
 
exactly
 
user47589
7:04 PM
@wardy that's an architectural decision. i was speaking more to the language used. MVC has nothing to do, conceptually, with data stores.
 
@Amy my point was ... all the things you mentioned are datasources
 
This is the only query I find in the application:

public GetActionReportQueryResult Handle(GetActionReportQuery query)
{
const string sql = @"SELECT
[ActionReport].[Id]
, UserId
, ReportDate
, EventDate
, EventName
, EventLocation
, EventTypeId
, OutReachTypeId
, IsSponsoredEvent
, EventSponsor
, PointOfContact
, PointOfContactEmail
, PointOfContactPhone
, OrganizationOrAgency
, ResourceId
, OtherResources
, SummaryOfEvent
, LastUpdateDate
, LastUpdateByUserId
, ApprovalCode
, [EventType].[Description] as EventTypeDescription
 
@Amy that just means you havent tried hard enough to implement a psuedo mvc structure in COBOl on a mainframe
 
user47589
its perfectly valid to do queries directly in your controllers if its some one-off thing with no chance of being used anyplace else.
 
@Amy that wouldn't hold in our team
there is literally no reason to query a db from an MVC controller
 
7:06 PM
same
 
user47589
there's literally no reason to always use a DAL. its not always necessary, or beneficial.
 
MVC can do nothing with a SQL query that adds value to that solution
 
user47589
architectural decisions should be made on a case-by-case basis.
 
it's personal preference
 
You can always refactor later if needed.
 
7:07 PM
@Amy I do't have a DAL but I do have IDataContext
 
user47589
exactly.
 
but MVC never deals with those either
lol
thats an architectural decision lol
 
user47589
i use data contexts in my controllers sometimes.
 
i always use a broker
just because i've been doing it for so goddamn long
it kinda stuck
 
user47589
hehe
 
7:09 PM
i like the stack anyway, i have templates up the wazoo
no real reason to switch it up
but regardless
 
controller > api > service > datacontext > db
 
it's still preference
 
If you exclude a dedicated business logic layer, does that imply that your entities should have behaviour, because something has to do the stuff that isn't intuitive in the database?
 
thats my stack
 
@TomW are you talking to me
 
7:10 PM
Anyone
 
if i didnt have a BLL i would do something like....
 
the key for me is how do you ensure the business rules are followed if your MVC controller has its hands on a data context
 
public class Operation : Base.Base {}
 
And if you design your database from the start to suit the structure of the application, so that the entities are a natural fit to the MVC models, is that OK?
 
its actually impossible in our setup to go directly from a controller to a datacontext
 
7:11 PM
where operation is the operation, etc GetResults
 
user47589
the controller enforces the rules. if you need those rules elsewhere, then you refactor.
 
and base is the set up logic for the operation
 
they live on different servers and those components cannot be deployed to our app servers
release management and build rules ensure that
 
that way the BLL and DAL can combine
 
also we have VS dependency diagrams that enforce rules too
 
user47589
7:12 PM
in that case you can't have the dbcontext in the controller anyway, so its a moot point.
 
so devs can't actually add a reference to something avoiding layers
 
user47589
"moot" is a strange word.
 
its a set of standards ... to say the least
 
@Amy every word is
 
not having them results in people needing crap like resharper to solve their problems
 
7:13 PM
you ever look at a word so long it becomes foreign
and you're like "Wtf is this word"
 
user47589
lol @wardy
 
@Failsafe i did that with choose the other day
couldn't figure out why it had soo many oo's
I was like .. that aint right
 
lol
 
user47589
you have a rather dim view of resharper. why is that? its code generation and navigation tools are fantastic
 
@Amy you know im right!!!
 
user47589
7:14 PM
no, i don't.
 
@Amy they are also designed to solve a problem that shouldn't exist
 
user47589
code generation tools exist to solve a problem that doesn't exist?
 
the fact that the problem exists suggests people have taken the "one off attitude" in every block of code
 
user47589
that's rather pessimistic.
 
@Amy resharper is mostly a set of tools for handling refactoring
 
user47589
7:16 PM
Is that how you think I code all the time?
 
no
 
yes no
 
I make no assumptions about your code
 
user47589
Good, I was starting to get a little offended.
 
lol
 
user47589
7:16 PM
haha
 
classic example
one of our team was asked to write a tool to import xml files
he was like ... ah I can write all this code to pull the various bits out of the xml using XDocument
so then he ended up with about 500 lines of code
 
user47589
the same argument has been made about design patterns. they solve a problem that only exists because of deficiencies in the language.
 
and I was like ... what happens if some of the xml spec changes ?
he was like ah its ok ... we just refactor the app
I was like ... ah ok ... resharper here we go
once a week
 
user47589
sigh
 
this xml happened to be files given to us that had to meet one of a growing number of xsd schema definitions
he knew about 1 of them
treated the app like it was a one off and then when i mentioned the others he was like ... ah ok ... im gonna need a few months to do the same for the others
I solved the problem of those months of work in about an hour with him ... we now have an app that can import any xml from any client from now until the platform dies
 
user47589
7:20 PM
that's great
 
user47589
you're right, developers with poor understandings of the problem domain use resharper.
 
@Wardy how easy is it to understand where a particular item of data or behaviour is coming from?
 
@TomW im not sure i understand the question
@TomW our stack is a series of OData contexts at the API level so the data has to be relevant and reasonably well defined so that the endpoint in question can map it to data it can use
 
@Amy I know you're being sarcastic, but just for the record, firmly against that idea. My experience is, we adopt a convention that made sense at the time based on what we knew. It was a good decision. We learned something new, and decided the convention should change. Having powerful refactoring tools makes the change easier
 
user47589
I agree with you, @TomW
 
7:23 PM
there are afew rules and in places we may need to write client specific transforms
but generally speaking it handles all we will need
 
@Wardy the situation you're describing is going from code that is 'dumb' but obvious, to code that is generalised but in my experience that often leads to difficulties understanding why the code behaves in a certain way in certain situations
 
@TomW I agree with that at least
 
@Wardy It seems like you're blaming the tools for a problem that's actually cultural - the fact that tooling mitigates some of the pain doesn't mean the tooling is a bad idea
 
@TomW depends on context and the implementation of the pattern I guess
both ways could be done badly
@ReedCopsey thats a fair comment i suppose ... my biggest issue with resharper is that its so heavy ... my VS installs that have it run orders of magnitude slower than those without and if i think about the times I actually need resharper its usually because something is inherently wrong about the general archiecture of the solution
imo ... resharper is an awesome tool for solving the problem i shouldn't have
 
@Wardy I love resharper - but I set a keyboard shortcut to disable it
and run with it disabled until I want to do something where it's useful
but refactoring isn't only something that should be done to fix something stupid
 
7:26 PM
the fact that the problem can and does come up is in resharpers favour
 
strawberries were jacked up to $7.00 per package instead of the usual $2.50-$3.00 :/
 
and any major refactoring in a C# codebase is often better done with better tooling
 
@ReedCopsey you can't disable it entirely unless you uninstall it
 
user47589
yes, you can disable it entirely
 
@Wardy Yes you can ;)
I have Ctrl+Shift+Alt+R set to toggle it on/off
 
7:27 PM
@Wardy the point I'm making is that having big refactors to do is not a bad problem to have
 
should I ask for resharper in new company? I never used it before
 
user47589
when you don't use a product, its rather silly to tell people who do use it how to use it and what it can do.
 
I actually had a huge debate with their support staff about this about a year ago ... unless they majorly changed it since then its basically impossible
 
@KalaJ if you're doing primarily C# development, it's often worth it
@Wardy It's been possible for about 2 years now'
 
yeah I will be doing mostly c# dev
 
7:28 PM
it disables everything except a few tiny things (that have almost no impact) left to let you re-enable it
 
@Amy as a standard we had to have it at a my last company so I have used it quite extensively
its not like i don;t know it
 
@Wardy I think you're assuming that because you used it to fix a big mess, its role is to fix messes
 
user47589
yeah
 
@ReedCopsey I can't say either way ... i just know that at the time (around a year ago) their support staff told me if I wanted to turn off resharper entirely I would have to uninstall it
@TomW if you remove a problem of solving big messes VS is plenty good enough without all that extra weight
 
7:31 PM
@TomW I don't take my house to work with me in case I need the kitchen sink
 
It doesn't turn it off 100%, but it turns it off to the point where you don't notice it
and you can bind it to a keyboard shortcut to make it easy to toggle on/off
I use it extensively, since using R# sucks if you're doing F# dev
(and even C++)
which I do more than C# nowadays ;)
 
user47589
yeah, its made for C#
 
user47589
and VB
 
@ReedCopsey yeh thats what they claimed ... don't notice it in my case was that my pc was still unusable
 
when it's disabled, I've never had any issue with it (R# 9+, VS 2013 or 2015)
 
7:32 PM
you guys are just lucky i guess that you didn't hit the problems I hit
 
user47589
i only have problems when editing html/cshtml with angular.
 
user47589
have to disable the intellisense then.
 
are you guys still arguing about resharper
i left to get a drink
 
user47589
i don't know.
 
tbh at that company I had loads of issues with my pc ... I think the sys admin was doing wierd shit like AV scanning literally every file access
there are some common stupid bits like that
 
user47589
7:33 PM
i gave up arguing about it a bit ago.
 
heres a cool tidbit
 
I suspect that part of the issue I had was not resharper
 
if you want to use resharper, the use it
boom see how easy that was
 
user47589
i love it, especially the code generation stuff
 
Who's arguing?
I thought this was a polite chat amongst "friends" ?
 
7:35 PM
@Wardy I shot myself in the balls with that one
 
user47589
arguing: "to give reasons for or against something" or "to persuade by giving reasons"
 
@TomW do you still have balls or no?
 
whining to the admins that my dev machine was slow....I'd left assembly binding logging switched on
 
user47589
"arguing" does not imply unfriendly.
 
@TomW haha yeh the sys admin in question said I did that ... I actually found the windows log entry trail that showed him logging in to my pc with a shellscript and setting up the AV scanning in that way
then I got told that because he wa the CTO I should STFU and do as i'm told because hey ... he can't be wrong being the CTO
 
7:37 PM
the problem was compounded by the AV thrashing the shit out of everything the binding logger generated as well
 
user47589
wow tom
 
@Amy one of the things about resharper i dont like is their C# naming styles
 
it was for "security reasons" that my VS temp files, my swap file and god knows what else needed to be scanned in realtime
 
mainly because i have to change them manually
 
user47589
yeah I had to customize those, @Failsafe
 
7:38 PM
@Amy I get that a lot
 
@TomW having that problem highlighted to me though exactly how many files resharper uses when im not using it and its "disabled"
I think I logged about 230 files in a 1 min period at one point that it wanted to mess with
 
mstest shadow copies on every run as well, btw
 
not bad for something that was "disabled"
 
more sets of new binding logs
 
@TomW i stopped bothering to run them locally ... let the build server do it for me
 
user47589
7:40 PM
i wish SO had private chats, or at least room owner chats.
 
@Amy you can create new rooms
 
@Amy i agree
 
user47589
they aren't private.
 
not sure if you can prevent people joining though
does seem like a bizzare thing to leave out though
meta it
 
@Wardy it's been meta'd for ages
 
7:41 PM
If you want to say something privately to someone you don't physically know...reconsider.
 
@Failsafe oh has it ... anything useful come out ?
 
is there PMing?
 
@TomW thats also a very good point
 
@TomW define privately
 
@Failsafe exactly.
 
7:42 PM
is anyone having sound problems lately on windows 10?
last build or two my sound drivers seem to randomly die
 
I've had my win10 laptop freeze while in skype meetings
 
user47589
I uninstalled Windows 10 and went back to 8.1. Network issues and stuff randomly breaking.
 
the only time I ever use sound
 
it was getting really good a few builds back
more recent ones appear to have made a load of stuff loads worse
 
windows decided to turn on windows sounds
all of them
after the last update
that was annoying
 
user47589
7:44 PM
your computer has become sentient and is crying out for you to kill it
 
@Amy that would not suprise me
 
user47589
there's some scifi short story about a guy who's brain was scanned into a computer, and the "AI" of him went insane and demanded to die. i can't remember the name of it.
 
@Amy theres the movie transcendence where instead the AI tries to take over the world
 
user47589
yeah, not one of johnny depp's best movies.
 
mainly because he was emotionless
the whole time
i want to see that movie black mass
didnt get a chance to
 
7:47 PM
Was that the one about Alastair Crowley?
 
not at all
it was about whitey bulger
 
oh fuck yeah, duh
I knew that
 
user47589
there was also that story about a guy who scanned his brain into a vacuum cleaner. the story dealt with him trying to get legal recognition that he was a sentient vacuum.
 
@Amy what a time to be alive
 
user47589
yeah
 
7:50 PM
that guy should be the poster child for universal income
these are the kinds of things that are possible in this world
 
If that guy didn't have to do anything useful for a living, imagine what other wonders we'd witness, you mean?
 
 
@TomW yes
Should someone tell that panini guy that he created a little meme here?
 
fuck yes
'the panini guy' I think you mean His Reverence
 
Argh, Ive been trying to think of a way to make this if statement
less disgusting for 30 minutes. Anyone see anything immediately obvious?

if (RowValues.Indexer == RowContainer.IndexerType.String &&
    DataGridClass.SelectRecord(DataGrid, (Dictionary<string,string>)CellValues, false, MouseClickType.Left, ValueComparator)
    ||
    RowValues.Indexer == RowContainer.IndexerType.Int &&
    DataGridClass.SelectRecord(DataGrid, (Dictionary<int, string>)CellValues, false, MouseClickType.Left, ValueComparator)
 
8:03 PM
@Sidney i would put the conditions in to bools before it
 
take it by the bools
 
bool condition = (bla != foo)
if(condition) { ... }
makes the actual if easy to read
and if you name your bools well all should be cool
 
Testing of the Bools
 
@Wardy bool left_bool, right_bool;
 
i do stuff like this in my "big ifs"
if(isImportant && canContinue && userIsntRetarded) { DoStuff(); }
 
8:06 PM
@scheien - Did you refresh the page after install? Can I see a screenshot of an answer? Are there errors in the console? Are you blocking the google api (it loads jquery from there)?
 
where those 3 bools would have been computed in the lines above
 
userIsntRetarded = false;
 
The running of the bools
 
@TomW isUserRetarded = true;
don't double negatives, start with is/has/are
 
^ truth
 
8:10 PM
@Sidney - Why are you casting twice
 
@TravisJ The SelectRecord function is overloaded to take an int based key or a dictionary based key. Based on the calling context, I need to be able to support either.
 
@Jeremy i tend to try and write code that reads like sentence ... as long as it makes in my head it's usually working code at the end of the day lol
 
@Sidney - It makes no sense to do that call twice with two different casts of the same data. You need to figure out a way to detect which version it is or which version makes sense up front.
 
> C# is a powerful laser rifle strapped to a donkey, when taken off the donkey the laser doesn't seem to work as well.
rofl
 
user47589
8:17 PM
lol
 
what is the donkey in the metaphor
 
Windows
....I assume
 
@TravisJ I would tend to agree, but unfortunately the author of the CellValues class and the Author of the DataGridClass seem to unanimously agree "No area of the application will or should need both, since the area of the application you're testing does, it's clearly wrong"
...Which I might also agree with.
 
I suppose c# doesn't run anywhere that doesn't support the runtime. Then again, you could basically make that argument of all compiled languages.
@Sidney - So your test is incorrect? I feel like I would need to ask you 20 questions to determine what you were doing (which you already know what you are doing) and so all I can say is "good luck" :D
 
=( I understand whole heartedly. Sadly, it's not my test that is implied to be incorrect, but the area of the application that I'm testing. It was Kludged together in 2008 to serve a "temporary need". Now it's still in use in 2016.
But either way, I found a way to make it a bit more readable.
 
8:27 PM
@TravisJ the old .Net runtime
since roslyn ... that donkey could be replaced
 
user47589
not poor betsy!
 
lol
"netty"
 
user47589
(i named the donkey, which means we have to keep it)
 
rofl
 
Why is Amy basically my favorite person already
 
8:33 PM
^ the Pony did it for me day one
 
donald trump for prez!
who else is voting for trump?
 
1 message moved to Trash
 
Wew
 
@CharlieBrown Thanks for all the help with the ViewModels again, I think ive finally come around to actually understanding its value in this situation
 
Anyone else terrified that we'll have to choose between Trump or Sanders?
 
8:35 PM
what do you mean
that's whats gonna happen
 
@Jeremy OK, I don't feel that was unwarranted
 
im voting for amy schumer
 
@Sidney eh, they cant screw the country up thattt bad
 
@TomW Nothing personal, but the implication there was pretty harsh
 
Wow detail on this question.. stackoverflow.com/questions/35369907/…
 
8:37 PM
@Juanvan watch a mod come through
 
Today is my SO birthday \o/
 
"Duplicate question"
 
@CharlieBrown I do have an issue with doing the projection like:

 mattersForDisplay = (from m in context.Matters
                                        select new MatterViewModel
                                        {
                                            MatterNumber = m.MatterNumber,
                                            OpenDate = m.OpenDate,
                                            PlaintiffsDisplay = m.PlaintiffsDisplay,
                                        }).ToList();
 
closed
 
user47589
when mods come through, how do they walk?
 
8:38 PM
with their legs
 
@CharlieBrown I get: The specified type member 'PlaintiffsDisplay' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.
 
user47589
makes sense.
 
15 comments, no one wants to try to answer it though.
 
@Michael what is the type of PlaintiffsDisplay?
Is it a readonly notmapped?
 
Its a string
and I have it [NotMapped]
and yes it is read only
 
8:40 PM
it has to be a mapped property (member)
but, there is a workaround
 
@Failsafe Right - he is using Localhost at the site name - that should not work in IIS
 
although I havent tested it
 
ooohh risky
lol. ill try it
 
"Although I havent tested it" - My personal motto
 
nope, nm. wont work
 
8:41 PM
lol
 
it would have to be mapped later, although if its generated, you could just have the same code inside the view model
 
So whats the next best alternative to projecting like this?
 
Do a tolist() first, then project
this code is giving you the whole damn sql table... you might need some where() clauses on that bad boy
 
@Amy - Do you think its possible to fool the typeof keyword in JavaScript?
 
user47589
hmmmmmm
 
user47589
8:42 PM
what do you mean, "fool" it?
 
It's possible to fool pretty much everything in JavaScript
 
user47589
maybe using SweetJS, you might be able to define a macro that changes the behavior of typeof
 
I mean I want to have an object return "number" when I use typeof on it.
 
user47589
no idea
 
Yeah me either =/
 
user47589
8:45 PM
if it was ever possible, an older version of EMCAScript is where we'd find it
 
user47589
imo
 
user47589
well, typeof new Number(10);
 
user47589
but that's not really fooling anything.
 
that is an object
 
@CharlieBrown okay the toList() works, your saying do where()s basically to limit the select to only the display properties im using?
 
8:47 PM
!!> typeof new Number(10);
 
@TravisJ "object"
 
lol this will look like one ugly chunk of code
 
no, just to limit the number of rows... unless you do acvtually want every row in the table
 
how do you limit rows?
 
test
 
8:48 PM
test2
 
user47589
TEST SUCCEEDED
 
@Adan - This is not a place to troll.
 
do you want all the "matters" in the database, or only some of them?
 
what can i chat about in this chat room?
link to rules?
 
8:49 PM
ah thanks
 
@TravisJ
why do you want to do such a thing (number / object)
typeof
 
@CharlieBrown uhhh all of them I guess.. just because thats how this is set up. I know its probably not great practice.
but how would you limit rows?
 
@AndySw - Because I am using a highstock graph, and it only takes typeof val === "number" values. However, it is not properly calculating aggregate ratios and I need to send an object for val to approximate grouped values.
 
Mind blown.
 
@Michael .Take(20).ToList()
 
8:52 PM
Take()! nice, now i learned what that method is for
 
user47589
@Michael or get all the matters in the last n months
 
its not about good or bad practice, just requirements
 
how would you get it by months?
 
I'm assuming whatever UI you are using puts this data somewhere on screen
 
user47589
don't the matters have a date?
 
8:52 PM
@CharlieBrown yeah a DGV
@Amy yes
 
it really doesnt matter... j/k. i couldnt help it
 
So basically there is a date, and a value. There is a column graph of these. Each day in a month has a value. Each value is roughly 0.25. So by day, it works. However, if it does a weekly total, instead of 0.25 being the value, it is 1.25 because it simply sums the ratios. Summing a set of ratios is however incorrect to get a final ratio.
 
:)
 
user47589
then do .Where(matter=> matter.WhateverTheDateIs > oldestWantedDate)
 
aww yeah
 
8:54 PM
anyone got links to learn about C# .where, .find, .equals ? i usually do my code the long way and would like to learn about extensions
.where(s <= s.X), where can i learn about these?
 
nvm we pretty much linked the same thing
 
ah thanks
 
edulinq is also an awesome resource for learning about linq
It was written by Jon Skeet (can see his name in the link) and it is very in depth.
 
thanks
 
8:56 PM
dotnetperls have some tutorials too.
 

« first day (1945 days earlier)      last day (3020 days later) »