« first day (2326 days earlier)      last day (2614 days later) » 

3:00 PM
@KendallFrey I assume he means that he's never written a virtual method himself
 
No, I have, just not in production code.
 
I assume as little as possible
 
You must not use inheritance/polymorphism much.
 
I've used it in toy programs I've written,
Not really, the most I have is two child classes in meh code. I use bunch of interfaces.
 
> meh code
My professional life summed up in two words.
 
3:02 PM
lel
 
Agreed.
 
@mikeTheLiar same
 
Didn't we already have an extensive, extensive discussion on the uses of ToString a while back?
Possible with @War, and part of his ongoing war against accepted practices?
2
 
why do you need to have an extensive, extensive discussion about fucking tostring
 
No, just regular ToString
 
3:02 PM
it's literally self explanatory
 
because we're programmers
 
Programmers are boring.
 
haha
 
Drills are boring.
 
God damn it
 
3:03 PM
1 min ago, by Avner Shahar-Kashtan
Possible with @War, and part of his ongoing war against accepted practices?
 
Beaver dam it.
 
Mohammed damn it.
 
War
@AvnerShahar-Kashtan hey wtf !!
 
@mikeTheLiar, you're the wurst
 
@Nathvi you so punny x_x
 
3:04 PM
@War lmao
 
holy shit shut the fuck up
 
@War OHAI :)
 
i mean same haha
 
@RoelvanUden, I actually am. My coworker hates it.
 
War
I get what ToString does and I get it's purpose I just don't see how it being a global thing in C# adds any value as each type needs its own implementation for it to be meaningful that's all there is to it
 
3:05 PM
^
 
@War Yes, as I said, an extensive, extensive discussion. :)
 
ToString as an extension hey there you go
no? okay, ill shut up now
 
War
The outcome was clearly ... I am wrong to think that and so I go about my life being wrong
 
@War fwiw, Haskell has a typeclass for that functionality, nothing is global
 
@RoelvanUden oh wow an extension? UNHEARD OF
 
3:06 PM
lol
 
I actually find the default implementation useful, mostly during coding, less so at runtime.
@KendallFrey Did you see the C# spec suggestion for typeclasses?
 
In lisp, the code is written for you.
 
War
yesterday, by War
Feb 16 at 17:00, by War
50 secs ago, by War
@KendallFrey no-one gives a shit about haskell
2
 
@AvnerShahar-Kashtan Don't pull my leg
 
@KendallFrey It's a proposal, not anywhere near yet. I saw it on the roslyn github page a few days ago.
 
3:07 PM
haskell was a mistake
 
I was trying to figure out how to make typeclasses work in C# the other day
There are so many ways it can't work
C# basically needs a new type system to use them
 
Type classes are fake.
 
I've started reading this, but it's late and I want to go home, so maybe tomorrow:
 
C# is fake news
 
God
 
3:10 PM
twitter is real news
 
Have we ever done a Google hangout?
or something similar?
 
c# has a border-radius exploit
 
@Nathvi the wurst of the wurst
Ich bin eine Frankfurter.
 
Gut
Is there any examples of what would be considered very well written c# code?
 
No
Everyone programs like shit
 
3:21 PM
Hey! I need help with spam score, Can you help me for a sec?
 
what is spam score?
 
You mean like from a 3rd party marketing email provider?
 
Spam score is used to identify spam emails. It's used in Gmail, Outlook etc
I'm using this spam scorer to identify the spam score of my e-mail marketing
The problem is, I'm getting 1.1 of penality:
1.1 SUBJ_ILLEGAL_CHARS Subject: has too many raw illegal characters
        var email = new MailMessage();
        email.To.Add(userEmail);
        email.Subject = "Promoção satisfação olá ônibus";
        email.SubjectEncoding = Encoding.UTF8;
 
You really should be using a 3rd party provider for marketing emails.
 
I'm using utf8 chars
 
3:37 PM
is there a reason that a webpage looks different in IE than chrome? ive been doing my testing for my webapp in chrome and just launched it in IE and the styling looks off for certain UI elements from html and css
 
