« first day (2866 days earlier)      last day (2073 days later) » 
02:00 - 13:0013:00 - 23:00

mr5
2:11 AM
o/
 
Bob
\o
 
mr5
How do I make Type compatible with the generic param.
I've tried IoC.Regsiter<type>(); where type is a variable
 
Bob
@mr5 Pretty sure that requires reflection
This looks appropriate:
24
Q: Initializing a Generic variable from a C# Type Variable

Peter LangeI have a class that takes a Generic Type as part of its initialization. public class AnimalContext<T> { public DoAnimalStuff() { //AnimalType Specific Code } } What I can do right now is AnimalContext<Donkey> donkeyContext = new AnimalContext<Donkey>(); AnimalContext<Orca>...

 
mr5
@Bob I'm still confused with the syntax. How would I go about with this:
IoC.Register<TInterface,TImplementation>()?
I have two Types at hand.
 
Bob
erm
void Main()
{
	Type a = typeof(int);
	Type b = typeof(string);
	var type = typeof(Foo<,>).MakeGenericType(a, b);
	object instance = Activator.CreateInstance(type);
}

class Foo<T, U>
{

}
@mr5 ^
 
mr5
2:25 AM
@Bob first time I saw that syntax
 
Bob
Your typeof needs the ,, and MakeGenericType takes an array (or params).
 
mr5
okay. I'll try it
 
Bob
Well, it compiles :P
 
mr5
I have another overload
Not sure why this is still wont compile :/
 
Bob
Oh. You meant something else. I thought you meant you wanted to get an instance where the generic type was not known at compile time.
 
mr5
2:28 AM
it's another overload :)
The previous solution is what I'm looking for
 
Bob
you probably want where TType : class
 
mr5
Hmm but it's a constraint between an interface and a class implementation
Same error with TType : class
I thought this was going to be simple
also. Reference type inside typeof seems to be not allowed :/
11 mins ago, by mr5
IoC.Register<TInterface,TImplementation>()?
 
Bob
@mr5 Hm? typeof(System.Console) works fine
 
mr5
System.Console is not a reference type?
 
Bob
@mr5 Every class is a reference type.
Only structs are not reference types.
(IIRC)
 
mr5
2:37 AM
err
what I mean is instance actually ^^
I cannot put instance inside typeof
 
Bob
If you want the type of an instance, use instance.GetType()
@mr5 ^
 
mr5
 
Bob
Oh.
Sorry, I missed that you were trying to call a method, not construct an object (not directly anyway)
 
mr5
:D
That's a lot of work than I imagine earlier
will try...
public void Register<TType, TImplementationType>()
	where TImplementationType : class, TType
	where TType : class
{
	IoC.Register<TType, TImplementationType>();
}
@Bob this is the solution to my first problem ^^
 
2:57 AM
Yo
This room is early today
 
Bob
@mr5 Yup, looks about right. Though you probably don't need the first : class since TImplementationType should inherit the class constraint from TType?
@nyconing Heh. I dropped in to try find some rubber ducks but apparently now's a quiet time :P
 
mr5
@Bob if I remove the class it wont compile anymore
 
Bob
@mr5 ...oh.
 
nullable?
 
mr5
probably the compiler needs both to be of reference type
but I agree what Bob says. The other where : class is unnecessary
 
3:09 AM
Usually mean input can be null
 
mr5
This is getting tedious
I need to overload this one last signature
 
Bob
@mr5 .Invoke(..., new object[] { action })
It doesn't take params so you need to construct the object[] manually
 
mr5
oohh
 
Bob
you only have one arg, so you just make a single-element object[1]
 
mr5
Do you think Func<object> is compatible with the param of IoC.Register<T>(() => instance)?
 
Bob
3:15 AM
It looks like it is.
The other option would be an expression tree, but I doubt that's what Register expects (that's more of a database thing)
 
mr5
Alright. I don't like this to be more complicated
Thank you for helping @Bob :)
 
diamond mod.
 
 
3 hours later…
5:58 AM
ohayou
 
6:32 AM
Good morning
 
7:07 AM
hola
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' pleberinos!
Gues who jsut got to work :D
 
A squirrel.
 
7:41 AM
Morning all - sorry for long absense. My dad died
 
Oh, I'm sorry.
 
Helo pls help sirs
 
mr5
8:16 AM
Have anyone tried using compiled lambdas to instantiate constructors?
I can see performance degradation using Activator.CreateInstance and ConstructorInfo.Invoke
I'm just not sure how to use it and how to pass arguments to it
> NonDefaultConstructor_NotCompiledExpression: (293,00 ms per 1000 calls)
how do you read 293,00ms?
Is it 293 milliseconds or 293 thousand milliseconds?
perhaps, twenty nine thousand three hundred milliseconds?
 
