Why is the "Let's chat" message so awkward?
Capitalize and punctuate "let us continue this discussion in chat"
What was the Historical Precursor for .NET Attributes? What languages or platforms influenced the .NET 1.0 Team to build-in the concept of Attributes from the very start? Was this an Aspect-Oriented thing? Serialization? or something else? I was still in VB6-land at this time, and never used any of the pre-1.0 .NET versions. SQL Coalesce in WHERE clause I'm trying to implement optional parameters in a stored procedure that I have but I am running into a problem. Here's a simplified query to illustrate the issue:  SET ANSI_NULLS OFF  DECLARE @MiddleName VARCHAR(20); SET @MiddleName = NULL;  SELECT * FROM [Customer] WHERE [LastName] = 'Torres' AND [MiddleName] = COALESCE(@MiddleName, [MiddleName])   When I run this query I need to get one row back because one Torres has NULL in the [MiddleName] column. But the query returns zero rows. Using IFNULL() produces the same result. From researching COALESCE, I was under the impression that NULL would be returned if all expressions are NULL. As I am not a SQL expert I assume that I am missing something, but what is it.....  Thanks in advance for any help. Intermediate ring between a field and an algebraic extension. What lies beyond the Sedenions Sometimes I create Material Groups to be used as appendable reusable assets. Unfortunately sometimes parameters I want to control using a Group Node's slider are not available for routing to a Group Node's input socket. Some examples of these are the Color Ramp and the Mapping Node.  So here's what I want to do:    Can this be done? If so, how?  Thanks! Scalar Field Theories The Lagrangian density for a single real scalar field theory is \begin{equation}\mathcal{L}=\frac{1}{2}(\partial_{\mu}\phi)^{2}-V(\phi)\end{equation} I have often seen this written \begin{equation}\mathcal{L}=\frac{1}{2}\partial_{\mu}\phi\partial^{\mu}\phi-V(\phi)\end{equation} which appears to differ in the kinetic term.  Specifically \begin{equation}(\partial_{\mu}\phi)^{2}=(\partial_{\mu}\phi)(\partial^{\mu}\phi)\neq\partial_{\mu}\phi\partial^{\mu}\phi=(\partial_{\mu}\phi)(\partial^{\mu}\phi)+\phi\partial_{\mu}\partial^{\mu}\phi\end{equation} where the product rule has been used in the last equality. Is this just sloppy notation (which is acceptable because only first derivatives in the field are considered anyway), or is my maths very bad? Solutions for INSERT OR UPDATE on SQL Server Assume a table structure of MyTable(KEY, datafield1, datafield2...).  Often I want to either update an existing record, or insert a new record if it doesn't exist.  Essentially:  IF (key exists)   run update command ELSE   run insert command   What's the best performing way to write this? Create Generic method constraining T to an Enum I'm building a function to extend the Enum.Parse concept that  Allows a default value to be parsed in case that an Enum value is not found Is case insensitive  So I wrote the following: public static T GetEnumFromString&lt;T&gt;(string value, T defaultValue) where T : Enum {     if (string.IsNullOrEmpty(value)) return defaultValue;     foreach (T item in Enum.GetValues(typeof(T)))     {         if (item.ToString().ToLower().Equals(value.Trim().ToLower())) return item;     }     return defaultValue; }  I am getting a Error Constraint cannot be special class System.Enum. Fair enough, but is there a workaround to allow a Generic Enum, or am I going to have to mimic the Parse function and pass a type as an attribute, which forces the ugly boxing requirement to your code. EDIT All suggestions below have been greatly appreciated, thanks. Have settled on (I've left the loop to maintain case insensitivity - I am using this when parsing XML) public static class EnumUtils {     public static T ParseEnum&lt;T&gt;(string value, T defaultValue) where T : struct, IConvertible     {         if (!typeof(T).IsEnum) throw new ArgumentException(&quot;T must be an enumerated type&quot;);         if (string.IsNullOrEmpty(value)) return defaultValue;          foreach (T item in Enum.GetValues(typeof(T)))         {             if (item.ToString().ToLower().Equals(value.Trim().ToLower())) return item;         }         return defaultValue;     } }  EDIT: (16th Feb 2015) Christopher Currens has posted  below, which is well worth a look, and an upvote. I will remove this edit if the solution bubbles further up the page. EDIT 2: (13th Apr 2021) As this has now been addressed, and supported, since C# 7.3, I have changed the accepted answer, though full perusal of the top answers is worth it for academic, and historical, interest :) During iPhone update to iOS 10.3.1, I was asked for my password using the correct machine name for my Mac mini. To be clear, the request was not for my iCloud password, my actual local user account password for macOS. This can also happen in the other direction - setting up a Mac may ask for verification for you to enter your iPhone / iPad passcode (and not your iCloud password)  I could not find any information about this kind of access. I was thinking it was security for iCloud and possibly related to two step authorization or two factor authorization. This is the first time I can think of that I entered a desktop password outside of that actual desktop.  I don't have a screen shot but I recall an implication that some files in my Mac are encrypted and need my password. '... need to enter the password for .'   Are there settings I can I control this assuming it's a legitimate part of iCloud setup process or iOS setup process? Setting-up SSH-tunnel for VPN? I have a laptop running Ubuntu.  I also rent a VPS running Ubuntu.  I've bought a paid VPN-service, which I use on my laptop.  I was wondering how I can set-up a SSH-tunnel or something similar, from my laptop to the VPS I'm renting, so I then can run VPN (from my laptop) "through" it (to the VPS), to the VPN-server.  The reason I wish to do so, is that a place I often work blocks my VPN-service, but not my SSHing to my VPS...  While I have been using Linux for a while, I'm a novice when it comes to setting-up virtual network-devices, advanced routing, and so on... so please spoonfeed me (using small words and colorful pictures ;-)  I have been googling and looking at various answers on the StackExchange-network, but not seems to be exactly what I'm after.  SSH-tunneling seemed promising, but since I don't have/know an exact domain and port for my VPN, I couldn't figure out how to use it...  I guess I may need to set-up some virtual network-device on my laptop (which ends on the VPS), and connect VPN through it - but how to do this, sadly goes over my head. Apply a string replacement on the citation as returned by \cite Say I have a code to draw a flow chart, I want now a arrow from node 3 to node 1, how can I do that?  1&lt;--| |   | 2   | |   | 3----   MWE  \documentclass[class=article,border=0pt]{standalone}  \usepackage{tikz} \usetikzlibrary{shapes,arrows}  % Define block styles \tikzset{     block/.style={rectangle, draw, line width=0.5mm, black, text width=5em, text centered,                   rounded corners, minimum height=2em},     line/.style={draw, -latex} }% &lt;- if you insist in using this in the document add this % here. \begin{document} \begin{tikzpicture}[node distance = 1cm, auto]     % Place nodes     \node [block] (BLOCK1) {a};     \node [block, below of=BLOCK1] (BLOCK2) {b};     \node [block, below of=BLOCK2, node distance=1cm] (BLOCK3) {c};     % Draw edges     \path [line] (BLOCK1) -- (BLOCK2);     \path [line] (BLOCK2) -- (BLOCK3); \end{tikzpicture} \end{document} (Up to / until / by) 50% off I wonder if someone could tell me which choice works in the following sentence and why the others do not work: (From my point of view, all of these choices work in this context.)  They have great promotion till January 5th......50% off. a) up to; b) until; c) by Realtek RTL8723be doesn't have good reception This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  How do I unit test code that includes a SOAP or REST-based callout, or indirectly calls code that makes a callout? I'm getting an error saying that callouts are not supported. Ubuntu gets stuck in a login loop Rights if we possess Carta di Soggiorno? How can we run a command stored in a variable? Natbib In-Text Citation displays (author?) I have taken a look through many other questions on this subject but cannot seem to fix my issue. Essentially while references display correctly I cannot get the author citation to appear in my text despite running pdflatex followed by bibtex followed by two more runs of pdflatex. Any help would be appreciated.  Sample tex file:  \documentclass{article} \usepackage{natbib}  \begin{document}  Blahblahblah \citet*{Test12}.  \bibliographystyle{plain} \bibliography{refs}  \end{document}   refs.bib:  @article{Test12, author = "John Smith", title = "Test Article", year = "2012", journal = "The Test Journal" }   Output: For a multiclass imbalanced problem, accuracy is not a good metric to evaluate model performance. Equally, accuracy is a global metric, so nothing like accuracy per-class (doesn't make sense). Scikit-learn provides the classification_report  function so one can evaluate model's precision/recall per class, e.g: classification_report(y_true, y_pred, target_names=target_names)               precision    recall  f1-score   support       Class:0      0.703     0.896     0.788      4491      Class:1      0.048     0.147     0.072        75      Class:2      0.368     0.503     0.425      1097      Class:3      0.937     0.850     0.892     17162      Class:4      0.529     0.177     0.265       311      accuracy                          0.832     23136    macro avg      0.517     0.515     0.488     23136 weighted avg      0.856     0.832     0.838     23136  Are there other metrics that evaluate per-class so I can evaluate my model across more metrics than precision/recall/f1? The goal is to assess the model on a per-class basis.