In C#, I'm calling a SQL Server sproc from EF and passing it an array of objects (each being a new SQLParameter). Is it possible to fetch the output param using its name rather than its array index? Here's my code:
object[] parameters =
	{
		new SqlParameter("MyParam1", SomeValue),
		new SqlParameter("MyParam2", SomeOtherValue),
		// Other parameters here...
		new SqlParameter("ErrorCode", SqlDbType.TinyInt)
		{
			Direction = ParameterDirection.Output
		}
	};

var results = await
	db.Database.SqlQuery<MyViewModel>(
		"uspSearch @MyParam1, @MyParam2, ..... @ErrorCode OUT ", parameters
		).ToListAsync();

var output = parameters[10] as SqlParameter;
// Read the output code here...
In other words, can I fetch the output SQL Parameter using LINQ and its name "ErrorCode"?
 
can you guys tell me if I understand this correctly? This is from the forgot password method in my account controller...
var user = await UserManager.FindByNameAsync();
                if (user == null)
                {
                    // Don't reveal that the user does not exist or is not confirmed
                    return View("ForgotPasswordConfirmation");
                }
 
@Skullomania No, I can't read your mind.
 
in the arguments for FindByNameAsync there was model.Email but it keeps returning fauls
false
The site does not use email as username so the usermanager does not recognize it
and returns it as false
or null
am I correct in assuming this?
but this also makes no sense looking at the model
 
I think I've got a solution... not sure why I was producing a generic object[] array rather than a SqlParameter[] array. Then I can use LINQ and find the element with a particular name
 
3:52 PM
So i'm trying to submit a form to a actionresult with an input with a value of 830000
Yet when it gets to the actionresult, the value is 0
Anyone have an idea as to why this could be happening?
 
ADH
Do you guys do your own taxes?
 
Nice try IRS/HMRC
 
ADH
IRS, not HMRC
 
good job im english, no nasty irs for me
 
ADH
I wonder what taxes in the UK are like.
Do you do your own?
 
3:53 PM
Hmm. Now getting a warning on Co-variant array conversion from SqlParameter[] to object[] can cause run-time exception on write operation
 
god knows
I can't say i've ever had to submit a tax return
so probably not
 
@Kieran can you show the code youre using?
ive had a similar problem before, but there are many possible reasons why thats happening
 
Its using a razor form
 
ADH
Can you post your action result code? Are you passing the model into it?
 
theres just not enough info here to help you lol
 
4:01 PM
model is being passed in
 
but based on what youve said, this is probably an issue with your form
 
There's not alot of info to give you lmao
@Html.TextBoxFor(x => x.Turnover)
Thats the textbox
 
in your model is turnover a string or int?
 
public ActionResult Insert(Model model)
 
ADH
Are you sure the model you are passing is the same one you have on the form?
 
4:02 PM
int
 
thats why
 
fuck me
lightbulb
 
need to convert
 
Yep
Thank you for confirming im an idiot c:
26
(no sarcasm there)
shit
 
what happened?
 
4:03 PM
its on the starboard
 
at least its an easy fix
im struggling to figure out how im gonna implement multiple sorting filters on my table
i got it to work for one column
but i feel like its gonna be a huge code block of if () else if() etc
definitely not going about it in the best way
 
4:33 PM
If anyone wants to try for my bounty.
2
Q: Visual Studio Single Page Application Integration

GregTechnology: Visual Studio 2017 Asp.Net Core Tooling 1.1 .Net Framework 4.6.2 Single Page Application's and their integration into Visual Studio have become easier, with all the new support built into Visual Studio. But earlier in the week, Jeffery T. Fritz released a really nice article on t...

 
4:50 PM
 
5:16 PM
@Greg I like bounties
 
Well, good luck.
It's above.
 
Why are you wrapping your SPA in a .net project?
 
Because it utilizes a WebApi backend.
So the same request and same sever would occur, which alleviates JavaScript CORS issue.
 
