« first day (818 days earlier)      last day (4137 days later) » 

6:00 PM
@userXemY the strategy we told you is valid for 3.5+ if you're targeting below that version then you have to resort of appsettings i think (the way you were doing it)
 
@ShotgunNinja A saleswoman at Sitefinity.
Who was assigned as our "point of contact" for this product.
 
@Ellie Buhhhhhhhhhhhhhh gross. What was the problem?
 
I hate off the shelf CMSes
even sharepoint
 
@ShotgunNinja brb. Lunch time. Be back in an hour. :)
 
@Ellie Same.
 
6:04 PM
In knockout, how to I call back to a function in the parent viewmodel?
 
if my method receives a parameter with the wrong number of elements, should i throw an ArgumentException, or an ArgumentOutOfRangeException?
 
Also, screw the close nazi's on SO.
@SteveKonves that sounds like an argumentoutofrange to me.
@TomW Welcome to chat
 
@Maverik im using .Net 4
 
tx
@SteveKonves IMHO, ArgumentException. It's not the parameter that's out of range, but its contents
ArgumentOutOfRangeException implies to me that the parameter in question is a value type
 
I agree on argumentexception but no biggie
 
6:13 PM
You could derive a custom one if you wanted to
 
Or just a ArgumentException with a message?
 
CollectionContentsArgumentException or similar
 
@TomW sounds like you and @Billdr need to fight it out :)
 
so one of our devs emailed out our usage numbers last night. apparently 25% of our users use chrome, and 0.1% use IE7. we officially support IE7, but not chrome. looks like thats changing :D
 
Hi, room. Any AD experts in here?
 
6:17 PM
I'm not invested enough to fight about it. Tom's smarter than me.
 
(Active Directory)
 
@user948060 maybe not expert, but ask away
 
Thanks..I need to display all the users in a few groups in some sort of grid, for an intranet
 
woot.
 
I also need the ability to search
I'm a webforms person, but I'm afraid that performance might be a problem
I'm currently displaying all the users via a repeater, since I need full control over the HTML
It takes about 20 seconds to load all the users
My question: all suggestions on how to increase performance?
any, not all
(assuming this is the right place to ask)
 
6:20 PM
caching?
That user list isn't going to change often.
 
right. cache locally?
 
well, do that too.
 
@user948060 you can cache SQL views, as well
 
^
 
it's a setting
 
6:21 PM
I'm not pulling from a sql db
 
what are you pulling your user list from, then?
 
@Billdr Tom is advanced, I always have to google what he writes
 
@user948060 have a job that queries AD daily, then puts the results in SQL.
Or like... anything that your server will have faster/more secure access to.
 
I'm pulling the list from ActiveDirectory, looping through the UserPrincipal, putting all the users into a list, and binding the list to the repeater
 
a text file in a locked down directory.
 
6:23 PM
doing my first GIT CLONE of our repository. whoo! so excited to use GIT instead of SVN
 
What about searching?
 
@user948060 how responsive do you need the page to be?
 
@Pheonixblade9 have you listened to the latest git hanselminutes podcast?
 
@ChadRuppert nah, I don't really listen to podcasts
 
@Pheonixblade9 it completely turned me off of git. the opposite of what it was meant to do. I want to get used to using it, but it convinced me it was needlessly complicated
 
6:25 PM
@Pheonixblade9 as responsive as possible. This is an intranet for a fairly large corp
 
@ChadRuppert it is complicated, if you abuse the tool :)
 
so can svn be, but its harder to shoot yourself in the foot
 
@user948060 is it acceptable to have a delay between users being added and being on the list? @Billdr 's idea to have a SQL db with the users cached from AD might be the way to go. You just want to make sure everything is automated, or you will hate your life
@ChadRuppert sort of like C vs C++ ? :)
 
sure. :)
 
some things about git do scare me
 
6:27 PM
@Pheonixblade9 SQL DB would def work, but seems like overkill. I don't need a db for anything else...
 
like the fact that if you're stupid you can delete history
@user948060 you don't have an existing SQL DB for anything else in the solution?
 
sql will perform faster than AD probably though @user948060
 
Hmm...
 
nope. it's a very small project, mainly for AD
 
@user948060 would a csv work for ya?
 
6:28 PM
I was going to suggest a CSV, or see if you can cache it in AD
 
It doesn't have to be sql, but I suspect you're hitting lag because you're sucking a huge amount of data from your DC at once.
 
can i easily bind a csv to a repeater? Or would I read the csv into a list first?
 
yeah, idk if streaming is available for AD though
see if you can use streaming, rather than an atomic operation
 
