« first day (2027 days earlier)      last day (2122 days later) » 
00:00 - 19:0019:00 - 23:00

12:47 AM
posted on May 08, 2018 by Ankit Asthana

Today at //Build 2018, we are excited to announce the preview of ML.NET, a cross-platform, open source machine learning framework. ML.NET will allow .NET developers to develop their own models and infuse custom ML into their applications without prior expertise in developing or tuning machine learning models. ML.NET was originally developed in Microsoft Research and evolved... Read more

 
 
10 hours later…
10:36 AM
Hi all
 
11:02 AM
hi alex
 
Hi Daniele
 
11:58 AM
Hello everybody
 
Hi Zarenor
 
How's tuesday, so far?
 
couldn't be worst for now
your?
 
Yesterday morning... stressful
Debugging an app... AD account w/ OWIN stuff
 
I just got in, so I'm doing alright. Writing an email with a list of feature requests, not so bad. Have to get back to an infrastructure-design problem I'm wrestling with here soon.
Daniele, what's got your Tuesday so terrible?
Alex, AD w/OWIN.. wasn't that the thing you had to break down to ugly syscalls? I don't remember that being exactly fun
 
12:09 PM
Yeah, it's kinda tricky though MS has made it easier with the Identity stuff
(Never know if something's a library/framework/pattern/package/... so just call it "stuff")
Still, a lot of "black box" magic going on. It only tells you a logon failed, not why
 
Well today i reached the office with 1 hr late, thanks to the awesome public transport of my city, so no lunch break for me. Plus i have a problem with my project that took me the whole afternnon of yesterday and this morning to be solved
and finally my bank suffered an hacker attack so no online bancking (pc or mobile) for me
and i had to check some important stuff
maybe i am just in a bad mood. It's more then a month that i'm working with XmlReader and i am little bit stressed
 
'morning all
@Maverik Ping me when you get a chance
 
morning lynn
 
You've got mail.
Hello Daniele
 
Hey Lynn
 
12:15 PM
Ah, I see. Yeah, I wouldn't envy a month of monotony. I don't understand how banks can continue to get this wrong and not be severely penalized.
 
hiya Alex
 
I hope it gets better, though
 
Xml can be tricky... traversing all the dang nodes
Prefer JSON myself
 
Anything black-boxy is really frustrating to me. This API I have to build on is largely that way.. Failures without descriptions of why. I'd seen something about the new Identity stuff, it looked interesting, but I couldn't tell if it was actually useful
 
Xml is tricky. That's why 99% of time everyone use XmlDocument insteas of XmlReader
thanks god at least i found a way to use some LINQ to make things easier
 
1:09 PM
X > Xml
 
Anyone heard of Intellicode?
 
I saw an announcement about it yesterday. Debating grabbing it
What do you think? It seems interesting.. I saw a few weeks ago where somebody had dome something similar for Java
 
Liveshare is now in public beta too
I'd like to try it, see what it can do
Already tried Liveshare... not sure how useful that is
 
1:52 PM
if it works IntelliCode seems very helpfull
i think i will try it
 
Just grabbed intellicode, so we'll see how it goes.
 
do you guys know a way to set a border around a text in richtextbox using something like this
        TextRange tr = new TextRange(textBox.Selection.Start, textBox.Selection.End);
        tr.ApplyPropertyValue(TextElement.BackgroundProperty, color);
I don't see a border property...but there is a TextElement.StyleProperty
 
2:08 PM
I don't see a way.. I think the border would be on the FlowDocument or TextBlock (the text container).. And I'm not sure how to get that.
 
Create this XAML hierarchy dynamically?
1
A: How can I make a paragraph corners round?

Ayyappan SubramanianYou can achieve it using the BlockUIContainer and again one more RichTextBox inside it. Refer below code. <RichTextBox> <FlowDocument> <BlockUIContainer> <Border BorderThickness="2" BorderBrush="Blue" CornerRadius="8" Padding="3"> <RichT...

BlockUIContainer seems to be a major part of it.
 
I found this but it looks overly complex
7
A: How to draw border around a word in RichTextBox?

Brian ReichleI have done something similar, only underlining text in a TextBox. The principal seems to be mostly the same. Add an AdornerDecorator containing your RichTextBox but inside a ScrollViewer. <Border ...> <ScrollViewer ... > <AdornerDecorator> <RichTextBox ...

 
2:50 PM
@Maverik Out of your meetings yet?
 
3:23 PM
Found out yesterday that my insurance covers transition lenses... I finally get to see if they are as good as they sound
Anybody here use them?
or am I the only one with awful vision. Also, I really can't see in 3D apparently
or at least; not steroscopically
 
never used them. THey don't appeal me
 
I've seen a bunch of people get them, and they always end up darkening when the user doesn't want them to.
(advise against)
 
guys i have a question, that may be stupid, but i need to remove any doubt. The whole purpose of that i was doing the past month was to solve the folowing problem: there is an application that reads an xml file and save the data in a db. Problem is that these files can be huge (2gb +) so the app crash when it tries to create the XmlDocument
 
well I get a 90 day redo period so I guess we'll see if I have the same problem :)
 
3:33 PM
so what i am doing is to re-do the whole part that reads those files with an XmlReader. My question is. Is it still possible to get memory overflow exception?
consider that i build a huge class that store hundreds of data and then import it in a single batch. So i have a lot variables that can contains also huge chunks of text
 
I'm sure OOM is still possible unless you are processing it in chunks somehow so you don't need all 2GB in memory
also; that file is way, way too big
 
not my fault. We don't produce these files. But they must still be readed
 
wherever possible I would read, process, and discard
reading the whole thing is asking for it
 
but correct me if i am wrong. XmlReader produce a stream. That's why you basically can only move forward. So what i've readed and "processed" shouldn't be discarded?
or the size of the class can still cause the overflow?
what i do actually is read a piece of file, and save it in my class, and proceed
should i import it directly in the db instead of storing it and import everything at last?
 
3:46 PM
I would think it depends on the XML structrue
but I'm no expert on XmlReader
 
I would use XmlReader instead of loading such a large file into xmldocument
 
in fact that is what i was doing and that is driving me to the land of crazyness
 
you can implement your own serializer/deserializer using IXmlSerializable interface
 
i have 4 different type of structures to deal with
have to go. Have a nice day guys. Bye
 
4:17 PM
@LynnCrumbling May 1st is the holiday that lands on first Monday of the May which happened to be 7th May this year and so yea we were off
that also covers the ping & me out of meetings for now
we're going through our SSL renewal and surprise surprise our provider can't process ECC requests or a request with wildcard SAN despite them telling us for years there's no problem
so I finally convinced my manager who convinced his and we finally moved to DigiCert - yay
 
 
1 hour later…
5:28 PM
I'm looking at the ContextDrivenViews file in the contributed samples - I like how the XAML files are referenced from the resource dictionary. I'm trying to emulate something like this, and noticed that the Views folder doesn't have any design views, and was wondering how / why that is?
 
design views?
 
Right, you can view the file using the XAML editor, but can't view it in the Design view.
 
If the views are defined in a resource dictionary that will be true; but I would imagine each one is in a user control file
 
I have 1 json which contains department(single) and employees(list)
 
5:33 PM
that should work with the designer
but I haven't studied the sample
 
Now i have been given a task to save department and employees
But i have been told that i dont have to create department if employees dont exist(this is just a task for my leaning purpose)
So my first step here is validating department fields
If it is fine then i will validate employees
So i am thinking to implement chain of responsibility
Like once department nis validated then i will validate employees
So this is forming a chain
Do you think chain of responsibility is overkill for this?
 
yes
its not just overkill; its plain inappropriate
 
@BradleyDotNET sir is this for me?
 
yes
chain of responsibility says: "I have this event/data/whatever. Do you want to handle it? No? Ok, next do you want to handle it? Yes? Ok, done now"
 
Can you please explain why because i get confused so as to when I should not implement COR
 
5:35 PM
its not for any sequence of code
I'm not saying you couldn't do a validation chain like that; but by that argument nearly any sequence of if statements could
and that's just crazy IMO
 
Great explanation sir
Short and sweet
 
Generally speaking, COR is a very heavy pattern. At least the way I've seen it does it significantly increases the mental load of processing code
so I would apply it very sparingly
 
So are you saying that as per my understanding then every chain if if statement would have to implement as chain of responsibility
Right?
 
Right
You get to enterprise FizzBuzz very quickly thinking like that
not everything is a pattern
 
sir actually i have been told to design code following pattern
 
5:39 PM
and you've been told wrong
software is not, I cannot say strongly enough not a puzzle of finding the right combination of magic patterns
 
sir if i want to learn how to design a better code then what should be my first step?
 
Design patterns exist for one purpose, and one purpose only: To allow for developers to give a name for commonly used solutions to problems as a shortcut for describing the design in detail
 
@RudiVisser Hello sir
 
So I can talk to you and say; use a Strategy there; or build that like Template Method" and I don't have to go into the details
 
5:41 PM
@Learning-Overthinker-Confused Ignore whoever is telling you to implement COR for simple applications would be a good start, like I told you yesterday :)
 
