« first day (1592 days earlier)      last day (3361 days later) » 

4:00 PM
@CharlieBrown Yeah, I figured
 
From your applications point of view, how do you know which entity to delete, without first loading it up? Your users certainly dont delete things by knowing the db key
 
I googled a bit, people have made extensions for batch operations using EF
@CharlieBrown My example was a little under developed
 
Task.WhenAll( usResponseTask, emeaResponseTask ).ContinueWith( responses =>
         {

         });
 
Sometimes you would want to batch delete records that have specific properties
 
A lot of times, people create things to solve a problem that exists becuase their design is flawed
 
4:01 PM
Using tasks for db work is tricky.
 
how do i know if responses.Result[0] is from the us response or the emea response
 
First off, the db context is not thread safe.
 
@TravisJ I don't think Steve's with us.
 
@Sippy not that I think that is the case, batch deleting records is a normal use case sometimes
 
:D
 
4:01 PM
both are of the same type
 
@CharlieBrown Ohhh! I'm not trying to do it
I'm just asking the question cos I didn't know the answer :)
 
Also, for deleting or processing a lot of records, just simply place them all in the queue and do them at once instead of calling savechanges individually for them
 
But it makes perfect sense to me now why you wouldn't have batch operations in an ORM
 
@Sippy - When you say "batch operations" I have a feeling it means something different than what my definition is. What are you thinking EF would do with a batch operation?
 
I would tend to agree there are times when batch operations are appropriate though, so it's useful that those extensions exist
 
4:03 PM
The reality is, esp for web apps, you really dont need to load an entity just to delete the darn thing
 
Aye
 
@CharlieBrown - I load it to delete it.
 
@TravisJ i think your missing half of the conversation... my sister does that a lot
 
@CharlieBrown - I think I am missing too much of it.
 
@TravisJ Doing batch update/delete on a database.
Without loading all the elements first.
Just using a single SQL statement
 
4:04 PM
@TravisJ agreed, my default framework does just that
 
So not using EF?
 
I wondered why EF didn't do it.
 
@CharlieBrown - I have to because tenants.
@Sippy - You can do it all in a single sql command, but it would be rather large depending on the set of pks
 
@TravisJ Yeah I know.
 
I could see a web api call like items/delete/by/category/12 and i wouldnt load 500 items just to loop and delete, i would call a store query instead
 
4:05 PM
18 mins ago, by Sippy
Guys, would using a lambda like db.Engineers.Remove(x => x.id == someId); be more performant than creating a list using db.Engineers.Where(x => x.id == someId); and looping through it removing each element from a SQL point of view?
18 mins ago, by Sippy
Or would it still generate a SQL statement per element?
that was the original question @TravisJ
But obviously an ORM isn't supposed to do that by design, which I now know :D
 
@CharlieBrown A stored procedure over a DELETE WHERE?
 
@Roel pls stop shouting
xD
 
and one more person joining the convo halfway through
 
Yes! Best way to make half assed comments for no particular reason.
 
4:07 PM
So if I were to do a batch delete, stored command would be the best way to do that currently?
 
@RoelvanUden i didnt say sproc, i said store query
 
@Sippy - EF only executes SQL on enumeration or SaveChanges.
@Sippy - So if you loop through it would only execute SQL once unless you called SaveChanges at each iteration.
 
@TravisJ If you looped through and then did SaveChanges() it'd still generate a statement for every element.
 
@Sippy - No it wouldn't.
 
It kinda has to.
 
4:09 PM
@Sippy - It would generate one huge block.
 
Even if it's all in one transaction, no?
yeah
 
It would all be in the same transaction
 
If you're batch deleting 2 million records surely it still makes a difference which way you do it
 
Although, I am a proponent of manually controlling the transactions at times.
@Sippy - Eww, 2 million records, you couldn't do it at once. The SQL query would be too large.
 
It will, but at the point, an application design is flawed
 
4:11 PM
Sure it is
I'm just spitballin'
 
You would have to break it into 4000 500 record blocks.
And then run them like 12 blocks at a time async
 
Why would you not just use a single SQL statement to batch delete?
 
It would probably take 15 seconds per block, and at roughly 25000 per minute that would be 40 minutes
@Sippy - I guess it depends on how you are determining what gets deleted. If you only had pks it would be massive.
 