@BugFinder My condolences.
I was wondering why
 
8:37 AM
@KamilSolecki that looks... sighfully
@mr5 what? how? why? bool? what do you mean with instantiate a constructor?
@mr5 < a second or ~ 5 minutes... big difference
 
mr5
@Wietlol I'm doing a reflection
 
since there are 2 trailing zeroes, i'd have a good argument against it being a thousand
only french deal with inconsistent heresy
 
Goood forenooon CeeeShaaarp! Have you encountered any previously unknown sources of exceptions yet?
 
> Have you encountered any previously unknown sources of exceptions yet?
I have
 
mr5
DefaultConstructor_Activator: (0,20 ms per 1000 calls)
DefaultConstructor_CompiledExpression: (0,04 ms per 1000 calls)
DefaultConstructor_Invoke: (1,07 ms per 1000 calls)
DefaultConstructor_New: (0,02 ms per 1000 calls)
DefaultConstructor_NotCompiledExpression: (169,00 ms per 1000 calls)
NonDefaultConstructor_Activator: (3,39 ms per 1000 calls)
NonDefaultConstructor_CompiledExpression: (0,07 ms per 1000 calls)
NonDefaultConstructor_Invoke: (1,57 ms per 1000 calls)
NonDefaultConstructor_New: (0,02 ms per 1000 calls)
 
8:43 AM
Morning kids
 
we still have no clue how it happens or where it comes from
 
@Squirrelkiller I think I created some in a release last night, but it was our first ever beta release and I expressly said "don't expect it to work properly" so it's fine
 
mr5
Why are they using weird digit separators
 
@mr5 Depends on your regional settings.
 
mr5
it's confusing
 
8:46 AM
@Squirrelkiller Actually yes I did
 
@mr5 Foriegn locale?
 
@mr5 you mean the french?
 
mr5
@AvnerShahar-Kashtan damn. how can I decode the benchmark in this link vagifabilov.wordpress.com/2010/04/02/…
 
iirc, they dont use a weird separator, they just dont place it every 3 digits (from the right)
 
Some country uses comma as decimal
For me, It just wrong, not weird.
 
8:56 AM
good morning
 
@nyconing Like germany! 1,0!
one thousand = 1000
One could alswo wirte it as 1.000 in germany.
A dot to seperate every 3 diggiegt. i.e. 1.000.000 to make it easer to read.

2 point 3 would be 2,3 in germany
and onethousand point three could be eitehr written as 1000,3 or 1.000,3
 
I never understood why
anybody would use commas or dots for those separators
when you have single quotes available
100'000'000.00
 
100.000.000,00000
le beste foremat
 
9:11 AM
100,000,000.00001
 
1.00,00
le frenche foremat
 
lol why
 
iDunno
im no heretic
 
Apple new product?
 
9:14 AM
Nov 22 '12 at 19:43, by MRS1367
I use idunno for say it.
First reference in this room
 
Jul 11 '17 at 12:36, by Wietlol
(iDunno, never use winforms)
that one is idunno, mine is iDunno
mr5, ntohl and Squirrelkiller have been the only ones that also said it
mr5 and ntohl both once and squirrel seems to be a fan
and then there is me with 99% of the occupation of the search results
in the JakartaScript room, there have been more mentions by other users
mostly idunno or Idunno though
 
mr5
whoa
I don't recall typing it ^^
 
iDo recall
 
le chat recalls
 
mr5
But can anyone explain to me how to use this:
1 hour ago, by mr5
https://rogerjohansson.blog/2008/02/28/linq-expressions-creating-objects/
 
9:27 AM
why so?
other approaches fail?
normal reflection isnt fancy enough?
 
mr5
cuz
1 hour ago, by mr5
I can see performance degradation using Activator.CreateInstance and ConstructorInfo.Invoke
It takes ~300ms-1sec to instantiate a single object in our case
 
why do you do it with reflection in the first place?
 
mr5
For example, I would like to navigate to another page. The process usually is like this: Create fresh ViewModel -> Create Page -> Show Page
 
imho, if you use reflection, you messed up your design earlier in the process
 
mr5
We do it in MVVM fashion
 
9:30 AM
you can mess up your design in any fashion really
 
mr5
Well, that's one of the cons using MVVM in a cross platform solution
 
that you are able to mess up? nah, everything has that con
 