I was kinda looking for you in asp.net mvc room as i got kinda confused
 
I'm always in both
 
The first step is to understand that programming is not following a checklist
regardless of how others view us; programming is a highly creative discipline. Writing good software requires you to balance pros and cons of 10 possible approaches and come up with some combination that is "best" for some value of "best"
trying to do a formulaic approach just leads to a mess
 
We are artistes
 
Do you think its a good idea to see open source project and learn code from there?
 
5:44 PM
I think the only way is to actually write software. Take the bumps and the bruises and you learn what all those pros and cons are
you won't actually learn it, internalizing the lessons, until you've done it
 
I agree with Bradders
 
(shocked that Rudi agrees with me on something ;) )
 
So am I
 
But how i will validate whether i have written a good code or bad one?
 
Usually by you having to maintain it
 
5:46 PM
Actually this is my struggle that i think something but then i dont get whether i am thinking in right direction or not or what would be better way then this
 
fix bugs; add features. You'll notice the pain points really quickly
Don't get me wrong; starting with best practices, discussing it in this kind of forum first is great
so you don't go completely in the weeds
but at some point you are just in Analysis Paralysis
 
But as you can see for the task i thought implementing COR but then you suggested it would be overkill for simple task like this
 
and you just need to build something. Even if you get it totally wrong the first time you can learn from it
And I think it is
but if you had just done it; tried to reason through that code a few months from now you would learn the lesson far better than some random person on the internet
again, not that we mind helping, but you need to get off this mindset you can get the perfect design before you start
There's a whole development/project management methodology designed around defeating that conceit (Agile)
 
