« first day (3182 days earlier)      last day (1766 days later) » 

2:11 AM
3 hours passed so slooooowwww........
 
Does where T : struct have any performance benefit (like avoiding boxing)?
 
2:47 AM
Did PublicKeyToken=null mean this library can be referenced regardless differ versions?
 
3:22 AM
anyone here really good with asp.net core?
 
 
1 hour later…
4:48 AM
hi @mr5
i have a problem
how can I reenstantiate a constructor
or do i need a separate class being instantiated every time in order to run the ctor
for example this code resides in a class.
var result = await _botServices.Dispatch.RecognizeAsync<LuisReturn>(turnContext, cancellationToken)
the _botServices is no longer loaded with a result it's null after the first use
 
5:14 AM
hi @Wietlol are you busy
haa i got it
What did that guy say last night about ctor chaining?
1. when you do dependency injection are you able to call a class's ctor without actually passing through params when the ctor actually has params?
example
 public MainDialog(IConfiguration configuration, ILogger<MainDialog> logger, IBotServices botServices)
 
5:34 AM
No. You must fulfill one of the ctor to create an instance. Thats why some API argue with parameterless ctor
 
2. the main dialog which set as a singleton through startup.cs services.AddSingleton<MainDialog>(); with the above params, specifically the IBotServices, in order to use that as a singleton in other classes I need to pass that param to the other classes... Is this called ctor chaining?
@nyconing I don't how MainDialog is started other than that singleton... that is the only thing that calls it but it doesn't call it with its parameters
I dont' get*
 
Me also. I read your question repeatedly but still dont get what youre asking....
Actually, you dont need a service to handle 'singleton', C# have static
And ctor are actually a static method
 
huh
so there is a class called Foo(Param1, Param2)
now in order to instantiate that ctor I need to call it with the parameters passed in
 
Foo{
 static Foo Create();
public Foo(){}
}
 
well that is the ctor of the class
just imagine
yes
but there are params in there
1 and 2
lets just say
why are you doing static
 
5:48 AM
Dont make a service when you can do static object
 
i can't
it doesn't work
i need the configuration values
i got it working
I just need to understand the why
why is this class being initiated without being "called" with parameters when it has parameters
this
services.AddSingleton<MainDialog>();
 
Which service youre using
If you have a R# installed, you can just simply looking into the decompiled source code to find out why
 
what is r#
 
..resharper
 
well it is still interesting to me that the above singleton service call sets this class
public MainDialog(IConfiguration configuration, ILogger<MainDialog> logger, IBotServices botServices)
            : base(nameof(MainDialog))
i need to figure out why
 
5:56 AM
Service name?
Or the service are writen by you?
"service" <- what is the service?
Your class can be initialized simply using Reflection
Just need to know what the exactly service youre using
And, a dialog do not need to be singleton
 
6:24 AM
public class Foo{
    public Foo(string str, int i, float f){
        Console.WriteLine("Im Foo. Im initialized.");
    }
    public void Really(){
        Console.WriteLine("Yes. Im initialized.");
    }
}
var type = typeof(Foo);
var ctor = type.GetConstructors()[0];
var parameters = ctor.GetParameters().Select(x=>GetDefault(x.ParameterType)).ToArray();
var instanceOfFoo = (Foo)ctor.Invoke(parameters);
instanceOfFoo.Really();
Hello, world! 08:23.28 03.07.19
Im Foo. Im initialized.
Yes. Im initialized.
Reflection way to initialize a parametered class. This code worked but ran slower.
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' squirrelerinos!
 
Good aftevenight
 
I think you shouldnt need reflection tho
either delegate out the construction to newtonsoft json for example, or use a factory object
 
Is it possible to make an insert statement like insert into table values (val1, val2, val3)?
in other words, missing the part where the fields are specified
Apparently in oracle it is possible
 
in mysql and sql server, it also is
 
6:38 AM
If you mean in C# ? I have .InsertRange()
 
that is a perfect answer... just to a different question :D
@Neil be happy with your oracle db, I had to query a dynamodb table yesterday
it is such a mess
 
@Wietlol the sound of it gives me chills
 
mongo
 
the results are always paginated
getting a page throws an exception when you exceed throughput capacity (in that case, you want to retry and slow down)
counting cannot be done, you must retrieve all the records and then count on the list in C#
 
firebase are growing faster than expected
 
6:43 AM
not to mention, there are multiple client classes in the same client library
 
either people are trusting google or firebase are realible
 
I was dealing with a library in java specialized in synchronizing a map across multiple weblogic nodes, and they had the possibility to paginate the results. Great! I need to show paginated results on my page!
Come to find out, there is zero support for knowing how many pages there are
so you end up having to load everything anyway just to know how many pages there are
I hate leaky abstractions
 
same for this dynamodb result
you just have a "LastResultKey" (or something) and you can add a "ExclusiveStartKey" in the query
 
