« first day (2753 days earlier)      last day (2199 days later) » 
05:00 - 19:0019:00 - 22:00

5:38 AM
what does localStorage does in jquery?
 
6:05 AM
Goood morning sharperinos!
LocalStorage stores things locally!
 
so between localstorage and session storage which one should I prefer?
 
That depends on whether you need persistent-storage or session-storage!
 
So I added Moq to my test project via nuget. How can I initialize the C# Interactive window with that? I wanna play around with moq
Wanted to do it manualy with #r when I didn't have the context menu7 option on the test project, but I can't find the Moq.dll :(
 
6:24 AM
ohayou
 
thanks Roel
 
good morning.
 
Morning Avner \o
 
6:48 AM
Anyone else have a relaxed day today? There's a national holiday tomorrow, so many people took the day off for an extended weekend.
Also, goddamnit german language:
 
@Squirrelkiller Does that translate as "bridge day"? The usage in Hebrew is similar, probably borrowed from German.
But no, today we have a version drop and it's anything but relaxed.
 
Yep, bridge day.
You probably dont have a holiday today, have you? Otherwise it'd still be relaxed.
 
We had a national Holiday last Friday. Also an extended weekend.
 
7:03 AM
@Squirrelkiller Nope. April was full of national holidays and memorial days, though.
 
How do I unit test a WebAPI controller?
How do I mock the HttpRequest?
 
We have the annual bonfire night later this week.
Another religious national holiday in a couple of weeks.
And then nothing until September.
 
7:23 AM
Hi,
How to find all `DataTable` members in a project ?
 
Find a DataTable, right-click on the type -> Find Usages.
 
Search in the box in the solution explorer view
For me it's ctrl+ü, don't know about non-german keyboards
 
@AvnerShahar-Kashtan there's no such Find Usages (I'm using VS 2017)
 
ctrl-k-r
 
@Squirrelkiller I want just Properties definition
 
7:27 AM
Then use solution explorer search bar
 
@Squirrelkiller it works
it find all fields too, but it's OK
 
Regex @"DataTable \w+ [{=]"
 
@MohamedElshawaf Might be a R# thing.
 
Ctrl-k-r is standard VS
But it finds all usages, not just the Properties
 
7:36 AM
OH, it's the same as Shift+F12
 
Great. I have an unmanaged component raising a "fatal program exit requested" mesage, which, well, exits the program even when surrounded by try/catch. :(
 
Better find out why then
Or get whoever made it to make it managed
 
It's an interop wrapper around FFMpeg decoding RTSP camera streams.
 
 
1 hour later…
8:56 AM
@Squirrelkiller it didnt work
she thought id tried to spit on her
 
9:09 AM
@Harry Did you say 'Hello' first?
(Or something)
I request a more detailed report!
 
i sang tom jones songs at her
i dont think she heard me
 
...plural?
 
the trap music was too loud
 
@Squirrelkiller It's "Hello there".
 
9:25 AM
"How u doin'?"
 
hey there darlin
 
!!giphy how u doing
 
hallo lieblin'
 
I think this is the first time giphy actually finds exactly what I was looking for
Liebling ist mehr für eine schon vorhandene Beziehung
 
9:32 AM
jesus you are german arent you
YOU MUST OBEY EXACTLY THESE RULES OF GRAMMAR OR ELSE A LECTURE SHALL BE ADMINISTERED!
(just kidding b x)
 
PRetty sure Jesus was from Israel or something
 
he was dutch
he smoked pure mary
 
*pure mary*

What's that even meant to mean
 
its young person speak for marijuana
 
9:38 AM
Whatever you'd like it to mean baby
 
steady on ;)))))
 
No spaces
 
It used to be fine with spaces
 
you have to format every single word
 
that's so retarded
 
9:39 AM
also not true
 
Indeed
 
10:12 AM
I have similar problem
But I am using post method and still getting it
 
10:28 AM
I just return Ok(requestedObject), hoping the media formatter (or whatever works the reverse way) does the rest for me.
 