^ this. 90% of the battle is just starting.
 
So as of now this the first place where i come and ask for review about my thought process because you guys are very much intelligent and genius in this field
 
5:49 PM
lol; you give us way too much credit
 
again what bradley said
 
we're just developers who have been through the battles and the inuries
learn from our experience, but make sure you have your own too
 
well not speaking for everyone in the room, but i'm nowhere near a genius. @JohanLarsson is....but I'm just a sparkey trying to learn to code so I don't get fired :)
 
man do I feel philosophical/old atm
 
you and i have the same brain today bradley...have you had a rough day at the office too?
 
5:50 PM
no, pretty good day actually
 
Yeah i am learning hence nowadays i am taking small small task and trying to design proper code before doing code in visual studio
 
you're not going to learn that way....
 
Because i have read somewhere that “Coding is the last step”
 
lol; that's nuts
 
i mean brain mapping is good, especially for ideas, pseudo code is always helpful
but past pseudo coding and mapping out your states if you have them, the best thing to do is just jump in
again
90% of the battle...is just getting started.
 
5:52 PM
Sketch out a design and try to implement it. If it feels like the design is working against you, refactor or start over
 
Can you guys share the first thing you do?
 
This is literally how I have done my job for the last 7 years. And while I don't claim to be anywhere near the elite echelon of developers; I've been highly successful and well regarded by my coworkers
 
i've got a squaling voltage regulator today that's driving me nuts
 
What does "squaling" mean?
 
@Learning-Overthinker-Confused i'll sit and pseudo a bit (in visual studio) to get my main points down, then code off the pseudo code
bradley: i meant squealing
 