5:38 PM
dummy question: my definition of Backend development was that any C# (for c sharp devs)or database code (server side), and frontend is the HTML, JS and any client side code. but a senior developer told me that the backend is anything that the owner of the (say, website) uses to enter the data and manage the website, and frontend, on the other hand, is any thing the end user sees. What is the real definition??
 
Can someone tell me why the token is returning null FOR THE LOVE OF GOD!?!

string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id);
 
@MohamedAhmed The terms are nebulously defined and highly dependent on context.
 
@Skullomania maybe it doesnt take user.Id
 
The front end is where you wee from, the back end is where you poo from.
 
what
the hell
mike
 
5:40 PM
I'm just answer his question.
 
but I swear it does
I just changed the model and everything
var userManager = HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
                var user = await UserManager.FindByNameAsync(model.Username);
                if (user == null)
                {
                    // Don't reveal that the user does not exist or is not confirmed
                    return View("ForgotPasswordConfirmation");
                }
                // For more information on how to enable account confirmation and password reset please visit go.microsoft.com/fwlink/?LinkID=320771
this should damn work!
 
it does take a userId
what is the value of userId, does it match in the db
 
yes...if it didn't wouldnt user return null?
also there is no userid in the database there is UserName
 
user.Id is null?
 
I see
user is the table
Id is the column
no user.Id is not null
but it is the username hashed
 
5:44 PM
Why you do this with one asks dummy question? :'(
 
make you think?
 
Id i believe is the user.Id...one sec
 
it should be
a GUID?
if it's standard Identity
 
The easiest way to think about it @MohamedAhmed would be a backend would take a client request, then would perform some action. Frontend is associated to the request after that server responds. That is the simplest definition.

But if you did a vin diagram for HTML and CSS you would notice that it is front end always. If you did the same for C# with a Asp.Net Framework it is always backend. But JavaScript would actually scope frontend and backend, since it can work within both. Depending on your setup.
 
@juanvan so user.ID would be the first column
 
5:48 PM
yep
 
it is looking for the username associated with that
 
it's a GUID
 
should my code not work?
 
ya I think so
 
idk
 
5:49 PM
oh steve you know..
you know more then you put on
 
then why does it not generate a token?
 
am looking at my code
 
when you debug does user.id have value?
 
I am doing that now
that pic is not loading lol
there it goes
@SteveG I think code is returning false. but it makes no sense!
 
the id?
 
5:58 PM
no the string
string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id);
its returning null
but I just showed you where the user is not null
niether is the ID
 
Did they confirm there email address?
 
there
 
if not they can't reset the password
 
Is the generate method msft?
 
ya
 
6:00 PM
strange
 
was reading this and it mentioned the confirm address
 
Is the connection disposed?
 
if it's False
 
@Skullomania - Are you using Security Stamp?
 
@juanvan I was following a password reset tutorial that told me to remove that portion
 
6:03 PM
linky
 
Here is someone with your same situation, getting null for the token: stackoverflow.com/q/28665431/1026459
 
ahh the Tube
need some lube with that
 
@TravisJ I checked the database
Everyone has a security stamp
but the photo I tried to upload was null
click on it
 
yeah
 
6:22 PM
Hmm if I wish to "prevent construction, and return (a reference to) an old object if constructing with old parameters", is the factory pattern really the way to go? Can't a constructor modify this to make itself actually the old object? Or, like in python, is it possible to act "before constructing" (as python's __new__ does)?
 
factory method
you want a singleton?
or a copy ctor?
 
Anyone running VS 2017?
 
Well I have class that is constructed as: "myCLass(key, name, etc...), and I want not a "singleton" but rather making sure each "key" is unique. And if the same key is inputted it should just return the already created version.
Or actually, I'm not realy sure what to do if the same key is inputted twice, as it really makes no sense.
 
@RyanTernier yeah
 
Have you found the Node.JS Server Side JavaScript process eating up all your memory?
 
6:27 PM
To do that I would just make a static dictionary that keeps track of key-myclass pairs and just checks for containing.
 
@RyanTernier No, mostly because I don't use node.js within VS. :(
Unless there are something behind the scenes that I don't know about.
 
@scheien neither do we, but it starts up nonetheless ;)
yea, it's behind the scenes I think
 
