« first day (2160 days earlier)      last day (1989 days later) » 

2:40 AM
posted on September 18, 2018 by Jamshed Damkewala [MSFT]

Today, we are happy to share an Early Access build for the .NET Framework 4.8. This includes an updated .NET 4.8 runtime as well as the .NET 4.8 Developer Pack (a a single package that bundles the .NET Framework 4.8 runtime, the .NET 4.8 Targeting Pack, and the .NET Framework 4.8 SDK). Please help us... Read more

 
 
7 hours later…
10:00 AM
Good Noon all
@Alex no you can't use "(?<blaat>.+)" capture groups within [] brackets
Good Noon all
[(] is the ( char.
Question: How do I make VS order all my methods alphabetically by default? or perhaps via resharper?, and also so that it has the correct order: vars, ctor, properties, methods, etc...
 
10:42 AM
r# or codemaid definitely have that functionality
 
what would I be looking for? as in what would one call that?
 
11:06 AM
Hi all
 
 
1 hour later…
12:22 PM
****YAWN****
I sooooooooooo did not want to wake up this morning.
 
@Zarenor yea Firefox was only ~2GB of it, but all the corporate bullhockey and what not on here bogs it down. Plus Visual Studio + AutoCAD + our c compiler
it takes a toll on 8GB
 
Sorry Jeffrey - i think it's part of Format code / cleanup code in R# but that does a lot more stuff by default that you may not want (its configurable)
 
yeah, but even that shortcut i've not yet found :S
 
codemaid.net <- i've used this for quick clean up tasks
 
awesume!
 
12:33 PM
R# Edit has the stuff i'm talking about
or rightclick a file to get the same options
 
Codemaid creates a menu item. There you can just run Cleanup Active Document
BTW, finally purchased R#
 
point of caution: R# & codemaid don't get along so use one or the other for formatting (otherwise they keep changing each others styles)
nice grats :)
 
gz Alex!
 
Procurement at my job ordered it like 6 mo. ago.
 
I would order your retirement party now... so when the time comes, its done :)
 
12:34 PM
I especially like the Line Join feature because it lets me undo r#'s chopping actions
 
Give it another few years and they'd deliver. Told myself I need it and using EAP is annoying
 
Did you get the version from 6 months ago, today, or somewhere in between? :)
 
Each year it costs ~$80 to renew
I got 2018.2
 
huh. Wonder when that was released...
April August 2018
 
Now it's up to 2018.2.3
12 Sept 18
An annoyance of Chrome Canary: tabs don't indicate changes (blue dot)
They're separated by bars |
 
12:38 PM
Does Chrome use less RAM than FireFox now?
 
Both have been mem hogs
 
I switched to firefox from chrome b/c of ram usage...now ff is doing what chrome did and it's killing my work pc haha
 
you get used to it Alex :)
 
Yeah, learning that!
 
if you're on dev stuff.. may as well use chrLauncher
 
12:40 PM
We humans can acclimate to so much life throws at us
For some reason, it's not running on my PC
 
what does it say?
 
@biggi_ Ah. AutoCAD is a pig. There's about two things I can find wrong with a large portion of Autodesk's software: It's not very efficient, and they're obsessed with that typed-command interface.
It's otherwise quality stuff. Nearly bulletproof, effective. Popular, so there's no problem with finding help online.
 
12:56 PM
IT's what I use for system diagrams
 
Maverik, it doesn't say anything -- it doesn't launch at all
 
do you guys draw class diagrams?
 
1:20 PM
I don't usually. If I do, it's usually a quick sketch by hand
Nothing real formal. I find descriptions in words to be more useful
 
no... I draw data structures (tables in SQL Server)...
which usually loosely (or tightly) map to classes...
 
In JS, you can reference a method dynamically as if it's an array element on the parent object...
callbackFunctions[callbackFunction](commentDto);
In C#, there doesn't seem to be an equivalent of this. If this were C#, you have to use this...
callbackFunctions.SomeCallbackFunction(commentDto);
 
Actually, in JS, the methods are all members of window:
window['myfunc'](arg1, arg2, ...)
 
Yup. Very flexible
From what I'm seeing, the equivalent isn't possible in C# Land
 
Well, c# has delegates
so you pass a delegate, which, for our purposes, is a func ptr.
Also, consider that you can reflect to dynamically get func names
 
