I want to make a class that contains basic arithmetical operations with one generic type (it have to be struct) but I can't limit the generic type with something that make sure compiler that this type will be able to do arithmetical operations. Simple example: T Sum&lt;T&gt;(T x, T y) { return x + y; }Error: Operator &quot;+&quot; can't be used on T operands. Using limitation lead to the same problem:T Sum&lt;T&gt;(T x, T y) where T: struct { return x + y; }What name of the class/interface that contains signatures for basic arithmetical operations that I can use in where construction to make sure compiler that generic type will have ability to work with arithmetical operations? I coudln't even find it in .NET documentaion.
Can anyone tell me if there is a way with generics to limit a generic type argument T to only:   Int16 Int32 Int64 UInt16 UInt32 UInt64   I'm aware of the where keyword, but can't find an interface for only these types,  Something like:  static bool IntegerFunction&lt;T&gt;(T value) where T : INumeric
What part of speech is there in the sentence “There is a book on the table?”  Also, while typing it out, another question pops up vis-à-vis punctuation. In my complete first sentence above, I ended it with a question mark since my main sentence is a question. The quote is not a question, but it looks like it because of the question mark. Is this the right way to punctuate? Is there a definition of  and proper explanation of it?  It is said "Electric charge is the physical property of matter that causes it to experience a force when close to other electrically charged matter."  How is it though that matter can get charged?  Defining charge as the property of feeling a force with other charged matter seems circular.  What is charge?  Is there a non-circular definition / explanation? SCP through multiple hosts describes how to SSH into a machine that can only be accessed through one or more hosts (that can also be SSH'd into).  Is there an equivalent way of using scp? That is, copy a file to my local machine from the far machine (assuming I have password or key access to all machines along the way)? Confused AUC ROC score I am working on binary classification problem, I try to evaluate the performance of some classification algorithms (LR,Decission Tree , Random forest ...). I am using  a cross validation technique (to avoid over-fitting) with AUC ROC as scoring function to compare the performance of the algorithms, but I am getting a weird results with Random forest and AdbBoost, I have a perfect AUC_ROC score (i.e. =1) despite the fact that the recall(TPR) and FPR of this algorithms are different from 1 and 0 respectively .  def FPR(y_true, y_pred):     tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()     result = fp / (fp+tn)     return result def FNR(y_true, y_pred):     tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()     result = fn / (tp+fn)     return result FPR_scorer = make_scorer(FPR) FNR_scorer = make_scorer(FNR)     def get_CrossValResults2(model,cv_rst,bestIndx):     best=pd.DataFrame.from_dict(cv_rst).iloc[bestIndx]     roc=&quot;{:.12f}&quot;.format(best['mean_test_roc_auc'])     acc =&quot;{:.0%}&quot;.format(best['mean_test_accuracy'])     prec =&quot;{:.0%}&quot;.format(best['mean_test_precision'])     rec =&quot;{:.0%}&quot;.format( best['mean_test_recall'])     f1 =&quot;{:.0%}&quot;.format(best['mean_test_f1'])     r2=&quot;{:.2f}&quot;.format(best['mean_test_r2'])     g_mean=&quot;{:.2f}&quot;.format(best['mean_test_gmean'])     pr_auc=&quot;{:.8f}&quot;.format(best['mean_test_pr'])     fnr=&quot;{:.0%}&quot;.format(best['mean_test_fnr'])     fpr=&quot;{:.0%}&quot;.format(best['mean_test_fpr'])     rst = pd.DataFrame([[ model, acc,prec,rec,fpr,fnr,f1,roc,pr_auc,g_mean,r2]],columns = ['Model', 'Accuracy', 'Precision', 'Recall','FPR','FNR', 'F1-Score','ROC_auc','PR_auc','gmean','r2'])     return rst        cross_val_rst = pd.DataFrame(columns = ['Model', 'Accuracy', 'Precision', 'Recall','FPR','FNR', 'F1-Score','ROC_auc','PR_auc','gmean','r2'])              scoring = {'accuracy':'accuracy','recall':'recall','precision':'precision','fpr':FPR_scorer,'fnr':FNR_scorer,'f1':'f1' ,'roc_auc':'roc_auc','pr':'average_precision','gmean':Gmean_scorer,'r2':'r2'}     param_grid = {'n_estimators': [200],               'max_depth': [80,90],               'min_samples_leaf': [2,3, 4],             'min_samples_split': [2,5,12],             'criterion': [ 'gini'],              'class_weight' : [class_weights], 'n_jobs' : [-1]}  clf = GridSearchCV(RandomForestClassifier(class_weight=class_weights), param_grid, cv=kfold,scoring=scoring,refit=refit)#Fit the model bestmodel = clf.fit(X,Y)       cross_val_rst = cross_val_rst.append(get_CrossValResults2(model='Random Forrest',bestIndx=bestmodel.best_index_,cv_rst=bestmodel.cv_results_),ignore_index=True) Compute $\frac{1}{e}\sum\limits_{n=0}^{\infty}\frac{n^{k}}{n!}$ for $k=0, 1, 2 ... $ Using some matlab (I know it's cheating) I found that: $$k=0 =&gt; Result=1$$ $$k=1 =&gt; Result=1$$ $$k=2 =&gt; Result=2$$ $$k=3 =&gt; Result=5$$ $$k=4 =&gt; Result=15$$ $$k=5 =&gt; Result=52$$ $$k=6 =&gt; Result=203$$  This sequence is puzzling... It seems to me that my costlier (Tamron 90 f/2.8 macro) lens gives better colors than my cheap Canon 18-55 IS kit lens.  So does lens matter for color quality? What physical processes are involved in that? Listings - Only highlight between delimiters I want to implement a function name color highlighting and I use the listings package. My 'regex' for this is def %s( where def (including space) is the first delimiter %s is the function name and ( is the second delimtier. Now my aim is to color only %s in purple. So basically I want to only touch the part between the delimiters and the delimiters should stay untouched.  Here is what I tried so far:  \documentclass{article} \usepackage{xcolor,listings} \usepackage[ngerman]{babel} \usepackage{fontspec} \setmonofont{Courier New}  \begin{document}  \lstset{language=Python,     escapebegin=\color{orange},     keywordstyle=\color{blue}\bfseries,     commentstyle=\color{orange!80!red},     stringstyle=\ttfamily\color{gray},     %moredelim = [is][\color{blue}\bfseries def \mdseries\color{purple}]{def\ }{(},     moredelim = [s][\color{purple}]{def\ }{(},     showstringspaces=false}‎ \lstset{literate=%    *{0}{{{\color{red}0}}}1     {1}{{{\color{red}1}}}1     {2}{{{\color{red}2}}}1     {3}{{{\color{red}3}}}1     {4}{{{\color{red}4}}}1     {5}{{{\color{red}5}}}1     {6}{{{\color{red}6}}}1     {7}{{{\color{red}7}}}1     {8}{{{\color{red}8}}}1     {9}{{{\color{red}9}}}1 }  ‎‎\begin{lstlisting}[basicstyle=\ttfamily,mathescape] def fancy_function_name(page_url = 'tex.stackexchange.com'):     return page_url.split('.')[0] \end{lstlisting}  \end{document}   This code will generate:   You can see that it matches the right place but is too greedy and colors the delimiters too. So I thought about the uncommented line: %moredelim = [is][\color{blue}\bfseries def \mdseries\color{purple}]{def\ }{(}, If I use this one and uncomment the line below I get this result:    It's nearly what I wan't but I cannot add the last, now missing ( in black color.  Does anyone has a solution for this without pretouching the code and add all the @@ symbols? Can someone help me out and explain or point me in the right direction on how to check video drivers and see if my video card running okay?  I had 10.04 installed on my Thinkpad r61 with Compiz Manager and life was great, until the machine took water damage. I bought an ASUS (X54H) since and am trying out 12.04, but the desktop just doesn't look right.  I always struggled with video driver installation. There are no proprietary drivers available in the hardware manager.  When I run lspci | grep VGA:  00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)   I will greatly appreciate your help. I want to use Linux more, but like I said video drivers appear to be my biggest concern. I have also tried 12.04 on my desktop PC, but again failed to configure video card, so switched back to Windows 7. Guest (not logged in) users can only sort questions with specific tag by newest I think this is platform wide (all SE sites).   Logout Choose a tag, eg.  on SO Try to sort questions by something other than newest   No matter what sorting is chosen, questions are sorted by newest As we all know, air consists of many gases including oxygen and carbon dioxide. I found that carbon dioxide is heavier than O2. Does the volume difference neglect the mass difference? Is it same for all other gases in air or is there another force that keeps all of these gases together?  If I take a breath of a fresh air, will the exhaled air be heavier because of its higher CO2 content? Will it fall on the floor? How to completely remove virtual packages? It turns out that removing a virtual package with apt-get only remove the package itself,  leaving behind the real packages that were installed by it  So how do you remove a virtual package, along with all the real packages that it installs? I had this problem a week or two ago and I posted here but nothing from the suggested solutions seemed to work. I have managed to get some more details on it, in case anyone can help me, because this issue is causing me huge productivity problems and I really want it solved.  So I'm using Linux mint distribution, and I've installed Lyx via the software manager. Every time that I open a new document, I get an error claiming that some files are missing, and until they are installed, compiling the files or exporting them as pdfs is not possible. The file in question is called "extarticle.cls". Additionally, under Document->Settings->Document Class, every document class is marked as unavailable.  Here is the thing though.. this file is not missing... I have located it inside a folder associated with Lyx. It's definitely not missing.  I really need help with this one guys... It's been weeks since the problem came up and I really just want to be rid of it.. Why does this thing not work? Any help? I know that non-married lovers address each other by saying “This is my girlfriend/boyfriend.” I know that married couples address each other by calling “my wife/husband”.  I also know that gay lovers who are not married (yet?) address each other by saying "my boyfriend" (for gays) and "my girlfriend" (for lesbians).  But if they are married, how do they address each other?  And how do we describe them? I mean if they are gays, are they “husband and husband” or “husband and wife” (one of them acts like the wife)? And if they are lesbians, are they “wife and wife” or “husband and wife” (one of them acts as the husband)?  I know they can be referred to as a gay couple or gay lovers from , but I couldn't find the answer to address each of the two. How to enable or disable a user? I'm uing ubuntu 12.04 desktop. I have 3 users: user1(administrator), user2(standard) and guest. I wanted to disable user1 and enable user2 which auto logs on with no password but after I did that I can't login to user1 and user2 accounts except the guest session user. I'm striped off every administrative privileges. I don't know which options are available to me and how do I enable root or user which is an administrator? TL;DR: how does an Ubuntu flavor iso installation ( for example Lubuntu ) differ from installing a desktop package via apt-get ? (for instance sudo apt-get install lubuntu-desktop)  Context for the question:   Some time ago I answered a question on AskUbuntu , where I tested in virtual machine removing unity-desktop and installing ubuntu-gnome-desktop. That makes the boot logo ( plymouth ) change, desktop changes, different packages get installed (gnome-network-manager instead of network-manager , if I am not mistaken). It appeared that in effect I've switched to different Ubuntu flavor, even though I started out with the standard Ubuntu system. Hence the question: what differentiates the pre-made Ubuntu flavor iso from installing a package ? Is it all the same base underneath the hood or does installation from iso have specific configurations ? If it's possible to install a flavor via package manager, why then separate flavor iso's exist ? (obvious answer is user convenience, but I think there has to exist other reasons. Canonical is a business , and it makes not a lot of sense for a business to provide additional flavor iso , if a sysadmin or end-user can get the same thing via package manager by themselves). Medium with refractive index less than unity? Allow cross-site queries in data explorer I think it would be useful if we could join across databases in the data-explorer.  For example, I'd like to query up a list of questions that I had a hand in migrating away from SO, and see what percentage of them were subsequently closed or re-migrated.  I realise I could download the various data dumps and do this on my own machine, but it would be nice if it were allowed on the online version.  Is this possible/practical? I've just been searching around the net for version control that has some support for graphic/Photoshop files. We're currently using BitBucket which is free and unlimited when it comes to file size but doesn't have any design review tools.  Here's what I've found. Does anyone else have any recommendations?  Pixelapse – Free/Beta, works well. Now has layer comp support.   Shipment – Private Beta (waiting for an invite)   LayerVault (out of business) – Windows/Mac, has layer comp support   PixelNovel – SVN Version control for Photoshop   CAD only?! But looks really good.   FileTrek – Very enterprise. No price or demo.   Kaleidoscopeapp – GIT with image compare   Apps that copy files with an incremented version I know, it's been asked before but I couldn't really get a satisfying answer for some details/backgrounds and I guess it's an important question for many.    Some application seem only to be running with Adobe Flash 15 (or at least I know it does, because I have that version on my Windows Partition).  The official Adobe website says:     NOTE: Adobe Flash Player 11.2 will be the last version to target Linux as a supported platform. Adobe will continue to provide security backports to Flash Player 11.2 for Linux.   Some search on the web like "Ubuntu Adobe Flash 15" or similar does not return any good websites.  I found something that says   (using a "pepper-based version"), and  .   Is it impossible to use this for Firefox too? Would it be a privacy risk?  Are there no alternative projects (I know it's closed source but there are so many so very bright people out there using something similar to wine but just for the plugin....)?  How about the Mac-Version? Shouldn't someone be able to port that one to Linux? How to suppress Terminated message after killing in bash?