« first day (3169 days earlier)      last day (1762 days later) » 
03:00 - 15:0015:00 - 00:00

mr5
3:38 AM
o/
 
mr5
4:02 AM
Why is FB API so crappy!!!?
 
4:31 AM
with entity framework
if i make a change to the database outside of the application
does the dbcontext pick up on that?
 
4:48 AM
hi
@cubesnyc what do you mean pickup on that
is your settings to the database
@mr5 are you here
 
5:01 AM
whatever
stupid question
i just hav ea long running console app that i need to expose as a webservice so i can built an interface for it using asp
 
mr5
@ChristianMatthew no
 
5:17 AM
do you know about base constructors
@cubesnyc a long running console app expose as an api... ummm you need some form of asp.net
 
mr5
@ChristianMatthew yep. you having issue again?
 
5:49 AM
Morning
@mr5 Why FB tho
Let it die already
 
mr5
Client's demand
@nyconing have you done any deep linking in your Xamarin Forms?
 
@cubesnyc Read up on rabbitMQ or similar
 
ive been reading web serivces and wcf literature
 
6:11 AM
Morning
 
@cubesnyc setting up a WCF service endpoint in a windows service or console app is pretty straightforward in plain .net. Haven't tried in core tho
 
i just want to make sure it will do what I want it to do
which is basically have the console app run, while the service methods are exposed, and interact with the classes in the console app when the service methods are ran from a service consumer
 
6:27 AM
!!dns
 
@CaptainObvious That didn't make much sense. Use the !!/help command to learn more.
 
Oh wow
!!learn dns <>https://pbs.twimg.com/media/DjYFaDBUYAAdqeT.jpg
 
@CaptainObvious Command dns learned
 
6:29 AM
!!dns
 
@mr5 I dont do Xamarin.Forms
 
6:44 AM
Good morning, people and peoplettes.
 
mr5
@nyconing Y_Y
 
good morning
 
ohai
 
mr5
var rootPage = "/" + (withNavigation ? nameof(NavigationPage) : null);
 
6:53 AM
morning conin
 
mr5
Would you do it, null or string.Empty?
 
string.empty should work
 
mr5
null also
 
I would use null
except that I wouldnt use null
 
mr5
wat
what does it mean?
 
7:01 AM
I would use a "missing" identification
but I wouldnt use null, because C# <8 doesnt have null awareness
instead, I use IOptional<String>
in your case, Maybe<T> would be easier available
i think there are some nuget packages that have it
 
That absolutely depends on the target here
Just wanna build a route? Doesnt matter, it'll be a string that says "/" anyway.
 
im talking in general
having null awareness is extremely satisfying
 
I'd go with string.empty since I have to actually think about what happens if you concat with null, so it's just easier to use string.empty.
He didnt ask in general though
 
iDunno what that code is
oh wait... the concat is in the expression
in that case String.Empty is much more preferred indeed
 
mr5
It adds to the list of pages.
Then join them using "/"
while removing empty elements in the process
 
7:06 AM
but the question is, do you want "/" as a valid value for rootPage?
 
mr5
The wouldn't be possible in my implementation though
 
you want it to be either null or /NavigationPage ?
then I would make the desicion explicit and move the "/" prefix inside the then block
 
mr5
yes
*/NavigationPage
 
(withNavigation ? "/" + nameof(NavigationPage) : null)
 
mr5
No
The "/" is required. It will followed by an existing page
I named the method .Absolute()
 
7:11 AM
so you want "/" or "/NavigationPage"?
 
mr5
The resulting syntax is like this:
var result = NavigationService.Absolute(withNavigation: false)
				.Push<TestViewModel>()
				.Push<AnotherTestViewModel>()
				.NavigateAsync();

var result = NavigationService.Relative()
				.Push<TestViewModel>()
				.Push<AnotherTestViewModel>()
				.NavigateAsync();
@Wietlol it would be either "/SomePage" or "/NavigationPage/SomePage"
 
so you want "" or "/NavigationPage"?
 
mr5
No.
 
because you append "/SomePage"
 
