« first day (2732 days earlier)      last day (2218 days later) » 

user5500750
5:40 AM
Is the WebAPI 2 the latest system for creating APIs in ASP.NET? If I create a project by going to New Project > ASP.NET Core Web Application > Web API I see signs that I am probably using the old way of doing it.
 
user5500750
For example; I see that I can only install and create controllers based on OData V3
 
user5500750
It also has MVC5 controller options.
 
user5500750
So I am confused whether I should create a WebAPI project or a Web Application (Model-View-Controller) project
 
user5500750
Also I am trying to create a website that has an API and a normal website in one. Maybe have the api at example.com/api
 
user5500750
But the WebAPI proect appears to have more API options and files than the Web Application (Model-View-Controller) project
 
user5500750
5:46 AM
There is no App_Start folder in a Web Application (Model-View-Controller) project and several files for configuring the API are missing including WebApiConfig.cs which I can see in the WebAPI project
 
6:00 AM
Hello!
 
Hi There
 
I have win 10 on VM, and lan disk, in my WPF app I have UdpClient
win 10 can only send messages but not receive, what can be the problem?
is it my code or there something with win 10?
 
Let's say I have a method Publish(Book book) witch it's input is an instance of the class Book, if i wanna publish a bunch of Book in a List<book> is there a best practice to avoid doing it in a foreach loop and instead use a generic type of the Publish Method so it accepts either one instance or a List of the instances.
 
user5500750
Apparently no.
 
user5500750
Not a method that I am aware of. But hopefully someone more experienced in this will give you the right answer. I always find myself using an iterator to add more items to an existing collection from another collection.
 
user5500750
6:11 AM
I understand the problem.
 
I dont understand the problem...
you can add Publish(List<Book> books) but inside you will do foreach and call Publish(Book book)
 
user5500750
He wants to avoid that.
 
how can he avoid foreach in that case and why?
 
user5500750
But you could something like this; new ObservableCollection<T>(booList);
 
user5500750
He wants a method that takes a list of items without having to use a foreach. Also it seems like a loop will use up more resources for example if you have thousands of items.
 
6:15 AM
but why?
 
@GSCM do you know any proper example for this matter witch can help me
i mean using of ObservableCollection<T>(booList) for my purpose
 
user5500750
That will only work when creating a new ObservableCollection msdn.microsoft.com/en-us/library/ms668604(v=vs.110).aspx
 
user5500750
It will not work if you want to add new items
 
Goood morning squirrels and not-yet-squirrels!
 
why you dont want to use loop?
can someone help me with my UdpClient win 10 problem?
 
6:22 AM
@Mr.Noob it's messy in the code, sometimes i have only one object sometimes i have a list of them. Also i can define a method that always accepts a list of the objects but this way every time i have only one object i have to create a list for it
 
@yekanchi Well you can create a "Books" class which derives from List<Book>
and in that way you can still treat it as a single instance, sort of
 
you can create method override
 
Though probably not a good idea unless you have a reason to do it
 
11 mins ago, by Mr. Noob
you can add Publish(List<Book> books) but inside you will do foreach and call Publish(Book book)
 
user5500750
How about custom IEnumerables?
 
6:24 AM
but it all will always use loop...
this action requires loop
 
I don't like having a Publish(List<Book> books) method that does nothing other than call Publish(Book book) for each book
It makes me think there is somethign more sophisticated going on underneath
No reason to have such a method otherwise
 
@Mr.Noob it also makes it messy, we are going to make thing clear and handy
 
idk what you trying to do there...
 
by the way how do you quote the chat message you are replying here?
 
click on arrow (next to the message) and choose permalink
 
6:29 AM
@yekanchi Use "> " before the message
also
> for random quotes -@Neil
 
> i'm trying
 
there ya go :)
 
>:42012354 i first click the "link my next mesage as a reply to this" and then i go
 
i think you can try things in chat.stackoverflow.com/rooms/1/sandbox
 
6:42 AM
anyone used UdpClient on WIN 10 over LAN?
 
@yekanchi Yes, don't try here please. Though the correct format would be :id > message
 
