« first day (2004 days earlier)      last day (2934 days later) » 

3:01 PM
do you know the reason why this happened? Does this mean that the value that is being used by the thread is not the int value but the reference to i.
 
user47589
this happens when you try to capture a closure in a loop.
 
user47589
95
Q: Captured variable in a loop in C#

Morgan ChengI met an interesting issue about C#. I have code like below. List<Func<int>> actions = new List<Func<int>>(); int variable = 0; while (variable < 5) { actions.Add(() => variable * 2); ++ variable; } foreach (var act in actions) { Console.WriteLine(act.Invoke()); } I expect it to ...

 
Hoisted context I believe is the term
 
user47589
 
now I understand.. thanks for all your help.
I appreciate it.
 
user47589
3:03 PM
hmmmm
 
user47589
> UPDATE: We are taking the breaking change. In C# 5, the loop variable of a foreach will be logically inside the loop, and therefore closures will close over a fresh copy of the variable each time. The for loop will not be changed. We return you now to our original article.
 
user47589
anyone with VS2015 able to confirm that? has this behavior been fixed in C# 5?
 
if you have any piece of code i can test for you
 
var values = new List<int>() { 100, 110, 120 };
var funcs = new List<Func<int>>();
foreach(var v in values)
  funcs.Add( ()=>v );
foreach(var f in funcs)
  Console.WriteLine(f());
(Quite literally a copy from that blog post)
 
@RoelvanUden 100, 110, 120
 
3:06 PM
@Amy Wouldn't VS2013 be C#5 and 2015 be C#6?
 
user47589
maybe so. i have trouble keeping the C# versions synced up in my head
 
I have the same problem, which is why I asked lol
Only because R# occasionally goes "that's a C#6 feature, so this won't compile :("
 
yep i got 100,110,120 as well
 
I'm checking VS2010 now
120, 120, 120
 
so... before i go down this rabbit hole again... is it possible with custom attributes to have validation where i can do [CustomRangeValidation(model.YearA, DateTime.Now, ErrorMessage = "You entered an invalid value!")]?
 
3:13 PM
@Bardicer people have done this, but as far as language/framework support for this goes, you're on your own
 
COCKBAGGING KNOBJOCKEY SWASH-TITTY CHOADGOBBLER
</rage>
 
@Bardicer don't the attributes have to be compile-time constants
 
no, this would be a custom implementation
 
sorry. That wasn't aimed at anyone. I just needed to vent.
 
@mikeTheLiar i think that's what i was running into at first
it's been a month or two since i tackled this
 
3:14 PM
@Squiggle That's um.... An interesting string there. I especially like Choad Gobbler, it just rolls off of the tongue.
 
@Bardicer what are you doing validation for?
WPF?
 
so i'd need to move the DateTime.Now part into the actual code
 
@Bardicer that's the problem I always run into with NUnit. I want to use some MaxValue in my test but it's not a constant
 
@Squiggle u rage in a very ... beautiful way if i can say
 
ASP.Net - MVC - Razor model
 
3:15 PM
@ElieSaad It's a British trait.
Because it's our language we're entitled to make up new words.
 
@Sidney although I believe the accepted spelling is chode
 
"Gobshite" is one of my personal favorites
@mikeTheLiar IT'S MY LANGUAGE
dnt u tell me hw 2 spel
 
Or Knob Jockey, that's delightful.
 
Guys, architect wants to implement a POST endpoint with a query string. While it's not explicitly disallowed, I could do with a reference to justify why it's bad
 
Americans just string together various combinations of "fuck"
 
3:16 PM
@Bardicer I probably can't help you then, but maybe this can
 
all hail 'Muricaa
 
@ElieSaad trump 2016
 
@Jeremy cringe
 
"You guys are just on a totally different level of swearing over here, aren't you?"
 
thanks @Jeremy i'll look at that
 
3:16 PM
@Sidney wanna-be
 
now i'm scared to look at that
 
@TomW No reference can't you just tell him the POST creates a body and its extra space that is used between the messages which is just useless?
 
@misha130 congratulations!
 
thanks :^)
 