mr5
The only thing that would be added internally is the "/NavigationPage"
 
7:16 AM
this makes no sense
 
mr5
rest of page are determined by the user of this method
 
find out what you want as output of your method first
(ideally, write that in unit tests)
 
mr5
NavigationService.Absolute(withNavigation: false)
	.Push<TestViewModel>()
	.Push<AnotherTestViewModel>()
	.NavigateAsync();

would resolve into: "/Test/AnotherTest", while

NavigationService.Absolute(withNavigation: true)
	.Push<TestViewModel>()
	.Push<AnotherTestViewModel>()
	.NavigateAsync();

would resolve into: "/NavigationPage/Test/AnotherTest"
It's working already.
I'm just asking for ideas about null vs string.Empty when concatenating.
 
always prefer to avoid nulls when you merge values
what you have now is this: "/" + null
ideally, you would remove the nulls by this: "/" + (null ?? String.Empty)
except that in that case, null ?? is unnecessary so you should use "/" + String.Empty
merging your values and nulls always has confusing behavior, people have to test or look up what happens and find out if that was intended
a proper null aware language wouldnt even allow you to concat with null
 
mr5
hmm. good point
well, how about this:
var rootPage = "/";
if (withNavigation)
    rootPage += nameof(NavigationPage);
in trade of line numbers
 
7:25 AM
I despise mutation of variables tho
ideally, I have the construction of a variable on a single expression
(withNavigation ? "/" + nameof(NavigationPage) : "/")
 
mr5
but the "/" is actually required since I am going on an absolute navigation
 
if this looks ugly and weird to you, blame C#
 
mr5
I wish there is a conditional operator where we don't need to provide the else part
 
var rootPage = if (withNagivation)
        "/$nameof(NavigationPage)"
    else
        "/"
 
var rootPage = "/";
if(withNavigation) rootPage += nameof(NavigationPage);
 
7:30 AM
var rootPage = when {
    withNavigation -> "/" + nameof(NavigationPage)
    else -> "/"
}
 
mr5
I see Wiet really likes to write "primitive" types in upper case. You'd be bombarded with suggestions in VS for Mac if you code there.
 
why do you think I like to write "primitive" types in TypeCase ?
because they are types, damnit
you dont care if they are primitive, custom tailored, from the base sdk, a library or Jon Skeet
(ok, maybe you do care if they are from Jon Skeet)
anyway, you write them as Type
some languages dont even have a camelCase or lowercontinuescase variant
 
mr5
So why do you think the language designer did it?
 
because it is C#
on String.Empty, I think that was also MS convention to use String instead of string
for all static members
 
mr5
 
7:44 AM
Quick Fix > Convert C# to Kotlin
:p
 
Good morning all
I'm saving images in database as byte[] , how to compress quality to minimize size?
 
you dont compress quality
you compress size at a loss of quality
 
mr5
depends if it's an icon type or a background type.
You'd want to convert them into PNG or JPG.
 
you could... make the image smaller
but why do you want to compress images?
are they taking up too many terabytes on your database server?
 
@mshwf What are these images? What format are they? What size are they?
 
mr5
7:49 AM
I thought he's referring to an uncompressed image
 
you could... filter images with copyrighted content ;)
I never thought that one could come in handy
 
If we're all shooting at the question anyway, the database also has nothing to do with image manipulation.
 
Also, what are your goals in minimizing size? To remove pressure on DB with large tables? You can move the files to an external storage (file share, CDN, etc) and just store a link. Is the network traffic killing you? Make sure you save them at the absolute lowest size and quality you need.
 
@AvnerShahar-Kashtan this is my filter ("Image files (*.jpg, *.jpeg, *.jpe, *.png) | *.jpg; *.jpeg; *.jpe; *.png";) - size is unknown to me
 
Are you taking in user uploads and storing them, and don't want users to kill your storage? A good start is to limit a user upload's size. Then, use some image manipulation library (I think the built-in one can do very basic manipulation, but it can read image info), and discard images that are too large.
 
7:52 AM
but typically a big size (e.x, docs from scanner)
 
