« first day (1969 days earlier)      last day (2965 days later) » 

6:00 PM
So
Now that I'm alone in the office
I found out the system I'm working on currently stores passwords in plaintext
 
No, masturbating is still a bad idea.
oh
 
<3 legacy
Like even when this wasn't legacy someone must have thought "Wait! That's stupid."
Apparently not.
 
user47589
They might have known it was dumb but didn't care.
 
masturbation is never a bad idea
3
 
Dunno
It's the first I have heard of it but apparently it's on our "URGENT: FIX THIS SHIT BEFORE RELEASE" list
 
6:06 PM
That in a TODO: list?
 
user47589
i worked for one month last year at a company that stored their passwords in plaintext in an excel spreadsheet and stored that spreadsheet in a SVN repository open to the internet.
 
oh, damn, i have to be nice now
 
omg dependency injection just clicked
 
guys scala is rly cool
 
im a fukin idiot.
that took me like a year.
@Amy Lol what the fuck even
TDWTF
 
user47589
6:11 PM
It was pretty bad.
 
that's an inspired level of bad
 
did the company close?
 
That's like "I wonder how bad I can make something and still get away with it"
 
user47589
no, they're still in business. I'm tempted to give the address but maybe that's not a good idea.
 
nah I am just suprised they are still afloat
 
user47589
6:12 PM
They used excel spreadsheets, one per table, as their db backup strategy.
 
those poor souls
its like learning about african tribes that practice cannibalism to this day
 
user47589
We didn't modify tables directly. Instead we modified the spreadsheet, and after committing a binary file to SVN, we could then modify the db. But the db didn't manage PK/FK relationships, we had to do that by hand, using excel.
 
151
Q: ValidateAntiForgeryToken purpose, explanation and example

Tabriz AtayiCould you explain ValidateAntiForgeryToken purpose and show me example about ValidateAntiForgeryToken in MVC 4? I could not find any examples which explain this attribute?

Do I need to pass the token from my ajax request to the controller?
as data
 
user47589
It was clumsy and error-prone as shit.
 
@Amy thats better than xcopy a running DB ^^
 
6:15 PM
@KalaJ if you have the annotation
so they didnt have any kind of indexing?
 
user47589
no.
 
Is it still preferable to jump on the xunit or nunit train?
 
holy fuck mate
 
@Amy I don't fuckin even what help my brain ow
 
yes I do
I have the attribute in my controller action
 
user47589
6:16 PM
It's the only job I felt good about quitting.
 
again summer is coming, so are interns
 
and the @html.antiforgerytoken in my view
 
Or has msbuild caught up?
 
@KalaJ so the action expects it
 
looking for good think out loud programming questions for recent graduates, any ideas?
 
6:17 PM
yes it does
 
user47589
ask about definitions, like "what's the difference between the heap and the stack"
 
What makes some classes Serializable and some not?
like some I can put the tag on, some I can't
Why am I asking here and not reading the intellisense tip
 
^ this is a good questions for interns
 
Woo I'm an intern!
 
:^)
 
6:19 PM
"Because the namespace isn't included"
 
so I was wondering if I do something like this:
$.ajax({
							type: "POST",
							url: '@Url.Action("Create", "ClientAccount")',
							contentType: "application/json; charset=utf-8",
							data: { __RequestVerificationToken: token, FormData : formData },
							dataType: "json",
							success: function () { alert('Saved Address'); }
						});
 
why is FormData seperate?
 
and my controller action only takes in one parameter
 
i tend to have some more algorithm/logic based questions. most of these guys are from the dark java side, never touch c# or .net
 
@misha130, what do you mean?
Should the token be included with the formdata?
 
6:20 PM
@tweray: explaining linked list has always been a good candidate
 
no
its fine
you just made a class so it cant bind in the action to the parameters
 