You'd load the csv into a list
 
@Pheonixblade9 the fact that there are different kinds of commits turns me off greatly
 
6:29 PM
Basically the csv would stand in for your DC, ya'know... like a cache.
You're not loading the DC's return straight into the repeater, are you?
 
on app start spin a thread that loads cache of the AD info. then every so often have that thread wake back up and rebuild the collection in cache?
that would be spiffy
 
@Billdr I'm loading the DC return into a List<> first
 
Exactly.
 
thats basically to the repeater
 
I ran some stupid benchmarks comparing CPU & GPU today, the GPU did not beat cpu. Used Microsoft Accelerator
 
6:31 PM
@ChadRuppert just two, really. Local commit and remote commit
 
do what i said, because im smart
 
@ChadRuppert I like that
 
anyone here ever worked with the fluent api for entity framework?
 
no, there's more from what the podcast said. there's a diff commit, a regular commit, and one other i think
 
I wish I had access to a domain controller, that seems like it'd be fun to write.
 
6:32 PM
there is nothing fluent about EF. <grin>
 
@ChadRuppert what about searching?
 
inorite
 
what sort of searching @user948060?
 
@user948060 search from the cached collection? use a dictionary
 
Linq?
 
6:32 PM
Stupid EF can't handle a 1 to 0..1 relationship.
 
yeah, i would use linq against the list
ef is stupid. end of story.
 
EF is the greatest.
 
hey, that NH thing seems really popular. lets implement it, poorly.
 
It's like the exact opposite of telerik.
 
