I have a table "Applies" with one of its attribute "applicantNum".  Is there a way to set a constraint to check the value inside a domain has less than 5 repeated value?  E.g.  insert into applies(applicantNum) values ('s12345');&lt;-- 1st insertion insert into applies(applicantNum) values ('s12345');&lt;-- 2nd insertion insert into applies(applicantNum) values ('s12345');&lt;-- 3rd insertion insert into applies(applicantNum) values ('s12345');&lt;-- 4th insertion insert into applies(applicantNum) values ('s12345');&lt;-- 5th insertion insert into applies(applicantNum) values ('s12345'); &lt;-- error
I'm trying modeling things like this using oracle:  An account can have 1~5 members  So I'll have a account table and a member table with a FK of account. But is that possible to check if the account have less than 5 members?  I've tried constraint and trigger but oracle doesn't allow sub queries in constraint or condition of trigger like  CHECK( SELECT ...) or IF count(*) &gt;= 5  which make things getting hard.
Get the generated SQL statement from a SqlCommand object? I have the following code:  Using cmd As SqlCommand = Connection.CreateCommand     cmd.CommandText = "UPDATE someTable SET Value = @Value"     cmd.CommandText &amp;= " WHERE Id = @Id"     cmd.Parameters.AddWithValue("@Id", 1234)     cmd.Parameters.AddWithValue("@Value", "myValue")     cmd.ExecuteNonQuery End Using   I wonder if there is any way to get the final SQL statment as a String, which should look like this:  UPDATE someTable SET Value = "myValue" WHERE Id = 1234   If anyone wonders why I would do this:   for logging (failed) statements for having the possibility to copy &amp; paste it to the Enterprise Manager for testing purposes Everyone knows that Wolverine's adamantium claws are super-sharp — sharper than even a razor — and virtually indestructible. What puzzled me the first time I saw Wolverine is: how do the claws stay in his body?  As it is shown, Wolverine's flesh and skin are human in strength, but the healing factor makes it superhumanly durable and strong. Still, when Wolverine slashes something, or someone, extremely hard, dense, or thick (as he has to use great amount of force), the claws don't tear through his hand and leave his hand through the opposite side of the palm (because of the action having equal and opposite reaction). Prove that $\sqrt{10} - \sqrt6 - \sqrt5 + \sqrt3$ is irrational I tried the methods shown in  but I cannot extend them well into 4 numbers. How can I safely create a nested directory in Python? What is the most elegant way to check if the directory a file is going to be written to exists, and if not, create the directory using Python? Here is what I tried:  import os  file_path = "/my/directory/filename.txt" directory = os.path.dirname(file_path)  try:     os.stat(directory) except:     os.mkdir(directory)         f = file(filename)   Somehow, I missed os.path.exists (thanks kanja, Blair, and Douglas). This is what I have now:  def ensure_dir(file_path):     directory = os.path.dirname(file_path)     if not os.path.exists(directory):         os.makedirs(directory)   Is there a flag for "open", that makes this happen automatically? How to see python symbolic names of objects on cursor hover of menu items in Blender 2.8 in Blender 2.79 one could hover over a UI element and see the symbolic python name of said element. How would one accomplish the same with Blender >= 2.8? I am looking for QGIS function to extract (or detect) edge from a raster, which was referred in here,  as answer by @MappaGnosis.  The name could have changed since then, or it may have been integrated into other tool... I cannot find it in my QGIS Processing Toolbox (2.14.10 and 2.18.2).  There are similar tools such as GRASS "i.zc Zero-crossing" and SAGA "Gaussian filter", but I am hoping to find this QGIS geoalgorithm. Recently, I was wondering how division of aleph numbers would work. First, I thought about how finite cardinality division would work. What I came up with was that the result of $A/B$ where $A$ and $B$ are both cardinalities, is the number of times that each element of $B$ had to be mapped to an element of $A$ in order to ensure that all elements of $A$ were mapped to.  Extending this to aleph numbers, specifically, I thought that $\aleph_1/\aleph_0$ would be $\aleph_1$. The reasoning behind this is that there are an infinite ($\aleph_1$) number of real numbers between any two natural numbers. As such, that mapping would need to be applied.  Can anyone validate this idea? Is this how division of aleph numbers actually works, or am I totally off base?  Thanks. Rounded caps on a Bezier Curve pipe This may be a simple question.  Essentially I am procedurally generating random 3D figures using a bezier curve and bezier circle bevel object, however, one of the only things I can't figure out how to do is how to round the end caps of the object.   I have tried using a taper object like suggested  but have had only limited success.  This is about as close as I've gotten:   I should note that all of this is done through Python and I'm not modeling any of this by hand. So any suggestions for how I can make the rounded caps programmatically would be greatly appreciated. With the exception of multiclassing, is there any big reason that if you were to change the spellcasting ability of a (spellcasting) class it would be a bad idea?  As a specific example: Let's say I was switching Sorcerers from Cha to Wis, what unexpected effects could this have on that class's balance? Additionally let's assume all places in spellcasting where you added your charisma modifier instead you now add wisdom (and vice-versa). I installed Ubuntu on a Dell XPS 13 laptop that had Windows 10 preinstalled on it. I installed it from a USB flash drive on a partition. When I boot my computer I can only boot into Windows 10 and Ubuntu is nowhere to be seen.  If I boot into my USB then I can see that Ubuntu is installed, but I can't get to it from the BIOS boot menu. Rstudio is duplicating commands in the command line Commuting: How to carry office clothing so it doesn't get crushed? I have the bike, I have the best route; but now I want to know, how do I transport my clothing in each day? I typically wear suit pants and a business shirt, but not a suit jacket.   Am I better off leaving my clothes at work, or is there a special bag that would let me carry in shirt/pants without them getting crushed? Filesystem shows /dev/nvme0n1p1 instead of /dev/sda I installed a dual boot of Ubuntu 16.04 (Windows being my other OS) two months ago to try it out. I want to allot more space to it on my hard drive. I was looking up tutorials, and I noticed that my filesystem names don't look anything like those in the tutorials. For example:  df -h   outputs:    How would I allot more space to Ubuntu (in layman's terms)? Difference estimate & confidence intervals for $\chi^2$ test between 2 proportions I am using a chi-sq test between two proportions (). I am using this over the z-test for proportions because I do not think my data is normal.   My question is how do I get the difference (shift) estimate &amp; confidence intervals for this test.   For example,     Data1: 193/252=.77   Data2: 154/227=.68   P-value=.032 (I used the formula in the link above. I will also add my exact code below)  Shift Estimate: I assume its the difference between proportions, ie .77-.68=.09. Is this correct?   Confidence Interval: ??????????????????  Code for generating P-value (matlab):   % Pooled estimate of proportion  p0 = (n1+n2) / (N1+N2); % Expected counts under H0 (null hypothesis)  n10 = N1 * p0;  n20 = N2 * p0; % Chi-square test, by hand  observed = [n1 N1-n1 n2 N2-n2];  expected = [n10 N1-n10 n20 N2-n20];  chi2stat = sum((observed-expected).^2 ./ expected);  p = 1 - chi2cdf(chi2stat,1);  H=0; if(p&lt;.05), H=1; end Try Ubuntu - Where does it store my files? I am wondering, when you select the option of just "Try Ubuntu" instead of installing, where does Ubuntu store the files that you download / copy / save?  I right click in the Home folder, and it specified I had 4GB free space. Where did it get this 4GB space from, and if I transition to another OS system, how can I access or delete all the previous data from the session of "Try Ubuntu"?  Thank you! Reprojecting MODIS-Sphere ESRI GRID file to WGS84 using QGIS/GDAL I have an ESRI GRID file projected in MODIS-Sphere (here's the dataset ) that I need to convert to a WGS84 GeoTIFF.  I tried Raster > Projections > Warp (Reproject) and got this nonsense:   I then thought I'd use the MODIS reprojection tool or HEG to convert it, but they only accept HDF files and using QGIS' warp or translate functions to convert this file to HDF throwns an error. This guy was trying to do the same thing in Arc, no joy:   I looked for clues in the metadata, and the file seems a little goofy; gdalinfo yields:  Driver: AIG/Arc/Info Binary Grid Files: seto_uf        seto_uf.aux        seto_uf/.aux.xml        seto_uf/.DS_Store        seto_uf/dblbnd.adf        seto_uf/hdr.adf        seto_uf/log        seto_uf/metadata.xml        seto_uf/sta.adf        seto_uf/vat.adf        seto_uf/w001001.adf        seto_uf/w001001.tif        seto_uf/w001001.tif.aux.xml        seto_uf/w001001x.adf Size is 7468, 2911 Coordinate System is `' Origin = (-17345341.010356999933720,8423784.764957003295422) Pixel Size = (5000.000000000000000,-5000.000000000000000) Corner Coordinates: Upper Left  (-17345341.010, 8423784.765)  Lower Left  (-17345341.010,-6131215.235)  Upper Right (19994658.990, 8423784.765)  Lower Right (19994658.990,-6131215.235)  Center      ( 1324658.990, 1146284.765)  Band 1 Block=256x4 Type=Byte, ColorInterp=Undefined   Description = Seto_UF   Min=0.000 Max=101.000    NoData Value=255   So it can't determine the coordinate system.  There's a .tif included in the directory, but gdalinfo on that shows:  Driver: GTiff/GeoTIFF Files: w001001.tif        w001001.tif.aux.xml Size is 7468, 2911 Coordinate System is: GEOGCS["Unspecified datum based upon the GRS 1980 Authalic Sphere",     DATUM["unknown",         SPHEROID["unnamed",6371007,1]],     PRIMEM["Greenwich",0],     UNIT["degree",0.0174532925199433],     AUTHORITY["EPSG","4047"]] Origin = (-17345341.010356999933720,8423784.764957003295422) Pixel Size = (5000.000000000000000,-5000.000000000000000) Metadata:   AREA_OR_POINT=Area Image Structure Metadata:   INTERLEAVE=BAND Corner Coordinates: Upper Left  (-17345341.010, 8423784.765)  Lower Left  (-17345341.010,-6131215.235)  Upper Right (19994658.990, 8423784.765)  Lower Right (19994658.990,-6131215.235)  Center      ( 1324658.990, 1146284.765)    So it says the units are degrees but those huge corner coordinates and origin values don't agree.  Any ideas?  My setup: OSX 10.9.4 QGIS 2.6.1 Brighton GDAL 1.11.2 (apparently there are newer versions but this is the latest you can get on OSX without having to compile it yourself) I played around with it for a while, but I simply can't figure it out.  I made a tank that fires missiles, and when the missiles hit the walls, I want them to bounce off, but I want them to bounce off to the right angle.  Right now I haven't got any obstacles, the missiles just bounce off when they get outside the viewportRectangle I made.  Is the solution I'm looking for quite advanced?  Is there a relativly simple way to do it? How do I drop an object to the sand? Rotate group of objects over an edge Why do people buy stocks that pay no dividend? Before recently, Apple Inc. did not give dividend to shareholders.  This makes me curious why people buy Apple Inc. stocks; while it might be due to the expectation of selling stocks at a higher price, this can only be possible if other people are thinking the same, thereby increasing demand. But the stocks themselves do not pay interests - so Apple's amazing revenue/profit records would not matter....