« first day (1818 days earlier)      last day (3146 days later) » 

2:00 PM
the getter of a navigation property
 
@Shoe there is shocks on the desk?
 
@ErroreFatale Yes
 
Hoes don't work.
 
@ErroreFatale You don't see that implementation because the classes you write for code first or generated by db first are not the same classes used by ef.
 
Protip: You can't easily serialize EF entities with lazy-loaded navigation properties.
 
2:14 PM
new google suggest answers pointing to paid software
 
ok Shoe, so technically there is no difference in terms of perormance between using lazy loading and doing a LINQ query each time you need a father or child of one object...
 
No
The advantage in it is avoiding getting things you dont need
 
ARRRGH
 
Also allows chaining ops
 
I just found a toString() method in our codebase
 
2:17 PM
Hello
 
I'm gonna hurt someone
 
aw @Sippy i just came, don't hurt me
 
@ton.yeung I can't
Your mom is busy doing her makeup
Your mom tastes strange.
 
Let's say somebody deployed to production with debug=true in web.config... is it 'safe' to just manually edit web.config in the middle of the day with IIS still running
 
You may be onto something.
 
2:21 PM
@ioSamurai Your app pool will restart
 
@ioSamurai It will cause an application pool recycle, meaning that anything stored in memory of the application pool will be recycled, as well. If that's acceptable, then it is safe. Otherwise it's not.
 
thanks!
 
hey chaps, does anyone have any recommendations for child-friendly software tools? Like graphical languages etc which can be used to teach programmin'?
 
@Squiggle tryruby.org
or any url with try....(language)
 
suitable for ~10 year-olds?
 
@Sippy perfect thanks!
 
@Squiggle Np, drag and drop programming is great for teaching kids
There are also some suggestions for moving onto writing their own code in there too
 
ideal
We've got a bring-your-kids-to-work day and one of the folks here is trying to organise something to keep 'em busy for the afternoon :P
 
Haha
 
@ton.yeung What did you end up doing to solve it?
 
2:31 PM
Scratch? I think i've heard of that
 
@ton.yeung Oh, that is cool. Basically what I said.
Glad it worked.
 
ah bollocks. That thing where you've implemented a solution and realised you're going to have to re-do it because the next requirement on the list changes everything.
</grump>
 
@Squiggle at least you get given requirements.
 
hi guys is it possible to throw a create a new instance of HttpResponseMessage?
 
@MatthewFlynn can you rephrase that in words that join up properly?
HttpResponseMessage is not an exception
 
2:44 PM
what do you mean throw
yeah
 
@Squiggle sorry i just re-read what i wrote ;).
basically I want to throw a new HttpResponseException() from my APi JWt provder when something goes wrong.
so when the user tries to log into the api and something goes wrong in the process I want to throw meaningful message back. the main thing I want to catch is if theres cert issues or the like. when creating the token
 
@MatthewFlynn you don't need to use exceptions for this
 
@Squiggle what do I need to do please sir
 
just use appropriate HTTP codes :)
 
ok see what your saying
 
2:48 PM
2xx = There you go
3xx = It's over there
4xx = You fucked up
5xx = I fucked up
 
and parse it based on that?
 
rewind a bit. What are you expecting might go wrong?
 
theres been a few instances when they been publishing they havent been adding the certs correctly and so when I try to write the security token, becuase it cant find the certificate and so it errors, but it doesnt give anything meaningful back so I was hoping to just catch this and send back the message
'install the damn cert correctly you idiots' but in a more polite manner
 
you could just let the system handle HTTP codes, and then anything that goes wrong explicitly you just throw a 404 no matter what, then hackers don't know that they made a 500 or whatever
 
its mainly just whilst staging is still going on so I this particular error is handled
@ioSamurai once its done I think i can probably remove this
your right
I supoose I could just throw a 503
and leave them with it
 
2:52 PM
that's fair, I guess :)
perhaps a 412 "Precondition failed"? :P
is this a webAPI project?
return InternalServerError(new MissingCertsException("You dumb. Install the certs."));
if you're returning IHttpActionResult
 
or something like this "Request.CreateResponse(HttpStatusCode.BadRequest);"
 
InternalServerError(Exception exception) is a method on the base ApiController in a WebAPI 2 project
 
@Squiggle sorry was reading up on something
yes its a webapi
so they are currently calling the login endpoint to get their bearer token
@squiggle problem is this isnt actually occurring in a controller
it happening in the Protect method of the ISecureDataFormat<AuthenticationTicket>
 
