« first day (3323 days earlier)      last day (1608 days later) » 

mr5
3:13 AM
@Sidney hey careful there. what's wrong with fornite?
 
3:40 AM
@mr5 the dancing
well more so the aim bots
 
mr5
4:25 AM
wat
 
mr5
oh ho. chotto matte
new bot
@JackSparrow can you dance?
 
....Come Again?
 
mr5
anyway
SourceEventArgs<object> a = SourceEventArgs<User>
how can I make this two types compatible with each other using contra/covariant approach?
 
Rob
You need an interface
 
mr5
4:29 AM
it already has
I'm not sure what to do next
 
Rob
void Main()
{
	var sea = new SourceEventArgs<User>();
	var sea2 = (ISourceEventArgs<object>)(sea);
}

public class SourceEventArgs<T> : ISourceEventArgs<T> { }
public interface ISourceEventArgs<out T> { }
public class User {}
 
mr5
so what's missing in my code is the direct cast
 
Rob
No, what's missing is you're using a concrete type
 
mr5
I thought when I declared in T, out T, it would implicitly do that
 
Rob
ISourceEventArgs<object> sea2 = sea; also works
 
mr5
4:36 AM
oh wait
How can I do it in reverse?
ISourceEventArgs<object> a = null;
SourceEventArgs<User> b = a;
I was actually doing this ^
 
Rob
Change out T to in T
Note you can't have it both ways
 
mr5
oh crap
I can't do that
public interface ISourceEventArgs<in T>
{
    T Data { get; }
}
this is my interface definition
 
Rob
You can't do that, no
 
mr5
 
Rob
You can't do that, because imagine you had:
public class SourceEventArgs<T> : ISourceEventArgs<T> {
	public SourceEventArgs(T obj) {

	}
}
var sea = new SourceEventArgs<object>(new Cat());
ISourceEventArgs<User> sea2 = sea;
Now, you call sea2.Data, and you're expecting a User, but you get a Cat
So you can either return a T, or accept a T with variance, but you can't do both
 
mr5
4:43 AM
oh crap. I just realize it now after your explanation
 
Rob
You can have two interfaces, though
public class SourceEventArgs<T> : ISourceEventArgsContra<T>, ISourceEventArgsCo<T> {
	public SourceEventArgs(T obj) {
		Data = obj;
	}
	public T Data { get; private set; }
	public void DoSomething(T obj) { }
}

public interface ISourceEventArgsContra<in T>
{
	void DoSomething(T obj);
}
public interface ISourceEventArgsCo<out T>
{
	T Data { get; }
}
var sea = new SourceEventArgs<Cat>(new Cat());
ISourceEventArgsCo<object> co = sea;
ISourceEventArgsContra<HouseCat> contra = sea;
Those will both work
Where HouseCat : Cat
 
mr5
wait. lemme process that for a minute or two or more
 
Rob
Sorry, messed that up (twice!)
 
mr5
ugh
not working
 
Rob
.. In what way?
 
mr5
4:51 AM
contravariance = in
covariant = out
correct?
the implicit conversion is not working for me
 
Rob
Correct
 
mr5
15 mins ago, by mr5
ISourceEventArgs<object> a = null;
SourceEventArgs<User> b = a;
 
Rob
You're not using the interface
You cannot use variance with concrete references
 
mr5
> Cannot implicitly convert type 'ISourceEventArgsCovariant<object>' to 'SourceEventArgs<User>'. An explicit conversion exists (are you missing a cast?)
 
Rob
> You're not using the interface
You cannot use variance with concrete references except for the magic Func<> and Action<>
 
mr5
4:54 AM
 
Rob
Those last two lines are still not using the interface
ISourceEventArgs<User> b1 = a1;
See the fiddle: dotnetfiddle.net/5Jz74V
You have a concrete instance, and then to use variance you must cast it to an interface of the appropriate type
 
mr5
so there are no ways to have an implicit cast from interface type to a concrete type?
 
Rob
My fiddle does exactly that
That's not what you're doing, though. You're casting from the interface to the concrete type
 
