« first day (2579 days earlier)      last day (2362 days later) » 
06:00 - 16:0016:00 - 00:00

mr5
6:45 AM
o/
\o
\o/
Is there any value interpolator I can already use out of the box in Xamarin or in C#?
Like, await Interpolator.Linear(ref myValue, toValue, duration)
 
o/
what the heck is an interpolator?
do you put values in between or what
 
mr5
value animator?
as opposed to direct assignment, the new value will be "interpolated" from starting value to new assigned value with a duration
 
I haven't worked with animation, so I can only grasp the rim of what you're saying
if I got this right, it's something that generates values over time that go from A to B at a steady pace
for example if you go from 1 to 5 you may get 1-2-3-4-5
is that it? because it sounds easy but I feel really stupid right now
 
mr5
7:01 AM
yes that's what I'm talking about
there's an equivalent classes I found on the net but I believe it's available in WPF only:
var animator = new DoubleAnimation();
animator.From 0;
animator.To = 100;
animator.Duration = 1.5; // seconds
 
ohayou
 
7:56 AM
Anyone have any experience generating C# code using Roslyn? I'm trying to get it to generate auto properties for me the way I want them to.
I'd like it to be a one-liner.
 
8:29 AM
@WilliamMariager put it in a file without any of your own code
youll never have to look at the uglyness
except if your own code is equally as ugly
 
It's already in a partial class, but I'd still like it to generate it properly if possible.
 
its auto-generated, you shouldnt care
unless its visible outside of the application
 
Good day everyone :)
 
everyone day good
 
Morningerinino
 
8:40 AM
@WilliamMariager No experience with Roslyn, but doesn't it auto-format snippets based on the workspace settings?
 
Fucking autocorrect
 
@RoelvanUden That might be it. Right now I'm not using a workspace. I'll see if I can make an adhoc workspace with the right settings.
 
Gotta love latin expressions
 
I'm struggling to find a solution here
[DisplayName("Standard UoM")]
public int UoMId{get;set;}

[DisplayName("Purchasing UoM")]
public int UoMId{get;set;}

public virtual UoMs UoMs{get;set;}
What's the best solution to achieve multiple foreign keys with the same class model?
 
8:54 AM
foreign keys in C-harp?
 
@mark333...333...333 what do you mean with "multiple foreign keys"?
treat your OOP code as an abstraction of your E/R model
 
@Wietlol No, in D flat.
 
I prefer minors.
2
 
public class Items{
[Key]
public int ItemId{get;set;}

[DisplayName("Standard UoM")]
public int UoMId{get;set;}

[DisplayName("Purchasing UoM")]
public int UoMId{get;set;}

public virtual UoMs UoMs{get;set;}
}
here's my sample class model
 
@WilliamMariager Star worthy.
 
8:59 AM
It's error because I already used the UoMId twice
But I want the first UoMId be like the Standard UoM and the second UoMId be like Purchasing UoM. The UoMs is another model with UoMId as the primary key
 
Tom
How do you name/organize classes with database CRUD operations? I'm not yet familiar with the repository pattern, but I want to organize those files already.
 
@WilliamMariager how about major?
 
@mark333...333...333 Indeed, because you are using the same name. You either have to use an attribute tag to refer to a different table field or use a different namespace
 
do you have sample codes or references? @HéctorÁlvarez :)
 
@mark333...333...333 Sorry but I've been developing VB6 for so long I even uninstalled VS2015
 
mr5
9:07 AM
@mark work on your variable naming first. My eyes hurt
 
becuase I needed room for a virtual machine that supports that abandonware trash
 
Tom
help :p
 
gives halpz to Tom
 
mr5
sending help...
DONE!
 
I can't escape from this !

IsValid =
!(string.IsNullOrWhiteSpace(ContactData.receiver_email) &&
string.IsNullOrWhiteSpace(ContactData.message_subject) &&
string.IsNullOrWhiteSpace(ContactData.message_name));
I want IsValid to be true if they all false
            IsValid = string.IsNullOrWhiteSpace(ContactData.receiver_email) == string.IsNullOrWhiteSpace(ContactData.message_subject) == string.IsNullOrWhiteSpace(ContactData.message_name) == false;
 