I haven't experienced any issues related to memory (yet), though I've noticed some other issues (like loading projects takes forever)
and frequently hangs if I try to open projects or run tests before it's "ready"
 
let me get my laptop and check it out, brb
No, it use around ~15MB
it's version 6.4.0
 
6:35 PM
Hrm, Why Node JS Why
 
I have VS 2017 Pro version 15.0.0-RC.4+26026.0
What a pretty version number
 
Same here
Weird that Node JS Is running like that, especially seeing we don't use it. I wonder if it was one of the options I picked while installing as we do allot of Web ApI work and it's just on by default
 
Might be, or it's related to some other backend functionality
 
@RyanTernier - Is it* a steady 1.3 gigs?
ping attack.
 
@TravisJ Yea, it's a bit lower now @ 1.329
Ping attack on my dev box????
 
6:43 PM
One thing JS is terrible with is fixing memory leaks, so if it is steady, in my opinion, that would mean that it is actually running something.
No, I meant ping attack in the sense that I pinged you three times editing my message (sorry)
 
haha nw
 
That is a serious amount of memory use. It has to be running some sort of actual application.
 
motherfuckers
 
@peterpep I see you've met Kendall.
2
 
i need to up my game. another group is looking at an external vendor for the app im working on
thankfully i got invited to the meeting
need to scope out their tech and make sure my solution is better
@mikeTheLiar lol
 
6:49 PM
@peterpep Welcome to the world of software development. What app are you working on?
 
its this chemical/item management tool
right now working on the chemical portion then gonna expand it for our specific consumables and specimen
 
Just tell your boss after the group meeting that you shouldn't outsource your proprietary chemical information.
 
You're working on an in house app and someone in your company is looking at a vendor that's made the same thing?
 
Next problem? ;)
See, Ryan had the same point.
 
What Travis said. Also, bring to light that maintenance and development of new features is something that can't easily be done with a COTS product without a lot of $$
If you continue on your current path, and make it proper you could create your own IP, patents and leverage your tech and sell it to other companies that do similar stuff through an API/Embedded app etc
 
6:53 PM
What Ryan said. Also, make sure to remind them that you need a fuzball table.
 
And beanbag chairs
 
Total. Agreement.
 
And if you have a spare office room and your company gives good benefits, once a month a masseuse can come by with a massage table for in office massages to boost productivity.
Talk about a perk to bring in more talent
 
Mind blown.
 
and a hoverboard
You don't want to walk to the coffee machine would you? :)
 
6:57 PM
Company called PNI I interviewed at allowed all owners to bring in dogs to work, they had hoverboards, skateboards, etc. for people to move around the office on
 
We have a spare office. We give good benefits! OMG if our current project hits its goals by June we are doing the masseuse thing.
 
NIce!
 
hehe
sweet
We had a hoverboard, until a couple of capacitors blew.
I guess expert mode was way too much for it
 
Yeah, you need fancier capacitors, and faster boards.
 
My boss was going to take us to the Champagne Bar at the Trump tower tomorrow after the demo... but then we realized it's the opening day and they're expecting a few hundred-thousands of protesters and he decided not to test them.
 
6:59 PM
Weren't they recalled because they kept exploding?
 
If you can't get enough flux, and cannot reach 88 miles per hour, then the hoverboard will not help you.
 
That was the battery
 
@mikeTheLiar Nah, they wouldn't fly on water
 
while charging
 
@RyanTernier Yeah, that does not sound like a good time.
 
7:03 PM
sorry for delay
it is another group
that is looking at it
the group that i am developing the tool for seem pretty interested in my app
so its gonna be interesting to see what happens
im really interested in going to the meeting tomorrow to see the external vendors tech
hopefully they have a demo
so i can compare our solutions
 
@RyanTernier I swear, your going to drive Cody to shoot you.
 
7:21 PM
Anyone have a good tip on how I can create a dynamically expression from a List<T> property? I can't seem to get the grasp on Expression.Call().
I'm making a custom projection based on what "columns" the user wants to show, and I don't want to send more data then needed.
 