can you catch that specific exception in the controller?
 
3:08 PM
i suppose I could couldnt i
although it seems to bypass the catch I have in the OAuthAuthorizationServerProvider GrantCustomException overridden method?
i just tried
throw new Exception("oh no a certificate error occurred again.");
which missed the catch in the api and threw it straight back to the calling app.
this caught it but with all the html
catch (System.Web.Http.HttpResponseException ex)
                {
                    var msg = ex.Response.Content.ReadAsStringAsync().Result;
msg is the full html of the error page?
 
3:27 PM
Is there a way other than nuget to grab a copy of the EWS managed API? I can't use Nuget on our work machines due to some powershell limitations created by GPO
 
@Wolfish YAY STUPID GPOs!
 
INORITE
 
I made our 'services management contractor' remove all the GPOs that were limiting me.
 
Tried everything, even takeownership alng with a little registry modifier. No luck.
 
I am now the ultimate power in the universe.
They had a GPO preventing me from using MMC snapins in Windows, which basically means no services window, no events viewer, etc ..
very annoying.
Oh and no IIS6 manager
 
3:31 PM
Erm... that probably won't happen here. We have several million employees worldwide, if I could even find a sysadmin with that sort of unwieldy power I'd probably just be ignored
 
Haha
Somewhere, at the top, he exists.
 
'tis a sad day for control freaks
 
A beardy old wizard.
 
@MatthewFlynn BTW sorry for the delay - try catching the right exception? or creating your own custom exception, throwing that, and handling it in the controller?
Still not the *ideal* approach, but at least it'll be obvious what's going on.
 
is his name God?
 
3:32 PM
no, that's his password
 
Lol
 
GoD!23
 
HACK THE PLANET!
 
When you ask him things, he either replies with 401 or 403
Feb 17 at 10:17, by Sippy
401 means "I don't know who you are, fuck off." whereas 403 means "I know who you are, fuck off."
 
@Sippy you've seen Hackers, right?
 
3:32 PM
No lol I've avoided watching that film so far during my life
I'm doing quite well.
 
y??
why u no hackrs
 
Lol
 
it's soooo l33t
 
:P
 
Oh God that film made me vomit in my underpants
 
3:35 PM
it's from a time AG had tits
 
5 hours learning 2 things sounds good to me?
 
@ton.yeung 42
 
@ton.yeung Subjective
That's ridiculously asian.
I swear you guys are all The Flash
 
^ does the sound come in clearer
 
Asians do stuff quickly.
Korean starcraft is the craziest thing I've ever seen.
such apm
wow
 
3:42 PM
I used to be able to beat Koreans at StarCraft
no joke. I was good.
 
n3rd
 
hnff hnff hnff
Lazy programmers are the best programmers.
they'll find the best way to write as little code as possible whilst still making it work
 
Ok, I pulled a zip of the EWS API from github, it has a solution file in it alongside a load of folders with .cs sources. Where do I put it? Or, what do I do with it?
 
4:03 PM
Aye, I need to reference it from within another project though
 
Just include the dll
If you decide to update the solution you have from github it'll be easier unless you are going to bind it in VS
Can you even bind to github in VS?
 
tbh I just want to get it working. I've been using ExchangeService but apparently that's outdated now. In any case it doesn't work.

As for binding to GH... I have no fucking clue
 
Yeah don't bother then
Open the solution, compile it, go to the bin folder and copy the DLL/DLLs to your project's bin folder and reference them in VS in your project.
 
I've been trying to make this work for two weeks now
Just done that. Guess what? I already have 2.2. fml
 
kappa hahahahhahaa
 
4:11 PM
If only I could make it work dammit
It's something to do with how I'm calling our exchange server. Autodiscover doesn't work, neither does specifying the URL. At least, that's what it looks like on the face of it, but there's definitely something more going on
 
@Wolfish you can test it here
 
Oh man, I got so happy for a second there. Can't stick credentials into an external site like that, that would be me fired in an instant
Unless there's a similar tool that can run from my desktop?
 
Hello
 
@ton.yeung thanks, if I can't find anything else that will do nicely
 
Anyone know about the practicality of using tasks inside a regular mvc controller? Specifically the default MVC identity template EmailService, which has a "Task SendAsync" method
 
4:26 PM
@TravisJ: hey, your code works great on my end!
 
@ton.yeung so to use it in a "normal" controller, I'm going to have to decorate the controller a bit I guess?
@ton.yeung I'm trying to send an email without messing about and writing my own service. There's a default email service in the normal mvc template projects which is used by identity to do password resets etc, and it's a Task. If I want to use that inside a regular controller, is there some magic syntax I need to know?
 
@Wolfish can do it with a bogus account just to test
 
Or have I conceptually misunderstood everything.
 
if your AD is on the office365 then they already have the creds
 
@juanvan If I could make a bogus account, I would. I'm just a tiny cog in a huge machine here.
 
4:33 PM
you said Auto discover was not working? that will test that even if it does not 'really connect'
 
@ton.yeung ok cool will give that a go.
@ton.yeung cannot implicitly convert partialviewresult to Task<...
@ton.yeung I think 17:30 was a bad time of day to start looking at this stuff.
 
@AlexH hah... I still have a load of batch jobs that I need to check
 
@Wolfish @ton.yeung was going to rebuild a server later too LOL
At least nothing involves TFS so that's a win.
@ton.yeung cracked it. Thanks! Home time.
 
@ton.yeung FW are hard
 
^ read that. It's the most beautifully crafted article I've ever seen.
> ERROR: Attempted to parse HTML with regular expression; system returned Cthulhu.
 
4:55 PM
hmm, not sure I want this job anymore... this was the coding test I got...

//1. Write a function that sorts an array of numbers where odds appear first.

//2. Write a function that reverses the words in a string, e.g.
// Input: "My name is Max"
// Output: "Max is name My"

//3. Write a function to reverse the characters a string, e.g.
// Input: "Hello world!"
// Output: "!dlrow olleH"

//PART B: Write the same function recursively

//4. Find the first non-repeated character in a string (appears once only).
I asked... Just to clarify for the coding questions:

Do they want me to do questions 1, 2, and 3 iteratively AND recursively? Or just question 3?
answer from the manager was...

If question 3 asks for a recursive way and 1&2 do not, it’s up to him to answer them in any way he can.
...what a fucking non answer, seriously?
 
w8... u are not interviewing at my company are u?
 
is it coding test for senior?
 
...
Run fast run far.
 
Nothing I hate more when job hunting... than recruiters
 
Hey guys, someone on my team is experiencing an odd issue with C#. My co-workers and I have created an ASP.net MVC solution. We all run this solution without incident. However, the one co-worker who hasn't yet run the solution tried to run it yesterday.
He is getting errors about Microsoft.Owin and WebGrease not being available. Doing a Google search, it appears that the general solution to this is to update the packages from NuGet, but I would have thought that VS should know to download the packages automatically.
@Pheonixblade9, in regards to the code test you received, I think that you need to consider the source.
If that code test was given to you by an experienced team and they seem like they don't know what they're talking about, I would concur, run far.
However, there are places I've worked where they didn't have C# expertise and they might have just fetched something like this off the internet because they didn't know anything better.
In such a place, you might be able to make a big impact.
 
5:15 PM
it's the fact that rather than answering the question, the manager gave a non-answer
this is for Microsoft
it's a coding test to be a contractor for MSFT to build an Android app
 
I'm late to this conversation, but let me guess, this is with some staffing agency that's going to bill them $100 per hour and pay you $60, or something like that, right?
 
that exactly, yes
although more likely they charge $160 and pay me $60
 
I've been there before and tolerated that crap before; it comes with the territory these days. It can be good for resume-building. Personally, I finally got a new contract gig a few months ago without a staffing agency.
By networking at a local user group.
 
I'm doing consulting for Starbucks at the moment
 
question itself is fine, i will give 1 or 2 basic programming question to all level of SE just to make sure he/she's not mouthpiece programmer, i can simply cross out ppl's name if they feel the question offensive
 
5:18 PM
@tweray the question is very easy. It's the fact that he wasn't clear about what he was asking that is annoying.
 
yeah, that's annoying, very likely he might be just the guy passing the question and have no idea what kind of answer he should expect
 
Staffing agencies can provide value when they do a good job, but in my experience, they typically don't.
Why pay someone to "recruit" for you when all they do is post to Dice.com and then forward the resumes to you and charge an exhorbitant fee?
 
and I'm really not sure what they mean here...
1. Write a function that sorts an array of numbers where odds appear first.
does that mean this?

//input: [1, 4, 7, 6]
//output: [1, 7, 4, 6]
 
What else could it mean?
 
what if you and your staffing agency accidently end up with the same firm?
 
5:21 PM
hello guys....
 
it could mean "sort the entire list, but put odds first", it could mean "just put the odds first, don't worry about sorting the rest"
 
you apply yourself to company A, staffing agency find company A then contact you
 
can i ask a question?
 
Ordinarily, when a staffing company refers you, you sign a contract with them not to work directly for the client or thru another agency for a fixed period of time. It varies agency to agency.
 
@WaqasKanju: don't ask if you can ask, it's recursive
 
5:22 PM
I'm sure that the agency has a similar contract with the company.
 
do you guys end exception messages with a period?
I'm thinking elipses
ellipsis
whatever
or ten exclamation marks
 
I usually use a period.
Sometimes I put an unusual word or symbol in it so that I can easily search for it in logs. I once even put in a message telling to ask for me by name if you see it (needless to say, I didn't expect that to go to production code)
 
oh we definitely have MSFT contracts
 
I should be surprised that they still hire anyone who speaks English.
I have the impression that they are laying off American staff and replacing them with foreign contractors as fast as they can.
 
@DanielAllenLangdon: but if I apply for company A before the staffing agency refers me. how do I know if the staffing has contract with company A, I simply submit my resume to the staffing site
 
5:26 PM
@DanielAllenLangdon well, you know, ppl in india speak english too
 
@JackyNguyen, if you apply to the company before the recruiter contacts you about them, you have absolutely no obligation to the recruiter. If they say, "May we refer you to ACME?", you may simply respond, "I'm sorry, but I'm already being considered by them." The recruiter should present you some other opportunity or else leave you alone.
 
Anyone know how to run a web app and execute unit tests at the same time from within the same solution? I know I've done it before with changing the Startup Projects to Multiple, but think I am missing a setting. Running the Load test is asking to stop the debugging session.
 
ahh I see
 
They will talk nice to you like they're your friend; one recruiter even treated me to lunch.
But, they are all about their bottom line.
So don't let them make you feel like you owe them anything.
 
Right, @JackyNguyen Just don't do the opposite where you apply after the recruiting agency has referred you already. Nothing wrong with you looking on your own while working with a recruiter.
 
5:28 PM
probably a simpler way:
	public static int[] sortOddsFirst(int[] input)
	{
		//1.	Write a function that sorts an array of numbers where odds appear first.
		//I assume this means to ONLY put odds first in the array.  The list will not be sorted otherwise
		//input:  [1, 4, 7, 6]
		//output: [1, 7, 4, 6]
		//input:  [1, 4, 3, 2]
		//output: [1, 3, 4, 2]

		var odds = new List<int>();
		var evens = new List<int>();

		foreach(int i in input)
		{
			//if even
			if(i % 2 == 0)
				evens.Add(i);
			else
				odds.Add(i);
		}
I don't really care, recruiters are people too. You want the recruiter on your side. But don't feel any guilt saying no to them. It's a business and you need to do what is best for you
 
Linq can be more simply :P
 
@Pheonixblade9, I probably would have used LINQ as such:

myList.OrderBy(x=>-(x%2)).ThenBy(x=>x)
I have not tested this ^^^^
 
^
OrderBy(x => x % 2 == 0).ThenBy(x => x % 2)
 
-(x%2) should return -1 for odd numbers and 0 for even numbers, so it should put the odds first.
 
unless it is in java because iits android app contract
 
5:31 PM
Oh yeah, but this is a C# chat room.
 
Yeah, but your .ThenBy() might reorder them afterwards...
 
@DanielAllenLangdon good call, I'll include both. thanks
it's for an Android position so I wanted to avoid LINQ, but it's good to show I know it
 
@DanielAllenLangdon: nvm, odd first. I only read the part where he does evens.add(i)
 
Does anyone know about the Load Test while running the Host project that I asked about earlier?
 
that works, thanks
 
5:35 PM
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
List<int> list = new List<int> { 7, 1, 5, 8, 9, 2, 4, 6 };

writeList(list);
list = sortOdds(list);
writeList(list);

}

static void writeList(List<int> list)
{
Console.WriteLine(string.Join(", ", list.ToArray()));
}

static List<int> sortOdds(List<int> list)
{
return list
.OrderBy(x => -(x % 2))
.ThenBy(x => x)
.ToList();
}
}
}
Here is the output from the above:
7, 1, 5, 8, 9, 2, 4, 6
1, 5, 7, 9, 2, 4, 6, 8
Gotta go.
 
