« first day (3013 days earlier)      last day (1934 days later) » 
00:00 - 19:0019:00 - 00:00

12:03 AM
hello
is it possible to join two tables with a where id= @id (parameter)?
 
ehm... what?
 
var changeContro_test = db.employeenewchanges.SqlQuery("select * from employee a left join employeenewchange b on a.emp_id = b.emp_id where a.emp_id = @Id",Id).FirstOrDefault();



var RehireModelDetails = new RehireModel
{
emp_id = changeContro_test.emp_id,
emp_namefirst = changeContro_test.emp_namefirst,



};
 
sure. it's possible.
 
12:40 AM
Woow... I've spent lots money last year...
 
1:12 AM
Someone knows about web development? I know some Python, C# and Javascript. I want to deploy a website which must to connect to a MySQL v5.7 database. I like to use Visual Studio. Should I use Django 1.11 or ASP.NET Core 2.1 MVC? Both are supported by VS. Or maybe another framework like Node.js (if possible, also supported by VS)? I know this question is a bit broad...
 
1:31 AM
I use Mysql with C# Form
and I also already developed web application with C#.
I think Asp.Net is enough for your purpose.
 
 
5 hours later…
6:57 AM
@EnderLook meh, take your pick. you could easily write a web application using any of these technologies
anyone who tells you that "bleh, don't use that language" is simply someone far more comfortable with one particular language
 
7:26 AM
Hi Folks,
I have an enum with synonyms (different names sharing the same value, for example my enum "Units" contains "Voltage" and "V", both have value of 0, and "Current" and "I" both have value of 1). I already know that It might happen that Enum.GetName(Units, Units.Voltage) returns "V" instead of "Voltage" (see remark here: https://docs.microsoft.com/en-us/dotnet/api/system.enum.getname?view=netframework-4.7.2). However, the same seems to be true when I query ALL names using enum.GetNames(). However, a remark is missing on https://docs.microsoft.com/en-us/dotnet/api/system.enum.getnames
Is there a way to get such a list f unique enum names, even though their values are not unique?
 
ohayou
 
Is not the default constructor created by default?
 
@QuicoLlinaresLlorens the name is a bit misleading admittedly..
default constructor is created when no parameters are passed to it
 
I just have a sealed class
with a constructor without parameters
and I try to create without parameters and it is complaining about it
 
7:42 AM
@QuicoLlinaresLlorens well that's calling the default constructor I think
what error do you get?
 
There is no argument given that correspond to argument X
 
@QuicoLlinaresLlorens what is argument X?
 
There is no argument given that corresponds to the required formal parameter 'address' of 'ProxySettings.ProxySettings(string, int, string, string, string, bool)'
 
well argument X is referring to something
 
8:25 AM
Good morning.
 
morning \o
 
8:55 AM
Heyo
 
9:27 AM
Gúten morgebn
My AltGr u isn't the umlaut :(
 
@LeeButler For shame!
 
Blame british keyboard layouts
 
i have question i need to cound the length of subs where the identifier=iolinkmaster using linq var ports = tree.Data.Subs.Count(x => x.Identifier.Equals("iolinkmaster"), new {Count = });
how can id o this i really forgot
 
What the hell is that screenshoit
Like what are we looking at
 
9:37 AM
object thats looks like that, it has an identifier and array of subs
i want to count the number of subs only for specific identifier
 
But the identifier isn't part of Sub is it?
 
nop
 
So... wtf
 
subs and identifier are parts of an obj
 
Subs.Count() There you go
 
9:39 AM
var ioLinkMaster = tree.Data.Subs.Single(x => x.Identifier.Equals("iolinkmaster"));

ioLinkMaster.Subs.Length;
 
V.7
Depends on their types
 
This doens't make any sense
 
V.7
 
@V.7 thx mate i solved it
 
9:55 AM
I can only answer a question if I understand it
 
 
2 hours later…
12:24 PM
hello ppl and squirrels
 
lol wtf is wrong with that weirdo?
I hope he gets banned for that
wtf wrong with you man @J.Doe
 
Theres a lot wrong with that guy.
 
12:42 PM
Hello!
In mvc core with Identity, how can I add Identity cs files to my project?
I managed to add razor files but I want to add the reset of the Identity system
 
1:04 PM
Noob, you may want to ask that question in the MVC room: chat.stackoverflow.com/rooms/160742/asp-net-mvc
 
 
2 hours later…
2:35 PM
Morning
 
ok thank you Alex!
:D 2 people in that room
 
Got a new jerb
 
good jerb
 
just get the jerb done
 
2:53 PM
:)
It's been a while since I've been on this chat
 