This is how my controller looks:
        [HttpPost]
        [Route("Create")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create(ClientAccountModel request)
        {
		}
It takes in one parameter
 
oh, please dont write razor inside javascript
 
so is my ajax action wrong?
 
well yes
 
6:22 PM
above is not in js, it's in C#?
 
I meant the view
 
Shouldn't the requestverificationtoken be part of the form data?
Isn't it a hidden usually?
 
well it is
the data object is the form data
 
passed as json. What type does the action expect?
 
I just want to get back the values from the textboxes in my form
so string data
 
6:26 PM
ClientAccountModel
 
but I am getting a 500 server error
on post
 
Is it mvc or webapi?
 
mvc
 
Does the actions in mvc controllers allow you to pass json?
or do they expect something like x-www-form-data instead?
What if you do a simple view, with a postback, then inspecting the differences in fiddler. Are they the same?
 
I basically want to pass a particular query to a form. But I want to be able to change the context at any point in time.

Any thoughts on how to handle this?
 
6:30 PM
@scheien action is an ActionResult
 
Why is it when I build the DLL the web service still takes 2 minutes figuring out wtf is in it
 
so I think it accepts json?
but I'm not sure
 
whats the error Kala J
except 500
 
@KalaJ me neither, that's why I'm asking. :)
 
contentType: "application/json; charset=utf-8",
 
6:34 PM
I just get this:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
But I'm debugging and the formData is correct (populated) and so is the token
 
try to change content type to application/x-www-form-urlencoded
 
maybe how I'm handling the token is incorrect
@scheien, it seems like that did it
thank you!
 
np
Do you understand why it worked?
 
no and actually there might still be a server error but it could be related to something else. However, I did notice it hit the action
 
If it hit the action, the token should be verified.
 
6:41 PM
okay, I might have a caching problem brb. Going to close the browser
yeah it hit the action, it's failing because the data isn't properly sent in the controller
 
Your model is null?
 
I'm a model struct wait wait...
 
yeah it's null
I might be missing some of the terms
but it should at least display the address but it doesn't
was there a way I had to map the address to the model?
that is, the formdata to the model
 
just make an equalient class in javascript of the formdata that is expected in the action
var formdata = {}; formdata.ID = "1" formdata.Name = "Johnnie" etc
 
@KalaJ: Have you tried using serialize()?
data: $('myForm').serialize()
That should include the token also, if it's within the same form.
 
6:53 PM
data: $('myForm').serialize() + "&__token" + token;
 
It includes the token if it's within that current form.
 
oh right i misread
 
generates something like this: __RequestVerificationToken=QMKALdFbE1_ub1&Name=Marius&Age=31&Alias=atom
 
o/
 
and the model I used consists of 3 string properties.
hey @TravisJ
 
6:56 PM
@KalaJ - The names must match exactly to the model used in the accepting parameters of the actionresult method in order to be bound.
 
What's up @Gabe?
 
@TravisJ, that must be why
What do you mean by that ex wise?
 
user47589
o/ @TravisJ
 
Like I pass FormData from ajax
does the action have to accept FormData?
 
@Amy :)
 
user47589
7:04 PM
its a lovely day today
 
Hey @TravisJ @Amy
 
@KalaJ - What do you mean FormData?
 
@scheien I think Gabe is sleep-chatting right now, it's like 5 AM there
 
@Greg :)
 
user47589
67F right now, sunny, with a gentle wind
 
7:04 PM
Yeah, a gentle wind here was like 30mph lol it was really windy last night
 
I've been missing for the past week.
 
@mikeTheLiar that might be.
 
found you!
 
user47589
throws a net on @greg
 
user47589
you won't get lost again
 
7:05 PM
@TravisJ, actually I think I might know why... this is weird but the way the code is setup is there are several partial views and different models
 
Been at the hospital.
 
user47589
wife give birth?
 
Yeah, last week.
 
user47589
congrats
 
oh cool! congrats @Greg
 
7:06 PM
Thank you.
 
You're a dad :D
 
what if I want to serialize two different models
 
Yeah, crazy.
 
@KalaJ - So, sorry if this sounds basic, but you are familiar with calling a regular method right? So if you have public void hello(string world, int i), you would call it as hello("world",5).
 
Congrats Greg!!!
yes Travis of course
 
7:08 PM
Thank you.
 
Congrats @Greg, that's awesome!
 