9:18 AM
@MohamedAhmed and the problem is...?
 
yeah looks fine to me
 
the last line solved it
I struggled with the first block of code
 
IsValid = new[]{string.IsNullOrWhiteSpace(ContactData.receiver_email), string.IsNullOrWhiteSpace(ContactData.message_subject), string.IsNullOrWhiteSpace(ContactData.message_name)}.All(x => x == false);
 
@MohamedAhmed try with || instead of &&
 
also De Morgan's law
 
9:20 AM
organ's law?
 
In propositional logic and boolean algebra, De Morgan's laws are a pair of transformation rules that are both valid rules of inference. They are named after Augustus De Morgan, a 19th-century British mathematician. The rules allow the expression of conjunctions and disjunctions purely in terms of each other via negation. The rules can be expressed in English as: the negation of a disjunction is the conjunction of the negations; and the negation of a conjunction is the disjunction of the negations; or the complement of the union of two sets is the same as the intersection of their complements; and...
 
no programming example
bad article imho
 
@milleniumbug Jesus why haven't I seen this before? Guess those are the perks of being an engineer
theory
 
why they always have to invent these really weird characters?
 
@Wietlol Not at all, it's as complete as it can be
 
@Wietlol it's called notation, and it serves the purpose of making text quickly readable
 
meh, the "weird characters" are as arbitrary as whatever syntax C# introduces
 
at least it uses characters that exist on my keyboard
 
the only difference is that some people are more familiar with one and not so familiar with the other
 
ofc for a very obvious reason
but still
 
9:26 AM
English has a huge problem when it comes to spreading around, it takes longer to understand so many things that are obvious if you come from other regions
specially danish people have a really easy time learning other languages
 
mr5
(!a && !b) == !(a || b)
 
(not a and not b) == not (a or b)
 
@MohamedAhmed !(a && b && c) is equivalent to !a || !b || !c (see the wikipedia article above), which is not what you want
 
mr5
where the latter is more optimized, but this might have already implement by the compiler for us
 
not c-harp, but I wonder if people will have issues with it
 
9:32 AM
you want either !a && !b && !c or !(a || b || c)
@MohamedAhmed This is essentially the same as !(a ^ b ^ c)
which also isn't what you want
 
9:45 AM
@milleniumbug It's equivalent if a, b and c aren't expressions with side effects, or, more specifically, if you disregard the short circuit evaluation
 
One does not simply disregard the short circuit and call themselves efficient
 
there has only ever been 1 moment where I wanted the single or operator
I find short circuit a bad name imho
its the difference between a boolean expression and a value operator
 
@Wietlol Me too, when I wanted to see what it did for the lols. The rest of the time you'll want to stop, specially if you might be dealing with nulls afterwards to avoid try-catching unnecessarily
if you save as small as 2 ticks for short circuiting, it was a worth extra stick on that OR
 
in my case, the non-short circuit one is even faster
so...
welcome to the world of things that literally dont make any sense
 
@Wietlol Please elaborate
 
9:58 AM
remember that short circuiting is essentially branching, and branch prediction can get confused if your input isn't very predictable
 
@HéctorÁlvarez i had 2 operations and needed both their values.
then there was an if statement that had the expression if both results were true
the bitwise operator is faster than putting them inside variables and then doing the short circuit
registry behavior and shit
 
It's pointless to check (A & B) if you know A is false already, because it doesn't matter what B is, the expression will be false
but you have to retrieve B too
you check it faster, but waste time calculating B, which is unnecessary
 
i still needed the value of B
 
if evaluation of B is faster than branching, short circuit loses
 
at least... i still needed to run the expression that would result in B
 
10:03 AM
Right, in that case it makes sense
I usually design workflows to avoid that kind of circumstance
then again, I either deal with .net frameworks or low level machines that have 32MB flash memory
 