I am getting 500 internal server error and when it was point me to the line xhr.send( ( s.hasContent && s.data ) || null );
 
500 basically means "an unhandled exception in the server".
 
What's || null supposed to do?
Pretty sure null isn't a bool
> false || null
(1,1): error CS0019: Operator '||' cannot be applied to operands of type 'bool' and '<null>'
@Breathing There's your error
 
what do you mean?
 
 ( s.hasContent && s.data ) || null
Why do you have null in there?
 
10:37 AM
it is an internal jqeury function
I saw it via console
 
Internal where?
 
What happens on the server though?
Does it get the request?
 
seems like it
POST 500 internal server error
my project runs fine on the other server machine though
 
Can you debug the server?
Because internal server error usually means the server has an internal error
Which means the server needs to get its shit together
 
10:46 AM
@Squirrelkiller it's javascript, which is fine with this sort of shenanigans.
 
Yeah I figured. Thought it's C#, until he showed me the screenshot.
The problem persists: There is a server side error, and @Breathing is looking client side right now.
 
Tom
Hey everybody. Got an EF question. Lets say I have a Customer-Entity. The Customer Entity is related to the Adress-Table via the navigation property Address, or AddressId (Guid). Lets say I want to change the address by assigning a different Guid to AddressId. I also want to keep the UI up to date by assigning the Address Entity the to Address-navigation property also. When I save the changes, EF detects the assigned Address Entity as a new Adress and throws an error of course, because it already exists.
 
...do you have EF and the GUI directly wired up?
 
Tom
No. The GUI just renders the models. The app is based on mvvm
 
So the GUI renders the viewmodel? Because that's not the actual model.
Wait why do you assign the address navigation property to teh adress entity
Do you make a whole new adress?
 
Tom
10:56 AM
The VM is bound to the GUI via DataContext. It's a WPF applicaiton, but this doesn't matter.

For example: The user can edit a customer. In a dropdown he can choose the customer address. The the user saves the edited customer-entity, I assigned the currently selected address to the customer. In the customer list, I show the address of the customer. Thats why I need to update the address entity also.

I could reload the whole customer Entity with its address, but would be unnecessary..
In make case it's not about customers and addresses, just an example.
'CurrentCustomer.Address = SelectedAddress;
CurrentCustomer.AddressId = SelectedAddress.Id;'
 
They have an Address AND and Id? You know that's not how database normalization works, right?
Address should com from Addresses[Id]
 
Tom
I do.
It's DB first. Address-Property is EF generated.
 
I just realized I became one of those assholes.
Sorry about that.
 
Tom
?
 
I assumed stuff and got impolite, that's not ok
 
Tom
11:09 AM
It's fine xD
 
I'm not sure why EF reacts that way here, but you could try another order, like assigning the Id first or something. Maybe SaveChanges() between them, to have it update itself.
 
Tom
Yeah that was my last attempt hehe. But when someone would edit the same customer again, this fails.
I mean if the user would edit the customer, save, edit and save again.
 
In terms of clean code and SOLID, is it a problem that there's a +1000 lines of code class, or lines number doesn't count?
 
@MohamedElshawaf A 1000-line class is a code smell. It doesn't necessarily mean there's a problem, but it's usually a good indicator of potential bad design.
 
I figured out
There is a log function that is supposed to create a folder in that server
Seems like I don't have permissions to do that
 
11:22 AM
I had a 500-line class here. A viewmodel class that had a lot of view functionality to handle. But it annoyed me.
 
@AvnerShahar-Kashtan it's a actually bad design, but wanted to make sure if lines count can be an indicator, (i.e. in a argument we can use how much lines in a class to refer to its bad design)
 
SLOC is usually a bad measure for anything because it's fairly meaningless
 
It's an indicator, but not a hard and fast rule like "300 lines = good. 700 lines = bad".
 
Aha
the 1000 lines class all switch-cases (disastrous class)
 