mr5
Can anyone explain how to solve this recursion?
 
lol
 
mr5
While we all know that the answer is 3, I would like to know how to solve it using the system the mushroom boy is using
 
@mr5 subtract first, then borrow
or just learn what 18-9 is
 
mr5
@KendallFrey wrong answer
you will join the struggling of that mushroom using that approach
 
3:00 PM
Oh dear leader please tell me what your answer is and why it's right
 
mr5
I don't know the answer
but I know it's wrong
 
What would it mean for an answer to be right?
 
mr5
5 mins ago, by mr5
While we all know that the answer is 3, I would like to know how to solve it using the system the mushroom boy is using
 
I don't see how that answers my question
 
mr5
I mean, I want to know how to solve it using that system
how would you continue by doing this:
 18
- 9
__
  -1??
 
3:05 PM
I have no idea what you want
 
@mr5 You take the 10 from 18, and apply the -1 to that
 
What are the rules?
Why exactly is my answer wrong?
 
But that's not how they teach
That system assumes that you know how to subtract x and y for x < 20 and y < 10
It's not a recursion, x < 20 && y < 10 is your end condition for the recursion branch.
 
mr5
@KendallFrey that method was not taught to us in grade school. I really don't think it's technically wrong but I want an answer that sticks to the system
 
WHAT IS THE SYSTEM?
 
3:08 PM
system of a down
 
@KendallFrey That method for long subtraction
 
Hello, I've got a question about unit testing. Is it possible to mock an object if the object is local to the function I'm testing?
 
mr5
idk what it's called
 
Example: I want to test void MyCoolLibrary.SendEmailMessage(string recipient). This function creates a SmtpClient object, and uses it to send a preformatted email message to the recipient. I would like to mock SmtpClient so that, instead of sending an email to an actual SMTP server, it writes the email message to a buffer in-memory, which my unit test can examine later.
 
@mr5 I don't care what it's called, I want to know what the rules are.
 
@Kevin You can't mock it if the function does a new SmtpClient inside of it
That's why newing nontrivial objects is bad practice.
 
I have an answer in there as well :P
 
I googled around a little bit and the most common approach seems to be: make the client a public property of the class, so you can set it to the mocked object before calling SendEmailMessage
 
you gotta use it as dependency, inject it through constructor
 
mr5
@KendallFrey the rule is, if the subtrahend is greater than minuend, you borrow from next right digit
 
3:11 PM
@Kevin Make the class accept an SmtpClient in the constructor (or, if SendEmailMessage is the only method to use it, add a parameter to SendEmailMessage itself)
 
@Teomanshipahi Yeah, or that. Both of those approaches change the public interface of the class I'm testing, which I'm not crazy about.
 
Then you can pass a mock in your test.
There is an alternative
 
@mr5 What I said doesn't violate that rule.
 
If you have a new XYX(); for a concrete implementation, there is something wrong
 
That can't be the only rule, then
 
3:12 PM
Make a protected method getSmtpClient that itself does new SmtpClient()
And create an extending class that returns a mock, and run your tests against that class
I would not do it, mind you, unless I had no other choice.,
Changing the public interface of the class is preferable in my books.
 