I assume the latter are "fun"
 
Segmentation faults are fun
 
yeah tell me all about it
(j/k I write C++ too so I know the pain)
 
the not-so-fun part comes when you write out of bounds and it lets you, because you are Shakespeare and your writing capabilities are beyond comprehension
so you edit the call stack and discover the callback of where the hell am I exception
may I add not intended
I just found out that VB6 stores queries in a data environment object, and those queries are stored as command objects, and you can't sort your commands unless you edit the file manually, which is a half-assed XML of sorts with custom MS formatting from year 1995
 
@milleniumbug i write llvm, dont talk to me about pain
 
10:13 AM
Anyone know if it's possible deserialize JSON into an existing object?
 
@WilliamMariager Of course it is
 
@WilliamMariager ofc, just write your own lib
;)
 
JsonConvert.PopulateObject was what I needed.
 
I believe you can deserialize JSON using any existing lib, like newtonsoft's
 
The specific requirement of doing it into an existing object was the challenge.
Everything I was finding just created a new object with the data.
 
10:15 AM
Is there any way to use a referenced dll that it's in a fixed folder outside the main program? I have seen ways but they seem to be for dynamically referenced dlls, in this case I want to load them statically, but from another folder. Is this possible? Should I play with the reference HintPath from the csprj?
 
@juagicre This sounds like loading a registered library from e.g. System32
 
You can use AppDomain.CurrentDomain.AssemblyResolve, but it should be the last resort.
 
@HéctorÁlvarez but I was able to 100% guarantee my answer without any knowledge of any existing libraries
 
@Wietlol But you are reinventing the wheel
 
@HéctorÁlvarez: I am just sharing some dlls among two programs, nothing registered but from my own production :)
@WilliamMariager This sounds quite interesting... I will check this... being last resort... you mean there are better solutions, maybe. Here my problem in short: my solution has 2 products, sharing a lot of libs coming from other projects from the same solution... and I really want those libs to be shared by both products.
 
10:31 AM
you think aaa and bbb and ccc are all false?
bbb is true :'(
 
scroll up
 
What kinda mess is that ... ?
 
 
mr5
@MohamedAhmed reminds me of memory corruption I made during C++ days, but sadly, it isn't applicable in C#
 
1 hour ago, by milleniumbug
@MohamedAhmed This is essentially the same as !(a ^ b ^ c)
 
10:36 AM
oops I just figured it out, it compares every two pairs !
 
we had a discussion about it
 
I can't google this operator ^ , google can't recognize it. what is its name ?
 
thanks
 
also just scroll up the transcript of this room already, I already listed like 2342343242 solutions to your problem
 
10:41 AM
@juagicre You want to encapsulate them and reference them as assemblies. I suggest you copy them to your project, one instance per solution to avoid version mismatch over time.
 
@mr5 Memory corruption isn't applicable in C#?
 
well, it isn't
unless you try very hard
 
Once you deal with interop, it becomes very applicable.
Wouldn't call that trying hard.
 
interop between safe memory language and unsafe memory language causing memory corruption can easily be blamed on the latter vOv
 
Morning all !
 
10:46 AM
I suppose you could pass random addresses to Marshal.Copy and this wouldn't involve unsafe code nor P/Invoke
 
@Mathematics o/
@milleniumbug My cat's name is Mittens
 
Tell Mittens I said hello
Also holy shit for the first time I saw DDG being superior to Google
 
good morning
 
@milleniumbug not superior, just different syntax
google is much more powerful, you can use most symbols as operators to optimize your query, it's not just a search box
it's an engine
 
guess what DDG is
also quoting ^ doesn't help in Google case so there
Clearly Google is riding their monopoly and not bothering to improve shit
 
10:55 AM
what can we call a code that is powerful that can be reused a cross other projects ?
 
"reusable code"? dunno, your question is underspecified
 