The reason I wanted to refactor my 500 line viewmodel is that it felt like it was doing too much, even though it was all the VM of a specific view. But then I realized I could take all the logic around showing filters and refactor that out to a different class - bam, that was ~100 lines out, and a logically distinct unit now in a logically distinct entitiy.
 
11:29 AM
Yes, refactoring is good but unfortunately managers don't believe in it!
 
It's not really something for managers to get into. Just like they won't tell you whether to use a while or for loop. It's just something you do as part of regular work on code.
Managers hate it when you add tasks/user stories called "refactor X". Because it doesn't look like something that has business value (and often it really doesn't)
 
But it takes time
 
hello nerds
there's a nice talk from uncle bob about refactoring
and why you should definitely just do it instead of asking managers for permission
 
@MohamedElshawaf Coding takes time. Refactoring existing code is just part of the ongoing coding process.
 
and definitely don't ask business for permission
because business don't understand programming so they will always say no :)
 
11:35 AM
If I come to class X to add new feature Y and see that it's a mess, I'll refactor X as part of adding Y. It's part of coding Y, not a separate task.
 
^ this x1000
boy scout principle: always leave the camp site in a better state than when you found it
apply that to code files
 
I've seen uncle bob in real life. Had no clue who he was though :D
I was still a student back then
 
What do people think about huge EF Seed methods? Do you shift the seed content into a different place?
 
@StevenLiekens That's a useful boy-scout rule to apply to programming, indeed.
 
Generally speaking, I've learned that business are usually right in that respect. If R&D open a whole task called "Refactor X", the main result is that X is probably less stable now and for no good business purpose.
"Refactoring" isn't a product feature.
Refactoring is a tool that developers use in order to build product features.
 
11:52 AM
Yeah, but do factor in refactoring work in your estimates if you know that feature X will need a significant amount of time dedicated to doing things in a sane way. Honestly, business (most likely) will not care about the state the code is in, so long as it works and you can add features!
 
Of course, but that's R&D's job as part of its work estimates, not something that a product manager needs to factor into the work plan as a separate task.
 
Indeed.
 
honestly if you work at a place where refactoring is a big enough topic to get the manager involved then either your code base or your business culture are shit... usually both
in a healthy project, refactoring is just a silent part of normal development
 
12:08 PM
actually if you do TDD then refactoring is a third of all development
 
Thankfully I don't do TDD.
 
me neither, we traded time spent refactoring (and writing tests) for time spent finding and fixing bugs
 
Eh, don't think that TDD is a silver bullet that solves bug hunting and fixing.
 
I'd say only about 20% of our issues are things that could have been prevented by automated tests
 
If you had complete covering tests for those specific issues to begin with.
 
12:12 PM
Have several classes with 10000+ LoC. Can confirm, they're shit.
 
When dealing with 10k LOC classes, one might be tempted to use partial classes to split it into several files. "I don't have time to do a logical refactoring, so I'll do a physical one". That's a bad idea.
 
please tell me they have badly named #regions all over the place
talk dirty to me
 
@StevenLiekens Regions? Where they're going, they don't need no regions.
(To hell. That's where they're going)
 
12:16 PM
@Mathematics Usually, when magazines publish editorial or commentaries, they don't feel the need to preface them with disclaimers saying they're not endorsing the opinions within.
That might mean something.
Ah, it's just because the site is republishing syndicated articles, probably automatically.
But generally speaking, when a headline uses evasive language ("jobs could be gone", not "will be gone"), I tend to treat it with care.
 
EVERY method goes like this:

public OurNumber DoSomething(ref instanceVar, ref otherInstanceVar)
{
  // [Yes, everything is pubilc. OurNumber is a magic number representing any c# number ofrmat but in this case a boolean.
  #region Locals
  DoSomethingLocals locals = new DoSomethingLocals();
  #endregion

  #region Actions
  locals.instanceVar = instanceVar;
  locals.otherInstanceVar = otherInstanceVar;
  try
  {
    doSomeUglyThingsWith(ref locals.instanceVar, ref locals.otherInstanceVar);
  #endregion
 
Bro. What.
 
*Omitted hungarian and some more ugly stuff for readability
 
Ah, in-method regions. Lovely.
 
I don't mind in-method regions generally. They have their uses. Just not like this.
!!giphy not like this
 
why is everything by ref?
 
because reasons
 
why is everything packed into a holder variable, but then passed in individually by ref anyway?
 
because there has to be a locals instance handling everything
there's usually also a hSqlX involved, (or hSqlUpd, hSqlDelete, hSqlInsert) that gets passed to a locals instance, and then ref-passed to the next method.
 
That's hSqlUpid.
 
12:25 PM
That's also the consent betweeen the *devs here
*There's now only two left: senior dev (who started with me) and me.
 
This is the sort of pattern used in C, when the whole concept of memory management and variable scoping was a lot more brittle.
 
When we started, it was 8 ppl I think
In this case, gupta
We call is Gupta-sharp. Have a whole folder of documentation.
 
1:26 PM
Now that more people are here, maybe someone can help me:
6 hours ago, by Squirrelkiller
How do I unit test a WebAPI controller?
How do I mock the HttpRequest?
 
@Squirrelkiller How much logic do you have in the controller?
How much are you relying on the contents of the HttpRequest?
In my last WebAPI project, we tried to avoid a lot of logic in the controller. It mostly called methods on the BL service layer.
 
pretty much jsut
if(accessor.IsValid(Request.Headers["token"])) return Ok(accessor.GetRequestedObject())
else return Unauthorized();
The actual IsValid call is also in the accessor
the controller jsut reads the token
 
The problem is, when instantiating the Controller, I can pass a mocked IAccessor, but I cant make the HttpRequest...
 
This seems to imply you simply set a manually created HttpRequestMessage to the controller's Request property.
 
1:33 PM
Wait tried that and it's get-only...let me check again.
For some reason, my Controller extends Controller and not ApiController, and http verbs return IActionResult. Is it possible I made a WebAPI (1) project?
I have
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
 
That's an MVC controller, not a WebAPI controller.
 
pretty sure I went new project -> as.net core -> WebAPI
 
Yeah, but AspNet core merged the two so your can have both MVC controllers and WebAPI controllers in the same project easily. But this, specifically, isan MVC controller.
 
Where's the difference? CLearly they can both turn HttpRequests into an HttpResponse
Woah. I just realized: VS2017 lets me change code WHILE RUNNING
Without break mode
I realized that when I wanted to start with my changes and couldn't, because it was already running
And I just realiized the difference, albeit only conceptual and not technical yet: MVC controllers for controlling view, api controller for an api consumed by whatever.
 
@Squirrelkiller Yup.
View controllers vs. data endpoints.
In fact, I think "controller" is a misleading term. Should have been "endpoint" or something.
 
1:47 PM
Anything on the technical side?
I guess 1) API Controller lets you set the HttpRequest, MVC Controller wont
 
> ApiControllers are specialized in returning data. For example, they take care of transparently serializing the data into the format requested by the client. Also, they follow a different routing scheme by default (as in: mapping URLs to actions), providing a REST-ful API by convention
 
My MVC controller came with a RESTful api too though
Pre-made Get/Get(id)/Post/Put/Put(id)/Delete(id)
Including a Route["/API/Values/] on each
 
ApiControllers have APIs that are more natural when building a restful endpoint. I don't use IActionResult/HttpResponseMessage. I simply define public async Task<MyObject> Get(int index) and return my object.
They're not very different, just fine-tuned differently.
272
Q: Difference between ApiController and Controller in ASP.NET MVC

VJAII've been playing around with ASP.NET MVC 4 beta and I see two types of controllers now: ApiController and Controller. I'm little confused at what situations I can choose a particular controller. For ex: If I want to return a view then I've to use ApiController or the ordinary Controller? I'm...

 
IActionResult lets me return a statuscode, optionally including an object, that's why I like it. I can return Unauthorized or not found messages easily.
 
You can do that with ApiController by throwing an exception.
Which makes a lot of sense to me.
throw new HttpResponseException(HttpStatusCode.Unauthorized);
So the standard code flow, with return, is resolved as a 200 OK status code. Anything else is an exception.
 
2:00 PM
Sounds nice. But I jsut tested it: Added an API Controller, then added an MVC Controller. Both are derived from Microsoft.AspNetCore.Mvc.Controller. The API Controller has http verbs though, while the mvc controller has index/details/create/edit/delete methods
 
Yeah, that makes sense.
 
Still can't manually set the Request though :(
How do I know whether I use WebAPI 2 and not 1? I'm in VS2017 Preview, maybe its only 2 now?
 
2:17 PM
 
Is anybody here who have use windows service?
 
hi guy
@Learning-Overthinker-Confused If you have a question, just ask it.
 
I have database on my colleague computer
 
2:20 PM
I once built a windows service from a turoial. Have since forgotten evreything about it.
 
so now while creating windows service which account i should select from below :
 
...your database is on a persons computer?
 
LocalService
Network Service
 
Why not a server
 
2:21 PM
@Squirrelkiller You're using ASP.NET Core.
 
My database is on my colleague computer
 
That's neither 1 nor 2. It's Core.
And you should check out the ASP.NET Core docs.
 
@Learning-Overthinker-Confused That depends on what the service does
 
Oh. Thought Web API 2 is like the next version of Core Web API
 
Service is accessing database
 
2:21 PM
If it acts as a server on the network, choose network service
 
@Learning-Overthinker-Confused Is this the SQLite shared network mapped thingy?
 
If it requires advanced permissions, you may want local system, otherwise local service
 
The one scenario for which SQLite clearly stated it should not be used, you're doing that, aren't you? Or was that someone else.
 
But database is on my colleague pc so i dont think localsystem would work
I am following this article to create windows service :
 
2:23 PM
@Learning-Overthinker-Confused then go for network service
And definitely research for yourself what the exact differences between those accounts are
 
Do you think i would be require to give any special permision on database level?
Later on i will be hosting this windows services on server and database will also reside on server
 
@Learning-Overthinker-Confused I don't see why you would
 
Ok i am selecting network account
331
Q: The difference between the 'Local System' account and the 'Network Service' account?

jmatthiasI have written a Windows service that spawns a separate process. This process creates a COM object. If the service runs under the 'Local System' account everything works fine, but if the service runs under the 'Network Service' account, the external process starts up but it fails to create the CO...

Thank you guys
Network service option worked
If database is on server and this window service will also be on server
then i will select localsystem>
?
 
AnywayGtgWedontgetpaidovertimeByebye
 
2:40 PM
@Learning-Overthinker-Confused Don't use local system unless you have a good reason. It has less security measures
 
LocalSystem has full control of the local system. It's for system services that need to fully control the machine - usually built-in Windows services.
LocalService has almost no permissions and is good for services that simply need to run locally and not affect system state.
Anything in between should be run with a dedicated user created for the task, which can be given fine-grained permissions.
 
3:07 PM
0
Q: Jquery Set Model Properties MVC?

Ram SinghI am using a simple code to bind model from Jquery. FYI, before jquery code was on view, now i am moving all the code to JS file. Before it was working fine. Here is my current code: View Page Code: var LoadPerformanceWidgetActionTabmodelDataToSendSA = '@Html.Raw(Json.Encode(new DPloy.Data.S...

please help me
 
3:28 PM
!!halp
 
@juanvan That didn't make much sense. Maybe you meant: help
 
disappointing
 
4:17 PM
Anyone have experiencing with Cloudflare and posting https to a MVC controller ?
I'm using Cloudflare universal SSL certificate, however when I post to my mvc project I'm getting "The requested resource can only be accessed via SSL."
 
@neildt Are you actually using SSL to post?
Also, isn't SSL deprecated?
 
I have the same project running on another server, with a purchased and locally installed SSL certificate and it works fine.
 
 
2 hours later…
6:35 PM
Hello people
 
Hello unfamiliar person
 
first this checking out the chat room on this site
nice to meet you I suppose
 
!!welcome-c# ZacharyLucas
or well maybe not
 
what's up?
 
6:37 PM
Nm just taking a much needed break from coding
 
Welcome to the party.
 
web development can be so annoying. I would much rather be dealing with unity/C#
 
I don't write much C# outside of work anymore
 
is there pizza at this party?
 
I prefer web-ish stuff
 
6:39 PM
!!pizza
 
I think that might be how it is for most people, whatever we do at work, we stop doing in our free time
 
CAP WHAT HAPPENED
 
@ZacharyLucas 🍕🍕🍕🍕🍕🍕🍕🍕
 
Damnit, you guys are making me hungry
 
!!are you alive
 
6:40 PM
Actually my codebase at work is so crappy, I seriously enjoy working on projects at home with C# how it's supposed to be used
 
and everything is closed too -_-
 
!!sandbox
Well that was stupid
 
FYI, I've pinged rlemon about the bot
ok, ping him too, idc
 
lol wish I'd seen that before pinging him in JS
 
oh, nice. That was my next idea after she seems dead in hte sandbox too.
 
6:42 PM
Programming in general still feel new to me. Im still in college learning more and more. Can anyone tell me what the job market feel like at the moment? I have to start looking soon
 
Anywhere in particular?
 
I haven't really been in the job market, but I hear there's lots of demand
 
BC. gonna get forced to moved there when Im done
 
In germany, great. Whne i finished my apprenticeship 3 months ago, offers started coming in.
 
Wish I could travel that far
 
6:43 PM
Boston is pretty absurd right now. It'd be great if I wanted to keep living here.
 
Must be nice in Europe
 
Well...it's like programming. Anything is possible. Just matter of resolve and resources.
 
that is true
 
@ZacharyLucas Are you also a fellow maple man?
 
I am indeed a product of maple
bron a raised, on the Great Lakes is where I spent most of my days
 
6:44 PM
Second question: do you watch Letterkenny?
 
no, no cable and no time to look up much
is it good?
 
absolutely legendary
 
maybe ill look it up later
 
cravetv is the primary place to get it online
 
SO what does everybody do here?
 
6:46 PM
nerd things
 
lol I can tell
who else would come here
 
@SterlingArcher
 
@ZacharyLucas like for work or more generally
Cause like
I exist
 
whodathunkit
 
6:49 PM
lol I was asking more for work. Just wondering
but exsisting good
existing*
 
Fintech.
It's boring.
 
Professionally, I poke at a large blob of C#, and glue back whatever falls apart
 
lol
sounds about accurate lol
 
The lol -> man drowning meme has basically broken me.
*lol* -> cheerleader drowning
i -> zombie
 
I seem to have hit the jackpot: Working in Fintech, poking at a blob as much as possible without anything falling out, while glueing on more stuff.
 
6:53 PM
That does sound pretty good
 
Also it's technically C#, but it's ported from gupta code written 25 years ago. The architecture sucks. No layer seperation.
Also, multiple inheritance.
 
sounds like a confusing mess
 
Pretty much. Forutnately, team lead is nice and knows exactly why we need 3 days to even locate a bug. She's hte one who wrote it 25 years ago.
Together with her now boss
 
Her now boss was great at documenting though. Like, 20% of the summaries on our mehtods are from her, and they really tell you everything you need.
On the other hand, you absolutely need those summaries, as you can't fathom what the hell those methods are supposed to do exactly so...we have some silver linings.
 
6:58 PM
I hope I get a boss like that at least
 
05:00 - 19:0019:00 - 22:00

« first day (2753 days earlier)      last day (2199 days later) »