\o
 
@Squiggle Damn, good one.
 
6:46 AM
@yekanchi Just type @ into chat and type the name you're replying to. It should start to suggest names and you can tab to autocomplete.
 
✌ 🙋
 
Can generic type infer the passed parameter type, rather doing:
public Foo Do<string>("str"){..}
public Foo Do<int>(2){..}
 
@MohamedElshawaf well you can declare generic type T, then make the method signature accept T as input parameter
is that what you mean?
 
try to avoid generic its a world of pain
 
6:51 AM
@MohamedElshawaf Of course. On invocation, it's inferred.
 
Oh, sorry I delivered it wrong.
it's a little complex than this
I pass string always, then by expressions I get Expression.Property, but I need to pass that type as a generic type to the method because I use it in the return type
 
47 mins ago, by yekanchi
Let's say I have a method Publish(Book book) witch it's input is an instance of the class Book, if i wanna publish a bunch of Book in a List<book> is there a best practice to avoid doing it in a foreach loop and instead use a generic type of the Publish Method so it accepts either one instance or a List of the instances.
Doe it Make Sense To Ask this in StackOverFlow?
 
@Mr.Noob Why, it's the most joyable thing in C# I like to play with?
 
it will be duplicate probably
:D
 
@Mr.Noob why? do you know any question like this? i could not find it
 
6:57 AM
type something like this in google: c# loop through list without foreach
 
it's not about looping though
 
maybe I don't understand your question... but if you have list and you want to to something with each item in it, idk if there any other way but loop
 
Almost surely that would be a duplicate
 
ohayou
 
maybe not for Publish/Book but for a very similar situation
 
7:02 AM
C# is based on basic machine commands all the rest is "synthetic sugar" even foreach translates to for loop "under the hood" (if i am correct)
 
@yekanchi Take a list of books all the time, and write a different overload that takes a book as input, then puts it in a list and calls the other method.
For reusability purposes.
 
looping on behalf of the library caller is a trivial exercise
 
@Neil I believe the Codex Astartes reflects just that.
 
If you want to have your own overload for List<Book>, it should do something that simply looping through all books and calling Publish(Book) wouldn't do on its own
 
Good morning btw
 
7:05 AM
at least imho
@HéctorÁlvarez \o btw
 
🙋 < can you see this icon?
 
@yekanchi If you want to do something for each book in tha list, there has to be a loop somewhere. Either in your coe, or in the code you're calling to add it.
You could probably use some LINQ method, but under the hood, that's a loop too.
 
someone know if there is something different in UdpClient in win 10?
 
@Mr.Noob I can.
 
@Mr.Noob You expect to receive a response from your udp request? ;)
 
7:09 AM
or maybe its the VM that block UdpClient? I don't have win 10 to test
:D
 
user5500750
Can't it be a memory copy? If a List is just a list of pointers. At low level it could just get the pointers and copy them over to the main List
 
@Mr.Noob What is the problem you're experiencing?
 