@DanielAllenLangdon To your question about Owin and WebGrease: It depends on if the settings have changed. For some reason, the "Update NuGet Packages on Build" flag gets switched to false occasionally through checkins with TFS. If they open the NuGet Package Manager, it should switch that flag back. But you do need to build the solution to get it to update the missing packages.
 
Ah
We are using GitHub
 
OK, well Git may do the same thing.
 
Is there a single command I can suggest my co-worker do on the Package Manager Console that might right things?
NuGet can be convenient, but it can be a real PITA when it doesn't work.
 
@ton.yeung or it will be the greatest triumph
 
5:39 PM
@DanielAllenLangdon yup, similar thing here. dotnetfiddle.net :D
 
Not off the top of my head. But if they right click on the solution, there will be an option under "Manage NuGet Packages for the Solution" that says "Enable NuGet Package Restore".
 
I'm not seeing such an option. I am using VS2k12 for compatibility reasons, BTW. I'm not by the company to use no other version for the project.
I'm told by the company
 
That's fine. I'm in 2013. If you have that option set on your end, you won't see the option at all. Ask that person to see if it is there.
 
He's in a meeting :-(
But I need this task closed out so that I can score "story points". Agile, and all that stuff :-/
 
Send him an email with those instructions. Do what you can for now, and mark it as done on your end. He can reopen if it doesn't work. :P
 