mr5
@KendallFrey well, can you explain more on this?
 
Presumably you're asking how to subtract 9 from 18 without knowing in advance what 18-9 is
 
@Kevin ew, mutable objects
 
So what I suggest is to start with 8-9 instead
 
Please direct your disgust at the first two google results I looked at, rather than me
 
3:14 PM
@Kevin Your solution is dependency injection.
 
mr5
@KendallFrey and that would result in -1
 
There are tricks, and hacks, and workarounds, but those are not solutions.
 
@mr5 It could, yes
 
@mr5 Now you borrow the 1, and get 10-1
 
@Kevin I dont direct my disgust at you, just at... the atmosphere
 
3:15 PM
Another way to do it is to use 8-9 = 9
 
mr5
@MadaraUchiha how did it become 10?
 
and then borrow, which removes the 1, leaving you with just 9
 
@mr5 You borrowed the 1 from one place ahead
 
@mr5 By removing the 8 from 18
 
mr5
wait, where did the 8 comes from?
 
3:16 PM
the 18
the least significant digit, to be precise
 
mr5
how did the -1 do that?
 
do what?
 
@MadaraUchiha Mm hmm, that's the impression I'm getting. I'm just trying to reconcile it with good design practices. In particular, encapsulation. Ideally, the caller of SendEmailMessage wouldn't need to know the nitty-gritty about what is actually necessary to send an email. I'm tipping my hand by making SmtpClient visible to them in any way.
 
mr5
I'm still at the -1 difference part
 
split 18 into 10 and 8
 
3:18 PM
@Kevin Does the caller of SendEmailMessage need to know how to construct the class of MyLibrary?
 
8-9 is -1, and 10-1 is 9
 
Quick maths?
 
mr5
@KendallFrey where did that rule comes from?
 
It's a static class, so it shouldn't have to be constructed
 
@mr5 It was invented to allow long subtraction to be easily calculated
 
3:20 PM
enters chatroom
reads transcript
!!giphy homer bush
 
mr5
@KendallFrey I don't think I'm following you
 
@mr5 I don't know what more you need
 
This discussion about subtraction is looping infinitely, much like the subtraction algorithm itself
 
@mr5 18 - 9 = (10 + 8) - 9 = 10 + (8 - 9) = 10 + -1 = 10 - 1 = 9
 
mr5
3:22 PM
@MadaraUchiha did your teacher in grade school really taught you about that (10 + 8) part
 
I'm not a very good example of that
I understood ± number bases at that age, so I knew what moving digit positions meant
 
18 - 9 = (9 + 9) - 9 = 9 + (9 - 9) = 9 + 0 = 9
 
@mr5 I'm pretty sure my teacher taught me 18-9, so we're well outside the realm of reality here
 
Also this ^
 
when I was young, I used to calculate this way:
4 + 5
= 5 + 4
= 6 + 3
= 7 + 2
= 8 + 1
= 9 + 0
= 9
(bearing in mind, I was 5 years old)
 
mr5
3:26 PM
well, I don't know anymore if that method is still part of the system
 
If it's not, what is the system?
 
mr5
the system I'm referring to, as far as I remember, has only two rules: 1.) if the subtrahend is greater than minuend, you borrow from next right digit, 2.) for every time you borrow, you concat the number 1 to the borrower
 
@mr5 Yes, and then you subtract 1X - Y = ? in your head.
 
@mr5 That's the same system I described
 
Again, that's the ending condition
 
3:29 PM
And the same one the mushroom is using
 
mr5
@KendallFrey but you introduced a new method
 
What method?
 
mr5
splitting the numbers
 
That's already implicit in your rule #1
"the if the subtrahend is greater than the minuend" where the minuend is implied to be 8, not 18
If not, then you need to be more explicit
Your system also doesn't mention anything about subtraction, but I assume you'll want some of that at some point.
 
@Teomanshipahi Can you elaborate on this? When should I use new?
 