If you ever want to start hating phones; start developing for them.
 
Yeah, but what UI lets the user select that many records for deletion?
At that point, something needs a redesign
 
4:14 PM
@CharlieBrown None, I'm thinking along the lines of "Click here to remove all records marked for deletion"
So let's say there's 200,000 records marked for deletion you'd only have DELETE FROM Table WHERE markedForDeletion = true
 
Right, but no one is using a UI to mark 2mil records for deletion. Many ways around that, flags in the db set on each click, categories, etc
 
Obviously you're never going to have that many records to remove.
Cos someone will use their brain before you get that far.
 
Hey, when my wife says "there were a million firefighters next door".. i believe her ;)
 
@CharlieBrown The flag thing is what I was getting at xD
Pahahaha
 
@CharlieBrown you mean you have to believe her
 
4:17 PM
Amazing. Our current ad-hoc sprint has been codenamed to 'avoid confusion' with the sprint planning charts the managers are producing, and the codenames are on the theme of Blackadder. We're currently on Sprint Baldrick
 
which, obviously will be shortened by the team in conversations. "What are you working on?" "Bdick"
 
@TomW Something tells me the reason why your sprint names are Blackadder themed has nothing to do with why your sprint names are actually Blackadder themed.
 
My feature is Sausage.
 
Hahaha
 
@TomW - Why are you guys always picking on poor Rick, it isn't his fault all of his hair is gone.
@CharlieBrown - Have you ever played cards against humanity?
 
4:19 PM
You are all ignoramuses. Watch Blackadder.
 
no, i have not
 
Fine.
 
Cards against Humanity is one of the best things I've ever seen.
And ironically, simultaneously one of the worst/most awful things I've seen.
 
The first one is basically a medieval version of Mr Bean, it's not great. The later ones are much better
 
@Sippy Well.. then you haven't seen Crabs Adjust Humidity.
 
4:20 PM
The times I have played have been with all the expansions included as well as custom cards.
 
@LynnCrumbling wat
I feel like that's something I need to see.
 
I actually purchased Crabs adjust humidity for a friend for xmas, but didnt play it
 
@Sippy Expansion pack.
 
That game made me realize I need new friends
 
@LynnCrumbling Oh my god.
 
4:21 PM
I threw down the "You must construct additional pylons" card and it didn't get picked. :(
 
Yep I need that in my life.
 
Nobody knew what it was.
 
@CharlieBrown I still think some of the original cards are funnier.. but it's not bad.
@Sippy The cards are printed in the same font and everything. They shuffle right in, and it's hard to tell which are which.
 
k bought it
 
HAHAHAHA
Star.
 
4:23 PM
:D
 
My question is... How in gods name and I going to convince my team to stop using nested classes because WPF hates them.
Oh.. and spaces in assembly names when referencing a namespace.
argghhhhhhh
 
@LynnCrumbling refactor them whenever you see them
 
Lol
 
@TomW I see that as the only possible option at this point.
 
Create yourself a new user account by nefarious means called "RFactorman"
 
4:25 PM
If anyone complains, the reason is that they don't work properly with WPF. If they want the framework to not work properly, then they can change it back. No rational person would be enough of a jerk to do that
 
By night log onto this account and refactor all their shitty code
 
UGGHHHHHH why would somebody do this
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
 
nested classes should have no problem in wpf
 
The user profile image for this user should be something wearing a cape.
 
lmao
 
4:28 PM
4
Q: How to use nested class in WPF XAML?

Gennady Vanin Геннадий ВанинI am refactoring the code from sample: 24.129.21. Master Detail Binding from C# / CSharp Tutorial » Windows Presentation Foundation » Binding) And after excluding Skills class, with corresponding changes in in MainWindow.xaml <local:Team> <local:Employee Name="Larry" Age="21"> <lo...

@CharlieBrown If you can come up with a way to databind a nested class.. let me know.
 
It works, that information is old
 
@CharlieBrown link?
 
Also, if your binding things like that, your doing yourself a disservice. thats a terrible way to write wpf
Using proper viewmodels will alleviate the problem
 
@CharlieBrown This isn't my question... I just found myself trying to bind against a DataContext where the data that I needed access to was nested.
 
@Sippy
Caped hero, deleting wat by night
 
4:33 PM
Lol
 