mr5
oh I switched the words
 
Rob
There's no way to do that even ignoring variance
 
mr5
5:00 AM
7 mins ago, by Rob
You cannot use variance with concrete references
yeah so I guess I should stop now from here
 
Rob
What you'll need to do is change your code to accept interfaces, rather than concrete types (which is a good practice in general, anyway)
Then you can pass it the same concrete types you have already
 
mr5
but then, doing so, I would feel I violated some standards:
private void Handle_AddUser(object sender, SourceEventArgs<User> e)
{

}
would change to:
private void Handle_AddUser(object sender, ISourceEventArgs<User> e)
{

}
 
Rob
Yep. What standards does that violate?
 
mr5
it's very common to have a concrete type in the delegate callback
 
Rob
Not particularly so
Maybe for some of the old framework stuff, yes
There's absolutely nothing wrong with accepting an interface
 
mr5
5:19 AM
Yeah but it's quite odd seeing an interface EventArgs
 
Rob
Not sure I agree
 
mr5
Anyway, I think I should just completely drop this idea since I'm just trying to manually invoked this handler from my code, which is also an odd idea: Handle_AddUser(this, ev as SourceEventArgs<User>)
thanks @Rob
brb, lunch
 
Rob
No problem
 
5:41 AM
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
mr5
6:30 AM
o/
SubscribeTo<IAccountService>(subscriber: this, forEvent: service => service.MethodName);
does anyone know how can I accomplish the 2nd parameter syntax?
retrieving method by name using lambda
service is the T, in this case, IAccountService
 
mr5
6:43 AM
2
A: Get the name of a method using an expression

seangwrightIf you are ok with using the nameof() operator you can use the following approach. One of the benefits is not having to unwrap an expression tree or supply default values or worry about having a non-null instance of the type with the method. // As extension method public static string GetMethod...

I found a closer answer:
But still, I would need to explicitly state the nameof
 
7:37 AM
morning
I might not be around today, bosses are coming to the office
 
mr5
7:56 AM
I need an alternative word for "requestor" (someone who makes request)
 
@mr5 caller?
 
mr5
because "requestor" sounds made up
 
asker
invoker
 
mr5
hmm. context: requestor, in my case, is the receiving end or the ViewModel in MVVM design
 
sollicitator
 
mr5
7:58 AM
it sounds too formal
asker sounds forced
invoker sounds dota to me
 
inquirer
 
mr5
I'm putting it in enum if it helps
 
sender
 
mr5
public enum PreferredSourceType
{
    Requestor,
    Performer
}
 
Performer makes me think of like a street performer
 
mr5
7:59 AM
I have someone who requests, and someone who performs that request
lol
same concept in Master-Slave
 
Though admittedly, I'd probably use Executor, which would make me think of a guy with a black hood on and a gigantic axe
@mr5 yeah, sounds like server-client relationship
 
mr5
 
you could even just call it that, even if they're not a server/client in the strictest sense of the words
the relationship between server/client is pretty straightforward in my mind
one asks, the other does
 
mr5
maybe this would reach on the client-server relationship someday though
makes me think... hmm
 
inquisitor
prober
interrogator
 
mr5
8:02 AM
okay I think I would go with client/server
that makes more sense
 
the only risk is that people would take that too literally
well programmers
 
mr5
not really
maybe for web developers only
in graphics programming, they also have client/server there which is CPU-GPU
 
fair enough
 
Hello everyone
 
hola
 
8:12 AM
Hola Neil
I need help regarding my web service issue
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS
 
No idea. What does the documentation have to say about the values of allowDefinition?
 
there is no allowDefinition in web.config file
there is allow users="*"
 
how about we start with this: what is the problem you're having?
 
I just deployed my web service yesterday on server
after that I am having issue
like
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
I have been trying to solve it and searched everywhere
 
8:27 AM
Good morning.
 
but no luck so far
 
mr5
o/ avnir
 
@ZMAX Have you tried configuring your virtual directory as an application in IIS?
 
no
can you provide me any link to solve this
 