mr5
3:34 PM
@KendallFrey basic arithmetic rules from 0-9 are considered in that system.
 
So that includes 8-9?
 
If I can't have new in concrete classes, I guess I'm supposed to limit them to abstract classes? But that doesn't sound right to me.
 
mr5
first rule
 
I was expecting a "yes" or a "no". "first rule" does not give me the information I was looking for.
 
@Kevin says who?
(I might be missing context for this statement)
 
mr5
3:38 PM
@KendallFrey Yes. But you would end up not following the first rule I guess
 
OK, so under the system, what is the result of 8-9?
 
@MikeTheLiar Says chat.stackoverflow.com/transcript/message/45071818#45071818, but judging from your reaction I expect I'm overgeneralizing the point that's trying to be made
 
mr5
@KendallFrey well, I'm really not sure what to answer. Having a larger minuend wasn't really taught when that system was introduced to us
 
@mr5 Oh, then I think you meant to answer with "no"
In that case, if presented with 8-9, you have to borrow.
 
mr5
3:43 PM
I have just learn the ± when I was actually in highschool (yeah, pretty bad at Math)
 
@Kevin yeah, the takeaway isn't "never use new in a concrete class" because that's just silly (and impossible AFAIK)
But an object shouldn't be in charge of creating/managing its dependencies.
 
@mr5 You learned how to subtract in... high school?
 
I learned how to multiply in high school. No one would help me though, so I just got a lot of practice on my own.
 
mr5
@KendallFrey no. signed numbers. I was really just making arithmetics using memory
 
Oh. Well you don't need signed numbers if you borrow.
 
mr5
3:45 PM
there was no particular logic when I do arithmetics back then
 
What qualifies as a "dependency" here? My email sending class also uses a StringBuilder in order to efficiently concatenate strings. Should I expect the caller to pass that in too?
 
mr5
@MikeTheLiar hard times. Mathematician would not be able to relate
 
@MikeTheLiar Multiplying by 1 gets you nowhere
 
@mr5 they were hard time indeed
@Kevin it's kinda a "know it when you see it" situation
"Anything that might cause failure/errors that is not the fault of the class itself"
 
i'd extract anything that the class doesnt want to care about
 
mr5
3:49 PM
I only memorized the multiplication table (from 1-10) in 4th year HS
 
what we used to see in our applications is a lot of ConfigurationManager.AppSettings["blablabla"]
 
mr5
@KendallFrey so, how would you continue with -1 from this?
 
even tho the classes that had them shouldnt want to care where the values came from
 
@mr5 so you went to American public school, yeah?
 
@mr5 Add -1 to the remaining 10
 
3:49 PM
as long as they have values
 
mr5
for additional context with my question, it's kinda, I have just "understand" arithmetic recently.
 
Perhaps for my purposes "anything that I might want to mock out later" is also a good criteria
 
mr5
@MikeTheLiar nope. I'm not really a smart person but I have just started to have that "aha" moments recently, so some of my questions are kinda off at this age.
 
"Things that cause side effects" being a sub-category of that. Things that write to email/db/files.
 
@Kevin I think that's a perfectly good baseline to start with
You shouldn't be unit testing external servers
 
"Learn from base principles" doesn't help him get shit done.
 
I'm moderately familiar with dependency injection in other languages, so actually implementing the thing is fairly straightforward. Convincing myself that I should implement the thing is the trick :-)
 
!!afk meeting
 
mr5
@KendallFrey but then you are subtracting from two digits already
 
If you are asking where to use new or not, then you need to get more familiar. my humble opinion.
 
3:56 PM
@mr5 You only need to know 10 though, not any other number
 
mr5
@MikeTheLiar nice. I have learned a new word "sodomize"
 
@mr5 MikeTheLiar is afk: meeting
 
mr5
can the regular users get that feature as well?
!!afk true
then Cap will set User.Afk = true
@KendallFrey what if it's not capable of knowing that 10?
 