The point we're making here in our various shouted comments is that your question is too broad, and you'll need to narrow down your exact use case and goal.
 
> but why do you want to compress images?
this one might be important
 
it's a WinForms app using SQL database, the bak file reached 10 GB!
 
Two days ago I had a ticket issue because some dude was uploaden too large PDF's... Each page was an image. The answer given was "Scan docs as text please"
 
@mshwf come back when it reached 10TB?
imho, 10GB is not that much
but iDunno how many users your application has
 
7:56 AM
@mshwf What was the average file size? Can the user upload any file they want? Who's doing the scanning?
 
but most sql databases should be able to handle the amount of data
 
Out of curiosity, size of the .ldf?
 
@Wietlol It's not supposed to be that large, the "images upload" is a secondary feature, the app is very basic
@AvnerShahar-Kashtan the average *.bak size is 50MB
@AvnerShahar-Kashtan image files as attachments to orders (*.jpg, *.jpeg, *.jpe, *.png), it's not used a lot by all clients
@bradbury9 didn't look at this, we a usually consider only the bak file as a sign to the storage issues
 
@mshwf Check average stackoverflow.com/questions/507785/… You will notice if the problem is within some huge files or with average large files
 
thanks
 
8:05 AM
@mshwf Never understimate a faulty backup policy, I had a crashed production database with 0,7GB of data and 15GB .ldf
8 hours until we fixed the server
 
mr5
Can anyone give me a suggestion when to decide if I should make something a Service or just a Singleton?
 
why cant it be both?
in DI, make something a singleton if you want only one of it
in code, make something a singleton if there is no reason to have multiple instances
in code, singletons are services (just make sure you implement the interface of the service it represents)
 
mr5
The downside of using service injection is that it's limited to certain classes only.
 
0.o?
 
mr5
I wouldn't be able to access this elegantly in the code-behind files in Xamarin
Mostly targeted class are ViewModels in the framework I am using.
 
8:16 AM
lucky you
I wouldn't be able to use anything elegantly in the code-behind files in Xamarin
 
mr5
We don't do code-behind files either. I'm discouraging my colleagues too
But it's just an example.
So, if the Service is just meant to be single instance, should I just make it singleton only?
 
Morn o/
 
in your DI, sure
if there is a specific reason to only have one instance
 
mr5
I mean, don't create it as a Service but rather create it as Singleton class
 
with what reason?
 
mr5
8:24 AM
I'm not sure what would be the reason other than it's meant to be a single instance only.
Pros: accessible in the entire assembly
@Wietlol I think this is the answer
Since I can do: container.RegisterInstance(SomeClass.Instance)
 
does it have non-constant state?
 
mr5
no
 
then you could make it a singleton, sure
 
8:52 AM
is everyone ded this morning?
because if so
I'd like to add my back to that list of ded people/things
 
