This line:  enum commandLine : int   should define following enums as int but no, it does not. What is wrong here?  using System;  enum commandLine : int {     DRIVELETTER = 0,     URL } namespace not_int {     class Program     {         static void Main(string[] args)         {             String driveLetter;              driveLetter = args[commandLine.DRIVELETTER]; //  Cannot implicitly convert type 'commandLine' to 'int' ... Yes You Can!             driveLetter = args[(int)commandLine.DRIVELETTER]; // This works but feels like talking to a grown-up like he was a child:             // You see, here we have an integer but to you it looks like an integer of a different type. Here I tell you it's an integer of the type you want, like your candies ...             // This way you are happy like with your friday candy ...         }     } }
If I have the following enum:  public enum ReturnValue{     Success = 0,     FailReason1 = 1,     FailReason2 = 2     //Etc... }   Can I avoid casting when I return, like this:  public static int main(string[] args){     return (int)ReturnValue.Success; }   If not, why isn't an enum value treated as an int by default?
Should you choose the MONEY or DECIMAL(x,y) datatypes in SQL Server? I'm curious as to whether or not there is a real difference between the money datatype and something like decimal(19,4) (which is what money uses internally, I believe).  I'm aware that money is specific to SQL Server. I want to know if there is a compelling reason to choose one over the other; most SQL Server samples (e.g. the AdventureWorks database) use money and not decimal for things like price information.    Should I just continue to use the money datatype, or is there a benefit to using decimal instead? Money is fewer characters to type, but that's not a valid reason :) GOTO still considered harmful? Having links relative to root? After swapping the positions of the hour and the minute hand, when will a clock still give a valid time? At 12 o'clock, the hour hand and minute hand of the clock can be swapped, and the clock still gives the same time, but at 6 o'clock, it can not be swapped. So in what cases when we swap the hour and the minute hand position does a clock still give a valid time? Find the equation of the plane knowing that it passes through 3 points the and thee (I prefer to pronounce it as thuh all the time) My question is can I always pronounce THE with thuh instead of thee? Because unlike "a" "an" rule, pronouncing "thee" seems cumbersome for some people (including me) Note that I know the "emphasis" and "vowel, consonant" rule about THE but I still prefer to pronounce it as thuh everytime. So can I?? The question at hand is:  "Two capacitors of capacitances $C_1$ and $C_1$ have charge $Q_1$ and $Q_2$. How much energy, $\Delta w$, is dissipated when they are connected in parallel. Show explicitly that $\Delta w$ is non-negative."  I'm confused about what the physical situation is. I took the assumption that these capacitors were somehow pre-charged, and then connected to each other in parallel without a voltage source. However, I don't understand how this would work. If a circuit is composed of only 2 elements, I don't see how they could be in any arrangement but series. Nevertheless, I tried solving it that way:  Two capacitors in parallel have the same voltage drop. Charge will be redistributed to make it the same voltage for both. Let $Q_1'$ and $Q_2'$ be the charges on the capacitors after they are connected. Now, picture the equivalent capacitor  $C_{eq} = C_1 + C_2 =$ $\frac{Q_1' + Q_2'}{V_f}$   conservation of charge:  $Q_1' + Q_2'= Q_1 + Q_2$,        $C_{eq} =$ $\frac{Q_1 + Q_2}{V_f}$  $V_f = $$\frac{Q_1 + Q_2}{C_1 + C_2}$  The initial energy of the capactiors is:  $U_0 = $$\frac{Q_1^2}{2C_1}$$+\frac{Q_2^2}{2C_2}$  $U_f = $$\frac{1}{2}$$(C_1 + C_2)V_f^2 = $$\frac{(Q_1 + Q_2)^2}{2(C_1 + C_2)}$  $\Delta U$$ = $$\frac{(Q_1 + Q_2)^2}{2(C_1 + C_2)}$-$\frac{Q_1^2}{2C_1}$$-\frac{Q_2^2}{2C_2}$  However, I don't see how this is necessarily non-negative. "Try Ubuntu" option is not dislayed I created a live USB using Unetbootin (distribution: ubuntu 12.04 ) from the alternate installation ISO, but while booting "try ubuntu" option is not displayed in Unetbootin menu. Is there any way to try this ubuntu distribution without installing ? Is it posible to add iframe directly in lightning components? Is it possible to add iframe directly in a lightning component as below to visible in community sites ?  &lt;aura:component implements="forceCommunity:availableForAllPageTypes" access="global" &gt;     &lt;iframe width="800" height="600" style="border: 1px solid" src="---" /&gt; &lt;/aura:component&gt; Calculate the area on a sphere of the intersection of two spherical caps Given a sphere of radius $r$ with two spherical caps on it defined by the radii ($a_1$ and $a_2$) of the bases of the spherical caps, given a separation of the two spherical caps by angle $\theta$, how do you calculate the surface area of that intersection?   To clarify, the area is that of the curved surface on the sphere defined by the intersection. At the extreme where both $a_1,a_2 = r$, we would be describing a spherical lune.   Alternatively define the spherical caps by the angles  $\Phi_1 = \arcsin(a_1/r)$ and $\Phi_2 = \arcsin(a_2/r)$. $\int_0^\infty \frac{\log(x)}{x^2+\alpha^2}$ using residues I'm trying to find $\int_0^\infty \frac{\log(x)}{x^2+\alpha^2}dx$ where $\alpha&gt;0$ is real.  My approach was to take an integral along the real line from $1/R$ to $R$, around the circle counterclockwise to $-R$, along the real line to $-1/R$, and then around the circle clockwise to $1/R$.  I have encountered 2 problems with this:   This path encloses one pole, at $z=\alpha i$.  I found the residue at $z=\alpha i$ to be $\frac{\ln(\alpha)+i\pi/2}{2\alpha i}$.  However, this gives me that $\int_0^\infty \frac{\log(x)}{x^2+\alpha^2}dx=\frac{\pi(\ln(\alpha)+i\pi/2)}{2\alpha}$.  Since I have a real function integrated over the real line, there cannot be an imaginary part.  Where did I go wrong?  (Also, doing a few examples, the correct answer seems to be $\frac{\pi\ln(\alpha)}{2\alpha}$, the same as I have but without the imaginary part.) At first chose my path so instead of going all the way around the upper semicircle, it only went 3/4 of the way around, as I wanted to avoid anything that might go wrong with the discontinuity of $\log(x)$ at the negative real axis.  When I do this, though, I get a different answer than before (the denominator of the fraction is $\alpha(1-e^{3\pi i/4})$ instead of $2\alpha$.  What am I doing wrong that gives me different answers? remote ssh tcpdump command, through a gateway, to be opened, in realtime, in Wireshark, on local machine I (Host A - Windows based using plink) am trying to connect to a remote linux server (Host C), through a gateway linux server (Host B), and run this tcpdump on Host C to be piped all the way back to Host A (through Host B I assume), and opened, in real time, with Wireshark on Host A:  Below is what I saw as the command when not using a gateway ("direct remote fetch").  So, how would I make this work going through my gateway host B scenario above?  Host A$ plink.exe -ssh -pw abc123 root@Host C "tcpdump -s0 -U -n -w - -i eth0 not port 22" | "C:\Program Files\Wireshark\Wireshark.exe" -k -i - How do you make samba follow symlink outside the shared path This is Ubuntu server 10.04 64 and samba 3.4.7.  I have a shared directory /home/mit/share and another one /home/temp that I link into the shared one:  ln -s /home/temp /home/mit/share/temp   But on windows, after using internet, I cannot open S:/temp, but on Linux it is possible to access /home/mit/share/temp like expected.   This works if I link directories inside /home/mit/share/temp, so I guess samba is restricting to jump with a link outside/above the shared directory.   EDIT:  See also this question titled .  It seems best to put unix extensions = no into the global section and follow symlinks = yes and wide links = yes only into the shares section, where you really need it.  The unix extension flag has to live in the global section and not in the individual shares sections. But for security reasons it is better to use the other options only where you need it, and not globally. I read on  that Ubuntu will no longer use the familiar file size units we all know by now (kB, MB, GB, TB) and switch to a different IEC standard (KiB, MiB, GiB, TiB). If this is true, I would like to know what's the reasoning behind this change, and the impact (if any) this change has, especially with multiplatform applications or applications run with Wine. Deriving Newton's Third Law from homogeneity of Space What's the difference between struct and class in .NET? I want to shrink my second (LVM) partition, in order to create a new partition in the newly freed space. I am using the Live CD to do so, because I know I can't resize/move this partition while it is in use. When I opened GParted in the Live CD, I realized that I could not resize the partition, because when I right-click it, the option "resize/move" is disabled.  I tried to unmount it, to "lazy" unmount it (umount -l /dev/sda2) but it didn't work.  A screenshot from GParted: I'm suppose to prove the following...  Let $A$ be a nonempty subset of $\mathbb{R}$. If $\alpha = \sup A $ is finite show that for each $ \epsilon &gt; 0 $ there is an $a \in A $ such that $\alpha - \epsilon &lt; a\leq \alpha $.  This is what I have so far...  Proof: We claim that $\alpha = \sup A $   Then by definition of a supremum $\alpha $ is the least upper bound of set A  Thus $\forall a \in A$,  $a \leq \alpha$   Suppose $\epsilon &gt; 0$   Then $\alpha - \epsilon &lt; \alpha $.   Thus $\alpha - \epsilon &lt; a\leq \alpha$.   I feel like I'm missing some step between my last and second to last step so what am I forgetting? Also is the rest of my proof right? A Hilbert space is, by definition, a complete inner product space. If $(V,|.|)$ is finite dimensional inner product space of dimension $n$ then it is (topologically) isomorphic to $\mathbb{R}^n$ which is of course complete. My instinct here is to say "and therefore, $V$ is also a Hilbert space". I'm not sure about this step however since completeness depends on the norm and the norm depends on the selected inner product (assuming the induced norm $||x|| = (x | x)^{1/2}$ is used). So, must we place some condition on the inner product or is the topological isomorphism between $\mathbb{R}^n$ enough to guarantee that V is Hilbert? Correct way of mounting a Windows share I mounted a Windows share to my Ubuntu 11.10 system via adding the following line to the /etc/fstab:  //serveraddr/sharedfolder /mnt/foldername/ smbfs credentials=/home/myname/.smbpasswd 0 0  using the .  But there's a problem with the permissions. The owner of the mount folder is root. I can not create any folders or files in the mounted point is I don't become the root. Even I can not change the ownership to my default user via   sudo chown -R myname .  I googled and saw that it might stem from the fact that Windows file formats (fat32/ntfs) can not save ownership. But when I connect to the same location via samba as   smb://serveraddr/sharedfolder  by providing my credentials, I have the privileges to write without being the root.  How can I make it to let me write to the mounted folder?