Right, Linq would work
kewl, thanks boys ('n girls)
 
6:33 PM
@TravisJ I don't believe you.
 
de nada, user person.
Why people want to be called users is beyond me. I hate users. Being a user sucked. That's why I learned to program to begin with.
 
hahah
people dont want to bother to do anything but the default
 
heh. I knows. I constantly fight against my desire to remain anonymous
 
Stupid lazy users.
You could change your name to "MyAnonThrowawayHandle"
 
I bet that's taken
 
6:35 PM
@TomW -
public class Car
{
 public int CarId { get; set; }
 public int? ManufacturerId { get; set; }
 public Manufacturer Manufacturer { get; set; }
}

public class Manufacturer
{
 public int ManufacturerId { get; set; }
 public string Name { get; set; }
}
 
Then we could call you anon.
or handle.
I'm exactly one whois away from revealing my identity. I'm so 1337.
 
@TomW - EF does not know how to skip the navigation property when ManufacturerId is null.
 
oh lord travis. why would you do that? why manufacturerId on the manufacturer class? why not just ID?
 
...FUCK, Travis, I think you just pointed out a huge flaw in my design.
....fuck.
 
sorry
Issue in mine too :(
 
6:37 PM
One sec, lemme check my ef seed script.
 
thats like prefixing all sql tables with tbl_ and all columns with col_ :( that makes me so sad.
 
@ChadRuppert - Readability, automapping, foreignkey clarity.
 
@ChadRuppert until recently, we prefixed all sprocs as dbo.spGetFeedStupidDerp
 
GGAAAAAAH
 
pfft. garbage. manufacturer.ManufacturerID is more readable than manufacturer.ID? pfft.
 
6:39 PM
I do have to specify the id for each child of my 3 table object.
 
@Chad - yes.
 
Manufacturer.ManufacturerId indicates to me that it is a nested relationship.
 
in Lounge<C++>, 2 mins ago, by Griwes
I'm trying to validate a fact about the C# 1.0 compiler. Unfortunately all the references I can find are my own Stack Overflow answers :(
3
 
now Car.ManufacturerID makes sense.
 
Skeet World Problems.
3
 
6:39 PM
hah
 
#JonSkeetProblems
 
@Billdr yeah
 
Dammit bill beat me to it :(
 
I'm the most prolific expert on a topic. I can't find someone smarter than me to solve my problems.
 
how would you represent a parent/child nested relationship like that? manufacturer.manufacturermanufacturerid?
 
6:40 PM
@SpencerRuport and he gets the stars, this chat is brutal
 
Soooooooo sad. :(
 
@SpencerRuport but I'm not like that :)
 
lol thanks.
 
What if I don't want to cache to a CSV? This is for an intranet and may not be able to write anything to the user's machine
 
I'm pretty sure people star me out of muscle memory now.
 
6:41 PM
@JohanLarsson /JonSkeetProblems
 
dont cache to a csv. cache to applicationcache. System.web.Caching
 
@ChadRuppert - You are thinking too hard about something which really has no negative affects except increasing readability and functionality.
 
its a trivial issue, i agree. it just one of those tiny things that gets under my skin. its redundancy.
 
I didn't mean to imply the csv should be on the user's machine
 
6:42 PM
i think it adds so little to readability
 
@ChadRuppert yeah, redundancy.
 
Well, lets just agree to disagree.
 
of course. :)
 
:)
 
I was just saying "put the data somewhere other than the DC."
 
6:42 PM
@Billdr then where do cache the CSV?
 
forget about the csv.
there is no csv
 
Forgotten1
!
 
CSVs and Spoons. There is no them.
 
use cache. system.web.caching
 
Chad's idea is much better.
 
6:43 PM
ok
 
well, my day is ruined. Thanks @TravisJ.
Way to point out my code sucks.
Jerk.
 
@Billdr - Well, what version of that do you have going on in your code?
 
use NH @Billdr its nicer
codegen == evil
codefirst for EF still does codegen, does it not?
 
None of that... I was looking at your code and realized I was inserting a chain of three rows without generating an id for any of them.
 
You know how you can tell that genned code is bad? the comments usually start with "This code was generated by a tool." You don't want to be a tool, do you?
 
6:45 PM
BUT! I have an ugly fix for this issue.
 
In some ways I'm ok with codegen, in that you can see what you're getting, if so inclined
 
right, but if you change it, and regen you lose those changes (partial classes aside)
 
although if it's full of API calls that fire off complicated interactions with some framework, I suppose that's no improvement
 
not to mention that most folks don't read that genned code and end up with garbage
 
lol@ChadRuppert
 
6:47 PM
god dammit bbc
 
EF does not gen the code.
Who was shocked?
 
there are five separate stories concerning the duchess of cambridge's first official portrait, all of them referenced in the 'most popular' section
 
i thought that it generated the dbcontext and all that? is it gone?
 
Your SQL Provider Factory generates the SQL.
The ORM simply makes the structure of the data.
 
Bouncing. Be back after I learn2math.
 
6:48 PM
later
I wish that everything was simpler.
 
with ef, or everything everything?
 
Everything everything.
If everything were simpler, then everyone would be working on far more complex versions of what we have now.
But especially with using an orm and a sql provider to get data from a database. And specifically with getting mysql connector to perform at even sub par levels.
5 second query > exception thrown and no data
Can you chain where statements?
 
I'm back
Also, why on earth was SO so slow just now? Did the server get restarted or something?
 
orm's are a crappy hack though. the simpler version is docdb or graphdbs
 
I couldn't even access the main site.
 
6:55 PM
Well I don't have time to custom write an ORM and a sql provider, so I am stuck with what 3rd party created.
 
you can't use something other than EF?
 
Guys, given the fact that he said "I don't have time", I'd assume he's not considering the option of switching at the moment, either.
 
oh, i missed the time thing
i read too quickly and not deep enough
 
@ChadRuppert You'd never make it at NASA.
 
Because?
 
6:57 PM
And yeah, NASA is pretty much the high-point on my scale of "impossible job requirements".
Because they get handed operation manuals for entire spacecraft and are given timespans on the order of days or hours to memorize them.
 
@ShotgunNinja astronauts, yeah? Not everybody at NASA is an astronaut
 
and you assumed that because i suggested a better tool?
nice thing to assume there, buddy
 
@ChadRuppert No. I said something because of the "read too quickly and not deeply enough" comment.
 
can i come in here and ask a quick stupid question or will i be banished and put into a holding cell for not putting it on SO?
 
Nice thing to assume there, buddy.
 
6:59 PM
so chatty is not part of my career. if it were work, i wouldn't have skimmed it.
both tj. either way you are doomed. What's your question?
 
@tjdecke That's what we're here for, as much as we may not act like it at times.
 
mostly we look like arrogant dicks taking cheap shots at eachother. or sex starved nerds. but its all an act. Except for the latter.
 
@ShotgunNinja pff, speak for yourself. I'm here to argue with Kendall and insult Johann Larsson's Mom
 
@tjdecke - fire away :)
 
hehe
 
7:01 PM
@TomW lol
 
i'd like to customize my javascript syntax highlighting in VS2012 by making the background of my current "scope" gray
 
Did you write a plugin for that?
 
i finally just loaded vs2012. i'm out for that one.
 
so i've looked into Vs2012 SDK and dabbled with custom taggers and classifiers - all fine so far - but is there any chance i can hook into the JavaScript language service?
 
Aaaaand I'm back.
 
7:02 PM
@Ellie - Welcome back ;)
 
@TravisJ I ate them all Thanks
 
@TomW Also, to think that only the astronauts need to read the operations manuals is foolish... Every engineer and scientist who has something on that ship needs to know how it affects the astronauts.
Welcome back @Ellie
 
@ShotgunNinja I wasn't being entirely serious. I wouldn't necessarily assume the same about the whole organisation though
Derp is contagious
 
@TomW Understood, and agreed.
 
@TravisJ I thought you liked EF, what changed?
 
7:03 PM
A big dumb organisation is vulnerable; derps hire other derps
 
@TomW But it's NASA...
 
@TravisJ yes i'd like to, I'd just like to avoid having to write my own lexical analyzer
 
@Johan - It is giving me severe issues with navigation properties in 1 to 0..1 relationships.
 
Very clever people often lack the capacity to communicate with other very clever people, or get things done
 
what is the formal definition of a derp? I tried googling but am still not sure
2
 
@TomW Well, that's precisely why they enforce a specific technical writing style. It turns an inherently soft-skills based communication issue into a technical formatting issue, and makes it infinitely more palatable for logical-analytical types.
 
@tjdecke - Well that seems rather complex, I thought you had a stupid question :P
I am not sure how to implement a Language Service for vs2012, and cannot find any good msdn articles for it, sorry :(
 
@Ellie ty, ty I guess I have to watch the episode to fully understand :)
 
Well it's stupid in that i get the feeling i'm just not using the right google search term for it ;-)
 