5:53 PM
ah, that would be very annoying
thought it was some hardware term ;)
 
it sounds like one of those mosquito ringtones that old people aren't supposed to hear
 
@BradleyDotNET sir you rep already says How great developer you are :)
 
nah, my rep says how good my writing is and how long I've been here
sure; it takes some knowledge too. At the same time: good software doesn't come from memorizing a book
 
sir but how quickly you identified solution to my problem while i am thinking from like an hour
 
That's from the experience. Some (simple) problems, the easy answer become apparent from experience,once you've built a solution many times.
 
5:57 PM
did you see the part about 7 years of experience?
 
Some, they don't. I'm working on the second or third iteration of solving the same problem, because it was time to try to solve it better than I did before
 
I've either written or had to maintain many, many different kinds of code
and so I can make a better initial judgement call than you
but the only way to really get there is to make and/or deal with the screwups
 
And I've thought through and started coding three or four solutions to various parts of the problem, and it wasn't until I wrote some of the code that I could see why the design was poor.
 
I wouldn't appreciate DI so much if I didn't spend a month refactoring a project to utilize it; or the state pattern if I hadn't had to build way too many state machines
 
So then, I paused, thought of a way around the new part of the problem, and designed how to solve that. But I couldn't have known that problem would exist if I hadn't started writing the code
 
5:59 PM
Actually i was thinking like this :i will have 2 interface for my problem
 
And I know when I shouldn't use those as well because I've done it
 
IDepartment and IEmployee
 
those are models, right. no logic?
 
Then why on earth would you use an interface
 
6:00 PM
Because i have been told not to do new anywhere
 
you can't DI a DTO/POCO/Model!
 
I have been told to follow DI workflow
 
ok; listen well because I really don't want to repeat this again: Programming is not a formula
 
Sorry but IDepartment and IEmployee are interface
 
For a problem like yours, you probably have three classes: The program itself, which reads the data, the department, which knows about it's employees, and the employees.
 
6:02 PM
Yes; you don't want to be newing up dependencies
 
I have a Stackpanel with a bunch of UserControls in it. I'm searching the Stackpanel's VisualChildren for textboxes (that are contained in the Usercontrols). But once I look inside the UserControl level, they don't have any children (which I know for a fact they do). I'm searching just as I'm loading the form. So maybe the Visual hierarchy isn't ready yet maybe?
 
but that doesn't hold for models; how in the blazes would you ever inject those?
 
I will inject in my controller
 
@Hypersapien You definitely want to wait until the window ( or control) has loaded.. I don't remember the order of loading, though. I thought there was a Loaded event
 
Really? And how is that going to work?
 
6:03 PM
Is there a way to know when it's fully loaded?
 
Look; your problem domain/project are incredibly simple
Try writing it whatever way you think is best; and have someone (even us) look at it and tell you where to improve
 
Can you please guide me what could be the better way to do this?
 
because right now you are going to try to do something that literally is not possible and it will be better for you to just see that
 
Alright I'll pull the Mav.
 
But I'm not sure if Loaded fires when it or it's entire graph of children are done
 
6:04 PM
The usercontrols are added to it dynamically, so I'm not sure if the built-in Loaded event will work.
 
Honestly, no I can't guide you because you don't believe me. Write a little project that tries to inject your models and you'll see what I'm talking about
Stop analyzing and write some code then we can help you further
 
But in my post method i will have my modelwhich will get binded like this
 
Or should I check the Loaded event of each UserControl instead of the StackPanel?
 
Ah. dynamically by what? Can you callback after the dynamic creation?
 
[HttpPost]
Public ActionResult Post(Department model)
{
}
 
6:07 PM
First of all, methods involve parameters which is deserializing an object for you (newsflash, that uses new); so its not the same problem as dependency injection.
But to prove my point; please write the getter for that controller
go ahead
Alternatively, the getter for the respository that the controller would call
either will do.
 
I (for example), had controls creating dynamically in something similar, whenever necessary (based on items being added to a list). If I needed to parse through those textboxes, Id've had to add the callback as a continuation to the task the command kicked off, or as an additional invokation in my command after the task returned
 
