In C# is a generic method that works on int and uint not possible because the generic type must be a class and not a primitive or is this only on constraints?  public decimal shift&lt;T&gt;(T input, byte b) where T : int, uint {    ///.... }   Is there anyway to make this work without the constraints?  public decimal shift&lt;T&gt;(T input, byte b)   {    ///.... }   When I do the latter, I get further but still error out on a bit shift operation on the int or uint. It's as though, it doesn't know what type it is at run time.
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
Where can the viewport clipping parameters be changed? Zooming in to inspect texture details in 3D view clips some closer faces like shown in the image. It's not the camera view so changing camera settings doesn't help.   Where can the distance to the clipping plane be adjusted? How many ways can we let people into a movie theater if they only have half-dollars and dollars? My interest in combinatorics was recently sparked when I read about the many things that the Catalan numbers count, as found by Richard Stanley. I picked up a copy of Brualdi's Combinatorics, and while browsing the section on counting sequences I found a nice little puzzle that has definitely puzzled me.     Let $m$ and $n$ be nonnegative integers with $n\geq m$. There are $m+n$ people in line to get into a theater for which admission if $50$ cents. Of the $m+n$ people, $n$ have a $50$-cent piece and $m$ have a $\$ 1$ dollar bill. The box offices opens with an empty cash register. Show that the number of ways the people can line up so that change is available when needed is   $$ \frac{n-m+1}{n+1}\binom{m+n}{m}. $$     I first noted that the first person to enter must be one of the $n$ with a half-dollar. Now the register has a half-dollar change. The second person can be either a person with a half-dollar or a dollar. In the first case, the register will now have two half-dollars, in the second case, the register will now have one dollar bill. So it seems to me that when one of the $n$ people with a half-dollar enters, the number of half-dollars in the register increases by $1$, and when one of the $m$ people with a bill enters, the number of half-dollars decreases by $1$ but the number of bills increases by $1$.   I tried to model this by looking at paths in $\mathbb{Z}^2$. The $x$-axis is like the number of half-dollars, and the $y$-axis is the number of bills. You start at $(0,0)$, and you can take steps forward $(1,0)$ or backwards diagonally $(-1,1)$ corresponding to who enters, but you must always stay in the first quadrant of the plane without crossing over the axes. The goal is to make $m+n$ moves, and I figured maybe the number of such paths is counted by $\frac{n-m+1}{n+1}\binom{m+n}{m}$, but I'm not sure how to show this. I don't know if this observation simplifies the problem at all, as I don't know how to finish up. I'd be happy to see how this problem is done, thank you. Prove that an infinite ring with finite quotient rings is an integral domain How can we show that if $R$ is an infinite commutative ring and $R/I$ is finite for every nonzero $I \unlhd R$, then $R$ is an integral domain?   I tried proceeding by contradiction: assume $a$,$b$ $\in R \backslash \{0\}$ and $ab=0$; then $R/(a)$ and $R/(b)$ must be finite, say $R/(a)=\{k_i + (a) : 1 \leq i \leq m\}$ and $R/(b)=\{l_j + (b) : 1 \leq j \leq n\}$. Does this mean $R$ must be finite? Or what about using the fact that $R/(a,b)$ finite?  Thanks for any help with this! "wait on" or "wait for"? Officials are waiting on autopsy results for Oscar-winning actor Philip Seymour Hoffman. New York police suspect a drug overdose, possibly heroin.   I am curious about the preposition on in the sentence, because I usually say "wait for" instead of "wait on". Does it still have the same meaning if I change on to for? Just as follows:     Officials are waiting for autopsy results for Oscar-winning actor Philip Seymour Hoffman. New York police suspect a drug overdose, possibly heroin. Correcting projection of 360° content onto a sphere - distortion at the poles I'm using the Autopano Giga 4.4 and Autopano Video Pro 2.6 to stitch and create spherical content, but I've recently moved into wanting to create 360° tours via Unity. I know this is partly a developers question, but if anyone out there can help me with the right specs for exporting a spherical image or video from Giga to use to create the image for the inside of the sphere on Unity, I'd appreciate it!  Experimenting with Premiere and FCPX to edit highlight reels of spherical content, I've had seamless experiences created. For some reason in Unity, the images appear to be stretched around the sphere wrong and it's creates issues on the top and bottom of the image:    The image shown is the bottom of the sphere. I'm using the Android platform to hopefully turn these tours into apps when completed. Thank you for any help! Calculation of number density from material density Material density is given by $ \rho =m/V$, where $m$ is mass and $V$ is volume. Again number density given by $n=N/V$, where $N$ is the total number of particle. How can I calculate number density $n$ from material density $ \rho $. I am looking for a book about "advanced" classical mechanics. By advanced I mean a book considering directly Lagrangian and Hamiltonian formulation, and also providing a firm basis in the geometrical consideration related to these to formalism (like tangent bundle, cotangent bundle, 1-form, 2-form, etc.).  I have , but I would like to go into more details about the [symplectic] geometrical and mathematical foundations of classical mechanics.  Additional note: A chapter about relativistic Hamiltonian dynamics would be a good thing. Let $G$ be a finite group and $N$ a normal subgroup of $G$ of index $4$. Prove that $G$ has a subgroup of index $2$ (hence normal) and if $G/H$ is not cyclic then $G$ is equal to the union of three proper subgroups.   I understand that $G/H$ is isomorphic to $\mathbb{Z}_4$ or $\mathbb{Z}_2\times \mathbb{Z}_2$. Let $K^*$ be a subgroup of $G/H$ of order $2$. Then $K^*\cong K/H$ for some $K$ such that $H$ is normal in $K$ and hence $[G:K]=[G/H:K/H]=4/2=2$.  If $G/H$ is not cyclic then $G/H\cong \mathbb{Z}_2\times \mathbb{Z}_2$. I don't know how to prove $G$ is the union of three subgroups. Could it be true that as $G/H$ is the union of three proper subgroups $K_1^*,K_2^*,K_3^*$ then the corresponding groups $K_1,K_2,K_3$ have union equal to $G$? Would anyone give me a hint to prove this?  Thank you. Will the Garbage Collector call IDisposable.Dispose for me? How do you set the expiry date or a maximum age in the HTTP headers for static resources in IIS A is similar to $A^k$, then each eigenvalue of $A$ is a root of unity Let $A \in \mathbb{C}(n,n)$ and $k \geq 2$ be an integer such that $$A \sim A^k$$. Show that if $A$ is non-singular then each eigenvalue of $A$ is a root of unity.   Attempt: Since $A \sim A^k$, $$PA = A^kP$$ where $P$ is an invertible matrix. Since $A$ is invertible, $0$ cannot be an eigenvalue of $A$. Suppose $$Av = \lambda v \quad v \neq 0$$ then $$PAv = \lambda Pv$$ $$\therefore A^k(Pv) = \lambda (Pv) $$ but this implies that $Pv$ is an eigenvector of $A$. But the eigenvalues of $A^k$ are $\lambda^k$ $$\therefore \lambda^k=\lambda$$ which gives the conclusion required.   My questions is: Is the logic correct? If so, Am I missing any details? If not, then how could I approach this?   Thanks! Using the simple example below, what is the best way to return results from multiple tables using Linq to SQL?  Say I have two tables:  Dogs:   Name, Age, BreedId Breeds: BreedId, BreedName   I want to return all dogs with their BreedName.  I should get all dogs using something like this with no problems:  public IQueryable&lt;Dog&gt; GetDogs() {     var db = new DogDataContext(ConnectString);     var result = from d in db.Dogs                  join b in db.Breeds on d.BreedId equals b.BreedId                  select d;     return result; }   But if I want dogs with breeds and try this I have problems:  public IQueryable&lt;Dog&gt; GetDogsWithBreedNames() {     var db = new DogDataContext(ConnectString);     var result = from d in db.Dogs                  join b in db.Breeds on d.BreedId equals b.BreedId                  select new                         {                             Name = d.Name,                             BreedName = b.BreedName                         };     return result; }   Now I realize that the compiler won't let me return a set of anonymous types since it's expecting Dogs, but is there a way to return this without having to create a custom type?  Or do I have to create my own class for DogsWithBreedNames and specify that type in the select?  Or is there another easier way? Python super() raises TypeError In Python 2.5, the following code raises a TypeError:  &gt;&gt;&gt; class X:       def a(self):         print "a"  &gt;&gt;&gt; class Y(X):       def a(self):         super(Y,self).a()         print "b"  &gt;&gt;&gt; c = Y() &gt;&gt;&gt; c.a() Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt;   File "&lt;stdin&gt;", line 3, in a TypeError: super() argument 1 must be type, not classobj   If I replace the class X with class X(object), it will work. What's the explanation for this? Using swap space instead of RAM can drastically slow down a PC.  So why, when I have more than enough RAM available, does my Linux system (Arch) use the swap?  Checkout my conky output below:    Also, could this be the cause of speed and system-responsiveness issues I'm having?  Output of free -m :  $ free -m              total       used       free     shared    buffers     cached Mem:          1257       1004        252          0         51        778 -/+ buffers/cache:        174       1082 Swap:          502        144        357 What is scientific mind? How can you define scientific mind? What i think , it is a bend of mind that can be developed by any person(also one not related to field of science).This mind is fulfilled with abilities to observe clearly and sceptical about what he sees.It means the person will be keen to dig out truth and did not reaches to a conclusion easily. He utilizes facts enhance them with logical reasoning and fills the gap with their imagination.  Is there any disadvantage or any kind of limitation with scientific mind? Has confinement been experimentally observed? So, confinement has obviously been shown by lattice gauge theory to be a predicted aspect of QCD. However, to what extent has it been observed in experimental physics? Ampscript date range lookup I want to use LookupOrderedRows and return rows between a start and end date (last month range). What is the best way to handle using Ampscript?   I can add one date to the where using   "DateField", @varStartDate,   But if I add the below to add additional where filters  "DateField", @varStartDate,"DateField", @varEndDate,   I get this error:     "Duplicate Key Field Name: DateField"   EDIT: Also I tried the range as the var for the LookupOrderedRows using   set @strRange = StringToDate(Format(DateDiff(@strStartDate, @strEndDate, "M"),"MM/dd/yyyy"))  and then in the LookupOrderedRows just using  "DateField", @strRange  But that got an error as well. Parsing Command Prompt Output I am retrieving disk information via JavaScript with the wmic statement, wmic logicaldisk get freespace,name,size,volumename, which produces the following output, but in a single string.    "FreeSpace      Name  Size           VolumeName  " "560232755200   C:    999526756352   System      " "999369699328   D:    999558213632   SSD         " "1511570386944  E:    8001545039872  Get         " "4620751712256  F:    8001545039872  BR          " "788449492992   G:    4000650883072  Seen        " "2296009408512  H:    4000768323584  Seen 2      " "3594248679424  I:    8001545039872  2160        " "3507750227968  J:    8001545039872  1080        " "945300619264   K:    999625322496   Trailers    "   I parse the above output with the following JavaScript.  window.onload = function(){   const cp = require('child_process')   let drives   cp.exec('wmic logicaldisk get freespace,name,size,volumename', (error, stdout)=&gt;{     drives = stdout.trim().split('\r\r\n')       .map(value =&gt; value.trim().split(/\s{2,0}/))       .slice(1)   }) }   That JavaScript already produces my desired output. It produces an array of nested arrays. Each row of information in the command prompt output corresponds to a nested array. Each nested array has four values that correspond to the originally queried data points.  [   ["560232439808",  "C:", "999526756352",  "System"  ]   ["999369699328",  "D:", "999558213632",  "SSD"     ]   ["1511570386944", "E:", "8001545039872", "Get"     ]   ["4620751712256", "F:", "8001545039872", "BR"      ]   ["788449492992",  "G:", "4000650883072", "Seen"    ]   ["2296009408512", "H:", "4000768323584", "Seen 2"  ]   ["3594248679424", "I:", "8001545039872", "2160"    ]   ["3507750227968", "J:", "8001545039872", "1080"    ]   ["945300619264",  "K:", "999625322496",  "Trailer" ] ]   I am wondering whether or not there is a way to similarly parse the information, but with command prompt instead? What are all the marriages and child relationships following the final chapter? In the last chapter of Naruto, some characters got married, and some of them had kids. What is the entire husband-wife-kids set? The supremum norm is submultiplicative Is the following proof correct:  Let $X$ be a compact Hausdorff space and $C(X)$ the space of continuous functions $f: X \to \mathbb{C}$. We can equip $C(X)$ with the (edit: sorry, semi-)norm $\lVert f \rVert_\infty = \sup_{x\in X} |f(x)|.$ I want to prove that for $f,g \in C(X)$, $\lVert fg \rVert_\infty \leq \lVert f \rVert_\infty \lVert g \rVert_\infty $. Let $z \in X$ be arbitrary then $$ \lvert f(z)g(z) \rvert \leq \lvert   \; \sup_{x} \lvert f(x) \rvert  g(z)  \;\rvert=\sup_{x} \lvert f(x) \rvert  \lvert    g(z)\rvert \leq \sup_{x} \lvert f(x) \rvert  \sup_{y} \lvert g(y) \rvert.  $$  Since $z$ was arbitrary $$ \sup_{z} f(z)g(z)\leq \sup_{x} f(x) \sup_{y} g(y) $$  that is the sought.