« first day (3107 days earlier)      last day (1824 days later) » 

12:01 AM
Morning O/
 
@Squirrelkiller Hi! I am "breathing" if you remember! haha
 
you can Insert/do before/after B called when you call A
 
Hello @Arphile! :)
 
for example, you can do like this
class X {
void A() {
BeforeB();
B();
AfterB();
}
void B() {
}
void BeforeB() {
}
void AfterB() {
}
}
if you don't use before/after method, there's no difference.
but if not, why you need to call A for use B?
 
but I could have done BeforeB() AfterB() via instance as well
void A(){
 X ob = new X();
 ob.beforeB();
 ob.B();
 ob.afterB();
}
@Arphile Well there could be many reasons to call one method from another method
 
12:11 AM
yeah that's true. but if A() just call B(), there's no reason to do like that.
which you write is right task for purpose. if there's more then just call B(), you need to do like that.
 
yes :)
 
 
7 hours later…
6:47 AM
what is with the feeds?
 
Apparently hacked is associated with this group somehow
!!smh
 
you think they've been genuinely hacked?
I wouldn't put it past them to pretend to be hacked
the web page isn't up anymore, so I suppose that's a good argument
 
Links doesnt work though
 
Nah, don't think so, but I would have to look into other groups as well to give an answer that
Doesn't look so, Not found in any other group
@nyconing That's a good point
 
Phil Haack is a suspicious name as well
"Get haacked!" "Yes? You called me?"
 
6:59 AM
I mean he is a blog writer, someone might have played a prank on him though
Would be funny though if a website known as get Haacked gets hacked
 
Maybe the Feed is broken while that server time get reset ed,
 
well it seems clear to me that either he wanted to seem hacked or he actually was
 
@Feeds This post is https://haacked.com/archive/2005/11/02/dynamic-vs-inline-sql.aspx/ but Feeds claim posted on April 19, 2019 by Phil Haack
 
@Neil And it's conclusive statements like this that I look upto you for guidance
 
@anand_v.singh Anytime, sir. Captain Obvious has saved the day again!
 
7:44 AM
@Shad I see you've adopted a more... Namely name. And you're a Pokémon trainer now!
 
8:02 AM
hmm... this is the first time Rider is telling me something isnt used while it is
but i cant reproduce it in an mcve
weird
 
8:37 AM
Guess time analysis is more interesting than I gave it credit for
 
shower thought of the day: there are so many different types of food that it is very likely that two foods that you eat with regularity have never been eaten together by you in your lifetime
my lunch for instance.. cabbage and tuna fish.. I eat them with regularity, and yet I don't think I've ever actually eaten them together before
will keep you guys posted on how it goes
 
9:00 AM
So many jokes, not one of them PC enough.... Arrrgh
 
> with regularity
is that english? (appears it is)
 
Anyone here has any idea how to install .Net framework 3.5 on windows 10, when your office device has windows updates disabled?
 
Don't even bother. Go straight to whoever is in charge of this insane policies and get that shit sorted out.
 
enable the windows updates and module installer while you install, then disable it. And dont tell anyone you enabled it.
 
Hmm, I like the way you think, not an admin account though
I have raised a ticket to enable windows update on my device, they get processed through Munich, so they have quite a turnaround time.
 
Nox
9:11 AM
ok, I'm trying to add a service reference to a project, the service has methods like GoogleLoginAsync, but when the service reference get added the methods are called as GoogleLogin, without the "Async", then when I try to connect to the service it throws an error saying the names in the Json are different... well of course!!
wtf
I know I'm totally newbie with WCF but well...
I don't understand what I'm supposed to do with this, vstudi ocreates the reference all by itself
 
any idea regarding OutOfMemoryException occured from StringBuilder.ToString() ?
 
maybe you dont have enough memory?
 
Nox
it seems pretty obvious, isn't it?
 
CLR is failing to allocate the memory that you are requesting, probably...
 