@TravisJ, I think I know why though it's null
I'm missing two required parameters
 
I got the weirdest request. "You're application uses Entity Framework, the SQL it generates doesn't have a (nolock), which is causing our users not able to login. So you need to add a (nolock) to all of the queries Entity Framework generates."
 
@KalaJ - Well, when posting to an actionmethod, that is really all you need to provide, the "world" and 5. However, it is in the form of the request body which is basically an object that contains the two arguments. In the case of posting to the hello method, we would need to give "world" and 5 to the request body, but also their name. The name that gets associated with these values comes literally from the name attribute on any input element.
@Greg - You need to start using transaction scopes
 
yeah the name is the same @TravisJ you're right!
sorry for being unclear
I understand what you mean. It's just weird how someone set this action up because it's getting model data from another model that is the primary model for the partial view
 
7:11 PM
So you would need to call hello with { world: "world", i: 5 }.
 
I honestly think there should be a helper for what Kala J here is doing, cause the current javascript/C# is super prone to errors
 
@KalaJ - Yeah sometimes that gets convoluted
 
@TravisJ Yeah, not familiar with those.
@TravisJ But I see it is in my future.
 
@Greg - context.Database.BeginTransaction();
you can start at that entry point :)
I use transaction scopes for ensuring that multiple commits rollback at once, and so my async search behemoth doesn't step on the toes of other processes
 
@TravisJ, yeah it is. I have no problem with the call and parameters... I believe the issue is, the wrong model is being used for the information I want to pass into my controller action. I'm going to test it separating out the calls
 
7:16 PM
@KalaJ - You mean it is accepting the wrong model in the method definition?
@KalaJ - A common misconception is that the @model definition used in views should be the same model that is used in the actionresult method that gets posted to once the page has been populated with data.
 
@TravisJ Yeah.
@TravisJ I'll have to look into that.
 
@TravisJ, it's a bit convulted because I have a view that contains several partial views
The partial view uses the correct model
and I want to save and grab that partial view data
 
@KalaJ - Yeah, but the model used to populate the view or partial views doesn't really have anything to do with composing the data to post from the page.
 
But the controller action needs not only the partial view data but the data from the main model that is passed in
 
@KalaJ - All you have to do is make sure that the names and structure of the object used for data in your ajax call line up with the names and structure of the arguments in the calling server side method.
 
7:22 PM
They do
 
@ReedCopsey that's what I meant - Jetbrains' new C# IDE
 
I'm missing a few fields because I didn't include them in the serialization
e.g. var formData = $("#addressBlockFrm").serialize(); for one partial view
but I need to serialize another part of the view
so I can pass both data into the controller
That is I have another form I want to serialize but I want to call the same controller
 
what does the actionresult accept
jquery's serialize can be overrated.
does it accept one model? two? panini?
 
panini of course
one model
so you're saying I can pass in two models?
 
user47589
something is locking my domain account every 15 minutes.
 
user47589
7:28 PM
i blame Zoidberg, of course, but am open to alternative reasons.
 
Who am I?
 
@Amy (\/);,,;(\/) sorry
 
@Amy, did you ask the professor?
 
user47589
you are @Kush, greatest among the panini.
 
user5981182
peninis
 
7:30 PM
Thank you, Amy and Steve
I'm on my phone on Firefox (: and it works!
 
user47589
Behold!
 
@KalaJ - You can pass as many as you want in several ways, one of which includes using a single model. It really just depends on the setup. If you can reproduce this type of scenario in a dotnetfiddle or something I can show you what I mean.
@kush - Wow! Cannot believe Firefox works :P
 
user47589
Hail science!
 
@Amy - Failed to parse error message, unknown context for "my domain account".
 
user47589
try again.
 
7:35 PM
Same message
 
user47589
third time's the charm.
 
lol
 
@Amy do you possibly have some device that's logged in with an old password?
 
user5981182
@Amy Coming from the last Jaboody's dub ? :)
 
user47589
yeah, IT told me I had a RDP session open for 4 months
 
7:35 PM
@Amy nice
 