@scheien - Are you also limiting the data that is fetched from the db?
 
I'm going to
If not, it's about ~15MB each call, and that's way to much. :)
 
@scheien - I would suggest looking into the best approach to use for whatever ORM you are using, use that, blind serialize the set on the server, and then let the client deserialize and detect what was sent.
 
but, but, I'm nearly there!
gist: 907a0fb04a1fa09d63c22830f528fbfb, 2017-02-27 19:33:34Z
 public class Sensor
    { 
        public int Id { get; set; }
        public string Name { get; set; }
        public string Location { get; set; }
    
        public List<Channel> Channels { get; set; }
    }
    
    public class Channel
    {
        public int Id { get; set; }
        public string Name { get; set; }
    
        public List<Reading> Readings { get; set; }
    }
    
    public class SensorDTO
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public List<ChannelDTO> Channels { get; set; }
    }
    
        private Expression<Func<Sensor, SensorDTO>> CreateProjection(IEnumerable<Column> columns)
        {
            var selectParam = Expression.Parameter(typeof(Sensor), "s");
            var row = Expression.New(typeof(SensorDTO));
            var bindings = new List<MemberAssignment>();

            foreach (var column in columns)
            {
                Expression body = selectParam;
                var destProperty = column.Property;

                if (column.Property.Contains('.'))
                {
                    destProperty = destProperty.Replace(".", "");

                    var propertyParts = column.Property.Split('.');

                    foreach (var member in propertyParts)
                    {
                        body = Expression.Property(body, member); // property with nested type mapping. e.g: Sensor.SubType.Name => SensorDTO.SubTypeName

                        if (body.Type.GetGenericTypeDefinition().IsAssignableFrom(typeof(ICollection<>))) // This is a collection, we need to project something on this nested property.
                        {
                            // something something here about projecting nested List<T> onto the DTO.
                        }

                    }
                }
                else
                {
                    var mi = typeof(Sensor).GetProperty(column.Property); // one to one mapping - e.g. Sensor.Id => SensorDTO.Id
                    body = Expression.Property(body, mi);
                }

                var destinationProperty = typeof(SensorDTO).GetProperty(destProperty);
                var binding = Expression.Bind(destinationProperty, body);

                bindings.Add(binding);
            }

            var init = Expression.MemberInit(row, bindings);

            return Expression.Lambda<Func<Sensor, SensorDTO>>(init, selectParam);
        }

        private class Column
        {
            public string Property { get; set; }
        }
    
    
    
    
    
 
Hi everyone
Can someone look my issue
i just posted
 
7:34 PM
@scheien - This question has a good description of how to break apart expressions and then combine them, even if it may not be an exact fit, it should be a good template stackoverflow.com/q/457316/1026459
 
if someone can explain it will be great
 
@TravisJ I'm just missing the bits on how to project on nested collections. Direct children, or even grand children works fine.
 
@user2147163 WHere is this issue? Can you paste the URL?
 
sure Ryan
0
Q: Value type and Reference type real time memory allocatoin

user2147163I have recently been asked in an interview like where actually variables are stored. I answered value type variables are stored on Stack and Reference type variables are stored on Heap but the interviewer asked me to give me real time scenario in a program.Please check the below program and help ...

 
Don't insult C# by saying Java#... at least do Jâ™­
 
7:37 PM
Its not Java Ryan
its C# only
 
I wasn't replying to you ;)
 
Honestly...90% of software development doesn't care about stack/heap
 
Yeah but still i wanted to know
 
The biggest thing to know about that question is what value is retained when exiting a function
 
7:39 PM
Pop()
 
I understand that, but it's a great counter to that question. Pre-optimization of code based on Heap/Stack variable storage will lead to a drastically long development time.
 
@RyanTernier - It is an infinite loop.
 
@TravisJ What is?
 
@RyanTernier - The program instantiates itself in the static constructor each time the program instantiates itself.
 
Please refrain from instantiating yourself in public. Keep that sort of activity confined to your own home.
 
7:41 PM
Static class memory is on the heap, static class is on the stack
 