@CharlieBrown In the ended, I bound the selecteditem, so that I can remember it...
 
@LynnCrumbling I see what your saying, but I think its best to just fix the code then apply a bandaid
 
I just thought the account should be called IWatman and realised that's very close to Ian Watkins ..
Or just WAtman that would work
@LynnCrumbling are you taking notes here?
We're coming up with your superhero developer alias.
 
@CharlieBrown I'd be interested in more details on how you'd fix (refactor).. if you have time.
 
1) stop nesting classes 2) use viewmodels/mvvm
 
4:35 PM
@Sippy nice.
@CharlieBrown Yeah.. I plan to refactor those classes into something flat. Now that I'm committed, I can play a bit. I'm already using mvvm; my model is the data structure storage class. The viewmodel currently has the model exposed as a property, and that's what I bind most UI elements against: property.setting
 
Ok, so how come your having issues with the <Local> declaration? Its the only thing that doesnt support nested classes
 
@CharlieBrown It seemed dangerous to duplicate nearly all of my model as the viewmodel, which was the alternative to just exposing it via a property.
 
If your binding a viewmodel, any bindings can use dot syntax. <textblock binding={house.door.color}/> is perfectly valid
Its just <local> that is funny
 
@CharlieBrown I thought I was running into it was x:Type. Now I'm not sure.
 
<x:Person+Address/>
"I don't always write code, but when I do I don't RTM or follow industry practices"
 
4:52 PM
Facepalm
 
"String or binary data will be truncated"
Aside from writing test code and prodding each field individually, is there a way to get the actual field that's failing from the DbUpdateException?
 
I'm in this 'I told you so' situation with my client, its hard not to say it when they are struggling to implement what I told them would be a nightmare
 
@ton.yeung step through an EF SaveChanges()?
 
Yes, the DbUpdateException has the detail of the messed up fields
 