Then you need a different system, obviously
 
This Composition Root concept is wild to me. So my application entry point needs to configure every class in my project that has a dependency? Every time I've written a class that touches a hundred other classes in my project, I've regretted it
 
4:22 PM
@Kevin If your class touches a hundred other classes, your class does too much.
 
But that's what stackify.com/net-core-dependency-injection is telling me to do. Create a Composition Root, which configures every dependency in my project in one place.
 
use autofac and create modules?
just gonna leave that there
 
Whenever I read an article about Hot New Design Patterns, I can never tell if it's all academic theorycrafting, or if people actually use them. How many of you regularly use inversion of control, composition roots, and autofac in your projects?
 
you might as well say that OOP is a meme
 
You dodged the question quite expertly ;-)
 
4:37 PM
:^)
no of course I use it in a bunch of projects but I am just an anecdote
 
I'm just trying to make sure I'm not falling into a rabbit hole of obscure tech and not-really-used-in-practice practices. I'm hearing "if you want to do X, you should use Y" and "if you want to do Y, you should use Z" and "if you want Z, use Q" and I don't want to come in a week from now with a question about Q only to get "Q? Nobody uses that any more"
 
well IoC has been around for a while now and it makes life easier thats for sure
 
Where's that link about javascript frameworks
 
I'm four calls deep in the technique/software recommendation stack, and if any of those calls sent me down the wrong path, I'm doomed
So. Recap. If I want to unit test a class that depends on SmtpClient, I should install Autofac. Correct?
 
yesterday, by Avner Shahar-Kashtan
@Wil You should read this, then. To see you're not alone. :) https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f
 
4:44 PM
Autofac is just a library for DI though
You don't have to use it, you can use the asp core DI, you could use other libraries
In case you do and you have ISmtpClient you dont actually test it sending emails right?
so most likely you would want to mock it the SmtpClient and test the services that use it
 
That's the idea, approximately
 
yea so obviously you see the benefits and how easy it is to decouple and test
on a personal note I enjoy to use pipe/process design patterns with DI because I can write more classes and not actually configure my collection of pipes or processes to have this class and it gets automatically added
 
"easy" being a relative term when I need to refactor 100 existing classes and turn them all inside out
 
yeap if you dont start it in a certain way its pretty much impossible to change things
 
4:59 PM
Hey guys / gals. What's the argument (assuming there is one) against using SPROCS in MVC in favor of LINQ / edmx files?
Also is there a more modern approach besides edmx files? I did a short project in core that didn't support them and it required the DB to be scaffolded via command line, but I don't know the implications.
Any discussion and / or links would be appreciated.
 
But perhaps I'm being unreasonable. I'm not going to find a one-click solution to unit testing 100 classes. Man-hours consumed is O(N) with respect to the number of public methods, and it stays O(N) whether I need to refactor each class a little or not.
As long as the refactors don't require me to comprehend the business logic of the application as a whole, which is O(N!!!)
 
are these chats still as dead as ever?
 
!!tumbleweed
 
We can go back to talking about 18-9 if you want, I feel like I didn't get my say in that convo
 
5:15 PM
about age?
 
The original context didn't mention units, but I guess it could be subtracting ages, sure
 
This that meme?
Mushroom subtracting 9 on 18
But what is the problem
 
Approximately, "is it possible to solve this problem if borrowing is the only technique you're allowed to use?". The consensus being, "no", with some dissenters saying "are you sure? I'm pretty sure I solved problems like these in elementary school"
 
Yes, it is using borrowing technique from the base of ahead, so it is still same because it was 18 not 28.
But it should not the problem, because it is still countable using 10 fingers
 
Or we could go back to discussing the benefits of LINQ over Sprocs and what the best practice is so my boss doesn't force me to use 20 year old techniques on my new MVC project. Please send help!
 
5:31 PM
@SeventhSon db vs linq is still on going debate
Which is nonsense cause its better to write c# than sql
Always
Forever
 