mr5
Lag is intolerable in Android. It'll take 1 second minimum to navigate from one page to another
 
ew, mobile development in C-harp
 
@mr5 check out, if you find any valuable code in my answer here> stackoverflow.com/a/41570317/1859959
I believe I made some kind of lambda expression in the GetFilterForDepth function
 
9:59 AM
Btw ISO says
Use fucking space as a seperator every 3 numbers if you really have to
Also use a comma as decimal seperator
IMO the big problem for that is: Programming languages are practically american english, therefore we all use dot as a decimal seperator, and ISO doesnt have a chance against that.
 
that explains stuff like color
 
Say I have an object of unknown class, but I *know* it has a certain method.
Is calling through `dynamic` faster than reflection?
Also fuck SO chat markdown
 
could be worth a try
i'd say test it
 
10:15 AM
I need help on English grammar
These sentenses actually already been published more than 1year
But I think I need impove
-
This application is collecting anonymous informations data such as crash, operation and device specifications for help developers continuously making a stable application for you.\nYou can't to use this application if you do not agreed.\n\nAnd we use some stuff and resources that under the license of Creative Commons 3.0 as below:\nnote that this is a offline version for Creative Commons 3.0 license, the license/s may changed over the time without notices.
 
> informations data
0.o?
 
@mr5 Holy fuck what are you doing to take that long
 
> crash, operation and device specifications
do you mean "crash specifications, operation specifications and device specifications"?
 
crashes informations?
 
> for help
to help?
> You can't to use this application if you do not agreed.
what the heck?
 
10:19 AM
Let's just deconstruct that sentence
 
lol
I knew it was bad and broken
 
> resources that under the license of Creative Commons 3.0
that are?
@Squirrelkiller i love deconstructive criticism
 
Can you help me to make corrections?
 
> a offline
 
Yup, there is a lot of images is under CCBY
 
10:20 AM
an
may change---d---
 
mr5
@nyconing try this
> This application is collecting anonymous data such as crashes, operation<need more clarity on this> and device specifications to help developers to continuously make a stable application for you.\nYou can't use this application if you don't agree.\n\We use some external resources under the license of Creative Commons 3.0 as below:\nnote that this is an offline version for Creative Commons 3.0 license. The license/s may changed over the time without prior notices to the users.
 
damnit markup
 
mr5
I'm also practicing my engrish ^^
 
> This application is collecting anonymous information data such as crash, operation and device specifications to help developers continuously make improvements toward a stable application for you.\nYou can't to use this application if you do not agree.\n\nWe also use some assets that are under the Creative Commons 3.0 license as below:\n
> Note that this is an offline version of the Creative Commons 3.0 license, the license may have changed over the time without notices.
 
@mr5 you only did the first sentence?
 
10:21 AM
@nyconing Complete version with changes in italics
 
> do not agreed
@LeeButler 0.o?
 
Main sentence 1:
> This application is collecting anonymous informations data
side sentence, specifying the object "data":
> such as crash, operation and device specifications
another side sentence with explanation
 
have not agreed, do not agree or anything sounds better afaik
 
mr5
information and data is wrong
 
Yeah I tweaked that, I italicised it but didn't actually change that one
 
mr5
10:23 AM
afaik, information is a collection of data
and data doesn't necessarily mean complete
it needs meta-data
 
Im appreciates all of corrections! Thanks!
 
lets take this sentence
> I appreciate all corrections! Thanks!
 
That's not an issue of the language though. We could pick apart the questionable wording for ages, but she asked us to correct the the grammar
 
(stupid markdown)
 
@Wietlol Technically correct, but doesn't sound right
 
10:24 AM
Oh. Well ok.
 
I appreciate all of the corrections! thanks!
 
im not sure what the difference is between "all corrections" and "all of the corrections"
is there any?
 
mr5
@Wietlol sent it without reviews lol
 
It's a shorthand version which I wouldn't use in natural speech
English has all sorts of weird padding words thrown in, and that is one of them. It makes sense without them, but it doesn't sound right
 
i think neither sound right
but that is just me being me an asshole
 
10:27 AM
What is your first language?
 
Java
:p
you mean my native language?
 
Your first language usually is your native language
 
my native language is JVM bytecode
 
Wow
 
but my first language is Java
 
10:29 AM
!!learn wietlol5 <>https://chat.stackoverflow.com/transcript/message/43666078#43666078
 
I am dutch though
 
@LeeButler Command wietlol5 learned
 
!!wietlol5
 
5?
 
2 mins ago, by Wietlol
but that is just me being me an asshole
 
10:29 AM
what is 4 again?
 