@Squirrelkiller You could also hardcode 2000 ifs in a sequence, like if(list.count>=1){...}if(list.count>=2){...}if(list.count>=3){...}
(Don't tell anyone I said that)
 
I test my app on win 10 that run in VM, I open 1 app on win 7 (my pc) and 1 on VM win 10, and win 10 can only send but not receive udp packs
its should to collaboration
 
@Mr.Noob Did you not open a firewall port?
 
7:13 AM
Disable your firewall and try again, sounds like something's blocking incoming requests.
 
i will try now
 
let's say i have function like `Publish(Book book)` i know that i can do some thing like `Publish(new Book("SomeName"))` but i want to not only instantiate it while passing it to the `Publish` method but change a property of ti right at the input parenthesis, is it possible?
something like: `Publish(new Book("SomeName").Year=1990)`
 
new Book("SomeName"){Year=1990}
 
new book() { year = 2009 }
year should be inside the constructor
 
1 min ago, by Mr. Noob
new book() { year = 2009 }
yes it works thankls
 
7:15 AM
Book (title, year, author)
 
setting ; between them?
semicolon
 
no use ,
 
oh yeah, thanks
 
but its better to use constructor with all this params
 
i see
 
7:18 AM
if I can send Udp packs but can't receive it can be firewall? why I can send then?
 
Don't worry @HéctorÁlvarez.
Noone will ever find
!!ifs
 
8 mins ago, by Héctor Álvarez
@Squirrelkiller You could also hardcode 2000 ifs in a sequence, like if(list.count>=1){...}if(list.count>=2){...}if(list.count>=3){...}
 
You could write some code to generate the 2000 if statements for you.
 
Could write a foreach so it exactly matches the list
 
have you checked this?
https://stackoverflow.com/questions/22852781/how-to-do-network-discovery-using-udp-broadcast
 
7:21 AM
@RoelvanUden Thinking like a real professional.
 
Exactly.
 
yes I have similar code, it works fine but when I test it on VM with win 10 it can only send, I dont know if its VM or WIN or my code...
tried to disable firewall but it wont help
 
i had issues with VM network too for ordinary task, i think it's weird
 
@RoelvanUden People might actually believe this, sadly
 
Set your network connection to bridged on the VM
 
7:32 AM
good morning
 
I will try it later I have to go now...
OMG it works!!!! Thank you!
can I assume that it will work the same on real pc?
 
If you fixed with the bridged adapter, then it should.
 
ok thank you!
gtg, bye
 
7:55 AM
By the way, I eventually went for an AIO kit, a Kraken X72 by NZXT.
Should have some decent cooling performance here.
 
8:10 AM
I had a classic "piemonte" lunch. Wow. Italians can eat. It was like a 7-course meal complete with 3 antipasti, 2 primi, 1 secondo, and desert
 
italians are fattos
 
I didn't eat dinner
Way too much good food
 
it's launch time not dinner time
 
what are you launching
 
lunch
lol
 
Ben
8:26 AM
Hey all, i want to parse an XML so after it I'll get an easy way to find each node's parent.
To be more specific example for my XML:
<DEV>
<Parents>
<Parent Name = "John">
<Child Num = "1">
<ChildName>Nancy Cole</ChildName>
<EyesColor>Blue</EyesColor>
</Child>
</Parent>
<Parent Name = "Daniel">
<Child Num = "1">
<ChildName>Ben Jackson</ChildName>
<EyesColor>Black</EyesColor>
</Child>
<Child Num = "2">
<ChildName>Pablo Jackson</ChildName>
<EyesColor>Blue</EyesColor>
</Child>
<Child Num = "3">
<ChildName>Alice Jackson</ChildName>
 
HiiiIIIIiiii everybody
 
Hi
@Ben there is myriad of XML parsers out there
Linq to XML (XDocument Parse)
XML Serializer
XML Reader
 
Maybe he should use r̝͔̤̦̥͉̽́̒ͧ͐e̟͎̟̹̳̮͉g̷̪̫̈́̌͊͆ȩ͓̋x͍̗͖́͗̅ͯͩ̆ͣ͞
 
Ben
Kamil I did something but this is doesn't really work and I'm not sure it;s the best way for it
 
avast ye land lubbers
 
Ben
8:31 AM
I thought to make a dictonary so each child name will be a key and parent will be value
 
@CaptainSquirrel Arrrrrrrr
 
@Butler1233 n̬̮̘̲͓̺ͨ͐ͦo̹͚̙̤͙ͩ̍ͪ̔̀͟ ̢͕̠̰̩̐̍ͨͤ͋̔n̯͚̟̜̱̳̹͊ͭ͌ͨ̔̚o̻ͫ̒̓̈ͥ̔͋͘ŏ̹̲̭̹ͧ͗͂͑͠ͅo͉̙̙͉̲ǒ̷̘̲̣̯o̡̠̗̺̐̉͛͌ö̻̱̦̩̫̉̏͛̀ ̳͈͐̃͟ͅp̢͙̝͖̏̑̇ͪ̓ͅl̥̬̟̱͔̑ͫ̍̋͢e̶͍̞͙͉̟̺a̮ͭ͝s̢̩̯̑͆̇͊͊͑ͅe̴̬͉̹̣͕̺ͩ̔ͩ
 
@Butler1233 Hold me! I'm scared!
 
@Neil You got a free desert with your meal? Did you pick Sahara or Gobi?
 
@HéctorÁlvarez Sahara of course
What do you take me for anyway? Pff..
 
9:18 AM
dat moment when you build a .dll and it gets loaded by a third company application... and that application decides that the dependencies of the dll are already loaded earlier for whatever reason... with the wrong versions
 
I'd just be surprised if a third party was loading my dll for any reason at all
 
I've had to decompile third party libraries, fix their bugs and recompile them.
 
I've definitely had to do that before
 
Ohai, I'm in ur dlls, loading them from the disk
 
The best instance where that happened was when a pocket PC lost the RF reader a couldn't print at all. The library was crawling with Sleep(200) instead of actually doing what they needed to.
 
9:24 AM
yikes
You know you're doing something wrong with you're adding Sleep(200) everywhere to make it work
 
Thread.Sleep(4000); // make it look like the application is working really hard
 
Sometimes sleeps are essential otherwise users think nothing is happening and then actually complain that nothing happens
 
ow damnit
why is it not friday today?
 
Because it was friday last week, although MS seemingly weren't aware
 
It makes sense to sleep at certain points, just not every 3 lines. Hardware has some limitations, and it takes some time to start, but you can't really control it from high level software, you have to assume how long will it take to boot in the worst case scenario and wait for that long.
 
9:29 AM
*looks at the starred messages*
*finds an interesting link*
*checks the date*
*yep, no fridii*
*goes to link*
*FRIDII FRIDII EVERYONE*
*sighs*
 
I had to deal with legacy C++ code once which used a dll to send keystrokes to a as400 terminal
 
Rule of thumb, never ever check links on fridays, or 1st April.
 
but its not 1st April, nor is it friday
 
The worst of it was that it was already supported, so I had to just deal with it, and whenever there was a task that took time, I couldn't send keystrokes but had no way to know whether or not it was done
Ended up filling the program with Sleep(100) everywhere. I still weep over it to this day
 
PSA @HéctorÁlvarez is wrong. You should ALWAYS click links on fridays
 
9:31 AM
^ if youre an idiot
 
I haven't learned the URL yet. As soon as I recognise kfVsf... as Friday, I'll be fine. Until then though, I'll keep checking that link
 
@Harry SHHHH
 
I must admit those captions are so damn catchy.
 
@Butler1233 same
 
@Neil BTDT. I wrote a wrapper for a various mobile emulators which used keystrokes and a local SMTP service to load and take screenshots of arbitrary emails as they would be viewed in the native mobile clients
 
9:34 AM
oh no i mean yeah always click links on friday
 
powered the back-end of litmus.com - was a great product, but hacky as hell behind the scenes for certain types of client. Had a program which scrolled down through key presses, took a screenshot of each page, comparing pixels to figure out if it was at the last page of the email.
(still is a great product)
(but they laid me off, so I don't like them)
 
strictly no squirrel policy
 
That sounds filthy. The worst I've done is lay controls out on screen, take a screenshot of that, move the controls over (the screen wasn't big enough to fit it all on), take another screenshot, combine them and print that because direct drawing to print wasn't working properly
 
nah, they relocated from the UK to Boston. Didn't want to take me with them, as I was the only non-director in the company.
then they later had the cheek to call someone else their "first employee"
<grumble>
 
@Squiggle control by proxy interfaces are a little awkward
But if there isn't really support for it, I suppose there aren't really good alternatives
 
9:41 AM
Exactly.
 
It's also incredibly difficult to get people to understand the kind of problems that come from control by proxy interfaces, especially to laymen
 
So Microsoft's Windows Store now features PWAs.
It's over, guys. UWP, WPF and WinForms are dead. Long live the web!
 
I've spent 30 minutes trying to guess where the hell this crap is calling stuff from
and it turns out the scripts are all in the html. Randomly, I mean randomly pasted in the middle of the html.
 
=_=
 
9:58 AM
randomly pasted scripts are usually the best kinds of scripts
Quality, baby.
 
Yeah I don't know how to debug this
 
It sometimes helps to work backwards
 
Yeah I sometimes go as far back as VB6, when I see this kind of shit it really helps to see old-ass crap that, at least, can be debugged.
 
hey. Watch your language, sonny.
We don't talk about V*sual B*sic in here
 
10:19 AM
I made it out of this pit of crap pulling the mightiest debugger; line.
 
Them are fitin' words
 
10:39 AM
I think visual studio is struggling with my model
 
looks fine to me
 
@Butler1233 So pay her more
 
ok, that is pretty cool
im not sure if such a feature is really necessary in not-messed-up diagrams, but its still cool
 
It makes sense if you've got a line which needs to cross a perpendicular one. When you've got a bunch though it starts getting a bit silly
 
im specifically talking about the large one, which crosses 4 lines
 
10:45 AM
If you're drawing lines, it is already silly
 
ussually, such tools make a bumb for each line they cross
 
Mysql Workbench was terrible for mangling lines
 
Can you draw 7 perpendicular red lines using green and transparent ink?
 
@Wietlol Extensible bridge? Or did they hardcode the length?
 
i suppose extensible bridges
 
10:56 AM
I'm fairly certain they're not hardcoded, especially because I've got them going diagonally and everything too
 
11:12 AM
wtf visual studio
Leave my new property alone :(
 
Maybe you should use it
 
Nah, deleted it. Params aren't allowed to be an instance variable.
Got enough strange shit going on in this codebase, better make it right when I can.
 
@Squirrelkiller why do you blur variable names ?
 
Dunno. It all pretty much says DSGVO but because DSGVO I suddenly got the need to blur everything
(DSGVO (ger) = GDPR (eng))
 
sehr schon
 
11:26 AM
something something data protection
 
Here you lost your ˙˙
 
i do not have them on the keyboard
 
Altcödes are your friend
 
ƒ for re$pects
 
11:30 AM
╚╩╦═╬
 
╔╦╩═╬
 
Build a maze!
That would be a-maze-ing
!!giphy yeaaah
 
@HéctorÁlvarez Nah.. now a labrynth made of corn.. that would be a-maize-ing
 
11:45 AM
@Neil A maize maze
Which by the way is absolutely a thing
 
I'm sure
Rule 34 and all that
 
No it's a legit activity here in the UK. Maize-maze.com has got you covered
 
And if Maisie Williams went through it, you could say It is truly a maisie maize maze
ok, I'll stop.
 
HAMMERTIME!
 
I wish that bot had some sense of context
 
11:52 AM
that out of context interpretation was hilarious :D
 
12:26 PM
@Neil ...what if, in the month of May, TV personality James May created a corn maze in the likeness of Maisie Williams?
May's May Maisie Maize Maze
And you went there to see it, but it was shut.
My May's May Maisie Maize Maze Dismay
4
 
That sounds like a TV show which may be commissioned
 
I have Channel 5 on the phone right now
 
go back to /r/wordavalanches
 
They'll definitely pick it up
 
they say James May is too expensive. Brian May might be available.
 
12:30 PM
Brian May may be available.*
 
Why not get them both on?
 
Brian May may say yae to "My May's May Maisie Maize Maze Dismay"
 
Would make a great news article
There was a real news story title "Foot Heads Arms Body"
The guy's name was "Foot"
 
May & May's May Maisie Maize Maze Dismay. Starting May on Channel 5
After Can't pay? We may take it away!
 
add clickbait
 
12:33 PM
Oh man
Can't Pay We'll Take It Away
That's the best show I've ever seen
 
May May & May's May Maisie Maize Maze Dismay?
 
> Shooter McGavin: Stay out of my way, or you'll pay. Listen to what I say.
Happy: Why don't I just go eat some hay? I can make things out of clay, or lay by the bay, I just may! What do you say?
 
user5500750
ASP.Net looks for controllers in all folders? Or is it just restricted to the Controllers folder?
 
@KendallFrey Seems like an incomplete sentence
Maybe May May & May's May Maisie Maize Maze Dismay Amaize?
 
wtf is the word "Amaize"?
@GSCM which version of ASP.Net?
 
12:35 PM
Amaze, but adapted because Clickbait
 
user5500750
The standard version. The core version is crap.
 
user5500750
It does not support a lot of things at the moment.
 
user5500750
.Net Framework 4.6.1
 
@GSCM It supports Linux though
 
12:40 PM
@KendallFrey that is exhausting
 
@GSCM Such as?
 
user5500750
 
It is missing a bunch of useful features though. I'm waiting for EF 2.1 to be released stable and then I'll try it, I'm waiting for Lazy Loading
 
why
 
user5500750
What happens to Forms in core?
 
12:42 PM
It's gone bruh.
GONE
 
It disappears. Rightfully so
 
@GSCM trying to use old EF libs and tooling in a ASPNet Core project? yeah, I can see why that won't work.
 
user5500750
Yes. Most libraries and tools don't work.
 
"most"...?
 
12:44 PM
@GSCM ???????
 
You and I have different experiences.
 
You're giving me an aneurysm
 
I've been using dotnet core in production for well over a year without problems
 
yup
2.0 makes everything perfect
 
and there's some simple work-arounds for any issues that do present themselves
 
user5500750
12:45 PM
Some features have not been added yet.
 
SUCH AS???????
Seriously, what are you missing so badly
 
Only once I've found a feature that was missing - and it was removed intentionally.
 
user5500750
Forms?
 
There isn't much reason to use framework over core really. Unless you're writing a native application with a UI
 
...
Forms isn't "missing". It's removed. Retired. Gone.
 
12:46 PM
how to use winforms
 
user5500750
Entity Framework isn't fully compatible.
 
step 1) unless its for a application you don't care about, don't use it
 
you say "compatible". Compatible with what?
 
@GSCM What is missing on EF? That you would need
 
@GSCM Old, crappy framework that nobody wants
@GSCM Use EF Core.
 
12:47 PM
it's not trying to mimic the old implementation. It's a new implementation.
 
@Butler1233 there are some differences though, for instance there are technologies (window specific) which aren't available in core
 
It just sounds like you're being resistant to change.
 
even Microsoft does not recomment using core unless needed
 
LOL
*dies
 
f
 
How the actual f would you calculate this?
 
user5500750
How about working with migrations?
 
@GSCM How about it? Use exactly the same commands like from full EF
 
12:48 PM
@Default Oh no. Why would I want a performant and scalable system. Shit, better use Full Framework!
 
@RudiVisser that wasn't my point
 
Please, tell me what your point is
That you shouldn't migrate a fully working FullFx app to CoreFx for no reason?
Obviously.
 
I said it above
 
That you shouldn't use CoreFx when you rely on FullFx? Obviously.
That you use desktop tech not available in CoreFx? Obviously
 
but people are saying "Core is missing X", when in reality there's nothing missing. It just isn't the same.
 
12:51 PM
It's not even just that, ASP.NET Core is very good. Using that, even when you rely on FullFx, you can introduce a new layer for your separated concerns - just move the FullFx stuff elsewhere whilst having a lightweight super quick web layer
 
user5500750
A new .NET Core project has a ApplicationDbContext file. How do I migrate that file?
 
Add-Migration, like you always did
 
or are you talking about migrating a .Net Framework project to a .Net Core project?
in which case, don't
 
Not unless rethinking the app arch anyway
 
@RudiVisser looks like we two are at least in agreement
 
12:56 PM
Yes
It's nice isn't it
Butler too but he's from Liverpool so :/
 
Liverpool
 
hey! Scousers are allowed opinions, too.
 
Yes. Anything west of Manchester is Liverpool
 
I aint scouse you lil rats
 
confirmed. (Source: I'm from Yorkshire)
 
12:57 PM
Me too
 
Rudi's a dirty manc anyway though, so it's fine
 
Errr no
I just live here
 
Riiiiiiight
 

« first day (2732 days earlier)      last day (2218 days later) »