@MohamedAhmed encapsulated?
a repository?
a library?
@milleniumbug You can't search for symbols in google search apparently...
 
I don't know, i though there is another terminology for this
 
I was expecting something like \^ to work
 
@MohamedAhmed composable maybe
 
11:12 AM
thaht's not what i'm looking for...

false ^ false ^ false = False
false ^ false ^ true = True
false ^ true ^ false = True
false ^ true ^ true = False
true ^ false ^ false = True
true ^ false ^ true = False
true ^ true ^ false = False
true ^ true ^ true = True
Press any key to continue . . .

I want a unique result for: false, false, false
 
@HéctorÁlvarez \o
 
scrooooooooll uuuuuuuuuuuup
 
:D.. ^ didn't work
 
2 hours ago, by milleniumbug
IsValid = new[]{string.IsNullOrWhiteSpace(ContactData.receiver_email), string.IsNullOrWhiteSpace(ContactData.message_subject), string.IsNullOrWhiteSpace(ContactData.message_name)}.All(x => x == false);
2 hours ago, by milleniumbug
In propositional logic and boolean algebra, De Morgan's laws are a pair of transformation rules that are both valid rules of inference. They are named after Augustus De Morgan, a 19th-century British mathematician. The rules allow the expression of conjunctions and disjunctions purely in terms of each other via negation. The rules can be expressed in English as: the negation of a disjunction is the conjunction of the negations; and the negation of a conjunction is the disjunction of the negations; or the complement of the union of two sets is the same as the intersection of their complements; and...
2 hours ago, by milleniumbug
@MohamedAhmed !(a && b && c) is equivalent to !a || !b || !c (see the wikipedia article above), which is not what you want
2 hours ago, by milleniumbug
you want either !a && !b && !c or !(a || b || c)
2 hours ago, by milleniumbug
@MohamedAhmed This is essentially the same as !(a ^ b ^ c)
2 hours ago, by milleniumbug
which also isn't what you want
since I'm tired of telling you to scroll up
 
11:32 AM
@HéctorÁlvarez Google will actively ignore several symbols, which makes it quite annoying to search with in some cases.
 
@MohamedAhmed don't you dare skip this
 
Don't you dare!
 
@WilliamMariager I sent them feedback, let's see if they do something to fix that broken feature
 
That's unlikely, it's been a problem for as long as I've used Google.
 
@milleniumbug LINQ!!
 
11:45 AM
@MohamedAhmed Internet Explorer has arrived!
 
power-cut
 
You didn't scroll up and kept asking away :)
 
http://localhost:17418/api/prem/getwithasync
why this won't work
 
please try ...api/Prem...
with capital P
 
"won't work" have you paid it the salary for this month
 
11:51 AM
@HéctorÁlvarez thanks but still won't work
 
Do you even understand my question?!!
 
that said, be specific with your "won't work" statements
 
nothing works above
 
@milleniumbug lol
 
I will not use LINQ for this
 
11:51 AM
@Mathematics are you requesting through Get? Maybe you are mistakenly using Post?
 
well it's not hitting debug on that method
 
there must be simpler way
 
making a request throw browser
 
2 hours ago, by milleniumbug
you want either !a && !b && !c or !(a || b || c)
you know what, fuck it
have fun dealing with high school boolean algebra
 
@Mathematics access your (i assume) RESTful API and check the actual path, every time I see hardcoded routes I get the shivers
 
12:00 PM
sorry I was wrong ,, thanks for your help
 
War
12:17 PM
0
Q: Why does kendo UI break when extending Array.prototype?