1. Go to the IIS manager.
2. Right-click your virtual directory.
3. Choose "Convert to application"
What the error seems to be is, in your web.config you placed some configuration directives that aren't valid in virtual directories, only in applications (do read up on the difference between them).
So either remove the relevant setting from your web.config, or configure an IIS Application.
 
8:32 AM
@AvnerShahar-Kashtan in default-web-sites
under application pools
 
No, that' application pools, that's something else.
 
or do I need to add my production site into IIS then I can add virtual directory
 
I assume it's already under IIS, or IIS wouldn't be serving it.
 
yes
you are right
I have default web site under sites option
 
...and under it?
 
8:35 AM
ok . I am creating virtual directory into that default web site
under default web site I don't have anything
only this one exists
 
IIS's site heirarchy goes:
Top level - Sites. Each site can listen on different ports, or different hostnames, etc.
Under that - you can either have physical folders (directly under your site's root), virtual directory (logical folders under the site root, which point to a different physical folder) which inherit all their settings from the top-level site, or applications, which are virtual folders with their own settings, which can run in different process (application pools)
 
good morning
 
No folders under Default Web Site?
 
no
 
So it seems like your app is deployed to the site's root?
 
8:37 AM
oh sorry
i have
aspnet_client
folder
 
That's there by default, it's a set of ASP.NET WebForms client scripts.
 
ok but apart from this I don't have any folder
in local web service working fine
but when I deployed it to production server then it throws error
so i assume i need to create virtual directory under my production site
 
I haven't deployed ASP.NET to IIS in... over a decade, I think.
So I can't remember the specifics, and they probably changed anyway.
I am declaring today "Listen to mid-2000's Canadian indie pop day". So, you know, y'all should go play that today.
 
8:52 AM
what if it's only mid-2000's Canadian indie?
 
I'm slightly nervous, never had a manager that cared so much as to have a 121 meeting
 
uh oh
This is going to be an important meeting
Not to make you nervous or anything, but it will probably impact your entire future
 
@Neil I'm willing to be flexible enough to allow for early-2000's Canadian indie pop, or mid-2000's Canadian indie rock.
 
@AvnerShahar-Kashtan (¬‿¬)☞
 
immediately I thought of boards of canada and then it hit me they aren't canadian
what pranksters
 
9:04 AM
My morning has been, so far, The New Pornographers, Destroyer and Broken Social Scene.
I particularly recommend The New Pornographers' 2005 masterpiece, Twin Cinema.
 
maybe I'll google "The New Pornographers" when I use my home PC
 
Wait what
 
They're a great Canadian indie-pop supergroup, and absolutely SFW.
 
@Neil Hah well, whatever, at this point I'm not expecting a huge difference
 
@AvnerShahar-Kashtan I'm sure they are
Regardless I wouldn't search for "The New Pornographers" using my work laptop anymore than I'd search for "Bare naked ladies" One week
 
9:10 AM
@AvnerShahar-Kashtan Not if someone reads your history
 
@Neil Another Canadian group, though I won't describe them as "indie".
@Neil I'm on my personal laptop, but connected via the corporate network. They're welcome to come have a chat with me about my search history. :)
 
I'd just assume avoid that conversation, even if I am doing nothing wrong :P
 
mr5
Chrome is suspiciously consuming too much CPU today hmm
 
suspiciously as usual
you misspelled "as usual"
 
js based coin miner
 
9:17 AM
wait, is that possible?
could you legit give many different clients pieces of bitcoin processing?
if it is possible, I'm sure it has been done already
 
mr5
distributed mining
 
\o
 
@Neil Sure, it's a relatively common form of malware.
If you manage to inject it onto a popular site - say, an online newspaper site - you can squeeze quite a bit of money from users' browsers before it's discovered and removed.
 
yes malware, but that implies it's software that resides on your pc
 
It's happened before.
@Neil Browser-based malware isn't new. I'd expect it to be most malware going around today.
 
9:21 AM
if you did it in such a way as to not turn your pc into a little bake oven, then they could get away with it easily
 