3:18 PM
@misha130 POST without a request body is permitted
 
for wut m8? ^^
 
Or more accurately a body of length 0
 
BUT HEADER WISE
YOUD HAVE TO SPECIFY THIS FACT
 
user47589
stop shouting
 
Why are we shouting?
 
3:19 PM
because I dont have a valid reason
and its making me mad
 
I think he acknowledges that it's iffy
 
@mikeTheLiar why do u have such a link ...
 
user47589
204
Q: HTTP POST with URL query parameters -- good idea or not?

Steven HuwigI'm designing an API to go over HTTP and I am wondering if using the HTTP POST command, but with URL query parameters only and no request body, is a good way to go. Considerations: "Good Web design" requires non-idempotent actions to be sent via POST. This is a non-idempotent action. It is eas...

 
I am actually using post as get in my project right now cause someone is forcing me to have only specific methods in my controller
 
@Amy I have exactly that Q open right now
 
3:21 PM
well, the actual flow from that to db is pre built and I can't change it
 
@ElieSaad because it was posted on the Boston Globe website? I don't understand the question
 
And the guy has referred to it already
 
user47589
i dont really see a problem with having query string parameters with a POST
 
user47589
are you trying to be RESTful?
 
It just feels "not as intended"
 
3:22 PM
@Amy Im restful
i can sleep a real long time
 
@Amy I just find it eh. I've encountered this before because WebHttpBinding actually ignores query strings on post
 
user47589
in REST the POST body should look like the resource you're posting to. if your parameters don't match that resource, it should be in the URL
 
@misha130 yeah
 
@mikeTheLiar Why did I look at this, It just makes me sad.
 
user47589
then dont look at it
 
3:25 PM
@Sidney Sad!
Apparently it made Trump sad, too.
 
The scary thing is, I wouldn't doubt it would whip up his supporters into a rabid frenzy to defend their candidate, and make 'em more likely to vote.
 
@Amy wow
thats scary
 
user47589
what is
 
how some people go about building API url structures
 
user47589
yes. terrifying.
 
3:29 PM
I know I talk about OData a lot but this is part of the reason I like it, it sort of standardises this issue
 
@wadry api/MyFunc
did i spook you
 
user47589
eeeeek!
 
user47589
hides
 
basically says "do it like this and all magical things will happen" or "do it your way ... and yay rely on your own black magic"
@Failsafe what's that do? I bet its broken
 
@wadry returns an empty json object
{ }
 
3:30 PM
2spooky
 
It has been a while since I had to create an installable app, in any event I wonder what the ratio of consumers who buy software nowadays buy something installable or if it needs to be configured via web server....or if I am talking about 2 different consumers altogether
 
5me
 
@Failsafe good for you ... now you can learn how to make real API's ;)
 
@wadry also there's a comma at the end { }, because i decided to build the string from scratch but i can't program
so the json's invalid
 
I am creating some evaluation software I should it be web based or should it be installable
 
user47589
3:32 PM
Choosy moms choose web.
 
@Failsafe its valid FailSon
just do a microsoft and define your own standard
 
@wadry Like JicamaJS
 
just don't expect me to ever call it
@Failsafe I still have no idea what that is lol
 
I will define my own standard of dashes
 
user47589
My standard is standardized.
 
3:33 PM
@wadry it's everything. That's the point
 
every character is represented by -'s equal to the ascii amount of that character
 
!!xkcd standards
 
user47589
Standardification proceeded without error.
 
for instance '{' is 123 -'s
 
user47589
3:34 PM
JicamaJS encodes the best '{'
 
@wadry Hey now, just because google, apple, Mozilla, and opera have their own standard, doesn't make it any more or less standard than Microsoft's standard.
 
@tweray I literally just saw that somewhere else
don't remember where
 
probably here too
 
xkcd litters the web. It's everywhere.
 
user47589
we should publish JicamaJS to npm.
 
user47589
3:35 PM
why haven't we?
 
At the old TDWTF forums it was so bad the mods would replace any xkcd image with a picture of Rosie O'Donnell
 
user47589
lol
 