I'm trying to save a large tree of data. Couldn't find the details in the caught exception.
perhaps I'm just being dumb
(wouldn't be the first time)
 
4:56 PM
@ton.yeung its killing me, 4 days straight trying to get this 'it should only take 5 mins' thing to work
 
@ton.yeung more like i said 'impossible' and they said '3'
So they assigned it to someone else, with 1 month of angular experience
Just like 'Why dont we use AngularUI?' "No, we should write our own angular datagrid"
 
@ton.yeung - Deadpool - He's an awesome character
 
@SpencerRuport etsy has great stuff like that, I have a couple in my office
 
@ton.yeung - He's knows he's a comic book character and sometimes he breaks the 4th wall and talks to the reader.
 
4:59 PM
Deadpool is fantastic
breaks the 4th wall all the time
 
@ton.yeung - I think Spiderman started looking more like Deadpool.
 
In a MVC 5 project, to prevent xss vulnerabilities, is using Html.Encode good enough ?
 
@Tommassiov thats not for XSS
 
@ton.yeung - Yeah the original spidey suit keeps getting redesigned and it looks more and more like the symbiot suit (black) with a different color scheme (red) which is very similar to Deadpool's (red & black).
 
@CharlieBrown In that case, what do I need to use to prevent xss vulnerabilities being posted to my MVC controller actions
 
5:01 PM
wah. It works. 6pm on the dot.
 
In MVC using the cross site request token prevents XSS @Html.CrossSiteForgeryToken() and [ValidateCrossSite]public MagicController
I forget the actual attribute name, its something like that
@Tommassiov Cross Site in MVC
 
I do have [ValidateAntiForgeryToken]
 
@ton.yeung - Deadpool does what he wants. And he's not always strictly a good guy or a bad guy.
 
RTM, its only a couple pages
 
in git I added web.config as "assume not changed" and right now I cannot commit because it does not take it as changed
is there anyway to set it back?
 
5:04 PM
@ton.yeung - I keep debating whether I should order this: indiegogo.com/projects/…
 
it is not in .gitignore by the way
 
@ton.yeung - This one you're supposed to leave on
 
cheers @CharlieBrown
 
@ton.yeung - They're claiming it feels like a band aid
But these things always make a lot of claims during fundraising so who knows.
true
 
@SpencerRuport - Why do you want to monitor your heart rate 24/7
 
5:19 PM
@ton.yeung oh the plot thickens. one of the clients' clients submitted a bug "not working in IE8". We just converted entire sections of the site to AngularJs.... lol
 
Bit hypochondriac isn't it @ton.yeung?
 
@TravisJ - I don't. I really just want an accurate heartrate monitor. Everything I've read seems to indicate that for running chest monitors are the most accurate. But straps seem uncomfortable to me. Much more than a sticker.
 
@ton.yeung If it's useful information for a condition then yeah
If you have nothing wrong with you and decide you want to know that you have a stable heartrate 24/7 then .. slightly overkill.
 
Not to mention, ever try to get CORS working in IE8 and IE9.... LOL.
Me: "CORS is a security measure by design this wont work"
Them: "That can't be, I'm sure we can hack the browser somehow"
Me: "...."
 
@ton.yeung - I wouldn't because I don't see any benefit to it.
 
5:22 PM
@CharlieBrown - I always hate that. "Why the hell did you hire me if you're going to disagree with me?"
 
@CharlieBrown That fills me with hope lol
 
funny title you got
 
Yeah, i was hired to be the 'AngularJS expert' since their team had never done anything but webforms before.
 
At the moment it's "You're a graduate, just do what the client wants and don't argue." "BUT HE'LL DESTROY HIS DATA INTEGRITY!" "Shut up."
 
but it's not like people are hopping on syntatic sugar
 
5:23 PM
When I'm competent it'll be "I appreciate that you're an expert in this field but I'm sure you're wrong."
 
it's rather the reverse, old school are hopped on writing boiler plate and reinventing the wheel from time to time
 
@Andrew - Speak for yourself. I'm amped right now.
 
@Sippy dont worry, after 12 years your managers will still say the same thing
 
@CharlieBrown Yaaay :D
I'm gonna go be a hobo instead.
 
@ton.yeung Application uses an ActiveX control to verify MAC address of machines for security
another gem
 
5:24 PM
@CharlieBrown - I dunno. Managers are constantly being replaced with more technically savvy people.
 
@Andrew - Reinventing the wheel is for php and python.
 
did i mention said activex control only works in ie8-ie10?
 
I feel like things are improving.
 
@Andrew - C# is write once, use everywhere.
 
@SpencerRuport agreed, which is why engineer led companies like tesla do so well
 
5:24 PM
I've had a productive day today learning shit and rep whoring. :D
 
Yeah. Eventually we'll rule the world.
 
.NET on windows, rasbpi, arduino, mono(linux), xamarin to native
 
Travis J: this sounds just weird, I when I write something I just need to run it on the server it is supposed to run
I have no interest in desktop apps
 
@CharlieBrown - I've started putting up with that kind of thing less. I'm financially stable enough to tell people "No I'm not going to do that. Feel free to replace me with someone who will."
 
.net on ARM even
 
5:26 PM
and run anywhere applies more to HTMl5 today, that the interface runs on client side and business logic on the server
that's the most popular way of doing apps since 1995
 
except its reversed now, business logic on the client side
 
@Andrew - When I write something I want to leverage code which has been through rigor, not some one off implementation.
 
well, if the business logic is meant to communicate with exteranal services, it is not on GUI part
 
@Andrew - Who mentioned desktop apps?
 
I'm just stoked about portable libraries. I'm writing all my utilities using those now.
 
5:28 PM
Nice.
 
So if I do need to port something to a desktop/linux/whatever there's no issues.
 
I am eager to start writing c# against the raspberry pi :)
 
Saaaame here.
Python is cool and all but the version issues really turned me off to it.
 
posted on February 24, 2015 by Visual Studio Blog

One of the top requests from developers (reiterated at //BUILD last year) has been tools for inspecting the XAML at runtime. With Visual Studio 2015 CTP6 we’re pleased to introduce the new UI debugging tools for XAML. These tools enable you to inspect the visual tree of your running WPF application as well as the properties on any element in the tree, turning the difficult challenge of pi

 
Yeah hate that about python
I've found that installing a new version of python breaks most python tools
Ugh
 
5:32 PM
@SpencerRuport - I can't stand it. Anything worth doing seems to require a custom implementation every time since their libraries are lacking in my opinion.
 
@TravisJ - Yeah welcome to linux.
 
@CharlieBrown I've added @Html.AntiForgeryToken(); on my forms etc. Just a quick question, if I try to post this on a form
<SCRIPT>alert("XSS")</SCRIPT>
I get
Server Error in '/' Application.

A potentially dangerous Request.Form value was detected from the client (Email="<SCRIPT>alert("XSS")...").
 
And that is surprising because?
 
It isn't
My question is should I just let the .NET handle this error like this ?
 
@Tommassiov - It's definitely safer.
Just depends on what your needs are.
 
5:35 PM
I have no reason to disable it
 
@Tommassiov - I would recommend writing some JS that will check it so you can give the user a nicer error message.
 
That way you get a cleaner user experience without sacrificing security.
 
@Tommassiov - Never, ever, ever, use user input in any form but text.
Text will never hurt you
 
152
A: Question quality is dropping on Stack Overflow

Denis de BernardyIn my view, SO made the jump and became the zero-cost version of Mechanical Turk aeons ago. I stopped visiting the site twice in disgust, and more than a day passes of late where I wonder why I'm still around, so I suppose you can say my reaction is retreating from the stench. Fwiw, I made a mod...

This doesn't seem alarming to me.
 
5:38 PM
hi guys
 
This is what happens when you encourage people to downvote dupes.
@Steve - o/
 
people spend too much time worrying about bad questions and good questions, who cares, really, the bad ones get closed. Are the quality of answers remaining consistent? thats what matters
 
@Steve Assume the best half of questions are "good". Then as average question quality decreases, so does the quality of good questions.
 
Should my ApiController worry about getting the first and last day of the week from a DateTime object, or should I pass that to my repo and let the repo do all that work?
 
@KendallFrey not if they get closed, then the answers don't matter
 
5:41 PM
The terrible content makes the bad content look good
 
i just think it's dumb, and to trying to fix it, even dumber
the system works
nothing to fix. bad questions get closed
 
I'd argue that because dupes aren't allowed there simply aren't as many good questions to ask.
And there are more questions because there are more visitors.
 
@SpencerRuport Questions aren't good per se, it's the way they're asked
 
In my MVC project I can navigate through bookings with the URL like

Booking/View?bookingId=111876
But, if I manually change the bookingId to like Booking/View?bookingId=111876xx, the server throws this error
The parameters dictionary contains a null entry for parameter 'bookingId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult View(Int32)' in 'AccountPage.Controllers.BookingController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
 
@KendallFrey and thats kind of a leap, saying that if the average quality of questions decreases, then the average quality of answers decrease. People who write poor questions don't know SO well enough (or whatever language theyre using) to write answers, generally
 
5:45 PM
Should I be handling such errors, or return the 500 Internal Server Error ?
 
@Steve That's kind of a leap, assuming that when I say questions I mean answers
 
huhhhh
 
lrn2read
 
you said as question quality decreases, so does the quality of answers, no? . "Then as average question quality decreases, so does the quality of good questions"
are you drinking this early
 
where does that say anything about answers lol
@Steve I'm not drinking, you're high as all fuck
 
5:49 PM
i read that shit like 20 times
and i read answer each time
i must be drunk as fuck
lmao
shut up
 
morning guys
 
gmorning pa
 
@KendallFrey - I would openly refute the premise that question quality impacts answer quality.
 
Stop talking about answers, lol
 
@KendallFrey - There are extremes on both sides, but the middle ground does not make any difference. Sure, on a scale of 1-10 the 1 will probably not elicit any spectacular answers. But there is no different between somewhere like 4 through 8.
 
5:54 PM
Steve's just high
 
i need a code review from somebody who's really familiar with async crap..... where or where can i find one of those people
 
@KendallFrey - k
 
@KendallFrey NO IM NOT I GAVE UP DRUGS OK
 
meta is murder
 
@Steve Reed
 
5:55 PM
@Steve - I am medium familiar
Obviously not on Reed's level
 
I as well
 
i meant internally, i can't show you guys our code base
 
well then gtfo
 
lol
 
5:55 PM
I'll show myself your codebase then
 
you'd cry
not really
 
hackety hack hack
 
our stuffs actually not too bad
there aren't 20 layers of inheritance, which was outsourced to shitty programmers in India in every solution like my last gig
except by 1 guy, i always have to re-do everything this one guy does
which is what i'm doing now
 

« first day (1592 days earlier)      last day (3361 days later) »