@Amy - Did you try turning it off and then back on again?
 
user47589
actually yes i did.
 
Was this response helpful [ ] Yes. [ ] No.
 
Did you try turning it on and then off again?
 
> Was this response helpful [ ] Yes. [X] No.
 
user47589
7:36 PM
[X] Yes. [X] No.
 
@Amy - Did you try reinstalling the program you were using?
 
Solution for all technology based problems - turn off computer. Go outside. Never return.
 
@TravisJ, is it just easiest to use a viewmodel to house all the model data?
I might put up a fiddle later otherwise, don't worry too much about it :) Thanks for your help :)
 
@Amy - Sorry, after the third parse error he comes out :P
 
user47589
1 message moved to Trash can
 
user47589
7:38 PM
no clippy, no, bad travis
 
Hello :)

Does anyone know a view in windows forms that can make the following structure?
I've tried with datagridview and listview but I cant find the solution.
 
@KendallFrey
 
What the heck domain?! A web domain? From the registrar? From your host? Some other domain?
 
user47589
the Master's domain.
 
;)
 
7:39 PM
The Domain of the King
 
@KalaJ - Usually what I will do is manually compose an object and the use JSON.stringify(obj) and pass that as my data.
 
@SteveG no
 
@KalaJ - It also requires that you manually compose the accepting model in the actionresult as well, and that all names match
 
@TravisJ If a form is being used, couldn't you use a serializeArray then stringify the array?
Might be better, rather than a huge object you're building from the front end.
 
If it works :) The "huge object" (often only 6-8 lines of code) tends to be rather simple to do though and that is why I use it.
 
7:47 PM
Thanks guys, I'll look into that
 
@mikeTheLiar do you have any thoughts on passing a particular query to a form. But being able to change the dbcontext associated with it at any point in time?
 
user47589
I know objects. I have the best objects. My objects are hyuuuge.
 
@Michael that sounds unpleasant.
 
@n.Stenvang the easy answer is to make a custom control :P
 
@KendallFrey
 
7:50 PM
As long as they can be properly manipulated there is no problem with huge objects. You don't want them to consume too much memory though. That is why the best objects tend to come in pairs.
 
@mikeTheLiar very much so, jw if there was some obvious simple answer I was over looking
 
in JavaScript, 1 min ago, by Kendall Frey
@Zirak 30/m/MI
 
Kendall are you really a 'm'...
 
Travis hi
 
:P
 
user47589
7:52 PM
Zirak? reminds me of that preying mantis guy on Space Ghost Coast to Coast.
 
@Michael not that I'm aware of but that's also based on a very tenuous understanding of the issue at hand. But it does sounds unpleasant. Complicated. Error prone. A Very Bad Thing &trade;
 
user47589
you guys watch that show?
 
Mysteries the most?
 
@Gabe I'm a p
 
@KendallFrey thats hawt
 
7:53 PM
@kush - What's up? yuno chrome?
:)
 
First coffee of the day done. Now we wait
 
user47589
No waiting. Go straight to that second cup, without regrets.
 
I just make two at a time
 
user47589
A sound strategy.
 
user5981182
7:55 PM
go straight to energy drinks
 
user47589
i want that mug
 
^what if its that big
D:
 
user47589
too big.
 
Still goto second cup?
 
user47589
can you imagine dumping that much hot coffee on someone? you'd scald half their body.
 
7:56 PM
Wait that is coffee? I thought it was tar.
 
Could you imagine the heart palpitations? lol
 
user47589
i can.
 
What did you imagine
 
Probably something along the lines of "oh god I'm having a heart attack"
dunno why I put that in italics. So hipster of me
 
It's not your fault
 
user47589
7:58 PM
are hipsters allowed in C# chat?
 
@TravisJ mmm nice cup
 
It's not your fault @Gabe
 
@Amy I have that mug :D
 
it's not?
 
user47589
it's Zoidberg's fault.
 
7:59 PM
It's not your fault
 
What isn't D:
 
@Amy hipsters are all using Rust or Go or some stupid shit like that
 

« first day (1969 days earlier)      last day (2965 days later) »