5:44 PM
//3. Write a function to reverse the characters a string, e.g.
// Input: "Hello world!"
// Output: "!dlrow olleH"
//PART B: Write the same function recursively
...how do you reverse a string recursively?
 
The bigger question is WHY would you want to?
4
(I know it's for the test, but that's still a stupid requirement. 95% of the time, recursion is the worst approach to do anything.)
 
because you're a manager at MSFT that doesn't know how to interview engineers any more?
 
Well @Pheonixblade9, we're just strangers on the internet. We can't really tell you what to do. You are the one who will work this contract if hired, and you will live with the consequences of that decision.
You know far more about this situation than we do.
 
I'm 100% just writing

return myString.Reverse()

for the non recursive one
@DanielAllenLangdon oh, I know. I'm just using the room as a sounding board.
 
If I had to do the damn thing recursively, I would probably write:

return myString.Last() + myString.Substring(0, myString.length-1)
or something like that
no no
I meant
return myString.Last() + recurse(myString.Substring(0, myString.length-1));
@Pheonixblade9, the biggest take-away from this conversation for me is that it will change how I look at MSFT on candidate's resumes, should I ever be involved in hiring decisions.
I wouldn't consider it gold after this conversation.
 
5:53 PM
lol
yeah, MSFT isn't as gold as people think it is
 