So my department json will get binded in model then in my constructor as i have injected dependencies for IDepartment and IEmployee then i will simply call my method for database operations and validations
 
stop it
I asked you to write the getter
actually write the code
I'm not being a jerk; this is the only way for you to understand
 
Alright sorry boss stepped in. I'm cracking the whip.
 
sorry sir but i am at home now and on mobile.I dont have laptop or computer at my home
 
6:10 PM
Learning: Bradley is trying to help, if you don't do what he's asking to help you learn and get to the solution, you're going to be better off writing a SO post instead of popping in here.
 
pseudo code is fine; I'm not compiling it
But until you try to actually write the code you aren't going to get this
 
But sorry I honestly didn’t get by this”Write the getter”
so trying to understand that part
 
This is exactly what he's talking about.
 
[HttpGet]
public IActionResult Get()
{
       //What goes here
}
^^ does that help?
 
Ok just a second let me write what i have think
[HttpPost]
Public ActionResult Post(Department model)
{
If(IDepartment.Validate(model).count()==0)
If(model.Employee.count > 0 and IEmployee.Validate(model.Employees).count==0
IDepartment.Insert();
IEmployee.Insert();

}

IDepartmentValidator
Validate(Department model) //return list of validation errors

IEmployeeValidator
Validate(List<Employee> emp)
This is how i am thinking considering SRP also
 
6:19 PM
Ok; what did you not see from my previous post?
I don't care about the Post. Write the Get
 
But right now i have been given task to save department and relevant Employee data but still for get i will do something like this :
 
I'm asking you to write the Get because it proves an incredibly important point
 
help! ....desperate
0
Q: How do I convert the start and end index of a selected text to exact TextRange?

erotavlasI can get the exact start and end index of a selected text in a RichTextBox, but how do you do the reverse of this? Use the start and end index to select the text again to perform some formatting on it - like highlight the background. private void textBox_PreviewMouseLeftButtonUp(object sender,...

I can't believe something so simple is so ***ing hard
 
HttpGet]
Public ActionResult Get()
{
IDepartment.Get();//this will return model containing department object(single) and list of employees in 1 POCOclass i.e Department
}
@BradleyDotNET
 
Ok, now write IDepartment.Get
all you did there is move the goalposts
 
6:24 PM
@erotavlas Can you not pass the pointers themselves, instead of the ints?
 
@BradleyDotNET Sorry didn’t get you sir
Can you explain if i did wrong
 
@Zarenor I want to deal with ints, because I'm storing the ranges in an interval tree data structure ....so for example when I load the ranges back up again ...I only need to pass into my method the ints
 
No, its fine. Having a repository there is good practice
 
I will have IDepartment as readonly private property and then in constructor i will inject dependency of IDepartment typical DI flow
 
wait; so you are saying Department doesn't implement IDepartment?
 
6:27 PM
@Zarenor that and the ints are more flexible...not really tied to WPF implementation...they are more general....just a character position anyone can find it
 
Ah, I see.
OH also
 
There will be department class which will contain actual logic of get
 
I think I see it
 
but Department is also your POCO right
 
Naming conflict but Department will be my view model actually
 
6:28 PM
I think it's that you're using direction.Backwards in the endpointer.
 
@Zarenor I tried all variations of those on the start and end pointer
 
Ok; lets get really clear on naming then
 
So IDepartment is actually IDepartmentService
 
forward forward, backward backward, forward backward backward forward
lol
 
Because in nop commerce project i have seen this naming convention
 
6:29 PM
Ok, yes; that should be injected. So now lets talk about the implementation of that service's Get
I would probably name it IDepartmentRepository but whatever
 
posted on May 08, 2018 by Phillip Carter [MSFT]

We’re excited to share updates about changes to F# and F# tools which shipped with the Visual Studio 2017 version 15.7 release. Let’s dive in! Type Providers now support .NET Standard For those who aren’t familiar with Type Providers, they are a feature of F# which allow you to get IntelliSense for data. When pointed... Read more

 
because I'm still very concerned that you think you should never use new
 
I think for POCO it will be fine
But only for POCO i guess my TL will allow
 
TL? Anyways yes; that's correct. In fact its more than fine it is absolutely necessary
which is why it is (usually) nonsense to give a POCO an interface
 
6:33 PM
He'd better allow it; there isn't any other way to make it work
 
There is actually
 
I mean; Activator.CreateInstance but that's just a ridiculously overcomplicated way of calling new (for you)
this I have to hear...
 
But right now we are doing this only
Oh my god you are genius
 
no really, what other way is there?
 
6:35 PM
because any solution no matter how convoluted (the above, factory, something else I haven't thought of) something is doing new or its equivealnt
 
I saw 1 code where my TL has done this Activator stuff
 
is he doing reflection there in general?
because Activator is fine if you are doing reflection
 
Huh. I think it's because the .text property is plaintext... so if you have any characters incompatible with the string type? Otherwise, I'm as stumped as you.
Some characters that don't fit in a single UTF-16 code point? It seems unlikely....
 
@BradleyDotNET i think in order to avoid new he is doing this i guess but i am pretty sure reflection is nowhere in picture
 
Activator.CreateInstance is just a way to new() something where you don't have the type in scope from namespacing or using... Unless you're doing something really bad. (Avoiding new pointlessly, remote-site activation....)
 
6:39 PM
I'll disagree on remote-site activation being an invalid use
(at least if I understand that term correctly)
the one time I've used it was to do RPC
 
Not invalid. Just not good :P
It is how to do remote-site, though
 
nothing wrong with RPC :)
 
Anyhow, that's well beside the point you're trying to make.
 
So conclusion like did i have think correctly
Based on my pseudo code?
Because i am an overthinker
 
Yeah; besides some terrible naming
 
6:42 PM
Reflects this in my profile name as well
Hehe
 
The whole thing that started this was you asking if you should have an IDepartment any programmer in their right mind will think that Department implements that interface and is a POCO (in fact, I clarified that with you) and thus has no business needing its own interface
 
1 important question that is if i have to check for department name while inserting department data so shall i include it in part of validation?
Because it is also kind of validation only that department name is unique or not
 
Sounds like validation to me
but it doesn't really matter
implementation details like that are the kind of thing you should work out while coding
if it feels right; great, if it doesn't; move it
if it starts to cause a problem later; move it
 
@erotavlas I think I may have figured it out - I think formatting elements become inline elements, but are excluded from the plaintext. This will make each formatting element cause an off-by-one error (they'll accumulate as the formatting becomes more complex). I think you need to use docStart.GetOffsetToPosition(start), rather than getting Text and reading length
 
So shall I include it as part of seperrate check or Make it part of validation only
 
6:46 PM
Ooh, this is a good one:
The 0th step in programming is realizing you aren't going to get it right the first time, so stop trying and write some code
24
I refuse to answer that question. Just start writing
 
Ok no problem sir
Thank you so much for your valuable time
Appreciated :)
 
no problem; good luck
 
sir are you always in this room or in some other room?
 
also; I had to seriously restrain myself from throwing some obscenities at the end of the 0th rule
 
I mean not whole day
 
6:49 PM
I'm in this room most weekdays
 
I dont see you mostly but this room is not active much
 
I'm here, even if I'm not talking
 
so will it be ok if i ping you in case for some clarification?
If you don’t mind
Like fir eg that COR one
 
Just ask the room; they are just as good if not better than me :)
 
Conversations in this room are always fully async. You can ask whenever, and might get an answer whenever.
 
6:52 PM
if no one responds after it gets active then sure; ping me but that shouldn't happen
 
I really dont mind asking here but this room is not active like c# room
 
well... if you ask it is likely to become active ;)
sometimes we, you know, go back to our actual jobs instead of just chatting
and there are fewer of us
 
lol. yeah thsi room isn't like the c# room because its not full of garbage all the time
 
Nope they are nice peoples too
 
This room is the best place to learn C#/programming, IMHO
As far as chat rooms go
There are other resources of course
 
6:58 PM
That is true when it is active :)
 
What I've noticed is, if you ask a question even when it's not active, it'll get an answer later
Or at least the friends will do their best to answer
As it is a free resource and we all have day jobs, we can't get to all items all the time
 
00:00 - 19:0019:00 - 23:00

« first day (2027 days earlier)      last day (2122 days later) »