Nox
9:46 AM
0
Q: WCF web service Error in deserializing body of request message for operation

NoxThis question comes from this other question. The code is basically the same except for FirstMethod and LastMethod methods which I removed because they was giving problems (I comment it in the same question). Even with that, I'll copy here the service interface just for referencing. If some of y...

:(
 
@Wietlol get out of here with your obvious answers
clearly it's far more complex than that
 
well... there are 2 options
1, you dont have enough memory
2, you use too much memory
I expect the first
 
you should write the code like you expect #2
but #1 could happen
actually #1 is always true
just a matter of understanding how it came about
 
I have 32GB RAM
#1 does not happen when there isnt another sanity limitation
such as a VM RAM limit
 
10:05 AM
If you receive an OutOfMemoryException #1 is always true regardless of how much memory you have
if this was due to a program error or because you have too many programs open, that is a different matter
 
true
 
 
1 hour later…
11:17 AM
Hello folks! Is this a place where I can ask a C# question that might not fit the main site?
 
11:31 AM
probably
this is also the place where we ask C# questions that do fit the main site
this is also the place where we ask no-C# questions that dont fit the main site
this is also the place where we dont ask C# questions that dont fit the main site
this is also not the place where we ask C# questions that dont fit the main site
... wait, scrap that last one
 
this is also the place where we ask [no-]C# questions that do[nt] fit the main site
there you go
 
but that doesnt have the same number of negatives as your question
it is more negative
or I dont understand
but what is your question?
 
alright
Is it ever okay to have a 500 bytes large struct?
it feels a bit icky but I really want it to be a struct
 
if you really want it to be a struct, make it a struct
but why do you want it to be a struct?
most of their value diminishes as their size grows
 
I don't like mutability
 
11:37 AM
I C
why cant a class be immutable?
 
it can be if the developer wants it to
but I want to enforce immutability
everyone has to think like I do
seriously though,
it's a 4x4 matrix with all its elements hard coded
 
if everyone thought the way I do, we would have one universal language that fits all needs
 
how'd it look like
 
lisp
 
ew
 
11:40 AM
hehe
 
jk lisp is cool
 
((((thanks))))
the way we enforce immutability is by making the developers understand why we want it
if you enforce a particular pattern without knowing why, it becomes a burden
 
lisp looks like you're dog whistling every function and constant you write
 
make sure you all believe the same approach to be something you all want
 
I'm writing a class library
so potentially everyone is the developer
 
11:42 AM
you are the developer
you write the class library
 
sure but other devs will use it writing their own stuff
 
so everything in the class library is immutable
you dont care if other devs create horrible abominations, right?
 
Honestly I just want to clear my conscious and make sure you're doing okay if you're using it in an immutable way
line 640
 
provide them articles about how to use stuff?
 
For sure maybe, but the original question was whether its okay in the first place,
So C# guidelines say you shouldn't make structs larger than 16 bytes
mine is about 360 bytes
 
11:46 AM
I find C# guidelines to be silly most of the time
but you prefer a struct for a reason that isnt really bound to the struct
both structs and classes are mutable
the way how you set up their api determines wether they are publicly mutable or not
so, unless you have other reasons why you want a struct, you might want to move to a class instead
 
I set up the API to be completely immutable but again, doesn't a massive struct have a bad effect on the stack or memory or something I don't quite understand?
both structs and classes are mutable but mutating a class isn't a crime against god is the difference
 
mutating a struct's data isnt a crime either
im not sure about any weird memory things that might occur in the internals of the CLR
stuff that comes to my mind is that every time you pass the matrix to another stack frame, you copy the entire data
which is much slower than copying a pointer
 
huh
so if I pass to a function for example?
 
void Main()
{
	var mat = new Matrix4<Single>(...);
	PrintM4(mat);
}

void PrintM4(Matrix4<T> mat)
{
	Console.WriteLine(mat);
}
here, you create a matrix
then you pass that matrix to the print function
however, when you pass a value, you copy that value from one stack frame to another
 
Ah of course you're right
 
11:53 AM
for classes, the value being copied is the pointer (8 bytes on 64-bit machines)
for structs, you copy the full struct data
 
Damn that'd suck for such a big struct
 
only if you pass it too many times
structs have some subtle advantages, such as that they are not pointers, which means data (for example from an array) is read in one big sequence rather than jumping back and forth between parts of the internal memory
or that you dont have an 8 byte footprint on your data
but all these kind of differences are negligible when your content size becomes larger and larger
imho, determining wether something should be a struct or a reference is not the developer's job
a compiler could in 90% of the cases (where the wrong decision is made) make a better decision
 
hmm
 
for simplicity, we always use a class
 
which I probably should
 
11:58 AM
(but we dont have to deal with extreme performing applications, such as a game or search engine)
 
it's a tough call, image transforming a matrix a bunch of times
Identity.Rotate(90).Translate(1, 2).Scale(3)
that's a bunch a megabytes right there
Kilobytes* lmao
but still
tough call
I'll probably end up making it a class
Oh and thanks a lot for the help man, gave me a lot to think about
 
if you have an immutable version, you create the matrices many times anyway
the biggest disadvantage of structs is that they dont work well with interfaces
 
That's fine, I basically don't do any boxing
the interfaces are just contracts in my code
 
an advantage of interfaces is that you can use decorators
which dont really need to create new matrices for most operations
 
idk what a decorator is to be honest
 
12:04 PM
they are cool things
for example, if you do an operation like "scale"
you create a new matrix, right?
 
ye
 
because you dont want to mutate your old one
instead, what you can do, is make a decorator
a decorator is an implementation of an interface, that delegates most, if not all, of its methods to another instance
public class DecoratorMatrix4<T> : IMatrix4<T>
{
	public T x00 => data.x00;
	public T x01 => data.x01;
	public T x02 => data.x02;
	public T x03 => data.x03;
	public T x10 => data.x10;
	public T x11 => data.x11;
	public T x12 => data.x12;
	public T x13 => data.x13;
	public T x20 => data.x20;
	public T x21 => data.x21;
	public T x22 => data.x22;
	public T x23 => data.x23;
	public T x30 => data.x30;
	public T x31 => data.x31;
	public T x32 => data.x32;
	public T x33 => data.x33;

	private readonly IMatrix4<T> data;
for example, like this
(better example)
 
What the ew.
 
Yeah it sucks I know
I generated it with T4
 
now what you can do is define a matrix that applies the operation already
public class DecoratorMatrix4<T> : IMatrix4<T>
{
	public T x00 => data.x00 * scalar;
	public T x01 => data.x01 * scalar;
	public T x02 => data.x02 * scalar;
	public T x03 => data.x03 * scalar;
	public T x10 => data.x10 * scalar;
	public T x11 => data.x11 * scalar;
	public T x12 => data.x12 * scalar;
	public T x13 => data.x13 * scalar;
	public T x20 => data.x20 * scalar;
	public T x21 => data.x21 * scalar;
	public T x22 => data.x22 * scalar;
	public T x23 => data.x23 * scalar;
	public T x30 => data.x30 * scalar;
like that
the data this class stores is a pointer to the source information and the scalar value
but it can give you all the information of a scaled matrix
 
12:10 PM
Oh that is actually pretty cool
and the original is left unchanged
 
original is left unchanged
you simply create a decorator around it
the decoration is the x## * scalar part
 
neat
might be a bit overkill for my bum ass first class library but good to know
 
you have to keep in mind, this applies the multiplication operation every time you access x##
 
But you could actually make them fields
 
but, when you chain operations such as .Rotate(90).Translate(1, 2).Scale(3), then you can group them together and at the end clone the matrix (using a copy constructor of a data class) and get the computed result
you cant make them fields
(i mean, you can, but you lose all advantages)
fields are overrated anyway
 
12:13 PM
right right right
I actually though of something like this
but I had expressions in mind
this is a really cool way of doing it
but it also implies making a new type for every operation right?
 
it implies making a new type for every operation that you want to have a decorated result for
 
Still a cool idea
you could use for a really heavy operation like maybe solving a huge linear equation or something
a bit out of my league though I'll stick to writing 400 lines of code to add two numbers
 
id say matrices arent that easy either
if I can avoid them, I would
in Java, I always used Joml for matrices
its simple but works really well
 
There's also Math.NET for C# so everything I'm doing has already been done
 
also... its a bit bigger
your class is what? a few hundred lines?
 
12:26 PM
a bit
 
org.joml.Matrix4f: 11,782
 
yikes
 
/**
 * Apply a rotation transformation, rotating about the given {@link AxisAngle4f}, to this matrix.
 * <p>
 * When used with a right-handed coordinate system, the produced rotation will rotate a vector
 * counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin.
 * When used with a left-handed coordinate system, the rotation is clockwise.
 * <p>
 * If <code>M</code> is <code>this</code> matrix and <code>A</code> the rotation matrix obtained from the given {@link AxisAngle4f},
ofc, 90% documentation
(for some methods)
others have it the other way around (often private methods)
 
That's actually hilarious
they have a reference to the wikipedia page about rotation that's incredible
Why would you ever write java if C# exists btw
Java should've been dead since C# 7.0 change my mind
 
@Wietlol You need some thunks
 
12:39 PM
thunks?
@H.Saleh can you believe someone would think the opposite?
"C# should've been dead since Java 8 change my mind"
this is still funny
 
 
@Wietlol Think of it as an unevaluated function. Much like a decorator, but doesn't need to be reevaluated upon every use.
It's how Haskell does lazy evaluation
 
but haskell is one big lazy blob
 
We need lazy evaluation in C#
 
we have lazy evaluation in C#
just not sane lazy evaluation
@KendallFrey is there a difference between a thunk and Lazy<T>?
 
12:50 PM
You can't use these thunks from user code, they're generated by the compiler.
 
but they are pointers to some object that contains (maybe) a cached value and a function how to load the value ?
 
They're roughly the same but in functional languages they often have a basis in lambda calculus
 
the only thing I am really wondering is how to achieve such pure lazyness while passing values over to other functions
 
In C#, without automatic laziness, Lazy<T> would be the way
Except you might need to add some monadic behaviour, not sure
 
val stuff: Stuff = findStuff() by lazy

printMaybe(false, stuff)

fun printMaybe(condition: Boolean, stuff: Stuff)
{
	if (condition)
		println(stuff)
}
 
12:53 PM
Due to the way expression trees can be lazy all the way down
 
for example, in this piece of code
(after being translated to haskell) would it evaluate findStuff() ?
 
no?
nvm
 
"evaluate" is a bit of a weird word here
But in this case, after printMaybe is called, stuff still contains an unevaluated thunk
 
how?
 
12:55 PM
how to which?
 
> stuff still contains an unevaluated thunk
I guess it could make sense basically
if you use a decorator
but a decorator only works on the methods of an object
 
When a value is created, it does the least amount of evaluation necessary, which is usually storing a thunk referencing the function
 
not the getter of a variable
 
Yeah, I think how it happens in Haskell is when you evaluate a thunk it replaces the thunk with the value
So essentially swapping the data behind the reference
 
hmm
so black magic
 
12:58 PM
Pretty much :)
It allows you to do things like infinite lists though, which is sometimes handy
In C# you need an enumerator to do that
 
you would need a special class for it
 
in Haskell it can be handled automatically by thunking
repeat x = x : repeat x
where a : [b, c] is [a, b, c]
 
Node<T> : List<T>
    with Node(head: T, tail: List<T>)
 
Just like that, but make the tail Lazy
Do you have any experience with lambda calculus (beta reduction etc)?
 
nope :)
I have experience with keeping things simple
and declarative languages
not cryptic repeat x = x : repeat x
 
1:04 PM
Which declarative language(s) do you use?
 
all?
none
 
I don't know of any mainstream general purpose ones
 
(i mean... none of them are declarative enough)
so I use all of them :D
 
I bet you don't use REBEL
That one's pretty declarative
 
I don't even know wtf you guys are talking about tbh
 
1:06 PM
nope, never used it
 
No one uses it ._.
lol
 
obviously
 
@SeaCharp Do you want to know?
 
The most obscure language I ever got fluent with was MivaScript, formerly HTMLScript
 
@KendallFrey If this feeling flows both ways.
 
1:07 PM
I don't want to know at this time in the morning....
: )
 
feel like talking about haskell, might delete later idk
 
lol
 
@KendallFrey if we dont evaluate the deletion result, you know it will never be deleted, right?
 
I was such a big MivaScript fan, and then someone introduced me to classic asp. It was 10 times better.
 
Anything with side effects gets an IO
 
1:10 PM
Which gives you an idea how bad MivaScript was.
 
IO is more explicit about what happens
@SeaCharp ...ouch
 
Miva was a non-compiled language in the beginning. They went compiled just before I got out of it.
It was really a shopping cart software company that started out as a language.
But I used to build all my e-commerce sites on it.
 
switching between interpreted and compiled is... weird
 
Now I use NopCommerce
 
@SeaCharp isnt that how Amazon grew?
 
1:12 PM
I dunno about Amazon.
 
a shopping website company with a very big IT team that wanted more?
 
You ever hear of NopCommerce?
 
nope
 
Biggest open source C# shopping cart system available
I use it for all my sites now, as a CMS
Anyone here doing any BI stuff?
 
2:05 PM
Speaking of .NET technology replacing garbage languages, you folks heard the Blazor news?
 
does it replace JS?
 
Blazor scares me.
 
2:26 PM
Yea, as I understand it it compiles to WASM so JS is barely involved in the whole thing, it's all c# now on front and backend. It's kinda like node js but the other way around
 
2:44 PM
only if you use C# everywhere tho, that is
 
I mean what kind of unhinged maniac uses VB in 2019
 
Java :p
 
EVEN WORSE
 
much better :p
obviously, I dont write plain Java
but its ecosystem is much more refined
when I write kotlin to a non-JVM target, I miss the natural feeling of having everything available
 
3:21 PM
Kotlin seems sweet, but I really dislike java because we're learning it at uni right now and coming to java from a C# background is like switching from an iPhone 10 to a clamshell
It's so bad you have to spell out every getter and setter very explicitly to the compiler
 
3:41 PM
depends on how you use Java
most schools dont teach it well
with ancient frameworks and not even going through the absolute advantages of Java
Java (since J8) has been making progress perpendicular to how early versions of Java worked
so Java (pre-8) teachers have a hard time teaching the Java 8+ functionality
I think one of the bigger advantages of Java is that you dont have to use Java to use Java
v0v
 
4:03 PM
Hi
 
 
1 hour later…
Nox
5:04 PM
this wcf thing is frustrating
why am I supposed to run an automatic pregenerating code assistant in vstudio to make a client, if when the code are pregenerated it throws this:
Error in deserializing body of request message for operation 'GoogleLogin'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'GoogleLogin' and namespace 'http://tempuri.org/'. Found node type 'Element' with name 'GoogleLoginAsync' and namespace 'http://tempuri.org/' ;
 
5:16 PM
Hello guys
Anyone with Xamarin.Forms knowledge ?
 
 
2 hours later…
7:28 PM
A question for everyone here: do you write C# professionally or for fun? Or maybe both or neither?
 
 
1 hour later…
8:43 PM
mostly professionally
 
 
1 hour later…
9:56 PM
Anyone here ever use IdentityServer
 
10:52 PM
Hello Experts,
I would like to know if anyone has expertise in WCF Service with CRM
 

« first day (3107 days earlier)      last day (1824 days later) »