admittedly I didn't have to search all the paginated results, but I still had to perform an additional count operation
nobody likes a paginated web page where the only options are forward and backward (and you can't even know if forward action will show legit results)
also the first page was page 0 pff
 
this is how you query
from official documents
query assumes infinite throughput
I love object databases much more than any other form of databases
but if you have an api like this... meh
my prototype just had code injection into a sandbox
it worked pretty nicely
 
6:49 AM
Leaky. Abstraction.
 
7:00 AM
@Wietlol sigh you are not the only one who had to deal with bad DB issues
, me as well I had to stay all night to go through the source code provided by my current client
, and good damn it the itch in my fist couldn't be controlled any longer, who ever wrote that code was an evil s*b,
I..........ugh I just finished bug squashing and I think I'm having a hard drink...yeah a drink in the early morning.
 
let it out
good morning
let it in
 
@ntohl done already...I also might need to buy a new screen protector for my phone, and good morning to you too
 
@Neil 0.o?
 
o/
 
7:15 AM
whenever you see an "abstraction" which doesn't quite cover all cases/uses
 
isnt it like an abstraction that has an api that is specific to a set of implementations?
 
no, it's more of a generic concept regarding abstractions in general
 
Just found a practical bug in the Immerdiate window!

If you do sth like `collection.ToList().Select(s => s.Name)`
You'd recieve an ErrorMessage: "Evaluation requires a thread to run temporarily. Use the Watch window to perform the evaluation."

Now if you do: `collection.Select(s => s.Name).ToArray()` then youu'd again get the same errormessage "Evaluation requires a thread to run temporarily. Use the Watch window to perform the evaluation.".

But once you've did that you can execute the first command again (First .ToList() then .Select()) and it will run and give an output.
Might also be due to the fact that I ran the code without .ToList() inbetween, not really sure ^^
 
7:31 AM
ToArray should work but ToList should 100% work
I got a covariance and contravariance question. Are there defaults for these? Or am i just a dumb dumb that never needed to do this and always used classes that already had this?
 
7:46 AM
It's the immediate window in debug when all threads are paused.
So no, If a Thread is required to run it won't work in 100% of the time
 
8:03 AM
Yea in immediate window debug it should attemp to move forward with the referenced expressions in the IEnumerable and resolve them
The thread is paused but its in memory
 
Oh no covariance and contravariance
 
yea never mind, default is invariance
a dumb dumb i am in any case
 
@misha How do you define defaults? List<T> is invariant.
 
when you define a generic interface how does it stand
that was the question
 
8:09 AM
@Neil fite mi
 
> System.Data.Entity.Validation.DbEntityValidationException - Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
AAAAAAAAARRRRRGGGGHHHHHH
STOP BEING AN ABOMINATION EF!!!
 
@misha start there and read for like one page:
Jun 3 at 11:24, by Squirrelkiller
Covariant is what we all want for List<T> but we can't have: A list<Animal> may contain Cats, because they're animals. But you can't put a LIst<Cat> into a List<Animal>'s reference, because they aren't covariant.
Covariance is basically saying (type of another type) -> (type of yetAnotherType) "inherits" the relation of anotherType -> yetAnotherType.
IEnumerable is covariant. You can stuff an IEnumerable<Cat> into a reference for IEnuemrable<Animal>, because the IEnumerbale<Cat> "is a subclass" of IEnumerable<Animal>. Note the "".
 
</rant>
 
wish I could just in/out my T's freely like this example :(
 
for List, it wont work, but I find it common to have classes with in/out generics... except that C# doesnt allow that
 
8:12 AM
yeap
 
ahoy mateys o/
 
@Squirrelintraining you need some more variety in your morning openers
 
@CaptainObvious 3 is more than enough :D
Aswell got more importenint things to do :<
 
actually maybe someone has an idea
public interface Foo<in T>
{
    Task Stuff(Expression<Func<T, bool>> predicate);
}
why wont this work
 
@Squirrelkiller Aswell LIst is this some kind of custom class?
 
8:19 AM
> class Expression<TDelegate>
> Func<in T, bool> : Func<T, bool>
 
I see
well, no I don't see
 
Hello Morning to All of You.Have a nice dayh
 
Func<Object, Boolean> : Func<String, Boolean>
Expression<Func<String, Boolean>>
 
@zubairz Thank yhou!
 
this all seems legit @Wietlol
 
8:21 AM
@Squirrelintraining Pleasure My Friend
 
Expression<Func<Object, Boolean>> cannot be assigned to Expression<Func<String, Boolean>>
because
Expression< A > cannot be assigned to Expression< B >
because TDelegate is invariant
 
so Func alone should work
 
morning
 
I kind of get it why its invariant though, since expression can break the constraint
right
this:
	public interface Foo<out T>
	{
		Task Stuff(Func<T, bool> predicate);
	}
works
great
 
Thar be no ship mates today :(
I'll be in my bunk
 
8:32 AM
Happy napping Cap'n o7
 
@user23333 that article you linked yesterday sounds like someone at that org who's job it was to secure such things, didn't like the fact that someone exposed them at being shite at their job and said "HE HACKED US"
OR
It was someone that literally has no fucking clue what they are doing
@Squirrelkiller AH, SHIP MATE!
Where's the rum Whiskey?
 
burp
 
:O
That damn wizard drink it all?......AGAIN?
 
i drank some but it was disgusting so i threw it overboard cap'n o7
 
\o/
oh wait...
thats not good
no more booze on board now ?
 
8:41 AM
theres pear cider?
u want that?
 
:O
:O :O :O :O
Ye, gimme the cider
so i can hit you with it
am doin' a hunger
is not gud
 
yo, quick one:
MVC5 -> html5 formAction attribute -> Is there specific code where mvc checks for that exact value to swap controllers action?
 
Because from docs formActions is supposed to be URL, so article telling mvc 5 explicitly checks for that thing would be nice
 
What do you mean by "Swap Controllers Action"
Also o/ @AvnerShahar-Kashtan
 
8:47 AM
yo
3
 
I mean if you have 2 or more buttons on UI and you are good old school boy who isn't using ajax, and you need each button to point to different action
in a single form
you can use formAction="actionNameHere"
and form submit will actually hit different actions
based on name given
 
♫ Here we go again ♫
 
....but
why
Why wouldn't you just ajax that
 
ask lead dev ;D
 
More to the point
 
8:49 AM
well I mean it reminds me of webforms
 
Why wouldn't you deal with it server side because you can't trust the client to do what you want anyway
 
but it's very MVCish
 
why would you have two separate end points (That i'm assuming take the same data)
 
it's not my duty to change that
Mixing mvc and ajax is ugly anyways
 
@Raimonds Ok in answer to your question
No. Don't do that
It's like saying
 
8:51 AM
I'ts not answer to my question
 
I want a new nose
 
My questions was Does it explicitly check for that param behind the scenes
 
So you rip your face off and replace it with someone else's face
 
We are already doing it
Do I like it ?
No
Can I see why?
Yes
 
Well whoever made that call is dumb
Unless there's some fuckery that im not aware of
 
8:52 AM
I mean when you deal with legacy stuff you do not just try to fix everything
 
I am removing some sort of attribute checking
 
But it doesn't mean you can't chastise whoever wrote the monstrosity in the first place
 
which was mvc4 way to do things
 
8:53 AM
I am just looking for a good reason to do that
imagine me now saying hey project lead, I removed some shit cos it's out of date
 
So you want to know if changing the form action from /oneaction/onemethod to /twoaction/twomethod will cause issues?
 
and he is like WEBFORRMSZZ!
nah
I am using formAction
 
Hey project lead, i removed some shit because its bad & you should feel bad BECAUSE YOU ARE BAD
 
key on a button
 
8:54 AM
HTML5 spec tells you to specify URL
 
is this webforms or mvc
am confuse
 
I specify action as a name of action in my controller
this is MVC
 
done very old way
no AJAX
 
........rite
 
8:54 AM
Are you using client side scripting to decide where to send your request? or form validation or something?
 
I have two buttons, one is regular submit button, other is adress lookup
 
[button a] [button b]
 
adress lookup has formAction="LookupAdress"
 
button a should do one formaction
 
So address lookup shouldn't be submitting
 
8:55 AM
button b should do another?
 
which basically will trigeer action called LookupAddress on a controller
 
Jesus christ you can't do address lookup without ajax
 
button A will do whatever form actions is, lets say Submit
@CaptainObvious You can
Welcome to advanced MVC :D
 
Either you need to make the user type the full address or redirect to an address dropdown on another pafe
 
it re-renders whole page, but with dropdown
 
8:56 AM
No you can't. I'd love to see any examples of address lookups without ajax or redirection out of form.
 
Keep in mind I am questioning is mvc explicitly checking formAction not best practices
I just gave you one
 
So it is a server side thing
 
Technically yes
 
There's literally nothing you can do client side
 
I see it as webforms postback but done with mvc
 
8:57 AM
Use address lookup to submit the form
 
You are missing my question...
I need legit reason to remove some code I consider obsolete
 
surely the fact its obsolete?
 
Then on the server you need to decide if the form needs returning re-rendered or to actually process the form
Just do it in ajax and your life will be much easier
 
if you look at HTML5 spec "formAction", it says use URL
I am leveraging MVC5 and using "name of my action" not it's url
 
omg the name of your action spits out a url
 
8:59 AM
I assume it explicitly checks for "formAction" in my payload
but I don't have any proof
 

« first day (3182 days earlier)      last day (1766 days later) »