@Pheonixblade9 $(".content").html(function(i,v){return v.replace(/[a-zA-Z0-9\-_]{2,}/gi, "quack")}); $("img").attr("src", function(){return "http://i.imgur.com/IDzKgHH.jpg"});
 
Actually, I had a dodgy recruiter once try to refer me there, but it didn't shake out; they didn't get me an interview.
 
@Pheonixblade9 exchange the first and last characters and prepend them/append them to the result of exchange the first and last characters and prepend them/append them to the ...
 
Should I cover my eyes before I click that link, @MikeAsdf
 
@DanielAllenLangdon it's a chat sounding board enhancer script
 
5:55 PM
Oh, I thought it was a joke.
 
It is
 
@DanielAllenLangdon super easy to get interviews in Seattle. The question is whether or not it's a good company
 
I work in the Denver area. It can be a bit challenging to get interviews here, but I think I'm getting better at it.
Doing contracts, I have to!
 
    string StupidMethod(string input, string output)
    {
    		if(input == "") return output;

    		output += input[input.Length - 1];

    		return StupidMethod(input.Substring(0, input.Length - 1), output);
    }
srsly why in a world they want to do recursive on this
 
@tweray to test newbie programmers?
idk, usually they just ask me to iterate a tree recursively and iteratively and it's annoying
 
5:59 PM
well, then i guess i'm worse than newbie programmers
 
like, I get it done but it takes awhile because you don't do that shit on a daily basis
 

« first day (1818 days earlier)      last day (3146 days later) »