Suppose I have a base class:  public class A {     public float someValue;      &lt;Access Modifier Here&gt; float SomeValue {         get {             return someValue;         }     } }   And I want to derive from it:  public class B : A {     public float SomeProperty {         get {             return SomeValue;         }     } }   What access modifier would I use if I want to make the SomeValue property only available to the deriving class and not anywhere else?
All my college years I have been using public, and would like to know the difference between public, private, and protected?  Also what does static do as opposed to having nothing?
What is the fastest way to convert float to int on x86 What is the fastest way you know to convert a floating-point number to an int on an x86 CPU.  Preferrably in C or assembly (that can be in-lined in C) for any combination of the following:   32/64/80-bit float -> 32/64-bit integer   I'm looking for some technique that is faster than to just let the compiler do it. 64 bit enum in C++? Is there a way to have a 64 bit enum in C++?  Whilst refactoring some code I came across bunch of #defines which would be better as an enum, but being greater than 32 bit causes the compiler to error.  For some reason I thought the following might work:  enum MY_ENUM : unsigned __int64   {       LARGE_VALUE = 0x1000000000000000,   }; Why does `find` not delete the files it found? I'm trying to understand why the find command is not deleting files in one particular case. I've got the following command:  find C:\\path\\to\\Pictures\\pmcctv -name cap_*.jpg -o -name cap_*.ogg -o -name cap_*.flv -o -name cap_*.mp4 -o -name cap_*.webm -mtime +7   Which returns the files I would expect:  C:\path\to/Pictures/pmcctv/cap_20160915T193251_620067800.jpg C:\path\to/Pictures/pmcctv/cap_20160915T193322_742708800.jpg C:\path\to/Pictures/pmcctv/cap_20160916T081046_394767500.jpg C:\path\to/Pictures/pmcctv/cap_20160916T081125_615129600.jpg C:\path\to/Pictures/pmcctv/cap_20160916T081129_503678200.jpg C:\path\to/Pictures/pmcctv/cap_20160916T081255_842394600.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161008_693586800.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161012_749396800.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161043_774132200.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161150_497251900.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161154_437379600.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161337_350955300.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161341_452596000.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161412_870774000.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161443_969064400.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161554_468109900.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161558_378086000.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161916_668433100.jpg   Now if I try to run the same command with -delete, the files are not deleted:  find C:\\path\\to\\Pictures\\pmcctv -name cap_*.jpg -o -name cap_*.ogg -o -name cap_*.flv -o -name cap_*.mp4 -o -name cap_*.webm -mtime +7 -delete   I've also tried with -exec rm, but they are also not deleted:  find C:\\path\\to\\Pictures\\pmcctv -name cap_*.jpg -o -name cap_*.ogg -o -name cap_*.flv -o -name cap_*.mp4 -o -name cap_*.webm -mtime +7 -exec rm {} \;   find returns no error and the files are owned by me with permissions 644.  Any idea what could be causing this?  (note: I've cut the commands to make it more readable but normally there's no line break) Minimum eigenvalue and singular value of a square matrix How to show that the relationship $\left | \lambda_{min} \right | \geq \sigma_{min}$ holds between the minimum eigenvalue and singular value of a square matrix $A \in \mathbb{C}^{n \times n}$? Splitting a semicolon-separated string to a dictionary, in Python Total order on complex numbers I've just happened to read this  on MO (that of course has been closed) and some of the answers to a similar  on MSE.   I know almost nothing of nonstandard analysis and was asking myself if something like the sentence « $1- 0.999 \dots$ is a nonzero positive infinitesimal» could be easily expressed and proved in nonstandard analysis.  First of all, what is 0.999... ? If we take the usual definition as a series or as a limit of a sequence of rationals, then it will still be a real number and equal to $1$ (I guess by "transfer principle", but please correct me if I'm wrong).  Instead, let's define  $$0.9_N:=\sum_{i=1}^N 9\cdot 10^{-i} $$  where $N\in{}^*\mathbb{N}\setminus\mathbb{N}$ is an infinite nonstandard natural number. This $0.9_N$ is a legitimate element of ${}^*\mathbb{R}$, expressed as $0.$ followed by an infinite number of "$9$" digits.  What can be said about $\epsilon_N:=1-0.9_N$ ? Is there an elementary proof that $\epsilon_N$ is a positive infinitesimal of ${}^*\mathbb{R}$ ? (by "elementary" I mean just order and field axioms and the intuitive facts about infinitesimals, like that for $x$ infinite $1/x$ is infinitesimal etc.; no nonprincipal ultrafilters &amp; C). population and subsamples : mean equality? I want to perform a two sample test, to see whether theirs means are equals. One of the sample is rather big (#60000 values) and represents the scores of a whole population. This population is partitioned in small classes of less that 1000 people. The other sample of the test is a subsamble of the former. It corresponds to people of the same class. So, each time, there is less than 1000 values in it. I have no idea about the variances, so I'd think of using Welch's t-test.  But I'm concerned regarding the independence hypothesis: can it be valid, considering that the second sample is negligible when compared to the overall population? Is there any way to accept only numeric values in a JTextField? My dev team is getting ready to start a new project. The shop has been a "VB shop" since the days of VB3, but the prevailing opinion now is that we're a ".NET shop" and since C# was created specifically for .NET, whereas VB.NET was a retrofit, we've decided to move forward writing C# only. The controversy revolves around the question of whether the Microsoft.VisualBasic namespace has a legitimate place in new development or if it is only for backward compatibility for VB6 (and older) code. A further, and more interesting question is whether the code "under" the Microsoft.VisualBasic namespace is even .NET code of if it is really the old VB runtime carefully packaged in a .NET wrapper, making it in fact a COM interop control (similar to how WinForms wraps the non-.NET Win32 windowing API but exposes only .NET APIs for consumption).  To make this even more confusing, our dev team has a Microsoft Consulting Services consultant telling us Microsoft no longer supports Visual Basic, including the VB runtime underlying the Microsoft.VisualBasic namespace.  What I'm looking for are links -- preferably to unimpeachable Microsoft sources -- to documentation that definitively answers this question one way or the other. I've already tried several search permutations on Google and not gotten any closer to getting to the bottom of this question.  EDIT: Apparently I didn't make my question clear. I'm not asking if VB.NET is true .NET code. I'm trying to determine if whatever is "under" the Microsoft.VisualBasic namespace is .NET code or if it's the old VB6 runtime carefully packaged and exposed as .NET code. Someone already said that 9/10 of the namespace simply wraps code from elsewhere in .NET; what about that other 1/10? I have a query to insert a row into a table, which has a field called ID, which is populated using an AUTO_INCREMENT on the column. I need to get this value for the next bit of functionality, but when I run the following, it always returns 0 even though the actual value is not 0:  MySqlCommand comm = connect.CreateCommand(); comm.CommandText = insertInvoice; comm.CommandText += "\'" + invoiceDate.ToString("yyyy:MM:dd hh:mm:ss") + "\', " + bookFee + ", " + adminFee + ", " + totalFee + ", " + customerID +  ")"; int id = Convert.ToInt32(comm.ExecuteScalar());   According to my understanding, this should return the ID column, but it just returns 0 every time. Any ideas?  EDIT:  When I run:  "INSERT INTO INVOICE (INVOICE_DATE, BOOK_FEE, ADMIN_FEE, TOTAL_FEE, CUSTOMER_ID) VALUES ('2009:01:01 10:21:12', 50, 7, 57, 2134);last_insert_id();"   I get:  {"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'last_insert_id()' at line 1"} Transform the NFSA with transition table Transform the NFSA with transition table  $$\begin{array}{ccc} X&amp;a&amp;b\\ A&amp;\{\}&amp;\{F\}\\ B&amp;\{\}&amp;\{\}\\ F&amp;\{\}&amp;\{A,S\}\\ S&amp;\{F\}&amp;\{A,F\} \end{array}$$  and starting state $S$ inta a DFSA and give the transition table of that DFSA. Place the letter $X$ (uppercase) in the top left corner of the matrix. Your states in the first column and inputs in the first row can be in the order of your choice.  The question then offers a $7\times 3$ matrix to be filled in.  Unsure how to transform the NFSA with transition table.  This is my answer but it is incorrect.  $$\begin{array}{ccc} X&amp;a&amp;b\\ \{S\}&amp;\{F\}&amp;\{A,F\}\\ \{F\}&amp;\{\}&amp;\{A,S\}\\ \{A\}&amp;\{\}&amp;\{F\}\\ \{A,F\}&amp;\{\}&amp;\{A,F,S\}\\ \{A,S\}&amp;\{F\}&amp;\{A,F\}\\ \{A,F,S\}&amp;\{F\}&amp;\{A,F,S\} \end{array}$$ My internet connection used to be a direct LAN connection to my provider. Back then, everything would load fine on both Windows and Ubuntu (dual boot). However, a while ago they started needing me to dial (PPPoE) using a username and password. Gateway, subnet mask, IP, DNS servers all stayed the same. But since then, I haven't been able to browse certain websites on Ubuntu, even though there have been no such issues on Windows. Some example websites are -  (although share.ovi.com loads fine, and nokia.com loads fine),  (works on Chrome(ium) and Opera but not on Firefox (both 3.6 and 4)) Mozilla  and other random websites.  Some of the websites that don't load show timeout messages and for some websites (like the moz addons one), the browser will keep trying to load without an end (I've left it like that even for hours but not noticed anything different happen).  I have tried changing the DNS servers to public ones. I have even tried booting from a Fedora LiveCD and then changing the DNS to those (and even to the ones of OpenDNS), but the exact same thing happens. What could be inherently wrong with some config within Linux itself that is causing this problem?  Does anyone know why this is happening and how it can be fixed?  Note: This question has been  on SU, but not gotten any responses.  Update: Just saw  that someone else was having similar problem and solved it by putting a NetworkManager.conf file in /etc/NetworkManager. What needs to be in that file? I've noticed a MATCH SIMPLE and MATCH FULL, but I don't understand what they do. I see default is MATCH SIMPLE; but, how do the other MATCH clauses to the FOREIGN KEY constraint function? What is the difference between class and instance attributes? I have a complex integral $$\int_{|z|=r}x \, dz$$ for the positive portion of the circle.  I know that this integral seems easy enough but I am having trouble with it, and I'm fairly certain my answer is incorrect.  I wanted to use a parameter such that $x=r\cos\theta$, so we then have $dz=dx+i\,dy=dx$ since there is no reason to have have the $i\,dy$ since the imaginary part is equal to $0$.  So now I have the double integral  $$\int^r_0\int^\pi_0 r \cos\theta \, dx$$  which equals $0$ since integration the $\cos\theta$ gives $\sin\theta$ and evaluated from $0$ to $\pi$ makes the integral evaluate to $0$.  Am i misinterpreting part of the question?  Way off base?  The book suggests to also solve the problem by realizing $x=\frac{1}{2}\left(z+\frac{r^2}{z}\right)$ along the circle.  For this portion of the problem I assume that I would integrate the above by $z$ as if it were a normal calculus problem, but I have problems with what to put as upper and lower limits.  Thanks in advance! How to find the inverse modulo $m$? For example: $$7x \equiv 1 \pmod{31} $$ In this example, the modular inverse of $7$ with respect to $31$ is $9$. How can we find out that $9$? What are the steps that I need to do? Update If I have a general modulo equation: $$5x + 1 \equiv 2 \pmod{6}$$ What is the fastest way to solve it? My initial thought was: $$5x + 1 \equiv 2 \pmod{6}$$ $$\Leftrightarrow 5x + 1 - 1\equiv 2 - 1 \pmod{6}$$ $$\Leftrightarrow 5x \equiv 1 \pmod{6}$$ Then solve for the inverse of $5$ modulo 6. Is it a right approach? Thanks. Usage of "would" and "will" Why is a nonstop flight sometimes more expensive than multiple connections? Usually I find a flight I like that uses one or more connections with the same or different companies. In these cases, if the distance between the first and the second connection is not too large, I prefer to go by bus or train and then take the flight. The problem is that sometimes it is more expensive to take the flight in the second airport than to take the flight from the first one. I mean, I'm wondering why sometimes it is more expensive to take only a flight than to take the same flight and another one.  A practical example (and real, you can check with SkyScanner). Imagine I am in Madrid (Spain) and would like to go to Rio de Janeiro (Brazil) on April 1st. The cheapest flight I have found is this:     TAM airlines: MAD -> GRU -> GIG : 507 €   Fantastic! GRU is one of São Paulo's airports. That's perfect for me! I'll go on to Rio traveling overland. But then, I look for this flight (MAD -> GRU, non-stop):     TAM airlines: MAD -> GRU : 597 €   It's the same flight, 90 € more expensive! I've found this kind of behavior a lot of times and I'm intrigued to know why it happens. I have a VB background and I'm converting to C# for my new job.  I'm also trying to get better at .NET in general.  I've seen the keyword "T" used a lot in samples people post.  What does the "T" mean in C#?  For example:  public class SomeBase&lt;T&gt; where T : SomeBase&lt;T&gt;, new()   What does T do? Why would I want to use it?