There's a 4 isn't there?
!!wietlol4
 
Jul 30 at 10:36, by Wietlol
I dont know what to put there
 
Thought so
 
ah
 
And you being dutch explains why neither sound right
 
10:30 AM
how come?
 
mr5
Why is there a flavor of Dutch in Icre Cream?
 
Because you're not english
 
@mr5 because of cannibalism?
@LeeButler that makes more sense than I care to admit
Im speak english very good tough
Im speak english lot for games and movies
and Java is english
on a side note, anyone knows a language that does currying really well?
 
The fuck is currying
 
10:35 AM
@LeeButler A concept in FP for composing functions.
 
I'm afraid of what I'll do in a sec
!!urban currying
 
@Squirrelkiller currying Mixing indian [spice] in to [questionable] food to make it taste ten [million times] better than before the currying.
 
Get this guys:
Holy moly!
 
Not too bad
 
Oh, that's kinda tame
 
10:36 AM
void connectToUcClientTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
	if (connectedToUcClient)
	{
		connectedToUcClient = KeepAlive();
		if (connectedToUcClient)
			return;
	}

	connect();
}

#endregion [ Timer ]


private bool KeepAlive()
{
	try
	{
		connectedToUcClient = uccServerConnection.IsCallbackRegistered();
	}
	catch (Exception)
	{
		connectedToUcClient = false;
	}

	return connectedToUcClient;
}
 
public static double divide(double base, double divisor)
{
	return base / divisor;
}

var divideXBy5 = divide::(_, 5.0);  // x / 5.0
var divide5ByX = divide::(5.0);     // 5.0 / x
 
Let's say you have a function like AddSuffix(string, suffix). Currying is creating a more specific function, say var makeIng = Bind(AddSuffix, suffix:"Ing")
 
@AvnerShahar-Kashtan not just functional programming though... imo
 
Better than what Hector got
Aug 14 at 11:02, by Caprica Six
@Squirrelkiller hector a caring ,gentle, loving person. usually [what a girl wants] but always messes up when she has it. very strong person both mentally and physically but uses his strength for good .constantly gets attention not looking for it , great friends they always listen .hectors are known for not sharing theirs problems ,only to not bring no on(snip)
 
Now you have a function called makeIng(string), which adds the Ing suffix to a string.
 
10:37 AM
I know haskell has some stuff (and is sorta famous for it), but haskell cheats
 
It's full of bullcrack that method.
It made my brain hurt and it's in an SDK!
 
When functions are first-class members in your languages, it makes sense to transform them and reuse the results.
 
but haskell doesnt have functions that take in more than 2 arguments
it basically sets up a chain of nested methods
in any case, !!afk lunch
 
10:57 AM
Yay, thanks you all.
 
@nyconing Take out the "to" in "Can't to use this application"
And the last bit, "Without prior notice", no "s" on the end
 
@AvnerShahar-Kashtan wat
 
@Squirrelintraining wat?
 
@AvnerShahar-Kashtan watception
 
!!wat
sigh
 
11:10 AM
@nyconing before you* continue
 
what is this dunglish?
... wait... how did I never read that as shitlish?
 
dunglish in the netherlands is a thing
its a combination of dutch and english
 
I tried to buy a Nigerian domain name. It turns out, it's a lot more difficult to transfer money to Nigeria than I was led to believe.
 
du nglish
 
11:20 AM
"Heblish" is the term used here in Israel.
 
@AvnerShahar-Kashtan you might need a certain someone to help you out. I know a prince who might be in.
 
however, dung is also the excrement of animals
so, instead of du nglish, you could read it as dung lish
which would be shitlish
@AvnerShahar-Kashtan I know a diamond mine company owner in nigeria... i think
 
@KamilSolecki I will contact a Nigerian official, possibly in exile, and tell them that I have a fund that I am trying to transfer into Nigeria but want to avoid the official hassles, and will gladly transfer part of the funds for them if they only register this domain in my name.
Actually, I eventually found a Nigerian registrar that accepts Paypal, so that's that.
 
on a side note, why do you want a Nigerian domain name?
do you have a lot of customers in Nigeria?
 
i bet hes making one of those cool domain names
 
11:23 AM
what is a nigerian domain name?
ng?
 
du.ng ?
 
entertaini.ng
 
MillenialsAreKill.i.ng, actually.
$3.50/year. Cheap!
 
wait, single character domains actually exist?
 
11:25 AM
No technical limitation against them.
It's just that most TLD authorities don't encourage them.
 
Huh. Never thought about it, but you never see them around so I assumed theres a lower limit
 