Why is C# better than SQL? Conversely, to make a change in the data-set, in some scenarios I don't need to release an entire application, reset the worker process, hose sessions, etc. I can just modify the data set.
Although I don't agree with this statement, it's the rationale that has been presented to me.
 
Well its pros and cons. I was just kidding about better
 
I like LINQ and entities because they just seem sexy, and passing around data in data tables or loading it into entities from a Sproc seems antiquated.
 
Sql is faster cause you dont go out and in out of the db
And c# is more maintainable. Its more modular, compilable
Can be dependency detached
 
Well you still have to go out to the DB either way. LINQ isn't necessarily slower in that regard.
I don't know what "dependency detached" means
 
5:38 PM
guess I was wrong ._.
howdy all
 
Any ideas why my task isn't being cancelled after 500ms
List<Task> tasks = new List<Task>();
CancellationTokenSource cts = new CancellationTokenSource();
cts.CancelAfter(500);

foreach (Models.Channel.IChannel channel in channels)
{
try
{
tasks.Add(Task.Run(() =>
{
if (cts.Token.IsCancellationRequested)
cts.Token.ThrowIfCancellationRequested();

channel.Data = channel.RequestOffers(new Models.Request.AvailabilityRequest()).Result;
availabilityResponse.Agents.Add(channel.Name);
}, cts.Token));

Task.WaitAny(tasks.ToArray());
}
catch (Exception ex)
{
log.Error(ex);
 
It means i was told to switch databases last week from msswl to snowflake warehouse and it wasnt too bad
Mssql*
Took me a couple of days to modify my code
 
Ooooohhhh. I see. So EF doesn't really care bout the data source?
Interesting. My boss would say "that's never going to happen so..."
 
Yea i said the same until last week
 
Lol
You don't have to convince me, honestly.
So, OK, should I be using ADO / edmx or is there a better way?
 
5:42 PM
I know. I think the old generation really likes sql
 
I am the old generation, but yeah, boss is a bit older.
 
Well ok
I use dapper but its a matter of taste
 
I've heard of it, but know nothing.
 
@neildt From what I remember cancellation isn't guaranteed at any point in time.
A Cancellation request is just "whenever you get a chance, stop working on whatever it is you're doing"
 
Strange, because if the task is running for say 2 seconds, you'd expect it to cancel if the CancelAfter is 500ms
 
5:49 PM
Linq is slow compared to Sql even on parallel, do expensive operation on Sql first and then Linq.
 
@neildt I'd start with reproducing in a MCVE
 
@nyconing Maybe, but expensive operations aren't the norm, 95% of your DB operations are going to be basic CRUD.
 
Worrying about raw SQL vs Linq/EF execution time is like the definition of premature optimization.
Don't solve problems you don't have yet.
 
Basically, I have the following

- Web Api receives JSON request
- Controller fires off tasks
- When first task is completed we return result to request (with a unique id)
- This completed task is saved in cache/memory with unique id
- As other tasks are completed, they are saved against this unique id (in cache/memory)
- The requester can then poll again using the unique id to get the the new response with all the completed tasks
 
Hence "reproduce in a MCVE"
That's a lot of moving parts.
 
5:54 PM
ok :)
 
does anyone know if code reviews in visual studio have their approval status reset after a code update?
 
Like, through a TFS plugin or something?
 
!!tfs
 
Sep 21 '15 at 13:02, by Caprica Six
@codebrain TFS I've heard it stands for team foundation server, but having used team foundation server, I now know it stands for Total Fucking Shit.
 
6:00 PM
rofl
 
I know next to nothing about TFS so I can't help, sorry.
It's lunchtime anyway
!!afk noms
 
@ThePeskyWabbit yes
It does
 
ahhhhh that explains it then. thjank you @misha130
 
00:00 - 19:0019:00 - 00:00

« first day (3013 days earlier)      last day (1934 days later) »