@JohanLarsson Full episode?
 
7:06 PM
@JohanLarsson It's an article, derp
 
@Ellie South park? hmm I'm still confused, starting to get drunk to :)
 
@JohanLarsson Ah, if it's a new episode, I haven't seen it.
 
I'll summarize it for you: The term "derp" is an onomatopoeia for the sound that a linguistically-deficient person would make, which is often associated with mental retardation.
3
 
Is there a way to implement a "short circuit" in linq-sql? I tried using an || where the first condition was true but it still runs the second comparison regardless. I tried to chain Where clauses in order to skip the comparison but it still runs. Any ideas on how to implement that? The comparison throws an exception.
 
@ShotgunNinja haha, mad skills ninja, mad skills!
 
7:09 PM
@JohanLarsson aw shucks.
 
I tried using && as well.
 
Thanks anyways, looks like i will create a question after all!
 
doomed!
 
@TravisJ is it the same in linq to objects?
 
I am not sure =/ Should be for the most part though.
 
7:13 PM
ok, will try it sec
 
@TravisJ SQL can't guarantee the order that the predicates are evaluated, so im assuming that is reflected the the inability to "short-circuit" in linq to SQL
linq to objects should work though, as C# can guarantee the order the predicates are evaluated
 
@SteveKonves - I thought something like that might be happening, so I tried to chain where clauses. Any idea why that didn't work? Should I enumerate them in the middle of the where clauses ?
I am trying to avoid pulling huge amounts of data all at once. But at the same time, I am getting close to the fkit stage of dealing with this issue.
 
[Test]
public void ShortCircuitTest()
{
    var list = new List<string> {null, "Travis"};
    IEnumerable<string> enumerable = list.Where(x => x != null && x == "Travis");
    Assert.AreEqual(1,enumerable.Count());
}
That works^
 
hm
 
lambdas?
 
7:18 PM
@ShotgunNinja LAMBDAS? HL3 CONFIRMED
 
Well, enumerating the enumerator worked.
 
ok guys. have a great weekend
 
@TravisJ Don't you normally enumerate enumerators?
 
I will!
@Johan - I am going to go skiing :D finally
@ShotgunNinja - Usually I just exploit them.
 
@TravisJ nice, I'll probably go skiing drunk soon. My ski-buddy just called
 
7:23 PM
Check out this mess of a query
dbSet.Where(pl => pl.isDeleted == false && pl.Q > 0 && pl.RQ < pl.Q && pl.PId == PId && pl.TCdId != null).ToList().Where(pl => pl.TC.T.W.FW.P.O == pl.TC.T.W.FW.F.S.P.Count()).Select(pl => pl.PLId).ToList();
2
 
@TravisJ wtf
 
@TravisJ That looks suspiciously like Java.
 
It runs in 540ms, not the best, but I will have to live with it.
 
Each one of the letters is a navigation property representing a database table
 
7:27 PM
@TravisJ Why do you need to convert it to a list twice?
 
@TravisJ that's... eww. That's worse than the worst LINQ I've written, lol
 