Exactly. There is no need to spray the heap like that.
 
nope
 
ok...
 
heap is always slower, so keeping things on the stack is nice, stack is your memory that you know at compile time
Heap is usually run time information
 
and what about the variables which is declared inside method
 
7:45 PM
Example:
Public void fo0(){
  int i = 4;//stack it baby
  int j = 3; //stack it baby
  var b = new bar(); // Pointer created on teh stack, object stored on the heap
}
If you did :
bar b;

It would not allocate any memory on the heap. It would put a pointer on the stack and set it to null.
 
Thanks Ryan
got it
 
Now, if you did :

int i = 123; //stack
object j = i;//ohhhh trickery

this uses the heap =D Boxing/Unboxing
 
It pisses me off when people say value types are stored on the stack
It's local variables that are stored on the stack.
 
value types are stored on the stack
 
7:49 PM
=D
Not all local variables are stored on the stack though
 
All non-local variables will be deported.
 
int i = 0; //Stack i = 1
object O = 0; //stack O(ref) points to Heap (4) (boxes)
 
We're going to build a wall between the stack and the heap.
 
Bout bloody time
Heaps are lazy
 
@RyanTernier The variable is still on the stack, the object itself is on the heap.
You're right about closures though
 
7:53 PM
If you did:
Foo obj = new Foo();
Foo obj1 = obj;

You'd have:

obj and obj1 (reference) on teh stack with the actual object on the heap
bunch of quick efficient things on the stack Heap shaming the object on the heap
 
8:34 PM
is there a way to direct jquery to go to the mvc controller so it returns a view and causes a reload?
i have no idea how to make jquery change all the logic on my page so i just want it to go to an actionresult that returns a view
 
yes.
do you want the entire page to reload?
 
Jess Pardue on February 27, 2017
Welcome to the Stack Overflow Podcast #102 recorded Thursday, February 23, 2017 at the Stack Overflow HQ in NYC. Today's podcast is brought to you by rogue cows and SHA-1. SHA-1: You can depend on it.
 
If nothing else comes from this whole SHA-1 mess, I've learned that I'm the only person on the planet who apparently doesn't say ESS-AITCH-EH One.
 
false
 
yea i want the whole page to reload @TravisJ
 
8:46 PM
I wonder if people think I'm a douche for saying "Sequel Server"
I have detected no you're-a-douche-face
 
@peterpep - Then use a form to submit, and use the post redirect get pattern.
 
@TomW Do you say SHA instead the individual letters?
 
@TomW - I also say Sequel Server
But I don't say shaw one
 
Shar one
 
I say Sequel Server but in other instances I'll say Ess Cue Ell
 
8:47 PM
I draw the line at saying "Earl"
 
see pound
 
(URL)
 
I used to say Yurl but I kept getting weird looks
 
@TravisJ so my actionresult returns a redircttoaction currently but that redirecttoaction doesnt seem to work when i call it from jquery using post
 
Dammit tom
 
8:48 PM
Some fuckwit on Channel9 came up with that one
 
@TomW gwid
 
but the actionresult that i am calling is definitely working because its removing the item i want from the context
 
Goo-Id
 
Yep I got challenged on that one
 
Gee You Eye Dee
 
8:48 PM
@peterpep - Yeah you can't redirect from an ajax like that. You need to create a form element and submit it.
 
Fun fact: WWW has six more syllables than what it stands for.
 
I retorted "Yeah just like calamari is crispy fried rings of sqoo-id"
 
I say GOO-id
 
Trying to say WWW phonetically would just make you sound like you're having a stroke
 
@KendallFrey what about UUID?
 
8:49 PM
@TravisJ: It's alive! (as a prototype, still feels like a really dark rabbit hole) :)
 
@TravisJ so i just wrap my input html element and my button in an html.beginform?
 
@mikeTheLiar yoo yoo ai dee
 
if thats the case, that would remove the need for any jquery
 
or just goo-id
 
or do you wrap it in an <form> </form>
 
8:51 PM
@TomW I don't play RPGs, but... "druid"
 

« first day (2326 days earlier)      last day (2614 days later) »