« first day (1567 days earlier)      last day (3375 days later) » 

3:01 PM
Oh
I'm using @Roel's EF wrapper
 
as long as dispose is getting called somweher in there, otherwise you end up with dangling connections
 
Not sure it is
Will have a look through see if I can shove it in the context stuff somewhere
 
AHHHH it wasn't my rebase that broke the solution, it was rest#
thats 2 times rest# screwed me this month
 
public class Context : IContext
	{
public interface IContext : IDisposable
	{
Is that enough or does it need more?
 
yeah, so you need a using statement then
 
3:04 PM
Okey doke sorted
 
IContext is IDisposable, wrap all IDispo in using
 
Is there a way to make Context dispose itself?
 
If you don't need to make a context, don't make it. Use the available ones.
 
@RoelvanUden like passing the same one around as a parameter?
 
3:07 PM
@Sippy Yes.
 
you can make one context-per-request using an injection container
or, you can stick with context-per-unit of work
per-request is usually better with web stuff
 
so if i inject a context it'll get disposed?
 
Injection is more elegant.
 
your injector must handle the dispoition
 
3:08 PM
i don't have to explicitly wrap it in a using or dispose of it manually
@CharlieBrown awesome thanks
 
Unity has stuff built in for this, Ninject as well
I have examples of Unity if anyone wants them
 
castle windsor probably too...?
 
@RoelvanUden Oh, yeah
 
Probs, never used it myself
 
I don't have a context in every controller, I just have one in the base
For the extension method it isn't gonna make sense to pass a Context because the method is called from Layout
 
3:10 PM
Is the context injected in your controller?
 
"From Layout"?
 
@RoelvanUden Yeah from the shared layout
@CharlieBrown Injected?
 
DI
 
how is it defined?
 
public abstract class BaseController : Controller
{
	protected Context Context = new Context();
}
Lol just realised protected is pointless
Anyway
 
3:13 PM
yeah, scary sauce
 
:(
 
lol, im being dramatic
 
Any help appreciated
I need a sign ..
"Will code for tips"
 
So, anytime you use a Disposable as a field, you should implement disposable in the class
 
So BaseController needs an override for Disposable?
 
3:14 PM
yes, but wow, will that be ugly
 
public BaseController(IContext context) {
this.context = context;
}

then set up your DI container, and hook it to ... your controller factory in your global asax.... charlie says your DI container will dispose of it, in which case it'd be prettier
(i think controller factory, there are two ways of doing it)
 
Controller is already disposable
 
I literally have like 2% of an idea what dependency injection is.
 
you can do it easier than that as well @Steve
 
do you know what the factory pattern is?
 
3:16 PM
I'm still trying fruitlessly to get my head around it
Nope
 
@CharlieBrown yeah?
 
[Dependency]
public Context Context {get; set;}
 
oh no way
 
The constructor is nice, but then you need a new controller factory
 
@CharlieBrown oh i didn't think about that, yeah
 
3:17 PM
As long as your injection container is registered with MVC, that will wire up
 
i didn't even know that was an available annotation
 
Morning everyone.
 
gmorning sunshine
@CharlieBrown is that new since mvc4?
 
4 i think
 
I've just learned that Steve can MVC anyway so
prepare your anus for my interrogations
 
3:23 PM
lmao
what is this thing you call MVC, is that a new kind of dessert?
 
yes
compared to webforms it is
 
@Sippy It's easy. CakeFactory.CreateCake() instead of new Cake()
 
@KendallFrey What's the point/difference?
 
because of reasons
 
What would be in CreateCake()?
 
3:25 PM
something that creates a cake and maybe sets some important properties or something
 
it's so you don't couple "new cake()' to the class, this is useful for testing, among other things
you program to an interface
in setting up your DI container, you say "when asked for interface Ixyz, use class xyz"
 
I have no idea what a DI container is :3
 
I also don't do unit testing cos this place doesn't, generally.
 
but in unit testing, you can create (moq) a fake class that implements that interface, so you can test stuff without actually hitting your db, and having KNOWN values during unit testing
i'm not sure if i explained that well
probably not
 
3:26 PM
@Sippy Essentially you ask for a IContext when you need one, and the DI knows you registered Context as IContext somewhere and gives you that. If you ever need to swap the Context implementation, you just change how you wired it up and you don't touch other files, ever.
 
^ that too
 
@RoelvanUden Hmm.#
 
Every time. Go Inactive as soon as I start typing.
IM is wundurfol
 
I just installed Visual Studio 2013 Community edition on a new computer and I don't have intellisense?
as in like I write Console. and I don't see the options... :(
 
heyyo
 
3:33 PM
@Sippy Dependency Injection is a scary term for something simple
i wonder if in 1000 years somebody will find a hard drive encrusted in rock, with our chat messages on it.... man would they think humans from this era are weird
 
@kush make sure intellisense in on in options, sometimes it gets turned off on its own
@kush Tools-Options-Text Editor-All Languages-Auto List Members
 
@CharlieBrown ah it is not a check mark but a square
perfect!
thank you c b
 
@Steve Hahahaha hard drive, physical world, so ancient!
 
:p
"wow, these early humans had a fascination with each others mothers"
 
Maybe the concept of parenting will be gone by then
They'll all be genetically perfect clones
 
3:41 PM
possibly
 
@Steve That reminds me of a lonely island song
 
"This race built us. Us. The absolutely perfect being, the machine. I feel sad now."
 
how long do you think the internet will last? 100 years? 1000 years? what will it look like in 1000 years
 
"each other's mothers"
@Steve cyborg kittehs
 
i am legitimately fascinated by my question though
i mean, what will it look like, will it be like that 'bating, go away' movie
 
3:42 PM
At some point they'll finish up neural implants and the internet will be in your brain
 
In 1000 years, the singularity will be long past
We'll either be dead or made of silicon
 
you think people would accept neural implants?
 
I fukin would
 
@Steve People already have all sorts of implants
 
Sucks if you get a virus though
 
3:44 PM
@Sippy yeah well, it does now too
 
@KendallFrey BCIs are still in their infancy though
and not everybody would be willing to do that, so would they just not get to use the internet?
@Sippy lol didn't even think about that
 
Existence of implants doesn't necessitate the non-existence of computers lol
I did a load of shit to do with consumer computing ethics and this was one of the things the lecturer brought up
 
@Sippy Implants will be nothing but a microprocessor and high-speed wireless link
 
@Steve A 1000 years is plenty to brainwash a ton of future generations
 
But remember, they figured we'd have flying cars by now
♪ We could fuck each other's mothers (fuck each other's moms) ♫
goddammit Steve
 
3:50 PM
lol
@RoelvanUden they aren't already brain washed?
lol
just gotta flick on fox news
DON'T TALK ABOUT POLITICS STEVE
 
@Steve Aha! But not everyone does that now! Just 99%!
@KendallFrey We have flying cars. 2 of them!
 
using ProjectB;
newds = ProjectB.DataLayer.Users...
After Users intellisense should pickup an existing method.. but is not finding it..
public DataSet AuthenticateUser(string username, string password, out bool ValidUser) {
ie. newds = ProjectB.DataLayer.User.AuthenticateUser(..)
 
I do not understand the point of a touchscreen laptop.
 
22 mins ago, by Charlie Brown
@kush make sure intellisense in on in options, sometimes it gets turned off on its own
 
it finds everything else though.. what do I do?
 
3:58 PM
oh
is the method public
 
yep
 
A tablet with a detachable keyboard I get. Laptop with a touch screen makes no sense.
 
do you use an interface and forgot to change the interface to match the implementation
 
probably @Steve lemme look
 
@JoJo Users is a collection
 
4:01 PM
like this? public class Users:DataLayerBase
I see.. I will research
 
is Users with an "s" a class name?
 
yes this is the sig: public class Users:DataLayerBase
 
@SpencerRuport If the screen can rotate, it's nice too.
 
Ok, ignore my last comment then
 
4:08 PM
they are nice for multi threaded
 
It's indeed nice, but I want easier syntax :P
 
why do css glyphs fuck up in chrome
not a clue
 
they do?
which glyph?
 
a custom one
 
"You did it wrong!"
 
4:10 PM
probably
but why is it wrong? :(
(dont answer that)
or
whatever
you know
it only does it at 100% too, 110 works, 90 works
damn you Murphy
 
@RoelvanUden - True. My laptop can't do that though :(
 
jeez 4 w-2's to enter this year
thats the annoying part of contracting
 
Not using an umbrella?
 
Yeah taxes are way more complicated when you have multiple clients/employers
 
@SpencerRuport I have one that swirls around and can put the screen down. I use it mostly in reversed screen position with touch screen to play visual novels. It works nicely for that purpose.
 
4:16 PM
I had to contract for the first few months of this job, I just paid someone to deal with all the taxes and stuff
Was like £80/month
 
I just use Turbotax. Makes it pretty easy.
@RoelvanUden - Yeah I wish mine would do that.
I'd be playing angry birds all day ;D
 
Yeah, Turbotax rocks. Been using it for 8 years now
Just noticed one contract never took Mu^&#%$#$% state taxes out. Definitely not contracting for their shady asses anymore
 
I'm not sure if I took too many deductions last year
Knowing my luck I probably did. I don't think it'll be a ton of money but I doubt I'll be getting a refund.
 
Also, read The Martian if you havent already. amzing
 
4:31 PM
> Length: 385 pages (Contains Real Page Numbers)
Is that dietary advice?
 
Fake page numbers give you gas
 
I have to first dig my kindle out... I hope i didn't leave it in some hotel
 
ugh, TFS is fucking stupid
I deleted a file, then undeleted it. TFS still thinks I deleted it. How do I get into its thick skull the file is still there?
 
@KendallFrey can't you just add it as if it is a new file? didn't use tfs for a while
 
Hi All,
i have a question about an MVC C# application i am working on
 
4:42 PM
delete the file again and then undelete it with TFS
TFS is terrible at version control
 
every time i start the website it takes long time (+30 seconds) to load the website
where should i start the troubleshooting
???
 
First start will compile the templates. are the pages slow after that?
 
once it's loaded it's fast
 
Thats normal
 
no the pages are not slow after that
 
4:44 PM
MVC compiles the view on first use, after that its fast. You can force precompilation on build if you want
 
"precompilation on build" bot familiar with this but i will do my homework
thanks for the guidance
 
i think there is some autostart module in IIS that can warn-up your app pool before someone hit it right?
never used that though
 
for app pools, yes thats typical to use with farms
wont fix the mvc issue though
its not normally a problem, unless your mvc site doesnt get a lot of traffic
 
I see
 
4:46 PM
how they deal with this issue for big websites (yahoo.com , microsft.com ...)
 
I worked at Huggies.com and Kleenex.com... we precompiled on build
 
That's great
thanks a lot for th einsight
@tweray thanks for the link
 
np
 
Isn't the point of a release candidate to allow you to test existing code and/or get a jump on development? But deploying said code into a production environment with the RC of an external library is bad practice right?
 
Hey @CharlieBrown i have another question for you if that's ok
 
4:49 PM
yup
 
I feel like this is wrong:
 
@CharlieBrown With View models, can you just make the view model inherit from a data model?
 
            var response = String.Empty;
            var request = WebRequest.Create(google) as HttpWebRequest;
            request.Method = "PUT";

            if (request != null)
                using (var stream = request.GetResponse() as HttpWebResponse)
                    response = stream.StatusCode.ToString();
 
That way it has all the shit you need in it
And you can add some extras
 
@Sippy yeah, you lazy developer, you could
 
4:51 PM
If your simply submitting a URL for instance and want the response, that should be okay right? It doesn't look right though.
 
Or do you have to literally copy and paste your data model into the view model and then go from there and write a mapper
I'm still gonna have to do that anyway
Cos need data annotations
laaame
 
        request.Method = "PUT";
        if (request != null)
That doesn't make sense.
 
@Sippy automapper can do like 90% of the mapping job
 
If request is null the prior line is gonna throw a null reference exception.
 
@tweray Never used it
 
4:52 PM
@CharlieBrown here's the scenario: the MVC project i am working on right now has two final "Customers" each one has it's own static pages (Home, contact us, about ) and each one has its own SQL DB . but they share the main functionality. rigth now it's very hard for me to deploy the app and switch between the 2
should i keep everything under one solution or have two different solutions?
 
basically as long as property name are the same, it will just map it for you
 
@SpencerRuport ?
 
you just have to deal with the mismatches
 
@Osadellah could go either way, but i would prob split the web parts out to 2 different web projects
 
Oh
Interesting
Thanks
 
4:54 PM
@Greg - What?
 
What doesn't make sense?
 
> If request is null the prior line is gonna throw a null reference exception.
 
I see and i like this idea. right now i have one solution and multiple projects
 
@SpencerRuport Oh, that should be in the request != null
 
so i will add one website project for the other "Client"
 
4:55 PM
@Osadellah - Are the only differences between the clients which database they connect to?
 
@SpencerRuport databases, static home pages (including logos and some themes) , dropbox account (I am using dropbox api)
 
ive built some sites with a theme system to switch between clients, and its waaay easier to just have separate projects.
 
@CharlieBrown when i was reorganizing my solution and dividing it to projects (Common, Data, Business, websites...) it was hard for me to extract the views from the websites project (For instance : dropbox controller is a common feature, the related views are now under the websites project and not the Common project)
is that normal
??
 
normal
 
so keep all the views within the websites project
 

« first day (1567 days earlier)      last day (3375 days later) »