@Amy Because everyone will come to rely on it's greatness, then someone will yank it, crippling 3/4 of the internet. We can't have that much power centralized in one location.
 
wat? isn't jicamajs having its own package management system?
 
grr
 
3:36 PM
@Amy that will work...I guess when you go to sell it they can decide whether or not to bring you on board to implement it
 
@Sidney leftPanini
 
Exactly! Or A.Insert
 
none panino, left meat
 
@Squiggle Invalid expression term, 'none panino'.
 
3:40 PM
Someone paid for that
 
is it normal to not hit a breakpoint in a custom attribute?
 
None pizza with left beef.
 
lol
 
@Bardicer only if the code isn't run, or the symbols are not loaded
 
well i know the code is being run, but my breakpoint on the IsValid override isn't being called
back to the drawing board
or i should say, i decorated a property in the model with the attribute, but the isvalid isn't being called
and no validation is popping up on invalid input
 
3:43 PM
do you have anything interrogating that attribute?
 
[CustomYear] public int MyYearAttribute { get; set; }
 
oh, you're doing MVC validation using the ComponentModel stuff, right?
 
lemme look up componentmodel real quick
 
@Squiggle That's the funniest image I've ever seen
 
yes
i'm using componentmodel
 
i have CustomYearAttribute : ValidationAttribute
 
ace
Does it validate if you use normal attributes like [Required] etc?
 
yes, [Required] works
um... one sec
;_;
 
:D
 
:D
 
3:46 PM
sad_trombone.wav
 
custom jquery validation is being used...
 
user47589
the trombone is the devils instrument
 
if $("form #FieldId").val() === "invalidData") { $("#divFieldIdMsg").show(); }
hey now
i was a boner in school
 
I didn't know trombone players called themselves that.
 
@Amy Hey! I'm a trombonist tyvm
 
3:47 PM
@Bardicer how did it feel being someone else's penis for 4 years?
 
even ron jeremy couldn't carry me around lol
it was only 2 years
 
@Bardicer so model validation using DataAnnotation attributes is easy on the server-side, but you want to do it client-side as well?
 
user47589
oh myyy
 
when i transferred to a school with football, i quit band for football
yes @Squiggle
 
@Bardicer and what guides were you following to do that? It's been a good few years since I last looked at that
 
3:49 PM
Are you doing @ValidationMessageFor in your view?
 
it's not the most trivial of things
 
@Amy George, i-is that you?
 
@Sidney lmao
 
when i did a [Range(1900, 2000, ErrorMessage = "Idjits!")] it'd show "Idjits" where i'd expect it to
no, i didn't think i needed to since the range attribute showed a message
 
was that after form submission?
 
3:49 PM
before
on blur
 
hmnyrgh. I guess custom validation attributes are difficult to translate to the client-side.
 
yeah, i'll go through that link you posted up
see if i can get it to work there
 
that link is for server-side validation of custom attributes
stackoverflow.com/questions/4747184/… has the additional step for client-side jQuery magic. It's fiddly as hell.
g'luck
 
@SteveG From now on I'm going to stop reading @Amy's post in Rainbow Dash's voice, now they're going to be read in George Takei's voice
 
who the hell is rainbow dash
 
3:57 PM
@SteveG it's a drug
a mix between cocaine and LSD
 
aka "Cake"
stimulates the area of the brain known as "Shatner's Bassoon"
 
user47589
!!youtube rainbow dash
 
no
 
user47589
yes
 
3:58 PM
no
 
user47589
maybe?
 
@CapricaSix Really, that's the best you could come up with?
 
nope
 
user47589
slides a thick envelop under the table to @Failsafe
 
My little pony, apocalypse pony, punishment for your sins!
 
3:59 PM
bloop
 
!!youtube apocalypse pony
 
Wow, I guess everything is darker in the comic books.
 
hahahahahahahahahahahahahahahahhahahahahahahahahahahahahahahahahahahahahahahhaha‌​hahahahahahahahahahahahahahahahhahahahahahahahahahahaha... fml
 
I LOVE YOU APOCALYPSE PONIES!!
 