Because of what I was talking about earlier with not being able to step over nullable foreign keys.
 
			var alerts = context.vwAlertHistories
					.Where(c => c.MerchantID == merchantID && c.AlertCreated > DateTime.Now.Subtract(TimeSpan.FromDays(daysBack)))
					.Select(c => new {label = c.SubscriptionTitle, date = c.Sent.Value.Day.ToString()})
					.GroupBy(c => c.date).ToList();
 
@Pheonixblade9 - See the dbset? I didn't even get to use my repository for it =/
What is doing is determining the eligibility of a product to be used in an assembly line process.
 
@TravisJ try converting it to an IEnumerable rather than a list the first time. I bet you that it runs faster. Converting it to a List makes it concrete, an IEnumerable lets LINQ magic happen better
 
7:29 PM
Ok, I will try that
 
we use that here for huge lists. Using a List is a concrete collection, whereas IEnumerable is allowed to be lazy
 
.AsEnumerable(), didn't seem to mind it.
It makes sense actually, good idea
 
:)
lemme know how the benchmark runs
 
@TravisJ if i ever think im having a bad day, im going to come back and read that.
 
lol
 
7:31 PM
Hey guys, I have a partial view that is like a address search control with some textboxes and submit button. I am calling that view in my main form view which has its own control and a submit button for the whole form controls. how can I implement the validation that if submit button of address partial view is clicked, the validation for the main form view controls doesn't get fired??
 
What tech are you using? WPF, Webforms, etc... ?
 
oh sorry..its mvc 4
 
public class Person : IValidatableObject
{
    public string Name { get; set; }
    public bool IsSenior { get; set; }
    public Senior Senior { get; set; }

    public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
    {
     if (IsSenior && string.IsNullOrEmpty(Senior.Description))
        yield return new ValidationResult("Description must be supplied.");
    }
}
you can write a custom validator that gets called when you use the search box :)
 
@Pheonixblade9 - AsEnumerable() didn't work :(
 
7:34 PM
@TravisJ boo. Didn't work at all?
 
It did not include the navigation property so it blew up and thew an exception.
 
tell me a reason to move mvc
 
what about this? (one sec)
 
@Pheonixblade9 the solution you have given is good in case of a checkbox or radiobutton which is bind with a bool property in model and we want to show some other control's validation...but I don't have any such flow in form where user needs to select something. those are just postcode1 and postcode2 textbox controls and a submit button which then populates d address in dropdown
 
@TravisJ why do you need the first .ToList() again?
 
7:39 PM
@Pheonixblade9 - I am not sure, all I know is that apparently it is happy when that happens. It is an ugly hack. Something about loading navigation properties, perhaps lazy loading evaluations? I am not sure entirely.
 
@Pheonixblade9 also there is no support in mvc yet to have clientside validation if we are using ivalidateobject's validation method in our class i.e. no unobtrusive behaviour.
 
lunch is here, one sec @TravisJ
 
:D
Well, it worked, so I am leaving it alone.
Later on for optimization it can be revisited.
 
Evenin' all
 
howdy, @RobWhite
 
7:47 PM
Hey @ShotgunNinja
Jeez I much be more tired than I thought...originally typed @SnotgunNinja ^^
 
@RobWhite lawl
 
@TravisJ here's better formatting at least:
dbSet.Where(
	pl => pl.isDeleted == false
		&& pl.Q > 0
		&& pl.RQ < pl.Q
		&& pl.PId == PId
		&& pl.TCdId != null)
	.ToList()
	.Where(
		pl => pl.TC.T.W.FW.P.O == pl.TC.T.W.FW.F.S.P.Count())
	.Select(pl => pl.PLId)
	.ToList();
 
Confused, why all the ToList()'s?
Guessing to transition from Queryable to Enumerable but is it necessary?
 
@RobWhite I suggested that, but it doesn't seem to work
 
Well, the first one is because the navigation property isn't loaded because the foreign key is nullable. So that has to be enumerated. The second one is to add the range of ids to a list of int.
It is ugly, and awful, and not the way things should be done. It works, I am moving on, good riddance.
 
7:51 PM
I'm sure I remember something about the configuration that lets you specify "eager load this relationship" etc
 
.Include
 
Aye that'd be it
 
Doesn't work with nullable foreign keys.
 
Ah okay
I haven't used Entity Framework in a long time
 
At least, I am fairly certain it does not. I will run it through once.
threw exception :(
 
7:58 PM
@TravisJ would this be related at all...? Just from a quick search but it's about nullable foreign keys etc
Time for food, will be back after - just in case that's related, a better answer is posted just below the one that's marked as answer (updated for performance / complexity)
 

« first day (818 days earlier)      last day (4137 days later) »