Nigeria, specifically, added the .i.ng subdomain as a special-cased, cheaper alternative to .ng domains.
 
coolso
 
To cater to the wise-ass demographic.
 
Hey, I finished my newsletter!
I'm decently happy with it
 
11:30 AM
wise ass-demographic
 
Yeah, it looks pretty good.
@Squirrelkiller !!xkcd 37
No? no.
 
Always
!!xkcd 37
 
what happened with xcd
the layout is grid based
i mean there is a grid background in every picture
 
It's an old one from when he drew them by hand on grid paper
 
11:40 AM
oh
 
12:01 PM
Hi
What is the most popular patterns except singleton?
and the easiest to implement
 
That question makes no sense. Patterns are common ways to solve specific problems. What problems are you trying to solve?
 
lack of knowledge problem
the best pattern to solve that problem is the listener pattern
 
I generally wanted to learn some popular patterns. however there are plenty of them and wanted to focus on some basic patterns
 
on a side note, I think principles are much more valuable than patterns
 
I don't think it's a good way to learn about design patterns. In isolation from a real-world problem, they become a meaningless coding exercise.
 
12:09 PM
imho, patterns are made to satisfy principles, if you dont understand the core principles, then the patterns would feel meaningless or bothersome
 
I've already learnd SOLID, DRY
 
SOLID is a set of principles though
 
yeah
 
One good way to learn more about common patterns is to go the other way - go over an existing code base (best option: the .NET Framework itself) and see that patterns have been implemented there. That way you can see real-world examples of the patterns in action.
 
I think this should give you a headstart on principles: principles-wiki.net/principles:start
 
12:10 PM
For instance, have you ever passed in an IEqualityComparer to a method?
 
(Even though I don't agree with all descriptions)
 
Say, string.Equals(firstString, secondString, StringComparer.OrdinalIgnoreCase)?
 
thanx Wietlol
 
@AvnerShahar-Kashtan what is that pattern called?
 
@Wietlol Strategy.
 
12:12 PM
@AvnerShahar-Kashtan nope
 
ah, the risk pattern
or the age of empires pattern
 
@essential This is the Strategy pattern. You want to check two strings for equality by calling Equals, but Equals receives a Strategy parameter which tells it how to compare.
 
ok,good
 
Also check out:
24
Q: What design patterns are used throughout the .NET Framework?

Srikar DoddiWhat classes in the .NET Framework implement the various design patterns such as decorator, factory, etc.?

 
I've seen this. anyway thanks
I'm preparing for interview
 
12:15 PM
I like this approach because it focuses on patterns being simply ways to solve problems. So when you look at solved problems and understand what pattern was used to solve them, you understand what the pattern is good for.
 
and I just gained theoretical knowledge about few of them
and as u suggest I will more focus on principles
 
@AvnerShahar-Kashtan Disappointing that singleton isn't mentioned.
 
Bary baty
 
Hi,

I have developed a cross-platform app that targets macOS, WPF, iOS, Android and UWP.

I have sideloaded the UWP app on clients' machines using Add-AppxPackage and it seems to be working fine but sometime the app crashes and I can't seem to find the reason why.

Is there any location that Windows 10 would keep a log when a UWP app crashes?

Just to confirm, it's not downloaded from the Store, it's simply sideloaded.
 
Event Viewer?
Windows Logs>Application usually has details of most uncaught .Net crashes
 
12:29 PM
I am in there
Hadrware Events, Internet Explorer, Key Management Service, Microsoft, etc.
Which section should I be looking into?
 
No not Applications and services logs
Windows Logs
 
you should see your application and a barf message
 
Where did the affordable logitech keyboards with more macro buttons go? THey all have like one row now. I want my G15 back.
 
they arent affordable now cos everyone knows they are useful so they doubled the price
 
12:34 PM
I am using Windows 10 and it looks different there
 
my win10 is at home, show us what it looks like and we can guide you
 
This is windows 10
 
@Linkgoron That's because you shouldn't be using it all that much.
 
@MadaraUchiha IMO it's the single best pattern
 
@Linkgoron I think it's the single best ton.
 
12:37 PM
@AmirNo-Family odd, all the win10 event viewer looks ive seen just look like Lee posted which is the same on win7
 
@AmirNo-Family Add HockeyApp integration. Trust me, it's a lifesaver.
 
12:59 PM
Im writing own simple replacement for OneNote
Want to relase from MS solution in most important for me segments
Notes on PC are on of most important things
 
02:00 - 13:0013:00 - 23:00

« first day (2866 days earlier)      last day (2073 days later) »