4:03 PM
Hey so i am doing something like i am returning Iqueryable from my controller and i am using it in my view with the same type as iqueryable. Works fine. Anyting wrong with it? Like not converting it to Ienumerable or something else????
 
user47589
it works fine, but you're asking if there's something wrong with it
 
@Obviously MVC? Yeah, I'm really not a fan of exposing queryables in views.
 
user47589
i'm guessing not.
 
I mean is it a bad practice
@Squiggle why not?
Yes, its mvc
 
The MvcMovies tutorial has returns that return an IQueryable entity
so probably not
 
4:05 PM
@Obviously if you have an IQueryable<Account> and you're rendering a list of 300 accounts... then in each row you say account.Count(a => a.Members);
that's probably 301 database queries
be careful of doing projections. I much prefer dealing with properly serialized data when rendering views. It makes things much less error prone.
 
cockbanging knobjockey
lmfao wtf
your brain makes me laugh
squiggle
 
I had to fix a WPF helpdesk app that was trying to do 5000 db queries just to load the first page. It hung for 2 minutes every time you switched tabs. Was bad.
 
my comments are completely unrelated to this convo
just felt like pointing it out
 
@SteveG I was having a moment of clarity.
 
@Squiggle Just curious, would you say that to a coworker?
 
user47589
4:08 PM
You know he would. He's like a honey badger.
 
say yes please
 
@Sidney I almost did.
but the CEO is in today, so I bit my tongue
 
I just checked my "fucks to give" balance and it looks like I'm overdrawn, sorry.
 
also it's only my 2nd week on the job, and nobody else is particularly fluent in my type of English
 
@Squiggle profanity?
 
user47589
4:09 PM
lol
 
@Jeremy eloquent profanity
 
So it's gone from "British English" to "Squiggle's English"?
 
the king's squiggle's english
2
 
lmao
 
I thought Squiggle was the king?
 
4:10 PM
Just curious, how do you spell Color?
 
Colour
 
couleur
 
COLOR -.-
 
on est francais
 
cuouluouru
 
@SteveG Command momentofclarity learned
 
!!momentofclarity
 
well, shit
 
shit gone bad ...
 
4:13 PM
i'd rather not be seen in that lol
 
!!unlearn momentofclarity
 
@SteveG That didn't make much sense. Maybe you meant: learn
 
You want forget
 
!!forget momentofclarity
 
@SteveG Command momentofclarity forgotten.
 
4:14 PM
ok, so i'm just going to go with the standard that's already been set forth on validation. custom jquery on the page
 
I think for one-boxing you have to do "<>permalink"?
!!learn momentofclarity "<>http://chat.stackoverflow.com/transcript/message/29879427#29879427"
 
@mikeTheLiar Command momentofclarity learned
 
!!momentofclarity
 
1 hour ago, by Squiggle
COCKBAGGING KNOBJOCKEY SWASH-TITTY CHOADGOBBLER
 
Goddamnit, someone burned popcorn. I swear, I'm gonna turn those microwaves into Magneto mutant making machines so the next person why tries to make popcorn gets liquefied ala Senator Kelly.
 
4:15 PM
it got worse ... HAHAHAHAHA
 
@Sidney you guys don't have a "popcorn" button?
 
DUDE his msg is on the top now, that squiggle really won it today :p
 
we're all children.
 
all our microwaves are plastered with warnings signs in bold red text "TO MAKE POPCORN: ...press the popcorn button"
 
we talking popcorn now?
 
4:16 PM
no
 
@Jeremy We do, but our employees all think "They know better than the microwave" when to stop it.
 
I guess we're all to busy with real work to care
like stackoverflow chat
 
why wouldn't we?
 
"IF YOU ARE MAKING POPCORN: your coworkers hate you."
Popcorn has one of the more unfortunate Spoonerisms I can think of
 
There a way to make a Generic Entity, say I know a table will have fields ID, Name, Height and there will be 4 tables with the same fields. Is there a way to use EF with out having to model each of those tables?
 
4:19 PM
@mikeTheLiar I like hardpore corn
 
@KendallFrey the unstable camera effect...
 
@juanvan Without knowing jack about EF, is it possible the similar Entity classes could inherit from a base class? I've been using that trick with XML serialization and it's great.
 