Here's a report that claims to have found over 50,000 site infected with coin mining malware: thenextweb.com/hardfork/2018/03/07/…
 
all you'd have to do to combat that is to modify the script to send almost correct data
it'd be very difficult to detect
and it would ruin their progress unless they kept track of where they got it from
 
What you'd do to combat that is avoid hosting injected malware on your sites.
 
sure, until it's again found on your page
 
Well, yes. Security isn't a one-time thing.
 
9:27 AM
it is if you make the purpose of their cryptomining counterproductive
 
mr5
Now that you guys mention it, I feel like the Mac I'm using is affected by malware
it's running slow now
 
You're thinking in the wrong scale. People who do that will usually try to spread their cryptojacking code onto dozens or hundreds of sites to get as many users on it - most users will be on the site only a few minutes, so you need as wide a spread as possible.
They don't do devops and production monitoring. They set it up to send money to a specific wallet and forget about it.
If you, a site owner, change the script so that it... what, doesn't send the coins to that wallet? Sends it to another wallet? You're still hurting your site's performance, and no-one cares.
 
mr5
9:41 AM
Can I edit an answer in SO so that it would be marked as Community Wiki?
 
There's a checkbox for that, yes. But make sure that the original answerer is on board with that.
 
mr5
The answer isn't mine though
 
Ah, maybe only mods can do that.
 
mr5
but his answer is not originally from him too so that's why I feel like it should be a community wiki
 
What do you mean "not from him"?
An answer that consists mostly of a quote from a different site should be marked as such, but it's a legitimate answer.
An answer that was copied from another answer should perhaps be flagged for moderator attention, but that's not what CW is for.
 
mr5
9:45 AM
He transcribed his answer from a comment on the same post
though he mentions it on the comment on his answer
 
That's also something that happens. Someone left a comment? That someone should have left an answer. If they didn't (and enough time passed to allow them to), the answer is up for grabs.
 
mr5
oh. but I feel like those kind of things should automatically be tagged as c' wiki
 
Community Wiki is when an answer is a collective answer, like these "identify all the robots in this image" questions on SciFi.SE:
19
Q: Identify these "Retro Machines"

phantom42Who are all of the "Retro Machines" depicted on this shirt design, and what properties are they from?

@mr5 If you think so, you can flag it for moderator intervention and say that, "this answer is copied from someone else's comment, it should be CW". If the specific stack has that policy, the mod can convert it. If not, they'll reject the flag.
 
mr5
nah I think it's good now. I just notice that the transcriber acknowledges the author for it to be marked as CW but it seems the author is too busy.
 
@AvnerShahar-Kashtan how about stars?
 
9:52 AM
Some stack sites annoy me because they have a lot of off-hand answers as comments. It's annoying because A) it doesn't give the OP a good enough answer, and B) it discourages giving proper answers because, as you said, it makes you feel like you're copying, even if you wanted to give a proper answer.
@misha130 Don't know them, but they seem to fit the bill. I'll give'em a whirl.
 
v cool
 
Bosses are late
great bait mate
I rate 8/8
 
mr5
shud b: i r8 5/7
 
It's a solid 5/7, no question
damn also
bosses coming = everyone must be in the office, so download speed is trash
downloading office 365 at <1Mbps
800 Kbps average
it's gonna take all day long
 
like internet speeds in 95
 
9:56 AM
aye
We have 10Mbps
for the whole office
normally there are 5 people tops at once
today we're 13
 
mr5
@HéctorÁlvarez why do you have slow connection in west?
I thought the average internet speed there is 50Mbps?
 
It is but apparently they don't give us more because it's not necessary
 
Averages are misleading.
 
They'll arrive to me downloading Office, lol
 
mr5
how do you say this in English, the speed is ____ (50Mbps/person)?
 
9:59 AM
One guy with a 1000Mbps fiber connection can skew a whole neighborhood.
 
the US has been behind on bandwidth for some time now
possibly because the US developed the infrastructure for the internet first
so now it's all old and needs to be replaced
 

« first day (3323 days earlier)      last day (1608 days later) »