WarI have an existing complex page with a bunch of kendo controls on it. One of those controls is a treeview. When I add this to my page ... Array.prototype.move = function (old_index, new_index) { if (new_index >= this.length) { var k = new_index - this.length; while ((k--) + ...

 
@HéctorÁlvarez Just trying to test something quickly
 
@War Sorry man, I've never used Telerik's software, although I might do at some point in the future
 
War
np
i think this is a bit of an odd one
i suspect someone from telerik might have to resolve it
 
12:32 PM
Even tried these but it won't reach debug endpoint
[HttpGet]
[Route("GetAsync")]
public HttpResponseMessage GetWithCallback()
{
    Task.Factory.StartNew(() => DoWork());
    return new HttpResponseMessage(HttpStatusCode.Accepted);
}
http://localhost:9291/api/Prem/GetAsync
 
War
try that
how is the controller defined?
and your routing
 
just usual stuff
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvc();
        }
default routing
[HttpGet]
[Route("GetAsync")]
public HttpResponseMessage GetAsync()
{
    Task.Factory.StartNew(() => DoWork());
    return new HttpResponseMessage(HttpStatusCode.Accepted);
}
changed it to this without any effects
    [Route("api/[controller]")]
    public class PremController : Controller

that's how controller looks like
 
War
12:53 PM
[Prefix("api/Prem")]
public class PremController : Controller
{
	[HttpGet]
	[Route("GetAsync")]
	public HttpResponseMessage GetAsync()
	{
		Task.Factory.StartNew(() => DoWork());
		return new HttpResponseMessage(HttpStatusCode.Accepted);
	}
}

localhost:9291/api/Prem/GetAsync
 
I am using .Net core 2, Prefix is in another library
 
yay code in chat
 
@Wietlol it's C# room what else would you expect lol
 
links to paste.ofcode where C-harp code is written
 
War
i would if it was any longer
but given that it's a a room about code ... i'd expect to see code here
 
1:02 PM
id expect to see sharp here
 
War
@Mathematics i aint started using asp.net core yet ... feels incomplete atm
 
@Wietlol the puns are real
 
@War yeah most of .Net core 2 is
 
1:21 PM
If I need async collections, what are my options? Reactive Extensions? I still want it polled rather than pushed.
 
IEnumerable?
 
Pretty sure IEnumerable is no where near async. :P
 
true
concurrent queue?
(iDunno which implementation would work)
adding stuff on async methods and having a deque method that returns a Task<T>
which you can wait for
 
What I need is basically a collection that isn't populated until needed, preferably one item at a time.
With reactive extensions I could subscribe to the data and then trigger a fetch.
Not very clean though.
 
2:03 PM
@WilliamMariager i think you just described an IEnumerable using yield return
its a collection that isnt populated until needed, one item at a time
you should then use var collection = getStuffUsingYieldReturn().Iterator();
iirc
 
Still isn't async
 
you dont want async
 
I don't?
 
you want it to not do shit until you want to have an item
maybe, you can make an implementation of an iterator and pass it the enumerable and the iterator will return Task<T> instead of T
that will make it as async as possible if I understand what you say
 
That's along the lines of what I was thinking too. An iterator returning tasks and then I just keep awaiting each task.
 
2:10 PM
Smells like it needs Rx
 
Rx is life
Better even, than Haskell
 
blasphemy
 
2:30 PM
I <3 Rx
 
I wish there were more use cases for it
 
@Wietlol You want to reimplement IObservable with that. Just use Rx instead
Ix have much less use cases, tho I would like to check out them.
@WilliamMariager why Rx is not clean in Your oppinion?
 
Rx is very clean
 
In Rx You could make a cold observable, which is still polled, but You manage the generator.
 
But for this purpose, setting up a subscription and then trigger a fetch.
I feel like it would result in more work.
But then again, Rx is awesome.
Writing more Rx might improve my quality of life.
 
2:36 PM
I'm not sure, but seems like You need a cold observable
how is this triggering work?
 
It's just a web service, so something should initiate a fetch.
 
like web crawler?
 
It's just a basic REST/JSON API.
Lets say I get results in batches of 10 at a time.
Rather than waiting for all ... 1000/10=100 requests to complete, it'd be nicer it would just start processing while downloading in a separate thread.
Rx sounds like the obvious choice
 
@ntohl what did I just read? Oh god I didn't understand a single word in there, should I start reconsidering my status as a developer?
 
Yes
Even @mikeTheLiar knows what Rx is.
 
2:42 PM
according to google it's some sort of drug
or something related to medical prescriptions
 
Indeed
You're not far off
It's a sort of anti depressant.
You use it, and you'll be happier
 
IObservable<string> fetcher = Observable.Create(obs =>
{
    var client = RESTAPI.Create();
    foreach (var string in client.Read(url))
        obs.OnNext(string);
});
when You subscribe to fetcher, it will start fetching data
 
Really?
Nice
That's pretty simple
 
Hot to check if an event is hooked up to an object before I subscribe to it?!
 
OK I'm reading a bit on Rx.NET and it looks pretty simple, you just got wicked with all that terminology
 
2:44 PM
Simple?!
That's the curse of Rx
 
it's NOT simple
 
All the samples make sense and it's awesome. But then you start using it and realize whatever you thought you knew, you didn't.
 
this for example:
cmbo.SelectionChanged += cmbo_SelectionChanged;
 
^ I kill those all the time
 
well I mean the concept is simple, it lets you handle async data streams
it might be more or less complex when it comes to developing, but the idea is simple
and it looks great to be honest
 
2:47 PM
... Yeah. Just async data streams... With all kind of combination of what happens, when 1 stream times out. What happens when You want some streams to die silently, and some die killing the whole process
what if You have to do it on some background thread, but Your result must be shown on the dispatcher
and so on
 
If I got this right you could run some statistics on how often someone talks about Stephen Hawking across social networks for the last 5 minutes
@ntohl I wouldn't use that technology for background processes... I would go for something like SignalR or similar stuff for that purpose
 
@WilliamMariager ohh. That Observable.Create needs a Func<T, IDisposable> parameter. Use System.Reactive.Disposable namespace to create one of Your needs
@HéctorÁlvarez You can use some SignalR connection as the source of the IObservable, but it's much easier to combine, than delegate result with Rx.
 
MVVM is a hell of a design pattern as well, to be honest I hate them all except MVC
And I don't quite love MVC either, so much stuff undefined and open for discussion
 
MVVM 4 lyf!
 
learning curve; L = ln 2e+37
 
2:55 PM
^ tons of stuff come from async sources, You combine them with Rx, than bind it in MVVM WPF.
 
seriously now, what's your preferred design pattern? It seems like many people go for N-layer in desktop, MVC for webs and no idea about the rest
 
MVVM always, for anything
 
MVC is part of the N-layer
so is mvvm
 
3:10 PM
they are architectural patterns, not design patterns
and about MVVM I just consider it inefficient
 
3:27 PM
anyone has had problem, where EF Core generates whole database migration, instead from latest migration?
 
3:39 PM
@HéctorÁlvarez how do You make unit tests? You need to include all the UI stuff into the test proj to test anything?
 
Is there a particular UI thing you want to test?
I'll usually only test functionality
 
@WilliamMariager you're not from TDWTF, are you?
 
@HéctorÁlvarez exactly MVVM will separate functionality for You
 
@ntohl I don't get what you mean, you have a test lab project to attach to your MVVM project so they work in tandem
but you have to maintain those labs, which most people forget about
like "hey I wrote this test unit 3 months ago, it should still apply" and then it proceeds to crash the whole thing
 
You write those 3 unit tests to document how should Your functionality work. And maintain that state, so no inconsistent state comes up. If You have something that crashes tests, than You have trouble in Your hand. You will have to write patch to redo some stuff, that made the DB or something inconsistent.
 
3:56 PM
Ideally you write those unit tests to automate validation and verification of a specific module in your project, documenting stuff is secondary. However, any changes to the base functionality when test cases were developed may not be compatible, e.g. the client specifies the "remove all" button leads to error and thus it has been removed. --> Test case for remove all returns object not found exception.
I'm a scrub that doesn't trust others to maintain anything, a scrub doesn't use test cases
 
06:00 - 16:0016:00 - 00:00

« first day (2579 days earlier)      last day (2362 days later) »