9:08 AM
hello
I have a controller that returns async Task<ActionResult<SomeClass>> and I'm trying to create a unit test. I want to mock the function inside the controller and I need to return an element of type Task<SomeClass>. In my test I have an element of SomeClass and I want to get an element of Task<SomeClass>. How can I do it? (.NET Core 2.1)
so, how can I create an element of Task<SomeClass> with an element of SomeClass?
I tried new Task<SomeClass>(theElement) and some similar things without success... :(
In other words: I'm trying to fix the error cannot convert from SomeClass to System.Threading.Tasks.Task<SomeClass>
 
9:41 AM
 
Rob
You can, but only if there are no edits made afterwards
So in this case, no
 
Ohh, so my later edit made it impossible accepting it, good to know
 
you can add it yourself and thank the other person
(i think)
 
Right @Wietlol
 
I managed to solve my question
 
Rob
9:45 AM
@xavier Task.FromResult(theElement)
Oh, just missed it :(
 
var SomeClassTask = Task.Factory.StartNew(() => SomeClassElement);
 
So DuckDuckGo using GoLang to kill Google :D
https://stackoverflow.com/jobs/273403/senior-backend-engineer-duckduckgo?med=clc&clc-var=4
 
@Rob Thank you anyway! :-)
 
Rob
@xavier That'll work, but it's a bit more overhead. FromResult creates an already-completed task with the result
 
9:47 AM
@Rob yes, I see. I already changed it and it works like a charm
thank you!
 
Rob
No problem
 
@xavier if you use Mocq, you can use .ResultAsync(new SomeClass())
 
@Wietlol I'm sorry but I don't see how...
 
do you use Moq ?
 
yes
what I do now is that:
 
9:51 AM
you use .Setup(blablabla).Results(blablabla) ?
 
myClassElementMock.Setup(x => x.UpdateMyElement(variable).Returns(MockTask)
 
or returns, ye
there is also a ReturnsAsync()
 
if I do:
myClassElementMock.Setup(x => x.UpdateMyElement(variable).ReturnsAsync
I don't see how I can make it work
 
why not?
 
inside ReturnsAsync, should I put my MockTask?
 
9:53 AM
nope, just the value
so, SomeClassElement
 
(I don't know if it's clear enough but I'm not very confident with Tasks yet...)
 
are you confident with your IDE?
it should tell you what type arg is in ReturnsAsync(arg)
 
@Wietlol it works!
 
ok
 
and it's even easier cause I don't have to create the Task
thanks a lot!!!
 
9:55 AM
ye
Async is amazing
 
@Wietlol not really :'(
 
it only resulted in duplication of every single method in C#
but hey, it is amazing because it solves stuff that was never supposed to be an issue in the first place
 
yes, I see
I had seen the ReturnsAsync but I thought I expecting a Task
 
(you dont have to star stuff that helped you in particular, starring is if you particularly liked a message and want to make sure other people in the room also see it)
hmm... that is actually a very good point
ReturnsAsync does the exact opposite of all other DoStuffAsync methods
didnt think of that until now
 
@Wietlol (it was helpful to me, it might be helpful to somebody else (probably not in this full-of-experts-room, but still) and it gives badges (although I assume you have them all)
 
9:59 AM
I have badges?
:p
 
Talkative badge: Post 10 messages, with 1 or more starred, in chat
 
hmm
 
if you didn't have that badge, after my star I guess you have it. But as I said, I suppose you already have it
 
ye, I guess I have some badges related to the chat
 
10:15 AM
actually, I think SO community is a bit reluctant to encourage new collaborators with upvotes and so on. Sometimes I have the feeling only for very high-quality questions/answers (and I'm not talking about my mediocre contributions but in general)
@Wietlol I'll have to read a bit about that because now it seems a bit incomprehensible to me...
 
@xavier I just wanted to accept a new user's edit suggestion (was a good one), couldnt do it so I thanked its contribution
Its true that in other communities its easier to get rep tho
BTW, you freakin spoilers, stop starring GoT! I am 1.8 seasons behind schedule...
 
how can you be so behind and like GoT so much?
 
I wanted to read the books and stopped when serie started being creative
recently my sister made me see some episodes and I said myself "screw him, im watching them and if he writes the books will read them also"
 
beware of the internet, for the internet is dank and full of spoilers
 
Yesterday saw the S07E02 in the bluray. 5 episodes + 1 full season to go
is dark
 
10:28 AM
if you dont want spoilers, dont go on the internet
is dank
 
maybe I shouldn't spoil season 8 ideas, but season 7 is fair game
 
thought dank was a typo. Not sure if there is GoT Season 8 in bluray
 
or it would have been if you didn't tell me you hadn't watched it yet
 
will check in a couple of weeks
 
If you are not up-to-date with GoT it is your own fault if it is spoiled for you
 
10:31 AM
In my company developers were angry with potential S08 spoilers
 
there was a gap of 2 years in order to catch up to the end of s7
 
Yeah, but I got a reasonable reason to be behind several seasons
 
and what be that sir
 
its R.R. Martin's fault, not mine
lazy ass
 
that you wanted to read the books
eh
you could have read the books and watched the show at the same time
 
10:33 AM
I did, until the show changed the book's plot
then I stopped
So far, I managed to skip spoilers somehow. The only S8 feedback I got is "we dont like the ending, kinda poor"
 
I liked it
I won't give away anything, but I enjoyed it
also props that they had the balls to do it that way
 
I am in no way fanatic to plot change, with X-Men's dark phoenix they screw it badly the comics history, and I said "poor actors, but it has some good things
But I liked Song of Fire and Ice books, and decided to stop when the plot twisted
 
Season 8 Ep 3 is where it just started to go down hill
the episode itself was ok, could have been better (I'D LIKE TO SEE THINGS THANKS)
somehow i have Thus, I'm of the opinion that copied to my clipboard
i don't know how
 
11:01 AM
how about [ctrl]+[c] ?
 
Well yeah
but i don't know where the fek its come from
 
@CaptainSquirrel did you see chrys' version of that?
 
@CaptainSquirrel Maybe your computer has developed consciousness and is trying to communicate with you via the clipboard.
 
@Wietlol who?
@AvnerShahar-Kashtan i hope not
If it is, i'd like to know why it is giving me shit about trying to install sitecore
 
@CaptainSquirrel It's trying to communicate. Via clipboard text and error messages.
 
11:07 AM
chrysreviews.com/index.php/game-of-thrones (site appears to be down atm)
 
It doesn't know any better.
 
but here is the S08E03 recap: imgur.com/gallery/xCdJtvZ
 
There's only so much troubleshooting I can do by myself @AvnerShahar-Kashtan :(
@Wietlol Don't have time to look through the entire thing, but that looks hysterical
 
i think there is one for each episode since like season 4 or something
but his site appears to be down
that is where they are all listed
but I guess you can google the imgur galleries
 
!!mute Wietol xD
 
11:13 AM
@bradbury9 That didn't make much sense. Use the !!/help command to learn more.
 
11:34 AM
> Wietol
 
12:09 PM
god sake guys his name is WITLOL
 
-_-
 
hahah
 
Weitlol don't be so upset
 
arrgghhh
 
12:50 PM
lol
 
there is no need to be upset
 
user10864482
1:17 PM
good morning
 
good morning
@user23333 I wanted to ask you is transitioning a thing or im gonna end up scrapping my old project?
for switching to mvc which seems necesarry at this point
I plan on stepping through some mvc tutorials today. and then transitioning/scrap and rebuilding towards the end of the day into tomorrow. assuming im still here tomorrow..
 
user10864482
@SamuelWakeman I think you would be better served starting a new mvc from scratch. Chances are you might copy paste some part of your code but yea not sure if there is such thing as transitioning from non mvc to mvc as much as start over and keep some model
 
sounds good. thanks for all your help the past couple weeks! you'be been a gem!
i think the models and cshtml will be copyable but the rest....
 
user10864482
@SamuelWakeman you are welcome. I'm glad I could be of help to you and don't forget; give back to the SO community by giving back when you can ;)
 
definitely will. I would give back more If I had a larger brain
as is I have a bit of a tiny brain
 
user10864482
1:25 PM
@SamuelWakeman I'm sure I told you before but don't diminish yourself , if anything we all have the same brain size. I don't see you differently then I see myself. What you have been trough, we been there too
 
ty :)
 
@SamuelWakeman what are you transitioning from?
web forms? i.e. aspx pages?
 
razor pages
in my defence the documentation for asp.net makes it sound like a ll the rage
 
Oh I thought MVC was Razor Pages. I am obviously too late to the party, no idea what['s going on :)
 
So 5 minutes ago, I left work for today. Before I left, 3 people stood with me on a stand-up desk to figure out a problem breaking our release on Tuesday. My exit went something like "ok you know what I'm going home, it's your problem now", made a new branch with the current progress, committed everything with "WIP fix this shit" and left.
 
1:33 PM
razor pages make you have sort of a false controller for each page
 
(my girlfriend is sick at home and everyone knew I planned on leaving at 3)
 
my sympathies @Squirrelkiller
@HollyStyles if you want to enjoy the learning process llike I am try checking out the documentation here: docs.microsoft.com/en-us/aspnet/core/?view=aspnetcore-2.2
 
@SamuelWakeman so you want MVVM not MVC?
 
what do you mean?
 
Uhh pretty sure MVVM is a special case of the MVC design pattern, but in this context "MVC" refers to the framework "ASP.NET MVC"
 
user10864482
1:36 PM
Microsoft introduced MVC pattern trough ASP.net mvc in like 2009-2010
 
*framework
Microsoft introduced the MVC *framework
 
basically im transitioning from MVVM (razor pages) to traditional mvc
 
Oh Core Razor Pages! (penny drops)
 
You're switching Frameworks or patterns?
 
patterns? Still asp.net just mvc instead of MVVM
 
1:40 PM
Damn I assumed you'd actually switch Frameworks, now I have to process...
 
process what
?
 
What the hell we're talking about
 
user10864482
well, technically by moving from asp mvvm to asp mvc you are switching both pattern and framework
 
user10864482
I think
 
user10864482
1:43 PM
a pattern is like a set of rule and a framework is like code with enforcement of that set of rules
 
Technically, that is switching Frameworks. Switching Frameworks is a technical step, changing dependencies and stuff.
 
When you said "false controller" I extrapolated that to mean your Y problem may actually be: You have several domain models you need to juggle for a single view-model
 
Switching patterns is just... How your data flows.
 
user10864482
on the good side of things, the code is pretty similar. I think the biggest thing is how route are processed and stuff
 
user10864482
I love how route are processed, coming from a php background before it went oop.
 
2:23 PM
Implementing your own router in PHP is (=====) always fun.
 
user10864482
@MikaelDĂșiBolinder indeed /s
 
@MikaelDúiBolinder your first mistake was using php
your second mistake was allowing your first mistake
 
user10864482
I think php is the definition of a nightmare
 
I once tried to use namespaces in PHP. I haven't used PHP ever since then.
 
My first experience with back end web stuff was PHP
for basic shit at least
then it was python
PHP is like someone trying to make a house out of shit
Yeah, you might have a house, but if you move it everything falls down and covers you in shit
 
user10864482
2:29 PM
@CaptainSquirrel me too, and for front end it was adobe flash with cs5
 
I just used flash to make animations :D
 
can anyone help me by answering this que:stackoverflow.com/questions/56688159/…
 
user10864482
my first 'website' (flash for website, php for form) was for my boss. At the time he was getting married and wanted a website with music (celine dion). Gosh I listen to that song far more then I needed, while troubleshooting actionscript shit.
 
@HirenPatel are you able to switch to WPF or make it a hybrid? Think Microsoft pretty much perfected the hybrid solution in the more recent releases.
 
user10864482
@HirenPatel an easy solution could be to have an overlay window taking the whole screen, from a different thread. The shared var could be a bool with a lock; when set to true it 'unlock' the overlay window. Would it work for you OP? Also yea, WPF would be better I think too
 
user10864482
2:33 PM
and then just use a user control. WPF for the win
 
@MikaelDúiBolinder ,I'm only want to use Windows Forms as my requirement.
@user23333 , can you please provide me the psude code for a solution that you provided
 
user10864482
@HirenPatel don't want to argue with your requirement but I like to point out that form is obsolete
 
@user23333 , but my application is on production so I can't change it to WPF.
 
user10864482
53
A: How do I show a "Loading . . . please wait" message in Winforms for a long loading form?

AshUsing a separate thread to display a simple please wait message is overkill especially if you don't have much experience with threading. A much simpler approach is to create a "Please wait" form and display it as a mode-less window just before the slow loading form. Once the main form has finis...

 
@HirenPatel you can make it a Forms/WPF hybrid with just a few clicks. It's well-supported by Microsoft.
 
user10864482
2:53 PM
@HirenPatel I understand. Please tell me if the provided link do the job for you. Is your app thread safe already or is everything running in the same thread?
 
@HirenPatel use ` instead of ** to highlight code in-line in your questions.
 
03:00 - 15:0015:00 - 00:00

« first day (3169 days earlier)      last day (1762 days later) »