1:29 PM
@Alex no sure :( i normally just unzip and run and it does everything on its own
 
So, depending on how you want to "dynamically" do it, there's a few approaches.
 
This is for SignalR in MVC world
 
You could use nameof(func) and stash that in a dict<string, delegate>
Not sure what actual problem you're trying to solve
 
In each controller, I'm having to define one of these so it can wire up to the JS client and do push notifications
 
1:32 PM
I'd like to make the handleCommentAdded a string or similar, so it can be made more generic
 
ha, then you want... a generic!
What's different
Between implementations?
A type, right?
That's your generic.
 
Two things: RealtimeHub and the method being called off of Clients.All
 
well, the method call can be passed as a delegate
And RealtimeHub is your <T> perhaps?
 
Yeah, a pointer.
 
Is RealtimeHub a different class sometimes?
 
1:35 PM
Yup, a <T>
RealtimeHub seems to be changing. You fire off a different one for each controller
 
i thought signalr was great, been years since i touched it
 
public static async Task bool MyDelegate(string s);
private static async Task NotifyClientsCommentAdded<T>(MyDelegate d, string result)
{
	var context = Microsoft.AspNet.SignalR
		.GlobalHost.ConnectionManager.GetHubContext<T>();

	// Clients and All are both of type "dynamic"
	await d(result);
}
fix that type up for MyDelegate
but you get the idea
 
Yes, that's what I was looking for!
 
So then maybe you have:
 
Thanks, Lynn :)
 
1:38 PM
public static async Task DoStuff(string s);
you'd call NotifyClientsCommentAdded<RealtimeHub>(DoStuff, result);
 
Haven't used delegates yet. Very cool
 
of course, your actual functions need to match the delegate signature
 
That's exactly what I need + generics
 
Since a delegate is more or less a typedef (and func ptr) rolled into one
 
Correction. Have used delegates but not quite like this
Thanks again, Lynn!
 
1:41 PM
Sure thing.. have fun :)
 
A follow up... so in my code, does this become the delegate? context.Clients.All.handleCommentAdded(string s)?
 
yep, you'd pass that into NotifyClientsCommentAdded
 
But context is defined inside the method
In other words, can I do this...
 
insert pewdiepie chair meme?
 
public static async Task bool context.Clients.All.handleCommentAdded(string s);
 
1:55 PM
Hrmm.
Thinking.
So there are multiple funcs on context.Clients.All ?
(and you won't know which one to call?)
 
Yup
 
How do you decide?
Based on <T>?
 
Yes, I think so
 
Ok - forget the delegate
Branch on typeof(<T>)
Read this:
121
Q: Using Case/Switch and GetType to determine the object

user29964 Possible Duplicate: C# - Is there a better alternative than this to ‘switch on type’? If you want to switch on a type of object, what is the best way to do this? Code snippet private int GetNodeType(NodeDTO node) { switch (node.GetType()) { case typeof(CasusNodeDTO):...

You can't just do case typeof(T)
 
Hmm. Interesting
 
1:59 PM
If you don't have many, just use if
 
That'll work
 
if (typeof(T) == SomeClass.GetType()) { SomeFunc() }
else if (typeof(T) == ....)
 
So I wasn't losing what little of my mind I have left :)
 
Right :)
But at least you see how DELEGATES* work there
 
You can't easily toggle the type. Gotta have some conditional
Yup, love generics
 
2:01 PM
Call this func that I'm passing in, right here
oops, typo
meant delegates
(already figured you knew how generics work ;)
 
And delegates. The name throws me; it's a function pointer
 
Well, it can be
delegates have multiple uses --
it's just very common to consider them as func ptrs
 
Hmm. Tell me more
 
An event is a delegate
you can subscribe multiple things to it
Unlike func pointers in c++ ... where it's 1:1
 
An event is, more specifically, a multicast delegate
it turns out that all delegates are multicast by default so... a distinction without a difference
 
2:07 PM
:)
Good morning Bradley
 
but it may help since Alex is right, delegates in and of themselves are basically function pointers
morning
 
Hey Bradley
 
class diagram tool in visual studio 2015 doesn't show relationship between interface and its implemented class
I thought there was supposed to be a line drawn between the interface and class
does anyone know if it works in 2017?
 
2:28 PM
err.... I have never used that tool
besides, that should be a "fat" arrow
not just a line
if its UML
 
i'm trying to create an architecture diagram for my plug in app...its similar to how MEF does it....do you know of any general diagrams I can look at?
 
In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among objects. The class diagram is the main building block of object-oriented modelling. It is used for general conceptual modelling of the systematic of the application, and for detailed modelling translating the models into programming code. Class diagrams can also be used for data modeling. The classes in a class diagram represent both the...
 
2:46 PM
I think I need something more high level like this
I think this is it
 
3:38 PM
this line:
public event EventHandler<object> OnWarningMessage;
gives https://docs.microsoft.com/en-gb/visualstudio/code-quality/ca1009-declare-event-handlers-correctly?view=vs-2015
and I trigger it via
OnWarningMessage?.Invoke(this, code);
in which code is an int.

What am I doing wrong? I dont get the warning...
strike that, after reading some stuff i guess i'll just ignore it :)
 
4:10 PM
erotavlas, that's not really a standardized diagram type, more of a basic block diagram
Probably a strong hint to not use object Jeffrey
 
Should almost definitely be using int if int is what you're sending. That's what it's complaining about. using object in places it isn't needed is really pretty expensive.
 
 
5 hours later…
9:22 PM
I later reallized I'm sending both int and string :)
 
9:39 PM
which also smells bad
 

« first day (2160 days earlier)      last day (1989 days later) »