ya I have a base entity that mocks those tables
 
oh my god
 
@Sidney have a Entity PersonInfo has a Id, Name Height, then I have 4 tables in the DB ContractorPerson, AccountPerson, PatientPerson that those tables have the same Fields. Is there a way to have them accessible thru the PersonInfo Entity.. Guessing not, would be better to have them all in one table this is just thinking outside the circle
SteveG where is he coming did he bring beer?
 
4:32 PM
@juanvan I wish I knew more about EF to help. If this doesn't work, I'm out of ideas =(

public abstract class PersonInfo
{
  //Details to get EF to understand name, age, height, etc
}

public class ContractorPerson : PersonInfo
{
  //ContractorPerson Specific details
}

public class AccountPerson : PersonInfo
{
  //AccountPerson Specific details
}
 
thanks I am doing more reading, I might email someone see what they think
 
@SteveG what's blown your mind now?
 
hi guys
nice to see you again
I've an doubt that I would like to share with you
I'm using the Serialization class to serialize objects. I add the XmlIgnoreAttribute for fields and I serialize the related properties (I implement the INPC interface)
Then, to follow the Version Tolerant Serialization, I also add to fields the [OptionalField] attribute. For example:

[XmlIgnoreAttribute]
[System.Runtime.Serialization.OptionalField(VersionAdded = 2)]
bool _nonlinearGeometry = true;

[PropertyOrder(1)]
 
finally ... I now have centralised resource string management
also implements dialects right instead of the .net version which just don't lol
 
@TomW nothing at all, don't even remember why i posted that
 
4:41 PM
@FrancescoDS wow thats pretty clean I suppose ... most these days are versioning their urls
~/Api/v2/Foo
then you don't have to hold the previous version info in the current versions api
I guess it depends on your requirements though
what happens if something is removed in v3?
 
I need to test it but I'm looking for some infos before testing
 
okay, so california forces dealers to provide a cancellation option agreement for used cars under x amount, i should still be entitled to that, even if i'm buying online, right?
 
user47589
should? yes
 
im suspicious of ebay
u can get a chinese replica of that jeep
 
me too, but, i'm taking every precaution imaginable
 
4:45 PM
the last time was buying on eBay there was an sdCard scam
 
Good morning all. I'm kinda stuck on an issue. I'm trying to generate a type based off of a .cs file read in at run time. The type will never be create, just reflected upon to get some details off of. Is there something from, say, the TypeBuilder that will just take in a string or file?
 
people got chinese fakes and made them look like the real thing, a lot of people bought them
ive seen a lot of scams on ebay
 
user47589
i haven't bought or sold anything on ebay since the site became home to scammers
 
have you even seen the jeep live?
can u get proof that jeep actually exists?
 
buying anything over $1000 on ebay proves nothing but stupidity
 
4:50 PM
i mainly shop on amazon
 
user47589
dad sold a few cars on ebay.
 
user47589
about a dozen.
 
and he got scammed lol
jk
<3
 
user47589
he had no issues.
 
how do u ship the car tho lol
 
user47589
4:51 PM
they came and picked it up with a car trailer.
 
user47589
in one case he delivered it.
 
@Amy I wouldn't think sellers would have much of an issue, but for buyers it's could easily be a cash scam.
 
user47589
yeah @Sidney
 
im just saying, b4 u buy a car on ebay, have the seller give you live footage of that car working
and looking like in the post
 
user47589
are you typing on a full keyboard or on a phone?
 
4:54 PM
im using YOUR keyboard kappa
*keyboard jhacks :D
 
user47589
Why type things like "b4" and "u" when you're using a full keyboard?
 
i dont think about it lol
it's muscle memory
 
How can you have muscle memory that translates from a phone to a full keyboard?
 
you can type like a baws in my keyboard any day, just gotta be a real chick tho
 
user47589
what is that supposed to mean
 
4:56 PM
i dont let other men touch my babies
 
This is quickly going south...
 
nah, gotta go do some coding, cya guys in a few
 
user47589
take your time.
 

« first day (2004 days earlier)      last day (2934 days later) »